sun-biz 0.0.4-beta.45 → 0.0.4-beta.47
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/index.js +102 -20
- package/dist/hooks/index.js +1 -1
- package/dist/index.js +102 -20
- package/package.json +3 -2
package/dist/components/index.js
CHANGED
|
@@ -572,7 +572,7 @@ const RenderColumn_exports_ = RenderColumnvue_type_script_lang_ts_setup_true_nam
|
|
|
572
572
|
function useFetchDataset(codeSystemCodes, enabledFlag) {
|
|
573
573
|
const list = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
|
|
574
574
|
async function fetchData() {
|
|
575
|
-
if (codeSystemCodes) {
|
|
575
|
+
if (codeSystemCodes && codeSystemCodes?.length) {
|
|
576
576
|
const [, result] = await queryDataSetByCodeSystemCodes({
|
|
577
577
|
codeSystemCodes,
|
|
578
578
|
enabledFlag: enabledFlag ?? __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.ENABLED_FLAG.YES
|
|
@@ -7351,9 +7351,9 @@ const user_select_exports_ = user_selectvue_type_script_setup_true_lang_ts_name_
|
|
|
7351
7351
|
*/ const queryBizUnitList = (params)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.dictRequest)('/organization/queryBizUnitListByExample', params);
|
|
7352
7352
|
// 全局事件:用于关闭其他实例的 popover
|
|
7353
7353
|
const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7354
|
+
96-10014-1 业务单元选择组件
|
|
7355
|
+
1、调用“1-10516-1 根据条件查询业务单元列表”传入“启用标志=1、关键字、医院标识=入参:医院标识、科室类型代码集合、就诊类型代码”查询业务单元列表
|
|
7356
|
+
2、展示列包括“组织类型、编码、名称”
|
|
7357
7357
|
*/
|
|
7358
7358
|
/* ESM default export */ const biz_unit_selectvue_type_script_lang_tsx_name_BizUnitSelect_setup_true = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
|
|
7359
7359
|
__name: 'index',
|
|
@@ -7538,7 +7538,24 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
7538
7538
|
await getBizUnitList({
|
|
7539
7539
|
keyWord: value
|
|
7540
7540
|
});
|
|
7541
|
-
}, 500); //
|
|
7541
|
+
}, 500); // 滚动到当前选中行
|
|
7542
|
+
const scrollToCurrentRow = ()=>{
|
|
7543
|
+
setTimeout(()=>{
|
|
7544
|
+
if (currentRowIndex.value < 0) return;
|
|
7545
|
+
try {
|
|
7546
|
+
const tableElement = tableRef.value?.eleTable?.$el;
|
|
7547
|
+
if (!tableElement) return; // 查找当前高亮的行
|
|
7548
|
+
const currentRowElement = tableElement.querySelector('.el-table__body tr.current-row');
|
|
7549
|
+
if (!currentRowElement) return; // 使用 scrollIntoView 方法滚动到当前行
|
|
7550
|
+
currentRowElement.scrollIntoView({
|
|
7551
|
+
block: 'nearest',
|
|
7552
|
+
behavior: 'smooth'
|
|
7553
|
+
});
|
|
7554
|
+
} catch (error) {
|
|
7555
|
+
console.error('Error scrolling to current row:', error);
|
|
7556
|
+
}
|
|
7557
|
+
}, 100);
|
|
7558
|
+
}; // 键盘事件
|
|
7542
7559
|
const handleKeydown = (e)=>{
|
|
7543
7560
|
if (!bizUnitList.value.length || !popoverVisible.value) return;
|
|
7544
7561
|
if ('ArrowDown' === e.key) {
|
|
@@ -7547,6 +7564,7 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
7547
7564
|
currentRowIndex.value++;
|
|
7548
7565
|
const row = bizUnitList.value[currentRowIndex.value];
|
|
7549
7566
|
tableRef.value.eleTable?.setCurrentRow(row);
|
|
7567
|
+
scrollToCurrentRow();
|
|
7550
7568
|
}
|
|
7551
7569
|
} else if ('ArrowUp' === e.key) {
|
|
7552
7570
|
e.preventDefault();
|
|
@@ -7554,6 +7572,7 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
7554
7572
|
currentRowIndex.value--;
|
|
7555
7573
|
const row = bizUnitList.value[currentRowIndex.value];
|
|
7556
7574
|
tableRef.value.eleTable?.setCurrentRow(row);
|
|
7575
|
+
scrollToCurrentRow();
|
|
7557
7576
|
}
|
|
7558
7577
|
} else if ('Enter' === e.key && currentRowIndex.value >= 0) {
|
|
7559
7578
|
const row = bizUnitList.value[currentRowIndex.value];
|
|
@@ -7619,16 +7638,44 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
7619
7638
|
const handleClickOutside = (e)=>{
|
|
7620
7639
|
const target = e.target;
|
|
7621
7640
|
const selectEl = selectRef.value?.$el;
|
|
7622
|
-
const popoverEl = popoverRef.value?.popperRef?.contentRef;
|
|
7623
|
-
if (
|
|
7641
|
+
const popoverEl = popoverRef.value?.popperRef?.contentRef; // 检查是否点击了当前组件的元素
|
|
7642
|
+
if (selectEl?.contains(target) || popoverEl?.contains(target)) return;
|
|
7643
|
+
// 检查是否点击了其他 el-select 或其下拉框
|
|
7644
|
+
let element = target;
|
|
7645
|
+
while(element){
|
|
7646
|
+
if (element.classList?.contains('el-select') || element.classList?.contains('el-select-dropdown') || element.classList?.contains('el-popper') || element.classList?.contains('el-picker-panel') || element.classList?.contains('el-date-picker') || element.classList?.contains('el-time-picker')) {
|
|
7647
|
+
popoverVisible.value = false;
|
|
7648
|
+
return;
|
|
7649
|
+
}
|
|
7650
|
+
element = element.parentElement;
|
|
7651
|
+
} // 点击了其他地方,关闭 popover
|
|
7652
|
+
popoverVisible.value = false;
|
|
7653
|
+
}; // 监听 el-select 的 focus 事件来关闭当前 popover
|
|
7654
|
+
const handleGlobalFocusin = (e)=>{
|
|
7655
|
+
if (!popoverVisible.value) return;
|
|
7656
|
+
const target = e.target;
|
|
7657
|
+
const selectEl = selectRef.value?.$el;
|
|
7658
|
+
const popoverEl = popoverRef.value?.popperRef?.contentRef; // 如果焦点移到了其他元素(如其他 el-select),则关闭当前 popover
|
|
7659
|
+
if (!selectEl?.contains(target) && !popoverEl?.contains(target)) {
|
|
7660
|
+
let element = target;
|
|
7661
|
+
while(element){
|
|
7662
|
+
if (element.classList?.contains('el-select') || element.classList?.contains('el-input')) {
|
|
7663
|
+
popoverVisible.value = false;
|
|
7664
|
+
return;
|
|
7665
|
+
}
|
|
7666
|
+
element = element.parentElement;
|
|
7667
|
+
}
|
|
7668
|
+
}
|
|
7624
7669
|
};
|
|
7625
7670
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.watch)(()=>popoverVisible.value, (val)=>{
|
|
7626
7671
|
if (val) {
|
|
7627
7672
|
document.addEventListener('keydown', handleKeydown, true);
|
|
7628
|
-
|
|
7673
|
+
document.addEventListener('click', handleClickOutside);
|
|
7674
|
+
document.addEventListener('focusin', handleGlobalFocusin, true);
|
|
7629
7675
|
} else {
|
|
7630
7676
|
document.removeEventListener('keydown', handleKeydown, true);
|
|
7631
|
-
|
|
7677
|
+
document.removeEventListener('click', handleClickOutside);
|
|
7678
|
+
document.removeEventListener('focusin', handleGlobalFocusin, true);
|
|
7632
7679
|
}
|
|
7633
7680
|
});
|
|
7634
7681
|
const handleTableRowSelect = (data)=>{
|
|
@@ -7667,7 +7714,8 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
7667
7714
|
};
|
|
7668
7715
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount)(()=>{
|
|
7669
7716
|
document.removeEventListener('keydown', handleKeydown, true);
|
|
7670
|
-
|
|
7717
|
+
document.removeEventListener('click', handleClickOutside);
|
|
7718
|
+
document.removeEventListener('focusin', handleGlobalFocusin, true);
|
|
7671
7719
|
window.removeEventListener(CLOSE_OTHER_POPOVERS_EVENT, handleCloseOtherPopovers);
|
|
7672
7720
|
});
|
|
7673
7721
|
const fetchData = async (data)=>{
|
|
@@ -7717,6 +7765,15 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
7717
7765
|
}
|
|
7718
7766
|
});
|
|
7719
7767
|
});
|
|
7768
|
+
const onClickOutside = ()=>{
|
|
7769
|
+
handleBlur();
|
|
7770
|
+
};
|
|
7771
|
+
const visibleChange = (val)=>{
|
|
7772
|
+
if (val) {
|
|
7773
|
+
loading.value = true;
|
|
7774
|
+
handleFocus();
|
|
7775
|
+
}
|
|
7776
|
+
};
|
|
7720
7777
|
__expose({
|
|
7721
7778
|
popoverRef,
|
|
7722
7779
|
tableRef,
|
|
@@ -7758,11 +7815,11 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
7758
7815
|
"collapse-tags-tooltip": "",
|
|
7759
7816
|
filterable: "",
|
|
7760
7817
|
remote: "",
|
|
7761
|
-
"remote-show-suffix": ""
|
|
7818
|
+
"remote-show-suffix": "",
|
|
7819
|
+
loading: loading.value
|
|
7762
7820
|
}, selectProps.value, {
|
|
7763
|
-
|
|
7821
|
+
onVisibleChange: visibleChange,
|
|
7764
7822
|
onClear: handleClear,
|
|
7765
|
-
onFocus: handleFocus,
|
|
7766
7823
|
onRemoveTag: handleTagRemove
|
|
7767
7824
|
}), null, 16, [
|
|
7768
7825
|
"modelValue",
|
|
@@ -7771,7 +7828,8 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
7771
7828
|
"placeholder",
|
|
7772
7829
|
"popper-class",
|
|
7773
7830
|
"remote-method",
|
|
7774
|
-
"teleported"
|
|
7831
|
+
"teleported",
|
|
7832
|
+
"loading"
|
|
7775
7833
|
])
|
|
7776
7834
|
]),
|
|
7777
7835
|
default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
|
|
@@ -7781,7 +7839,7 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
7781
7839
|
}),
|
|
7782
7840
|
class: "w-full overflow-hidden"
|
|
7783
7841
|
}, [
|
|
7784
|
-
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(pro_table), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
|
|
7842
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives)((0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(pro_table), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
|
|
7785
7843
|
ref_key: "tableRef",
|
|
7786
7844
|
ref: tableRef,
|
|
7787
7845
|
columns: (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(tableConfig),
|
|
@@ -7800,6 +7858,11 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
7800
7858
|
"columns",
|
|
7801
7859
|
"data",
|
|
7802
7860
|
"loading"
|
|
7861
|
+
]), [
|
|
7862
|
+
[
|
|
7863
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ClickOutside),
|
|
7864
|
+
onClickOutside
|
|
7865
|
+
]
|
|
7803
7866
|
])
|
|
7804
7867
|
], 4)
|
|
7805
7868
|
]),
|
|
@@ -8151,6 +8214,15 @@ const biz_unit_select_exports_ = biz_unit_selectvue_type_script_lang_tsx_name_Bi
|
|
|
8151
8214
|
}
|
|
8152
8215
|
});
|
|
8153
8216
|
});
|
|
8217
|
+
const onClickOutside = ()=>{
|
|
8218
|
+
handleBlur();
|
|
8219
|
+
};
|
|
8220
|
+
const visibleChange = (val)=>{
|
|
8221
|
+
if (val) {
|
|
8222
|
+
loading.value = true;
|
|
8223
|
+
handleFocus();
|
|
8224
|
+
}
|
|
8225
|
+
};
|
|
8154
8226
|
__expose({
|
|
8155
8227
|
popoverRef,
|
|
8156
8228
|
tableRef,
|
|
@@ -8192,10 +8264,10 @@ const biz_unit_select_exports_ = biz_unit_selectvue_type_script_lang_tsx_name_Bi
|
|
|
8192
8264
|
"remote-method": (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(handelRemoteMethod),
|
|
8193
8265
|
multiple: !!props.multiSelectFlag,
|
|
8194
8266
|
options: [],
|
|
8267
|
+
loading: loading.value,
|
|
8195
8268
|
"popper-class": popoverVisible.value ? 'hidden' : '',
|
|
8196
8269
|
onRemoveTag: handleTagRemove,
|
|
8197
|
-
|
|
8198
|
-
onBlur: handleBlur,
|
|
8270
|
+
onVisibleChange: visibleChange,
|
|
8199
8271
|
onClear: handleClear
|
|
8200
8272
|
}, selectProps.value), null, 16, [
|
|
8201
8273
|
"modelValue",
|
|
@@ -8204,6 +8276,7 @@ const biz_unit_select_exports_ = biz_unit_selectvue_type_script_lang_tsx_name_Bi
|
|
|
8204
8276
|
"teleported",
|
|
8205
8277
|
"remote-method",
|
|
8206
8278
|
"multiple",
|
|
8279
|
+
"loading",
|
|
8207
8280
|
"popper-class"
|
|
8208
8281
|
])
|
|
8209
8282
|
]),
|
|
@@ -8214,7 +8287,7 @@ const biz_unit_select_exports_ = biz_unit_selectvue_type_script_lang_tsx_name_Bi
|
|
|
8214
8287
|
}),
|
|
8215
8288
|
class: "w-full overflow-hidden"
|
|
8216
8289
|
}, [
|
|
8217
|
-
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(pro_table), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
|
|
8290
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives)((0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(pro_table), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
|
|
8218
8291
|
style: {
|
|
8219
8292
|
height: "100%"
|
|
8220
8293
|
},
|
|
@@ -8232,6 +8305,11 @@ const biz_unit_select_exports_ = biz_unit_selectvue_type_script_lang_tsx_name_Bi
|
|
|
8232
8305
|
"loading",
|
|
8233
8306
|
"columns",
|
|
8234
8307
|
"data"
|
|
8308
|
+
]), [
|
|
8309
|
+
[
|
|
8310
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ClickOutside),
|
|
8311
|
+
onClickOutside
|
|
8312
|
+
]
|
|
8235
8313
|
])
|
|
8236
8314
|
], 4)
|
|
8237
8315
|
]),
|
|
@@ -11056,7 +11134,9 @@ const access_info_exports_ = access_infovue_type_script_setup_true_lang_ts_name_
|
|
|
11056
11134
|
const _component_el_dropdown_item = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-dropdown-item");
|
|
11057
11135
|
const _component_el_dropdown_menu = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-dropdown-menu");
|
|
11058
11136
|
const _component_el_dropdown = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-dropdown");
|
|
11059
|
-
return (0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(_component_el_dropdown,
|
|
11137
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(_component_el_dropdown, {
|
|
11138
|
+
trigger: disabledLoad.value ? 'click' : 'hover'
|
|
11139
|
+
}, (0, __WEBPACK_EXTERNAL_MODULE_vue__.createSlots)({
|
|
11060
11140
|
default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
|
|
11061
11141
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(_component_el_button, {
|
|
11062
11142
|
type: "primary",
|
|
@@ -11105,7 +11185,9 @@ const access_info_exports_ = access_infovue_type_script_setup_true_lang_ts_name_
|
|
|
11105
11185
|
]),
|
|
11106
11186
|
key: "0"
|
|
11107
11187
|
}
|
|
11108
|
-
]),
|
|
11188
|
+
]), 1032, [
|
|
11189
|
+
"trigger"
|
|
11190
|
+
]);
|
|
11109
11191
|
};
|
|
11110
11192
|
}
|
|
11111
11193
|
});
|
package/dist/hooks/index.js
CHANGED
|
@@ -454,7 +454,7 @@ function useSelectByDirectionEvent(options) {
|
|
|
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
|
package/dist/index.js
CHANGED
|
@@ -572,7 +572,7 @@ const RenderColumn_exports_ = RenderColumnvue_type_script_lang_ts_setup_true_nam
|
|
|
572
572
|
function useFetchDataset(codeSystemCodes, enabledFlag) {
|
|
573
573
|
const list = (0, __WEBPACK_EXTERNAL_MODULE_vue__.ref)();
|
|
574
574
|
async function fetchData() {
|
|
575
|
-
if (codeSystemCodes) {
|
|
575
|
+
if (codeSystemCodes && codeSystemCodes?.length) {
|
|
576
576
|
const [, result] = await queryDataSetByCodeSystemCodes({
|
|
577
577
|
codeSystemCodes,
|
|
578
578
|
enabledFlag: enabledFlag ?? __WEBPACK_EXTERNAL_MODULE__sun_toolkit_enums__.ENABLED_FLAG.YES
|
|
@@ -8027,9 +8027,9 @@ const user_select_exports_ = user_selectvue_type_script_setup_true_lang_ts_name_
|
|
|
8027
8027
|
*/ const queryBizUnitList = (params)=>(0, __WEBPACK_EXTERNAL_MODULE__sun_toolkit_request__.dictRequest)('/organization/queryBizUnitListByExample', params);
|
|
8028
8028
|
// 全局事件:用于关闭其他实例的 popover
|
|
8029
8029
|
const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
8030
|
-
|
|
8031
|
-
|
|
8032
|
-
|
|
8030
|
+
96-10014-1 业务单元选择组件
|
|
8031
|
+
1、调用“1-10516-1 根据条件查询业务单元列表”传入“启用标志=1、关键字、医院标识=入参:医院标识、科室类型代码集合、就诊类型代码”查询业务单元列表
|
|
8032
|
+
2、展示列包括“组织类型、编码、名称”
|
|
8033
8033
|
*/
|
|
8034
8034
|
/* ESM default export */ const biz_unit_selectvue_type_script_lang_tsx_name_BizUnitSelect_setup_true = /*@__PURE__*/ (0, __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent)({
|
|
8035
8035
|
__name: 'index',
|
|
@@ -8214,7 +8214,24 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
8214
8214
|
await getBizUnitList({
|
|
8215
8215
|
keyWord: value
|
|
8216
8216
|
});
|
|
8217
|
-
}, 500); //
|
|
8217
|
+
}, 500); // 滚动到当前选中行
|
|
8218
|
+
const scrollToCurrentRow = ()=>{
|
|
8219
|
+
setTimeout(()=>{
|
|
8220
|
+
if (currentRowIndex.value < 0) return;
|
|
8221
|
+
try {
|
|
8222
|
+
const tableElement = tableRef.value?.eleTable?.$el;
|
|
8223
|
+
if (!tableElement) return; // 查找当前高亮的行
|
|
8224
|
+
const currentRowElement = tableElement.querySelector('.el-table__body tr.current-row');
|
|
8225
|
+
if (!currentRowElement) return; // 使用 scrollIntoView 方法滚动到当前行
|
|
8226
|
+
currentRowElement.scrollIntoView({
|
|
8227
|
+
block: 'nearest',
|
|
8228
|
+
behavior: 'smooth'
|
|
8229
|
+
});
|
|
8230
|
+
} catch (error) {
|
|
8231
|
+
console.error('Error scrolling to current row:', error);
|
|
8232
|
+
}
|
|
8233
|
+
}, 100);
|
|
8234
|
+
}; // 键盘事件
|
|
8218
8235
|
const handleKeydown = (e)=>{
|
|
8219
8236
|
if (!bizUnitList.value.length || !popoverVisible.value) return;
|
|
8220
8237
|
if ('ArrowDown' === e.key) {
|
|
@@ -8223,6 +8240,7 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
8223
8240
|
currentRowIndex.value++;
|
|
8224
8241
|
const row = bizUnitList.value[currentRowIndex.value];
|
|
8225
8242
|
tableRef.value.eleTable?.setCurrentRow(row);
|
|
8243
|
+
scrollToCurrentRow();
|
|
8226
8244
|
}
|
|
8227
8245
|
} else if ('ArrowUp' === e.key) {
|
|
8228
8246
|
e.preventDefault();
|
|
@@ -8230,6 +8248,7 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
8230
8248
|
currentRowIndex.value--;
|
|
8231
8249
|
const row = bizUnitList.value[currentRowIndex.value];
|
|
8232
8250
|
tableRef.value.eleTable?.setCurrentRow(row);
|
|
8251
|
+
scrollToCurrentRow();
|
|
8233
8252
|
}
|
|
8234
8253
|
} else if ('Enter' === e.key && currentRowIndex.value >= 0) {
|
|
8235
8254
|
const row = bizUnitList.value[currentRowIndex.value];
|
|
@@ -8295,16 +8314,44 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
8295
8314
|
const handleClickOutside = (e)=>{
|
|
8296
8315
|
const target = e.target;
|
|
8297
8316
|
const selectEl = selectRef.value?.$el;
|
|
8298
|
-
const popoverEl = popoverRef.value?.popperRef?.contentRef;
|
|
8299
|
-
if (
|
|
8317
|
+
const popoverEl = popoverRef.value?.popperRef?.contentRef; // 检查是否点击了当前组件的元素
|
|
8318
|
+
if (selectEl?.contains(target) || popoverEl?.contains(target)) return;
|
|
8319
|
+
// 检查是否点击了其他 el-select 或其下拉框
|
|
8320
|
+
let element = target;
|
|
8321
|
+
while(element){
|
|
8322
|
+
if (element.classList?.contains('el-select') || element.classList?.contains('el-select-dropdown') || element.classList?.contains('el-popper') || element.classList?.contains('el-picker-panel') || element.classList?.contains('el-date-picker') || element.classList?.contains('el-time-picker')) {
|
|
8323
|
+
popoverVisible.value = false;
|
|
8324
|
+
return;
|
|
8325
|
+
}
|
|
8326
|
+
element = element.parentElement;
|
|
8327
|
+
} // 点击了其他地方,关闭 popover
|
|
8328
|
+
popoverVisible.value = false;
|
|
8329
|
+
}; // 监听 el-select 的 focus 事件来关闭当前 popover
|
|
8330
|
+
const handleGlobalFocusin = (e)=>{
|
|
8331
|
+
if (!popoverVisible.value) return;
|
|
8332
|
+
const target = e.target;
|
|
8333
|
+
const selectEl = selectRef.value?.$el;
|
|
8334
|
+
const popoverEl = popoverRef.value?.popperRef?.contentRef; // 如果焦点移到了其他元素(如其他 el-select),则关闭当前 popover
|
|
8335
|
+
if (!selectEl?.contains(target) && !popoverEl?.contains(target)) {
|
|
8336
|
+
let element = target;
|
|
8337
|
+
while(element){
|
|
8338
|
+
if (element.classList?.contains('el-select') || element.classList?.contains('el-input')) {
|
|
8339
|
+
popoverVisible.value = false;
|
|
8340
|
+
return;
|
|
8341
|
+
}
|
|
8342
|
+
element = element.parentElement;
|
|
8343
|
+
}
|
|
8344
|
+
}
|
|
8300
8345
|
};
|
|
8301
8346
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.watch)(()=>popoverVisible.value, (val)=>{
|
|
8302
8347
|
if (val) {
|
|
8303
8348
|
document.addEventListener('keydown', handleKeydown, true);
|
|
8304
|
-
|
|
8349
|
+
document.addEventListener('click', handleClickOutside);
|
|
8350
|
+
document.addEventListener('focusin', handleGlobalFocusin, true);
|
|
8305
8351
|
} else {
|
|
8306
8352
|
document.removeEventListener('keydown', handleKeydown, true);
|
|
8307
|
-
|
|
8353
|
+
document.removeEventListener('click', handleClickOutside);
|
|
8354
|
+
document.removeEventListener('focusin', handleGlobalFocusin, true);
|
|
8308
8355
|
}
|
|
8309
8356
|
});
|
|
8310
8357
|
const handleTableRowSelect = (data)=>{
|
|
@@ -8343,7 +8390,8 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
8343
8390
|
};
|
|
8344
8391
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount)(()=>{
|
|
8345
8392
|
document.removeEventListener('keydown', handleKeydown, true);
|
|
8346
|
-
|
|
8393
|
+
document.removeEventListener('click', handleClickOutside);
|
|
8394
|
+
document.removeEventListener('focusin', handleGlobalFocusin, true);
|
|
8347
8395
|
window.removeEventListener(CLOSE_OTHER_POPOVERS_EVENT, handleCloseOtherPopovers);
|
|
8348
8396
|
});
|
|
8349
8397
|
const fetchData = async (data)=>{
|
|
@@ -8393,6 +8441,15 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
8393
8441
|
}
|
|
8394
8442
|
});
|
|
8395
8443
|
});
|
|
8444
|
+
const onClickOutside = ()=>{
|
|
8445
|
+
handleBlur();
|
|
8446
|
+
};
|
|
8447
|
+
const visibleChange = (val)=>{
|
|
8448
|
+
if (val) {
|
|
8449
|
+
loading.value = true;
|
|
8450
|
+
handleFocus();
|
|
8451
|
+
}
|
|
8452
|
+
};
|
|
8396
8453
|
__expose({
|
|
8397
8454
|
popoverRef,
|
|
8398
8455
|
tableRef,
|
|
@@ -8434,11 +8491,11 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
8434
8491
|
"collapse-tags-tooltip": "",
|
|
8435
8492
|
filterable: "",
|
|
8436
8493
|
remote: "",
|
|
8437
|
-
"remote-show-suffix": ""
|
|
8494
|
+
"remote-show-suffix": "",
|
|
8495
|
+
loading: loading.value
|
|
8438
8496
|
}, selectProps.value, {
|
|
8439
|
-
|
|
8497
|
+
onVisibleChange: visibleChange,
|
|
8440
8498
|
onClear: handleClear,
|
|
8441
|
-
onFocus: handleFocus,
|
|
8442
8499
|
onRemoveTag: handleTagRemove
|
|
8443
8500
|
}), null, 16, [
|
|
8444
8501
|
"modelValue",
|
|
@@ -8447,7 +8504,8 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
8447
8504
|
"placeholder",
|
|
8448
8505
|
"popper-class",
|
|
8449
8506
|
"remote-method",
|
|
8450
|
-
"teleported"
|
|
8507
|
+
"teleported",
|
|
8508
|
+
"loading"
|
|
8451
8509
|
])
|
|
8452
8510
|
]),
|
|
8453
8511
|
default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
|
|
@@ -8457,7 +8515,7 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
8457
8515
|
}),
|
|
8458
8516
|
class: "w-full overflow-hidden"
|
|
8459
8517
|
}, [
|
|
8460
|
-
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(pro_table), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
|
|
8518
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives)((0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(pro_table), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
|
|
8461
8519
|
ref_key: "tableRef",
|
|
8462
8520
|
ref: tableRef,
|
|
8463
8521
|
columns: (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(tableConfig),
|
|
@@ -8476,6 +8534,11 @@ const CLOSE_OTHER_POPOVERS_EVENT = 'biz-unit-select:close-others'; /*
|
|
|
8476
8534
|
"columns",
|
|
8477
8535
|
"data",
|
|
8478
8536
|
"loading"
|
|
8537
|
+
]), [
|
|
8538
|
+
[
|
|
8539
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ClickOutside),
|
|
8540
|
+
onClickOutside
|
|
8541
|
+
]
|
|
8479
8542
|
])
|
|
8480
8543
|
], 4)
|
|
8481
8544
|
]),
|
|
@@ -8827,6 +8890,15 @@ const biz_unit_select_exports_ = biz_unit_selectvue_type_script_lang_tsx_name_Bi
|
|
|
8827
8890
|
}
|
|
8828
8891
|
});
|
|
8829
8892
|
});
|
|
8893
|
+
const onClickOutside = ()=>{
|
|
8894
|
+
handleBlur();
|
|
8895
|
+
};
|
|
8896
|
+
const visibleChange = (val)=>{
|
|
8897
|
+
if (val) {
|
|
8898
|
+
loading.value = true;
|
|
8899
|
+
handleFocus();
|
|
8900
|
+
}
|
|
8901
|
+
};
|
|
8830
8902
|
__expose({
|
|
8831
8903
|
popoverRef,
|
|
8832
8904
|
tableRef,
|
|
@@ -8868,10 +8940,10 @@ const biz_unit_select_exports_ = biz_unit_selectvue_type_script_lang_tsx_name_Bi
|
|
|
8868
8940
|
"remote-method": (0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(handelRemoteMethod),
|
|
8869
8941
|
multiple: !!props.multiSelectFlag,
|
|
8870
8942
|
options: [],
|
|
8943
|
+
loading: loading.value,
|
|
8871
8944
|
"popper-class": popoverVisible.value ? 'hidden' : '',
|
|
8872
8945
|
onRemoveTag: handleTagRemove,
|
|
8873
|
-
|
|
8874
|
-
onBlur: handleBlur,
|
|
8946
|
+
onVisibleChange: visibleChange,
|
|
8875
8947
|
onClear: handleClear
|
|
8876
8948
|
}, selectProps.value), null, 16, [
|
|
8877
8949
|
"modelValue",
|
|
@@ -8880,6 +8952,7 @@ const biz_unit_select_exports_ = biz_unit_selectvue_type_script_lang_tsx_name_Bi
|
|
|
8880
8952
|
"teleported",
|
|
8881
8953
|
"remote-method",
|
|
8882
8954
|
"multiple",
|
|
8955
|
+
"loading",
|
|
8883
8956
|
"popper-class"
|
|
8884
8957
|
])
|
|
8885
8958
|
]),
|
|
@@ -8890,7 +8963,7 @@ const biz_unit_select_exports_ = biz_unit_selectvue_type_script_lang_tsx_name_Bi
|
|
|
8890
8963
|
}),
|
|
8891
8964
|
class: "w-full overflow-hidden"
|
|
8892
8965
|
}, [
|
|
8893
|
-
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(pro_table), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
|
|
8966
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives)((0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)((0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(pro_table), (0, __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps)({
|
|
8894
8967
|
style: {
|
|
8895
8968
|
height: "100%"
|
|
8896
8969
|
},
|
|
@@ -8908,6 +8981,11 @@ const biz_unit_select_exports_ = biz_unit_selectvue_type_script_lang_tsx_name_Bi
|
|
|
8908
8981
|
"loading",
|
|
8909
8982
|
"columns",
|
|
8910
8983
|
"data"
|
|
8984
|
+
]), [
|
|
8985
|
+
[
|
|
8986
|
+
(0, __WEBPACK_EXTERNAL_MODULE_vue__.unref)(__WEBPACK_EXTERNAL_MODULE_element_sun__.ClickOutside),
|
|
8987
|
+
onClickOutside
|
|
8988
|
+
]
|
|
8911
8989
|
])
|
|
8912
8990
|
], 4)
|
|
8913
8991
|
]),
|
|
@@ -12212,7 +12290,9 @@ const keyboard_value_exports_ = keyboard_valuevue_type_script_setup_true_lang_ts
|
|
|
12212
12290
|
const _component_el_dropdown_item = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-dropdown-item");
|
|
12213
12291
|
const _component_el_dropdown_menu = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-dropdown-menu");
|
|
12214
12292
|
const _component_el_dropdown = (0, __WEBPACK_EXTERNAL_MODULE_vue__.resolveComponent)("el-dropdown");
|
|
12215
|
-
return (0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(_component_el_dropdown,
|
|
12293
|
+
return (0, __WEBPACK_EXTERNAL_MODULE_vue__.openBlock)(), (0, __WEBPACK_EXTERNAL_MODULE_vue__.createBlock)(_component_el_dropdown, {
|
|
12294
|
+
trigger: disabledLoad.value ? 'click' : 'hover'
|
|
12295
|
+
}, (0, __WEBPACK_EXTERNAL_MODULE_vue__.createSlots)({
|
|
12216
12296
|
default: (0, __WEBPACK_EXTERNAL_MODULE_vue__.withCtx)(()=>[
|
|
12217
12297
|
(0, __WEBPACK_EXTERNAL_MODULE_vue__.createVNode)(_component_el_button, {
|
|
12218
12298
|
type: "primary",
|
|
@@ -12261,7 +12341,9 @@ const keyboard_value_exports_ = keyboard_valuevue_type_script_setup_true_lang_ts
|
|
|
12261
12341
|
]),
|
|
12262
12342
|
key: "0"
|
|
12263
12343
|
}
|
|
12264
|
-
]),
|
|
12344
|
+
]), 1032, [
|
|
12345
|
+
"trigger"
|
|
12346
|
+
]);
|
|
12265
12347
|
};
|
|
12266
12348
|
}
|
|
12267
12349
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sun-biz",
|
|
3
|
-
"version": "0.0.4-beta.
|
|
3
|
+
"version": "0.0.4-beta.47",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"src/*",
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
"js-pinyin": "^0.2.7",
|
|
82
82
|
"latest": "^0.2.0",
|
|
83
83
|
"lodash": "^4.17.21",
|
|
84
|
-
"sortablejs": "^1.15.6"
|
|
84
|
+
"sortablejs": "^1.15.6",
|
|
85
|
+
"uuid": "^13.0.0"
|
|
85
86
|
}
|
|
86
87
|
}
|