manage-detail-legacy.b29e3197.js 10 KB

1
  1. !function(){function e(e,n){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter((function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable}))),t.push.apply(t,r)}return t}function n(n){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?e(Object(i),!0).forEach((function(e){t(n,e,i[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):e(Object(i)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))}))}return n}function t(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,n){if(!e)return;if("string"==typeof e)return i(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i(e,n)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,r=new Array(n);t<n;t++)r[t]=e[t];return r}function o(e,n,t,r,i,o,u){try{var a=e[o](u),c=a.value}catch(l){return void t(l)}a.done?n(c):Promise.resolve(c).then(r,i)}function u(e){return function(){var n=this,t=arguments;return new Promise((function(r,i){var u=e.apply(n,t);function a(e){o(u,r,i,a,c,"next",e)}function c(e){o(u,r,i,a,c,"throw",e)}a(void 0)}))}}var a=document.createElement("style");a.innerHTML="._detailCellGroup_1ex6x_1{margin:.32rem .34667rem;overflow:hidden;border-radius:.26667rem}._detailCell_1ex6x_1{padding:.4rem .34667rem}._detailCell_1ex6x_1 ._img_1ex6x_9{width:1.28rem;height:1.28rem;overflow:hidden;border-radius:50%;margin-right:.26667rem}._detailCell_1ex6x_1 ._name_1ex6x_16{font-size:.42667rem;font-weight:500;color:#333;line-height:.58667rem}._detailCell_1ex6x_1 ._phone_1ex6x_22{font-size:.37333rem;color:#777;line-height:.53333rem}._sectionTitle_1ex6x_27{padding:.21333rem .34667rem 0;font-size:.42667rem;font-weight:500;color:#333;line-height:.58667rem}._sectionTitle_1ex6x_27 i{display:inline-block;margin-right:.16rem;width:.10667rem;height:.32rem;background:#ff8057;border-radius:.05333rem}._functionGrid_1ex6x_42{margin:.32rem .34667rem;padding:.26667rem 0;background:#ffffff;border-radius:.32rem;overflow:hidden}._functionGrid_1ex6x_42 ._functionImg_1ex6x_49{width:1.25333rem;height:1.25333rem}._functionGrid_1ex6x_42 ._functionText_1ex6x_53{max-width:1.33333rem;padding-top:.13333rem;font-size:.32rem;color:#333;line-height:.45333rem}._functionGrid_1ex6x_42 .van-grid-item__content{padding-top:.26667rem;padding-bottom:.26667rem}._dialogTitle_1ex6x_64{padding-left:.66667rem;text-align:left;font-size:.48rem;font-weight:500;color:#333;line-height:.66667rem;padding-bottom:.32rem}._dialogTitle_1ex6x_64 i{display:inline-block;width:.10667rem;height:.37333rem;background:#ff8057;border-radius:.05333rem;margin-right:.16rem}._menuFunction_1ghfh_1{min-height:100vh;background-color:#f8f8f8}._menuFunction_1ghfh_1 ._menuContent_1ghfh_5{margin:.32rem .34667rem;padding-bottom:.32rem;background-color:#fff;border-radius:.26667rem}._menuFunction_1ghfh_1 ._menuContent_1ghfh_5 h2{padding:.32rem .32rem .21333rem;font-size:.42667rem;font-weight:500;color:#333;line-height:.58667rem}._menuFunction_1ghfh_1 ._menuContent_1ghfh_5 ._functionImg_1ghfh_18{width:1.25333rem;height:1.25333rem}._menuFunction_1ghfh_1 ._menuContent_1ghfh_5 ._gray_1ghfh_22{transition:all .3s ease;filter:grayscale(100%);opacity:.76}._menuFunction_1ghfh_1 ._menuContent_1ghfh_5 ._functionText_1ghfh_27{max-width:1.33333rem;padding-top:.13333rem;font-size:.32rem;color:#333;line-height:.45333rem}._menuFunction_1ghfh_1 ._menuContent_1ghfh_5 .van-grid-item__content{padding-top:.26667rem;padding-bottom:.26667rem}\n",document.head.appendChild(a),System.register(["./index-legacy.c52b7cbb.js","./index-legacy.4833415a.js","./index-legacy.2ae28dc5.js","./index-legacy.f657fbb5.js","./index-legacy.d61b8a1f.js","./index-legacy.f900000d.js","./icon_teacher-legacy.42ba77b1.js","./index-legacy.26638f55.js","./index-legacy.51e5b886.js"],(function(e){"use strict";var t,i,o,a,c,l,s,f,d,m,_,g,h,p,x,v,b,y,w,C,O,j;return{setters:[function(e){t=e.O},function(e){i=e.O},function(e){o=e.d,a=e.R,c=e.X,l=e.k,s=e.l,f=e.B,d=e.g,m=e.j,_=e.b8,g=e.S,h=e.F,p=e.bh,x=e.ad},function(e){v=e.G,b=e.a},function(e){y=e.I},function(e){w=e.S},function(e){C=e.i},function(e){O=e.C},function(e){j=e.C}],execute:function(){var T={detailCellGroup:"_detailCellGroup_1ex6x_1",detailCell:"_detailCell_1ex6x_1",img:"_img_1ex6x_9",name:"_name_1ex6x_16",phone:"_phone_1ex6x_22",sectionTitle:"_sectionTitle_1ex6x_27",functionGrid:"_functionGrid_1ex6x_42",functionImg:"_functionImg_1ex6x_49",functionText:"_functionText_1ex6x_53",dialogTitle:"_dialogTitle_1ex6x_64"},k={menuFunction:"_menuFunction_1ghfh_1",menuContent:"_menuContent_1ghfh_5",functionImg:"_functionImg_1ghfh_18",gray:"_gray_1ghfh_22",functionText:"_functionText_1ghfh_27"},I=o({name:"menu-function",props:{teacherId:{type:String,default:""},menus:{type:Array||String,default:[]}},emits:["close","success"],setup:function(e,n){n.slots,n.attrs;var i=n.emit,o=a({list:[],selectMenus:[]}),_=function(){var e=u(regeneratorRuntime.mark((function e(){var n,t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,d.post("/api-school/sysMenuButton/page",{data:{clientType:"SCHOOL",page:1,rows:100}});case 3:n=e.sent,t=n.data,o.list=t.rows||[],e.next=10;break;case 8:e.prev=8,e.t0=e.catch(0);case 10:case"end":return e.stop()}}),e,null,[[0,8]])})));return function(){return e.apply(this,arguments)}}(),g=function(e){return o.selectMenus.includes(e)},h=function(){var n=u(regeneratorRuntime.mark((function n(){var t;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,t=[],o.list&&o.list.forEach((function(e){g(e.id)&&t.push({buttonImage:e.buttonImage,sortOrder:e.order,id:e.id,title:e.title})})),n.next=5,d.post("/api-school/schoolStaff/updateButton",{data:{teacherId:e.teacherId,menuButtons:[].concat(t)}});case 5:setTimeout((function(){m("修改成功"),setTimeout((function(){i("close"),i("success")}),1e3)}),100),n.next=10;break;case 8:n.prev=8,n.t0=n.catch(0);case 10:case"end":return n.stop()}}),n,null,[[0,8]])})));return function(){return n.apply(this,arguments)}}();return c((function(){_();var n=(e.menus?e.menus:[]).map((function(e){return e.id}));o.selectMenus=r(n)})),function(){return l("div",{class:k.menuFunction},[l(t,null,null),l("div",{class:k.menuContent},[l("h2",null,[s("全部功能")]),l(v,{border:!1,class:k.functionGrid},{default:function(){return[o.list&&o.list.map((function(e){return l(b,{onClick:function(){return function(e){if(g(e.id)){var n=o.selectMenus.findIndex((function(n){return n===e.id}));o.selectMenus.splice(n,1)}else o.selectMenus.push(e.id)}(e)},class:g(e.id)?"":k.gray},{icon:function(){return l(y,{class:[k.functionImg],src:e.buttonImage},null)},text:function(){return l("div",{class:[k.functionText,"van-ellipsis"]},[e.title])}})}))]}})]),l(w,{position:"bottom"},{default:function(){return[l("div",{class:"btnGroup"},[l(f,{block:!0,round:!0,type:"primary",onClick:h},{default:function(){return[s("确认修改")]}})])]}})])}}});e("default",o({name:"manage-detail",setup:function(){var e=_(),r=g({}),o=a({menuStatus:!1,status:!1}),w=function(){var t=u(regeneratorRuntime.mark((function t(){var i,o,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,i=e.query,t.next=4,d.get("/api-school/schoolStaff/detail/"+i.id);case 4:o=t.sent,u=o.data,r.value=n({},u),t.next=11;break;case 9:t.prev=9,t.t0=t.catch(0);case 11:case"end":return t.stop()}}),t,null,[[0,9]])})));return function(){return t.apply(this,arguments)}}(),k=function(){var n=u(regeneratorRuntime.mark((function n(){var t;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,t=e.query,n.next=4,d.post("/api-school/schoolStaff/freeze/"+t.id);case 4:setTimeout((function(){r.value.status="LOCKED",m("冻结成功")}),100),n.next=9;break;case 7:n.prev=7,n.t0=n.catch(0);case 9:case"end":return n.stop()}}),n,null,[[0,7]])})));return function(){return n.apply(this,arguments)}}();return c((function(){w()})),function(){var e,n;return l(h,null,[l(t,null,null),l(O,{inset:!0,class:T.detailCellGroup},{default:function(){return[l(j,{center:!0,class:T.detailCell},{icon:function(){return l(y,{class:T.img,src:r.value.avatar?r.value.avatar:C},null)},title:function(){return l("div",{class:T.content},[l("p",{class:T.name},[r.value.nickname]),l("p",{class:T.phone},[r.value.phone])])}})]}}),l("div",{class:T.sectionTitle},[l("i",null,null),s("基本信息")]),l(O,{inset:!0,class:T.detailCellGroup},{default:function(){return[l(j,{title:"手机号码",value:r.value.nickname},null),l(j,{title:"性别",value:r.value.gender?"男":"女"},null)]}}),r.value.menuButtons&&r.value.menuButtons.length>0&&l(h,null,[l("div",{class:T.sectionTitle},[l("i",null,null),s("功能权限")]),l(v,{border:!1,class:T.functionGrid},(n=e=r.value.menuButtons.map((function(e){return l(b,null,{icon:function(){return l(y,{class:T.functionImg,src:e.buttonImage},null)},text:function(){return l("div",{class:[T.functionText,"van-ellipsis"]},[e.title])}})})),"function"==typeof n||"[object Object]"===Object.prototype.toString.call(n)&&!x(n)?e:{default:function(){return[e]}}))]),l("div",{class:["btnGroup","btnMore"],style:{paddingLeft:"13px",paddingRight:"13px"}},[l(f,{type:"primary",round:!0,onClick:function(){return o.menuStatus=!0}},{default:function(){return[s("修改权限")]}}),l(f,{type:"primary",round:!0,color:"#64A9FF",onClick:function(){return o.status=!0},disabled:"ACTIVATION"!==r.value.status},{default:function(){return[s("冻结账号")]}})]),l(i,{modelValue:o.menuStatus,"onUpdate:modelValue":function(e){return o.menuStatus=e},destroy:!0},{default:function(){return[l(I,{onClose:function(){return o.menuStatus=!1},onSuccess:function(){return w()},teacherId:r.value.id,menus:r.value.menuButtons},null)]}}),l(p,{show:o.status,"onUpdate:show":function(e){return o.status=e},message:"冻结后该管理老师将无法登录\n确认需要冻结吗?",messageAlign:"left",showCancelButton:!0,onConfirm:k},{title:function(){return l("div",{class:T.dialogTitle},[l("i",null,null),s("冻结管理老师")])}})])}}}))}}}))}();