hy-dispatch-ui-v3 0.2.52 → 0.2.54
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.
- package/dist/tailwind.css +53 -0
- package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +45 -11
- package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +12 -22
- package/es/components/hyDialog/dialog.vue.mjs +9 -7
- package/es/components/hyForm/cpns/arrayItem.vue.mjs +5 -5
- package/es/components/hyForm/cpns/extraItem.vue.mjs +6 -1
- package/es/components/hyForm/cpns/formItem.vue.mjs +29 -14
- package/es/components/hyForm/js/index.mjs +29 -25
- package/es/components/hyForm/js/useAppForm.mjs +15 -30
- package/es/components/hyIconBox/iconBox.vue.mjs +1 -1
- package/es/components/hyIconBox/style/iconBox.scss +1 -1
- package/es/components/hyMap/index.mjs +6 -0
- package/es/components/hyMap/js/index.mjs +59 -0
- package/es/components/hyMap/map.vue.mjs +59 -0
- package/es/components/hyOrgCascader/js/index.mjs +53 -0
- package/es/components/hyOrgCascader/orgCascader.vue.mjs +22 -25
- package/es/components/hySearch/search.vue.mjs +6 -8
- package/es/components/hyTable/cpns/columnSelect.vue.mjs +10 -18
- package/es/components/hyTable/table.vue.mjs +8 -11
- package/es/components/hyTableActionButton/tableActionButton.vue.mjs +6 -3
- package/es/components/hyTableForm/batchTableForm.vue.mjs +182 -135
- package/es/components/hyTableForm/js/index.mjs +2 -2
- package/es/components/hyTableForm/tableForm.vue.mjs +29 -20
- package/es/components/hyTooltip/tooltip.vue.mjs +1 -1
- package/es/components/hyTree/js/index.mjs +6 -4
- package/es/components/hyTree/tree.vue.mjs +7 -1
- package/es/components/index.mjs +1 -0
- package/es/hooks/index.mjs +1 -0
- package/es/hooks/useApi.mjs +11 -5
- package/es/hooks/useAudioPlayerConfig.mjs +13 -5
- package/es/hooks/useEnsureHyIcon.mjs +11 -5
- package/es/hooks/useLocale.mjs +6 -5
- package/es/hooks/usePermissionMap.mjs +13 -5
- package/es/hooks/useSubscribe.mjs +28 -0
- package/es/hooks/useTooltipConfig.mjs +11 -5
- package/es/hooks/useUserAvatarMap.mjs +13 -5
- package/es/hooks/useVideoPlayerConfig.mjs +13 -5
- package/es/index.mjs +3 -2
- package/es/static/map/CFCASIPInput.min.js +258 -0
- package/es/static/map/MarkerCluster.css +75 -0
- package/es/static/map/bigemap.css +838 -0
- package/es/static/map/bigemap.js +5 -0
- package/es/static/map/bm.geometryutil.js +754 -0
- package/es/static/map/bmDraw.css +329 -0
- package/es/static/map/bmDraw.js +181 -0
- package/es/static/map/car.png +0 -0
- package/es/static/map/markercluster.js +2679 -0
- package/es/static/map/moveMarker.js +74 -0
- package/es/utils/form.mjs +38 -2
- package/es/utils/index.mjs +1 -2
- package/es/utils/map/hook/bigMap.mjs +1136 -0
- package/es/utils/map/hook/gaode.mjs +683 -0
- package/es/utils/map/hook/leafletjs.mjs +1336 -0
- package/es/utils/map/index.mjs +291 -0
- package/es/utils/map/js/mapProxy.mjs +38 -0
- package/es/utils/map/js/webgis.mjs +153 -0
- package/es/version.mjs +1 -1
- package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +46 -12
- package/lib/components/hyConfirmDialog/confirmDialog.vue.js +13 -23
- package/lib/components/hyDialog/dialog.vue.js +9 -7
- package/lib/components/hyForm/cpns/arrayItem.vue.js +4 -4
- package/lib/components/hyForm/cpns/extraItem.vue.js +6 -1
- package/lib/components/hyForm/cpns/formItem.vue.js +26 -11
- package/lib/components/hyForm/js/index.js +29 -23
- package/lib/components/hyForm/js/useAppForm.js +14 -29
- package/lib/components/hyIconBox/iconBox.vue.js +1 -1
- package/lib/components/hyIconBox/style/iconBox.scss +1 -1
- package/lib/components/hyMap/index.js +11 -0
- package/lib/components/hyMap/js/index.js +61 -0
- package/lib/components/hyMap/map.vue.js +63 -0
- package/lib/components/hyOrgCascader/js/index.js +56 -0
- package/lib/components/hyOrgCascader/orgCascader.vue.js +21 -24
- package/lib/components/hySearch/search.vue.js +4 -6
- package/lib/components/hyTable/cpns/columnSelect.vue.js +12 -20
- package/lib/components/hyTable/table.vue.js +17 -20
- package/lib/components/hyTableActionButton/tableActionButton.vue.js +5 -2
- package/lib/components/hyTableForm/batchTableForm.vue.js +181 -134
- package/lib/components/hyTableForm/js/index.js +1 -1
- package/lib/components/hyTableForm/tableForm.vue.js +29 -20
- package/lib/components/hyTooltip/tooltip.vue.js +1 -1
- package/lib/components/hyTree/js/index.js +6 -4
- package/lib/components/hyTree/tree.vue.js +7 -1
- package/lib/components/index.js +22 -20
- package/lib/hooks/index.js +3 -0
- package/lib/hooks/useApi.js +10 -4
- package/lib/hooks/useAudioPlayerConfig.js +12 -4
- package/lib/hooks/useEnsureHyIcon.js +10 -4
- package/lib/hooks/useLocale.js +5 -4
- package/lib/hooks/usePermissionMap.js +12 -4
- package/lib/hooks/useSubscribe.js +31 -0
- package/lib/hooks/useTooltipConfig.js +10 -4
- package/lib/hooks/useUserAvatarMap.js +12 -4
- package/lib/hooks/useVideoPlayerConfig.js +12 -4
- package/lib/index.js +27 -22
- package/lib/static/map/CFCASIPInput.min.js +258 -0
- package/lib/static/map/MarkerCluster.css +75 -0
- package/lib/static/map/bigemap.css +838 -0
- package/lib/static/map/bigemap.js +5 -0
- package/lib/static/map/bm.geometryutil.js +754 -0
- package/lib/static/map/bmDraw.css +329 -0
- package/lib/static/map/bmDraw.js +181 -0
- package/lib/static/map/car.png +0 -0
- package/lib/static/map/markercluster.js +2679 -0
- package/lib/static/map/moveMarker.js +74 -0
- package/lib/utils/form.js +38 -0
- package/lib/utils/index.js +2 -2
- package/lib/utils/map/hook/bigMap.js +1140 -0
- package/lib/utils/map/hook/gaode.js +687 -0
- package/lib/utils/map/hook/leafletjs.js +1360 -0
- package/lib/utils/map/index.js +298 -0
- package/lib/utils/map/js/mapProxy.js +44 -0
- package/lib/utils/map/js/webgis.js +162 -0
- package/lib/version.js +1 -1
- package/package.json +16 -1
- package/es/utils/bus.mjs +0 -5
- package/lib/utils/bus.js +0 -7
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, ref, nextTick, openBlock, createElementBlock, createElementVNode, createVNode, unref as unref$1, withCtx, Fragment, renderList, createCommentVNode, toDisplayString, renderSlot, createTextVNode, mergeProps, createSlots, normalizeProps, guardReactiveProps, normalizeStyle } from 'vue';
|
|
1
|
+
import { defineComponent, useTemplateRef, useModel, ref, nextTick, openBlock, createElementBlock, withDirectives, createElementVNode, createVNode, unref as unref$1, withCtx, Fragment, renderList, createCommentVNode, toDisplayString, renderSlot, createTextVNode, vShow, mergeProps, createSlots, normalizeProps, guardReactiveProps, normalizeStyle, mergeModels } from 'vue';
|
|
2
2
|
import { ElUpload, ElIcon, ElMessage } from 'element-plus';
|
|
3
3
|
import { Loading } from '@element-plus/icons-vue';
|
|
4
4
|
import _sfc_main$1 from './tableForm.vue.mjs';
|
|
@@ -16,7 +16,7 @@ const __default__ = defineComponent({
|
|
|
16
16
|
name: "HyBatchTableForm"
|
|
17
17
|
});
|
|
18
18
|
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
19
|
-
props: {
|
|
19
|
+
props: /* @__PURE__ */ mergeModels({
|
|
20
20
|
// 表格配置项
|
|
21
21
|
tableColumns: {
|
|
22
22
|
// 表格的列
|
|
@@ -78,22 +78,26 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
78
78
|
submitHandler: {
|
|
79
79
|
type: Function
|
|
80
80
|
}
|
|
81
|
-
},
|
|
82
|
-
|
|
81
|
+
}, {
|
|
82
|
+
"step": { type: Number, default: 1 },
|
|
83
|
+
"stepModifiers": {}
|
|
84
|
+
}),
|
|
85
|
+
emits: /* @__PURE__ */ mergeModels([
|
|
83
86
|
"uploading",
|
|
84
87
|
"uploaded",
|
|
85
88
|
"reset",
|
|
86
89
|
"submitting",
|
|
87
90
|
"submit"
|
|
88
|
-
],
|
|
91
|
+
], ["update:step"]),
|
|
89
92
|
setup(__props, { expose: __expose, emit: __emit }) {
|
|
90
93
|
const props = __props;
|
|
91
94
|
const emits = __emit;
|
|
92
95
|
const { api } = useApi();
|
|
93
96
|
const { t } = useLocale();
|
|
94
97
|
const containerRef = useTemplateRef("containerRef");
|
|
98
|
+
const uploadRef = useTemplateRef("uploadRef");
|
|
95
99
|
const tableRef = useTemplateRef("tableRef");
|
|
96
|
-
const active =
|
|
100
|
+
const active = useModel(__props, "step");
|
|
97
101
|
const stepList = [
|
|
98
102
|
{
|
|
99
103
|
title: "\u4E0A\u4F20\u5BFC\u5165\u6587\u4EF6",
|
|
@@ -145,6 +149,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
145
149
|
try {
|
|
146
150
|
isUploading.value = true;
|
|
147
151
|
emits("uploading");
|
|
152
|
+
formColumns;
|
|
148
153
|
const data = await doReadExcel(files, props);
|
|
149
154
|
if (!data) {
|
|
150
155
|
ElMessage.warning("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25");
|
|
@@ -194,6 +199,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
194
199
|
active.value = 1;
|
|
195
200
|
submitNumber.value = 0;
|
|
196
201
|
emits("reset");
|
|
202
|
+
await nextTick();
|
|
203
|
+
uploadRef.value.click();
|
|
197
204
|
}
|
|
198
205
|
async function submitDataSource() {
|
|
199
206
|
if (!props.url && !props.submitHandler) {
|
|
@@ -305,7 +312,19 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
305
312
|
},
|
|
306
313
|
getTableDataSource,
|
|
307
314
|
validate,
|
|
308
|
-
submitDataSource
|
|
315
|
+
submitDataSource,
|
|
316
|
+
prevStep: () => {
|
|
317
|
+
if (active.value > 1) {
|
|
318
|
+
active.value--;
|
|
319
|
+
}
|
|
320
|
+
return active.value;
|
|
321
|
+
},
|
|
322
|
+
nextStep: () => {
|
|
323
|
+
if (active.value < 2) {
|
|
324
|
+
active.value++;
|
|
325
|
+
}
|
|
326
|
+
return active.value;
|
|
327
|
+
}
|
|
309
328
|
});
|
|
310
329
|
return (_ctx, _cache) => {
|
|
311
330
|
return openBlock(), createElementBlock(
|
|
@@ -316,146 +335,170 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
316
335
|
class: "hy-batch-table-form"
|
|
317
336
|
},
|
|
318
337
|
[
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
class: "max-h-full overflow-y-auto scroll-body"
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
338
|
+
withDirectives(createElementVNode(
|
|
339
|
+
"div",
|
|
340
|
+
{ class: "max-h-full overflow-y-auto scroll-body" },
|
|
341
|
+
[
|
|
342
|
+
createElementVNode("div", { class: "hy-batch-table-form-upload-box" }, [
|
|
343
|
+
createVNode(unref$1(ElUpload), {
|
|
344
|
+
accept: ".xls,.xlsx",
|
|
345
|
+
drag: "",
|
|
346
|
+
multiple: false,
|
|
347
|
+
"auto-upload": false,
|
|
348
|
+
"show-file-list": false,
|
|
349
|
+
class: "w-full h-full",
|
|
350
|
+
"on-change": onUploadChange
|
|
351
|
+
}, {
|
|
352
|
+
default: withCtx(() => [
|
|
353
|
+
createVNode(unref$1(HyIcon), {
|
|
354
|
+
"svg-name": "ops-file-xls",
|
|
355
|
+
"class-name": "!w-[58px] !h-[66px] mb-4"
|
|
356
|
+
}),
|
|
357
|
+
isUploading.value ? (openBlock(), createElementBlock("div", {
|
|
358
|
+
key: 0,
|
|
359
|
+
class: "flex items-center gap-2 text-auxiliary"
|
|
360
|
+
}, [
|
|
361
|
+
createElementVNode("span", { class: "text-xs" }, "\u6587\u4EF6\u4E0A\u4F20\u4E2D"),
|
|
362
|
+
createVNode(unref$1(ElIcon), { class: "is-loading" }, {
|
|
363
|
+
default: withCtx(() => [
|
|
364
|
+
createVNode(unref$1(Loading))
|
|
365
|
+
]),
|
|
366
|
+
_: 1
|
|
367
|
+
/* STABLE */
|
|
368
|
+
})
|
|
369
|
+
])) : (openBlock(), createElementBlock(
|
|
370
|
+
Fragment,
|
|
371
|
+
{ key: 1 },
|
|
372
|
+
[
|
|
373
|
+
createElementVNode("div", { class: "mb-1.5 text-main" }, [
|
|
374
|
+
createElementVNode("span", null, "\u70B9\u51FB\u6216\u5C06 \u6587\u4EF6 \u62D6\u62FD\u5230\u6B64\u5904\u4E0A\u4F20")
|
|
375
|
+
]),
|
|
376
|
+
createElementVNode("div", { class: "text-auxiliary text-xs" }, "\u4E00\u6B21\u4EC5\u652F\u6301\u4E0A\u4F20\u4E00\u4E2A\u6587\u4EF6"),
|
|
377
|
+
createElementVNode("div", { class: "w-full text-main absolute left-1/2 bottom-4 transform -translate-x-1/2" }, [
|
|
378
|
+
createElementVNode("div", { class: "flex items-center justify-center text-xs text-auxiliary gap-2" }, [
|
|
379
|
+
createElementVNode("span", null, "\u6587\u4EF6\u652F\u6301\uFF1A"),
|
|
380
|
+
createElementVNode("div", { class: "border border-border rounded py-1 px-2.5 bg-background-4" }, " .xls "),
|
|
381
|
+
createElementVNode("div", { class: "border border-border rounded py-1 px-2.5 bg-background-4" }, " .xlsx "),
|
|
382
|
+
createElementVNode("span", null, "\u5355\u6587\u4EF6\u4E0D\u8D85\u8FC7 10 MB")
|
|
383
|
+
])
|
|
364
384
|
])
|
|
365
|
-
]
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
385
|
+
],
|
|
386
|
+
64
|
|
387
|
+
/* STABLE_FRAGMENT */
|
|
388
|
+
)),
|
|
389
|
+
createElementVNode(
|
|
390
|
+
"div",
|
|
391
|
+
{
|
|
392
|
+
ref_key: "uploadRef",
|
|
393
|
+
ref: uploadRef,
|
|
394
|
+
class: "hy-batch-table-form-upload-bg"
|
|
395
|
+
},
|
|
396
|
+
null,
|
|
397
|
+
512
|
|
398
|
+
/* NEED_PATCH */
|
|
399
|
+
)
|
|
400
|
+
]),
|
|
401
|
+
_: 1
|
|
402
|
+
/* STABLE */
|
|
403
|
+
})
|
|
379
404
|
]),
|
|
380
|
-
createElementVNode("div", { class: "
|
|
381
|
-
(
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
key:
|
|
391
|
-
class: "w-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
405
|
+
createElementVNode("div", { class: "hy-batch-table-form-step-box" }, [
|
|
406
|
+
createElementVNode("div", { class: "text-auxiliary text-center mb-[30px]" }, [
|
|
407
|
+
createElementVNode("span", null, "\u6279\u91CF\u6DFB\u52A0\u5BFC\u5165\u6D41\u7A0B\u8BF4\u660E")
|
|
408
|
+
]),
|
|
409
|
+
createElementVNode("div", { class: "w-full flex" }, [
|
|
410
|
+
(openBlock(), createElementBlock(
|
|
411
|
+
Fragment,
|
|
412
|
+
null,
|
|
413
|
+
renderList(stepList, (item, index) => {
|
|
414
|
+
return createElementVNode("div", {
|
|
415
|
+
key: index,
|
|
416
|
+
class: "w-0 flex-1 flex flex-col items-center relative"
|
|
417
|
+
}, [
|
|
418
|
+
index < stepList.length - 1 ? (openBlock(), createElementBlock("div", {
|
|
419
|
+
key: 0,
|
|
420
|
+
class: "w-3/4 absolute top-[19px] left-full transform -translate-x-1/2",
|
|
421
|
+
style: { "border-top": "2px dashed rgba(var(--hy-border))" }
|
|
422
|
+
})) : createCommentVNode("v-if", true),
|
|
423
|
+
createElementVNode("div", { class: "w-[38px] h-[38px] flex items-center justify-center border border-solid border-border rounded-full bg-background box-border" }, [
|
|
424
|
+
createElementVNode(
|
|
425
|
+
"span",
|
|
426
|
+
{ class: "text-base text-main" },
|
|
427
|
+
toDisplayString(index + 1),
|
|
428
|
+
1
|
|
429
|
+
/* TEXT */
|
|
430
|
+
)
|
|
431
|
+
]),
|
|
395
432
|
createElementVNode(
|
|
396
433
|
"span",
|
|
397
|
-
{ class: "text-
|
|
398
|
-
toDisplayString(
|
|
434
|
+
{ class: "text-main font-bold text-sm mt-3 mb-2" },
|
|
435
|
+
toDisplayString(item.title),
|
|
399
436
|
1
|
|
400
437
|
/* TEXT */
|
|
401
|
-
)
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
}, 8, ["onClick"])
|
|
430
|
-
], void 0, 1) : createCommentVNode("v-if", true)
|
|
431
|
-
]);
|
|
432
|
-
}),
|
|
433
|
-
64
|
|
434
|
-
/* STABLE_FRAGMENT */
|
|
435
|
-
))
|
|
438
|
+
),
|
|
439
|
+
createElementVNode("div", {
|
|
440
|
+
innerHTML: item.description,
|
|
441
|
+
class: "text-auxiliary text-center mb-3 whitespace-nowrap"
|
|
442
|
+
}, null, 8, ["innerHTML"]),
|
|
443
|
+
index === 0 ? renderSlot(_ctx.$slots, "template-down", {}, () => [
|
|
444
|
+
createVNode(unref$1(HyButton), {
|
|
445
|
+
type: "primary",
|
|
446
|
+
link: "",
|
|
447
|
+
onClick: () => unref$1(downloadTemplateHandler)(props)
|
|
448
|
+
}, {
|
|
449
|
+
default: withCtx(() => [
|
|
450
|
+
createTextVNode(
|
|
451
|
+
toDisplayString(__props.templateConfig ? __props.templateConfig.title : "\u4E0B\u8F7D\u6A21\u677F"),
|
|
452
|
+
1
|
|
453
|
+
/* TEXT */
|
|
454
|
+
)
|
|
455
|
+
]),
|
|
456
|
+
_: 1
|
|
457
|
+
/* STABLE */
|
|
458
|
+
}, 8, ["onClick"])
|
|
459
|
+
], void 0, 1) : createCommentVNode("v-if", true)
|
|
460
|
+
]);
|
|
461
|
+
}),
|
|
462
|
+
64
|
|
463
|
+
/* STABLE_FRAGMENT */
|
|
464
|
+
))
|
|
465
|
+
])
|
|
436
466
|
])
|
|
437
|
-
]
|
|
438
|
-
|
|
439
|
-
|
|
467
|
+
],
|
|
468
|
+
512
|
|
469
|
+
/* NEED_PATCH */
|
|
470
|
+
), [
|
|
471
|
+
[vShow, active.value === 1]
|
|
472
|
+
]),
|
|
473
|
+
active.value === 2 ? (openBlock(), createElementBlock("div", {
|
|
474
|
+
key: 0,
|
|
440
475
|
class: "h-full flex flex-col"
|
|
441
476
|
}, [
|
|
442
477
|
createElementVNode("div", { class: "hy-batch-table-form-template-box mb-4" }, [
|
|
443
478
|
createElementVNode("div", { class: "flex items-center gap-2" }, [
|
|
444
479
|
createVNode(unref$1(HyIcon), {
|
|
445
|
-
"svg-name": "
|
|
480
|
+
"svg-name": "ops-file-xls",
|
|
446
481
|
"class-name": "!w-[18px] !h-[22px]"
|
|
447
482
|
}),
|
|
448
483
|
templateFileName.value ? (openBlock(), createElementBlock(
|
|
449
|
-
|
|
450
|
-
{
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
484
|
+
Fragment,
|
|
485
|
+
{ key: 0 },
|
|
486
|
+
[
|
|
487
|
+
createElementVNode(
|
|
488
|
+
"span",
|
|
489
|
+
{ class: "text-theme" },
|
|
490
|
+
toDisplayString(templateFileName.value),
|
|
491
|
+
1
|
|
492
|
+
/* TEXT */
|
|
493
|
+
),
|
|
494
|
+
createElementVNode("span", { class: "text-auxiliary" }, "\u89E3\u6790\u5B8C\u6210")
|
|
495
|
+
],
|
|
496
|
+
64
|
|
497
|
+
/* STABLE_FRAGMENT */
|
|
498
|
+
)) : (openBlock(), createElementBlock("span", {
|
|
499
|
+
key: 1,
|
|
500
|
+
class: "text-auxiliary"
|
|
501
|
+
}, "\u6682\u672A\u5BFC\u5165\u6587\u4EF6"))
|
|
459
502
|
]),
|
|
460
503
|
createVNode(unref$1(HyButton), {
|
|
461
504
|
type: "primary",
|
|
@@ -464,7 +507,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
464
507
|
onClick: onResetUpload
|
|
465
508
|
}, {
|
|
466
509
|
default: withCtx(() => [
|
|
467
|
-
createTextVNode(
|
|
510
|
+
createTextVNode(
|
|
511
|
+
toDisplayString(templateFileName.value ? "\u91CD\u65B0\u4E0A\u4F20\u6587\u4EF6" : "\u70B9\u51FB\u4E0A\u4F20\u6587\u4EF6"),
|
|
512
|
+
1
|
|
513
|
+
/* TEXT */
|
|
514
|
+
)
|
|
468
515
|
]),
|
|
469
516
|
_: 1
|
|
470
517
|
/* STABLE */
|
|
@@ -496,13 +543,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
496
543
|
]), 1040, ["tableColumns", "formColumns", "rules", "rowClickExpand", "columnNum", "size"])
|
|
497
544
|
])) : createCommentVNode("v-if", true),
|
|
498
545
|
submitting.value ? (openBlock(), createElementBlock("div", {
|
|
499
|
-
key:
|
|
546
|
+
key: 1,
|
|
500
547
|
class: "absolute top-0 right-0 bottom-0 left-0 z-10 flex items-center justify-center"
|
|
501
548
|
}, [
|
|
502
549
|
createElementVNode("div", { class: "w-full h-full absolute bg-[rgba(var(--hy-background-4),0.9)] backdrop-blur-sm" }),
|
|
503
550
|
createElementVNode("div", { class: "flex flex-col items-center text-theme text-xs relative" }, [
|
|
504
551
|
createVNode(unref$1(HyIcon), {
|
|
505
|
-
"svg-name": "
|
|
552
|
+
"svg-name": "ops-file-xls",
|
|
506
553
|
"class-name": "!w-[58px] !h-[66px] mb-[18px]"
|
|
507
554
|
}),
|
|
508
555
|
createElementVNode("div", { class: "flex items-center" }, [
|
|
@@ -5,7 +5,7 @@ import AsyncValidator from 'async-validator';
|
|
|
5
5
|
import { ElMessage } from 'element-plus';
|
|
6
6
|
import { columnShowHandler } from '../../hyForm/js/index.mjs';
|
|
7
7
|
import { useApi } from '../../../hooks/useApi.mjs';
|
|
8
|
-
import { setValueByProp, getValueByProp } from '../../../utils/form.mjs';
|
|
8
|
+
import { columnRuleHandler, setValueByProp, getValueByProp } from '../../../utils/form.mjs';
|
|
9
9
|
import { isArray } from '../../../utils/is.mjs';
|
|
10
10
|
|
|
11
11
|
const doValidate = async (target = {}, columns = [], ruleList = {}) => {
|
|
@@ -14,7 +14,7 @@ const doValidate = async (target = {}, columns = [], ruleList = {}) => {
|
|
|
14
14
|
const columnMap = (columns || []).reduce((columnMap2, column) => {
|
|
15
15
|
if (columnShowHandler({ model: data }, column)) {
|
|
16
16
|
columnMap2[column.prop] = column;
|
|
17
|
-
rules[column.prop] = column
|
|
17
|
+
rules[column.prop] = columnRuleHandler(column, target);
|
|
18
18
|
setValueByProp(data, column.prop, getValueByProp(target, column.prop));
|
|
19
19
|
}
|
|
20
20
|
return columnMap2;
|
|
@@ -150,7 +150,15 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
150
150
|
onlyId: /* @__PURE__ */ Symbol("onlyId")
|
|
151
151
|
});
|
|
152
152
|
await initValidateHandler([data]);
|
|
153
|
-
dataSource.value.
|
|
153
|
+
if (!dataSource.value.length) {
|
|
154
|
+
dataSource.value = [data];
|
|
155
|
+
setData(dataSource.value);
|
|
156
|
+
} else {
|
|
157
|
+
dataSource.value.push(data);
|
|
158
|
+
}
|
|
159
|
+
emits("validate", {
|
|
160
|
+
...statistics.value
|
|
161
|
+
});
|
|
154
162
|
}
|
|
155
163
|
async function initValidateHandler(dataSource2) {
|
|
156
164
|
let promiseList = [];
|
|
@@ -158,13 +166,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
158
166
|
promiseList.push(
|
|
159
167
|
new Promise(async (resolve, reject) => {
|
|
160
168
|
try {
|
|
161
|
-
|
|
169
|
+
await doValidate(data, props.formColumns, props.rules);
|
|
162
170
|
data.errorMsg = data.errorMsg && !data.errorMsg.prop ? data.errorMsg : null;
|
|
163
171
|
data.errorMap = /* @__PURE__ */ new Map();
|
|
164
172
|
resolve();
|
|
165
173
|
} catch (error) {
|
|
166
174
|
const errorMap = /* @__PURE__ */ new Map();
|
|
167
|
-
error.forEach((item
|
|
175
|
+
error.forEach((item) => {
|
|
168
176
|
const errData = {
|
|
169
177
|
prop: item.field,
|
|
170
178
|
message: item.message || `${item.field} is required`
|
|
@@ -188,24 +196,25 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
188
196
|
if (!row.errorMap) {
|
|
189
197
|
row.errorMap = /* @__PURE__ */ new Map();
|
|
190
198
|
}
|
|
191
|
-
|
|
192
|
-
row.
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
row.errorMap.set(prop, message);
|
|
203
|
-
if (!row.errorMsg || !row.errorMsg.prop) {
|
|
204
|
-
row.errorMsg = {
|
|
205
|
-
prop,
|
|
206
|
-
message
|
|
199
|
+
try {
|
|
200
|
+
await doValidate(row, props.formColumns, props.rules);
|
|
201
|
+
row.errorMsg = null;
|
|
202
|
+
row.errorMap = /* @__PURE__ */ new Map();
|
|
203
|
+
} catch (error) {
|
|
204
|
+
let errMsg = null;
|
|
205
|
+
const errorMap2 = /* @__PURE__ */ new Map();
|
|
206
|
+
error.forEach((item) => {
|
|
207
|
+
const errData = {
|
|
208
|
+
prop: item.field,
|
|
209
|
+
message: item.message || `${item.field} is required`
|
|
207
210
|
};
|
|
208
|
-
|
|
211
|
+
if (!errMsg) {
|
|
212
|
+
errMsg = errData;
|
|
213
|
+
}
|
|
214
|
+
errorMap2.set(errData.prop, errData.message);
|
|
215
|
+
});
|
|
216
|
+
row.errorMap = errorMap2;
|
|
217
|
+
row.errorMsg = errMsg;
|
|
209
218
|
}
|
|
210
219
|
const { onlyId, errorMsg, errorMap, children, ...data } = row;
|
|
211
220
|
emits("validate", {
|
|
@@ -59,7 +59,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
59
59
|
}
|
|
60
60
|
return (_ctx, _cache) => {
|
|
61
61
|
return openBlock(), createBlock(unref(ElTooltip), mergeProps({
|
|
62
|
-
"
|
|
62
|
+
"show-after": 500,
|
|
63
63
|
class: "item",
|
|
64
64
|
effect: "dark",
|
|
65
65
|
placement: "top",
|
|
@@ -113,6 +113,7 @@ const useAppTreeWrapper = (hy) => {
|
|
|
113
113
|
rowSelection: {
|
|
114
114
|
type: props.showCheckbox ? "checkbox" : "radio",
|
|
115
115
|
highlight: props.highlight,
|
|
116
|
+
checkStrictly: props.checkStrictly,
|
|
116
117
|
// 是否显示选项 showSinglebox 单选为true时部门不显示其他节点显示选择框
|
|
117
118
|
showSelect: (data) => {
|
|
118
119
|
if (data.dataType === 1) {
|
|
@@ -297,6 +298,7 @@ const useAppTreeWrapper = (hy) => {
|
|
|
297
298
|
hy.disableSelectionMap.value = map;
|
|
298
299
|
}
|
|
299
300
|
function refreshData() {
|
|
301
|
+
hy.loading.value = true;
|
|
300
302
|
emits("on-refreshData");
|
|
301
303
|
}
|
|
302
304
|
function setRenderStatus(data) {
|
|
@@ -384,7 +386,7 @@ const useAppTreeWrapper = (hy) => {
|
|
|
384
386
|
}
|
|
385
387
|
function singleRemovalFn(row) {
|
|
386
388
|
if (props.treeType === "device") {
|
|
387
|
-
virtualTree.setChecked(row.deviceId, false, true);
|
|
389
|
+
virtualTree.setChecked(row.channelId || row.deviceId, false, true);
|
|
388
390
|
} else if (props.treeType) {
|
|
389
391
|
virtualTree.setChecked(row.id, false, true);
|
|
390
392
|
} else if (!props.treeType && props.treeProps) {
|
|
@@ -392,9 +394,9 @@ const useAppTreeWrapper = (hy) => {
|
|
|
392
394
|
}
|
|
393
395
|
}
|
|
394
396
|
function setCheckedKeys(dataList) {
|
|
395
|
-
if (props.treeType === "device") {
|
|
397
|
+
if (props.treeType === "device" || props.treeType === "channel") {
|
|
396
398
|
virtualTree?.setCheckedKeys(
|
|
397
|
-
dataList.map((v) => v.deviceId),
|
|
399
|
+
dataList.map((v) => v.channelId || v.deviceId),
|
|
398
400
|
true
|
|
399
401
|
);
|
|
400
402
|
} else if (props.treeType) {
|
|
@@ -416,7 +418,7 @@ const useAppTreeWrapper = (hy) => {
|
|
|
416
418
|
}
|
|
417
419
|
function setChecked(data, type) {
|
|
418
420
|
if (props.treeType === "device") {
|
|
419
|
-
virtualTree?.setChecked(data.deviceId, type, true);
|
|
421
|
+
virtualTree?.setChecked(data.channelId || data.deviceId, type, true);
|
|
420
422
|
} else if (props.treeType) {
|
|
421
423
|
virtualTree?.setChecked(data.id, type, true);
|
|
422
424
|
} else if (!props.treeType && props.treeProps) {
|
|
@@ -137,6 +137,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
137
137
|
highlight: {
|
|
138
138
|
type: Boolean,
|
|
139
139
|
default: false
|
|
140
|
+
},
|
|
141
|
+
// 是否严格的遵循父子不互相关联
|
|
142
|
+
checkStrictly: {
|
|
143
|
+
type: Boolean,
|
|
144
|
+
default: false
|
|
140
145
|
}
|
|
141
146
|
},
|
|
142
147
|
emits: [
|
|
@@ -191,7 +196,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
191
196
|
singleRemovalFn,
|
|
192
197
|
setCheckedKeys,
|
|
193
198
|
setChecked,
|
|
194
|
-
getSelectedDataList
|
|
199
|
+
getSelectedDataList,
|
|
200
|
+
refreshData
|
|
195
201
|
});
|
|
196
202
|
return (_ctx, _cache) => {
|
|
197
203
|
const _directive_loading = resolveDirective("loading");
|
package/es/components/index.mjs
CHANGED
|
@@ -23,6 +23,7 @@ export { ElTimePicker, HyTimePicker } from './hyTimePicker/index.mjs';
|
|
|
23
23
|
export { HyBatchTableForm, HyTableForm } from './hyTableForm/index.mjs';
|
|
24
24
|
export { HyTableActionButton } from './hyTableActionButton/index.mjs';
|
|
25
25
|
export { HyBatchUploadDialog } from './hyBatchUploadDialog/index.mjs';
|
|
26
|
+
export { HyMap } from './hyMap/index.mjs';
|
|
26
27
|
export { resetAppFormValue, useAppForm } from './hyForm/js/useAppForm.mjs';
|
|
27
28
|
export { resetAppSearchValue, useAppSearch } from './hySearch/js/useAppSearch.mjs';
|
|
28
29
|
export { useAppTable } from './hyTable/js/useAppTable.mjs';
|
package/es/hooks/index.mjs
CHANGED
|
@@ -10,3 +10,4 @@ export { localAudioPlayerConfigKey, useAudioPlayerConfig } from './useAudioPlaye
|
|
|
10
10
|
export { localVideoPlayerConfigKey, useVideoPlayerConfig } from './useVideoPlayerConfig.mjs';
|
|
11
11
|
export { localEnsureHyIconMapKey, useEnsureHyIcon } from './useEnsureHyIcon.mjs';
|
|
12
12
|
export { localTooltipConfigKey, useTooltipConfig } from './useTooltipConfig.mjs';
|
|
13
|
+
export { usePublish, useSubscribe } from './useSubscribe.mjs';
|
package/es/hooks/useApi.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import { ref, inject, unref } from 'vue';
|
|
2
|
+
import { ref, getCurrentInstance, inject, unref } from 'vue';
|
|
3
3
|
import { useGlobalConfig } from './useGlobalConfig.mjs';
|
|
4
4
|
|
|
5
5
|
const localApiKey = /* @__PURE__ */ Symbol("localApiKey");
|
|
@@ -20,10 +20,16 @@ defaultAxios.value.interceptors.response.use(
|
|
|
20
20
|
}
|
|
21
21
|
);
|
|
22
22
|
const useApi = () => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
if (getCurrentInstance()) {
|
|
24
|
+
const api = inject(localApiKey, ref());
|
|
25
|
+
return {
|
|
26
|
+
api: unref(api) ? api : unref(useGlobalConfig())?.api || defaultAxios
|
|
27
|
+
};
|
|
28
|
+
} else {
|
|
29
|
+
return {
|
|
30
|
+
api: unref(useGlobalConfig())?.api || defaultAxios
|
|
31
|
+
};
|
|
32
|
+
}
|
|
27
33
|
};
|
|
28
34
|
|
|
29
35
|
export { defaultAxios, localApiKey, useApi };
|