emp_ui/dist/static/js/chunk-646fecbc.22318a9e.js

1 line
6.6 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-646fecbc"],{"06fa":function(e,t,l){},8093:function(e,t,l){"use strict";l("06fa")},ab72:function(e,t,l){"use strict";l.r(t);var i=function(){var e=this,t=e.$createElement,l=e._self._c||t;return l("div",{staticClass:"SkillType-container"},[l("el-form",{staticClass:"header-buttons",attrs:{"label-width":"80px",inline:!0}},[l("el-button",{attrs:{type:"primary"},on:{click:e.showAddSkillTypeDialog}},[e._v("添 加 ")]),l("el-button",{attrs:{type:"danger",disabled:0===e.selectedSkillType.length},on:{click:e.deleteSkillTypesInBatches}},[e._v("批量删除 ")])],1),l("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loadingOfGetSkillTypeList,expression:"loadingOfGetSkillTypeList"}],staticStyle:{width:"100%"},attrs:{data:e.SkillTypes,stripe:"",border:""},on:{"selection-change":e.handleSelectionChange}},[l("el-table-column",{attrs:{type:"selection",width:"55"}}),l("el-table-column",{attrs:{type:"index",label:"序号",width:"80",align:"center"}}),l("el-table-column",{attrs:{"header-align":"center",align:"center",prop:"name",label:"技能种类名称"}}),l("el-table-column",{attrs:{"header-align":"center",align:"center",prop:"description",label:"技能种类描述"}}),l("el-table-column",{attrs:{"header-align":"center",align:"center",prop:"createTime",label:"创建时间"}}),l("el-table-column",{attrs:{"header-align":"center",align:"center",prop:"updateTime",label:"修改时间"}}),l("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:e._u([{key:"default",fn:function(t){var i=t.row;return[l("el-button",{attrs:{type:"edit",icon:"el-icon-edit",size:"mini",title:"修改技能种类"},on:{click:function(t){return e.updateSkillType(i)}}}),l("el-button",{attrs:{type:"danger",icon:"el-icon-delete",size:"mini",title:"删除技能种类"},on:{click:function(t){return e.deleteSkillType(i)}}})]}}])})],1),l("el-dialog",{attrs:{title:e.SkillType.id?"修改技能种类":"添加技能种类",visible:e.dialogSkillTypeVisible,"close-on-click-modal":!1},on:{"update:visible":function(t){e.dialogSkillTypeVisible=t},close:function(t){return e.cancelButtonOfAddOrUpdateDialog()}}},[l("div",[l("el-form",{ref:"skilltypeForm",attrs:{model:e.SkillType,rules:e.skilltypeRules,"label-width":"120px"}},[l("el-form-item",{attrs:{label:"技能种类名称",prop:"name"}},[l("el-input",{model:{value:e.SkillType.name,callback:function(t){e.$set(e.SkillType,"name",t)},expression:"SkillType.name"}})],1),l("el-form-item",{attrs:{label:"技能种类描述",prop:"description"}},[l("el-input",{model:{value:e.SkillType.description,callback:function(t){e.$set(e.SkillType,"description",t)},expression:"SkillType.description"}})],1)],1)],1),l("div",{attrs:{slot:"footer"},slot:"footer"},[l("el-button",{attrs:{type:"primary",loading:e.loadingOfSaveSkillTypeButton},on:{click:function(t){return e.saveButtonOfAddEditDialog()}}},[e._v("保 存")]),l("el-button",{on:{click:function(t){return e.cancelButtonOfAddOrUpdateDialog()}}},[e._v("取 消")])],1)])],1)},n=[],a=l("5530"),s=l("c7eb"),c=l("1da1"),r=(l("d81d"),{name:"SkillTypeList",data:function(){return{loadingOfSaveSkillTypeButton:!1,dialogSkillTypeVisible:!1,loadingOfGetSkillTypeList:!1,SkillType:{},SkillTypes:[],selectedSkillType:[],skilltypeRules:{name:[{required:!0,message:"技能种类名称不能为空"}],description:[{}]}}},mounted:function(){this.fetchSkillTypeList()},methods:{fetchSkillTypeList:function(){var e=this;return Object(c["a"])(Object(s["a"])().mark((function t(){var l;return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.loadingOfGetSkillTypeList=!0,t.next=3,e.$API.skilltype.reqGetSkillTypeList();case 3:l=t.sent,0==l.code&&(e.SkillTypes=l.data),e.loadingOfGetSkillTypeList=!1;case 6:case"end":return t.stop()}}),t)})))()},showAddSkillTypeDialog:function(){this.dialogSkillTypeVisible=!0,this.$refs.skilltypeForm&&this.$refs.skilltypeForm.clearValidate()},saveButtonOfAddEditDialog:function(){var e=this;return Object(c["a"])(Object(s["a"])().mark((function t(){return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$refs.skilltypeForm.validate(function(){var t=Object(c["a"])(Object(s["a"])().mark((function t(l){var i;return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!l){t.next=11;break}return e.loadingOfSaveSkillTypeButton=!0,console.log(e.SkillType),t.next=5,e.$API.skilltype[e.SkillType.id?"reqUpdateSkillType":"reqAddSkillType"](e.SkillType);case 5:i=t.sent,0==i.code&&e.$message({type:"success",message:"".concat(e.SkillType.id?"修改":"添加","技能种类成功!")}),e.SkillType={},e.loadingOfSaveSkillTypeButton=!1,e.dialogSkillTypeVisible=!1,e.fetchSkillTypeList();case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 1:case"end":return t.stop()}}),t)})))()},updateSkillType:function(e){var t=this;this.dialogSkillTypeVisible=!0,this.$nextTick((function(){t.$refs.skilltypeForm.clearValidate()})),this.SkillType=Object(a["a"])({},e),this.$refs.skilltypeForm.clearValidate()},deleteSkillType:function(e){var t=this;this.$confirm("您确定要删除此技能种类?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(c["a"])(Object(s["a"])().mark((function l(){var i,n;return Object(s["a"])().wrap((function(l){while(1)switch(l.prev=l.next){case 0:return i=[e.id],l.next=3,t.$API.skilltype.reqDeleteSkillType(i);case 3:n=l.sent,0==n.code&&(t.$message({type:"success",message:"技能种类删除成功!"}),t.fetchSkillTypeList());case 5:case"end":return l.stop()}}),l)})))).catch((function(){t.$message({type:"info",message:"已取消删除技能种类"})}))},handleSelectionChange:function(e){this.selectedSkillType=e,console.log(e)},deleteSkillTypesInBatches:function(){var e=this;this.$confirm("此操作将永久删除已选中的技能种类, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(Object(c["a"])(Object(s["a"])().mark((function t(){var l,i;return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return l=e.selectedSkillType.map((function(e){return e.id})),t.next=3,e.$API.skilltype.reqDeleteSkillType(l);case 3:i=t.sent,0==i.code&&(e.$message({type:"success",message:"批量删除成功!"}),e.fetchSkillTypeList());case 5:case"end":return t.stop()}}),t)})))).catch((function(){e.$message({type:"info",message:"已取消批量删除!"}),console.log("选择了取消")}))},cancelButtonOfAddOrUpdateDialog:function(){this.SkillType={},this.dialogSkillTypeVisible=!1,this.allPermissionsLeafIds=[]}}}),o=r,p=(l("8093"),l("2877")),d=Object(p["a"])(o,i,n,!1,null,"3be2b7e9",null);t["default"]=d.exports}}]);