Prechádzať zdrojové kódy

各审计类型DMS数据接入

DESKTOP-6LTVLN7\Liumouren 2 rokov pred
rodič
commit
ad57470446

+ 0 - 1
src/components/common/BottomForm/CustomModelDialog.vue

@@ -661,7 +661,6 @@ export default {
     },
     // 执行叠置分析
     executeOverlay() {
-      debugger;
       this.overlayBtnChecked = !this.overlayBtnChecked;
       if (this.overlayBtnChecked && !this.forbidOverlayBtn) {
         // 进行叠置分析后,叠置分析结果会自动保存

+ 2 - 2
src/components/common/TopCard.vue

@@ -3,7 +3,7 @@
     <div v-for="(items, index) in dataList" :key="index" class="Top_box">
       <div class="Top_box_name">{{ "TOP" + (index + 1) }}</div>
       <div class="Top_box_main">
-        <div class="Top_box_main_title">{{ items.c_wtfl }}</div>
+        <div class="Top_box_main_title">{{ items[columnName] }}</div>
         <div><el-progress :percentage="items.number" :stroke-width="10" :show-text="false"></el-progress></div>
       </div>
       <div class="Top_box_value">{{ items.number }}</div>
@@ -25,7 +25,7 @@ export default {
   /**
    * data:top data
    */
-  props: ["dataList"],
+  props: ["dataList", "columnName"],
   methods: {},
   watch: {}
 };

+ 66 - 9
src/components/layout/MenuCard.vue

@@ -80,7 +80,7 @@
       <!-- 上部 -->
       <div class="menuMainBox_main_top" v-if="!menuData.topSolt">
         <slot name="top"> </slot>
-        <TopCard v-if="menuData.commonName == 'TOP'" :dataList="menuData.topData"/>
+        <TopCard v-if="menuData.commonName == 'TOP'" :dataList="menuData.topData" :columnName="menuData.field" />
       </div>
       <div class="menuMainBox_main_top" v-if="menuData.topSolt">
         <TagTableCard
@@ -234,10 +234,9 @@ export default {
             this.dataInitLoading = false;
           }
         );
-      } else if (this.menuData && this.menuData.columnId) {
+      } else if (this.menuData && this.menuData.columnId && this.menuData.commonName !== "SUM") {
         this.dataInitLoading = true;
         let params = new FormData();
-        this.countUser = 0;
         params.append("columnId", this.menuData.columnId);
         if (this.menuData.field) {
           params.append("field", this.menuData.field);
@@ -245,6 +244,9 @@ export default {
         params.append("states", "2,3");
         params.append("pageSize", this.menuData.pageSize ? this.menuData.pageSize : 999);
         params.append("page", 0);
+        if (this.menuData.paramJson) {
+          params.append("paramJson", JSON.stringify(this.menuData.paramJson));
+        }
         if (this.menuData.sortField) {
           let sortparam = [
             {
@@ -257,13 +259,13 @@ export default {
         this.$Post(this.menuData.getUrl ? this.menuData.getUrl : this.urlsCollection.selectContentList, params).then(
           res => {
             if (this.menuData.commonName && this.menuData.commonName === "TOP" && res.code === 200 && res.content.length > 0) {
-              res.content.forEach((item,index)=>{
-                if(this.menuData.dataSize > index){
+              res.content.forEach((item, index) => {
+                if (this.menuData.dataSize > index) {
                   this.resData[index] = item;
                 }
-              })
+              });
               this.changeHomeSpecialTown();
-            }else if (res.code === 200 && res.content.data && res.content.data.length > 0) {
+            } else if (res.code === 200 && res.content.data && res.content.data.length > 0) {
               let listMap = {};
               let tableData = res.content.data;
               tableData.forEach(item => {
@@ -318,6 +320,8 @@ export default {
             this.dataInitLoading = false;
           }
         );
+      } else if (this.menuData.commonName && this.menuData.commonName === "SUM") {
+        this.sumData();
       }
       // 只有第一次创建该页面,或刷新页面时。
       if (this.menuData.menuIndex) {
@@ -352,7 +356,6 @@ export default {
    * columnId:DMS数据请求columnId
    * pageSize:DMS数据请求个数
    * field:DMS数据请求field
-   * dataType:DMS数据类型
    * sortField=>:DMS数据请求排序配置
    *  field:排序字段
    *  orderByType:排序类型【1:正序,2:倒序】
@@ -377,6 +380,58 @@ export default {
    */
   props: ["menuData"],
   methods: {
+    sumData() {
+      this.dataInitLoading = true;
+      let params = new FormData();
+      params.append("columnId", this.menuData.columnId);
+      if (this.menuData.field) {
+        params.append("field", this.menuData.field);
+      }
+      params.append("states", "2,3");
+      params.append("pageSize", this.menuData.pageSize ? this.menuData.pageSize : 999);
+      params.append("page", 0);
+      if (this.menuData.paramJson) {
+        if (this.menuData.categoryData) {
+          let pramJson = {};
+          this.menuData.categoryData.forEach((item,_index) => {
+            pramJson.c_new_date = item;
+            pramJson.sj_select = this.menuData.paramJson.sj_select;
+            params.append("paramJson", JSON.stringify(pramJson));
+            if (this.menuData.sortField) {
+              let sortparam = [
+                {
+                  field: this.menuData.sortField.field,
+                  orderByType: this.menuData.sortField.orderByType
+                }
+              ];
+              params.append("orderBy", JSON.stringify(sortparam));
+            }
+            this.$Post(this.menuData.getUrl ? this.menuData.getUrl : this.urlsCollection.selectContentList, params).then(
+              res => {
+                if (res.code === 200 && res.content.length > 0) {
+                  this.menuData.topSolt.commonData[0].categoryData[_index] = item;
+                  let sumField = 0;
+                  res.content.forEach(contentItem => {
+                    sumField += Number(contentItem.number);
+                  });
+                  this.menuData.topSolt.commonData[0].valueData[_index] = sumField;
+                } else {
+                  this.menuData.topSolt.commonData[0].categoryData = [];
+                  this.menuData.topSolt.commonData[0].valueData = [];
+                }
+                this.dataInitLoading = false;
+              },
+              error => {
+                this.menuData.topSolt.commonData[0].categoryData = [];
+                this.menuData.topSolt.commonData[0].valueData = [];
+                console.log("error:", error, this.menuData);
+                this.dataInitLoading = false;
+              }
+            );
+          });
+        }
+      }
+    },
     // 切换街镇时
     changeHomeSpecialTown() {
       if (this.resData[this.$store.state.homeSpecialTown] && this.menuData.topSolt.commonData) {
@@ -414,8 +469,10 @@ export default {
             this.menuData.topSolt.commonData[index].value = 0;
           }
         });
-      } else if(this.menuData && this.menuData.commonName && this.menuData.commonName === "TOP"){
+      } else if (this.menuData && this.menuData.commonName && this.menuData.commonName === "TOP") {
         this.menuData.topData = this.resData;
+      } else if (this.menuData && this.menuData.commonName && this.menuData.commonName === "SUM") {
+        this.sumData(this.$store.state.homeSpecialTown);
       }
     },
     // 当用户使用光标切换交互组件时触发

+ 0 - 3
src/components/map/MapHolder.vue

@@ -150,7 +150,6 @@ export default {
     },
     // 常规图层弹窗
     createAuditDiv(str, properties) {
-      debugger
       // 根据ref获取组件的dom元素
       this.currentHtml = this.$refs.auditRef.$el.innerHTML;
       this.$refs.auditRef.tableObj = properties;
@@ -242,8 +241,6 @@ export default {
       console.log("用户点击了地图中的修改按钮!");
     },
     confirmBtnEvent(str) {
-      debugger;
-      console.log("用户点击地图中的确认按钮");
       // isTrue
       let selectVal = $(`#${str}_id .center-table-item-special select`).val();
       let obj = {

+ 155 - 24
src/config/common.js

@@ -557,7 +557,7 @@ export const defaultLayers = {
 /**
  * 在线菜单配置
  */
-const menuOnLine = {
+export const menuOnLine = {
   left: [
     {
       type: "card",
@@ -1082,6 +1082,19 @@ const menuOnLine = {
         subMenuIndex: "1",
         position: "right",
         minDomWidth: 1200,
+        getUrl: "/dms/content/selectGroupByCountOrderBy",
+        columnId: 24,
+        pageSize: 5,
+        field: "c_zdsjsx",
+        commonName: "SUM",
+        categoryData: [
+          "2019",
+          "2020",
+          "2021"
+        ],
+        paramJson: {
+          sj_select: "1"
+        },
         topSolt: {
           commonName: "TagCard",
           commonData: [
@@ -1119,31 +1132,149 @@ const menuOnLine = {
         getUrl: "/dms/content/selectGroupByCountOrderBy",
         columnId: 24,
         pageSize: 5,
-        field: "c_wtfl",
+        field: "c_zdsjsx",
         dataType: "all",
+        paramJson: {
+          sj_select: "1"
+        },
         dataSize: 5,
-        topData: [
-          {
-            number: 0,
-            c_wtfl: "--"
-          },
-          {
-            number: 0,
-            c_wtfl: "--"
-          },
-          {
-            number: 0,
-            c_wtfl: "--"
-          },
-          {
-            number: 0,
-            c_wtfl: "--"
-          },
-          {
-            number: 0,
-            c_wtfl: "--"
-          }
-        ]
+        topData: []
+      }
+    ],
+    [
+      {
+        type: "card",
+        title: "水资源类问题",
+        titleWidth: 60,
+        menuIndex: "2",
+        subMenuIndex: "2",
+        position: "right",
+        minDomWidth: 1200,
+        getUrl: "/dms/content/selectGroupByCountOrderBy",
+        columnId: 24,
+        pageSize: 5,
+        field: "c_zdsjsx",
+        commonName: "SUM",
+        categoryData: [
+          "2019",
+          "2020",
+          "2021"
+        ],
+        paramJson: {
+          sj_select: "2"
+        },
+        topSolt: {
+          commonName: "TagCard",
+          commonData: [
+            {
+              type: "lr",
+              title: "水资源类疑点",
+              value: 72,
+              unit: "个",
+              categoryData: [
+                "2019",
+                "2020",
+                "2021"
+              ],
+              valueData: [
+                100,
+                120,
+                72
+              ]
+            }
+          ]
+        },
+        bottomSolt: {
+          commonName: "ChartCard"
+        }
+      },
+      {
+        type: "card",
+        title: "水资源类问题TOP5",
+        titleWidth: 81,
+        menuIndex: "2",
+        subMenuIndex: "2",
+        position: "right",
+        minDomWidth: 1200,
+        commonName: "TOP",
+        getUrl: "/dms/content/selectGroupByCountOrderBy",
+        columnId: 24,
+        pageSize: 5,
+        field: "c_zdsjsx",
+        dataType: "all",
+        paramJson: {
+          sj_select: "2"
+        },
+        dataSize: 5,
+        topData: []
+      }
+    ],
+    [
+      {
+        type: "card",
+        title: "林地类问题",
+        titleWidth: 60,
+        menuIndex: "2",
+        subMenuIndex: "3",
+        position: "right",
+        minDomWidth: 1200,
+        getUrl: "/dms/content/selectGroupByCountOrderBy",
+        columnId: 24,
+        pageSize: 5,
+        field: "c_zdsjsx",
+        commonName: "SUM",
+        categoryData: [
+          "2019",
+          "2020",
+          "2021"
+        ],
+        paramJson: {
+          sj_select: "3"
+        },
+        topSolt: {
+          commonName: "TagCard",
+          commonData: [
+            {
+              type: "lr",
+              title: "林地类疑点",
+              value: 72,
+              unit: "个",
+              categoryData: [
+                "2019",
+                "2020",
+                "2021"
+              ],
+              valueData: [
+                100,
+                120,
+                72
+              ]
+            }
+          ]
+        },
+        bottomSolt: {
+          commonName: "ChartCard"
+        }
+      },
+      {
+        type: "card",
+        title: "林类问题TOP5",
+        titleWidth: 81,
+        menuIndex: "2",
+        subMenuIndex: "3",
+        position: "right",
+        minDomWidth: 1200,
+        commonName: "TOP",
+        getUrl: "/dms/content/selectGroupByCountOrderBy",
+        columnId: 24,
+        pageSize: 5,
+        field: "c_zdsjsx",
+        dataType: "all",
+        paramJson: {
+          sj_select: "3"
+        },
+        dataSize: 5,
+        topData: []
       }
     ]
   ]

+ 7 - 5
src/views/HomeView.vue

@@ -166,7 +166,7 @@ import Header from "@/components/layout/Header.vue";
 import MenuCard from "@/components/layout/MenuCard.vue";
 import NewSelect from "@/components/common/NewSelect.vue";
 import BarChart from "@/components/chart/BarChart.vue";
-import { street } from "@/config/common";
+import { street, menuOnLine } from "@/config/common";
 import publicFun from "@/utils/publicFunction.js";
 import TagCard from "@/components/common/TagCard";
 import ChartCard from "@/components/common/ChartCard.vue";
@@ -291,10 +291,12 @@ export default {
   },
   methods: {
     initMenu(menus) {
-      if (menus) {
-        this.menus = menus;
-        this.getSourcesData();
-      }
+      // if (menus) {
+      //   this.menus = menus;
+      //   this.getSourcesData();
+      // }
+      this.menus = menuOnLine;
+      this.getSourcesData();
     },
     navSelect: function (data) {
       this.$store.commit("changeNavSelect", data);