hy-dispatch-ui-v3 0.2.53 → 0.2.55
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 +39 -10
- 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 +5 -4
- package/es/components/hyTree/tree.vue.mjs +5 -0
- 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 +40 -11
- 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 +5 -4
- package/lib/components/hyTree/tree.vue.js +5 -0
- 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
|
@@ -225,13 +225,15 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
225
225
|
class: vue.normalizeClass(["box-border w-full border-0 border-b border-solid border-background-3 px-4 py-[10px] text-main text-sm font-bold flex justify-between items-center relative", { "!justify-center": __props.titleAlign === "center" }])
|
|
226
226
|
},
|
|
227
227
|
[
|
|
228
|
-
vue.createElementVNode(
|
|
229
|
-
"
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
228
|
+
vue.createElementVNode("div", { class: "flex-grow w-0 mr-2 over_one_line" }, [
|
|
229
|
+
vue.renderSlot(_ctx.$slots, "title", {}, () => [
|
|
230
|
+
vue.createTextVNode(
|
|
231
|
+
vue.toDisplayString(__props.title),
|
|
232
|
+
1
|
|
233
|
+
/* TEXT */
|
|
234
|
+
)
|
|
235
|
+
])
|
|
236
|
+
]),
|
|
235
237
|
vue.createElementVNode("div", { class: "text-lg cursor-pointer" }, [
|
|
236
238
|
vue.renderSlot(_ctx.$slots, "title-operate-box"),
|
|
237
239
|
__props.ifShrink ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.HyIcon), {
|
|
@@ -11,7 +11,6 @@ var useAppForm = require('../js/useAppForm.js');
|
|
|
11
11
|
var useLocale = require('../../../hooks/useLocale.js');
|
|
12
12
|
var form = require('../../../utils/form.js');
|
|
13
13
|
var is = require('../../../utils/is.js');
|
|
14
|
-
var handler = require('../../../utils/handler.js');
|
|
15
14
|
var index$1 = require('../../hyTooltip/index.js');
|
|
16
15
|
|
|
17
16
|
const _sfc_main = {
|
|
@@ -109,11 +108,11 @@ const _sfc_main = {
|
|
|
109
108
|
/* TEXT */
|
|
110
109
|
)
|
|
111
110
|
]),
|
|
112
|
-
vue.unref(
|
|
111
|
+
vue.unref(index.columnHelpHandler)(props, __props.column) ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.HyTooltip), {
|
|
113
112
|
key: 0,
|
|
114
113
|
"is-always": "",
|
|
115
114
|
overLine: 1,
|
|
116
|
-
content: vue.unref(
|
|
115
|
+
content: vue.unref(index.columnHelpHandler)(props, __props.column)
|
|
117
116
|
}, {
|
|
118
117
|
default: vue.withCtx(() => [
|
|
119
118
|
vue.createVNode(vue.unref(elementPlus.ElIcon), {
|
|
@@ -256,6 +255,7 @@ const _sfc_main = {
|
|
|
256
255
|
"parent-prop": __props.column.field,
|
|
257
256
|
index: index$1,
|
|
258
257
|
loading: __props.loading,
|
|
258
|
+
size: __props.size,
|
|
259
259
|
disabled: __props.disabled,
|
|
260
260
|
readonly: __props.readonly,
|
|
261
261
|
level: 3
|
|
@@ -271,7 +271,7 @@ const _sfc_main = {
|
|
|
271
271
|
])
|
|
272
272
|
};
|
|
273
273
|
})
|
|
274
|
-
]), 1032, ["model", "column", "rules", "parent-prop", "index", "loading", "disabled", "readonly"]);
|
|
274
|
+
]), 1032, ["model", "column", "rules", "parent-prop", "index", "loading", "size", "disabled", "readonly"]);
|
|
275
275
|
}),
|
|
276
276
|
128
|
|
277
277
|
/* KEYED_FRAGMENT */
|
|
@@ -39,6 +39,10 @@ const _sfc_main = {
|
|
|
39
39
|
readonly: {
|
|
40
40
|
type: Boolean,
|
|
41
41
|
default: false
|
|
42
|
+
},
|
|
43
|
+
size: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "default"
|
|
42
46
|
}
|
|
43
47
|
},
|
|
44
48
|
setup(__props) {
|
|
@@ -118,6 +122,7 @@ const _sfc_main = {
|
|
|
118
122
|
model: __props.model,
|
|
119
123
|
column: item,
|
|
120
124
|
rules: __props.rules,
|
|
125
|
+
size: __props.size,
|
|
121
126
|
loading: __props.loading,
|
|
122
127
|
disabled: __props.disabled,
|
|
123
128
|
readonly: __props.readonly
|
|
@@ -133,7 +138,7 @@ const _sfc_main = {
|
|
|
133
138
|
])
|
|
134
139
|
};
|
|
135
140
|
})
|
|
136
|
-
]), 1032, ["model", "column", "rules", "loading", "disabled", "readonly"]);
|
|
141
|
+
]), 1032, ["model", "column", "rules", "size", "loading", "disabled", "readonly"]);
|
|
137
142
|
}),
|
|
138
143
|
128
|
|
139
144
|
/* KEYED_FRAGMENT */
|
|
@@ -8,7 +8,6 @@ var iconsVue = require('@element-plus/icons-vue');
|
|
|
8
8
|
var index = require('../js/index.js');
|
|
9
9
|
var is = require('../../../utils/is.js');
|
|
10
10
|
var form = require('../../../utils/form.js');
|
|
11
|
-
var handler = require('../../../utils/handler.js');
|
|
12
11
|
var index$1 = require('../../hyTooltip/index.js');
|
|
13
12
|
var index$2 = require('../../hyInput/index.js');
|
|
14
13
|
var index$3 = require('../../hyDatePicker/index.js');
|
|
@@ -51,10 +50,15 @@ const _sfc_main = {
|
|
|
51
50
|
level: {
|
|
52
51
|
type: Number,
|
|
53
52
|
default: 2
|
|
53
|
+
},
|
|
54
|
+
size: {
|
|
55
|
+
type: String,
|
|
56
|
+
default: "default"
|
|
54
57
|
}
|
|
55
58
|
},
|
|
56
59
|
setup(__props) {
|
|
57
60
|
const props = __props;
|
|
61
|
+
const formItemRef = vue.useTemplateRef("formItemRef");
|
|
58
62
|
const columnProp = vue.computed(() => {
|
|
59
63
|
let field = is.isArray(props.column.field) ? props.column.field[0] : props.column.field;
|
|
60
64
|
if (props.parentProp) {
|
|
@@ -82,7 +86,13 @@ const _sfc_main = {
|
|
|
82
86
|
form.setValueByProp(props.model, prop, val);
|
|
83
87
|
}
|
|
84
88
|
});
|
|
85
|
-
function
|
|
89
|
+
function getColumnRuleHandler(column, model) {
|
|
90
|
+
if (!index.isRequired(props, column) && formItemRef.value) {
|
|
91
|
+
formItemRef.value.clearValidate();
|
|
92
|
+
}
|
|
93
|
+
return form.columnRuleHandler(column, model);
|
|
94
|
+
}
|
|
95
|
+
function onChangeHandler() {
|
|
86
96
|
const { onChange } = props.column;
|
|
87
97
|
if (!onChange) return;
|
|
88
98
|
onChange(props.column, props.model);
|
|
@@ -90,8 +100,10 @@ const _sfc_main = {
|
|
|
90
100
|
return (_ctx, _cache) => {
|
|
91
101
|
return vue.unref(index.columnShowHandler)(props, __props.column) ? (vue.openBlock(), vue.createBlock(vue.unref(elementPlus.ElFormItem), {
|
|
92
102
|
key: 0,
|
|
93
|
-
|
|
103
|
+
ref_key: "formItemRef",
|
|
104
|
+
ref: formItemRef,
|
|
94
105
|
prop: columnProp.value,
|
|
106
|
+
rules: getColumnRuleHandler(__props.column, props.model),
|
|
95
107
|
style: vue.normalizeStyle(vue.unref(index.columnItemStyle)(props, __props.column))
|
|
96
108
|
}, {
|
|
97
109
|
default: vue.withCtx(() => [
|
|
@@ -115,11 +127,11 @@ const _sfc_main = {
|
|
|
115
127
|
key: 0,
|
|
116
128
|
class: "label-required"
|
|
117
129
|
})) : vue.createCommentVNode("v-if", true),
|
|
118
|
-
vue.unref(
|
|
130
|
+
vue.unref(index.columnHelpHandler)(props, __props.column) ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.HyTooltip), {
|
|
119
131
|
key: 1,
|
|
120
132
|
"is-always": "",
|
|
121
133
|
overLine: 1,
|
|
122
|
-
content: vue.unref(
|
|
134
|
+
content: vue.unref(index.columnHelpHandler)(props, __props.column)
|
|
123
135
|
}, {
|
|
124
136
|
default: vue.withCtx(() => [
|
|
125
137
|
vue.createVNode(vue.unref(elementPlus.ElIcon), {
|
|
@@ -150,14 +162,14 @@ const _sfc_main = {
|
|
|
150
162
|
])) : vue.createCommentVNode("v-if", true)
|
|
151
163
|
]),
|
|
152
164
|
vue.createCommentVNode(" \u5185\u5BB9\u4EC5\u67E5\u770B "),
|
|
153
|
-
|
|
165
|
+
vue.unref(index.isReadonly)(props, __props.column) || !__props.column.type && !__props.column.slot ? (vue.openBlock(), vue.createElementBlock(
|
|
154
166
|
"div",
|
|
155
167
|
{
|
|
156
168
|
key: 0,
|
|
157
169
|
class: vue.normalizeClass(["w-full flex items-center text-main px-2", {
|
|
158
|
-
"min-h-[40px]":
|
|
159
|
-
"min-h-[32px]":
|
|
160
|
-
"min-h-[24px]":
|
|
170
|
+
"min-h-[40px]": __props.size === "large",
|
|
171
|
+
"min-h-[32px]": __props.size === "default",
|
|
172
|
+
"min-h-[24px]": __props.size === "small",
|
|
161
173
|
"bg-background": __props.level === 1,
|
|
162
174
|
"bg-background-2": __props.level === 2,
|
|
163
175
|
"bg-background-3": __props.level === 3,
|
|
@@ -324,7 +336,10 @@ const _sfc_main = {
|
|
|
324
336
|
vue.createCommentVNode(" \u5F00\u5173 "),
|
|
325
337
|
vue.createVNode(vue.unref(elementPlus.ElSwitch), vue.mergeProps({
|
|
326
338
|
modelValue: bindValue.value,
|
|
327
|
-
"onUpdate:modelValue": ($event) => bindValue.value = $event
|
|
339
|
+
"onUpdate:modelValue": ($event) => bindValue.value = $event,
|
|
340
|
+
"inline-prompt": "",
|
|
341
|
+
width: "80",
|
|
342
|
+
style: { "--hy-el-switch-on-color": "#5ab95f", "--hy-el-switch-off-color": "rgba(var(--hy-background), 1)" }
|
|
328
343
|
}, __props.column.attrs, {
|
|
329
344
|
disabled: vue.unref(index.isDisabled)(props, __props.column),
|
|
330
345
|
onChange: onChangeHandler
|
|
@@ -371,7 +386,7 @@ const _sfc_main = {
|
|
|
371
386
|
]),
|
|
372
387
|
_: 3
|
|
373
388
|
/* FORWARDED */
|
|
374
|
-
}, 8, ["
|
|
389
|
+
}, 8, ["prop", "rules", "style"])) : vue.createCommentVNode("v-if", true);
|
|
375
390
|
};
|
|
376
391
|
}
|
|
377
392
|
};
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var vue = require('vue');
|
|
4
4
|
var handler = require('../../../utils/handler.js');
|
|
5
5
|
var is = require('../../../utils/is.js');
|
|
6
|
+
var form = require('../../../utils/form.js');
|
|
6
7
|
var useLocale = require('../../../hooks/useLocale.js');
|
|
7
8
|
|
|
8
9
|
function columnItemStyle(props, column) {
|
|
@@ -28,15 +29,29 @@ function columnShowHandler(props, column) {
|
|
|
28
29
|
if (is.isFunction(show)) return show(column, props.model);
|
|
29
30
|
return true;
|
|
30
31
|
}
|
|
32
|
+
function columnHelpHandler(props, column) {
|
|
33
|
+
const help = vue.unref(column.help);
|
|
34
|
+
if (is.isString(help)) return help;
|
|
35
|
+
if (is.isFunction(help)) return help(column, props.model);
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
function isReadonly(props, column) {
|
|
39
|
+
if (props.readonly) return props.readonly;
|
|
40
|
+
const readonly = vue.unref(column.readonly);
|
|
41
|
+
if (is.isBoolean(readonly)) return readonly;
|
|
42
|
+
if (is.isFunction(readonly)) return readonly(column, props.model);
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
31
45
|
function isRequired(props, column) {
|
|
32
|
-
let {
|
|
33
|
-
|
|
46
|
+
let { field } = column;
|
|
47
|
+
let rules = form.columnRuleHandler(column, props.model);
|
|
48
|
+
if (isReadonly(props, column)) {
|
|
34
49
|
return false;
|
|
35
50
|
}
|
|
36
51
|
if (Array.isArray(field)) {
|
|
37
52
|
return field.find((key) => isRequired(props, { ...column, field: key }));
|
|
38
53
|
}
|
|
39
|
-
rules = is.isArray(rules) && rules?.length
|
|
54
|
+
rules = is.isArray(rules) && rules?.length ? rules : props.rules?.[field];
|
|
40
55
|
if (is.isArray(rules)) {
|
|
41
56
|
return rules.some((item) => item.required);
|
|
42
57
|
}
|
|
@@ -55,39 +70,28 @@ function isDisabled(props, column) {
|
|
|
55
70
|
function renderText(props, column = {}) {
|
|
56
71
|
const { type, field, customRender } = column;
|
|
57
72
|
const { props: fieldNames } = column.attrs || {};
|
|
73
|
+
const columnValue = form.getValueByProp(props.model, field);
|
|
58
74
|
if (customRender && typeof customRender === "function") {
|
|
59
75
|
return customRender({
|
|
60
76
|
column,
|
|
61
77
|
model: props.model,
|
|
62
|
-
value:
|
|
78
|
+
value: columnValue
|
|
63
79
|
});
|
|
64
80
|
}
|
|
65
|
-
if (type === "range-picker") {
|
|
66
|
-
const [start, end] = field;
|
|
67
|
-
return props.model?.[start] ? `${props.model?.[start]} ~ ${props.model?.[end]}` : "";
|
|
68
|
-
}
|
|
69
|
-
if (type === "location") {
|
|
70
|
-
const [lon, lat] = field;
|
|
71
|
-
return [props.model[lon], props.model[lat]].filter(Boolean).join("\uFF0C");
|
|
72
|
-
}
|
|
73
81
|
if (/^(select|radio|checkbox)$/.test(type)) {
|
|
74
82
|
const optionList = optionsHandler(props, column);
|
|
75
83
|
const target = optionList.find(
|
|
76
|
-
(item) => item[fieldNames.value] ===
|
|
84
|
+
(item) => item[fieldNames.value] === columnValue
|
|
77
85
|
);
|
|
78
|
-
return target?.[fieldNames.label] ||
|
|
79
|
-
}
|
|
80
|
-
if (/^dept-select(-all)?$/.test(type)) {
|
|
81
|
-
const dict = /^dept-select$/.test(type) ? deptTreeDict.value : deptTreeAllDict.value;
|
|
82
|
-
return dict[props.model?.[field]] || props.model?.[field] || "";
|
|
83
|
-
}
|
|
84
|
-
if (type === "area-select") {
|
|
85
|
-
return areaTreeDict.value[props.model?.[field]] || props.model?.[field] || "";
|
|
86
|
+
return target?.[fieldNames.label] || columnValue || "";
|
|
86
87
|
}
|
|
87
88
|
if (Array.isArray(field)) {
|
|
88
|
-
return field.map((key) => props.model
|
|
89
|
+
return field.map((key) => form.getValueByProp(props.model, key) || "").filter(Boolean).join(" - ");
|
|
90
|
+
}
|
|
91
|
+
if (type === "switch") {
|
|
92
|
+
return columnValue === column.attrs.activeValue ? column.attrs.activeText : column.attrs.inactiveText;
|
|
89
93
|
}
|
|
90
|
-
return
|
|
94
|
+
return columnValue || "";
|
|
91
95
|
}
|
|
92
96
|
function renderArrayItemLabel(props, column, index) {
|
|
93
97
|
const { t } = useLocale.useLocale();
|
|
@@ -108,9 +112,11 @@ function optionsHandler(props, column) {
|
|
|
108
112
|
return [];
|
|
109
113
|
}
|
|
110
114
|
|
|
115
|
+
exports.columnHelpHandler = columnHelpHandler;
|
|
111
116
|
exports.columnItemStyle = columnItemStyle;
|
|
112
117
|
exports.columnShowHandler = columnShowHandler;
|
|
113
118
|
exports.isDisabled = isDisabled;
|
|
119
|
+
exports.isReadonly = isReadonly;
|
|
114
120
|
exports.isRequired = isRequired;
|
|
115
121
|
exports.optionsHandler = optionsHandler;
|
|
116
122
|
exports.renderAddLabel = renderAddLabel;
|
|
@@ -34,34 +34,6 @@ const genPlaceholderHandler = (config) => {
|
|
|
34
34
|
}
|
|
35
35
|
return { placeholder, startPlaceholder, endPlaceholder };
|
|
36
36
|
};
|
|
37
|
-
const genRuleRequiredMsgHandler = (config) => {
|
|
38
|
-
const { t } = useLocale.useLocale();
|
|
39
|
-
const { type, prop, label } = config || {};
|
|
40
|
-
if (!prop || !prop?.length) return "";
|
|
41
|
-
switch (type) {
|
|
42
|
-
case "input":
|
|
43
|
-
case "input-number":
|
|
44
|
-
return t("hy.pleaseEnterPlaceholder", [label]);
|
|
45
|
-
case "select":
|
|
46
|
-
case "radio":
|
|
47
|
-
case "checkbox":
|
|
48
|
-
case "date-picker":
|
|
49
|
-
return t("hy.pleaseSelectPlaceholder", [label]);
|
|
50
|
-
default:
|
|
51
|
-
return t("hy.cannotBeEmpty", [label]);
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
const rulesHandler = (config) => {
|
|
55
|
-
let { rules, required } = config || {};
|
|
56
|
-
rules = is.isArray(rules) ? [...rules] : is.isObject(rules) ? [rules] : [];
|
|
57
|
-
if (!rules.some((item) => item.required) && required) {
|
|
58
|
-
rules.unshift({
|
|
59
|
-
required: true,
|
|
60
|
-
message: genRuleRequiredMsgHandler(config)
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
return rules;
|
|
64
|
-
};
|
|
65
37
|
function appFormItemHandler(column = {}) {
|
|
66
38
|
const label = genDefaultLabel(column);
|
|
67
39
|
const { placeholder} = genPlaceholderHandler({ ...column, label });
|
|
@@ -73,7 +45,7 @@ function appFormItemHandler(column = {}) {
|
|
|
73
45
|
field: column.prop,
|
|
74
46
|
label,
|
|
75
47
|
readonly: column.readonly || false,
|
|
76
|
-
rules:
|
|
48
|
+
rules: column.rules,
|
|
77
49
|
attrs
|
|
78
50
|
}
|
|
79
51
|
);
|
|
@@ -111,6 +83,17 @@ function appFormItemHandler(column = {}) {
|
|
|
111
83
|
...column,
|
|
112
84
|
children: (column.children || []).map((item) => appFormItemHandler(item))
|
|
113
85
|
};
|
|
86
|
+
} else if (/^switch$/.test(column.type)) {
|
|
87
|
+
column = {
|
|
88
|
+
...column,
|
|
89
|
+
attrs: {
|
|
90
|
+
activeText: "\u5F00\u542F",
|
|
91
|
+
inactiveText: "\u5173\u95ED",
|
|
92
|
+
activeValue: true,
|
|
93
|
+
inactiveValue: false,
|
|
94
|
+
...attrs
|
|
95
|
+
}
|
|
96
|
+
};
|
|
114
97
|
}
|
|
115
98
|
return column;
|
|
116
99
|
}
|
|
@@ -124,6 +107,8 @@ const resetAppFormValue = (columns = [], obj = {}) => {
|
|
|
124
107
|
const childValue = resetAppFormValue(item.children);
|
|
125
108
|
obj[item.prop] = [childValue];
|
|
126
109
|
}
|
|
110
|
+
} else if (item.type === "extra") {
|
|
111
|
+
resetAppFormValue(item.children, obj);
|
|
127
112
|
} else if (Array.isArray(item.prop)) {
|
|
128
113
|
for (let i = 0; i < item.prop.length; i++) {
|
|
129
114
|
form.genValueByProp(
|
|
@@ -58,7 +58,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
58
58
|
return (_ctx, _cache) => {
|
|
59
59
|
return vue.openBlock(), vue.createElementBlock("div", { class: "hy-icon-box" }, [
|
|
60
60
|
vue.createVNode(vue.unref(elementPlus.ElTooltip), {
|
|
61
|
-
"
|
|
61
|
+
"show-after": 500,
|
|
62
62
|
class: "item",
|
|
63
63
|
effect: "dark",
|
|
64
64
|
placement: "top",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
.hy-icon-box {
|
|
2
2
|
display: inline-block;
|
|
3
|
+
color: rgb(var(--hy-main));
|
|
3
4
|
border-radius: 4px;
|
|
4
5
|
& + & {
|
|
5
6
|
margin-left: 12px;
|
|
@@ -11,7 +12,6 @@
|
|
|
11
12
|
justify-content: center;
|
|
12
13
|
padding: 5px;
|
|
13
14
|
user-select: none;
|
|
14
|
-
color: rgb(var(--hy-main));
|
|
15
15
|
border-radius: 100%;
|
|
16
16
|
background:
|
|
17
17
|
radial-gradient(
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var map = require('./map.vue.js');
|
|
6
|
+
var handler = require('../../utils/handler.js');
|
|
7
|
+
|
|
8
|
+
const HyMap = handler.withInstall(map.default);
|
|
9
|
+
|
|
10
|
+
exports.HyMap = HyMap;
|
|
11
|
+
exports.default = HyMap;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var index = require('../../../utils/map/index.js');
|
|
4
|
+
var vue = require('vue');
|
|
5
|
+
|
|
6
|
+
const useAppMapWrapper = (hy) => {
|
|
7
|
+
const {
|
|
8
|
+
props: { mapConfig },
|
|
9
|
+
mapRef,
|
|
10
|
+
emits
|
|
11
|
+
} = hy;
|
|
12
|
+
const hyMap = null;
|
|
13
|
+
const map = null;
|
|
14
|
+
function newMap(mapType) {
|
|
15
|
+
hy.hyMap = new index.default({
|
|
16
|
+
...mapConfig,
|
|
17
|
+
mapType,
|
|
18
|
+
BM: window.BM
|
|
19
|
+
// defaultMapStyle: 'amap://styles/b5d280643c6525a8f6b2a07521f639ef', // 地图样式
|
|
20
|
+
// bmHttpsUrl: 'http://www.bigemap.com:9000' /* 内网部署的地址 */,
|
|
21
|
+
// bmUiName:
|
|
22
|
+
// 'bigemap.amap-map' /* bmUiName 内网部署的地址里面的离线地图名称 */,
|
|
23
|
+
// crs: null,
|
|
24
|
+
// layersUrlList: [
|
|
25
|
+
// {
|
|
26
|
+
// layersUrls:
|
|
27
|
+
// 'http://t7.tianditu.gov.cn/vec_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&tk={mapKey},http://t7.tianditu.gov.cn/cva_w/wmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=w&FORMAT=tiles&TILECOL={x}&TILEROW={y}&TILEMATRIX={z}&tk={mapKey}',
|
|
28
|
+
// filter: mapFilters[0].filter,
|
|
29
|
+
// key: 'db848f59ddd50debfb774811bbdfb327',
|
|
30
|
+
// },
|
|
31
|
+
// ], // 地图瓦片地址
|
|
32
|
+
});
|
|
33
|
+
setTimeout(() => {
|
|
34
|
+
hy.initMap();
|
|
35
|
+
}, 800);
|
|
36
|
+
}
|
|
37
|
+
function initMap() {
|
|
38
|
+
hy.map = hy.hyMap.InitMap(mapRef.value, {
|
|
39
|
+
minZoom: mapConfig.minZoom || 8,
|
|
40
|
+
maxZoom: mapConfig.maxZoom || 18,
|
|
41
|
+
center: mapConfig.center || {
|
|
42
|
+
lat: 22.553681,
|
|
43
|
+
lng: 113.931936
|
|
44
|
+
},
|
|
45
|
+
zoom: mapConfig.zoom || 14,
|
|
46
|
+
completeCallbacks: () => {
|
|
47
|
+
vue.nextTick(() => {
|
|
48
|
+
emits("complete", hy.hyMap, hy.map);
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
hyMap,
|
|
55
|
+
map,
|
|
56
|
+
newMap,
|
|
57
|
+
initMap
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
exports.useAppMapWrapper = useAppMapWrapper;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
var index = require('./js/index.js');
|
|
7
|
+
var useMixins = require('../../hooks/useMixins.js');
|
|
8
|
+
|
|
9
|
+
import "@hy-dispatch-ui-v3/static/map/bigemap.css";
|
|
10
|
+
|
|
11
|
+
import "@hy-dispatch-ui-v3/static/map/MarkerCluster.css";
|
|
12
|
+
|
|
13
|
+
import "@hy-dispatch-ui-v3/static/map/bmDraw.css";
|
|
14
|
+
|
|
15
|
+
const _sfc_main = {
|
|
16
|
+
__name: "map",
|
|
17
|
+
props: {
|
|
18
|
+
// 地图配置
|
|
19
|
+
mapConfig: {
|
|
20
|
+
type: Object,
|
|
21
|
+
default: () => ({})
|
|
22
|
+
},
|
|
23
|
+
// 地图类型 gaode leaflet bugMap
|
|
24
|
+
mapType: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: "gaode"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
emits: ["complete"],
|
|
30
|
+
setup(__props, { emit: __emit }) {
|
|
31
|
+
const props = __props;
|
|
32
|
+
const emits = __emit;
|
|
33
|
+
const mapRef = vue.ref();
|
|
34
|
+
const { newMap } = useMixins.useMixins(
|
|
35
|
+
{
|
|
36
|
+
props,
|
|
37
|
+
emits,
|
|
38
|
+
mapRef
|
|
39
|
+
},
|
|
40
|
+
[index.useAppMapWrapper]
|
|
41
|
+
);
|
|
42
|
+
vue.onMounted(() => {
|
|
43
|
+
newMap(props.mapType);
|
|
44
|
+
});
|
|
45
|
+
return (_ctx, _cache) => {
|
|
46
|
+
return vue.openBlock(), vue.createElementBlock("div", { class: "w-full h-full p-5 box-border border-border border relative" }, [
|
|
47
|
+
vue.createElementVNode(
|
|
48
|
+
"div",
|
|
49
|
+
{
|
|
50
|
+
ref_key: "mapRef",
|
|
51
|
+
ref: mapRef,
|
|
52
|
+
class: "w-full h-full rounded overflow-hidden"
|
|
53
|
+
},
|
|
54
|
+
null,
|
|
55
|
+
512
|
|
56
|
+
/* NEED_PATCH */
|
|
57
|
+
)
|
|
58
|
+
]);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
exports.default = _sfc_main;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var axios = require('axios');
|
|
4
|
+
var vue = require('vue');
|
|
5
|
+
var useApi = require('../../../hooks/useApi.js');
|
|
6
|
+
|
|
7
|
+
let throttleFn = null;
|
|
8
|
+
let cancelSource = null;
|
|
9
|
+
function getOrgTreeSimple() {
|
|
10
|
+
const { api } = useApi.useApi();
|
|
11
|
+
if (!throttleFn) {
|
|
12
|
+
if (cancelSource) {
|
|
13
|
+
cancelSource.cancel("\u4E2D\u65AD\u8BF7\u6C42");
|
|
14
|
+
}
|
|
15
|
+
cancelSource = axios.CancelToken.source();
|
|
16
|
+
throttleFn = new Promise((resolve, reject) => {
|
|
17
|
+
vue.unref(api).post(
|
|
18
|
+
"organization/orgTreeSimple",
|
|
19
|
+
{},
|
|
20
|
+
{ cancelToken: cancelSource.token }
|
|
21
|
+
).then((res) => {
|
|
22
|
+
resolve(res.data);
|
|
23
|
+
throttleFn = null;
|
|
24
|
+
}).catch((err) => {
|
|
25
|
+
reject(err);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
return throttleFn;
|
|
29
|
+
} else {
|
|
30
|
+
return throttleFn;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
function orgTreeDatahandler(data) {
|
|
34
|
+
const cascaderMap = /* @__PURE__ */ new Map();
|
|
35
|
+
const handler = (list = [], parentIdsList = []) => {
|
|
36
|
+
(list || []).forEach((item) => {
|
|
37
|
+
item.label = item.companyName;
|
|
38
|
+
item.value = item.id;
|
|
39
|
+
item.parentIdsList = [...parentIdsList, item.id];
|
|
40
|
+
cascaderMap.set(item.value, item);
|
|
41
|
+
if (item.children && item.children.length > 0) {
|
|
42
|
+
handler(item.children, item.parentIdsList);
|
|
43
|
+
} else {
|
|
44
|
+
delete item.children;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
handler(data);
|
|
49
|
+
return {
|
|
50
|
+
cascaderData: data,
|
|
51
|
+
cascaderDataMap: cascaderMap
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
exports.getOrgTreeSimple = getOrgTreeSimple;
|
|
56
|
+
exports.orgTreeDatahandler = orgTreeDatahandler;
|
|
@@ -4,8 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
6
|
var elementPlus = require('element-plus');
|
|
7
|
-
var
|
|
7
|
+
var index = require('./js/index.js');
|
|
8
8
|
var useLocale = require('../../hooks/useLocale.js');
|
|
9
|
+
var useSubscribe = require('../../hooks/useSubscribe.js');
|
|
9
10
|
|
|
10
11
|
import "./style/orgCascader.scss";
|
|
11
12
|
|
|
@@ -85,9 +86,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
85
86
|
setup(__props, { emit: __emit }) {
|
|
86
87
|
const props = __props;
|
|
87
88
|
const emits = __emit;
|
|
88
|
-
const {
|
|
89
|
+
const { subOrgCascader, unsubOrgCascader } = useSubscribe.useSubscribe();
|
|
89
90
|
const modelValue = vue.useModel(__props, "modelValue");
|
|
90
91
|
const cascaderRef = vue.useTemplateRef("cascaderRef");
|
|
92
|
+
const loading = vue.ref(true);
|
|
91
93
|
const focusType = vue.ref(false);
|
|
92
94
|
const cascaderValue = vue.ref(null);
|
|
93
95
|
const cascaderOptions = vue.ref([]);
|
|
@@ -96,29 +98,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
96
98
|
const target = cascaderValueMap.value.get(modelValue.value);
|
|
97
99
|
return target?.companyName;
|
|
98
100
|
});
|
|
99
|
-
function getCascaderData() {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
async function getCascaderData() {
|
|
102
|
+
loading.value = true;
|
|
103
|
+
const data = await index.getOrgTreeSimple();
|
|
104
|
+
handlerData(data || []);
|
|
105
|
+
loading.value = false;
|
|
103
106
|
}
|
|
104
107
|
function handlerData(data) {
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
item.label = item.companyName;
|
|
109
|
-
item.value = item.id;
|
|
110
|
-
item.parentIdsList = [...parentIdsList, item.id];
|
|
111
|
-
cascaderMap.set(item.value, item);
|
|
112
|
-
if (item.children && item.children.length > 0) {
|
|
113
|
-
handler(item.children, item.parentIdsList);
|
|
114
|
-
} else {
|
|
115
|
-
delete item.children;
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
};
|
|
119
|
-
handler(data);
|
|
120
|
-
cascaderOptions.value = data;
|
|
121
|
-
cascaderValueMap.value = cascaderMap;
|
|
108
|
+
const { cascaderData, cascaderDataMap } = index.orgTreeDatahandler(data);
|
|
109
|
+
cascaderOptions.value = cascaderData;
|
|
110
|
+
cascaderValueMap.value = cascaderDataMap;
|
|
122
111
|
if (modelValue.value) {
|
|
123
112
|
setDefaultValue(modelValue.value);
|
|
124
113
|
}
|
|
@@ -146,6 +135,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
146
135
|
}
|
|
147
136
|
if (props.defaultGetData) {
|
|
148
137
|
getCascaderData();
|
|
138
|
+
subOrgCascader(getCascaderData);
|
|
149
139
|
}
|
|
150
140
|
vue.watch(
|
|
151
141
|
() => props.options,
|
|
@@ -163,6 +153,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
163
153
|
},
|
|
164
154
|
{ immediate: true, deep: true }
|
|
165
155
|
);
|
|
156
|
+
vue.onUnmounted(() => {
|
|
157
|
+
unsubOrgCascader(getCascaderData);
|
|
158
|
+
});
|
|
166
159
|
return (_ctx, _cache) => {
|
|
167
160
|
return vue.openBlock(), vue.createElementBlock("div", { class: "relative" }, [
|
|
168
161
|
__props.contentType ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
@@ -235,7 +228,11 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
235
228
|
"show-all-levels": false,
|
|
236
229
|
"virtual-scroll": "",
|
|
237
230
|
onChange: onChangeHanlder
|
|
238
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "size", "options", "clearable", "disabled", "placeholder"]))
|
|
231
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "class", "size", "options", "clearable", "disabled", "placeholder"])),
|
|
232
|
+
loading.value ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
233
|
+
key: 2,
|
|
234
|
+
class: "absolute left-0 right-0 top-0 bottom-0 cursor-wait"
|
|
235
|
+
})) : vue.createCommentVNode("v-if", true)
|
|
239
236
|
]);
|
|
240
237
|
};
|
|
241
238
|
}
|