|
|
@@ -5,7 +5,7 @@ import { unref } from 'vue';
|
|
|
import { isObject } from '/@/utils/is';
|
|
|
import { cloneDeep } from 'lodash-es';
|
|
|
|
|
|
-export const noop = () => { };
|
|
|
+export const noop = () => {};
|
|
|
|
|
|
/**
|
|
|
* @description: Set ui mount node
|
|
|
@@ -74,10 +74,10 @@ export function getRawRoute(route: RouteLocationNormalized): RouteLocationNormal
|
|
|
...opt,
|
|
|
matched: (matched
|
|
|
? matched.map((item: any) => ({
|
|
|
- meta: item.meta,
|
|
|
- name: item.name,
|
|
|
- path: item.path,
|
|
|
- }))
|
|
|
+ meta: item.meta,
|
|
|
+ name: item.name,
|
|
|
+ path: item.path,
|
|
|
+ }))
|
|
|
: undefined) as RouteRecordNormalized[],
|
|
|
};
|
|
|
}
|
|
|
@@ -123,26 +123,29 @@ export function getAllParentKeys(treeData: Array<any>, key: string) {
|
|
|
|
|
|
// 获取字典值
|
|
|
export function formatDictValue(options: Array<any>, value: string) {
|
|
|
- if (!value || !options) {
|
|
|
- return '';
|
|
|
+ if (!value) {
|
|
|
+ if (value != '0' || !options) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
}
|
|
|
let matchItem = '';
|
|
|
-
|
|
|
if (typeof value == 'boolean') {
|
|
|
matchItem = value ? '是' : '否';
|
|
|
return matchItem;
|
|
|
}
|
|
|
- matchItem = options.find(item => item['value'] === value);
|
|
|
+ matchItem = options.find(item => (item['value'] as string) == value);
|
|
|
return matchItem && matchItem['label'] ? matchItem['label'] : '';
|
|
|
}
|
|
|
|
|
|
// 获取字典颜色
|
|
|
export function formatDictColor(options: Array<any>, value: string) {
|
|
|
- if (!value || !options) {
|
|
|
- return '';
|
|
|
+ if (!value) {
|
|
|
+ if (value != '0' || !options) {
|
|
|
+ return '';
|
|
|
+ }
|
|
|
}
|
|
|
let matchItem = '';
|
|
|
- matchItem = options.find(item => item['value'] === value);
|
|
|
+ matchItem = options.find(item => item['value'] == value);
|
|
|
return matchItem && matchItem['color'] ? matchItem['color'] : '';
|
|
|
}
|
|
|
|