hy-dispatch-ui-v3 0.2.78 → 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 +4 -4
- package/es/components/hyDatePicker/datePicker.vue.mjs +34 -4
- package/es/components/hyForm/cpns/formItem.vue.mjs +71 -62
- package/es/components/hyForm/js/useAppForm.mjs +2 -1
- package/es/components/hySearch/js/useAppSearch.mjs +2 -29
- package/es/components/hyTable/js/search.mjs +1 -1
- package/es/components/hyTooltip/tooltip.vue.mjs +27 -17
- package/es/index.mjs +1 -1
- package/es/utils/form.mjs +26 -1
- package/es/utils/index.mjs +1 -1
- package/es/utils/is.mjs +1 -1
- package/es/utils/permission.mjs +3 -1
- package/es/version.mjs +1 -1
- package/lib/components/hyDatePicker/datePicker.vue.js +32 -2
- package/lib/components/hyForm/cpns/formItem.vue.js +70 -61
- package/lib/components/hyForm/js/useAppForm.js +1 -0
- package/lib/components/hySearch/js/useAppSearch.js +1 -28
- package/lib/components/hyTable/js/search.js +1 -1
- package/lib/components/hyTooltip/tooltip.vue.js +26 -16
- package/lib/index.js +1 -0
- package/lib/utils/form.js +26 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/is.js +1 -1
- package/lib/utils/permission.js +3 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
package/dist/tailwind.css
CHANGED
|
@@ -1027,10 +1027,6 @@
|
|
|
1027
1027
|
max-width: 200px;
|
|
1028
1028
|
}
|
|
1029
1029
|
|
|
1030
|
-
.max-w-\[300px\] {
|
|
1031
|
-
max-width: 300px;
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
1030
|
.max-w-full {
|
|
1035
1031
|
max-width: 100%;
|
|
1036
1032
|
}
|
|
@@ -1674,6 +1670,10 @@
|
|
|
1674
1670
|
padding-left: 52px;
|
|
1675
1671
|
}
|
|
1676
1672
|
|
|
1673
|
+
.pr-0 {
|
|
1674
|
+
padding-right: 0px;
|
|
1675
|
+
}
|
|
1676
|
+
|
|
1677
1677
|
.pr-1 {
|
|
1678
1678
|
padding-right: 0.25rem;
|
|
1679
1679
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, useModel, computed, watch, unref, openBlock, createBlock, mergeProps, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps, mergeModels } from 'vue';
|
|
1
|
+
import { defineComponent, useTemplateRef, useModel, computed, watch, ref, unref, openBlock, createBlock, mergeProps, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps, mergeModels } from 'vue';
|
|
2
|
+
import dayjs from 'dayjs';
|
|
2
3
|
import { ElDatePicker } from 'element-plus';
|
|
3
4
|
import '../../utils/index.mjs';
|
|
4
5
|
import '../../hooks/index.mjs';
|
|
5
6
|
import { $t } from '../../hooks/useLocale.mjs';
|
|
6
7
|
import { getDefaultValueFormatByType } from '../../utils/date.mjs';
|
|
7
|
-
import { isArray } from '../../utils/is.mjs';
|
|
8
|
+
import { isArray, isNumber, isFunction } from '../../utils/is.mjs';
|
|
8
9
|
|
|
9
10
|
import "./style/datePicker.scss";
|
|
10
11
|
|
|
@@ -33,7 +34,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
33
34
|
type: String
|
|
34
35
|
},
|
|
35
36
|
startPlaceholder: String,
|
|
36
|
-
endPlaceholder: String
|
|
37
|
+
endPlaceholder: String,
|
|
38
|
+
disabledDate: Function,
|
|
39
|
+
// 超出禁用天数
|
|
40
|
+
exceedDisableDays: Number
|
|
37
41
|
}, {
|
|
38
42
|
"modelValue": { type: [String, Date, Array] },
|
|
39
43
|
"modelModifiers": {},
|
|
@@ -111,6 +115,30 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
111
115
|
}
|
|
112
116
|
emits("change", dateValue.value);
|
|
113
117
|
}
|
|
118
|
+
const pickDate = ref();
|
|
119
|
+
const exceedDisableDays = computed(() => {
|
|
120
|
+
const val = Number(props.exceedDisableDays);
|
|
121
|
+
return isNumber(val) ? val : void 0;
|
|
122
|
+
});
|
|
123
|
+
const disabledDate = (date) => {
|
|
124
|
+
if (isFunction(props.disabledDate)) return props.disabledDate(date);
|
|
125
|
+
if (!pickDate.value || !isNumber(exceedDisableDays.value) || exceedDisableDays.value < 1) {
|
|
126
|
+
return false;
|
|
127
|
+
}
|
|
128
|
+
const minTime = dayjs(pickDate.value).subtract(exceedDisableDays.value - 1, "day");
|
|
129
|
+
const maxTime = dayjs(pickDate.value).add(exceedDisableDays.value - 1, "day");
|
|
130
|
+
return date.getTime() < minTime.valueOf() || date.getTime() > maxTime.valueOf();
|
|
131
|
+
};
|
|
132
|
+
function onCalendarChangeHandler(dates) {
|
|
133
|
+
if (!dates || !isNumber(exceedDisableDays.value) || exceedDisableDays.value < 1 || !["daterange", "datetimerange"].includes(props.type)) {
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
const [start, end] = dates;
|
|
137
|
+
pickDate.value = start ? start.getTime() : null;
|
|
138
|
+
if (end) {
|
|
139
|
+
pickDate.value = null;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
114
142
|
__expose({
|
|
115
143
|
focus() {
|
|
116
144
|
if (!unref(appDatePicker)) return;
|
|
@@ -142,7 +170,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
142
170
|
"start-placeholder": startPlaceholder.value,
|
|
143
171
|
"range-separator": unref($t)("datePicker.to"),
|
|
144
172
|
"end-placeholder": endPlaceholder.value,
|
|
145
|
-
|
|
173
|
+
disabledDate,
|
|
174
|
+
onChange: onChangeHandler,
|
|
175
|
+
onCalendarChange: onCalendarChangeHandler
|
|
146
176
|
}), createSlots({
|
|
147
177
|
_: 2
|
|
148
178
|
/* DYNAMIC */
|
|
@@ -6,7 +6,7 @@ import '../../index.mjs';
|
|
|
6
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, columnnoDataTextHandler, columnLabelHandler, columnRuleHandler, columnHelpHandler } from '../../../utils/form.mjs';
|
|
9
|
+
import { setValueByProp, getValueByProp, genColumnShortcuts, 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';
|
|
@@ -123,7 +123,8 @@ const _sfc_main = {
|
|
|
123
123
|
...attrs,
|
|
124
124
|
label: columnLabelHandler(props.column, props.model),
|
|
125
125
|
noDataText: columnnoDataTextHandler(props.column, props.model),
|
|
126
|
-
placeholder: columnPlaceholderHandler(props.column, props.model)
|
|
126
|
+
placeholder: columnPlaceholderHandler(props.column, props.model),
|
|
127
|
+
shortcuts: genColumnShortcuts(props.column)
|
|
127
128
|
};
|
|
128
129
|
});
|
|
129
130
|
async function obtainOptions(isMountedLoad = false) {
|
|
@@ -261,74 +262,82 @@ const _sfc_main = {
|
|
|
261
262
|
"show-message": showMessage.value
|
|
262
263
|
}, createSlots({
|
|
263
264
|
default: withCtx(() => [
|
|
264
|
-
createElementVNode(
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
toDisplayString(unref(columnLabelHandler)(__props.column, props.model) || "\xA0"),
|
|
274
|
-
1
|
|
275
|
-
/* TEXT */
|
|
276
|
-
)
|
|
277
|
-
])
|
|
278
|
-
]),
|
|
279
|
-
unref(isRequired)(props, __props.column) ? (openBlock(), createElementBlock("span", {
|
|
280
|
-
key: 0,
|
|
281
|
-
class: "label-required"
|
|
282
|
-
})) : createCommentVNode("v-if", true),
|
|
283
|
-
unref(columnHelpHandler)(props, __props.column) || __props.column.tooltipContentSlot ? (openBlock(), createBlock(unref(HyTooltip), {
|
|
284
|
-
key: 1,
|
|
285
|
-
"is-always": "",
|
|
286
|
-
overLine: 1
|
|
287
|
-
}, {
|
|
288
|
-
content: withCtx(() => [
|
|
289
|
-
!__props.column.tooltipContentSlot ? (openBlock(), createElementBlock(
|
|
290
|
-
"span",
|
|
291
|
-
{ key: 0 },
|
|
292
|
-
toDisplayString(unref(columnHelpHandler)(props, __props.column)),
|
|
293
|
-
1
|
|
294
|
-
/* TEXT */
|
|
295
|
-
)) : createCommentVNode("v-if", true),
|
|
296
|
-
renderSlot(_ctx.$slots, __props.column.tooltipContentSlot, {
|
|
265
|
+
createElementVNode(
|
|
266
|
+
"div",
|
|
267
|
+
{
|
|
268
|
+
class: normalizeClass(["w-full flex justify-between text-main", __props.column.labelClass])
|
|
269
|
+
},
|
|
270
|
+
[
|
|
271
|
+
createElementVNode("div", { class: "flex items-center" }, [
|
|
272
|
+
createElementVNode("span", { class: "text-main whitespace-nowrap" }, [
|
|
273
|
+
renderSlot(_ctx.$slots, __props.column.labelSlot, {
|
|
297
274
|
column: columnConfig.value,
|
|
298
275
|
model: __props.model,
|
|
299
276
|
required: unref(isRequired)(props, __props.column)
|
|
300
|
-
})
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
createElementVNode("span", { class: "text-xs text-theme ml-2" }, [
|
|
304
|
-
createVNode(unref(HyIcon), {
|
|
305
|
-
"svg-name": "dispatch-share-v3-base-help",
|
|
306
|
-
class: "!w-3 !h-3 mr-1"
|
|
307
|
-
}),
|
|
308
|
-
createElementVNode(
|
|
309
|
-
"span",
|
|
310
|
-
null,
|
|
311
|
-
toDisplayString(unref($t)("hy.help")),
|
|
277
|
+
}, () => [
|
|
278
|
+
createTextVNode(
|
|
279
|
+
toDisplayString(unref(columnLabelHandler)(__props.column, props.model) || "\xA0"),
|
|
312
280
|
1
|
|
313
281
|
/* TEXT */
|
|
314
282
|
)
|
|
315
283
|
])
|
|
316
284
|
]),
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
285
|
+
unref(isRequired)(props, __props.column) ? (openBlock(), createElementBlock("span", {
|
|
286
|
+
key: 0,
|
|
287
|
+
class: "label-required"
|
|
288
|
+
})) : createCommentVNode("v-if", true),
|
|
289
|
+
unref(columnHelpHandler)(props, __props.column) || __props.column.tooltipContentSlot ? (openBlock(), createBlock(unref(HyTooltip), {
|
|
290
|
+
key: 1,
|
|
291
|
+
"is-always": "",
|
|
292
|
+
overLine: 1
|
|
293
|
+
}, {
|
|
294
|
+
content: withCtx(() => [
|
|
295
|
+
!__props.column.tooltipContentSlot ? (openBlock(), createElementBlock(
|
|
296
|
+
"span",
|
|
297
|
+
{ key: 0 },
|
|
298
|
+
toDisplayString(unref(columnHelpHandler)(props, __props.column)),
|
|
299
|
+
1
|
|
300
|
+
/* TEXT */
|
|
301
|
+
)) : createCommentVNode("v-if", true),
|
|
302
|
+
renderSlot(_ctx.$slots, __props.column.tooltipContentSlot, {
|
|
303
|
+
column: columnConfig.value,
|
|
304
|
+
model: __props.model,
|
|
305
|
+
required: unref(isRequired)(props, __props.column)
|
|
306
|
+
})
|
|
307
|
+
]),
|
|
308
|
+
default: withCtx(() => [
|
|
309
|
+
createElementVNode("span", { class: "text-xs text-theme ml-2" }, [
|
|
310
|
+
createVNode(unref(HyIcon), {
|
|
311
|
+
"svg-name": "dispatch-share-v3-base-help",
|
|
312
|
+
class: "!w-3 !h-3 mr-1"
|
|
313
|
+
}),
|
|
314
|
+
createElementVNode(
|
|
315
|
+
"span",
|
|
316
|
+
null,
|
|
317
|
+
toDisplayString(unref($t)("hy.help")),
|
|
318
|
+
1
|
|
319
|
+
/* TEXT */
|
|
320
|
+
)
|
|
321
|
+
])
|
|
322
|
+
]),
|
|
323
|
+
_: 3
|
|
324
|
+
/* FORWARDED */
|
|
325
|
+
})) : createCommentVNode("v-if", true)
|
|
326
|
+
]),
|
|
327
|
+
__props.column.rightSlot && _ctx.$slots[__props.column.rightSlot] ? (openBlock(), createElementBlock("div", {
|
|
328
|
+
key: 0,
|
|
329
|
+
class: "ml-2 flex items-center"
|
|
330
|
+
}, [
|
|
331
|
+
renderSlot(_ctx.$slots, __props.column.rightSlot, {
|
|
332
|
+
column: columnConfig.value,
|
|
333
|
+
model: __props.model,
|
|
334
|
+
required: unref(isRequired)(props, __props.column)
|
|
335
|
+
})
|
|
336
|
+
])) : createCommentVNode("v-if", true)
|
|
337
|
+
],
|
|
338
|
+
2
|
|
339
|
+
/* CLASS */
|
|
340
|
+
),
|
|
332
341
|
unref(isReadonly)(props, __props.column) || !__props.column.type && !__props.column.slot ? (openBlock(), createElementBlock(
|
|
333
342
|
"div",
|
|
334
343
|
{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { unref, toRef } from 'vue';
|
|
2
2
|
import '../../../utils/index.mjs';
|
|
3
|
-
import { genColumnDefaultLabel, genValueByProp } from '../../../utils/form.mjs';
|
|
3
|
+
import { genColumnDefaultLabel, columnTimeRangeOptionsHandler, genValueByProp } from '../../../utils/form.mjs';
|
|
4
4
|
import { mergeDeep, funRunHandler } from '../../../utils/handler.mjs';
|
|
5
5
|
import { isArray } from '../../../utils/is.mjs';
|
|
6
6
|
|
|
@@ -15,6 +15,7 @@ function appFormItemHandler(column = {}) {
|
|
|
15
15
|
label,
|
|
16
16
|
readonly: column.readonly || false,
|
|
17
17
|
rules: column.rules,
|
|
18
|
+
timeRangeOptions: columnTimeRangeOptionsHandler(column),
|
|
18
19
|
attrs
|
|
19
20
|
}
|
|
20
21
|
);
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { unref, toRef } from 'vue';
|
|
2
2
|
import '../../../hooks/index.mjs';
|
|
3
3
|
import '../../../utils/index.mjs';
|
|
4
|
-
import {
|
|
5
|
-
import { $t } from '../../../hooks/useLocale.mjs';
|
|
6
|
-
import { genColumnDefaultLabel, genValueByProp } from '../../../utils/form.mjs';
|
|
4
|
+
import { genColumnDefaultLabel, columnTimeRangeOptionsHandler, genValueByProp } from '../../../utils/form.mjs';
|
|
7
5
|
import { mergeDeep, funRunHandler } from '../../../utils/handler.mjs';
|
|
8
6
|
|
|
9
7
|
const genColumnWidth = (config) => {
|
|
@@ -31,31 +29,6 @@ const genColumnWidth = (config) => {
|
|
|
31
29
|
}
|
|
32
30
|
return { width, inputWidth };
|
|
33
31
|
};
|
|
34
|
-
const timeRangeOptionsHandler = (config) => {
|
|
35
|
-
const { timeRangeOptions } = config || {};
|
|
36
|
-
if (!timeRangeOptions?.length) return timeRangeOptions;
|
|
37
|
-
return timeRangeOptions.reduce((list, item) => {
|
|
38
|
-
let { value, label, unit } = item;
|
|
39
|
-
if (!value || !isNumber(value) || isNaN(value)) return list;
|
|
40
|
-
const isPlural = value > 1;
|
|
41
|
-
if (!label) {
|
|
42
|
-
switch (unit) {
|
|
43
|
-
case "year":
|
|
44
|
-
label = $t("hy.lastDate", [value + $t(isPlural ? "hy.years" : "hy.year")]);
|
|
45
|
-
break;
|
|
46
|
-
case "month":
|
|
47
|
-
label = $t("hy.lastDate", [value + $t(isPlural ? "hy.months" : "hy.month")]);
|
|
48
|
-
break;
|
|
49
|
-
case "day":
|
|
50
|
-
default:
|
|
51
|
-
unit = "day";
|
|
52
|
-
label = value === 1 ? $t("hy.today") : $t("hy.lastDate", [value + $t(isPlural ? "hy.days" : "hy.day")]);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
list.push({ ...item, label, unit });
|
|
56
|
-
return list;
|
|
57
|
-
}, []);
|
|
58
|
-
};
|
|
59
32
|
function appSearchItemHandler(column = {}) {
|
|
60
33
|
const label = genColumnDefaultLabel(column);
|
|
61
34
|
const attrs = {
|
|
@@ -72,7 +45,7 @@ function appSearchItemHandler(column = {}) {
|
|
|
72
45
|
readonly: column.readonly || false,
|
|
73
46
|
width,
|
|
74
47
|
inputWidth,
|
|
75
|
-
timeRangeOptions:
|
|
48
|
+
timeRangeOptions: columnTimeRangeOptionsHandler(column),
|
|
76
49
|
attrs
|
|
77
50
|
}
|
|
78
51
|
);
|
|
@@ -46,7 +46,7 @@ function useAppTableSearch(hy) {
|
|
|
46
46
|
} else {
|
|
47
47
|
tableDataSource.value = data;
|
|
48
48
|
}
|
|
49
|
-
totalElements.value = res.data.totalElements;
|
|
49
|
+
totalElements.value = res.data.totalElements || data.length || 0;
|
|
50
50
|
hy.expandRowKeys.value = [];
|
|
51
51
|
emits("reqSuccess", tableDataSource.value);
|
|
52
52
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useModel, ref, computed, openBlock, createBlock, unref, mergeProps,
|
|
1
|
+
import { defineComponent, useModel, ref, computed, openBlock, createBlock, unref, mergeProps, withCtx, renderSlot, createTextVNode, toDisplayString, createElementBlock, normalizeStyle, normalizeClass, createElementVNode, mergeModels } from 'vue';
|
|
2
2
|
import { ElTooltip } from 'element-plus';
|
|
3
3
|
import '../../utils/index.mjs';
|
|
4
4
|
import '../../hooks/index.mjs';
|
|
@@ -37,6 +37,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
37
37
|
},
|
|
38
38
|
content: {
|
|
39
39
|
type: [String, Number]
|
|
40
|
+
},
|
|
41
|
+
maxWidth: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: "300px"
|
|
44
|
+
},
|
|
45
|
+
maxHeight: {
|
|
46
|
+
type: String
|
|
40
47
|
}
|
|
41
48
|
}, {
|
|
42
49
|
"modelValue": { type: Boolean, default: false },
|
|
@@ -72,11 +79,22 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
72
79
|
class: "item",
|
|
73
80
|
effect: "dark",
|
|
74
81
|
placement: "top",
|
|
75
|
-
"popper-class": "
|
|
76
|
-
}, _ctx.$attrs, {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
"popper-class": _ctx.$slots.content ? "" : "pr-0"
|
|
83
|
+
}, _ctx.$attrs, { disabled: isDisabled.value }), {
|
|
84
|
+
content: withCtx(() => [
|
|
85
|
+
renderSlot(_ctx.$slots, "content", {}, () => [
|
|
86
|
+
createElementVNode(
|
|
87
|
+
"div",
|
|
88
|
+
{
|
|
89
|
+
class: "scroll-body break-all overflow-y-auto pr-1",
|
|
90
|
+
style: normalizeStyle({ maxWidth: __props.maxWidth, maxHeight: __props.maxHeight })
|
|
91
|
+
},
|
|
92
|
+
toDisplayString(unref(isNumber)(__props.content) ? `${__props.content}` : __props.content),
|
|
93
|
+
5
|
|
94
|
+
/* TEXT, STYLE */
|
|
95
|
+
)
|
|
96
|
+
])
|
|
97
|
+
]),
|
|
80
98
|
default: withCtx(() => [
|
|
81
99
|
__props.isAlways ? renderSlot(_ctx.$slots, "default", {}, () => [
|
|
82
100
|
createTextVNode(
|
|
@@ -105,17 +123,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
105
123
|
/* CLASS, STYLE, NEED_HYDRATION */
|
|
106
124
|
))
|
|
107
125
|
]),
|
|
108
|
-
_:
|
|
109
|
-
/*
|
|
110
|
-
}, [
|
|
111
|
-
_ctx.$slots.content ? {
|
|
112
|
-
name: "content",
|
|
113
|
-
fn: withCtx(() => [
|
|
114
|
-
renderSlot(_ctx.$slots, "content")
|
|
115
|
-
]),
|
|
116
|
-
key: "0"
|
|
117
|
-
} : void 0
|
|
118
|
-
]), 1040, ["visible", "onUpdate:visible", "disabled", "content"]);
|
|
126
|
+
_: 3
|
|
127
|
+
/* FORWARDED */
|
|
128
|
+
}, 16, ["visible", "onUpdate:visible", "popper-class", "disabled"]);
|
|
119
129
|
};
|
|
120
130
|
}
|
|
121
131
|
});
|
package/es/index.mjs
CHANGED
|
@@ -53,7 +53,7 @@ export { base64Decrypt, encryptToBase64, generateRandomCode } from './utils/cryp
|
|
|
53
53
|
export { blobToDataURL, fileFormUpload, fileJsonUplaod, fileUpload, presignedUrl, sizeToTextHandler } from './utils/file.mjs';
|
|
54
54
|
export { bus, usePublish, useSubscribe } from './hooks/useSubscribe.mjs';
|
|
55
55
|
export { clearResizeObserver, useResizeObserver } from './hooks/useResizeObserver.mjs';
|
|
56
|
-
export { clearSpace, columnHelpHandler, columnLabelHandler, columnPlaceholderHandler, columnRuleHandler, columnnoDataTextHandler, genColumnDefaultLabel, genColumnShortcuts, genRuleRequiredMsgHandler, genValueByProp, getValueByProp, setValueByProp } from './utils/form.mjs';
|
|
56
|
+
export { clearSpace, columnHelpHandler, columnLabelHandler, columnPlaceholderHandler, columnRuleHandler, columnTimeRangeOptionsHandler, columnnoDataTextHandler, genColumnDefaultLabel, genColumnShortcuts, genRuleRequiredMsgHandler, genValueByProp, getValueByProp, setValueByProp } from './utils/form.mjs';
|
|
57
57
|
export { cloneDeep, copyText, createUniqueId, funRunHandler, mergeDeep, withInstall } from './utils/handler.mjs';
|
|
58
58
|
export { configProviderContextKey, provideGlobalConfig, useGlobalConfig } from './hooks/useGlobalConfig.mjs';
|
|
59
59
|
export { defaultAxios, localApiKey, useApi } from './hooks/useApi.mjs';
|
package/es/utils/form.mjs
CHANGED
|
@@ -169,6 +169,31 @@ function columnHelpHandler(props, column) {
|
|
|
169
169
|
if (isFunction(help)) return help(column, props.model);
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
|
+
function columnTimeRangeOptionsHandler(config) {
|
|
173
|
+
const { timeRangeOptions } = config || {};
|
|
174
|
+
if (!timeRangeOptions?.length) return timeRangeOptions;
|
|
175
|
+
return timeRangeOptions.reduce((list, item) => {
|
|
176
|
+
let { value, label, unit } = item;
|
|
177
|
+
if (!value || !isNumber(value) || isNaN(value)) return list;
|
|
178
|
+
const isPlural = value > 1;
|
|
179
|
+
if (!label) {
|
|
180
|
+
switch (unit) {
|
|
181
|
+
case "year":
|
|
182
|
+
label = $t("hy.lastDate", [value + $t(isPlural ? "hy.years" : "hy.year")]);
|
|
183
|
+
break;
|
|
184
|
+
case "month":
|
|
185
|
+
label = $t("hy.lastDate", [value + $t(isPlural ? "hy.months" : "hy.month")]);
|
|
186
|
+
break;
|
|
187
|
+
case "day":
|
|
188
|
+
default:
|
|
189
|
+
unit = "day";
|
|
190
|
+
label = value === 1 ? $t("hy.today") : $t("hy.lastDate", [value + $t(isPlural ? "hy.days" : "hy.day")]);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
list.push({ ...item, label, unit });
|
|
194
|
+
return list;
|
|
195
|
+
}, []);
|
|
196
|
+
}
|
|
172
197
|
function genColumnShortcuts(column) {
|
|
173
198
|
if (!["datetimerange", "daterange", "monthrange", "yearrange"].includes(column.attrs?.type) || !isArray(column.field) || !column.timeRangeOptions?.length) {
|
|
174
199
|
return;
|
|
@@ -209,4 +234,4 @@ function genColumnShortcuts(column) {
|
|
|
209
234
|
}
|
|
210
235
|
}
|
|
211
236
|
|
|
212
|
-
export { clearSpace, columnHelpHandler, columnLabelHandler, columnPlaceholderHandler, columnRuleHandler, columnnoDataTextHandler, genColumnDefaultLabel, genColumnShortcuts, genRuleRequiredMsgHandler, genValueByProp, getValueByProp, setValueByProp };
|
|
237
|
+
export { clearSpace, columnHelpHandler, columnLabelHandler, columnPlaceholderHandler, columnRuleHandler, columnTimeRangeOptionsHandler, columnnoDataTextHandler, genColumnDefaultLabel, genColumnShortcuts, genRuleRequiredMsgHandler, genValueByProp, getValueByProp, setValueByProp };
|
package/es/utils/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ export { isArray, isBoolean, isEmpty, isFile, isFunction, isNull, isNumber, isOb
|
|
|
4
4
|
export { cloneDeep, copyText, createUniqueId, funRunHandler, mergeDeep, withInstall } from './handler.mjs';
|
|
5
5
|
export { formatDuration, getDefaultValueFormatByType } from './date.mjs';
|
|
6
6
|
export { blobToDataURL, fileFormUpload, fileJsonUplaod, fileUpload, presignedUrl, sizeToTextHandler } from './file.mjs';
|
|
7
|
-
export { clearSpace, columnHelpHandler, columnLabelHandler, columnPlaceholderHandler, columnRuleHandler, columnnoDataTextHandler, genColumnDefaultLabel, genColumnShortcuts, genRuleRequiredMsgHandler, genValueByProp, getValueByProp, setValueByProp } from './form.mjs';
|
|
7
|
+
export { clearSpace, columnHelpHandler, columnLabelHandler, columnPlaceholderHandler, columnRuleHandler, columnTimeRangeOptionsHandler, columnnoDataTextHandler, genColumnDefaultLabel, genColumnShortcuts, genRuleRequiredMsgHandler, genValueByProp, getValueByProp, setValueByProp } from './form.mjs';
|
|
8
8
|
export { enterNumbersRrLetters, enterTheMumber, filterSpaces, formatTimeFn, getPublicFileSize, inputForbidden, keepTwoDecimalPlaces, onlyNumber } from './input.mjs';
|
|
9
9
|
export { PERMISSION } from './permission.mjs';
|
|
10
10
|
export { InitMap, setMapServer, setPoiServer } from './map/index.mjs';
|
package/es/utils/is.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { usePermissionMap } from '../hooks/usePermissionMap.mjs';
|
|
|
5
5
|
import { PERMISSION } from './permission.mjs';
|
|
6
6
|
|
|
7
7
|
const isString = (e) => typeof e === "string";
|
|
8
|
-
const isNumber = (e) => typeof e === "number";
|
|
8
|
+
const isNumber = (e) => typeof e === "number" && !isNaN(e);
|
|
9
9
|
const isObject = (e) => Object.prototype.toString.call(e) === "[object Object]";
|
|
10
10
|
const isFunction = (e) => typeof e === "function";
|
|
11
11
|
const isArray = (e) => Array.isArray(e);
|
package/es/utils/permission.mjs
CHANGED
|
@@ -492,7 +492,9 @@ const PERMISSION = {
|
|
|
492
492
|
// 区域管理
|
|
493
493
|
operator_areaManagement: "operator_areaManagement",
|
|
494
494
|
// 工单系统
|
|
495
|
-
headerNavigation_policeticketSyncShangrao: "headerNavigation_policeticketSyncShangrao"
|
|
495
|
+
headerNavigation_policeticketSyncShangrao: "headerNavigation_policeticketSyncShangrao",
|
|
496
|
+
// 采集站管理 - 非全链路模式 - 同步数据
|
|
497
|
+
operator_acquisitionStation_nonFullChainMode_manualDataSynchronization: "operator_acquisitionStation_nonFullChainMode_manualDataSynchronization"
|
|
496
498
|
};
|
|
497
499
|
|
|
498
500
|
export { PERMISSION };
|
package/es/version.mjs
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
|
+
var dayjs = require('dayjs');
|
|
6
7
|
var elementPlus = require('element-plus');
|
|
7
8
|
require('../../utils/index.js');
|
|
8
9
|
require('../../hooks/index.js');
|
|
@@ -37,7 +38,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
37
38
|
type: String
|
|
38
39
|
},
|
|
39
40
|
startPlaceholder: String,
|
|
40
|
-
endPlaceholder: String
|
|
41
|
+
endPlaceholder: String,
|
|
42
|
+
disabledDate: Function,
|
|
43
|
+
// 超出禁用天数
|
|
44
|
+
exceedDisableDays: Number
|
|
41
45
|
}, {
|
|
42
46
|
"modelValue": { type: [String, Date, Array] },
|
|
43
47
|
"modelModifiers": {},
|
|
@@ -115,6 +119,30 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
115
119
|
}
|
|
116
120
|
emits("change", dateValue.value);
|
|
117
121
|
}
|
|
122
|
+
const pickDate = vue.ref();
|
|
123
|
+
const exceedDisableDays = vue.computed(() => {
|
|
124
|
+
const val = Number(props.exceedDisableDays);
|
|
125
|
+
return is.isNumber(val) ? val : void 0;
|
|
126
|
+
});
|
|
127
|
+
const disabledDate = (date) => {
|
|
128
|
+
if (is.isFunction(props.disabledDate)) return props.disabledDate(date);
|
|
129
|
+
if (!pickDate.value || !is.isNumber(exceedDisableDays.value) || exceedDisableDays.value < 1) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
const minTime = dayjs(pickDate.value).subtract(exceedDisableDays.value - 1, "day");
|
|
133
|
+
const maxTime = dayjs(pickDate.value).add(exceedDisableDays.value - 1, "day");
|
|
134
|
+
return date.getTime() < minTime.valueOf() || date.getTime() > maxTime.valueOf();
|
|
135
|
+
};
|
|
136
|
+
function onCalendarChangeHandler(dates) {
|
|
137
|
+
if (!dates || !is.isNumber(exceedDisableDays.value) || exceedDisableDays.value < 1 || !["daterange", "datetimerange"].includes(props.type)) {
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
const [start, end] = dates;
|
|
141
|
+
pickDate.value = start ? start.getTime() : null;
|
|
142
|
+
if (end) {
|
|
143
|
+
pickDate.value = null;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
118
146
|
__expose({
|
|
119
147
|
focus() {
|
|
120
148
|
if (!vue.unref(appDatePicker)) return;
|
|
@@ -146,7 +174,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
146
174
|
"start-placeholder": startPlaceholder.value,
|
|
147
175
|
"range-separator": vue.unref(useLocale.$t)("datePicker.to"),
|
|
148
176
|
"end-placeholder": endPlaceholder.value,
|
|
149
|
-
|
|
177
|
+
disabledDate,
|
|
178
|
+
onChange: onChangeHandler,
|
|
179
|
+
onCalendarChange: onCalendarChangeHandler
|
|
150
180
|
}), vue.createSlots({
|
|
151
181
|
_: 2
|
|
152
182
|
/* DYNAMIC */
|
|
@@ -127,7 +127,8 @@ const _sfc_main = {
|
|
|
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)
|
|
130
|
+
placeholder: form.columnPlaceholderHandler(props.column, props.model),
|
|
131
|
+
shortcuts: form.genColumnShortcuts(props.column)
|
|
131
132
|
};
|
|
132
133
|
});
|
|
133
134
|
async function obtainOptions(isMountedLoad = false) {
|
|
@@ -265,74 +266,82 @@ const _sfc_main = {
|
|
|
265
266
|
"show-message": showMessage.value
|
|
266
267
|
}, vue.createSlots({
|
|
267
268
|
default: vue.withCtx(() => [
|
|
268
|
-
vue.createElementVNode(
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
vue.
|
|
277
|
-
vue.toDisplayString(vue.unref(form.columnLabelHandler)(__props.column, props.model) || "\xA0"),
|
|
278
|
-
1
|
|
279
|
-
/* TEXT */
|
|
280
|
-
)
|
|
281
|
-
])
|
|
282
|
-
]),
|
|
283
|
-
vue.unref(index.isRequired)(props, __props.column) ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
284
|
-
key: 0,
|
|
285
|
-
class: "label-required"
|
|
286
|
-
})) : vue.createCommentVNode("v-if", true),
|
|
287
|
-
vue.unref(form.columnHelpHandler)(props, __props.column) || __props.column.tooltipContentSlot ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.HyTooltip), {
|
|
288
|
-
key: 1,
|
|
289
|
-
"is-always": "",
|
|
290
|
-
overLine: 1
|
|
291
|
-
}, {
|
|
292
|
-
content: vue.withCtx(() => [
|
|
293
|
-
!__props.column.tooltipContentSlot ? (vue.openBlock(), vue.createElementBlock(
|
|
294
|
-
"span",
|
|
295
|
-
{ key: 0 },
|
|
296
|
-
vue.toDisplayString(vue.unref(form.columnHelpHandler)(props, __props.column)),
|
|
297
|
-
1
|
|
298
|
-
/* TEXT */
|
|
299
|
-
)) : vue.createCommentVNode("v-if", true),
|
|
300
|
-
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, {
|
|
301
278
|
column: columnConfig.value,
|
|
302
279
|
model: __props.model,
|
|
303
280
|
required: vue.unref(index.isRequired)(props, __props.column)
|
|
304
|
-
})
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
vue.createElementVNode("span", { class: "text-xs text-theme ml-2" }, [
|
|
308
|
-
vue.createVNode(vue.unref(index$2.HyIcon), {
|
|
309
|
-
"svg-name": "dispatch-share-v3-base-help",
|
|
310
|
-
class: "!w-3 !h-3 mr-1"
|
|
311
|
-
}),
|
|
312
|
-
vue.createElementVNode(
|
|
313
|
-
"span",
|
|
314
|
-
null,
|
|
315
|
-
vue.toDisplayString(vue.unref(useLocale.$t)("hy.help")),
|
|
281
|
+
}, () => [
|
|
282
|
+
vue.createTextVNode(
|
|
283
|
+
vue.toDisplayString(vue.unref(form.columnLabelHandler)(__props.column, props.model) || "\xA0"),
|
|
316
284
|
1
|
|
317
285
|
/* TEXT */
|
|
318
286
|
)
|
|
319
287
|
])
|
|
320
288
|
]),
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
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
|
+
),
|
|
336
345
|
vue.unref(index.isReadonly)(props, __props.column) || !__props.column.type && !__props.column.slot ? (vue.openBlock(), vue.createElementBlock(
|
|
337
346
|
"div",
|
|
338
347
|
{
|
|
@@ -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 = useLocale.$t("hy.lastDate", [value + useLocale.$t(isPlural ? "hy.years" : "hy.year")]);
|
|
47
|
-
break;
|
|
48
|
-
case "month":
|
|
49
|
-
label = useLocale.$t("hy.lastDate", [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") : useLocale.$t("hy.lastDate", [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
|
);
|
|
@@ -48,7 +48,7 @@ function useAppTableSearch(hy) {
|
|
|
48
48
|
} else {
|
|
49
49
|
tableDataSource.value = data;
|
|
50
50
|
}
|
|
51
|
-
totalElements.value = res.data.totalElements;
|
|
51
|
+
totalElements.value = res.data.totalElements || data.length || 0;
|
|
52
52
|
hy.expandRowKeys.value = [];
|
|
53
53
|
emits("reqSuccess", tableDataSource.value);
|
|
54
54
|
}
|
|
@@ -41,6 +41,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
41
41
|
},
|
|
42
42
|
content: {
|
|
43
43
|
type: [String, Number]
|
|
44
|
+
},
|
|
45
|
+
maxWidth: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: "300px"
|
|
48
|
+
},
|
|
49
|
+
maxHeight: {
|
|
50
|
+
type: String
|
|
44
51
|
}
|
|
45
52
|
}, {
|
|
46
53
|
"modelValue": { type: Boolean, default: false },
|
|
@@ -76,11 +83,22 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
76
83
|
class: "item",
|
|
77
84
|
effect: "dark",
|
|
78
85
|
placement: "top",
|
|
79
|
-
"popper-class": "
|
|
80
|
-
}, _ctx.$attrs, {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
"popper-class": _ctx.$slots.content ? "" : "pr-0"
|
|
87
|
+
}, _ctx.$attrs, { disabled: isDisabled.value }), {
|
|
88
|
+
content: vue.withCtx(() => [
|
|
89
|
+
vue.renderSlot(_ctx.$slots, "content", {}, () => [
|
|
90
|
+
vue.createElementVNode(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
class: "scroll-body break-all overflow-y-auto pr-1",
|
|
94
|
+
style: vue.normalizeStyle({ maxWidth: __props.maxWidth, maxHeight: __props.maxHeight })
|
|
95
|
+
},
|
|
96
|
+
vue.toDisplayString(vue.unref(is.isNumber)(__props.content) ? `${__props.content}` : __props.content),
|
|
97
|
+
5
|
|
98
|
+
/* TEXT, STYLE */
|
|
99
|
+
)
|
|
100
|
+
])
|
|
101
|
+
]),
|
|
84
102
|
default: vue.withCtx(() => [
|
|
85
103
|
__props.isAlways ? vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
86
104
|
vue.createTextVNode(
|
|
@@ -109,17 +127,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
109
127
|
/* CLASS, STYLE, NEED_HYDRATION */
|
|
110
128
|
))
|
|
111
129
|
]),
|
|
112
|
-
_:
|
|
113
|
-
/*
|
|
114
|
-
}, [
|
|
115
|
-
_ctx.$slots.content ? {
|
|
116
|
-
name: "content",
|
|
117
|
-
fn: vue.withCtx(() => [
|
|
118
|
-
vue.renderSlot(_ctx.$slots, "content")
|
|
119
|
-
]),
|
|
120
|
-
key: "0"
|
|
121
|
-
} : void 0
|
|
122
|
-
]), 1040, ["visible", "onUpdate:visible", "disabled", "content"]);
|
|
130
|
+
_: 3
|
|
131
|
+
/* FORWARDED */
|
|
132
|
+
}, 16, ["visible", "onUpdate:visible", "popper-class", "disabled"]);
|
|
123
133
|
};
|
|
124
134
|
}
|
|
125
135
|
});
|
package/lib/index.js
CHANGED
|
@@ -184,6 +184,7 @@ exports.columnHelpHandler = form.columnHelpHandler;
|
|
|
184
184
|
exports.columnLabelHandler = form.columnLabelHandler;
|
|
185
185
|
exports.columnPlaceholderHandler = form.columnPlaceholderHandler;
|
|
186
186
|
exports.columnRuleHandler = form.columnRuleHandler;
|
|
187
|
+
exports.columnTimeRangeOptionsHandler = form.columnTimeRangeOptionsHandler;
|
|
187
188
|
exports.columnnoDataTextHandler = form.columnnoDataTextHandler;
|
|
188
189
|
exports.genColumnDefaultLabel = form.genColumnDefaultLabel;
|
|
189
190
|
exports.genColumnShortcuts = form.genColumnShortcuts;
|
package/lib/utils/form.js
CHANGED
|
@@ -171,6 +171,31 @@ function columnHelpHandler(props, column) {
|
|
|
171
171
|
if (is.isFunction(help)) return help(column, props.model);
|
|
172
172
|
return;
|
|
173
173
|
}
|
|
174
|
+
function columnTimeRangeOptionsHandler(config) {
|
|
175
|
+
const { timeRangeOptions } = config || {};
|
|
176
|
+
if (!timeRangeOptions?.length) return timeRangeOptions;
|
|
177
|
+
return timeRangeOptions.reduce((list, item) => {
|
|
178
|
+
let { value, label, unit } = item;
|
|
179
|
+
if (!value || !is.isNumber(value) || isNaN(value)) return list;
|
|
180
|
+
const isPlural = value > 1;
|
|
181
|
+
if (!label) {
|
|
182
|
+
switch (unit) {
|
|
183
|
+
case "year":
|
|
184
|
+
label = useLocale.$t("hy.lastDate", [value + useLocale.$t(isPlural ? "hy.years" : "hy.year")]);
|
|
185
|
+
break;
|
|
186
|
+
case "month":
|
|
187
|
+
label = useLocale.$t("hy.lastDate", [value + useLocale.$t(isPlural ? "hy.months" : "hy.month")]);
|
|
188
|
+
break;
|
|
189
|
+
case "day":
|
|
190
|
+
default:
|
|
191
|
+
unit = "day";
|
|
192
|
+
label = value === 1 ? useLocale.$t("hy.today") : useLocale.$t("hy.lastDate", [value + useLocale.$t(isPlural ? "hy.days" : "hy.day")]);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
list.push({ ...item, label, unit });
|
|
196
|
+
return list;
|
|
197
|
+
}, []);
|
|
198
|
+
}
|
|
174
199
|
function genColumnShortcuts(column) {
|
|
175
200
|
if (!["datetimerange", "daterange", "monthrange", "yearrange"].includes(column.attrs?.type) || !is.isArray(column.field) || !column.timeRangeOptions?.length) {
|
|
176
201
|
return;
|
|
@@ -216,6 +241,7 @@ exports.columnHelpHandler = columnHelpHandler;
|
|
|
216
241
|
exports.columnLabelHandler = columnLabelHandler;
|
|
217
242
|
exports.columnPlaceholderHandler = columnPlaceholderHandler;
|
|
218
243
|
exports.columnRuleHandler = columnRuleHandler;
|
|
244
|
+
exports.columnTimeRangeOptionsHandler = columnTimeRangeOptionsHandler;
|
|
219
245
|
exports.columnnoDataTextHandler = columnnoDataTextHandler;
|
|
220
246
|
exports.genColumnDefaultLabel = genColumnDefaultLabel;
|
|
221
247
|
exports.genColumnShortcuts = genColumnShortcuts;
|
package/lib/utils/index.js
CHANGED
|
@@ -58,6 +58,7 @@ exports.columnHelpHandler = form.columnHelpHandler;
|
|
|
58
58
|
exports.columnLabelHandler = form.columnLabelHandler;
|
|
59
59
|
exports.columnPlaceholderHandler = form.columnPlaceholderHandler;
|
|
60
60
|
exports.columnRuleHandler = form.columnRuleHandler;
|
|
61
|
+
exports.columnTimeRangeOptionsHandler = form.columnTimeRangeOptionsHandler;
|
|
61
62
|
exports.columnnoDataTextHandler = form.columnnoDataTextHandler;
|
|
62
63
|
exports.genColumnDefaultLabel = form.genColumnDefaultLabel;
|
|
63
64
|
exports.genColumnShortcuts = form.genColumnShortcuts;
|
package/lib/utils/is.js
CHANGED
|
@@ -7,7 +7,7 @@ var usePermissionMap = require('../hooks/usePermissionMap.js');
|
|
|
7
7
|
var permission = require('./permission.js');
|
|
8
8
|
|
|
9
9
|
const isString = (e) => typeof e === "string";
|
|
10
|
-
const isNumber = (e) => typeof e === "number";
|
|
10
|
+
const isNumber = (e) => typeof e === "number" && !isNaN(e);
|
|
11
11
|
const isObject = (e) => Object.prototype.toString.call(e) === "[object Object]";
|
|
12
12
|
const isFunction = (e) => typeof e === "function";
|
|
13
13
|
const isArray = (e) => Array.isArray(e);
|
package/lib/utils/permission.js
CHANGED
|
@@ -494,7 +494,9 @@ const PERMISSION = {
|
|
|
494
494
|
// 区域管理
|
|
495
495
|
operator_areaManagement: "operator_areaManagement",
|
|
496
496
|
// 工单系统
|
|
497
|
-
headerNavigation_policeticketSyncShangrao: "headerNavigation_policeticketSyncShangrao"
|
|
497
|
+
headerNavigation_policeticketSyncShangrao: "headerNavigation_policeticketSyncShangrao",
|
|
498
|
+
// 采集站管理 - 非全链路模式 - 同步数据
|
|
499
|
+
operator_acquisitionStation_nonFullChainMode_manualDataSynchronization: "operator_acquisitionStation_nonFullChainMode_manualDataSynchronization"
|
|
498
500
|
};
|
|
499
501
|
|
|
500
502
|
exports.PERMISSION = PERMISSION;
|
package/lib/version.js
CHANGED