44.c85169172ecd296370a7.js 4.4 KB

12
  1. webpackJsonp([44],{ahhw:function(e,t){},mlS1:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i("woOf"),a=i.n(n),s=i("Og03"),o=i("xT6B"),l={name:null,sort:0},r={name:"resourceCategoryList",data:function(){return{list:null,listLoading:!1,dialogVisible:!1,isEdit:!1,resourceCategory:a()({},l)}},created:function(){this.getList()},filters:{formatDateTime:function(e){if(null==e||""===e)return"--";var t=new Date(e);return Object(o.a)(t,"yyyy-MM-dd hh:mm:ss")}},methods:{handleAdd:function(){this.dialogVisible=!0,this.isEdit=!1,this.resourceCategory=a()({},l)},handleUpdate:function(e,t){this.dialogVisible=!0,this.isEdit=!0,this.resourceCategory=a()({},t)},handleDelete:function(e,t){var i=this;this.$confirm("是否要删除该分类?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){Object(s.b)(t.id).then(function(e){i.$message({type:"success",message:"删除成功!"}),i.getList()})})},handleDialogConfirm:function(){var e=this;this.$confirm("是否要确认?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){e.isEdit?Object(s.d)(e.resourceCategory.id,e.resourceCategory).then(function(t){e.$message({message:"修改成功!",type:"success"}),e.dialogVisible=!1,e.getList()}):Object(s.a)(e.resourceCategory).then(function(t){e.$message({message:"添加成功!",type:"success"}),e.dialogVisible=!1,e.getList()})})},getList:function(){var e=this;this.listLoading=!0,Object(s.c)({}).then(function(t){e.listLoading=!1,e.list=t.data})}}},c={render:function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"app-container"},[i("el-card",{staticClass:"operate-container",attrs:{shadow:"never"}},[i("i",{staticClass:"el-icon-tickets"}),e._v(" "),i("span",[e._v("数据列表")]),e._v(" "),i("el-button",{staticClass:"btn-add",attrs:{size:"mini"},on:{click:function(t){e.handleAdd()}}},[e._v("添加")])],1),e._v(" "),i("div",{staticClass:"table-container"},[i("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"}],ref:"resourceCategoryTable",staticStyle:{width:"100%"},attrs:{data:e.list,border:""}},[i("el-table-column",{attrs:{label:"编号",width:"100",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.id))]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"名称",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.name))]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"创建时间",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(e._f("formatDateTime")(t.row.createTime)))]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"排序",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.sort))]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"操作",width:"180",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){return[i("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(i){e.handleUpdate(t.$index,t.row)}}},[e._v("编辑\n ")]),e._v(" "),i("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(i){e.handleDelete(t.$index,t.row)}}},[e._v("删除\n ")])]}}])})],1)],1),e._v(" "),i("el-dialog",{attrs:{title:"添加分类",visible:e.dialogVisible,width:"40%"},on:{"update:visible":function(t){e.dialogVisible=t}}},[i("el-form",{ref:"resourceCategoryForm",attrs:{model:e.resourceCategory,"label-width":"150px",size:"small"}},[i("el-form-item",{attrs:{label:"名称:"}},[i("el-input",{staticStyle:{width:"250px"},model:{value:e.resourceCategory.name,callback:function(t){e.$set(e.resourceCategory,"name",t)},expression:"resourceCategory.name"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"排序:"}},[i("el-input",{staticStyle:{width:"250px"},model:{value:e.resourceCategory.sort,callback:function(t){e.$set(e.resourceCategory,"sort",t)},expression:"resourceCategory.sort"}})],1)],1),e._v(" "),i("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{size:"small"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),e._v(" "),i("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){e.handleDialogConfirm()}}},[e._v("确 定")])],1)],1)],1)},staticRenderFns:[]};var u=i("VU/8")(r,c,!1,function(e){i("ahhw")},null,null);t.default=u.exports}});
  2. //# sourceMappingURL=44.c85169172ecd296370a7.js.map