| | |
| | | } from 'vue' |
| | | import { ElMessage } from 'element-plus' |
| | | import sdk from 'sdk' |
| | | import { Permission, UserInfo, Props } from './Permission.d' |
| | | import { Permission, UserInfo, Props, EditionTypeEnum } from './Permission.d' |
| | | import { useGlobalState } from '../Store/Store' |
| | | import { FeatureType } from '../Store/Store.d' |
| | | |
| | | import { get } from 'lodash' |
| | | import { clone, cloneDeep, get, isBoolean } from 'lodash' |
| | | import { editionMap } from '../enum' |
| | | import { _t } from '../Language/Language' |
| | | |
| | |
| | | */ |
| | | const permissionCodes = ref<string[]>([]) |
| | | |
| | | const featureMap = ref<Record<string, any>>({}) |
| | | const featureMap = ref<Record<string, FeatureType>>({}) |
| | | |
| | | /** |
| | | * 校验权限,发出警告 |
| | |
| | | } |
| | | |
| | | export const vEditionShow: { [key: string]: Directive } = { |
| | | updated(el: HTMLElement, binding: DirectiveBinding<any>) { |
| | | updated(el: HTMLElement, binding: DirectiveBinding<EditionTypeEnum>) { |
| | | if (el) { |
| | | const state: Record<string, any> = useGlobalState() |
| | | const l = Object.keys(state.featureMap.state.value)?.length |
| | |
| | | } |
| | | |
| | | /** |
| | | * 功能版本控制 |
| | | */ |
| | | export const useEditionFeature = async () => { |
| | | const state = useGlobalState() |
| | | const { getSystemConfig } = state |
| | | |
| | | // @ts-ignore |
| | | await getSystemConfig(true) |
| | | featureMap.value = state.featureMap.state.value |
| | | } |
| | | |
| | | /** |
| | | * 初始化权限 |
| | | * @param props |
| | | * @param permissionMap |