You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
shipin/public/admin/system_static/js/chunk-17634f96.bf75bbd4.js

1 line
3.7 KiB

1 year ago
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-17634f96"],{"1a9e":function(t,e,i){},"3fe5":function(t,e,i){"use strict";i("1a9e")},b252:function(t,e,i){"use strict";i.r(e);var n=i("c7eb"),a=i("1da1"),c=i("5530"),r=(i("a434"),i("2f62")),s=i("90e7");c={name:"setting_dada",data:function(){return{grid:{xl:7,lg:7,md:12,sm:24,xs:24},loading:!1,columns1:[{title:"编号",key:"id",width:80},{title:"地区名称",key:"label",minWidth:300,tree:!0},{title:"上级名称",key:"parent_name",minWidth:300},{title:"操作",slot:"action",fixed:"right",minWidth:120}],cityLists:[],cityId:0}},computed:Object(c.a)(Object(c.a)({},Object(r.d)("media",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:"80px"},labelPosition:function(){return this.isMobile?"top":"right"}}),created:function(){this.getList(0)},methods:{cleanCache:function(){var t=this;Object(s.g)().then((function(e){t.$message.success(e.msg)})).catch((function(e){t.$message.success(e.msg)}))},add:function(t){var e=this;this.$modalForm(Object(s.e)(t)).then((function(){return e.getList(0)}))},lower:function(t){this.cityId=t,this.getList(t)},getList:function(t){var e=this;e.loading=!0,Object(s.h)(t).then(function(){var t=Object(a.a)(Object(n.a)().mark((function t(i){return Object(n.a)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.cityLists=i.data,e.loading=!1;case 2:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.loading=!1,e.$message.error(t.msg)}))},goBack:function(){this.cityId=0,this.getList(0)},edit:function(t){var e=this;this.$modalForm(Object(s.f)(t)).then((function(){return e.getList(e.cityId)}))},del:function(t,e,i){var n=this;e={title:e,num:i,url:"setting/city/del/".concat(t.city_id),method:"DELETE",ids:""};this.$modalSure(e).then((function(t){n.$message.success(t.msg),n.cityLists.splice(i,1),n.getList(n.cityId)})).catch((function(t){n.$message.error(t.msg)}))},handleLoadData:function(t,e,i){Object(s.h)(t.city_id).then((function(t){i(t.data)}))}}},i("3fe5"),r=i("2877"),i=Object(r.a)(c,(function(){var t=this,e=t._self._c;return e("div",[e("el-card",{staticClass:"ivu-mt",attrs:{bordered:!1,shadow:"never"}},[e("div",{staticClass:"acea-row row-between-wrapper mb20"},[e("el-row",[e("el-col",t._b({},"el-col",t.grid,!1),[e("div",{staticClass:"button acea-row row-middle"},[e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t.add(0)}}},[t._v("添加省份")]),e("el-button",{attrs:{type:"primary"},on:{click:t.cleanCache}},[t._v("清除缓存")])],1)])],1)],1),e("el-table",{attrs:{"row-key":"id",load:t.handleLoadData,"tree-props":{children:"children",hasChildren:"hasChildren"},data:t.cityLists,lazy:""}},[e("el-table-column",{attrs:{label:"编号",width:"120"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(i.row.id))])]}}])}),e("el-table-column",{attrs:{label:"地区名称","min-width":"300"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(i.row.label))])]}}])}),e("el-table-column",{attrs:{label:"上级名称","min-width":"300"},scopedSlots:t._u([{key:"default",fn:function(i){return[e("span",[t._v(t._s(i.row.parent_name))])]}}])}),e("el-table-column",{attrs:{label:"操作",fixed:"right",width:"170"},scopedSlots:t._u([{key:"default",fn:function(i){return[i.row.hasOwnProperty("children")?e("a",{on:{click:function(e){return t.add(i.row.city_id)}}},[t._v("添加")]):t._e(),i.row.hasOwnProperty("children")?e("el-divider",{attrs:{direction:"vertical"}}):t._e(),e("a",{on:{click:function(e){return t.edit(i.row.id)}}},[t._v("编辑")]),e("el-divider",{attrs:{direction:"vertical"}}),e("a",{on:{click:function(e){return t.del(i.row,"删除城市",i.$index)}}},[t._v("删除")])]}}])})],1)],1)],1)}),[],!1,null,"465a75f3",null);e.default=i.exports}}]);