| 1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-da2cd138"],{"6b91":function(t,e,a){"use strict";a.r(e);var s=a("c964"),i=a("f3f3"),n=(a("96cf"),a("a9e3"),a("d81d"),a("a434"),a("2f62")),o=(a("99af"),a("6b6c"));function l(t){return Object(o.a)({url:"setting/system_out_account/save",method:"post",data:t})}function r(t){return Object(o.a)({url:"setting/system_out_account/update/".concat(t.id),method:"post",data:t})}i={name:"systemOut",data:function(){return{grid:{xl:7,lg:7,md:12,sm:24,xs:24},total:0,loading:!1,roleData:{status1:""},formValidate:{roles:"",status:"",name:"",page:1,limit:20},status:"",list:[],intList:[],columns:[{type:"selection",width:60,align:"center"},{title:"接口名称",key:"name"}],columns1:[{title:"编号",key:"id",minWidth:80},{title:"账号",key:"appid",minWidth:150},{title:"描述",key:"title",minWidth:250},{title:"添加时间",key:"add_time",minWidth:180},{title:"最后登录时间",key:"last_time",minWidth:180},{title:"最后登录ip",key:"ip",minWidth:180},{title:"状态",slot:"status",minWidth:90},{title:"操作",key:"action",slot:"action",fixed:"right",minWidth:120}],FromData:null,modalTitleSs:"",ids:Number,modals:!1,modalsid:"",type:0,modalsdate:{appid:"",appsecret:"",title:"",rules:[]},ruleValidate:{appid:[{required:!0,message:"请输入正确的账号 (4到30位之间)",trigger:"blur",min:4,max:30}],appsecret:[{required:!0,message:"请输入正确的密码 (6到32位之间)",trigger:"blur",min:6,max:32}],title:[{message:"请输入正确的描述 (不能多于200位数)",trigger:"blur",max:200}]},editValidate:{appsecret:[{required:!1,message:"请输入正确的密码 (6到32位之间)",trigger:"blur",min:6,max:32}]}}},computed:Object(i.a)(Object(i.a)({},Object(n.e)("media",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:50},labelPosition:function(){return this.isMobile?"top":"left"}}),created:function(){this.getList()},methods:{onchangeIsShow:function(t){var e=this;t={id:t.id,status:t.status};t=t,Object(o.a)({url:"setting/system_out_account/set_status/".concat(t.id,"/").concat(t.status),method:"PUT"}).then(function(){var t=Object(s.a)(regeneratorRuntime.mark((function t(a){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$Message.success(a.msg);case 1:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$Message.error(t.msg)}))},submitFail:function(){this.getList()},getList:function(){var t,e=this;this.loading=!0,this.formValidate.roles=this.formValidate.roles||"",t=this.formValidate,Object(o.a)({url:"/setting/system_out_account/index",method:"get",params:t}).then(function(){var t=Object(s.a)(regeneratorRuntime.mark((function t(a){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.total=a.data.count,e.list=a.data.list,e.loading=!1;case 3:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.loading=!1,e.$Message.error(t.msg)}))},pageChange:function(t){this.formValidate.page=t,this.getList()},add:function(){this.modals=!0,this.type=0,this.modalsdate={appid:"",appsecret:"",title:"",rules:[]},this.getIntList()},selectTree:function(t,e){},getIntList:function(t,e){var a=this;Object(o.a)({url:"setting/system_out_interface/list",method:"get"}).then((function(s){a.intList=s.data,t?e.map((function(t){a.intList.map((function(e){1===e.id&&(e.checked=!0,e.disableCheckbox=!0,e.children.length&&e.children.map((function(t){t.checked=!0,t.disableCheckbox=!0}))),function t(e,a){e.length&&e.map((function(e){e.id==a&&(e.checked=!0),e.children&&t(e.children)}))}(e.children||[],t)}))})):a.intList.map((function(t){1===t.id&&(t.checked=!0,t.disableCheckbox=!0,t.children.length&&t.children.map((function(t){t.checked=!0,t.disableCheckbox=!0})))}))}))},edit:function(t){this.modals=!0,this.modalsdate.appid=t.appid,this.modalsdate.title=t.title,this.modalsdate.rules=t.rules.map((function(t){return Number(t)})),this.modalsid=t.id,this.type=1,this.getIntList("edit",this.modalsdate.rules)},del:function(t,e,a){var s=this;e={title:e,num:a,url:"setting/system_out_account/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(e).then((function(t){s.$Message.success(t.msg),s.list.splice(a,1)})).catch((function(t){s.$Message.error(t.msg)}))},setUp:function(t){var e=this;this.$modalForm((t=t.id,Object(o.a)({url:"setting/system_out_account/set_up/".concat(t),method:"get"}))).then((function(){return e.getList()}))},userSearchs:function(){this.formValidate.status="all"===this.status?"":this.status,this.formValidate.page=1,this.list=[],this.getList()},ok:function(t){var e=this,a=this.modalsid?r:l;this.$refs[t].validate((function(t){t?(e.modalsdate.rules=[],e.$refs.tree.getCheckedAndIndeterminateNodes().map((function(t){e.modalsdate.rules.push(t.id)})),e.modalsid&&(e.modalsdate.id=e.modalsid),a(e.modalsdate).then((function(t){e.modalsdate={appid:"",appsecret:"",title:"",rules:[]},e.modals=!1,e.$Message.success(t.msg),e.modalsid="",e.getList()})).catch((function(t){e.$Message.error(t.msg)}))):e.$Message.warning("请完善数据")}))},cancel:function(){this.modalsid="",this.modalsdate={appid:"",appsecret:"",title:""},this.modals=!1},reset:function(){for(var t="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",e=t.length,a="",s=0;s<16;s++)a+=t.charAt(Math.floor(Math.random()*e));this.modalsdate.appsecret=a}}},a("878f"),n=a("2877"),a=Object(n.a)(i,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("div",{staticClass:"i-layout-page-header"},[a("div",{staticClass:"i-layout-page-header"},[a("span",{staticClass:"ivu-page-header-title"},[t._v(t._s(t.$route.meta.title))])])]),a("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[a("Form",{ref:"formValidate",attrs:{model:t.formValidate,"label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[a("Row",{attrs:{type:"flex"}},[a("Col",t._b({},"Col",t.grid,!1),[a("Button",{directives:[{name:"auth",rawName:"v-auth",value:["setting-system_admin-add"],expression:"['setting-system_admin-add']"}],attrs:{type:"primary",icon:"md-add"},on:{click:t.add}},[t._v("添加账号")])],1)],1)],1),a("Table",{staticClass:"mt25",attrs:{columns:t.columns1,data:t.list,"no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果",loading:t.loading,"highlight-row":""},scopedSlots:t._u([{key:"roles",fn:function(e){return e=e.row,[0!==e.roles.length?a("div",t._l(e.roles.split(","),(function(e,s){return a("Tag",{key:s,attrs:{color:"blue"},domProps:{textContent:t._s(e)}})})),1):t._e()]}},{key:"status",fn:function(e){var s=e.row;return[a("i-switch",{attrs:{value:s.status,"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(s)}},model:{value:s.status,callback:function(e){t.$set(s,"status",e)},expression:"row.status"}},[a("span",{attrs:{slot:"open"},slot:"open"},[t._v("开启")]),a("span",{attrs:{slot:"close"},slot:"close"},[t._v("关闭")])])]}},{key:"action",fn:function(e){var s=e.row,i=e.index;return[a("a",{on:{click:function(e){return t.setUp(s)}}},[t._v("设置")]),a("Divider",{attrs:{type:"vertical"}}),a("a",{on:{click:function(e){return t.edit(s)}}},[t._v("编辑")]),a("Divider",{attrs:{type:"vertical"}}),a("a",{on:{click:function(e){return t.del(s,"删除账号",i)}}},[t._v("删除")])]}}])}),a("div",{staticClass:"acea-row row-right page"},[a("Page",{attrs:{total:t.total,current:t.formValidate.page,"show-elevator":"","show-total":"","page-size":t.formValidate.limit},on:{"on-change":t.pageChange}})],1)],1),a("Modal",{attrs:{scrollable:"",title:0==t.type?"添加账号":"编辑账号","mask-closable":!1,width:"700",closable:!1},model:{value:t.modals,callback:function(e){t.modals=e},expression:"modals"}},[a("Form",{ref:"modalsdate",attrs:{model:t.modalsdate,rules:0==t.type?t.ruleValidate:t.editValidate,"label-width":70,"label-position":"right"}},[a("FormItem",{attrs:{label:"账号",prop:"appid"}},[a("div",{staticStyle:{display:"flex"}},[a("Input",{attrs:{type:"text",disabled:0!=t.type},model:{value:t.modalsdate.appid,callback:function(e){t.$set(t.modalsdate,"appid",e)},expression:"modalsdate.appid"}})],1)]),a("FormItem",{attrs:{label:"密码",prop:"appsecret"}},[a("div",{staticStyle:{display:"flex"}},[a("Input",{staticClass:"input",attrs:{type:"text"},model:{value:t.modalsdate.appsecret,callback:function(e){t.$set(t.modalsdate,"appsecret",e)},expression:"modalsdate.appsecret"}}),a("Button",{staticClass:"reset",attrs:{type:"primary"},on:{click:t.reset}},[t._v("重置")])],1)]),a("FormItem",{attrs:{label:"描述",prop:"title"}},[a("div",{staticStyle:{display:"flex"}},[a("Input",{attrs:{type:"textarea"},model:{value:t.modalsdate.title,callback:function(e){t.$set(t.modalsdate,"title",e)},expression:"modalsdate.title"}})],1)]),a("FormItem",{attrs:{label:"接口权限",prop:"title"}},[a("Tree",{ref:"tree",attrs:{data:t.intList,multiple:"","show-checkbox":""},on:{"on-check-change":t.selectTree}})],1)],1),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("Button",{attrs:{type:"primary"},on:{click:function(e){return t.ok("modalsdate")}}},[t._v("确定")]),a("Button",{on:{click:t.cancel}},[t._v("取消")])],1)],1)],1)}),[],!1,null,"dc157a5e",null),e.default=a.exports},"878f":function(t,e,a){"use strict";var s=a("a2fa");a.n(s).a},a2fa:function(t,e,a){}}]);
|