Files
nexusphp/admin/dist/assets/detail.c0899ca3.js
T

2 lines
6.4 KiB
JavaScript
Raw Normal View History

2021-05-02 17:24:05 +08:00
var e=Object.defineProperty,a=Object.prototype.hasOwnProperty,l=Object.getOwnPropertySymbols,t=Object.prototype.propertyIsEnumerable,n=(a,l,t)=>l in a?e(a,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[l]=t,d=(e,d)=>{for(var s in d||(d={}))a.call(d,s)&&n(e,s,d[s]);if(l)for(var s of l(d))t.call(d,s)&&n(e,s,d[s]);return e};import{r as s,a as o,t as r,b as i,v as u,e as m,k as f,o as c,c as p,x as g,f as b,m as x,F as _,y as h,i as y,j as v,s as I,u as E,p as w,d as D,z as A,A as k,g as C}from"./index.ad419675.js";const U={name:"DialogAssignExam",props:{reload:Function},setup(e,a){const l=s(null),t=o({loading:!1,matchExams:[],visible:!1,formData:{uid:0,exam_id:"",time_range:[]},rules:{exam_id:[{required:"true"}]}});return d(d({},r(t)),{handleSubmit:()=>{l.value.validate((async a=>{if(a){let a=await i.storeExamUser(t.formData);t.visible=!1,u.success(a.msg),e.reload&&e.reload()}}))},formRef:l,open:e=>{t.formData.uid=e,0==t.matchExams.length&&(t.loading=!0,(async()=>{let e=await i.listUserMatchExams({uid:t.formData.uid});t.matchExams=e.data})(),t.loading=!1),t.visible=!0}})}},V=b("div",{class:"time-range-help-text"},"If the time range is not specified, the exam's own configured time range will be used.",-1),z={class:"dialog-footer"},R=y("Cancel"),P=y("Save");U.render=function(e,a,l,t,n,d){const s=m("el-option"),o=m("el-select"),r=m("el-form-item"),i=m("el-date-picker"),u=m("el-form"),y=m("el-button"),v=m("el-dialog"),I=f("loading");return c(),p(v,{title:"Assign exam to user",modelValue:e.visible,"onUpdate:modelValue":a[4]||(a[4]=a=>e.visible=a),center:"","close-on-click-modal":!1},{footer:g((()=>[b("span",z,[b(y,{onClick:a[3]||(a[3]=a=>e.visible=!1)},{default:g((()=>[R])),_:1}),b(y,{type:"primary",onClick:t.handleSubmit},{default:g((()=>[P])),_:1},8,["onClick"])])])),default:g((()=>[x(b(u,{model:e.formData,"label-width":"100px",ref:"formRef",rules:e.rules},{default:g((()=>[b(r,{label:"Exam",prop:"exam_id"},{default:g((()=>[b(o,{modelValue:e.formData.exam_id,"onUpdate:modelValue":a[1]||(a[1]=a=>e.formData.exam_id=a),placeholder:"Select an exam..."},{default:g((()=>[(c(!0),p(_,null,h(e.matchExams,(e=>(c(),p(s,{key:e.id,label:e.name,value:e.id},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),b(r,{label:"Time range",prop:"time_range"},{default:g((()=>[b(i,{modelValue:e.formData.time_range,"onUpdate:modelValue":a[2]||(a[2]=a=>e.formData.time_range=a),type:"datetimerange",format:"YYYY-MM-DD HH:mm:ss","range-separator":"to","start-placeholder":"Begin","end-placeholder":"End"},null,8,["modelValue"]),V])),_:1})])),_:1},8,["model","rules"]),[[I,e.loading]])])),_:1},8,["modelValue"])};const O={name:"UserDetail",components:{DialogAssignExam:U},setup(){const e=I();E();const{id:a}=e.query,l=s(null),t=o({loading:!1,baseInfo:{},examInfo:null});v((()=>{n()}));const n=async()=>{t.loading=!0;let e=await i.getUser(a);t.loading=!1,t.baseInfo=e.data.base_info,t.examInfo=e.data.exam_info};return d(d({},r(t)),{handleRemoveExam:async e=>{let a=await i.deleteExamUser(e);u.success(a.msg),await n()},handleAssignExam:async()=>{l.value.open(a)},assignExam:l,fetchPageData:n})}},j=C();w("data-v-0a6d742e");const S={class:"page-user-detail"},q=b("div",{class:"card-header"},[b("span",null,"Base info")],-1),M={class:"table-base-info"},Y=b("tr",null,[b("th",null,"Field"),b("th",null,"Value"),b("th",null,"Actions"),b("th",null,"Other")],-1),B=b("td",null,"Username",-1),F=b("td",null,null,-1),H={colspan:"7"},N={class:"other-actions"},T=y("Reset password"),G=y("PM"),J=y("Assign exam"),K=b("td",null,"Email",-1),L=y("Change"),Q=b("td",null,"Added",-1),W=b("td",null,"Class",-1),X=b("td",null,"Uploaded",-1),Z=y("Add"),$=b("td",null,"Downloaded",-1),ee=y("Add"),ae=b("td",null,"Bonus",-1),le=y("Add"),te=b("div",{class:"card-header"},[b("span",null,"Exam on the way")],-1),ne={class:"table-base-info"},de=b("td",null,"Name",-1),se=b("td",null,"Created at",-1),oe=b("td",null,"Exam time",-1),re=b("td",null,"Status",-1),ie=b("td",null,"Action",-1),ue=y("Remove"),me=y("Pass !"),fe=y("Not Pass !");D();const ce=j(((e,a,l,t,n,d)=>{const s=m("el-butt