Files
PropertyDeployment/resources/Web/MicroCommunityMallWeb/html/js/chunk-37f26b88.59afdb66.js
Anfioo adfd019d2d 江门
1
2026-02-01 15:37:55 +08:00

2 lines
13 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-37f26b88"],{"0862":function(e,t,a){},"1f71":function(e,t,a){},"2b2e":function(e,t,a){"use strict";a("1f71")},"41c2":function(e,t,a){},"55d8":function(e,t,a){"use strict";a("86da")},"86da":function(e,t,a){},"9c58":function(e,t,a){},a38a:function(e,t,a){"use strict";a("41c2")},ef92:function(e,t,a){"use strict";a("9c58")},f14a:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e._self._c;return t("el-row",{attrs:{gutter:15}},[t("el-col",{staticClass:"padding-r-0",attrs:{span:4}},[t("city-area-tree",{ref:"cityAreaTree",on:{switchCityAreaTree:e.handleSwitchCityArea}})],1),t("el-col",{attrs:{span:20}},[t("div",{staticClass:"white-bg padding-left padding-right padding-top border-radius-top"},[t("div",{staticClass:"flex justify-between"},[t("div",{staticClass:"text-title"},[e._v(" "+e._s(e.$t("cityArea.areaDetails"))+" ")]),t("div")]),t("div",{staticClass:"margin-top"},[t("el-form",{staticClass:"text-left",attrs:{model:e.cityAreaInfo,"label-width":"100px"}},[t("el-row",[t("el-col",{attrs:{sm:8,xs:24}},[t("el-form-item",{attrs:{label:e.$t("cityArea.areaName")}},[t("label",[e._v(e._s(e.cityAreaInfo.areaName||"-"))])])],1),t("el-col",{attrs:{sm:8,xs:24}},[t("el-form-item",{attrs:{label:e.$t("cityArea.areaCode")}},[t("label",[e._v(e._s(e.cityAreaInfo.areaCode||"-"))])])],1),t("el-col",{attrs:{sm:8,xs:24}},[t("el-form-item",{attrs:{label:e.$t("cityArea.areaLevel")}},["101"==e.cityAreaInfo.areaLevel?t("label",[e._v(e._s(e.$t("cityArea.province")))]):"202"==e.cityAreaInfo.areaLevel?t("label",[e._v(e._s(e.$t("cityArea.city")))]):"303"==e.cityAreaInfo.areaLevel?t("label",[e._v(e._s(e.$t("cityArea.district")))]):t("label",[e._v(e._s(e.$t("cityArea.area")))])])],1),t("el-col",{attrs:{sm:8,xs:24}},[t("el-form-item",{attrs:{label:e.$t("cityArea.parentAreaCode")}},[t("label",[e._v(e._s(e.cityAreaInfo.parentAreaCode||"-"))])])],1),t("el-col",{attrs:{sm:8,xs:24}},[t("el-form-item",{attrs:{label:e.$t("cityArea.parentAreaName")}},[t("label",[e._v(e._s(e.cityAreaInfo.parentAreaName||"-"))])])],1),t("el-col",{attrs:{sm:8,xs:24}},[t("el-form-item",{attrs:{label:e.$t("cityArea.createTime")}},[t("label",[e._v(e._s(e.cityAreaInfo.createTime||"-"))])])],1)],1)],1)],1)])])],1)},i=[],s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"bg-white padding border-radius"},[t("div",["303"!=e.cityAreaTreeInfo.curCityArea.areaLevel?t("el-button",{attrs:{type:"primary",size:"small"},on:{click:e.openAddCityAreaModal}},[e._v(" "+e._s(e.$t("cityArea.add"))+" ")]):e._e(),"0"!=e.cityAreaTreeInfo.curCityArea.areaCode?t("el-button",{attrs:{type:"warning",size:"small"},on:{click:e.openEditCityAreaTreeModel}},[e._v(" "+e._s(e.$t("cityArea.edit"))+" ")]):e._e(),"0"!=e.cityAreaTreeInfo.curCityArea.areaCode?t("el-button",{attrs:{type:"danger",size:"small"},on:{click:e.openDeleteCityAreaTreeModel}},[e._v(" "+e._s(e.$t("cityArea.delete"))+" ")]):e._e()],1),t("div",{staticClass:"margin-top"},[t("el-tree",{ref:"areaTree",attrs:{data:e.cityAreaTreeInfo.orgs,"node-key":"id",props:e.defaultProps},on:{"node-click":e.handleNodeClick}})],1),t("add-city-area",{ref:"addCityArea",on:{success:e.loadCityAreaTrees}}),t("edit-city-area",{ref:"editCityArea",on:{success:e.loadCityAreaTrees}}),t("delete-city-area",{ref:"deleteCityArea",on:{success:e.loadCityAreaTrees}})],1)},o=[],l=a("b775");function n(){return new Promise((e,t)=>{Object(l["a"])({url:"/area.queryAreaTree",method:"get",params:{hc:1.8}}).then(t=>{const a=t.data;e(a)}).catch(e=>{t(e)})})}function d(e){return new Promise((t,a)=>{Object(l["a"])({url:"/area.saveCityArea",method:"post",data:e}).then(e=>{const a=e.data;t(a)}).catch(e=>{a(e)})})}function c(e){return new Promise((t,a)=>{Object(l["a"])({url:"/area.updateCityArea",method:"post",data:e}).then(e=>{const a=e.data;t(a)}).catch(e=>{a(e)})})}function A(e){return new Promise((t,a)=>{Object(l["a"])({url:"/area.deleteCityArea",method:"post",data:e}).then(e=>{const a=e.data;t(a)}).catch(e=>{a(e)})})}function y(e){return new Promise((t,a)=>{Object(l["a"])({url:"/area.listAreas",method:"get",params:e}).then(e=>{const a=e.data;t(a)}).catch(e=>{a(e)})})}var f=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("cityArea.addArea"),visible:e.dialogVisible,width:"70%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.handleClose}},[t("el-form",{attrs:{model:e.addCityAreaInfo,"label-width":"120px"}},[t("el-form-item",{attrs:{label:e.$t("cityArea.areaName"),required:""}},[t("el-input",{attrs:{placeholder:e.$t("cityArea.areaNameRequired")},model:{value:e.addCityAreaInfo.areaName,callback:function(t){e.$set(e.addCityAreaInfo,"areaName",t)},expression:"addCityAreaInfo.areaName"}})],1),t("el-form-item",{attrs:{label:e.$t("cityArea.areaCode"),required:""}},[t("el-input",{attrs:{placeholder:e.$t("cityArea.areaCodeRequired")},model:{value:e.addCityAreaInfo.areaCode,callback:function(t){e.$set(e.addCityAreaInfo,"areaCode",t)},expression:"addCityAreaInfo.areaCode"}})],1),t("el-form-item",{attrs:{label:e.$t("cityArea.parent"),required:""}},[t("el-input",{attrs:{disabled:"",placeholder:e.$t("cityArea.parentRequired")},model:{value:e.addCityAreaInfo.parentAreaName,callback:function(t){e.$set(e.addCityAreaInfo,"parentAreaName",t)},expression:"addCityAreaInfo.parentAreaName"}})],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v(e._s(e.$t("common.cancel")))]),t("el-button",{attrs:{type:"primary"},on:{click:e.saveOrgInfo}},[e._v(e._s(e.$t("common.save")))])],1)],1)},C=[],h={name:"AddCityArea",data(){return{dialogVisible:!1,addCityAreaInfo:{areaCode:"",areaName:"",areaLevel:"",parentAreaCode:"",parentAreaName:"",lon:"",lat:""}}},methods:{open(e){this.addCityAreaInfo={...this.addCityAreaInfo,...e},this.dialogVisible=!0},handleClose(){this.clearAddCityAreaInfo()},addCityAreaValidate(){return this.addCityAreaInfo.areaCode?this.addCityAreaInfo.areaName?!!this.addCityAreaInfo.parentAreaCode||(this.$message.warning(this.$t("cityArea.parentRequired")),!1):(this.$message.warning(this.$t("cityArea.areaNameRequired")),!1):(this.$message.warning(this.$t("cityArea.areaCodeRequired")),!1)},saveOrgInfo(){this.addCityAreaValidate()&&d(this.addCityAreaInfo).then(e=>{console.log(e),this.$message.success(this.$t("cityArea.addSuccess")),this.dialogVisible=!1,this.clearAddCityAreaInfo(),this.$emit("success")}).catch(e=>{console.error("添加地区失败:",e),this.$message.error(this.$t("cityArea.addFailed"))})},clearAddCityAreaInfo(){this.addCityAreaInfo={areaCode:"",areaName:"",areaLevel:"",parentAreaCode:"",parentAreaName:"",lon:"",lat:""}}}},u=h,m=(a("55d8"),a("2877")),p=Object(m["a"])(u,f,C,!1,null,"03f58cdc",null),b=p.exports,I=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("cityArea.editArea"),visible:e.dialogVisible,width:"70%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.handleClose}},[t("el-form",{attrs:{model:e.editCityAreaInfo,"label-width":"120px"}},[t("el-form-item",{attrs:{label:e.$t("cityArea.areaName"),required:""}},[t("el-input",{attrs:{placeholder:e.$t("cityArea.areaNameRequired")},model:{value:e.editCityAreaInfo.areaName,callback:function(t){e.$set(e.editCityAreaInfo,"areaName",t)},expression:"editCityAreaInfo.areaName"}})],1),t("el-form-item",{attrs:{label:e.$t("cityArea.areaCode"),required:""}},[t("el-input",{attrs:{disabled:"",placeholder:e.$t("cityArea.areaCodeRequired")},model:{value:e.editCityAreaInfo.areaCode,callback:function(t){e.$set(e.editCityAreaInfo,"areaCode",t)},expression:"editCityAreaInfo.areaCode"}})],1),t("el-form-item",{attrs:{label:e.$t("cityArea.parent"),required:""}},[t("el-input",{attrs:{disabled:"",placeholder:e.$t("cityArea.parentRequired")},model:{value:e.editCityAreaInfo.parentAreaName,callback:function(t){e.$set(e.editCityAreaInfo,"parentAreaName",t)},expression:"editCityAreaInfo.parentAreaName"}})],1)],1),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v(e._s(e.$t("common.cancel")))]),t("el-button",{attrs:{type:"primary"},on:{click:e.editCityArea}},[e._v(e._s(e.$t("common.save")))])],1)],1)},$=[],g={name:"EditCityArea",data(){return{dialogVisible:!1,editCityAreaInfo:{id:"",areaCode:"",areaName:"",areaLevel:"",parentAreaCode:"",parentAreaName:"",lon:"",lat:""}}},methods:{open(e){this.editCityAreaInfo={...e},this.loadEditCityArea(),this.dialogVisible=!0},handleClose(){this.clearEditCityAreaInfo()},editCityAreaValidate(){return!!this.editCityAreaInfo.areaName||(this.$message.warning(this.$t("cityArea.areaNameRequired")),!1)},editCityArea(){this.editCityAreaValidate()&&c(this.editCityAreaInfo).then(e=>{console.log(e),this.$message.success(this.$t("cityArea.editSuccess")),this.dialogVisible=!1,this.clearEditCityAreaInfo(),this.$emit("success")}).catch(e=>{console.error("修改地区失败:",e),this.$message.error(this.$t("cityArea.editFailed"))})},clearEditCityAreaInfo(){this.editCityAreaInfo={id:"",areaCode:"",areaName:"",areaLevel:"",parentAreaCode:"",parentAreaName:"",lon:"",lat:""}},loadEditCityArea(){const e={page:1,row:1,id:this.editCityAreaInfo.id};y(e).then(e=>{const t=e.data;t&&t.length>0&&(this.editCityAreaInfo={...this.editCityAreaInfo,...t[0]})}).catch(e=>{console.error("获取地区详情失败:",e)})}}},v=g,_=(a("f65c"),Object(m["a"])(v,I,$,!1,null,"6b99dfc8",null)),N=_.exports,w=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("cityArea.confirmOperation"),visible:e.dialogVisible,width:"30%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.handleClose}},[t("div",{staticStyle:{"text-align":"center"}},[t("p",[e._v(e._s(e.$t("cityArea.confirmDeleteArea")))])]),t("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v(e._s(e.$t("cityArea.cancel")))]),t("el-button",{attrs:{type:"primary"},on:{click:e.deleteCityArea}},[e._v(e._s(e.$t("cityArea.confirmDelete")))])],1)])},T=[],x={name:"DeleteCityArea",data(){return{dialogVisible:!1,deleteCityAreaInfo:{}}},methods:{open(e){this.deleteCityAreaInfo={...e},this.dialogVisible=!0},handleClose(){this.clearDeleteCityAreaInfo()},deleteCityArea(){A(this.deleteCityAreaInfo).then(e=>{console.log(e),this.$message.success(this.$t("cityArea.deleteSuccess")),this.dialogVisible=!1,this.clearDeleteCityAreaInfo(),this.$emit("success")}).catch(e=>{console.error("删除地区失败:",e),this.$message.error(this.$t("cityArea.deleteFailed"))})},clearDeleteCityAreaInfo(){this.deleteCityAreaInfo={}}}},k=x,V=(a("a38a"),Object(m["a"])(k,w,T,!1,null,"593324df",null)),q=V.exports,L={name:"CityAreaTree",components:{AddCityArea:b,EditCityArea:N,DeleteCityArea:q},props:{callBackListener:{type:String,default:""}},data(){return{cityAreaTreeInfo:{orgs:[],curCityArea:{}},defaultProps:{children:"children",label:"text"}}},mounted(){this.loadCityAreaTrees()},methods:{loadCityAreaTrees(){n().then(e=>{this.cityAreaTreeInfo.orgs=[e.data]}).catch(e=>{console.error("获取地区树失败:",e)})},handleNodeClick(e){this.cityAreaTreeInfo.curCityArea=e,this.$emit("switchCityAreaTree",{id:e.id,areaCode:e.areaCode,areaLevel:e.areaLevel,areaName:e.text})},openAddCityAreaModal(){if(!this.cityAreaTreeInfo.curCityArea.id)return void this.$message.warning(this.$t("cityArea.selectAreaFirst"));let e=this.cityAreaTreeInfo.curCityArea.areaLevel;if("101"===e)e="202";else if("202"===e)e="303";else{if("303"===e)return void this.$message.warning(this.$t("cityArea.cannotAddChild"));e="101"}this.$refs.addCityArea.open({parentAreaCode:this.cityAreaTreeInfo.curCityArea.areaCode,areaLevel:e,parentAreaName:this.cityAreaTreeInfo.curCityArea.text})},openEditCityAreaTreeModel(){this.cityAreaTreeInfo.curCityArea.id?this.$refs.editCityArea.open(this.cityAreaTreeInfo.curCityArea):this.$message.warning(this.$t("cityArea.selectAreaFirst"))},openDeleteCityAreaTreeModel(){this.cityAreaTreeInfo.curCityArea.id?this.$refs.deleteCityArea.open(this.cityAreaTreeInfo.curCityArea):this.$message.warning(this.$t("cityArea.selectAreaFirst"))}}},O=L,j=(a("ef92"),Object(m["a"])(O,s,o,!1,null,"08ac06df",null)),D=j.exports,R={name:"CityArea",components:{CityAreaTree:D},data(){return{cityAreaInfo:{id:"",areaCode:"",areaName:"",areaLevel:"",parentAreaCode:"",parentAreaName:"",createTime:""}}},methods:{handleSwitchCityArea(e){this.cityAreaInfo.id=e.id,this.cityAreaInfo.areaCode=e.areaCode,this.cityAreaInfo.areaName=e.areaName,this.listCityArea()},listCityArea(){const e={page:1,row:1,areaCode:this.cityAreaInfo.areaCode,id:this.cityAreaInfo.id};y(e).then(e=>{const t=e.data;t&&t.length>0&&(this.cityAreaInfo={...this.cityAreaInfo,...t[0]})}).catch(e=>{console.error("获取地区详情失败:",e)})}}},E=R,P=(a("2b2e"),Object(m["a"])(E,r,i,!1,null,"65be7bf7",null));t["default"]=P.exports},f65c:function(e,t,a){"use strict";a("0862")}}]);
//# sourceMappingURL=chunk-37f26b88.59afdb66.js.map