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
@@ -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: "HyDepartmentTypeOperationTiantonmg"
21
+ });
22
+ var _sfc_main = /* @__PURE__ */ defineComponent({
23
+ ...__default__,
24
+ emits: ["on-submit"],
25
+ setup(__props, { expose: __expose, emit: __emit }) {
26
+ registerComponentLocale("HyDepartmentTypeOperationTiantonmg", index);
27
+ onUnmounted(() => {
28
+ unregisterComponentLocale("HyDepartmentTypeOperationTiantonmg");
29
+ });
30
+ const $t$1 = (key, option) => $t(`HyDepartmentTypeOperationTiantonmg.${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(" 222222 "),
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,8 @@
1
+ import './departmentTypeOperation.vue.mjs';
2
+ import '../../utils/index.mjs';
3
+ import { withInstall } from '../../utils/handler.mjs';
4
+ import _sfc_main from './departmentTypeOperation2.vue.mjs';
5
+
6
+ const HyDepartmentTypeOperation = withInstall(_sfc_main);
7
+
8
+ export { HyDepartmentTypeOperation, HyDepartmentTypeOperation as default };
@@ -0,0 +1,15 @@
1
+ var en_US = {
2
+ departmentIcon: "Department Icon",
3
+ upload: "Upload",
4
+ pleaseUploadDepartmentTypeIcon: "Please upload department type icon",
5
+ iconSize44px: "Icon size 44px",
6
+ ifNoIconUseTheDefaultIcon: "If no icon, use the default icon",
7
+ departmentTypeName: "Department Type Name",
8
+ pleaseEnterTheDepartmentTypeName: "Please enter the department type name",
9
+ imageUploadFailedLogoSizeWithin2M: "Image upload failed, logo size within 2M.",
10
+ editDepartmentType: "Edit Department Type",
11
+ addDepartmentType: "Add Department Type",
12
+ operationSuccessful: "Operation Successful"
13
+ };
14
+
15
+ export { en_US as default };
@@ -0,0 +1,2 @@
1
+ export { default as en_US } from './en_US.mjs';
2
+ export { default as zh_CN } from './zh_CN.mjs';
@@ -0,0 +1,15 @@
1
+ var zh_CN = {
2
+ departmentIcon: "\u90E8\u95E8\u56FE\u6807",
3
+ upload: "\u4E0A \u4F20",
4
+ pleaseUploadDepartmentTypeIcon: "\u8BF7\u4E0A\u4F20\u90E8\u95E8\u7C7B\u578B\u56FE\u6807",
5
+ iconSize44px: "\u56FE\u6807\u5C3A\u5BF844px",
6
+ ifNoIconUseTheDefaultIcon: "\u82E5\u65E0\u56FE\u6807\u5219\u4F7F\u7528\u9ED8\u8BA4\u56FE\u6807",
7
+ departmentTypeName: "\u90E8\u95E8\u7C7B\u578B\u540D\u79F0",
8
+ pleaseEnterTheDepartmentTypeName: "\u8BF7\u8F93\u5165\u90E8\u95E8\u7C7B\u578B\u540D\u79F0",
9
+ imageUploadFailedLogoSizeWithin2M: "\u56FE\u7247\u4E0A\u4F20\u5931\u8D25\uFF0Clogo\u5927\u5C0F2M\u4EE5\u5185\u3002",
10
+ editDepartmentType: "\u7F16\u8F91\u90E8\u95E8\u7C7B\u578B",
11
+ addDepartmentType: "\u6DFB\u52A0\u90E8\u95E8\u7C7B\u578B",
12
+ operationSuccessful: "\u64CD\u4F5C\u6210\u529F"
13
+ };
14
+
15
+ export { zh_CN as default };
@@ -0,0 +1,58 @@
1
+ .departmentTypeOperation {
2
+ .emptyHead {
3
+ height: 60px;
4
+ width: 60px;
5
+ overflow: hidden;
6
+ position: relative;
7
+ border: 1px solid var(--border);
8
+ background: rgba(var(--hy-background-2), 1);
9
+ transition: 0.5s;
10
+ border-radius: 6px;
11
+ line-height: 20px;
12
+
13
+ &:hover {
14
+ box-shadow: 0 0 10px 0 rgba(var(--hy-theme), 0.5);
15
+
16
+ img {
17
+ opacity: 0.5;
18
+ }
19
+
20
+ span.uploadTips {
21
+ opacity: 1;
22
+ }
23
+ }
24
+
25
+ span.uploadTips {
26
+ font-weight: bold;
27
+ color: rgba(var(--hy-theme), 1);
28
+ position: absolute;
29
+ top: 50%;
30
+ left: 50%;
31
+ font-size: 12px;
32
+ transform: translate(-50%, -50%);
33
+ opacity: 0;
34
+ transition: 0.5s;
35
+ }
36
+ }
37
+ .upload_box {
38
+ position: relative;
39
+ overflow: hidden;
40
+ &:hover {
41
+ .delete_box {
42
+ bottom: 0;
43
+ }
44
+ }
45
+ .delete_box {
46
+ position: absolute;
47
+ z-index: 3;
48
+ left: 0;
49
+ width: 100%;
50
+ height: 23px;
51
+ border-radius: 0 0 7px 7px;
52
+ background: rgba(0, 0, 0, 0.6);
53
+ color: rgba(var(--hy-danger-2));
54
+ transition: 0.5s;
55
+ bottom: -40%;
56
+ }
57
+ }
58
+ }
@@ -0,0 +1,8 @@
1
+ import './departmentTypeOperation_tiantong.vue.mjs';
2
+ import '../../utils/index.mjs';
3
+ import { withInstall } from '../../utils/handler.mjs';
4
+ import _sfc_main from './departmentTypeOperation_tiantong2.vue.mjs';
5
+
6
+ const HyDepartmentTypeOperationTiantonmg = withInstall(_sfc_main);
7
+
8
+ export { HyDepartmentTypeOperationTiantonmg, HyDepartmentTypeOperationTiantonmg as default };
@@ -1,4 +1,5 @@
1
- export { HyAddDepartmentType } from './hyAddDepartmentType/index.mjs';
1
+ export { HyDepartmentTypeOperation } from './hyDepartmentTypeOperation/index.mjs';
2
+ export { HyDepartmentTypeOperationTiantonmg } from './hyDepartmentTypeOperation/tiantong.mjs';
2
3
  export { HyMapAearchPlace } from './hyMapAearchPlace/index.mjs';
3
4
  export { HyUserTree } from './hyUserTree/index.mjs';
4
5
  export { HyDeviceTree } from './hyDeviceTree/index.mjs';
@@ -7,6 +7,7 @@ import '../index.mjs';
7
7
  import '../../hooks/index.mjs';
8
8
  import { $t } from '../../hooks/useLocale.mjs';
9
9
  import { sizeToTextHandler, blobToDataURL, fileUpload } from '../../utils/file.mjs';
10
+ import { useBaseMainStore } from '../../hooks/useBaseMainStore.mjs';
10
11
  import { HyDialog } from '../hyDialog/index.mjs';
11
12
 
12
13
  import "vue-cropper/dist/index.css";
@@ -82,7 +83,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
82
83
  const modelValue = useModel(__props, "modelValue");
83
84
  const cropperRef = useTemplateRef("cropperRef");
84
85
  const uploadRef = useTemplateRef("uploadRef");
85
- const visible = ref(false);
86
+ const HyDialogRef = useTemplateRef("HyDialogRef");
87
+ const dialogVisible = ref(false);
86
88
  const imgSrc = ref();
87
89
  const fileInfo = ref({
88
90
  name: "",
@@ -137,9 +139,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
137
139
  return false;
138
140
  }
139
141
  function openCutter(src, name) {
140
- visible.value = true;
142
+ dialogVisible.value = true;
141
143
  fileInfo.value.src = src;
142
144
  fileInfo.value.name = name;
145
+ setDragLevelIndex("HyDialogRef");
143
146
  }
144
147
  function onClearHandler() {
145
148
  imgSrc.value = "";
@@ -190,6 +193,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
190
193
  return await props.onClose();
191
194
  }
192
195
  }
196
+ function setDragLevelIndex() {
197
+ const { baseMainStore } = useBaseMainStore();
198
+ const dragLevel = baseMainStore.getters.dragLevel;
199
+ HyDialogRef.value.setDragLevelIndex(dragLevel);
200
+ baseMainStore.commit("setDragLevel");
201
+ }
193
202
  __expose({
194
203
  open: async (params) => {
195
204
  const { url, fileName = "img.png", options: options2, file, onSubmit, onCancel, onClose } = params || {};
@@ -319,13 +328,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
319
328
  [vShow, __props.showUpload]
320
329
  ]),
321
330
  createVNode(unref(HyDialog), mergeProps({
322
- modelValue: visible.value,
323
- "onUpdate:modelValue": ($event) => visible.value = $event,
331
+ ref_key: "HyDialogRef",
332
+ ref: HyDialogRef,
333
+ modelValue: dialogVisible.value,
334
+ "onUpdate:modelValue": ($event) => dialogVisible.value = $event,
324
335
  title: unref($t)("cutter.imageSegmentation")
325
336
  }, _ctx.$attrs, {
326
337
  onClose: onCloseHandler,
327
338
  onCancel: onCancelHandler,
328
- onSubmit: onSubmitHandler
339
+ onSubmit: onSubmitHandler,
340
+ onOnDialogMousedown: ($event) => setDragLevelIndex("HyDialogRef")
329
341
  }), {
330
342
  default: withCtx(() => [
331
343
  createElementVNode("div", { class: "h-[500px]" }, [
@@ -338,7 +350,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
338
350
  ]),
339
351
  _: 1
340
352
  /* STABLE */
341
- }, 16, ["modelValue", "onUpdate:modelValue", "title"])
353
+ }, 16, ["modelValue", "onUpdate:modelValue", "title", "onOnDialogMousedown"])
342
354
  ]);
343
355
  };
344
356
  }
@@ -1,4 +1,4 @@
1
- import Axios from 'axios';
1
+ import axios from 'axios';
2
2
  import { unref } from 'vue';
3
3
  import '../../../hooks/index.mjs';
4
4
  import { useApi } from '../../../hooks/useApi.mjs';
@@ -11,7 +11,7 @@ function getOrgTreeSimple() {
11
11
  if (cancelSource) {
12
12
  cancelSource.cancel("\u4E2D\u65AD\u8BF7\u6C42");
13
13
  }
14
- cancelSource = Axios.CancelToken.source();
14
+ cancelSource = axios.CancelToken.source();
15
15
  throttleFn = new Promise((resolve, reject) => {
16
16
  unref(api).post("organization/orgTreeSimple", {}, { cancelToken: cancelSource.token }).then((res) => {
17
17
  resolve(res.data);
@@ -0,0 +1,3 @@
1
+ export default {
2
+ ,
3
+ }
@@ -1,5 +1,5 @@
1
1
  export { defaultAxios, localApiKey, useApi } from './useApi.mjs';
2
- export { $t, buildLocaleContext, buildTranslator, getLang, getLanguage, lang, localeContextKey, setLang, translate, useLocale } from './useLocale.mjs';
2
+ export { $t, buildLocaleContext, buildTranslator, getLang, getLanguage, lang, localeContextKey, registerComponentLocale, setLang, translate, unregisterComponentLocale, useLocale } from './useLocale.mjs';
3
3
  export { configProviderContextKey, provideGlobalConfig, useGlobalConfig } from './useGlobalConfig.mjs';
4
4
  export { useMixins } from './useMixins.mjs';
5
5
  export { localPermissionMapKey, usePermissionMap } from './usePermissionMap.mjs';
@@ -1,10 +1,10 @@
1
- import Axios from 'axios';
1
+ import axios from 'axios';
2
2
  import { ref, getCurrentInstance, inject, unref } from 'vue';
3
3
  import { useGlobalConfig } from './useGlobalConfig.mjs';
4
4
 
5
5
  const localApiKey = /* @__PURE__ */ Symbol("localApiKey");
6
6
  const defaultAxios = ref(
7
- Axios.create({
7
+ axios.create({
8
8
  baseURL: "/api/admin",
9
9
  withCredentials: false,
10
10
  timeout: 6e4
@@ -133,9 +133,9 @@ function useDialog(hy) {
133
133
  );
134
134
  });
135
135
  return {
136
+ instance,
136
137
  loading,
137
138
  isEdit,
138
- instance,
139
139
  minimized,
140
140
  minimizedTitle,
141
141
  setDragLevelIndex,
@@ -30,6 +30,9 @@ function useGlobalConfig(key, defaultValue = void 0) {
30
30
  } else {
31
31
  return config;
32
32
  }
33
+ return {
34
+ config
35
+ };
33
36
  }
34
37
  const provideGlobalConfig = (props, app, global = false) => {
35
38
  const inSetup = !!getCurrentInstance();
@@ -44,5 +44,33 @@ const $t = (path, option) => {
44
44
  const locale = index[lang.value] || zh_CN;
45
45
  return translate(path, option, locale);
46
46
  };
47
+ const registeredLocales = /* @__PURE__ */ new Map();
48
+ const registerComponentLocale = (componentName, localeMessages) => {
49
+ if (!componentName || !localeMessages) {
50
+ console.warn("[useLocale] registerComponentLocale: componentName and localeMessages are required");
51
+ return;
52
+ }
53
+ if (registeredLocales.has(componentName)) {
54
+ return;
55
+ }
56
+ registeredLocales.set(componentName, true);
57
+ Object.keys(localeMessages).forEach((langKey) => {
58
+ if (index[langKey]) {
59
+ if (!index[langKey][componentName]) {
60
+ index[langKey][componentName] = {};
61
+ }
62
+ Object.assign(index[langKey][componentName], localeMessages[langKey]);
63
+ }
64
+ });
65
+ };
66
+ const unregisterComponentLocale = (componentName) => {
67
+ if (!componentName) return;
68
+ registeredLocales.delete(componentName);
69
+ Object.keys(index).forEach((langKey) => {
70
+ if (index[langKey] && index[langKey][componentName]) {
71
+ delete index[langKey][componentName];
72
+ }
73
+ });
74
+ };
47
75
 
48
- export { $t, buildLocaleContext, buildTranslator, getLang, getLanguage, lang, localeContextKey, setLang, translate, useLocale };
76
+ export { $t, buildLocaleContext, buildTranslator, getLang, getLanguage, lang, localeContextKey, registerComponentLocale, setLang, translate, unregisterComponentLocale, useLocale };
package/es/index.mjs CHANGED
@@ -3,14 +3,13 @@ import './utils/index.mjs';
3
3
  import './components/index.mjs';
4
4
  import './bussiness/index.mjs';
5
5
  import './hooks/index.mjs';
6
- export { $t, buildLocaleContext, buildTranslator, getLang, getLanguage, lang, localeContextKey, setLang, translate, useLocale } from './hooks/useLocale.mjs';
6
+ export { $t, buildLocaleContext, buildTranslator, getLang, getLanguage, lang, localeContextKey, registerComponentLocale, setLang, translate, unregisterComponentLocale, useLocale } from './hooks/useLocale.mjs';
7
7
  export { ElDatePicker, HyDatePicker } from './components/hyDatePicker/index.mjs';
8
8
  export { ElInput, HyInput, HyInputSearch } from './components/hyInput/index.mjs';
9
9
  export { ElLoading, ElLoading as HyLoading } from './components/hyLoading/index.mjs';
10
10
  export { ElTimePicker, HyTimePicker } from './components/hyTimePicker/index.mjs';
11
11
  export { ElTooltip, HyTooltip } from './components/hyTooltip/index.mjs';
12
12
  export { HyAcquisitionStationTree } from './bussiness/hyAcquisitionStationTree/index.mjs';
13
- export { HyAddDepartmentType } from './bussiness/hyAddDepartmentType/index.mjs';
14
13
  export { HyAddElectronicFenceDialog, HyBatchSetElectronicFenceUserDialog, HyElectronicFence, HyElectronicFenceAssociatedUsersDialog } from './bussiness/hyElectronicFence/index.mjs';
15
14
  export { HyAudioPlayer } from './components/hyAudioPlayer/index.mjs';
16
15
  export { HyBatchTableForm, HyTableForm } from './components/hyTableForm/index.mjs';
@@ -20,6 +19,8 @@ export { HyCheckboxGroup } from './components/hyCheckboxGroup/index.mjs';
20
19
  export { HyConfigProvider } from './components/hyConfigProvider/index.mjs';
21
20
  export { HyConfirmDialog } from './components/hyConfirmDialog/index.mjs';
22
21
  export { HyCutter } from './components/hyCutter/index.mjs';
22
+ export { HyDepartmentTypeOperation } from './bussiness/hyDepartmentTypeOperation/index.mjs';
23
+ export { HyDepartmentTypeOperationTiantonmg } from './bussiness/hyDepartmentTypeOperation/tiantong.mjs';
23
24
  export { HyDeviceTree } from './bussiness/hyDeviceTree/index.mjs';
24
25
  export { HyDialog } from './components/hyDialog/index.mjs';
25
26
  export { HyDrawer } from './components/hyDrawer/index.mjs';