hy-dispatch-ui-v3 0.1.5 → 0.2.0

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 (174) hide show
  1. package/README.md +47 -0
  2. package/dist/tailwind.css +408 -4
  3. package/es/components/appAudioPlayer/appAudioPlayer.vue.mjs +462 -0
  4. package/es/components/appAudioPlayer/index.mjs +6 -0
  5. package/es/components/appAudioPlayer/js/index.mjs +327 -0
  6. package/es/components/appAudioPlayer/style/appAudioPlayer.scss +319 -0
  7. package/es/components/appButton/style/appButton.scss +0 -1
  8. package/es/components/appConfigProvider/appConfigProvider.vue.mjs +25 -4
  9. package/es/components/appConfirmDialog/appConfirmDialog.vue.mjs +3 -3
  10. package/es/components/appConfirmDialog/appConfirmMethod.mjs +13 -13
  11. package/es/components/appCutter/appCutter.vue.mjs +358 -0
  12. package/es/components/appCutter/index.mjs +6 -0
  13. package/es/components/appCutter/style/appCutter.scss +51 -0
  14. package/es/components/appDatePicker/appDatePicker.vue.mjs +1 -1
  15. package/es/components/appDialog/appDialog.vue.mjs +205 -0
  16. package/es/components/appDialog/index.mjs +6 -0
  17. package/es/components/appDialog/style/appDialog.scss +0 -0
  18. package/es/components/appForm/appForm.vue.mjs +132 -209
  19. package/es/components/appForm/cpns/appFormItem.vue.mjs +312 -0
  20. package/es/components/appForm/cpns/arrayItem.vue.mjs +305 -0
  21. package/es/components/appForm/cpns/extraItem.vue.mjs +140 -0
  22. package/es/components/appForm/js/index.mjs +46 -24
  23. package/es/components/appForm/js/useAppForm.mjs +30 -6
  24. package/es/components/appForm/style/appForm.scss +53 -0
  25. package/es/components/appIcon/appIcon.vue.mjs +2 -1
  26. package/es/components/appIconBox/style/appIconBox.scss +0 -1
  27. package/es/components/appInput/appInput.vue.mjs +99 -0
  28. package/es/components/appInput/index.mjs +6 -0
  29. package/es/components/appMenu/appMenu.vue.mjs +129 -0
  30. package/es/components/appMenu/index.mjs +6 -0
  31. package/es/components/appMenu/style/appMenu.scss +145 -0
  32. package/es/components/appOrgCascader/appOrgCascader.vue.mjs +14 -10
  33. package/es/components/appSearch/appSearch.vue.mjs +55 -211
  34. package/es/components/appSearch/cpns/appSearchItem.vue.mjs +238 -0
  35. package/es/components/appSearch/js/index.mjs +20 -8
  36. package/es/components/appSearch/js/useAppSearch.mjs +10 -5
  37. package/es/components/appSearch/style/appSearch.scss +10 -0
  38. package/es/components/appTable/appTable.vue.mjs +313 -159
  39. package/es/components/appTable/cpns/columnSelect.vue.mjs +151 -156
  40. package/es/components/appTable/cpns/columnSelectItem.vue2.mjs +104 -110
  41. package/es/components/appTable/cpns/headerItem.vue.mjs +98 -0
  42. package/es/components/appTable/cpns/virtualTable.vue.mjs +560 -0
  43. package/es/components/appTable/js/index.mjs +46 -20
  44. package/es/components/appTable/js/search.mjs +1 -2
  45. package/es/components/appTable/js/useAppTable.mjs +58 -14
  46. package/es/components/appTable/style/appTable.scss +16 -0
  47. package/es/components/appTooltip/appTooltip.vue.mjs +24 -13
  48. package/es/components/appTree/appTree.vue.mjs +304 -0
  49. package/es/components/appTree/index.mjs +6 -0
  50. package/es/components/appTree/js/index.mjs +531 -0
  51. package/es/components/appUserAvatar/appUserAvatar.vue.mjs +9 -8
  52. package/es/components/appUserAvatar/style/appUserAvatar.scss +0 -1
  53. package/es/components/appVideoPlayer/appVideoPlayer.vue.mjs +647 -0
  54. package/es/components/appVideoPlayer/cpns/mediaLoading.vue.mjs +35 -0
  55. package/es/components/appVideoPlayer/index.mjs +6 -0
  56. package/es/components/appVideoPlayer/js/index.mjs +426 -0
  57. package/es/components/appVideoPlayer/style/appVideoPlayer.scss +275 -0
  58. package/es/components/appVideoPlayer/style/mediaLoading.scss +62 -0
  59. package/es/components/index.mjs +7 -0
  60. package/es/hooks/index.mjs +3 -0
  61. package/es/hooks/useApi.mjs +7 -3
  62. package/es/hooks/useAudioPlayerConfig.mjs +12 -0
  63. package/es/hooks/useGlobalConfig.mjs +20 -9
  64. package/es/hooks/useLocale.mjs +10 -8
  65. package/es/hooks/useMixins.mjs +1 -1
  66. package/es/hooks/usePermissionMap.mjs +12 -0
  67. package/es/hooks/useUserAvatarMap.mjs +6 -3
  68. package/es/hooks/useVideoPlayerConfig.mjs +12 -0
  69. package/es/index.mjs +16 -3
  70. package/es/locale/en.mjs +58 -4
  71. package/es/locale/zh_CN.mjs +56 -6
  72. package/es/make-installer.mjs +2 -0
  73. package/es/static/hy-svg-icons.js +462 -0
  74. package/es/static/protocolcheck.js +247 -0
  75. package/es/style/element/element.scss +9 -0
  76. package/es/style/element/index.scss +6 -3
  77. package/es/style/index.scss +11 -0
  78. package/es/style/theme.scss +73 -0
  79. package/es/utils/date.mjs +25 -1
  80. package/es/utils/file.mjs +69 -0
  81. package/es/utils/form.mjs +52 -0
  82. package/es/utils/handler.mjs +22 -2
  83. package/es/utils/index.mjs +6 -3
  84. package/es/utils/is.mjs +26 -2
  85. package/es/utils/loadScript.mjs +33 -0
  86. package/es/version.mjs +1 -1
  87. package/lib/components/appAudioPlayer/appAudioPlayer.vue.js +466 -0
  88. package/lib/components/appAudioPlayer/index.js +11 -0
  89. package/lib/components/appAudioPlayer/js/index.js +329 -0
  90. package/lib/components/appAudioPlayer/style/appAudioPlayer.scss +319 -0
  91. package/lib/components/appButton/style/appButton.scss +0 -1
  92. package/lib/components/appConfigProvider/appConfigProvider.vue.js +23 -2
  93. package/lib/components/appConfirmDialog/appConfirmDialog.vue.js +3 -3
  94. package/lib/components/appConfirmDialog/appConfirmMethod.js +13 -13
  95. package/lib/components/appCutter/appCutter.vue.js +362 -0
  96. package/lib/components/appCutter/index.js +11 -0
  97. package/lib/components/appCutter/style/appCutter.scss +51 -0
  98. package/lib/components/appDatePicker/appDatePicker.vue.js +1 -1
  99. package/lib/components/appDialog/appDialog.vue.js +209 -0
  100. package/lib/components/appDialog/index.js +11 -0
  101. package/lib/components/appDialog/style/appDialog.scss +0 -0
  102. package/lib/components/appForm/appForm.vue.js +129 -206
  103. package/lib/components/appForm/cpns/appFormItem.vue.js +316 -0
  104. package/lib/components/appForm/cpns/arrayItem.vue.js +309 -0
  105. package/lib/components/appForm/cpns/extraItem.vue.js +144 -0
  106. package/lib/components/appForm/js/index.js +48 -23
  107. package/lib/components/appForm/js/useAppForm.js +30 -6
  108. package/lib/components/appForm/style/appForm.scss +53 -0
  109. package/lib/components/appIcon/appIcon.vue.js +2 -1
  110. package/lib/components/appIconBox/style/appIconBox.scss +0 -1
  111. package/lib/components/appInput/appInput.vue.js +103 -0
  112. package/lib/components/appInput/index.js +11 -0
  113. package/lib/components/appMenu/appMenu.vue.js +133 -0
  114. package/lib/components/appMenu/index.js +11 -0
  115. package/lib/components/appMenu/style/appMenu.scss +145 -0
  116. package/lib/components/appOrgCascader/appOrgCascader.vue.js +14 -10
  117. package/lib/components/appSearch/appSearch.vue.js +51 -207
  118. package/lib/components/appSearch/cpns/appSearchItem.vue.js +242 -0
  119. package/lib/components/appSearch/js/index.js +20 -7
  120. package/lib/components/appSearch/js/useAppSearch.js +10 -5
  121. package/lib/components/appSearch/style/appSearch.scss +10 -0
  122. package/lib/components/appTable/appTable.vue.js +320 -166
  123. package/lib/components/appTable/cpns/columnSelect.vue.js +151 -156
  124. package/lib/components/appTable/cpns/columnSelectItem.vue2.js +105 -111
  125. package/lib/components/appTable/cpns/headerItem.vue.js +102 -0
  126. package/lib/components/appTable/cpns/virtualTable.vue.js +564 -0
  127. package/lib/components/appTable/js/index.js +47 -19
  128. package/lib/components/appTable/js/search.js +1 -2
  129. package/lib/components/appTable/js/useAppTable.js +57 -13
  130. package/lib/components/appTable/style/appTable.scss +16 -0
  131. package/lib/components/appTooltip/appTooltip.vue.js +23 -12
  132. package/lib/components/appTree/appTree.vue.js +308 -0
  133. package/lib/components/appTree/index.js +11 -0
  134. package/lib/components/appTree/js/index.js +533 -0
  135. package/lib/components/appUserAvatar/appUserAvatar.vue.js +9 -8
  136. package/lib/components/appUserAvatar/style/appUserAvatar.scss +0 -1
  137. package/lib/components/appVideoPlayer/appVideoPlayer.vue.js +651 -0
  138. package/lib/components/appVideoPlayer/cpns/mediaLoading.vue.js +39 -0
  139. package/lib/components/appVideoPlayer/index.js +11 -0
  140. package/lib/components/appVideoPlayer/js/index.js +429 -0
  141. package/lib/components/appVideoPlayer/style/appVideoPlayer.scss +275 -0
  142. package/lib/components/appVideoPlayer/style/mediaLoading.scss +62 -0
  143. package/lib/components/index.js +42 -28
  144. package/lib/hooks/index.js +9 -0
  145. package/lib/hooks/useApi.js +7 -3
  146. package/lib/hooks/useAudioPlayerConfig.js +15 -0
  147. package/lib/hooks/useGlobalConfig.js +18 -7
  148. package/lib/hooks/useLocale.js +9 -7
  149. package/lib/hooks/useMixins.js +1 -1
  150. package/lib/hooks/usePermissionMap.js +15 -0
  151. package/lib/hooks/useUserAvatarMap.js +5 -2
  152. package/lib/hooks/useVideoPlayerConfig.js +15 -0
  153. package/lib/index.js +70 -28
  154. package/lib/locale/en.js +58 -4
  155. package/lib/locale/zh_CN.js +56 -6
  156. package/lib/make-installer.js +2 -0
  157. package/lib/static/hy-svg-icons.js +459 -8
  158. package/lib/static/protocolcheck.js +249 -0
  159. package/lib/style/element/element.scss +9 -0
  160. package/lib/style/element/index.scss +6 -3
  161. package/lib/style/index.scss +11 -0
  162. package/lib/style/theme.scss +73 -0
  163. package/lib/utils/date.js +25 -0
  164. package/lib/utils/file.js +76 -0
  165. package/lib/utils/form.js +57 -0
  166. package/lib/utils/handler.js +22 -1
  167. package/lib/utils/index.js +19 -0
  168. package/lib/utils/is.js +27 -1
  169. package/lib/utils/loadScript.js +37 -0
  170. package/lib/version.js +1 -1
  171. package/package.json +13 -12
  172. package/es/config/index.mjs +0 -1
  173. package/es/static/hy-svg-icons.mjs +0 -11
  174. package/lib/config/index.js +0 -2
@@ -149,7 +149,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
149
149
  vue.createElementVNode(
150
150
  "span",
151
151
  { class: "text-sm text-main font-bold" },
152
- vue.toDisplayString(__props.dialogTitle || vue.unref(t)("confirmDialog.prompt")),
152
+ vue.toDisplayString(__props.dialogTitle || vue.unref(t)("dialog.prompt")),
153
153
  1
154
154
  /* TEXT */
155
155
  ),
@@ -216,7 +216,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
216
216
  }, {
217
217
  default: vue.withCtx(() => [
218
218
  vue.createTextVNode(
219
- vue.toDisplayString(__props.cancelText || vue.unref(t)("confirmDialog.cancel")),
219
+ vue.toDisplayString(__props.cancelText || vue.unref(t)("dialog.cancel")),
220
220
  1
221
221
  /* TEXT */
222
222
  )
@@ -232,7 +232,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
232
232
  }, {
233
233
  default: vue.withCtx(() => [
234
234
  vue.createTextVNode(
235
- vue.toDisplayString(__props.submitText || vue.unref(t)("confirmDialog.confirm")),
235
+ vue.toDisplayString(__props.submitText || vue.unref(t)("dialog.confirm")),
236
236
  1
237
237
  /* TEXT */
238
238
  )
@@ -6,8 +6,8 @@ var vue = require('vue');
6
6
  var useApi = require('../../hooks/useApi.js');
7
7
  var index = require('../appConfigProvider/index.js');
8
8
  var appConfirmDialog = require('./appConfirmDialog.vue.js');
9
- var useGlobalConfig = require('../../hooks/useGlobalConfig.js');
10
9
  var useLocale = require('../../hooks/useLocale.js');
10
+ var useGlobalConfig = require('../../hooks/useGlobalConfig.js');
11
11
 
12
12
  function appConfirmMethod(config) {
13
13
  let container = document.createDocumentFragment();
@@ -56,9 +56,9 @@ function appConfirmMethod(config) {
56
56
  appConfirmDialog.default.tip = (props) => {
57
57
  const { t } = useLocale.useLocale();
58
58
  return appConfirmMethod({
59
- dialogTitle: t("confirmDialog.prompt"),
60
- title: t("confirmDialog.prompt"),
61
- content: t("confirmDialog.content"),
59
+ dialogTitle: t("dialog.prompt"),
60
+ title: t("dialog.prompt"),
61
+ content: t("dialog.content"),
62
62
  showCancel: false,
63
63
  ...props
64
64
  });
@@ -66,19 +66,19 @@ appConfirmDialog.default.tip = (props) => {
66
66
  appConfirmDialog.default.confirm = (props) => {
67
67
  const { t } = useLocale.useLocale();
68
68
  return appConfirmMethod({
69
- dialogTitle: t("confirmDialog.prompt"),
70
- title: t("confirmDialog.prompt"),
71
- content: t("confirmDialog.content"),
69
+ dialogTitle: t("dialog.prompt"),
70
+ title: t("dialog.prompt"),
71
+ content: t("dialog.content"),
72
72
  ...props
73
73
  });
74
74
  };
75
75
  appConfirmDialog.default.warning = (props) => {
76
76
  const { t } = useLocale.useLocale();
77
77
  return appConfirmMethod({
78
- dialogTitle: t("confirmDialog.riskWarning"),
79
- title: t("confirmDialog.prompt"),
78
+ dialogTitle: t("dialog.riskWarning"),
79
+ title: t("dialog.prompt"),
80
80
  titleClass: "text-warning",
81
- content: t("confirmDialog.content"),
81
+ content: t("dialog.content"),
82
82
  iconColor: "rgb(var(--hy-warning))",
83
83
  ...props
84
84
  });
@@ -86,10 +86,10 @@ appConfirmDialog.default.warning = (props) => {
86
86
  appConfirmDialog.default.danger = (props) => {
87
87
  const { t } = useLocale.useLocale();
88
88
  return appConfirmMethod({
89
- dialogTitle: t("confirmDialog.dangerousOperation"),
89
+ dialogTitle: t("dialog.dangerousOperation"),
90
90
  titleClass: "text-danger",
91
- title: t("confirmDialog.prompt"),
92
- content: t("confirmDialog.content"),
91
+ title: t("dialog.prompt"),
92
+ content: t("dialog.content"),
93
93
  submitType: "danger",
94
94
  iconColor: "rgb(var(--hy-danger))",
95
95
  ...props
@@ -0,0 +1,362 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var vue = require('vue');
6
+ var vueCropper = require('vue-cropper');
7
+ var elementPlus = require('element-plus');
8
+ var iconsVue = require('@element-plus/icons-vue');
9
+ var file = require('../../utils/file.js');
10
+ var index = require('../appDialog/index.js');
11
+ var useLocale = require('../../hooks/useLocale.js');
12
+
13
+ import "vue-cropper/dist/index.css";
14
+
15
+ import "./style/appCutter.scss";
16
+
17
+ const __default__ = vue.defineComponent({
18
+ name: "AppCutter"
19
+ });
20
+ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
21
+ props: /* @__PURE__ */ vue.mergeModels({
22
+ defaultImg: { type: String },
23
+ // 默认展示图片
24
+ uploadText: {
25
+ // 上传文本
26
+ type: String,
27
+ default: () => {
28
+ const { t } = useLocale.useLocale();
29
+ return t("cutter.uploadPicture");
30
+ }
31
+ },
32
+ showUpload: { type: Boolean, default: true },
33
+ // 是否显示上传模块
34
+ showText: { type: Boolean, default: true },
35
+ // 是否显示上传提示文本
36
+ showDelete: { type: Boolean, default: true },
37
+ // 是否显示删除按钮
38
+ maxSize: { type: Number, default: 1024 * 1024 * 2 },
39
+ // 限制上传文件大小
40
+ accept: { type: String, default: "image/png,image/jpg,image/jpeg,image/gif" },
41
+ // 限制上传文件类型
42
+ info: { type: Boolean, default: true },
43
+ // 裁剪框的大小信息
44
+ outputSize: { type: Number, default: 1 },
45
+ // 裁剪生成图片的质量
46
+ outputType: { type: String, default: "jpeg" },
47
+ // 裁剪生成图片的格式
48
+ autoCrop: { type: Boolean, default: true },
49
+ // 是否默认生成截图框
50
+ autoCropWidth: { type: Number, default: 100 },
51
+ // 默认生成截图框宽度
52
+ autoCropHeight: { type: Number, default: 100 },
53
+ // 默认生成截图框高度
54
+ fixedBox: { type: Boolean, default: false },
55
+ // 固定截图框大小 不允许改变
56
+ fixed: { type: Boolean, default: true },
57
+ // 是否开启截图框宽高固定比例
58
+ fixedNumber: { type: Array },
59
+ // 截图框的宽高比例
60
+ full: { type: Boolean, default: true },
61
+ // 是否输出原图比例的截图
62
+ canMoveBox: { type: Boolean, default: false },
63
+ // 截图框能否拖动
64
+ original: { type: Boolean, default: false },
65
+ // 上传图片按照原始比例渲染
66
+ centerBox: { type: Boolean, default: true },
67
+ // 截图框是否被限制在图片里面
68
+ infoTrue: { type: Boolean, default: false },
69
+ // true 为展示真实输出图片宽高 false 展示看到的截图框宽高
70
+ readonly: { type: Boolean, default: false },
71
+ // 是否只读
72
+ directTransmission: { type: Boolean, default: true },
73
+ // 是否使用直传接口
74
+ onClose: Function,
75
+ onCancel: Function
76
+ }, {
77
+ "modelValue": { type: String },
78
+ "modelModifiers": {}
79
+ }),
80
+ emits: /* @__PURE__ */ vue.mergeModels(["confirm"], ["update:modelValue"]),
81
+ setup(__props, { expose: __expose, emit: __emit }) {
82
+ const props = __props;
83
+ const emits = __emit;
84
+ const { t } = useLocale.useLocale();
85
+ const modelValue = vue.useModel(__props, "modelValue");
86
+ const cropperRef = vue.useTemplateRef("cropperRef");
87
+ const uploadRef = vue.useTemplateRef("uploadRef");
88
+ const visible = vue.ref(false);
89
+ const imgSrc = vue.ref();
90
+ const fileInfo = vue.ref({
91
+ name: "",
92
+ src: ""
93
+ });
94
+ const imageSrc = vue.computed(() => imgSrc.value || props.defaultImg);
95
+ const options = vue.computed(() => ({
96
+ info: props.info,
97
+ // 裁剪框的大小信息
98
+ outputSize: props.outputSize,
99
+ // 裁剪生成图片的质量
100
+ outputType: props.outputType,
101
+ // 裁剪生成图片的格式
102
+ canScale: props.canScale,
103
+ // 图片是否允许滚轮缩放
104
+ autoCrop: props.autoCrop,
105
+ // 是否默认生成截图框
106
+ autoCropWidth: props.autoCropWidth,
107
+ // 默认生成截图框宽度
108
+ autoCropHeight: props.autoCropHeight,
109
+ // 默认生成截图框高度
110
+ fixedBox: props.fixedBox,
111
+ // 固定截图框大小 不允许改变
112
+ fixed: props.fixed,
113
+ // 是否开启截图框宽高固定比例
114
+ fixedNumber: props.fixedNumber,
115
+ // 截图框的宽高比例
116
+ full: props.full,
117
+ // 是否输出原图比例的截图
118
+ canMoveBox: props.canMoveBox,
119
+ // 截图框能否拖动
120
+ original: props.original,
121
+ // 上传图片按照原始比例渲染
122
+ centerBox: props.centerBox,
123
+ // 截图框是否被限制在图片里面
124
+ infoTrue: props.infoTrue,
125
+ // true 为展示真实输出图片宽高 false 展示看到的截图框宽高
126
+ ...customOptions.value
127
+ }));
128
+ const customOptions = vue.ref({});
129
+ let customSubmit = null;
130
+ let customCancel = null;
131
+ let customClose = null;
132
+ async function beforeAvatarUpload(file$1) {
133
+ const limit = file$1.size < props.maxSize;
134
+ if (!limit) {
135
+ elementPlus.ElMessage.error(
136
+ t("cutter.uploadPictureLimit", [file.sizeToTextHandler(props.maxSize)])
137
+ );
138
+ return false;
139
+ }
140
+ const result = await file.blobToDataURL(file$1);
141
+ openCutter(result, file$1.name);
142
+ return false;
143
+ }
144
+ function openCutter(src, name) {
145
+ visible.value = true;
146
+ fileInfo.value.src = src;
147
+ fileInfo.value.name = name;
148
+ }
149
+ function onClearHandler() {
150
+ imgSrc.value = "";
151
+ modelValue.value = null;
152
+ fileInfo.value = {
153
+ name: "",
154
+ src: ""
155
+ };
156
+ }
157
+ async function onSubmitHandler() {
158
+ return new Promise((resolve, reject) => {
159
+ cropperRef.value.getCropBlob(async (data) => {
160
+ data.name = fileInfo.value.name;
161
+ const res = await file.fileUpload(data, props.directTransmission).catch(
162
+ (res2) => {
163
+ elementPlus.ElMessage.error(res2.msg || res2);
164
+ reject();
165
+ }
166
+ );
167
+ if (res.code === 200) {
168
+ const url = await file.blobToDataURL(data);
169
+ const key = res.data?.key || res.data?.url || res.data;
170
+ imgSrc.value = url;
171
+ modelValue.value = key;
172
+ if (customSubmit) {
173
+ await customSubmit({ url, key });
174
+ }
175
+ emits("confirm", { url, key });
176
+ resolve();
177
+ } else {
178
+ elementPlus.ElMessage.error(res.msg || res);
179
+ reject();
180
+ }
181
+ });
182
+ });
183
+ }
184
+ async function onCancelHandler() {
185
+ if (customCancel) {
186
+ return await customCancel();
187
+ }
188
+ if (props.onCancel) {
189
+ return await props.onCancel();
190
+ }
191
+ }
192
+ async function onCloseHandler() {
193
+ if (customCancel) {
194
+ return await customClose();
195
+ }
196
+ if (props.onClose) {
197
+ return await props.onClose();
198
+ }
199
+ }
200
+ __expose({
201
+ open: async (params) => {
202
+ const {
203
+ url,
204
+ fileName = "img.png",
205
+ options: options2,
206
+ file: file$1,
207
+ onSubmit,
208
+ onCancel,
209
+ onClose
210
+ } = params || {};
211
+ if (file$1) {
212
+ const result = await file.blobToDataURL(file$1);
213
+ openCutter(result, file$1.name);
214
+ } else if (url) {
215
+ openCutter(url, fileName);
216
+ } else {
217
+ uploadRef.value.click();
218
+ }
219
+ customOptions.value = options2 || {};
220
+ customClose = async () => {
221
+ if (onClose) {
222
+ await onClose();
223
+ }
224
+ customOptions.value = {};
225
+ };
226
+ customCancel = async () => {
227
+ if (onCancel) {
228
+ await onCancel();
229
+ }
230
+ customOptions.value = {};
231
+ };
232
+ customSubmit = async (value) => {
233
+ await onSubmit(value);
234
+ customOptions.value = {};
235
+ };
236
+ },
237
+ clear: onClearHandler
238
+ });
239
+ return (_ctx, _cache) => {
240
+ return vue.openBlock(), vue.createElementBlock("div", { class: "inline-block" }, [
241
+ vue.withDirectives(vue.createVNode(vue.unref(elementPlus.ElUpload), {
242
+ accept: ".png,.jpg,.gif,.jpeg",
243
+ "before-upload": beforeAvatarUpload,
244
+ action: "",
245
+ class: "upload_box",
246
+ "show-file-list": false,
247
+ disabled: __props.readonly
248
+ }, {
249
+ default: vue.withCtx(() => [
250
+ vue.createElementVNode(
251
+ "div",
252
+ {
253
+ ref_key: "uploadRef",
254
+ ref: uploadRef,
255
+ class: "app-cutter-upload-box"
256
+ },
257
+ [
258
+ vue.renderSlot(_ctx.$slots, "default", { src: imgSrc.value }, () => [
259
+ vue.createElementVNode(
260
+ "div",
261
+ {
262
+ class: "app-cutter-upload-card",
263
+ style: vue.normalizeStyle({
264
+ width: `${__props.autoCropWidth}px`,
265
+ height: `${__props.autoCropHeight}px`
266
+ })
267
+ },
268
+ [
269
+ modelValue.value && imageSrc.value ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElImage), {
270
+ key: 0,
271
+ src: imageSrc.value,
272
+ style: vue.normalizeStyle({
273
+ width: `${__props.autoCropWidth}px`,
274
+ height: `${__props.autoCropHeight}px`
275
+ })
276
+ }, null, 8, ["src", "style"])) : (vue.openBlock(), vue.createElementBlock(
277
+ vue.Fragment,
278
+ { key: 1 },
279
+ [
280
+ vue.createCommentVNode(' <AppIcon\n v-else\n svg-name="emptyHead"\n style="width: 70px; height: 70px"\n /> '),
281
+ vue.createVNode(vue.unref(elementPlus.ElIcon), {
282
+ color: "rgb(var(--hy-auxiliary))",
283
+ size: "64"
284
+ }, {
285
+ default: vue.withCtx(() => [
286
+ vue.createVNode(vue.unref(iconsVue.User))
287
+ ]),
288
+ _: 1
289
+ /* STABLE */
290
+ })
291
+ ],
292
+ 2112
293
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
294
+ ))
295
+ ],
296
+ 4
297
+ /* STYLE */
298
+ )
299
+ ]),
300
+ __props.uploadText && __props.showText ? (vue.openBlock(), vue.createElementBlock(
301
+ "div",
302
+ {
303
+ key: 0,
304
+ class: "app-cutter-tip"
305
+ },
306
+ vue.toDisplayString(__props.uploadText),
307
+ 1
308
+ /* TEXT */
309
+ )) : vue.createCommentVNode("v-if", true),
310
+ __props.showDelete ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
311
+ key: 1,
312
+ class: "app-cutter-delete",
313
+ onClick: vue.withModifiers(($event) => onClearHandler(), ["stop"])
314
+ }, [
315
+ vue.createCommentVNode(' <AppIcon svg-name="delete" /> '),
316
+ vue.createVNode(vue.unref(elementPlus.ElIcon), { color: "rgb(var(--hy-danger-2))" }, {
317
+ default: vue.withCtx(() => [
318
+ vue.createVNode(vue.unref(iconsVue.Delete))
319
+ ]),
320
+ _: 1
321
+ /* STABLE */
322
+ })
323
+ ], 8, ["onClick"])), [
324
+ [vue.vShow, modelValue.value]
325
+ ]) : vue.createCommentVNode("v-if", true)
326
+ ],
327
+ 512
328
+ /* NEED_PATCH */
329
+ )
330
+ ]),
331
+ _: 3
332
+ /* FORWARDED */
333
+ }, 8, ["disabled"]), [
334
+ [vue.vShow, __props.showUpload]
335
+ ]),
336
+ vue.createVNode(vue.unref(index.AppDialog), vue.mergeProps({
337
+ modelValue: visible.value,
338
+ "onUpdate:modelValue": ($event) => visible.value = $event,
339
+ title: vue.unref(t)("cutter.imageSegmentation")
340
+ }, _ctx.$attrs, {
341
+ onClose: onCloseHandler,
342
+ onCancel: onCancelHandler,
343
+ onSubmit: onSubmitHandler
344
+ }), {
345
+ default: vue.withCtx(() => [
346
+ vue.createElementVNode("div", { class: "h-[500px]" }, [
347
+ vue.createVNode(vue.unref(vueCropper.VueCropper), vue.mergeProps({
348
+ ref_key: "cropperRef",
349
+ ref: cropperRef,
350
+ img: fileInfo.value.src
351
+ }, options.value), null, 16, ["img"])
352
+ ])
353
+ ]),
354
+ _: 1
355
+ /* STABLE */
356
+ }, 16, ["modelValue", "onUpdate:modelValue", "title"])
357
+ ]);
358
+ };
359
+ }
360
+ });
361
+
362
+ exports.default = _sfc_main;
@@ -0,0 +1,11 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var appCutter = require('./appCutter.vue.js');
6
+ var handler = require('../../utils/handler.js');
7
+
8
+ const AppCutter = handler.withInstall(appCutter.default);
9
+
10
+ exports.AppCutter = AppCutter;
11
+ exports.default = AppCutter;
@@ -0,0 +1,51 @@
1
+ .app-cutter-upload-box {
2
+ display: inline-block;
3
+ position: relative;
4
+ overflow: hidden;
5
+ border-radius: 4px;
6
+ .app-cutter-delete {
7
+ width: 100%;
8
+ height: 23px;
9
+ display: flex;
10
+ align-items: center;
11
+ justify-content: center;
12
+ position: absolute;
13
+ bottom: -23px;
14
+ z-index: 3;
15
+ transition: all 0.3s;
16
+ background: rgba(0, 0, 0, 0.6);
17
+ }
18
+ .app-cutter-tip {
19
+ width: 100%;
20
+ position: absolute;
21
+ left: 50%;
22
+ top: 50%;
23
+ transform: translate(-50%, -50%);
24
+ z-index: 3;
25
+ font-size: 14px;
26
+ color: rgb(var(--hy-theme));
27
+ text-align: center;
28
+ user-select: none;
29
+ opacity: 0;
30
+ transition: all 0.3s;
31
+ }
32
+ &:hover {
33
+ .app-cutter-delete {
34
+ bottom: 0;
35
+ }
36
+ .app-cutter-tip {
37
+ opacity: 1;
38
+ }
39
+ }
40
+ .app-cutter-upload-card {
41
+ width: 70px;
42
+ height: 70px;
43
+ display: flex;
44
+ align-items: center;
45
+ justify-content: center;
46
+ border: 1px solid rgb(var(--hy-border));
47
+ border-radius: 4px;
48
+ background-color: rgb(var(--hy-background-2));
49
+ position: relative;
50
+ }
51
+ }
@@ -65,7 +65,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
65
65
  startValue.value = value[0] ? `${value[0]}${isFill ? " 00:00:00" : ""}` : null;
66
66
  endValue.value = value[1] ? `${value[1]}${isFill ? " 23:59:59" : ""}` : null;
67
67
  } else {
68
- dateValue.value = isFill && (value == null ? void 0 : value.length) ? [`${value[0]} 00:00:00`, `${value[1]} 23:59:59`] : value;
68
+ dateValue.value = isFill && value?.length ? [`${value[0]} 00:00:00`, `${value[1]} 23:59:59`] : value;
69
69
  }
70
70
  emits("change", dateValue.value);
71
71
  }