hy-dispatch-ui-v3 0.2.67 → 0.2.68
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/tailwind.css +232 -20
- package/es/api/device.mjs +2 -3
- package/es/api/exportExcel.mjs +57 -0
- package/es/api/index.mjs +27 -16
- package/es/api/mapRail.mjs +31 -0
- package/es/api/organization.mjs +17 -9
- package/es/api/rule.mjs +30 -0
- package/es/api/sypct.mjs +2 -3
- package/es/api/task.mjs +2 -3
- package/es/bussiness/hyAddDepartmentType/addDepartmentType.vue.mjs +18 -19
- package/es/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +28 -28
- package/es/bussiness/hyElectronicFence/cpns/addElectronicFenceDialog/addElectronicFenceDialog.vue.mjs +511 -0
- package/es/bussiness/hyElectronicFence/cpns/batchSetElectronicFenceUserDialog/batchSetElectronicFenceUserDialog.vue.mjs +169 -0
- package/es/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersDialog.vue.mjs +318 -0
- package/es/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersItem.vue.mjs +123 -0
- package/es/bussiness/hyElectronicFence/electronicFence.vue.mjs +358 -0
- package/es/bussiness/hyElectronicFence/index.mjs +13 -0
- package/es/bussiness/hyElectronicFence/style/electronicFence.scss +0 -0
- package/es/bussiness/hyMapAearchPlace/js/index.mjs +1 -1
- package/es/bussiness/hyMapAearchPlace/mapAearchPlace.vue.mjs +4 -6
- package/es/bussiness/hyMapAearchPlace/style/mapAearchPlace.scss +4 -3
- package/es/bussiness/hyRuleSetting/cpns/gatheringPeople/gatheringPeople.vue.mjs +270 -0
- package/es/bussiness/hyRuleSetting/cpns/missionInRule/missionInRule.vue.mjs +251 -0
- package/es/bussiness/hyRuleSetting/cpns/missionOutRule/missionOutRule.vue.mjs +251 -0
- package/es/bussiness/hyRuleSetting/cpns/ruleAssignDialog/ruleAssignDialog.vue.mjs +395 -0
- package/es/bussiness/hyRuleSetting/cpns/ruleFenceDialog/ruleFenceDialog.vue.mjs +651 -0
- package/es/bussiness/hyRuleSetting/cpns/ruleSettingDialog/ruleSettingDialog.vue.mjs +357 -0
- package/es/bussiness/hyRuleSetting/cpns/sedentary/sedentary.vue.mjs +261 -0
- package/es/bussiness/hyRuleSetting/cpns/setRuleAggregationAlarmDialog/setRuleAggregationAlarmDialog.vue.mjs +360 -0
- package/es/bussiness/hyRuleSetting/cpns/timedVideo/timedVideo.vue.mjs +240 -0
- package/es/bussiness/hyRuleSetting/cpns/timerCamera/timerCamera.vue.mjs +258 -0
- package/es/bussiness/hyRuleSetting/cpns/timingReturn/timingReturn.vue.mjs +240 -0
- package/es/bussiness/hyRuleSetting/index.mjs +15 -0
- package/es/bussiness/hyRuleSetting/js/ruleSetting.mjs +65 -0
- package/es/bussiness/hyRuleSetting/ruleSetting.vue.mjs +129 -0
- package/es/bussiness/hyRuleSetting/style/ruleSetting.scss +0 -0
- package/es/bussiness/index.mjs +2 -0
- package/es/components/hyAudioPlayer/audioPlayer.vue.mjs +5 -13
- package/es/components/hyAudioPlayer/js/index.mjs +9 -14
- package/es/components/hyAudioPlayer/style/audioPlayer.scss +7 -2
- package/es/components/hyButton/button.vue.mjs +2 -2
- package/es/components/hyButton/style/button.scss +48 -74
- package/es/components/hyCheckboxGroup/checkboxGroup.vue.mjs +119 -0
- package/es/components/hyCheckboxGroup/index.mjs +7 -0
- package/es/components/hyCheckboxGroup/style/checkboxGroup.scss +58 -0
- package/es/components/hyConfigProvider/configProvider.vue.mjs +51 -38
- package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +57 -62
- package/es/components/hyConfirmDialog/confirmMethod.mjs +24 -22
- package/es/components/hyCutter/cutter.vue.mjs +9 -23
- package/es/components/hyDatePicker/datePicker.vue.mjs +12 -17
- package/es/components/hyDialog/dialog.vue.mjs +5 -9
- package/es/components/hyDialog/style/dialog.scss +12 -13
- package/es/components/hyDrawer/drawer.vue.mjs +100 -0
- package/es/components/hyDrawer/index.mjs +7 -0
- package/es/components/hyDrawer/style/drawer.scss +0 -0
- package/es/components/hyForm/cpns/arrayItem.vue.mjs +10 -28
- package/es/components/hyForm/cpns/arrayItem2.vue.mjs +198 -0
- package/es/components/hyForm/cpns/extraItem.vue.mjs +2 -3
- package/es/components/hyForm/cpns/formItem.vue.mjs +65 -35
- package/es/components/hyForm/cpns/locationSelect.vue.mjs +26 -26
- package/es/components/hyForm/form.vue.mjs +56 -24
- package/es/components/hyForm/js/index.mjs +4 -8
- package/es/components/hyForm/js/useAppForm.mjs +4 -9
- package/es/components/hyForm/style/form.scss +4 -13
- package/es/components/hyIcon/icon.vue.mjs +3 -3
- package/es/components/hyIconBox/style/iconBox.scss +2 -6
- package/es/components/hyInput/inputSearch.vue.mjs +8 -11
- package/es/components/hyInput/style/inputSearch.scss +3 -0
- package/es/components/hyLoading/index.mjs +3 -5
- package/es/components/hyMap/js/index.mjs +29 -4
- package/es/components/hyMap/map.vue.mjs +17 -3
- package/es/components/hyMenu/style/menu.scss +5 -15
- package/es/components/hyNoPermissions/noPermissions.vue.mjs +3 -4
- package/es/components/hyNoPermissionsMap/noPermissionsMap.vue.mjs +3 -6
- package/es/components/hyOrgCascader/js/index.mjs +1 -5
- package/es/components/hyOrgCascader/orgCascader.vue.mjs +25 -11
- package/es/components/hyOrgCascader/style/orgCascader.scss +7 -0
- package/es/components/hyRadioGroup/radioGroup.vue.mjs +48 -41
- package/es/components/hyRadioGroup/style/radioGroup.scss +9 -0
- package/es/components/hySearch/cpns/searchItem.vue.mjs +33 -20
- package/es/components/hySearch/js/index.mjs +1 -4
- package/es/components/hySearch/js/useAppSearch.mjs +5 -10
- package/es/components/hySearch/search.vue.mjs +9 -16
- package/es/components/hySearch/style/search.scss +2 -0
- package/es/components/hyStatus/index.mjs +7 -0
- package/es/components/hyStatus/status.vue.mjs +110 -0
- package/es/components/hyStatus/style/status.scss +0 -0
- package/es/components/hyTable/cpns/columnSelect.vue.mjs +24 -28
- package/es/components/hyTable/cpns/columnSelectItem.vue.mjs +8 -9
- package/es/components/hyTable/cpns/headerItem.vue.mjs +2 -2
- package/es/components/hyTable/cpns/virtualTable.vue.mjs +18 -28
- package/es/components/hyTable/js/index.mjs +56 -59
- package/es/components/hyTable/js/useAppTable.mjs +3 -4
- package/es/components/hyTable/style/table.scss +8 -0
- package/es/components/hyTable/table.vue.mjs +35 -41
- package/es/components/hyTableActionButton/tableActionButton.vue.mjs +4 -4
- package/es/components/hyTableForm/batchTableForm.vue.mjs +3 -7
- package/es/components/hyTableForm/js/index.mjs +2 -8
- package/es/components/hyTableForm/js/useAppTableForm.mjs +2 -7
- package/es/components/hyTableForm/style/batchTableForm.scss +26 -54
- package/es/components/hyTableForm/style/tableForm.scss +3 -2
- package/es/components/hyTableForm/tableForm.vue.mjs +90 -46
- package/es/components/hyTimePicker/timePicker.vue.mjs +4 -5
- package/es/components/hyTree/js/index.mjs +13 -40
- package/es/components/hyTree/style/index.css +1 -1
- package/es/components/hyTree/tree.vue.mjs +17 -16
- package/es/components/hyUserAvatar/userAvatar.vue.mjs +3 -6
- package/es/components/hyVideoPlayer/js/index.mjs +14 -23
- package/es/components/hyVideoPlayer/style/videoPlayer.scss +5 -7
- package/es/components/hyVideoPlayer/videoPlayer.vue.mjs +16 -26
- package/es/components/index.mjs +3 -0
- package/es/hooks/index.mjs +6 -2
- package/es/hooks/useAudioPlayerConfig.mjs +1 -3
- package/es/hooks/useBaseMainStore.mjs +29 -0
- package/es/hooks/useCurrentBus.mjs +20 -0
- package/es/hooks/useDialog.mjs +327 -0
- package/es/hooks/useExportFile.mjs +133 -0
- package/es/hooks/useGlobalConfig.mjs +10 -6
- package/es/hooks/useLocale.mjs +22 -12
- package/es/hooks/usePermissionMap.mjs +1 -3
- package/es/hooks/useResizeHandler.mjs +1 -4
- package/es/hooks/useResizeObserver.mjs +3 -1
- package/es/hooks/useSubscribe.mjs +2 -2
- package/es/hooks/useUserAvatarMap.mjs +1 -3
- package/es/hooks/useVideoPlayerConfig.mjs +1 -3
- package/es/index.mjs +11 -2
- package/es/locale/{en.mjs → en_US.mjs} +79 -4
- package/es/locale/index.mjs +2 -2
- package/es/locale/zh_CN.mjs +79 -2
- package/es/style/tailwind.scss +7 -3
- package/es/utils/adaptive.mjs +1 -3
- package/es/utils/form.mjs +7 -10
- package/es/utils/handler.mjs +4 -8
- package/es/utils/input.mjs +8 -9
- package/es/utils/map/hook/bigMap.mjs +14 -53
- package/es/utils/map/hook/gaode.mjs +5 -20
- package/es/utils/map/hook/leafletjs.mjs +23 -79
- package/es/utils/map/index.mjs +2 -8
- package/es/utils/map/js/webgis.mjs +12 -12
- package/es/version.mjs +1 -1
- package/lib/api/device.js +2 -3
- package/lib/api/exportExcel.js +62 -0
- package/lib/api/index.js +27 -16
- package/lib/api/mapRail.js +34 -0
- package/lib/api/organization.js +17 -8
- package/lib/api/rule.js +33 -0
- package/lib/api/sypct.js +2 -3
- package/lib/api/task.js +2 -3
- package/lib/bussiness/hyAddDepartmentType/addDepartmentType.vue.js +17 -18
- package/lib/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +28 -28
- package/lib/bussiness/hyElectronicFence/cpns/addElectronicFenceDialog/addElectronicFenceDialog.vue.js +515 -0
- package/lib/bussiness/hyElectronicFence/cpns/batchSetElectronicFenceUserDialog/batchSetElectronicFenceUserDialog.vue.js +173 -0
- package/lib/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersDialog.vue.js +322 -0
- package/lib/bussiness/hyElectronicFence/cpns/electronicFenceAssociatedUsersDialog/electronicFenceAssociatedUsersItem.vue.js +127 -0
- package/lib/bussiness/hyElectronicFence/electronicFence.vue.js +362 -0
- package/lib/bussiness/hyElectronicFence/index.js +21 -0
- package/lib/bussiness/hyElectronicFence/style/electronicFence.scss +0 -0
- package/lib/bussiness/hyMapAearchPlace/js/index.js +1 -1
- package/lib/bussiness/hyMapAearchPlace/mapAearchPlace.vue.js +4 -6
- package/lib/bussiness/hyMapAearchPlace/style/mapAearchPlace.scss +4 -3
- package/lib/bussiness/hyRuleSetting/cpns/gatheringPeople/gatheringPeople.vue.js +274 -0
- package/lib/bussiness/hyRuleSetting/cpns/missionInRule/missionInRule.vue.js +255 -0
- package/lib/bussiness/hyRuleSetting/cpns/missionOutRule/missionOutRule.vue.js +255 -0
- package/lib/bussiness/hyRuleSetting/cpns/ruleAssignDialog/ruleAssignDialog.vue.js +399 -0
- package/lib/bussiness/hyRuleSetting/cpns/ruleFenceDialog/ruleFenceDialog.vue.js +655 -0
- package/lib/bussiness/hyRuleSetting/cpns/ruleSettingDialog/ruleSettingDialog.vue.js +361 -0
- package/lib/bussiness/hyRuleSetting/cpns/sedentary/sedentary.vue.js +265 -0
- package/lib/bussiness/hyRuleSetting/cpns/setRuleAggregationAlarmDialog/setRuleAggregationAlarmDialog.vue.js +364 -0
- package/lib/bussiness/hyRuleSetting/cpns/timedVideo/timedVideo.vue.js +244 -0
- package/lib/bussiness/hyRuleSetting/cpns/timerCamera/timerCamera.vue.js +262 -0
- package/lib/bussiness/hyRuleSetting/cpns/timingReturn/timingReturn.vue.js +244 -0
- package/lib/bussiness/hyRuleSetting/index.js +24 -0
- package/lib/bussiness/hyRuleSetting/js/ruleSetting.js +68 -0
- package/lib/bussiness/hyRuleSetting/ruleSetting.vue.js +133 -0
- package/lib/bussiness/hyRuleSetting/style/ruleSetting.scss +0 -0
- package/lib/bussiness/index.js +21 -10
- package/lib/components/hyAudioPlayer/audioPlayer.vue.js +5 -13
- package/lib/components/hyAudioPlayer/js/index.js +9 -14
- package/lib/components/hyAudioPlayer/style/audioPlayer.scss +7 -2
- package/lib/components/hyButton/button.vue.js +2 -2
- package/lib/components/hyButton/style/button.scss +48 -74
- package/lib/components/hyCheckboxGroup/checkboxGroup.vue.js +123 -0
- package/lib/components/hyCheckboxGroup/index.js +12 -0
- package/lib/components/hyCheckboxGroup/style/checkboxGroup.scss +58 -0
- package/lib/components/hyConfigProvider/configProvider.vue.js +50 -56
- package/lib/components/hyConfirmDialog/confirmDialog.vue.js +56 -61
- package/lib/components/hyConfirmDialog/confirmMethod.js +23 -21
- package/lib/components/hyCutter/cutter.vue.js +8 -22
- package/lib/components/hyDatePicker/datePicker.vue.js +11 -16
- package/lib/components/hyDialog/dialog.vue.js +5 -9
- package/lib/components/hyDialog/style/dialog.scss +12 -13
- package/lib/components/hyDrawer/drawer.vue.js +104 -0
- package/lib/components/hyDrawer/index.js +12 -0
- package/lib/components/hyDrawer/style/drawer.scss +0 -0
- package/lib/components/hyForm/cpns/arrayItem.vue.js +9 -27
- package/lib/components/hyForm/cpns/arrayItem2.vue.js +202 -0
- package/lib/components/hyForm/cpns/extraItem.vue.js +2 -3
- package/lib/components/hyForm/cpns/formItem.vue.js +66 -36
- package/lib/components/hyForm/cpns/locationSelect.vue.js +26 -26
- package/lib/components/hyForm/form.vue.js +51 -19
- package/lib/components/hyForm/js/index.js +3 -7
- package/lib/components/hyForm/js/useAppForm.js +4 -9
- package/lib/components/hyForm/style/form.scss +4 -13
- package/lib/components/hyIcon/icon.vue.js +3 -3
- package/lib/components/hyIconBox/style/iconBox.scss +2 -6
- package/lib/components/hyInput/inputSearch.vue.js +7 -10
- package/lib/components/hyInput/style/inputSearch.scss +3 -0
- package/lib/components/hyLoading/index.js +2 -4
- package/lib/components/hyMap/js/index.js +29 -4
- package/lib/components/hyMap/map.vue.js +17 -3
- package/lib/components/hyMenu/style/menu.scss +5 -15
- package/lib/components/hyNoPermissions/noPermissions.vue.js +3 -4
- package/lib/components/hyNoPermissionsMap/noPermissionsMap.vue.js +3 -6
- package/lib/components/hyOrgCascader/js/index.js +1 -5
- package/lib/components/hyOrgCascader/orgCascader.vue.js +23 -9
- package/lib/components/hyOrgCascader/style/orgCascader.scss +7 -0
- package/lib/components/hyRadioGroup/radioGroup.vue.js +47 -40
- package/lib/components/hyRadioGroup/style/radioGroup.scss +9 -0
- package/lib/components/hySearch/cpns/searchItem.vue.js +33 -20
- package/lib/components/hySearch/js/index.js +1 -4
- package/lib/components/hySearch/js/useAppSearch.js +5 -10
- package/lib/components/hySearch/search.vue.js +9 -16
- package/lib/components/hySearch/style/search.scss +2 -0
- package/lib/components/hyStatus/index.js +12 -0
- package/lib/components/hyStatus/status.vue.js +114 -0
- package/lib/components/hyStatus/style/status.scss +0 -0
- package/lib/components/hyTable/cpns/columnSelect.vue.js +22 -26
- package/lib/components/hyTable/cpns/columnSelectItem.vue.js +7 -8
- package/lib/components/hyTable/cpns/headerItem.vue.js +2 -2
- package/lib/components/hyTable/cpns/virtualTable.vue.js +17 -27
- package/lib/components/hyTable/js/index.js +54 -57
- package/lib/components/hyTable/js/useAppTable.js +2 -3
- package/lib/components/hyTable/style/table.scss +8 -0
- package/lib/components/hyTable/table.vue.js +35 -41
- package/lib/components/hyTableActionButton/tableActionButton.vue.js +4 -4
- package/lib/components/hyTableForm/batchTableForm.vue.js +3 -7
- package/lib/components/hyTableForm/js/index.js +2 -8
- package/lib/components/hyTableForm/js/useAppTableForm.js +2 -7
- package/lib/components/hyTableForm/style/batchTableForm.scss +26 -54
- package/lib/components/hyTableForm/style/tableForm.scss +3 -2
- package/lib/components/hyTableForm/tableForm.vue.js +89 -45
- package/lib/components/hyTimePicker/timePicker.vue.js +3 -4
- package/lib/components/hyTree/js/index.js +13 -40
- package/lib/components/hyTree/style/index.css +1 -1
- package/lib/components/hyTree/tree.vue.js +17 -16
- package/lib/components/hyUserAvatar/userAvatar.vue.js +3 -6
- package/lib/components/hyVideoPlayer/js/index.js +14 -23
- package/lib/components/hyVideoPlayer/style/videoPlayer.scss +5 -7
- package/lib/components/hyVideoPlayer/videoPlayer.vue.js +16 -26
- package/lib/components/index.js +46 -40
- package/lib/hooks/index.js +17 -0
- package/lib/hooks/useAudioPlayerConfig.js +1 -3
- package/lib/hooks/useBaseMainStore.js +32 -0
- package/lib/hooks/useCurrentBus.js +23 -0
- package/lib/hooks/useDialog.js +331 -0
- package/lib/hooks/useExportFile.js +135 -0
- package/lib/hooks/useGlobalConfig.js +10 -6
- package/lib/hooks/useLocale.js +25 -11
- package/lib/hooks/usePermissionMap.js +1 -3
- package/lib/hooks/useResizeHandler.js +1 -4
- package/lib/hooks/useResizeObserver.js +3 -1
- package/lib/hooks/useSubscribe.js +2 -1
- package/lib/hooks/useUserAvatarMap.js +1 -3
- package/lib/hooks/useVideoPlayerConfig.js +1 -3
- package/lib/index.js +107 -73
- package/lib/locale/{en.js → en_US.js} +79 -4
- package/lib/locale/index.js +3 -3
- package/lib/locale/zh_CN.js +79 -2
- package/lib/style/tailwind.scss +7 -3
- package/lib/utils/adaptive.js +1 -3
- package/lib/utils/form.js +6 -9
- package/lib/utils/handler.js +3 -7
- package/lib/utils/input.js +7 -8
- package/lib/utils/map/hook/bigMap.js +14 -53
- package/lib/utils/map/hook/gaode.js +5 -20
- package/lib/utils/map/hook/leafletjs.js +23 -79
- package/lib/utils/map/index.js +2 -8
- package/lib/utils/map/js/webgis.js +12 -12
- package/lib/version.js +1 -1
- package/package.json +3 -2
|
@@ -2,8 +2,8 @@ import { unref, ref, computed, watch, nextTick, watchEffect } from 'vue';
|
|
|
2
2
|
import '../../../hooks/index.mjs';
|
|
3
3
|
import '../../../utils/index.mjs';
|
|
4
4
|
import '../../index.mjs';
|
|
5
|
-
import { isPermission, isBoolean, isFunction, isNumber, isString, isArray } from '../../../utils/is.mjs';
|
|
6
|
-
import {
|
|
5
|
+
import { isPermission, isBoolean, isFunction, isNumber, isString, isArray, isSymbol } from '../../../utils/is.mjs';
|
|
6
|
+
import { $t } from '../../../hooks/useLocale.mjs';
|
|
7
7
|
import { ElLoading as HyLoading } from '../../hyLoading/index.mjs';
|
|
8
8
|
|
|
9
9
|
function tableColumnShowHandler(column) {
|
|
@@ -31,17 +31,14 @@ function tableColumnsEditableleHandler(columns, columnsEditablele) {
|
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
33
|
const sortList = Array.from(sortSet.values()).reduce((a, b) => a - b);
|
|
34
|
-
const columnsList = Object.keys(columnsEditableleObj).reduce(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
[]
|
|
44
|
-
);
|
|
34
|
+
const columnsList = Object.keys(columnsEditableleObj).reduce((columnsList2, key) => {
|
|
35
|
+
const list = columnsEditableleObj[key];
|
|
36
|
+
for (let i = 0; i < list.length; i++) {
|
|
37
|
+
const target = list[i];
|
|
38
|
+
columnsList2.push(target.column);
|
|
39
|
+
}
|
|
40
|
+
return columnsList2;
|
|
41
|
+
}, []);
|
|
45
42
|
return {
|
|
46
43
|
columnsList,
|
|
47
44
|
columnsEditablele
|
|
@@ -93,26 +90,21 @@ function operatorDisabledHandler(operator, scope) {
|
|
|
93
90
|
return false;
|
|
94
91
|
}
|
|
95
92
|
function operatorDisableTextdHandler(operator, scope) {
|
|
96
|
-
const { t } = useLocale();
|
|
97
93
|
const { disabledText } = operator;
|
|
98
94
|
if (isString(disabledText)) return disabledText;
|
|
99
95
|
if (isFunction(disabledText)) return disabledText(scope);
|
|
100
|
-
return t("table.nonsupport");
|
|
96
|
+
return $t("table.nonsupport");
|
|
101
97
|
}
|
|
102
98
|
function operatorFilterHandler(column, scope, type = "all") {
|
|
103
99
|
let { width } = column;
|
|
104
100
|
width = isString(width) ? Number(width.replace(/[a-zA-Z]+/g, "")) : width;
|
|
105
|
-
const operator = (column.operator || []).filter(
|
|
106
|
-
(item) => operatorShowHandler(item, scope)
|
|
107
|
-
);
|
|
101
|
+
const operator = (column.operator || []).filter((item) => operatorShowHandler(item, scope));
|
|
108
102
|
if (type === "all" || operator.length <= 1 && type === "default") {
|
|
109
103
|
return operator;
|
|
110
104
|
}
|
|
111
105
|
const btnWidth = 40;
|
|
112
106
|
const gapWidth = 12;
|
|
113
|
-
const operatorCount = Math.floor(
|
|
114
|
-
(width - 12 * 2 - btnWidth) / (btnWidth + gapWidth) + 1
|
|
115
|
-
);
|
|
107
|
+
const operatorCount = Math.floor((width - 12 * 2 - btnWidth) / (btnWidth + gapWidth) + 1);
|
|
116
108
|
if (operatorCount === operator.length) {
|
|
117
109
|
return type === "default" ? operator : [];
|
|
118
110
|
}
|
|
@@ -150,15 +142,7 @@ function renderContentHandler(column, scope) {
|
|
|
150
142
|
return row[column.prop];
|
|
151
143
|
}
|
|
152
144
|
const useAppTableWrapper = (hy) => {
|
|
153
|
-
const {
|
|
154
|
-
props,
|
|
155
|
-
emits,
|
|
156
|
-
containerRef,
|
|
157
|
-
tableRef,
|
|
158
|
-
tableDropdownRef,
|
|
159
|
-
operatorDropdownRef
|
|
160
|
-
} = hy;
|
|
161
|
-
const { t } = useLocale();
|
|
145
|
+
const { props, emits, containerRef, tableRef, tableDropdownRef, operatorDropdownRef } = hy;
|
|
162
146
|
const CACHE_COLUMNS_KEY = props.controller || props.url || "CACHE_COLUMNS_KEY";
|
|
163
147
|
const tableDataSource = ref([]);
|
|
164
148
|
const tableColumns = ref([]);
|
|
@@ -167,15 +151,12 @@ const useAppTableWrapper = (hy) => {
|
|
|
167
151
|
return tableColumns.value.filter((column) => tableColumnShowHandler(column));
|
|
168
152
|
});
|
|
169
153
|
const searchPlaceholder = computed(() => {
|
|
170
|
-
const searchLabelSet = tableColumnsList.value.reduce(
|
|
171
|
-
(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
},
|
|
177
|
-
/* @__PURE__ */ new Set()
|
|
178
|
-
);
|
|
154
|
+
const searchLabelSet = tableColumnsList.value.reduce((searchLabelSet2, column) => {
|
|
155
|
+
if (column.isSearch) {
|
|
156
|
+
searchLabelSet2.add(column.label);
|
|
157
|
+
}
|
|
158
|
+
return searchLabelSet2;
|
|
159
|
+
}, /* @__PURE__ */ new Set());
|
|
179
160
|
if (props.searchArr?.length > 0) {
|
|
180
161
|
props.searchArr.forEach((item) => {
|
|
181
162
|
searchLabelSet.add(item.label);
|
|
@@ -190,10 +171,7 @@ const useAppTableWrapper = (hy) => {
|
|
|
190
171
|
return row.id;
|
|
191
172
|
}
|
|
192
173
|
function onTableColumnsSelectHandler(value) {
|
|
193
|
-
const { columnsList, searchText } = tableColumnsEditableleHandler(
|
|
194
|
-
props.tableColumns,
|
|
195
|
-
value
|
|
196
|
-
);
|
|
174
|
+
const { columnsList, searchText } = tableColumnsEditableleHandler(props.tableColumns, value);
|
|
197
175
|
tableColumns.value = columnsList;
|
|
198
176
|
tableColumnsEditablele.value = value;
|
|
199
177
|
sessionStorage.setItem(CACHE_COLUMNS_KEY, JSON.stringify(value));
|
|
@@ -252,9 +230,7 @@ const useAppTableWrapper = (hy) => {
|
|
|
252
230
|
x: clientX,
|
|
253
231
|
y: clientY
|
|
254
232
|
});
|
|
255
|
-
const column = tableColumns.value.find(
|
|
256
|
-
(column2) => column2.type === "operator"
|
|
257
|
-
);
|
|
233
|
+
const column = tableColumns.value.find((column2) => column2.type === "operator");
|
|
258
234
|
const operator = operatorFilterHandler(column, { row });
|
|
259
235
|
if (!operator?.length) return;
|
|
260
236
|
tableTriggerRef.value.column = column;
|
|
@@ -278,15 +254,16 @@ const useAppTableWrapper = (hy) => {
|
|
|
278
254
|
if (props.type === "default") {
|
|
279
255
|
return tableColumnsList.value.some((column) => column.type === "expand");
|
|
280
256
|
} else if (props.type === "virtual") {
|
|
281
|
-
return tableColumnsList.value.some(
|
|
282
|
-
(column) => column.type === "expand" && column.expandType === "expand"
|
|
283
|
-
);
|
|
257
|
+
return tableColumnsList.value.some((column) => column.type === "expand" && column.expandType === "expand");
|
|
284
258
|
}
|
|
285
259
|
return false;
|
|
286
260
|
});
|
|
287
261
|
const isAccordionMode = computed(() => {
|
|
288
262
|
return isExpandTable.value && props.expandMode === "accordion";
|
|
289
263
|
});
|
|
264
|
+
function getRowExpansion() {
|
|
265
|
+
return expandRowKeys.value;
|
|
266
|
+
}
|
|
290
267
|
function setRowExpansion(list = []) {
|
|
291
268
|
const keys = (list || []).map((item) => {
|
|
292
269
|
return isString(item) || isNumber(item) ? item : getRowKey(item);
|
|
@@ -294,7 +271,7 @@ const useAppTableWrapper = (hy) => {
|
|
|
294
271
|
expandRowKeys.value = isAccordionMode.value ? [keys[0]] : keys;
|
|
295
272
|
}
|
|
296
273
|
function toggleRowExpansion(row, expanded) {
|
|
297
|
-
const key = isString(row) || isNumber(row) ? row : getRowKey(row);
|
|
274
|
+
const key = isString(row) || isNumber(row) || isSymbol(row) ? row : getRowKey(row);
|
|
298
275
|
const index = expandRowKeyMap.value.get(key);
|
|
299
276
|
const isExpanded = isBoolean(expanded) ? expanded : !isNumber(index);
|
|
300
277
|
if (isAccordionMode.value) {
|
|
@@ -310,7 +287,8 @@ const useAppTableWrapper = (hy) => {
|
|
|
310
287
|
expandRowKeys.value.splice(index, 1);
|
|
311
288
|
}
|
|
312
289
|
}
|
|
313
|
-
|
|
290
|
+
const data = tableDataSource.value.find((v) => getRowKey(v) === key);
|
|
291
|
+
emits("expand-change", data, isExpanded);
|
|
314
292
|
}
|
|
315
293
|
function onTableRowExpandChangeHandler(row, expandedRows) {
|
|
316
294
|
if (props.type === "virtual") {
|
|
@@ -393,9 +371,7 @@ const useAppTableWrapper = (hy) => {
|
|
|
393
371
|
selectedList.value = list || [];
|
|
394
372
|
clearSelection();
|
|
395
373
|
list.forEach((row) => {
|
|
396
|
-
const item = tableDataSource.value.find(
|
|
397
|
-
(v) => getRowKey(row) === getRowKey(v)
|
|
398
|
-
);
|
|
374
|
+
const item = tableDataSource.value.find((v) => getRowKey(row) === getRowKey(v));
|
|
399
375
|
if (item) {
|
|
400
376
|
tableRef.value.toggleRowSelection(item, true);
|
|
401
377
|
} else {
|
|
@@ -414,11 +390,28 @@ const useAppTableWrapper = (hy) => {
|
|
|
414
390
|
}
|
|
415
391
|
return className.filter(Boolean).join(" ");
|
|
416
392
|
}
|
|
393
|
+
function scrollToTop(top) {
|
|
394
|
+
if (!isNumber(top) || isNaN(top)) return;
|
|
395
|
+
if (props.type === "virtual") {
|
|
396
|
+
tableRef.value.scrollToTop(top);
|
|
397
|
+
} else {
|
|
398
|
+
tableRef.value.setScrollTop(top);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function scrollToLeft(left) {
|
|
402
|
+
if (!isNumber(left) || isNaN(left)) return;
|
|
403
|
+
if (props.type === "virtual") {
|
|
404
|
+
tableRef.value.scrollToLeft(left);
|
|
405
|
+
} else {
|
|
406
|
+
tableRef.value.setScrollLeft(left);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
function onScrollHandler(params) {
|
|
410
|
+
emits("scroll", params);
|
|
411
|
+
}
|
|
412
|
+
window.scrollToTop = scrollToTop;
|
|
417
413
|
watchEffect(() => {
|
|
418
|
-
const { columnsList, columnsEditablele, searchText } = tableColumnHandler(
|
|
419
|
-
props.tableColumns,
|
|
420
|
-
CACHE_COLUMNS_KEY
|
|
421
|
-
);
|
|
414
|
+
const { columnsList, columnsEditablele, searchText } = tableColumnHandler(props.tableColumns, CACHE_COLUMNS_KEY);
|
|
422
415
|
tableColumns.value = columnsList;
|
|
423
416
|
tableColumnsEditablele.value = columnsEditablele;
|
|
424
417
|
});
|
|
@@ -440,6 +433,7 @@ const useAppTableWrapper = (hy) => {
|
|
|
440
433
|
clearSelectedList,
|
|
441
434
|
expandRowKeys,
|
|
442
435
|
expandRowKeyMap,
|
|
436
|
+
getRowExpansion,
|
|
443
437
|
setRowExpansion,
|
|
444
438
|
toggleRowExpansion,
|
|
445
439
|
onTableRowExpandChangeHandler,
|
|
@@ -448,7 +442,10 @@ const useAppTableWrapper = (hy) => {
|
|
|
448
442
|
onTableRowClickHandler,
|
|
449
443
|
onTableColumnsSelectHandler,
|
|
450
444
|
showAppTableLoading,
|
|
451
|
-
closeAppTableLoading
|
|
445
|
+
closeAppTableLoading,
|
|
446
|
+
scrollToTop,
|
|
447
|
+
scrollToLeft,
|
|
448
|
+
onScrollHandler
|
|
452
449
|
};
|
|
453
450
|
};
|
|
454
451
|
|
|
@@ -2,12 +2,11 @@ import { toRef } from 'vue';
|
|
|
2
2
|
import '../../../hooks/index.mjs';
|
|
3
3
|
import '../../../utils/index.mjs';
|
|
4
4
|
import '../../index.mjs';
|
|
5
|
-
import {
|
|
5
|
+
import { $t } from '../../../hooks/useLocale.mjs';
|
|
6
6
|
import { isPermission, isBoolean, isString, isObject, isEmpty } from '../../../utils/is.mjs';
|
|
7
7
|
import { useAppSearch } from '../../hySearch/js/useAppSearch.mjs';
|
|
8
8
|
|
|
9
9
|
function getColumnDefaultConfig(column) {
|
|
10
|
-
const { t } = useLocale();
|
|
11
10
|
switch (column.type) {
|
|
12
11
|
case "selection":
|
|
13
12
|
return {
|
|
@@ -17,7 +16,7 @@ function getColumnDefaultConfig(column) {
|
|
|
17
16
|
case "index":
|
|
18
17
|
return {
|
|
19
18
|
prop: `${column.type}_prop`,
|
|
20
|
-
label: t("table.index")
|
|
19
|
+
label: $t("table.index")
|
|
21
20
|
};
|
|
22
21
|
case "expand":
|
|
23
22
|
return {
|
|
@@ -25,7 +24,7 @@ function getColumnDefaultConfig(column) {
|
|
|
25
24
|
};
|
|
26
25
|
case "operator":
|
|
27
26
|
return {
|
|
28
|
-
label: t("table.
|
|
27
|
+
label: $t("table.operation"),
|
|
29
28
|
prop: `operator_prop`,
|
|
30
29
|
fixed: "right"
|
|
31
30
|
};
|
|
@@ -9,9 +9,9 @@ import { useAppTableSearch } from './js/search.mjs';
|
|
|
9
9
|
import _sfc_main$2 from './cpns/headerItem.vue.mjs';
|
|
10
10
|
import _sfc_main$1 from './cpns/columnSelect.vue.mjs';
|
|
11
11
|
import _sfc_main$3 from './cpns/virtualTable.vue.mjs';
|
|
12
|
-
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
13
12
|
import { useMixins } from '../../hooks/useMixins.mjs';
|
|
14
13
|
import { HyIcon } from '../hyIcon/index.mjs';
|
|
14
|
+
import { $t } from '../../hooks/useLocale.mjs';
|
|
15
15
|
import { HyTooltip } from '../hyTooltip/index.mjs';
|
|
16
16
|
import { HyInputSearch } from '../hyInput/index.mjs';
|
|
17
17
|
import { HyButton } from '../hyButton/index.mjs';
|
|
@@ -199,13 +199,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
199
199
|
"expand-change",
|
|
200
200
|
"on-select-checkbox",
|
|
201
201
|
"reqSuccess",
|
|
202
|
-
"search-data"
|
|
202
|
+
"search-data",
|
|
203
|
+
"scroll"
|
|
203
204
|
], ["update:loading"]),
|
|
204
205
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
205
206
|
const props = __props;
|
|
206
207
|
const emits = __emit;
|
|
207
208
|
const loading = useModel(__props, "loading");
|
|
208
|
-
const { t } = useLocale();
|
|
209
209
|
const containerRef = useTemplateRef("containerRef");
|
|
210
210
|
const tableRef = useTemplateRef("tableRef");
|
|
211
211
|
const appSearchRef = useTemplateRef("appSearchRef");
|
|
@@ -229,12 +229,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
229
229
|
clearSelectedList,
|
|
230
230
|
expandRowKeys,
|
|
231
231
|
expandRowKeyMap,
|
|
232
|
+
getRowExpansion,
|
|
232
233
|
setRowExpansion,
|
|
233
234
|
toggleRowExpansion,
|
|
234
235
|
onTableRowClickHandler,
|
|
235
236
|
onTableRowContextmenuHandler,
|
|
236
237
|
onTableRowExpandChangeHandler,
|
|
237
238
|
onTableSelectHandler,
|
|
239
|
+
scrollToTop,
|
|
240
|
+
scrollToLeft,
|
|
241
|
+
onScrollHandler,
|
|
238
242
|
// useAppTableSearch
|
|
239
243
|
// 表单查询
|
|
240
244
|
totalElements,
|
|
@@ -282,6 +286,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
282
286
|
getTableDataSource,
|
|
283
287
|
clearSelection,
|
|
284
288
|
clearSelectedList,
|
|
289
|
+
getRowExpansion,
|
|
285
290
|
setRowExpansion,
|
|
286
291
|
toggleRowExpansion,
|
|
287
292
|
showAppTableLoading,
|
|
@@ -289,7 +294,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
289
294
|
getOptions,
|
|
290
295
|
getOptionsFields,
|
|
291
296
|
getOptionsError,
|
|
292
|
-
getOptionsByField
|
|
297
|
+
getOptionsByField,
|
|
298
|
+
scrollToTop,
|
|
299
|
+
scrollToLeft
|
|
293
300
|
});
|
|
294
301
|
return (_ctx, _cache) => {
|
|
295
302
|
return openBlock(), createElementBlock(
|
|
@@ -315,7 +322,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
315
322
|
}, null, 8, ["columns", "columns-editable", "origin-columns", "onConfirm"])) : createCommentVNode("v-if", true),
|
|
316
323
|
__props.filterColumns.length > 0 ? (openBlock(), createElementBlock("div", {
|
|
317
324
|
key: 1,
|
|
318
|
-
class: "h-[32px] flex items-center gap-[10px] clickBox px-3 select-none rounded hover:bg-background-2",
|
|
325
|
+
class: "h-[32px] flex items-center gap-[10px] clickBox px-3 select-none rounded hover:bg-background-2 box-border",
|
|
319
326
|
onClick: unref(switchShowFilter)
|
|
320
327
|
}, [
|
|
321
328
|
createVNode(unref(HyIcon), {
|
|
@@ -325,7 +332,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
325
332
|
createElementVNode(
|
|
326
333
|
"span",
|
|
327
334
|
null,
|
|
328
|
-
toDisplayString(unref(showFilter) ? unref(t)("table.hideFilter") : unref(t)("table.displayFilter")),
|
|
335
|
+
toDisplayString(unref(showFilter) ? unref($t)("table.hideFilter") : unref($t)("table.displayFilter")),
|
|
329
336
|
1
|
|
330
337
|
/* TEXT */
|
|
331
338
|
)
|
|
@@ -338,14 +345,14 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
338
345
|
}, {
|
|
339
346
|
content: withCtx(() => [
|
|
340
347
|
createElementVNode("span", {
|
|
341
|
-
innerHTML: unref(t)("table.searchByInput", [unref(searchPlaceholder)])
|
|
348
|
+
innerHTML: unref($t)("table.searchByInput", [unref(searchPlaceholder)])
|
|
342
349
|
}, null, 8, ["innerHTML"])
|
|
343
350
|
]),
|
|
344
351
|
default: withCtx(() => [
|
|
345
352
|
createVNode(unref(HyInputSearch), {
|
|
346
353
|
modelValue: __props.filterModel.query,
|
|
347
354
|
"onUpdate:modelValue": ($event) => __props.filterModel.query = $event,
|
|
348
|
-
placeholder: unref(t)("table.searchFor", [__props.controllerText || ""]),
|
|
355
|
+
placeholder: unref($t)("table.searchFor", [__props.controllerText || ""]),
|
|
349
356
|
onSearch: unref(onSearchQueryHandler)
|
|
350
357
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder", "onSearch"])
|
|
351
358
|
]),
|
|
@@ -421,14 +428,15 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
421
428
|
onSelectAll: (list) => unref(onTableSelectHandler)(list, null, true),
|
|
422
429
|
onRowClick: unref(onTableRowClickHandler),
|
|
423
430
|
onRowContextmenu: unref(onTableRowContextmenuHandler),
|
|
424
|
-
onExpandChange: unref(onTableRowExpandChangeHandler)
|
|
431
|
+
onExpandChange: unref(onTableRowExpandChangeHandler),
|
|
432
|
+
onScroll: unref(onScrollHandler)
|
|
425
433
|
}), {
|
|
426
434
|
empty: withCtx(() => [
|
|
427
435
|
renderSlot(_ctx.$slots, "empty", {}, () => [
|
|
428
436
|
createElementVNode(
|
|
429
437
|
"span",
|
|
430
438
|
null,
|
|
431
|
-
toDisplayString(__props.emptyText || unref(t)("hy.noData")),
|
|
439
|
+
toDisplayString(__props.emptyText || unref($t)("hy.noData")),
|
|
432
440
|
1
|
|
433
441
|
/* TEXT */
|
|
434
442
|
)
|
|
@@ -481,11 +489,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
481
489
|
(openBlock(true), createElementBlock(
|
|
482
490
|
Fragment,
|
|
483
491
|
null,
|
|
484
|
-
renderList(unref(operatorFilterHandler)(
|
|
485
|
-
column,
|
|
486
|
-
scope,
|
|
487
|
-
"default"
|
|
488
|
-
), (citem, cindex) => {
|
|
492
|
+
renderList(unref(operatorFilterHandler)(column, scope, "default"), (citem, cindex) => {
|
|
489
493
|
return openBlock(), createBlock(unref(HyTooltip), {
|
|
490
494
|
key: cindex,
|
|
491
495
|
"is-always": "",
|
|
@@ -551,11 +555,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
551
555
|
(openBlock(true), createElementBlock(
|
|
552
556
|
Fragment,
|
|
553
557
|
null,
|
|
554
|
-
renderList(unref(operatorFilterHandler)(
|
|
555
|
-
column,
|
|
556
|
-
scope,
|
|
557
|
-
"more"
|
|
558
|
-
), (citem, cindex) => {
|
|
558
|
+
renderList(unref(operatorFilterHandler)(column, scope, "more"), (citem, cindex) => {
|
|
559
559
|
return openBlock(), createBlock(unref(ElDropdownItem), {
|
|
560
560
|
key: cindex,
|
|
561
561
|
command: cindex,
|
|
@@ -611,7 +611,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
611
611
|
createVNode(unref(HyTooltip), {
|
|
612
612
|
"is-always": "",
|
|
613
613
|
overLine: 1,
|
|
614
|
-
content: unref(t)("table.moreOperations")
|
|
614
|
+
content: unref($t)("table.moreOperations")
|
|
615
615
|
}, {
|
|
616
616
|
default: withCtx(() => [
|
|
617
617
|
createElementVNode("div", { class: "w-[40px] h-[48px] inline-flex flex-col items-center justify-center text-main text-xs hover:font-bold border border-transparent hover:border-theme hover:shadow-[0px_0px_5px_0px_rgba(var(--hy-theme),0.5)] rounded box-border cursor-pointer" }, [
|
|
@@ -628,7 +628,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
628
628
|
createElementVNode(
|
|
629
629
|
"div",
|
|
630
630
|
{ class: "mt-0.5" },
|
|
631
|
-
toDisplayString(unref(t)("table.more")),
|
|
631
|
+
toDisplayString(unref($t)("table.more")),
|
|
632
632
|
1
|
|
633
633
|
/* TEXT */
|
|
634
634
|
)
|
|
@@ -692,7 +692,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
692
692
|
]),
|
|
693
693
|
_: 3
|
|
694
694
|
/* FORWARDED */
|
|
695
|
-
}, 16, ["row-key", "data", "show-header", "row-class-name", "class", "style", "expand-row-keys", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu", "onExpandChange"])) : createCommentVNode("v-if", true),
|
|
695
|
+
}, 16, ["row-key", "data", "show-header", "row-class-name", "class", "style", "expand-row-keys", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu", "onExpandChange", "onScroll"])) : createCommentVNode("v-if", true),
|
|
696
696
|
__props.type === "virtual" ? (openBlock(), createBlock(unref(ElAutoResizer), { key: 1 }, {
|
|
697
697
|
default: withCtx(({ height, width }) => [
|
|
698
698
|
createVNode(_sfc_main$3, mergeProps({
|
|
@@ -721,7 +721,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
721
721
|
onSelectAll: unref(onTableSelectHandler),
|
|
722
722
|
onRowClick: unref(onTableRowClickHandler),
|
|
723
723
|
onRowContextmenu: unref(onTableRowContextmenuHandler),
|
|
724
|
-
onExpandClick: unref(onTableRowExpandChangeHandler)
|
|
724
|
+
onExpandClick: unref(onTableRowExpandChangeHandler),
|
|
725
|
+
onScroll: unref(onScrollHandler)
|
|
725
726
|
}), createSlots({
|
|
726
727
|
empty: withCtx(() => [
|
|
727
728
|
createElementVNode("div", { class: "w-full h-full flex items-center justify-center border-b border-border" }, [
|
|
@@ -729,7 +730,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
729
730
|
createElementVNode(
|
|
730
731
|
"span",
|
|
731
732
|
null,
|
|
732
|
-
toDisplayString(__props.emptyText || unref(t)("hy.noData")),
|
|
733
|
+
toDisplayString(__props.emptyText || unref($t)("hy.noData")),
|
|
733
734
|
1
|
|
734
735
|
/* TEXT */
|
|
735
736
|
)
|
|
@@ -747,7 +748,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
747
748
|
])
|
|
748
749
|
};
|
|
749
750
|
})
|
|
750
|
-
]), 1040, ["expandedRowKeys", "onUpdate:expandedRowKeys", "expandRowKeyMap", "width", "height", "data", "columns", "columns-editable", "show-header", "row-class-name", "show-all-select", "style", "row-key", "filter-model", "expandMode", "onSearch", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu", "onExpandClick"])
|
|
751
|
+
]), 1040, ["expandedRowKeys", "onUpdate:expandedRowKeys", "expandRowKeyMap", "width", "height", "data", "columns", "columns-editable", "show-header", "row-class-name", "show-all-select", "style", "row-key", "filter-model", "expandMode", "onSearch", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu", "onExpandClick", "onScroll"])
|
|
751
752
|
]),
|
|
752
753
|
_: 3
|
|
753
754
|
/* FORWARDED */
|
|
@@ -761,11 +762,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
761
762
|
createElementVNode(
|
|
762
763
|
"div",
|
|
763
764
|
{ class: "absolute left-4 top-1/2 transform -translate-y-1/2 text-sm" },
|
|
764
|
-
toDisplayString(unref(t)("table.aTotalOfPiecesOfData", [unref(totalElements)])),
|
|
765
|
+
toDisplayString(unref($t)("table.aTotalOfPiecesOfData", [unref(totalElements)])),
|
|
765
766
|
1
|
|
766
767
|
/* TEXT */
|
|
767
768
|
),
|
|
768
|
-
|
|
769
|
+
unref(totalElements) >= 10 ? (openBlock(), createBlock(unref(ElPagination), {
|
|
770
|
+
key: 0,
|
|
769
771
|
"current-page": __props.filterModel.page,
|
|
770
772
|
"onUpdate:currentPage": ($event) => __props.filterModel.page = $event,
|
|
771
773
|
"page-size": __props.filterModel.size,
|
|
@@ -776,12 +778,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
776
778
|
layout: __props.layout,
|
|
777
779
|
size: "default",
|
|
778
780
|
background: "",
|
|
779
|
-
"hide-on-single-page": "",
|
|
780
781
|
onSizeChange: unref(onSizeChangeHandler),
|
|
781
782
|
onCurrentChange: unref(onCurrentChangeHandler)
|
|
782
|
-
}, null, 8, ["current-page", "onUpdate:currentPage", "page-size", "onUpdate:pageSize", "total", "pager-count", "layout", "onSizeChange", "onCurrentChange"]),
|
|
783
|
+
}, null, 8, ["current-page", "onUpdate:currentPage", "page-size", "onUpdate:pageSize", "total", "pager-count", "layout", "onSizeChange", "onCurrentChange"])) : createCommentVNode("v-if", true),
|
|
783
784
|
unref(selectedList) && unref(selectedList).length > 0 ? (openBlock(), createElementBlock("div", {
|
|
784
|
-
key:
|
|
785
|
+
key: 1,
|
|
785
786
|
class: "absolute right-4 top-1/2 transform -translate-y-1/2"
|
|
786
787
|
}, [
|
|
787
788
|
renderSlot(_ctx.$slots, "multiple-operator-slot")
|
|
@@ -800,12 +801,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
800
801
|
},
|
|
801
802
|
"virtual-triggering": "",
|
|
802
803
|
trigger: "contextmenu",
|
|
803
|
-
placement: "bottom",
|
|
804
|
-
onCommand: ($event) => unref(operatorClickHandler)(
|
|
805
|
-
$event,
|
|
806
|
-
unref(tableTriggerRef).column,
|
|
807
|
-
unref(tableTriggerRef).scope
|
|
808
|
-
)
|
|
804
|
+
placement: "bottom-end",
|
|
805
|
+
onCommand: ($event) => unref(operatorClickHandler)($event, unref(tableTriggerRef).column, unref(tableTriggerRef).scope)
|
|
809
806
|
}, {
|
|
810
807
|
dropdown: withCtx(() => [
|
|
811
808
|
createVNode(unref(ElDropdownMenu), { class: "hy-table-dropdown-menu" }, {
|
|
@@ -813,10 +810,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
813
810
|
(openBlock(true), createElementBlock(
|
|
814
811
|
Fragment,
|
|
815
812
|
null,
|
|
816
|
-
renderList(unref(operatorFilterHandler)(
|
|
817
|
-
unref(tableTriggerRef).column,
|
|
818
|
-
unref(tableTriggerRef).scope
|
|
819
|
-
), (citem, cindex) => {
|
|
813
|
+
renderList(unref(operatorFilterHandler)(unref(tableTriggerRef).column, unref(tableTriggerRef).scope), (citem, cindex) => {
|
|
820
814
|
return openBlock(), createBlock(unref(ElDropdownItem), {
|
|
821
815
|
key: cindex,
|
|
822
816
|
command: cindex,
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { defineComponent, ref, computed, unref, watch, openBlock, createElementBlock, createBlock, withCtx, createVNode, normalizeClass, createTextVNode, toDisplayString, createElementVNode, Fragment, renderList, createCommentVNode, normalizeStyle } from 'vue';
|
|
2
2
|
import { ElPopover, ElIcon } from 'element-plus';
|
|
3
3
|
import { ArrowDown } from '@element-plus/icons-vue';
|
|
4
|
-
import '../../hooks/index.mjs';
|
|
5
4
|
import '../../utils/index.mjs';
|
|
6
5
|
import '../index.mjs';
|
|
7
|
-
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
8
6
|
import { isPermission, isBoolean, isFunction } from '../../utils/is.mjs';
|
|
9
7
|
import { HyTooltip } from '../hyTooltip/index.mjs';
|
|
10
8
|
import { HyButton } from '../hyButton/index.mjs';
|
|
@@ -70,7 +68,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
70
68
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
71
69
|
const props = __props;
|
|
72
70
|
const emits = __emit;
|
|
73
|
-
const { t } = useLocale();
|
|
74
71
|
const visible = ref(false);
|
|
75
72
|
const dataList = ref([]);
|
|
76
73
|
const selectedData = ref(null);
|
|
@@ -185,7 +182,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
185
182
|
}, {
|
|
186
183
|
content: withCtx(() => [
|
|
187
184
|
createElementVNode("div", { class: "h-full flex items-center justify-center pl-[14px]" }, [
|
|
188
|
-
createVNode(unref(HyIcon), {
|
|
185
|
+
createVNode(unref(HyIcon), {
|
|
186
|
+
"svg-name": __props.svgName,
|
|
187
|
+
class: "w-[14px] h-[14px]"
|
|
188
|
+
}, null, 8, ["svg-name"]),
|
|
189
189
|
createElementVNode(
|
|
190
190
|
"span",
|
|
191
191
|
{ class: "ml-[6px]" },
|
|
@@ -7,7 +7,6 @@ import '../index.mjs';
|
|
|
7
7
|
import _sfc_main$1 from './tableForm.vue.mjs';
|
|
8
8
|
import { doReadExcel } from './js/index.mjs';
|
|
9
9
|
import { useApi } from '../../hooks/useApi.mjs';
|
|
10
|
-
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
11
10
|
import { HyConfirmDialog } from '../hyConfirmDialog/index.mjs';
|
|
12
11
|
import { isArray } from '../../utils/is.mjs';
|
|
13
12
|
import { HyIcon } from '../hyIcon/index.mjs';
|
|
@@ -96,7 +95,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
96
95
|
const props = __props;
|
|
97
96
|
const emits = __emit;
|
|
98
97
|
const { api } = useApi();
|
|
99
|
-
const { t } = useLocale();
|
|
100
98
|
const containerRef = useTemplateRef("containerRef");
|
|
101
99
|
const uploadRef = useTemplateRef("uploadRef");
|
|
102
100
|
const tableRef = useTemplateRef("tableRef");
|
|
@@ -297,9 +295,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
297
295
|
emits("submit", submitResult);
|
|
298
296
|
onResetUpload();
|
|
299
297
|
} else {
|
|
300
|
-
ElMessage.warning(
|
|
301
|
-
`${submitResult.success} \u6761\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF0C ${submitResult.failed} \u6761\u6570\u636E\u5F02\u5E38\uFF0C\u8BF7\u8C03\u6574`
|
|
302
|
-
);
|
|
298
|
+
ElMessage.warning(`${submitResult.success} \u6761\u6570\u636E\u5BFC\u5165\u6210\u529F\uFF0C ${submitResult.failed} \u6761\u6570\u636E\u5F02\u5E38\uFF0C\u8BF7\u8C03\u6574`);
|
|
303
299
|
emits("submit", submitResult);
|
|
304
300
|
}
|
|
305
301
|
}
|
|
@@ -403,8 +399,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
403
399
|
createElementVNode("div", { class: "w-full text-main absolute left-1/2 bottom-4 transform -translate-x-1/2" }, [
|
|
404
400
|
createElementVNode("div", { class: "flex items-center justify-center text-xs text-auxiliary gap-2" }, [
|
|
405
401
|
createElementVNode("span", null, "\u6587\u4EF6\u652F\u6301\uFF1A"),
|
|
406
|
-
createElementVNode("div", { class: "border border-border rounded py-1 px-2.5 bg-background-4" }, "
|
|
407
|
-
createElementVNode("div", { class: "border border-border rounded py-1 px-2.5 bg-background-4" }, "
|
|
402
|
+
createElementVNode("div", { class: "border border-border rounded py-1 px-2.5 bg-background-4 box-border" }, ".xls"),
|
|
403
|
+
createElementVNode("div", { class: "border border-border rounded py-1 px-2.5 bg-background-4 box-border" }, ".xlsx"),
|
|
408
404
|
createElementVNode("span", null, "\u5355\u6587\u4EF6\u4E0D\u8D85\u8FC7 10 MB")
|
|
409
405
|
])
|
|
410
406
|
])
|
|
@@ -22,10 +22,7 @@ const doValidate = async (target = {}, columns = [], ruleList = {}) => {
|
|
|
22
22
|
}, {});
|
|
23
23
|
Object.entries(ruleList || {}).forEach(([key, citem]) => {
|
|
24
24
|
if (columnMap[key]) {
|
|
25
|
-
rules[key] = [
|
|
26
|
-
...isArray(citem) ? citem : [citem],
|
|
27
|
-
...rules[key]
|
|
28
|
-
].filter(Boolean);
|
|
25
|
+
rules[key] = [...isArray(citem) ? citem : [citem], ...rules[key]].filter(Boolean);
|
|
29
26
|
}
|
|
30
27
|
});
|
|
31
28
|
const validator = new AsyncValidator(rules);
|
|
@@ -53,10 +50,7 @@ const doReadExcel = (files, props) => {
|
|
|
53
50
|
const ws1 = XLSX.utils.sheet_to_json(workbook.Sheets[wsname1]);
|
|
54
51
|
let content = formColumns.reduce((content2, column) => {
|
|
55
52
|
const title = column.import ? column.import.title : column.label;
|
|
56
|
-
return content2.replace(
|
|
57
|
-
new RegExp(`"${title}":`, "g"),
|
|
58
|
-
`"${column.prop}":`
|
|
59
|
-
);
|
|
53
|
+
return content2.replace(new RegExp(`"${title}":`, "g"), `"${column.prop}":`);
|
|
60
54
|
}, JSON.stringify(ws1));
|
|
61
55
|
let dataSource = JSON.parse(content);
|
|
62
56
|
if (beforeDataHandle) {
|
|
@@ -13,9 +13,7 @@ const useAppTableForm = (config = {}) => {
|
|
|
13
13
|
expandType: "expand",
|
|
14
14
|
width: 48
|
|
15
15
|
},
|
|
16
|
-
...columns.filter(
|
|
17
|
-
(column) => !["expand", "operator"].includes(column.type)
|
|
18
|
-
),
|
|
16
|
+
...columns.filter((column) => !["expand", "operator"].includes(column.type)),
|
|
19
17
|
{
|
|
20
18
|
label: "\u5BFC\u5165\u72B6\u6001",
|
|
21
19
|
prop: "validateStatus",
|
|
@@ -23,10 +21,7 @@ const useAppTableForm = (config = {}) => {
|
|
|
23
21
|
}
|
|
24
22
|
];
|
|
25
23
|
const { tableColumns } = useAppTable({ columns });
|
|
26
|
-
const { formModel, formColumns } = useAppForm(
|
|
27
|
-
config.formColumns,
|
|
28
|
-
config.formModel
|
|
29
|
-
);
|
|
24
|
+
const { formModel, formColumns } = useAppForm(config.formColumns, config.formModel);
|
|
30
25
|
formColumns.value.forEach((item) => {
|
|
31
26
|
if (isString(item.import)) {
|
|
32
27
|
item.import = {
|