hy-dispatch-ui-v3 0.1.4 → 0.1.6

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 (49) hide show
  1. package/dist/tailwind.css +59 -0
  2. package/es/components/appConfigProvider/appConfigProvider.vue.mjs +3 -3
  3. package/es/components/appConfirmDialog/appConfirmDialog.vue.mjs +3 -3
  4. package/es/components/appConfirmDialog/appConfirmMethod.mjs +13 -13
  5. package/es/components/appCutter/appCutter.vue.mjs +285 -0
  6. package/es/components/appCutter/index.mjs +6 -0
  7. package/es/components/appCutter/style/appCutter.scss +51 -0
  8. package/es/components/appDialog/appDialog.vue.mjs +205 -0
  9. package/es/components/appDialog/index.mjs +6 -0
  10. package/es/components/appDialog/style/appDialog.scss +0 -0
  11. package/es/components/appSearch/appSearch.vue.mjs +4 -8
  12. package/es/components/appTable/appTable.vue.mjs +4 -4
  13. package/es/components/appTable/js/useAppTable.mjs +4 -3
  14. package/es/components/index.mjs +2 -0
  15. package/es/hooks/useApi.mjs +6 -2
  16. package/es/hooks/useGlobalConfig.mjs +2 -2
  17. package/es/hooks/useLocale.mjs +14 -4
  18. package/es/hooks/useUserAvatarMap.mjs +6 -2
  19. package/es/index.mjs +4 -1
  20. package/es/locale/en.mjs +6 -1
  21. package/es/locale/zh_CN.mjs +8 -3
  22. package/es/utils/file.mjs +68 -0
  23. package/es/utils/index.mjs +2 -1
  24. package/es/utils/is.mjs +4 -1
  25. package/es/version.mjs +1 -1
  26. package/lib/components/appConfigProvider/appConfigProvider.vue.js +1 -1
  27. package/lib/components/appConfirmDialog/appConfirmDialog.vue.js +3 -3
  28. package/lib/components/appConfirmDialog/appConfirmMethod.js +13 -13
  29. package/lib/components/appCutter/appCutter.vue.js +289 -0
  30. package/lib/components/appCutter/index.js +11 -0
  31. package/lib/components/appCutter/style/appCutter.scss +51 -0
  32. package/lib/components/appDialog/appDialog.vue.js +209 -0
  33. package/lib/components/appDialog/index.js +11 -0
  34. package/lib/components/appDialog/style/appDialog.scss +0 -0
  35. package/lib/components/appSearch/appSearch.vue.js +4 -8
  36. package/lib/components/appTable/appTable.vue.js +26 -26
  37. package/lib/components/appTable/js/useAppTable.js +4 -3
  38. package/lib/components/index.js +26 -22
  39. package/lib/hooks/useApi.js +6 -2
  40. package/lib/hooks/useLocale.js +13 -3
  41. package/lib/hooks/useUserAvatarMap.js +6 -2
  42. package/lib/index.js +35 -22
  43. package/lib/locale/en.js +6 -1
  44. package/lib/locale/zh_CN.js +8 -3
  45. package/lib/utils/file.js +76 -0
  46. package/lib/utils/index.js +9 -0
  47. package/lib/utils/is.js +4 -0
  48. package/lib/version.js +1 -1
  49. package/package.json +2 -3
@@ -5,15 +5,16 @@ 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 index$4 = require('../appTooltip/index.js');
9
- var index$2 = require('./js/index.js');
8
+ var index$5 = require('../appTooltip/index.js');
9
+ var index$3 = require('./js/index.js');
10
10
  var search = require('./js/search.js');
11
11
  var columnSelect = require('./cpns/columnSelect.vue.js');
12
12
  var useMixins = require('../../hooks/useMixins.js');
13
13
  var index = require('../appButton/index.js');
14
- var index$1 = require('../appSearch/index.js');
14
+ var index$1 = require('../appIcon/index.js');
15
+ var index$2 = require('../appSearch/index.js');
15
16
  var adaptive = require('../../utils/adaptive.js');
16
- var index$3 = require('../appIconBox/index.js');
17
+ var index$4 = require('../appIconBox/index.js');
17
18
  var useLocale = require('../../hooks/useLocale.js');
18
19
  var is = require('../../utils/is.js');
19
20
 
@@ -207,7 +208,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
207
208
  operatorDropdownRef,
208
209
  appSearchRef
209
210
  },
210
- [index$2.useAppTableWrapper, search.useAppTableSearch]
211
+ [index$3.useAppTableWrapper, search.useAppTableSearch]
211
212
  );
212
213
  if (props.defaultGetData) {
213
214
  getData(1);
@@ -223,7 +224,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
223
224
  clearSelectedList
224
225
  });
225
226
  return (_ctx, _cache) => {
226
- const _component_AppIcon = vue.resolveComponent("AppIcon");
227
227
  return vue.openBlock(), vue.createElementBlock(
228
228
  "div",
229
229
  {
@@ -284,7 +284,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
284
284
  onClick: ($event) => vue.unref(getData)()
285
285
  }, {
286
286
  default: vue.withCtx(() => [
287
- vue.createVNode(_component_AppIcon, {
287
+ vue.createVNode(vue.unref(index$1.AppIcon), {
288
288
  class: "w-[12px] h-[12px]",
289
289
  "svg-name": "refres"
290
290
  })
@@ -302,7 +302,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
302
302
  ])) : vue.createCommentVNode("v-if", true)
303
303
  ]),
304
304
  vue.createCommentVNode(" \u67E5\u8BE2\u8FC7\u6EE4 "),
305
- __props.filterColumns.length > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.AppSearch), {
305
+ __props.filterColumns.length > 0 ? (vue.openBlock(), vue.createBlock(vue.unref(index$2.AppSearch), {
306
306
  key: 0,
307
307
  ref_key: "appSearchRef",
308
308
  ref: appSearchRef,
@@ -378,7 +378,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
378
378
  vue.renderSlot(_ctx.$slots, column.headerSlot, vue.mergeProps({ ref_for: true }, scope), () => {
379
379
  var _a2, _b;
380
380
  return [
381
- !vue.unref(is.isEmpty)((_a2 = scope.column) == null ? void 0 : _a2.label) ? (vue.openBlock(), vue.createBlock(vue.unref(index$4.AppTooltip), {
381
+ !vue.unref(is.isEmpty)((_a2 = scope.column) == null ? void 0 : _a2.label) ? (vue.openBlock(), vue.createBlock(vue.unref(index$5.AppTooltip), {
382
382
  key: 0,
383
383
  "over-line": 1,
384
384
  content: (_b = scope.column) == null ? void 0 : _b.label
@@ -399,22 +399,22 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
399
399
  (vue.openBlock(true), vue.createElementBlock(
400
400
  vue.Fragment,
401
401
  null,
402
- vue.renderList(vue.unref(index$2.operatorFilterHandler)(
402
+ vue.renderList(vue.unref(index$3.operatorFilterHandler)(
403
403
  column,
404
404
  scope,
405
405
  "default"
406
406
  ), (citem, cindex) => {
407
- return vue.openBlock(), vue.createBlock(vue.unref(index$3.AppIconBox), {
407
+ return vue.openBlock(), vue.createBlock(vue.unref(index$4.AppIconBox), {
408
408
  key: cindex,
409
409
  "svg-name": citem.svgName,
410
410
  altText: citem.label,
411
- onClick: vue.withModifiers(($event) => vue.unref(index$2.operatorClickHandler)(cindex, column, scope, "default"), ["stop"])
411
+ onClick: vue.withModifiers(($event) => vue.unref(index$3.operatorClickHandler)(cindex, column, scope, "default"), ["stop"])
412
412
  }, null, 8, ["svg-name", "altText", "onClick"]);
413
413
  }),
414
414
  128
415
415
  /* KEYED_FRAGMENT */
416
416
  )),
417
- ((_a2 = vue.unref(index$2.operatorFilterHandler)(column, scope, "more")) == null ? void 0 : _a2.length) ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElDropdown), {
417
+ ((_a2 = vue.unref(index$3.operatorFilterHandler)(column, scope, "more")) == null ? void 0 : _a2.length) ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElDropdown), {
418
418
  key: 0,
419
419
  ref_for: true,
420
420
  ref_key: "operatorDropdownRef",
@@ -423,7 +423,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
423
423
  class: "ml-3",
424
424
  "popper-style": "min-width: 150px",
425
425
  placement: "bottom",
426
- onCommand: ($event) => vue.unref(index$2.operatorClickHandler)($event, column, scope, "more")
426
+ onCommand: ($event) => vue.unref(index$3.operatorClickHandler)($event, column, scope, "more")
427
427
  }, {
428
428
  dropdown: vue.withCtx(() => [
429
429
  vue.createVNode(
@@ -434,7 +434,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
434
434
  (vue.openBlock(true), vue.createElementBlock(
435
435
  vue.Fragment,
436
436
  null,
437
- vue.renderList(vue.unref(index$2.operatorFilterHandler)(
437
+ vue.renderList(vue.unref(index$3.operatorFilterHandler)(
438
438
  column,
439
439
  scope,
440
440
  "more"
@@ -442,7 +442,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
442
442
  return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElDropdownItem), {
443
443
  key: cindex,
444
444
  command: cindex,
445
- disabled: vue.unref(index$2.operatorDisabledHandler)(citem, scope)
445
+ disabled: vue.unref(index$3.operatorDisabledHandler)(citem, scope)
446
446
  }, {
447
447
  default: vue.withCtx(() => [
448
448
  vue.createElementVNode("span", null, [
@@ -453,13 +453,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
453
453
  1
454
454
  /* TEXT */
455
455
  ),
456
- vue.unref(index$2.operatorDisabledHandler)(citem, scope) ? (vue.openBlock(), vue.createElementBlock(
456
+ vue.unref(index$3.operatorDisabledHandler)(citem, scope) ? (vue.openBlock(), vue.createElementBlock(
457
457
  "span",
458
458
  {
459
459
  key: 0,
460
460
  class: "text-xs leading-1"
461
461
  },
462
- "\uFF08" + vue.toDisplayString(vue.unref(index$2.operatorDisableTextdHandler)(citem, scope)) + "\uFF09",
462
+ "\uFF08" + vue.toDisplayString(vue.unref(index$3.operatorDisableTextdHandler)(citem, scope)) + "\uFF09",
463
463
  1
464
464
  /* TEXT */
465
465
  )) : vue.createCommentVNode("v-if", true)
@@ -481,7 +481,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
481
481
  )
482
482
  ]),
483
483
  default: vue.withCtx(() => [
484
- vue.createVNode(vue.unref(index$3.AppIconBox), {
484
+ vue.createVNode(vue.unref(index$4.AppIconBox), {
485
485
  key: "more",
486
486
  "svg-name": "system-burst_analysis_select_option",
487
487
  altText: vue.unref(t)("table.moreOperations"),
@@ -499,7 +499,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
499
499
  vue.Fragment,
500
500
  { key: 2 },
501
501
  [
502
- !vue.unref(is.isEmpty)(scope.row[scope.column.property]) ? (vue.openBlock(), vue.createBlock(vue.unref(index$4.AppTooltip), {
502
+ !vue.unref(is.isEmpty)(scope.row[scope.column.property]) ? (vue.openBlock(), vue.createBlock(vue.unref(index$5.AppTooltip), {
503
503
  key: 0,
504
504
  "over-line": 2,
505
505
  content: scope.row[scope.column.property]
@@ -540,7 +540,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
540
540
  vue.createElementVNode(
541
541
  "div",
542
542
  { class: "absolute left-4 top-1/2 transform -translate-y-1/2 text-sm" },
543
- vue.toDisplayString(vue.unref(t)("table.aTotalOfPiecesOfData", [100])),
543
+ vue.toDisplayString(vue.unref(t)("table.aTotalOfPiecesOfData", [vue.unref(totalElements)])),
544
544
  1
545
545
  /* TEXT */
546
546
  ),
@@ -574,7 +574,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
574
574
  "virtual-triggering": "",
575
575
  trigger: "contextmenu",
576
576
  placement: "bottom",
577
- onCommand: ($event) => vue.unref(index$2.operatorClickHandler)(
577
+ onCommand: ($event) => vue.unref(index$3.operatorClickHandler)(
578
578
  $event,
579
579
  vue.unref(tableTriggerRef).column,
580
580
  vue.unref(tableTriggerRef).scope
@@ -586,14 +586,14 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
586
586
  (vue.openBlock(true), vue.createElementBlock(
587
587
  vue.Fragment,
588
588
  null,
589
- vue.renderList(vue.unref(index$2.operatorFilterHandler)(
589
+ vue.renderList(vue.unref(index$3.operatorFilterHandler)(
590
590
  vue.unref(tableTriggerRef).column,
591
591
  vue.unref(tableTriggerRef).scope
592
592
  ), (citem, cindex) => {
593
593
  return vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElDropdownItem), {
594
594
  key: cindex,
595
595
  command: cindex,
596
- disabled: vue.unref(index$2.operatorDisabledHandler)(citem, vue.unref(tableTriggerRef).scope)
596
+ disabled: vue.unref(index$3.operatorDisabledHandler)(citem, vue.unref(tableTriggerRef).scope)
597
597
  }, {
598
598
  default: vue.withCtx(() => [
599
599
  vue.createElementVNode("span", null, [
@@ -604,13 +604,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
604
604
  1
605
605
  /* TEXT */
606
606
  ),
607
- vue.unref(index$2.operatorDisabledHandler)(citem, vue.unref(tableTriggerRef).scope) ? (vue.openBlock(), vue.createElementBlock(
607
+ vue.unref(index$3.operatorDisabledHandler)(citem, vue.unref(tableTriggerRef).scope) ? (vue.openBlock(), vue.createElementBlock(
608
608
  "span",
609
609
  {
610
610
  key: 0,
611
611
  class: "text-xs leading-1"
612
612
  },
613
- "\uFF08" + vue.toDisplayString(vue.unref(index$2.operatorDisableTextdHandler)(citem, vue.unref(tableTriggerRef).scope)) + "\uFF09",
613
+ "\uFF08" + vue.toDisplayString(vue.unref(index$3.operatorDisableTextdHandler)(citem, vue.unref(tableTriggerRef).scope)) + "\uFF09",
614
614
  1
615
615
  /* TEXT */
616
616
  )) : vue.createCommentVNode("v-if", true)
@@ -56,7 +56,7 @@ function getColumnsEditable(column, index) {
56
56
  };
57
57
  }
58
58
  const useAppTable = (config = {}) => {
59
- const { columns, filterColumns } = config || {};
59
+ const { columns, filterModel, filterColumns } = config || {};
60
60
  const tableColumns = [];
61
61
  try {
62
62
  for (let i = 0; i < (columns == null ? void 0 : columns.length); i++) {
@@ -77,12 +77,13 @@ const useAppTable = (config = {}) => {
77
77
  console.error(err);
78
78
  }
79
79
  const appSearchForm = useAppSearch.useAppSearch(filterColumns, {
80
+ query: null,
80
81
  page: 1,
81
82
  // 当前分页数
82
- size: 15
83
+ size: 15,
83
84
  // 每页数量
85
+ ...filterModel
84
86
  });
85
- console.log("appSearchFormappSearchFormappSearchForm", appSearchForm);
86
87
  return {
87
88
  tableColumns: vue.toRef(tableColumns),
88
89
  filterModel: appSearchForm.formModel,
@@ -1,39 +1,43 @@
1
1
  'use strict';
2
2
 
3
- var index$9 = require('./appOrgCascader/index.js');
3
+ var index$b = require('./appOrgCascader/index.js');
4
4
  var index$2 = require('./appConfirmDialog/index.js');
5
- var index$3 = require('./appDatePicker/index.js');
6
- var index$4 = require('./appForm/index.js');
7
- var index$5 = require('./appIcon/index.js');
8
- var index$6 = require('./appIconBox/index.js');
9
- var index$a = require('./appSearch/index.js');
10
- var index$b = require('./appTable/index.js');
11
- var index$c = require('./appTooltip/index.js');
5
+ var index$4 = require('./appDatePicker/index.js');
6
+ var index$6 = require('./appForm/index.js');
7
+ var index$7 = require('./appIcon/index.js');
8
+ var index$8 = require('./appIconBox/index.js');
9
+ var index$c = require('./appSearch/index.js');
10
+ var index$d = require('./appTable/index.js');
11
+ var index$e = require('./appTooltip/index.js');
12
12
  var index$1 = require('./appConfigProvider/index.js');
13
13
  var index = require('./appButton/index.js');
14
- var index$d = require('./appUserAvatar/index.js');
15
- var index$7 = require('./appNoPermissions/index.js');
16
- var index$8 = require('./appNoPermissionsMap/index.js');
14
+ var index$f = require('./appUserAvatar/index.js');
15
+ var index$9 = require('./appNoPermissions/index.js');
16
+ var index$a = require('./appNoPermissionsMap/index.js');
17
+ var index$3 = require('./appCutter/index.js');
18
+ var index$5 = require('./appDialog/index.js');
17
19
  var useAppForm = require('./appForm/js/useAppForm.js');
18
20
  var useAppSearch = require('./appSearch/js/useAppSearch.js');
19
21
  var useAppTable = require('./appTable/js/useAppTable.js');
20
22
 
21
23
 
22
24
 
23
- exports.AppOrgCascader = index$9.AppOrgCascader;
25
+ exports.AppOrgCascader = index$b.AppOrgCascader;
24
26
  exports.AppConfirmDialog = index$2.AppConfirmDialog;
25
- exports.AppDatePicker = index$3.AppDatePicker;
26
- exports.AppForm = index$4.AppForm;
27
- exports.AppIcon = index$5.AppIcon;
28
- exports.AppIconBox = index$6.AppIconBox;
29
- exports.AppSearch = index$a.AppSearch;
30
- exports.AppTable = index$b.AppTable;
31
- exports.AppTooltip = index$c.AppTooltip;
27
+ exports.AppDatePicker = index$4.AppDatePicker;
28
+ exports.AppForm = index$6.AppForm;
29
+ exports.AppIcon = index$7.AppIcon;
30
+ exports.AppIconBox = index$8.AppIconBox;
31
+ exports.AppSearch = index$c.AppSearch;
32
+ exports.AppTable = index$d.AppTable;
33
+ exports.AppTooltip = index$e.AppTooltip;
32
34
  exports.AppConfigProvider = index$1.AppConfigProvider;
33
35
  exports.AppButton = index.AppButton;
34
- exports.AppUserAvatar = index$d.AppUserAvatar;
35
- exports.AppNoPermissions = index$7.AppNoPermissions;
36
- exports.AppNoPermissionsMap = index$8.AppNoPermissionsMap;
36
+ exports.AppUserAvatar = index$f.AppUserAvatar;
37
+ exports.AppNoPermissions = index$9.AppNoPermissions;
38
+ exports.AppNoPermissionsMap = index$a.AppNoPermissionsMap;
39
+ exports.AppCutter = index$3.AppCutter;
40
+ exports.AppDialog = index$5.AppDialog;
37
41
  exports.useAppForm = useAppForm.useAppForm;
38
42
  exports.useAppSearch = useAppSearch.useAppSearch;
39
43
  exports.useAppTable = useAppTable.useAppTable;
@@ -2,10 +2,12 @@
2
2
 
3
3
  var axios = require('axios');
4
4
  var vue = require('vue');
5
+ var useGlobalConfig = require('./useGlobalConfig.js');
5
6
 
6
7
  const localApiKey = /* @__PURE__ */ Symbol("localApiKey");
7
8
  const defaultAxios = vue.ref(
8
9
  axios.create({
10
+ baseURL: "/api/admin",
9
11
  withCredentials: false,
10
12
  timeout: 6e4
11
13
  })
@@ -20,8 +22,10 @@ defaultAxios.value.interceptors.response.use(
20
22
  }
21
23
  );
22
24
  const useApi = () => {
23
- const api = vue.inject(localApiKey, defaultAxios);
24
- return { api: vue.unref(api) ? api : defaultAxios };
25
+ var _a;
26
+ const api = vue.inject(localApiKey, vue.ref());
27
+ const globalConfig = useGlobalConfig.useGlobalConfig();
28
+ return { api: vue.unref(api) ? api : ((_a = vue.unref(globalConfig)) == null ? void 0 : _a.api) || defaultAxios };
25
29
  };
26
30
 
27
31
  exports.defaultAxios = defaultAxios;
@@ -2,6 +2,8 @@
2
2
 
3
3
  var vue = require('vue');
4
4
  var lodashUnified = require('lodash-unified');
5
+ var useGlobalConfig = require('./useGlobalConfig.js');
6
+ var index = require('../locale/index.js');
5
7
  var zh_CN = require('../locale/zh_CN.js');
6
8
 
7
9
  const buildTranslator = (locale) => (path, option) => translate(path, option, vue.unref(locale));
@@ -23,13 +25,21 @@ const buildLocaleContext = (locale, conifg) => {
23
25
  };
24
26
  const localeContextKey = /* @__PURE__ */ Symbol("localeContextKey");
25
27
  const getLanguage = (localeOverrides) => {
26
- var _a, _b;
28
+ var _a;
27
29
  const locale = localeOverrides || vue.inject(localeContextKey, vue.ref());
28
- return ((_a = vue.unref(locale)) == null ? void 0 : _a.name) || ((_b = zh_CN.default) == null ? void 0 : _b.name);
30
+ return ((_a = vue.unref(locale)) == null ? void 0 : _a.name) || (Chinese == null ? void 0 : Chinese.name);
29
31
  };
30
32
  const useLocale = (localeOverrides) => {
31
33
  const locale = localeOverrides || vue.inject(localeContextKey, vue.ref());
32
- return buildLocaleContext(vue.computed(() => vue.unref(locale) || zh_CN.default));
34
+ const globalConfig = useGlobalConfig.useGlobalConfig();
35
+ return buildLocaleContext(
36
+ vue.computed(
37
+ () => {
38
+ var _a;
39
+ return vue.unref(locale) || index[(_a = vue.unref(globalConfig)) == null ? void 0 : _a.locale] || zh_CN.default;
40
+ }
41
+ )
42
+ );
33
43
  };
34
44
 
35
45
  exports.buildLocaleContext = buildLocaleContext;
@@ -1,11 +1,15 @@
1
1
  'use strict';
2
2
 
3
3
  var vue = require('vue');
4
+ var useGlobalConfig = require('./useGlobalConfig.js');
4
5
 
5
6
  const localUserAvatarMapKey = /* @__PURE__ */ Symbol("userAvatarMap");
6
7
  const useUserAvatarMap = () => {
7
- const userAvatarMap = vue.inject(localUserAvatarMapKey, vue.ref(/* @__PURE__ */ new Map()));
8
- return { userAvatarMap };
8
+ const userAvatarMap = vue.inject(localUserAvatarMapKey, vue.ref());
9
+ const globalConfig = useGlobalConfig.useGlobalConfig();
10
+ return {
11
+ userAvatarMap: unref(userAvatarMap) ? userAvatarMap : unref(globalConfig).userAvatarMap || vue.ref(/* @__PURE__ */ new Map())
12
+ };
9
13
  };
10
14
 
11
15
  exports.localUserAvatarMapKey = localUserAvatarMapKey;
package/lib/index.js CHANGED
@@ -6,18 +6,21 @@ var makeInstaller = require('./make-installer.js');
6
6
  var index = require('./components/appButton/index.js');
7
7
  var index$1 = require('./components/appConfigProvider/index.js');
8
8
  var index$2 = require('./components/appConfirmDialog/index.js');
9
- var index$3 = require('./components/appDatePicker/index.js');
10
- var index$4 = require('./components/appForm/index.js');
11
- var index$5 = require('./components/appIcon/index.js');
12
- var index$6 = require('./components/appIconBox/index.js');
13
- var index$7 = require('./components/appNoPermissions/index.js');
14
- var index$8 = require('./components/appNoPermissionsMap/index.js');
15
- var index$9 = require('./components/appOrgCascader/index.js');
16
- var index$a = require('./components/appSearch/index.js');
17
- var index$b = require('./components/appTable/index.js');
18
- var index$c = require('./components/appTooltip/index.js');
19
- var index$d = require('./components/appUserAvatar/index.js');
9
+ var index$3 = require('./components/appCutter/index.js');
10
+ var index$4 = require('./components/appDatePicker/index.js');
11
+ var index$5 = require('./components/appDialog/index.js');
12
+ var index$6 = require('./components/appForm/index.js');
13
+ var index$7 = require('./components/appIcon/index.js');
14
+ var index$8 = require('./components/appIconBox/index.js');
15
+ var index$9 = require('./components/appNoPermissions/index.js');
16
+ var index$a = require('./components/appNoPermissionsMap/index.js');
17
+ var index$b = require('./components/appOrgCascader/index.js');
18
+ var index$c = require('./components/appSearch/index.js');
19
+ var index$d = require('./components/appTable/index.js');
20
+ var index$e = require('./components/appTooltip/index.js');
21
+ var index$f = require('./components/appUserAvatar/index.js');
20
22
  var crypto = require('./utils/crypto.js');
23
+ var file = require('./utils/file.js');
21
24
  var useLocale = require('./hooks/useLocale.js');
22
25
  var bus = require('./utils/bus.js');
23
26
  var handler = require('./utils/handler.js');
@@ -40,20 +43,29 @@ exports.default = makeInstaller.default;
40
43
  exports.AppButton = index.AppButton;
41
44
  exports.AppConfigProvider = index$1.AppConfigProvider;
42
45
  exports.AppConfirmDialog = index$2.AppConfirmDialog;
43
- exports.AppDatePicker = index$3.AppDatePicker;
44
- exports.AppForm = index$4.AppForm;
45
- exports.AppIcon = index$5.AppIcon;
46
- exports.AppIconBox = index$6.AppIconBox;
47
- exports.AppNoPermissions = index$7.AppNoPermissions;
48
- exports.AppNoPermissionsMap = index$8.AppNoPermissionsMap;
49
- exports.AppOrgCascader = index$9.AppOrgCascader;
50
- exports.AppSearch = index$a.AppSearch;
51
- exports.AppTable = index$b.AppTable;
52
- exports.AppTooltip = index$c.AppTooltip;
53
- exports.AppUserAvatar = index$d.AppUserAvatar;
46
+ exports.AppCutter = index$3.AppCutter;
47
+ exports.AppDatePicker = index$4.AppDatePicker;
48
+ exports.AppDialog = index$5.AppDialog;
49
+ exports.AppForm = index$6.AppForm;
50
+ exports.AppIcon = index$7.AppIcon;
51
+ exports.AppIconBox = index$8.AppIconBox;
52
+ exports.AppNoPermissions = index$9.AppNoPermissions;
53
+ exports.AppNoPermissionsMap = index$a.AppNoPermissionsMap;
54
+ exports.AppOrgCascader = index$b.AppOrgCascader;
55
+ exports.AppSearch = index$c.AppSearch;
56
+ exports.AppTable = index$d.AppTable;
57
+ exports.AppTooltip = index$e.AppTooltip;
58
+ exports.AppUserAvatar = index$f.AppUserAvatar;
54
59
  exports.base64Decrypt = crypto.base64Decrypt;
55
60
  exports.encryptToBase64 = crypto.encryptToBase64;
56
61
  exports.generateRandomCode = crypto.generateRandomCode;
62
+ exports.blobToDataURL = file.blobToDataURL;
63
+ exports.directTransmission = file.directTransmission;
64
+ exports.fileFormUpload = file.fileFormUpload;
65
+ exports.fileJsonUplaod = file.fileJsonUplaod;
66
+ exports.fileUpload = file.fileUpload;
67
+ exports.presignedUrl = file.presignedUrl;
68
+ exports.sizeToTextHandler = file.sizeToTextHandler;
57
69
  exports.buildLocaleContext = useLocale.buildLocaleContext;
58
70
  exports.buildTranslator = useLocale.buildTranslator;
59
71
  exports.getLanguage = useLocale.getLanguage;
@@ -76,6 +88,7 @@ exports.getDefaultValueFormatByType = date.getDefaultValueFormatByType;
76
88
  exports.isArray = is.isArray;
77
89
  exports.isBoolean = is.isBoolean;
78
90
  exports.isEmpty = is.isEmpty;
91
+ exports.isFile = is.isFile;
79
92
  exports.isFunction = is.isFunction;
80
93
  exports.isNull = is.isNull;
81
94
  exports.isNumber = is.isNumber;
package/lib/locale/en.js CHANGED
@@ -55,7 +55,7 @@ var en = {
55
55
  searchFor: "Search For {0}",
56
56
  example: "Example"
57
57
  },
58
- confirmDialog: {
58
+ dialog: {
59
59
  content: "Secondary Confirmation Operation",
60
60
  close: "Close",
61
61
  cancel: "Cancel",
@@ -77,6 +77,11 @@ var en = {
77
77
  pleaseContactTheAdministrator: "Please Contact The Administrator",
78
78
  youDoNotHaveAMapConfigurationForThisModule: "You Do Not Have A Map Configuration For This Module",
79
79
  pleaseContactTheAdministratorToGoToTheSettingsCenterForConfiguration: "Please Contact The Administrator To Go To The Settings Center For Configuration"
80
+ },
81
+ cutter: {
82
+ uploadPictures: "Upload Picture",
83
+ uploadPictureLimit: "The Image Upload Failed. The File Size Cannot Exceed {0}",
84
+ imageSegmentation: "Image Segmentation"
80
85
  }
81
86
  };
82
87
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var Chinese = {
5
+ var zh_CN = {
6
6
  name: "zh_CN",
7
7
  hy: {
8
8
  language: "\u8BED\u8A00",
@@ -56,7 +56,7 @@ var Chinese = {
56
56
  maxColumnLimitTip: "\u5DF2\u8FBE\u5230\u5B57\u6BB5\u6570\u91CF\u4E0A\u9650(\u6700\u591A15\u4E2A)\uFF0C\u8BF7\u53D6\u6D88\u90E8\u5206\u5B57\u6BB5\u540E\u518D\u786E\u8BA4",
57
57
  example: "\u793A\u4F8B"
58
58
  },
59
- confirmDialog: {
59
+ dialog: {
60
60
  content: "\u4E8C\u6B21\u786E\u8BA4\u64CD\u4F5C",
61
61
  close: "\u5173\u95ED",
62
62
  cancel: "\u53D6\u6D88",
@@ -77,7 +77,12 @@ var Chinese = {
77
77
  pleaseContactTheAdministrator: "\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458",
78
78
  youDoNotHaveAMapConfigurationForThisModule: "\u60A8\u6CA1\u6709\u8BE5\u6A21\u5757\u7684\u5730\u56FE\u914D\u7F6E",
79
79
  pleaseContactTheAdministratorToGoToTheSettingsCenterForConfiguration: "\u8BF7\u8054\u7CFB\u7BA1\u7406\u5458\u524D\u5F80\u8BBE\u7F6E\u4E2D\u5FC3\u8FDB\u884C\u914D\u7F6E"
80
+ },
81
+ cutter: {
82
+ uploadPicture: "\u4E0A\u4F20\u56FE\u7247",
83
+ uploadPictureLimit: "\u56FE\u7247\u4E0A\u4F20\u5931\u8D25\uFF0C\u6587\u4EF6\u4E0D\u80FD\u5927\u4E8E{0}",
84
+ imageSegmentation: "\u56FE\u50CF\u5207\u5272"
80
85
  }
81
86
  };
82
87
 
83
- exports.default = Chinese;
88
+ exports.default = zh_CN;
@@ -0,0 +1,76 @@
1
+ 'use strict';
2
+
3
+ var vue = require('vue');
4
+ var handler = require('./handler.js');
5
+ var useApi = require('../hooks/useApi.js');
6
+
7
+ function blobToDataURL(bolb) {
8
+ return new Promise((resolve) => {
9
+ const a = new FileReader();
10
+ a.onload = function(e) {
11
+ resolve(e.target.result);
12
+ };
13
+ a.readAsDataURL(bolb);
14
+ });
15
+ }
16
+ async function presignedUrl(file) {
17
+ const { api } = useApi.useApi();
18
+ const fileList = file.name.split(".");
19
+ const res = await vue.unref(api).post("file/presignedUrl", {
20
+ fileName: `${handler.createUniqueId(1)}.${fileList[fileList.length - 1]}`
21
+ });
22
+ if (res.code === 200) {
23
+ return res;
24
+ } else {
25
+ return Promise.reject(res);
26
+ }
27
+ }
28
+ async function fileJsonUplaod(file) {
29
+ const { api } = useApi.useApi();
30
+ const result = await presignedUrl(file);
31
+ await vue.unref(api).put(result.data.url, file, {
32
+ otherUrl: true,
33
+ xAmzAcl: true
34
+ });
35
+ return result;
36
+ }
37
+ async function fileFormUpload(file) {
38
+ const { api } = useApi.useApi();
39
+ try {
40
+ const formData = new FormData();
41
+ formData.append("file", file);
42
+ const res = await vue.unref(api).post("/file/upload", formData, {
43
+ otherUrl: true,
44
+ xAmzAcl: false
45
+ });
46
+ return res;
47
+ } catch (err) {
48
+ return Promise.reject(err);
49
+ }
50
+ }
51
+ let directTransmission = true;
52
+ async function fileUpload(file) {
53
+ {
54
+ return await fileJsonUplaod(file);
55
+ }
56
+ }
57
+ async function sizeToTextHandler(size) {
58
+ if (size < Math.pow(1024, 1)) {
59
+ return `${Math.floor(size / Math.pow(1024, 1) / 100) * 100}KB`;
60
+ }
61
+ if (size < Math.pow(1024, 2)) {
62
+ return `${Math.floor(size / Math.pow(1024, 2) / 100) * 100}MB`;
63
+ }
64
+ if (size < Math.pow(1024, 3)) {
65
+ return `${Math.floor(size / Math.pow(1024, 3) / 100) * 100}GB`;
66
+ }
67
+ return `${Math.floor(size / Math.pow(1024, 4) / 100) * 100}TB`;
68
+ }
69
+
70
+ exports.blobToDataURL = blobToDataURL;
71
+ exports.directTransmission = directTransmission;
72
+ exports.fileFormUpload = fileFormUpload;
73
+ exports.fileJsonUplaod = fileJsonUplaod;
74
+ exports.fileUpload = fileUpload;
75
+ exports.presignedUrl = presignedUrl;
76
+ exports.sizeToTextHandler = sizeToTextHandler;
@@ -6,6 +6,7 @@ var crypto = require('./crypto.js');
6
6
  var is = require('./is.js');
7
7
  var handler = require('./handler.js');
8
8
  var date = require('./date.js');
9
+ var file = require('./file.js');
9
10
 
10
11
 
11
12
 
@@ -20,6 +21,7 @@ exports.generateRandomCode = crypto.generateRandomCode;
20
21
  exports.isArray = is.isArray;
21
22
  exports.isBoolean = is.isBoolean;
22
23
  exports.isEmpty = is.isEmpty;
24
+ exports.isFile = is.isFile;
23
25
  exports.isFunction = is.isFunction;
24
26
  exports.isNull = is.isNull;
25
27
  exports.isNumber = is.isNumber;
@@ -35,3 +37,10 @@ exports.funRunHandler = handler.funRunHandler;
35
37
  exports.mergeDeep = handler.mergeDeep;
36
38
  exports.withInstall = handler.withInstall;
37
39
  exports.getDefaultValueFormatByType = date.getDefaultValueFormatByType;
40
+ exports.blobToDataURL = file.blobToDataURL;
41
+ exports.directTransmission = file.directTransmission;
42
+ exports.fileFormUpload = file.fileFormUpload;
43
+ exports.fileJsonUplaod = file.fileJsonUplaod;
44
+ exports.fileUpload = file.fileUpload;
45
+ exports.presignedUrl = file.presignedUrl;
46
+ exports.sizeToTextHandler = file.sizeToTextHandler;
package/lib/utils/is.js CHANGED
@@ -16,10 +16,14 @@ const isOverflowing = (e) => e.clientWidth < e.scrollWidth || e.clientHeight < e
16
16
  const isVueProxy = (e) => {
17
17
  return vue.isRef(e) || vue.isReactive(e) || vue.isReadonly(e) || vue.isProxy(e);
18
18
  };
19
+ const isFile = (e) => {
20
+ return e instanceof File;
21
+ };
19
22
 
20
23
  exports.isArray = isArray;
21
24
  exports.isBoolean = isBoolean;
22
25
  exports.isEmpty = isEmpty;
26
+ exports.isFile = isFile;
23
27
  exports.isFunction = isFunction;
24
28
  exports.isNull = isNull;
25
29
  exports.isNumber = isNumber;
package/lib/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "0.1.4";
3
+ const version = "0.1.6";
4
4
 
5
5
  exports.version = version;