From 4e778d7f61e2508455e3a69815f7a17c455d81da Mon Sep 17 00:00:00 2001
From: wangting <675591594@qq.com>
Date: 星期四, 09 五月 2024 18:20:27 +0800
Subject: [PATCH] 调整列表中按钮展示位置及默认按钮

---
 Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue |   36 ++++++++++++++++++++++++++++++------
 1 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue b/Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue
index 4db1f97..2e17737 100644
--- a/Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue
+++ b/Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue
@@ -13,7 +13,7 @@
                @size-change="sizeChange"
                @row-click="rowClickChange"
                @search-change='searchChange'
-               @filter-change="filterChange"
+               @filter="filterChange"
                @selection-change="selectChange">
       <!--top鍖哄煙鎸夐挳-->
       <template slot="menuLeft" slot-scope="scope">
@@ -29,6 +29,7 @@
         <dynamic-button :componentVO="componentVO" :butttonList="componentVO.buttons" :scope="scope" :dataStore="selectList" :sourceData="sourceData"
                         LocationType="menu"
                         @afterMethod="handleRefresh"
+                        @rowView="rowView"
                         type="table"></dynamic-button>
       </template>
       <template  slot="menuRight" slot-scope="scope">
@@ -144,6 +145,7 @@
         filterBtn:false,
         selection: true,
         tip: false,
+        menuWidth:260,
         height: '100%',
         calcHeight: 15,
         indexFixed: false,
@@ -313,7 +315,7 @@
     onLoad(page, params = {}) {
       if (Object.keys(this.sourceData).length>0 && this.isShow) {
         this.loading = true;
-        getList(page.currentPage, page.pageSize, Object.assign(params,this.params,this.query)).then(res => {
+        getList(page.currentPage, page.pageSize, Object.assign({},this.params,this.query,params)).then(res => {
           let data = [];
           if (res.data && res.data.data) {
             data = res.data.data;
@@ -334,6 +336,9 @@
         });
       }
     },
+    rowView(row,index){
+      this.$refs.dataTable.rowView(row,index)
+    },
     rowClickChange(row){
       this.$refs.dataTable.toggleRowSelection(row);
     },
@@ -353,14 +358,33 @@
       this.page.pageSize = pageSize;
     },
     searchChange(params,done){
-      this.query = params;
+      this.query = {};
+      for (let i in params) {
+        this.query['conditionMap["' + i + '"]'] = "*" + params[i] + "*";
+      }
       this.page.currentPage = 1;
       this.onLoad(this.page);
       done();
     },
     filterChange(result){
-      debugger;
-
+      let parms={}
+      for (let i in result) {
+        if(!validatenull(result[i][2])) {
+          const fieldVal = result[i][2]
+          if (result[i][1] == "=") {
+            parms['conditionMap["' + result[i][0] + '"]'] = fieldVal;
+          } else if (result[i][1] == "鈮�") {
+            parms['conditionMap["' + result[i][0] + '"]'] = '!=' + fieldVal;
+          } else if (result[i][1] == "like") {
+            parms['conditionMap["' + result[i][0] + '"]'] = "*" + fieldVal + "*";
+          } else if (result[i][1] == "鈭�") {
+            parms['conditionMap["' + result[i][0] + '"]'] = "*" + fieldVal + "*";
+          } else {
+            parms['conditionMap["' + result[i][0] + '"]'] = result[i][1] + fieldVal;
+          }
+        }
+      }
+      this.onLoad(this.page,parms);
     },
     searchReset() {
       this.query = {};
@@ -375,7 +399,7 @@
       }
     },
     handleRefresh(type) {
-      this.onLoad(this.page, this.query);
+      this.onLoad(this.page);
     },
     rowExcel() {
       //瀵煎嚭

--
Gitblit v1.9.3