zjh-web-ui 1.0.10
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/README.md +1 -0
- package/config/resolver.js +21 -0
- package/dist/_virtual/_plugin-vue_export-helper.js +9 -0
- package/dist/components/AMapConfig.js +23 -0
- package/dist/components/HuiAMapMassMarkers/HuiAMapMassMarkers.vue.js +82 -0
- package/dist/components/HuiAMapMassMarkers/HuiAMapMassMarkers.vue2.js +4 -0
- package/dist/components/HuiAMapMassMarkers/index.js +7 -0
- package/dist/components/HuiAMapSearchAddress/HuiAMapSearchAddress.vue.js +7 -0
- package/dist/components/HuiAMapSearchAddress/HuiAMapSearchAddress.vue2.js +190 -0
- package/dist/components/HuiAMapSearchAddress/index.js +7 -0
- package/dist/components/HuiAMapSearchAddressDialog/HuiAMapSearchAddressDialog.vue.js +83 -0
- package/dist/components/HuiAMapSearchAddressDialog/HuiAMapSearchAddressDialog.vue2.js +4 -0
- package/dist/components/HuiAMapSearchAddressDialog/index.js +7 -0
- package/dist/components/HuiAMapSelectAddress/HuiAMapSelectAddress.vue.js +7 -0
- package/dist/components/HuiAMapSelectAddress/HuiAMapSelectAddress.vue2.js +178 -0
- package/dist/components/HuiAMapSelectAddress/index.js +7 -0
- package/dist/components/HuiAMapSelectAddressDialog/HuiAMapSelectAddressDialog.vue.js +83 -0
- package/dist/components/HuiAMapSelectAddressDialog/HuiAMapSelectAddressDialog.vue2.js +4 -0
- package/dist/components/HuiAMapSelectAddressDialog/index.js +7 -0
- package/dist/components/HuiCountDownButton/HuiCountDownButton.vue.js +63 -0
- package/dist/components/HuiCountDownButton/HuiCountDownButton.vue2.js +4 -0
- package/dist/components/HuiCountDownButton/index.js +7 -0
- package/dist/components/HuiDataView/HuiDataView.vue.js +7 -0
- package/dist/components/HuiDataView/HuiDataView.vue2.js +84 -0
- package/dist/components/HuiDataView/index.js +7 -0
- package/dist/components/HuiGridForm/HuiGridForm.vue.js +7 -0
- package/dist/components/HuiGridForm/HuiGridForm.vue2.js +223 -0
- package/dist/components/HuiGridForm/HuiGridFormHooks.js +21 -0
- package/dist/components/HuiGridForm/index.js +7 -0
- package/dist/components/HuiLineEditDialog/HuiLineEditDialog.vue.js +7 -0
- package/dist/components/HuiLineEditDialog/HuiLineEditDialog.vue2.js +167 -0
- package/dist/components/HuiLineEditDialog/index.js +7 -0
- package/dist/components/HuiLineEditPopover/HuiLineEditPopover.vue.js +7 -0
- package/dist/components/HuiLineEditPopover/HuiLineEditPopover.vue2.js +128 -0
- package/dist/components/HuiLineEditPopover/index.js +7 -0
- package/dist/components/HuiPreviewRichTextDialog/HuiPreviewRichTextDialog.vue.js +65 -0
- package/dist/components/HuiPreviewRichTextDialog/HuiPreviewRichTextDialog.vue2.js +4 -0
- package/dist/components/HuiPreviewRichTextDialog/index.js +7 -0
- package/dist/components/HuiRegionTreeDialog/HuiRegionTreeDialog.vue.js +118 -0
- package/dist/components/HuiRegionTreeDialog/HuiRegionTreeDialog.vue2.js +4 -0
- package/dist/components/HuiRegionTreeDialog/index.js +7 -0
- package/dist/components/HuiRegionTreeSelect/HuiRegionTreeSelect.vue.js +7 -0
- package/dist/components/HuiRegionTreeSelect/HuiRegionTreeSelect.vue2.js +59 -0
- package/dist/components/HuiRegionTreeSelect/index.js +7 -0
- package/dist/components/HuiSelectLoadStatus/HuiSelectLoadStatus.vue.js +44 -0
- package/dist/components/HuiSelectLoadStatus/HuiSelectLoadStatus.vue2.js +4 -0
- package/dist/components/HuiSelectLoadStatus/index.js +7 -0
- package/dist/components/HuiShowUrlDialog/HuiShowUrlDialog.vue.js +50 -0
- package/dist/components/HuiShowUrlDialog/HuiShowUrlDialog.vue2.js +4 -0
- package/dist/components/HuiShowUrlDialog/index.js +7 -0
- package/dist/components/HuiStringArrayInputDialog/HuiStringArrayInputDialog.vue.js +118 -0
- package/dist/components/HuiStringArrayInputDialog/HuiStringArrayInputDialog.vue2.js +4 -0
- package/dist/components/HuiStringArrayInputDialog/index.js +7 -0
- package/dist/components/HuiTags/HuiTags.vue.js +7 -0
- package/dist/components/HuiTags/HuiTags.vue2.js +28 -0
- package/dist/components/HuiTags/index.js +7 -0
- package/dist/components/HuiTagsMore/HuiTagsMore.vue.js +188 -0
- package/dist/components/HuiTagsMore/HuiTagsMore.vue2.js +4 -0
- package/dist/components/HuiTagsMore/index.js +7 -0
- package/dist/components/HuiTinymce/HuiTinymce.vue.js +37 -0
- package/dist/components/HuiTinymce/HuiTinymce.vue3.js +5 -0
- package/dist/components/HuiTinymce/HuiTinymceLinkHooks.js +99 -0
- package/dist/components/HuiTinymce/HuiTinymceSettingHooks.js +104 -0
- package/dist/components/HuiTinymce/index.js +8 -0
- package/dist/components/HuiTinymceDialog/HuiTinymceDialog.vue.js +96 -0
- package/dist/components/HuiTinymceDialog/HuiTinymceDialog.vue2.js +4 -0
- package/dist/components/HuiTinymceDialog/index.js +7 -0
- package/dist/components/HuiTip/HuiTip.vue.js +52 -0
- package/dist/components/HuiTip/HuiTip.vue2.js +4 -0
- package/dist/components/HuiTip/index.js +7 -0
- package/dist/components-install-list.js +47 -0
- package/dist/delegate.js +13 -0
- package/dist/directives/install-loadmore.js +7 -0
- package/dist/directives/select-loadmore.js +25 -0
- package/dist/hooks/useHuiDialog/useHuiDialog.js +20 -0
- package/dist/hooks/useHuiFormDialog/formDialogPropsDef.js +6 -0
- package/dist/hooks/useHuiFormDialog/useHuiFormDialog.js +109 -0
- package/dist/index.js +62 -0
- package/dist/install-helper/install.js +21 -0
- package/dist/style.css +1 -0
- package/dist/utils/hui-rules.js +142 -0
- package/dist/utils/hui-tool/index.js +7 -0
- package/dist/utils/hui-tool/message-box/index.js +33 -0
- package/dist/utils/hui-tool/message-box/message-box.vue.js +112 -0
- package/dist/utils/hui-tool/message-box/message-box.vue3.js +5 -0
- package/dist/utils/hui-tool/msg-tool.js +39 -0
- package/global.d.ts +40 -0
- package/package.json +44 -0
- package/src/css/common-font.scss +104 -0
- package/src/css/index.scss +1 -0
- package/types/components/AMapConfig.d.ts +2 -0
- package/types/components/HuiAMapMassMarkers/HuiAMapMassMarkers.vue.d.ts +105 -0
- package/types/components/HuiAMapMassMarkers/index.d.ts +107 -0
- package/types/components/HuiAMapMassMarkers/type.d.ts +58 -0
- package/types/components/HuiAMapSearchAddress/HuiAMapSearchAddress.vue.d.ts +76 -0
- package/types/components/HuiAMapSearchAddress/index.d.ts +77 -0
- package/types/components/HuiAMapSearchAddress/type.d.ts +19 -0
- package/types/components/HuiAMapSearchAddressDialog/HuiAMapSearchAddressDialog.vue.d.ts +38 -0
- package/types/components/HuiAMapSearchAddressDialog/index.d.ts +71 -0
- package/types/components/HuiAMapSearchAddressDialog/type.d.ts +17 -0
- package/types/components/HuiAMapSelectAddress/HuiAMapSelectAddress.vue.d.ts +76 -0
- package/types/components/HuiAMapSelectAddress/index.d.ts +77 -0
- package/types/components/HuiAMapSelectAddress/type.d.ts +19 -0
- package/types/components/HuiAMapSelectAddressDialog/HuiAMapSelectAddressDialog.vue.d.ts +38 -0
- package/types/components/HuiAMapSelectAddressDialog/index.d.ts +71 -0
- package/types/components/HuiAMapSelectAddressDialog/type.d.ts +17 -0
- package/types/components/HuiCountDownButton/HuiCountDownButton.vue.d.ts +44 -0
- package/types/components/HuiCountDownButton/index.d.ts +76 -0
- package/types/components/HuiCountDownButton/type.d.ts +20 -0
- package/types/components/HuiDataView/HuiDataView.vue.d.ts +60 -0
- package/types/components/HuiDataView/index.d.ts +109 -0
- package/types/components/HuiDataView/type.d.ts +49 -0
- package/types/components/HuiGridForm/HuiGridForm.vue.d.ts +77 -0
- package/types/components/HuiGridForm/HuiGridFormHooks.d.ts +4 -0
- package/types/components/HuiGridForm/index.d.ts +175 -0
- package/types/components/HuiGridForm/type.d.ts +67 -0
- package/types/components/HuiLineEditDialog/HuiLineEditDialog.vue.d.ts +75 -0
- package/types/components/HuiLineEditDialog/index.d.ts +173 -0
- package/types/components/HuiLineEditDialog/type.d.ts +86 -0
- package/types/components/HuiLineEditPopover/HuiLineEditPopover.vue.d.ts +74 -0
- package/types/components/HuiLineEditPopover/index.d.ts +133 -0
- package/types/components/HuiLineEditPopover/type.d.ts +23 -0
- package/types/components/HuiPreviewRichTextDialog/HuiPreviewRichTextDialog.vue.d.ts +31 -0
- package/types/components/HuiPreviewRichTextDialog/index.d.ts +22 -0
- package/types/components/HuiPreviewRichTextDialog/type.d.ts +4 -0
- package/types/components/HuiRegionTreeDialog/HuiRegionTreeDialog.vue.d.ts +53 -0
- package/types/components/HuiRegionTreeDialog/index.d.ts +68 -0
- package/types/components/HuiRegionTreeDialog/type.d.ts +24 -0
- package/types/components/HuiRegionTreeSelect/HuiRegionTreeSelect.vue.d.ts +25 -0
- package/types/components/HuiRegionTreeSelect/index.d.ts +29 -0
- package/types/components/HuiRegionTreeSelect/type.d.ts +6 -0
- package/types/components/HuiSelectLoadStatus/HuiSelectLoadStatus.vue.d.ts +14 -0
- package/types/components/HuiSelectLoadStatus/index.d.ts +33 -0
- package/types/components/HuiSelectLoadStatus/type.d.ts +11 -0
- package/types/components/HuiShowUrlDialog/HuiShowUrlDialog.vue.d.ts +37 -0
- package/types/components/HuiShowUrlDialog/index.d.ts +40 -0
- package/types/components/HuiShowUrlDialog/type.d.ts +11 -0
- package/types/components/HuiStringArrayInputDialog/HuiStringArrayInputDialog.vue.d.ts +44 -0
- package/types/components/HuiStringArrayInputDialog/index.d.ts +67 -0
- package/types/components/HuiStringArrayInputDialog/type.d.ts +33 -0
- package/types/components/HuiTags/HuiTags.vue.d.ts +37 -0
- package/types/components/HuiTags/index.d.ts +36 -0
- package/types/components/HuiTagsMore/HuiTagsMore.vue.d.ts +93 -0
- package/types/components/HuiTagsMore/index.d.ts +92 -0
- package/types/components/HuiTinymce/HuiTinymce.vue.d.ts +62 -0
- package/types/components/HuiTinymce/HuiTinymceLinkHooks.d.ts +3 -0
- package/types/components/HuiTinymce/HuiTinymceSettingHooks.d.ts +3 -0
- package/types/components/HuiTinymce/index.d.ts +66 -0
- package/types/components/HuiTinymce/type.d.ts +51 -0
- package/types/components/HuiTinymceDialog/HuiTinymceDialog.vue.d.ts +53 -0
- package/types/components/HuiTinymceDialog/index.d.ts +78 -0
- package/types/components/HuiTinymceDialog/type.d.ts +12 -0
- package/types/components/HuiTip/HuiTip.vue.d.ts +22 -0
- package/types/components/HuiTip/index.d.ts +99 -0
- package/types/components/HuiTip/type.d.ts +14 -0
- package/types/components-install-list.d.ts +3328 -0
- package/types/components.d.ts +21 -0
- package/types/delegate.d.ts +41 -0
- package/types/directives/index.d.ts +4 -0
- package/types/directives/install-loadmore.d.ts +7 -0
- package/types/directives/select-loadmore.d.ts +7 -0
- package/types/hooks/index.d.ts +3 -0
- package/types/hooks/useHuiDialog/useHuiDialog.d.ts +18 -0
- package/types/hooks/useHuiFormDialog/formDialogPropsDef.d.ts +3 -0
- package/types/hooks/useHuiFormDialog/type.d.ts +90 -0
- package/types/hooks/useHuiFormDialog/useHuiFormDialog.d.ts +32 -0
- package/types/index.d.ts +13 -0
- package/types/install-helper/install.d.ts +18 -0
- package/types/install-helper/typescript.d.ts +14 -0
- package/types/utils/hui-rules.d.ts +80 -0
- package/types/utils/hui-tool/index.d.ts +8 -0
- package/types/utils/hui-tool/message-box/index.d.ts +18 -0
- package/types/utils/hui-tool/message-box/message-box.vue.d.ts +36 -0
- package/types/utils/hui-tool/msg-tool.d.ts +26 -0
- package/types/utils/index.d.ts +2 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# [文档说明](http://192.168.31.5/front-end/hua5-web-ui/)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
function getHuiResolved(name) {
|
|
3
|
+
return {
|
|
4
|
+
name,
|
|
5
|
+
from: '@hua5/hua5-web-ui',
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export const HuiResolver = () => {
|
|
10
|
+
return {
|
|
11
|
+
type: 'component',
|
|
12
|
+
resolve: (name) => {
|
|
13
|
+
if (name.startsWith('Hui')) {
|
|
14
|
+
return getHuiResolved(name)
|
|
15
|
+
}
|
|
16
|
+
if (name.startsWith('useHui')) {
|
|
17
|
+
return getHuiResolved(name)
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const o = function() {
|
|
2
|
+
c(), window._AMapSecurityConfig = {
|
|
3
|
+
serviceHost: window.huiDelegate.amapConfig.serviceHost
|
|
4
|
+
};
|
|
5
|
+
const n = window.huiDelegate.amapConfig.key;
|
|
6
|
+
return new Promise((a) => {
|
|
7
|
+
const e = document.createElement("script");
|
|
8
|
+
e.type = "text/javascript", e.src = `https://webapi.amap.com/maps?v=2.0&key=${n}&plugin=AMap.PlaceSearch`, e.onload = function() {
|
|
9
|
+
const t = document.createElement("script");
|
|
10
|
+
t.type = "text/javascript", t.src = "https://webapi.amap.com/ui/1.1/main.js", document.head.appendChild(t), t.onload = function() {
|
|
11
|
+
a("");
|
|
12
|
+
};
|
|
13
|
+
}, document.head.appendChild(e);
|
|
14
|
+
});
|
|
15
|
+
}, c = function(n = "webapi") {
|
|
16
|
+
document.querySelectorAll("script").forEach((e) => {
|
|
17
|
+
e.src.includes(n) && e.parentNode.removeChild(e);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
o as addAMap,
|
|
22
|
+
c as removeAMap
|
|
23
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { defineComponent as h, mergeModels as d, ref as w, useModel as M, onMounted as k, openBlock as v, createElementBlock as y, normalizeStyle as b, nextTick as g } from "vue";
|
|
2
|
+
import { testUtils as s } from "@hua5/hua5-utils";
|
|
3
|
+
import { addAMap as C } from "../AMapConfig.js";
|
|
4
|
+
const x = /* @__PURE__ */ h({
|
|
5
|
+
name: "HuiAMapMassMarkers",
|
|
6
|
+
__name: "HuiAMapMassMarkers",
|
|
7
|
+
props: /* @__PURE__ */ d({
|
|
8
|
+
value: {},
|
|
9
|
+
width: { default: "40vw" },
|
|
10
|
+
height: { default: "60vh" },
|
|
11
|
+
showLabel: { type: Boolean, default: !0 },
|
|
12
|
+
direction: { default: "top" },
|
|
13
|
+
textStyle: { default: () => ({
|
|
14
|
+
fontSize: 12,
|
|
15
|
+
fillColor: window.theme.colors.white,
|
|
16
|
+
backgroundColor: window.theme.colors.ccc,
|
|
17
|
+
borderRadius: 2
|
|
18
|
+
}) },
|
|
19
|
+
iconPath: { default: "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png" },
|
|
20
|
+
iconSize: { default: () => [19, 32] },
|
|
21
|
+
mapCenter: { default: () => [102.832891, 24.880095] }
|
|
22
|
+
}, {
|
|
23
|
+
modelValue: {},
|
|
24
|
+
modelModifiers: {}
|
|
25
|
+
}),
|
|
26
|
+
emits: /* @__PURE__ */ d(["pointClick"], ["update:modelValue"]),
|
|
27
|
+
setup(i, { expose: c, emit: m }) {
|
|
28
|
+
const u = m, a = i, n = w(null), t = M(i, "modelValue");
|
|
29
|
+
function l(e, o) {
|
|
30
|
+
u("pointClick", o);
|
|
31
|
+
}
|
|
32
|
+
function p() {
|
|
33
|
+
g(() => {
|
|
34
|
+
n.value = new window.AMap.Map("mapContainer", {
|
|
35
|
+
zoom: 10,
|
|
36
|
+
viewMode: "3D",
|
|
37
|
+
center: t.value.length ? t.value[0].position : a.mapCenter,
|
|
38
|
+
showLabel: a.showLabel
|
|
39
|
+
});
|
|
40
|
+
const e = new window.AMap.LabelsLayer({
|
|
41
|
+
zooms: [3, 20],
|
|
42
|
+
// 缩放范围
|
|
43
|
+
zIndex: 1e3,
|
|
44
|
+
// 图层层级
|
|
45
|
+
collision: !1
|
|
46
|
+
// 该层内标注是否避让
|
|
47
|
+
});
|
|
48
|
+
n.value.add(e), s.isArray(t.value) && s.isNotEmpty(t.value) && t.value.forEach((o) => {
|
|
49
|
+
const r = new window.AMap.LabelMarker({
|
|
50
|
+
position: o.position,
|
|
51
|
+
text: {
|
|
52
|
+
content: o.name,
|
|
53
|
+
direction: a.direction,
|
|
54
|
+
style: {
|
|
55
|
+
...a.textStyle
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
icon: {
|
|
59
|
+
type: "iamge",
|
|
60
|
+
image: o.iconPath || a.iconPath,
|
|
61
|
+
size: a.iconSize
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
e.add(r), r.on("click", (f) => l(f, o));
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
return k(async () => {
|
|
69
|
+
try {
|
|
70
|
+
await C(), p();
|
|
71
|
+
} catch (e) {
|
|
72
|
+
console.error("Error loading map:", e);
|
|
73
|
+
}
|
|
74
|
+
}), c({ handleLabelMarkerClick: l }), (e, o) => (v(), y("div", {
|
|
75
|
+
id: "mapContainer",
|
|
76
|
+
style: b({ height: e.height, width: e.width })
|
|
77
|
+
}, null, 4));
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
export {
|
|
81
|
+
x as default
|
|
82
|
+
};
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import { defineComponent as J, mergeModels as Q, ref as s, useModel as W, onMounted as X, nextTick as x, watch as N, reactive as Y, computed as $, openBlock as h, createElementBlock as P, createElementVNode as i, createVNode as ee, unref as g, withDirectives as ae, createBlock as H, withCtx as z, Fragment as te, renderList as le, toDisplayString as D, normalizeStyle as oe } from "vue";
|
|
2
|
+
import { addAMap as ne } from "../AMapConfig.js";
|
|
3
|
+
import { testUtils as d } from "@hua5/hua5-utils";
|
|
4
|
+
import { HuiTool as se } from "../../utils/hui-tool/index.js";
|
|
5
|
+
import { selectLoadmore as ie } from "../../directives/select-loadmore.js";
|
|
6
|
+
import { ElCascader as re, ElSelect as de, ElOption as ue } from "element-plus";
|
|
7
|
+
const ce = { class: "AMap" }, pe = { class: "flex h-32 lh-32 mb-20" }, me = { class: "flex h-32 lh-32 mb-20" }, ve = { class: "flex justify-between text-14" }, fe = { class: "c-regular" }, he = { class: "c-disabled" }, ge = ["id"], xe = /* @__PURE__ */ J({
|
|
8
|
+
name: "HuiAMapSearchAddress",
|
|
9
|
+
__name: "HuiAMapSearchAddress",
|
|
10
|
+
props: /* @__PURE__ */ Q({
|
|
11
|
+
disabled: { type: Boolean, default: !1 },
|
|
12
|
+
value: {},
|
|
13
|
+
width: { default: "100%" },
|
|
14
|
+
height: { default: "490px" },
|
|
15
|
+
showInput: { type: Boolean, default: !1 },
|
|
16
|
+
iconPath: { default: "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png" },
|
|
17
|
+
iconClass: { default: "w-19 h-32 rel" }
|
|
18
|
+
}, {
|
|
19
|
+
modelValue: {},
|
|
20
|
+
modelModifiers: {}
|
|
21
|
+
}),
|
|
22
|
+
emits: ["update:modelValue"],
|
|
23
|
+
setup(b, { expose: K }) {
|
|
24
|
+
const C = b, O = s(""), u = s(null), c = s(null), t = W(b, "modelValue"), m = s(""), r = s([]), E = s([]), p = s([]), w = s(""), S = s(F(2));
|
|
25
|
+
X(async () => {
|
|
26
|
+
E.value = await window.huiDelegate.getRegionTree(), V();
|
|
27
|
+
});
|
|
28
|
+
function V() {
|
|
29
|
+
ne().then(() => {
|
|
30
|
+
L();
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function L() {
|
|
34
|
+
x(() => {
|
|
35
|
+
R(() => {
|
|
36
|
+
var l, e, a, o;
|
|
37
|
+
if (d.isNotEmpty(t.value)) {
|
|
38
|
+
const { provinceName: n, cityName: _, districtName: f, street: k, streetShort: q } = t.value;
|
|
39
|
+
r.value = [{ ...t.value, pname: n, cityname: _, adname: f, address: q, name: k }], m.value = t.value.id, p.value = t.value.regionCode;
|
|
40
|
+
}
|
|
41
|
+
(l = t.value) != null && l.longitude && ((e = t.value) != null && e.latitude) && (y(t.value.longitude, t.value.latitude), A(t.value.longitude, t.value.latitude)), (a = t.value) != null && a.lon && ((o = t.value) != null && o.lat) && (y(t.value.lon, t.value.lat), A(t.value.lon, t.value.lat));
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function R(l) {
|
|
46
|
+
c.value = new window.AMap.Map(S.value, {
|
|
47
|
+
zoom: d.isNotEmpty(t.value) ? 23 : 13,
|
|
48
|
+
center: (() => {
|
|
49
|
+
var e, a, o, n;
|
|
50
|
+
if ((e = t.value) != null && e.longitude && ((a = t.value) != null && a.latitude))
|
|
51
|
+
return [t.value.longitude, t.value.latitude];
|
|
52
|
+
if ((o = t.value) != null && o.lon && ((n = t.value) != null && n.lat))
|
|
53
|
+
return [t.value.lon, t.value.lat];
|
|
54
|
+
})()
|
|
55
|
+
}), c.value.setMapStyle('amap://styles/f695f9484e6fb466b6680b7806a5eae6")'), l();
|
|
56
|
+
}
|
|
57
|
+
N(p, (l) => {
|
|
58
|
+
d.isArray(l) ? w.value = l[l.length - 1] : w.value = l;
|
|
59
|
+
}), N(t, (l) => {
|
|
60
|
+
O.value = l.formattedAddress;
|
|
61
|
+
}, { deep: !0 });
|
|
62
|
+
const M = Y({
|
|
63
|
+
city: $(() => w.value),
|
|
64
|
+
citylimit: !1,
|
|
65
|
+
pageSize: 20,
|
|
66
|
+
pageIndex: 1,
|
|
67
|
+
extensions: "all"
|
|
68
|
+
}), I = s(0), v = s("");
|
|
69
|
+
N(v, () => {
|
|
70
|
+
r.value = [], M.pageIndex = 1;
|
|
71
|
+
});
|
|
72
|
+
function U(l) {
|
|
73
|
+
const e = r.value.find((n) => n.id == l) || {};
|
|
74
|
+
t.value = e, p.value = e.adcode;
|
|
75
|
+
const a = e.location.KT || e.location.lat, o = e.location.KL || e.location.lng;
|
|
76
|
+
B(), y(o, a), A(o, a), c.value.setCenter([o, a]), c.value.setZoom(18);
|
|
77
|
+
}
|
|
78
|
+
function T(l) {
|
|
79
|
+
d.isEmpty(l) || (v.value = l, window.AMap.plugin("AMap.PlaceSearch", async function() {
|
|
80
|
+
await x();
|
|
81
|
+
var e = new window.AMap.PlaceSearch(M);
|
|
82
|
+
e.search(v.value, function(a, o) {
|
|
83
|
+
d.isEmpty(o) || d.isEmpty(o.poiList.pois) || (o.poiList.pois.forEach((n) => {
|
|
84
|
+
n.provinceName = n.pname, n.cityName = n.cityname, n.districtName = n.adname, n.street = n.address, n.streetShort = n.name, n.addressName = n.name;
|
|
85
|
+
}), I.value = o.poiList.count, r.value.push(...o.poiList.pois));
|
|
86
|
+
});
|
|
87
|
+
}));
|
|
88
|
+
}
|
|
89
|
+
function j() {
|
|
90
|
+
r.value.length >= I.value || (M.pageIndex++, T(v.value));
|
|
91
|
+
}
|
|
92
|
+
function y(l, e) {
|
|
93
|
+
B(), u.value = new window.AMap.Marker({
|
|
94
|
+
position: [l, e],
|
|
95
|
+
map: c.value
|
|
96
|
+
}), u.value.setMap(c.value);
|
|
97
|
+
}
|
|
98
|
+
function B() {
|
|
99
|
+
u.value && (u.value.setMap(null), u.value = null);
|
|
100
|
+
}
|
|
101
|
+
function G(l) {
|
|
102
|
+
const e = document.createElement("div"), a = document.createElement("img");
|
|
103
|
+
if (a.className = C.iconClass, a.src = C.iconPath, e.appendChild(a), !l) return;
|
|
104
|
+
const o = document.createElement("span");
|
|
105
|
+
o.className = "AMap__marker top-0 abs", o.innerHTML = l, e.appendChild(o), u.value.setContent(e);
|
|
106
|
+
}
|
|
107
|
+
function A(l, e) {
|
|
108
|
+
window.AMap.plugin("AMap.Geocoder", function() {
|
|
109
|
+
new window.AMap.Geocoder().getAddress([l, e], (o, n) => {
|
|
110
|
+
o === "complete" && n.info === "OK" ? x(() => {
|
|
111
|
+
var f;
|
|
112
|
+
const _ = ((f = r.value.find((k) => k.id == m.value)) == null ? void 0 : f.name) || "";
|
|
113
|
+
G(_);
|
|
114
|
+
}) : console.error("获取地址失败", n);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
function F(l) {
|
|
119
|
+
const e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
120
|
+
let a = "";
|
|
121
|
+
for (let o = 0; o < l; o++)
|
|
122
|
+
a += e.charAt(Math.floor(Math.random() * e.length));
|
|
123
|
+
return "map__container" + a;
|
|
124
|
+
}
|
|
125
|
+
function Z() {
|
|
126
|
+
return d.isNotEmpty(t.value) ? !0 : (se.err("请选择地址"), !1);
|
|
127
|
+
}
|
|
128
|
+
return K({ loadMap: V, setupMap: L, poi: t, submitInfo: Z }), (l, e) => (h(), P("div", ce, [
|
|
129
|
+
i("div", pe, [
|
|
130
|
+
e[2] || (e[2] = i("div", { class: "w-100 text-center" }, "地区", -1)),
|
|
131
|
+
ee(g(re), {
|
|
132
|
+
modelValue: p.value,
|
|
133
|
+
"onUpdate:modelValue": e[0] || (e[0] = (a) => p.value = a),
|
|
134
|
+
class: "w-full",
|
|
135
|
+
separator: "-",
|
|
136
|
+
options: E.value,
|
|
137
|
+
placeholder: "选择地区"
|
|
138
|
+
}, null, 8, ["modelValue", "options"])
|
|
139
|
+
]),
|
|
140
|
+
i("div", me, [
|
|
141
|
+
e[3] || (e[3] = i("div", { class: "w-100 text-center" }, "位置名称", -1)),
|
|
142
|
+
ae((h(), H(g(de), {
|
|
143
|
+
modelValue: m.value,
|
|
144
|
+
"onUpdate:modelValue": e[1] || (e[1] = (a) => m.value = a),
|
|
145
|
+
class: "loadmore",
|
|
146
|
+
filterable: "",
|
|
147
|
+
remote: "",
|
|
148
|
+
teleported: !1,
|
|
149
|
+
"reserve-keyword": "",
|
|
150
|
+
placeholder: "小区名 / 店铺 / 写字楼 / 街道名称",
|
|
151
|
+
"remote-method": T,
|
|
152
|
+
"no-data-text": "暂时查询不到数据",
|
|
153
|
+
onChange: U
|
|
154
|
+
}, {
|
|
155
|
+
default: z(() => [
|
|
156
|
+
(h(!0), P(te, null, le(r.value, (a) => (h(), H(g(ue), {
|
|
157
|
+
key: a.id,
|
|
158
|
+
label: a.addressName,
|
|
159
|
+
value: a.id
|
|
160
|
+
}, {
|
|
161
|
+
default: z(() => [
|
|
162
|
+
i("div", ve, [
|
|
163
|
+
i("div", fe, D(a.addressName), 1),
|
|
164
|
+
i("div", he, D(a.pname + a.cityname + a.adname + a.address), 1)
|
|
165
|
+
])
|
|
166
|
+
]),
|
|
167
|
+
_: 2
|
|
168
|
+
}, 1032, ["label", "value"]))), 128))
|
|
169
|
+
]),
|
|
170
|
+
_: 1
|
|
171
|
+
}, 8, ["modelValue"])), [
|
|
172
|
+
[g(ie), { className: "loadmore", callback: j }]
|
|
173
|
+
])
|
|
174
|
+
]),
|
|
175
|
+
i("div", {
|
|
176
|
+
class: "AMap__content-box",
|
|
177
|
+
style: oe({ height: l.height })
|
|
178
|
+
}, [
|
|
179
|
+
i("div", {
|
|
180
|
+
id: S.value,
|
|
181
|
+
class: "AMap__content-container",
|
|
182
|
+
tabindex: "0"
|
|
183
|
+
}, null, 8, ge)
|
|
184
|
+
], 4)
|
|
185
|
+
]));
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
export {
|
|
189
|
+
xe as default
|
|
190
|
+
};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { defineComponent as V, ref as d, openBlock as C, createBlock as S, unref as o, isRef as k, withCtx as a, createVNode as s, createTextVNode as p, mergeProps as H, toValue as M } from "vue";
|
|
2
|
+
import { useHuiDialog as B } from "../../hooks/useHuiDialog/useHuiDialog.js";
|
|
3
|
+
import { ElDialog as D, ElButton as m } from "element-plus";
|
|
4
|
+
import "@hua5/hua5-utils";
|
|
5
|
+
/* empty css */
|
|
6
|
+
import x from "../HuiAMapSearchAddress/HuiAMapSearchAddress.vue.js";
|
|
7
|
+
const L = /* @__PURE__ */ V({
|
|
8
|
+
name: "HuiAMapSearchAddressDialog",
|
|
9
|
+
__name: "HuiAMapSearchAddressDialog",
|
|
10
|
+
props: {
|
|
11
|
+
disabled: { type: Boolean },
|
|
12
|
+
value: {},
|
|
13
|
+
width: { default: "800px" },
|
|
14
|
+
height: {},
|
|
15
|
+
showInput: { type: Boolean },
|
|
16
|
+
iconPath: {},
|
|
17
|
+
iconClass: {},
|
|
18
|
+
title: { default: "地图位置选择" }
|
|
19
|
+
},
|
|
20
|
+
emits: ["onSubmit"],
|
|
21
|
+
setup(R, { expose: f, emit: c }) {
|
|
22
|
+
const y = c, n = d(null), { show: i, open: h, close: u, payload: v, confirmLoading: w } = B(), t = d(null);
|
|
23
|
+
async function A() {
|
|
24
|
+
n.value.loadMap(), t.value = M(v) || "";
|
|
25
|
+
}
|
|
26
|
+
function b() {
|
|
27
|
+
t.value = "";
|
|
28
|
+
}
|
|
29
|
+
function g() {
|
|
30
|
+
n.value.submitInfo() && (y("onSubmit", t.value), u());
|
|
31
|
+
}
|
|
32
|
+
return f({
|
|
33
|
+
open: h,
|
|
34
|
+
close: u
|
|
35
|
+
}), (l, e) => (C(), S(o(D), {
|
|
36
|
+
modelValue: o(i),
|
|
37
|
+
"onUpdate:modelValue": e[1] || (e[1] = (r) => k(i) ? i.value = r : null),
|
|
38
|
+
title: l.title,
|
|
39
|
+
width: l.width,
|
|
40
|
+
top: "5vh",
|
|
41
|
+
"modal-append-to-body": !1,
|
|
42
|
+
"append-to-body": "",
|
|
43
|
+
"destroy-on-close": "",
|
|
44
|
+
onOpen: A,
|
|
45
|
+
onClose: b
|
|
46
|
+
}, {
|
|
47
|
+
footer: a(() => [
|
|
48
|
+
s(o(m), { onClick: o(u) }, {
|
|
49
|
+
default: a(() => e[2] || (e[2] = [
|
|
50
|
+
p("取 消")
|
|
51
|
+
])),
|
|
52
|
+
_: 1
|
|
53
|
+
}, 8, ["onClick"]),
|
|
54
|
+
s(o(m), {
|
|
55
|
+
type: "primary",
|
|
56
|
+
class: "w-100",
|
|
57
|
+
loading: o(w),
|
|
58
|
+
onClick: g
|
|
59
|
+
}, {
|
|
60
|
+
default: a(() => e[3] || (e[3] = [
|
|
61
|
+
p("确定")
|
|
62
|
+
])),
|
|
63
|
+
_: 1
|
|
64
|
+
}, 8, ["loading"])
|
|
65
|
+
]),
|
|
66
|
+
default: a(() => [
|
|
67
|
+
s(x, H(l.$props, {
|
|
68
|
+
ref_key: "HuiAMapSelectAddressRef",
|
|
69
|
+
ref: n,
|
|
70
|
+
modelValue: t.value,
|
|
71
|
+
"onUpdate:modelValue": e[0] || (e[0] = (r) => t.value = r),
|
|
72
|
+
class: "m-y-20",
|
|
73
|
+
"show-input": !0,
|
|
74
|
+
width: "100%"
|
|
75
|
+
}), null, 16, ["modelValue"])
|
|
76
|
+
]),
|
|
77
|
+
_: 1
|
|
78
|
+
}, 8, ["modelValue", "title", "width"]));
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
export {
|
|
82
|
+
L as default
|
|
83
|
+
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { defineComponent as z, mergeModels as L, ref as s, useModel as O, watch as U, onMounted as j, openBlock as m, createElementBlock as _, normalizeStyle as f, createBlock as x, unref as R, createCommentVNode as y, createElementVNode as v, normalizeClass as D, nextTick as h } from "vue";
|
|
2
|
+
import { addAMap as G } from "../AMapConfig.js";
|
|
3
|
+
import { testUtils as I } from "@hua5/hua5-utils";
|
|
4
|
+
import { HuiTool as q } from "../../utils/hui-tool/index.js";
|
|
5
|
+
import { ElInput as F } from "element-plus";
|
|
6
|
+
const J = ["id"], $ = /* @__PURE__ */ z({
|
|
7
|
+
name: "HuiAMapSelectAddress",
|
|
8
|
+
__name: "HuiAMapSelectAddress",
|
|
9
|
+
props: /* @__PURE__ */ L({
|
|
10
|
+
disabled: { type: Boolean, default: !1 },
|
|
11
|
+
value: {},
|
|
12
|
+
width: { default: "40vw" },
|
|
13
|
+
height: { default: "40vh" },
|
|
14
|
+
showInput: { type: Boolean, default: !1 },
|
|
15
|
+
iconPath: { default: "//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-default.png" },
|
|
16
|
+
iconClass: { default: "w-19 h-32" }
|
|
17
|
+
}, {
|
|
18
|
+
modelValue: {},
|
|
19
|
+
modelModifiers: {}
|
|
20
|
+
}),
|
|
21
|
+
emits: ["update:modelValue"],
|
|
22
|
+
setup(g, { expose: b }) {
|
|
23
|
+
const r = g, c = s(""), l = s(null), i = s(null), a = O(g, "modelValue");
|
|
24
|
+
U(a, (e) => {
|
|
25
|
+
c.value = e.formattedAddress;
|
|
26
|
+
}, { deep: !0 });
|
|
27
|
+
function w() {
|
|
28
|
+
h(() => {
|
|
29
|
+
V(() => {
|
|
30
|
+
var e, t, n;
|
|
31
|
+
(e = a.value) != null && e.longitude && ((t = a.value) != null && t.latitude) && (d(a.value.longitude, a.value.latitude), p(a.value.longitude, a.value.latitude)), (n = a.value) != null && n.location && (d(a.value.location.lng, a.value.location.lat), p(a.value.location.lng, a.value.location.lat));
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
function P() {
|
|
36
|
+
C();
|
|
37
|
+
}
|
|
38
|
+
function C() {
|
|
39
|
+
if (!r.showInput) return;
|
|
40
|
+
const e = document.getElementById("map__result");
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
const t = document.querySelector(".amap_lib_placeSearch");
|
|
43
|
+
e.innerHTML = t ? "" : '<h3 class="w-full text-center text-12">暂无搜索结果</h3>';
|
|
44
|
+
}, 200);
|
|
45
|
+
}
|
|
46
|
+
function S() {
|
|
47
|
+
return I.isNotEmpty(a.value) ? !0 : (q.err("请选择地址"), !1);
|
|
48
|
+
}
|
|
49
|
+
function d(e, t) {
|
|
50
|
+
M(), l.value = new window.AMap.Marker({
|
|
51
|
+
position: [e, t],
|
|
52
|
+
map: i.value
|
|
53
|
+
}), l.value.setMap(i.value);
|
|
54
|
+
}
|
|
55
|
+
function M() {
|
|
56
|
+
l.value && (l.value.setMap(null), l.value = null);
|
|
57
|
+
}
|
|
58
|
+
function E(e) {
|
|
59
|
+
const t = document.createElement("div"), n = document.createElement("img");
|
|
60
|
+
if (n.className = r.iconClass, n.src = r.iconPath, t.appendChild(n), !e) return;
|
|
61
|
+
const o = document.createElement("span");
|
|
62
|
+
o.className = "AMap__marker", o.innerHTML = e, t.appendChild(o), l.value.setContent(t);
|
|
63
|
+
}
|
|
64
|
+
function p(e, t) {
|
|
65
|
+
window.AMap.plugin("AMap.Geocoder", function() {
|
|
66
|
+
new window.AMap.Geocoder().getAddress([e, t], (o, u) => {
|
|
67
|
+
if (o === "complete" && u.info === "OK") {
|
|
68
|
+
const K = u.regeocode;
|
|
69
|
+
a.value = Object.assign(K, {
|
|
70
|
+
longitude: e,
|
|
71
|
+
latitude: t
|
|
72
|
+
}), h(() => {
|
|
73
|
+
E(a.value.formattedAddress);
|
|
74
|
+
});
|
|
75
|
+
} else
|
|
76
|
+
console.error("获取地址失败", u);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function T() {
|
|
81
|
+
i.value.on("click", (e) => {
|
|
82
|
+
const t = e.lnglat, n = t.KT || t.lat, o = t.KL || t.lng;
|
|
83
|
+
d(o, n), p(o, n);
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
function V(e) {
|
|
87
|
+
i.value = new window.AMap.Map(A.value, {
|
|
88
|
+
zoom: I.isNotEmpty(a.value) ? 23 : 13,
|
|
89
|
+
center: (() => {
|
|
90
|
+
var t, n, o;
|
|
91
|
+
if ((t = a.value) != null && t.longitude && ((n = a.value) != null && n.latitude))
|
|
92
|
+
return [a.value.longitude, a.value.latitude];
|
|
93
|
+
if ((o = a.value) != null && o.location)
|
|
94
|
+
return [a.value.location.lng, a.value.location.lat];
|
|
95
|
+
})()
|
|
96
|
+
}), i.value.setMapStyle('amap://styles/f695f9484e6fb466b6680b7806a5eae6")'), setTimeout(() => {
|
|
97
|
+
B();
|
|
98
|
+
}), T(), e();
|
|
99
|
+
}
|
|
100
|
+
function B() {
|
|
101
|
+
r.showInput && window.AMapUI.loadUI(["misc/PoiPicker"], (e) => {
|
|
102
|
+
window.poiPicker = new e({
|
|
103
|
+
input: "map__input",
|
|
104
|
+
placeSearchOptions: {
|
|
105
|
+
map: i.value,
|
|
106
|
+
pageSize: 10
|
|
107
|
+
},
|
|
108
|
+
searchResultsContainer: "map__result"
|
|
109
|
+
}), window.poiPicker.on("poiPicked", N);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function N(e) {
|
|
113
|
+
M();
|
|
114
|
+
const t = e.source, n = e.item;
|
|
115
|
+
h(() => {
|
|
116
|
+
var o, u;
|
|
117
|
+
a.value = Object.assign(n, {
|
|
118
|
+
formattedAddress: n.name,
|
|
119
|
+
longitude: (o = n.location) == null ? void 0 : o.KL,
|
|
120
|
+
latitude: (u = n.location) == null ? void 0 : u.kT
|
|
121
|
+
}), t !== "search" && window.poiPicker.searchByKeyword(n.name);
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
function k() {
|
|
125
|
+
G().then(() => {
|
|
126
|
+
w();
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
j(() => {
|
|
130
|
+
k();
|
|
131
|
+
});
|
|
132
|
+
function H(e) {
|
|
133
|
+
const t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
134
|
+
let n = "";
|
|
135
|
+
for (let o = 0; o < e; o++)
|
|
136
|
+
n += t.charAt(Math.floor(Math.random() * t.length));
|
|
137
|
+
return "map__container" + n;
|
|
138
|
+
}
|
|
139
|
+
const A = s(H(2));
|
|
140
|
+
return b({ loadMap: k, setupMap: w, poi: a, submitInfo: S }), (e, t) => (m(), _("div", {
|
|
141
|
+
class: "AMap",
|
|
142
|
+
style: f({ width: e.width, height: e.height })
|
|
143
|
+
}, [
|
|
144
|
+
e.showInput ? (m(), x(R(F), {
|
|
145
|
+
key: 0,
|
|
146
|
+
id: "map__input",
|
|
147
|
+
modelValue: c.value,
|
|
148
|
+
"onUpdate:modelValue": t[0] || (t[0] = (n) => c.value = n),
|
|
149
|
+
class: "AMap__content-input",
|
|
150
|
+
readonly: r.disabled,
|
|
151
|
+
clearable: "",
|
|
152
|
+
placeholder: "输入关键字选取地点",
|
|
153
|
+
onInput: P
|
|
154
|
+
}, null, 8, ["modelValue", "readonly"])) : y("", !0),
|
|
155
|
+
v("div", {
|
|
156
|
+
class: D(["AMap__content-box", e.showInput ? "" : "noEvents"])
|
|
157
|
+
}, [
|
|
158
|
+
v("div", {
|
|
159
|
+
id: A.value,
|
|
160
|
+
style: f({ height: e.height }),
|
|
161
|
+
class: "AMap__content-container",
|
|
162
|
+
tabindex: "0"
|
|
163
|
+
}, null, 12, J),
|
|
164
|
+
e.showInput ? (m(), _("div", {
|
|
165
|
+
key: 0,
|
|
166
|
+
id: "map__result",
|
|
167
|
+
style: f({ height: e.height }),
|
|
168
|
+
class: "AMap__content-result"
|
|
169
|
+
}, t[1] || (t[1] = [
|
|
170
|
+
v("h3", { class: "w-full text-center text-12" }, "暂无搜索结果", -1)
|
|
171
|
+
]), 4)) : y("", !0)
|
|
172
|
+
], 2)
|
|
173
|
+
], 4));
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
export {
|
|
177
|
+
$ as default
|
|
178
|
+
};
|