zhaozp 3 anos atrás
pai
commit
4dbded5cbe
5 arquivos alterados com 54 adições e 26 exclusões
  1. 2 1
      config/dev.env.js
  2. 2 2
      config/prod.env.js
  3. BIN
      dist.zip
  4. 6 4
      src/views/index.vue
  5. 44 19
      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"',
-  BASE_API: '"http://39.100.230.190:30047/"',
+  // BASE_API: '"http://39.100.230.190:30047/"',
+  BASE_API: '"http://81.70.84.72:30047/"',
   // BASE_API: '"http://172.18.1.227:30047/"',
   VERSION: '"1.0"',
   TIME_OUT: '"100000"'

+ 2 - 2
config/prod.env.js

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

BIN
dist.zip


+ 6 - 4
src/views/index.vue

@@ -119,7 +119,7 @@
         areas: [],
         stations: [],
         version: process.env.VERSION,
-        word: '',
+        word: '全部点检表',
         infoMessage: ''
       }
     },
@@ -215,8 +215,7 @@
         data['id'] = -1
         this.selectId = -1
         this.leftIndex = -1
-        this.rightTitle = '全部点检表'
-        this.select_template_info_list(data)
+        this.select_template_info_list(data,1)
       },
       async change_index(id,index) {
         this.leftIndex = index
@@ -279,7 +278,7 @@
         sessionStorage.setItem('info',  JSON.stringify(data))
         this.dialogVisible = false
       },
-      async select_template_info_list(data) {
+      async select_template_info_list(data,type) {
         await selectTemplateInfoList(data).then(res=> {
           this.rightList = res.data
           this.infoMessage = ''
@@ -289,6 +288,9 @@
           } else {
             this.rightTitle = this.word
           }
+          if(type) {
+            this.rightTitle = '全部点检表'
+          }
         })
       }
     },

+ 44 - 19
src/views/info.vue

@@ -20,31 +20,33 @@
               <th colspan="2">{{ data.time }}</th>
            </tr>
            <template v-if="data.projectCommonList.length">
-             <tr height="53" v-for="(item,index) in newProjectCommonList">
+            <tr height="53" v-for="(item,index) in newProjectCommonList" :key="index + '1'">
                <th colspan="2">{{ item.commonList[0] | argIfExistName }}</th>
                 <th colspan="2">{{ item.commonList[0] | argIfExistValue }}</th>
-                <th>{{ item.commonList[1] | argIfExistName }}</th>
+               <th>{{ item.commonList[1] | argIfExistName }}</th>
                 <th>{{ item.commonList[1] | argIfExistValue }}</th>
                 <th colspan="3">{{ item.commonList[2] | argIfExistName }}</th>
                 <th colspan="2">{{ item.commonList[2] | argIfExistValue }}</th>
              </tr>
            </template>
-           <tr height="53" v-if="data.projectGroupList.length">
-              <th>序号</th>
-              <th>点检位置</th>
-              <th>项目</th>
-              <th>点检方法</th>
-              <th style="width:16.125rem">点检内容和标准</th>
-              <th style="width:16.125rem">数值</th>
-              <th>可视化参考</th>
-              <th>结果</th>
-              <th>备注</th>
-              <th>图片</th>
-              <th>工程师确认</th>
-           </tr>
+           <!-- <template  v-if="data.projectGroupList.length"> -->
+             <tr height="53">
+                <th>序号</th>
+                <th>点检位置</th>
+                <th>项目</th>
+                <th>点检方法</th>
+                <th style="width:16.125rem">点检内容和标准</th>
+                <th style="width:16.125rem">数值</th>
+                <th>可视化参考</th>
+                <th>结果</th>
+                <th>备注</th>
+                <th>图片</th>
+                <th>工程师确认</th>
+             </tr>
+           <!-- </template> -->
            <template v-if="data.projectGroupList.length">
              <template v-for="(item,index) in data.projectGroupList">
-               <tr height="53" v-for="(iten,indey) in item.projectList"  :key="indey">
+               <tr height="53" v-for="(iten,indey) in item.projectList"  :key="indey + '1'">
                  <th>{{ jisuan(indey) }}</th>
                  <th :rowspan="item.projectList.length" v-if="indey === 0">{{ item.name }}</th>
                  <th>{{ iten.name }}</th>
@@ -73,7 +75,7 @@
                  <th :style="{background: backgroundStyle(iten.status)}">{{ iten.statusValue }}</th>
                  <th>{{ iten.remark }}</th>
                  <th style="display: flex;justify-content: space-evenly;" v-if="iten.fileList.length">
-                   <div v-for="(item,indea) in iten.fileList">
+                   <div v-for="(item,indea) in iten.fileList" :key="indea + '1'">
                      <img style="width:4.5rem;height:6rem;" :src="item.url" alt="" @click="clickImg($event)">
                      <big-img  v-if="showImg" :imgSrc="item.url" @cancelEnlarge="cancelEnlarge"></big-img>
                    </div>
@@ -83,6 +85,21 @@
                </tr>
              </template>
            </template>
+           <template v-else>
+             <tr height="53">
+                <th></th>
+                <th></th>
+                <th></th>
+                <th></th>
+                <th></th>
+                <th></th>
+                <th></th>
+                <th></th>
+                <th></th>
+                <th></th>
+                <th></th>
+             </tr>
+           </template>
         </table>
       </div>
     </div>
@@ -112,16 +129,24 @@
           let commonNum = Math.ceil(res.data.projectCommonList.length/3)
           let projectCommonList = res.data.projectCommonList
           let newProjectCommonList = []
-          for (let i=0;i<commonNum;i++){
+          if(commonNum === 1){
             let data = {}
-            let dataItem = projectCommonList.slice(i*commonNum,(i+1)*commonNum)
+            let dataItem = projectCommonList.slice(0,res.data.projectCommonList.length)
             data['commonList'] = dataItem
             newProjectCommonList.push(data)
+          } else {
+            for (let i=0;i<commonNum;i++){
+              let data = {}
+              let dataItem = projectCommonList.slice(i*commonNum,(i+1)*commonNum)
+              data['commonList'] = dataItem
+              newProjectCommonList.push(data)
+            }
           }
           this.newProjectCommonList = newProjectCommonList
         } else {
           this.$message.error(res.message)
         }
+        // [{'commonList':[]}]
       })
     },
     mounted() {