sun-biz 0.0.4-beta.5 → 0.0.4-beta.50
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/dist/components/biz-select/biz-unit-select/api.d.ts +34 -0
- package/dist/components/biz-select/department-select/api.d.ts +51 -0
- package/dist/components/biz-select/hospital-charge-select/api.d.ts +53 -0
- package/dist/components/biz-select/index.d.ts +8 -0
- package/dist/components/biz-select/tag-select/api.d.ts +44 -0
- package/dist/components/biz-select/tag-select/utils.d.ts +31 -0
- package/dist/components/biz-select/user-select/api.d.ts +109 -0
- package/dist/components/biz-select/ward-select/api.d.ts +43 -0
- package/dist/components/index.d.ts +3 -1
- package/dist/components/index.js +4246 -426
- package/dist/components/index.js.LICENSE.txt +11 -0
- package/dist/components/keyboard-value/index.d.ts +1 -0
- package/dist/components/patient-access/api.d.ts +12 -1
- package/dist/components/print/hooks/index.d.ts +1 -0
- package/dist/components/pro-avatar/index.d.ts +2 -0
- package/dist/components/pro-avatar/utils.d.ts +21 -0
- package/dist/components/pro-form/typings/index.d.ts +1 -0
- package/dist/components/pro-table/constant.d.ts +1 -0
- package/dist/components/pro-table/interface/index.d.ts +7 -1
- package/dist/components/static/css/index.css +57 -3
- package/dist/components/table-select/composable/useDirectionKey.d.ts +7 -0
- package/dist/components/table-select/index.d.ts +4 -0
- package/dist/components/table-select/types/index.d.ts +103 -0
- package/dist/directives/index.d.ts +1 -0
- package/dist/directives/shortcut.d.ts +13 -0
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/index.js +68 -22
- package/dist/hooks/use-app-config/index.d.ts +2 -2
- package/dist/hooks/use-column&form-config/index.d.ts +5 -5
- package/dist/hooks/use-data-change-detector/index.d.ts +2 -1
- package/dist/hooks/use-direction-select/index.d.ts +2 -2
- package/dist/hooks/use-editable-table/index.d.ts +2 -0
- package/dist/hooks/use-fetch-data/index.d.ts +3 -0
- package/dist/hooks/{use-fetch-dataset/index.d.ts → use-fetch-data/use-fetch-dataset.d.ts} +1 -1
- package/dist/hooks/use-fetch-data/use-fetch-params.d.ts +24 -0
- package/dist/hooks/use-fetch-data/use-fetch-time.d.ts +6 -0
- package/dist/index.d.ts +28 -24
- package/dist/index.js +5203 -514
- package/dist/index.js.LICENSE.txt +11 -0
- package/dist/static/css/index.css +57 -3
- package/package.json +21 -18
- package/dist/hooks/use-fetch-dataset/use-fetch-time.d.ts +0 -4
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**!
|
|
2
|
+
* hotkeys-js v3.13.15
|
|
3
|
+
* A simple micro-library for defining and dispatching keyboard shortcuts. It has no dependencies.
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2025 kenny wong <wowohoo@qq.com>
|
|
6
|
+
* https://github.com/jaywcjlove/hotkeys-js.git
|
|
7
|
+
*
|
|
8
|
+
* @website: https://jaywcjlove.github.io/hotkeys-js
|
|
9
|
+
|
|
10
|
+
* Licensed under the MIT license
|
|
11
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as KeyboardValue } from './index.vue';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ConfigReqParams, SearchReqParams, AccessConfig, TPatient, BannerReqParams, BannerReqItem } from
|
|
1
|
+
import type { ConfigReqParams, SearchReqParams, AccessConfig, TPatient, BannerReqParams, BannerReqItem, BizTagInfo } from './types.d';
|
|
2
2
|
/**
|
|
3
3
|
* 1-10115-1 根据条件查询菜单的检索方式列表(业务态)
|
|
4
4
|
* @param params
|
|
@@ -11,9 +11,11 @@ export declare const queryBizDataList: (params: SearchReqParams) => Promise<[imp
|
|
|
11
11
|
dataIndex: string;
|
|
12
12
|
title: string;
|
|
13
13
|
display: string;
|
|
14
|
+
displayWidth: string;
|
|
14
15
|
}[];
|
|
15
16
|
data: {
|
|
16
17
|
data: TPatient[];
|
|
18
|
+
total: number;
|
|
17
19
|
};
|
|
18
20
|
}> | undefined]>;
|
|
19
21
|
/**
|
|
@@ -22,3 +24,12 @@ export declare const queryBizDataList: (params: SearchReqParams) => Promise<[imp
|
|
|
22
24
|
* @returns
|
|
23
25
|
*/
|
|
24
26
|
export declare const getBannerDataByBizId: (params: BannerReqParams) => Promise<[import("@sun-toolkit/request").SunApiResultData<null> | undefined, import("@sun-toolkit/request").SunApiResultData<BannerReqItem> | undefined]>;
|
|
27
|
+
/**
|
|
28
|
+
* [1-10475-1]根据条件查询标签列表
|
|
29
|
+
* @param params
|
|
30
|
+
* @returns
|
|
31
|
+
*/
|
|
32
|
+
export declare const queryBizTagListByExample: (params: {
|
|
33
|
+
bizIdTypeCode: string;
|
|
34
|
+
bizId: string;
|
|
35
|
+
}) => Promise<[import("@sun-toolkit/request").SunApiResultData<null> | undefined, import("@sun-toolkit/request").SunApiResultData<BizTagInfo[]> | undefined]>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare function useAvatarSize(width?: number | string, height?: number | string): {
|
|
2
|
+
currentWidth: import("vue").ComputedRef<string>;
|
|
3
|
+
currentHeight: import("vue").ComputedRef<string>;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* 头像类型
|
|
7
|
+
*/
|
|
8
|
+
export declare enum AVATAR_TYPE_CODE {
|
|
9
|
+
/**
|
|
10
|
+
* 男性
|
|
11
|
+
*/
|
|
12
|
+
WOMAN = "woman",
|
|
13
|
+
/**
|
|
14
|
+
* 女性
|
|
15
|
+
*/
|
|
16
|
+
MAN = "man",
|
|
17
|
+
/**
|
|
18
|
+
* 默认
|
|
19
|
+
*/
|
|
20
|
+
DEFAULT = "default"
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const OPERATION = "operation";
|
|
@@ -35,7 +35,9 @@ export type HeaderRenderScope<T> = {
|
|
|
35
35
|
column: TableColumnCtx<T>;
|
|
36
36
|
[key: string]: any;
|
|
37
37
|
};
|
|
38
|
-
export interface ColumnProps<T = any> extends Partial<Omit<TableColumnCtx<T>, 'type' | 'children' | 'renderCell' | 'renderHeader'>> {
|
|
38
|
+
export interface ColumnProps<T = any> extends Partial<Omit<TableColumnCtx<T>, 'type' | 'children' | 'renderCell' | 'renderHeader' | 'label'>> {
|
|
39
|
+
label: string | (() => VNode | string);
|
|
40
|
+
isDraggable?: boolean;
|
|
39
41
|
defaultDisplayFlag?: number;
|
|
40
42
|
required?: boolean | undefined;
|
|
41
43
|
autoFormatterNumber?: boolean;
|
|
@@ -88,3 +90,7 @@ export interface SortFieldObj {
|
|
|
88
90
|
ascendFlag: number;
|
|
89
91
|
sort: number;
|
|
90
92
|
}
|
|
93
|
+
export type TableColumnProps = ColumnProps & {
|
|
94
|
+
displayFlag?: number;
|
|
95
|
+
sort?: number;
|
|
96
|
+
};
|
|
@@ -6,21 +6,75 @@
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
[data-v-
|
|
9
|
+
[data-v-0aa25cee] .el-menu-item {
|
|
10
10
|
height: 48px;
|
|
11
11
|
line-height: 48px;
|
|
12
12
|
}
|
|
13
|
-
[data-v-
|
|
13
|
+
[data-v-0aa25cee] .el-sub-menu__title {
|
|
14
14
|
height: 48px;
|
|
15
15
|
line-height: 48px;
|
|
16
16
|
}
|
|
17
|
-
[data-v-
|
|
17
|
+
[data-v-0aa25cee] .el-menu-item.is-active {
|
|
18
18
|
color: inherit !important;
|
|
19
19
|
background-color: #0000 !important;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
.input[data-v-34ffe8bb] .el-input__inner {
|
|
23
|
+
cursor: pointer !important;
|
|
24
|
+
}
|
|
25
|
+
.table-select-popover[data-v-34ffe8bb] {
|
|
26
|
+
height: 350px;
|
|
27
|
+
width: auto !important;
|
|
28
|
+
}
|
|
29
|
+
.table-select-popover-simple .header[data-v-34ffe8bb] {
|
|
30
|
+
width: 100%;
|
|
31
|
+
}
|
|
32
|
+
.table-select-popover-simple .header > span[data-v-34ffe8bb] {
|
|
33
|
+
flex: var(--simple-column-flex);
|
|
34
|
+
}
|
|
35
|
+
.table-select-popover-simple .cell[data-v-34ffe8bb] {
|
|
36
|
+
width: 100%;
|
|
37
|
+
}
|
|
38
|
+
.table-select-popover-simple .cell > span[data-v-34ffe8bb] {
|
|
39
|
+
flex: var(--simple-column-flex);
|
|
40
|
+
}
|
|
41
|
+
|
|
22
42
|
|
|
23
43
|
|
|
44
|
+
.hospital-charge-select[data-v-ffb2d000] {
|
|
45
|
+
width: 100%;
|
|
46
|
+
}
|
|
47
|
+
.hospital-charge-select .input[data-v-ffb2d000] .el-input__inner {
|
|
48
|
+
cursor: pointer !important;
|
|
49
|
+
}
|
|
50
|
+
[data-v-ffb2d000] .hospital-charge-select-popover {
|
|
51
|
+
max-height: var(--5aebc6cb);
|
|
52
|
+
padding: 0;
|
|
53
|
+
z-index: 9999 !important;
|
|
54
|
+
}
|
|
55
|
+
[data-v-ffb2d000] .hospital-charge-select-popover .popover-content {
|
|
56
|
+
width: 100%;
|
|
57
|
+
height: 100%;
|
|
58
|
+
max-height: var(--5aebc6cb);
|
|
59
|
+
}
|
|
60
|
+
[data-v-ffb2d000] .hospital-charge-select-popover .el-table__row.cursor-not-allowed {
|
|
61
|
+
color: #c0c4cc;
|
|
62
|
+
cursor: not-allowed !important;
|
|
63
|
+
background-color: #f5f7fa !important;
|
|
64
|
+
}
|
|
65
|
+
[data-v-ffb2d000] .hospital-charge-select-popover .el-table__row.cursor-not-allowed td {
|
|
66
|
+
background-color: #f5f7fa !important;
|
|
67
|
+
}
|
|
68
|
+
[data-v-ffb2d000] .hospital-charge-select-popover .el-table__row.cursor-not-allowed:hover > td {
|
|
69
|
+
background-color: #f5f7fa !important;
|
|
70
|
+
}
|
|
71
|
+
.hospital-charge-select-popover {
|
|
72
|
+
margin-bottom: 8px !important;
|
|
73
|
+
}
|
|
74
|
+
.hospital-charge-select-popover {
|
|
75
|
+
margin-top: 8px !important;
|
|
76
|
+
}
|
|
77
|
+
|
|
24
78
|
|
|
25
79
|
|
|
26
80
|
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { ComponentSize } from 'element-sun';
|
|
2
|
+
import { ColumnProps } from '@/components/pro-table';
|
|
3
|
+
/**
|
|
4
|
+
* 简易模式 option 类型
|
|
5
|
+
*/
|
|
6
|
+
export interface ISelectSimpleOption<T> {
|
|
7
|
+
label: string;
|
|
8
|
+
value: T;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 简易模式 表头 option 类型
|
|
12
|
+
*/
|
|
13
|
+
export interface ISelectSimpleHeadOption<T> {
|
|
14
|
+
label: string;
|
|
15
|
+
key: keyof T;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* table-select 模式枚举值
|
|
19
|
+
*/
|
|
20
|
+
export declare enum TableSelectMode {
|
|
21
|
+
Simple = "simple",
|
|
22
|
+
Complex = "complex"
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 提取枚举值的类型('simple' | 'complex')
|
|
26
|
+
*/
|
|
27
|
+
export type TableSelectModeType = `${TableSelectMode}`;
|
|
28
|
+
/**
|
|
29
|
+
* 远程加载数据的方法类型
|
|
30
|
+
*/
|
|
31
|
+
type RemoteMethod<T = unknown> = (...args: T[]) => unknown;
|
|
32
|
+
/**
|
|
33
|
+
* 优化后的 table-select 组件 props 类型
|
|
34
|
+
* 采用泛型关联 mode 和 columns 的类型
|
|
35
|
+
*/
|
|
36
|
+
export interface TableSelectProps<T extends Record<PropertyKey, any>> {
|
|
37
|
+
/**
|
|
38
|
+
* 选择模式
|
|
39
|
+
* - 'simple': 简易模式,配合 ISelectSimpleHeadOption 类型的 columns
|
|
40
|
+
* - 'complex': 复杂模式,配合 ColumnProps 类型的 columns
|
|
41
|
+
*/
|
|
42
|
+
mode?: TableSelectModeType;
|
|
43
|
+
/**
|
|
44
|
+
* 列配置,类型由 mode 决定
|
|
45
|
+
* - mode 为 'simple' 时,必须是 ISelectSimpleHeadOption[]
|
|
46
|
+
* - mode 为 'complex' 时,必须是 ColumnProps[]
|
|
47
|
+
*/
|
|
48
|
+
columns?: ISelectSimpleHeadOption<T>[] | ColumnProps[];
|
|
49
|
+
/** 占位符 */
|
|
50
|
+
placeholder?: string;
|
|
51
|
+
/** 是否加载中 */
|
|
52
|
+
loading?: boolean;
|
|
53
|
+
/** 是否滚动加载中 */
|
|
54
|
+
scrollLoading?: boolean;
|
|
55
|
+
/** 是否立即执行加载方法 */
|
|
56
|
+
immediate?: boolean;
|
|
57
|
+
/** 弹窗是否可见 */
|
|
58
|
+
popoverVisible?: boolean;
|
|
59
|
+
/** 弹窗挂载点 */
|
|
60
|
+
appendTo?: string | HTMLElement;
|
|
61
|
+
/** 是否支持多选 */
|
|
62
|
+
multiple?: boolean;
|
|
63
|
+
/** 弹窗位置 */
|
|
64
|
+
placement?: string;
|
|
65
|
+
/** 行数据的唯一标识字段 */
|
|
66
|
+
rowKey?: string & keyof T;
|
|
67
|
+
/** 自定义 label 键名 */
|
|
68
|
+
labelKey?: string;
|
|
69
|
+
/** 表格组件编号 */
|
|
70
|
+
componentNo?: string;
|
|
71
|
+
/** 当前选中行的 key */
|
|
72
|
+
currentRowKey?: string;
|
|
73
|
+
/** 组件尺寸 */
|
|
74
|
+
size?: ComponentSize;
|
|
75
|
+
/** 简易模式配置项 */
|
|
76
|
+
simpleConfig?: ISelectSimpleConfig;
|
|
77
|
+
/** 复杂模式配置项 */
|
|
78
|
+
complexConfig?: ISelectComplexConfig;
|
|
79
|
+
/** 是否高亮当前行 */
|
|
80
|
+
highlightCurrentRow?: boolean;
|
|
81
|
+
/** 表格数据 */
|
|
82
|
+
data: T[];
|
|
83
|
+
/** 远程加载数据的方法 */
|
|
84
|
+
remoteMethod?: RemoteMethod<string | undefined>;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* 简易模式配置项
|
|
88
|
+
*/
|
|
89
|
+
export interface ISelectSimpleConfig {
|
|
90
|
+
/** 是否显示表头 */
|
|
91
|
+
showHeader?: boolean;
|
|
92
|
+
}
|
|
93
|
+
export interface ISelectComplexConfig {
|
|
94
|
+
/**
|
|
95
|
+
* 弹窗宽度
|
|
96
|
+
*/
|
|
97
|
+
width?: string | number;
|
|
98
|
+
/**
|
|
99
|
+
* 弹窗最大高度
|
|
100
|
+
*/
|
|
101
|
+
maxHeight?: string | number;
|
|
102
|
+
}
|
|
103
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createShortcutDirective, findKeyCommandConfig, type ShortcutOptions, } from './shortcut.ts';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ObjectDirective } from 'vue';
|
|
2
|
+
export interface ShortcutOptions {
|
|
3
|
+
commandNo: string;
|
|
4
|
+
bizId?: string;
|
|
5
|
+
handler?: (e: KeyboardEvent) => void;
|
|
6
|
+
autoDisplay?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function findKeyCommandConfig(commandNo: string, defaultMenuId?: string, bizId?: string): {
|
|
9
|
+
keyboardValue: string | null;
|
|
10
|
+
menuId: string | null;
|
|
11
|
+
};
|
|
12
|
+
declare function createShortcutDirective(menuId?: string): ObjectDirective;
|
|
13
|
+
export { createShortcutDirective };
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export { default as useRequest } from "./use-request/index.ts";
|
|
|
2
2
|
export { default as useAppConfigData, MAIN_APP_CONFIG, } from "./use-app-config/index.ts";
|
|
3
3
|
export type { PreferenceData } from "./use-app-config/index.ts";
|
|
4
4
|
export { default as useDirectionSelect } from "./use-direction-select/index.ts";
|
|
5
|
-
export
|
|
6
|
-
export { default as useEditableTable } from
|
|
7
|
-
export { default as useDataChangeDetector } from
|
|
5
|
+
export * from "./use-fetch-data/index.ts";
|
|
6
|
+
export { default as useEditableTable } from "./use-editable-table/index.ts";
|
|
7
|
+
export { default as useDataChangeDetector } from "./use-data-change-detector/index.ts";
|
|
8
8
|
export { useColumnConfig, useFormConfig, } from "./use-column&form-config/index.ts";
|
package/dist/hooks/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import * as __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__ from "@sun-toolkit/en
|
|
|
4
4
|
import * as __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__ from "@sun-toolkit/shared";
|
|
5
5
|
import * as __WEBPACK_EXTERNAL_MODULE_element_sun__ from "element-sun";
|
|
6
6
|
import * as __WEBPACK_EXTERNAL_MODULE_vue_router__ from "vue-router";
|
|
7
|
-
import * as
|
|
7
|
+
import * as __WEBPACK_EXTERNAL_MODULE__sun_toolkit_micro_app__ from "@sun-toolkit/micro-app";
|
|
8
8
|
/* eslint-disable @typescript-eslint/no-explicit-any */ // support refreshDeps & ready
|
|
9
9
|
const useAutoRunPlugin = (fetchInstance, { manual, ready = true, refreshDeps = [], refreshDepsAction })=>{
|
|
10
10
|
const hasAutoRun = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(false);
|
|
@@ -364,7 +364,7 @@ function useRequest_useRequest(service, options, plugins) {
|
|
|
364
364
|
return MAIN_APP_CONFIG;
|
|
365
365
|
}({});
|
|
366
366
|
function useAppConfigData(name) {
|
|
367
|
-
const data = (0, __WEBPACK_EXTERNAL_MODULE_vue__.inject)(
|
|
367
|
+
const data = (0, __WEBPACK_EXTERNAL_MODULE_vue__.inject)("mainAppConfig");
|
|
368
368
|
if (Array.isArray(name)) return name.reduce((acc, key)=>{
|
|
369
369
|
if (data && key in data) acc[key] = data[key];
|
|
370
370
|
return acc;
|
|
@@ -417,7 +417,7 @@ function useSelectByDirectionEvent(options) {
|
|
|
417
417
|
scrollTo({
|
|
418
418
|
top: rowHeight * index,
|
|
419
419
|
left: 0,
|
|
420
|
-
behavior:
|
|
420
|
+
behavior: "smooth"
|
|
421
421
|
});
|
|
422
422
|
}
|
|
423
423
|
});
|
|
@@ -433,14 +433,14 @@ function useSelectByDirectionEvent(options) {
|
|
|
433
433
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.watch)(()=>unrefElement(triggerRef), (target)=>{
|
|
434
434
|
if (target) {
|
|
435
435
|
cleanup();
|
|
436
|
-
target.addEventListener(
|
|
436
|
+
target.addEventListener("keydown", handleKeydown);
|
|
437
437
|
cleanups.push(()=>{
|
|
438
|
-
target.removeEventListener(
|
|
438
|
+
target.removeEventListener("keydown", handleKeydown);
|
|
439
439
|
});
|
|
440
440
|
}
|
|
441
441
|
}, {
|
|
442
442
|
immediate: true,
|
|
443
|
-
flush:
|
|
443
|
+
flush: "post"
|
|
444
444
|
});
|
|
445
445
|
}
|
|
446
446
|
/* ESM default export */ const use_direction_select = useSelectByDirectionEvent;
|
|
@@ -448,13 +448,13 @@ function useSelectByDirectionEvent(options) {
|
|
|
448
448
|
* [1-10012-1]获取值域列表
|
|
449
449
|
* @param data
|
|
450
450
|
* @returns
|
|
451
|
-
*/ const queryDataSetByCodeSystemCodes = (params)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.dictRequest)(
|
|
451
|
+
*/ const queryDataSetByCodeSystemCodes = (params)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.dictRequest)("/codeSystem/queryDataSetByCodeSystemCodes", params, {
|
|
452
452
|
cancel: false
|
|
453
453
|
});
|
|
454
454
|
function useFetchDataset(codeSystemCodes, enabledFlag) {
|
|
455
455
|
const list = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
|
|
456
456
|
async function fetchData() {
|
|
457
|
-
if (codeSystemCodes) {
|
|
457
|
+
if (codeSystemCodes && codeSystemCodes?.length) {
|
|
458
458
|
const [, result] = await queryDataSetByCodeSystemCodes({
|
|
459
459
|
codeSystemCodes,
|
|
460
460
|
enabledFlag: enabledFlag ?? __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.ENABLED_FLAG.YES
|
|
@@ -468,6 +468,42 @@ function useFetchDataset(codeSystemCodes, enabledFlag) {
|
|
|
468
468
|
return list;
|
|
469
469
|
}
|
|
470
470
|
/* ESM default export */ const use_fetch_dataset = useFetchDataset;
|
|
471
|
+
/** 获取系统时间 */ async function getSystemTime() {
|
|
472
|
+
const [, res] = await (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.dictRequest)('/dictCommon/getSysTime');
|
|
473
|
+
if (res?.success) return res.data;
|
|
474
|
+
return (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.getNowTime)();
|
|
475
|
+
}
|
|
476
|
+
/** 获取系统时间 */ function useFetchSystemTime() {
|
|
477
|
+
const time = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
|
|
478
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeMount)(()=>{
|
|
479
|
+
getSystemTime().then((val)=>time.value = val);
|
|
480
|
+
});
|
|
481
|
+
return time;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* [1-10012-1]获取值域列表
|
|
485
|
+
* @param data
|
|
486
|
+
* @returns
|
|
487
|
+
*/ const queryParamListByNos = (params)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.dictRequest)("/parameter/queryParamListByNos", params);
|
|
488
|
+
function useFetchParams(options) {
|
|
489
|
+
const { hospitalId, paramNos, callback } = options;
|
|
490
|
+
const paramsConfig = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)({});
|
|
491
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeMount)(async ()=>{
|
|
492
|
+
if (!hospitalId) return;
|
|
493
|
+
const [, res] = await queryParamListByNos({
|
|
494
|
+
hospitalId,
|
|
495
|
+
paramNos
|
|
496
|
+
});
|
|
497
|
+
if (res?.data) {
|
|
498
|
+
paramsConfig.value = res.data.reduce((acc, cur)=>{
|
|
499
|
+
acc[cur.paramNo] = cur.paramSettingList;
|
|
500
|
+
return acc;
|
|
501
|
+
}, {});
|
|
502
|
+
if (callback) callback(paramsConfig.value);
|
|
503
|
+
}
|
|
504
|
+
});
|
|
505
|
+
return paramsConfig;
|
|
506
|
+
}
|
|
471
507
|
/**
|
|
472
508
|
* 表格编辑功能
|
|
473
509
|
*/ function useEditableTable(options) {
|
|
@@ -489,6 +525,13 @@ function useFetchDataset(codeSystemCodes, enabledFlag) {
|
|
|
489
525
|
}
|
|
490
526
|
};
|
|
491
527
|
/**
|
|
528
|
+
* 清理行数据验证信息
|
|
529
|
+
*/ const clearValidateItem = (row)=>{
|
|
530
|
+
const cacheKey = getRowKey(row);
|
|
531
|
+
const index = tableData.value.findIndex((item)=>item[cacheKey] === row[cacheKey]);
|
|
532
|
+
tableRef?.value?.clearValidateRow(index);
|
|
533
|
+
};
|
|
534
|
+
/**
|
|
492
535
|
* 切换编辑状态
|
|
493
536
|
*/ const toggleEdit = async (row)=>{
|
|
494
537
|
const cacheKey = getRowKey(row);
|
|
@@ -513,7 +556,7 @@ function useFetchDataset(codeSystemCodes, enabledFlag) {
|
|
|
513
556
|
* @param row
|
|
514
557
|
*/ const cancelEdit = (row, index, deleteWithoutId = true)=>{
|
|
515
558
|
const targetData = cachedEditData[row[getRowKey(row)]];
|
|
516
|
-
if ((row?.[id] || cancelToDelete || !deleteWithoutId) && targetData) Object.keys(
|
|
559
|
+
if ((row?.[id] || cancelToDelete || !deleteWithoutId) && targetData) Object.keys(targetData).forEach((key)=>{
|
|
517
560
|
row[key] = targetData[key];
|
|
518
561
|
});
|
|
519
562
|
else tableData.value.splice(index, 1);
|
|
@@ -559,12 +602,13 @@ function useFetchDataset(codeSystemCodes, enabledFlag) {
|
|
|
559
602
|
delItem,
|
|
560
603
|
insertItem,
|
|
561
604
|
updateItem,
|
|
562
|
-
validateItem
|
|
605
|
+
validateItem,
|
|
606
|
+
clearValidateItem
|
|
563
607
|
};
|
|
564
608
|
}
|
|
565
609
|
/* ESM default export */ const use_editable_table = useEditableTable;
|
|
566
610
|
function useDataChangeDetector(sources, options) {
|
|
567
|
-
const confirmMessage = options?.confirmMessage ||
|
|
611
|
+
const confirmMessage = options?.confirmMessage || "您有未保存的更改,确定要离开吗?";
|
|
568
612
|
// 缓存原始数据
|
|
569
613
|
const cacheSources = sources.map((s)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.cloneDeep)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(s)));
|
|
570
614
|
let clearSourceWatchList = [];
|
|
@@ -599,13 +643,14 @@ function useDataChangeDetector(sources, options) {
|
|
|
599
643
|
sources.forEach((value, index)=>{
|
|
600
644
|
console.log(index, (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(value), cacheSources[index]);
|
|
601
645
|
});
|
|
602
|
-
__WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessageBox.confirm(confirmMessage,
|
|
603
|
-
confirmButtonText:
|
|
604
|
-
cancelButtonText:
|
|
605
|
-
type:
|
|
646
|
+
__WEBPACK_EXTERNAL_MODULE_element_sun__.ElMessageBox.confirm(confirmMessage, "提示", {
|
|
647
|
+
confirmButtonText: "确定",
|
|
648
|
+
cancelButtonText: "取消",
|
|
649
|
+
type: "warning"
|
|
606
650
|
}).then(async ()=>{
|
|
607
651
|
next();
|
|
608
652
|
}).catch(()=>{
|
|
653
|
+
if (options?.cancelFn) options.cancelFn();
|
|
609
654
|
next(false);
|
|
610
655
|
});
|
|
611
656
|
return;
|
|
@@ -629,18 +674,19 @@ function useDataChangeDetector(sources, options) {
|
|
|
629
674
|
};
|
|
630
675
|
}
|
|
631
676
|
/* ESM default export */ const use_data_change_detector = useDataChangeDetector;
|
|
677
|
+
// import { useTranslation } from "i18next-vue";
|
|
632
678
|
function useFormConfig(options) {
|
|
633
|
-
const { t } =
|
|
679
|
+
// const { t } = useTranslation();
|
|
634
680
|
const { getData, dataSetCodes } = options;
|
|
635
|
-
const dataSet =
|
|
636
|
-
const data = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>getData(t, dataSet));
|
|
681
|
+
const dataSet = use_fetch_dataset(dataSetCodes);
|
|
682
|
+
const data = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>getData(__WEBPACK_EXTERNAL_MODULE__sun_toolkit_micro_app__.t, dataSet));
|
|
637
683
|
return data;
|
|
638
684
|
}
|
|
639
685
|
function useColumnConfig(options) {
|
|
640
|
-
const { t } =
|
|
686
|
+
// const { t } = useTranslation();
|
|
641
687
|
const { getData, dataSetCodes } = options;
|
|
642
|
-
const dataSet =
|
|
643
|
-
const data = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>getData(t, dataSet));
|
|
688
|
+
const dataSet = use_fetch_dataset(dataSetCodes);
|
|
689
|
+
const data = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>getData(__WEBPACK_EXTERNAL_MODULE__sun_toolkit_micro_app__.t, dataSet));
|
|
644
690
|
return data;
|
|
645
691
|
}
|
|
646
|
-
export { use_app_config_MAIN_APP_CONFIG as MAIN_APP_CONFIG, queryDataSetByCodeSystemCodes, use_app_config as useAppConfigData, useColumnConfig, use_data_change_detector as useDataChangeDetector, use_direction_select as useDirectionSelect, use_editable_table as useEditableTable, use_fetch_dataset as useFetchDataset, useFormConfig, use_request as useRequest };
|
|
692
|
+
export { use_app_config_MAIN_APP_CONFIG as MAIN_APP_CONFIG, getSystemTime, queryDataSetByCodeSystemCodes, queryParamListByNos, use_app_config as useAppConfigData, useColumnConfig, use_data_change_detector as useDataChangeDetector, use_direction_select as useDirectionSelect, use_editable_table as useEditableTable, use_fetch_dataset as useFetchDataset, useFetchParams, useFetchSystemTime, useFormConfig, use_request as useRequest };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Ref } from
|
|
2
|
-
import { TFunction } from
|
|
3
|
-
import { CodeSystem } from
|
|
4
|
-
import { FormDescItem } from
|
|
5
|
-
import { ColumnProps } from
|
|
1
|
+
import { Ref } from "vue";
|
|
2
|
+
import { TFunction } from "i18next";
|
|
3
|
+
import { CodeSystem } from "../use-fetch-data/types";
|
|
4
|
+
import { FormDescItem } from "@/components/pro-form/typings/index";
|
|
5
|
+
import { ColumnProps } from "@/components/pro-table/interface";
|
|
6
6
|
export interface ConfigOptions<T extends readonly string[] | undefined, U, R = undefined> {
|
|
7
7
|
getData: (t: TFunction, data: Ref<(T extends readonly string[] ? {
|
|
8
8
|
[P in T[number]]: CodeSystem[];
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Ref } from
|
|
1
|
+
import { Ref } from "vue";
|
|
2
2
|
export declare function useDataChangeDetector<T extends readonly unknown[]>(sources: {
|
|
3
3
|
[K in keyof T]: Ref<T[K]>;
|
|
4
4
|
}, options?: {
|
|
5
5
|
confirmMessage?: string;
|
|
6
6
|
isSkip?: Ref<boolean>;
|
|
7
|
+
cancelFn?: () => void;
|
|
7
8
|
}): {
|
|
8
9
|
checkChange: () => boolean;
|
|
9
10
|
updateOriginals: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ShallowRef, Ref, WritableComputedRef, ComputedRef, ComponentPublicInstance } from
|
|
1
|
+
import { ShallowRef, Ref, WritableComputedRef, ComputedRef, ComponentPublicInstance } from "vue";
|
|
2
2
|
export declare enum KEY_CODE {
|
|
3
3
|
/**
|
|
4
4
|
* ENTER
|
|
@@ -56,7 +56,7 @@ export interface UseSelectByDirectionEventOptions<T> {
|
|
|
56
56
|
scrollTo: (params: {
|
|
57
57
|
left: number;
|
|
58
58
|
top: number;
|
|
59
|
-
behavior:
|
|
59
|
+
behavior: "smooth" | "auto";
|
|
60
60
|
}) => void;
|
|
61
61
|
}
|
|
62
62
|
export declare function useSelectByDirectionEvent<U extends Record<string, any>>(options: UseSelectByDirectionEventOptions<U>): void;
|
|
@@ -3,6 +3,7 @@ import type { FormInstance } from "element-sun";
|
|
|
3
3
|
export type TableRef = {
|
|
4
4
|
formRef: FormInstance;
|
|
5
5
|
validateRow: (index: number, cb?: (isValid: boolean) => void) => Promise<boolean>;
|
|
6
|
+
clearValidateRow: (index: number) => void;
|
|
6
7
|
} | undefined;
|
|
7
8
|
/**
|
|
8
9
|
* 表格编辑功能
|
|
@@ -25,5 +26,6 @@ export declare function useEditableTable<TData extends {
|
|
|
25
26
|
insertItem: (row: TData, index: number, step?: number) => void;
|
|
26
27
|
updateItem: (row: TData, index?: number) => void;
|
|
27
28
|
validateItem: (row: TData) => Promise<boolean>;
|
|
29
|
+
clearValidateItem: (row: TData) => void;
|
|
28
30
|
};
|
|
29
31
|
export default useEditableTable;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { default as useFetchDataset, queryDataSetByCodeSystemCodes, type CodeSystem, } from './use-fetch-dataset';
|
|
2
|
+
export { getSystemTime, useFetchSystemTime } from './use-fetch-time';
|
|
3
|
+
export { useFetchParams, queryParamListByNos, type ParamSettingItem, type ParamResItem, } from './use-fetch-params';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface ParamSettingItem {
|
|
2
|
+
paramSettingId: string;
|
|
3
|
+
paramValue: string;
|
|
4
|
+
}
|
|
5
|
+
export interface ParamResItem {
|
|
6
|
+
paramNo: string;
|
|
7
|
+
paramSettingList: ParamSettingItem[];
|
|
8
|
+
}
|
|
9
|
+
interface OptionType {
|
|
10
|
+
hospitalId: string;
|
|
11
|
+
paramNos: readonly string[];
|
|
12
|
+
callback?: (data: Record<string, ParamSettingItem[]>) => void;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* [1-10012-1]获取值域列表
|
|
16
|
+
* @param data
|
|
17
|
+
* @returns
|
|
18
|
+
*/
|
|
19
|
+
export declare const queryParamListByNos: (params: {
|
|
20
|
+
paramNos: readonly string[];
|
|
21
|
+
hospitalId: string;
|
|
22
|
+
}) => Promise<[import("@sun-toolkit/request").SunApiResultData<null> | undefined, import("@sun-toolkit/request").SunApiResultData<ParamResItem[]> | undefined]>;
|
|
23
|
+
export declare function useFetchParams(options: OptionType): import("vue").Ref<Record<string, ParamSettingItem[]>, Record<string, ParamSettingItem[]>>;
|
|
24
|
+
export default useFetchParams;
|