mirror of
https://github.com/hpd840321/starRiverProperty.git
synced 2026-06-09 16:30:29 +08:00
0c56a3e599
Made-with: Cursor Former-commit-id: 571c9a99ee26d90505e550c287eb8ad8d743ff8d
1 line
14 KiB
JavaScript
1 line
14 KiB
JavaScript
(window["webpackJsonp_park-area-web"]=window["webpackJsonp_park-area-web"]||[]).push([["chunk-a3498940"],{"0bc2":function(e,t,r){},2909:function(e,t,r){"use strict";function n(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}r("a4d3"),r("e01a"),r("d28b"),r("a630"),r("e260"),r("d3b7"),r("25f0"),r("3ca3"),r("ddb0");function a(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}function i(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function o(e){return n(e)||a(e)||i()}r.d(t,"a",(function(){return o}))},6424:function(e,t,r){"use strict";var n=r("0bc2"),a=r.n(n);a.a},a630:function(e,t,r){var n=r("23e7"),a=r("4df4"),i=r("1c7e"),o=!i((function(e){Array.from(e)}));n({target:"Array",stat:!0,forced:o},{from:a})},ae85:function(e,t,r){"use strict";r("a4d3"),r("4de4"),r("4160"),r("e439"),r("dbb4"),r("b64b"),r("159b");var n=r("ade3"),a=r("d4ec"),i=r("bee2"),o=r("99de"),s=r("7e84"),c=r("262e"),u=r("9ab4"),l=r("60a3");function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function f(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach((function(t){Object(n["a"])(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}t["a"]=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"fetchTableData",r=function(r){function n(){var t;return Object(a["a"])(this,n),t=Object(o["a"])(this,Object(s["a"])(n).apply(this,arguments)),t.tableData=[],t.searchForm=f({},e),t.pager={rowsOfPage:10,currentPage:1,total:0},t.loading=!1,t}return Object(c["a"])(n,r),Object(i["a"])(n,[{key:"getSearchParams",value:function(){var e=f({},this.searchForm,{},this.pager);return delete e.total,e}},{key:"onSearch",value:function(){this.pager.currentPage=1,this[t]()}}]),n}(l["e"]);return r=u["a"]([Object(l["a"])({components:{}})],r),r}},b0c0:function(e,t,r){var n=r("83ab"),a=r("9bf2").f,i=Function.prototype,o=i.toString,s=/^\s*function ([^ (]*)/,c="name";!n||c in i||a(i,c,{configurable:!0,get:function(){try{return o.call(this).match(s)[1]}catch(e){return""}}})},f569:function(e,t,r){"use strict";r.r(t);var n=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("qz-wrap",{attrs:{loading:e.loading},scopedSlots:e._u([{key:"opt",fn:function(){return[r("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.onOpenModal("add",null)}}},[e._v("新增区域")])]},proxy:!0}])},[r("qz-table",{attrs:{columns:e.columns,data:e.tableData,attrs:{"row-key":"id"}},scopedSlots:e._u([{key:"name",fn:function(t){var n=t.row;return[n.isEdit?[r("el-input",{staticStyle:{width:"260px"},model:{value:n.name,callback:function(t){e.$set(n,"name",t)},expression:"row.name"}},[r("template",{slot:"suffix"},[r("el-button",{attrs:{type:"text"},on:{click:e.fetchTableData}},[e._v("取消")]),r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.onUpdate(n)}}},[e._v("保存")])],1)],2)]:r("span",{staticClass:"click-item",on:{click:function(t){return e.onToogleEdit(n,!0)}}},[e._v(e._s(n.name)+" "),r("i",{staticClass:"el-icon-edit"})])]}},{key:"type",fn:function(t){var n=t.row;return[r("span",[e._v(e._s(e._f("filterAreaType")(n.type)))])]}},{key:"unitCount",fn:function(t){var n=t.row;return[r("span",{staticClass:"click-item",on:{click:function(t){return e.routerJump("AreaPersonList",{zoneId:n.id})}}},[e._v(" "+e._s(n.unitCount)+" "),r("i",{staticClass:"el-icon-setting"})])]}},{key:"isValid",fn:function(t){var n=t.row;return[[0,1].includes(n.isValid)?[r("qz-dot-tag",{attrs:{type:["danger","success"][n.isValid]}},[e._v(e._s(e.statusMap[n.isValid]||"-"))])]:e._e()]}},{key:"action",fn:function(t){var n=t.row;return[r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.onOpenModal("view",n)}}},[e._v("详情")]),r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.onOpenModal("edit",n)}}},[e._v("编辑")]),n.parentId?r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.onMove(n,1)}}},[e._v("上移")]):e._e(),n.parentId?r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.onMove(n,0)}}},[e._v("下移")]):e._e(),n.parentId?r("el-button",{attrs:{type:"text"},on:{click:function(t){return e.onDelete(n)}}},[e._v("删除")]):e._e()]}}])}),r("org-edit-modal",{ref:"orgModalRef",on:{fresh:e.fetchTableData}})],1)},a=[],i=(r("4160"),r("b0c0"),r("159b"),r("2909")),o=(r("96cf"),r("1da1")),s=r("d4ec"),c=r("bee2"),u=r("99de"),l=r("7e84"),p=r("262e"),f=r("9ab4"),h=r("60a3"),d=r("6891"),b=function(){var e=this,t=e.$createElement,r=e._self._c||t;return e.visible?r("qz-drawer",{attrs:{visible:e.visible,"confirm-loading":e.confirmLoading,title:e.title},on:{"update:visible":function(t){e.visible=t},confirm:e.onOk}},["view"===e.mode?r("qz-form-info",{model:{value:e.orgFormInfo,callback:function(t){e.orgFormInfo=t},expression:"orgFormInfo"}}):r("qz-form",{ref:"areaFormRef",attrs:{form:e.form,rows:e.rows,width:"420px",footer:!1},scopedSlots:e._u([{key:"orgSelect",fn:function(){return[r("CwAreaChoose",{attrs:{props:e.orgProps},model:{value:e.form.parentId,callback:function(t){e.$set(e.form,"parentId",t)},expression:"form.parentId"}})]},proxy:!0}],null,!1,2641232131)})],1):e._e()},v=[],m=(r("a4d3"),r("4de4"),r("d81d"),r("e439"),r("dbb4"),r("b64b"),r("d3b7"),r("25f0"),r("ade3"));function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach((function(t){Object(m["a"])(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O={add:"新增区域",edit:"编辑区域",view:"查看区域"},w=function(e){function t(){var e;return Object(s["a"])(this,t),e=Object(u["a"])(this,Object(l["a"])(t).apply(this,arguments)),e.form={name:"",typeId:void 0,parentId:void 0},e.parentOrgRow={parentId:{label:"上级区域",customSlot:"orgSelect"}},e.baseFormRows={name:{label:"区域名称",type:"text",valid:{required:!0},attrs:{clearable:!0}},typeId:{label:"区域类型",type:"select",options:[],valid:{required:!0},listeners:{change:e.onAreaTypeChange}}},e.rows={},e.properties=[],e.orgFormInfo=[],e.mode="",e.orgTypeOptions=[],e.title="",e.visible=!1,e.confirmLoading=!1,e.orgProps={multiple:!1,emitPath:!1,checkStrictly:!0,label:"name",value:"id"},e}return Object(p["a"])(t,e),Object(c["a"])(t,[{key:"open",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t,r){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(this.mode=t,"view"===t){e.next=5;break}return r&&(this.form=y({},r)),e.next=5,this.fetchAreaTypes();case 5:"add"===t?this.getAddForm():this.fetchAreaDetail(r),this.rows=Object.assign({},this.baseFormRows,this.parentOrgRow),this.areaFormRef&&this.areaFormRef.reset(),this.title=O[t],this.visible=!0;case 10:case"end":return e.stop()}}),e,this)})));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"getAddForm",value:function(){this.form={name:"",typeId:void 0,parentId:void 0}}},{key:"fetchAreaDetail",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){var r,n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,this.properties=[],e.next=4,this.service.getAreaDetail({id:t.id});case 4:return r=e.sent,n=r.data,this.form=n,e.next=9,this.fetchOrgTypeDetail(this.form.typeId||"");case 9:"view"===this.mode?this.getOrgFormInfo():this.getFormItems(),e.next=14;break;case 12:e.prev=12,e.t0=e["catch"](0);case 14:case"end":return e.stop()}}),e,this,[[0,12]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getOrgFormInfo",value:function(){var e=this;this.orgFormInfo=[],this.orgFormInfo.push({label:"区域名称",value:this.form.name||"-"}),this.orgFormInfo.push({label:"区域类型",value:this.form.type||"-"}),this.properties.forEach((function(t){e.orgFormInfo.push({label:t.name,value:e.form[t.code]||"-"})}))}},{key:"fetchAreaTypes",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.service.getAreaTypeList({});case 3:t=e.sent,r=t.data,this.orgTypeOptions=r.map((function(e){return{label:e.name,value:e.id}})),this.baseFormRows["typeId"].options=this.orgTypeOptions,e.next=11;break;case 9:e.prev=9,e.t0=e["catch"](0);case 11:case"end":return e.stop()}}),e,this,[[0,9]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"onAreaTypeChange",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,this.fetchOrgTypeDetail(t);case 2:this.getFormItems();case 3:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()},{key:"getFormItems",value:function(){var e=Object.assign({},this.baseFormRows,1!==this.form.level?this.parentOrgRow:{});this.properties.forEach((function(t){e[t.code]={label:t.name,type:"text"}})),this.rows=Object.assign({},e)}},{key:"fetchOrgTypeDetail",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){var r,n,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,t){e.next=4;break}return this.properties=[],e.abrupt("return");case 4:return e.next=6,this.service.getAreaTypeDetail({id:t});case 6:r=e.sent,n=r.data,a=n.properties||[],this.properties=a.filter((function(e){return 0===e.status})),e.next=14;break;case 12:e.prev=12,e.t0=e["catch"](0);case 14:case"end":return e.stop()}}),e,this,[[0,12]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"onOk",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(e.prev=0,"view"===this.mode){e.next=17;break}return e.next=4,this.areaFormRef.validate();case 4:if(this.confirmLoading=!0,t=y({},this.form),r=t.parentId,"[object Array]"===Object.prototype.toString.call(r)&&(t.parentId=r[r.length-1]),!this.form.id){e.next=13;break}return e.next=11,this.service.updateArea(t);case 11:e.next=15;break;case 13:return e.next=15,this.service.addArea(t);case 15:this.$message.success("保存成功"),this.$emit("fresh");case 17:this.visible=!1,e.next=22;break;case 20:e.prev=20,e.t0=e["catch"](0);case 22:return e.prev=22,this.confirmLoading=!1,e.finish(22);case 25:case"end":return e.stop()}}),e,this,[[0,20,22,25]])})));function t(){return e.apply(this,arguments)}return t}()}]),t}(h["e"]);f["a"]([Object(h["d"])()],w.prototype,"areaFormRef",void 0),w=f["a"]([Object(h["a"])({name:"OrgEditModal",components:{}})],w);var k=w,j=k,x=r("2877"),I=Object(x["a"])(j,b,v,!1,null,"62fa27e8",null),R=I.exports,_=r("ae85"),D=function(e){function t(){var e;return Object(s["a"])(this,t),e=Object(u["a"])(this,Object(l["a"])(t).apply(this,arguments)),e.columns=d["b"],e.routerJump=e.$utils.routerJump,e.statusMap={0:"已停用",1:"已启用"},e}return Object(p["a"])(t,e),Object(c["a"])(t,[{key:"created",value:function(){this.fetchTableData()}},{key:"fetchTableData",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,this.loading=!0,e.next=4,this.service.areaTree({parentId:"",byLoginUser:!1,businessId:this.$store.state.user.userInfo.businessId,isValid:0});case 4:t=e.sent,r=t.data,this.tableData=r,this.loading=!1,e.next=13;break;case 10:e.prev=10,e.t0=e["catch"](0),this.loading=!1;case 13:case"end":return e.stop()}}),e,this,[[0,10]])})));function t(){return e.apply(this,arguments)}return t}()},{key:"onMove",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t,r){var n;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,n={id:t.id,sort:r},e.next=4,this.service.moveArea(n);case 4:this.$message.success("".concat(1===r?"上移":"下移","成功")),this.fetchTableData(),e.next=10;break;case 8:e.prev=8,e.t0=e["catch"](0);case 10:case"end":return e.stop()}}),e,this,[[0,8]])})));function t(t,r){return e.apply(this,arguments)}return t}()},{key:"getChildrenIds",value:function(e,t){var r=this;e.forEach((function(e){t.push(e.id),e.children&&e.children.length>0&&r.getChildrenIds(e.children,t)}))}},{key:"onDelete",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){var r;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.$confirm("确定删除".concat(t.name,"区域吗?"),{center:!0});case 3:return r=[t.id],e.next=6,this.service.deleteArea({ids:r});case 6:this.$message.success("删除成功"),this.fetchTableData(),e.next=12;break;case 10:e.prev=10,e.t0=e["catch"](0);case 12:case"end":return e.stop()}}),e,this,[[0,10]])})));function t(t){return e.apply(this,arguments)}return t}()},{key:"onOpenModal",value:function(e,t){this.orgModalRef.open(e,t)}},{key:"onToogleEdit",value:function(e,t){e.isEdit=t,this.tableData=Object(i["a"])(this.tableData)}},{key:"onUpdate",value:function(){var e=Object(o["a"])(regeneratorRuntime.mark((function e(t){return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.service.updateArea(t);case 3:this.$message.success("保存成功"),this.fetchTableData(),e.next=9;break;case 7:e.prev=7,e.t0=e["catch"](0);case 9:case"end":return e.stop()}}),e,this,[[0,7]])})));function t(t){return e.apply(this,arguments)}return t}()}]),t}(Object(h["b"])(Object(_["a"])()));f["a"]([Object(h["d"])()],D.prototype,"orgModalRef",void 0),D=f["a"]([Object(h["a"])({name:"Org",components:{OrgEditModal:R}})],D);var A=D,F=A,T=(r("6424"),Object(x["a"])(F,n,a,!1,null,"49053d50",null));t["default"]=T.exports}}]); |