hy-dispatch-ui-v3 0.2.77 → 0.2.78
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 +91 -8
- package/es/api/common.mjs +28 -0
- package/es/bussiness/hyDepartmentTypeOperation/departmentTypeOperation2.vue.mjs +5 -8
- package/es/bussiness/hyDepartmentTypeOperation/departmentTypeOperation_tiantong2.vue.mjs +108 -125
- package/es/bussiness/hyDepartmentTypeOperation/locale/en_US.mjs +7 -7
- package/es/bussiness/hyDepartmentTypeOperation/locale/zh_CN.mjs +6 -6
- package/es/bussiness/hyDisplayQueryAddress/displayQueryAddress.vue.mjs +5 -0
- package/es/bussiness/hyDisplayQueryAddress/displayQueryAddress2.install.mjs +6 -0
- package/es/bussiness/hyDisplayQueryAddress/displayQueryAddress2.vue.mjs +182 -0
- package/es/bussiness/hyDisplayQueryAddress/index.mjs +8 -0
- package/es/bussiness/hyDisplayQueryAddress/locale/en_US.mjs +7 -0
- package/es/bussiness/hyDisplayQueryAddress/locale/index.mjs +2 -0
- package/es/bussiness/hyDisplayQueryAddress/locale/zh_CN.mjs +7 -0
- package/es/bussiness/hyDisplayQueryAddress/style/dialog.scss +0 -0
- package/es/bussiness/hyFilePlayback/cpns/audioDetail.vue.mjs +5 -0
- package/es/bussiness/hyFilePlayback/cpns/audioDetail2.install.mjs +6 -0
- package/es/bussiness/hyFilePlayback/cpns/audioDetail2.vue.mjs +247 -0
- package/es/bussiness/hyFilePlayback/cpns/picDetail.vue.mjs +5 -0
- package/es/bussiness/hyFilePlayback/cpns/picDetail2.install.mjs +6 -0
- package/es/bussiness/hyFilePlayback/cpns/picDetail2.vue.mjs +206 -0
- package/es/bussiness/hyFilePlayback/cpns/videoDetail.vue.mjs +5 -0
- package/es/bussiness/hyFilePlayback/cpns/videoDetail2.install.mjs +6 -0
- package/es/bussiness/hyFilePlayback/cpns/videoDetail2.vue.mjs +238 -0
- package/es/bussiness/hyFilePlayback/filePlayback.vue.mjs +5 -0
- package/es/bussiness/hyFilePlayback/filePlayback2.install.mjs +6 -0
- package/es/bussiness/hyFilePlayback/filePlayback2.vue.mjs +166 -0
- package/es/bussiness/hyFilePlayback/index.mjs +8 -0
- package/es/bussiness/hyFilePlayback/locale/en_US.mjs +22 -0
- package/es/bussiness/hyFilePlayback/locale/index.mjs +2 -0
- package/es/bussiness/hyFilePlayback/locale/zh_CN.mjs +22 -0
- package/es/bussiness/hyFilePlayback/style/filePlayback.scss +2 -0
- package/es/bussiness/index.mjs +2 -0
- package/es/components/hyCutter/cutter.vue.mjs +2 -2
- package/es/components/hyForm/cpns/arrayItem.vue.mjs +2 -2
- package/es/components/hyForm/cpns/formItem.vue.mjs +3 -2
- package/es/components/hyForm/js/index.mjs +2 -8
- package/es/components/hySearch/cpns/searchItem.vue.mjs +57 -67
- package/es/components/hySearch/js/index.mjs +1 -35
- package/es/components/hySearch/js/useAppSearch.mjs +3 -3
- package/es/components/hySearch/style/search.scss +1 -0
- package/es/components/hyTable/cpns/virtualTable.vue.mjs +5 -5
- package/es/components/hyTable/js/index.mjs +44 -4
- package/es/components/hyTable/js/search.mjs +0 -6
- package/es/components/hyTable/table.vue.mjs +47 -30
- package/es/components/hyTooltip/tooltip.vue.mjs +14 -6
- package/es/components/hyUserAvatar/userAvatar.vue.mjs +1 -1
- package/es/components/hyVideoPlayer/videoPlayer.vue.mjs +3 -3
- package/es/components-map.mjs +2 -0
- package/es/hooks/useBaseMainStore.mjs +16 -5
- package/es/hooks/useCurrentBus.mjs +5 -4
- package/es/hooks/useDialog.mjs +2 -2
- package/es/hooks/useGlobalConfig.mjs +19 -18
- package/es/index.mjs +5 -2
- package/es/locale/en_US.mjs +1 -0
- package/es/locale/zh_CN.mjs +1 -0
- package/es/style/index.scss +2 -2
- package/es/utils/file.mjs +1 -2
- package/es/utils/form.mjs +59 -5
- package/es/utils/index.mjs +3 -2
- package/es/utils/map/hook/leafletjs.mjs +4 -0
- package/es/utils/map/index.mjs +4 -0
- package/es/utils/timeUtils.mjs +95 -0
- package/es/version.mjs +1 -1
- package/lib/api/common.js +33 -0
- package/lib/bussiness/hyDepartmentTypeOperation/departmentTypeOperation2.vue.js +3 -6
- package/lib/bussiness/hyDepartmentTypeOperation/departmentTypeOperation_tiantong2.vue.js +107 -124
- package/lib/bussiness/hyDepartmentTypeOperation/locale/en_US.js +7 -7
- package/lib/bussiness/hyDepartmentTypeOperation/locale/zh_CN.js +6 -6
- package/lib/bussiness/hyDisplayQueryAddress/displayQueryAddress.install.js +6 -0
- package/lib/bussiness/hyDisplayQueryAddress/displayQueryAddress.vue.js +9 -0
- package/lib/bussiness/hyDisplayQueryAddress/displayQueryAddress2.install.js +6 -0
- package/lib/bussiness/hyDisplayQueryAddress/displayQueryAddress2.vue.js +186 -0
- package/lib/bussiness/hyDisplayQueryAddress/index.js +13 -0
- package/lib/bussiness/hyDisplayQueryAddress/locale/en_US.js +11 -0
- package/lib/bussiness/hyDisplayQueryAddress/locale/index.js +9 -0
- package/lib/bussiness/hyDisplayQueryAddress/locale/zh_CN.js +11 -0
- package/lib/bussiness/hyDisplayQueryAddress/style/dialog.scss +0 -0
- package/lib/bussiness/hyFilePlayback/cpns/audioDetail.install.js +6 -0
- package/lib/bussiness/hyFilePlayback/cpns/audioDetail.vue.js +9 -0
- package/lib/bussiness/hyFilePlayback/cpns/audioDetail2.install.js +6 -0
- package/lib/bussiness/hyFilePlayback/cpns/audioDetail2.vue.js +251 -0
- package/lib/bussiness/hyFilePlayback/cpns/picDetail.install.js +6 -0
- package/lib/bussiness/hyFilePlayback/cpns/picDetail.vue.js +9 -0
- package/lib/bussiness/hyFilePlayback/cpns/picDetail2.install.js +6 -0
- package/lib/bussiness/hyFilePlayback/cpns/picDetail2.vue.js +210 -0
- package/lib/bussiness/hyFilePlayback/cpns/videoDetail.install.js +6 -0
- package/lib/bussiness/hyFilePlayback/cpns/videoDetail.vue.js +9 -0
- package/lib/bussiness/hyFilePlayback/cpns/videoDetail2.install.js +6 -0
- package/lib/bussiness/hyFilePlayback/cpns/videoDetail2.vue.js +242 -0
- package/lib/bussiness/hyFilePlayback/filePlayback.install.js +6 -0
- package/lib/bussiness/hyFilePlayback/filePlayback.vue.js +9 -0
- package/lib/bussiness/hyFilePlayback/filePlayback2.install.js +6 -0
- package/lib/bussiness/hyFilePlayback/filePlayback2.vue.js +170 -0
- package/lib/bussiness/hyFilePlayback/index.js +13 -0
- package/lib/bussiness/hyFilePlayback/locale/en_US.js +26 -0
- package/lib/bussiness/hyFilePlayback/locale/index.js +9 -0
- package/lib/bussiness/hyFilePlayback/locale/zh_CN.js +26 -0
- package/lib/bussiness/hyFilePlayback/style/filePlayback.scss +2 -0
- package/lib/bussiness/index.js +18 -14
- package/lib/components/hyCutter/cutter.vue.js +2 -2
- package/lib/components/hyForm/cpns/arrayItem.vue.js +2 -2
- package/lib/components/hyForm/cpns/formItem.vue.js +3 -2
- package/lib/components/hyForm/js/index.js +0 -7
- package/lib/components/hySearch/cpns/searchItem.vue.js +64 -74
- package/lib/components/hySearch/js/index.js +0 -36
- package/lib/components/hySearch/js/useAppSearch.js +3 -3
- package/lib/components/hySearch/style/search.scss +1 -0
- package/lib/components/hyTable/cpns/virtualTable.vue.js +4 -4
- package/lib/components/hyTable/js/index.js +45 -3
- package/lib/components/hyTable/js/search.js +0 -6
- package/lib/components/hyTable/table.vue.js +46 -29
- package/lib/components/hyTooltip/tooltip.vue.js +13 -5
- package/lib/components/hyUserAvatar/userAvatar.vue.js +1 -1
- package/lib/components/hyVideoPlayer/videoPlayer.vue.js +3 -3
- package/lib/components-map.js +2 -0
- package/lib/hooks/useBaseMainStore.js +15 -4
- package/lib/hooks/useCurrentBus.js +4 -3
- package/lib/hooks/useDialog.js +2 -2
- package/lib/hooks/useGlobalConfig.js +18 -17
- package/lib/index.js +70 -55
- package/lib/locale/en_US.js +1 -0
- package/lib/locale/zh_CN.js +1 -0
- package/lib/style/index.scss +2 -2
- package/lib/utils/file.js +1 -2
- package/lib/utils/form.js +61 -4
- package/lib/utils/index.js +12 -1
- package/lib/utils/map/hook/leafletjs.js +4 -0
- package/lib/utils/map/index.js +4 -0
- package/lib/utils/timeUtils.js +105 -0
- package/lib/version.js +1 -1
- package/package.json +14 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
var zh_CN = {
|
|
2
|
+
"fileNumber": "\u6587\u4EF6\u7F16\u53F7",
|
|
3
|
+
"videoDuration": "\u89C6\u9891\u65F6\u957F",
|
|
4
|
+
"fileName": "\u6587\u4EF6\u540D\u79F0",
|
|
5
|
+
"resolution": "\u5206\u8FA8\u7387",
|
|
6
|
+
"creationTime": "\u521B\u5EFA\u65F6\u95F4",
|
|
7
|
+
"fileSize": "\u6587\u4EF6\u5927\u5C0F",
|
|
8
|
+
"collectionTime": "\u91C7\u96C6\u65F6\u95F4",
|
|
9
|
+
"deviceNumber": "\u8BBE\u5907\u7F16\u53F7",
|
|
10
|
+
"deviceName": "\u8BBE\u5907\u540D\u79F0",
|
|
11
|
+
"workNumber": "\u5DE5\u53F7",
|
|
12
|
+
"collectionStationIP": "\u91C7\u96C6\u7AD9IP",
|
|
13
|
+
"userName-0": "\u7528\u6237\u540D\u79F0",
|
|
14
|
+
"deviceCode": "\u8BBE\u5907\u7F16\u7801",
|
|
15
|
+
"detectionIsCorrect": "\u68C0\u6D4B\u6B63\u786E",
|
|
16
|
+
"audioDuration": "\u97F3\u9891\u65F6\u957F",
|
|
17
|
+
"equipmentNumber": "\u8BBE\u5907\u7F16\u53F7\uFF1A",
|
|
18
|
+
"shootingTime": "\u62CD\u6444\u65F6\u95F4",
|
|
19
|
+
"clickTheImageToDisplayInFullScreen": "\u70B9\u51FB\u56FE\u7247\uFF0C\u5373\u53EF\u5168\u5C4F\u5C55\u793A"
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { zh_CN as default };
|
package/es/bussiness/index.mjs
CHANGED
|
@@ -7,3 +7,5 @@ export { HyPlanGroupDeviceTree } from './hyPlanGroupDeviceTree/index.mjs';
|
|
|
7
7
|
export { HyAcquisitionStationTree } from './hyAcquisitionStationTree/index.mjs';
|
|
8
8
|
export { HyAddElectronicFenceDialog, HyBatchSetElectronicFenceUserDialog, HyElectronicFence, HyElectronicFenceAssociatedUsersDialog } from './hyElectronicFence/index.mjs';
|
|
9
9
|
export { HyRuleAssignDialog, HyRuleFenceDialog, HyRuleSetting, HyRuleSettingDialog, HySetRuleAggregationAlarmDialog } from './hyRuleSetting/index.mjs';
|
|
10
|
+
export { HyDisplayQueryAddress } from './hyDisplayQueryAddress/index.mjs';
|
|
11
|
+
export { HyFilePlayback } from './hyFilePlayback/index.mjs';
|
|
@@ -195,9 +195,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
195
195
|
}
|
|
196
196
|
function setDragLevelIndex() {
|
|
197
197
|
const { baseMainStore } = useBaseMainStore();
|
|
198
|
-
const dragLevel = baseMainStore.getters.dragLevel;
|
|
198
|
+
const dragLevel = baseMainStore.value.getters.dragLevel;
|
|
199
199
|
HyDialogRef.value.setDragLevelIndex(dragLevel);
|
|
200
|
-
baseMainStore.commit("setDragLevel");
|
|
200
|
+
baseMainStore.value.commit("setDragLevel");
|
|
201
201
|
}
|
|
202
202
|
__expose({
|
|
203
203
|
open: async (params) => {
|
|
@@ -3,10 +3,10 @@ import { ElIcon } from 'element-plus';
|
|
|
3
3
|
import { Delete, Top, Bottom, CirclePlus } from '@element-plus/icons-vue';
|
|
4
4
|
import '../../index.mjs';
|
|
5
5
|
import '../../../utils/index.mjs';
|
|
6
|
-
import { isRequired,
|
|
6
|
+
import { isRequired, renderArrayItemLabel, renderAddLabel } from '../js/index.mjs';
|
|
7
7
|
import _sfc_main$1 from './formItem.vue.mjs';
|
|
8
8
|
import { resetAppFormValue } from '../js/useAppForm.mjs';
|
|
9
|
-
import { setValueByProp, getValueByProp } from '../../../utils/form.mjs';
|
|
9
|
+
import { setValueByProp, getValueByProp, columnHelpHandler } from '../../../utils/form.mjs';
|
|
10
10
|
import { isNumber, isArray } from '../../../utils/is.mjs';
|
|
11
11
|
import { HyTooltip } from '../../hyTooltip/index.mjs';
|
|
12
12
|
|
|
@@ -3,10 +3,10 @@ import { ElFormItem, ElSelect, ElIcon, ElSelectV2, ElRadioGroup, ElCheckboxGroup
|
|
|
3
3
|
import { Loading } from '@element-plus/icons-vue';
|
|
4
4
|
import '../../../utils/index.mjs';
|
|
5
5
|
import '../../index.mjs';
|
|
6
|
-
import { formContextKey, optionsHandler, isRequired, columnVisibleHandler, columnItemStyle, columnShowHandler,
|
|
6
|
+
import { formContextKey, optionsHandler, isRequired, columnVisibleHandler, columnItemStyle, columnShowHandler, isReadonly, renderText, isDisabled } from '../js/index.mjs';
|
|
7
7
|
import '../../../hooks/index.mjs';
|
|
8
8
|
import { isBoolean, isArray } from '../../../utils/is.mjs';
|
|
9
|
-
import { setValueByProp, getValueByProp, columnPlaceholderHandler, columnLabelHandler, columnRuleHandler } from '../../../utils/form.mjs';
|
|
9
|
+
import { setValueByProp, getValueByProp, columnPlaceholderHandler, columnnoDataTextHandler, columnLabelHandler, columnRuleHandler, columnHelpHandler } from '../../../utils/form.mjs';
|
|
10
10
|
import { HyTooltip } from '../../hyTooltip/index.mjs';
|
|
11
11
|
import { HyIcon } from '../../hyIcon/index.mjs';
|
|
12
12
|
import { $t } from '../../../hooks/useLocale.mjs';
|
|
@@ -122,6 +122,7 @@ const _sfc_main = {
|
|
|
122
122
|
...config,
|
|
123
123
|
...attrs,
|
|
124
124
|
label: columnLabelHandler(props.column, props.model),
|
|
125
|
+
noDataText: columnnoDataTextHandler(props.column, props.model),
|
|
125
126
|
placeholder: columnPlaceholderHandler(props.column, props.model)
|
|
126
127
|
};
|
|
127
128
|
});
|
|
@@ -2,7 +2,7 @@ import { unref } from 'vue';
|
|
|
2
2
|
import '../../../utils/index.mjs';
|
|
3
3
|
import '../../../hooks/index.mjs';
|
|
4
4
|
import { funRunHandler } from '../../../utils/handler.mjs';
|
|
5
|
-
import { isNumber, isBoolean, isFunction,
|
|
5
|
+
import { isNumber, isBoolean, isFunction, isArray, isObject } from '../../../utils/is.mjs';
|
|
6
6
|
import { columnRuleHandler, getValueByProp } from '../../../utils/form.mjs';
|
|
7
7
|
import { $t } from '../../../hooks/useLocale.mjs';
|
|
8
8
|
|
|
@@ -37,12 +37,6 @@ function columnVisibleHandler(props, column) {
|
|
|
37
37
|
if (isFunction(visible)) return visible(column, props.model);
|
|
38
38
|
return true;
|
|
39
39
|
}
|
|
40
|
-
function columnHelpHandler(props, column) {
|
|
41
|
-
const help = unref(column.help);
|
|
42
|
-
if (isString(help)) return help;
|
|
43
|
-
if (isFunction(help)) return help(column, props.model);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
40
|
function isReadonly(props, column) {
|
|
47
41
|
if (props.readonly) return props.readonly;
|
|
48
42
|
const readonly = unref(column.readonly);
|
|
@@ -116,4 +110,4 @@ function optionsHandler(props, column) {
|
|
|
116
110
|
return [];
|
|
117
111
|
}
|
|
118
112
|
|
|
119
|
-
export {
|
|
113
|
+
export { columnItemStyle, columnShowHandler, columnVisibleHandler, formContextKey, isDisabled, isReadonly, isRequired, optionsHandler, renderAddLabel, renderArrayItemLabel, renderText };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { inject, useTemplateRef, computed, reactive, toRefs, onMounted, watch, onBeforeUnmount, unref, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, normalizeStyle, createCommentVNode, renderSlot, createElementBlock, toDisplayString,
|
|
1
|
+
import { inject, useTemplateRef, computed, ref, reactive, toRefs, onMounted, watch, onBeforeUnmount, unref, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, normalizeStyle, createCommentVNode, renderSlot, createElementBlock, toDisplayString, createVNode, Fragment, mergeProps, withKeys, createSlots } from 'vue';
|
|
2
2
|
import { ElFormItem, ElSelect, ElIcon, ElSelectV2, ElCascader } from 'element-plus';
|
|
3
3
|
import { Loading } from '@element-plus/icons-vue';
|
|
4
4
|
import '../../../utils/index.mjs';
|
|
5
5
|
import '../../index.mjs';
|
|
6
|
-
import { formContextKey, optionsHandler,
|
|
6
|
+
import { formContextKey, optionsHandler, columnShowHandler, columnItemStyle, columnItemInputStyle, isDisabled } from '../js/index.mjs';
|
|
7
7
|
import { isArray } from '../../../utils/is.mjs';
|
|
8
|
-
import { setValueByProp, getValueByProp, columnPlaceholderHandler, columnLabelHandler } from '../../../utils/form.mjs';
|
|
8
|
+
import { setValueByProp, getValueByProp, genColumnShortcuts, columnPlaceholderHandler, columnnoDataTextHandler, columnLabelHandler, columnHelpHandler } from '../../../utils/form.mjs';
|
|
9
|
+
import { HyTooltip } from '../../hyTooltip/index.mjs';
|
|
10
|
+
import { HyIcon } from '../../hyIcon/index.mjs';
|
|
9
11
|
import { HyInput } from '../../hyInput/index.mjs';
|
|
10
12
|
import { HyDatePicker } from '../../hyDatePicker/index.mjs';
|
|
11
13
|
import { HyTimePicker } from '../../hyTimePicker/index.mjs';
|
|
@@ -75,9 +77,15 @@ const _sfc_main = {
|
|
|
75
77
|
return {
|
|
76
78
|
...props.column.attrs,
|
|
77
79
|
label: columnLabelHandler(props.column, props.model),
|
|
78
|
-
|
|
80
|
+
noDataText: columnnoDataTextHandler(props.column, props.model),
|
|
81
|
+
placeholder: props.column.optionsError === "error" ? "\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u52A0\u8F7D" : columnPlaceholderHandler(props.column, props.model),
|
|
82
|
+
shortcuts: genColumnShortcuts(props.column)
|
|
79
83
|
};
|
|
80
84
|
});
|
|
85
|
+
const helpVisible = ref(false);
|
|
86
|
+
function helpVisibleHandler(visible) {
|
|
87
|
+
helpVisible.value = visible;
|
|
88
|
+
}
|
|
81
89
|
function obtainOptions(isMountedLoad = false) {
|
|
82
90
|
return new Promise(async (resolve, reject) => {
|
|
83
91
|
if (props.column.optionsFn) {
|
|
@@ -155,21 +163,6 @@ const _sfc_main = {
|
|
|
155
163
|
function onKeydownEnterHander(e) {
|
|
156
164
|
emits("search");
|
|
157
165
|
}
|
|
158
|
-
function onTimeRangeClickHandler(column, options) {
|
|
159
|
-
const { field } = column;
|
|
160
|
-
const dateValue = timeRangeHandler(column, options);
|
|
161
|
-
const flag = dateValue.length && dateValue.every((value, index) => {
|
|
162
|
-
return isArray(field) ? value === props.model[field[index]] : props.model[field][index];
|
|
163
|
-
});
|
|
164
|
-
if (flag) return;
|
|
165
|
-
if (isArray(field)) {
|
|
166
|
-
props.model[field[0]] = dateValue[0];
|
|
167
|
-
props.model[field[1]] = dateValue[1];
|
|
168
|
-
} else {
|
|
169
|
-
props.model[field] = dateValue;
|
|
170
|
-
}
|
|
171
|
-
emits("search");
|
|
172
|
-
}
|
|
173
166
|
const context = reactive({
|
|
174
167
|
...toRefs(props),
|
|
175
168
|
columnProp,
|
|
@@ -228,25 +221,50 @@ const _sfc_main = {
|
|
|
228
221
|
},
|
|
229
222
|
[
|
|
230
223
|
createCommentVNode(" \u8868\u5355label "),
|
|
231
|
-
createElementVNode(
|
|
232
|
-
"
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
[
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
224
|
+
createElementVNode("div", {
|
|
225
|
+
class: normalizeClass(["flex items-center text-auxiliary text-sm whitespace-nowrap box-border cursor-default", {
|
|
226
|
+
"border-r border-border px-3": __props.column.labelSlot && _ctx.$slots[__props.column.labelSlot] || unref(columnLabelHandler)(__props.column, props.model)
|
|
227
|
+
}]),
|
|
228
|
+
onMouseenter: ($event) => helpVisibleHandler(true),
|
|
229
|
+
onMouseleave: ($event) => helpVisibleHandler(false)
|
|
230
|
+
}, [
|
|
231
|
+
__props.column.labelSlot && _ctx.$slots[__props.column.labelSlot] ? renderSlot(_ctx.$slots, __props.column.labelSlot, { column: columnConfig.value }, void 0, void 0, 0) : (openBlock(), createElementBlock(
|
|
232
|
+
"span",
|
|
233
|
+
{ key: 1 },
|
|
234
|
+
toDisplayString(unref(columnLabelHandler)(__props.column, props.model)),
|
|
235
|
+
1
|
|
236
|
+
/* TEXT */
|
|
237
|
+
)),
|
|
238
|
+
unref(columnHelpHandler)(props, __props.column) || __props.column.tooltipContentSlot ? (openBlock(), createBlock(unref(HyTooltip), {
|
|
239
|
+
key: 2,
|
|
240
|
+
"is-always": "",
|
|
241
|
+
visible: helpVisible.value
|
|
242
|
+
}, {
|
|
243
|
+
content: withCtx(() => [
|
|
244
|
+
!__props.column.tooltipContentSlot ? (openBlock(), createElementBlock(
|
|
245
|
+
"span",
|
|
246
|
+
{ key: 0 },
|
|
247
|
+
toDisplayString(unref(columnHelpHandler)(props, __props.column)),
|
|
248
|
+
1
|
|
249
|
+
/* TEXT */
|
|
250
|
+
)) : createCommentVNode("v-if", true),
|
|
251
|
+
renderSlot(_ctx.$slots, __props.column.tooltipContentSlot, {
|
|
252
|
+
column: columnConfig.value,
|
|
253
|
+
model: __props.model
|
|
254
|
+
})
|
|
255
|
+
]),
|
|
256
|
+
default: withCtx(() => [
|
|
257
|
+
createElementVNode("span", { class: "text-xs text-theme ml-1" }, [
|
|
258
|
+
createVNode(unref(HyIcon), {
|
|
259
|
+
"svg-name": "dispatch-share-v3-base-help",
|
|
260
|
+
class: "!w-3 !h-3"
|
|
261
|
+
})
|
|
262
|
+
])
|
|
263
|
+
]),
|
|
264
|
+
_: 3
|
|
265
|
+
/* FORWARDED */
|
|
266
|
+
}, 8, ["visible"])) : createCommentVNode("v-if", true)
|
|
267
|
+
], 42, ["onMouseenter", "onMouseleave"]),
|
|
250
268
|
createCommentVNode(" \u8868\u5355\u7EC4\u4EF6 "),
|
|
251
269
|
createElementVNode(
|
|
252
270
|
"div",
|
|
@@ -503,35 +521,7 @@ const _sfc_main = {
|
|
|
503
521
|
],
|
|
504
522
|
4
|
|
505
523
|
/* STYLE */
|
|
506
|
-
)
|
|
507
|
-
__props.column.type === "date-picker" && ["daterange", "datetimerange"].includes(columnAttrs.value?.type) && __props.column.timeRangeOptions?.length ? (openBlock(), createElementBlock("div", {
|
|
508
|
-
key: 0,
|
|
509
|
-
class: "flex text-main select-none"
|
|
510
|
-
}, [
|
|
511
|
-
(openBlock(true), createElementBlock(
|
|
512
|
-
Fragment,
|
|
513
|
-
null,
|
|
514
|
-
renderList(__props.column.timeRangeOptions, (item, index) => {
|
|
515
|
-
return openBlock(), createElementBlock("div", {
|
|
516
|
-
key: index,
|
|
517
|
-
class: normalizeClass(["border-l border-border px-[10px] cursor-pointer box-border", {
|
|
518
|
-
"bg-[rgba(var(--hy-theme),0.2)] text-theme font-bold": unref(isSelectedTimeRange)(__props.column, item, __props.model)
|
|
519
|
-
}]),
|
|
520
|
-
onClick: ($event) => onTimeRangeClickHandler(__props.column, item)
|
|
521
|
-
}, [
|
|
522
|
-
createElementVNode(
|
|
523
|
-
"span",
|
|
524
|
-
null,
|
|
525
|
-
toDisplayString(item.label),
|
|
526
|
-
1
|
|
527
|
-
/* TEXT */
|
|
528
|
-
)
|
|
529
|
-
], 10, ["onClick"]);
|
|
530
|
-
}),
|
|
531
|
-
128
|
|
532
|
-
/* KEYED_FRAGMENT */
|
|
533
|
-
))
|
|
534
|
-
])) : createCommentVNode("v-if", true)
|
|
524
|
+
)
|
|
535
525
|
],
|
|
536
526
|
2
|
|
537
527
|
/* CLASS */
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import dayjs from 'dayjs';
|
|
2
1
|
import { unref, ref } from 'vue';
|
|
3
2
|
import '../../../utils/index.mjs';
|
|
4
3
|
import '../../../hooks/index.mjs';
|
|
@@ -96,39 +95,6 @@ function useShrink(props, formItemWrapper) {
|
|
|
96
95
|
}
|
|
97
96
|
};
|
|
98
97
|
}
|
|
99
|
-
function timeRangeHandler(column, options) {
|
|
100
|
-
const { value, unit } = options;
|
|
101
|
-
const { attrs } = column;
|
|
102
|
-
let { timeRangeFill } = attrs;
|
|
103
|
-
const format = "YYYY-MM-DD";
|
|
104
|
-
const date = dayjs(Date.now());
|
|
105
|
-
timeRangeFill = timeRangeFill || attrs.type === "datetimerange";
|
|
106
|
-
switch (unit) {
|
|
107
|
-
case "year":
|
|
108
|
-
case "month":
|
|
109
|
-
return [
|
|
110
|
-
date.subtract(value, unit).format(`${format}${timeRangeFill ? " 00:00:00" : ""}`),
|
|
111
|
-
date.format(`${format}${timeRangeFill ? " 23:59:59" : ""}`)
|
|
112
|
-
];
|
|
113
|
-
case "day":
|
|
114
|
-
default:
|
|
115
|
-
return value === 1 ? [
|
|
116
|
-
date.format(`${format}${timeRangeFill ? " 00:00:00" : ""}`),
|
|
117
|
-
date.format(`${format}${timeRangeFill ? " 23:59:59" : ""}`)
|
|
118
|
-
] : [
|
|
119
|
-
date.subtract(value, unit).format(`${format}${timeRangeFill ? " 00:00:00" : ""}`),
|
|
120
|
-
date.format(`${format}${timeRangeFill ? " 23:59:59" : ""}`)
|
|
121
|
-
];
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
function isSelectedTimeRange(column, options, model = {}) {
|
|
125
|
-
const [start, end] = timeRangeHandler(column, options);
|
|
126
|
-
const { field } = column;
|
|
127
|
-
if (Array.isArray(field)) {
|
|
128
|
-
return start === model[field[0]] && end === model[field[1]];
|
|
129
|
-
}
|
|
130
|
-
return start === model[field][0] && end === model[field][1];
|
|
131
|
-
}
|
|
132
98
|
function optionsHandler(props, column) {
|
|
133
99
|
const options = unref(column.attrs.options);
|
|
134
100
|
if (isArray(options)) return options;
|
|
@@ -136,4 +102,4 @@ function optionsHandler(props, column) {
|
|
|
136
102
|
return [];
|
|
137
103
|
}
|
|
138
104
|
|
|
139
|
-
export { columnItemInputStyle, columnItemStyle, columnShowHandler, formContextKey, isDisabled, isEmptyValue,
|
|
105
|
+
export { columnItemInputStyle, columnItemStyle, columnShowHandler, formContextKey, isDisabled, isEmptyValue, optionsHandler, useShrink };
|
|
@@ -41,15 +41,15 @@ const timeRangeOptionsHandler = (config) => {
|
|
|
41
41
|
if (!label) {
|
|
42
42
|
switch (unit) {
|
|
43
43
|
case "year":
|
|
44
|
-
label =
|
|
44
|
+
label = $t("hy.lastDate", [value + $t(isPlural ? "hy.years" : "hy.year")]);
|
|
45
45
|
break;
|
|
46
46
|
case "month":
|
|
47
|
-
label =
|
|
47
|
+
label = $t("hy.lastDate", [value + $t(isPlural ? "hy.months" : "hy.month")]);
|
|
48
48
|
break;
|
|
49
49
|
case "day":
|
|
50
50
|
default:
|
|
51
51
|
unit = "day";
|
|
52
|
-
label = value === 1 ? $t("hy.today") :
|
|
52
|
+
label = value === 1 ? $t("hy.today") : $t("hy.lastDate", [value + $t(isPlural ? "hy.days" : "hy.day")]);
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
list.push({ ...item, label, unit });
|
|
@@ -4,7 +4,7 @@ import { MoreFilled } from '@element-plus/icons-vue';
|
|
|
4
4
|
import '../../index.mjs';
|
|
5
5
|
import '../../../hooks/index.mjs';
|
|
6
6
|
import '../../../utils/index.mjs';
|
|
7
|
-
import { operatorFilterHandler, operatorClickHandler, operatorDisabledHandler, operatorIsDotHandler, operatorDisableTextdHandler, renderContentHandler, renderHeaderHandler } from '../js/index.mjs';
|
|
7
|
+
import { operatorFilterHandler, operatorDescHandler, operatorClickHandler, operatorDisabledHandler, operatorLabelHandler, operatorIsDotHandler, operatorDisableTextdHandler, renderContentHandler, renderHeaderHandler } from '../js/index.mjs';
|
|
8
8
|
import _sfc_main$1 from './headerItem.vue.mjs';
|
|
9
9
|
import { isNumber, isString, isFunction, isArray, isBoolean, isEmpty } from '../../../utils/is.mjs';
|
|
10
10
|
import { HyIcon } from '../../hyIcon/index.mjs';
|
|
@@ -435,7 +435,7 @@ const _sfc_main = {
|
|
|
435
435
|
key: cindex,
|
|
436
436
|
"is-always": "",
|
|
437
437
|
overLine: 1,
|
|
438
|
-
content: citem
|
|
438
|
+
content: unref(operatorDescHandler)(citem, { column, row, $index, cellIndex })
|
|
439
439
|
}, {
|
|
440
440
|
default: withCtx(() => [
|
|
441
441
|
createElementVNode("div", {
|
|
@@ -454,13 +454,13 @@ const _sfc_main = {
|
|
|
454
454
|
"svg-name": citem.svgName,
|
|
455
455
|
"class-name": "!w-4 !h-4"
|
|
456
456
|
}, null, 8, ["svg-name"]),
|
|
457
|
-
citem
|
|
457
|
+
unref(operatorLabelHandler)(citem, { column, row, $index, cellIndex }) ? (openBlock(), createElementBlock(
|
|
458
458
|
"div",
|
|
459
459
|
{
|
|
460
460
|
key: 0,
|
|
461
461
|
class: "mt-1 whitespace-nowrap"
|
|
462
462
|
},
|
|
463
|
-
toDisplayString(citem
|
|
463
|
+
toDisplayString(unref(operatorLabelHandler)(citem, { column, row, $index, cellIndex })),
|
|
464
464
|
1
|
|
465
465
|
/* TEXT */
|
|
466
466
|
)) : (openBlock(), createElementBlock("div", {
|
|
@@ -523,7 +523,7 @@ const _sfc_main = {
|
|
|
523
523
|
createElementVNode(
|
|
524
524
|
"span",
|
|
525
525
|
{ class: "pr-1" },
|
|
526
|
-
toDisplayString(citem
|
|
526
|
+
toDisplayString(unref(operatorLabelHandler)(citem, { column, row, $index, cellIndex })),
|
|
527
527
|
1
|
|
528
528
|
/* TEXT */
|
|
529
529
|
),
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { debounce } from 'lodash-es';
|
|
1
2
|
import { unref, ref, computed, watch, nextTick, watchEffect } from 'vue';
|
|
2
3
|
import '../../../hooks/index.mjs';
|
|
3
4
|
import '../../../utils/index.mjs';
|
|
@@ -83,6 +84,16 @@ function operatorShowHandler(operator, scope) {
|
|
|
83
84
|
if (isFunction(show)) return show(scope);
|
|
84
85
|
return true;
|
|
85
86
|
}
|
|
87
|
+
function operatorLabelHandler(operator, scope) {
|
|
88
|
+
const label = unref(operator.label);
|
|
89
|
+
if (isFunction(label)) return label(scope);
|
|
90
|
+
return label || "";
|
|
91
|
+
}
|
|
92
|
+
function operatorDescHandler(operator, scope) {
|
|
93
|
+
const desc = unref(operator.desc);
|
|
94
|
+
if (isFunction(desc)) return desc(scope);
|
|
95
|
+
return desc || "";
|
|
96
|
+
}
|
|
86
97
|
function operatorDisabledHandler(operator, scope) {
|
|
87
98
|
const { disabled } = operator;
|
|
88
99
|
if (isBoolean(disabled)) return disabled;
|
|
@@ -148,7 +159,23 @@ const useAppTableWrapper = (hy) => {
|
|
|
148
159
|
const tableColumns = ref([]);
|
|
149
160
|
const tableColumnsEditablele = ref({});
|
|
150
161
|
const tableColumnsList = computed(() => {
|
|
151
|
-
|
|
162
|
+
let columnContentLength = 0;
|
|
163
|
+
const columns = tableColumns.value.filter((column) => {
|
|
164
|
+
const flag = tableColumnShowHandler(column);
|
|
165
|
+
if (flag && column.type === "default" && tableColumnsEditablele.value[column.prop]?.checked) {
|
|
166
|
+
columnContentLength++;
|
|
167
|
+
}
|
|
168
|
+
return flag;
|
|
169
|
+
});
|
|
170
|
+
if (columnContentLength <= 1) {
|
|
171
|
+
return columns.map(({ width, ...column }) => {
|
|
172
|
+
return {
|
|
173
|
+
...column,
|
|
174
|
+
width: column.type === "default" && tableColumnsEditablele.value[column.prop]?.checked ? void 0 : width
|
|
175
|
+
};
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
return columns;
|
|
152
179
|
});
|
|
153
180
|
const searchPlaceholder = computed(() => {
|
|
154
181
|
const searchLabelSet = tableColumnsList.value.reduce((searchLabelSet2, column) => {
|
|
@@ -410,9 +437,22 @@ const useAppTableWrapper = (hy) => {
|
|
|
410
437
|
tableRef.value.setScrollLeft(left);
|
|
411
438
|
}
|
|
412
439
|
}
|
|
413
|
-
|
|
440
|
+
const onScrollHandler = debounce((params) => {
|
|
441
|
+
const { scrollTop } = params || {};
|
|
442
|
+
let clientHeight, scrollHeight;
|
|
443
|
+
if (props.type === "virtual") {
|
|
444
|
+
const wrapperEl = tableRef.value?.$el.querySelector(".hy-el-vl__wrapper");
|
|
445
|
+
clientHeight = wrapperEl?.clientHeight;
|
|
446
|
+
scrollHeight = wrapperEl?.firstChild.firstChild.scrollHeight;
|
|
447
|
+
} else {
|
|
448
|
+
clientHeight = tableRef.value?.$refs.bodyWrapper.clientHeight;
|
|
449
|
+
scrollHeight = tableRef.value?.$refs.tableBody.scrollHeight;
|
|
450
|
+
}
|
|
414
451
|
emits("scroll", params);
|
|
415
|
-
|
|
452
|
+
if (clientHeight && scrollHeight && scrollTop && clientHeight + Math.round(scrollTop) + 1 >= scrollHeight) {
|
|
453
|
+
emits("scrollBottom", params);
|
|
454
|
+
}
|
|
455
|
+
}, 250);
|
|
416
456
|
window.scrollToTop = scrollToTop;
|
|
417
457
|
watchEffect(() => {
|
|
418
458
|
const { columnsList, columnsEditablele, searchText } = tableColumnHandler(props.tableColumns, CACHE_COLUMNS_KEY);
|
|
@@ -454,4 +494,4 @@ const useAppTableWrapper = (hy) => {
|
|
|
454
494
|
};
|
|
455
495
|
};
|
|
456
496
|
|
|
457
|
-
export { operatorClickHandler, operatorDisableTextdHandler, operatorDisabledHandler, operatorFilterHandler, operatorIsDotHandler, renderContentHandler, renderHeaderHandler, tableColumnHandler, tableColumnShowHandler, useAppTableWrapper };
|
|
497
|
+
export { operatorClickHandler, operatorDescHandler, operatorDisableTextdHandler, operatorDisabledHandler, operatorFilterHandler, operatorIsDotHandler, operatorLabelHandler, renderContentHandler, renderHeaderHandler, tableColumnHandler, tableColumnShowHandler, useAppTableWrapper };
|
|
@@ -8,10 +8,6 @@ function useAppTableSearch(hy) {
|
|
|
8
8
|
const { props, emits, appSearchRef, tableDataSource, clearSelection } = hy;
|
|
9
9
|
const { api } = useApi();
|
|
10
10
|
const totalElements = ref(0);
|
|
11
|
-
const showFilter = ref(true);
|
|
12
|
-
function switchShowFilter() {
|
|
13
|
-
showFilter.value = !showFilter.value;
|
|
14
|
-
}
|
|
15
11
|
async function getData(page = null) {
|
|
16
12
|
await nextTick();
|
|
17
13
|
hy.loading.value = true;
|
|
@@ -123,12 +119,10 @@ function useAppTableSearch(hy) {
|
|
|
123
119
|
}
|
|
124
120
|
return {
|
|
125
121
|
totalElements,
|
|
126
|
-
showFilter,
|
|
127
122
|
getData,
|
|
128
123
|
setData,
|
|
129
124
|
resetFields,
|
|
130
125
|
resetFn,
|
|
131
|
-
switchShowFilter,
|
|
132
126
|
getTotalElements,
|
|
133
127
|
getTableDataSource,
|
|
134
128
|
onSizeChangeHandler,
|