@ditari/bsui 1.1.47 → 1.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/menu/Menu.cjs +6 -1
- package/dist/cjs/menu/Menu.cjs.map +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/menu/Menu.mjs +6 -1
- package/dist/esm/menu/Menu.mjs.map +1 -1
- package/package.json +7 -3
- package/example/index.html +0 -13
- package/example/node_modules/.vite/deps/@ant-design_icons-vue.js +0 -29406
- package/example/node_modules/.vite/deps/@ant-design_icons-vue.js.map +0 -7
- package/example/node_modules/.vite/deps/@vueuse_core.js +0 -8255
- package/example/node_modules/.vite/deps/@vueuse_core.js.map +0 -7
- package/example/node_modules/.vite/deps/_metadata.json +0 -80
- package/example/node_modules/.vite/deps/ant-design-vue.js +0 -62756
- package/example/node_modules/.vite/deps/ant-design-vue.js.map +0 -7
- package/example/node_modules/.vite/deps/axios.js +0 -2126
- package/example/node_modules/.vite/deps/axios.js.map +0 -7
- package/example/node_modules/.vite/deps/chunk-5WWUZCGV.js +0 -36
- package/example/node_modules/.vite/deps/chunk-5WWUZCGV.js.map +0 -7
- package/example/node_modules/.vite/deps/chunk-D36HXFYL.js +0 -25
- package/example/node_modules/.vite/deps/chunk-D36HXFYL.js.map +0 -7
- package/example/node_modules/.vite/deps/chunk-EBDM3ESC.js +0 -161
- package/example/node_modules/.vite/deps/chunk-EBDM3ESC.js.map +0 -7
- package/example/node_modules/.vite/deps/chunk-EKNPBJBG.js +0 -3600
- package/example/node_modules/.vite/deps/chunk-EKNPBJBG.js.map +0 -7
- package/example/node_modules/.vite/deps/chunk-GK7Q6YQN.js +0 -10796
- package/example/node_modules/.vite/deps/chunk-GK7Q6YQN.js.map +0 -7
- package/example/node_modules/.vite/deps/chunk-TDI2FIXO.js +0 -19
- package/example/node_modules/.vite/deps/chunk-TDI2FIXO.js.map +0 -7
- package/example/node_modules/.vite/deps/package.json +0 -3
- package/example/node_modules/.vite/deps/pinia-plugin-persistedstate.js +0 -125
- package/example/node_modules/.vite/deps/pinia-plugin-persistedstate.js.map +0 -7
- package/example/node_modules/.vite/deps/pinia.js +0 -1519
- package/example/node_modules/.vite/deps/pinia.js.map +0 -7
- package/example/node_modules/.vite/deps/vue-request.js +0 -1191
- package/example/node_modules/.vite/deps/vue-request.js.map +0 -7
- package/example/node_modules/.vite/deps/vue-router.js +0 -2667
- package/example/node_modules/.vite/deps/vue-router.js.map +0 -7
- package/example/node_modules/.vite/deps/vue.js +0 -314
- package/example/node_modules/.vite/deps/vue.js.map +0 -7
- package/example/package.json +0 -17
- package/example/src/App.vue +0 -7
- package/example/src/api/list.ts +0 -22
- package/example/src/api/user.ts +0 -13
- package/example/src/components/AppMain.vue +0 -113
- package/example/src/hooks.ts +0 -103
- package/example/src/main.ts +0 -22
- package/example/src/router/form/index.route.ts +0 -23
- package/example/src/router/index.ts +0 -61
- package/example/src/router/table/index.route.ts +0 -39
- package/example/src/views/Demo.vue +0 -49
- package/example/src/views/DemoBk.vue +0 -34
- package/example/src/views/Login.vue +0 -79
- package/example/src/views/form/List.vue +0 -16
- package/example/src/views/form/List2.vue +0 -74
- package/example/src/views/form/QueryFormDemo.vue +0 -49
- package/example/src/views/form/dyn/List.vue +0 -121
- package/example/src/views/table/Add.vue +0 -377
- package/example/src/views/table/Demo.vue +0 -15
- package/example/src/views/table/Demo2.vue +0 -12
- package/example/src/views/table/Edit.vue +0 -10
- package/example/src/views/table/List.vue +0 -415
- package/example/src/views/table/Test.tsx +0 -42
- package/example/src/views/table/TestModal.vue +0 -64
- package/example/src/views/table/WorkStatusRound.vue +0 -31
- package/example/src/views/table/components/AddForm.vue +0 -44
- package/example/src/views/table/hooks.ts +0 -106
- package/example/src/views/task/Todo.vue +0 -6
- package/example/tsconfig.json +0 -16
- package/example/utils/http.ts +0 -107
- package/example/vite-env.d.ts +0 -8
- package/example/vite.config.ts +0 -10
- package/src/_utils/html.ts +0 -17
- package/src/_utils/install.ts +0 -12
- package/src/components.ts +0 -10
- package/src/config/Config.vue +0 -8
- package/src/date/RangePicker.tsx +0 -93
- package/src/date/index.ts +0 -9
- package/src/desensitize/Desensitize.tsx +0 -97
- package/src/desensitize/index.ts +0 -9
- package/src/desensitize/style/index.scss +0 -8
- package/src/dic/DicReplace.tsx +0 -63
- package/src/dic/index.ts +0 -8
- package/src/dic/replace.worker.ts +0 -25
- package/src/form/DQueryForm.tsx +0 -258
- package/src/form/index.ts +0 -9
- package/src/form/style/index.less +0 -0
- package/src/grid/Grid.tsx +0 -83
- package/src/grid/GridItem.tsx +0 -15
- package/src/grid/index.md +0 -4
- package/src/grid/index.ts +0 -16
- package/src/grid/style/index.scss +0 -70
- package/src/index.scss +0 -19
- package/src/index.ts +0 -50
- package/src/json-scheme-render/JsonSchemeRender.tsx +0 -101
- package/src/json-scheme-render/index.ts +0 -9
- package/src/layout/Breadcrumb.vue +0 -39
- package/src/layout/FuckMain.vue +0 -90
- package/src/layout/List.vue +0 -145
- package/src/layout/Main.vue +0 -97
- package/src/layout/NavTabs.vue +0 -129
- package/src/layout/Show.vue +0 -135
- package/src/layout/index.ts +0 -24
- package/src/layout/style/breadcrumb.scss +0 -61
- package/src/layout/style/fuckmain.scss +0 -21
- package/src/layout/style/index.scss +0 -35
- package/src/layout/style/list.scss +0 -26
- package/src/layout/style/main.scss +0 -74
- package/src/layout/style/navtab.scss +0 -146
- package/src/layout/style/show.scss +0 -50
- package/src/menu/Menu.tsx +0 -181
- package/src/menu/style/index.scss +0 -26
- package/src/modal/Modal.tsx +0 -83
- package/src/modal/index.ts +0 -9
- package/src/modal/style/index.scss +0 -74
- package/src/select/Select.vue +0 -177
- package/src/select/dic.worker.ts +0 -32
- package/src/select/index.ts +0 -9
- package/src/table/Field.vue +0 -44
- package/src/table/Table.tsx +0 -515
- package/src/table/index.md +0 -1
- package/src/table/index.ts +0 -9
- package/src/table/interface/table.ts +0 -64
- package/src/table/style/index.scss +0 -10
- package/src/theme/index.ts +0 -1
- package/src/theme/theme.scss +0 -1
- package/src/theme/variable.scss +0 -67
package/example/tsconfig.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"assumeChangesOnlyAffectDirectDependencies": true,
|
|
4
|
-
"baseUrl": ".",
|
|
5
|
-
"jsx": "preserve",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"target": "ES2015",
|
|
8
|
-
"module": "ESNext",
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"esModuleInterop": true,
|
|
11
|
-
"moduleResolution": "Node",
|
|
12
|
-
"allowJs": true,
|
|
13
|
-
"lib": ["esnext", "dom"],
|
|
14
|
-
"paths": {}
|
|
15
|
-
}
|
|
16
|
-
}
|
package/example/utils/http.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
|
-
import { message as Message, Modal } from "ant-design-vue";
|
|
3
|
-
import type {
|
|
4
|
-
AxiosInstance,
|
|
5
|
-
InternalAxiosRequestConfig,
|
|
6
|
-
AxiosResponse
|
|
7
|
-
} from "axios";
|
|
8
|
-
|
|
9
|
-
const cancelSource = axios.CancelToken.source();
|
|
10
|
-
const http: AxiosInstance = axios.create({
|
|
11
|
-
baseURL: "http://172.16.10.34:1243/",
|
|
12
|
-
timeout: 1000 * 10 * 60,
|
|
13
|
-
cancelToken: cancelSource.token,
|
|
14
|
-
withCredentials: true
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
// 因为现在的后台接口状态码真是TMD没统一
|
|
18
|
-
const SUCCESS_CODE = ["200", "0"];
|
|
19
|
-
// 登录失效状态码
|
|
20
|
-
const EXPIRED_STATUS_CODE = ["401", "403"];
|
|
21
|
-
// 超额状态码
|
|
22
|
-
const OVER_AMOUNT_CODE = ["1056"];
|
|
23
|
-
const BLACK_URL = ["/login"];
|
|
24
|
-
|
|
25
|
-
http.interceptors.request.use((config: InternalAxiosRequestConfig) => {
|
|
26
|
-
if (!BLACK_URL.includes(config.url as any)) {
|
|
27
|
-
// 没有包含login的url 才添加token
|
|
28
|
-
// config.headers["Authorization"] = getToken;
|
|
29
|
-
}
|
|
30
|
-
return config;
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
http.interceptors.response.use(
|
|
34
|
-
async ({ data }: AxiosResponse) => {
|
|
35
|
-
const { code, data: content, message } = data;
|
|
36
|
-
const successStatus = SUCCESS_CODE.includes(code);
|
|
37
|
-
|
|
38
|
-
// 状态码在SUCCESS_CODE 里面表示成功
|
|
39
|
-
if (successStatus) {
|
|
40
|
-
// 返回响应内容
|
|
41
|
-
return content;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
switch (code) {
|
|
45
|
-
case EXPIRED_STATUS_CODE[0]:
|
|
46
|
-
case EXPIRED_STATUS_CODE[1]:
|
|
47
|
-
handleExpiredToken();
|
|
48
|
-
break;
|
|
49
|
-
case OVER_AMOUNT_CODE[0]:
|
|
50
|
-
handleOverAmount(message);
|
|
51
|
-
break;
|
|
52
|
-
default:
|
|
53
|
-
handleDefaultError(message);
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
return Promise.reject(data);
|
|
57
|
-
},
|
|
58
|
-
(error) => {
|
|
59
|
-
// 网络超时异常处理
|
|
60
|
-
if (
|
|
61
|
-
error.code === "ECONNABORTED" ||
|
|
62
|
-
error.message === "Network Error" ||
|
|
63
|
-
error.message.includes("timeout")
|
|
64
|
-
) {
|
|
65
|
-
handleTimeoutError();
|
|
66
|
-
}
|
|
67
|
-
return Promise.reject(error);
|
|
68
|
-
}
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
function handleExpiredToken() {
|
|
72
|
-
cancelSource.cancel("token失效,取消后续请求");
|
|
73
|
-
sessionStorage.clear();
|
|
74
|
-
Message.warn({ content: "登录失效,请重新登录", duration: 5 });
|
|
75
|
-
setTimeout(() => {
|
|
76
|
-
location.href = (import.meta.env.VITE_APP_BASE_URL || "") + "/login";
|
|
77
|
-
}, 2000);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function handleOverAmount(message: string) {
|
|
81
|
-
Modal.confirm({
|
|
82
|
-
title: "超额提示",
|
|
83
|
-
content: message,
|
|
84
|
-
centered: true,
|
|
85
|
-
okText: "明白",
|
|
86
|
-
cancelText: "关闭",
|
|
87
|
-
onCancel() {
|
|
88
|
-
Modal.destroyAll();
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function handleDefaultError(message: string) {
|
|
94
|
-
Message.warn({
|
|
95
|
-
content: message || "未知错误,请联系后台开发人员!!!",
|
|
96
|
-
duration: 6
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function handleTimeoutError() {
|
|
101
|
-
Message.error({
|
|
102
|
-
content: "请求超时,请稍后重试",
|
|
103
|
-
duration: 6
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export default http;
|
package/example/vite-env.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
|
2
|
-
/// <reference types="vue/macros-global" />
|
|
3
|
-
declare module "*.vue" {
|
|
4
|
-
import type { DefineComponent } from "vue";
|
|
5
|
-
// eslint-disable-next-line
|
|
6
|
-
const component: DefineComponent<{}, {}, any>;
|
|
7
|
-
export default component;
|
|
8
|
-
}
|
package/example/vite.config.ts
DELETED
package/src/_utils/html.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const useEleHeight = (node: Element) => {
|
|
2
|
-
const list = [
|
|
3
|
-
"margin-top",
|
|
4
|
-
"margin-bottom",
|
|
5
|
-
"border-top",
|
|
6
|
-
"border-bottom",
|
|
7
|
-
"padding-top",
|
|
8
|
-
"padding-bottom",
|
|
9
|
-
"height"
|
|
10
|
-
];
|
|
11
|
-
const style = getComputedStyle(node);
|
|
12
|
-
return list
|
|
13
|
-
.map((k) => parseInt(style.getPropertyValue(k), 10))
|
|
14
|
-
.reduce((prev, cur) => {
|
|
15
|
-
return prev + cur;
|
|
16
|
-
});
|
|
17
|
-
};
|
package/src/_utils/install.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { App, Plugin } from "vue";
|
|
2
|
-
export type SFCWithInstall<T> = T & Plugin;
|
|
3
|
-
export default <T>(comp: T) => {
|
|
4
|
-
(comp as SFCWithInstall<T>).install = (app: App) => {
|
|
5
|
-
// 当组件是 script setup 的形式时,会自动以为文件名注册,会挂载到组件的__name 属性上
|
|
6
|
-
// 所以要加上这个条件
|
|
7
|
-
const name = (comp as any).name || (comp as any).__name;
|
|
8
|
-
//注册组件
|
|
9
|
-
app.component(name, comp as SFCWithInstall<T>);
|
|
10
|
-
};
|
|
11
|
-
return comp as SFCWithInstall<T>;
|
|
12
|
-
};
|
package/src/components.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export { default as DQueryForm } from "./form";
|
|
2
|
-
export * from "./layout";
|
|
3
|
-
export { default as DTable } from "./table";
|
|
4
|
-
export { default as grid } from "./grid";
|
|
5
|
-
export { default as Select } from "./select";
|
|
6
|
-
export { default as Desensitize } from "./desensitize";
|
|
7
|
-
export { default as DicReplace } from "./dic";
|
|
8
|
-
export { default as DModal } from "./modal";
|
|
9
|
-
export { default as DJsonSchemeRender } from "./json-scheme-render";
|
|
10
|
-
export { default as DRangePicker } from "./date";
|
package/src/config/Config.vue
DELETED
package/src/date/RangePicker.tsx
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { defineComponent, ref, watch } from "vue";
|
|
2
|
-
import type { PropType } from "vue";
|
|
3
|
-
import { RangePicker } from "ant-design-vue";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* 日期范围控件
|
|
7
|
-
*/
|
|
8
|
-
export default defineComponent({
|
|
9
|
-
name: "DRangePicker",
|
|
10
|
-
props: {
|
|
11
|
-
value: {
|
|
12
|
-
type: Object as PropType<{ [name: string]: unknown }>
|
|
13
|
-
},
|
|
14
|
-
field: {
|
|
15
|
-
required: true,
|
|
16
|
-
default: [] as string[]
|
|
17
|
-
},
|
|
18
|
-
format: {
|
|
19
|
-
default: "YYYY-MM-DD"
|
|
20
|
-
},
|
|
21
|
-
valueFormat: {
|
|
22
|
-
default: "YYYY-MM-DD"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
emits: ["update:value"],
|
|
26
|
-
setup(props, { emit, attrs }) {
|
|
27
|
-
const dates = ref<string[]>([]);
|
|
28
|
-
|
|
29
|
-
//内部model
|
|
30
|
-
const internalModel = ref<{ [name: string]: unknown }>(props?.value || {});
|
|
31
|
-
|
|
32
|
-
watch(
|
|
33
|
-
() => props.value,
|
|
34
|
-
(val: any) => {
|
|
35
|
-
// 要监听val 进行赋值,因为如果父组件直接改变val的整个对象,那么internalModel就会失去对value的依赖追踪
|
|
36
|
-
// 导致数据不同步
|
|
37
|
-
internalModel.value = val ? { ...val } : {};
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
deep: true
|
|
41
|
-
}
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
// 监听日期变化
|
|
45
|
-
const onChange = (dates: [any, any]) => {
|
|
46
|
-
if (!dates) {
|
|
47
|
-
props.field.forEach((key) => {
|
|
48
|
-
internalModel.value[key] = "";
|
|
49
|
-
});
|
|
50
|
-
} else {
|
|
51
|
-
props.field.forEach((key, index) => {
|
|
52
|
-
internalModel.value[key] = dates[index];
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
emit("update:value", internalModel.value);
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
//循环字段
|
|
59
|
-
// eslint-disable-next-line vue/no-setup-props-destructure
|
|
60
|
-
const watchExpressions = props.field.map((key) => () => {
|
|
61
|
-
return props.value?.[key];
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
const watchHandler = (newValues: any) => {
|
|
65
|
-
// 判断是否被置空只有这两个字段同时为空,才是表明被置空
|
|
66
|
-
const isClear = props.field.every((key, index) => {
|
|
67
|
-
return newValues[index] === "" || newValues[index] === undefined;
|
|
68
|
-
});
|
|
69
|
-
if (isClear) {
|
|
70
|
-
dates.value = [];
|
|
71
|
-
} else {
|
|
72
|
-
props.field.forEach((key, index) => {
|
|
73
|
-
dates.value && (dates.value[index] = newValues[index]);
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
//监听多个字段变化
|
|
78
|
-
watch(watchExpressions, watchHandler, { immediate: true });
|
|
79
|
-
|
|
80
|
-
return () => (
|
|
81
|
-
<div>
|
|
82
|
-
<RangePicker
|
|
83
|
-
{...attrs}
|
|
84
|
-
v-model:value={dates.value}
|
|
85
|
-
onChange={onChange}
|
|
86
|
-
format={props.format}
|
|
87
|
-
valueFormat={props.valueFormat}
|
|
88
|
-
style={{ width: "100%" }}
|
|
89
|
-
></RangePicker>
|
|
90
|
-
</div>
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
});
|
package/src/date/index.ts
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 脱敏
|
|
3
|
-
* @author 余春林
|
|
4
|
-
*/
|
|
5
|
-
import { defineComponent, computed, ref } from "vue";
|
|
6
|
-
import { EyeOutlined, EyeInvisibleOutlined } from "@ant-design/icons-vue";
|
|
7
|
-
import { prefixName } from "../theme";
|
|
8
|
-
|
|
9
|
-
//class名称
|
|
10
|
-
const baseClassName = `${prefixName}-desensitize`;
|
|
11
|
-
export default defineComponent({
|
|
12
|
-
name: "DDesensitize",
|
|
13
|
-
components: {
|
|
14
|
-
EyeOutlined,
|
|
15
|
-
EyeInvisibleOutlined
|
|
16
|
-
},
|
|
17
|
-
props: {
|
|
18
|
-
value: {
|
|
19
|
-
// type: [string,number] 可以使用PropType 来声明对象类型
|
|
20
|
-
// type: String as () => string | number,
|
|
21
|
-
type: String as () => string | undefined,
|
|
22
|
-
required: true
|
|
23
|
-
},
|
|
24
|
-
// 替换样式
|
|
25
|
-
style: {
|
|
26
|
-
type: String,
|
|
27
|
-
default: "*"
|
|
28
|
-
},
|
|
29
|
-
// 替换规则 id 和mobile
|
|
30
|
-
rule: {
|
|
31
|
-
type: String,
|
|
32
|
-
required: true
|
|
33
|
-
},
|
|
34
|
-
// 正则表达式
|
|
35
|
-
regex: {
|
|
36
|
-
type: String,
|
|
37
|
-
default: ""
|
|
38
|
-
},
|
|
39
|
-
// 替换方式
|
|
40
|
-
regexValue: {
|
|
41
|
-
type: String,
|
|
42
|
-
default: ""
|
|
43
|
-
},
|
|
44
|
-
eye: {
|
|
45
|
-
type: Boolean,
|
|
46
|
-
default: false
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
setup(props) {
|
|
50
|
-
// 控制显示隐藏脱敏或者不脱敏
|
|
51
|
-
const invisible = ref(true);
|
|
52
|
-
const desensitizedString = computed(() => {
|
|
53
|
-
const value = props.value;
|
|
54
|
-
const rule = props.rule;
|
|
55
|
-
const regex = props.regex;
|
|
56
|
-
const regexValue = props.regexValue;
|
|
57
|
-
let str = "";
|
|
58
|
-
if (!value) {
|
|
59
|
-
return "";
|
|
60
|
-
}
|
|
61
|
-
if (rule) {
|
|
62
|
-
switch (rule) {
|
|
63
|
-
case "mobile":
|
|
64
|
-
str = value.replace(/(\d{3})\d{4}(\d{4})/, "$1*****$2");
|
|
65
|
-
break;
|
|
66
|
-
case "id":
|
|
67
|
-
str = value.replace(/(\d{4})\d{10}(\w{4})/, "$1*****$2");
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
} else {
|
|
71
|
-
str = value.replace(regex, regexValue);
|
|
72
|
-
}
|
|
73
|
-
return str;
|
|
74
|
-
});
|
|
75
|
-
return () => (
|
|
76
|
-
<>
|
|
77
|
-
<div class={baseClassName}>
|
|
78
|
-
<span class={"value"}>
|
|
79
|
-
{invisible.value ? desensitizedString.value : props.value}
|
|
80
|
-
</span>
|
|
81
|
-
{props.eye ? (
|
|
82
|
-
<span>
|
|
83
|
-
<eye-outlined
|
|
84
|
-
onClick={() => (invisible.value = !invisible.value)}
|
|
85
|
-
v-show={!invisible.value}
|
|
86
|
-
/>
|
|
87
|
-
<eye-invisible-outlined
|
|
88
|
-
onClick={() => (invisible.value = !invisible.value)}
|
|
89
|
-
v-show={invisible.value}
|
|
90
|
-
/>
|
|
91
|
-
</span>
|
|
92
|
-
) : undefined}
|
|
93
|
-
</div>
|
|
94
|
-
</>
|
|
95
|
-
);
|
|
96
|
-
}
|
|
97
|
-
});
|
package/src/desensitize/index.ts
DELETED
package/src/dic/DicReplace.tsx
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 字典替换
|
|
3
|
-
* 根据字典名字及对应的value替换成中文或者人能看懂的文字
|
|
4
|
-
* @author 余春林
|
|
5
|
-
*/
|
|
6
|
-
import { defineComponent, ref, watch } from "vue";
|
|
7
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
8
|
-
// @ts-ignore
|
|
9
|
-
// import DicWorker from "./replace.worker?worker&inline";
|
|
10
|
-
import { useDataDicStore } from "@ditari/store";
|
|
11
|
-
|
|
12
|
-
export default defineComponent({
|
|
13
|
-
name: "DicReplace",
|
|
14
|
-
props: {
|
|
15
|
-
// 字典名称
|
|
16
|
-
name: {
|
|
17
|
-
type: String,
|
|
18
|
-
default: ""
|
|
19
|
-
},
|
|
20
|
-
// 值
|
|
21
|
-
value: {
|
|
22
|
-
type: String as any,
|
|
23
|
-
default: ""
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
setup(props) {
|
|
27
|
-
const { getDicTextByValue } = useDataDicStore();
|
|
28
|
-
//TODO 使用webworker存在一定的问题
|
|
29
|
-
//const workerStatus = ref(true);
|
|
30
|
-
const dicValueTxt = ref<any>("");
|
|
31
|
-
// const repWorkerPool: any = inject("repWorkerPool");
|
|
32
|
-
// // 获取worker
|
|
33
|
-
// const workerInstance: any = repWorkerPool.getWorker();
|
|
34
|
-
/**
|
|
35
|
-
* web worker 启动失败
|
|
36
|
-
*/
|
|
37
|
-
// workerInstance.onerror = () => {
|
|
38
|
-
// workerStatus.value = false;
|
|
39
|
-
// };
|
|
40
|
-
/**
|
|
41
|
-
* 监听web worker发送的数据
|
|
42
|
-
* @param e
|
|
43
|
-
*/
|
|
44
|
-
// workerInstance.onmessage = (e: any) => {
|
|
45
|
-
// // 赋值给下拉选择数据变量
|
|
46
|
-
// dicValueTxt.value = e.data;
|
|
47
|
-
// };
|
|
48
|
-
|
|
49
|
-
watch(
|
|
50
|
-
() => props.value,
|
|
51
|
-
(val: any) => {
|
|
52
|
-
const value = val;
|
|
53
|
-
const name = props.name;
|
|
54
|
-
dicValueTxt.value = getDicTextByValue(name, value);
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
immediate: true
|
|
58
|
-
}
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
return () => <>{dicValueTxt.value}</>;
|
|
62
|
-
}
|
|
63
|
-
});
|
package/src/dic/index.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 字典匹配worker
|
|
3
|
-
* 根据字典名称和value 替换对应的中文
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
self.addEventListener(
|
|
7
|
-
"message",
|
|
8
|
-
function (e) {
|
|
9
|
-
// 字典名字
|
|
10
|
-
const name = e.data.name ?? "";
|
|
11
|
-
// 字典值
|
|
12
|
-
const value = e.data.value ?? "";
|
|
13
|
-
// 字典列表
|
|
14
|
-
const parseData = JSON.parse(e.data.list) ?? [];
|
|
15
|
-
const rs = parseData[name] || [];
|
|
16
|
-
|
|
17
|
-
const str = rs
|
|
18
|
-
.filter((item: any) => item.value === value)
|
|
19
|
-
.map((item: any) => item.label)
|
|
20
|
-
.join("");
|
|
21
|
-
|
|
22
|
-
self.postMessage(str);
|
|
23
|
-
},
|
|
24
|
-
false
|
|
25
|
-
);
|