File: /var/www/html/public/static/js/hookQue-8458e478.js
import{getSubjectTree as ie,addPaper as ne,getMyList as re,getGroupListWeb as oe,paperAnswerDetailWeb as ce,redoPaperWeb as ue}from"./po-338e700f.js";import{d as D,u as le}from"./vue-router-a383d220.js";import{b7 as f}from"./message-2472a54a.js";import{A as o,r as i,o as de}from"./runtime-core.esm-bundler-6128546f.js";import"./index-d44f8e28.js";import"./preload-helper-78dc9057.js";import"./vue-i18n.runtime.esm-bundler-6949bcab.js";import"./index-b7f916e1.js";import"./_commonjsHelpers-87174ba5.js";import"./utils-2ab4f76a.js";function Se(){const{query:A,params:pe}=D(),u=le();D();const R=o({}),q=o({}),E=o({}),L=o({}),k=o({}),M=o({});o({});const _=i(1),m=i(),b=i(!1),h=i(!1),I=i(!1),g=i(!1),x=i(!1),y=i(""),l=i([]),w=i([]),j=i([]),P=i([]),d=i([]),C=i([{id:1,name:"所有题目"},{id:2,name:"其他选项"}]),S=i([{id:1,name:"错误",value:"error",is_select:1},{id:2,name:"不确定",value:"unsure",is_select:1},{id:3,name:"猜测",value:"guess",is_select:1},{id:4,name:"重新做",value:"review",is_select:1},{id:5,name:"正确",value:"correct",is_select:0}]),O=i(!1),r=o({score:"",answer:"",shareValue:"",year:"",title:"",subjectId:""}),t=o({paper_name:"",paper_id:"",reDoIndex:0,userPaperId:"",searchKey:"",subjectId:""}),T=i([{id:1,name:"Y",name_k:"6"},{id:2,name:"N",name_k:"1"}]),W=[{label:"序号列",type:"index",width:70,hide:({checkList:e})=>!e.includes("序号列")},{label:"试题名称",prop:"name",minWidth:100,hide:({checkList:e})=>!e.includes("试题名称")},{label:"科目",prop:"subject_name",minWidth:100,hide:({checkList:e})=>!e.includes("科目")},{label:"操作",prop:"order_id",minWidth:100,slot:"operation",hide:({checkList:e})=>!e.includes("操作")}],G=["序号列","试题名称","科目","操作"];function K(e,a,s){_.value=2,l.value=e.data.data.datas,b.value=!0}function N(e,a){}function V(e,a,s){e?s.answer=1:s.answer=0;let n="";a.options.forEach((c,fe)=>{c.answer==1&&(n==""?n=c.answerCode:n=n+" , "+c.answerCode)}),a.answer=n}async function F(){const{data:e}=await ie(Object.assign(R,{}));e.code==0&&(d.value=e.data[0].children,se())}function Q(e){l.value.forEach((a,s)=>{a.subjectId=e})}async function Y(){if(r.title==""){f.error("Please fill in the name of the test question");return}if(r.subjectId==""){f.error("Please select a classification");return}const{data:e}=await ne(Object.assign(q,{title:r.title,year:r.year,subjectId:r.subjectId,isShare:r.shareValue,choiceQuestions:l}));if(e.code==0){l.value=[],_.value=1,f.success("success"),y.value.clearFiles(),r.title="",r.shareValue="",r.subjectId="",r.year="",b.value=!1,p();return}}async function p(){const e=[];d.value.forEach((n,c)=>{n.is_select==1&&e.push(n.id)});const a=e.toString();t.subjectId=a;const{data:s}=await re(Object.assign(E,{searchType:"mockName",searchKey:t.searchKey,subjectId:t.subjectId}));P.value=s.dataList}function z(e){u.push({name:"test",query:{userPaperId:e.userPaperId,paperId:e.id}})}async function B(){const{data:e}=await oe(Object.assign(L,{}));j.value=e.data}const H=(e,a)=>{if(e.length>1){const s=e.shift();m.value.toggleRowSelection(s,!1)}h.value=!1,u.push({name:"situation",query:{paper_name:t.paper_name,paper_id:t.paper_id,group_id:a.id}})},J=(e,a)=>{if(e.length>1){const s=e.shift();m.value.toggleRowSelection(s,!1)}g.value=!1,u.push({name:"mySituation",query:{userPaperId:a.id,paperId:t.paper_id}})},U=(e,a)=>{if(e.length>1){const s=e.shift();m.value.toggleRowSelection(s,!1)}t.userPaperId?t.userPaperId="":t.userPaperId=a.id};function v(e){t.paper_name=e.name,t.paper_id=e.id,h.value=!0}async function X(e){t.paper_name=e.name,t.paper_id=e.id;const{data:a}=await ce(Object.assign(k,{paper_id:t.paper_id}));a.code==1&&(w.value=a.data,I.value=!0)}function Z(e){t.reDoIndex=e}function $(e){e.is_select==1?e.is_select=0:e.is_select==0&&(e.is_select=1)}async function ee(){const e=[];if(S.value.forEach((n,c)=>{n.is_select==1&&e.push(n.value)}),t.userPaperId==""){f({type:"error",message:"请选择试题"});return}if(e.length==0){f({type:"error",message:"请选择类型"});return}const a=e.toString(),{data:s}=await ue(Object.assign(M,{userPaperId:t.userPaperId,examStatus:a,currentTime:""}));s.code==0&&(I.value=!1,u.push({name:"test",query:{userPaperId:s.data.userPaperId,paperId:s.data.paperId}}))}function ae(e){e.is_select==0?e.is_select=1:e.is_select==1&&(e.is_select=0);const a=[];d.value.forEach((n,c)=>{n.is_select==1&&a.push(n.id)});const s=a.toString();t.subjectId=s,p()}async function te(e){u.push({name:"mySituation",query:{userPaperId:e.userPaperId,paperId:e.id}})}function se(){A.Multiple=="1"&&(d.value.forEach((e,a)=>{e.name=="综合学科"&&(e.is_select=1,t.subjectId=e.id)}),p())}return de(()=>{F(),p(),B()}),{singleTableRef:m,uploadSlotFile:K,tip:_,topicData:l,share:T,detailNum:r,saveT:V,subjectData:d,onSubmit:Y,onSelect:Q,remove:N,upload:y,importDialog:b,queDataList:P,goExercises:z,btnSituation:v,columns:W,selectList:G,loading:x,small:O,groupData:j,GroupDialog:h,selectClick:H,selectClick1:U,onRework:X,onReworkDialog:I,paperAnswer:w,reDoInfo:C,onReDoInfo:Z,itemArr:t,reDoInfo1:S,btnReDoInfo1:$,btnDeliverConfirm:ee,onSubjectData:ae,laodMyList:p,onMyDialog:g,onMyview:te,selectClick2:J}}export{Se as useEqu};