From a5d01d5503750b6c95f9393d7cd4da880de6024c Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 28 八月 2023 15:50:51 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.110.209:9001/r/lims-before
---
src/views/basicData/index.vue | 82 ++++++-----------------------------------
1 files changed, 12 insertions(+), 70 deletions(-)
diff --git a/src/views/basicData/index.vue b/src/views/basicData/index.vue
index 576920a..7aa28c5 100644
--- a/src/views/basicData/index.vue
+++ b/src/views/basicData/index.vue
@@ -52,12 +52,8 @@
width="30%"
right
:before-close="handleClose"
+ :title="isUpdate ? '鏇存柊' : '鏂板'"
>
- <template slot="title">
- <div class="addTop">
- <span>{{ isUpdate ? "鏇存柊" : "鏂板" }}鍩虹鏁版嵁</span>
- </div>
- </template>
<el-form :model="form" :rules="rules" ref="ruleForm" class="addForm">
<el-form-item prop="material" required>
<span>鏍峰搧鍚嶇О锛�</span>
@@ -136,13 +132,14 @@
<el-table
:data="tableData"
style="width: 100%; margin-bottom: 20px"
- row-key="name"
+ row-key="id"
border
height="calc(100vh - 250px)"
default-expand-all
ref="multipleTable"
@select="selectTr"
@select-all="selectAll"
+ @selection-change="handleSelectionChange"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<el-table-column type="selection" label="搴忓彿"> </el-table-column>
@@ -344,23 +341,6 @@
this.isAllSelect = !this.isAllSelect;
let data = this.tableData;
this.toggleSelect(data, this.isAllSelect, "all");
- // 鑷畾涔�
- if (this.isAllSelect) {
- val.forEach((i) => {
- let isExist = false;
- this.deleteList.findIndex((c) => {
- if (c === i.id) {
- isExist = true;
- }
- });
- if (!isExist && i.id !== undefined) {
- this.deleteList.push(i.id);
- }
- });
- } else {
- this.deleteList.splice(0, this.deleteList.length);
- }
- // 鑷畾涔夌粨鏉�
},
//閫夋嫨鏌愯
selectTr(selection, row) {
@@ -369,33 +349,6 @@
this.isAllSelect = row.isChecked;
this.toggleSelect(row, row.isChecked, "tr");
});
-
- if (row.isChecked === true) {
- if (row.children !== undefined) {
- row.children.forEach((i) => {
- this.deleteList.push(i.id);
- });
- } else {
- this.deleteList.push(row.id);
- }
- } else if (row.isChecked === false) {
- if (row.children !== undefined) {
- row.children.forEach((i) => {
- this.deleteList.findIndex((c, index) => {
- if (c === i.id) {
- this.deleteList.splice(index, 1);
- return;
- }
- });
- });
- }
- this.deleteList.findIndex((c, index) => {
- if (c === row.id) {
- this.deleteList.splice(index, 1);
- return;
- }
- });
- }
},
//閫掑綊瀛愮骇
toggleSelect(data, flag, type) {
@@ -428,6 +381,15 @@
this.$refs.multipleTable.clearSelection();
}
});
+ },
+ handleSelectionChange(val) {
+ this.deleteList = [];
+ val.forEach((v) => {
+ if (v.id !== undefined) {
+ this.deleteList.push(v.id);
+ }
+ });
+ console.log(`output->this.deleteList`, this.deleteList);
},
// 琛ㄦ牸鏍戝叏閮ㄩ�変腑閰嶇疆 缁撴潫
deleteListClick() {
@@ -492,12 +454,6 @@
position: relative;
padding: 0 10px 10px 10px;
}
-.el-dialog__header {
- padding: 0;
-}
-.el-dialog__headerbtn {
- top: 0;
-}
.el-dialog__close {
padding: 8px 0;
color: #ffffff !important;
@@ -513,20 +469,6 @@
}
.el-dialog__body {
padding: 30px 20px 0 20px;
-}
-.addTop {
- border-top-left-radius: 10px;
- border-top-right-radius: 10px;
- background-color: #00a5ff;
- color: #ffffff;
- padding: 8px 20px;
- float: left;
- height: 30px;
- width: 100%;
-}
-.addTop span {
- font-size: 16px;
- font-weight: 700;
}
.table_div {
margin-top: 10px;
--
Gitblit v1.9.3