fix: bug#16434
This commit is contained in:
parent
70cf9c0268
commit
1949018900
|
@ -274,6 +274,8 @@ const beginAction = () => {
|
||||||
};
|
};
|
||||||
const stopAction = () => {
|
const stopAction = () => {
|
||||||
isBeginning.value = true;
|
isBeginning.value = true;
|
||||||
|
console.log(ws.value)
|
||||||
|
debugger
|
||||||
if (ws.value) {
|
if (ws.value) {
|
||||||
ws.value.unsubscribe?.();
|
ws.value.unsubscribe?.();
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,5 +6,6 @@ export const createScript = (src: string) => {
|
||||||
}
|
}
|
||||||
script.setAttribute('type', 'text/javascript')
|
script.setAttribute('type', 'text/javascript')
|
||||||
script.setAttribute('src', src)
|
script.setAttribute('src', src)
|
||||||
|
document.body.appendChild(script)
|
||||||
})
|
})
|
||||||
}
|
}
|
|
@ -187,7 +187,7 @@ const handleOk = () => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
btnLoading.value = true;
|
btnLoading.value = true;
|
||||||
queryDeviceMapping(instanceStore.current.id)
|
queryDeviceMapping(instanceStore.current.id, )
|
||||||
.then(res => {
|
.then(res => {
|
||||||
const arr = bindDeviceRef.value?._dataSource.filter(item => {
|
const arr = bindDeviceRef.value?._dataSource.filter(item => {
|
||||||
return !res.result?.[0]?.find(val => val.deviceId === item.id) && _selectedRowKeys.value.includes(item.id);
|
return !res.result?.[0]?.find(val => val.deviceId === item.id) && _selectedRowKeys.value.includes(item.id);
|
||||||
|
|
|
@ -95,7 +95,7 @@ const handleChange = async (info: UploadChangeParam) => {
|
||||||
Notification.error({
|
Notification.error({
|
||||||
// key: '403',
|
// key: '403',
|
||||||
message: '系统提示',
|
message: '系统提示',
|
||||||
description: '系统未知错误,请反馈给管理员',
|
description: info.file.response?.message,
|
||||||
});
|
});
|
||||||
// emit('update:modelValue', { err:'file_upload_error'});
|
// emit('update:modelValue', { err:'file_upload_error'});
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
|
|
@ -111,7 +111,7 @@ import {
|
||||||
USER_CENTER_MENU_CODE
|
USER_CENTER_MENU_CODE
|
||||||
} from '@/utils/consts'
|
} from '@/utils/consts'
|
||||||
import { isNoCommunity } from '@/utils/utils'
|
import { isNoCommunity } from '@/utils/utils'
|
||||||
import {useIndirectMenusMap} from "@/views/system/Role/Detail/components/util";
|
import {permissionsGranted, useIndirectMenusMap} from "@/views/system/Role/Detail/components/util";
|
||||||
|
|
||||||
const emits = defineEmits(['update:selectItems']);
|
const emits = defineEmits(['update:selectItems']);
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -303,12 +303,20 @@ function getAllPermiss() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const hasIndirectMenus = (data: any) => {
|
const hasIndirectMenus = (data: any) => {
|
||||||
|
let indirectMenus = []
|
||||||
if (data.children) {
|
if (data.children) {
|
||||||
const has = data.children.find(item => item.indirectMenus)
|
const item = data.children.find(item => item.indirectMenus)
|
||||||
console.log(has)
|
indirectMenus = item.indirectMenus
|
||||||
} else if (data?.indirectMenus) {
|
} else if (data?.indirectMenus) {
|
||||||
console.log(data.indirectMenus)
|
indirectMenus = data.indirectMenus
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (indirectMenus.length) {
|
||||||
|
const ids = permissionsGranted(tableData.value)
|
||||||
|
console.log(ids, indirectMenus)
|
||||||
|
const inMenu = false
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -322,7 +330,7 @@ function menuChange(
|
||||||
): undefined {
|
): undefined {
|
||||||
console.log('menuChange', row)
|
console.log('menuChange', row)
|
||||||
// 判断是否需要对子菜单及操作权限进行选择
|
// 判断是否需要对子菜单及操作权限进行选择
|
||||||
hasIndirectMenus(row)
|
// hasIndirectMenus(row)
|
||||||
if (setButtonBool) {
|
if (setButtonBool) {
|
||||||
if (row.buttons && row.buttons.length > 0)
|
if (row.buttons && row.buttons.length > 0)
|
||||||
row.buttons.forEach((button) => {
|
row.buttons.forEach((button) => {
|
||||||
|
|
|
@ -27,4 +27,15 @@ export const useIndirectMenusMap = (tableData: Ref<any[]>) => {
|
||||||
return {
|
return {
|
||||||
PermissionsMap
|
PermissionsMap
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export const permissionsGranted = (data: any[]) => {
|
||||||
|
return data.reduce((prev,current) => {
|
||||||
|
let ids = current.granted ? [...prev, current.id] : prev
|
||||||
|
if (current.children) {
|
||||||
|
const _ids = permissionsGranted(current.children)
|
||||||
|
ids = ids.concat(_ids)
|
||||||
|
}
|
||||||
|
return ids
|
||||||
|
}, [])
|
||||||
}
|
}
|
Loading…
Reference in New Issue