Browse Source

修改级联情况问题,输入类型判断

shaun-sheep 5 years ago
parent
commit
ebd2edf71f

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

@@ -95,7 +95,7 @@
         oInput.remove()
       },
       handleName(val) {
-        return val.length > 12 ? val.substr(1, 12) + '...' : val
+        return val.length > 12 ? val.substring(0, 12) + '...' : val
       }
     }
   }

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

@@ -86,7 +86,7 @@
         oInput.remove()
       },
       handleName(val) {
-        return val.length > 12 ? val.substr(1, 12) + '...' : val
+        return val.length > 12 ? val.substring(0, 12) + '...' : val
       }
     }
   }

+ 18 - 0
src/views/ledger/cenotelist/cenoteDetail/index.vue

@@ -121,6 +121,7 @@
       this.$router.push({name: "cenotelist"});
     },
     getData() {
+
       let params1 = {
         data: {
           Orders: "sort asc",
@@ -177,11 +178,28 @@
     displayData(arr) {//对数据进行处理传给组件展示
       const result = {}
       arr.forEach(i => {
+
         if (this.instance.hasOwnProperty(i.Path) && this.currentRadio != 2) {
           i.value = this.instance[i.Path]
         }
         if (i.DataSource && i.DataSource.length) {
           let source = JSON.parse(i.DataSource)
+          //判断输入类型
+          if (i.InputMode == 'D1L') {
+            let d1l = tools.formatDataSource(i.DataSource)
+            d1l.forEach(k => {
+              if (k.Code == this.instance[i.Path]) {
+                i.value = k.Name
+              }
+            })
+          } else if (i.InputMode == 'D2' || i.InputMode == 'C6') {
+            if (this.instance.hasOwnProperty(i.Path)) {
+              if (!Array.isArray(this.instance[i.Path])) {
+                let transArray = this.instance[i.Path].split(',')
+                i.value = source.filter(item => transArray.includes(item.Code)).map(item => item.Name).join(',')
+              }
+            }
+          }
           source.forEach(j => {
             if (j.Code == this.instance[i.Path]) {
               console.log(j.Name)

+ 16 - 0
src/views/ledger/facility/details/index.vue

@@ -347,6 +347,22 @@
           }
           if (i.DataSource && i.DataSource.length) {
             let source = JSON.parse(i.DataSource)
+            //判断输入类型
+            if (i.InputMode == 'D1L') {
+              let d1l = tools.formatDataSource(i.DataSource)
+              d1l.forEach(k => {
+                if (k.Code == this.instance[i.Path]) {
+                  i.value = k.Name
+                }
+              })
+            } else if (i.InputMode == 'D2' || i.InputMode == 'C6') {
+              if (this.instance.hasOwnProperty(i.Path)) {
+                if (!Array.isArray(this.instance[i.Path])) {
+                  let transArray = this.instance[i.Path].split(',')
+                  i.value = source.filter(item => transArray.includes(item.Code)).map(item => item.Name).join(',')
+                }
+              }
+            }
             source.forEach(j => {
               if (j.Code == this.instance[i.Path]) {
                 console.log(j.Name)

+ 16 - 0
src/views/ledger/property/details/index.vue

@@ -288,6 +288,22 @@
           }
           if (i.DataSource && i.DataSource.length) {
             let source = JSON.parse(i.DataSource)
+            //判断输入类型
+            if (i.InputMode == 'D1L') {
+              let d1l = tools.formatDataSource(i.DataSource)
+              d1l.forEach(k => {
+                if (k.Code == this.instance[i.Path]) {
+                  i.value = k.Name
+                }
+              })
+            } else if (i.InputMode == 'D2' || i.InputMode == 'C6') {
+              if (this.instance.hasOwnProperty(i.Path)) {
+                if (!Array.isArray(this.instance[i.Path])) {
+                  let transArray = this.instance[i.Path].split(',')
+                  i.value = source.filter(item => transArray.includes(item.Code)).map(item => item.Name).join(',')
+                }
+              }
+            }
             source.forEach(j => {
               if (j.Code == this.instance[i.Path]) {
                 console.log(j.Name)

+ 18 - 3
src/views/ledger/spacelist/spaceDetail/index.vue

@@ -85,7 +85,6 @@
   import selectRadio from "@/components/ledger/details/detail/selectRadio";
 
 
-
   export default {
     data() {
       return {
@@ -211,7 +210,7 @@
       Promise.all([promise1, promise2]).then(values => {
         this.pointData = values[0].Content;
         this.exampleData = values[1].Content[0];
-        debugger
+
         let obj = this.deepCopy(values[1].Content[0]);
         obj = tools.flattenKeys(obj);
         this.instance = obj;
@@ -366,9 +365,25 @@
         }
         if (i.DataSource && i.DataSource.length) {
           let source = JSON.parse(i.DataSource)
+          //判断输入类型
+          if (i.InputMode == 'D1L') {
+            let d1l = tools.formatDataSource(i.DataSource)
+            d1l.forEach(k => {
+              if (k.Code == this.instance[i.Path]) {
+                i.value = k.Name
+              }
+            })
+          } else if (i.InputMode == 'D2' || i.InputMode == 'C6') {
+            if (this.instance.hasOwnProperty(i.Path)) {
+              if (!Array.isArray(this.instance[i.Path])) {
+                let transArray = this.instance[i.Path].split(',')
+                i.value = source.filter(item => transArray.includes(item.Code)).map(item => item.Name).join(',')
+              }
+            }
+          }
           source.forEach(j => {
             if (j.Code == this.instance[i.Path]) {
-              console.log(j.Name)
+              console.log(j.Name, '===name===')
               i.value = j.Name
             }
           })

+ 16 - 0
src/views/ledger/system/systemDetail/index.vue

@@ -344,6 +344,22 @@
 
         if (i.DataSource && i.DataSource.length) {
           let source = JSON.parse(i.DataSource)
+          //判断输入类型
+          if (i.InputMode == 'D1L') {
+            let d1l = tools.formatDataSource(i.DataSource)
+            d1l.forEach(k => {
+              if (k.Code == this.instance[i.Path]) {
+                i.value = k.Name
+              }
+            })
+          } else if (i.InputMode == 'D2' || i.InputMode == 'C6') {
+            if (this.instance.hasOwnProperty(i.Path)) {
+              if (!Array.isArray(this.instance[i.Path])) {
+                let transArray = this.instance[i.Path].split(',')
+                i.value = source.filter(item => transArray.includes(item.Code)).map(item => item.Name).join(',')
+              }
+            }
+          }
           source.forEach(j => {
             if (j.Code == this.instance[i.Path]) {
               console.log(j.Name)