启程易购后端代码
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.
 
 
 
 
 
 
qicheng_shop_backend/public/system/js/chunk-2d213a3e.22c59bbc.js

1 lines
2.8 KiB

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d213a3e"],{ae15:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"divBox"},[n("el-card",[n("div",{staticClass:"mb20"},[n("el-button",{attrs:{size:"small",type:"primary"},on:{click:function(e){return t.onAdd(0)}}},[t._v("添加城市")])],1),t._v(" "),n("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:t.tableData.data,size:"small","row-key":"id",lazy:"",load:t.load,"tree-props":{children:"children"}}},[n("el-table-column",{attrs:{prop:"name",label:"地区名称","min-width":"250"}}),t._v(" "),n("el-table-column",{attrs:{prop:"parent.name",label:"上级名称","min-width":"250"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(e.row.parent&&e.row.parent.name||"中国"))])]}}])}),t._v(" "),n("el-table-column",{attrs:{label:"操作","min-width":"100",fixed:"right"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return t.onAdd(e.row.id)}}},[t._v("添加")]),t._v(" "),n("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return t.onEdit(e.row.id)}}},[t._v("编辑")]),t._v(" "),n("el-button",{attrs:{type:"text",size:"small"},on:{click:function(n){return t.handleDelete(e.row.id,e.$index,e.row)}}},[t._v("删除")])]}}])})],1)],1)],1)},i=[],l=n("8593"),r={name:"CityList",data:function(){return{listLoading:!0,tableData:{data:[],total:0},childrenData:[],tableFrom:{page:1,limit:20}}},mounted:function(){this.getList(0)},methods:{getList:function(t){var e=this;this.listLoading=!0,Object(l["m"])(t).then((function(t){e.tableData.data=t.data,e.listLoading=!1})).catch((function(t){e.listLoading=!1,e.$message.error(t.message)}))},getChildren:function(t){var e=this;Object(l["m"])(t).then((function(t){e.childrenData=t.data})).catch((function(t){e.$message.error(t.message)}))},load:function(t,e,n){var a=this;a.getChildren(t.id),setTimeout((function(){n(a.childrenData)}),1e3)},onAdd:function(t){var e=this;this.$modalForm(Object(l["k"])(t)).then((function(){return e.getList(0)}))},onEdit:function(t){var e=this;this.$modalForm(Object(l["n"])(t)).then((function(){return e.getList(0)}))},handleDelete:function(t,e,n){var a=this;this.$modalSure("确定删除该城市").then((function(){Object(l["l"])(t).then((function(t){var i=t.message;if(n.parent){var l=a.childrenData.map((function(t){return t})).indexOf(n);a.childrenData.splice(l,1)}else a.tableData.data.splice(e,1);a.$message.success(i)})).catch((function(t){var e=t.message;a.$message.error(e)}))}))}}},s=r,o=n("2877"),c=Object(o["a"])(s,a,i,!1,null,"4e3ac882",null);e["default"]=c.exports}}]);