|
@@ -35,7 +35,6 @@ function confirmClick() {
|
|
|
}
|
|
|
|
|
|
const startGroup = async (nodes: any[], routeId: string) => {
|
|
|
- console.log(nodes);
|
|
|
nodesData.value = markRaw(nodes);
|
|
|
routeIdA.value = routeId;
|
|
|
|
|
@@ -92,6 +91,28 @@ const addGroup = () => {
|
|
|
groupData.value[input3.value] = [];
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
+
|
|
|
+// 新增全选相关
|
|
|
+const checked = ref<boolean>()
|
|
|
+const selectAll = (key: string) => {
|
|
|
+ if (checked.value) {
|
|
|
+ groupData.value[key] = []
|
|
|
+ nodesData.value.map((item) => {
|
|
|
+ groupData.value[key].push(item.operationId)
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ groupData.value[key] = []
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const changeChecked = (key: string) => {
|
|
|
+ if (groupData.value[key].length === nodesData.value.length) {
|
|
|
+ checked.value = true
|
|
|
+ } else {
|
|
|
+ checked.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -126,6 +147,7 @@ const addGroup = () => {
|
|
|
filterable
|
|
|
placeholder="请选择工序"
|
|
|
popper-class="custom-header"
|
|
|
+ @click="changeChecked(key)"
|
|
|
>
|
|
|
<!-- <template #header>-->
|
|
|
<!-- <el-checkbox-->
|
|
@@ -135,7 +157,10 @@ const addGroup = () => {
|
|
|
<!-- >-->
|
|
|
<!-- All-->
|
|
|
<!-- </el-checkbox>-->
|
|
|
- <!-- </template>-->
|
|
|
+ <!-- </template> -->
|
|
|
+ <template #header>
|
|
|
+ <el-checkbox v-model="checked" @change="selectAll(key)">全选</el-checkbox>
|
|
|
+ </template>
|
|
|
<el-option
|
|
|
v-for="item in nodesData"
|
|
|
:key="item.operationId"
|