Selaa lähdekoodia

模糊查询字段统一

zpf 1 vuosi sitten
vanhempi
commit
725a9ffe2c

+ 1 - 0
src/store/store.js

@@ -48,6 +48,7 @@ var store2 = {
         query_vector_input: false,
         cockpit_vector: {
             title: "",
+            word: "",
             tableData: "",
             columns: [],
         },

+ 2 - 0
src/views/cockpit/bjxm.vue

@@ -429,6 +429,8 @@ export default {
       store.setToolBarShow(false);
       store.setXzqh_flag(false);
       store.setCockpit_vector({
+        word: "",
+        word:this.left_value == 'csbj' ? '事项内容' : '报建项目名称',
         title: this.left_value == 'csbj' ? '城市报建完成项目' : '私宅报建完成项目',
         tableData: [],
         tablejscType: `jsc_bjxm_${this.left_value}_zbmx`,

+ 57 - 32
src/views/cockpit/common/VectorSpace/BoxCommonVector.vue

@@ -296,44 +296,66 @@ export default {
         change_witch() {
             this.get_search(this.state);
         },
-        get_search(word) {
-            if (word.length == 0) {
-                this.active_dableData = this.tableData;
-            } else {
-                let gy_ju = {
-                    beginTime: store.state.cockpit_date[0],
-                    endTime: store.state.cockpit_date[1],
-                    jscType: store.state.cockpit_vector.tablejscType + '_cx',
-                    id: '4602',
-                    val0: word,
+        // get_search(word) {
+        //     if (word.length == 0) {
+        //         this.active_dableData = this.tableData;
+        //     } else {
+        //         let gy_ju = {
+        //             beginTime: store.state.cockpit_date[0],
+        //             endTime: store.state.cockpit_date[1],
+        //             jscType: store.state.cockpit_vector.tablejscType + '_cx',
+        //             id: '4602',
+        //             val0: word,
 
-                }
-                if (this.title == '土地供应完成项目' || this.title == '山水工程完成项目') {
-                    gy_ju.beginTime = undefined
-                    gy_ju.endTime = undefined
-                }
+        //         }
+        //         if (this.title == '土地供应完成项目' || this.title == '山水工程完成项目') {
+        //             gy_ju.beginTime = undefined
+        //             gy_ju.endTime = undefined
+        //         }
 
-                // let bj_sl = {
-                //   beginTime: store.state.cockpit_date[0],
-                //   endTime: store.state.cockpit_date[1],
-                //   jscType: 'jsc_bjxm_csbj_zbmx_cx',
-                //   id: '4602',
-                //   val0: word,
+        //         // let bj_sl = {
+        //         //   beginTime: store.state.cockpit_date[0],
+        //         //   endTime: store.state.cockpit_date[1],
+        //         //   jscType: 'jsc_bjxm_csbj_zbmx_cx',
+        //         //   id: '4602',
+        //         //   val0: word,
 
-                // }
+        //         // }
 
-                Promise.all([QueryList(gy_ju)]).then((values) => {
-                    values[0].data.map((res) => {
-                        if (res.geom) {
-                            res.geom = wellknown.parse(res.geom.split(";")[1]);
-                        }
-                    })
-                    this.active_dableData = values[0].data
+        //         Promise.all([QueryList(gy_ju)]).then((values) => {
+        //             values[0].data.map((res) => {
+        //                 if (res.geom) {
+        //                     res.geom = wellknown.parse(res.geom.split(";")[1]);
+        //                 }
+        //             })
+        //             this.active_dableData = values[0].data
 
 
-                }).catch((error) => {
-                    console.error(error); // 如果有任何一个 promise 失败,则捕获这个错误  
-                });
+        //         }).catch((error) => {
+        //             console.error(error); // 如果有任何一个 promise 失败,则捕获这个错误  
+        //         });
+        //     }
+
+        // },
+
+        get_search(word) {
+            if (word.length == 0) {
+                this.active_dableData = this.tableData;
+            } else {
+                // console.log('this.tableData: ', this.tableData);
+                // this.active_dableData = this.tableData.filter((item) => {
+                //     item.项目名称.indexOf(word) >= 0
+                // })
+                console.log('this.tableData: ', this.word);
+
+                this.active_dableData = this.tableData.filter((item) => {
+                    console.log('item: ', item);
+                    if (item[this.word] && word) {
+                        return item[this.word].indexOf(word) >= 0;
+                    }
+                    return false;
+                })
+
             }
 
         },
@@ -368,6 +390,7 @@ export default {
                 }
             });
             this.active_dableData = data.data
+            console.log('data.data: ', data.data);
             this.tableData = data.data
         },
 
@@ -380,7 +403,9 @@ export default {
     },
     watch: {
         cockpit_vector(newVal, oldVal) {
+            console.log('newVal: ', newVal);
             this.title = newVal.title
+            this.word = newVal.word
             if (newVal.tableData.length > 0) {
 
                 this.active_dableData = newVal.tableData

+ 1 - 0
src/views/cockpit/gdbh.vue

@@ -646,6 +646,7 @@ export default {
       store.setCockpit_vector({
         title: "进出平衡",
         tableData: [],
+        word:"地类编码名称",
         tablejscType: 'jsc_tdgy_gy_zbmx',
         columns: [
           "进出状态",

+ 1 - 1
src/views/cockpit/hysy.vue

@@ -44,7 +44,7 @@ export default {
         return {
             activeName: 'first',
             radio: 'cut',
-            left_value: 'nzyd',
+            left_value: 'lsyd',
             options: [
                 { value: "nzyd", label: "农转用地" },
                 { value: "lsyd", label: "临时用地" },

+ 2 - 0
src/views/cockpit/stxf.vue

@@ -236,6 +236,8 @@ export default {
         store.setXzqh_flag(false);
         store.setCockpit_vector({
           title: "山水工程完成项目",
+          word: "项目名称",
+
           tableData: store.state.cockpit_stxf.ssgc.list,
           tablejscType: `jsc_stxf_ywlx_ssxfmx`,
           columns: ['区县编码','区县编码名称','项目名称','投资金额(万元)','治理时间','治理进度','治理面积(公顷)','备注'],

+ 1 - 0
src/views/cockpit/tdsc.vue

@@ -292,6 +292,7 @@ export default {
       store.setXzqh_flag(false);
       store.setCockpit_vector({
         title: "土地收储计划项目",
+        word:"收储项目名称",
         tableData: [],
         tablejscType: 'jsc_tdsc_zbmx',
         columns: [

+ 1 - 0
src/views/cockpit/tdsy.vue

@@ -1157,6 +1157,7 @@ export default {
       store.setCockpit_vector({
         title: "土地供应完成项目",
         tableData: this.vector_data,
+        word:"项目名称",
         tablejscType: 'jsc_tdgy_gy_zbmx',
         columns: [
           "项目名称",