hy-dispatch-ui-v3 0.2.60 → 0.2.62
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 +70 -8
- package/es/api/device.mjs +18 -0
- package/es/api/sypct.mjs +18 -0
- package/es/api/task.mjs +18 -0
- package/es/bussiness/hyMapAearchPlace/index.mjs +6 -0
- package/es/bussiness/hyMapAearchPlace/js/index.mjs +653 -0
- package/es/bussiness/hyMapAearchPlace/mapAearchPlace.vue.mjs +347 -0
- package/es/bussiness/hyMapAearchPlace/mapAearchPlaceItem.vue.mjs +99 -0
- package/es/bussiness/hyMapAearchPlace/style/mapAearchPlace.scss +71 -0
- package/es/bussiness/index.mjs +1 -0
- package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +22 -3
- package/es/components/hyButton/style/button.scss +1 -1
- package/es/components/hyConfigProvider/configProvider.vue.mjs +4 -0
- package/es/components/hyConfirmDialog/confirmDialog.vue.mjs +2 -2
- package/es/components/hyDialog/dialog.vue.mjs +24 -4
- package/es/components/hyForm/cpns/locationSelect.vue.mjs +3 -1
- package/es/components/hyMap/map.vue.mjs +10 -3
- package/es/components/hyMenu/menu.vue.mjs +38 -23
- package/es/components/hyMenu/style/menu.scss +3 -1
- package/es/components/hyOrgCascader/js/index.mjs +2 -2
- package/es/components/hySearch/cpns/searchItem.vue.mjs +17 -1
- package/es/components/hyTable/table.vue.mjs +8 -1
- package/es/components/hyTableForm/batchTableForm.vue.mjs +36 -59
- package/es/components/hyTableForm/js/index.mjs +8 -58
- package/es/components/hyTableForm/tableForm.vue.mjs +9 -3
- package/es/components/hyVideoPlayer/js/index.mjs +0 -1
- package/es/hooks/index.mjs +1 -0
- package/es/hooks/useApi.mjs +2 -2
- package/es/hooks/useGlobalConfig.mjs +6 -1
- package/es/hooks/useMapConfig.mjs +18 -0
- package/es/index.mjs +3 -0
- package/es/static/hy-svg-icons/hy-icon-ops-list-editorialdownsizing.js +14 -0
- package/es/static/hy-svg-icons/hy-icon-ops-list-suoxiao.js +14 -0
- package/es/style/element/hy-element.scss +10 -1
- package/es/utils/form.mjs +5 -1
- package/es/utils/handler.mjs +5 -0
- package/es/utils/index.mjs +1 -0
- package/es/utils/map/js/webgis.mjs +1 -1
- package/es/utils/tree.mjs +1 -0
- package/es/version.mjs +1 -1
- package/lib/api/device.js +20 -0
- package/lib/api/sypct.js +20 -0
- package/lib/api/task.js +20 -0
- package/lib/bussiness/hyMapAearchPlace/index.js +11 -0
- package/lib/bussiness/hyMapAearchPlace/js/index.js +655 -0
- package/lib/bussiness/hyMapAearchPlace/mapAearchPlace.vue.js +351 -0
- package/lib/bussiness/hyMapAearchPlace/mapAearchPlaceItem.vue.js +103 -0
- package/lib/bussiness/hyMapAearchPlace/style/mapAearchPlace.scss +71 -0
- package/lib/bussiness/index.js +2 -0
- package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +22 -3
- package/lib/components/hyButton/style/button.scss +1 -1
- package/lib/components/hyConfigProvider/configProvider.vue.js +4 -0
- package/lib/components/hyConfirmDialog/confirmDialog.vue.js +2 -2
- package/lib/components/hyDialog/dialog.vue.js +23 -3
- package/lib/components/hyForm/cpns/locationSelect.vue.js +3 -1
- package/lib/components/hyMap/map.vue.js +10 -3
- package/lib/components/hyMenu/menu.vue.js +37 -22
- package/lib/components/hyMenu/style/menu.scss +3 -1
- package/lib/components/hyOrgCascader/js/index.js +2 -2
- package/lib/components/hySearch/cpns/searchItem.vue.js +16 -0
- package/lib/components/hyTable/table.vue.js +8 -1
- package/lib/components/hyTableForm/batchTableForm.vue.js +33 -56
- package/lib/components/hyTableForm/js/index.js +7 -58
- package/lib/components/hyTableForm/tableForm.vue.js +8 -2
- package/lib/components/hyVideoPlayer/js/index.js +0 -1
- package/lib/hooks/index.js +3 -0
- package/lib/hooks/useApi.js +2 -2
- package/lib/hooks/useGlobalConfig.js +5 -0
- package/lib/hooks/useMapConfig.js +21 -0
- package/lib/index.js +36 -26
- package/lib/static/hy-svg-icons/hy-icon-ops-list-editorialdownsizing.js +14 -0
- package/lib/static/hy-svg-icons/hy-icon-ops-list-suoxiao.js +14 -0
- package/lib/style/element/hy-element.scss +10 -1
- package/lib/utils/form.js +4 -0
- package/lib/utils/handler.js +5 -0
- package/lib/utils/index.js +5 -0
- package/lib/utils/map/js/webgis.js +1 -0
- package/lib/utils/tree.js +10 -0
- package/lib/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useModel, computed, ref, openBlock, createElementBlock, Fragment, createCommentVNode, createVNode, unref, mergeProps, withCtx,
|
|
1
|
+
import { useModel, computed, ref, resolveDirective, openBlock, createElementBlock, Fragment, createCommentVNode, createVNode, unref, mergeProps, withCtx, withDirectives, renderSlot, createElementVNode, normalizeClass, createBlock, withModifiers, createTextVNode, toDisplayString, mergeModels, defineComponent } from 'vue';
|
|
2
2
|
import { ElDialog } from 'element-plus';
|
|
3
3
|
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
4
4
|
import { HyButton } from '../hyButton/index.mjs';
|
|
@@ -9,6 +9,16 @@ import "./style/dialog.scss";
|
|
|
9
9
|
const __default__ = defineComponent({
|
|
10
10
|
name: "HyDialog"
|
|
11
11
|
});
|
|
12
|
+
const svg = `
|
|
13
|
+
<path class="path" d="
|
|
14
|
+
M 30 15
|
|
15
|
+
L 28 17
|
|
16
|
+
M 25.61 25.61
|
|
17
|
+
A 15 15, 0, 0, 1, 15 30
|
|
18
|
+
A 15 15, 0, 1, 1, 27.99 7.5
|
|
19
|
+
L 15 15
|
|
20
|
+
" style="stroke-width: 4px; fill: rgba(0, 0, 0, 0)"/>
|
|
21
|
+
`;
|
|
12
22
|
const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
13
23
|
props: /* @__PURE__ */ mergeModels({
|
|
14
24
|
title: { type: String, default: "\u6807\u9898" },
|
|
@@ -186,6 +196,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
186
196
|
hideToWorkspace
|
|
187
197
|
});
|
|
188
198
|
return (_ctx, _cache) => {
|
|
199
|
+
const _directive_loading = resolveDirective("loading");
|
|
189
200
|
return openBlock(), createElementBlock(
|
|
190
201
|
Fragment,
|
|
191
202
|
null,
|
|
@@ -206,6 +217,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
206
217
|
"close-on-click-modal": false,
|
|
207
218
|
"close-on-press-escape": false,
|
|
208
219
|
"show-close": false,
|
|
220
|
+
"destroy-on-close": true,
|
|
209
221
|
"modal-class": modalClass.value,
|
|
210
222
|
modelValue: visible.value,
|
|
211
223
|
"onUpdate:modelValue": ($event) => visible.value = $event,
|
|
@@ -251,7 +263,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
251
263
|
)
|
|
252
264
|
]),
|
|
253
265
|
default: withCtx(() => [
|
|
254
|
-
|
|
266
|
+
withDirectives((openBlock(), createElementBlock("div", {
|
|
267
|
+
"element-loading-text": "\u52A0\u8F7D\u4E2D...",
|
|
268
|
+
"element-loading-svg": svg,
|
|
269
|
+
"element-loading-svg-view-box": "-10, -10, 50, 50",
|
|
270
|
+
"element-loading-background": "rgba(0, 0, 0, 0.8)",
|
|
271
|
+
class: "h-full flex flex-col text-main"
|
|
272
|
+
}, [
|
|
255
273
|
renderSlot(_ctx.$slots, "before-content"),
|
|
256
274
|
renderSlot(_ctx.$slots, "content", {}, () => [
|
|
257
275
|
createElementVNode(
|
|
@@ -300,7 +318,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
300
318
|
__props.showSubmit ? (openBlock(), createBlock(unref(HyButton), {
|
|
301
319
|
key: 1,
|
|
302
320
|
type: __props.submitType,
|
|
303
|
-
|
|
321
|
+
loading: loading.value,
|
|
304
322
|
class: "!min-w-[120px]",
|
|
305
323
|
onClick: onSubmitHandler
|
|
306
324
|
}, {
|
|
@@ -313,7 +331,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
313
331
|
]),
|
|
314
332
|
_: 1
|
|
315
333
|
/* STABLE */
|
|
316
|
-
}, 8, ["type", "
|
|
334
|
+
}, 8, ["type", "loading"])) : createCommentVNode("v-if", true)
|
|
317
335
|
]),
|
|
318
336
|
renderSlot(_ctx.$slots, "operate-right-box")
|
|
319
337
|
],
|
|
@@ -322,6 +340,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
322
340
|
),
|
|
323
341
|
renderSlot(_ctx.$slots, "operate-left-box")
|
|
324
342
|
])) : createCommentVNode("v-if", true)
|
|
343
|
+
])), [
|
|
344
|
+
[_directive_loading, loading.value]
|
|
325
345
|
])
|
|
326
346
|
]),
|
|
327
347
|
_: 3
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ref, onMounted, openBlock, createElementBlock, createElementVNode } from 'vue';
|
|
2
2
|
import { useAppMapWrapper } from './js/index.mjs';
|
|
3
3
|
import { useMixins } from '../../hooks/useMixins.mjs';
|
|
4
|
+
import { useMapConfig } from '../../hooks/useMapConfig.mjs';
|
|
4
5
|
|
|
5
6
|
import "../../static/map/bigemap.css";
|
|
6
7
|
|
|
@@ -14,12 +15,18 @@ const _sfc_main = {
|
|
|
14
15
|
// 地图配置
|
|
15
16
|
mapConfig: {
|
|
16
17
|
type: Object,
|
|
17
|
-
default: () =>
|
|
18
|
+
default: () => {
|
|
19
|
+
const { mapConfig } = useMapConfig();
|
|
20
|
+
return mapConfig.value || {};
|
|
21
|
+
}
|
|
18
22
|
},
|
|
19
|
-
// 地图类型 gaode leafletjs
|
|
23
|
+
// 地图类型 gaode leafletjs bigMap
|
|
20
24
|
mapType: {
|
|
21
25
|
type: String,
|
|
22
|
-
default:
|
|
26
|
+
default: () => {
|
|
27
|
+
const { mapConfig } = useMapConfig();
|
|
28
|
+
return mapConfig.value?.mapType || "gaode";
|
|
29
|
+
}
|
|
23
30
|
}
|
|
24
31
|
},
|
|
25
32
|
emits: ["complete"],
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useModel, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, createBlock, unref, withCtx, withModifiers, createVNode, toDisplayString,
|
|
2
|
-
import { ElIcon } from 'element-plus';
|
|
3
|
-
import { Download } from '@element-plus/icons-vue';
|
|
1
|
+
import { defineComponent, useModel, openBlock, createElementBlock, normalizeClass, createElementVNode, Fragment, renderList, createBlock, unref, withCtx, withModifiers, createVNode, toDisplayString, createCommentVNode, mergeModels } from 'vue';
|
|
4
2
|
import { HyTooltip } from '../hyTooltip/index.mjs';
|
|
5
3
|
import { HyIcon } from '../hyIcon/index.mjs';
|
|
6
4
|
|
|
@@ -21,7 +19,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
21
19
|
},
|
|
22
20
|
showShrink: {
|
|
23
21
|
type: Boolean,
|
|
24
|
-
default:
|
|
22
|
+
default: true
|
|
25
23
|
}
|
|
26
24
|
}, {
|
|
27
25
|
"expand": { type: Boolean, default: true },
|
|
@@ -66,18 +64,27 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
66
64
|
}, [
|
|
67
65
|
createElementVNode("div", { class: "operator-label clickBox" }, [
|
|
68
66
|
createVNode(unref(HyIcon), {
|
|
69
|
-
"svg-name": `${item.iconName}`,
|
|
70
|
-
"class-name": "!w-
|
|
67
|
+
"svg-name": `${item.iconNameV3 || item.iconName}`,
|
|
68
|
+
"class-name": "!w-4 !h-4 flex-shrink-0"
|
|
71
69
|
}, null, 8, ["svg-name"]),
|
|
72
70
|
createElementVNode(
|
|
73
71
|
"div",
|
|
74
72
|
{
|
|
75
|
-
class: normalizeClass([{
|
|
73
|
+
class: normalizeClass([{
|
|
74
|
+
"ml-4 mr-3": expand.value,
|
|
75
|
+
"text-center mt-1": !expand.value
|
|
76
|
+
}, "over_one_line w-full"])
|
|
76
77
|
},
|
|
77
78
|
toDisplayString(expand.value ? item.label : item.tip || item.label),
|
|
78
79
|
3
|
|
79
80
|
/* TEXT, CLASS */
|
|
80
|
-
)
|
|
81
|
+
),
|
|
82
|
+
expand.value && __props.modelValue === item.path ? (openBlock(), createBlock(unref(HyIcon), {
|
|
83
|
+
key: 0,
|
|
84
|
+
"svg-name": "analytics-v3-card-bili",
|
|
85
|
+
class: "text-theme",
|
|
86
|
+
"class-name": "!w-3 !h-3 flex-shrink-0"
|
|
87
|
+
})) : createCommentVNode("v-if", true)
|
|
81
88
|
])
|
|
82
89
|
], 10, ["onClick"])
|
|
83
90
|
]),
|
|
@@ -91,23 +98,31 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
91
98
|
]),
|
|
92
99
|
__props.showShrink ? (openBlock(), createElementBlock("div", {
|
|
93
100
|
key: 0,
|
|
94
|
-
class: normalizeClass(["w-full h-[44px] border-t border-border box-border cursor-pointer relative", { "justify-end pr-3": expand.value, "justify-center": !expand.value }]),
|
|
101
|
+
class: normalizeClass(["w-full h-[44px] border-t border-border box-border cursor-pointer relative flex items-center", { "justify-end pr-3": expand.value, "justify-center": !expand.value }]),
|
|
95
102
|
onClick: ($event) => onExpandHandler()
|
|
96
103
|
}, [
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
104
|
+
expand.value ? (openBlock(), createBlock(unref(HyIcon), {
|
|
105
|
+
key: 0,
|
|
106
|
+
"svg-name": "ops-linear-shouqi",
|
|
107
|
+
"class-name": "!w-4 !h-4 flex-shrink-0"
|
|
108
|
+
})) : (openBlock(), createBlock(unref(HyIcon), {
|
|
109
|
+
key: 1,
|
|
110
|
+
"svg-name": "ops-linear-zhankai",
|
|
111
|
+
"class-name": "!w-4 !h-4 flex-shrink-0"
|
|
112
|
+
})),
|
|
113
|
+
createCommentVNode(" <el-icon"),
|
|
114
|
+
createCommentVNode(' size="20"'),
|
|
115
|
+
createCommentVNode(' :style="{'),
|
|
116
|
+
createCommentVNode(" transform: expand"),
|
|
117
|
+
createCommentVNode(" ? 'translate(0px, -50%) rotateY(0deg) rotateZ(90deg)'"),
|
|
118
|
+
createCommentVNode(" : 'translate(50%, -50%) rotateY(-180deg) rotateZ(90deg)',"),
|
|
119
|
+
createCommentVNode(" transition: 'all 0.3s linear',"),
|
|
120
|
+
createCommentVNode(' }"'),
|
|
121
|
+
createCommentVNode(' class="absolute top-1/2"'),
|
|
122
|
+
createCommentVNode(` :class="{ 'right-3': expand, 'right-1/2': !expand }"`),
|
|
123
|
+
createCommentVNode(" >"),
|
|
124
|
+
createCommentVNode(" <Download />"),
|
|
125
|
+
createCommentVNode(" </el-icon>")
|
|
111
126
|
], 10, ["onClick"])) : createCommentVNode("v-if", true)
|
|
112
127
|
],
|
|
113
128
|
2
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
left: 0;
|
|
54
54
|
top: 50%;
|
|
55
55
|
transform: translateY(-50%);
|
|
56
|
+
border-radius: 10px;
|
|
56
57
|
background-color: rgba(var(--hy-theme));
|
|
57
58
|
}
|
|
58
59
|
.operator-label {
|
|
@@ -115,6 +116,7 @@
|
|
|
115
116
|
left: 0;
|
|
116
117
|
top: 50%;
|
|
117
118
|
transform: translateY(-50%);
|
|
119
|
+
border-radius: 10px;
|
|
118
120
|
background-color: rgba(var(--hy-theme));
|
|
119
121
|
}
|
|
120
122
|
.operator-label {
|
|
@@ -138,7 +140,7 @@
|
|
|
138
140
|
rgba(var(--hy-theme), 0) 2%,
|
|
139
141
|
rgba(var(--hy-theme), 0.4) 100%
|
|
140
142
|
);
|
|
141
|
-
border-radius: 0px 4px 4px 0px;
|
|
143
|
+
//border-radius: 0px 4px 4px 0px;
|
|
142
144
|
}
|
|
143
145
|
}
|
|
144
146
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Axios from 'axios';
|
|
2
2
|
import { unref } from 'vue';
|
|
3
3
|
import { useApi } from '../../../hooks/useApi.mjs';
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@ function getOrgTreeSimple() {
|
|
|
10
10
|
if (cancelSource) {
|
|
11
11
|
cancelSource.cancel("\u4E2D\u65AD\u8BF7\u6C42");
|
|
12
12
|
}
|
|
13
|
-
cancelSource =
|
|
13
|
+
cancelSource = Axios.CancelToken.source();
|
|
14
14
|
throttleFn = new Promise((resolve, reject) => {
|
|
15
15
|
unref(api).post(
|
|
16
16
|
"organization/orgTreeSimple",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { computed, unref, openBlock, createBlock, withCtx, createElementVNode, normalizeStyle, createCommentVNode, normalizeClass, renderSlot, createElementBlock, toDisplayString, Fragment, createVNode, mergeProps, withKeys, renderList } from 'vue';
|
|
2
|
-
import { ElFormItem, ElSelect } from 'element-plus';
|
|
2
|
+
import { ElFormItem, ElSelect, ElCascader } from 'element-plus';
|
|
3
3
|
import { columnShowHandler, columnItemStyle, columnItemInputStyle, isDisabled, optionsHandler, isSelectedTimeRange, timeRangeHandler } from '../js/index.mjs';
|
|
4
4
|
import { isArray } from '../../../utils/is.mjs';
|
|
5
5
|
import { setValueByProp, getValueByProp, columnPlaceholderHandler, columnLabelHandler } from '../../../utils/form.mjs';
|
|
@@ -239,6 +239,22 @@ const _sfc_main = {
|
|
|
239
239
|
],
|
|
240
240
|
2112
|
|
241
241
|
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
242
|
+
)) : __props.column.type === "cascader" ? (openBlock(), createElementBlock(
|
|
243
|
+
Fragment,
|
|
244
|
+
{ key: 6 },
|
|
245
|
+
[
|
|
246
|
+
createCommentVNode(" \u7EA7\u8054\u9009\u62E9\u6846 "),
|
|
247
|
+
createVNode(unref(ElCascader), mergeProps({
|
|
248
|
+
modelValue: bindValue.value,
|
|
249
|
+
"onUpdate:modelValue": ($event) => bindValue.value = $event
|
|
250
|
+
}, columnAttrs.value, {
|
|
251
|
+
disabled: unref(isDisabled)(props, __props.column),
|
|
252
|
+
options: unref(optionsHandler)(props, __props.column),
|
|
253
|
+
onChange: onChangeHandler
|
|
254
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "options"])
|
|
255
|
+
],
|
|
256
|
+
2112
|
|
257
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
242
258
|
)) : createCommentVNode("v-if", true)
|
|
243
259
|
],
|
|
244
260
|
6
|
|
@@ -239,6 +239,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
239
239
|
// 表单查询
|
|
240
240
|
totalElements,
|
|
241
241
|
showFilter,
|
|
242
|
+
selectedList,
|
|
242
243
|
getData,
|
|
243
244
|
setData,
|
|
244
245
|
resetFields,
|
|
@@ -741,7 +742,13 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
741
742
|
"hide-on-single-page": "",
|
|
742
743
|
onSizeChange: unref(onSizeChangeHandler),
|
|
743
744
|
onCurrentChange: unref(onCurrentChangeHandler)
|
|
744
|
-
}, null, 8, ["current-page", "onUpdate:currentPage", "page-size", "onUpdate:pageSize", "total", "pager-count", "layout", "onSizeChange", "onCurrentChange"])
|
|
745
|
+
}, null, 8, ["current-page", "onUpdate:currentPage", "page-size", "onUpdate:pageSize", "total", "pager-count", "layout", "onSizeChange", "onCurrentChange"]),
|
|
746
|
+
unref(selectedList) && unref(selectedList).length > 0 ? (openBlock(), createElementBlock("div", {
|
|
747
|
+
key: 0,
|
|
748
|
+
class: "absolute right-4 top-1/2 transform -translate-y-1/2"
|
|
749
|
+
}, [
|
|
750
|
+
renderSlot(_ctx.$slots, "multiple-operator-slot")
|
|
751
|
+
])) : createCommentVNode("v-if", true)
|
|
745
752
|
])) : createCommentVNode("v-if", true)
|
|
746
753
|
]),
|
|
747
754
|
createCommentVNode(" \u8868\u683C\u884C\u53F3\u952E\u5C55\u793A\u64CD\u4F5C\u5217\u8868 "),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, useModel, ref, nextTick, openBlock, createElementBlock, withDirectives, createElementVNode, createVNode, unref
|
|
1
|
+
import { defineComponent, useTemplateRef, useModel, ref, nextTick, openBlock, createElementBlock, withDirectives, createElementVNode, createVNode, unref, withCtx, Fragment, renderList, createCommentVNode, toDisplayString, renderSlot, vShow, createTextVNode, 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';
|
|
5
|
-
import {
|
|
5
|
+
import { doReadExcel } from './js/index.mjs';
|
|
6
6
|
import { useApi } from '../../hooks/useApi.mjs';
|
|
7
7
|
import { useLocale } from '../../hooks/useLocale.mjs';
|
|
8
8
|
import { isArray } from '../../utils/is.mjs';
|
|
@@ -64,21 +64,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
64
64
|
onExpandRowChange: {
|
|
65
65
|
type: Function
|
|
66
66
|
},
|
|
67
|
-
|
|
68
|
-
type:
|
|
69
|
-
default: () => ({
|
|
70
|
-
title: "\u4E0B\u8F7D\u6A21\u677F",
|
|
71
|
-
url: "",
|
|
72
|
-
fileName: ""
|
|
73
|
-
})
|
|
74
|
-
},
|
|
75
|
-
url: {
|
|
76
|
-
type: String
|
|
67
|
+
submitHandler: {
|
|
68
|
+
type: Function
|
|
77
69
|
},
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
// 是否显示添加按钮
|
|
71
|
+
showAddBtn: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: true
|
|
80
74
|
},
|
|
81
|
-
|
|
75
|
+
// 外部整体数据处理
|
|
76
|
+
beforeDataListHandle: {
|
|
82
77
|
type: Function
|
|
83
78
|
}
|
|
84
79
|
}, {
|
|
@@ -142,6 +137,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
142
137
|
return tableRef.value.validate();
|
|
143
138
|
}
|
|
144
139
|
async function onUploadChange(file) {
|
|
140
|
+
const { beforeDataListHandle } = props;
|
|
145
141
|
const type = file.raw.type;
|
|
146
142
|
if (file.raw.size > 1024 * 1024 * 10) {
|
|
147
143
|
ElMessage.error(`\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC710M\uFF01`);
|
|
@@ -149,31 +145,32 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
149
145
|
} else {
|
|
150
146
|
if (type.indexOf("application") !== -1) {
|
|
151
147
|
const files = { 0: file.raw };
|
|
148
|
+
isUploading.value = true;
|
|
149
|
+
emits("uploading");
|
|
152
150
|
try {
|
|
153
|
-
isUploading.value = true;
|
|
154
|
-
emits("uploading");
|
|
155
151
|
const data = await doReadExcel(files, props);
|
|
156
152
|
if (!data) {
|
|
157
153
|
ElMessage.warning("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25");
|
|
158
|
-
|
|
159
|
-
return;
|
|
154
|
+
throw Error("\u8BFB\u53D6\u6587\u4EF6\u5931\u8D25");
|
|
160
155
|
}
|
|
161
156
|
if (!data.length) {
|
|
162
157
|
ElMessage.warning("\u8BE5\u6587\u4EF6\u6CA1\u6709\u6570\u636E");
|
|
163
|
-
|
|
164
|
-
return;
|
|
158
|
+
throw Error("\u8BE5\u6587\u4EF6\u6CA1\u6709\u6570\u636E");
|
|
165
159
|
}
|
|
166
160
|
active.value++;
|
|
167
|
-
isUploading.value = false;
|
|
168
|
-
emits("uploaded");
|
|
169
161
|
await nextTick();
|
|
170
|
-
|
|
162
|
+
if (beforeDataListHandle) {
|
|
163
|
+
const processData = await beforeDataListHandle(data);
|
|
164
|
+
setData(processData);
|
|
165
|
+
} else {
|
|
166
|
+
setData(data);
|
|
167
|
+
}
|
|
171
168
|
templateFileName.value = file.name;
|
|
172
169
|
} catch (err) {
|
|
173
|
-
isUploading.value = false;
|
|
174
170
|
console.error(err);
|
|
175
|
-
return;
|
|
176
171
|
}
|
|
172
|
+
isUploading.value = false;
|
|
173
|
+
emits("uploaded");
|
|
177
174
|
} else {
|
|
178
175
|
ElMessage.error("\u6587\u4EF6\u683C\u5F0F\u6709\u8BEF");
|
|
179
176
|
}
|
|
@@ -205,8 +202,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
205
202
|
uploadRef.value.click();
|
|
206
203
|
}
|
|
207
204
|
async function submitDataSource() {
|
|
208
|
-
if (!props.
|
|
209
|
-
ElMessage.warning("\u8BF7\u914D\u7F6E\u63D0\u4EA4\
|
|
205
|
+
if (!props.submitHandler) {
|
|
206
|
+
ElMessage.warning("\u8BF7\u914D\u7F6E\u63D0\u4EA4\u903B\u8F91");
|
|
210
207
|
return Promise.reject();
|
|
211
208
|
}
|
|
212
209
|
if (submitting.value) {
|
|
@@ -250,13 +247,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
250
247
|
if (errorMsg) {
|
|
251
248
|
continue;
|
|
252
249
|
}
|
|
253
|
-
let res2;
|
|
254
250
|
try {
|
|
255
|
-
|
|
256
|
-
res2 = await props.submitHandler(data);
|
|
257
|
-
} else {
|
|
258
|
-
res2 = await unref(api).post(props.url, props.submitParams);
|
|
259
|
-
}
|
|
251
|
+
const res2 = await props.submitHandler(data);
|
|
260
252
|
if (res2.code === 200) {
|
|
261
253
|
submitNumber.value++;
|
|
262
254
|
submitList.push(target);
|
|
@@ -342,7 +334,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
342
334
|
{ class: "max-h-full overflow-y-auto scroll-body" },
|
|
343
335
|
[
|
|
344
336
|
createElementVNode("div", { class: "hy-batch-table-form-upload-box" }, [
|
|
345
|
-
createVNode(unref
|
|
337
|
+
createVNode(unref(ElUpload), {
|
|
346
338
|
accept: ".xls,.xlsx",
|
|
347
339
|
drag: "",
|
|
348
340
|
multiple: false,
|
|
@@ -352,7 +344,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
352
344
|
"on-change": onUploadChange
|
|
353
345
|
}, {
|
|
354
346
|
default: withCtx(() => [
|
|
355
|
-
createVNode(unref
|
|
347
|
+
createVNode(unref(HyIcon), {
|
|
356
348
|
"svg-name": "ops-file-xls",
|
|
357
349
|
"class-name": "!w-[58px] !h-[66px] mb-4"
|
|
358
350
|
}),
|
|
@@ -361,9 +353,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
361
353
|
class: "flex items-center gap-2 text-auxiliary"
|
|
362
354
|
}, [
|
|
363
355
|
createElementVNode("span", { class: "text-xs" }, "\u6587\u4EF6\u4E0A\u4F20\u4E2D"),
|
|
364
|
-
createVNode(unref
|
|
356
|
+
createVNode(unref(ElIcon), { class: "is-loading" }, {
|
|
365
357
|
default: withCtx(() => [
|
|
366
|
-
createVNode(unref
|
|
358
|
+
createVNode(unref(Loading))
|
|
367
359
|
]),
|
|
368
360
|
_: 1
|
|
369
361
|
/* STABLE */
|
|
@@ -442,23 +434,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
442
434
|
innerHTML: item.description,
|
|
443
435
|
class: "text-auxiliary text-center mb-3 whitespace-nowrap"
|
|
444
436
|
}, null, 8, ["innerHTML"]),
|
|
445
|
-
index === 0 ? renderSlot(_ctx.$slots, "template-down", {},
|
|
446
|
-
createVNode(unref$1(HyButton), {
|
|
447
|
-
type: "primary",
|
|
448
|
-
link: "",
|
|
449
|
-
onClick: () => unref$1(downloadTemplateHandler)(props)
|
|
450
|
-
}, {
|
|
451
|
-
default: withCtx(() => [
|
|
452
|
-
createTextVNode(
|
|
453
|
-
toDisplayString(__props.templateConfig ? __props.templateConfig.title : "\u4E0B\u8F7D\u6A21\u677F"),
|
|
454
|
-
1
|
|
455
|
-
/* TEXT */
|
|
456
|
-
)
|
|
457
|
-
]),
|
|
458
|
-
_: 1
|
|
459
|
-
/* STABLE */
|
|
460
|
-
}, 8, ["onClick"])
|
|
461
|
-
], void 0, 1) : createCommentVNode("v-if", true)
|
|
437
|
+
index === 0 ? renderSlot(_ctx.$slots, "template-down", {}, void 0, void 0, 1) : createCommentVNode("v-if", true)
|
|
462
438
|
]);
|
|
463
439
|
}),
|
|
464
440
|
64
|
|
@@ -478,7 +454,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
478
454
|
}, [
|
|
479
455
|
createElementVNode("div", { class: "hy-batch-table-form-template-box mb-4" }, [
|
|
480
456
|
createElementVNode("div", { class: "flex items-center gap-2" }, [
|
|
481
|
-
createVNode(unref
|
|
457
|
+
createVNode(unref(HyIcon), {
|
|
482
458
|
"svg-name": "ops-file-xls",
|
|
483
459
|
"class-name": "!w-[18px] !h-[22px]"
|
|
484
460
|
}),
|
|
@@ -502,7 +478,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
502
478
|
class: "text-auxiliary"
|
|
503
479
|
}, "\u6682\u672A\u5BFC\u5165\u6587\u4EF6"))
|
|
504
480
|
]),
|
|
505
|
-
createVNode(unref
|
|
481
|
+
createVNode(unref(HyButton), {
|
|
506
482
|
type: "primary",
|
|
507
483
|
link: "",
|
|
508
484
|
size: "small",
|
|
@@ -530,6 +506,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
530
506
|
rowClickExpand: __props.rowClickExpand,
|
|
531
507
|
columnNum: __props.columnNum,
|
|
532
508
|
size: __props.size,
|
|
509
|
+
showAddBtn: __props.showAddBtn,
|
|
533
510
|
class: "h-0 flex-1"
|
|
534
511
|
}), createSlots({
|
|
535
512
|
_: 2
|
|
@@ -543,7 +520,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
543
520
|
])
|
|
544
521
|
};
|
|
545
522
|
})
|
|
546
|
-
]), 1040, ["tableColumns", "formColumns", "onExpandRowChange", "rules", "rowClickExpand", "columnNum", "size"])
|
|
523
|
+
]), 1040, ["tableColumns", "formColumns", "onExpandRowChange", "rules", "rowClickExpand", "columnNum", "size", "showAddBtn"])
|
|
547
524
|
])) : createCommentVNode("v-if", true),
|
|
548
525
|
submitting.value ? (openBlock(), createElementBlock("div", {
|
|
549
526
|
key: 1,
|
|
@@ -551,7 +528,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
551
528
|
}, [
|
|
552
529
|
createElementVNode("div", { class: "w-full h-full absolute bg-[rgba(var(--hy-background-4),0.9)] backdrop-blur-sm" }),
|
|
553
530
|
createElementVNode("div", { class: "flex flex-col items-center text-theme text-xs relative" }, [
|
|
554
|
-
createVNode(unref
|
|
531
|
+
createVNode(unref(HyIcon), {
|
|
555
532
|
"svg-name": "ops-file-xls",
|
|
556
533
|
"class-name": "!w-[58px] !h-[66px] mb-[18px]"
|
|
557
534
|
}),
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import XLSX from 'xlsx';
|
|
2
|
-
import dayjs from 'dayjs';
|
|
3
|
-
import { unref } from 'vue';
|
|
4
2
|
import AsyncValidator from 'async-validator';
|
|
5
|
-
import { ElMessage } from 'element-plus';
|
|
6
3
|
import { columnShowHandler } from '../../hyForm/js/index.mjs';
|
|
7
|
-
import { useApi } from '../../../hooks/useApi.mjs';
|
|
8
4
|
import { columnRuleHandler, setValueByProp, getValueByProp } from '../../../utils/form.mjs';
|
|
9
5
|
import { isArray } from '../../../utils/is.mjs';
|
|
10
6
|
|
|
@@ -39,7 +35,7 @@ const doValidate = async (target = {}, columns = [], ruleList = {}) => {
|
|
|
39
35
|
});
|
|
40
36
|
};
|
|
41
37
|
const doReadExcel = (files, props) => {
|
|
42
|
-
return new Promise((
|
|
38
|
+
return new Promise((resolve, reject) => {
|
|
43
39
|
const { formColumns, beforeDataHandle } = props;
|
|
44
40
|
const fileReader = new FileReader();
|
|
45
41
|
fileReader.onload = (ev) => {
|
|
@@ -59,9 +55,13 @@ const doReadExcel = (files, props) => {
|
|
|
59
55
|
}, JSON.stringify(ws1));
|
|
60
56
|
let dataSource = JSON.parse(content);
|
|
61
57
|
if (beforeDataHandle) {
|
|
62
|
-
|
|
58
|
+
const handlePromises = dataSource.map(
|
|
59
|
+
(item) => Promise.resolve().then(() => beforeDataHandle(item)).catch(() => item)
|
|
60
|
+
);
|
|
61
|
+
Promise.all(handlePromises).then(resolve, reject);
|
|
62
|
+
return;
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
resolve(dataSource);
|
|
65
65
|
} catch (err) {
|
|
66
66
|
reject(err);
|
|
67
67
|
}
|
|
@@ -69,55 +69,5 @@ const doReadExcel = (files, props) => {
|
|
|
69
69
|
fileReader.readAsBinaryString(files[0]);
|
|
70
70
|
});
|
|
71
71
|
};
|
|
72
|
-
const downloadTemplateHandler = async (props) => {
|
|
73
|
-
const { templateConfig } = props;
|
|
74
|
-
const { url, fileName } = templateConfig;
|
|
75
|
-
if (!url) {
|
|
76
|
-
ElMessage.warning("\u8BF7\u914D\u7F6E\u4E0B\u8F7D\u6A21\u677F\u5730\u5740");
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
const { api } = useApi();
|
|
80
|
-
try {
|
|
81
|
-
const blob = await unref(api).get(url, {
|
|
82
|
-
responseType: "blob"
|
|
83
|
-
});
|
|
84
|
-
blobDownloadFn(blob, fileName).then(() => {
|
|
85
|
-
resolve();
|
|
86
|
-
});
|
|
87
|
-
} catch (err) {
|
|
88
|
-
console.error(err);
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
function blobDownloadFn(blob, name) {
|
|
92
|
-
return new Promise((resolve2, reject) => {
|
|
93
|
-
ElMessage.warning("\u5F00\u59CB\u4E0B\u8F7D");
|
|
94
|
-
const today = dayjs().format("YYYY-MM-DD HH:mm:ss");
|
|
95
|
-
const reader = new FileReader();
|
|
96
|
-
reader.readAsDataURL(blob);
|
|
97
|
-
reader.onload = function(ev) {
|
|
98
|
-
let url = null;
|
|
99
|
-
try {
|
|
100
|
-
if (window.navigator.msSaveOrOpenBlob) {
|
|
101
|
-
const blobObject = new Blob([blob]);
|
|
102
|
-
window.navigator.msSaveOrOpenBlob(blobObject, `${name}_${today}.xls`);
|
|
103
|
-
} else {
|
|
104
|
-
url = URL.createObjectURL(new Blob([blob]));
|
|
105
|
-
const a = document.createElement("a");
|
|
106
|
-
document.body.appendChild(a);
|
|
107
|
-
a.href = url;
|
|
108
|
-
a.download = `${name}_${today}.xls`;
|
|
109
|
-
a.target = "_blank";
|
|
110
|
-
a.click();
|
|
111
|
-
a.remove();
|
|
112
|
-
}
|
|
113
|
-
resolve2();
|
|
114
|
-
} catch (error) {
|
|
115
|
-
reject(error);
|
|
116
|
-
} finally {
|
|
117
|
-
if (url) URL.revokeObjectURL(url);
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
72
|
|
|
123
|
-
export { doReadExcel, doValidate
|
|
73
|
+
export { doReadExcel, doValidate };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, ref, computed, openBlock, createElementBlock, createElementVNode, toDisplayString, createCommentVNode,
|
|
1
|
+
import { defineComponent, useTemplateRef, ref, computed, openBlock, createElementBlock, createElementVNode, toDisplayString, createCommentVNode, createBlock, unref, withCtx, createTextVNode, Fragment, renderList, normalizeClass, createVNode, mergeProps, createSlots, renderSlot, normalizeProps, guardReactiveProps, nextTick } from 'vue';
|
|
2
2
|
import { ElIcon } from 'element-plus';
|
|
3
3
|
import { Warning } from '@element-plus/icons-vue';
|
|
4
4
|
import { doValidate } from './js/index.mjs';
|
|
@@ -59,6 +59,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
59
59
|
type: String,
|
|
60
60
|
default: "default"
|
|
61
61
|
// 'large' | 'default' | 'small'
|
|
62
|
+
},
|
|
63
|
+
// 是否显示添加按钮
|
|
64
|
+
showAddBtn: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: true
|
|
62
67
|
}
|
|
63
68
|
},
|
|
64
69
|
emits: ["validate"],
|
|
@@ -330,7 +335,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
330
335
|
])) : createCommentVNode("v-if", true)
|
|
331
336
|
]),
|
|
332
337
|
createElementVNode("div", { class: "flex items-center gap-3" }, [
|
|
333
|
-
|
|
338
|
+
__props.showAddBtn ? (openBlock(), createBlock(unref(HyButton), {
|
|
339
|
+
key: 0,
|
|
334
340
|
type: "success",
|
|
335
341
|
size: "small",
|
|
336
342
|
"svg-name": "ops-button-add",
|
|
@@ -341,7 +347,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
341
347
|
]),
|
|
342
348
|
_: 1
|
|
343
349
|
/* STABLE */
|
|
344
|
-
}),
|
|
350
|
+
})) : createCommentVNode("v-if", true),
|
|
345
351
|
createElementVNode("div", { class: "hy-table-form-tabs" }, [
|
|
346
352
|
(openBlock(true), createElementBlock(
|
|
347
353
|
Fragment,
|