chunk-fbd106ac.b3e7f8d4.js 17 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-fbd106ac"],{2015:function(t,e,a){"use strict";a.r(e);var o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{"show-close":!1,"close-on-click-modal":!1,visible:t.isShow,title:"polygonAdd"===t.mteStr?"多边形操作":"文字操作",fullscreen:!1,width:"400px","custom-class":"xl-dialog",center:""},on:{"update:visible":function(e){t.isShow=e}}},[a("base-form",{ref:"ruleForm",attrs:{data:t.formData,"is-inline":!1,"label-width":"110px"}}),a("div",{staticClass:"xl-form"},[a("div",{staticClass:"xl-form-footer"},[a("el-button",{staticClass:"xl-form-btn t2",on:{click:t.close}},[t._v("关 闭")]),t.curObj.obj?a("el-button",{staticClass:"xl-form-btn t1",on:{click:function(e){return t.close("confirm")}}},[t._v("保存")]):a("el-button",{staticClass:"xl-form-btn t3",on:{click:function(e){return t.close("confirm")}}},[t._v("去画图")])],1)])],1)],1)},s=[],i=a("5530"),l=(a("ed08"),{components:{},mixins:mixins,props:{isShow:Boolean,curObj:Object,mteStr:String},data:function(){return{loading:!1,formData:[],fillColor:"#DC3021",strokeColor:"#DC3021"}},watch:{isShow:function(t){t&&this.getDef()}},methods:{getDef:function(t){var e=Object(i["a"])({},this.curObj.obj);e.text||(e.text="标题示例"),"polygonAdd"===this.mteStr?(e.fillColor||(e.fillColor=this.fillColor,e.fillOpacity="0.3",e.strokeColor=this.strokeColor),this.formData=[{label:"标题",key:"text",rules:1},{label:"填充色",key:"fillColor",type:"colorPicker",rules:1},{label:"透明度",key:"fillOpacity",rules:1},{label:"轮廓色",key:"strokeColor",type:"colorPicker",rules:1}]):(e.color||(e.color="#fff"),this.formData=[{label:"文字内容",key:"text",rules:1},{label:"文字颜色",key:"color",type:"colorPicker",rules:1}]),this.setDefaultValue(e)},close:function(t){var e=this;"confirm"===t?this.$refs["ruleForm"].$refs["baseForm"].validate((function(t){if(t){var a=e.$refs.ruleForm.baseForm,o=Object(i["a"])({},a);e.curObj.obj?e.$emit("close",o,"edit"):e.$emit("close",o),e.setDefaultValue()}})):(this.$emit("close"),this.setDefaultValue())}}}),n=l,r=(a("3dbb"),a("2877")),c=Object(r["a"])(n,o,s,!1,null,"442e5d97",null);e["default"]=c.exports},"2bfb":function(t,e,a){"use strict";a("f9cb")},"3dbb":function(t,e,a){"use strict";a("fab0")},f3ae:function(t,e,a){"use strict";a.r(e);var o=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"scoped-bg"}),a("div",{directives:[{name:"show",rawName:"v-show",value:t.isDeal,expression:"isDeal"}],class:t.isDbShow?"scoped-deal-box":"scoped-deal-box t2"},[a("div",{staticClass:"sdb-info"},[a("div",{staticClass:"p1"},[t._v("当前缩放级别:"+t._s(t.mapDiyObj.zoom)),a("span",{staticClass:"more",on:{click:t.setShowChange}},[t._v(t._s(t.isMapSetShow?"收起设置":"展开设置")+">")])]),a("div",{directives:[{name:"show",rawName:"v-show",value:t.isMapSetShow,expression:"isMapSetShow"}],staticClass:"p2"},[a("base-form",{ref:"ruleForm",attrs:{data:t.formData,"is-inline":!1,"label-width":"80px"}},[a("div",{attrs:{slot:"footer"},slot:"footer"},[a("el-button",{staticClass:"xl-form-btn bgc2",on:{click:t.setHandle}},[t._v("设置")]),a("div",{staticClass:"scoped-select-center",on:{click:t.setCenterHandle}},[t._v("中心坐标"),a("div",{staticClass:"s"},[t._v(t._s(t.centerStr))])])],1)])],1)]),a("div",{staticClass:"sdb-add"},[a("div",{staticClass:"b t2",on:{click:function(e){return t.openMte("polygonAdd")}}},[t._v("添加多边形")]),a("div",{staticClass:"b t2",on:{click:function(e){return t.openMte("textAdd")}}},[t._v("添加文字")])]),a("div",{staticClass:"sdb-add"},[a("div",{staticClass:"b t3",on:{click:function(e){return t.saveHandle()}}},[t._v("保 存")])]),t.polygons.length>0?a("div",{staticClass:"sdb-list"},[a("div",{staticClass:"label t2"},[t._v("多边形列表")]),a("div",{staticClass:"ul"},t._l(t.polygons,(function(e,o){return a("div",{key:o,staticClass:"op"},[a("p",{staticClass:"p1",on:{click:function(a){return t.openMte("polygonAdd",{obj:e,index:o})}}},[t._v(t._s(e.text))]),a("p",{staticClass:"more"},[e.editable?a("span",{staticClass:"d d2",on:{click:function(a){return t.textAdd(e)}}},[t._v("标点")]):t._e(),e.editable?a("span",{staticClass:"d d1",on:{click:function(e){return t.mapIsEdit(o,"polygons")}}},[t._v("编辑")]):a("span",{staticClass:"d d3",on:{click:function(e){return t.mapIsEdit(o,"polygons")}}},[t._v("只读")]),a("span",{staticClass:"d d4",on:{click:function(e){return t.mapDel(o,"polygons")}}},[t._v("删除")])])])})),0)]):t._e(),t.markerData.length>0?a("div",{staticClass:"sdb-list"},[a("div",{staticClass:"label t2"},[t._v("文字列表(选中:"+t._s(t.curMarkersIndex+1)+")")]),a("div",{staticClass:"ul"},t._l(t.markerData,(function(e,o){return a("div",{key:o,staticClass:"op"},[a("p",{staticClass:"p1",on:{click:function(a){return t.openMte("textAdd",{obj:e,index:o})}}},[t._v("("+t._s(t.curMarkersIndex+1)+")"+t._s(e.content))]),a("p",{staticClass:"more"},[e.draggable?a("span",{staticClass:"d d1",on:{click:function(e){return t.mapIsEdit(o,"markerData")}}},[t._v("编辑")]):a("span",{staticClass:"d d3",on:{click:function(e){return t.mapIsEdit(o,"markerData")}}},[t._v("只读")]),a("span",{staticClass:"d d4",on:{click:function(e){return t.mapDel(o,"markerData")}}},[t._v("删除")])])])})),0)]):t._e()]),a("el-amap",{staticClass:"amap-box",attrs:{vid:"amap-vue","amap-manager":t.amapManager,zoom:t.mapDiyObj.zoom,zooms:t.mapDiyObj.zooms,mapStyle:t.mapDiyObj.mapStyle,center:t.mapDiyObj.center,events:t.mapEvents,plugin:t.plugin}},[t.mapDiyObj.zoom>13?["1"===t.mapDiyObj.isSchoolShow?t._l(t.schoolList,(function(e,o){return a("el-amap-marker",{key:3e3+o,staticClass:"scoped-m-box",attrs:{icon:"https://img2.honglounews.com/20220110041435-6276.png",position:e.position,events:t.schoolEvents,title:e.school_name,label:{content:e.school_name,offset:[0,-20]},extData:{id:e.id}}})})):t._e(),"1"===t.mapDiyObj.isEstateShow?t._l(t.estateList,(function(e,o){return a("el-amap-marker",{key:2e3+o,staticClass:"scoped-m-box",attrs:{icon:"https://img2.honglounews.com/20220110041411-6675.png",position:e.position,events:t.estateEvents,title:e.estate_name,label:{content:e.estate_name,offset:[0,-20]},extData:{id:e.id}}})})):t._e(),t._l(t.markerData,(function(e,o){return a("el-amap-marker",{key:1e3+o,attrs:{position:e.position,draggable:e.draggable,animation:e.animation,offset:e.offset,events:t.markersEvents}},[a("div",{staticClass:"scoped-marker-text",style:"color: "+e.color},[t._v(t._s(e.content))])])}))]:["1"===t.mapDiyObj.isAreaShow?t._l(t.areaList,(function(e,o){return a("el-amap-marker",{key:4e3+o,staticClass:"scoped-m-box",attrs:{icon:"https://img2.honglounews.com/20220110041435-6276.png",position:e.position,events:t.areaEvents,offset:[-40,-40],extData:{areaName:e.areaName,areaType:e.area_type}}},[a("div",{staticClass:"scoped-marker-area"},[a("div",{staticClass:"p1"},[t._v(t._s(e.areaName))]),a("div",{staticClass:"p2"},[t._v("楼盘:"+t._s(e.estate_total))]),a("div",{staticClass:"p2"},[t._v("学校:"+t._s(e.school_total))])])])})):t._e()],t._l(t.polygons,(function(e,o){return a("el-amap-polygon",{key:o,attrs:{path:e.path,editable:e.editable,fillColor:e.fillColor,fillOpacity:e.fillOpacity,strokeColor:e.strokeColor,strokeWeight:e.strokeWeight,strokeOpacity:e.strokeOpacity,extData:{index:o},events:t.polygonEvents}})}))],2),a("MapTextEdit",{attrs:{isShow:t.isMteShow,mteStr:t.mteStr,curObj:t.mteObj},on:{close:t.closeMte}})],1)},s=[],i=a("5530"),l=a("2909"),n=(a("99af"),a("d81d"),a("1276"),a("ac1f"),a("a9e3"),a("159b"),a("a434"),a("8f9b")),r=a("2015"),c=a("ed08"),p=new n["AMapManager"],m={name:"map",components:{MapTextEdit:r["default"]},mixins:mixins,data:function(){var t=this;return{estateList:[],schoolList:[],areaList:[],isDbShow:!0,isMapSetShow:!1,formData:[],isMteShow:!1,mapDiyObj:{center:[115.852386,28.684076],zoom:17,zooms:[15,19]},amapManager:p,polygons:[],markerData:[],mapEvents:{init:function(t){t.setFeatures(["road","bg","building"]),AMapUI.loadUI(["control/BasicControl"],(function(e){var a=new e.LayerSwitcher({baseLayers:[{id:"basic",enable:!0,name:"基础地图",layer:new AMap.TileLayer},{id:"Satellite",enable:!1,name:"卫星图",layer:new AMap.TileLayer.Satellite}],overlayLayers:[],position:{bottom:"50px",right:"30px"}});t.addControl(a)}))},zoomchange:function(e){var a=p.getMap();t.mapDiyObj.zoom=a.getZoom()||17},complete:function(){t.setCurFeatures(t.mapDiyObj.features)}},markersEvents:{dragend:function(e){var a=e.lnglat,o=a.lng,s=a.lat,i=JSON.parse(JSON.stringify(t.markerData));i[t.curMarkersIndex].position=[o,s],t.markerData=Object(l["a"])(i)}},polygonEvents:{click:function(t){wx.miniProgram.navigateTo({url:"/pagesSchool/indexDtl?id=25"})}},estateEvents:{click:function(t){var e=t.target.getExtData();wx.miniProgram.navigateTo({url:"/pagesHouse/indexDtl?id=".concat(e.id)})}},schoolEvents:{click:function(t){var e=t.target.getExtData();wx.miniProgram.navigateTo({url:"/pagesSchool/indexDtl?id=".concat(e.id)})}},areaEvents:{click:function(t){var e=t.target.getExtData();wx.miniProgram.navigateTo({url:"/pagesSchool/index?areaName=".concat(e.areaName,"&areaType=").concat(e.areaType)})}},curMarkersIndex:0,plugin:[{pName:"MouseTool"}],mteStr:"polygonAdd",mteObj:{},dictData:{sys_yesno:[{key:"是",val:"1"},{key:"否",val:"2"}],area_type:[{key:"红谷滩中心区",val:"hgt"},{key:"红角洲",val:"hjz"},{key:"朝阳新城",val:"cyxc"},{key:"九龙湖",val:"jlh"},{key:"凤凰洲",val:"fhz"},{key:"西湖区",val:"xhq"},{key:"东湖区",val:"dhq"},{key:"象湖滨江",val:"xhbj"},{key:"青山湖区",val:"qshq"},{key:"新建区",val:"xjq"},{key:"湾里区",val:"wlq"},{key:"青云谱区",val:"qypq"},{key:"高新区",val:"gxq"},{key:"欣悦湖",val:"xyh"},{key:"经开区",val:"jkq"},{key:"象湖新城",val:"xhxc"},{key:"望城",val:"wcxq"},{key:"南昌县",val:"ncx"},{key:"赣江新区",val:"gjxq"}],map_area_lnglat:[{option1:"望城",key:"115.74219,28.622854",val:"wcxq"},{option1:"湾里区",key:"115.781385,28.709504",val:"wlq"},{option1:"欣悦湖",key:"115.787513,28.685376",val:"xyh"},{option1:"九龙湖",key:"115.792951,28.587435",val:"jlh"},{option1:"新建区",key:"115.818441,28.692623",val:"xjq"},{option1:"红角洲",key:"115.824219,28.63926",val:"hjz"},{option1:"经开区",key:"115.830506,28.747641",val:"jkq"},{option1:"象湖滨江",key:"115.847217,28.582374",val:"xhbj"},{option1:"红谷滩中心区",key:"115.852886,28.683902",val:"hgt"},{option1:"朝阳新城",key:"115.858884,28.633789",val:"cyxc"},{option1:"凤凰洲",key:"115.875846,28.709236",val:"fhz"},{option1:"西湖区",key:"115.889966,28.664366",val:"xhq"},{option1:"东湖区",key:"115.901112,28.680259",val:"dhq"},{option1:"青云谱区",key:"115.908247,28.623327",val:"qypq"},{option1:"南昌县",key:"115.932183,28.550813",val:"ncx"},{option1:"赣江新区",key:"115.93303,28.803368",val:"gjxq"},{option1:"青山湖区",key:"115.949679,28.701298",val:"qshq"},{option1:"高新区",key:"116.033624,28.697981",val:"gxq"}]}}},computed:{isDeal:function(){var t=this.$route.query;return!(!t.e||"1"!==t.e)},centerStr:function(){var t=this.mapDiyObj.center;return t&&t.length>0?"".concat(t[0],", ").concat(t[1]):"待选取"}},created:function(){var t=this;this.getData(),this.$api.other.admmapcoordinall().then((function(e){var a=e.estate_list||[];a.map((function(t){t.position=[t.longitude,t.latitude]})),t.estateList=Object(l["a"])(a);var o=e.school_list||[];o.map((function(t){t.position=[t.longitude,t.latitude]})),t.schoolList=Object(l["a"])(o);var s=e.area_total||[];s.map((function(e){var a=Object(c["a"])(t.dictData.map_area_lnglat)[e.area_type].split(",");e.position=[a[0],a[1]],e.areaName=Object(c["a"])(t.dictData.area_type)[e.area_type]})),t.areaList=Object(l["a"])(s)}))},mounted:function(){},methods:{setShowChange:function(){this.isMapSetShow=!this.isMapSetShow},getDef:function(){var t={};t=Object(i["a"])({},this.mapDiyObj),t.zoom1=t.zooms[0],t.zoom2=t.zooms[1],this.formData=[{label:"地图标题",key:"title",rules:1},{label:"主题样式",key:"mapStyle",type:"select",rules:1,options:[{key:"默认样式",val:"normal"},{key:"深色样式",val:"dark"},{key:"浅色样式",val:"light"},{key:"清新风格osm",val:"fresh"}]},{label:"显示内容",key:"features",type:"select",multiple:!0,rules:1,options:[{key:"区域面",val:"bg"},{key:"兴趣点",val:"point"},{key:"道路和标注",val:"road"},{key:"建筑物",val:"building"}]},{label:"默认级别",key:"zoom",rules:1},{label:"最小3+",key:"zoom1",rules:1},{label:"最大19-",key:"zoom2",rules:1},{label:"展示楼盘",key:"isEstateShow",type:"select",rules:1,options:this.dictData.sys_yesno},{label:"展示学校",key:"isSchoolShow",type:"select",rules:1,options:this.dictData.sys_yesno},{label:"展示区域",key:"isAreaShow",type:"select",rules:1,options:this.dictData.sys_yesno}],this.setDefaultValue(t)},setCurFeatures:function(t){var e=this.amapManager.getMap();e.setFeatures(t)},getData:function(){var t=this,e=this.$route.query;this.$api.other.admmapcoordindetail({uuid:e.id}).then((function(e){if(e.data){var a=JSON.parse(e.data);t.polygons=Object(l["a"])(a.polygons),t.markerData=Object(l["a"])(a.markerData),t.mapDiyObj=Object(i["a"])(Object(i["a"])({},a.mapDiyObj),{},{title:e.title})}else t.mapDiyObj={mapStyle:"light",zoom:17,zooms:[15,19],center:[115.852386,28.684076],isEstateShow:"1",isSchoolShow:"1",isAreaShow:"1",title:e.title,features:["road","bg","building"]};document.title=e.title||"洪楼地图1",t.getDef()}))},setHandle:function(){var t=this;this.$refs["ruleForm"].$refs["baseForm"].validate((function(e){if(e){var a=t.$refs.ruleForm.baseForm,o=Object(i["a"])({},a),s=Object(i["a"])({},t.mapDiyObj);s.zoom=Number(o.zoom),s.zooms=[Number(o.zoom1),Number(o.zoom2)],s.title=o.title,s.mapStyle=o.mapStyle,s.features=o.features,s.isEstateShow=o.isEstateShow,s.isSchoolShow=o.isSchoolShow,s.isAreaShow=o.isAreaShow,t.mapDiyObj=Object(i["a"])({},s),t.setCurFeatures(o.features),t.isMapSetShow=!1}}))},setCenterHandle:function(){var t=this,e=this.amapManager.getMap(),a=new AMap.MouseTool(e);a.marker({content:" "}),t.isDbShow=!1,t.$msgs("请在地图上选择中心点"),AMap.event.addListener(a,"draw",(function(e){var o=e.obj.getPosition(),s=Object(i["a"])({},t.mapDiyObj);s.center=[o.lng,o.lat],t.mapDiyObj=Object(i["a"])({},s),t.$msg("中心坐标选取成功~如需重新选中心点,请再次点击中心坐标位置"),t.isDbShow=!0,window.setTimeout((function(){a.close(!0)}),100)}))},saveHandle:function(){var t=this;this.$msg("您确定要保存该数据(覆盖原来数据)吗?","confirm",(function(){var e=JSON.parse(JSON.stringify(t.polygons));e.map((function(t){var e=[];t.editable=!1,t.path.forEach((function(t){e.push([t.lng,t.lat])})),t.path=e}));var a=JSON.parse(JSON.stringify(t.markerData));a.map((function(t){t.draggable=!1}));var o={polygons:e,markerData:a,mapDiyObj:t.mapDiyObj},s=t.$route.query;t.$api.other.admmapcoordinedit({uuid:s.id,title:t.mapDiyObj.title,data:JSON.stringify(o)}).then((function(e){t.getData()}))}))},polygonAdd:function(t){var e=this,a=this.amapManager.getMap(),o=new AMap.MouseTool(a);o.polygon({fillColor:"#00b0ff",strokeColor:"#80d8ff",editable:!0,strokeStyle:"dashed"}),AMap.event.addListener(o,"draw",(function(a){var s=Object(l["a"])(a.obj.getPath()),i=[];s.forEach((function(t){i.push([t.lng,t.lat])}));var n=Object(l["a"])(e.polygons);n.push({path:i,editable:!0,fillColor:t.fillColor||"#DC3021",fillOpacity:t.fillOpacity||.3,strokeColor:t.strokeColor||"#DC3021",strokeWeight:2,strokeOpacity:.9,text:t.text}),e.polygons=Object(l["a"])(n),o.close(!0),e.isDbShow=!0}))},mapIsEdit:function(t,e){this.curMarkersIndex=t;var a=Object(l["a"])(this[e]);"polygons"===e?a[t].editable?(a[t].editable=!1,a[t].strokeStyle="solid"):(a[t].editable=!0,a[t].strokeStyle="dashed"):a[t].draggable=!a[t].draggable,this[e]=Object(l["a"])(a),this.$storage("map_".concat(e),JSON.stringify(a))},mapDel:function(t,e){var a=this;this.$msg("您确定要删除该数据吗?","confirm",(function(){var o=Object(l["a"])(a[e]);o.splice(t,1),a[e]=Object(l["a"])(o),a.$storage("map_".concat(e),JSON.stringify(o))}))},openMte:function(t,e){this.mteStr=t,this.isMteShow=!0,e&&(this.mteObj=Object(i["a"])({},e))},closeMte:function(t,e){if(this.isMteShow=!1,t)if(e&&"edit"===e){var a=this.mteObj.index||0,o="textAdd"===this.mteStr?"markerData":"polygons",s=Object(l["a"])(this[o]);"textAdd"===this.mteStr?(s[a].content=t.text,s[a].text=t.text,s[a].color=t.color):(s[a].text=t.text,s[a].fillColor=t.fillColor,s[a].fillOpacity=t.fillOpacity,s[a].strokeColor=t.strokeColor),this[o]=Object(l["a"])(s),this.$storage("map_".concat(o),JSON.stringify(s))}else this[this.mteStr](t),this.isDbShow=!1,this.$msgs("请在地图上操作");this.mteObj={}},textAdd:function(t){var e=this,a=this.amapManager.getMap(),o=new AMap.MouseTool(a);o.marker({content:" "}),AMap.event.addListener(o,"draw",(function(a){var s=a.obj.getPosition(),i=Object(l["a"])(e.markerData);i.push({position:[s.lng,s.lat],draggable:!0,animation:"AMAP_ANIMATION_DROP",content:t.text,offset:[0,-10],text:t.text,color:t.color}),e.markerData=Object(l["a"])(i),window.setTimeout((function(){o.close(!0),e.isDbShow=!0}),100)}))}}},d=m,u=(a("2bfb"),a("2877")),f=Object(u["a"])(d,o,s,!1,null,"b0e54da4",null);e["default"]=f.exports},f9cb:function(t,e,a){},fab0:function(t,e,a){}}]);