hy-dispatch-ui-v3 0.2.73 → 0.2.75

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 (56) hide show
  1. package/dist/tailwind.css +12 -12
  2. package/es/bussiness/hyDepartmentTypeOperation/departmentTypeOperation.vue.mjs +6 -0
  3. package/es/bussiness/hyDepartmentTypeOperation/departmentTypeOperation2.vue.mjs +352 -0
  4. package/es/bussiness/hyDepartmentTypeOperation/departmentTypeOperation_tiantong.vue.mjs +6 -0
  5. package/es/bussiness/hyDepartmentTypeOperation/departmentTypeOperation_tiantong2.vue.mjs +352 -0
  6. package/es/bussiness/hyDepartmentTypeOperation/index.mjs +8 -0
  7. package/es/bussiness/hyDepartmentTypeOperation/locale/en_US.mjs +15 -0
  8. package/es/bussiness/hyDepartmentTypeOperation/locale/index.mjs +2 -0
  9. package/es/bussiness/hyDepartmentTypeOperation/locale/zh_CN.mjs +15 -0
  10. package/es/bussiness/hyDepartmentTypeOperation/style/departmentTypeOperation.scss +58 -0
  11. package/es/bussiness/hyDepartmentTypeOperation/tiantong.mjs +8 -0
  12. package/es/bussiness/index.mjs +2 -1
  13. package/es/components/hyCutter/cutter.vue.mjs +18 -6
  14. package/es/components/hyOrgCascader/js/index.mjs +2 -2
  15. package/es/components-map.mjs +3 -0
  16. package/es/hooks/index.mjs +1 -1
  17. package/es/hooks/useApi.mjs +2 -2
  18. package/es/hooks/useDialog.mjs +1 -1
  19. package/es/hooks/useGlobalConfig.mjs +3 -0
  20. package/es/hooks/useLocale.mjs +29 -1
  21. package/es/index.mjs +3 -2
  22. package/es/static/hy-svg-icons/hy-icon-dispatch-share-damage.js +10 -0
  23. package/es/utils/handler.mjs +0 -1
  24. package/es/version.mjs +1 -1
  25. package/lib/bussiness/hyDepartmentTypeOperation/departmentTypeOperation.vue.js +10 -0
  26. package/lib/bussiness/hyDepartmentTypeOperation/departmentTypeOperation2.vue.js +356 -0
  27. package/lib/bussiness/hyDepartmentTypeOperation/departmentTypeOperation_tiantong.vue.js +10 -0
  28. package/lib/bussiness/hyDepartmentTypeOperation/departmentTypeOperation_tiantong2.vue.js +356 -0
  29. package/lib/bussiness/hyDepartmentTypeOperation/index.js +13 -0
  30. package/lib/bussiness/hyDepartmentTypeOperation/locale/en_US.js +19 -0
  31. package/lib/bussiness/hyDepartmentTypeOperation/locale/index.js +9 -0
  32. package/lib/bussiness/hyDepartmentTypeOperation/locale/zh_CN.js +19 -0
  33. package/lib/bussiness/hyDepartmentTypeOperation/style/departmentTypeOperation.scss +58 -0
  34. package/lib/bussiness/hyDepartmentTypeOperation/tiantong.js +13 -0
  35. package/lib/bussiness/index.js +9 -7
  36. package/lib/components/hyCutter/cutter.vue.js +18 -6
  37. package/lib/components/hyOrgCascader/js/index.js +2 -2
  38. package/lib/components-map.js +3 -0
  39. package/lib/hooks/index.js +2 -0
  40. package/lib/hooks/useApi.js +2 -2
  41. package/lib/hooks/useDialog.js +1 -1
  42. package/lib/hooks/useGlobalConfig.js +3 -0
  43. package/lib/hooks/useLocale.js +30 -0
  44. package/lib/index.js +28 -24
  45. package/lib/static/hy-svg-icons/hy-icon-dispatch-share-damage.js +10 -0
  46. package/lib/utils/handler.js +0 -1
  47. package/lib/version.js +1 -1
  48. package/package.json +10 -6
  49. package/es/_virtual/_plugin-vue_export-helper.mjs +0 -9
  50. package/es/bussiness/hyAddDepartmentType/addDepartmentType.vue.mjs +0 -367
  51. package/es/bussiness/hyAddDepartmentType/index.mjs +0 -7
  52. package/es/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +0 -31
  53. package/lib/_virtual/_plugin-vue_export-helper.js +0 -13
  54. package/lib/bussiness/hyAddDepartmentType/addDepartmentType.vue.js +0 -371
  55. package/lib/bussiness/hyAddDepartmentType/index.js +0 -12
  56. package/lib/bussiness/hyAddDepartmentType/style/addDepartmentType.scss +0 -31
package/dist/tailwind.css CHANGED
@@ -241,10 +241,6 @@
241
241
  right: 0.75rem;
242
242
  }
243
243
 
244
- .right-4 {
245
- right: 1rem;
246
- }
247
-
248
244
  .top-0 {
249
245
  top: 0px;
250
246
  }
@@ -481,10 +477,6 @@
481
477
  margin-top: 1rem;
482
478
  }
483
479
 
484
- .mt-5 {
485
- margin-top: 1.25rem;
486
- }
487
-
488
480
  .mt-\[10px\] {
489
481
  margin-top: 10px;
490
482
  }
@@ -590,6 +582,10 @@
590
582
  height: 56px !important;
591
583
  }
592
584
 
585
+ .\!h-\[60px\] {
586
+ height: 60px !important;
587
+ }
588
+
593
589
  .\!h-\[66px\] {
594
590
  height: 66px !important;
595
591
  }
@@ -842,6 +838,10 @@
842
838
  width: 58px !important;
843
839
  }
844
840
 
841
+ .\!w-\[60px\] {
842
+ width: 60px !important;
843
+ }
844
+
845
845
  .\!w-\[80px\] {
846
846
  width: 80px !important;
847
847
  }
@@ -946,14 +946,14 @@
946
946
  width: 42px;
947
947
  }
948
948
 
949
- .w-\[44px\] {
950
- width: 44px;
951
- }
952
-
953
949
  .w-\[54px\] {
954
950
  width: 54px;
955
951
  }
956
952
 
953
+ .w-\[60px\] {
954
+ width: 60px;
955
+ }
956
+
957
957
  .w-\[68px\] {
958
958
  width: 68px;
959
959
  }
@@ -0,0 +1,6 @@
1
+ import _sfc_main from './departmentTypeOperation2.vue.mjs';
2
+
3
+ import "./style/departmentTypeOperation.scss?vue&type=style&index=0&src=true&lang.css";
4
+
5
+
6
+ export { _sfc_main as default };
@@ -0,0 +1,352 @@
1
+ import { defineComponent, onUnmounted, ref, useTemplateRef, nextTick, resolveComponent, openBlock, createElementBlock, Fragment, createTextVNode, createVNode, unref, mergeProps, isRef, withCtx, createElementVNode, withDirectives, withModifiers, vShow, createBlock, toDisplayString } from 'vue';
2
+ import { useDialog, useDialogIsEdit } from '../../hooks/useDialog.mjs';
3
+ import '../../hooks/index.mjs';
4
+ import '../../components/index.mjs';
5
+ import { ElMessage } from 'element-plus';
6
+ import { saveApi } from '../../api/index.mjs';
7
+ import '../../utils/index.mjs';
8
+ import * as index from './locale/index.mjs';
9
+ import { registerComponentLocale, unregisterComponentLocale, $t } from '../../hooks/useLocale.mjs';
10
+ import { useCurrentBus } from '../../hooks/useCurrentBus.mjs';
11
+ import { useAppForm } from '../../components/hyForm/js/useAppForm.mjs';
12
+ import { fileUpload } from '../../utils/file.mjs';
13
+ import { useMixins } from '../../hooks/useMixins.mjs';
14
+ import { HyDialog } from '../../components/hyDialog/index.mjs';
15
+ import { HyForm } from '../../components/hyForm/index.mjs';
16
+ import { HyIcon } from '../../components/hyIcon/index.mjs';
17
+ import { HyCutter } from '../../components/hyCutter/index.mjs';
18
+
19
+ const __default__ = defineComponent({
20
+ name: "HyDepartmentTypeOperation"
21
+ });
22
+ var _sfc_main = /* @__PURE__ */ defineComponent({
23
+ ...__default__,
24
+ emits: ["on-submit"],
25
+ setup(__props, { expose: __expose, emit: __emit }) {
26
+ registerComponentLocale("HyDepartmentTypeOperation", index);
27
+ onUnmounted(() => {
28
+ unregisterComponentLocale("HyDepartmentTypeOperation");
29
+ });
30
+ const $t$1 = (key, option) => $t(`HyDepartmentTypeOperation.${key}`, option);
31
+ const emit = __emit;
32
+ function useDepartmentTypeOperation(hy) {
33
+ const { currentBus } = useCurrentBus();
34
+ const formRef2 = ref(null);
35
+ const HyCutterRef2 = useTemplateRef("HyCutterRef");
36
+ const HyDialogRef2 = useTemplateRef("HyDialogRef");
37
+ const dialogVisible2 = ref(false);
38
+ const loading2 = ref(false);
39
+ const { formModel: formModel2, formColumns: formColumns2 } = useAppForm([
40
+ // 自定义插槽
41
+ {
42
+ span: 12,
43
+ prop: "companyName",
44
+ label: $t$1("departmentIcon"),
45
+ slot: "companyNameSlot"
46
+ },
47
+ // 输入框
48
+ {
49
+ span: 12,
50
+ type: "input",
51
+ prop: "typeName",
52
+ required: true,
53
+ label: $t$1("departmentTypeName"),
54
+ attrs: {
55
+ placeholder: $t$1("pleaseEnterTheDepartmentTypeName"),
56
+ clearable: true
57
+ }
58
+ }
59
+ ]);
60
+ function beforeAvatarUpload2(file) {
61
+ const width = 44;
62
+ const height = 44;
63
+ const _this = this;
64
+ const isLt2M = file.size / 1024 / 1024 < 2;
65
+ if (!isLt2M) {
66
+ ElMessage.error($t$1("imageUploadFailedLogoSizeWithin2M"));
67
+ return false;
68
+ }
69
+ hy.HyCutterRef.value.open({
70
+ file,
71
+ options: {
72
+ outputType: "png",
73
+ // 裁剪生成图片的格式
74
+ canScale: true,
75
+ // 图片是否允许滚轮缩放
76
+ fixedBox: true,
77
+ // 固定截图框大小 不允许改变
78
+ infoTrue: false,
79
+ // 是否开启截图框宽高固定比例
80
+ autoCropWidth: width,
81
+ autoCropHeight: height,
82
+ centerBox: false,
83
+ original: true,
84
+ fixed: false
85
+ },
86
+ onSubmit: (res) => {
87
+ hy.setHeadImg(res);
88
+ }
89
+ });
90
+ return false;
91
+ }
92
+ function setHeadImg2(res) {
93
+ if (!res) {
94
+ res = {
95
+ url: null,
96
+ key: null
97
+ };
98
+ }
99
+ hy.formModel.value.icon = res.url;
100
+ hy.formModel.value.iconKey = res.key;
101
+ }
102
+ async function handleHttpRequestImg2(object) {
103
+ await fileUpload(object.file).then((url) => {
104
+ hy.formModel.value.icon = url;
105
+ });
106
+ }
107
+ async function onSubmit2() {
108
+ const valid = await hy.formRef.value.validate();
109
+ if (!valid) throw new Error("Validation failed");
110
+ if (!hy.formModel.value.icon) {
111
+ hy.formModel.value.iconKey = null;
112
+ }
113
+ const res = await saveApi("organization/orgType", {
114
+ ...hy.formModel.value,
115
+ icon: null
116
+ });
117
+ if (!res || res.code !== 200) throw new Error(res?.msg || "Operation failed");
118
+ hy.dialogVisible.value = false;
119
+ ElMessage.success($t$1("operationSuccessful"));
120
+ nextTick(() => {
121
+ emit("on-submit", hy.formModel.value.id ? null : 1);
122
+ currentBus.emit("departmentTypeOperation", {
123
+ method: "onSubmit",
124
+ param: hy.formModel.value.id ? null : 1
125
+ });
126
+ });
127
+ }
128
+ async function onClose2() {
129
+ await hy.watchPause("close");
130
+ hy.dialogVisible.value = false;
131
+ }
132
+ async function show2(row = {}) {
133
+ if (hy.loading.value) {
134
+ ElMessage.error("\u6570\u636E\u52A0\u8F7D\u4E2D\uFF0C\u8BF7\u52FF\u91CD\u590D\u70B9\u51FB");
135
+ return;
136
+ }
137
+ await hy.watchPause();
138
+ hy.loading.value = true;
139
+ hy.setDragLevelIndex("HyDialogRef");
140
+ hy.dialogVisible.value = true;
141
+ if (row && row.id) {
142
+ hy.formModel.value = { ...row };
143
+ } else {
144
+ hy.formModel.value = {
145
+ icon: null,
146
+ typeName: null
147
+ };
148
+ }
149
+ nextTick(() => {
150
+ hy.formRef.value.clearValidate();
151
+ hy.loading.value = false;
152
+ hy.watchResume();
153
+ });
154
+ }
155
+ function getCacheData2() {
156
+ return {
157
+ formModel: hy.formModel.value
158
+ };
159
+ }
160
+ async function restoreCache2(data = {}) {
161
+ hy.formModel.value = {
162
+ ...data.formModel
163
+ };
164
+ hy.dialogVisible.value = true;
165
+ }
166
+ return {
167
+ formRef: formRef2,
168
+ HyCutterRef: HyCutterRef2,
169
+ HyDialogRef: HyDialogRef2,
170
+ dialogVisible: dialogVisible2,
171
+ loading: loading2,
172
+ beforeAvatarUpload: beforeAvatarUpload2,
173
+ setHeadImg: setHeadImg2,
174
+ handleHttpRequestImg: handleHttpRequestImg2,
175
+ onSubmit: onSubmit2,
176
+ onClose: onClose2,
177
+ show: show2,
178
+ getCacheData: getCacheData2,
179
+ restoreCache: restoreCache2,
180
+ formModel: formModel2,
181
+ formColumns: formColumns2
182
+ };
183
+ }
184
+ const {
185
+ HyCutterRef,
186
+ HyDialogRef,
187
+ beforeAvatarUpload,
188
+ confirmReplace,
189
+ dialogVisible,
190
+ formColumns,
191
+ formModel,
192
+ formRef,
193
+ getCacheData,
194
+ getIsEdit,
195
+ handleHttpRequestImg,
196
+ instance,
197
+ isEdit,
198
+ isWatchForm,
199
+ loading,
200
+ minimized,
201
+ minimizedClose,
202
+ minimizedRemove,
203
+ minimizedShow,
204
+ minimizedTitle,
205
+ onClose,
206
+ onMinimized,
207
+ onSubmit,
208
+ restoreCache,
209
+ setDragLevelIndex,
210
+ setHeadImg,
211
+ setIsEdit,
212
+ setWatchResume,
213
+ show,
214
+ watchPause,
215
+ watchResume
216
+ } = useMixins({}, [useDialog, useDialogIsEdit, useDepartmentTypeOperation]);
217
+ __expose({
218
+ show,
219
+ setIsEdit,
220
+ minimizedShow
221
+ });
222
+ return (_ctx, _cache) => {
223
+ const _component_el_image = resolveComponent("el-image");
224
+ const _component_el_upload = resolveComponent("el-upload");
225
+ return openBlock(), createElementBlock(
226
+ Fragment,
227
+ null,
228
+ [
229
+ createTextVNode(" 111111111 "),
230
+ createVNode(unref(HyDialog), mergeProps({
231
+ ref_key: "HyDialogRef",
232
+ ref: HyDialogRef,
233
+ modelValue: unref(dialogVisible),
234
+ "onUpdate:modelValue": ($event) => isRef(dialogVisible) ? dialogVisible.value = $event : null,
235
+ loading: unref(loading),
236
+ "onUpdate:loading": ($event) => isRef(loading) ? loading.value = $event : null,
237
+ "if-shrink": true,
238
+ width: "310px"
239
+ }, _ctx.$attrs, {
240
+ title: unref(formModel).id ? $t$1("editDepartmentType") : $t$1("addDepartmentType"),
241
+ "on-submit": unref(onSubmit),
242
+ "on-cancel": unref(onClose),
243
+ "on-close": unref(onClose),
244
+ "operate-class": "w-full justify-center",
245
+ onOnMinimized: unref(onMinimized),
246
+ onOnDialogMousedown: ($event) => unref(setDragLevelIndex)("HyDialogRef")
247
+ }), {
248
+ default: withCtx(() => [
249
+ createVNode(unref(HyForm), {
250
+ ref_key: "formRef",
251
+ ref: formRef,
252
+ "column-num": 1,
253
+ model: unref(formModel),
254
+ columns: unref(formColumns)
255
+ }, {
256
+ companyNameSlot: withCtx(() => [
257
+ createElementVNode("div", { class: "flex flex-row departmentTypeOperation" }, [
258
+ createVNode(_component_el_upload, {
259
+ class: "w-[80px] flex items-center justify-center upload_box",
260
+ accept: ".png,.jpg,.gif",
261
+ "before-upload": unref(beforeAvatarUpload),
262
+ "http-request": unref(handleHttpRequestImg),
263
+ action: "",
264
+ "show-file-list": false
265
+ }, {
266
+ default: withCtx(() => [
267
+ withDirectives(createElementVNode("div", {
268
+ class: "delete_box flex items-center justify-center",
269
+ onClick: withModifiers(($event) => unref(setHeadImg)(null), ["stop"])
270
+ }, [
271
+ createVNode(unref(HyIcon), {
272
+ "svg-name": "ops-button-delete",
273
+ class: "svg_box"
274
+ })
275
+ ], 8, ["onClick"]), [
276
+ [vShow, unref(formModel).icon]
277
+ ]),
278
+ createElementVNode("div", { class: "click-box emptyHead" }, [
279
+ unref(formModel).icon ? (openBlock(), createBlock(_component_el_image, {
280
+ key: 0,
281
+ fit: "contain",
282
+ class: "w-[60px] h-[60px]",
283
+ src: unref(formModel).icon
284
+ }, null, 8, ["src"])) : (openBlock(), createBlock(unref(HyIcon), {
285
+ key: 1,
286
+ "svg-name": "ops-file-empty-head",
287
+ class: "text-auxiliary !w-[60px] !h-[60px]"
288
+ })),
289
+ createElementVNode(
290
+ "span",
291
+ { class: "uploadTips text-center" },
292
+ toDisplayString($t$1("upload")),
293
+ 1
294
+ /* TEXT */
295
+ )
296
+ ])
297
+ ]),
298
+ _: 1
299
+ /* STABLE */
300
+ }, 8, ["before-upload", "http-request"]),
301
+ createElementVNode("div", { class: "flex-grow leading-[20px] text-auxiliary text-xs text-center" }, [
302
+ createElementVNode(
303
+ "div",
304
+ null,
305
+ toDisplayString($t$1("pleaseUploadDepartmentTypeIcon")),
306
+ 1
307
+ /* TEXT */
308
+ ),
309
+ createElementVNode(
310
+ "div",
311
+ null,
312
+ toDisplayString($t$1("iconSize44px")) + "*44px",
313
+ 1
314
+ /* TEXT */
315
+ ),
316
+ createElementVNode(
317
+ "div",
318
+ null,
319
+ toDisplayString($t$1("ifNoIconUseTheDefaultIcon")),
320
+ 1
321
+ /* TEXT */
322
+ )
323
+ ])
324
+ ])
325
+ ]),
326
+ _: 1
327
+ /* STABLE */
328
+ }, 8, ["model", "columns"]),
329
+ createVNode(
330
+ unref(HyCutter),
331
+ {
332
+ ref_key: "HyCutterRef",
333
+ ref: HyCutterRef,
334
+ "show-upload": false
335
+ },
336
+ null,
337
+ 512
338
+ /* NEED_PATCH */
339
+ )
340
+ ]),
341
+ _: 1
342
+ /* STABLE */
343
+ }, 16, ["modelValue", "onUpdate:modelValue", "loading", "onUpdate:loading", "title", "on-submit", "on-cancel", "on-close", "onOnMinimized", "onOnDialogMousedown"])
344
+ ],
345
+ 64
346
+ /* STABLE_FRAGMENT */
347
+ );
348
+ };
349
+ }
350
+ });
351
+
352
+ export { _sfc_main as default };
@@ -0,0 +1,6 @@
1
+ import _sfc_main from './departmentTypeOperation_tiantong2.vue.mjs';
2
+
3
+ import "./style/departmentTypeOperation.scss?vue&type=style&index=0&src=true&lang.css";
4
+
5
+
6
+ export { _sfc_main as default };