Browse Source

统计柱状图

maxiaoxiao 2 days ago
parent
commit
03583e30bf

+ 25 - 4
src/views/pageCode/statistic/progress/config.js

@@ -17,6 +17,27 @@ export const FormConfig = [
     },
   ],
 ]
+export const zllist = {
+  all: [
+    { name: "监测\n图斑", prop: "all" },
+    { name: "已举证\n图斑", prop: "WYTJ", prop3: "完成进度" },
+    { name: "县级\n已审核", prop: "XJYSH", prop3: "完成进度" },
+    { name: "市级\n已审核", prop: "SJYSH", prop3: "完成进度" },
+    { name: "省级\n已审核", prop: "SJJYSH", prop3: "完成进度" },
+  ],
+  judge: [
+    { name: "监测\n图斑", pro: "all" },
+    { name: "未判定\n图斑", prop: "WPD", prop3: "占比" },
+    { name: "已判定\n图斑\n(拆分前)", prop: "PDCFQ", prop3: "占比" },
+    { name: "已判定\n图斑\n(拆分后)", prop: "PDCFH" },
+  ],
+  result: [
+    { name: "已判定\n图斑", pro: "all", api: "pdjg" },
+    { name: "判定为\n合法用地", prop: "HFYD", prop3: "占比", api: "pdjg" },
+    { name: "判定为\n违法用地", prop: "WFYD", prop3: "占比", api: "pdjg" },
+    { name: "判定为\n其它用地", prop: "QTYD", prop3: "占比", api: "pdjg" },
+  ],
+}
 export const titles = {
   all: "监测图斑",
   judge: "合法性判定情况",
@@ -28,10 +49,10 @@ export const units = [
   { name: "平方千米", id: "1" },
   { name: "公顷", id: "1" },
 ]
-export const TableHeader = [
-  { label: "行政区", prop: "date", align: 'center' },
-  { label: "图斑数", prop: "szxzc", width: '60px' },
-  { label: "图斑面积", prop: "name", align: 'center' },
+export const allTable = [
+  { label: "行政区", prop: "xzqmc", align: 'center' },
+  { label: "图斑数", prop: "countNumber", },
+  { label: "图斑面积", prop: "countSum", align: 'center' },
   // { label: "操作", slot: "action", width: '80px', align: 'center' },
 ]
 export const judgeTable = [

+ 25 - 48
src/views/pageCode/statistic/progress/index.vue

@@ -116,7 +116,9 @@
         </div>
         <el-table :data="tableData" class="table">
           <el-table-column
-            v-for="(columni, cindex) in judgeTable"
+            v-for="(columni, cindex) in route.query.type == 'all'
+              ? allTable
+              : judgeTable"
             :key="cindex"
             :prop="columni.prop"
             :label="columni.label"
@@ -133,14 +135,14 @@
                 :align="child.align"
             /></template>
           </el-table-column>
-          <el-table-column label="商业服务用地">
+          <!-- <el-table-column label="商业服务用地">
             <el-table-column prop="xzqmc" label="图斑数" />
             <el-table-column label="面积"> </el-table-column>
-          </el-table-column>
+          </el-table-column> -->
         </el-table>
         <div class="echartTitle">
           <div class="block-title">{{ titles[route.query.type] }}统计图</div>
-          <el-select v-model="ntype">
+          <el-select v-model="bartype" @change="changeNtype">
             <el-option
               v-for="item in typeoptions"
               :key="item.id"
@@ -159,7 +161,8 @@
 import customForm from "@/components/custom-form.vue";
 import EchartsMap from "@/components/echarts/EchartsMap.vue";
 import bar from "@/components/echarts/bar.vue";
-import { FormConfig, titles, units, judgeTable } from "./config";
+import { FormConfig, titles, units, allTable, judgeTable } from "./config";
+import { zllist } from "./config";
 import { nextTick } from "vue";
 import { userDept } from "@/api/system/dept";
 import { getcount, listJctb, listJz } from "@/api/rsmonitoring/statistics";
@@ -188,12 +191,8 @@ const data = reactive({
   },
   countData: {},
   eData: {
-    xData: ["2020", "2021", "2022", "2023"],
-    yData: [
-      [-10, 10, 10, 10],
-      [-10, 10, 10, 10],
-      [-10, 10, 10, 10],
-    ],
+    xData: [],
+    yData: [[]],
     legend: ["未判定", "已判定(拆分前)", "已判定(拆分后)"],
     yName: "个",
     stack: "ad",
@@ -202,39 +201,18 @@ const data = reactive({
 });
 const showdata = reactive({
   deptList: [],
-  zllist: {
-    all: [
-      { name: "监测\n图斑", prop: "all" },
-      { name: "已举证\n图斑", prop: "WYTJ", prop3: "完成进度" },
-      { name: "县级\n已审核", prop: "XJYSH", prop3: "完成进度" },
-      { name: "市级\n已审核", prop: "SJYSH", prop3: "完成进度" },
-      { name: "省级\n已审核", prop: "SJJYSH", prop3: "完成进度" },
-    ],
-    judge: [
-      { name: "监测\n图斑", pro: "all" },
-      { name: "未判定\n图斑", prop: "WPD", prop3: "占比" },
-      { name: "已判定\n图斑\n(拆分前)", prop: "PDCFQ", prop3: "占比" },
-      { name: "已判定\n图斑\n(拆分后)", prop: "PDCFH" },
-    ],
-    result: [
-      { name: "已判定\n图斑", pro: "all", api: "pdjg" },
-      { name: "判定为\n合法用地", prop: "HFYD", prop3: "占比", api: "pdjg" },
-      { name: "判定为\n违法用地", prop: "WFYD", prop3: "占比", api: "pdjg" },
-      { name: "判定为\n其它用地", prop: "QTYD", prop3: "占比", api: "pdjg" },
-    ],
-  },
-
   ntype: "0",
   typeoptions: [
     { name: "图斑数", id: "0" },
     { name: "图斑面积", id: "1" },
   ],
   nunit: "0",
+  bartype: "0",
   judgetype: "",
   resulttype: "",
 });
 const { queryParams, countData, eData } = toRefs(data);
-const { deptList, zllist, typeoptions, ntype, nunit, judgetype, resulttype } =
+const { deptList, typeoptions, ntype, bartype, nunit, judgetype, resulttype } =
   toRefs(showdata);
 let countparm = {
   all: {
@@ -265,12 +243,7 @@ let countparm = {
     SJJTH: [{ auditflowStep: "SJJTJ", successType: "1" }],
   },
 };
-onMounted(() => {
-  nextTick(() => {
-    // 初始化主题样式
-    echartRef.value.setOptions(eData.value);
-  });
-});
+onMounted(() => {});
 function getDrpt() {
   userDept({}).then((response) => {
     deptList.value = response.data;
@@ -342,6 +315,7 @@ function getList() {
       }
     });
     changeNtype();
+    setLnbh(res.data);
     // total.value = response.total;
     // loading.value = false;
   });
@@ -351,14 +325,17 @@ function changeNtype() {
   echartsMap.value.init(mapVals.value, ntype.value == "0" ? "Number" : "Sum");
 }
 function setLnbh(data) {
-  // this.eData.yName = `变化面积${this.unitList[this.nowunit].unit}`;
-  // this.eData.xData = [];
-  // this.eData.yData = [[]];
-  // data.forEach((res) => {
-  //   this.eData.xData.push(res.year);
-  //   this.eData.yData[0].push(res[this.uprops[this.nowunit]]);
-  // });
-  // this.setEchart(this.eData, 0);
+  //eData.value.yName = `变化面积${this.unitList[this.nowunit].unit}`;
+  eData.value.xData = [];
+  eData.value.yData = [[]];
+  data.forEach((res) => {
+    eData.value.xData.push(res.xzqmc);
+    eData.value.yData[0].push(
+      res[ntype.value == "0" ? "countNumber" : "countSum"]
+    );
+  });
+
+  echartRef.value.setOptions(eData.value);
 }
 
 getDrpt();