liyongli 2 jaren geleden
bovenliggende
commit
1aef774f7b
2 gewijzigde bestanden met toevoegingen van 55 en 53 verwijderingen
  1. 47 46
      src/views/Department/index.vue
  2. 8 7
      src/views/ReportForm/ReportForm.vue

+ 47 - 46
src/views/Department/index.vue

@@ -94,7 +94,7 @@
               >
                 <template #default="scope">
                   {{
-                    item.type == "number"
+                    item.type == 'number'
                       ? formatter(scope.row[item.key])
                       : scope.row[item.key]
                   }}
@@ -103,7 +103,7 @@
             </template>
           </el-table>
         </el-tab-pane>
-        <el-tab-pane label="详情数据" name="list">
+        <el-tab-pane label="稿件数据" name="list">
           <el-table
             :header-cell-style="{
               backgroundColor: '#f4f5f7',
@@ -128,7 +128,7 @@
               >
                 <template #default="scope">
                   {{
-                    item.type == "number"
+                    item.type == 'number'
                       ? formatter(scope.row[item.key])
                       : scope.row[item.key]
                   }}
@@ -153,71 +153,71 @@
 
 <script>
 // @ is an alias to /src
-const ElLoading = require("element-plus/lib/el-loading/index");
-import "element-plus/lib/theme-chalk/el-loading.css";
+const ElLoading = require('element-plus/lib/el-loading/index');
+import 'element-plus/lib/theme-chalk/el-loading.css';
 
-import { platformList, platformlistData, platform } from "@/api/index";
+import { platformList, platformlistData, platform } from '@/api/index';
 
-import { formatter } from "@/utils/tool";
+import { formatter } from '@/utils/tool';
 
-import config from "@/config/index";
+import config from '@/config/index';
 let tableDataListOri = [];
 let sort = null;
 export default {
-  name: "RealData",
+  name: 'RealData',
   data() {
     return {
       btnGroup: {
         微信: {
-          color: "#1cc393",
-          class: "weixin",
+          color: '#1cc393',
+          class: 'weixin',
         },
         微博: {
-          color: "#ffb712",
-          class: "weibo",
+          color: '#ffb712',
+          class: 'weibo',
         },
         快手: {
-          color: "#ffb712",
-          class: "kuaishou",
+          color: '#ffb712',
+          class: 'kuaishou',
         },
         抖音: {
-          color: "#170b1a",
-          class: "douyin",
+          color: '#170b1a',
+          class: 'douyin',
         },
         头条: {
-          color: "#de0517",
-          class: "toutiao",
+          color: '#de0517',
+          class: 'toutiao',
         },
         B站: {
-          color: "#ffb712",
-          class: "bzhan",
+          color: '#ffb712',
+          class: 'bzhan',
         },
       },
       page: 0,
       pagesize: 20,
       total: 0,
       load: false,
-      activeTab: "agg",
+      activeTab: 'agg',
       form: {
-        platform: "",
+        platform: '',
         dt: [],
-        match: "",
+        match: '',
       },
-      formRael: { platform: "", dt: [] },
+      formRael: { platform: '', dt: [] },
       tableData: [],
       pListData: [],
     };
   },
   mounted() {
     platformList().then(res => {
-      const first = res[0] || { platform: "", dt: "" };
+      const first = res[0] || { platform: '', dt: '' };
       this.form = {
         dt: [first.dt, first.dt],
         platform: first.platform,
       };
       this.formRael = {
         dt: [first.dt, first.dt],
-        platform: first.platform || "",
+        platform: first.platform || '',
       };
       this.pListData = res || [];
       this.onSubmit();
@@ -267,13 +267,14 @@ export default {
       if (!this.formRael.dt || this.formRael.dt.length != 2) return;
       const startd = this.dateFormat(this.formRael.dt[0] || 0);
       const starte = this.dateFormat(this.formRael.dt[1] || 0);
-      window.open(
+      let url =
         config.base.url2 +
-          "/new-media/export?start=" +
-          [startd.year, startd.month, startd.day].join("-") +
-          "&end=" +
-          [starte.year, starte.month, starte.day].join("-")
-      );
+        '/new-media/export?start=' +
+        [startd.year, startd.month, startd.day].join('-') +
+        '&end=' +
+        [starte.year, starte.month, starte.day].join('-');
+      if (this.formRael.sort) url += "&sort=" + this.formRael.sort;
+      window.open(url);
     },
     disabledDate(time) {
       return time.getTime() > Date.now() - 86400000;
@@ -292,7 +293,7 @@ export default {
       Promise.all([platform(data), platformlistData(data)])
         .then(list => {
           this.formRael = data;
-          this.formRael.dt = [this.formRael.start,this.formRael.end];
+          this.formRael.dt = [this.formRael.start, this.formRael.end];
           this.tableData = (list[0] || []).map((v, i) => {
             v.index = i + 1;
             return v;
@@ -318,11 +319,11 @@ export default {
       let h = D.getHours();
       let M = D.getMinutes();
       let s = D.getSeconds();
-      m > 9 ? m : (m = "0" + m);
-      d > 9 ? d : (d = "0" + d);
-      h > 9 ? h : (h = "0" + h);
-      M > 9 ? M : (M = "0" + M);
-      s > 9 ? s : (s = "0" + s);
+      m > 9 ? m : (m = '0' + m);
+      d > 9 ? d : (d = '0' + d);
+      h > 9 ? h : (h = '0' + h);
+      M > 9 ? M : (M = '0' + M);
+      s > 9 ? s : (s = '0' + s);
       return {
         year: D.getFullYear(),
         month: m,
@@ -336,15 +337,15 @@ export default {
       const startd = this.form.dt[0] ? this.dateFormat(this.form.dt[0]) : false;
       const starte = this.form.dt[1] ? this.dateFormat(this.form.dt[1]) : false;
       const loginname = JSON.parse(
-        window.parent.localStorage.userinfo || "{}"
+        window.parent.localStorage.userinfo || '{}'
       ).loginname;
       const p = {
         platform: this.form.platform || this.pListData[0],
         start: startd
-          ? [startd.year, startd.month, startd.day].join("-")
+          ? [startd.year, startd.month, startd.day].join('-')
           : undefined,
         end: starte
-          ? [starte.year, starte.month, starte.day].join("-")
+          ? [starte.year, starte.month, starte.day].join('-')
           : undefined,
         match: this.form.match,
         userId: loginname,
@@ -441,10 +442,10 @@ export default {
   color: #fff;
 }
 
-.program .ascending{
-    opacity: 0;
+.program .ascending {
+  opacity: 0;
 }
-.program .caret-wrapper{
-    top: -3px;
+.program .caret-wrapper {
+  top: -3px;
 }
 </style>

+ 8 - 7
src/views/ReportForm/ReportForm.vue

@@ -103,7 +103,7 @@
             </template>
           </el-table>
         </el-tab-pane>
-        <el-tab-pane label="详情数据" name="list">
+        <el-tab-pane label="稿件数据" name="list">
           <el-table
             :header-cell-style="{
               backgroundColor: '#f4f5f7',
@@ -266,13 +266,14 @@ export default {
       if (!this.formRael.dt || this.formRael.dt.length != 2) return;
       const startd = this.dateFormat(this.formRael.dt[0] || 0);
       const starte = this.dateFormat(this.formRael.dt[1] || 0);
-      window.open(
+      let url =
         config.base.url2 +
-          "/new-media/export?start=" +
-          [startd.year, startd.month, startd.day].join("-") +
-          "&end=" +
-          [starte.year, starte.month, starte.day].join("-")
-      );
+        '/new-media/export?start=' +
+        [startd.year, startd.month, startd.day].join('-') +
+        '&end=' +
+        [starte.year, starte.month, starte.day].join('-');
+      if (this.formRael.sort) url += "&sort=" + this.formRael.sort;
+      window.open(url);
     },
     disabledDate(time) {
       return time.getTime() > Date.now() - 86400000;