1 |
- (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-21a2cbdf"],{"31b4":function(t,e,a){"use strict";var n=a("9860"),r=a.n(n),i=a("b6bd"),s=a("2f62");function o(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)}return a}function c(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var l={name:"edit",components:{formCreate:r.a.$form()},computed:function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?o(a,!0).forEach((function(e){c(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):o(a).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}({},Object(s.e)("admin/userLevel",["taskId","levelId"])),props:{FromData:{type:Object,default:null},userEdit:{type:Number,default:0}},data:function(){return{modals:!1,type:0,config:{global:{upload:{props:{onSuccess:function(t,e){200===t.status?e.url=t.data.src:this.Message.error(t.msg)}}}}},isDisable:!1}},methods:{couponsType:function(){this.$parent.addType(this.type)},onSubmit:function(t){var e,a=this;(setTimeout((function(){a.isDisable=!1}),1e3),this.isDisable)||(this.isDisable=!0,e=t,Object(i.a)({url:this.FromData.action,method:this.FromData.method,data:e}).then((function(t){a.$parent.getList(),a.$Message.success(t.msg),a.modals=!1,setTimeout((function(){a.$emit("submitFail")}),1e3)})).catch((function(t){a.$Message.error(t.msg)})))},cancel:function(){this.type=0}}},u=(a("bddf"),a("2877")),d=Object(u.a)(l,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return t.FromData?a("div",[a("Modal",{class:t.userEdit?"userEdit":"",attrs:{scrollable:"","footer-hide":"",closable:"",title:t.FromData.title,width:"700"},on:{"on-cancel":t.cancel},model:{value:t.modals,callback:function(e){t.modals=e},expression:"modals"}},[["/marketing/coupon/save.html"===t.FromData.action?a("div",{staticClass:"radio acea-row row-middle"},[a("div",{staticClass:"name ivu-form-item-content"},[t._v("优惠券类型")]),a("Radio-group",{on:{"on-change":t.couponsType},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}},[a("Radio",{attrs:{label:0}},[t._v("通用券")]),a("Radio",{attrs:{label:1}},[t._v("品类券")]),a("Radio",{attrs:{label:2}},[t._v("商品券")])],1)],1):t._e()],a("form-create",{ref:"fc",staticClass:"formBox",attrs:{option:t.config,rule:Array.from(t.FromData.rules),handleIcon:"false"},on:{"on-submit":t.onSubmit}})],2)],1):t._e()}),[],!1,null,"2850396f",null);e.a=d.exports},"3cb6":function(t,e,a){},bddf:function(t,e,a){"use strict";var n=a("3cb6");a.n(n).a},e7d9:function(t,e,a){"use strict";a.r(e);var n=a("a34a"),r=a.n(n),i=a("2f62"),s=a("b6bd");function o(t,e,a,n,r,i,s){try{var o=t[i](s),c=o.value}catch(t){return void a(t)}o.done?e(c):Promise.resolve(c).then(n,r)}function c(t){return function(){var e=this,a=arguments;return new Promise((function(n,r){var i=t.apply(e,a);function s(t){o(i,n,r,s,c,"next",t)}function c(t){o(i,n,r,s,c,"throw",t)}s(void 0)}))}}function l(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,n)}return a}function u(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var d={name:"systemAdmin",components:{adminFrom:a("31b4").a},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},list:[],columns1:[{title:"姓名",key:"real_name",minWidth:120},{title:"账号",key:"account",minWidth:150},{title:"身份",slot:"roles",minWidth:250},{title:"最后一次登录时间",key:"_last_time",minWidth:180},{title:"最后一次登录ip",key:"last_ip",minWidth:180},{title:"开启",slot:"status",minWidth:90},{title:"操作",key:"action",slot:"action",fixed:"right",minWidth:120}],FromData:null,modalTitleSs:"",ids:Number}},computed:function(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?l(a,!0).forEach((function(e){u(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):l(a).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}({},Object(i.e)("admin/layout",["isMobile"]),{labelWidth:function(){return this.isMobile?void 0:96},labelPosition:function(){return this.isMobile?"top":"right"}}),created:function(){this.getList()},methods:{onchangeIsShow:function(t){var e=this;(function(t){return Object(s.a)({url:"setting/set_status/".concat(t.id,"/").concat(t.status),method:"PUT"})})({id:t.id,status:t.status}).then(function(){var t=c(r.a.mark((function t(a){return r.a.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(s.a)({url:"/setting/admin",method:"get",params:t})).then(function(){var t=c(r.a.mark((function t(a){return r.a.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(){var t=this;Object(s.a)({url:"/setting/admin/create",method:"get"}).then(function(){var e=c(r.a.mark((function e(a){return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.FromData=a.data,t.$refs.adminfrom.modals=!0;case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){t.$Message.error(e.msg)}))},edit:function(t){var e,a=this;(e=t.id,Object(s.a)({url:"/setting/admin/".concat(e,"/edit"),method:"get"})).then(function(){var t=c(r.a.mark((function t(e){return r.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!1!==e.data.status){t.next=2;break}return t.abrupt("return",a.$authLapse(e.data));case 2:a.FromData=e.data,a.$refs.adminfrom.modals=!0;case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){a.$Message.error(t.msg)}))},del:function(t,e,a){var n=this,r={title:e,num:a,url:"setting/admin/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(r).then((function(t){n.$Message.success(t.msg),n.list.splice(a,1),n.list.length||(n.formValidate.page=1==n.formValidate.page?1:n.formValidate.page-1),n.getList()})).catch((function(t){n.$Message.error(t.msg)}))},userSearchs:function(){this.formValidate.page=1,this.list=[],this.getList()}}},m=a("2877"),f=Object(m.a)(d,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":"",padding:0}},[a("div",{staticClass:"new_card_pd"},[a("Form",{ref:"formValidate",attrs:{model:t.formValidate,inline:"","label-width":t.labelWidth,"label-position":t.labelPosition},nativeOn:{submit:function(t){t.preventDefault()}}},[a("FormItem",{attrs:{label:"状态:","label-for":"status1"}},[a("Select",{staticClass:"input-add",attrs:{placeholder:"请选择",clearable:""},model:{value:t.formValidate.status,callback:function(e){t.$set(t.formValidate,"status",e)},expression:"formValidate.status"}},[a("Option",{attrs:{value:""}},[t._v("全部")]),a("Option",{attrs:{value:"1"}},[t._v("开启")]),a("Option",{attrs:{value:"0"}},[t._v("关闭")])],1)],1),a("FormItem",{attrs:{label:"搜索:","label-for":"status2"}},[a("Input",{staticClass:"input-add mr14",attrs:{placeholder:"请输入姓名或者账号"},model:{value:t.formValidate.name,callback:function(e){t.$set(t.formValidate,"name",e)},expression:"formValidate.name"}}),a("Button",{attrs:{type:"primary"},on:{click:function(e){return t.userSearchs()}}},[t._v("查询")])],1)],1)],1)]),a("Card",{staticClass:"ivu-mt",attrs:{bordered:!1,"dis-hover":""}},[a("Button",{directives:[{name:"auth",rawName:"v-auth",value:["setting-system_admin-add"],expression:"['setting-system_admin-add']"}],attrs:{type:"primary"},on:{click:t.add}},[t._v("添加管理员")]),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){var n=e.row;return[0!==n.roles.length?a("div",t._l(n.roles.split(","),(function(e,n){return a("Tag",{key:n,attrs:{color:"blue"},domProps:{textContent:t._s(e)}})})),1):t._e()]}},{key:"status",fn:function(e){var n=e.row;return[a("i-switch",{attrs:{value:n.status,"true-value":1,"false-value":0,size:"large"},on:{"on-change":function(e){return t.onchangeIsShow(n)}},model:{value:n.status,callback:function(e){t.$set(n,"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 n=e.row,r=e.index;return[a("a",{on:{click:function(e){return t.edit(n)}}},[t._v("编辑")]),a("Divider",{attrs:{type:"vertical"}}),a("a",{on:{click:function(e){return t.del(n,"删除管理员",r)}}},[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("admin-from",{ref:"adminfrom",attrs:{FromData:t.FromData},on:{submitFail:t.submitFail}})],1)}),[],!1,null,"403d297e",null);e.default=f.exports}}]);
|