sun-biz 0.0.4-beta.5 → 0.0.4-beta.51

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.
Files changed (43) hide show
  1. package/dist/components/biz-select/biz-unit-select/api.d.ts +34 -0
  2. package/dist/components/biz-select/department-select/api.d.ts +51 -0
  3. package/dist/components/biz-select/hospital-charge-select/api.d.ts +53 -0
  4. package/dist/components/biz-select/index.d.ts +8 -0
  5. package/dist/components/biz-select/tag-select/api.d.ts +44 -0
  6. package/dist/components/biz-select/tag-select/utils.d.ts +31 -0
  7. package/dist/components/biz-select/user-select/api.d.ts +109 -0
  8. package/dist/components/biz-select/ward-select/api.d.ts +43 -0
  9. package/dist/components/index.d.ts +3 -1
  10. package/dist/components/index.js +4716 -390
  11. package/dist/components/index.js.LICENSE.txt +11 -0
  12. package/dist/components/keyboard-value/index.d.ts +1 -0
  13. package/dist/components/patient-access/api.d.ts +12 -1
  14. package/dist/components/print/hooks/index.d.ts +1 -0
  15. package/dist/components/pro-avatar/index.d.ts +2 -0
  16. package/dist/components/pro-avatar/utils.d.ts +21 -0
  17. package/dist/components/pro-form/typings/index.d.ts +1 -0
  18. package/dist/components/pro-table/composables/dbgrid-component-setting/typings/index.d.ts +1 -0
  19. package/dist/components/pro-table/constant.d.ts +1 -0
  20. package/dist/components/pro-table/interface/index.d.ts +7 -1
  21. package/dist/components/static/css/index.css +61 -3
  22. package/dist/components/table-select/composable/useDirectionKey.d.ts +7 -0
  23. package/dist/components/table-select/index.d.ts +4 -0
  24. package/dist/components/table-select/types/index.d.ts +109 -0
  25. package/dist/directives/index.d.ts +1 -0
  26. package/dist/directives/shortcut.d.ts +13 -0
  27. package/dist/hooks/index.d.ts +3 -3
  28. package/dist/hooks/index.js +68 -22
  29. package/dist/hooks/use-app-config/index.d.ts +2 -2
  30. package/dist/hooks/use-column&form-config/index.d.ts +5 -5
  31. package/dist/hooks/use-data-change-detector/index.d.ts +2 -1
  32. package/dist/hooks/use-direction-select/index.d.ts +2 -2
  33. package/dist/hooks/use-editable-table/index.d.ts +2 -0
  34. package/dist/hooks/use-fetch-data/index.d.ts +3 -0
  35. package/dist/hooks/{use-fetch-dataset/index.d.ts → use-fetch-data/use-fetch-dataset.d.ts} +1 -1
  36. package/dist/hooks/use-fetch-data/use-fetch-params.d.ts +24 -0
  37. package/dist/hooks/use-fetch-data/use-fetch-time.d.ts +6 -0
  38. package/dist/index.d.ts +28 -24
  39. package/dist/index.js +5682 -480
  40. package/dist/index.js.LICENSE.txt +11 -0
  41. package/dist/static/css/index.css +61 -3
  42. package/package.json +21 -18
  43. 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 "./types.d";
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]>;
@@ -34,3 +34,4 @@ export declare function useDesignAndPreview(htmlContent: string | undefined, tit
34
34
  onConfirm?: () => void;
35
35
  onCancel?: () => void;
36
36
  }): void;
37
+ /** 此处忽略修改之后已经支持了火狐,不需要判断了 */
@@ -0,0 +1,2 @@
1
+ export { default as ProAvatar } from './index.vue';
2
+ export { AVATAR_TYPE_CODE } from './utils';
@@ -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
+ }
@@ -14,6 +14,7 @@ export interface FormDescItem {
14
14
  supportCopyAndTips?: boolean;
15
15
  type?: string;
16
16
  name: string;
17
+ radioComponent?: string;
17
18
  label?: string | (() => VNode | string);
18
19
  span?: number;
19
20
  width?: number | string;
@@ -74,6 +74,7 @@ export interface UserItem {
74
74
  }
75
75
  export interface SettingParams {
76
76
  columns: ColumnProps[];
77
+ defaultColumns: ColumnProps[];
77
78
  componentNo: string;
78
79
  columnsSetting?: {
79
80
  draggable?: boolean;
@@ -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,20 +6,78 @@
6
6
 
7
7
 
8
8
 
9
- [data-v-51d84f56] .el-menu-item {
9
+ [data-v-a526e56a] .el-menu-item {
10
10
  height: 48px;
11
11
  line-height: 48px;
12
12
  }
13
- [data-v-51d84f56] .el-sub-menu__title {
13
+ [data-v-a526e56a] .el-sub-menu__title {
14
14
  height: 48px;
15
15
  line-height: 48px;
16
16
  }
17
- [data-v-51d84f56] .el-menu-item.is-active {
17
+ [data-v-a526e56a] .el-menu-item.is-active {
18
18
  color: inherit !important;
19
19
  background-color: #0000 !important;
20
20
  }
21
21
 
22
+ .input[data-v-6f430336] .el-input__inner {
23
+ cursor: pointer !important;
24
+ }
25
+ .table-select-popover[data-v-6f430336] {
26
+ height: 350px;
27
+ width: auto !important;
28
+ }
29
+ .table-select-popover-simple .header[data-v-6f430336] {
30
+ width: 100%;
31
+ }
32
+ .table-select-popover-simple .header > span[data-v-6f430336] {
33
+ flex: var(--simple-column-flex);
34
+ }
35
+ .table-select-popover-simple .cell[data-v-6f430336] {
36
+ width: 100%;
37
+ }
38
+ .table-select-popover-simple .cell > span[data-v-6f430336] {
39
+ flex: var(--simple-column-flex);
40
+ }
41
+
42
+
43
+
44
+ .disabled-user-tooltip, .disabled-user-tooltip .el-tooltip__trigger {
45
+ color: #f56c6c !important;
46
+ }
22
47
 
48
+ .hospital-charge-select[data-v-ffb2d000] {
49
+ width: 100%;
50
+ }
51
+ .hospital-charge-select .input[data-v-ffb2d000] .el-input__inner {
52
+ cursor: pointer !important;
53
+ }
54
+ [data-v-ffb2d000] .hospital-charge-select-popover {
55
+ max-height: var(--5aebc6cb);
56
+ padding: 0;
57
+ z-index: 9999 !important;
58
+ }
59
+ [data-v-ffb2d000] .hospital-charge-select-popover .popover-content {
60
+ width: 100%;
61
+ height: 100%;
62
+ max-height: var(--5aebc6cb);
63
+ }
64
+ [data-v-ffb2d000] .hospital-charge-select-popover .el-table__row.cursor-not-allowed {
65
+ color: #c0c4cc;
66
+ cursor: not-allowed !important;
67
+ background-color: #f5f7fa !important;
68
+ }
69
+ [data-v-ffb2d000] .hospital-charge-select-popover .el-table__row.cursor-not-allowed td {
70
+ background-color: #f5f7fa !important;
71
+ }
72
+ [data-v-ffb2d000] .hospital-charge-select-popover .el-table__row.cursor-not-allowed:hover > td {
73
+ background-color: #f5f7fa !important;
74
+ }
75
+ .hospital-charge-select-popover {
76
+ margin-bottom: 8px !important;
77
+ }
78
+ .hospital-charge-select-popover {
79
+ margin-top: 8px !important;
80
+ }
23
81
 
24
82
 
25
83
 
@@ -0,0 +1,7 @@
1
+ import { Ref } from 'vue';
2
+ /**
3
+ * 方向键监听的 hook
4
+ * @param hookActive hook是否激活
5
+ * @returns
6
+ */
7
+ export default function useDirectionKey(hookActive: Ref<boolean>, cb: (e: KeyboardEvent) => void): void;
@@ -0,0 +1,4 @@
1
+ import useDirectionKey from './composable/useDirectionKey.ts';
2
+ export * from './types';
3
+ export { useDirectionKey };
4
+ export { default as TableSelect } from './index.vue';
@@ -0,0 +1,109 @@
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
+ * 是否禁用
53
+ */
54
+ disabled?: boolean;
55
+ /**
56
+ * 是否加载中
57
+ */
58
+ loading?: boolean;
59
+ /** 是否滚动加载中 */
60
+ scrollLoading?: boolean;
61
+ /** 是否立即执行加载方法 */
62
+ immediate?: boolean;
63
+ /** 弹窗是否可见 */
64
+ popoverVisible?: boolean;
65
+ /** 弹窗挂载点 */
66
+ appendTo?: string | HTMLElement;
67
+ /** 是否支持多选 */
68
+ multiple?: boolean;
69
+ /** 弹窗位置 */
70
+ placement?: string;
71
+ /** 行数据的唯一标识字段 */
72
+ rowKey?: string & keyof T;
73
+ /** 自定义 label 键名 */
74
+ labelKey?: string;
75
+ /** 表格组件编号 */
76
+ componentNo?: string;
77
+ /** 当前选中行的 key */
78
+ currentRowKey?: string;
79
+ /** 组件尺寸 */
80
+ size?: ComponentSize;
81
+ /** 简易模式配置项 */
82
+ simpleConfig?: ISelectSimpleConfig;
83
+ /** 复杂模式配置项 */
84
+ complexConfig?: ISelectComplexConfig;
85
+ /** 是否高亮当前行 */
86
+ highlightCurrentRow?: boolean;
87
+ /** 表格数据 */
88
+ data: T[];
89
+ /** 远程加载数据的方法 */
90
+ remoteMethod?: RemoteMethod<string | undefined>;
91
+ }
92
+ /**
93
+ * 简易模式配置项
94
+ */
95
+ export interface ISelectSimpleConfig {
96
+ /** 是否显示表头 */
97
+ showHeader?: boolean;
98
+ }
99
+ export interface ISelectComplexConfig {
100
+ /**
101
+ * 弹窗宽度
102
+ */
103
+ width?: string | number;
104
+ /**
105
+ * 弹窗最大高度
106
+ */
107
+ maxHeight?: string | number;
108
+ }
109
+ 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 };
@@ -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 { default as useFetchDataset, queryDataSetByCodeSystemCodes, type CodeSystem } from "./use-fetch-dataset/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';
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";
@@ -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 __WEBPACK_EXTERNAL_MODULE_i18next_vue__ from "i18next-vue";
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)('mainAppConfig');
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: 'smooth'
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('keydown', handleKeydown);
436
+ target.addEventListener("keydown", handleKeydown);
437
437
  cleanups.push(()=>{
438
- target.removeEventListener('keydown', handleKeydown);
438
+ target.removeEventListener("keydown", handleKeydown);
439
439
  });
440
440
  }
441
441
  }, {
442
442
  immediate: true,
443
- flush: 'post'
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)('/codeSystem/queryDataSetByCodeSystemCodes', params, {
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(row).forEach((key)=>{
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: 'warning'
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 } = (0, __WEBPACK_EXTERNAL_MODULE_i18next_vue__.useTranslation)();
679
+ // const { t } = useTranslation();
634
680
  const { getData, dataSetCodes } = options;
635
- const dataSet = useFetchDataset(dataSetCodes);
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 } = (0, __WEBPACK_EXTERNAL_MODULE_i18next_vue__.useTranslation)();
686
+ // const { t } = useTranslation();
641
687
  const { getData, dataSetCodes } = options;
642
- const dataSet = useFetchDataset(dataSetCodes);
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,5 +1,5 @@
1
- import { AppConfigType } from './types';
2
- export type { PreferenceData } from './types';
1
+ import { AppConfigType } from "./types";
2
+ export type { PreferenceData } from "./types";
3
3
  /**
4
4
  * 获取主应用配置信息
5
5
  */
@@ -1,8 +1,8 @@
1
- import { Ref } from 'vue';
2
- import { TFunction } from 'i18next';
3
- import { CodeSystem } from '../use-fetch-dataset/types';
4
- import { FormDescItem } from '@/components/pro-form/typings/index';
5
- import { ColumnProps } from '@/components/pro-table/interface';
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 'vue';
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 'vue';
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: 'smooth' | 'auto';
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';
@@ -1,4 +1,4 @@
1
- import type { CodeSystem } from './types.d';
1
+ import type { CodeSystem } from "./types.d";
2
2
  /**
3
3
  * [1-10012-1]获取值域列表
4
4
  * @param data
@@ -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;
@@ -0,0 +1,6 @@
1
+ /** 获取系统时间 */
2
+ export declare function getSystemTime(): Promise<string | {
3
+ data: string;
4
+ }>;
5
+ /** 获取系统时间 */
6
+ export declare function useFetchSystemTime(): import("vue").Ref<any, any>;