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.
Files changed (139) hide show
  1. package/dist/tailwind.css +95 -12
  2. package/es/api/common.mjs +28 -0
  3. package/es/bussiness/hyDepartmentTypeOperation/departmentTypeOperation2.vue.mjs +5 -8
  4. package/es/bussiness/hyDepartmentTypeOperation/departmentTypeOperation_tiantong2.vue.mjs +108 -125
  5. package/es/bussiness/hyDepartmentTypeOperation/locale/en_US.mjs +7 -7
  6. package/es/bussiness/hyDepartmentTypeOperation/locale/zh_CN.mjs +6 -6
  7. package/es/bussiness/hyDisplayQueryAddress/displayQueryAddress.vue.mjs +5 -0
  8. package/es/bussiness/hyDisplayQueryAddress/displayQueryAddress2.install.mjs +6 -0
  9. package/es/bussiness/hyDisplayQueryAddress/displayQueryAddress2.vue.mjs +182 -0
  10. package/es/bussiness/hyDisplayQueryAddress/index.mjs +8 -0
  11. package/es/bussiness/hyDisplayQueryAddress/locale/en_US.mjs +7 -0
  12. package/es/bussiness/hyDisplayQueryAddress/locale/index.mjs +2 -0
  13. package/es/bussiness/hyDisplayQueryAddress/locale/zh_CN.mjs +7 -0
  14. package/es/bussiness/hyDisplayQueryAddress/style/dialog.scss +0 -0
  15. package/es/bussiness/hyFilePlayback/cpns/audioDetail.vue.mjs +5 -0
  16. package/es/bussiness/hyFilePlayback/cpns/audioDetail2.install.mjs +6 -0
  17. package/es/bussiness/hyFilePlayback/cpns/audioDetail2.vue.mjs +247 -0
  18. package/es/bussiness/hyFilePlayback/cpns/picDetail.vue.mjs +5 -0
  19. package/es/bussiness/hyFilePlayback/cpns/picDetail2.install.mjs +6 -0
  20. package/es/bussiness/hyFilePlayback/cpns/picDetail2.vue.mjs +206 -0
  21. package/es/bussiness/hyFilePlayback/cpns/videoDetail.vue.mjs +5 -0
  22. package/es/bussiness/hyFilePlayback/cpns/videoDetail2.install.mjs +6 -0
  23. package/es/bussiness/hyFilePlayback/cpns/videoDetail2.vue.mjs +238 -0
  24. package/es/bussiness/hyFilePlayback/filePlayback.vue.mjs +5 -0
  25. package/es/bussiness/hyFilePlayback/filePlayback2.install.mjs +6 -0
  26. package/es/bussiness/hyFilePlayback/filePlayback2.vue.mjs +166 -0
  27. package/es/bussiness/hyFilePlayback/index.mjs +8 -0
  28. package/es/bussiness/hyFilePlayback/locale/en_US.mjs +22 -0
  29. package/es/bussiness/hyFilePlayback/locale/index.mjs +2 -0
  30. package/es/bussiness/hyFilePlayback/locale/zh_CN.mjs +22 -0
  31. package/es/bussiness/hyFilePlayback/style/filePlayback.scss +2 -0
  32. package/es/bussiness/index.mjs +2 -0
  33. package/es/components/hyCutter/cutter.vue.mjs +2 -2
  34. package/es/components/hyDatePicker/datePicker.vue.mjs +34 -4
  35. package/es/components/hyForm/cpns/arrayItem.vue.mjs +2 -2
  36. package/es/components/hyForm/cpns/formItem.vue.mjs +73 -63
  37. package/es/components/hyForm/js/index.mjs +2 -8
  38. package/es/components/hyForm/js/useAppForm.mjs +2 -1
  39. package/es/components/hySearch/cpns/searchItem.vue.mjs +57 -67
  40. package/es/components/hySearch/js/index.mjs +1 -35
  41. package/es/components/hySearch/js/useAppSearch.mjs +2 -29
  42. package/es/components/hySearch/style/search.scss +1 -0
  43. package/es/components/hyTable/cpns/virtualTable.vue.mjs +5 -5
  44. package/es/components/hyTable/js/index.mjs +44 -4
  45. package/es/components/hyTable/js/search.mjs +1 -7
  46. package/es/components/hyTable/table.vue.mjs +47 -30
  47. package/es/components/hyTooltip/tooltip.vue.mjs +39 -21
  48. package/es/components/hyUserAvatar/userAvatar.vue.mjs +1 -1
  49. package/es/components/hyVideoPlayer/videoPlayer.vue.mjs +3 -3
  50. package/es/components-map.mjs +2 -0
  51. package/es/hooks/useBaseMainStore.mjs +16 -5
  52. package/es/hooks/useCurrentBus.mjs +5 -4
  53. package/es/hooks/useDialog.mjs +2 -2
  54. package/es/hooks/useGlobalConfig.mjs +19 -18
  55. package/es/index.mjs +5 -2
  56. package/es/locale/en_US.mjs +1 -0
  57. package/es/locale/zh_CN.mjs +1 -0
  58. package/es/style/index.scss +2 -2
  59. package/es/utils/file.mjs +1 -2
  60. package/es/utils/form.mjs +84 -5
  61. package/es/utils/index.mjs +3 -2
  62. package/es/utils/is.mjs +1 -1
  63. package/es/utils/map/hook/leafletjs.mjs +4 -0
  64. package/es/utils/map/index.mjs +4 -0
  65. package/es/utils/permission.mjs +3 -1
  66. package/es/utils/timeUtils.mjs +95 -0
  67. package/es/version.mjs +1 -1
  68. package/lib/api/common.js +33 -0
  69. package/lib/bussiness/hyDepartmentTypeOperation/departmentTypeOperation2.vue.js +3 -6
  70. package/lib/bussiness/hyDepartmentTypeOperation/departmentTypeOperation_tiantong2.vue.js +107 -124
  71. package/lib/bussiness/hyDepartmentTypeOperation/locale/en_US.js +7 -7
  72. package/lib/bussiness/hyDepartmentTypeOperation/locale/zh_CN.js +6 -6
  73. package/lib/bussiness/hyDisplayQueryAddress/displayQueryAddress.install.js +6 -0
  74. package/lib/bussiness/hyDisplayQueryAddress/displayQueryAddress.vue.js +9 -0
  75. package/lib/bussiness/hyDisplayQueryAddress/displayQueryAddress2.install.js +6 -0
  76. package/lib/bussiness/hyDisplayQueryAddress/displayQueryAddress2.vue.js +186 -0
  77. package/lib/bussiness/hyDisplayQueryAddress/index.js +13 -0
  78. package/lib/bussiness/hyDisplayQueryAddress/locale/en_US.js +11 -0
  79. package/lib/bussiness/hyDisplayQueryAddress/locale/index.js +9 -0
  80. package/lib/bussiness/hyDisplayQueryAddress/locale/zh_CN.js +11 -0
  81. package/lib/bussiness/hyDisplayQueryAddress/style/dialog.scss +0 -0
  82. package/lib/bussiness/hyFilePlayback/cpns/audioDetail.install.js +6 -0
  83. package/lib/bussiness/hyFilePlayback/cpns/audioDetail.vue.js +9 -0
  84. package/lib/bussiness/hyFilePlayback/cpns/audioDetail2.install.js +6 -0
  85. package/lib/bussiness/hyFilePlayback/cpns/audioDetail2.vue.js +251 -0
  86. package/lib/bussiness/hyFilePlayback/cpns/picDetail.install.js +6 -0
  87. package/lib/bussiness/hyFilePlayback/cpns/picDetail.vue.js +9 -0
  88. package/lib/bussiness/hyFilePlayback/cpns/picDetail2.install.js +6 -0
  89. package/lib/bussiness/hyFilePlayback/cpns/picDetail2.vue.js +210 -0
  90. package/lib/bussiness/hyFilePlayback/cpns/videoDetail.install.js +6 -0
  91. package/lib/bussiness/hyFilePlayback/cpns/videoDetail.vue.js +9 -0
  92. package/lib/bussiness/hyFilePlayback/cpns/videoDetail2.install.js +6 -0
  93. package/lib/bussiness/hyFilePlayback/cpns/videoDetail2.vue.js +242 -0
  94. package/lib/bussiness/hyFilePlayback/filePlayback.install.js +6 -0
  95. package/lib/bussiness/hyFilePlayback/filePlayback.vue.js +9 -0
  96. package/lib/bussiness/hyFilePlayback/filePlayback2.install.js +6 -0
  97. package/lib/bussiness/hyFilePlayback/filePlayback2.vue.js +170 -0
  98. package/lib/bussiness/hyFilePlayback/index.js +13 -0
  99. package/lib/bussiness/hyFilePlayback/locale/en_US.js +26 -0
  100. package/lib/bussiness/hyFilePlayback/locale/index.js +9 -0
  101. package/lib/bussiness/hyFilePlayback/locale/zh_CN.js +26 -0
  102. package/lib/bussiness/hyFilePlayback/style/filePlayback.scss +2 -0
  103. package/lib/bussiness/index.js +18 -14
  104. package/lib/components/hyCutter/cutter.vue.js +2 -2
  105. package/lib/components/hyDatePicker/datePicker.vue.js +32 -2
  106. package/lib/components/hyForm/cpns/arrayItem.vue.js +2 -2
  107. package/lib/components/hyForm/cpns/formItem.vue.js +71 -61
  108. package/lib/components/hyForm/js/index.js +0 -7
  109. package/lib/components/hyForm/js/useAppForm.js +1 -0
  110. package/lib/components/hySearch/cpns/searchItem.vue.js +64 -74
  111. package/lib/components/hySearch/js/index.js +0 -36
  112. package/lib/components/hySearch/js/useAppSearch.js +1 -28
  113. package/lib/components/hySearch/style/search.scss +1 -0
  114. package/lib/components/hyTable/cpns/virtualTable.vue.js +4 -4
  115. package/lib/components/hyTable/js/index.js +45 -3
  116. package/lib/components/hyTable/js/search.js +1 -7
  117. package/lib/components/hyTable/table.vue.js +46 -29
  118. package/lib/components/hyTooltip/tooltip.vue.js +38 -20
  119. package/lib/components/hyUserAvatar/userAvatar.vue.js +1 -1
  120. package/lib/components/hyVideoPlayer/videoPlayer.vue.js +3 -3
  121. package/lib/components-map.js +2 -0
  122. package/lib/hooks/useBaseMainStore.js +15 -4
  123. package/lib/hooks/useCurrentBus.js +4 -3
  124. package/lib/hooks/useDialog.js +2 -2
  125. package/lib/hooks/useGlobalConfig.js +18 -17
  126. package/lib/index.js +71 -55
  127. package/lib/locale/en_US.js +1 -0
  128. package/lib/locale/zh_CN.js +1 -0
  129. package/lib/style/index.scss +2 -2
  130. package/lib/utils/file.js +1 -2
  131. package/lib/utils/form.js +87 -4
  132. package/lib/utils/index.js +13 -1
  133. package/lib/utils/is.js +1 -1
  134. package/lib/utils/map/hook/leafletjs.js +4 -0
  135. package/lib/utils/map/index.js +4 -0
  136. package/lib/utils/permission.js +3 -1
  137. package/lib/utils/timeUtils.js +105 -0
  138. package/lib/version.js +1 -1
  139. 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 };
@@ -0,0 +1,2 @@
1
+ .filePlayback{
2
+ }
@@ -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) => {
@@ -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
- onChange: onChangeHandler
173
+ disabledDate,
174
+ onChange: onChangeHandler,
175
+ onCalendarChange: onCalendarChangeHandler
146
176
  }), createSlots({
147
177
  _: 2
148
178
  /* DYNAMIC */
@@ -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, columnHelpHandler, renderArrayItemLabel, renderAddLabel } from '../js/index.mjs';
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, columnHelpHandler, isReadonly, renderText, isDisabled } from '../js/index.mjs';
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, 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';
@@ -122,7 +122,9 @@ const _sfc_main = {
122
122
  ...config,
123
123
  ...attrs,
124
124
  label: columnLabelHandler(props.column, props.model),
125
- placeholder: columnPlaceholderHandler(props.column, props.model)
125
+ noDataText: columnnoDataTextHandler(props.column, props.model),
126
+ placeholder: columnPlaceholderHandler(props.column, props.model),
127
+ shortcuts: genColumnShortcuts(props.column)
126
128
  };
127
129
  });
128
130
  async function obtainOptions(isMountedLoad = false) {
@@ -260,74 +262,82 @@ const _sfc_main = {
260
262
  "show-message": showMessage.value
261
263
  }, createSlots({
262
264
  default: withCtx(() => [
263
- createElementVNode("div", { class: "w-full flex justify-between text-main" }, [
264
- createElementVNode("div", { class: "flex items-center" }, [
265
- createElementVNode("span", { class: "text-main whitespace-nowrap" }, [
266
- renderSlot(_ctx.$slots, __props.column.labelSlot, {
267
- column: columnConfig.value,
268
- model: __props.model,
269
- required: unref(isRequired)(props, __props.column)
270
- }, () => [
271
- createTextVNode(
272
- toDisplayString(unref(columnLabelHandler)(__props.column, props.model) || "\xA0"),
273
- 1
274
- /* TEXT */
275
- )
276
- ])
277
- ]),
278
- unref(isRequired)(props, __props.column) ? (openBlock(), createElementBlock("span", {
279
- key: 0,
280
- class: "label-required"
281
- })) : createCommentVNode("v-if", true),
282
- unref(columnHelpHandler)(props, __props.column) || __props.column.tooltipContentSlot ? (openBlock(), createBlock(unref(HyTooltip), {
283
- key: 1,
284
- "is-always": "",
285
- overLine: 1
286
- }, {
287
- content: withCtx(() => [
288
- !__props.column.tooltipContentSlot ? (openBlock(), createElementBlock(
289
- "span",
290
- { key: 0 },
291
- toDisplayString(unref(columnHelpHandler)(props, __props.column)),
292
- 1
293
- /* TEXT */
294
- )) : createCommentVNode("v-if", true),
295
- 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, {
296
274
  column: columnConfig.value,
297
275
  model: __props.model,
298
276
  required: unref(isRequired)(props, __props.column)
299
- })
300
- ]),
301
- default: withCtx(() => [
302
- createElementVNode("span", { class: "text-xs text-theme ml-2" }, [
303
- createVNode(unref(HyIcon), {
304
- "svg-name": "dispatch-share-v3-base-help",
305
- class: "!w-3 !h-3 mr-1"
306
- }),
307
- createElementVNode(
308
- "span",
309
- null,
310
- toDisplayString(unref($t)("hy.help")),
277
+ }, () => [
278
+ createTextVNode(
279
+ toDisplayString(unref(columnLabelHandler)(__props.column, props.model) || "\xA0"),
311
280
  1
312
281
  /* TEXT */
313
282
  )
314
283
  ])
315
284
  ]),
316
- _: 3
317
- /* FORWARDED */
318
- })) : createCommentVNode("v-if", true)
319
- ]),
320
- __props.column.rightSlot && _ctx.$slots[__props.column.rightSlot] ? (openBlock(), createElementBlock("div", {
321
- key: 0,
322
- class: "ml-2 flex items-center"
323
- }, [
324
- renderSlot(_ctx.$slots, __props.column.rightSlot, {
325
- column: columnConfig.value,
326
- model: __props.model,
327
- required: unref(isRequired)(props, __props.column)
328
- })
329
- ])) : createCommentVNode("v-if", true)
330
- ]),
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
+ ),
331
341
  unref(isReadonly)(props, __props.column) || !__props.column.type && !__props.column.slot ? (openBlock(), createElementBlock(
332
342
  "div",
333
343
  {
@@ -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, isString, isArray, isObject } from '../../../utils/is.mjs';
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 { columnHelpHandler, columnItemStyle, columnShowHandler, columnVisibleHandler, formContextKey, isDisabled, isReadonly, isRequired, optionsHandler, renderAddLabel, renderArrayItemLabel, renderText };
113
+ export { columnItemStyle, columnShowHandler, columnVisibleHandler, formContextKey, isDisabled, isReadonly, isRequired, optionsHandler, renderAddLabel, renderArrayItemLabel, renderText };
@@ -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,11 +1,13 @@
1
- import { inject, useTemplateRef, computed, reactive, toRefs, onMounted, watch, onBeforeUnmount, unref, openBlock, createBlock, withCtx, createElementVNode, normalizeClass, normalizeStyle, createCommentVNode, renderSlot, createElementBlock, toDisplayString, Fragment, createVNode, mergeProps, withKeys, createSlots, renderList } from 'vue';
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, timeRangeHandler, columnShowHandler, columnItemStyle, columnItemInputStyle, isDisabled, isSelectedTimeRange } from '../js/index.mjs';
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
- placeholder: props.column.optionsError === "error" ? "\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u65B0\u52A0\u8F7D" : columnPlaceholderHandler(props.column, props.model)
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
- "div",
233
- {
234
- class: normalizeClass(["flex items-center text-auxiliary text-sm whitespace-nowrap box-border", {
235
- "border-r border-border px-3": __props.column.labelSlot && _ctx.$slots[__props.column.labelSlot] || unref(columnLabelHandler)(__props.column, props.model)
236
- }])
237
- },
238
- [
239
- __props.column.labelSlot && _ctx.$slots[__props.column.labelSlot] ? renderSlot(_ctx.$slots, __props.column.labelSlot, { column: columnConfig.value }, void 0, void 0, 0) : (openBlock(), createElementBlock(
240
- "span",
241
- { key: 1 },
242
- toDisplayString(unref(columnLabelHandler)(__props.column, props.model)),
243
- 1
244
- /* TEXT */
245
- ))
246
- ],
247
- 2
248
- /* CLASS */
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, isSelectedTimeRange, optionsHandler, timeRangeHandler, useShrink };
105
+ export { columnItemInputStyle, columnItemStyle, columnShowHandler, formContextKey, isDisabled, isEmptyValue, optionsHandler, useShrink };
@@ -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 { isNumber } from '../../../utils/is.mjs';
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 = `${value} ` + $t(isPlural ? "hy.years" : "hy.year");
45
- break;
46
- case "month":
47
- label = `${value} ` + $t(isPlural ? "hy.months" : "hy.month");
48
- break;
49
- case "day":
50
- default:
51
- unit = "day";
52
- label = value === 1 ? $t("hy.today") : `${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: timeRangeOptionsHandler(column),
48
+ timeRangeOptions: columnTimeRangeOptionsHandler(column),
76
49
  attrs
77
50
  }
78
51
  );
@@ -11,6 +11,7 @@
11
11
  padding-top: 0;
12
12
  padding-bottom: 0;
13
13
  opacity: 0;
14
+ border: none;
14
15
  }
15
16
  .hy-search-header {
16
17
  height: 16px;