hy-dispatch-ui-v3 0.2.77 → 0.2.79
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 +95 -12
- 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/hyDatePicker/datePicker.vue.mjs +34 -4
- package/es/components/hyForm/cpns/arrayItem.vue.mjs +2 -2
- package/es/components/hyForm/cpns/formItem.vue.mjs +73 -63
- package/es/components/hyForm/js/index.mjs +2 -8
- package/es/components/hyForm/js/useAppForm.mjs +2 -1
- 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 +2 -29
- 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 +1 -7
- package/es/components/hyTable/table.vue.mjs +47 -30
- package/es/components/hyTooltip/tooltip.vue.mjs +39 -21
- 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 +84 -5
- package/es/utils/index.mjs +3 -2
- package/es/utils/is.mjs +1 -1
- package/es/utils/map/hook/leafletjs.mjs +4 -0
- package/es/utils/map/index.mjs +4 -0
- package/es/utils/permission.mjs +3 -1
- 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/hyDatePicker/datePicker.vue.js +32 -2
- package/lib/components/hyForm/cpns/arrayItem.vue.js +2 -2
- package/lib/components/hyForm/cpns/formItem.vue.js +71 -61
- package/lib/components/hyForm/js/index.js +0 -7
- package/lib/components/hyForm/js/useAppForm.js +1 -0
- 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 +1 -28
- 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 +1 -7
- package/lib/components/hyTable/table.vue.js +46 -29
- package/lib/components/hyTooltip/tooltip.vue.js +38 -20
- 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 +71 -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 +87 -4
- package/lib/utils/index.js +13 -1
- package/lib/utils/is.js +1 -1
- package/lib/utils/map/hook/leafletjs.js +4 -0
- package/lib/utils/map/index.js +4 -0
- package/lib/utils/permission.js +3 -1
- package/lib/utils/timeUtils.js +105 -0
- package/lib/version.js +1 -1
- package/package.json +14 -1
|
@@ -126,7 +126,9 @@ const _sfc_main = {
|
|
|
126
126
|
...config,
|
|
127
127
|
...attrs,
|
|
128
128
|
label: form.columnLabelHandler(props.column, props.model),
|
|
129
|
-
|
|
129
|
+
noDataText: form.columnnoDataTextHandler(props.column, props.model),
|
|
130
|
+
placeholder: form.columnPlaceholderHandler(props.column, props.model),
|
|
131
|
+
shortcuts: form.genColumnShortcuts(props.column)
|
|
130
132
|
};
|
|
131
133
|
});
|
|
132
134
|
async function obtainOptions(isMountedLoad = false) {
|
|
@@ -264,74 +266,82 @@ const _sfc_main = {
|
|
|
264
266
|
"show-message": showMessage.value
|
|
265
267
|
}, vue.createSlots({
|
|
266
268
|
default: vue.withCtx(() => [
|
|
267
|
-
vue.createElementVNode(
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
vue.
|
|
276
|
-
vue.toDisplayString(vue.unref(form.columnLabelHandler)(__props.column, props.model) || "\xA0"),
|
|
277
|
-
1
|
|
278
|
-
/* TEXT */
|
|
279
|
-
)
|
|
280
|
-
])
|
|
281
|
-
]),
|
|
282
|
-
vue.unref(index.isRequired)(props, __props.column) ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
283
|
-
key: 0,
|
|
284
|
-
class: "label-required"
|
|
285
|
-
})) : vue.createCommentVNode("v-if", true),
|
|
286
|
-
vue.unref(index.columnHelpHandler)(props, __props.column) || __props.column.tooltipContentSlot ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.HyTooltip), {
|
|
287
|
-
key: 1,
|
|
288
|
-
"is-always": "",
|
|
289
|
-
overLine: 1
|
|
290
|
-
}, {
|
|
291
|
-
content: vue.withCtx(() => [
|
|
292
|
-
!__props.column.tooltipContentSlot ? (vue.openBlock(), vue.createElementBlock(
|
|
293
|
-
"span",
|
|
294
|
-
{ key: 0 },
|
|
295
|
-
vue.toDisplayString(vue.unref(index.columnHelpHandler)(props, __props.column)),
|
|
296
|
-
1
|
|
297
|
-
/* TEXT */
|
|
298
|
-
)) : vue.createCommentVNode("v-if", true),
|
|
299
|
-
vue.renderSlot(_ctx.$slots, __props.column.tooltipContentSlot, {
|
|
269
|
+
vue.createElementVNode(
|
|
270
|
+
"div",
|
|
271
|
+
{
|
|
272
|
+
class: vue.normalizeClass(["w-full flex justify-between text-main", __props.column.labelClass])
|
|
273
|
+
},
|
|
274
|
+
[
|
|
275
|
+
vue.createElementVNode("div", { class: "flex items-center" }, [
|
|
276
|
+
vue.createElementVNode("span", { class: "text-main whitespace-nowrap" }, [
|
|
277
|
+
vue.renderSlot(_ctx.$slots, __props.column.labelSlot, {
|
|
300
278
|
column: columnConfig.value,
|
|
301
279
|
model: __props.model,
|
|
302
280
|
required: vue.unref(index.isRequired)(props, __props.column)
|
|
303
|
-
})
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
vue.createElementVNode("span", { class: "text-xs text-theme ml-2" }, [
|
|
307
|
-
vue.createVNode(vue.unref(index$2.HyIcon), {
|
|
308
|
-
"svg-name": "dispatch-share-v3-base-help",
|
|
309
|
-
class: "!w-3 !h-3 mr-1"
|
|
310
|
-
}),
|
|
311
|
-
vue.createElementVNode(
|
|
312
|
-
"span",
|
|
313
|
-
null,
|
|
314
|
-
vue.toDisplayString(vue.unref(useLocale.$t)("hy.help")),
|
|
281
|
+
}, () => [
|
|
282
|
+
vue.createTextVNode(
|
|
283
|
+
vue.toDisplayString(vue.unref(form.columnLabelHandler)(__props.column, props.model) || "\xA0"),
|
|
315
284
|
1
|
|
316
285
|
/* TEXT */
|
|
317
286
|
)
|
|
318
287
|
])
|
|
319
288
|
]),
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
289
|
+
vue.unref(index.isRequired)(props, __props.column) ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
290
|
+
key: 0,
|
|
291
|
+
class: "label-required"
|
|
292
|
+
})) : vue.createCommentVNode("v-if", true),
|
|
293
|
+
vue.unref(form.columnHelpHandler)(props, __props.column) || __props.column.tooltipContentSlot ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.HyTooltip), {
|
|
294
|
+
key: 1,
|
|
295
|
+
"is-always": "",
|
|
296
|
+
overLine: 1
|
|
297
|
+
}, {
|
|
298
|
+
content: vue.withCtx(() => [
|
|
299
|
+
!__props.column.tooltipContentSlot ? (vue.openBlock(), vue.createElementBlock(
|
|
300
|
+
"span",
|
|
301
|
+
{ key: 0 },
|
|
302
|
+
vue.toDisplayString(vue.unref(form.columnHelpHandler)(props, __props.column)),
|
|
303
|
+
1
|
|
304
|
+
/* TEXT */
|
|
305
|
+
)) : vue.createCommentVNode("v-if", true),
|
|
306
|
+
vue.renderSlot(_ctx.$slots, __props.column.tooltipContentSlot, {
|
|
307
|
+
column: columnConfig.value,
|
|
308
|
+
model: __props.model,
|
|
309
|
+
required: vue.unref(index.isRequired)(props, __props.column)
|
|
310
|
+
})
|
|
311
|
+
]),
|
|
312
|
+
default: vue.withCtx(() => [
|
|
313
|
+
vue.createElementVNode("span", { class: "text-xs text-theme ml-2" }, [
|
|
314
|
+
vue.createVNode(vue.unref(index$2.HyIcon), {
|
|
315
|
+
"svg-name": "dispatch-share-v3-base-help",
|
|
316
|
+
class: "!w-3 !h-3 mr-1"
|
|
317
|
+
}),
|
|
318
|
+
vue.createElementVNode(
|
|
319
|
+
"span",
|
|
320
|
+
null,
|
|
321
|
+
vue.toDisplayString(vue.unref(useLocale.$t)("hy.help")),
|
|
322
|
+
1
|
|
323
|
+
/* TEXT */
|
|
324
|
+
)
|
|
325
|
+
])
|
|
326
|
+
]),
|
|
327
|
+
_: 3
|
|
328
|
+
/* FORWARDED */
|
|
329
|
+
})) : vue.createCommentVNode("v-if", true)
|
|
330
|
+
]),
|
|
331
|
+
__props.column.rightSlot && _ctx.$slots[__props.column.rightSlot] ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
332
|
+
key: 0,
|
|
333
|
+
class: "ml-2 flex items-center"
|
|
334
|
+
}, [
|
|
335
|
+
vue.renderSlot(_ctx.$slots, __props.column.rightSlot, {
|
|
336
|
+
column: columnConfig.value,
|
|
337
|
+
model: __props.model,
|
|
338
|
+
required: vue.unref(index.isRequired)(props, __props.column)
|
|
339
|
+
})
|
|
340
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
341
|
+
],
|
|
342
|
+
2
|
|
343
|
+
/* CLASS */
|
|
344
|
+
),
|
|
335
345
|
vue.unref(index.isReadonly)(props, __props.column) || !__props.column.type && !__props.column.slot ? (vue.openBlock(), vue.createElementBlock(
|
|
336
346
|
"div",
|
|
337
347
|
{
|
|
@@ -39,12 +39,6 @@ function columnVisibleHandler(props, column) {
|
|
|
39
39
|
if (is.isFunction(visible)) return visible(column, props.model);
|
|
40
40
|
return true;
|
|
41
41
|
}
|
|
42
|
-
function columnHelpHandler(props, column) {
|
|
43
|
-
const help = vue.unref(column.help);
|
|
44
|
-
if (is.isString(help)) return help;
|
|
45
|
-
if (is.isFunction(help)) return help(column, props.model);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
42
|
function isReadonly(props, column) {
|
|
49
43
|
if (props.readonly) return props.readonly;
|
|
50
44
|
const readonly = vue.unref(column.readonly);
|
|
@@ -118,7 +112,6 @@ function optionsHandler(props, column) {
|
|
|
118
112
|
return [];
|
|
119
113
|
}
|
|
120
114
|
|
|
121
|
-
exports.columnHelpHandler = columnHelpHandler;
|
|
122
115
|
exports.columnItemStyle = columnItemStyle;
|
|
123
116
|
exports.columnShowHandler = columnShowHandler;
|
|
124
117
|
exports.columnVisibleHandler = columnVisibleHandler;
|
|
@@ -10,10 +10,12 @@ require('../../index.js');
|
|
|
10
10
|
var index = require('../js/index.js');
|
|
11
11
|
var is = require('../../../utils/is.js');
|
|
12
12
|
var form = require('../../../utils/form.js');
|
|
13
|
-
var index$1 = require('../../
|
|
14
|
-
var index$2 = require('../../
|
|
15
|
-
var index$3 = require('../../
|
|
16
|
-
var index$4 = require('../../
|
|
13
|
+
var index$1 = require('../../hyTooltip/index.js');
|
|
14
|
+
var index$2 = require('../../hyIcon/index.js');
|
|
15
|
+
var index$3 = require('../../hyInput/index.js');
|
|
16
|
+
var index$4 = require('../../hyDatePicker/index.js');
|
|
17
|
+
var index$5 = require('../../hyTimePicker/index.js');
|
|
18
|
+
var index$6 = require('../../hyOrgCascader/index.js');
|
|
17
19
|
|
|
18
20
|
const _sfc_main = {
|
|
19
21
|
__name: "searchItem",
|
|
@@ -79,9 +81,15 @@ const _sfc_main = {
|
|
|
79
81
|
return {
|
|
80
82
|
...props.column.attrs,
|
|
81
83
|
label: form.columnLabelHandler(props.column, props.model),
|
|
82
|
-
|
|
84
|
+
noDataText: form.columnnoDataTextHandler(props.column, props.model),
|
|
85
|
+
placeholder: props.column.optionsError === "error" ? "\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u52A0\u8F7D" : form.columnPlaceholderHandler(props.column, props.model),
|
|
86
|
+
shortcuts: form.genColumnShortcuts(props.column)
|
|
83
87
|
};
|
|
84
88
|
});
|
|
89
|
+
const helpVisible = vue.ref(false);
|
|
90
|
+
function helpVisibleHandler(visible) {
|
|
91
|
+
helpVisible.value = visible;
|
|
92
|
+
}
|
|
85
93
|
function obtainOptions(isMountedLoad = false) {
|
|
86
94
|
return new Promise(async (resolve, reject) => {
|
|
87
95
|
if (props.column.optionsFn) {
|
|
@@ -159,21 +167,6 @@ const _sfc_main = {
|
|
|
159
167
|
function onKeydownEnterHander(e) {
|
|
160
168
|
emits("search");
|
|
161
169
|
}
|
|
162
|
-
function onTimeRangeClickHandler(column, options) {
|
|
163
|
-
const { field } = column;
|
|
164
|
-
const dateValue = index.timeRangeHandler(column, options);
|
|
165
|
-
const flag = dateValue.length && dateValue.every((value, index) => {
|
|
166
|
-
return is.isArray(field) ? value === props.model[field[index]] : props.model[field][index];
|
|
167
|
-
});
|
|
168
|
-
if (flag) return;
|
|
169
|
-
if (is.isArray(field)) {
|
|
170
|
-
props.model[field[0]] = dateValue[0];
|
|
171
|
-
props.model[field[1]] = dateValue[1];
|
|
172
|
-
} else {
|
|
173
|
-
props.model[field] = dateValue;
|
|
174
|
-
}
|
|
175
|
-
emits("search");
|
|
176
|
-
}
|
|
177
170
|
const context = vue.reactive({
|
|
178
171
|
...vue.toRefs(props),
|
|
179
172
|
columnProp,
|
|
@@ -232,25 +225,50 @@ const _sfc_main = {
|
|
|
232
225
|
},
|
|
233
226
|
[
|
|
234
227
|
vue.createCommentVNode(" \u8868\u5355label "),
|
|
235
|
-
vue.createElementVNode(
|
|
236
|
-
"
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
[
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
228
|
+
vue.createElementVNode("div", {
|
|
229
|
+
class: vue.normalizeClass(["flex items-center text-auxiliary text-sm whitespace-nowrap box-border cursor-default", {
|
|
230
|
+
"border-r border-border px-3": __props.column.labelSlot && _ctx.$slots[__props.column.labelSlot] || vue.unref(form.columnLabelHandler)(__props.column, props.model)
|
|
231
|
+
}]),
|
|
232
|
+
onMouseenter: ($event) => helpVisibleHandler(true),
|
|
233
|
+
onMouseleave: ($event) => helpVisibleHandler(false)
|
|
234
|
+
}, [
|
|
235
|
+
__props.column.labelSlot && _ctx.$slots[__props.column.labelSlot] ? vue.renderSlot(_ctx.$slots, __props.column.labelSlot, { column: columnConfig.value }, void 0, void 0, 0) : (vue.openBlock(), vue.createElementBlock(
|
|
236
|
+
"span",
|
|
237
|
+
{ key: 1 },
|
|
238
|
+
vue.toDisplayString(vue.unref(form.columnLabelHandler)(__props.column, props.model)),
|
|
239
|
+
1
|
|
240
|
+
/* TEXT */
|
|
241
|
+
)),
|
|
242
|
+
vue.unref(form.columnHelpHandler)(props, __props.column) || __props.column.tooltipContentSlot ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.HyTooltip), {
|
|
243
|
+
key: 2,
|
|
244
|
+
"is-always": "",
|
|
245
|
+
visible: helpVisible.value
|
|
246
|
+
}, {
|
|
247
|
+
content: vue.withCtx(() => [
|
|
248
|
+
!__props.column.tooltipContentSlot ? (vue.openBlock(), vue.createElementBlock(
|
|
249
|
+
"span",
|
|
250
|
+
{ key: 0 },
|
|
251
|
+
vue.toDisplayString(vue.unref(form.columnHelpHandler)(props, __props.column)),
|
|
252
|
+
1
|
|
253
|
+
/* TEXT */
|
|
254
|
+
)) : vue.createCommentVNode("v-if", true),
|
|
255
|
+
vue.renderSlot(_ctx.$slots, __props.column.tooltipContentSlot, {
|
|
256
|
+
column: columnConfig.value,
|
|
257
|
+
model: __props.model
|
|
258
|
+
})
|
|
259
|
+
]),
|
|
260
|
+
default: vue.withCtx(() => [
|
|
261
|
+
vue.createElementVNode("span", { class: "text-xs text-theme ml-1" }, [
|
|
262
|
+
vue.createVNode(vue.unref(index$2.HyIcon), {
|
|
263
|
+
"svg-name": "dispatch-share-v3-base-help",
|
|
264
|
+
class: "!w-3 !h-3"
|
|
265
|
+
})
|
|
266
|
+
])
|
|
267
|
+
]),
|
|
268
|
+
_: 3
|
|
269
|
+
/* FORWARDED */
|
|
270
|
+
}, 8, ["visible"])) : vue.createCommentVNode("v-if", true)
|
|
271
|
+
], 42, ["onMouseenter", "onMouseleave"]),
|
|
254
272
|
vue.createCommentVNode(" \u8868\u5355\u7EC4\u4EF6 "),
|
|
255
273
|
vue.createElementVNode(
|
|
256
274
|
"div",
|
|
@@ -265,7 +283,7 @@ const _sfc_main = {
|
|
|
265
283
|
{ key: 1 },
|
|
266
284
|
[
|
|
267
285
|
vue.createCommentVNode(" \u8F93\u5165\u6846 "),
|
|
268
|
-
vue.createVNode(vue.unref(index$
|
|
286
|
+
vue.createVNode(vue.unref(index$3.HyInput), vue.mergeProps({
|
|
269
287
|
ref_key: "componentRef",
|
|
270
288
|
ref: componentRef,
|
|
271
289
|
modelValue: bindValue.value,
|
|
@@ -367,7 +385,7 @@ const _sfc_main = {
|
|
|
367
385
|
{ key: 4 },
|
|
368
386
|
[
|
|
369
387
|
vue.createCommentVNode(" \u65E5\u671F\u9009\u62E9\u6846 "),
|
|
370
|
-
["datetimerange", "daterange", "monthrange", "yearrange"].includes(columnAttrs.value?.type) && vue.unref(is.isArray)(__props.column.field) ? (vue.openBlock(), vue.createBlock(vue.unref(index$
|
|
388
|
+
["datetimerange", "daterange", "monthrange", "yearrange"].includes(columnAttrs.value?.type) && vue.unref(is.isArray)(__props.column.field) ? (vue.openBlock(), vue.createBlock(vue.unref(index$4.HyDatePicker), vue.mergeProps({
|
|
371
389
|
key: 0,
|
|
372
390
|
ref_key: "componentRef",
|
|
373
391
|
ref: componentRef,
|
|
@@ -382,7 +400,7 @@ const _sfc_main = {
|
|
|
382
400
|
}, columnAttrs.value, {
|
|
383
401
|
disabled: vue.unref(index.isDisabled)(props, __props.column),
|
|
384
402
|
onChange: ($event) => onChangeHandler($event, __props.column)
|
|
385
|
-
}), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "timeRangeFill", "disabled", "onChange"])) : (vue.openBlock(), vue.createBlock(vue.unref(index$
|
|
403
|
+
}), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "timeRangeFill", "disabled", "onChange"])) : (vue.openBlock(), vue.createBlock(vue.unref(index$4.HyDatePicker), vue.mergeProps({
|
|
386
404
|
key: 1,
|
|
387
405
|
ref_key: "componentRef",
|
|
388
406
|
ref: componentRef,
|
|
@@ -404,7 +422,7 @@ const _sfc_main = {
|
|
|
404
422
|
{ key: 5 },
|
|
405
423
|
[
|
|
406
424
|
vue.createCommentVNode(" \u65F6\u95F4\u9009\u62E9\u6846 "),
|
|
407
|
-
columnAttrs.value.isRange ? (vue.openBlock(), vue.createBlock(vue.unref(index$
|
|
425
|
+
columnAttrs.value.isRange ? (vue.openBlock(), vue.createBlock(vue.unref(index$5.HyTimePicker), vue.mergeProps({
|
|
408
426
|
key: 0,
|
|
409
427
|
ref_key: "componentRef",
|
|
410
428
|
ref: componentRef,
|
|
@@ -418,7 +436,7 @@ const _sfc_main = {
|
|
|
418
436
|
}, columnAttrs.value, {
|
|
419
437
|
disabled: vue.unref(index.isDisabled)(props, __props.column),
|
|
420
438
|
onChange: onChangeHandler
|
|
421
|
-
}), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled"])) : (vue.openBlock(), vue.createBlock(vue.unref(index$
|
|
439
|
+
}), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled"])) : (vue.openBlock(), vue.createBlock(vue.unref(index$5.HyTimePicker), vue.mergeProps({
|
|
422
440
|
key: 1,
|
|
423
441
|
ref_key: "componentRef",
|
|
424
442
|
ref: componentRef,
|
|
@@ -439,7 +457,7 @@ const _sfc_main = {
|
|
|
439
457
|
{ key: 6 },
|
|
440
458
|
[
|
|
441
459
|
vue.createCommentVNode(" \u90E8\u95E8\u7EA7\u8054\u9009\u62E9\u6846 "),
|
|
442
|
-
vue.createVNode(vue.unref(index$
|
|
460
|
+
vue.createVNode(vue.unref(index$6.HyOrgCascader), vue.mergeProps({
|
|
443
461
|
ref_key: "componentRef",
|
|
444
462
|
ref: componentRef,
|
|
445
463
|
modelValue: bindValue.value,
|
|
@@ -507,35 +525,7 @@ const _sfc_main = {
|
|
|
507
525
|
],
|
|
508
526
|
4
|
|
509
527
|
/* STYLE */
|
|
510
|
-
)
|
|
511
|
-
__props.column.type === "date-picker" && ["daterange", "datetimerange"].includes(columnAttrs.value?.type) && __props.column.timeRangeOptions?.length ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
512
|
-
key: 0,
|
|
513
|
-
class: "flex text-main select-none"
|
|
514
|
-
}, [
|
|
515
|
-
(vue.openBlock(true), vue.createElementBlock(
|
|
516
|
-
vue.Fragment,
|
|
517
|
-
null,
|
|
518
|
-
vue.renderList(__props.column.timeRangeOptions, (item, index$1) => {
|
|
519
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
520
|
-
key: index$1,
|
|
521
|
-
class: vue.normalizeClass(["border-l border-border px-[10px] cursor-pointer box-border", {
|
|
522
|
-
"bg-[rgba(var(--hy-theme),0.2)] text-theme font-bold": vue.unref(index.isSelectedTimeRange)(__props.column, item, __props.model)
|
|
523
|
-
}]),
|
|
524
|
-
onClick: ($event) => onTimeRangeClickHandler(__props.column, item)
|
|
525
|
-
}, [
|
|
526
|
-
vue.createElementVNode(
|
|
527
|
-
"span",
|
|
528
|
-
null,
|
|
529
|
-
vue.toDisplayString(item.label),
|
|
530
|
-
1
|
|
531
|
-
/* TEXT */
|
|
532
|
-
)
|
|
533
|
-
], 10, ["onClick"]);
|
|
534
|
-
}),
|
|
535
|
-
128
|
|
536
|
-
/* KEYED_FRAGMENT */
|
|
537
|
-
))
|
|
538
|
-
])) : vue.createCommentVNode("v-if", true)
|
|
528
|
+
)
|
|
539
529
|
],
|
|
540
530
|
2
|
|
541
531
|
/* CLASS */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var dayjs = require('dayjs');
|
|
4
3
|
var vue = require('vue');
|
|
5
4
|
require('../../../utils/index.js');
|
|
6
5
|
require('../../../hooks/index.js');
|
|
@@ -98,39 +97,6 @@ function useShrink(props, formItemWrapper) {
|
|
|
98
97
|
}
|
|
99
98
|
};
|
|
100
99
|
}
|
|
101
|
-
function timeRangeHandler(column, options) {
|
|
102
|
-
const { value, unit } = options;
|
|
103
|
-
const { attrs } = column;
|
|
104
|
-
let { timeRangeFill } = attrs;
|
|
105
|
-
const format = "YYYY-MM-DD";
|
|
106
|
-
const date = dayjs(Date.now());
|
|
107
|
-
timeRangeFill = timeRangeFill || attrs.type === "datetimerange";
|
|
108
|
-
switch (unit) {
|
|
109
|
-
case "year":
|
|
110
|
-
case "month":
|
|
111
|
-
return [
|
|
112
|
-
date.subtract(value, unit).format(`${format}${timeRangeFill ? " 00:00:00" : ""}`),
|
|
113
|
-
date.format(`${format}${timeRangeFill ? " 23:59:59" : ""}`)
|
|
114
|
-
];
|
|
115
|
-
case "day":
|
|
116
|
-
default:
|
|
117
|
-
return value === 1 ? [
|
|
118
|
-
date.format(`${format}${timeRangeFill ? " 00:00:00" : ""}`),
|
|
119
|
-
date.format(`${format}${timeRangeFill ? " 23:59:59" : ""}`)
|
|
120
|
-
] : [
|
|
121
|
-
date.subtract(value, unit).format(`${format}${timeRangeFill ? " 00:00:00" : ""}`),
|
|
122
|
-
date.format(`${format}${timeRangeFill ? " 23:59:59" : ""}`)
|
|
123
|
-
];
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
function isSelectedTimeRange(column, options, model = {}) {
|
|
127
|
-
const [start, end] = timeRangeHandler(column, options);
|
|
128
|
-
const { field } = column;
|
|
129
|
-
if (Array.isArray(field)) {
|
|
130
|
-
return start === model[field[0]] && end === model[field[1]];
|
|
131
|
-
}
|
|
132
|
-
return start === model[field][0] && end === model[field][1];
|
|
133
|
-
}
|
|
134
100
|
function optionsHandler(props, column) {
|
|
135
101
|
const options = vue.unref(column.attrs.options);
|
|
136
102
|
if (is.isArray(options)) return options;
|
|
@@ -144,7 +110,5 @@ exports.columnShowHandler = columnShowHandler;
|
|
|
144
110
|
exports.formContextKey = formContextKey;
|
|
145
111
|
exports.isDisabled = isDisabled;
|
|
146
112
|
exports.isEmptyValue = isEmptyValue;
|
|
147
|
-
exports.isSelectedTimeRange = isSelectedTimeRange;
|
|
148
113
|
exports.optionsHandler = optionsHandler;
|
|
149
|
-
exports.timeRangeHandler = timeRangeHandler;
|
|
150
114
|
exports.useShrink = useShrink;
|
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
var vue = require('vue');
|
|
4
4
|
require('../../../hooks/index.js');
|
|
5
5
|
require('../../../utils/index.js');
|
|
6
|
-
var is = require('../../../utils/is.js');
|
|
7
|
-
var useLocale = require('../../../hooks/useLocale.js');
|
|
8
6
|
var form = require('../../../utils/form.js');
|
|
9
7
|
var handler = require('../../../utils/handler.js');
|
|
10
8
|
|
|
@@ -33,31 +31,6 @@ const genColumnWidth = (config) => {
|
|
|
33
31
|
}
|
|
34
32
|
return { width, inputWidth };
|
|
35
33
|
};
|
|
36
|
-
const timeRangeOptionsHandler = (config) => {
|
|
37
|
-
const { timeRangeOptions } = config || {};
|
|
38
|
-
if (!timeRangeOptions?.length) return timeRangeOptions;
|
|
39
|
-
return timeRangeOptions.reduce((list, item) => {
|
|
40
|
-
let { value, label, unit } = item;
|
|
41
|
-
if (!value || !is.isNumber(value) || isNaN(value)) return list;
|
|
42
|
-
const isPlural = value > 1;
|
|
43
|
-
if (!label) {
|
|
44
|
-
switch (unit) {
|
|
45
|
-
case "year":
|
|
46
|
-
label = `${value} ` + useLocale.$t(isPlural ? "hy.years" : "hy.year");
|
|
47
|
-
break;
|
|
48
|
-
case "month":
|
|
49
|
-
label = `${value} ` + useLocale.$t(isPlural ? "hy.months" : "hy.month");
|
|
50
|
-
break;
|
|
51
|
-
case "day":
|
|
52
|
-
default:
|
|
53
|
-
unit = "day";
|
|
54
|
-
label = value === 1 ? useLocale.$t("hy.today") : `${value} ` + useLocale.$t(isPlural ? "hy.days" : "hy.day");
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
list.push({ ...item, label, unit });
|
|
58
|
-
return list;
|
|
59
|
-
}, []);
|
|
60
|
-
};
|
|
61
34
|
function appSearchItemHandler(column = {}) {
|
|
62
35
|
const label = form.genColumnDefaultLabel(column);
|
|
63
36
|
const attrs = {
|
|
@@ -74,7 +47,7 @@ function appSearchItemHandler(column = {}) {
|
|
|
74
47
|
readonly: column.readonly || false,
|
|
75
48
|
width,
|
|
76
49
|
inputWidth,
|
|
77
|
-
timeRangeOptions:
|
|
50
|
+
timeRangeOptions: form.columnTimeRangeOptionsHandler(column),
|
|
78
51
|
attrs
|
|
79
52
|
}
|
|
80
53
|
);
|
|
@@ -439,7 +439,7 @@ const _sfc_main = {
|
|
|
439
439
|
key: cindex,
|
|
440
440
|
"is-always": "",
|
|
441
441
|
overLine: 1,
|
|
442
|
-
content: citem
|
|
442
|
+
content: vue.unref(index$1.operatorDescHandler)(citem, { column, row, $index, cellIndex })
|
|
443
443
|
}, {
|
|
444
444
|
default: vue.withCtx(() => [
|
|
445
445
|
vue.createElementVNode("div", {
|
|
@@ -458,13 +458,13 @@ const _sfc_main = {
|
|
|
458
458
|
"svg-name": citem.svgName,
|
|
459
459
|
"class-name": "!w-4 !h-4"
|
|
460
460
|
}, null, 8, ["svg-name"]),
|
|
461
|
-
citem
|
|
461
|
+
vue.unref(index$1.operatorLabelHandler)(citem, { column, row, $index, cellIndex }) ? (vue.openBlock(), vue.createElementBlock(
|
|
462
462
|
"div",
|
|
463
463
|
{
|
|
464
464
|
key: 0,
|
|
465
465
|
class: "mt-1 whitespace-nowrap"
|
|
466
466
|
},
|
|
467
|
-
vue.toDisplayString(
|
|
467
|
+
vue.toDisplayString(vue.unref(index$1.operatorLabelHandler)(citem, { column, row, $index, cellIndex })),
|
|
468
468
|
1
|
|
469
469
|
/* TEXT */
|
|
470
470
|
)) : (vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -527,7 +527,7 @@ const _sfc_main = {
|
|
|
527
527
|
vue.createElementVNode(
|
|
528
528
|
"span",
|
|
529
529
|
{ class: "pr-1" },
|
|
530
|
-
vue.toDisplayString(
|
|
530
|
+
vue.toDisplayString(vue.unref(index$1.operatorLabelHandler)(citem, { column, row, $index, cellIndex })),
|
|
531
531
|
1
|
|
532
532
|
/* TEXT */
|
|
533
533
|
),
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var lodashEs = require('lodash-es');
|
|
3
4
|
var vue = require('vue');
|
|
4
5
|
require('../../../hooks/index.js');
|
|
5
6
|
require('../../../utils/index.js');
|
|
@@ -85,6 +86,16 @@ function operatorShowHandler(operator, scope) {
|
|
|
85
86
|
if (is.isFunction(show)) return show(scope);
|
|
86
87
|
return true;
|
|
87
88
|
}
|
|
89
|
+
function operatorLabelHandler(operator, scope) {
|
|
90
|
+
const label = vue.unref(operator.label);
|
|
91
|
+
if (is.isFunction(label)) return label(scope);
|
|
92
|
+
return label || "";
|
|
93
|
+
}
|
|
94
|
+
function operatorDescHandler(operator, scope) {
|
|
95
|
+
const desc = vue.unref(operator.desc);
|
|
96
|
+
if (is.isFunction(desc)) return desc(scope);
|
|
97
|
+
return desc || "";
|
|
98
|
+
}
|
|
88
99
|
function operatorDisabledHandler(operator, scope) {
|
|
89
100
|
const { disabled } = operator;
|
|
90
101
|
if (is.isBoolean(disabled)) return disabled;
|
|
@@ -150,7 +161,23 @@ const useAppTableWrapper = (hy) => {
|
|
|
150
161
|
const tableColumns = vue.ref([]);
|
|
151
162
|
const tableColumnsEditablele = vue.ref({});
|
|
152
163
|
const tableColumnsList = vue.computed(() => {
|
|
153
|
-
|
|
164
|
+
let columnContentLength = 0;
|
|
165
|
+
const columns = tableColumns.value.filter((column) => {
|
|
166
|
+
const flag = tableColumnShowHandler(column);
|
|
167
|
+
if (flag && column.type === "default" && tableColumnsEditablele.value[column.prop]?.checked) {
|
|
168
|
+
columnContentLength++;
|
|
169
|
+
}
|
|
170
|
+
return flag;
|
|
171
|
+
});
|
|
172
|
+
if (columnContentLength <= 1) {
|
|
173
|
+
return columns.map(({ width, ...column }) => {
|
|
174
|
+
return {
|
|
175
|
+
...column,
|
|
176
|
+
width: column.type === "default" && tableColumnsEditablele.value[column.prop]?.checked ? void 0 : width
|
|
177
|
+
};
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
return columns;
|
|
154
181
|
});
|
|
155
182
|
const searchPlaceholder = vue.computed(() => {
|
|
156
183
|
const searchLabelSet = tableColumnsList.value.reduce((searchLabelSet2, column) => {
|
|
@@ -412,9 +439,22 @@ const useAppTableWrapper = (hy) => {
|
|
|
412
439
|
tableRef.value.setScrollLeft(left);
|
|
413
440
|
}
|
|
414
441
|
}
|
|
415
|
-
|
|
442
|
+
const onScrollHandler = lodashEs.debounce((params) => {
|
|
443
|
+
const { scrollTop } = params || {};
|
|
444
|
+
let clientHeight, scrollHeight;
|
|
445
|
+
if (props.type === "virtual") {
|
|
446
|
+
const wrapperEl = tableRef.value?.$el.querySelector(".hy-el-vl__wrapper");
|
|
447
|
+
clientHeight = wrapperEl?.clientHeight;
|
|
448
|
+
scrollHeight = wrapperEl?.firstChild.firstChild.scrollHeight;
|
|
449
|
+
} else {
|
|
450
|
+
clientHeight = tableRef.value?.$refs.bodyWrapper.clientHeight;
|
|
451
|
+
scrollHeight = tableRef.value?.$refs.tableBody.scrollHeight;
|
|
452
|
+
}
|
|
416
453
|
emits("scroll", params);
|
|
417
|
-
|
|
454
|
+
if (clientHeight && scrollHeight && scrollTop && clientHeight + Math.round(scrollTop) + 1 >= scrollHeight) {
|
|
455
|
+
emits("scrollBottom", params);
|
|
456
|
+
}
|
|
457
|
+
}, 250);
|
|
418
458
|
window.scrollToTop = scrollToTop;
|
|
419
459
|
vue.watchEffect(() => {
|
|
420
460
|
const { columnsList, columnsEditablele, searchText } = tableColumnHandler(props.tableColumns, CACHE_COLUMNS_KEY);
|
|
@@ -457,10 +497,12 @@ const useAppTableWrapper = (hy) => {
|
|
|
457
497
|
};
|
|
458
498
|
|
|
459
499
|
exports.operatorClickHandler = operatorClickHandler;
|
|
500
|
+
exports.operatorDescHandler = operatorDescHandler;
|
|
460
501
|
exports.operatorDisableTextdHandler = operatorDisableTextdHandler;
|
|
461
502
|
exports.operatorDisabledHandler = operatorDisabledHandler;
|
|
462
503
|
exports.operatorFilterHandler = operatorFilterHandler;
|
|
463
504
|
exports.operatorIsDotHandler = operatorIsDotHandler;
|
|
505
|
+
exports.operatorLabelHandler = operatorLabelHandler;
|
|
464
506
|
exports.renderContentHandler = renderContentHandler;
|
|
465
507
|
exports.renderHeaderHandler = renderHeaderHandler;
|
|
466
508
|
exports.tableColumnHandler = tableColumnHandler;
|