完善生产查询与登录权限配置

This commit is contained in:
2026-09-03 19:56:19 +08:00
parent 793f140a45
commit 02c8fb7021
438 changed files with 1595 additions and 573 deletions
@@ -0,0 +1,21 @@
import { type ComponentInternalInstance, getCurrentInstance } from 'vue';
export function parent(componentName?: string, _instance: ComponentInternalInstance | null | undefined = null) {
const instance = _instance || getCurrentInstance();
let parent = instance && (instance.parent as ComponentInternalInstance | null | undefined);
while (parent) {
const name = (parent.type as any)?.name as string | undefined;
if (name === componentName) {
return parent;
}
parent = parent.parent;
}
return null;
}
export function parentData(componentName?: string, _instance: ComponentInternalInstance | null | undefined = null) {
const instance = _instance || getCurrentInstance();
const findParent = parent(componentName, instance);
return findParent ? findParent.exposed : null;
}