hy-dispatch-ui-v3 0.1.2 → 0.1.3

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 (52) hide show
  1. package/dist/tailwind.css +16 -0
  2. package/es/components/appButton/appButton.vue.mjs +4 -4
  3. package/es/components/appButton/style/appButton.scss +4 -4
  4. package/es/components/appForm/appForm.vue.mjs +17 -3
  5. package/es/components/appForm/js/useAppForm.mjs +15 -1
  6. package/es/components/appIcon/style/appIcon.scss +2 -2
  7. package/es/components/appNoPermissions/appNoPermissions.vue.mjs +48 -0
  8. package/es/components/appNoPermissions/index.mjs +6 -0
  9. package/es/components/appNoPermissions/style/appNoPermissions.scss +0 -0
  10. package/es/components/appNoPermissionsMap/appNoPermissionsMap.vue.mjs +50 -0
  11. package/es/components/appNoPermissionsMap/index.mjs +6 -0
  12. package/es/components/appNoPermissionsMap/style/appNoPermissionsMap.scss +0 -0
  13. package/es/components/appOrgCascader/appOrgCascader.vue.mjs +1 -1
  14. package/es/components/appSearch/appSearch.vue.mjs +22 -6
  15. package/es/components/appSearch/js/index.mjs +12 -3
  16. package/es/components/appSearch/js/useAppSearch.mjs +12 -1
  17. package/es/components/appTable/appTable.vue.mjs +23 -6
  18. package/es/components/appTable/js/index.mjs +21 -6
  19. package/es/components/appTable/js/search.mjs +0 -3
  20. package/es/components/appTable/js/useAppTable.mjs +17 -1
  21. package/es/components/index.mjs +2 -0
  22. package/es/index.mjs +2 -0
  23. package/es/locale/en.mjs +9 -0
  24. package/es/locale/zh_CN.mjs +10 -1
  25. package/es/style/index.scss +0 -2
  26. package/es/version.mjs +1 -1
  27. package/lib/components/appButton/appButton.vue.js +4 -4
  28. package/lib/components/appButton/style/appButton.scss +4 -4
  29. package/lib/components/appForm/appForm.vue.js +17 -3
  30. package/lib/components/appForm/js/useAppForm.js +15 -1
  31. package/lib/components/appIcon/style/appIcon.scss +2 -2
  32. package/lib/components/appNoPermissions/appNoPermissions.vue.js +52 -0
  33. package/lib/components/appNoPermissions/index.js +11 -0
  34. package/lib/components/appNoPermissions/style/appNoPermissions.scss +0 -0
  35. package/lib/components/appNoPermissionsMap/appNoPermissionsMap.vue.js +54 -0
  36. package/lib/components/appNoPermissionsMap/index.js +11 -0
  37. package/lib/components/appNoPermissionsMap/style/appNoPermissionsMap.scss +0 -0
  38. package/lib/components/appOrgCascader/appOrgCascader.vue.js +1 -1
  39. package/lib/components/appSearch/appSearch.vue.js +23 -7
  40. package/lib/components/appSearch/js/index.js +12 -2
  41. package/lib/components/appSearch/js/useAppSearch.js +12 -1
  42. package/lib/components/appTable/appTable.vue.js +22 -5
  43. package/lib/components/appTable/js/index.js +21 -6
  44. package/lib/components/appTable/js/search.js +0 -3
  45. package/lib/components/appTable/js/useAppTable.js +17 -1
  46. package/lib/components/index.js +14 -10
  47. package/lib/index.js +14 -10
  48. package/lib/locale/en.js +9 -0
  49. package/lib/locale/zh_CN.js +10 -1
  50. package/lib/style/index.scss +0 -2
  51. package/lib/version.js +1 -1
  52. package/package.json +11 -1
package/es/index.mjs CHANGED
@@ -6,6 +6,8 @@ export { AppDatePicker } from './components/appDatePicker/index.mjs';
6
6
  export { AppForm } from './components/appForm/index.mjs';
7
7
  export { AppIcon } from './components/appIcon/index.mjs';
8
8
  export { AppIconBox } from './components/appIconBox/index.mjs';
9
+ export { AppNoPermissions } from './components/appNoPermissions/index.mjs';
10
+ export { AppNoPermissionsMap } from './components/appNoPermissionsMap/index.mjs';
9
11
  export { AppOrgCascader } from './components/appOrgCascader/index.mjs';
10
12
  export { AppSearch } from './components/appSearch/index.mjs';
11
13
  export { AppTable } from './components/appTable/index.mjs';
package/es/locale/en.mjs CHANGED
@@ -31,6 +31,9 @@ var en = {
31
31
  confirm: "Confirm",
32
32
  loading: "Loading"
33
33
  },
34
+ form: {
35
+ department: "Department"
36
+ },
34
37
  table: {
35
38
  hideFilter: "Hide filter",
36
39
  displayFilter: "Display filter",
@@ -64,6 +67,12 @@ var en = {
64
67
  },
65
68
  userAvatar: {
66
69
  userAvatar: "User Avatar"
70
+ },
71
+ permissino: {
72
+ youDoNotHaveSubordinatePermissionsForThisModule: "You Do Not Have Subordinate Permissions For This Module",
73
+ pleaseContactTheAdministrator: "Please Contact The Administrator",
74
+ youDoNotHaveAMapConfigurationForThisModule: "You Do Not Have A Map Configuration For This Module",
75
+ pleaseContactTheAdministratorToGoToTheSettingsCenterForConfiguration: "Please Contact The Administrator To Go To The Settings Center For Configuration"
67
76
  }
68
77
  };
69
78
 
@@ -31,6 +31,9 @@ var Chinese = {
31
31
  confirm: "\u786E\u8BA4",
32
32
  loading: "\u52A0\u8F7D\u4E2D"
33
33
  },
34
+ form: {
35
+ department: "\u6240\u5C5E\u90E8\u95E8"
36
+ },
34
37
  table: {
35
38
  hideFilter: "\u9690\u85CF\u7B5B\u9009\u5668",
36
39
  displayFilter: "\u663E\u793A\u7B5B\u9009\u5668",
@@ -60,10 +63,16 @@ var Chinese = {
60
63
  dangerousOperation: "\u5371\u9669\u64CD\u4F5C"
61
64
  },
62
65
  cascader: {
63
- pleaseSelectDepartment: "\u8BF7\u9009\u62E9\u90E8\u95E8"
66
+ pleaseSelectDepartment: "\u8BF7\u9009\u62E9\u6240\u5C5E\u90E8\u95E8"
64
67
  },
65
68
  userAvatar: {
66
69
  userAvatar: "\u7528\u6237\u5934\u50CF"
70
+ },
71
+ permissino: {
72
+ youDoNotHaveSubordinatePermissionsForThisModule: "\u60A8\u6CA1\u6709\u8BE5\u6A21\u5757\u4E0B\u7EA7\u6743\u9650",
73
+ pleaseContactTheAdministrator: "\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458",
74
+ youDoNotHaveAMapConfigurationForThisModule: "\u60A8\u6CA1\u6709\u8BE5\u6A21\u5757\u7684\u5730\u56FE\u914D\u7F6E",
75
+ pleaseContactTheAdministratorToGoToTheSettingsCenterForConfiguration: "\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u524D\u5F80\u8BBE\u7F6E\u4E2D\u5FC3\u8FDB\u884C\u914D\u7F6E"
67
76
  }
68
77
  };
69
78
 
@@ -1,6 +1,4 @@
1
1
  @use './element/index.scss';
2
- @use './theme.scss';
3
- // @use './style/tailwind.scss';
4
2
 
5
3
  * {
6
4
  margin: 0;
package/es/version.mjs CHANGED
@@ -1,3 +1,3 @@
1
- const version = "0.1.2";
1
+ const version = "0.1.3";
2
2
 
3
3
  export { version };
@@ -42,10 +42,10 @@ const _sfc_main = {
42
42
  setup(__props, { emit: __emit }) {
43
43
  const props = __props;
44
44
  const typeObj = {
45
- default: "button_default",
46
- primary: "button_function",
47
- success: "button_addTo",
48
- danger: "button_delete"
45
+ default: "hy-button_default",
46
+ primary: "hy-button_function",
47
+ success: "hy-button_addTo",
48
+ danger: "hy-button_delete"
49
49
  };
50
50
  const emit = __emit;
51
51
  const handleClick = (event) => {
@@ -32,7 +32,7 @@
32
32
  }
33
33
  }
34
34
 
35
- .button_default {
35
+ .hy-button_default {
36
36
  background: rgba(94, 157, 180, 0.32);
37
37
 
38
38
  .hy-button__border {
@@ -96,7 +96,7 @@
96
96
  }
97
97
  }
98
98
 
99
- .button_function {
99
+ .hy-button_function {
100
100
  background: rgba(45, 242, 255, 0.32);
101
101
 
102
102
  .hy-button__border {
@@ -160,7 +160,7 @@
160
160
  }
161
161
  }
162
162
 
163
- .button_addTo {
163
+ .hy-button_addTo {
164
164
  background: rgba(44, 232, 152, 0.32);
165
165
 
166
166
  .hy-button__border {
@@ -224,7 +224,7 @@
224
224
  }
225
225
  }
226
226
 
227
- .button_delete {
227
+ .hy-button_delete {
228
228
  background: rgba(255, 77, 77, 0.32);
229
229
 
230
230
  .hy-button__border {
@@ -5,7 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var vue = require('vue');
6
6
  var elementPlus = require('element-plus');
7
7
  var index$1 = require('../appIcon/index.js');
8
- var appDatePicker = require('../appDatePicker/appDatePicker.vue.js');
8
+ var index$2 = require('../appDatePicker/index.js');
9
+ var index$3 = require('../appOrgCascader/index.js');
9
10
  var index = require('./js/index.js');
10
11
  var useAppForm = require('./js/useAppForm.js');
11
12
  var useLocale = require('../../hooks/useLocale.js');
@@ -251,7 +252,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
251
252
  "daterange",
252
253
  "monthrange",
253
254
  "yearrange"
254
- ].includes((_a = column.attrs) == null ? void 0 : _a.type) && vue.unref(is.isArray)(column.field) ? (vue.openBlock(), vue.createBlock(appDatePicker.default, vue.mergeProps({
255
+ ].includes((_a = column.attrs) == null ? void 0 : _a.type) && vue.unref(is.isArray)(column.field) ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.AppDatePicker), vue.mergeProps({
255
256
  key: 0,
256
257
  start: __props.model[column.field[0]],
257
258
  "onUpdate:start": ($event) => __props.model[column.field[0]] = $event,
@@ -261,7 +262,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
261
262
  style: { "width": "100%" }
262
263
  }, { ref_for: true }, column.attrs, {
263
264
  disabled: vue.unref(index.isDisabled)(props, column)
264
- }), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled"])) : (vue.openBlock(), vue.createBlock(appDatePicker.default, vue.mergeProps({
265
+ }), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled"])) : (vue.openBlock(), vue.createBlock(vue.unref(index$2.AppDatePicker), vue.mergeProps({
265
266
  key: 1,
266
267
  modelValue: __props.model[column.field],
267
268
  "onUpdate:modelValue": ($event) => __props.model[column.field] = $event,
@@ -299,6 +300,19 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
299
300
  ],
300
301
  2112
301
302
  /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
303
+ )) : column.type === "org-cascader" ? (vue.openBlock(), vue.createElementBlock(
304
+ vue.Fragment,
305
+ { key: 6 },
306
+ [
307
+ vue.createCommentVNode(" \u90E8\u95E8\u7EA7\u8054\u9009\u62E9\u6846 "),
308
+ vue.createVNode(vue.unref(index$3.AppOrgCascader), vue.mergeProps({
309
+ modelValue: __props.model[column.field],
310
+ "onUpdate:modelValue": ($event) => __props.model[column.field] = $event,
311
+ disabled: vue.unref(index.isDisabled)(props, column)
312
+ }, { ref_for: true }, column.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])
313
+ ],
314
+ 2112
315
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
302
316
  )) : vue.createCommentVNode("v-if", true)
303
317
  ],
304
318
  64
@@ -6,6 +6,15 @@ var date = require('../../../utils/date.js');
6
6
  var useLocale = require('../../../hooks/useLocale.js');
7
7
  var is = require('../../../utils/is.js');
8
8
 
9
+ const genDefaultLabel = (config) => {
10
+ if (config.label) return config.label;
11
+ const { t } = useLocale.useLocale();
12
+ switch (config.type) {
13
+ // 部门级联选择框
14
+ case "org-cascader":
15
+ return t("form.department");
16
+ }
17
+ };
9
18
  const genPlaceholderHandler = (config) => {
10
19
  const { t } = useLocale.useLocale();
11
20
  const { type, label, attrs = {} } = config || {};
@@ -13,8 +22,10 @@ const genPlaceholderHandler = (config) => {
13
22
  switch (type) {
14
23
  case "input":
15
24
  placeholder = placeholder || t("hy.pleaseEnterPlaceholder", [label]);
25
+ break;
16
26
  case "select":
17
27
  placeholder = placeholder || t("hy.pleaseSelectPlaceholder", [label]);
28
+ break;
18
29
  case "date-picker":
19
30
  if (["datetimerange", "daterange", "monthrange", "yearrange"].includes(
20
31
  attrs == null ? void 0 : attrs.type
@@ -40,6 +51,7 @@ const genPlaceholderHandler = (config) => {
40
51
  } else {
41
52
  placeholder = placeholder || t("hy.pleaseSelectPlaceholder", [label]);
42
53
  }
54
+ break;
43
55
  default:
44
56
  placeholder = placeholder || label;
45
57
  }
@@ -74,13 +86,15 @@ const rulesHandler = (config) => {
74
86
  return rules;
75
87
  };
76
88
  function appFormItemHandler(column = {}) {
77
- const { placeholder, startPlaceholder, endPlaceholder } = genPlaceholderHandler(column);
89
+ const label = genDefaultLabel(column);
90
+ const { placeholder, startPlaceholder, endPlaceholder } = genPlaceholderHandler({ ...column, label });
78
91
  const attrs = { ...column.attrs || {}, placeholder };
79
92
  column = handler.mergeDeep(
80
93
  { ...column },
81
94
  {
82
95
  key: /* @__PURE__ */ Symbol("appFormItemKey"),
83
96
  field: column.prop,
97
+ label,
84
98
  readonly: column.readonly || false,
85
99
  rules: rulesHandler(column)
86
100
  }
@@ -1,8 +1,8 @@
1
1
  .app-icon {
2
2
  width: 16px;
3
3
  height: 16px;
4
- vertical-align: -0.15em;
5
- stroke: currentColor;
4
+ vertical-align: -0.1em;
5
+ display: inline-block;
6
6
  overflow: hidden;
7
7
  fill: currentColor;
8
8
  outline: none;
@@ -0,0 +1,52 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ var index = require('../appIcon/index.js');
7
+ var useLocale = require('../../hooks/useLocale.js');
8
+
9
+ import "./style/appNoPermissions.scss";
10
+
11
+ const __default__ = vue.defineComponent({
12
+ name: "AppNoPermissions"
13
+ });
14
+ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
15
+ props: {
16
+ svgName: {
17
+ type: String,
18
+ default: "2-v3-base-no-data-noData"
19
+ }
20
+ },
21
+ emits: [],
22
+ setup(__props, { expose: __expose, emit: __emit }) {
23
+ const { t } = useLocale.useLocale();
24
+ __expose({});
25
+ return (_ctx, _cache) => {
26
+ return vue.openBlock(), vue.createElementBlock("div", { class: "w-full h-full bg-background-2 text-auxiliary text-base flex flex-col items-center justify-center" }, [
27
+ vue.createVNode(vue.unref(index.AppIcon), {
28
+ "svg-name": __props.svgName,
29
+ "class-name": "!w-[46px] !h-[46px]"
30
+ }, null, 8, ["svg-name"]),
31
+ vue.createElementVNode("div", { class: "text-center mt-[12px]" }, [
32
+ vue.createElementVNode(
33
+ "p",
34
+ null,
35
+ vue.toDisplayString(vue.unref(t)("permissino.youDoNotHaveSubordinatePermissionsForThisModule")),
36
+ 1
37
+ /* TEXT */
38
+ ),
39
+ vue.createElementVNode(
40
+ "p",
41
+ null,
42
+ vue.toDisplayString(vue.unref(t)("permissino.pleaseContactTheAdministrator")),
43
+ 1
44
+ /* TEXT */
45
+ )
46
+ ])
47
+ ]);
48
+ };
49
+ }
50
+ });
51
+
52
+ exports.default = _sfc_main;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var appNoPermissions = require('./appNoPermissions.vue.js');
6
+ var handler = require('../../utils/handler.js');
7
+
8
+ const AppNoPermissions = handler.withInstall(appNoPermissions.default);
9
+
10
+ exports.AppNoPermissions = AppNoPermissions;
11
+ exports.default = AppNoPermissions;
@@ -0,0 +1,54 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ var index = require('../appIcon/index.js');
7
+ var useLocale = require('../../hooks/useLocale.js');
8
+
9
+ import "./style/appNoPermissionsMap.scss";
10
+
11
+ const __default__ = vue.defineComponent({
12
+ name: "AppNoPermissionsMap"
13
+ });
14
+ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
15
+ props: {
16
+ svgName: {
17
+ type: String,
18
+ default: "2-v3-base-no-data-noData"
19
+ }
20
+ },
21
+ emits: [],
22
+ setup(__props, { expose: __expose, emit: __emit }) {
23
+ const { t } = useLocale.useLocale();
24
+ __expose({});
25
+ return (_ctx, _cache) => {
26
+ return vue.openBlock(), vue.createElementBlock("div", { class: "w-full h-full bg-background-2 text-auxiliary text-base flex flex-col items-center justify-center" }, [
27
+ vue.createVNode(vue.unref(index.AppIcon), {
28
+ "svg-name": __props.svgName,
29
+ "class-name": "!w-[46px] !h-[46px]"
30
+ }, null, 8, ["svg-name"]),
31
+ vue.createElementVNode("div", { class: "text-center mt-[12px]" }, [
32
+ vue.createElementVNode(
33
+ "p",
34
+ null,
35
+ vue.toDisplayString(vue.unref(t)("permissino.youDoNotHaveAMapConfigurationForThisModule")),
36
+ 1
37
+ /* TEXT */
38
+ ),
39
+ vue.createElementVNode(
40
+ "p",
41
+ null,
42
+ vue.toDisplayString(vue.unref(t)(
43
+ "permissino.pleaseContactTheAdministratorToGoToTheSettingsCenterForConfiguration"
44
+ )),
45
+ 1
46
+ /* TEXT */
47
+ )
48
+ ])
49
+ ]);
50
+ };
51
+ }
52
+ });
53
+
54
+ exports.default = _sfc_main;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var appNoPermissionsMap = require('./appNoPermissionsMap.vue.js');
6
+ var handler = require('../../utils/handler.js');
7
+
8
+ const AppNoPermissionsMap = handler.withInstall(appNoPermissionsMap.default);
9
+
10
+ exports.AppNoPermissionsMap = AppNoPermissionsMap;
11
+ exports.default = AppNoPermissionsMap;
@@ -70,7 +70,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
70
70
  changeLastLayer: {
71
71
  type: Boolean,
72
72
  default: () => {
73
- return false;
73
+ return true;
74
74
  }
75
75
  }
76
76
  }, {
@@ -5,7 +5,8 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var vue = require('vue');
6
6
  var elementPlus = require('element-plus');
7
7
  var iconsVue = require('@element-plus/icons-vue');
8
- var appDatePicker = require('../appDatePicker/appDatePicker.vue.js');
8
+ var index$1 = require('../appDatePicker/index.js');
9
+ var index$2 = require('../appOrgCascader/index.js');
9
10
  var index = require('./js/index.js');
10
11
  var useAppSearch = require('./js/useAppSearch.js');
11
12
  var useLocale = require('../../hooks/useLocale.js');
@@ -314,7 +315,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
314
315
  "daterange",
315
316
  "monthrange",
316
317
  "yearrange"
317
- ].includes((_a = column.attrs) == null ? void 0 : _a.type) && vue.unref(is.isArray)(column.field) ? (vue.openBlock(), vue.createBlock(appDatePicker.default, vue.mergeProps({
318
+ ].includes((_a = column.attrs) == null ? void 0 : _a.type) && vue.unref(is.isArray)(column.field) ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.AppDatePicker), vue.mergeProps({
318
319
  key: 0,
319
320
  start: __props.model[column.field[0]],
320
321
  "onUpdate:start": ($event) => __props.model[column.field[0]] = $event,
@@ -326,7 +327,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
326
327
  disabled: vue.unref(index.isDisabled)(props, column),
327
328
  timeRangeFill: column.timeRangeFill,
328
329
  onChange: ($event) => onChangeHandler($event, column)
329
- }), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled", "timeRangeFill", "onChange"])) : (vue.openBlock(), vue.createBlock(appDatePicker.default, vue.mergeProps({
330
+ }), null, 16, ["start", "onUpdate:start", "end", "onUpdate:end", "disabled", "timeRangeFill", "onChange"])) : (vue.openBlock(), vue.createBlock(vue.unref(index$1.AppDatePicker), vue.mergeProps({
330
331
  key: 1,
331
332
  modelValue: __props.model[column.field],
332
333
  "onUpdate:modelValue": ($event) => __props.model[column.field] = $event,
@@ -340,6 +341,19 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
340
341
  ],
341
342
  64
342
343
  /* STABLE_FRAGMENT */
344
+ )) : column.type === "org-cascader" ? (vue.openBlock(), vue.createElementBlock(
345
+ vue.Fragment,
346
+ { key: 4 },
347
+ [
348
+ vue.createCommentVNode(" \u90E8\u95E8\u7EA7\u8054\u9009\u62E9\u6846 "),
349
+ vue.createVNode(vue.unref(index$2.AppOrgCascader), vue.mergeProps({
350
+ modelValue: __props.model[column.field],
351
+ "onUpdate:modelValue": ($event) => __props.model[column.field] = $event,
352
+ disabled: vue.unref(index.isDisabled)(props, column)
353
+ }, { ref_for: true }, column.attrs), null, 16, ["modelValue", "onUpdate:modelValue", "disabled"])
354
+ ],
355
+ 2112
356
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
343
357
  )) : vue.createCommentVNode("v-if", true)
344
358
  ],
345
359
  4
@@ -356,10 +370,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
356
370
  (vue.openBlock(true), vue.createElementBlock(
357
371
  vue.Fragment,
358
372
  null,
359
- vue.renderList(column.timeRangeOptions, (item, index) => {
373
+ vue.renderList(column.timeRangeOptions, (item, index$1) => {
360
374
  return vue.openBlock(), vue.createElementBlock("div", {
361
- key: index,
362
- class: "border-l border-border px-[10px] cursor-pointer",
375
+ key: index$1,
376
+ class: vue.normalizeClass(["border-l border-border px-[10px] cursor-pointer", {
377
+ "bg-[rgba(var(--hy-theme),0.2)] text-theme font-bold": vue.unref(index.isSelectedTimeRange)(column, item, __props.model)
378
+ }]),
363
379
  onClick: ($event) => onTimeRangeClickHandler(column, item)
364
380
  }, [
365
381
  vue.createElementVNode(
@@ -369,7 +385,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
369
385
  1
370
386
  /* TEXT */
371
387
  )
372
- ], 8, ["onClick"]);
388
+ ], 10, ["onClick"]);
373
389
  }),
374
390
  128
375
391
  /* KEYED_FRAGMENT */
@@ -90,9 +90,10 @@ function useShrink(props, templateRef) {
90
90
  }
91
91
  function timeRangeHandler(column, options) {
92
92
  const { value, unit } = options;
93
- const { timeRangeFill, attrs } = column;
94
- const format = attrs.valueFormat || "YYYY-MM-DD";
93
+ let { timeRangeFill, attrs } = column;
94
+ const format = "YYYY-MM-DD";
95
95
  const date = dayjs(Date.now());
96
+ timeRangeFill = timeRangeFill || attrs.type === "datetimerange";
96
97
  switch (unit) {
97
98
  case "year":
98
99
  case "month":
@@ -111,11 +112,20 @@ function timeRangeHandler(column, options) {
111
112
  ];
112
113
  }
113
114
  }
115
+ function isSelectedTimeRange(column, options, model = {}) {
116
+ const [start, end] = timeRangeHandler(column, options);
117
+ const { field } = column;
118
+ if (Array.isArray(field)) {
119
+ return start === model[field[0]] && end === model[field[1]];
120
+ }
121
+ return start === model[field][0] && end === model[field][1];
122
+ }
114
123
 
115
124
  exports.columnItemInputStyle = columnItemInputStyle;
116
125
  exports.columnItemStyle = columnItemStyle;
117
126
  exports.columnShowHandler = columnShowHandler;
118
127
  exports.isDisabled = isDisabled;
119
128
  exports.isEmptyValue = isEmptyValue;
129
+ exports.isSelectedTimeRange = isSelectedTimeRange;
120
130
  exports.timeRangeHandler = timeRangeHandler;
121
131
  exports.useShrink = useShrink;
@@ -6,6 +6,15 @@ var date = require('../../../utils/date.js');
6
6
  var useLocale = require('../../../hooks/useLocale.js');
7
7
  var is = require('../../../utils/is.js');
8
8
 
9
+ const genDefaultLabel = (config) => {
10
+ if (config.label) return config.label;
11
+ const { t } = useLocale.useLocale();
12
+ switch (config.type) {
13
+ // 部门级联选择框
14
+ case "org-cascader":
15
+ return t("form.department");
16
+ }
17
+ };
9
18
  const genPlaceholderHandler = (config) => {
10
19
  const { t } = useLocale.useLocale();
11
20
  const { type, label, attrs = {} } = config || {};
@@ -96,7 +105,8 @@ const timeRangeOptionsHandler = (config) => {
96
105
  }, []);
97
106
  };
98
107
  function appSearchItemHandler(column = {}) {
99
- const { placeholder, startPlaceholder, endPlaceholder } = genPlaceholderHandler(column);
108
+ const label = genDefaultLabel(column);
109
+ const { placeholder, startPlaceholder, endPlaceholder } = genPlaceholderHandler({ ...column, label });
100
110
  const attrs = {
101
111
  clearable: true,
102
112
  ...column.attrs || {},
@@ -108,6 +118,7 @@ function appSearchItemHandler(column = {}) {
108
118
  {
109
119
  key: /* @__PURE__ */ Symbol("appFormItemKey"),
110
120
  field: column.prop,
121
+ label,
111
122
  readonly: column.readonly || false,
112
123
  width,
113
124
  inputWidth,
@@ -174,9 +174,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
174
174
  tableTriggerRef,
175
175
  getSelectedList,
176
176
  setTableRowClassName,
177
+ clearSelection,
178
+ clearSelectedList,
177
179
  onTableRowClickHandler,
178
180
  onTableRowContextmenuHandler,
179
- onTableSelectAllHandler,
181
+ onTableSelectHandler,
180
182
  // useAppTableSearch
181
183
  // 表单查询
182
184
  formModel,
@@ -213,7 +215,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
213
215
  resetFn,
214
216
  getSelectedList,
215
217
  getTotalElements,
216
- getTableDataSource
218
+ getTableDataSource,
219
+ clearSelection,
220
+ clearSelectedList
217
221
  });
218
222
  return (_ctx, _cache) => {
219
223
  return vue.openBlock(), vue.createElementBlock(
@@ -289,7 +293,19 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
289
293
  hidden: !vue.unref(showFilter),
290
294
  class: vue.normalizeClass({ "mb-4": vue.unref(showFilter) }),
291
295
  onSearch: ($event) => vue.unref(getData)(1)
292
- }, null, 8, ["model", "columns", "hidden", "class", "onSearch"])) : vue.createCommentVNode("v-if", true),
296
+ }, vue.createSlots({
297
+ _: 2
298
+ /* DYNAMIC */
299
+ }, [
300
+ vue.renderList(_ctx.$slots, (_, slotName) => {
301
+ return {
302
+ name: slotName,
303
+ fn: vue.withCtx((scope) => [
304
+ vue.renderSlot(_ctx.$slots, slotName, vue.normalizeProps(vue.guardReactiveProps(scope)))
305
+ ])
306
+ };
307
+ })
308
+ ]), 1032, ["model", "columns", "hidden", "class", "onSearch"])) : vue.createCommentVNode("v-if", true),
293
309
  vue.createCommentVNode(" \u4E3B\u5185\u5BB9 "),
294
310
  vue.createElementVNode("div", { class: "h-0 flex-1 flex flex-col border border-border rounded pb-5 overflow-hidden" }, [
295
311
  vue.renderSlot(_ctx.$slots, "table", { data: vue.unref(tableDataSource) }, () => [
@@ -305,7 +321,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
305
321
  style: {
306
322
  "font-size": `${vue.unref(adaptive.parseRem)(__props.fontSize)}rem`
307
323
  },
308
- onSelectAll: vue.unref(onTableSelectAllHandler),
324
+ onSelect: vue.unref(onTableSelectHandler),
325
+ onSelectAll: vue.unref(onTableSelectHandler),
309
326
  onRowClick: vue.unref(onTableRowClickHandler),
310
327
  onRowContextmenu: vue.unref(onTableRowContextmenuHandler)
311
328
  }, _ctx.$attrs), {
@@ -495,7 +512,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
495
512
  ]),
496
513
  _: 3
497
514
  /* FORWARDED */
498
- }, 16, ["row-key", "data", "show-header", "row-class-name", "class", "style", "onSelectAll", "onRowClick", "onRowContextmenu"])
515
+ }, 16, ["row-key", "data", "show-header", "row-class-name", "class", "style", "onSelect", "onSelectAll", "onRowClick", "onRowContextmenu"])
499
516
  ]),
500
517
  vue.createCommentVNode(" \u5206\u9875 "),
501
518
  __props.showPagination ? (vue.openBlock(), vue.createElementBlock("div", {
@@ -252,13 +252,27 @@ const useAppTableWrapper = (hy) => {
252
252
  emits("on-select-checkbox", selectedList.value, row);
253
253
  }
254
254
  }
255
- function onTableSelectAllHandler(selectList = [], row) {
255
+ function onTableSelectHandler(selectList = [], row) {
256
256
  if (selectList.length === 0 && tableDataSource.value.length === 0) {
257
- tableRef.value.clearSelection();
257
+ clearSelection();
258
258
  }
259
259
  selectedList.value = [...selectList];
260
260
  emits("on-select-checkbox", [...selectList], row);
261
261
  }
262
+ function clearSelectedList(list = []) {
263
+ selectedList.value = list || [];
264
+ clearSelection();
265
+ list.forEach((row) => {
266
+ const item = tableDataSource.value.find(
267
+ (v) => getRowKey(row) === getRowKey(v)
268
+ );
269
+ if (item) {
270
+ tableRef.value.toggleRowSelection(item, true);
271
+ } else {
272
+ tableRef.value.toggleRowSelection(row, true);
273
+ }
274
+ });
275
+ }
262
276
  function setTableRowClassName(obj) {
263
277
  const row = obj.row;
264
278
  let className = [];
@@ -295,12 +309,13 @@ const useAppTableWrapper = (hy) => {
295
309
  selectedList,
296
310
  tableTriggerRef,
297
311
  setTableRowClassName,
298
- onTableSelectAllHandler,
312
+ getSelectedList,
313
+ clearSelection,
314
+ clearSelectedList,
315
+ onTableSelectHandler,
299
316
  onTableRowContextmenuHandler,
300
317
  onTableRowClickHandler,
301
- onTableColumnsSelectHandler,
302
- getSelectedList,
303
- clearSelection
318
+ onTableColumnsSelectHandler
304
319
  };
305
320
  };
306
321