Browse Source

1,提取出关键信息点
2,处理有些信息未展示问题
3,处理图片问题,eg:显示 有 or '-',渲染下载列表

shaun-sheep 5 years ago
parent
commit
3618edea81

+ 36 - 11
src/components/ledger/details/detail/exhibitionBaseInformation.vue

@@ -7,7 +7,6 @@
 'w22':exhibitionBaseInformation.style == 4}"
          style="display: inline-block;margin-left: 20px">
       <span> {{value.InfoPointName}}:</span>
-
       <el-popover
         v-if="value.Value && value.Value.length && value.Value.length>12 && value.Path=='EquipQRCode'"
         placement="top"
@@ -16,21 +15,33 @@
         <p style="border-bottom: 1px solid #eee;padding:2px 0 4px 0;'">{{value.InfoPointName}}</p>
         <div style="overflow:hidden;">
           <div style="float:left;width: 60%">
-          <img
-            style="width:200px;height:200px;"
-            :src="'/image-service/common/file_get/'+ value.Value +'?systemId=dataPlatform'"
-            alt="二维码"
-          >
+            <img
+              style="width:200px;height:200px;"
+              :src="'/image-service/common/file_get/'+ value.Value +'?systemId=dataPlatform'"
+              alt="二维码"
+            >
           </div>
           <div style="float:right;width: 40%;margin-top: 30px">
-          <span>{{value.Value}}</span>
+            <span>{{value.Value}}</span>
           </div>
         </div>
-
         <div style="text-align: center; margin: 0">
           <el-button type="text" size="mini" @click="handleCopy(value.Value)">复制</el-button>
         </div>
-        <el-button slot="reference" type="text">{{handleName(value.Value)}}</el-button>
+        <el-button slot="reference" type="text">{{value.Value ? '有' :'-'}}</el-button>
+      </el-popover>
+      <el-popover
+        v-else-if="Array.isArray(value.Value) && value.InputMode== 'F2'"
+        placement="top"
+        width="250"
+        trigger="hover">
+        <p style="border-bottom: 1px solid #eee;padding:2px 0 4px 0;'">{{value.InfoPointName}}</p>
+        <div v-for="(pic,index) in value.Value">
+          <div>图纸名称:{{pic.Name}}
+              <el-button style="" type="text" size="mini" @click="downloadFile(pic.Key)">下载</el-button>
+          </div>
+        </div>
+        <el-button slot="reference" type="text">{{value.Value? '有':'-'}}</el-button>
       </el-popover>
       <el-popover
         v-else-if="value.Value && value.Value.length && value.Value.length>12"
@@ -44,10 +55,20 @@
         </div>
         <el-button slot="reference" type="text">{{handleName(value.Value)}}</el-button>
       </el-popover>
+      <el-popover
+        v-else-if="Array.isArray(value.Value) || value.InputMode=='N2'"
+        placement="top"
+        width="300"
+        trigger="hover">
+        <p style="border-bottom: 1px solid #eee;padding:2px 0 4px 0;'">{{value.InfoPointName}}</p>
+        <p>{{value.Value}}</p>
+        <div style="text-align: center; margin: 0">
+          <el-button type="text" size="mini" @click="handleCopy(value.Value)">复制</el-button>
+        </div>
+        <el-button slot="reference" type="text">{{value.Value ? '有' :'-'}}</el-button>
+      </el-popover>
       <span v-else>{{value.Value}}</span>
     </div>
-
-
   </section>
 </div>
 </template>
@@ -60,6 +81,10 @@
       return {}
     },
     methods: {
+      downloadFile(key) {
+        window.open("/image-service/common/file_get/" + key + "?systemId=dataPlatform")
+
+      },
       handleCopy(data) {
         let oInput = document.createElement('input')
         oInput.value = data

+ 1 - 1
src/components/ledger/details/detail/exhibitionCrux.vue

@@ -28,7 +28,7 @@
           <div style="text-align: center; margin: 0">
             <el-button type="text" size="mini" @click="handleCopy(item.value)">复制</el-button>
           </div>
-          <el-button slot="reference" type="text">{{handleName(item.value)}}</el-button>
+          <el-button slot="reference" type="text">{{item.value ? '有' :'-'}}</el-button>
         </el-popover>
         <el-popover
           v-else-if="item.value && item.value.length && item.value.length>12"

+ 9 - 5
src/components/ledger/details/detail/lookImage.vue

@@ -5,11 +5,11 @@
         <div v-for="(val,key,i) in exhibitionImage.list" :key="i">
           <div class="point-view" v-for="(j,index) in val">
             <p class="title">{{key}}</p>
-            <div v-if="j.PicList !=undefined && j.PicList.length">
-              <template v-for="(item,index) in j.PicList">
+            <div v-if="j.PicList !=undefined && j.PicList.length >0">
+              <template v-for="item in j.PicList">
                 <div class="point-image">
-                  <img @click="lookImg" :src="imageGetUrl + '&key=' +item.Key" alt v-load>
-                  <p class="pic-name">{{item.Name}}</p>
+                  <img @click="lookImg" :src="imageGetUrl + '&key=' +item.Key" alt v-load style="margin-bottom: 5px">
+                  <p class="pic-name">{{handleName(item.Name)}}</p>
                 </div>
               </template>
             </div>
@@ -43,6 +43,9 @@
       };
     },
     methods: {
+      handleName(val) {
+        return val && val.length > 12 ? val.substr(1, 12) + '...' : val
+      },
       //查看图片
       lookImg() {
         this.dialog.details = true
@@ -262,7 +265,7 @@
     .point-view {
       .pic-name {
         position: absolute;
-        right: 59px;
+        right: 72px;
         display: inline-block;
         background: #fff;
         color: #000;
@@ -274,6 +277,7 @@
     }
     .point-image {
       height: 180px;
+      margin-bottom: 10px;
       position: relative;
       overflow: hidden;
       img {

+ 1 - 1
src/components/ledger/details/detail/lookVideo.vue

@@ -266,7 +266,7 @@
     .point-view {
       .pic-name {
         position: absolute;
-        right: 59px;
+        right: 72px;
         display: inline-block;
         background: #fff;
         color: #000;

+ 1 - 1
src/components/ledger/details/detail/selectRadio.vue

@@ -4,7 +4,7 @@
     <template>
       <el-radio-group
         style=" margin: 0 10px;"
-        v-model="radio"
+        v-model="selectRadio.initRadio"
         @change="changeRadio"
         v-for="(item,index) in selectRadio.radioList"
         :key="index"

+ 1 - 1
src/views/ledger/cenotelist/cenoteDetail/index.vue

@@ -94,6 +94,7 @@
         },
         selectRadio: {
           information: '设备信息点',
+          initRadio: '1',
           radioList: [
             {
               value: '显示需采集信息点',
@@ -202,7 +203,6 @@
           case "L1":
           case "L2":
           case "M":
-          case 'F2':
             break;
           default:
             if (result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`]) {

+ 17 - 18
src/views/ledger/facility/details/index.vue

@@ -130,6 +130,7 @@
         criterias: [], //动态参数
         selectRadio: {
           information: '设备信息点',
+          initRadio: '1',
           radioList: [
             {
               value: '显示需采集信息点',
@@ -214,7 +215,6 @@
           obj = flattenKeys(obj);
           this.instance = obj;
           this.handleRadios(1)
-
           this.pointData.forEach(item => {
             if (item.InputMode == "L" || item.InputMode == "L1" || item.InputMode == "L2" || item.InputMode == "M") {
               let cur = tools.dataForKey(this.exampleData, item.Path);
@@ -260,18 +260,19 @@
       },
       handleRadios(val) { //判断radio的值显示关键信息,基本信息,图片,文件
         let arr = []
+        //关键信息点
+        this.exhibitionCrux.cruxArray = this.pointData.filter(i => i.KeyWord)
+        this.exhibitionCrux.cruxArray.map(i => {
+          if (this.instance.hasOwnProperty(i.Path)) {
+            return {
+              ...i,
+              value: this.instance[i.Path]
+            }
+          }
+        })
         if (val == 1) { //需采集信息
           arr = this.pointData.filter(i => i.Visible)
-          //关键信息点
-          this.exhibitionCrux.cruxArray = arr.filter(i => i.KeyWord)
-          this.exhibitionCrux.cruxArray.map(i => {
-            if (this.exampleData.hasOwnProperty(i.Path)) {
-              return {
-                ...i,
-                value: this.exampleData[i.Path]
-              }
-            }
-          })
+
           //  图片和的处理
           this.handlePicList(arr)
           //  文件处理
@@ -280,10 +281,10 @@
         } else if (val == 2) { //有值信息点
           let list = this.pointData
           list.map(j => {
-            if (this.exampleData.hasOwnProperty(j.Path)) {
+            if (this.instance.hasOwnProperty(j.Path)) {
               return {
                 ...j,
-                value: this.exampleData[j.Path]
+                value: this.instance[j.Path]
               }
             }
             arr = list.filter(k => k.value)
@@ -344,14 +345,12 @@
                 } else {
                   picObject[i.InfoPointName] = []
                 }
-
                 picObject[i.InfoPointName].push({
                   ...i,
                 })
                 break
             }
           }
-
         })
         //展示文件
         this.exhibitionFile.list = picObject
@@ -363,15 +362,14 @@
       displayData(arr) {//对数据进行处理传给组件展示
         const result = {}
         arr.forEach(i => {
-          if (this.exampleData.hasOwnProperty(i.Path) && this.currentRadio != 2) {
-            i.value = this.exampleData[i.Path]
+          if (this.instance.hasOwnProperty(i.Path) && this.currentRadio != 2) {
+            i.value = this.instance[i.Path]
           }
           switch (i.InputMode) {
             case "L":
             case "L1":
             case "L2":
             case "M":
-            case 'F2':
               break;
             default:
               if (result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`]) {
@@ -413,6 +411,7 @@
       },
       // 切换实例
       handleChangeExample() {
+        this.selectRadio.initRadio = '1'
         this.getData();
       },
     },

+ 14 - 11
src/views/ledger/property/details/index.vue

@@ -61,6 +61,7 @@
 
   import {getDataDictionary, queryProperty} from "@/api/scan/request";
   import {mapGetters} from "vuex";
+
   function flattenKeys(obj) {
     let res = {}
 
@@ -114,6 +115,7 @@
         currentRadio: '',//当前选中的select
         selectRadio: {
           information: '设备信息点',
+          initRadio: '1',
           radioList: [
             {
               value: '显示需采集信息点',
@@ -195,18 +197,19 @@
       },
       handleRadios(val) { //判断radio的值显示关键信息,基本信息,图片,文件
         let arr = []
+        //关键信息点
+        this.exhibitionCrux.cruxArray = this.pointData.filter(i => i.KeyWord)
+        this.exhibitionCrux.cruxArray.map(i => {
+          if (this.exampleData.hasOwnProperty(i.Path)) {
+            return {
+              ...i,
+              value: this.exampleData[i.Path]
+            }
+          }
+        })
         if (val == 1) { //需采集信息
           arr = this.pointData.filter(i => i.Visible)
-          //关键信息点
-          this.exhibitionCrux.cruxArray = arr.filter(i => i.KeyWord)
-          this.exhibitionCrux.cruxArray.map(i => {
-            if (this.exampleData.hasOwnProperty(i.Path)) {
-              return {
-                ...i,
-                value: this.exampleData[i.Path]
-              }
-            }
-          })
+
           //  图片和的处理
           this.handlePicList(arr)
           //  文件处理
@@ -306,7 +309,6 @@
             case "L1":
             case "L2":
             case "M":
-            case 'F2':
               break;
             default:
               if (result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`]) {
@@ -348,6 +350,7 @@
       },
       // 切换实例
       handleChangeExample() {
+        this.selectRadio.initRadio = '1'
         this.getData();
       },
     },

+ 11 - 11
src/views/ledger/spacelist/spaceDetail/index.vue

@@ -124,6 +124,7 @@
         iframeSrc: '', //空间详情iframe
         selectRadio: {
           information: '设备信息点',
+          initRadio: '1',
           radioList: [
             {
               value: '显示需采集信息点',
@@ -278,18 +279,18 @@
     },
     handleRadios(val) { //判断radio的值显示关键信息,基本信息,图片,文件
       let arr = []
+      //关键信息点
+      this.exhibitionCrux.cruxArray = this.pointData.filter(i => i.KeyWord)
+      this.exhibitionCrux.cruxArray.map(i => {
+        if (this.exampleData.hasOwnProperty(i.Path)) {
+          return {
+            ...i,
+            value: this.exampleData[i.Path]
+          }
+        }
+      })
       if (val == 1) { //需采集信息
         arr = this.pointData.filter(i => i.Visible)
-        //关键信息点
-        this.exhibitionCrux.cruxArray = arr.filter(i => i.KeyWord)
-        this.exhibitionCrux.cruxArray.map(i => {
-          if (this.exampleData.hasOwnProperty(i.Path)) {
-            return {
-              ...i,
-              value: this.exampleData[i.Path]
-            }
-          }
-        })
         //  图片和的处理
         this.handlePicList(arr)
         //  文件处理
@@ -389,7 +390,6 @@
           case "L1":
           case "L2":
           case "M":
-          case 'F2':
             break;
           default:
             if (result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`]) {

+ 1 - 1
src/views/ledger/system/systemDetail/index.vue

@@ -120,6 +120,7 @@
         currentRadio: '',//当前选中的select
         selectRadio: {
           information: '设备信息点',
+          initRadio: '1',
           radioList: [
             {
               value: '显示需采集信息点',
@@ -365,7 +366,6 @@
           case "L1":
           case "L2":
           case "M":
-          case 'F2':
             break;
           default:
             if (result[`${i.FirstName}${i.SecondName ? '/' + i.SecondName : ''}`]) {