52585 标准清单发布/更新流程 选择清单中勾选一个 外面的复选框也会被同步勾选

This commit is contained in:
宋伟佳
2022-04-18 14:43:21 +08:00
parent 181cc36207
commit 81780a1a1c
4 changed files with 38 additions and 16 deletions
+4 -4
View File
@@ -11,10 +11,10 @@
<title>标准法规管理系统</title>
<script src = "https://cdn.jsdelivr.net/npm/proxy-polyfill@0.3.0/proxy.min.js"></script>
<!-- vconsole调试工具-->
<script src="https://cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js"></script>
<script type="text/javascript">
var vConsole = new VConsole();
</script>
<!-- <script src="https://cdn.bootcss.com/vConsole/3.3.4/vconsole.min.js"></script>-->
<!-- <script type="text/javascript">-->
<!-- var vConsole = new VConsole();-->
<!-- </script>-->
</head>
<body class="el-drawer-body">
<div id="app"></div>
@@ -237,6 +237,7 @@
</div>
<!-- 选择已拆分标准抽屉-->
<el-drawer
class="drawer-table"
title="标准库"
:visible.sync="ListModel"
size="900px"
@@ -365,6 +366,7 @@
</el-drawer>
<!-- 添加抽屉-->
<el-drawer
class="drawer-table"
title="添加项目群"
:visible.sync="ProjectModel"
size="950px"
@@ -1389,6 +1391,11 @@ export default {
.demo-drawer-content {
margin-top: 10px;
}
.drawer-table{
/deep/.el-drawer__body{
overflow-y: hidden;
}
}
}
</style>
@@ -235,6 +235,7 @@
</div>
<!-- 选择清单抽屉-->
<el-drawer
class="drawer-table"
title="选择清单"
:visible.sync="ListModel"
size="900px"
@@ -533,6 +534,7 @@
</el-drawer>
<!-- 添加标准抽屉-->
<el-drawer
class="drawer-table"
title="添加标准"
:visible.sync="standModel"
size="900px"
@@ -1419,29 +1421,29 @@ export default {
// 表格某一行的单击事件
rowClick(row, column) {
const selectData = this.selectList;
this.$refs.selection.clearSelection();
this.$refs.detailedSelection.clearSelection();
if (selectData.length === 1) {
selectData.forEach(item => {
// 判断 如果当前的一行被勾选, 再次点击的时候就会取消选中
if (item === row) {
this.$refs.selection.toggleRowSelection(row, false);
this.$refs.detailedSelection.toggleRowSelection(row, false);
}
// 不然就让当前的一行勾选
else {
this.$refs.selection.toggleRowSelection(row, true);
this.$refs.detailedSelection.toggleRowSelection(row, true);
}
});
} else {
this.$refs.selection.toggleRowSelection(row, true);
this.$refs.detailedSelection.toggleRowSelection(row, true);
}
},
select(selection, row) {
// 清除 所有勾选项
this.$refs.selection.clearSelection();
this.$refs.detailedSelection.clearSelection();
// 当表格数据都没有被勾选的时候 就返回
// 主要用于将当前勾选的表格状态清除
if (selection.length === 0) return;
this.$refs.selection.toggleRowSelection(row, true);
this.$refs.detailedSelection.toggleRowSelection(row, true);
},
//标准表格选择框改变
selectStandChange(data) {
@@ -1633,5 +1635,10 @@ export default {
height: calc(~'100% - 65px');
overflow: auto;
}
.drawer-table{
/deep/.el-drawer__body{
overflow-y: hidden;
}
}
}
</style>
@@ -235,6 +235,7 @@
</div>
<!-- 选择清单抽屉-->
<el-drawer
class="drawer-table"
title="选择清单"
:visible.sync="ListModel"
size="900px"
@@ -503,6 +504,7 @@
</el-drawer>
<!-- 添加标准抽屉-->
<el-drawer
class="drawer-table"
title="添加标准"
:visible.sync="standModel"
size="900px"
@@ -1387,12 +1389,13 @@ export default {
}
},
select(selection, row) {
console.log(selection);
// 清除 所有勾选项
this.$refs.selection.clearSelection()
this.$refs.detailedSelection.clearSelection()
// 当表格数据都没有被勾选的时候 就返回
// 主要用于将当前勾选的表格状态清除
if(selection.length === 0) return
this.$refs.selection.toggleRowSelection(row, true)
this.$refs.detailedSelection.toggleRowSelection(row, true)
},
//添加标准select的改变
selectThree(data) {
@@ -1401,21 +1404,21 @@ export default {
// 表格某一行的单击事件
rowClick(row, column) {
const selectData = this.selectList
this.$refs.selection.clearSelection()
this.$refs.detailedSelection.clearSelection()
if( selectData.length === 1 ) {
selectData.forEach(item => {
// 判断 如果当前的一行被勾选, 再次点击的时候就会取消选中
if (item === row) {
this.$refs.selection.toggleRowSelection(row, false);
this.$refs.detailedSelection.toggleRowSelection(row, false);
}
// 不然就让当前的一行勾选
else {
this.$refs.selection.toggleRowSelection(row, true);
this.$refs.detailedSelection.toggleRowSelection(row, true);
}
})
}
else {
this.$refs.selection.toggleRowSelection(row, true);
this.$refs.detailedSelection.toggleRowSelection(row, true);
}
},
choiceZRR(type, title, id) {
@@ -1595,5 +1598,10 @@ export default {
height: calc(~'100% - 65px');
overflow: auto;
}
.drawer-table{
/deep/.el-drawer__body{
overflow-y: hidden;
}
}
}
</style>