hy-dispatch-ui-v3 0.2.66 → 0.2.67
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 +25 -1
- package/es/components/hyBatchUploadDialog/batchUploadDialog.vue.mjs +174 -142
- package/es/components/hyButton/button.vue.mjs +16 -3
- package/es/components/hyButton/style/button.scss +2 -0
- package/es/components/hyForm/cpns/formItem.vue.mjs +96 -46
- package/es/components/hyForm/form.vue.mjs +22 -8
- package/es/components/hyForm/js/useAppForm.mjs +1 -1
- package/es/components/hyMap/js/index.mjs +6 -6
- package/es/components/hyMap/map.vue.mjs +14 -4
- package/es/components/hyOrgCascader/orgCascader.vue.mjs +7 -2
- package/es/components/hySearch/cpns/searchItem.vue.mjs +396 -324
- package/es/components/hySearch/search.vue.mjs +17 -7
- package/es/components/hySearch/style/search.scss +7 -0
- package/es/components/hyTable/cpns/virtualTable.vue.mjs +25 -6
- package/es/components/hyTable/js/index.mjs +11 -5
- package/es/components/hyTable/js/search.mjs +25 -1
- package/es/components/hyTable/table.vue.mjs +34 -13
- package/es/components/hyTableActionButton/tableActionButton.vue.mjs +9 -2
- package/es/components/hyTableForm/batchTableForm.vue.mjs +23 -2
- package/es/components/hyTableForm/js/useAppTableForm.mjs +1 -1
- package/es/components/hyTableForm/tableForm.vue.mjs +79 -33
- package/es/components/hyTree/js/index.mjs +118 -50
- package/es/components/hyTree/tree.vue.mjs +4 -2
- package/es/style/index.scss +0 -1
- package/es/style/tailwind.scss +0 -1
- package/es/utils/is.mjs +3 -1
- package/es/utils/map/hook/bigMap.mjs +2 -0
- package/es/utils/map/hook/gaode.mjs +51 -16
- package/es/utils/map/hook/leafletjs.mjs +15 -3
- package/es/utils/map/index.mjs +1 -1
- package/es/version.mjs +1 -1
- package/lib/components/hyBatchUploadDialog/batchUploadDialog.vue.js +173 -141
- package/lib/components/hyButton/button.vue.js +15 -2
- package/lib/components/hyButton/style/button.scss +2 -0
- package/lib/components/hyForm/cpns/formItem.vue.js +93 -43
- package/lib/components/hyForm/form.vue.js +21 -7
- package/lib/components/hyForm/js/useAppForm.js +1 -1
- package/lib/components/hyMap/js/index.js +5 -5
- package/lib/components/hyMap/map.vue.js +13 -3
- package/lib/components/hyOrgCascader/orgCascader.vue.js +7 -2
- package/lib/components/hySearch/cpns/searchItem.vue.js +394 -322
- package/lib/components/hySearch/search.vue.js +17 -7
- package/lib/components/hySearch/style/search.scss +7 -0
- package/lib/components/hyTable/cpns/virtualTable.vue.js +24 -5
- package/lib/components/hyTable/js/index.js +11 -4
- package/lib/components/hyTable/js/search.js +25 -1
- package/lib/components/hyTable/table.vue.js +33 -12
- package/lib/components/hyTableActionButton/tableActionButton.vue.js +9 -2
- package/lib/components/hyTableForm/batchTableForm.vue.js +23 -2
- package/lib/components/hyTableForm/js/useAppTableForm.js +1 -1
- package/lib/components/hyTableForm/tableForm.vue.js +78 -32
- package/lib/components/hyTree/js/index.js +118 -50
- package/lib/components/hyTree/tree.vue.js +4 -2
- package/lib/style/index.scss +0 -1
- package/lib/style/tailwind.scss +0 -1
- package/lib/utils/is.js +5 -3
- package/lib/utils/map/hook/bigMap.js +2 -0
- package/lib/utils/map/hook/gaode.js +51 -16
- package/lib/utils/map/hook/leafletjs.js +15 -3
- package/lib/utils/map/index.js +1 -1
- package/lib/version.js +1 -1
- package/package.json +2 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { inject, useTemplateRef, computed,
|
|
1
|
+
import { inject, useTemplateRef, computed, reactive, toRefs, onMounted, watch, onBeforeUnmount, unref, openBlock, createElementBlock, normalizeClass, normalizeStyle, createBlock, createSlots, withCtx, createElementVNode, renderSlot, toDisplayString, createCommentVNode, createVNode, Fragment, mergeProps } from 'vue';
|
|
2
2
|
import { ElFormItem, ElSelect, ElIcon, ElSelectV2, ElRadioGroup, ElCheckboxGroup, ElSwitch, ElInputNumber, ElCascader } from 'element-plus';
|
|
3
3
|
import { Loading } from '@element-plus/icons-vue';
|
|
4
4
|
import '../../../utils/index.mjs';
|
|
5
5
|
import '../../index.mjs';
|
|
6
|
-
import { formContextKey,
|
|
6
|
+
import { formContextKey, optionsHandler, isRequired, columnVisibleHandler, columnItemStyle, columnShowHandler, columnHelpHandler, isReadonly, renderText, isDisabled } from '../js/index.mjs';
|
|
7
7
|
import '../../../hooks/index.mjs';
|
|
8
8
|
import { useLocale } from '../../../hooks/useLocale.mjs';
|
|
9
|
-
import { isArray } from '../../../utils/is.mjs';
|
|
9
|
+
import { isBoolean, isArray } from '../../../utils/is.mjs';
|
|
10
10
|
import { setValueByProp, getValueByProp, columnPlaceholderHandler, columnLabelHandler, columnRuleHandler } from '../../../utils/form.mjs';
|
|
11
11
|
import { HyTooltip } from '../../hyTooltip/index.mjs';
|
|
12
12
|
import { HyIcon } from '../../hyIcon/index.mjs';
|
|
@@ -64,6 +64,15 @@ const _sfc_main = {
|
|
|
64
64
|
const formContext = inject(formContextKey);
|
|
65
65
|
const formItemRef = useTemplateRef("formItemRef");
|
|
66
66
|
const orgCascaderRef = useTemplateRef("orgCascaderRef");
|
|
67
|
+
const showMessage = computed(() => {
|
|
68
|
+
if (columnConfig.value.optionsError) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
if (isBoolean(columnConfig.value.showMessage)) {
|
|
72
|
+
return columnConfig.value.showMessage;
|
|
73
|
+
}
|
|
74
|
+
return formContext.showMessage;
|
|
75
|
+
});
|
|
67
76
|
const columnProp = computed(() => {
|
|
68
77
|
let field = isArray(props.column.field) ? props.column.field[0] : props.column.field;
|
|
69
78
|
if (props.parentProp) {
|
|
@@ -108,36 +117,54 @@ const _sfc_main = {
|
|
|
108
117
|
placeholder: columnPlaceholderHandler(props.column, props.model)
|
|
109
118
|
};
|
|
110
119
|
});
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
120
|
+
async function obtainOptions(isMountedLoad = false) {
|
|
121
|
+
return new Promise(async (resolve, reject) => {
|
|
122
|
+
if (props.column.optionsFn) {
|
|
123
|
+
if (!props.column.optionsFn) return;
|
|
124
|
+
props.column.optionsLoading = true;
|
|
125
|
+
props.column.optionsError = "";
|
|
126
|
+
props.column.attrs.options = [];
|
|
127
|
+
if (!(isMountedLoad && props.column.isDefaultGetData === false)) {
|
|
128
|
+
try {
|
|
129
|
+
props.column.attrs.options = await props.column.optionsFn(
|
|
130
|
+
props.column,
|
|
131
|
+
props.model
|
|
132
|
+
);
|
|
133
|
+
props.column.optionsError = "";
|
|
134
|
+
resolve();
|
|
135
|
+
} catch (err) {
|
|
136
|
+
props.column.optionsError = "error";
|
|
137
|
+
console.error(err);
|
|
138
|
+
reject();
|
|
139
|
+
}
|
|
140
|
+
} else {
|
|
141
|
+
resolve();
|
|
142
|
+
}
|
|
143
|
+
} else if (props.column.type === "org-cascader") {
|
|
144
|
+
if (orgCascaderRef.value) {
|
|
145
|
+
props.column.optionsLoading = true;
|
|
146
|
+
props.column.optionsError = "";
|
|
147
|
+
try {
|
|
148
|
+
await orgCascaderRef.value.getData();
|
|
149
|
+
resolve();
|
|
150
|
+
} catch {
|
|
151
|
+
props.column.optionsError = "error";
|
|
152
|
+
reject();
|
|
153
|
+
}
|
|
154
|
+
} else {
|
|
155
|
+
resolve();
|
|
137
156
|
}
|
|
157
|
+
} else {
|
|
158
|
+
resolve();
|
|
138
159
|
}
|
|
160
|
+
props.column.optionsLoading = false;
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
function getOptionsHandler(props2, column) {
|
|
164
|
+
if (props2.column.optionsLoading) {
|
|
165
|
+
return [];
|
|
139
166
|
}
|
|
140
|
-
|
|
167
|
+
return optionsHandler(props2, props2.column);
|
|
141
168
|
}
|
|
142
169
|
function getColumnRuleHandler(column, model) {
|
|
143
170
|
if (!isRequired(props, column) && formItemRef.value) {
|
|
@@ -150,6 +177,15 @@ const _sfc_main = {
|
|
|
150
177
|
if (!onChange) return;
|
|
151
178
|
onChange(props.column, props.model, props.index);
|
|
152
179
|
}
|
|
180
|
+
async function onReloadOptions() {
|
|
181
|
+
if (props.column.optionsError === "error") {
|
|
182
|
+
try {
|
|
183
|
+
await obtainOptions();
|
|
184
|
+
} catch {
|
|
185
|
+
}
|
|
186
|
+
formContext?.emitOptionsStatus();
|
|
187
|
+
}
|
|
188
|
+
}
|
|
153
189
|
const context = reactive({
|
|
154
190
|
...toRefs(props),
|
|
155
191
|
columnProp,
|
|
@@ -157,16 +193,29 @@ const _sfc_main = {
|
|
|
157
193
|
columnConfig,
|
|
158
194
|
columnAttrs,
|
|
159
195
|
obtainOptions,
|
|
160
|
-
optionsLoading,
|
|
161
|
-
optionsError,
|
|
196
|
+
optionsLoading: computed(() => props.column.optionsLoading),
|
|
197
|
+
optionsError: computed(() => props.column.optionsError),
|
|
162
198
|
options: computed(() => {
|
|
163
|
-
return
|
|
199
|
+
return getOptionsHandler(props, props.column);
|
|
164
200
|
})
|
|
165
201
|
});
|
|
166
202
|
onMounted(() => {
|
|
167
203
|
if (propString.value) {
|
|
168
204
|
formContext?.addField(context);
|
|
169
205
|
}
|
|
206
|
+
watch(
|
|
207
|
+
() => formContext.model.errorMsg,
|
|
208
|
+
() => {
|
|
209
|
+
const optionsError = props.column.optionsError;
|
|
210
|
+
if (optionsError === "error") {
|
|
211
|
+
props.column.optionsError = "";
|
|
212
|
+
setTimeout(() => {
|
|
213
|
+
props.column.optionsError = "error";
|
|
214
|
+
}, 1);
|
|
215
|
+
}
|
|
216
|
+
},
|
|
217
|
+
{ immediate: true, deep: true }
|
|
218
|
+
);
|
|
170
219
|
});
|
|
171
220
|
onBeforeUnmount(() => {
|
|
172
221
|
formContext?.removeField(context);
|
|
@@ -188,7 +237,8 @@ const _sfc_main = {
|
|
|
188
237
|
prop: columnProp.value,
|
|
189
238
|
rules: getColumnRuleHandler(__props.column, props.model),
|
|
190
239
|
style: normalizeStyle(unref(columnItemStyle)(props, __props.column)),
|
|
191
|
-
error: optionsError
|
|
240
|
+
error: __props.column.optionsError,
|
|
241
|
+
"show-message": showMessage.value
|
|
192
242
|
}, createSlots({
|
|
193
243
|
default: withCtx(() => [
|
|
194
244
|
createElementVNode("div", { class: "w-full flex justify-between text-main" }, [
|
|
@@ -325,13 +375,13 @@ const _sfc_main = {
|
|
|
325
375
|
"onUpdate:modelValue": ($event) => bindValue.value = $event
|
|
326
376
|
}, columnAttrs.value, {
|
|
327
377
|
disabled: unref(isDisabled)(props, __props.column),
|
|
328
|
-
options:
|
|
378
|
+
options: getOptionsHandler(props, __props.column),
|
|
329
379
|
onChange: onChangeHandler
|
|
330
380
|
}), createSlots({
|
|
331
381
|
_: 2
|
|
332
382
|
/* DYNAMIC */
|
|
333
383
|
}, [
|
|
334
|
-
optionsLoading
|
|
384
|
+
__props.column.optionsLoading ? {
|
|
335
385
|
name: "empty",
|
|
336
386
|
fn: withCtx(() => [
|
|
337
387
|
createElementVNode("div", { class: "w-full flex items-center justify-center py-2 gap-1.5 text-main text-xs whitespace-nowrap" }, [
|
|
@@ -364,13 +414,13 @@ const _sfc_main = {
|
|
|
364
414
|
"onUpdate:modelValue": ($event) => bindValue.value = $event
|
|
365
415
|
}, columnAttrs.value, {
|
|
366
416
|
disabled: unref(isDisabled)(props, __props.column),
|
|
367
|
-
options:
|
|
417
|
+
options: getOptionsHandler(props, __props.column),
|
|
368
418
|
onChange: onChangeHandler
|
|
369
419
|
}), createSlots({
|
|
370
420
|
_: 2
|
|
371
421
|
/* DYNAMIC */
|
|
372
422
|
}, [
|
|
373
|
-
optionsLoading
|
|
423
|
+
__props.column.optionsLoading ? {
|
|
374
424
|
name: "empty",
|
|
375
425
|
fn: withCtx(() => [
|
|
376
426
|
createElementVNode("div", { class: "w-full flex items-center justify-center py-2 gap-1.5 text-main text-xs whitespace-nowrap" }, [
|
|
@@ -467,7 +517,7 @@ const _sfc_main = {
|
|
|
467
517
|
"onUpdate:modelValue": ($event) => bindValue.value = $event
|
|
468
518
|
}, columnAttrs.value, {
|
|
469
519
|
disabled: unref(isDisabled)(props, __props.column),
|
|
470
|
-
options:
|
|
520
|
+
options: getOptionsHandler(props, __props.column),
|
|
471
521
|
onChange: onChangeHandler
|
|
472
522
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "options"])
|
|
473
523
|
],
|
|
@@ -483,7 +533,7 @@ const _sfc_main = {
|
|
|
483
533
|
"onUpdate:modelValue": ($event) => bindValue.value = $event
|
|
484
534
|
}, columnAttrs.value, {
|
|
485
535
|
disabled: unref(isDisabled)(props, __props.column),
|
|
486
|
-
options:
|
|
536
|
+
options: getOptionsHandler(props, __props.column),
|
|
487
537
|
size: __props.size,
|
|
488
538
|
onChange: onChangeHandler
|
|
489
539
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "options", "size"])
|
|
@@ -500,7 +550,7 @@ const _sfc_main = {
|
|
|
500
550
|
"onUpdate:modelValue": ($event) => bindValue.value = $event
|
|
501
551
|
}, columnAttrs.value, {
|
|
502
552
|
disabled: unref(isDisabled)(props, __props.column),
|
|
503
|
-
options:
|
|
553
|
+
options: getOptionsHandler(props, __props.column),
|
|
504
554
|
onChange: onChangeHandler
|
|
505
555
|
}), null, 16, ["modelValue", "onUpdate:modelValue", "disabled", "options"])
|
|
506
556
|
],
|
|
@@ -568,13 +618,13 @@ const _sfc_main = {
|
|
|
568
618
|
}, columnAttrs.value, {
|
|
569
619
|
class: "w-full",
|
|
570
620
|
disabled: unref(isDisabled)(props, __props.column),
|
|
571
|
-
options:
|
|
621
|
+
options: getOptionsHandler(props, __props.column),
|
|
572
622
|
onChange: onChangeHandler
|
|
573
623
|
}), createSlots({
|
|
574
624
|
_: 2
|
|
575
625
|
/* DYNAMIC */
|
|
576
626
|
}, [
|
|
577
|
-
optionsLoading
|
|
627
|
+
__props.column.optionsLoading ? {
|
|
578
628
|
name: "empty",
|
|
579
629
|
fn: withCtx(() => [
|
|
580
630
|
createElementVNode("div", { class: "w-full flex items-center justify-center py-2 gap-1.5 text-main text-xs whitespace-nowrap" }, [
|
|
@@ -606,21 +656,21 @@ const _sfc_main = {
|
|
|
606
656
|
_: 2
|
|
607
657
|
/* DYNAMIC */
|
|
608
658
|
}, [
|
|
609
|
-
optionsError
|
|
659
|
+
__props.column.optionsError ? {
|
|
610
660
|
name: "error",
|
|
611
661
|
fn: withCtx(() => [
|
|
612
662
|
createElementVNode("div", { class: "hy-el-form-item__error" }, [
|
|
613
663
|
createElementVNode("span", null, "\u6570\u636E\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7"),
|
|
614
664
|
createElementVNode("span", {
|
|
615
665
|
class: "text-theme cursor-pointer",
|
|
616
|
-
onClick:
|
|
666
|
+
onClick: onReloadOptions
|
|
617
667
|
}, "[\u91CD\u65B0\u52A0\u8F7D]"),
|
|
618
668
|
createElementVNode("span", null, "\u6216\u8054\u7CFB\u7BA1\u7406\u5458")
|
|
619
669
|
])
|
|
620
670
|
]),
|
|
621
671
|
key: "0"
|
|
622
672
|
} : void 0
|
|
623
|
-
]), 1032, ["id", "prop", "rules", "style", "error"])) : createCommentVNode("v-if", true);
|
|
673
|
+
]), 1032, ["id", "prop", "rules", "style", "error", "show-message"])) : createCommentVNode("v-if", true);
|
|
624
674
|
};
|
|
625
675
|
}
|
|
626
676
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, useTemplateRef, computed, ref, reactive,
|
|
1
|
+
import { defineComponent, useTemplateRef, computed, ref, reactive, provide, toRefs, onMounted, nextTick, unref, openBlock, createBlock, mergeProps, withCtx, createElementVNode, normalizeStyle, createCommentVNode, createElementBlock, Fragment, renderList, normalizeClass, toDisplayString, createVNode, createSlots, renderSlot } from 'vue';
|
|
2
2
|
import { ElForm, ElDivider } from 'element-plus';
|
|
3
3
|
import '../../hooks/index.mjs';
|
|
4
4
|
import '../../utils/index.mjs';
|
|
@@ -50,6 +50,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
50
50
|
type: String,
|
|
51
51
|
default: "default"
|
|
52
52
|
// 'large' | 'default' | 'small'
|
|
53
|
+
},
|
|
54
|
+
showMessage: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: true
|
|
53
57
|
}
|
|
54
58
|
},
|
|
55
59
|
emits: ["on-allMapSelect", "complete"],
|
|
@@ -88,7 +92,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
88
92
|
fields.push(field);
|
|
89
93
|
}
|
|
90
94
|
const removeField = (field) => {
|
|
91
|
-
if (
|
|
95
|
+
if (field.propString) {
|
|
92
96
|
fields.splice(fields.indexOf(field), 1);
|
|
93
97
|
}
|
|
94
98
|
};
|
|
@@ -98,21 +102,30 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
98
102
|
(field) => field.propString && filterKeys.includes(field.propString)
|
|
99
103
|
) : fields2;
|
|
100
104
|
}
|
|
101
|
-
async function obtainOptionsFields(keys) {
|
|
105
|
+
async function obtainOptionsFields(keys, isMountedLoad = false) {
|
|
102
106
|
const filteredFields = filterFields(fields, keys);
|
|
103
|
-
await Promise.allSettled(
|
|
107
|
+
await Promise.allSettled(
|
|
108
|
+
filteredFields.map((field) => field.obtainOptions(isMountedLoad))
|
|
109
|
+
);
|
|
104
110
|
}
|
|
105
|
-
async function getOptions() {
|
|
106
|
-
await obtainOptionsFields();
|
|
111
|
+
async function getOptions(isMountedLoad = false) {
|
|
112
|
+
await obtainOptionsFields([], isMountedLoad);
|
|
113
|
+
emitOptionsStatus();
|
|
107
114
|
}
|
|
108
115
|
async function getOptionsFields(keys) {
|
|
109
116
|
await obtainOptionsFields(keys);
|
|
117
|
+
emitOptionsStatus();
|
|
110
118
|
}
|
|
111
119
|
async function getOptionsError() {
|
|
112
120
|
const filteredFields = fields.filter(
|
|
113
121
|
(field) => field.propString && field.optionsError
|
|
114
122
|
);
|
|
115
123
|
await Promise.allSettled(filteredFields.map((field) => field.obtainOptions()));
|
|
124
|
+
emitOptionsStatus();
|
|
125
|
+
}
|
|
126
|
+
function emitOptionsStatus() {
|
|
127
|
+
const hasError = fields.some((item) => item.optionsError === "error");
|
|
128
|
+
emits("optionsStatus", { result: !hasError });
|
|
116
129
|
}
|
|
117
130
|
provide(
|
|
118
131
|
formContextKey,
|
|
@@ -120,11 +133,12 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
120
133
|
...toRefs(props),
|
|
121
134
|
emits,
|
|
122
135
|
addField,
|
|
123
|
-
removeField
|
|
136
|
+
removeField,
|
|
137
|
+
emitOptionsStatus
|
|
124
138
|
})
|
|
125
139
|
);
|
|
126
140
|
onMounted(() => {
|
|
127
|
-
getOptions();
|
|
141
|
+
getOptions(true);
|
|
128
142
|
});
|
|
129
143
|
__expose({
|
|
130
144
|
validate: async (callback) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InitMap } from '../../../utils/map/index.mjs';
|
|
2
|
-
import { nextTick } from 'vue';
|
|
2
|
+
import { shallowRef, nextTick } from 'vue';
|
|
3
3
|
|
|
4
4
|
const useAppMapWrapper = (hy) => {
|
|
5
5
|
const {
|
|
@@ -7,8 +7,8 @@ const useAppMapWrapper = (hy) => {
|
|
|
7
7
|
mapRef,
|
|
8
8
|
emits
|
|
9
9
|
} = hy;
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
let hyMap = shallowRef(null);
|
|
11
|
+
let map = shallowRef(null);
|
|
12
12
|
function newMap(mapType) {
|
|
13
13
|
const mapFilters = [
|
|
14
14
|
{
|
|
@@ -92,7 +92,7 @@ const useAppMapWrapper = (hy) => {
|
|
|
92
92
|
filter: "saturate(180%) brightness(105%) contrast(115%)"
|
|
93
93
|
}
|
|
94
94
|
];
|
|
95
|
-
hy.hyMap = new InitMap({
|
|
95
|
+
hy.hyMap.value = new InitMap({
|
|
96
96
|
...mapConfig,
|
|
97
97
|
mapType,
|
|
98
98
|
BM: window.BM
|
|
@@ -115,7 +115,7 @@ const useAppMapWrapper = (hy) => {
|
|
|
115
115
|
}, 800);
|
|
116
116
|
}
|
|
117
117
|
function initMap() {
|
|
118
|
-
hy.map = hy.hyMap.InitMap(mapRef.value, {
|
|
118
|
+
hy.map.value = hy.hyMap.value.InitMap(mapRef.value, {
|
|
119
119
|
minZoom: mapConfig.minZoom || 8,
|
|
120
120
|
maxZoom: mapConfig.maxZoom || 18,
|
|
121
121
|
center: mapConfig.center || {
|
|
@@ -125,7 +125,7 @@ const useAppMapWrapper = (hy) => {
|
|
|
125
125
|
zoom: mapConfig.zoom || 14,
|
|
126
126
|
completeCallbacks: () => {
|
|
127
127
|
nextTick(() => {
|
|
128
|
-
emits("complete", hy.hyMap, hy.map);
|
|
128
|
+
emits("complete", hy.hyMap.value, hy.map.value);
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { ref, onMounted, openBlock, createElementBlock,
|
|
1
|
+
import { ref, onMounted, onBeforeUnmount, openBlock, createElementBlock, createBlock, unref } from 'vue';
|
|
2
2
|
import '../../hooks/index.mjs';
|
|
3
|
+
import '../../index.mjs';
|
|
3
4
|
import { useAppMapWrapper } from './js/index.mjs';
|
|
4
5
|
import { useMixins } from '../../hooks/useMixins.mjs';
|
|
6
|
+
import { HyNoPermissionsMap } from '../hyNoPermissionsMap/index.mjs';
|
|
5
7
|
import { useMapConfig } from '../../hooks/useMapConfig.mjs';
|
|
6
8
|
|
|
7
9
|
import "../../static/map/bigemap.css";
|
|
@@ -44,13 +46,21 @@ const _sfc_main = {
|
|
|
44
46
|
[useAppMapWrapper]
|
|
45
47
|
);
|
|
46
48
|
onMounted(() => {
|
|
47
|
-
|
|
49
|
+
if (props.mapType !== "nomap") {
|
|
50
|
+
newMap(props.mapType);
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
onBeforeUnmount(() => {
|
|
54
|
+
map.value?.removeMap();
|
|
55
|
+
map.value = null;
|
|
56
|
+
hyMap.value = null;
|
|
48
57
|
});
|
|
49
58
|
return (_ctx, _cache) => {
|
|
50
59
|
return openBlock(), createElementBlock("div", { class: "w-full h-full box-border border-border border relative" }, [
|
|
51
|
-
|
|
60
|
+
props.mapType !== "nomap" ? (openBlock(), createElementBlock(
|
|
52
61
|
"div",
|
|
53
62
|
{
|
|
63
|
+
key: 0,
|
|
54
64
|
ref_key: "mapRef",
|
|
55
65
|
ref: mapRef,
|
|
56
66
|
class: "w-full h-full rounded overflow-hidden"
|
|
@@ -58,7 +68,7 @@ const _sfc_main = {
|
|
|
58
68
|
null,
|
|
59
69
|
512
|
|
60
70
|
/* NEED_PATCH */
|
|
61
|
-
)
|
|
71
|
+
)) : (openBlock(), createBlock(unref(HyNoPermissionsMap), { key: 1 }))
|
|
62
72
|
]);
|
|
63
73
|
};
|
|
64
74
|
}
|
|
@@ -75,6 +75,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
75
75
|
default: () => {
|
|
76
76
|
return true;
|
|
77
77
|
}
|
|
78
|
+
},
|
|
79
|
+
onVisibleChange: {
|
|
80
|
+
type: Function
|
|
78
81
|
}
|
|
79
82
|
}, {
|
|
80
83
|
"modelValue": { type: [Array, String, Number] },
|
|
@@ -139,6 +142,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
139
142
|
}
|
|
140
143
|
function onVisibleChangeHandler(type) {
|
|
141
144
|
focusType.value = type;
|
|
145
|
+
onVisibleChange(type);
|
|
142
146
|
}
|
|
143
147
|
if (props.defaultGetData) {
|
|
144
148
|
getCascaderData();
|
|
@@ -260,7 +264,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
260
264
|
filterable: "",
|
|
261
265
|
"show-all-levels": false,
|
|
262
266
|
"virtual-scroll": "",
|
|
263
|
-
onChange: onChangeHanlder
|
|
267
|
+
onChange: onChangeHanlder,
|
|
268
|
+
onVisibleChange: __props.onVisibleChange
|
|
264
269
|
}, createSlots({
|
|
265
270
|
_: 2
|
|
266
271
|
/* DYNAMIC */
|
|
@@ -284,7 +289,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
|
|
|
284
289
|
]),
|
|
285
290
|
key: "0"
|
|
286
291
|
} : void 0
|
|
287
|
-
]), 1032, ["modelValue", "onUpdate:modelValue", "class", "size", "options", "clearable", "disabled", "placeholder"]))
|
|
292
|
+
]), 1032, ["modelValue", "onUpdate:modelValue", "class", "size", "options", "clearable", "disabled", "placeholder", "onVisibleChange"]))
|
|
288
293
|
]);
|
|
289
294
|
};
|
|
290
295
|
}
|