智慧教务系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1 lines
8.6 KiB

import{d as U,v as D,l as A,r as w,f as Q,h as C,c as z,e as t,w as p,a as m,t as _,u as e,i as h,k as o,J as F,m as $,M as L,E as N,D as R,G as j,H as I,K as M,O as S,P as G,Q as H,L as J}from"./index-f5d841af.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import"./el-tooltip-4ed993c7.js";/* empty css *//* empty css *//* empty css */import"./el-form-item-4ed993c7.js";/* empty css */import{g as K,d as O}from"./exam_questions-81fdf484.js";import{_ as W}from"./_plugin-vue_export-helper-c27b6911.js";const X={class:"main-container"},Y={class:"flex justify-between items-center"},Z={class:"text-lg"},ee={class:"mt-[10px]"},te={class:"mt-[16px] flex justify-end"},oe=U({__name:"exam_questions",setup(ne){const P=D().meta.title;let n=A({page:1,limit:10,total:0,loading:!0,data:[],searchParam:{question_type:"",question_content_type:"",question_content:"",option_a_content_type:"",option_a_content:"",option_b_content_type:"",option_b_content:"",option_c_content_type:"",option_c_content:"",option_d_content_type:"",option_d_content:"",correct_answer:""}});const b=w();w([]);const u=(d=1)=>{n.loading=!0,n.page=d,K({page:n.page,limit:n.limit,...n.searchParam}).then(l=>{n.loading=!1,n.data=l.data.data,n.total=l.data.total}).catch(()=>{n.loading=!1})};u();const y=Q(),V=()=>{y.push("/exam_questions/exam_questions_edit")},g=d=>{y.push("/exam_questions/exam_questions_edit?id="+d.id)},v=d=>{L.confirm(o("examQuestionsDeleteTips"),o("warning"),{confirmButtonText:o("confirm"),cancelButtonText:o("cancel"),type:"warning"}).then(()=>{O(d).then(()=>{u()}).catch(()=>{})})},x=d=>{d&&(d.resetFields(),u())};return(d,l)=>{const c=N,s=R,r=j,q=I,f=M,i=S,T=G,E=H,k=J;return C(),z("div",X,[t(f,{class:"box-card !border-none",shadow:"never"},{default:p(()=>[m("div",Y,[m("span",Z,_(e(P)),1),t(c,{type:"primary",onClick:V},{default:p(()=>[h(_(e(o)("addExamQuestions")),1)]),_:1})]),t(f,{class:"box-card !border-none my-[10px] table-search-wrap",shadow:"never"},{default:p(()=>[t(q,{inline:!0,model:e(n).searchParam,ref_key:"searchFormRef",ref:b},{default:p(()=>[t(r,{label:e(o)("questionType"),prop:"question_type"},{default:p(()=>[t(s,{modelValue:e(n).searchParam.question_type,"onUpdate:modelValue":l[0]||(l[0]=a=>e(n).searchParam.question_type=a),placeholder:e(o)("questionTypePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(r,{label:e(o)("questionContentType"),prop:"question_content_type"},{default:p(()=>[t(s,{modelValue:e(n).searchParam.question_content_type,"onUpdate:modelValue":l[1]||(l[1]=a=>e(n).searchParam.question_content_type=a),placeholder:e(o)("questionContentTypePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(r,{label:e(o)("questionContent"),prop:"question_content"},{default:p(()=>[t(s,{modelValue:e(n).searchParam.question_content,"onUpdate:modelValue":l[2]||(l[2]=a=>e(n).searchParam.question_content=a),placeholder:e(o)("questionContentPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(r,{label:e(o)("optionAContentType"),prop:"option_a_content_type"},{default:p(()=>[t(s,{modelValue:e(n).searchParam.option_a_content_type,"onUpdate:modelValue":l[3]||(l[3]=a=>e(n).searchParam.option_a_content_type=a),placeholder:e(o)("optionAContentTypePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(r,{label:e(o)("optionAContent"),prop:"option_a_content"},{default:p(()=>[t(s,{modelValue:e(n).searchParam.option_a_content,"onUpdate:modelValue":l[4]||(l[4]=a=>e(n).searchParam.option_a_content=a),placeholder:e(o)("optionAContentPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(r,{label:e(o)("optionBContentType"),prop:"option_b_content_type"},{default:p(()=>[t(s,{modelValue:e(n).searchParam.option_b_content_type,"onUpdate:modelValue":l[5]||(l[5]=a=>e(n).searchParam.option_b_content_type=a),placeholder:e(o)("optionBContentTypePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(r,{label:e(o)("optionBContent"),prop:"option_b_content"},{default:p(()=>[t(s,{modelValue:e(n).searchParam.option_b_content,"onUpdate:modelValue":l[6]||(l[6]=a=>e(n).searchParam.option_b_content=a),placeholder:e(o)("optionBContentPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(r,{label:e(o)("optionCContentType"),prop:"option_c_content_type"},{default:p(()=>[t(s,{modelValue:e(n).searchParam.option_c_content_type,"onUpdate:modelValue":l[7]||(l[7]=a=>e(n).searchParam.option_c_content_type=a),placeholder:e(o)("optionCContentTypePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(r,{label:e(o)("optionCContent"),prop:"option_c_content"},{default:p(()=>[t(s,{modelValue:e(n).searchParam.option_c_content,"onUpdate:modelValue":l[8]||(l[8]=a=>e(n).searchParam.option_c_content=a),placeholder:e(o)("optionCContentPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(r,{label:e(o)("optionDContentType"),prop:"option_d_content_type"},{default:p(()=>[t(s,{modelValue:e(n).searchParam.option_d_content_type,"onUpdate:modelValue":l[9]||(l[9]=a=>e(n).searchParam.option_d_content_type=a),placeholder:e(o)("optionDContentTypePlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(r,{label:e(o)("optionDContent"),prop:"option_d_content"},{default:p(()=>[t(s,{modelValue:e(n).searchParam.option_d_content,"onUpdate:modelValue":l[10]||(l[10]=a=>e(n).searchParam.option_d_content=a),placeholder:e(o)("optionDContentPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(r,{label:e(o)("correctAnswer"),prop:"correct_answer"},{default:p(()=>[t(s,{modelValue:e(n).searchParam.correct_answer,"onUpdate:modelValue":l[11]||(l[11]=a=>e(n).searchParam.correct_answer=a),placeholder:e(o)("correctAnswerPlaceholder")},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),t(r,null,{default:p(()=>[t(c,{type:"primary",onClick:l[12]||(l[12]=a=>u())},{default:p(()=>[h(_(e(o)("search")),1)]),_:1}),t(c,{onClick:l[13]||(l[13]=a=>x(b.value))},{default:p(()=>[h(_(e(o)("reset")),1)]),_:1})]),_:1})]),_:1},8,["model"])]),_:1}),m("div",ee,[F((C(),$(T,{data:e(n).data,size:"large"},{empty:p(()=>[m("span",null,_(e(n).loading?"":e(o)("emptyData")),1)]),default:p(()=>[t(i,{prop:"question_type",label:e(o)("questionType"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(i,{prop:"question_content_type",label:e(o)("questionContentType"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(i,{prop:"question_content",label:e(o)("questionContent"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(i,{prop:"option_a_content_type",label:e(o)("optionAContentType"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(i,{prop:"option_a_content",label:e(o)("optionAContent"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(i,{prop:"option_b_content_type",label:e(o)("optionBContentType"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(i,{prop:"option_b_content",label:e(o)("optionBContent"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(i,{prop:"option_c_content_type",label:e(o)("optionCContentType"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(i,{prop:"option_c_content",label:e(o)("optionCContent"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(i,{prop:"option_d_content_type",label:e(o)("optionDContentType"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(i,{prop:"option_d_content",label:e(o)("optionDContent"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(i,{prop:"correct_answer",label:e(o)("correctAnswer"),"min-width":"120","show-overflow-tooltip":!0},null,8,["label"]),t(i,{label:e(o)("operation"),fixed:"right","min-width":"120"},{default:p(({row:a})=>[t(c,{type:"primary",link:"",onClick:B=>g(a)},{default:p(()=>[h(_(e(o)("edit")),1)]),_:2},1032,["onClick"]),t(c,{type:"primary",link:"",onClick:B=>v(a.id)},{default:p(()=>[h(_(e(o)("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[k,e(n).loading]]),m("div",te,[t(E,{"current-page":e(n).page,"onUpdate:current-page":l[14]||(l[14]=a=>e(n).page=a),"page-size":e(n).limit,"onUpdate:page-size":l[15]||(l[15]=a=>e(n).limit=a),layout:"total, sizes, prev, pager, next, jumper",total:e(n).total,onSizeChange:l[16]||(l[16]=a=>u()),onCurrentChange:u},null,8,["current-page","page-size","total"])])])]),_:1})])}}});const ve=W(oe,[["__scopeId","data-v-c2f428d2"]]);export{ve as default};