sun-biz 0.0.4-beta.38 → 0.0.4-beta.39

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.
@@ -3841,8 +3841,8 @@ function icon_combinevue_type_template_id_80fc0d0e_render(_ctx, _cache) {
3841
3841
  ], -1)
3842
3842
  ]));
3843
3843
  }
3844
- const script = {};
3845
- const icon_combine_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(script, [
3844
+ const icon_combine_script = {};
3845
+ const icon_combine_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(icon_combine_script, [
3846
3846
  [
3847
3847
  'render',
3848
3848
  icon_combinevue_type_template_id_80fc0d0e_render
@@ -3885,7 +3885,7 @@ const icon_combine_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(script,
3885
3885
  const columns = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>__props.accessResult.columns.filter((item)=>item.display === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG_STR.YES).map((item)=>({
3886
3886
  ...item,
3887
3887
  label: item.title,
3888
- minWidth: 110,
3888
+ minWidth: item?.displayWidth || 110,
3889
3889
  prop: item.dataIndex,
3890
3890
  ...__props.isPatientAccess && 'patientName' === item.dataIndex && {
3891
3891
  render: (row)=>row?.patMainRecordId && row?.patientId !== row?.patMainRecordId ? (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)("div", {
@@ -6744,6 +6744,109 @@ const print = async (params)=>{
6744
6744
  });
6745
6745
  const printReceiptBtn_exports_ = printReceiptBtnvue_type_script_setup_true_lang_ts_name_printReceipt;
6746
6746
  /* ESM default export */ const printReceiptBtn = printReceiptBtn_exports_;
6747
+ /**
6748
+ * 方向键监听的 hook
6749
+ * @param hookActive hook是否激活
6750
+ * @returns
6751
+ */ function useDirectionKey(hookActive, cb) {
6752
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.watch)(hookActive, (v)=>{
6753
+ if (v) document.addEventListener('keydown', cb);
6754
+ else // 移除事件监听
6755
+ window.removeEventListener('keydown', cb);
6756
+ });
6757
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount)(()=>{
6758
+ console.log('useDirectionKey onBeforeUnmount');
6759
+ });
6760
+ // return {};
6761
+ }
6762
+ /**
6763
+ * table-select 模式枚举值
6764
+ */ var types_TableSelectMode = /*#__PURE__*/ function(TableSelectMode) {
6765
+ TableSelectMode["Simple"] = "simple";
6766
+ TableSelectMode["Complex"] = "complex";
6767
+ return TableSelectMode;
6768
+ }({});
6769
+ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Record_3CPropertyKey_2C_20any_3E_hoisted_1 = {
6770
+ class: "flex h-full flex-col"
6771
+ };
6772
+ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Record_3CPropertyKey_2C_20any_3E_hoisted_2 = {
6773
+ class: "header flex items-center"
6774
+ };
6775
+ // import { detectOverflow } from '@popperjs/core';
6776
+ /* ESM default export */ ({
6777
+ mode: {
6778
+ default: 'complex'
6779
+ },
6780
+ columns: {
6781
+ default: ()=>[]
6782
+ },
6783
+ placeholder: {},
6784
+ loading: {
6785
+ type: Boolean,
6786
+ default: false
6787
+ },
6788
+ scrollLoading: {
6789
+ type: Boolean,
6790
+ default: false
6791
+ },
6792
+ immediate: {
6793
+ type: Boolean,
6794
+ default: true
6795
+ },
6796
+ popoverVisible: {
6797
+ type: Boolean,
6798
+ default: false
6799
+ },
6800
+ appendTo: {
6801
+ default: 'body'
6802
+ },
6803
+ multiple: {
6804
+ type: Boolean,
6805
+ default: false
6806
+ },
6807
+ placement: {
6808
+ default: 'bottom-start'
6809
+ },
6810
+ rowKey: {
6811
+ default: ()=>'id'
6812
+ },
6813
+ labelKey: {
6814
+ default: 'label'
6815
+ },
6816
+ componentNo: {
6817
+ default: void 0
6818
+ },
6819
+ currentRowKey: {
6820
+ default: 'id'
6821
+ },
6822
+ size: {
6823
+ default: 'default'
6824
+ },
6825
+ simpleConfig: {
6826
+ default: (props)=>'simple' === props.mode ? {
6827
+ showHeader: false
6828
+ } : {}
6829
+ },
6830
+ complexConfig: {},
6831
+ highlightCurrentRow: {
6832
+ type: Boolean,
6833
+ default: true
6834
+ },
6835
+ data: {
6836
+ default: ()=>[]
6837
+ },
6838
+ remoteMethod: {
6839
+ type: Function,
6840
+ default: void 0
6841
+ }
6842
+ }), ({
6843
+ modelValue: {},
6844
+ modelModifiers: {}
6845
+ }), [
6846
+ "nextPage"
6847
+ ], [
6848
+ "update:modelValue"
6849
+ ];
6747
6850
  const Titlevue_type_script_setup_true_lang_ts_name_sunTitle_hoisted_1 = {
6748
6851
  class: "relative pl-3 font-semibold before:absolute before:left-0 before:top-1/2 before:h-2/3 before:w-1 before:-translate-y-1/2 before:bg-primary"
6749
6852
  };
@@ -11,6 +11,7 @@ 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[];
@@ -19,6 +19,26 @@
19
19
  background-color: #0000 !important;
20
20
  }
21
21
 
22
+ .input[data-v-9f70929c] .el-input__inner {
23
+ cursor: pointer !important;
24
+ }
25
+ .table-select-popover[data-v-9f70929c] {
26
+ height: 350px;
27
+ width: auto !important;
28
+ }
29
+ .table-select-popover-simple .header[data-v-9f70929c] {
30
+ width: 100%;
31
+ }
32
+ .table-select-popover-simple .header > span[data-v-9f70929c] {
33
+ flex: var(--simple-column-flex);
34
+ }
35
+ .table-select-popover-simple .cell[data-v-9f70929c] {
36
+ width: 100%;
37
+ }
38
+ .table-select-popover-simple .cell > span[data-v-9f70929c] {
39
+ flex: var(--simple-column-flex);
40
+ }
41
+
22
42
 
23
43
 
24
44
 
@@ -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,95 @@
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
+ export {};
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export * from './components/pro-table-v2';
4
4
  export * from './components/patient-access/index.ts';
5
5
  export * from './components/print/index.ts';
6
6
  export * from './components/invoice/index.ts';
7
+ export * from './components/table-select';
7
8
  export { Title } from './components/title';
8
9
  export { DictSelect, FlagSelect, HospitalSelect, TagSelect, UserSelect, BizUnitSelect, DepartmentSelect, WardSelect, } from './components/biz-select';
9
10
  export type { TagGroupInfo } from './components/biz-select';
package/dist/index.js CHANGED
@@ -4385,7 +4385,7 @@ const icon_combine_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(script,
4385
4385
  const columns = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>__props.accessResult.columns.filter((item)=>item.display === __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.FLAG_STR.YES).map((item)=>({
4386
4386
  ...item,
4387
4387
  label: item.title,
4388
- minWidth: 110,
4388
+ minWidth: item?.displayWidth || 110,
4389
4389
  prop: item.dataIndex,
4390
4390
  ...__props.isPatientAccess && 'patientName' === item.dataIndex && {
4391
4391
  render: (row)=>row?.patMainRecordId && row?.patientId !== row?.patMainRecordId ? (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)("div", {
@@ -10038,6 +10038,474 @@ const invoicevue_type_script_setup_true_lang_ts_name_proInvoice_hoisted_4 = {
10038
10038
  });
10039
10039
  const invoice_exports_ = invoicevue_type_script_setup_true_lang_ts_name_proInvoice;
10040
10040
  /* ESM default export */ const invoice = invoice_exports_;
10041
+ /**
10042
+ * 方向键监听的 hook
10043
+ * @param hookActive hook是否激活
10044
+ * @returns
10045
+ */ function useDirectionKey(hookActive, cb) {
10046
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.watch)(hookActive, (v)=>{
10047
+ if (v) document.addEventListener('keydown', cb);
10048
+ else // 移除事件监听
10049
+ window.removeEventListener('keydown', cb);
10050
+ });
10051
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount)(()=>{
10052
+ console.log('useDirectionKey onBeforeUnmount');
10053
+ });
10054
+ // return {};
10055
+ }
10056
+ /**
10057
+ * table-select 模式枚举值
10058
+ */ var types_TableSelectMode = /*#__PURE__*/ function(TableSelectMode) {
10059
+ TableSelectMode["Simple"] = "simple";
10060
+ TableSelectMode["Complex"] = "complex";
10061
+ return TableSelectMode;
10062
+ }({});
10063
+ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Record_3CPropertyKey_2C_20any_3E_hoisted_1 = {
10064
+ class: "flex h-full flex-col"
10065
+ };
10066
+ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Record_3CPropertyKey_2C_20any_3E_hoisted_2 = {
10067
+ class: "header flex items-center"
10068
+ };
10069
+ // import { detectOverflow } from '@popperjs/core';
10070
+ /* ESM default export */ const table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Record_3CPropertyKey_2C_20any_3E = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
10071
+ __name: 'index',
10072
+ props: /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeModels)({
10073
+ mode: {
10074
+ default: 'complex'
10075
+ },
10076
+ columns: {
10077
+ default: ()=>[]
10078
+ },
10079
+ placeholder: {},
10080
+ loading: {
10081
+ type: Boolean,
10082
+ default: false
10083
+ },
10084
+ scrollLoading: {
10085
+ type: Boolean,
10086
+ default: false
10087
+ },
10088
+ immediate: {
10089
+ type: Boolean,
10090
+ default: true
10091
+ },
10092
+ popoverVisible: {
10093
+ type: Boolean,
10094
+ default: false
10095
+ },
10096
+ appendTo: {
10097
+ default: 'body'
10098
+ },
10099
+ multiple: {
10100
+ type: Boolean,
10101
+ default: false
10102
+ },
10103
+ placement: {
10104
+ default: 'bottom-start'
10105
+ },
10106
+ rowKey: {
10107
+ default: ()=>'id'
10108
+ },
10109
+ labelKey: {
10110
+ default: 'label'
10111
+ },
10112
+ componentNo: {
10113
+ default: void 0
10114
+ },
10115
+ currentRowKey: {
10116
+ default: 'id'
10117
+ },
10118
+ size: {
10119
+ default: 'default'
10120
+ },
10121
+ simpleConfig: {
10122
+ default: (props)=>'simple' === props.mode ? {
10123
+ showHeader: false
10124
+ } : {}
10125
+ },
10126
+ complexConfig: {},
10127
+ highlightCurrentRow: {
10128
+ type: Boolean,
10129
+ default: true
10130
+ },
10131
+ data: {
10132
+ default: ()=>[]
10133
+ },
10134
+ remoteMethod: {
10135
+ type: Function,
10136
+ default: void 0
10137
+ }
10138
+ }, {
10139
+ modelValue: {},
10140
+ modelModifiers: {}
10141
+ }),
10142
+ emits: /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeModels)([
10143
+ "nextPage"
10144
+ ], [
10145
+ "update:modelValue"
10146
+ ]),
10147
+ setup (__props, { expose: __expose, emit: __emit }) {
10148
+ const model = (0, __WEBPACK_EXTERNAL_MODULE_vue__.useModel)(__props, "modelValue");
10149
+ const props = __props;
10150
+ const isSimpleMode = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>'simple' === props.mode);
10151
+ const simpleColumns = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>{
10152
+ if (isSimpleMode.value) return props.columns || [];
10153
+ return [];
10154
+ });
10155
+ const complexColumns = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>{
10156
+ if (!isSimpleMode.value) return props.columns || [];
10157
+ return [];
10158
+ });
10159
+ const defaultPopperOptions = {};
10160
+ const emits = __emit;
10161
+ const tableRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.useTemplateRef)('table');
10162
+ const popoverRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.useTemplateRef)('popoverRef');
10163
+ const inputSearchRef = (0, __WEBPACK_EXTERNAL_MODULE_vue__.useTemplateRef)('inputSearchRef');
10164
+ const popoverVisible = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(props.popoverVisible);
10165
+ const inputValue = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)('');
10166
+ const keydownIndex = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)(-1);
10167
+ const rowElements = (0, __WEBPACK_EXTERNAL_MODULE_vue__.computed)(()=>{
10168
+ // 此处添加 props.data.length 是为了将 props.data n纳入依赖
10169
+ if (tableRef.value?.proTableRef && props.data.length) {
10170
+ const elRowSelector = '.el-table__body tbody .el-table__row';
10171
+ const rowElements = Array.from((tableRef.value?.proTableRef.$el).querySelectorAll(elRowSelector));
10172
+ console.log(rowElements.length);
10173
+ return rowElements;
10174
+ }
10175
+ return [];
10176
+ });
10177
+ function setCurrentRow() {
10178
+ const option = props.data[keydownIndex.value];
10179
+ if (option) tableRef.value?.proTableRef.setCurrentRow(option);
10180
+ }
10181
+ function scrollToCurrentRow() {
10182
+ if (rowElements.value.length) {
10183
+ const currentRow = rowElements.value[keydownIndex.value];
10184
+ if (currentRow) // 滚动到当前行
10185
+ currentRow.scrollIntoView({
10186
+ behavior: 'smooth',
10187
+ block: 'nearest',
10188
+ inline: 'start'
10189
+ });
10190
+ }
10191
+ }
10192
+ // 键盘事件处理函数
10193
+ const handleKeydown = (e)=>{
10194
+ // 处理键盘事件逻辑
10195
+ if ('Enter' === e.key) handleRowClick(props.data[keydownIndex.value]);
10196
+ else if ('ArrowUp' === e.key) {
10197
+ keydownIndex.value--;
10198
+ keydownIndex.value = Math.max(keydownIndex.value, 0);
10199
+ setCurrentRow();
10200
+ scrollToCurrentRow();
10201
+ } else if ('ArrowDown' === e.key) {
10202
+ keydownIndex.value++;
10203
+ keydownIndex.value = Math.min(keydownIndex.value, props.data.length - 1);
10204
+ setCurrentRow();
10205
+ scrollToCurrentRow();
10206
+ }
10207
+ };
10208
+ if (props.mode === types_TableSelectMode.Complex) useDirectionKey(popoverVisible, handleKeydown);
10209
+ // function setHightLight(row: T) {
10210
+ // tableRef.value?.proTableRef.setCurrentRow(row);
10211
+ // }
10212
+ function cancelHightLight() {
10213
+ tableRef.value?.proTableRef.setCurrentRow(void 0);
10214
+ }
10215
+ /**
10216
+ * 重置
10217
+ */ function reset() {
10218
+ inputValue.value = '';
10219
+ model.value = void 0;
10220
+ }
10221
+ /**
10222
+ * 聚焦事件
10223
+ */ function focus() {
10224
+ console.log('table-select focus');
10225
+ toggleVisible();
10226
+ }
10227
+ /**
10228
+ * 点击行
10229
+ * @param row 点击的行
10230
+ */ function handleRowClick(row) {
10231
+ // 多选
10232
+ if ((0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.isArray)(model.value)) {
10233
+ const existedIndex = model.value.findIndex((item)=>item[props.rowKey] === row[props.rowKey]);
10234
+ if (-1 !== existedIndex) {
10235
+ model.value.splice(existedIndex, 1);
10236
+ cancelHightLight();
10237
+ } else model.value.push(row);
10238
+ } else {
10239
+ // 单选
10240
+ const index = props.data.findIndex((item)=>item[props.rowKey] === row[props.rowKey]);
10241
+ if (model.value) {
10242
+ if (row[props.rowKey] === model.value[props.rowKey]) {
10243
+ model.value = void 0;
10244
+ keydownIndex.value = -1;
10245
+ cancelHightLight();
10246
+ } else {
10247
+ model.value = row;
10248
+ keydownIndex.value = index;
10249
+ }
10250
+ } else {
10251
+ model.value = row;
10252
+ keydownIndex.value = index;
10253
+ }
10254
+ // popoverRef.value?.hide();
10255
+ }
10256
+ }
10257
+ /**
10258
+ * 输入框输入
10259
+ * @param v 输入的值
10260
+ */ function handleInput(v) {
10261
+ (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.debounce)(()=>{
10262
+ // 存在异步行为,要判断
10263
+ if (props.remoteMethod) props.remoteMethod(v);
10264
+ }, 500)();
10265
+ popoverVisible.value = true;
10266
+ }
10267
+ /**
10268
+ * 处理下拉加载
10269
+ */ function handleScrollLoad() {
10270
+ emits('nextPage');
10271
+ }
10272
+ function handleClickOutside(e) {
10273
+ if (e.target === inputSearchRef.value?.$el) return;
10274
+ popoverVisible.value = false;
10275
+ }
10276
+ function toggleVisible() {
10277
+ popoverVisible.value = true;
10278
+ }
10279
+ // const originalHeight = ref(0);
10280
+ // @show="handlePopoverShow" @hide="handlePopoverHide
10281
+ /**
10282
+ * popover 显示时处理高度
10283
+ */ // async function handlePopoverShow() {
10284
+ // await nextTick(); // 等待popover渲染完成
10285
+ // const popoverState = popoverRef.value?.popperRef?.popperInstanceRef?.state; // 获取Popper实例
10286
+ // // 使用detectOverflow检测溢出情况
10287
+ // const overflow = await detectOverflow(popoverState!);
10288
+ // // 当浮动存在溢出的情况时,为容易添加溢出高度手动撑开,同时让容器的父容器主动触发滚动到底部
10289
+ // if (overflow.bottom > 0) {
10290
+ // // appendTo 的元素,可以是传入的 HTMLElement或者是一个 css选择器
10291
+ // const appendToElement =
10292
+ // props.appendTo instanceof HTMLElement
10293
+ // ? props.appendTo
10294
+ // : (document.querySelector(props.appendTo) as HTMLElement);
10295
+ // // 记录原始最小高度
10296
+ // originalHeight.value = appendToElement.offsetHeight || 0;
10297
+ // // 计算需要补充的高度(溢出距离 +安全间距) 弹窗高度需要吗?
10298
+ // // const popoverHeight =
10299
+ // // popoverRef.value?.popperRef?.contentRef?.offsetHeight || 0;
10300
+ // const neededHeight = overflow.bottom + 20; // 20px安全间距
10301
+ // // 调整插入容器的高度
10302
+ // appendToElement.style.height = `${originalHeight.value + neededHeight}px`;
10303
+ // // 将容器滚动到底部
10304
+ // scrollToBottom(appendToElement.parentElement!);
10305
+ // }
10306
+ // }
10307
+ /**
10308
+ * popover 隐藏时恢复高度
10309
+ */ // async function handlePopoverHide() {
10310
+ // const appendToElement =
10311
+ // props.appendTo instanceof HTMLElement
10312
+ // ? props.appendTo
10313
+ // : (document.querySelector(props.appendTo) as HTMLElement);
10314
+ // appendToElement.style.height = '';
10315
+ // }
10316
+ /**
10317
+ * 线性动画滚动到底部
10318
+ */ // function scrollToBottom(container: HTMLElement, duration = 200) {
10319
+ // // 目标位置:容器底部
10320
+ // const targetScrollTop = container.scrollHeight - container.clientHeight;
10321
+ // // 起始位置:当前滚动位置
10322
+ // const startScrollTop = container.scrollTop;
10323
+ // // 滚动距离
10324
+ // const distance = targetScrollTop - startScrollTop;
10325
+ // if (distance <= 0) return;
10326
+ // const startTime = performance.now(); // 动画开始时间
10327
+ // // 逐帧更新函数
10328
+ // function updateScroll(currentTime: number) {
10329
+ // // 计算时间比例(0~1)
10330
+ // const elapsed = currentTime - startTime;
10331
+ // const progress = Math.min(elapsed / duration, 1); // 确保不超过1
10332
+ // container.scrollTop = startScrollTop + distance * progress;
10333
+ // // 未完成则继续下一帧
10334
+ // if (progress < 1) {
10335
+ // requestAnimationFrame(updateScroll);
10336
+ // }
10337
+ // }
10338
+ // // 启动动画
10339
+ // requestAnimationFrame(updateScroll);
10340
+ // }
10341
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect)(()=>{
10342
+ if (model.value) inputValue.value = (0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_shared__.isArray)(model.value) ? '' : model.value.name;
10343
+ });
10344
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeMount)(()=>{
10345
+ if (isSimpleMode.value) document.documentElement.style.setProperty('--simple-column-flex', `0 0 ${Math.floor(100 / simpleColumns.value.length)}%`);
10346
+ });
10347
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.onMounted)(()=>{
10348
+ if (props.immediate && props.remoteMethod) props.remoteMethod();
10349
+ });
10350
+ __expose({
10351
+ reset,
10352
+ focus,
10353
+ tableRef,
10354
+ popoverRef
10355
+ });
10356
+ return (_ctx, _cache)=>{
10357
+ const _component_el_option = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-option");
10358
+ const _component_el_select = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-select");
10359
+ return (0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, [
10360
+ 'complex' === _ctx.mode ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, {
10361
+ key: 0
10362
+ }, [
10363
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElInput), {
10364
+ class: "input",
10365
+ "prefix-icon": "Search",
10366
+ modelValue: inputValue.value,
10367
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event)=>inputValue.value = $event),
10368
+ ref_key: "inputSearchRef",
10369
+ ref: inputSearchRef,
10370
+ size: _ctx.size,
10371
+ placeholder: _ctx.$t('global:placeholder.input.template', {
10372
+ content: _ctx.$t('global:search') + _ctx.$t('global:content')
10373
+ }),
10374
+ clearable: "",
10375
+ onKeydownCapture: _cache[1] || (_cache[1] = (0, __WEBPACK_EXTERNAL_MODULE_vue__.withKeys)((0, __WEBPACK_EXTERNAL_MODULE_vue__.withModifiers)(()=>{}, [
10376
+ "prevent"
10377
+ ]), [
10378
+ "enter"
10379
+ ])),
10380
+ onClickCapture: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withModifiers)(toggleVisible, [
10381
+ "prevent"
10382
+ ]),
10383
+ onInput: handleInput,
10384
+ onClear: reset
10385
+ }, null, 8, [
10386
+ "modelValue",
10387
+ "size",
10388
+ "placeholder"
10389
+ ]),
10390
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ElPopover), {
10391
+ ref_key: "popoverRef",
10392
+ ref: popoverRef,
10393
+ width: 400,
10394
+ visible: popoverVisible.value,
10395
+ "virtual-ref": inputSearchRef.value,
10396
+ "virtual-triggering": "",
10397
+ "popper-class": "table-select-popover",
10398
+ placement: "bottom-start",
10399
+ "append-to": _ctx.appendTo,
10400
+ "popper-options": defaultPopperOptions
10401
+ }, {
10402
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
10403
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives)(((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("div", table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Record_3CPropertyKey_2C_20any_3E_hoisted_1, [
10404
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderSlot)(_ctx.$slots, "header"),
10405
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(pro_table), {
10406
+ ref: "table",
10407
+ "component-no": _ctx.componentNo,
10408
+ "row-key": _ctx.rowKey,
10409
+ "current-row-key": _ctx.currentRowKey,
10410
+ "highlight-current-row": _ctx.highlightCurrentRow,
10411
+ columns: complexColumns.value,
10412
+ data: _ctx.data,
10413
+ "scroll-load": handleScrollLoad,
10414
+ loading: _ctx.loading,
10415
+ "scroll-loading": _ctx.scrollLoading,
10416
+ onRowClick: handleRowClick
10417
+ }, null, 8, [
10418
+ "component-no",
10419
+ "row-key",
10420
+ "current-row-key",
10421
+ "highlight-current-row",
10422
+ "columns",
10423
+ "data",
10424
+ "loading",
10425
+ "scroll-loading"
10426
+ ]),
10427
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderSlot)(_ctx.$slots, "footer", {
10428
+ remoteMethod: _ctx.remoteMethod
10429
+ })
10430
+ ])), [
10431
+ [
10432
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ClickOutside),
10433
+ handleClickOutside
10434
+ ]
10435
+ ])
10436
+ ]),
10437
+ _: 3
10438
+ }, 8, [
10439
+ "visible",
10440
+ "virtual-ref",
10441
+ "append-to"
10442
+ ])
10443
+ ], 64)) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true),
10444
+ 'simple' === props.mode ? ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(_component_el_select, {
10445
+ key: 1,
10446
+ modelValue: model.value,
10447
+ "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event)=>model.value = $event),
10448
+ clearable: "",
10449
+ "popper-class": "table-select-popover-simple",
10450
+ size: _ctx.size,
10451
+ placeholder: _ctx.$t('global:placeholder.input.template', {
10452
+ content: _ctx.$t('global:search') + _ctx.$t('global:content')
10453
+ }),
10454
+ "value-key": _ctx.rowKey
10455
+ }, (0, __WEBPACK_EXTERNAL_MODULE_vue__.createSlots)({
10456
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
10457
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderSlot)(_ctx.$slots, "default", {}, ()=>[
10458
+ ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(true), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(_ctx.data, (item, index)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(_component_el_option, {
10459
+ class: "cell flex items-center",
10460
+ label: item[_ctx.labelKey],
10461
+ value: item
10462
+ }, {
10463
+ default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
10464
+ ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(true), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(simpleColumns.value, (column)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("span", {
10465
+ key: index
10466
+ }, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(item[column.key]), 1))), 128))
10467
+ ]),
10468
+ _: 2
10469
+ }, 1032, [
10470
+ "label",
10471
+ "value"
10472
+ ]))), 256))
10473
+ ])
10474
+ ]),
10475
+ _: 2
10476
+ }, [
10477
+ _ctx.simpleConfig?.showHeader ? {
10478
+ name: "header",
10479
+ fn: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
10480
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderSlot)(_ctx.$slots, "header", {
10481
+ columns: simpleColumns.value
10482
+ }, ()=>[
10483
+ (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementVNode)("div", table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Record_3CPropertyKey_2C_20any_3E_hoisted_2, [
10484
+ ((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(true), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)(__WEBPACK_EXTERNAL_MODULE_vue__.Fragment, null, (0, __WEBPACK_EXTERNAL_MODULE_vue__.renderList)(simpleColumns.value, (head, index)=>((0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createElementBlock)("span", {
10485
+ key: index
10486
+ }, (0, __WEBPACK_EXTERNAL_MODULE_vue__.toDisplayString)(head.label), 1))), 128))
10487
+ ])
10488
+ ])
10489
+ ]),
10490
+ key: "0"
10491
+ } : void 0
10492
+ ]), 1032, [
10493
+ "modelValue",
10494
+ "size",
10495
+ "placeholder",
10496
+ "value-key"
10497
+ ])) : (0, __WEBPACK_EXTERNAL_MODULE_vue__.createCommentVNode)("", true)
10498
+ ], 64);
10499
+ };
10500
+ }
10501
+ });
10502
+ const table_select_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(table_selectvue_type_script_lang_ts_setup_true_generic_T_20extends_20Record_3CPropertyKey_2C_20any_3E, [
10503
+ [
10504
+ '__scopeId',
10505
+ "data-v-9f70929c"
10506
+ ]
10507
+ ]);
10508
+ /* ESM default export */ const table_select = table_select_exports_;
10041
10509
  const utils_DICT_SELECT = 'dictSelect';
10042
10510
  /**
10043
10511
  * 集合规则
@@ -12029,4 +12497,4 @@ const form_design_render_exports_ = /*#__PURE__*/ (0, exportHelper["default"])(f
12029
12497
  ]);
12030
12498
  /* ESM default export */ const form_design_render = form_design_render_exports_;
12031
12499
  /** components **/ /** hooks ** */ var __webpack_exports__COMPONENT_CODE = __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.COMPONENT_CODE;
12032
- export { utils_AVATAR_TYPE_CODE as AVATAR_TYPE_CODE, access_info as AccessInfo, BANNER_COMPONENT_CONFIG, BannerInfo, biz_unit_select as BizUnitSelect, copy_text_with_tooltip as CopyTextWithTooltip, constant_DATA_SOURCE_CONTENT_TYPE_CODE as DATA_SOURCE_CONTENT_TYPE_CODE, dbgrid_component_setting as DbgridComponentSetting, department_select as DepartmentSelect, dict_select as DictSelect, dml_button as DmlButton, flag_select as FlagSelect, form_design_render as FormDesignRender, FormUnit, hospital_select as HospitalSelect, keyboard_value as KeyboardValue, use_app_config_MAIN_APP_CONFIG as MAIN_APP_CONFIG, patient_access as PatientAccess, PatientInfo, printReceiptBtn as PrintReceiptBtn, pro_avatar as ProAvatar, pro_dialog as ProDialog, pro_form as ProForm, invoice as ProInvoice, pro_table as ProTable, pro_table_v2 as ProTableV2, tag_select as TagSelect, Title, user_select as UserSelect, ward_select as WardSelect, convertToSpellNo, convertToWbNo, createShortcutDirective, debounce, decimalCount, findKeyCommandConfig, formatDecimalNumber, getSystemTime, isNumber, print, queryDataSetByCodeSystemCodes, queryParamListByNos, use_app_config as useAppConfigData, useColumnConfig, useDataChangeDetector, use_direction_select as useDirectionSelect, useEditableTable, use_fetch_dataset as useFetchDataset, useFetchParams, useFetchSystemTime, useFormConfig, usePrintReceipt, use_request as useRequest, __webpack_exports__COMPONENT_CODE as COMPONENT_CODE };
12500
+ export { utils_AVATAR_TYPE_CODE as AVATAR_TYPE_CODE, access_info as AccessInfo, BANNER_COMPONENT_CONFIG, BannerInfo, biz_unit_select as BizUnitSelect, copy_text_with_tooltip as CopyTextWithTooltip, constant_DATA_SOURCE_CONTENT_TYPE_CODE as DATA_SOURCE_CONTENT_TYPE_CODE, dbgrid_component_setting as DbgridComponentSetting, department_select as DepartmentSelect, dict_select as DictSelect, dml_button as DmlButton, flag_select as FlagSelect, form_design_render as FormDesignRender, FormUnit, hospital_select as HospitalSelect, keyboard_value as KeyboardValue, use_app_config_MAIN_APP_CONFIG as MAIN_APP_CONFIG, patient_access as PatientAccess, PatientInfo, printReceiptBtn as PrintReceiptBtn, pro_avatar as ProAvatar, pro_dialog as ProDialog, pro_form as ProForm, invoice as ProInvoice, pro_table as ProTable, pro_table_v2 as ProTableV2, table_select as TableSelect, types_TableSelectMode as TableSelectMode, tag_select as TagSelect, Title, user_select as UserSelect, ward_select as WardSelect, convertToSpellNo, convertToWbNo, createShortcutDirective, debounce, decimalCount, findKeyCommandConfig, formatDecimalNumber, getSystemTime, isNumber, print, queryDataSetByCodeSystemCodes, queryParamListByNos, use_app_config as useAppConfigData, useColumnConfig, useDataChangeDetector, useDirectionKey, use_direction_select as useDirectionSelect, useEditableTable, use_fetch_dataset as useFetchDataset, useFetchParams, useFetchSystemTime, useFormConfig, usePrintReceipt, use_request as useRequest, __webpack_exports__COMPONENT_CODE as COMPONENT_CODE };
@@ -21,6 +21,26 @@
21
21
 
22
22
 
23
23
 
24
+ .input[data-v-9f70929c] .el-input__inner {
25
+ cursor: pointer !important;
26
+ }
27
+ .table-select-popover[data-v-9f70929c] {
28
+ height: 350px;
29
+ width: auto !important;
30
+ }
31
+ .table-select-popover-simple .header[data-v-9f70929c] {
32
+ width: 100%;
33
+ }
34
+ .table-select-popover-simple .header > span[data-v-9f70929c] {
35
+ flex: var(--simple-column-flex);
36
+ }
37
+ .table-select-popover-simple .cell[data-v-9f70929c] {
38
+ width: 100%;
39
+ }
40
+ .table-select-popover-simple .cell > span[data-v-9f70929c] {
41
+ flex: var(--simple-column-flex);
42
+ }
43
+
24
44
 
25
45
 
26
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sun-biz",
3
- "version": "0.0.4-beta.38",
3
+ "version": "0.0.4-beta.39",
4
4
  "type": "module",
5
5
  "workspaces": [
6
6
  "src/*",
@@ -37,6 +37,7 @@
37
37
  "devDependencies": {
38
38
  "@microsoft/api-extractor": "^7.52.8",
39
39
  "@rsbuild/plugin-babel": "^1.0.5",
40
+ "@rsbuild/plugin-sass": "^1.4.0",
40
41
  "@rsbuild/plugin-vue": "^1.1.0",
41
42
  "@rsbuild/plugin-vue-jsx": "^1.1.1",
42
43
  "@rslib/core": "^0.0.18",