@ibiz-template/mob-vue3-components 0.7.41-alpha.18 → 0.7.41-alpha.19
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/index-BsnCebyq.js +2 -0
- package/dist/index-BsnCebyq.js.map +1 -0
- package/dist/index-DL4fl2Xq.js +2 -0
- package/dist/index-DL4fl2Xq.js.map +1 -0
- package/dist/index-DwC1-gss.js +76 -0
- package/dist/index-DwC1-gss.js.map +1 -0
- package/dist/index.min.css +4 -4
- package/dist/index.system.min.js +1 -1
- package/dist/{quill-DKjojHxx.js → quill-DcWdzP1t.js} +2 -2
- package/dist/{quill-DKjojHxx.js.map → quill-DcWdzP1t.js.map} +1 -1
- package/dist/{quill-editor-B4FDYSA7.js → quill-editor-DlIyufAV.js} +2 -2
- package/dist/{quill-editor-B4FDYSA7.js.map → quill-editor-DlIyufAV.js.map} +1 -1
- package/dist/{quill-editor-preview-6GV-nd2y.js → quill-editor-preview-Cf2qhphz.js} +2 -2
- package/dist/{quill-editor-preview-6GV-nd2y.js.map → quill-editor-preview-Cf2qhphz.js.map} +1 -1
- package/dist/tree-CGwysqdR.js +2 -0
- package/dist/tree-CGwysqdR.js.map +1 -0
- package/es/_virtual/index12.mjs +2 -2
- package/es/_virtual/index13.mjs +2 -2
- package/es/_virtual/index14.mjs +2 -2
- package/es/_virtual/index15.mjs +3 -1
- package/es/_virtual/index16.mjs +1 -1
- package/es/_virtual/index17.mjs +1 -3
- package/es/_virtual/index18.mjs +2 -2
- package/es/_virtual/index19.mjs +3 -0
- package/es/control/calendar/calendar.mjs +2 -0
- package/es/control/dashboard/dashboard.css +1 -1
- package/es/control/dashboard/portlet/portlet-layout/portlet-layout.css +1 -1
- package/es/control/dashboard/portlet/portlet-layout/portlet-layout.mjs +68 -22
- package/es/control/drbar/drbar.controller.mjs +24 -1
- package/es/control/drtab/drtab.controller.mjs +20 -4
- package/es/control/list/list-render-util.mjs +1 -1
- package/es/control/list/md-ctrl/md-ctrl.css +1 -1
- package/es/control/tab-exp-panel/tab-exp-panel.css +1 -1
- package/es/control/tree/tree.mjs +8 -0
- package/es/editor/data-picker/ibiz-mpicker/ibiz-mpicker.css +1 -1
- package/es/editor/data-picker/ibiz-mpicker/ibiz-mpicker.mjs +5 -0
- package/es/editor/data-picker/ibiz-picker/ibiz-picker.mjs +23 -3
- package/es/editor/data-picker/picker-editor.controller.mjs +1 -1
- package/es/editor/date-picker/date-picker-editor.controller.mjs +16 -0
- package/es/editor/date-picker/ibiz-date-picker/ibiz-date-picker.mjs +4 -1
- package/es/editor/date-range/date-range-editor.controller.mjs +16 -0
- package/es/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.mjs +11 -4
- package/es/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.mjs +2 -2
- package/es/editor/html/html-editor.controller.mjs +8 -2
- package/es/editor/index.mjs +5 -0
- package/es/editor/map-picker/ibiz-map-picker/ibiz-map-picker.css +1 -0
- package/es/editor/map-picker/ibiz-map-picker/ibiz-map-picker.mjs +337 -0
- package/es/editor/map-picker/index.mjs +5 -0
- package/es/editor/map-picker/map-picker-editor.controller.mjs +7 -0
- package/es/editor/map-picker/map-picker-editor.provider.mjs +22 -0
- package/es/editor/text-box/signature/signature.css +1 -1
- package/es/editor/text-box/signature/signature.mjs +2 -0
- package/es/index.mjs +1 -0
- package/es/locale/en/index.mjs +3 -0
- package/es/locale/zh-CN/index.mjs +3 -0
- package/es/mob-app/router/index.mjs +6 -5
- package/es/node_modules/.pnpm/@amap_amap-jsapi-loader@1.0.1_patch_hash_73bpcwbs2m5ip4qppmz6a7epsa/node_modules/@amap/amap-jsapi-loader/dist/index.mjs +41 -0
- package/es/node_modules/.pnpm/dingtalk-jsapi@3.2.0/node_modules/dingtalk-jsapi/lib/packages/frame-talk-client-pc/index.mjs +1 -1
- package/es/node_modules/.pnpm/dingtalk-jsapi@3.2.0/node_modules/dingtalk-jsapi/lib/sdk/middlewares/index.mjs +1 -1
- package/es/node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index2.mjs +1 -1
- package/es/node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.mjs +1 -1
- package/es/node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.mjs +1 -1
- package/es/node_modules/.pnpm/quill-delta@5.1.0/node_modules/quill-delta/dist/AttributeMap.mjs +1 -1
- package/es/node_modules/.pnpm/quill-delta@5.1.0/node_modules/quill-delta/dist/Delta.mjs +1 -1
- package/es/view-engine/mob-mpickup-view-engine.mjs +6 -1
- package/lib/_virtual/index12.cjs +2 -2
- package/lib/_virtual/index13.cjs +2 -2
- package/lib/_virtual/index14.cjs +2 -2
- package/lib/_virtual/index15.cjs +2 -6
- package/lib/_virtual/index16.cjs +2 -2
- package/lib/_virtual/index17.cjs +6 -2
- package/lib/_virtual/index18.cjs +2 -2
- package/lib/_virtual/index19.cjs +5 -0
- package/lib/control/calendar/calendar.cjs +2 -0
- package/lib/control/dashboard/dashboard.css +1 -1
- package/lib/control/dashboard/portlet/portlet-layout/portlet-layout.cjs +67 -21
- package/lib/control/dashboard/portlet/portlet-layout/portlet-layout.css +1 -1
- package/lib/control/drbar/drbar.controller.cjs +24 -1
- package/lib/control/drtab/drtab.controller.cjs +20 -4
- package/lib/control/list/list-render-util.cjs +1 -1
- package/lib/control/list/md-ctrl/md-ctrl.css +1 -1
- package/lib/control/tab-exp-panel/tab-exp-panel.css +1 -1
- package/lib/control/tree/tree.cjs +8 -0
- package/lib/editor/data-picker/ibiz-mpicker/ibiz-mpicker.cjs +5 -0
- package/lib/editor/data-picker/ibiz-mpicker/ibiz-mpicker.css +1 -1
- package/lib/editor/data-picker/ibiz-picker/ibiz-picker.cjs +23 -3
- package/lib/editor/data-picker/picker-editor.controller.cjs +1 -1
- package/lib/editor/date-picker/date-picker-editor.controller.cjs +16 -0
- package/lib/editor/date-picker/ibiz-date-picker/ibiz-date-picker.cjs +3 -0
- package/lib/editor/date-range/date-range-editor.controller.cjs +16 -0
- package/lib/editor/date-range/ibiz-date-range-picker/ibiz-date-range-picker.cjs +10 -3
- package/lib/editor/dropdown-list/ibiz-dropdown/ibiz-dropdown.cjs +2 -2
- package/lib/editor/html/html-editor.controller.cjs +8 -2
- package/lib/editor/index.cjs +5 -0
- package/lib/editor/map-picker/ibiz-map-picker/ibiz-map-picker.cjs +339 -0
- package/lib/editor/map-picker/ibiz-map-picker/ibiz-map-picker.css +1 -0
- package/lib/editor/map-picker/index.cjs +11 -0
- package/lib/editor/map-picker/map-picker-editor.controller.cjs +9 -0
- package/lib/editor/map-picker/map-picker-editor.provider.cjs +24 -0
- package/lib/editor/text-box/signature/signature.cjs +2 -0
- package/lib/editor/text-box/signature/signature.css +1 -1
- package/lib/index.cjs +2 -0
- package/lib/locale/en/index.cjs +3 -0
- package/lib/locale/zh-CN/index.cjs +3 -0
- package/lib/mob-app/router/index.cjs +6 -5
- package/lib/node_modules/.pnpm/@amap_amap-jsapi-loader@1.0.1_patch_hash_73bpcwbs2m5ip4qppmz6a7epsa/node_modules/@amap/amap-jsapi-loader/dist/index.cjs +45 -0
- package/lib/node_modules/.pnpm/dingtalk-jsapi@3.2.0/node_modules/dingtalk-jsapi/lib/packages/frame-talk-client-pc/index.cjs +1 -1
- package/lib/node_modules/.pnpm/dingtalk-jsapi@3.2.0/node_modules/dingtalk-jsapi/lib/sdk/middlewares/index.cjs +1 -1
- package/lib/node_modules/.pnpm/eventemitter3@5.0.1/node_modules/eventemitter3/index2.cjs +1 -1
- package/lib/node_modules/.pnpm/lodash.clonedeep@4.5.0/node_modules/lodash.clonedeep/index.cjs +1 -1
- package/lib/node_modules/.pnpm/lodash.isequal@4.5.0/node_modules/lodash.isequal/index.cjs +1 -1
- package/lib/node_modules/.pnpm/quill-delta@5.1.0/node_modules/quill-delta/dist/AttributeMap.cjs +1 -1
- package/lib/node_modules/.pnpm/quill-delta@5.1.0/node_modules/quill-delta/dist/Delta.cjs +1 -1
- package/lib/view-engine/mob-mpickup-view-engine.cjs +6 -1
- package/package.json +14 -8
- package/dist/index-BcB2An4e.js +0 -2
- package/dist/index-BcB2An4e.js.map +0 -1
- package/dist/index-DO9R8HNp.js +0 -76
- package/dist/index-DO9R8HNp.js.map +0 -1
- package/dist/index-DuVHtH1z.js +0 -2
- package/dist/index-DuVHtH1z.js.map +0 -1
- package/dist/tree-Db38FIKx.js +0 -2
- package/dist/tree-Db38FIKx.js.map +0 -1
package/es/control/tree/tree.mjs
CHANGED
|
@@ -96,6 +96,7 @@ const TreeControl = /* @__PURE__ */ defineComponent({
|
|
|
96
96
|
}) : "";
|
|
97
97
|
return {
|
|
98
98
|
_id: node._id,
|
|
99
|
+
id: node._id,
|
|
99
100
|
_uuid: node._uuid,
|
|
100
101
|
_leaf: node._leaf,
|
|
101
102
|
_text: node._text,
|
|
@@ -123,6 +124,12 @@ const TreeControl = /* @__PURE__ */ defineComponent({
|
|
|
123
124
|
}
|
|
124
125
|
return controller.state.items.find((item) => item._uuid === key);
|
|
125
126
|
}
|
|
127
|
+
const updateUI = () => {
|
|
128
|
+
if (treeRef.value) {
|
|
129
|
+
treeRef.value.tree.tree.store.checkedKeys = checkedKeys.value;
|
|
130
|
+
treeRef.value.tree.tree.store.setDefaultChecked();
|
|
131
|
+
}
|
|
132
|
+
};
|
|
126
133
|
const loadData = async (item, callback) => {
|
|
127
134
|
if (!c.state.isLoaded) {
|
|
128
135
|
return;
|
|
@@ -143,6 +150,7 @@ const TreeControl = /* @__PURE__ */ defineComponent({
|
|
|
143
150
|
return;
|
|
144
151
|
}
|
|
145
152
|
callback(toElNodes(nodes));
|
|
153
|
+
updateUI();
|
|
146
154
|
};
|
|
147
155
|
const onNodeCheck = (event, opts) => {
|
|
148
156
|
if (c.state.singleSelect) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";.ibiz-mpicker .van-field{font-size:var(--ibiz-form-item-font-size)}.ibiz-mpicker .van-field::after{display:none}.ibiz-mpicker .van-field__right-icon button{color:var(--van-field-right-icon-color);border:none}.ibiz-mpicker .van-field__control--custom{flex-wrap:wrap}.ibiz-mpicker .van-field__control{gap:var(--ibiz-spacing-tight)}.ibiz-mpicker input:disabled{color:var(--ibiz-form-item-disabled-color);background-color:var(--ibiz-form-item-disabled-bg-color);border-color:var(--ibiz-form-item-disabled-border-color);-webkit-text-fill-color:var(--ibiz-form-item-disabled-color)}.ibiz-mpicker__pickup-search-icon{font-size:var(--ibiz-font-size-header-5);display:flex}.ibiz-mpicker--disabled{pointer-events:none;opacity:.8}.ibiz-mpicker--readonly{color:var(--ibiz-form-item-readonly-color);-webkit-text-fill-color:var(--ibiz-form-item-readonly-color)}.ibiz-mpicker .ibiz-mpicker-select-item{display:flex;gap:var(--ibiz-spacing-tight);align-items:center;justify-content:space-between;padding:var(--ibiz-spacing-tight);background-color:var(--ibiz-color-disabled-bg);border-radius:var(--ibiz-border-radius-small)}.ibiz-mpicker .van-field__control--custom{display:flex;flex-direction:row;justify-content:var(--ibiz-form-item-container-editor-align)}.ibiz-mpicker.ibiz-mpicker--readonly{text-align:var(--ibiz-form-item-container-editor-align)}
|
|
1
|
+
@charset "UTF-8";.ibiz-mpicker .van-field{font-size:var(--ibiz-form-item-font-size)}.ibiz-mpicker .van-field::after{display:none}.ibiz-mpicker .van-field__right-icon{align-items:center}.ibiz-mpicker .van-field__right-icon button{color:var(--van-field-right-icon-color);border:none}.ibiz-mpicker .van-field__control--custom{flex-wrap:wrap}.ibiz-mpicker .van-field__control{gap:var(--ibiz-spacing-tight)}.ibiz-mpicker input:disabled{color:var(--ibiz-form-item-disabled-color);background-color:var(--ibiz-form-item-disabled-bg-color);border-color:var(--ibiz-form-item-disabled-border-color);-webkit-text-fill-color:var(--ibiz-form-item-disabled-color)}.ibiz-mpicker__placeholder{color:var(--ibiz-color-text-3)}.ibiz-mpicker__pickup-search-icon{font-size:var(--ibiz-font-size-header-5);display:flex}.ibiz-mpicker--disabled{pointer-events:none;opacity:.8}.ibiz-mpicker--readonly{color:var(--ibiz-form-item-readonly-color);-webkit-text-fill-color:var(--ibiz-form-item-readonly-color)}.ibiz-mpicker .ibiz-mpicker-select-item{display:flex;gap:var(--ibiz-spacing-tight);align-items:center;justify-content:space-between;padding:var(--ibiz-spacing-tight);background-color:var(--ibiz-color-disabled-bg);border-radius:var(--ibiz-border-radius-small)}.ibiz-mpicker .van-field__control--custom{display:flex;flex-direction:row;justify-content:var(--ibiz-form-item-container-editor-align)}.ibiz-mpicker.ibiz-mpicker--readonly{text-align:var(--ibiz-form-item-container-editor-align)}
|
|
@@ -299,6 +299,11 @@ const IBizMPicker = /* @__PURE__ */ defineComponent({
|
|
|
299
299
|
"disabled": this.disabled
|
|
300
300
|
}, {
|
|
301
301
|
input: () => {
|
|
302
|
+
if (!this.selectItems.length) {
|
|
303
|
+
return createVNode("div", {
|
|
304
|
+
"class": this.ns.e("placeholder")
|
|
305
|
+
}, [this.c.placeHolder]);
|
|
306
|
+
}
|
|
302
307
|
return this.selectItems.map((item) => {
|
|
303
308
|
return createVNode("div", {
|
|
304
309
|
"class": this.ns.b("select-item")
|
|
@@ -62,12 +62,28 @@ const IBizPicker = /* @__PURE__ */ defineComponent({
|
|
|
62
62
|
}
|
|
63
63
|
emit("change", targetData[c.textName]);
|
|
64
64
|
};
|
|
65
|
+
const calcSelectItem = () => {
|
|
66
|
+
const selectItems = [];
|
|
67
|
+
if (curValue.value) {
|
|
68
|
+
const selectItem = {
|
|
69
|
+
srfkey: props.data[c.valueItem],
|
|
70
|
+
srfmajortext: curValue.value,
|
|
71
|
+
...c.model.valueType === "OBJECT" && props.value && c.objectValueField ? props.value[c.objectValueField] : {}
|
|
72
|
+
};
|
|
73
|
+
if (c.deACMode && c.dataItems.length)
|
|
74
|
+
c.dataItems.forEach((item) => Object.assign(selectItem, {
|
|
75
|
+
[item.appDEFieldId]: props.data[item.id]
|
|
76
|
+
}));
|
|
77
|
+
selectItems.push(selectItem);
|
|
78
|
+
}
|
|
79
|
+
return selectItems;
|
|
80
|
+
};
|
|
65
81
|
const openPickUpView = async (e) => {
|
|
66
82
|
e.stopPropagation();
|
|
67
83
|
if (props.disabled || props.readonly) {
|
|
68
84
|
return;
|
|
69
85
|
}
|
|
70
|
-
const res = await c.openPickUpView(props.data);
|
|
86
|
+
const res = await c.openPickUpView(props.data, JSON.stringify(calcSelectItem()));
|
|
71
87
|
if (res && res[0]) {
|
|
72
88
|
await handleDataSelect(res[0]);
|
|
73
89
|
}
|
|
@@ -172,7 +188,7 @@ const IBizPicker = /* @__PURE__ */ defineComponent({
|
|
|
172
188
|
onSearch();
|
|
173
189
|
};
|
|
174
190
|
const onClose = () => {
|
|
175
|
-
showPicker.value =
|
|
191
|
+
showPicker.value = false;
|
|
176
192
|
};
|
|
177
193
|
const onClickClear = () => {
|
|
178
194
|
showPicker.value = false;
|
|
@@ -218,6 +234,10 @@ const IBizPicker = /* @__PURE__ */ defineComponent({
|
|
|
218
234
|
var _a;
|
|
219
235
|
if (((_a = item[c.textName]) == null ? void 0 : _a.indexOf(searchValue.value)) < 0)
|
|
220
236
|
return;
|
|
237
|
+
let selected = (item[c.textName] || item.srfmajortext) === curValue.value;
|
|
238
|
+
if (c.valueItem) {
|
|
239
|
+
selected = (item[c.keyName] || item.srfkey) === props.data[c.valueItem];
|
|
240
|
+
}
|
|
221
241
|
return createVNode("div", {
|
|
222
242
|
"class": ns.bem("pop", "list", "item"),
|
|
223
243
|
"onClick": () => onConfirm(item)
|
|
@@ -227,7 +247,7 @@ const IBizPicker = /* @__PURE__ */ defineComponent({
|
|
|
227
247
|
"select-option-item-color": `${item.color || ""}`,
|
|
228
248
|
"select-option-item-bkcolor": `${item.bkcolor || ""}`
|
|
229
249
|
}) : ""
|
|
230
|
-
}, [item[c.textName]]),
|
|
250
|
+
}, [item[c.textName]]), selected && createVNode(resolveComponent("van-icon"), {
|
|
231
251
|
"class": ns.bem("pop", "list", "selected"),
|
|
232
252
|
"name": "success"
|
|
233
253
|
}, null)]);
|
|
@@ -53,6 +53,22 @@ class DatePickerEditorController extends EditorController {
|
|
|
53
53
|
return "YYYY-MM-DD hh:mm:ss";
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
+
/**
|
|
57
|
+
* 值格式化
|
|
58
|
+
*
|
|
59
|
+
* @readonly
|
|
60
|
+
* @type {(string | undefined)}
|
|
61
|
+
* @memberof DatePickerEditorController
|
|
62
|
+
*/
|
|
63
|
+
get valueFormat() {
|
|
64
|
+
if (super.valueFormat) {
|
|
65
|
+
return super.valueFormat;
|
|
66
|
+
}
|
|
67
|
+
if (this.model.dateTimeFormat) {
|
|
68
|
+
return this.model.dateTimeFormat;
|
|
69
|
+
}
|
|
70
|
+
return this.getFormatByType(this.model.editorType);
|
|
71
|
+
}
|
|
56
72
|
}
|
|
57
73
|
|
|
58
74
|
export { DatePickerEditorController };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, createVNode, resolveComponent, ref, watch, onMounted } from 'vue';
|
|
1
|
+
import { defineComponent, createVNode, resolveComponent, ref, watch, onMounted, onBeforeUnmount } from 'vue';
|
|
2
2
|
import { useNamespace, getEditorEmits, getDatePickerProps } from '@ibiz-template/vue3-util';
|
|
3
3
|
import './ibiz-date-picker.css';
|
|
4
4
|
import dayjs from 'dayjs';
|
|
@@ -107,6 +107,9 @@ const IBizDatePicker = /* @__PURE__ */ defineComponent({
|
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
|
+
onBeforeUnmount(() => {
|
|
111
|
+
closeDrawer();
|
|
112
|
+
});
|
|
110
113
|
return {
|
|
111
114
|
ns,
|
|
112
115
|
c,
|
|
@@ -58,6 +58,22 @@ class DateRangeEditorController extends EditorController {
|
|
|
58
58
|
return "YYYY-MM-DD hh:mm:ss";
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* 值格式化
|
|
63
|
+
*
|
|
64
|
+
* @readonly
|
|
65
|
+
* @type {(string | undefined)}
|
|
66
|
+
* @memberof DateRangeEditorController
|
|
67
|
+
*/
|
|
68
|
+
get valueFormat() {
|
|
69
|
+
if (this.model.dateTimeFormat) {
|
|
70
|
+
return this.model.dateTimeFormat;
|
|
71
|
+
}
|
|
72
|
+
if (super.valueFormat) {
|
|
73
|
+
return super.valueFormat;
|
|
74
|
+
}
|
|
75
|
+
return this.getFormatByType();
|
|
76
|
+
}
|
|
61
77
|
}
|
|
62
78
|
|
|
63
79
|
export { DateRangeEditorController };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, createVNode, resolveComponent, ref, computed, onMounted } from 'vue';
|
|
1
|
+
import { defineComponent, createVNode, resolveComponent, ref, computed, onMounted, onBeforeUnmount } from 'vue';
|
|
2
2
|
import { useNamespace, getEditorEmits, getDateRangeProps } from '@ibiz-template/vue3-util';
|
|
3
3
|
import './ibiz-date-range-picker.css';
|
|
4
4
|
import RollDate from '../../../node_modules/.pnpm/ibiz-mob-rolldate@3.1.4/node_modules/ibiz-mob-rolldate/dist/rolldate.min.mjs';
|
|
@@ -22,6 +22,8 @@ const IBizDateRangePicker = /* @__PURE__ */ defineComponent({
|
|
|
22
22
|
const beginYear = currentYear - 100;
|
|
23
23
|
const endYear = currentYear + 100;
|
|
24
24
|
const minStep = 1;
|
|
25
|
+
const startRollDateInstance = ref(null);
|
|
26
|
+
const endRollDateInstance = ref(null);
|
|
25
27
|
let items = [];
|
|
26
28
|
const lang = {
|
|
27
29
|
title: ibiz.i18n.t("editor.datePicker.title"),
|
|
@@ -154,7 +156,7 @@ const IBizDateRangePicker = /* @__PURE__ */ defineComponent({
|
|
|
154
156
|
};
|
|
155
157
|
const el = startEditorRef.value;
|
|
156
158
|
if (el) {
|
|
157
|
-
new RollDate({
|
|
159
|
+
startRollDateInstance.value = new RollDate({
|
|
158
160
|
el,
|
|
159
161
|
value: startFormatValue.value,
|
|
160
162
|
confirm: (value) => {
|
|
@@ -169,7 +171,7 @@ const IBizDateRangePicker = /* @__PURE__ */ defineComponent({
|
|
|
169
171
|
}
|
|
170
172
|
const el2 = endEditorRef.value;
|
|
171
173
|
if (el2) {
|
|
172
|
-
new RollDate({
|
|
174
|
+
endRollDateInstance.value = new RollDate({
|
|
173
175
|
el: el2,
|
|
174
176
|
value: endFormatValue.value,
|
|
175
177
|
confirm: (value) => {
|
|
@@ -184,9 +186,11 @@ const IBizDateRangePicker = /* @__PURE__ */ defineComponent({
|
|
|
184
186
|
}
|
|
185
187
|
});
|
|
186
188
|
const closeDrawer = () => {
|
|
187
|
-
var _a, _b, _c, _d;
|
|
189
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
188
190
|
(_b = (_a = startEditorRef.value) == null ? void 0 : _a.hide) == null ? void 0 : _b.call(_a);
|
|
189
191
|
(_d = (_c = endEditorRef.value) == null ? void 0 : _c.hide) == null ? void 0 : _d.call(_c);
|
|
192
|
+
(_f = (_e = startRollDateInstance.value) == null ? void 0 : _e.hide) == null ? void 0 : _f.call(_e);
|
|
193
|
+
(_h = (_g = endRollDateInstance.value) == null ? void 0 : _g.hide) == null ? void 0 : _h.call(_g);
|
|
190
194
|
};
|
|
191
195
|
usePopstateListener(closeDrawer);
|
|
192
196
|
const expandHidden = (text) => {
|
|
@@ -203,6 +207,9 @@ const IBizDateRangePicker = /* @__PURE__ */ defineComponent({
|
|
|
203
207
|
});
|
|
204
208
|
show.value = false;
|
|
205
209
|
};
|
|
210
|
+
onBeforeUnmount(() => {
|
|
211
|
+
closeDrawer();
|
|
212
|
+
});
|
|
206
213
|
const renderCalendarMode = () => {
|
|
207
214
|
return createVNode(resolveComponent("van-popup"), {
|
|
208
215
|
"show": show.value,
|
|
@@ -64,7 +64,7 @@ const IBizDropdown = /* @__PURE__ */ defineComponent({
|
|
|
64
64
|
const index = items.value.findIndex(
|
|
65
65
|
// 不匹配类型 兼容数值属性配置字符串代码表
|
|
66
66
|
// eslint-disable-next-line eqeqeq
|
|
67
|
-
(item) => item.value
|
|
67
|
+
(item) => item.value === curValue.value
|
|
68
68
|
);
|
|
69
69
|
if (index !== -1) {
|
|
70
70
|
return items.value[index].text;
|
|
@@ -155,7 +155,7 @@ const IBizDropdown = /* @__PURE__ */ defineComponent({
|
|
|
155
155
|
"select-option-item-color": `${item.color || ""}`,
|
|
156
156
|
"select-option-item-bkcolor": `${item.bkcolor || ""}`
|
|
157
157
|
}) : ""
|
|
158
|
-
}, [item.text]), item.value
|
|
158
|
+
}, [item.text]), item.value === curValue.value && createVNode(resolveComponent("van-icon"), {
|
|
159
159
|
"class": ns.bem("pop", "list", "selected"),
|
|
160
160
|
"name": "success"
|
|
161
161
|
}, null)]);
|
|
@@ -156,13 +156,19 @@ class HtmlEditorController extends EditorController {
|
|
|
156
156
|
if (MODULES) {
|
|
157
157
|
this.modules = ScriptFactory.execScriptFn(
|
|
158
158
|
{ controller: this },
|
|
159
|
-
MODULES
|
|
159
|
+
MODULES,
|
|
160
|
+
{
|
|
161
|
+
isAsync: false
|
|
162
|
+
}
|
|
160
163
|
);
|
|
161
164
|
}
|
|
162
165
|
if (modules) {
|
|
163
166
|
this.modules = ScriptFactory.execScriptFn(
|
|
164
167
|
{ controller: this },
|
|
165
|
-
modules
|
|
168
|
+
modules,
|
|
169
|
+
{
|
|
170
|
+
isAsync: false
|
|
171
|
+
}
|
|
166
172
|
);
|
|
167
173
|
}
|
|
168
174
|
if (DEFAULTHEIGHT) {
|
package/es/editor/index.mjs
CHANGED
|
@@ -23,6 +23,7 @@ import './html/index.mjs';
|
|
|
23
23
|
import { IBizDropdownList } from './dropdown-list/ibiz-dropdown-list/ibiz-dropdown-list.mjs';
|
|
24
24
|
import './qrcode/index.mjs';
|
|
25
25
|
import './check-box/index.mjs';
|
|
26
|
+
import './map-picker/index.mjs';
|
|
26
27
|
import './common/index.mjs';
|
|
27
28
|
import { IBizInput } from './text-box/input/input.mjs';
|
|
28
29
|
import { IBizInputNumber } from './text-box/ibiz-input-number/ibiz-input-number.mjs';
|
|
@@ -53,6 +54,7 @@ import { IBizEditorCarousel } from './upload/ibiz-carousel/ibiz-carousel.mjs';
|
|
|
53
54
|
import { IBizQrcode } from './qrcode/ibiz-qrcode/ibiz-qrcode.mjs';
|
|
54
55
|
import { IBizImageCropping } from './upload/ibiz-image-cropping/ibiz-image-cropping.mjs';
|
|
55
56
|
import { IBizCheckbox } from './check-box/ibiz-checkbox/ibiz-checkbox.mjs';
|
|
57
|
+
import { IBizMapPicker } from './map-picker/ibiz-map-picker/ibiz-map-picker.mjs';
|
|
56
58
|
import { SpanEditorProvider } from './span/span-editor.provider.mjs';
|
|
57
59
|
import { TextBoxEditorProvider } from './text-box/text-box-editor.provider.mjs';
|
|
58
60
|
import { DropDownListEditorProvider } from './dropdown-list/dropdown-list-editor.provider.mjs';
|
|
@@ -72,6 +74,7 @@ import { FileUploaderEditorProvider } from './upload/upload-editor.provider.mjs'
|
|
|
72
74
|
import { NumberRangeEditorProvider } from './number-range/number-range-editor.provider.mjs';
|
|
73
75
|
import { DateRangeEditorProvider } from './date-range/date-range-editor.provider.mjs';
|
|
74
76
|
import { CheckBoxEditorProvider } from './check-box/check-box-editor.provider.mjs';
|
|
77
|
+
import { MapPickerEditorProvider } from './map-picker/map-picker-editor.provider.mjs';
|
|
75
78
|
import { CheckBoxListEditorProvider } from './check-box-list/checkbox-list-editor.provider.mjs';
|
|
76
79
|
import { QrcodeEditorProvider } from './qrcode/qrcode-editor.provider.mjs';
|
|
77
80
|
export { CascaderEditorController } from './cascader/cascader-editor.controller.mjs';
|
|
@@ -131,6 +134,7 @@ const IBizEditor = {
|
|
|
131
134
|
v.component(IBizQrcode.name, IBizQrcode);
|
|
132
135
|
v.component(IBizImageCropping.name, IBizImageCropping);
|
|
133
136
|
v.component(IBizCheckbox.name, IBizCheckbox);
|
|
137
|
+
v.component(IBizMapPicker.name, IBizMapPicker);
|
|
134
138
|
v.component(
|
|
135
139
|
"IBizMarkDown",
|
|
136
140
|
defineAsyncComponent(
|
|
@@ -340,6 +344,7 @@ const IBizEditor = {
|
|
|
340
344
|
() => new DateRangeEditorProvider()
|
|
341
345
|
);
|
|
342
346
|
registerEditorProvider("CHECKBOX", () => new CheckBoxEditorProvider());
|
|
347
|
+
registerEditorProvider("MAPPICKER", () => new MapPickerEditorProvider());
|
|
343
348
|
registerEditorProvider(
|
|
344
349
|
"FIELD_IMAGE_PICTURE_ONE",
|
|
345
350
|
() => new FileUploaderEditorProvider("MOBPICTURE_RAW")
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.ibiz-map-picker--readonly{height:auto;overflow:auto;line-height:var(--ibiz-editor-default-line-height);color:var(--ibiz-form-item-readonly-color);word-break:break-word;white-space:pre-wrap}.ibiz-map-picker-popup{width:100%;height:100%}.ibiz-map-picker-popup.van-popup--bottom.van-popup--round{border-radius:0}.ibiz-map-picker-input .van-field__button{position:relative;display:flex;align-items:center;justify-content:center;padding:0}.ibiz-map-picker-input .van-field__button .van-button{position:relative;width:var(--ibiz-width-icon-large);height:auto;padding:0 0 0 var(--ibiz-spacing-loose);background-color:transparent;border:none}.ibiz-map-picker-input .van-field__button .van-button::before{display:none}.ibiz-map-picker-input .van-field__button .van-icon-clear{position:absolute;left:2px;font-size:var(--ibiz-width-icon-large);color:var(--ibiz-color-text-3)}.ibiz-map-picker-popup-wrapper{display:flex;flex-direction:column;width:100%;height:100%}.ibiz-map-picker-popup-wrapper-content{position:relative;display:flex;flex-direction:column;width:100%;height:100%}.ibiz-map-picker-popup-content-search{--ibiz-popup-content-search-input-padding-left:36px;--ibiz-popup-content-search-input-padding-right:24px;position:relative;z-index:999;width:100%}.ibiz-map-picker-popup-content-search .van-search{padding:var(--ibiz-spacing-tight)}.ibiz-map-picker-popup-content-search .van-search__content{position:relative}.ibiz-map-picker-popup-content-search .van-cell,.ibiz-map-picker-popup-content-search .van-cell__value{position:static}.ibiz-map-picker-popup-content-search .van-cell__value,.ibiz-map-picker-popup-content-search .van-field__body,.ibiz-map-picker-popup-content-search .van-field__control{height:100%}.ibiz-map-picker-popup-content-search input{position:absolute;left:0;padding-left:var(--ibiz-popup-content-search-input-padding-left);padding-right:var(--ibiz-popup-content-search-input-padding-right);margin:0}.ibiz-map-picker-popup-content-search .van-field__clear{position:absolute;right:var(--ibiz-spacing-extra-tight)}.ibiz-map-picker-popup-map{width:100%;height:100%}.ibiz-map-picker-popup-map-content{width:100%;height:100%}.ibiz-map-picker-popup-map-container{width:100%;height:100%}.ibiz-map-picker-popup-search-result-container{--ibiz-popup-search-result-container-bottom:24px;--ibiz-popup-search-result-container-placesearch-list-height:30vh;position:absolute;bottom:var(--ibiz-popup-search-result-container-bottom);left:0;display:block!important;width:100%;padding:0 var(--ibiz-spacing-tight);overflow:hidden}.ibiz-map-picker-popup-search-result-container .amap_lib_placeSearch{display:flex;flex-direction:column;border:none}.ibiz-map-picker-popup-search-result-container .amap_lib_placeSearch_list{max-height:var(--ibiz-popup-search-result-container-placesearch-list-height);overflow-y:auto}.ibiz-map-picker-popup-search-result-container .amap_lib_placeSearch_page{display:flex;overflow-x:auto}.ibiz-map-picker-popup-wrapper-footer{--ibiz-popup-wrapper-footer-height:70px;display:flex;gap:var(--ibiz-spacing-base);align-items:center;justify-content:space-between;height:var(--ibiz-popup-wrapper-footer-height);padding:0 var(--ibiz-spacing-tight)}.ibiz-map-picker-popup-wrapper-footer .van-button{width:50%}.ibiz-map-picker-popup-map-marker-text{--ibiz-popup-map-marker-text-background-color:#3d93fd;--ibiz-popup-map-marker-text-font-size:12px;--ibiz-popup-map-marker-text-padding:4px 10px;--ibiz-popup-map-marker-text-border-radius:4px;position:absolute;top:-24px;padding:var(--ibiz-popup-map-marker-text-padding);font-size:var(--ibiz-popup-map-marker-text-font-size);color:var(--ibiz-color-white);white-space:nowrap;background-color:var(--ibiz-popup-map-marker-text-background-color);border-radius:var(--ibiz-popup-map-marker-text-border-radius);transform:translateX(calc(-50% - 12.5px))}
|
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
import { isVNode, defineComponent, createVNode, resolveComponent, withDirectives, resolveDirective, ref, computed, nextTick, onUnmounted } from 'vue';
|
|
2
|
+
import { useNamespace, getEditorEmits, getMapPickerProps } from '@ibiz-template/vue3-util';
|
|
3
|
+
import AMapLoader from '../../../node_modules/.pnpm/@amap_amap-jsapi-loader@1.0.1_patch_hash_73bpcwbs2m5ip4qppmz6a7epsa/node_modules/@amap/amap-jsapi-loader/dist/index.mjs';
|
|
4
|
+
import './ibiz-map-picker.css';
|
|
5
|
+
|
|
6
|
+
"use strict";
|
|
7
|
+
function _isSlot(s) {
|
|
8
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
9
|
+
}
|
|
10
|
+
const IBizMapPicker = /* @__PURE__ */ defineComponent({
|
|
11
|
+
name: "IBizMapPicker",
|
|
12
|
+
props: getMapPickerProps(),
|
|
13
|
+
emits: getEditorEmits(),
|
|
14
|
+
setup(props, {
|
|
15
|
+
emit
|
|
16
|
+
}) {
|
|
17
|
+
const ns = useNamespace("map-picker");
|
|
18
|
+
const c = props.controller;
|
|
19
|
+
const {
|
|
20
|
+
editorItems
|
|
21
|
+
} = c.model;
|
|
22
|
+
let longitudeName = "";
|
|
23
|
+
let latitudeName = "";
|
|
24
|
+
if (editorItems) {
|
|
25
|
+
const [longitude, latitude] = editorItems;
|
|
26
|
+
longitudeName = longitude.id || "";
|
|
27
|
+
latitudeName = latitude.id || "";
|
|
28
|
+
}
|
|
29
|
+
const inputRef = ref();
|
|
30
|
+
const searchRef = ref();
|
|
31
|
+
const searchInputRef = computed(() => {
|
|
32
|
+
var _a, _b, _c;
|
|
33
|
+
return (_c = (_a = searchRef.value) == null ? void 0 : (_b = _a.$el).querySelector) == null ? void 0 : _c.call(_b, "input");
|
|
34
|
+
});
|
|
35
|
+
const mapContainerRef = ref();
|
|
36
|
+
const searchResultContainerRef = ref();
|
|
37
|
+
const dialogVisible = ref(false);
|
|
38
|
+
const isLoading = ref(false);
|
|
39
|
+
const searchValue = ref("");
|
|
40
|
+
let map;
|
|
41
|
+
let marker;
|
|
42
|
+
let poiPicker;
|
|
43
|
+
const addressInfo = {
|
|
44
|
+
address: "",
|
|
45
|
+
longitude: null,
|
|
46
|
+
latitude: null
|
|
47
|
+
};
|
|
48
|
+
const clearMarker = () => {
|
|
49
|
+
if (marker) {
|
|
50
|
+
marker.setMap(null);
|
|
51
|
+
marker = void 0;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const addMarker = (lng, lat) => {
|
|
55
|
+
const AMap = window.AMap;
|
|
56
|
+
if (!AMap) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
clearMarker();
|
|
60
|
+
marker = new AMap.Marker({
|
|
61
|
+
position: [lng, lat]
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
const getAddress = (lng, lat) => {
|
|
65
|
+
const AMap = window.AMap;
|
|
66
|
+
if (!AMap) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
if (!marker) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const geocoder = new AMap.Geocoder({});
|
|
73
|
+
const currentMarker = marker;
|
|
74
|
+
geocoder.getAddress([lng, lat], (status, result) => {
|
|
75
|
+
if (!marker || marker !== currentMarker) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (status === "complete" && result.info === "OK" && result.regeocode) {
|
|
79
|
+
const regeocode = result.regeocode;
|
|
80
|
+
const address = regeocode.formattedAddress;
|
|
81
|
+
const markerContent = document.createElement("div");
|
|
82
|
+
const markerImg = document.createElement("img");
|
|
83
|
+
markerImg.style.width = "25px";
|
|
84
|
+
markerImg.src = "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png";
|
|
85
|
+
markerContent.appendChild(markerImg);
|
|
86
|
+
const markerText = document.createElement("span");
|
|
87
|
+
markerText.className = ns.b("popup-map-marker-text");
|
|
88
|
+
markerText.textContent = address;
|
|
89
|
+
markerContent.appendChild(markerText);
|
|
90
|
+
marker.setContent(markerContent);
|
|
91
|
+
marker.setMap(map);
|
|
92
|
+
addressInfo.address = address;
|
|
93
|
+
addressInfo.longitude = lng;
|
|
94
|
+
addressInfo.latitude = lat;
|
|
95
|
+
searchValue.value = address;
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
const loadMap = async () => {
|
|
100
|
+
try {
|
|
101
|
+
isLoading.value = true;
|
|
102
|
+
window._AMapSecurityConfig = {
|
|
103
|
+
securityJsCode: ibiz.env.aMapSecurityJsCode
|
|
104
|
+
};
|
|
105
|
+
await AMapLoader.load({
|
|
106
|
+
key: ibiz.env.aMapKey,
|
|
107
|
+
version: "2.0",
|
|
108
|
+
plugins: ["AMap.PlaceSearch", "AMap.Geocoder"],
|
|
109
|
+
AMapUI: {
|
|
110
|
+
version: "1.1",
|
|
111
|
+
plugins: ["misc/PoiPicker"]
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
} finally {
|
|
115
|
+
isLoading.value = false;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
const initMap = () => {
|
|
119
|
+
const AMap = window.AMap;
|
|
120
|
+
if (!AMap) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if (!mapContainerRef.value) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
map = new AMap.Map(mapContainerRef.value, {
|
|
127
|
+
viewMode: "3D",
|
|
128
|
+
zoom: 11
|
|
129
|
+
});
|
|
130
|
+
map == null ? void 0 : map.on("click", (e) => {
|
|
131
|
+
const lnglat = e.lnglat;
|
|
132
|
+
const lng = lnglat.lng;
|
|
133
|
+
const lat = lnglat.lat;
|
|
134
|
+
if (lng != null && lat != null) {
|
|
135
|
+
addMarker(lng, lat);
|
|
136
|
+
getAddress(lng, lat);
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
const AMapUI = window.AMapUI;
|
|
140
|
+
if (!AMapUI) {
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
if (!searchInputRef.value || !searchResultContainerRef.value) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
AMapUI.loadUI(["misc/PoiPicker"], function(PoiPicker) {
|
|
147
|
+
if (!searchInputRef.value || !searchResultContainerRef.value || !PoiPicker) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
poiPicker = new PoiPicker({
|
|
151
|
+
input: searchInputRef.value,
|
|
152
|
+
placeSearchOptions: {
|
|
153
|
+
map
|
|
154
|
+
},
|
|
155
|
+
searchResultsContainer: searchResultContainerRef.value
|
|
156
|
+
});
|
|
157
|
+
poiPicker == null ? void 0 : poiPicker.on("poiPicked", function(poiResult) {
|
|
158
|
+
var _a, _b;
|
|
159
|
+
clearMarker();
|
|
160
|
+
const item = poiResult.item;
|
|
161
|
+
if (item) {
|
|
162
|
+
addressInfo.address = item.name;
|
|
163
|
+
addressInfo.longitude = (_a = item.location) == null ? void 0 : _a.lng;
|
|
164
|
+
addressInfo.latitude = (_b = item.location) == null ? void 0 : _b.lat;
|
|
165
|
+
searchValue.value = item.name;
|
|
166
|
+
if (poiResult.source !== "search") {
|
|
167
|
+
poiPicker == null ? void 0 : poiPicker.searchByKeyword(item.name);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
const handleShow = () => {
|
|
174
|
+
var _a;
|
|
175
|
+
dialogVisible.value = true;
|
|
176
|
+
(_a = inputRef.value) == null ? void 0 : _a.blur();
|
|
177
|
+
nextTick(async () => {
|
|
178
|
+
var _a2;
|
|
179
|
+
if (!window.AMap) {
|
|
180
|
+
await loadMap();
|
|
181
|
+
}
|
|
182
|
+
if (!map || !((_a2 = mapContainerRef.value) == null ? void 0 : _a2.children.length)) {
|
|
183
|
+
map == null ? void 0 : map.destroy();
|
|
184
|
+
initMap();
|
|
185
|
+
}
|
|
186
|
+
searchValue.value = props.value || "";
|
|
187
|
+
if (props.data && longitudeName && latitudeName) {
|
|
188
|
+
const longitude = props.data[longitudeName];
|
|
189
|
+
const latitude = props.data[latitudeName];
|
|
190
|
+
if (longitude && latitude) {
|
|
191
|
+
map == null ? void 0 : map.setCenter([longitude, latitude], true);
|
|
192
|
+
addMarker(longitude, latitude);
|
|
193
|
+
getAddress(longitude, latitude);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
};
|
|
198
|
+
const handleConfirm = () => {
|
|
199
|
+
dialogVisible.value = false;
|
|
200
|
+
if (longitudeName) {
|
|
201
|
+
emit("change", addressInfo.longitude != null ? addressInfo.longitude : null, longitudeName);
|
|
202
|
+
}
|
|
203
|
+
if (latitudeName) {
|
|
204
|
+
emit("change", addressInfo.latitude != null ? addressInfo.latitude : null, latitudeName);
|
|
205
|
+
}
|
|
206
|
+
emit("change", addressInfo.address || "");
|
|
207
|
+
handleClose();
|
|
208
|
+
};
|
|
209
|
+
const handleClose = () => {
|
|
210
|
+
dialogVisible.value = false;
|
|
211
|
+
if (poiPicker) {
|
|
212
|
+
poiPicker.clearSuggest();
|
|
213
|
+
poiPicker.clearSearchResults();
|
|
214
|
+
}
|
|
215
|
+
searchValue.value = "";
|
|
216
|
+
addressInfo.address = "";
|
|
217
|
+
addressInfo.longitude = null;
|
|
218
|
+
addressInfo.latitude = null;
|
|
219
|
+
clearMarker();
|
|
220
|
+
};
|
|
221
|
+
const handleClear = (_e) => {
|
|
222
|
+
_e.stopPropagation();
|
|
223
|
+
if (longitudeName) {
|
|
224
|
+
emit("change", null, longitudeName);
|
|
225
|
+
}
|
|
226
|
+
if (latitudeName) {
|
|
227
|
+
emit("change", null, latitudeName);
|
|
228
|
+
}
|
|
229
|
+
emit("change", "");
|
|
230
|
+
handleClose();
|
|
231
|
+
};
|
|
232
|
+
const handleSearchClear = () => {
|
|
233
|
+
searchValue.value = "";
|
|
234
|
+
addressInfo.address = "";
|
|
235
|
+
addressInfo.longitude = null;
|
|
236
|
+
addressInfo.latitude = null;
|
|
237
|
+
clearMarker();
|
|
238
|
+
};
|
|
239
|
+
onUnmounted(() => {
|
|
240
|
+
map == null ? void 0 : map.destroy();
|
|
241
|
+
});
|
|
242
|
+
return {
|
|
243
|
+
ns,
|
|
244
|
+
c,
|
|
245
|
+
inputRef,
|
|
246
|
+
searchRef,
|
|
247
|
+
mapContainerRef,
|
|
248
|
+
searchResultContainerRef,
|
|
249
|
+
dialogVisible,
|
|
250
|
+
isLoading,
|
|
251
|
+
searchValue,
|
|
252
|
+
handleShow,
|
|
253
|
+
handleConfirm,
|
|
254
|
+
handleClose,
|
|
255
|
+
handleClear,
|
|
256
|
+
handleSearchClear
|
|
257
|
+
};
|
|
258
|
+
},
|
|
259
|
+
render() {
|
|
260
|
+
let content;
|
|
261
|
+
if (this.readonly) {
|
|
262
|
+
content = this.value;
|
|
263
|
+
} else {
|
|
264
|
+
content = [createVNode(resolveComponent("van-field"), {
|
|
265
|
+
"class": this.ns.b("input"),
|
|
266
|
+
"ref": "inputRef",
|
|
267
|
+
"modelValue": this.value,
|
|
268
|
+
"onUpdate:modelValue": ($event) => this.value = $event,
|
|
269
|
+
"readonly": true,
|
|
270
|
+
"placeholder": this.c.placeHolder,
|
|
271
|
+
"disabled": this.disabled,
|
|
272
|
+
"onClick": this.handleShow
|
|
273
|
+
}, {
|
|
274
|
+
button: () => {
|
|
275
|
+
if (this.readonly || !this.value)
|
|
276
|
+
return;
|
|
277
|
+
return createVNode(resolveComponent("van-button"), {
|
|
278
|
+
"icon": "clear",
|
|
279
|
+
"onClick": this.handleClear
|
|
280
|
+
}, null);
|
|
281
|
+
}
|
|
282
|
+
}), createVNode(resolveComponent("van-popup"), {
|
|
283
|
+
"class": this.ns.b("popup"),
|
|
284
|
+
"show": this.dialogVisible,
|
|
285
|
+
"onUpdate:show": ($event) => this.dialogVisible = $event,
|
|
286
|
+
"round": true,
|
|
287
|
+
"position": "bottom",
|
|
288
|
+
"teleport": "body",
|
|
289
|
+
"close-on-popstate": true
|
|
290
|
+
}, {
|
|
291
|
+
default: () => {
|
|
292
|
+
let _slot, _slot2;
|
|
293
|
+
return createVNode("div", {
|
|
294
|
+
"class": this.ns.b("popup-wrapper")
|
|
295
|
+
}, [createVNode("div", {
|
|
296
|
+
"class": this.ns.b("popup-wrapper-content")
|
|
297
|
+
}, [createVNode("div", {
|
|
298
|
+
"class": this.ns.b("popup-content-search")
|
|
299
|
+
}, [createVNode(resolveComponent("van-search"), {
|
|
300
|
+
"ref": "searchRef",
|
|
301
|
+
"modelValue": this.searchValue,
|
|
302
|
+
"onUpdate:modelValue": ($event) => this.searchValue = $event,
|
|
303
|
+
"placeholder": ibiz.i18n.t("editor.mapPicker.searchPlaceholder"),
|
|
304
|
+
"disabled": this.isLoading
|
|
305
|
+
}, null)]), withDirectives(createVNode("div", {
|
|
306
|
+
"class": this.ns.b("popup-map-content")
|
|
307
|
+
}, [createVNode("div", {
|
|
308
|
+
"class": this.ns.b("popup-map-container"),
|
|
309
|
+
"ref": "mapContainerRef"
|
|
310
|
+
}, null), createVNode("div", {
|
|
311
|
+
"class": this.ns.b("popup-search-result-container"),
|
|
312
|
+
"ref": "searchResultContainerRef"
|
|
313
|
+
}, null)]), [[resolveDirective("loading"), this.isLoading]])]), createVNode("div", {
|
|
314
|
+
"class": this.ns.b("popup-wrapper-footer")
|
|
315
|
+
}, [createVNode(resolveComponent("van-button"), {
|
|
316
|
+
"class": this.ns.b("popup-confirm"),
|
|
317
|
+
"onClick": this.handleClose
|
|
318
|
+
}, _isSlot(_slot = ibiz.i18n.t("editor.common.cancel")) ? _slot : {
|
|
319
|
+
default: () => [_slot]
|
|
320
|
+
}), createVNode(resolveComponent("van-button"), {
|
|
321
|
+
"class": this.ns.b("popup-footer-button"),
|
|
322
|
+
"type": "primary",
|
|
323
|
+
"disabled": this.isLoading,
|
|
324
|
+
"onClick": this.handleConfirm
|
|
325
|
+
}, _isSlot(_slot2 = ibiz.i18n.t("editor.common.confirm")) ? _slot2 : {
|
|
326
|
+
default: () => [_slot2]
|
|
327
|
+
})])]);
|
|
328
|
+
}
|
|
329
|
+
})];
|
|
330
|
+
}
|
|
331
|
+
return createVNode("div", {
|
|
332
|
+
"class": [this.ns.b(), this.disabled ? this.ns.m("disabled") : "", this.readonly ? this.ns.m("readonly") : ""]
|
|
333
|
+
}, [content]);
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
|
|
337
|
+
export { IBizMapPicker };
|