| 1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-19c7a842"],{"23fc":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"divBox"},[a("el-card",[a("div",{staticClass:"mb20"},[a("el-button",{attrs:{size:"small",type:"primary"},on:{click:t.onAdd}},[t._v("添加分类")])],1),t._v(" "),a("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],attrs:{data:t.tableData.data,size:"small","row-key":"id","default-expand-all":!1,"tree-props":{children:"children",hasChildren:"hasChildren"}}},[a("el-table-column",{attrs:{prop:"id",label:"ID","min-width":"60"}}),t._v(" "),a("el-table-column",{attrs:{prop:"name",label:"名称","min-width":"150"}}),t._v(" "),a("el-table-column",{attrs:{prop:"type",label:"类型","min-width":"100"}}),t._v(" "),a("el-table-column",{attrs:{prop:"status",label:"是否显示","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-switch",{attrs:{"active-value":1,"inactive-value":0,"active-text":"显示","inactive-text":"隐藏",width:55},on:{change:function(a){return t.onchangeIsShow(e.row)}},model:{value:e.row.status,callback:function(a){t.$set(e.row,"status",a)},expression:"scope.row.status"}})]}}])}),t._v(" "),a("el-table-column",{attrs:{prop:"add_time",label:"添加时间","min-width":"150"}}),t._v(" "),a("el-table-column",{attrs:{label:"操作","min-width":"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.edit(e.row)}}},[t._v("编辑")]),t._v(" "),a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return t.handleDelete(e.row,e.$index)}}},[t._v("删除")])]}}])})],1)],1)],1)},i=[],s=a("f478"),l=a("83d6"),o={name:"PlantCategory",data:function(){return{roterPre:l["roterPre"],listLoading:!0,tableData:{data:[]},tableFrom:{page:1,limit:20}}},mounted:function(){this.getList()},methods:{getList:function(){var t=this;this.listLoading=!0,Object(s["S"])(this.tableFrom).then((function(e){t.tableData.data=e.data,t.listLoading=!1})).catch((function(e){t.listLoading=!1,t.$message.error(e.message)}))},onAdd:function(){var t=this;this.$modalForm(Object(s["c"])()).then((function(){return t.getList()}))},edit:function(t){var e=this;this.$modalForm(Object(s["r"])(t.id)).then((function(){return e.getList()}))},onchangeIsShow:function(t){var e=this;Object(s["T"])(t.id,t.status).then((function(t){var a=t.message;e.$message.success(a),e.getList()})).catch((function(t){var a=t.message;e.$message.error(a)}))},handleDelete:function(t,e){var a=this;this.$modalSure("删除该分类吗").then((function(){Object(s["i"])(t.id).then((function(t){var e=t.message;a.$message.success(e),a.getList()})).catch((function(t){var e=t.message;a.$message.error(e)}))}))}}},r=o,c=(a("2aa9"),a("2877")),u=Object(c["a"])(r,n,i,!1,null,"d2e5fb2a",null);e["default"]=u.exports},"2aa9":function(t,e,a){"use strict";a("88fd")},"88fd":function(t,e,a){}}]);
|