Преглед на файлове

耕地保护接口接入

Maxx преди 1 година
родител
ревизия
43b6cc664e
променени са 3 файла, в които са добавени 35 реда и са изтрити 16 реда
  1. 8 0
      src/api/cockpitNew.js
  2. 0 2
      src/components/echartsTemplate/3dPie.vue
  3. 27 14
      src/views/cockpitNew1/gdbh.vue

+ 8 - 0
src/api/cockpitNew.js

@@ -8,3 +8,11 @@ export function QueryList(params) {
         params
     })
 }
+export function QueryOne(params) {
+    return request({
+        url: '/apply/jsc/QueryOne',
+        method: 'get',
+        params
+    })
+}
+

+ 0 - 2
src/components/echartsTemplate/3dPie.vue

@@ -115,8 +115,6 @@ export default {
           `${item.name}`.includes(`${name}`)
         );
         if (sItem) {
-          console.log("name",name);
-          
           return `{name|${name}}  {value|${sItem.value}}  {unit|${_this.$props.unit}} `;
           // return name + 'sItem.value';
         } else {

+ 27 - 14
src/views/cockpitNew1/gdbh.vue

@@ -5,7 +5,7 @@
         <div class="icon" :class="`icongdbh${i}`"></div>
         <div class="text">
           <p>{{ sd.name }}</p>
-          <span class="sdvalue">{{ sd.value || 0 }}</span>
+          <span class="sdvalue">{{ sdata[sd.prop] || 0 }}</span>
           <span class="unit">{{ sd.unit }}</span>
         </div>
       </div>
@@ -17,18 +17,19 @@
 <script>
 //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 import borderTemplate from "./borderTemplate.vue";
-import highPie from "../../components/echartsTemplate/highPie.vue";
+// import highPie from "../../components/echartsTemplate/highPie.vue";
 import pie3d from "../../components/echartsTemplate/3dPie.vue";
-import { QueryList } from "../../api/cockpitNew";
+import { QueryOne, QueryList } from "../../api/cockpitNew";
 export default {
   components: { borderTemplate, pie3d },
   data() {
     return {
+      sdata: {},
       sdlist: [
-        { name: "高标准农田", value: "", unit: "km²" }, //耕地保有量//url: "residentPopulation",
-        { name: "补充耕地项目", value: "", unit: "个" },
-        { name: "永久基本农田", value: "", unit: "km²" },
-        { name: "补充耕地面积", value: "", unit: "km²" }
+        { name: "高标准农田", prop: "residentPopulation", unit: "km²" }, //耕地保有量
+        { name: "补充耕地项目", prop: "residentPopulation", unit: "个" },
+        { name: "永久基本农田", prop: "residentPopulation", unit: "km²" },
+        { name: "补充耕地面积", prop: "residentPopulation", unit: "km²" }
       ]
     };
   },
@@ -48,26 +49,38 @@ export default {
       this.$nextTick(() => {
         this.$refs.echartRef.setOptions(optionsData);
       });
-      // this.GetQueryListztsh(datas)
-      // this.GetQueryListztsh(datas)
+      this.GetQueryOne_nt(datas);
+      this.GetQueryOne_bh(datas);
+      this.GetQueryList(datas);
     },
-    GetQueryListztsh(datas) {
+    GetQueryOne_nt(datas) {
       let params = {
         ...datas,
-        jscType: "jsc_wpjc_ztsh",
+        jscType: "jsc_gdbh_ztgh_nt",
         id: 46
       };
-      QueryList(params).then(res => {
+      QueryOne(params).then(res => {
+        this.sdata = { ...this.sdata, ...res.data }; //&& res.data.length > 0 ? res.data[0] : {};
+      });
+    },
+    GetQueryOne_bh(datas) {
+      let params = {
+        ...datas,
+        jscType: "jsc_gdbh_ztgh_bc",
+        id: 4603
+      };
+      QueryOne(params).then(res => {
         // this.sdata = res.data && res.data.length > 0 ? res.data[0] : {};
       });
     },
-    GetQueryListztsh(datas) {
+    GetQueryList(datas) {
       let params = {
         ...datas,
-        jscType: "jsc_wpjc_ztsh",
+        jscType: "jsc_gdbh_yelx_nt",
         id: 46
       };
       QueryList(params).then(res => {
+        console.log("----", res.data);
         // this.sdata = res.data && res.data.length > 0 ? res.data[0] : {};
       });
     }