瀏覽代碼

首页资金投入添加DMS数据接入(全部数据除外)

DESKTOP-6LTVLN7\Liumouren 2 年之前
父節點
當前提交
185a8c5f1e
共有 3 個文件被更改,包括 19 次插入20 次删除
  1. 4 4
      src/components/common/TagCard.vue
  2. 14 15
      src/components/layout/MenuCard.vue
  3. 1 1
      src/config/common.js

+ 4 - 4
src/components/common/TagCard.vue

@@ -5,7 +5,7 @@
       <!-- 上下布局 -->
       <div v-if="data.type !== 'lr'" class="tbFlx">
         <div class="tagValue">
-          <span>{{ data.value ? data.value : "--" }}</span
+          <span>{{ data.valueData ? data.valueData[data.valueData.length - 1] : "--" }}</span
           ><span>{{ data.unit ? data.unit : "--" }}</span>
         </div>
         <div class="tagImg">
@@ -20,7 +20,7 @@
         </div>
         <div>
           <div class="tagValue">
-            <span>{{ data.value ? data.value : "--" }}</span
+            <span>{{ data.valueData ? data.valueData[data.valueData.length - 1] : "--" }}</span
             ><span>{{ data.unit ? data.unit : "--" }}</span>
           </div>
           <div class="tagTitle">{{ data.title ? data.title : "--" }}</div>
@@ -48,7 +48,7 @@ export default {
    * data:=>
    * data.type: 布局方式【lr:左右布局;other:上下布局】,默认为lr(非必填)
    * data.title: 标题(必填)
-   * data.value: 值(必填)
+   * data.valueData: 值(必填)
    * data.unit: 单位
    */
   props: ["data", "index", "chartCardDataIndex"],
@@ -127,7 +127,7 @@ export default {
       left: 50%;
       transform: translate(-50%, -50%);
       border-radius: 50%;
-      background-image: radial-gradient(circle, #FFFFFF32, #0000, #34c6d8);
+      background-image: radial-gradient(circle, #ffffff32, #0000, #34c6d8);
       z-index: 1;
     }
   }

+ 14 - 15
src/components/layout/MenuCard.vue

@@ -132,6 +132,7 @@ export default {
   components: { TagTableCard, ChartCard, TagCard },
   data() {
     return {
+      resData: [],
       chartCardDataIndex: 0
     };
   },
@@ -140,7 +141,7 @@ export default {
       if (this.menuData && this.menuData.topSolt && this.menuData.topSolt.commonDataGetUrl) {
         this.$Get("/static/json/home/" + this.menuData.topSolt.commonDataGetUrl).then(
           res => {
-            this.resData = res;
+            // this.resData = res;
           },
           error => {
             console.log("error:", error, this.menuData);
@@ -153,6 +154,8 @@ export default {
         params.append("states", "2,3");
         params.append("pageSize", 999);
         params.append("page", 0);
+      let sortparam = [{ field: "c_years", orderByType: 1 }];
+      params.append("orderBy", JSON.stringify(sortparam));
         this.$Post(this.urlsCollection.selectContentList, params).then(
           res => {
             if (res.code === 200 && res.content.data.length > 0) {
@@ -160,17 +163,18 @@ export default {
               let tableData = res.content.data;
               tableData.forEach(item=>{
                 if(listMap[item.street]){
-                  console.log("添加数据!");
+                  listMap[item.street]['categoryData'].push(item.c_years);
+                  listMap[item.street]['valueData'].push((item.c_float_num / 10000).toFixed(2));
                 }else{
                   let listMapItem = {};
-                  listMapItem['categoryData'] = item.c_year;
-                  listMapItem['valueData'] = item.c_year;
+                  listMapItem['categoryData'] = [item.c_years];
+                  listMapItem['valueData'] = [(item.c_float_num / 10000).toFixed(2)];
                   listMap[item.street] = listMapItem;
                 }
               })
-              console.log("tableData:", tableData);
+              this.resData = listMap;
             } else {
-              let tableData = [];
+              this.resData = [];
             }
           },
           error => {
@@ -229,15 +233,10 @@ export default {
   methods: {
     // 切换街镇时
     changeHomeSpecialTown() {
-      if (this.resData) {
-        this.resData.forEach(item => {
-          if (this.$store.state.homeSpecialTown == item.name && item.data.length > 0) {
-            this.$message.info("土地资源数据开始解析!");
-            // item.data.forEach(dataItem=>{
-
-            // })
-          }
-        });
+      if (this.resData[this.$store.state.homeSpecialTown]) {
+        this.menuData.topSolt.commonData[0].categoryData = this.resData[this.$store.state.homeSpecialTown].categoryData;
+        this.menuData.topSolt.commonData[0].valueData = this.resData[this.$store.state.homeSpecialTown].valueData;
+        console.log(this.menuData,this.resData,this.$store.state.homeSpecialTown)
       }
     },
     // 当用户使用光标切换交互组件时触发

+ 1 - 1
src/config/common.js

@@ -600,7 +600,7 @@ export const menusMap = {
           {
             type: "tb",
             title: "土地资源面积",
-            value: 172,
+            valueData: [172],
             unit: "公顷",
           },
         ],