浏览代码

测试2.0

Sanmu8 1 年之前
父节点
当前提交
57f3adf1e6
共有 3 个文件被更改,包括 38 次插入17 次删除
  1. 6 6
      src/views/TQSJ/index.vue
  2. 7 10
      src/views/ZBFS/index.vue
  3. 25 1
      src/views/dashboard/categoryChart.vue

+ 6 - 6
src/views/TQSJ/index.vue

@@ -64,7 +64,7 @@
     </el-row>
 
     <el-table :data="dataList" height="500px">
-      <el-table-column label="保税区" align="center" prop="cbName">
+      <el-table-column label="保税区名称" align="center" prop="cbName" width="150px">
         <template slot-scope="scope">
           {{ scope.row.cbName }}
         </template> 
@@ -101,7 +101,7 @@
         <template slot="header" slot-scope="scope">
           {{ timeValue[0]?timeValue[0]:'月份' }}
         </template>
-          <el-table-column label="对比值" align="center" prop="colName">
+          <el-table-column label="对比值(去年)" align="center" prop="colName" width="120px">
           <template slot-scope="scope">
             {{ scope.row.datails[0].oldValue }}
           </template>
@@ -111,9 +111,9 @@
             {{ scope.row.datails[0].nowValue }}
           </template>
         </el-table-column>
-        <el-table-column label="浮动" align="center" prop="colName">
+        <el-table-column label="同比%" align="center" prop="colName">
           <template slot-scope="scope">
-            {{ scope.row.datails[0].redio }}
+            {{ scope.row.datails[0].redio==0?'持平':scope.row.datails[0].redio+'%'}}
           </template>
         </el-table-column>
       </el-table-column> 
@@ -122,7 +122,7 @@
         <template slot="header" slot-scope="scope">
           {{ timeValue[1]?timeValue[1] + '季度':'季度' }}
         </template>
-        <el-table-column label="对比值" align="center" prop="colName">
+        <el-table-column label="对比值(去年)" align="center" prop="colName" width="120px">
           <template slot-scope="scope">
             {{ scope.row.datails[1].oldValue }}
           </template>
@@ -143,7 +143,7 @@
         <template slot="header" slot-scope="scope">
           {{ timeValue[2]?timeValue[2] + '年度':'年度' }}
         </template>
-        <el-table-column label="对比值" align="center" prop="colName">
+        <el-table-column label="对比值(去年)" align="center" prop="colName" width="120px">
           <template slot-scope="scope">
             {{ scope.row.datails[2].oldValue }}
           </template>

+ 7 - 10
src/views/ZBFS/index.vue

@@ -82,7 +82,7 @@
     </el-table>
 
     <category-chart v-if="contentType == '2'"  :chartData="ChartData" style="width: 100%"></category-chart> -->
-    <!-- <category-chart :chartData="ChartData" style="width: 100%"></category-chart> -->
+    <category-chart v-for="(item,index) in ChartData" :key="index" :title="item.cbName" :chartData="item.datailList" style="width: 100%;"></category-chart>
   </div>
 </template>
 
@@ -145,17 +145,14 @@ export default {
       this.dataList = []
       this.ChartData =[]
       getZBFS(this.queryParams).then(response => {
-        this.dataList = response.data;
-        for (const i in response.data) {
-          // this.ChartData.push({ 
-          //   name: response.data[i].colName,
-          //   value: response.data[i].colValue,
-          //  })
-          if(this.chartData){
-            console.log(this.chartData);
+        this.ChartData = response.data
+        for (const index in this.ChartData) {
+          for (const i in this.ChartData[index].datailList) {
+            this.ChartData[index].datailList[i].name = this.ChartData[index].datailList[i].normName,
+            this.ChartData[index].datailList[i].value = this.ChartData[index].datailList[i].cvalue
           }
         }
-       
+        
         this.loading = false;
       });
     },

+ 25 - 1
src/views/dashboard/categoryChart.vue

@@ -28,6 +28,10 @@ export default {
       type: String,
       default: "400px",
     },
+    title: {
+      type: String,
+      default: "",
+    },
   },
   data() {
     return {
@@ -71,6 +75,10 @@ export default {
         });
       }
       this.chart.setOption({
+        title: {
+          text: this.title,
+          left: "center",
+        },
         color: ["rgba(37, 97, 239, 1)"],
         tooltip: {
           trigger: "axis",
@@ -96,16 +104,32 @@ export default {
         yAxis: [
           {
             type: "value",
+            data: xAxisData,
           },
         ],
         series: [
           {
+            // showBackground: true,
+            // backgroundStyle: {
+            //   color: "rgba(180, 180, 180, 0.05)",
+            // },
             name: "Direct",
             type: "bar",
             barWidth: "60%",
             data: seriesData,
             animationDuration,
-
+            itemStyle: {
+              normal: {
+                color: function () {
+                  return (
+                    "#" +
+                    Math.floor(Math.random() * (256 * 256 * 256 - 1)).toString(
+                      16
+                    )
+                  );
+                },
+              },
+            },
           },
         ],
       });