liyongli 1 год назад
Родитель
Сommit
cacc543724
1 измененных файлов с 70 добавлено и 69 удалено
  1. 70 69
      src/views/BoutiqueColumn/views/default.vue

+ 70 - 69
src/views/BoutiqueColumn/views/default.vue

@@ -66,35 +66,35 @@
     </el-pagination> -->
     </el-pagination> -->
     <el-button
     <el-button
       type="default"
       type="default"
-      style="margin: 5px auto;display: block"
+      style="margin: 5px auto; display: block"
       v-if="total > tableData.length"
       v-if="total > tableData.length"
       :loading="load"
       :loading="load"
-      @click="()=>changePage(current)"
+      @click="() => changePage(current)"
       size="mini"
       size="mini"
     >
     >
-      {{ load ? "加载中..." : "加载更多" }}
+      {{ load ? '加载中...' : '加载更多' }}
     </el-button>
     </el-button>
   </div>
   </div>
 </template>
 </template>
 
 
 <script>
 <script>
 // @ is an alias to /src
 // @ is an alias to /src
-import { epgDetail, epgResult } from "@/api/index";
+import { epgDetail, epgResult } from '@/api/index';
 
 
-import watchrateEle from "../components/watchrate.vue";
+import watchrateEle from '../components/watchrate.vue';
 
 
-import * as echarts from "echarts/core";
-import { LineChart, BarChart } from "echarts/charts";
+import * as echarts from 'echarts/core';
+import { LineChart, BarChart } from 'echarts/charts';
 import {
 import {
   TitleComponent,
   TitleComponent,
   TooltipComponent,
   TooltipComponent,
   GridComponent,
   GridComponent,
   ToolboxComponent,
   ToolboxComponent,
   VisualMapComponent,
   VisualMapComponent,
-} from "echarts/components";
-import { LabelLayout, UniversalTransition } from "echarts/features";
-import { CanvasRenderer } from "echarts/renderers";
-import config from "../../../config/index";
+} from 'echarts/components';
+import { LabelLayout, UniversalTransition } from 'echarts/features';
+import { CanvasRenderer } from 'echarts/renderers';
+import config from '../../../config/index';
 echarts.use([
 echarts.use([
   TitleComponent,
   TitleComponent,
   TooltipComponent,
   TooltipComponent,
@@ -109,11 +109,9 @@ echarts.use([
 ]);
 ]);
 const openList = [];
 const openList = [];
 const openLi = [];
 const openLi = [];
-let type = "STADATE",
-  direction = "DESC";
 export default {
 export default {
-  name: "urbanExpressNews",
-  props: ["item"],
+  name: 'urbanExpressNews',
+  props: ['item'],
   data() {
   data() {
     return {
     return {
       tableData: [],
       tableData: [],
@@ -121,6 +119,8 @@ export default {
       load: false,
       load: false,
       current: 0,
       current: 0,
       total: 1,
       total: 1,
+      direction: 'DESC',
+      type: 'STADATE',
     };
     };
   },
   },
   mounted() {
   mounted() {
@@ -137,12 +137,13 @@ export default {
         page: this.current,
         page: this.current,
         pageSize: this.size,
         pageSize: this.size,
       };
       };
-      type && (p.sort = type);
-      direction && (p.order = direction);
+      console.log(this.data)
+      this.type && (p.sort = this.type);
+      this.direction && (p.order = this.direction);
       epgResult(p).then(programList => {
       epgResult(p).then(programList => {
         this.total = programList.total;
         this.total = programList.total;
         if (num === 1) {
         if (num === 1) {
-            this.tableData =programList.data;
+          this.tableData = programList.data;
         } else this.tableData = [...this.tableData, ...programList.data];
         } else this.tableData = [...this.tableData, ...programList.data];
         this.load = false;
         this.load = false;
       });
       });
@@ -163,15 +164,15 @@ export default {
         return;
         return;
       }
       }
       this.$nextTick(() => {
       this.$nextTick(() => {
-        epgDetail({ epgId: row.epg_id, target: ".loadare" + row.epg_id }).then(
+        epgDetail({ epgId: row.epg_id, target: '.loadare' + row.epg_id }).then(
           res => {
           res => {
             let more = this.createChart(
             let more = this.createChart(
-              this.$refs["huashanChart" + row.epg_id],
+              this.$refs['huashanChart' + row.epg_id],
               res
               res
             );
             );
             openList[row.epg_id] = more.chart;
             openList[row.epg_id] = more.chart;
             openLi[row.epg_id] = this.createBarChart(
             openLi[row.epg_id] = this.createBarChart(
-              this.$refs["huashanListChart" + row.epg_id],
+              this.$refs['huashanListChart' + row.epg_id],
               more.height
               more.height
             );
             );
           }
           }
@@ -189,28 +190,28 @@ export default {
       let option = {
       let option = {
         tooltip: {
         tooltip: {
           confine: true,
           confine: true,
-          trigger: "axis",
+          trigger: 'axis',
           axisPointer: {
           axisPointer: {
-            type: "cross",
+            type: 'cross',
           },
           },
-          formatter: function(data) {
+          formatter: function (data) {
             return data[0].value;
             return data[0].value;
           },
           },
         },
         },
         grid: {
         grid: {
-          top: "5%",
-          left: "3%",
-          right: "4%",
-          bottom: "3%",
+          top: '5%',
+          left: '3%',
+          right: '4%',
+          bottom: '3%',
           containLabel: true,
           containLabel: true,
         },
         },
         xAxis: {
         xAxis: {
-          type: "category",
+          type: 'category',
           boundaryGap: false,
           boundaryGap: false,
           data: list.map(v => v.metric),
           data: list.map(v => v.metric),
         },
         },
         yAxis: {
         yAxis: {
-          type: "value",
+          type: 'value',
           axisLabel: {
           axisLabel: {
             formatter: watchrate => {
             formatter: watchrate => {
               return watchrate;
               return watchrate;
@@ -226,32 +227,32 @@ export default {
           pieces: [
           pieces: [
             {
             {
               lte: 6,
               lte: 6,
-              color: "green",
+              color: 'green',
             },
             },
             {
             {
               gt: 6,
               gt: 6,
               lte: 800,
               lte: 800,
-              color: "red",
+              color: 'red',
             },
             },
             {
             {
               gt: 8,
               gt: 8,
               lte: 14,
               lte: 14,
-              color: "green",
+              color: 'green',
             },
             },
             {
             {
               gt: 14,
               gt: 14,
               lte: 17,
               lte: 17,
-              color: "red",
+              color: 'red',
             },
             },
             {
             {
               gt: 17,
               gt: 17,
-              color: "green",
+              color: 'green',
             },
             },
           ],
           ],
         },
         },
         series: [
         series: [
           {
           {
-            type: "line",
+            type: 'line',
             smooth: true,
             smooth: true,
             data: list.map(v => v.watchrate),
             data: list.map(v => v.watchrate),
             itemStyle: {
             itemStyle: {
@@ -268,25 +269,25 @@ export default {
             },
             },
             markArea: {
             markArea: {
               itemStyle: {
               itemStyle: {
-                color: "rgba(255, 173, 177, 0.4)",
+                color: 'rgba(255, 173, 177, 0.4)',
               },
               },
               data: [
               data: [
                 [
                 [
                   {
                   {
-                    name: "Morning Peak",
-                    xAxis: "07:30",
+                    name: 'Morning Peak',
+                    xAxis: '07:30',
                   },
                   },
                   {
                   {
-                    xAxis: "10:00",
+                    xAxis: '10:00',
                   },
                   },
                 ],
                 ],
                 [
                 [
                   {
                   {
-                    name: "Evening Peak",
-                    xAxis: "17:30",
+                    name: 'Evening Peak',
+                    xAxis: '17:30',
                   },
                   },
                   {
                   {
-                    xAxis: "21:15",
+                    xAxis: '21:15',
                   },
                   },
                 ],
                 ],
               ],
               ],
@@ -294,7 +295,7 @@ export default {
           },
           },
         ],
         ],
       };
       };
-      if (this.item.programType === "simple") {
+      if (this.item.programType === 'simple') {
         delete option.visualMap;
         delete option.visualMap;
         option.series[0].markArea = undefined;
         option.series[0].markArea = undefined;
       }
       }
@@ -312,30 +313,30 @@ export default {
         title: {},
         title: {},
         tooltip: {
         tooltip: {
           confine: true,
           confine: true,
-          trigger: "axis",
+          trigger: 'axis',
           axisPointer: {
           axisPointer: {
-            type: "shadow",
+            type: 'shadow',
           },
           },
         },
         },
         grid: {
         grid: {
           top: 0,
           top: 0,
-          left: "3%",
-          right: "4%",
-          bottom: "3%",
+          left: '3%',
+          right: '4%',
+          bottom: '3%',
           containLabel: true,
           containLabel: true,
         },
         },
         xAxis: {
         xAxis: {
-          type: "value",
+          type: 'value',
           splitNumber: 2,
           splitNumber: 2,
         },
         },
         yAxis: {
         yAxis: {
-          type: "category",
-          data: ["Brazil", "Indonesia", "USA", "India", "China", "World"],
+          type: 'category',
+          data: ['Brazil', 'Indonesia', 'USA', 'India', 'China', 'World'],
         },
         },
         series: [
         series: [
           {
           {
-            name: "2011",
-            type: "bar",
+            name: '2011',
+            type: 'bar',
             data: [1000, 2000, 4000, 50000, 6000, 70000],
             data: [1000, 2000, 4000, 50000, 6000, 70000],
           },
           },
         ],
         ],
@@ -344,38 +345,38 @@ export default {
       return chart;
       return chart;
     },
     },
     sortFun(column) {
     sortFun(column) {
-      direction = column.order ? config.order[column.order] : "DESC";
-      type = column.prop ? column.prop.toUpperCase() : "STADATE";
+      this.direction = column.order ? config.order[column.order] : 'DESC';
+      this.type = column.prop ? column.prop.toUpperCase() : 'STADATE';
       this.changePage(0);
       this.changePage(0);
     },
     },
     exportfun() {
     exportfun() {
       let xhttp,
       let xhttp,
         that = this;
         that = this;
       if (window.XMLHttpRequest) xhttp = new XMLHttpRequest();
       if (window.XMLHttpRequest) xhttp = new XMLHttpRequest();
-      else xhttp = new window.ActiveXObject("Microsoft.XMLHTTP");
-      xhttp.responseType = "blob";
+      else xhttp = new window.ActiveXObject('Microsoft.XMLHTTP');
+      xhttp.responseType = 'blob';
       xhttp.open(
       xhttp.open(
-        "GET",
-        config.base.url2 + "/epg-export?programId=" + that.item.id,
+        'GET',
+        config.base.url2 + '/epg-export?programId=' + that.item.id,
         true
         true
       );
       );
       xhttp.send();
       xhttp.send();
-      xhttp.onreadystatechange = function() {
+      xhttp.onreadystatechange = function () {
         if (this.readyState != 4 || this.status != 200) return;
         if (this.readyState != 4 || this.status != 200) return;
         // 组装a标签
         // 组装a标签
-        let elink = document.createElement("a");
+        let elink = document.createElement('a');
         // 设置下载文件名
         // 设置下载文件名
         let D = new Date(),
         let D = new Date(),
           M = D.getMonth() + 1,
           M = D.getMonth() + 1,
           E = D.getDate();
           E = D.getDate();
-        M > 9 ? "" : (M = ["0", M].join(""));
-        E > 9 ? "" : (E = ["0", E].join(""));
+        M > 9 ? '' : (M = ['0', M].join(''));
+        E > 9 ? '' : (E = ['0', E].join(''));
         elink.download =
         elink.download =
           that.item.programName +
           that.item.programName +
-          " " +
-          [D.getFullYear(), M, E].join("-") +
-          ".csv";
-        elink.style.display = "none";
+          ' ' +
+          [D.getFullYear(), M, E].join('-') +
+          '.csv';
+        elink.style.display = 'none';
         elink.href = URL.createObjectURL(this.response);
         elink.href = URL.createObjectURL(this.response);
         document.body.appendChild(elink);
         document.body.appendChild(elink);
         elink.click();
         elink.click();
@@ -384,7 +385,7 @@ export default {
     },
     },
   },
   },
 
 
-  beforeUnmount: function() {},
+  beforeUnmount: function () {},
   components: {
   components: {
     watchrateEle,
     watchrateEle,
   },
   },