1 line
5.2 KiB
JavaScript
1 line
5.2 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([["MiWS"],{MiWS:function(e,t,i){"use strict";i.r(t);var r=i("14Xm"),a=i.n(r),n=i("D3Ub"),s=i.n(n),d=i("t3Un");function c(e){return Object(d.a)({url:"/gaeaDict/pageList",method:"GET",params:e})}function l(e){return Object(d.a)({url:"/gaeaDict",method:"POST",data:e})}function u(e){return Object(d.a)({url:"/gaeaDict",method:"PUT",data:e})}function o(e){return Object(d.a)({url:"/gaeaDict/"+e.id,method:"get",params:{accessKey:e.accessKey}})}function p(e){return Object(d.a)({url:"/gaeaDict/delete/batch",method:"POST",data:e})}function m(e){return Object(d.a)({url:"/gaeaDict/freshDict",method:"POST",data:e})}var f={name:"Dict",components:{anjiCrud:i("sYqA").default},data:function(){var e=this,t=this;return{crudOption:{title:"数据字典",labelWidth:"120px",queryFormFields:[{inputType:"input",label:"字典名称",field:"dictName"},{inputType:"input",label:"字典编码",field:"dictCode"}],queryFormChange:function(e,i,r){e.project&&t.$store.commit("user/SET_PROJECT",e.project)},tableButtons:[{label:"刷新字典项",type:"primary",permission:"dictManage:fresh",icon:"el-icon-edit",plain:!0,click:this.dictRefresh},{label:"新增",type:"",permission:"dictManage:insert",icon:"el-icon-plus",plain:!0,click:function(){return e.$refs.listPage.handleOpenEditView("add")}},{label:"删除",type:"danger",permission:"dictManage:delete",icon:"el-icon-delete",plain:!1,click:function(){return e.$refs.listPage.handleDeleteBatch()}}],rowButtons:[{label:"编辑",permission:"dictManage:update",click:function(t){return e.$refs.listPage.handleOpenEditView("edit",t)}},{label:"编辑字典项",permission:"dictItemManage:query",click:this.editItem},{label:"刷新字典项",permission:"dictManage:fresh",click:this.itemRefresh},{label:"删除",permission:"dictManage:delete",click:function(t){return e.$refs.listPage.handleDeleteBatch(t)}}],buttons:{query:{api:c,permission:"dictManage:query"},queryByPrimarykey:{api:o,permission:"dictManage:query"},add:{api:l,permission:"dictManage:insert"},delete:{api:p,permission:"dictManage:delete"},edit:{api:u,permission:"dictManage:update"},rowButtonsWidth:150},columns:[{label:"",field:"id",primaryKey:!0,tableHide:!0,editHide:!0},{label:"字典名称",placeholder:"",field:"dictName",editField:"dictName",inputType:"input",rules:[{required:!0,message:"字典名称不能为空",trigger:"blur"},{min:1,max:64,message:"不超过64个字符",trigger:"blur"}],disabled:!1},{label:"字典编码",placeholder:"",field:"dictCode",editField:"dictCode",inputType:"input",rules:[{required:!0,message:"字典编码不能为空",trigger:"blur"},{min:1,max:64,message:"不超过64个字符",trigger:"blur"}],disabled:"disableOnEdit"},{label:"描述",placeholder:"",field:"remark",editField:"remark",inputType:"input",rules:[{min:1,max:64,message:"不超过64个字符",trigger:"blur"}],disabled:!1},{label:"创建时间",placeholder:"",field:"createTime",editField:"createTime",inputType:"input",disabled:!1,editHide:!0},{label:"创建人",placeholder:"",field:"createBy",editField:"createBy",inputType:"input",disabled:!1,editHide:!0},{label:"更新时间",placeholder:"",field:"updateTime",editField:"updateTime",inputType:"input",disabled:!1,editHide:!0},{label:"更新人",placeholder:"",field:"updateBy",editField:"updateBy",inputType:"input",disabled:!1,editHide:!0}]}}},methods:{dictRefresh:function(){var e=this;return s()(a.a.mark(function t(){var i,r,n;return a.a.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return i=e.$refs.listPage.checkRecords,r=[],i.length>0&&(r=i.map(function(e){return e.dictCode})),t.next=5,m(r);case 5:if(n=t.sent,"200"==n.code){t.next=9;break}return t.abrupt("return");case 9:e.$message.success("刷新成功");case 10:case"end":return t.stop()}},t,e)}))()},itemRefresh:function(e){var t=this;return s()(a.a.mark(function i(){var r,n,s;return a.a.wrap(function(i){for(;;)switch(i.prev=i.next){case 0:return n=[],(r=e).length>0&&(n=r.map(function(e){return e.dictCode})),i.next=5,m(n);case 5:if(s=i.sent,"200"==s.code){i.next=9;break}return i.abrupt("return");case 9:t.$message.success("刷新成功");case 10:case"end":return i.stop()}},i,t)}))()},editItem:function(e){this.$router.push({path:"/system/dictItem",query:{dictCode:e.dictCode,project:this.$store.state.user.project}})}}},h=i("KHd+"),b=Object(h.a)(f,function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("anji-crud",{ref:"listPage",attrs:{option:e.crudOption},scopedSlots:e._u([{key:"buttonLeftOnTable",fn:function(){return[i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"dictManage:fresh",expression:"'dictManage:fresh'"}],attrs:{type:"primary",icon:"el-icon-edit"},on:{click:e.dictRefresh}},[e._v("刷新字典项\n ")])]},proxy:!0},{key:"rowButtonInMore",fn:function(t){return[i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"dictItemManage:query",expression:"'dictItemManage:query'"}],attrs:{type:"text"},on:{click:function(i){return e.editItem(t)}}},[e._v("编辑字典项")]),e._v(" "),i("el-button",{directives:[{name:"permission",rawName:"v-permission",value:"dictManage:fresh",expression:"'dictManage:fresh'"}],attrs:{type:"text"},on:{click:function(i){return e.itemRefresh(t)}}},[e._v("刷新字典项")])]}}])})},[],!1,null,null,null);b.options.__file="index.vue";t.default=b.exports}}]); |