fix: 修改bug(13663、15022、13672)
This commit is contained in:
parent
743f5b3fd7
commit
c42a5139d5
|
@ -62,7 +62,8 @@ const check = async (): Promise<boolean> => {
|
|||
let hasProperties = false
|
||||
if (metadata.properties.length) {
|
||||
if (deviceTrigger.operation?.readProperties && deviceTrigger.operation?.readProperties.length) {
|
||||
hasProperties = metadata.properties.every((item: any) => deviceTrigger.operation!.readProperties!.includes(item.id))
|
||||
// hasProperties = metadata.properties.every((item: any) => deviceTrigger.operation!.readProperties!.includes(item.id))
|
||||
hasProperties = deviceTrigger.operation!.readProperties.every(_id => metadata.properties.some((item: any) => item.id === _id))
|
||||
} else if (deviceTrigger.operation?.writeProperties && Object.keys(deviceTrigger.operation?.writeProperties).length) {
|
||||
const key = Object.keys(deviceTrigger.operation?.writeProperties)[0]
|
||||
hasProperties = metadata.properties.some((item: any) => key ===item.id)
|
||||
|
|
|
@ -125,7 +125,8 @@ const checkDeviceDelete = async () => {
|
|||
if (item!.selectorValues && metadata?.tags?.length) {
|
||||
const values = (item!.selectorValues?.[0]?.value as any).map((item: any) => item.column)
|
||||
const tagKeys = new Set(values)
|
||||
hasAllTags = metadata?.tags?.every((item: any) => tagKeys.has(item.id))
|
||||
hasAllTags = [...tagKeys.values()].every((_key) => metadata?.tags.some((item: any) => item.id === _key))
|
||||
// hasAllTags = metadata?.tags?.every((item: any) => tagKeys.has(item.id))
|
||||
}
|
||||
if (!hasAllTags) {
|
||||
_data.value.branches![props.branchesName].then[props.thenName].actions[props.name].device!.selectorValues = undefined
|
||||
|
|
|
@ -584,6 +584,7 @@ const table = {
|
|||
refresh: () => {
|
||||
nextTick(() => {
|
||||
tableRef.value.reload();
|
||||
table.cancelSelect()
|
||||
});
|
||||
},
|
||||
};
|
||||
|
|
|
@ -192,6 +192,7 @@
|
|||
v-for="i in table.getActions(slotProps, 'table')"
|
||||
:hasPermission="i.permission"
|
||||
type="link"
|
||||
:key="i.key"
|
||||
:tooltip="i?.tooltip"
|
||||
:pop-confirm="i.popConfirm"
|
||||
@click="i.onClick"
|
||||
|
@ -576,6 +577,7 @@ const table = {
|
|||
refresh: () => {
|
||||
nextTick(() => {
|
||||
tableRef.value.reload();
|
||||
table.cancelSelect()
|
||||
});
|
||||
},
|
||||
addConfirm: () => {
|
||||
|
|
|
@ -39,7 +39,7 @@ export const mergeArr = (oldData: Array<any>, newData: Array<any>) => {
|
|||
return newItem;
|
||||
}
|
||||
|
||||
if(oldItem && newItem){
|
||||
if (oldItem && newItem) {
|
||||
oldItem.sortIndex = newItem?.sortIndex
|
||||
}
|
||||
|
||||
|
@ -60,9 +60,7 @@ export const mergeArr = (oldData: Array<any>, newData: Array<any>) => {
|
|||
(child) => child.code === oldChild.code,
|
||||
);
|
||||
if (index !== -1) {
|
||||
mergedChildren.push(
|
||||
mergeItem(oldChild, newChildren[index]),
|
||||
);
|
||||
mergedChildren.push(mergeItem(oldChild, newChildren[index]));
|
||||
newChildren.splice(index, 1);
|
||||
} else {
|
||||
//防止重复code,系统已经选中的code不能再从old中添加
|
||||
|
@ -71,13 +69,14 @@ export const mergeArr = (oldData: Array<any>, newData: Array<any>) => {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
...oldItem,
|
||||
children: mergedChildren.concat(newChildren),
|
||||
};
|
||||
}
|
||||
|
||||
return oldItem;
|
||||
return oldItem
|
||||
};
|
||||
|
||||
for (const newItem of newData) {
|
||||
|
@ -102,7 +101,7 @@ export const mergeArr = (oldData: Array<any>, newData: Array<any>) => {
|
|||
}
|
||||
}
|
||||
|
||||
return mergedData;
|
||||
return mergedData
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -312,12 +311,9 @@ export const getNodeDepth = (node: any) => {
|
|||
|
||||
export const handleSorts = (node: any[]) => {
|
||||
if (!node) return []
|
||||
return node.map((item, index) => {
|
||||
if (item.index !== index) {
|
||||
item.sortIndex = index
|
||||
if (item.children) {
|
||||
item.children = handleSorts(item.children).sort((a, b) => a.sortIndex - b.sortIndex)
|
||||
}
|
||||
return node.sort((a, b) => a.sortIndex - b.sortIndex).map((item) => {
|
||||
if (item.children) {
|
||||
item.children = handleSorts(item.children)
|
||||
}
|
||||
return item
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue