liyongli 4 months ago
parent
commit
1ec69b506c
1 changed files with 51 additions and 47 deletions
  1. 51 47
      src/views/Content/index.vue

+ 51 - 47
src/views/Content/index.vue

@@ -147,7 +147,7 @@
             style="width: 100%"
             :header-cell-style="{
               backgroundColor: '#f4f5f7',
-              color: '#606266',
+              color: '#606266'
             }"
           >
             <el-table-column
@@ -194,7 +194,7 @@
         @sort-change="tableChange"
         :header-cell-style="{
           backgroundColor: '#f4f5f7',
-          color: '#606266',
+          color: '#606266'
         }"
       >
         <el-table-column
@@ -373,7 +373,7 @@ import {
   getContentChart,
   getContentPage,
   getContentTotle,
-  getAppColumn,
+  getAppColumn
 } from '@/api/index';
 
 import countTo from '@/components/counto/vue-countTo.vue';
@@ -385,7 +385,7 @@ import {
   TooltipComponent,
   GridComponent,
   ToolboxComponent,
-  LegendComponent,
+  LegendComponent
 } from 'echarts/components';
 import { CanvasRenderer } from 'echarts/renderers';
 echarts.use([
@@ -395,7 +395,7 @@ echarts.use([
   LineChart,
   CanvasRenderer,
   ToolboxComponent,
-  LegendComponent,
+  LegendComponent
 ]);
 
 import config from '@/config/index';
@@ -411,7 +411,7 @@ export default {
         version: [],
         date: [],
         content: '',
-        client: '',
+        client: ''
       },
       match: '',
       cycle: [],
@@ -421,7 +421,7 @@ export default {
       top: [],
       total: [],
       client: [],
-      appColumn: [],
+      appColumn: []
     };
   },
   async mounted() {
@@ -434,11 +434,11 @@ export default {
       appli,
       appVLi,
       contentli,
-      clentli,
+      clentli
     } = await this.getAppListFunc();
     const keys = {
       value: 'mname',
-      label: 'mname',
+      label: 'mname'
     };
     const clentliList = clentli.find(r => r.mdefault) || false;
     let client = clentliList ? clentliList.mcode.toString() : -1;
@@ -450,7 +450,7 @@ export default {
       clentV,
       {
         value: 'mcode',
-        label: 'mname',
+        label: 'mname'
       },
       true
     );
@@ -465,7 +465,7 @@ export default {
       page: 1,
       size: 20,
       sortBy: '',
-      appColumn: '不限',
+      appColumn: '不限'
     };
     this.onSubmit();
   },
@@ -482,7 +482,7 @@ export default {
       const appColumn = await getAppColumn({
         app: this.form.app || defaultAppNameFunc(this.cycle),
         start,
-        end,
+        end
       });
       const col = appColumn || [];
       this.appColumn = ['不限', ...col];
@@ -494,7 +494,7 @@ export default {
       this.lastParams.page = this.form.page;
       const sortLibType = {
         descending: 1,
-        ascending: 0,
+        ascending: 0
       };
       if (e.order) {
         this.form.order = sortLibType[e.order];
@@ -514,7 +514,7 @@ export default {
         if (verify.length !== 0 && !verify[v.mcode]) continue;
         out.push({
           value: v[obj.value],
-          label: v[obj.label],
+          label: v[obj.label]
         });
       }
       return out;
@@ -539,7 +539,7 @@ export default {
         channelName:
           this.form.appColumn === '不限' || !this.form.appColumn
             ? undefined
-            : this.form.appColumn,
+            : this.form.appColumn
       };
       getContentPage(this.lastParams).then(r => (this.table = r || {}));
       getContentTotle({
@@ -547,7 +547,7 @@ export default {
         end: this.FormData(this.form.date[1]),
         app: this.form.app,
         version: this.form.version == -1 ? undefined : this.form.version,
-        lib: this.form.client == -1 ? undefined : this.form.client,
+        lib: this.form.client == -1 ? undefined : this.form.client
       }).then(r => {
         this.total = r || [];
       });
@@ -557,7 +557,7 @@ export default {
         end: this.FormData(this.form.date[1]),
         version: this.form.version == -1 ? undefined : this.form.version,
         contentType: this.form.content == -1 ? undefined : this.form.content,
-        lib: this.form.client == -1 ? undefined : this.form.client,
+        lib: this.form.client == -1 ? undefined : this.form.client
       })
         .then(r => {
           this.top = r || [];
@@ -569,6 +569,10 @@ export default {
             lib: this.form.client == -1 ? undefined : this.form.client,
             contentType:
               this.form.content == -1 ? undefined : this.form.content,
+            channelName:
+              this.form.appColumn === '不限' || !this.form.appColumn
+                ? undefined
+                : this.form.appColumn
           }).then(resChart => {
             let keyList = [],
               valueList = [],
@@ -599,34 +603,34 @@ export default {
       }
       chart.clear();
       chart.resize({
-        height: (this.$refs.regionChart.offsetWidth * 4) / 16,
+        height: (this.$refs.regionChart.offsetWidth * 4) / 16
       });
       chart.setOption({
         tooltip: {
           trigger: 'axis',
-          confine: true,
+          confine: true
         },
         toolbox: {
           feature: {
             saveAsImage: {
               type: 'jpg',
-              name: '内容分析-' + this.form.app,
-            },
-          },
+              name: '内容分析-' + this.form.app
+            }
+          }
         },
         legend: {
-          data: title,
+          data: title
         },
         grid: {
           left: '3%',
           right: '4%',
           bottom: '3%',
-          containLabel: true,
+          containLabel: true
         },
         xAxis: {
           type: 'category',
           boundaryGap: true,
-          data: keyList,
+          data: keyList
         },
         yAxis: {
           type: 'value',
@@ -641,8 +645,8 @@ export default {
                 val = (val / 10000).toFixed(2) + '万';
               }
               return val;
-            },
-          },
+            }
+          }
         },
         series: valueList.map((v, i) => {
           return {
@@ -650,12 +654,12 @@ export default {
             data: v,
             symbolSize: 0,
             lineStyle: {
-              width: 1,
+              width: 1
             },
             type: 'line',
-            smooth: true,
+            smooth: true
           };
-        }),
+        })
       });
     },
     async getAppListFunc() {
@@ -692,7 +696,7 @@ export default {
         contentV,
         appVLi,
         contentli,
-        clentli,
+        clentli
       };
     },
     async getAppListOri() {
@@ -703,7 +707,7 @@ export default {
         db: 'authplat',
         exportMark: '0',
         menuid: 399,
-        roleid,
+        roleid
       });
       //   应用列表
 
@@ -711,25 +715,25 @@ export default {
         exportMark: '0',
         gcode: 'SOURCE',
         pageid: 1,
-        pagesize: 1000,
+        pagesize: 1000
       });
       const cycle = li.output ? li.output.data || [] : [];
       // 端列表
       const clientList = await getSearchData({
         gcode: 'CLIENT_TYPE',
-        source: defaultAppNameFunc(cycle, 'mname'),
+        source: defaultAppNameFunc(cycle, 'mname')
       });
       //   应用版本列表
       const appVersion = await getSearchData({
         gcode: 'APP_VERSION',
-        source: defaultAppNameFunc(cycle, 'mname'),
+        source: defaultAppNameFunc(cycle, 'mname')
       });
       // 端列表
       let contentList = await getAppList({
         exportMark: '0',
         gcode: 'CONTENT_TYPE',
         pageid: 1,
-        pagesize: 1000,
+        pagesize: 1000
       });
       contentList =
         contentList.status == '0' ? contentList.output.data || [] : [];
@@ -769,7 +773,7 @@ export default {
         window.parent.localStorage.userinfo || '{}'
       ).roleid;
       const appV = {
-        length: 0,
+        length: 0
       };
 
       //    端列表
@@ -801,14 +805,14 @@ export default {
         },
         true
       );
-      this.form.client = this.client[1].value
+      this.form.client = this.client[1].value;
       //   如果应用选择西部网则渠道默认全部
       this.form.app === '西部网' && (this.form.client = -1);
       getRule({
         db: 'authplat',
         exportMark: '0',
         menuid: 399,
-        roleid,
+        roleid
       }).then(rule => {
         let prvList =
           (rule.output && rule.output.data && rule.output.data.prvRolectrl) ||
@@ -820,25 +824,25 @@ export default {
         }
         getSearchData({
           gcode: 'APP_VERSION',
-          source: this.form.app,
+          source: this.form.app
         }).then(r => {
           let version = [
             {
               label: '不限',
-              value: -1,
-            },
+              value: -1
+            }
           ];
           r.map(v => {
             if ((appV.length && appV[v.mcode]) || appV.length === 0)
               version.push({
                 value: v.mname,
-                label: v.mname,
+                label: v.mname
               });
           });
           this.version = version;
           this.form = {
             ...this.form,
-            version: [-1],
+            version: [-1]
           };
         });
       });
@@ -881,12 +885,12 @@ export default {
       this.lastParams.channelName &&
         (url += '&channelName=' + this.lastParams.channelName);
       window.open(url);
-    },
+    }
   },
   components: {
     countTo,
-    Search,
-  },
+    Search
+  }
 };
 </script>