zhaozhipeng 3 years ago
parent
commit
827d94c29d
7 changed files with 38 additions and 18 deletions
  1. 2 1
      config/dev.env.js
  2. 1 1
      config/prod.env.js
  3. BIN
      dist.zip
  4. 2 4
      src/api/request.js
  5. 2 2
      src/main.js
  6. 9 3
      src/views/index.vue
  7. 22 7
      src/views/info.vue

+ 2 - 1
config/dev.env.js

@@ -4,7 +4,8 @@ const prodEnv = require('./prod.env')
 
 module.exports = merge(prodEnv, {
   NODE_ENV: '"development"',
-  EMBED_API: '"http://blue.cn1.utools.club/api5/"',
+  BASE_API: '"http://39.100.230.190:30047/"',
+  VERSION: '"1.0"',
   // EMBED_API: '"http://39.100.230.190:8089"',
   TIME_OUT: '"100000"'
 })

+ 1 - 1
config/prod.env.js

@@ -1,6 +1,6 @@
 'use strict'
 module.exports = {
   NODE_ENV: '"production"',
-  // BASE_API: '"http://39.100.230.190:8089"',
+  BASE_API: '"http://39.100.230.190:30047/"',
   TIME_OUT: '"100000"'
 }

BIN
dist.zip


+ 2 - 4
src/api/request.js

@@ -1,16 +1,15 @@
 import axios from 'axios'
 import { Message } from 'element-ui';
 import Router from '../router'
-
 /**
  * 使用自定义配置新建一个 axios 实例
  * baseURL = 请求路径
  * timeout = 请求超时配置
  */
 const request = axios.create({
-  // baseURL: process.env.BASE_API,
+  baseURL: process.env.BASE_API,
   // baseURL: 'http://81.70.84.72:30047/',
-  baseURL: 'http://39.100.230.190:30047/',
+  // baseURL: baseUrl+":30047/",
   timeout: process.env.TIME_OUT,
   method: "post",
   type: "JSON"
@@ -74,7 +73,6 @@ request.interceptors.response.use(
     //   Message.error('凭证过期,请重新登录')
     //   Router.push('/')
     // }
-    console.log(response);
     return response.data
   },
   error => {

+ 2 - 2
src/main.js

@@ -12,7 +12,7 @@ import store from './vuex/store';
 // 引入icon
 // import './assets/icon/iconfont.css'
 
-// import touch from 'vue-directive-touch';
+import touch from 'vue-directive-touch';
 
 import axios from 'axios';
 Vue.prototype.$axios = axios;
@@ -22,7 +22,7 @@ Vue.config.productionTip = false;
 // 文件上传域名
 // Vue.prototype.$imgUrl = "http://blue.cn1.utools.club/api1/file/uploadOne
 Vue.use(ElementUI);
-// Vue.use(touch);
+Vue.use(touch);
 // 创建loading
 Vue.prototype.openLoading = function() {
   const loading = this.$loading({           // 声明一个loading对象

+ 9 - 3
src/views/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="main">
-    <div class="title">点检视板</div>
+    <div class="title">点检视板({{version}})</div>
     <div class="top_content">
       <div>{{  nowDate }}</div>
       <div class="top_content_right">
@@ -27,7 +27,7 @@
         </div>
         <template v-for="(item,index) in leftList">
           <div :style="troubled(index)[2]" style="cursor:pointer;flex-direction:column;display: flex;align-items: center;">
-            <img :src="leftIndex === index ? item.selectedIcon : item.defaultIcon" style="width:2.625rem;height:2.625rem;margin-bottom:2%;" @click.stop="change_index(item.id,index)" >
+            <img :src="item.defaultIcon" style="width:2.625rem;height:2.625rem;margin-bottom:2%;" @click.stop="change_index(item.id,index)" >
             <div :style="{color: leftIndex === index ? '#fff' :'#5294FF'}" style="width:60px;text-align: center;">{{ item.name }}</div>
           </div>
         </template>
@@ -117,7 +117,8 @@
         leftList: [],
         rightList: [],
         areas: [],
-        stations: []
+        stations: [],
+        version: process.env.VERSION
       }
     },
     created() {
@@ -221,6 +222,11 @@
         this.selectId = id
         let data = this.searchData
         this.rightTitle = this.leftList[index].name
+        if(this.leftList[index].lingjianming) {
+          this.rightTitle = this.leftList[index].name + '(' + this.leftList[index].lingjianming +')'
+        } else {
+          this.rightTitle = this.leftList[index].name
+        }
         data['id'] = id
         this.select_template_info_list(data)
       },

+ 22 - 7
src/views/info.vue

@@ -1,5 +1,5 @@
 <template>
-  <div id="main">
+  <div id="main" v-touch:right="onSwipeRight">
     <div class="title">
       <div>{{ mainTitle }}</div>
       <div style="width:1.5rem;height:1.5rem;margin-left: 0.625rem;cursor: pointer;" @click="back"><img src="../assets/img/tuichu.png"></div>
@@ -7,6 +7,10 @@
     <div class="content">
       <div class="content_child">
         <table border="1" cellspacing="0" style="width:100%;">
+          <tr height="53">
+            <th colspan="2">零件名</th>
+            <th colspan="9">{{ data.lingjianming || 2 }}</th>
+          </tr>
            <tr height="53">
               <th colspan="2">班次</th>
               <th colspan="2">{{ data.shift }}</th>
@@ -47,10 +51,18 @@
                  <th>{{ iten.method}} </th>
                  <th style="width:16.125rem">{{ iten.standard }}</th>
                  <th style="width:16.125rem;">
-                   <div style="display: inline-block;width:100%;margin: 5px 0;" v-for="(iteo,indez) in iten.projectSubList" :key="indez">
-                     <span>{{ iteo.name }}: </span>
-                     <span>{{ iteo.value ? iteo.value : '无' }}</span>
-                   </div>
+                   <template v-if="iten.projectSubList.length === 1">
+                     <div style="display: inline-block;width:100%;margin: 5px 0;" v-for="(iteo,indez) in iten.projectSubList" :key="indez">
+                       <span>{{ iteo.name }}: </span>
+                       <span>{{ iteo.value ? iteo.value : '无' }}</span>
+                     </div>
+                   </template>
+                   <template v-else>
+                      <div style="display: inline-block;width:50%;margin: 5px 0;" v-for="(iteo,indez) in iten.projectSubList" :key="indez">
+                        <span>{{ iteo.name }}: </span>
+                        <span>{{ iteo.value ? iteo.value : '无' }}</span>
+                      </div>
+                   </template>
                  </th>
                  <th>
                    <template v-if="iten.file.url">
@@ -117,7 +129,7 @@
         data: {},
         mainTitle: '',
         commonNum: 0,
-        newProjectCommonList: []
+        newProjectCommonList: [],
       }
     },
     computed: {
@@ -152,13 +164,16 @@
     },
     methods: {
       clickImg () {
-            this.showImg = true
+         this.showImg = true
       },
       cancelEnlarge () {
         this.showImg = false
       },
       back() {
         this.$router.back()
+      },
+      onSwipeRight() {
+        this.$router.back()
       }
      },
     filters: {