From 5c8adc16e9b0c0e71998d3cefc35170fa4a60900 Mon Sep 17 00:00:00 2001 From: lkk <364857242@qq.com> Date: 星期五, 11 四月 2025 16:01:13 +0800 Subject: [PATCH] 1 --- src/components/public/index.vue | 46 ++++++++++++++++++---------------------------- 1 files changed, 18 insertions(+), 28 deletions(-) diff --git a/src/components/public/index.vue b/src/components/public/index.vue index 139adba..482915f 100644 --- a/src/components/public/index.vue +++ b/src/components/public/index.vue @@ -17,7 +17,7 @@ :inline="true" label-width="68px" > --> - <!-- <el-form-item label="鐥呯鍚嶇О" prop="bingzhong"> + <!-- <el-form-item label="鐥呯鍚嶇О" prop="bingzhong"> <el-input v-model="queryParams.bingzhong" placeholder="璇疯緭鍏ョ畝绉�" @@ -44,22 +44,21 @@ >鎼滅储</el-button > </el-form-item> --> - <!-- <el-form-item> + <!-- <el-form-item> <h3 >{{ queryParams.proName || '鏆傛棤椤圭洰鍚嶇О' }}</h3> </el-form-item> --> - <!-- <el-form-item> + <!-- <el-form-item> <h3 style="margin-left: 160px">宸查�夐」鐩�</h3> </el-form-item> --> <!-- </el-form> --> - <h2 style="text-align: center; margin-top: -30px"> - {{ queryParams.proName || "鏆傛棤椤圭洰鍚嶇О" }} - </h2> + <h2 style="text-align: center;margin-top: -30px;">{{ queryParams.proName || '鏆傛棤椤圭洰鍚嶇О' }}</h2> <div style="display: flex; width: 100%"> <div style="width: 50%; margin-right: 40px"> <el-table :data="dataList" ref="multipleTable" v-loading="loading" + row-key="aid" @selection-change="handleSelectionChange" border height="420px" @@ -159,10 +158,6 @@ type: Array, default: () => [], }, - proSex: { - type: String, - default: "2" - } }, data() { return { @@ -170,7 +165,7 @@ // 寮瑰嚭灞傛爣棰� title: "", yxbx: "", - proName: "", + proName:'', // lastDesc: "", total: 0, dataList: [], @@ -183,8 +178,8 @@ queryParams: { bingzhong: "", bzPinyin: "", - proId: "", - proSex: "2", + proId:"", + // proName:"", pageNum: 1, pageSize: 10, }, @@ -209,24 +204,15 @@ if (newVal && newVal.length > 0) { const firstProject = newVal[0]; // 浣犱篃鍙互閬嶅巻鎵�鏈夐」鐩紝鐪嬩綘涓氬姟闇�姹� this.queryParams.proId = firstProject.proId; // 鍋囪椤圭洰涓彨 id - this.proName = firstProject.proName; + // this.queryParams.proName = firstProject.proName; + this.proName = firstProject.proName } }, }, - proSex: { - handler(newVal) { - this.queryParams.proSex = newVal; - this.getList(); - }, - immediate: true - } }, mounted() {}, - created() { - this.queryParams.proSex = this.proSex; - this.getList(); - }, + created() {}, methods: { async getList() { try { @@ -251,6 +237,9 @@ if (!this.fList?.rulesList?.length) return; await this.$nextTick(); + // 鍏堟竻闄ゆ墍鏈夐�夋嫨 + this.$refs.multipleTable?.clearSelection(); + // 鍐嶈繘琛岄�夋嫨 this.dataList.forEach((item) => { const shouldSelect = this.fList.rulesList.some( (rule) => rule.aid === item.aid @@ -279,8 +268,8 @@ }, handleSelectionChange(selection) { - // this.list = selection; - this.list = [...selection]; + console.log('Selection changed:', selection); + this.list = [...selection]; // 浣跨敤灞曞紑杩愮畻绗﹀垱寤烘柊鏁扮粍 this.updateFormContent(selection); }, @@ -295,8 +284,9 @@ this.form.desc = ""; this.form.jcsj = ""; - // 浣跨敤map鍜宩oin鏇夸唬forEach鍜屽瓧绗︿覆鎷兼帴 + // 鍙湁鍦ㄦ湁閫変腑椤规椂鎵嶈繘琛屾嫾鎺� if (selection.length > 0) { + // 浣跨敤map鍜宩oin鏇夸唬forEach鍜屽瓧绗︿覆鎷兼帴 this.form.desc = selection .map((item) => item.bingzhong || item.ruleStr) .filter(Boolean) -- Gitblit v1.8.0