mirror of
https://github.com/crmeb/CRMEB.git
synced 2025-12-15 04:52:50 +00:00
1 line
16 KiB
JavaScript
1 line
16 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-0a2fde4e"],{"31b4":function(t,e,r){"use strict";var n=r("f3f3"),a=(r("d3b7"),r("159b"),r("30ba")),o=(a=r.n(a),r("6b6c")),i=r("2f62");a={name:"edit",components:{formCreate:a.a.$form()},computed:Object(n.a)({},Object(i.d)("userLevel",["taskId","levelId"])),props:{FromData:{type:Object,default:null},update:{type:Boolean,default:!0}},watch:{FromData:function(){this.FromData.rules.forEach((function(t){t.title+=":"}))}},data:function(){return{modals:!1,type:0,loading:!1,fapi:null,config:{form:{labelWidth:"100px"},resetBtn:!1,submitBtn:!1,global:{upload:{props:{onSuccess:function(t,e){200===t.status?e.url=t.data.src:this.$message.error(t.msg)}}}}}}},methods:{couponsType:function(){this.$parent.addType(this.type)},formSubmit:function(){this.fapi.submit()},onSubmit:function(t){var e=this;this.loading||(this.loading=!0,Object(o.a)({url:this.FromData.action,method:this.FromData.method,data:t}).then((function(t){e.update&&e.$parent.getList(),e.$message.success(t.msg),e.modals=!1,setTimeout((function(){e.$emit("submitFail"),e.loading=!1}),1e3)})).catch((function(t){e.loading=!1,e.$message.error(t.msg)})))},cancel:function(){this.type=0}}},r("6a61"),n=r("2877"),i=Object(n.a)(a,(function(){var t=this,e=t.$createElement;e=t._self._c||e;return t.FromData?e("div",[e("el-dialog",{attrs:{visible:t.modals,title:t.FromData.title,"z-index":1,width:"720px"},on:{"update:visible":function(e){t.modals=e},closed:t.cancel}},[["/marketing/coupon/save.html"===t.FromData.action?e("div",{staticClass:"radio acea-row row-middle"},[e("div",{staticClass:"name ivu-form-item-content"},[t._v("优惠券类型")]),e("el-radio-group",{on:{input:t.couponsType},model:{value:t.type,callback:function(e){t.type=e},expression:"type"}},[e("el-radio",{attrs:{label:0}},[t._v("通用券")]),e("el-radio",{attrs:{label:1}},[t._v("品类券")]),e("el-radio",{attrs:{label:2}},[t._v("商品券")])],1)],1):t._e()],e("form-create",{ref:"fc",staticClass:"formBox",attrs:{option:t.config,rule:Array.from(this.FromData.rules),handleIcon:"false"},on:{submit:t.onSubmit},model:{value:t.fapi,callback:function(e){t.fapi=e},expression:"fapi"}}),e("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(e){t.modals=!1}}},[t._v("取 消")]),e("el-button",{attrs:{type:"primary"},on:{click:t.formSubmit}},[t._v("确 定")])],1)],2)],1):t._e()}),[],!1,null,"58fdaf03",null);e.a=i.exports},"6a61":function(t,e,r){"use strict";var n=r("c23d");r.n(n).a},c23d:function(t,e,r){},e7d9:function(t,e,r){"use strict";r.r(e),r("a4d3"),r("e01a"),r("d3b7"),r("d28b"),r("3ca3"),r("ddb0"),r("b636"),r("944a"),r("0c47"),r("23dc"),r("3410"),r("d9e2"),r("159b"),r("b0c0"),r("131a"),r("fb6a");var n=r("0122"),a=r("c964"),o=r("f3f3"),i=(r("a9e3"),r("a434"),r("2f62")),s=(r("99af"),r("6b6c"));function l(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */l=function(){return t};var t={},e=Object.prototype,r=e.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},o="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(e){u=function(t,e,r){return t[e]=r}}function f(t,e,r,n){var o,i,s,l;e=e&&e.prototype instanceof m?e:m,e=Object.create(e.prototype),n=new k(n||[]);return a(e,"_invoke",{value:(o=t,i=r,s=n,l="suspendedStart",function(t,e){if("executing"===l)throw new Error("Generator is already running");if("completed"===l){if("throw"===t)throw e;return O()}for(s.method=t,s.arg=e;;){var r=s.delegate;if(r&&(r=function t(e,r){var n=r.method,a=e.iterator[n];return void 0===a?(r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=void 0,t(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),h):(n=d(a,e.iterator,r.arg),"throw"===n.type?(r.method="throw",r.arg=n.arg,r.delegate=null,h):(a=n.arg,a?a.done?(r[e.resultName]=a.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,h):a:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,h)))}(r,s),r)){if(r===h)continue;return r}if("next"===s.method)s.sent=s._sent=s.arg;else if("throw"===s.method){if("suspendedStart"===l)throw l="completed",s.arg;s.dispatchException(s.arg)}else"return"===s.method&&s.abrupt("return",s.arg);if(l="executing",r=d(o,i,s),"normal"===r.type){if(l=s.done?"completed":"suspendedYield",r.arg===h)continue;return{value:r.arg,done:s.done}}"throw"===r.type&&(l="completed",s.method="throw",s.arg=r.arg)}})}),e}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var h={};function m(){}function p(){}function v(){}o={};var g=(u(o,i,(function(){return this})),Object.getPrototypeOf),b=(g=g&&g(g(L([]))),g&&g!==e&&r.call(g,i)&&(o=g),v.prototype=m.prototype=Object.create(o));function y(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function w(t,e){var o;a(this,"_invoke",{value:function(a,i){function s(){return new e((function(o,s){!function a(o,i,s,l){var c;o=d(t[o],t,i);if("throw"!==o.type)return(i=(c=o.arg).value)&&"object"==Object(n.a)(i)&&r.call(i,"__await")?e.resolve(i.__await).then((function(t){a("next",t,s,l)}),(function(t){a("throw",t,s,l)})):e.resolve(i).then((function(t){c.value=t,s(c)}),(function(t){return a("throw",t,s,l)}));l(o.arg)}(a,i,o,s)}))}return o=o?o.then(s,s):s()}})}function _(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function x(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(_,this),this.reset(!0)}function L(t){if(t){var e,n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return e=-1,(n=function n(){for(;++e<t.length;)if(r.call(t,e))return n.value=t[e],n.done=!1,n;return n.value=void 0,n.done=!0,n}).next=n}return{next:O}}function O(){return{value:void 0,done:!0}}return a(b,"constructor",{value:p.prototype=v,configurable:!0}),a(v,"constructor",{value:p,configurable:!0}),p.displayName=u(v,c,"GeneratorFunction"),t.isGeneratorFunction=function(t){return t="function"==typeof t&&t.constructor,!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},y(w.prototype),u(w.prototype,s,(function(){return this})),t.AsyncIterator=w,t.async=function(e,r,n,a,o){void 0===o&&(o=Promise);var i=new w(f(e,r,n,a),o);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},y(b),u(b,c,"Generator"),u(b,i,(function(){return this})),u(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e,r=Object(t),n=[];for(e in r)n.push(e);return n.reverse(),function t(){for(;n.length;){var e=n.pop();if(e in r)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=L,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(x),!t)for(var e in this)"t"===e.charAt(0)&&r.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function n(r,n){return i.type="throw",i.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var a=this.tryEntries.length-1;0<=a;--a){var o=this.tryEntries[a],i=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(s&&l){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;0<=n;--n){var a=this.tryEntries[n];if(a.tryLoc<=this.prev&&r.call(a,"finallyLoc")&&this.prev<a.finallyLoc){var o=a;break}}var i=(o=o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc?null:o)?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),h},finish:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),x(r),h}},catch:function(t){for(var e=this.tryEntries.length-1;0<=e;--e){var r,n,a=this.tryEntries[e];if(a.tryLoc===t)return"throw"===(r=a.completion).type&&(n=r.arg,x(a)),n}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}o={name:"systemAdmin",components:{adminFrom:r("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},status:"",list:[],FromData:null,modalTitleSs:"",ids:Number}},computed:Object(o.a)(Object(o.a)({},Object(i.d)("media",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:"50px"},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(s.a)({url:"setting/set_status/".concat(t.id,"/").concat(t.status),method:"PUT"}).then(function(){var t=Object(a.a)(l().mark((function t(r){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$message.success(r.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=Object(a.a)(l().mark((function t(r){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.total=r.data.count,e.list=r.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)}))},add:function(){var t=this;Object(s.a)({url:"/setting/admin/create",method:"get"}).then(function(){var e=Object(a.a)(l().mark((function e(r){return l().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.FromData=r.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=this;t=t.id,Object(s.a)({url:"/setting/admin/".concat(t,"/edit"),method:"get"}).then(function(){var t=Object(a.a)(l().mark((function t(r){return l().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!1===r.data.status)return t.abrupt("return",e.$authLapse(r.data));t.next=2;break;case 2:e.FromData=r.data,e.$refs.adminfrom.modals=!0;case 4:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()).catch((function(t){e.$message.error(t.msg)}))},del:function(t,e,r){var n=this;e={title:e,num:r,url:"setting/admin/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(e).then((function(t){n.$message.success(t.msg),n.list.splice(r,1)})).catch((function(t){n.$message.error(t.msg)}))},userSearchs:function(){this.formValidate.status="all"===this.status?"":this.status,this.formValidate.page=1,this.list=[],this.getList()}}},i=r("2877"),r=Object(i.a)(o,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("el-card",{staticClass:"ivu-mb-16",attrs:{bordered:!1,shadow:"never","body-style":{padding:0}}},[r("div",{staticClass:"padding-add"},[r("el-form",{ref:"formValidate",attrs:{model:t.formValidate,"label-width":"80px","label-position":"right",inline:""},nativeOn:{submit:function(t){t.preventDefault()}}},[r("el-form-item",{attrs:{label:"状态:","label-for":"status1"}},[r("el-select",{staticClass:"form_content_width",attrs:{placeholder:"请选择",clearable:""},on:{change:t.userSearchs},model:{value:t.status,callback:function(e){t.status=e},expression:"status"}},[r("el-option",{attrs:{value:"all",label:"全部"}}),r("el-option",{attrs:{value:"1",label:"开启"}}),r("el-option",{attrs:{value:"0",label:"关闭"}})],1)],1),r("el-form-item",{attrs:{label:"搜索:","label-for":"status2"}},[r("el-input",{staticClass:"form_content_width",attrs:{clearable:"",placeholder:"请输入姓名或者账号"},model:{value:t.formValidate.name,callback:function(e){t.$set(t.formValidate,"name",e)},expression:"formValidate.name"}})],1),r("el-form-item",[r("el-button",{attrs:{type:"primary"},on:{click:t.userSearchs}},[t._v("查询")])],1)],1)],1)]),r("el-card",{staticClass:"ivu-mt",attrs:{bordered:!1,shadow:"never"}},[r("el-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("添加管理员")]),r("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],staticClass:"mt14",attrs:{data:t.list,"no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果","highlight-current-row":""}},[r("el-table-column",{attrs:{label:"姓名",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("span",[t._v(t._s(e.row.real_name))])]}}])}),r("el-table-column",{attrs:{label:"账号","min-width":"130"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("span",[t._v(t._s(e.row.account))])]}}])}),r("el-table-column",{attrs:{label:"身份","min-width":"130"},scopedSlots:t._u([{key:"default",fn:function(e){return[0!==e.row.roles.length?r("div",t._l(e.row.roles.split(","),(function(e,n){return r("el-tag",{key:n},[t._v(t._s(e))])})),1):t._e()]}}])}),r("el-table-column",{attrs:{label:"最后一次登录时间","min-width":"130"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("span",[t._v(t._s(e.row._last_time))])]}}])}),r("el-table-column",{attrs:{label:"最后一次登录ip","min-width":"130"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("span",[t._v(t._s(e.row.last_ip))])]}}])}),r("el-table-column",{attrs:{label:"开启","min-width":"70"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("el-switch",{staticClass:"defineSwitch",attrs:{"active-value":1,"inactive-value":0,value:e.row.status,size:"large","active-text":"开启","inactive-text":"关闭"},on:{change:function(r){return t.onchangeIsShow(e.row)}},model:{value:e.row.status,callback:function(r){t.$set(e.row,"status",r)},expression:"scope.row.status"}})]}}])}),r("el-table-column",{attrs:{label:"操作",fixed:"right",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("a",{on:{click:function(r){return t.edit(e.row)}}},[t._v("编辑")]),r("el-divider",{attrs:{direction:"vertical"}}),r("a",{on:{click:function(r){return t.del(e.row,"删除管理员",e.$index)}}},[t._v("删除")])]}}])})],1),r("div",{staticClass:"acea-row row-right page"},[t.total?r("pagination",{attrs:{total:t.total,page:t.formValidate.page,limit:t.formValidate.limit},on:{"update:page":function(e){return t.$set(t.formValidate,"page",e)},"update:limit":function(e){return t.$set(t.formValidate,"limit",e)},pagination:t.getList}}):t._e()],1)],1),r("admin-from",{ref:"adminfrom",attrs:{FromData:t.FromData},on:{submitFail:t.submitFail}})],1)}),[],!1,null,"821abc92",null),e.default=r.exports}}]); |