141 lines
5.3 KiB
JavaScript
141 lines
5.3 KiB
JavaScript
import Locale from "element-ui/lib/mixins/locale";
|
|
import EleModal from "../ele-modal/index";
|
|
import MapView from "./components/map-view";
|
|
import props from "./props";
|
|
function normalizeComponent(scriptExports, render2, staticRenderFns, functionalTemplate, injectStyles, scopeId, moduleIdentifier, shadowMode) {
|
|
var options = typeof scriptExports === "function" ? scriptExports.options : scriptExports;
|
|
if (render2) {
|
|
options.render = render2;
|
|
options.staticRenderFns = staticRenderFns;
|
|
options._compiled = true;
|
|
}
|
|
if (functionalTemplate) {
|
|
options.functional = true;
|
|
}
|
|
if (scopeId) {
|
|
options._scopeId = "data-v-" + scopeId;
|
|
}
|
|
var hook;
|
|
if (moduleIdentifier) {
|
|
hook = function(context) {
|
|
context = context || this.$vnode && this.$vnode.ssrContext || this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext;
|
|
if (!context && typeof __VUE_SSR_CONTEXT__ !== "undefined") {
|
|
context = __VUE_SSR_CONTEXT__;
|
|
}
|
|
if (injectStyles) {
|
|
injectStyles.call(this, context);
|
|
}
|
|
if (context && context._registeredComponents) {
|
|
context._registeredComponents.add(moduleIdentifier);
|
|
}
|
|
};
|
|
options._ssrRegister = hook;
|
|
} else if (injectStyles) {
|
|
hook = shadowMode ? function() {
|
|
injectStyles.call(
|
|
this,
|
|
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
);
|
|
} : injectStyles;
|
|
}
|
|
if (hook) {
|
|
if (options.functional) {
|
|
options._injectStyles = hook;
|
|
var originalRender = options.render;
|
|
options.render = function renderWithStyleInjection(h, context) {
|
|
hook.call(context);
|
|
return originalRender(h, context);
|
|
};
|
|
} else {
|
|
var existing = options.beforeCreate;
|
|
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
|
|
}
|
|
}
|
|
return {
|
|
exports: scriptExports,
|
|
options
|
|
};
|
|
}
|
|
const _sfc_main = {
|
|
name: "EleMapPicker",
|
|
components: { EleModal, MapView },
|
|
mixins: [Locale],
|
|
props,
|
|
inject: {
|
|
proLayout: {
|
|
default: null
|
|
}
|
|
},
|
|
emits: ["done", "open", "closed", "update:show", "map-done"],
|
|
data() {
|
|
return {
|
|
enable: false
|
|
};
|
|
},
|
|
computed: {
|
|
dialogClass() {
|
|
const classes = ["ele-map-picker-dialog"];
|
|
if (this.customClass) {
|
|
classes.push(this.customClass);
|
|
}
|
|
if (this.styleResponsive) {
|
|
classes.push("ele-map-picker-responsive");
|
|
}
|
|
return classes.join(" ");
|
|
},
|
|
aMapKey() {
|
|
const globalConfig = this.$ELEADMIN;
|
|
return this.mapKey || (globalConfig == null ? void 0 : globalConfig.mapKey);
|
|
},
|
|
styleResponsive() {
|
|
var _a, _b;
|
|
const proLayout = (_a = this.proLayout) != null ? _a : {};
|
|
return (_b = proLayout.styleResponsive) != null ? _b : true;
|
|
}
|
|
},
|
|
methods: {
|
|
onOpen() {
|
|
this.enable = true;
|
|
this.$emit("open");
|
|
},
|
|
onClosed() {
|
|
if (this.destroyOnClose) {
|
|
this.enable = false;
|
|
}
|
|
this.$emit("closed");
|
|
},
|
|
onDone(result) {
|
|
this.$emit("done", result);
|
|
},
|
|
onMapDone(ins) {
|
|
this.$emit("map-done", ins);
|
|
},
|
|
updateVisible(value) {
|
|
this.$emit("update:show", value);
|
|
}
|
|
}
|
|
};
|
|
var _sfc_render = function render() {
|
|
var _vm = this, _c = _vm._self._c;
|
|
return _c("EleModal", { attrs: { "visible": _vm.show, "title": _vm.title || _vm.t("ele.map.title"), "width": _vm.width, "top": _vm.top, "modal": _vm.modal, "modal-append-to-body": _vm.modalAppendToBody, "append-to-body": _vm.appendToBody, "lock-scroll": _vm.lockScroll, "custom-class": _vm.dialogClass, "close-on-click-modal": _vm.closeOnClickModal, "close-on-press-escape": _vm.closeOnPressEscape, "show-close": _vm.showClose, "destroy-on-close": _vm.destroyOnClose, "movable": _vm.movable, "move-out": _vm.moveOut, "move-out-positive": _vm.moveOutPositive, "resizable": _vm.resizable, "maxable": _vm.maxable, "multiple": _vm.multiple, "fullscreen": _vm.fullscreen, "inner": _vm.inner, "reset-on-close": _vm.resetOnClose, "centered": _vm.centered, "mask-keep-alive": false }, on: { "open": _vm.onOpen, "closed": _vm.onClosed, "update:visible": _vm.updateVisible }, scopedSlots: _vm._u([_vm._l(Object.keys(_vm.$scopedSlots).filter((s) => s !== "default"), function(name) {
|
|
return { key: name, fn: function(props2) {
|
|
return [_vm._t(name, null, null, props2 || {})];
|
|
} };
|
|
})], null, true) }, [_vm.enable ? _c("MapView", { ref: "mapRef", attrs: { "height": _vm.height, "center": _vm.center, "zoom": _vm.zoom, "chooseZoom": _vm.chooseZoom, "poiSize": _vm.poiSize, "poiType": _vm.poiType, "poiKeywords": _vm.poiKeywords, "poiRadius": _vm.poiRadius, "needCity": _vm.needCity, "forceChoose": _vm.forceChoose, "suggestionCity": _vm.suggestionCity, "searchType": _vm.searchType, "searchPlaceholder": _vm.searchPlaceholder || _vm.t("ele.map.placeholder"), "markerSrc": _vm.markerSrc, "mapKey": _vm.aMapKey, "mapVersion": _vm.mapVersion, "mapStyle": _vm.mapStyle, "darkMode": _vm.darkMode, "okText": _vm.okText || _vm.t("ele.map.ok"), "tipMessage": _vm.t("ele.map.message") }, on: { "done": _vm.onDone, "map-done": _vm.onMapDone } }) : _vm._e()], 1);
|
|
};
|
|
var _sfc_staticRenderFns = [];
|
|
var __component__ = /* @__PURE__ */ normalizeComponent(
|
|
_sfc_main,
|
|
_sfc_render,
|
|
_sfc_staticRenderFns,
|
|
false,
|
|
null,
|
|
null,
|
|
null,
|
|
null
|
|
);
|
|
const index = __component__.exports;
|
|
export {
|
|
index as default
|
|
};
|