1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-36e93b2c"],{"1b9f":function(e,t,i){},"333d":function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"pagination-container",class:{hidden:e.hidden}},[i("el-pagination",e._b({attrs:{background:e.background,"current-page":e.currentPage,"page-size":e.pageSize,layout:e.layout,"page-sizes":e.pageSizes,total:e.total},on:{"update:currentPage":function(t){e.currentPage=t},"update:current-page":function(t){e.currentPage=t},"update:pageSize":function(t){e.pageSize=t},"update:page-size":function(t){e.pageSize=t},"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}},"el-pagination",e.$attrs,!1))],1)},a=[];i("c5f6");Math.easeInOutQuad=function(e,t,i,n){return e/=n/2,e<1?i/2*e*e+t:(e--,-i/2*(e*(e-2)-1)+t)};var r=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function s(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function c(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function o(e,t,i){var n=c(),a=e-n,o=20,l=0;t="undefined"===typeof t?500:t;var d=function e(){l+=o;var c=Math.easeInOutQuad(l,n,a,t);s(c),l<t?r(e):i&&"function"===typeof i&&i()};d()}var l={name:"Pagination",props:{total:{required:!0,type:Number},page:{type:Number,default:1},limit:{type:Number,default:20},pageSizes:{type:Array,default:function(){return[12,24,36,48]}},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1}},computed:{currentPage:{get:function(){return this.page},set:function(e){this.$emit("update:page",e)}},pageSize:{get:function(){return this.limit},set:function(e){this.$emit("update:limit",e)}}},methods:{handleSizeChange:function(e){this.$emit("pagination",{page:this.currentPage,limit:e}),this.autoScroll&&o(0,800)},handleCurrentChange:function(e){this.$emit("pagination",{page:e,limit:this.pageSize}),this.autoScroll&&o(0,800)}}},d=l,u=(i("baa8"),i("2877")),p=Object(u["a"])(d,n,a,!1,null,"2424f858",null);t["a"]=p.exports},"5e6f":function(e,t,i){},6059:function(e,t,i){"use strict";i("5e6f")},"6bce":function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"app-container"},[i("el-row",{attrs:{gutter:10}},[i("el-col",{attrs:{md:6}},[i("el-card",[i("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[i("span",[e._v("字典类型")]),e._v(" "),e.checkPermission(["dicttype_add"])?i("el-button",{staticStyle:{float:"right",padding:"3px 0"},attrs:{type:"text",icon:"el-icon-plus"},on:{click:e.handleAddDictType}},[e._v("新增")]):e._e()],1),e._v(" "),i("el-tree",{directives:[{name:"loading",rawName:"v-loading",value:e.treeLoding,expression:"treeLoding"}],ref:"tree",staticClass:"filter-tree",staticStyle:{"margin-top":"10px"},attrs:{data:e.dictTypeData,"highlight-current":"","expand-on-click-node":!1,"filter-node-method":e.filterNode},on:{"node-click":e.handleDictTypeClick},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.node,a=t.data;return i("span",{staticClass:"custom-tree-node"},[i("span",[e._v(e._s(n.label))]),e._v(" "),i("span",[e.checkPermission(["dicttype_delete"])?i("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(t){return e.handleEditDictType(a)}}},[e._v("\n 编辑\n ")]):e._e()],1)])}}])})],1)],1),e._v(" "),i("el-col",{attrs:{md:18}},[i("el-card",[i("div",{staticClass:"clearfix",attrs:{slot:"header"},slot:"header"},[i("span",[e._v("字典详情")])]),e._v(" "),i("div",[e.checkPermission(["dic_create"])?i("el-button",{directives:[{name:"show",rawName:"v-show",value:e.listQuery.type,expression:"listQuery.type"}],attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:e.handleAddDict}},[e._v("新增")]):e._e()],1),e._v(" "),i("el-table",{directives:[{name:"show",rawName:"v-show",value:e.listQuery.type,expression:"listQuery.type"},{name:"loading",rawName:"v-loading",value:e.listLoading,expression:"listLoading"},{name:"el-height-adaptive-table",rawName:"v-el-height-adaptive-table",value:{bottomOffset:50},expression:"{bottomOffset: 50}"}],staticStyle:{width:"100%","margin-top":"10px"},attrs:{data:e.dictList,"highlight-current-row":"","row-key":"id",height:"100",stripe:"",border:"","default-expand-all":"","tree-props":{children:"children",hasChildren:"hasChildren"}}},[i("el-table-column",{attrs:{type:"index",width:"50"}}),e._v(" "),i("el-table-column",{attrs:{label:"代号/编号"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.code))]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"名称"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.name))]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"描述"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v(e._s(t.row.description))]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"是否有效"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.is_used?i("el-tag",{attrs:{type:"success"}},[e._v("有效")]):i("el-tag",{attrs:{type:"danger"}},[e._v("无效")])]}}])}),e._v(" "),i("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.is_superuser?e._e():i("el-button",{attrs:{disabled:!e.checkPermission(["dict_update"]),type:"primary",size:"small",icon:"el-icon-edit"},on:{click:function(i){return e.handleEdit(t)}}})]}}])})],1),e._v(" "),i("p",{directives:[{name:"show",rawName:"v-show",value:!e.listQuery.type,expression:"!listQuery.type"}]},[e._v("点击左侧类型查看字典")])],1)],1)],1),e._v(" "),i("el-dialog",{attrs:{visible:e.dgV1,title:"edit"===e.dgT1?"编辑字典类型":"新建字典类型"},on:{"update:visible":function(t){e.dgV1=t}}},[i("el-form",{ref:"Form1",attrs:{model:e.dicttype,"label-width":"80px","label-position":"right",rules:e.rule1}},[i("el-form-item",{attrs:{label:"名称",prop:"name"}},[i("el-input",{attrs:{placeholder:"名称"},model:{value:e.dicttype.name,callback:function(t){e.$set(e.dicttype,"name",t)},expression:"dicttype.name"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"代号",prop:"code"}},[i("el-input",{attrs:{placeholder:"代号"},model:{value:e.dicttype.code,callback:function(t){e.$set(e.dicttype,"code",t)},expression:"dicttype.code"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"父级",prop:"parent"}},[i("treeselect",{attrs:{multiple:!1,options:e.dictTypeData,placeholder:"父级"},model:{value:e.dicttype.parent,callback:function(t){e.$set(e.dicttype,"parent",t)},expression:"dicttype.parent"}})],1)],1),e._v(" "),i("span",{attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"danger"},on:{click:function(t){e.dgV1=!1}}},[e._v("取消")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.confirm1("Form1")}}},[e._v("确认")])],1)],1),e._v(" "),i("el-dialog",{attrs:{visible:e.dgV2,title:"edit"===e.dgT2?"编辑字典":"新建字典"},on:{"update:visible":function(t){e.dgV2=t}}},[i("el-form",{ref:"Form2",attrs:{model:e.dict,"label-width":"80px","label-position":"right",rules:e.rule2}},[i("el-form-item",{attrs:{label:"编号",prop:"code"}},[i("el-input",{attrs:{placeholder:"编号"},model:{value:e.dict.code,callback:function(t){e.$set(e.dict,"code",t)},expression:"dict.code"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"名称",prop:"name"}},[i("el-input",{attrs:{type:"textarea",placeholder:"名称"},model:{value:e.dict.name,callback:function(t){e.$set(e.dict,"name",t)},expression:"dict.name"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"描述",prop:"description"}},[i("el-input",{attrs:{type:"textarea",placeholder:"描述"},model:{value:e.dict.description,callback:function(t){e.$set(e.dict,"description",t)},expression:"dict.description"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"父级",prop:"parent"}},[i("treeselect",{attrs:{multiple:!1,options:e.dictList,placeholder:"父级"},model:{value:e.dict.parent,callback:function(t){e.$set(e.dict,"parent",t)},expression:"dict.parent"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"排序",prop:"sort"}},[i("el-input-number",{attrs:{min:1,max:999},model:{value:e.dict.sort,callback:function(t){e.$set(e.dict,"sort",t)},expression:"dict.sort"}})],1),e._v(" "),i("el-form-item",{attrs:{label:"是否有效",prop:"is_used"}},[i("el-switch",{model:{value:e.dict.is_used,callback:function(t){e.$set(e.dict,"is_used",t)},expression:"dict.is_used"}})],1)],1),e._v(" "),i("span",{attrs:{slot:"footer"},slot:"footer"},[i("el-button",{attrs:{type:"danger"},on:{click:function(t){e.dgV2=!1}}},[e._v("取消")]),e._v(" "),i("el-button",{attrs:{type:"primary"},on:{click:function(t){return e.confirm2("Form2")}}},[e._v("确认")])],1)],1)],1)},a=[],r=(i("96cf"),i("1da1")),s=i("b775");function c(e){return Object(s["a"])({url:"/system/dicttype/",method:"get",params:e})}function o(e){return Object(s["a"])({url:"/system/dicttype/",method:"post",data:e})}function l(e,t){return Object(s["a"])({url:"/system/dicttype/".concat(e,"/"),method:"put",data:t})}function d(e){return Object(s["a"])({url:"/system/dict/",method:"get",params:e})}function u(e){return Object(s["a"])({url:"/system/dict/",method:"post",data:e})}function p(e,t){return Object(s["a"])({url:"/system/dict/".concat(e,"/"),method:"put",data:t})}function f(e){return Object(s["a"])({url:"/system/dict/".concat(e,"/"),method:"delete"})}var m=i("ed08"),h=i("e350"),g=i("333d"),v=i("ca17"),y=i.n(v),b=(i("542c"),{id:"",name:"",code:"",parent:null}),_={id:"",name:"",description:"",sort:1,type:null,is_used:!0,parent:null},w={components:{Pagination:g["a"],Treeselect:y.a},data:function(){return{dicttype:Object.assign({},b),dict:Object.assign({},_),search:"",dictList:[],listLoading:!0,listQuery:{},dgV1:!1,dgT1:"new",rule1:{name:[{required:!0,message:"请输入名称",trigger:"blur"}],code:[{required:!0,message:"请输入代号",trigger:"change"}]},dgV2:!1,dgT2:"new",rule2:{name:[{required:!0,message:"请输入名称",trigger:"blur"}]},filterDictTypeText:"",treeLoding:!1,dictTypeData:[]}},computed:{},watch:{filterDictTypeText:function(e){this.$refs.tree.filter(e)}},created:function(){this.getDictTypeList()},methods:{checkPermission:h["a"],filterNode:function(e,t){return!e||-1!==t.label.indexOf(e)},handleDictTypeClick:function(e,t,i){this.listQuery.type=e.id,this.getList()},getList:function(){var e=this;this.listLoading=!0,d(this.listQuery).then((function(t){t.data&&(e.dictList=Object(m["b"])(t.data),e.listLoading=!1)})).catch((function(t){e.listLoading=!1}))},getDictTypeList:function(){var e=this;this.treeLoding=!0,c().then((function(t){e.dictTypeData=Object(m["b"])(t.data),e.treeLoding=!1}))},handleAddDictType:function(){var e=this;this.dicttype=Object.assign({},b),this.dgT1="new",this.dgV1=!0,this.$nextTick((function(){e.$refs["Form1"].clearValidate()}))},handleAddDict:function(){var e=this;this.dict=Object.assign({},_),this.dict.type=this.listQuery.type,this.dgT2="new",this.dgV2=!0,this.$nextTick((function(){e.$refs["Form2"].clearValidate()}))},handleEdit:function(e){var t=this;this.dict=Object.assign({},e.row),this.dgT2="edit",this.dgV2=!0,this.$nextTick((function(){t.$refs["Form2"].clearValidate()}))},handleEditDictType:function(e){var t=this;this.dicttype=Object.assign({},e),this.dgT1="edit",this.dgV1=!0,this.$nextTick((function(){t.$refs["Form1"].clearValidate()}))},handleDelete:function(e){var t=this;this.$confirm("确认删除?","警告",{confirmButtonText:"确认",cancelButtonText:"取消",type:"error"}).then(Object(r["a"])(regeneratorRuntime.mark((function i(){var n,a;return regeneratorRuntime.wrap((function(i){while(1)switch(i.prev=i.next){case 0:return i.next=2,f(e.row.id);case 2:n=i.sent,a=n.code,a>=200&&(t.dictList.splice(e.row.index,1),t.$message({type:"success",message:"成功删除!"}));case 5:case"end":return i.stop()}}),i)})))).catch((function(e){console.error(e)}))},confirm1:function(){var e=Object(r["a"])(regeneratorRuntime.mark((function e(t){var i=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.$refs[t].validate((function(e){if(!e)return!1;var t="edit"===i.dgT1;t?l(i.dicttype.id,i.dicttype).then((function(e){i.getDictTypeList(),i.dgV1=!1,i.$message({message:"编辑成功",type:"success"})})).catch((function(e){})):o(i.dicttype).then((function(e){i.getDictTypeList(),i.dgV1=!1,i.$message({message:"新增成功",type:"success"})})).catch((function(e){}))}));case 1:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}(),confirm2:function(){var e=Object(r["a"])(regeneratorRuntime.mark((function e(t){var i=this;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:this.$refs[t].validate((function(e){if(!e)return!1;var t="edit"===i.dgT2;t?p(i.dict.id,i.dict).then((function(e){i.getList(),i.dgV2=!1,i.$message({message:"编辑成功",type:"success"})})).catch((function(e){})):u(i.dict).then((function(e){i.getList(),i.dgV2=!1,i.$message({message:"新增成功",type:"success"})})).catch((function(e){}))}));case 1:case"end":return e.stop()}}),e,this)})));function t(t){return e.apply(this,arguments)}return t}()}},x=w,k=(i("6059"),i("2877")),T=Object(k["a"])(x,n,a,!1,null,null,null);t["default"]=T.exports},aa77:function(e,t,i){var n=i("5ca1"),a=i("be13"),r=i("79e5"),s=i("fdef"),c="["+s+"]",o="
",l=RegExp("^"+c+c+"*"),d=RegExp(c+c+"*$"),u=function(e,t,i){var a={},c=r((function(){return!!s[e]()||o[e]()!=o})),l=a[e]=c?t(p):s[e];i&&(a[i]=l),n(n.P+n.F*c,"String",a)},p=u.trim=function(e,t){return e=String(a(e)),1&t&&(e=e.replace(l,"")),2&t&&(e=e.replace(d,"")),e};e.exports=u},baa8:function(e,t,i){"use strict";i("1b9f")},c5f6:function(e,t,i){"use strict";var n=i("7726"),a=i("69a8"),r=i("2d95"),s=i("5dbc"),c=i("6a99"),o=i("79e5"),l=i("9093").f,d=i("11e9").f,u=i("86cc").f,p=i("aa77").trim,f="Number",m=n[f],h=m,g=m.prototype,v=r(i("2aeb")(g))==f,y="trim"in String.prototype,b=function(e){var t=c(e,!1);if("string"==typeof t&&t.length>2){t=y?t.trim():p(t,3);var i,n,a,r=t.charCodeAt(0);if(43===r||45===r){if(i=t.charCodeAt(2),88===i||120===i)return NaN}else if(48===r){switch(t.charCodeAt(1)){case 66:case 98:n=2,a=49;break;case 79:case 111:n=8,a=55;break;default:return+t}for(var s,o=t.slice(2),l=0,d=o.length;l<d;l++)if(s=o.charCodeAt(l),s<48||s>a)return NaN;return parseInt(o,n)}}return+t};if(!m(" 0o1")||!m("0b1")||m("+0x1")){m=function(e){var t=arguments.length<1?0:e,i=this;return i instanceof m&&(v?o((function(){g.valueOf.call(i)})):r(i)!=f)?s(new h(b(t)),i,m):b(t)};for(var _,w=i("9e1e")?l(h):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),x=0;w.length>x;x++)a(h,_=w[x])&&!a(m,_)&&u(m,_,d(h,_));m.prototype=g,g.constructor=m,i("2aba")(n,f,m)}},e350:function(e,t,i){"use strict";i.d(t,"a",(function(){return a}));i("6762"),i("2fdb");var n=i("4360");function a(e){if(e&&e instanceof Array&&e.length>0){var t=n["a"].getters&&n["a"].getters.perms,i=e;if(t.includes("admin"))return!0;var a=t.some((function(e){return i.includes(e)}));return!!a}return console.error("need perms! Like v-permission=\"['admin','editor']\""),!1}},fdef:function(e,t){e.exports="\t\n\v\f\r \u2028\u2029\ufeff"}}]); |