catchAdmin/public/dist/js/chunk-770da3a4.52d43f20.js
2020-01-06 17:42:51 +08:00

1 line
12 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-770da3a4"],{"0feb":function(e,t,r){"use strict";r.d(t,"b",(function(){return n})),r.d(t,"c",(function(){return i})),r.d(t,"d",(function(){return o})),r.d(t,"a",(function(){return l}));var a=r("b775");function n(e){return Object(a["b"])({url:"/permissions",method:"get",params:e})}function i(e){return Object(a["b"])({url:"/permissions",method:"post",data:e})}function o(e,t){return Object(a["b"])({url:"/permissions/"+e,method:"put",data:t})}function l(e){return Object(a["b"])({url:"/permissions/"+e,method:"delete"})}},"88bc":function(e,t,r){(function(t){var r=1/0,a=9007199254740991,n="[object Arguments]",i="[object Function]",o="[object GeneratorFunction]",l="[object Symbol]",s="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,u=s||c||Function("return this")();function d(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function p(e,t){var r=-1,a=e?e.length:0,n=Array(a);while(++r<a)n[r]=t(e[r],r,e);return n}function m(e,t){var r=-1,a=t.length,n=e.length;while(++r<a)e[n+r]=t[r];return e}var f=Object.prototype,h=f.hasOwnProperty,b=f.toString,v=u.Symbol,y=f.propertyIsEnumerable,g=v?v.isConcatSpreadable:void 0,w=Math.max;function k(e,t,r,a,n){var i=-1,o=e.length;r||(r=O),n||(n=[]);while(++i<o){var l=e[i];t>0&&r(l)?t>1?k(l,t-1,r,a,n):m(n,l):a||(n[n.length]=l)}return n}function x(e,t){return e=Object(e),C(e,t,(function(t,r){return r in e}))}function C(e,t,r){var a=-1,n=t.length,i={};while(++a<n){var o=t[a],l=e[o];r(l,o)&&(i[o]=l)}return i}function _(e,t){return t=w(void 0===t?e.length-1:t,0),function(){var r=arguments,a=-1,n=w(r.length-t,0),i=Array(n);while(++a<n)i[a]=r[t+a];a=-1;var o=Array(t+1);while(++a<t)o[a]=r[a];return o[t]=i,d(e,this,o)}}function O(e){return S(e)||q(e)||!!(g&&e&&e[g])}function j(e){if("string"==typeof e||A(e))return e;var t=e+"";return"0"==t&&1/e==-r?"-0":t}function q(e){return $(e)&&h.call(e,"callee")&&(!y.call(e,"callee")||b.call(e)==n)}var S=Array.isArray;function V(e){return null!=e&&F(e.length)&&!P(e)}function $(e){return L(e)&&V(e)}function P(e){var t=I(e)?b.call(e):"";return t==i||t==o}function F(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}function I(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function L(e){return!!e&&"object"==typeof e}function A(e){return"symbol"==typeof e||L(e)&&b.call(e)==l}var E=_((function(e,t){return null==e?{}:x(e,p(k(t,1),j))}));e.exports=E}).call(this,r("c8ba"))},caac:function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("a-card",{attrs:{bordered:!1}},[r("div",{staticClass:"table-page-search-wrapper"},[r("a-form",{attrs:{layout:"inline"}},[r("a-row",{attrs:{gutter:48}},[r("a-col",{attrs:{md:4,sm:24}},[r("a-input",{attrs:{placeholder:"请输入菜单名名称"},model:{value:e.queryParam.permission_name,callback:function(t){e.$set(e.queryParam,"permission_name",t)},expression:"queryParam.permission_name"}})],1),r("a-col",{attrs:{md:4,sm:24}},[r("span",{staticClass:"table-page-search-submitButtons"},[r("a-button",{attrs:{type:"primary"},on:{click:function(t){return e.$refs.table.refresh(!0)}}},[e._v("查询")]),r("a-button",{staticStyle:{"margin-left":"8px"},on:{click:function(){return e.queryParam={}}}},[e._v("重置")])],1)])],1)],1)],1),r("div",{staticClass:"table-operator"},[r("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:function(t){return e.$refs.permissionModal.add()}}},[e._v("新建")])],1),r("s-table",{ref:"table",attrs:{size:"default",rowKey:"id",bordered:!0,columns:e.columns,data:e.loadData,showPagination:!1},scopedSlots:e._u([{key:"action",fn:function(t,a){return r("span",{},[[r("a",{on:{click:function(t){return e.handleEdit(a)}}},[e._v("编辑")]),r("a-divider",{attrs:{type:"vertical"}}),r("a",{on:{click:function(t){return e.handleAddSon(a)}}},[e._v("新增子菜单")]),r("a-divider",{attrs:{type:"vertical"}}),r("a",{on:{click:function(t){return e.handleDel(a)}}},[e._v("删除")])]],2)}}])}),r("create-permission",{ref:"permissionModal",on:{ok:e.handleOk}})],1)},n=[],i=(r("0d03"),r("c1df")),o=r.n(i),l=r("2af9"),s=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("a-modal",{attrs:{title:e.title,width:640,visible:e.visible,confirmLoading:e.confirmLoading},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[r("a-spin",{attrs:{spinning:e.confirmLoading}},[r("a-form",{attrs:{form:e.form}},[r("a-form-item",{attrs:{label:"菜单名称",type:"text",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["permission_name",{rules:[{required:!0,min:2,message:"请输入至少3个字符"}]}],expression:"['permission_name', {rules: [{required: true, min: 2, message: '请输入至少3个字符'}]}]"}],attrs:{allowClear:""}})],1),r("a-form-item",{attrs:{label:"菜单图标",type:"text",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["icon"],expression:"['icon']"}],staticStyle:{width:"320px"},attrs:{showSearch:"",placeholder:"选择图标",optionFilterProp:"children"}},e._l(e.icons,(function(t,a){return r("a-select-option",{key:a+"-"+t,attrs:{value:t}},[e._v(" "+e._s(t)+" "),r("a-icon",{style:{fontSize:"16px"},attrs:{type:t}})],1)})),1)],1),r("a-form-item",{attrs:{label:"菜单路由",type:"text",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["route",{rules:[{required:!0,min:2,message:"请输入至少3个字符"}]}],expression:"['route', {rules: [{required: true, min: 2, message: '请输入至少3个字符'}]}]"}],attrs:{allowClear:""}})],1),r("a-form-item",{attrs:{label:"菜单标识",type:"text",labelCol:e.labelCol,wrapperCol:e.wrapperCol,filterOption:e.filterOption}},[r("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["permission_mark",{rules:[{required:!0,min:2,message:"请输入至少3个字符"}]}],expression:"['permission_mark',{rules: [{required: true, min: 2, message: '请输入至少3个字符'}]}]"}],attrs:{allowClear:""}})],1),r("a-form-item",{attrs:{"label-col":e.labelCol,"wrapper-col":e.wrapperCol,label:"请求方法"}},[r("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["method",{initialValue:e.methodValue},{rules:[{required:!0}]}],expression:"['method',{initialValue:methodValue},{rules: [{required: true}]}]"}]},[r("a-select-option",{attrs:{value:"get"}},[e._v(" get ")]),r("a-select-option",{attrs:{value:"post"}},[e._v(" post ")]),r("a-select-option",{attrs:{value:"put"}},[e._v(" put ")]),r("a-select-option",{attrs:{value:"delete"}},[e._v(" delete ")])],1)],1),r("a-form-item",{attrs:{"label-col":e.labelCol,"wrapper-col":e.wrapperCol,label:"类型"}},[r("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["type",{initialValue:e.typeValue},{rules:[{required:!0}]}],expression:"['type',{initialValue: typeValue},{rules: [{required: true}]}]"}],attrs:{buttonStyle:"solid"}},[r("a-radio-button",{attrs:{value:"1"}},[e._v("菜单")]),r("a-radio-button",{attrs:{value:"2"}},[e._v("按钮")])],1)],1),r("a-form-item",{attrs:{"label-col":e.labelCol,"wrapper-col":e.wrapperCol,label:"排序"}},[r("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:e.sort}],expression:"['sort', {initialValue: sort}]"}],attrs:{min:1}})],1)],1)],1)],1)},c=[],u=(r("c975"),r("4e82"),r("0feb")),d=r("88bc"),p=r.n(d),m=["lock","unlock","bars","book","calendar","cloud","cloud-download","code","copy","credit-card","delete","desktop","download","ellipsis","file","file-text","file-unknown","file-pdf","file-word","file-excel","file-jpg","file-ppt","file-markdown","file-add","folder","folder-open","folder-add","hdd","frown","meh","smile","inbox","laptop","appstore","link","mail","mobile","notification","paper-clip","picture","poweroff","reload","search","setting","share-alt","shopping-cart","tablet","tag","tags","to-top","upload","user","video-camera","home","loading","loading-3-quarters","cloud-upload","star","heart","environment","eye","camera","save","team","solution","phone","filter","exception","export","customer-service","qrcode","scan","like","dislike","message","pay-circle","calculator","pushpin","bulb","select","switcher","rocket","bell","disconnect","database","compass","barcode","hourglass","key","flag","layout","printer","sound","usb","skin","tool","sync","wifi","car","schedule","user-add","user-delete","usergroup-add","usergroup-delete","man","woman","shop","gift","idcard","medicine-box","red-envelope","coffee","copyright","trademark","safety","wallet","bank","trophy","contacts","global","shake","api","fork","dashboard","table","profile","alert","audit","branches","build","border","crown","experiment","fire","money-collect","property-safety","read","reconciliation","rest","security-scan","insurance","interation","safety-certificate","project","thunderbolt","block","cluster","deployment-unit","dollar","euro","pound","file-done","file-exclamation","file-protect","file-search","file-sync","gateway","gold","robot","shopping"],f={data:function(){return{labelCol:{xs:{span:24},sm:{span:7}},wrapperCol:{xs:{span:24},sm:{span:13}},visible:!1,title:"新建菜单",confirmLoading:!1,id:null,parent_id:0,methodValue:"GET",typeValue:"2",form:this.$form.createForm(this),sort:1,icons:m}},methods:{add:function(){this.visible=!0,this.title="新增菜单"},edit:function(e){this.visible=!0,this.title="编辑菜单";var t=this.form.setFieldsValue;this.id=e.id,t(p()(e,["permission_name","route","permission_mark","method","type","sort","icon"])),this.methodValue=e.method,this.typeValue=e.type,this.sort=e.sort},addSon:function(e){this.visible=!0,this.title="新增子菜单 ("+e.permission_name+")",this.parent_id=e.id},handleSubmit:function(){var e=this,t=this.form.validateFields;this.id?t((function(t,r){t||(e.confirmLoading=!0,Object(u["d"])(e.id,r).then((function(t){e.refresh(t.message)})).catch((function(t){return e.failed(t)})))})):t((function(t,r){t||(e.confirmLoading=!0,e.parent_id>0&&(r["parent_id"]=e.parent_id),Object(u["c"])(r).then((function(t){e.refresh(t.message)})).catch((function(t){return e.failed(t)})))}))},failed:function(e){this.$notification["error"]({message:e.message,duration:4}),this.handleCancel()},handleCancel:function(){this.visible=!1,this.id=null,this.confirmLoading=!1,this.parent_id=0,this.methodValue="GET",this.typeValue="2",this.sort=1,this.form.resetFields()},filterOption:function(e,t){return t.componentOptions.children[0].text.toLowerCase().indexOf(e.toLowerCase())>=0},refresh:function(e){this.$notification["success"]({message:e,duration:4}),this.handleCancel(),this.$parent.$parent.handleOk()}}},h=f,b=r("2877"),v=Object(b["a"])(h,s,c,!1,null,null,null),y=v.exports,g={name:"Permissions",components:{STable:l["f"],CreatePermission:y},data:function(){var e=this;return{queryParam:{},columns:[{title:"菜单名称",dataIndex:"permission_name"},{title:"菜单路由",dataIndex:"route"},{title:"菜单标识",dataIndex:"permission_mark"},{title:"请求方法",dataIndex:"method"},{title:"类型",dataIndex:"type",customRender:this.renderType},{title:"创建时间",dataIndex:"created_at",sorter:!0},{title:"更新时间",dataIndex:"updated_at",sorter:!0},{title:"操作",dataIndex:"action",width:"150px",scopedSlots:{customRender:"action"}}],loadData:function(t){return Object(u["b"])(Object.assign(t,e.queryParam)).then((function(e){return e}))}}},methods:{handleEdit:function(e){this.$refs.permissionModal.edit(e)},handleAddSon:function(e){this.$refs.permissionModal.addSon(e)},handleDel:function(e){var t=this;this.$confirm({title:"确定删除"+e.username+"吗?",okText:"确定",okType:"danger",cancelText:"取消",onOk:function(){Object(u["a"])(e.id).then((function(e){t.$notification["success"]({message:e.message,duration:4}),t.handleOk()})).catch((function(e){return t.failed(e)}))},onCancel:function(){}})},handleOk:function(){this.$refs.table.refresh(!0)},failed:function(e){this.$notification["error"]({message:e.message,duration:4}),this.handleCancel()},resetSearchForm:function(){this.queryParam={date:o()(new Date)}},renderType:function(e,t,r){var a=this.$createElement;return 1===e?a("a-button",{attrs:{type:"normal",size:"small"}},["菜单"]):a("a-button",{attrs:{type:"danger",size:"small"}},["按钮"])}}},w=g,k=Object(b["a"])(w,a,n,!1,null,null,null);t["default"]=k.exports}}]);