|
@@ -65,10 +65,10 @@ const handleCheckAllChange = (checkAll, index, item, subIndex) => {
|
|
|
menuactionList.value[index].child[subIndex].child.forEach(element => {
|
|
|
const findindex = menuactionList.value[index].child[
|
|
|
subIndex
|
|
|
- ].checkList.findIndex(findItem => findItem === String(element.action_id));
|
|
|
+ ].checkList.findIndex(findItem => findItem === Number(element.id));
|
|
|
if (checkAll && findindex == -1) {
|
|
|
menuactionList.value[index].child[subIndex].checkList.push(
|
|
|
- String(element.action_id)
|
|
|
+ Number(element.id)
|
|
|
);
|
|
|
} else if (!checkAll && findindex > -1) {
|
|
|
menuactionList.value[index].child[subIndex].checkList.splice(
|
|
@@ -104,7 +104,7 @@ const handleCheckedGroupChange = (event, index, item, subIndex) => {
|
|
|
].child[subIndex].child.every(
|
|
|
evitem =>
|
|
|
menuactionList.value[index].child[subIndex].checkList.findIndex(
|
|
|
- finditem => finditem == evitem.action_id
|
|
|
+ finditem => finditem == Number(evitem.id)
|
|
|
) > -1
|
|
|
);
|
|
|
};
|
|
@@ -116,7 +116,7 @@ const handleFieldGroupChange = (event, index, item, subIndex) => {
|
|
|
].child[subIndex].child.every(
|
|
|
evitem =>
|
|
|
menuactionList.value[index].child[subIndex].fieldList.findIndex(
|
|
|
- finditem => finditem == evitem.action_id
|
|
|
+ finditem => finditem == Number( evitem.id)
|
|
|
) > -1
|
|
|
);
|
|
|
};
|
|
@@ -296,7 +296,7 @@ const initData = async () => {
|
|
|
y.child.map(z => {
|
|
|
const Aindex =
|
|
|
action_list.value.length > 0
|
|
|
- ? action_list.value.findIndex(a => a == z.action_id)
|
|
|
+ ? action_list.value.findIndex(a => a == z.id)
|
|
|
: -1;
|
|
|
if (Aindex !== -1) {
|
|
|
y.checkList.push(action_list.value[Aindex]);
|
|
@@ -350,13 +350,15 @@ let indeterminateCheck = computed(() => {
|
|
|
// 选中子节点的数量
|
|
|
const selectItemLength = item.child.filter(
|
|
|
filitem =>
|
|
|
- item.checkList.findIndex(finditem => finditem == filitem.id) > -1
|
|
|
+ item.checkList.findIndex(finditem => Number(finditem) == filitem.id) > -1
|
|
|
).length;
|
|
|
// 未选中子节点的数量
|
|
|
const noSlectItemLength = item.child.filter(
|
|
|
filitem =>
|
|
|
- item.checkList.findIndex(finditem => finditem == filitem.id) == -1
|
|
|
+ item.checkList.findIndex(finditem => Number(finditem) == filitem.id) == -1
|
|
|
).length;
|
|
|
+
|
|
|
+ console.log(selectItemLength,noSlectItemLength)
|
|
|
// // 当前节点的index
|
|
|
// 存在选中子节点且存在未选中子节点为中间态
|
|
|
return selectItemLength > 0 && noSlectItemLength > 0;
|
|
@@ -516,12 +518,12 @@ let indeterminateField = computed(() => {
|
|
|
<el-checkbox
|
|
|
:disabled="editType == 'view'"
|
|
|
v-for="children in subItem.child"
|
|
|
- :key="'checkItem' + children.action_id"
|
|
|
- :label="Number(children.action_id)"
|
|
|
+ :key="'checkItem' + children.id"
|
|
|
+ :label="Number(children.id)"
|
|
|
@change="
|
|
|
handleCheckedChange(
|
|
|
$event,
|
|
|
- Number(children.action_id),
|
|
|
+ Number(children.id),
|
|
|
index,
|
|
|
subIndex,
|
|
|
item
|