| | |
| | | :data="dataList" |
| | | ref="multipleTable" |
| | | v-loading="loading" |
| | | row-key="aid" |
| | | @selection-change="handleSelectionChange" |
| | | border |
| | | height="420px" |
| | |
| | | bingzhong: "", |
| | | bzPinyin: "", |
| | | proId:"", |
| | | proName:"", |
| | | // proName:"", |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | }, |
| | |
| | | if (newVal && newVal.length > 0) { |
| | | const firstProject = newVal[0]; // 你也可以遍历所有项目,看你业务需求 |
| | | this.queryParams.proId = firstProject.proId; // 假设项目中叫 id |
| | | this.queryParams.proName = firstProject.proName; // 假设叫 proName |
| | | // this.queryParams.proName = firstProject.proName; |
| | | this.proName = firstProject.proName |
| | | } |
| | | }, |
| | |
| | | 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 |
| | |
| | | }, |
| | | |
| | | handleSelectionChange(selection) { |
| | | this.list = selection; |
| | | console.log('Selection changed:', selection); |
| | | this.list = [...selection]; // 使用展开运算符创建新数组 |
| | | this.updateFormContent(selection); |
| | | }, |
| | | |
| | | updateFormContent(selection) { |
| | | if (!selection.length) return; |
| | | |
| | | // 如果处于检查状态,使用传入的值 |
| | | if (this.checkStatus === "1") { |
| | | this.updateData(this.proResult, this.conclusion); |
| | |
| | | this.form.desc = ""; |
| | | this.form.jcsj = ""; |
| | | |
| | | // 使用map和join替代forEach和字符串拼接 |
| | | this.form.desc = selection |
| | | .map((item) => item.bingzhong || item.ruleStr) |
| | | .filter(Boolean) |
| | | .join(","); |
| | | // 只有在有选中项时才进行拼接 |
| | | if (selection.length > 0) { |
| | | // 使用map和join替代forEach和字符串拼接 |
| | | this.form.desc = selection |
| | | .map((item) => item.bingzhong || item.ruleStr) |
| | | .filter(Boolean) |
| | | .join(","); |
| | | |
| | | this.form.jcsj = selection |
| | | .map((item) => item.yxbx) |
| | | .filter(Boolean) |
| | | .join(","); |
| | | this.form.jcsj = selection |
| | | .map((item) => item.yxbx) |
| | | .filter(Boolean) |
| | | .join(","); |
| | | } |
| | | }, |
| | | |
| | | handleOk() { |