Browse Source

二维码管理显示样式调整

qymljy 4 months ago
parent
commit
72cbd738bd

+ 10 - 10
public/codeToFile.html

@@ -86,22 +86,22 @@
                 .then(function (response) {
                     console.log(response)
                     console.log(response.data.data.length)
-                    response.data.data.forEach(item => {
+                    response.data.data.forEach((item,index) => {
                         const div = document.createElement('div');
                         div.className = 'div-border';
                         let iconSrc = '';
-                        if (item.attinfos[0].postfix == 'word' || item.attinfos[0].postfix == 'Word') {
+                        if (item.attinfos[index].postfix == 'word' || item.attinfos[index].postfix == 'Word') {
                             iconSrc = './img/word.svg';
-                        } else if (item.attinfos[0].postfix == 'pdf' || item.attinfos[0].postfix == 'PDF') {
+                        } else if (item.attinfos[index].postfix == 'pdf' || item.attinfos[index].postfix == 'PDF') {
                             iconSrc = './img/pdfType.svg';
-                        } else if (item.attinfos[0].postfix == 'png' || item.attinfos[0].postfix == 'PNG' || item.attinfos[0].postfix == 'JPG' || item.attinfos[0].postfix == 'jpg') {
+                        } else if (item.attinfos[index].postfix == 'png' || item.attinfos[index].postfix == 'PNG' || item.attinfos[index].postfix == 'JPG' || item.attinfos[index].postfix == 'jpg') {
                             iconSrc = './img/pngType.svg';
-                        }else if (item.attinfos[0].postfix == 'ppt' || item.attinfos[0].postfix == 'PPT') {
+                        }else if (item.attinfos[index].postfix == 'ppt' || item.attinfos[index].postfix == 'PPT') {
                             iconSrc = './img/ppt.svg';
-                        }else if (item.attinfos[0].postfix == 'mp3' || item.attinfos[0].postfix == 'MP3' || item.attinfos[0].postfix == 'MP4' || item.attinfos[0].postfix == 'mp4'
-                            || item.attinfos[0].postfix == 'mov' || item.attinfos[0].postfix == 'MOV') {
+                        }else if (item.attinfos[index].postfix == 'mp3' || item.attinfos[index].postfix == 'MP3' || item.attinfos[index].postfix == 'MP4' || item.attinfos[index].postfix == 'mp4'
+                            || item.attinfos[index].postfix == 'mov' || item.attinfos[index].postfix == 'MOV') {
                             iconSrc = './img/mov.svg';
-                        }else if (item.attinfos[0].postfix == 'EXCEL' || item.attinfos[0].postfix == 'excel' || item.attinfos[0].postfix == 'xlsx' || item.attinfos[0].postfix == 'XLSX') {
+                        }else if (item.attinfos[index].postfix == 'EXCEL' || item.attinfos[index].postfix == 'excel' || item.attinfos[index].postfix == 'xlsx' || item.attinfos[index].postfix == 'XLSX') {
                             iconSrc = './img/excel.svg';
                         } else {
                             iconSrc = './img/default.svg';
@@ -114,8 +114,8 @@
                 `;
                         dataContainer.appendChild(div);
                         div.addEventListener('click', function() {
-                            console.log(item.attinfos[0].url)
-                            downloadFile(item.attinfos[0].url)
+                            console.log(item.attinfos[index].url)
+                            downloadFile(item.attinfos[index].url)
                         });
                     })
                 })

+ 9 - 0
src/HDrpManagement/contactData/components/statisticsOfClues.vue

@@ -121,6 +121,15 @@ export default {
     async chartData(init,state){
       const res = await this.$api.requested(this.paramChart)
       this.chartList = res.data
+      this.chartList = this.chartList.map(item => {
+        return {
+          key: this.$t(item.key),
+          ratio: item.ratio,
+          rowindex: item.rowindex,
+          totalqty: item.totalqty,
+          value: item.value
+        }
+      })
       if (init) {
         this.chartCluesMap = new Pie(this.$refs.statisticsOfCluesChart, {
           appendPadding: 10,

+ 10 - 2
src/HDrpManagement/contactData/components/statisticsOfCustomer.vue

@@ -124,13 +124,21 @@ export default {
     },
     async chartData(init,state){
       const res = await this.$api.requested(this.paramChart)
-      this.chartList = res.data
+      this.chartList = res.data.map(item => {
+        return {
+          key: this.$t(item.key),
+          ratio: item.ratio,
+          rowindex: item.rowindex,
+          totalqty: item.totalqty,
+          value: item.value
+        }
+      })
       if (init) {
         this.chartMap = new Pie(this.$refs.statisticsOfCustomerChart, {
           appendPadding: 10,
           data:this.chartList,
           angleField: 'ratio',
-          colorField: 'key',
+          colorField: this.$t('key'),
           radius: 1,
           innerRadius: 0.64,
           label:{

+ 9 - 1
src/HDrpManagement/contactData/components/statisticsOfFollow.vue

@@ -122,7 +122,15 @@ export default {
     },
     async chartData(init,state){
       const res = await this.$api.requested(this.paramChart)
-      this.chartList = res.data
+      this.chartList = res.data.map(item => {
+        return {
+          key: this.$t(item.key),
+          ratio: item.ratio,
+          rowindex: item.rowindex,
+          totalqty: item.totalqty,
+          value: item.value
+        }
+      })
       if (init) {
         this.chartMap = new Pie(this.$refs.statisticsOfFollowChart, {
           appendPadding: 10,

+ 9 - 1
src/HDrpManagement/contactData/components/statisticsOfProject.vue

@@ -144,7 +144,15 @@ export default {
     },
     async chartData(init,state){
       const res = await this.$api.requested(this.paramChart)
-      this.chartList = res.data
+      this.chartList = res.data.map(item => {
+        return {
+          key: this.$t(item.key),
+          ratio: item.ratio,
+          rowindex: item.rowindex,
+          totalqty: item.totalqty,
+          value: item.value
+        }
+      })
       if (init) {
         this.chartMap = new Pie(this.$refs.statisticsOfProjectChart, {
           appendPadding: 10,