import A from"./ExamConfigEditor-De5SQpL4.js";import{d as C}from"./dataProvider-CZSEeRvI.js";import{_ as F,e as y,c as V,f as g,F as J,d as v,h as u,p as R,q as z,r as O,t as H,o as L,k as S,l as T,g as k,n as P}from"./index-CsRk2AqG.js";import{X as p,Y as h,Z as i,j as s,a1 as l,k as f,S as x,$ as D,_ as U,F as X,a2 as j,ad as B}from"./vendor-vue-wu2SJQxD.js";import{V as W,a as q}from"./VRow-DHfYjRE7.js";import{V as N}from"./VAlert-BgQXBXzr.js";import{V as M}from"./VChip-CViYTCJs.js";import{V as K}from"./VSkeletonLoader-1nFMV3Hy.js";import{V as Y}from"./VTextField-Bo6WlR6l.js";import{V as G}from"./VTextarea-D3srWVzb.js";import{V as Z}from"./VContainer-C6YXnkuM.js";import"./VTooltip-BqDuOSRz.js";import"./vendor-vuetify-BaOIwHiz.js";import"./VSwitch-BvFHuUFC.js";import"./VAutocomplete-Fe-QfMSz.js";import"./VSelect-Ds4dZNYo.js";import"./VSheet-BN0mPF06.js";import"./VCheckboxBtn-J2irdueg.js";import"./VDatePicker-BiNZFTl6.js";import"./VPicker-CJNui2Y5.js";import"./VTimePicker-vhv6XekM.js";import"./vendor-utils-DwjQ18Dh.js";import"./serverRotation-BLypxz6S.js";const Q={name:"ExamScheduleManager",components:{ExamConfigEditor:A},data(){return{configs:[],loading:!1,error:"",success:"",renameDialog:!1,editDialog:!1,configToRename:null,editingConfig:null,newConfigName:"",renaming:!1,saving:!1,importDialog:!1,importJson:"",importError:"",importing:!1,datePickerDialog:!1,baseDate:"",virtualDateInfo:null,pendingImportConfig:null,aiDialog:!1,copied:!1}},async mounted(){await this.loadConfigs()},computed:{aiPrompt(){const a=new Date;return`Your task is to generate a JSON configuration file for an exam dashboard. Based on the exam information input by the user, generate the configuration strictly following these rules.

Generation Requirements:
* Output using JSON blocks in Markdown
* Use Chinese for all text

Field Definitions:

examName (string)
* The general name of the exam
* Fill with "考试" when not provided by user

message (string)
* Exam reminder message
* Prioritize user-provided content
* When not provided by user, fill with "请保持卷面整洁，字迹清晰，遵守考场纪律，诚信应考。听到终考铃声时，请立即起立并停止作答。"

room (string)
* Exam room number
* Fill in if provided by user, otherwise use empty string ""

examInfos (array)
* Array of information for each exam session
* Each object must include:
   * name: The subject or name of that exam session
   * start: Start time, format "YYYY-MM-DD HH:mm:ss"
   * end: End time, format "YYYY-MM-DD HH:mm:ss"
   * alertTime: Minutes before exam end for reminder, fill with 15

Date and Time Handling:
* Current date: ${`${a.getFullYear()}年${a.getMonth()+1}月${a.getDate()}日`}
* When user provides specific dates, use actual dates
* When user does not provide dates, use virtual date format "0000-00-XX"
* XX represents day number: 01=first day, 02=second day, 03=third day...
* Time portion filled according to user description
* For multiple exams, calculate dates sequentially in order

Now please generate the exam configuration based on the above rules:`}},methods:{inferExamType(){const a=new Date,e=a.getMonth()+1,r=a.getDate();let o="新考试",t=`请保持卷面整洁，字迹清晰，遵守考场纪律，诚信应考。
听到终考铃声时,请立即起立并停止作答。`;return e>=9||e<=1?e===9&&r<=15?o="开学摸底考试":e===9&&r>15?o="第一次月考":e===10?o="第二次月考":e===11&&r<=20?o="期中考试":e===11&&r>20?o="第三次月考":e===12?o="第四次月考":e===1&&(o="期末考试"):e>=2&&e<=7&&(e===2||e===3&&r<=10?o="开学摸底考试":e===3&&r>10?o="第一次月考":e===4&&r<=25?o="期中考试":e===4&&r>25?o="第二次月考":e===5?o="第三次月考":(e===6||e===7)&&(o="期末考试")),{examName:o,message:t}},async initializeExampleData(){const a=[{id:"exam_example_001",examName:"期末考试安排",message:"请按时参加考试，携带学生证和身份证",examInfos:[{name:"数学",start:"2025/01/15 09:00",end:"2025/01/15 11:00"},{name:"英语",start:"2025/01/16 14:00",end:"2025/01/16 16:00"}]},{id:"exam_example_002",examName:"期中考试安排",message:"考试期间请保持安静",examInfos:[{name:"物理",start:"2025/01/20 10:00",end:"2025/01/20 12:00"},{name:"化学",start:"2025/01/21 14:00",end:"2025/01/21 16:00"}]},{id:"exam_example_003",examName:"模拟考试安排",message:"模拟考试，请认真对待",examInfos:[{name:"语文",start:"2025/01/25 09:00",end:"2025/01/25 11:30"}]}],e=a.map(r=>({id:r.id}));await C.saveData("es_list",e);for(let r of a){const o={...r};delete o.id,await C.saveData(`es_${r.id}`,o)}return a},async loadConfigs(){this.loading=!0,this.error="";try{const a=await C.loadData("es_list");if(a&&a&&a.length>0){this.configs=[];for(let e of a)try{const r=await C.loadData(`es_${e.id}`);r&&this.configs.push({id:e.id,...r})}catch(r){console.warn(`加载配置 es_${e.id} 失败:`,r)}}else this.configs=await this.initializeExampleData()}catch(a){this.error="加载配置列表失败: "+a.message,this.configs=[]}finally{this.loading=!1}},async createNewConfig(){var c,n;const a=Date.now().toString(),e=new Date;e.setDate(e.getDate()+1),e.setHours(8,0,0,0);const r=new Date(e);r.setHours(r.getHours()+2);const o=d=>{const E=d.getFullYear(),I=String(d.getMonth()+1).padStart(2,"0"),w=String(d.getDate()).padStart(2,"0"),b=String(d.getHours()).padStart(2,"0"),_=String(d.getMinutes()).padStart(2,"0");return`${E}/${I}/${w} ${b}:${_}`},t=this.inferExamType(),m={examName:t.examName,message:t.message,room:P("server.classNumber")||"",examInfos:[{name:"语文",start:o(e),end:o(r)}]};try{const d=await C.saveData(`es_${a}`,m);if(!d)throw new Error(((c=d.error)==null?void 0:c.message)||"保存失败");this.configs.push({id:a,...m});const E=this.configs.map(b=>({id:b.id})),I=await C.saveData("es_list",E);if(!I)throw new Error(((n=I.error)==null?void 0:n.message)||"更新列表失败");this.$message.success("新配置创建成功");const w=this.configs.find(b=>b.id===a);w&&(this.editingConfig=w,this.editDialog=!0)}catch(d){this.$message.error("创建配置失败: "+d.message)}},showRenameDialog(a){this.configToRename=a,this.newConfigName=a.examName||`配置 ${a.id}`,this.renameDialog=!0},async renameConfig(){var a;if(!(!this.configToRename||!this.newConfigName)){this.renaming=!0;try{const e={examName:this.newConfigName,message:this.configToRename.message,examInfos:this.configToRename.examInfos},r=await C.saveData(`es_${this.configToRename.id}`,e);if(!r)throw new Error(((a=r.error)==null?void 0:a.message)||"保存失败");const o=this.configs.findIndex(t=>t.id===this.configToRename.id);o!==-1&&(this.configs[o].examName=this.newConfigName),this.$message.success("配置重命名成功"),this.renameDialog=!1,this.configToRename=null,this.newConfigName=""}catch(e){this.$message.error("重命名配置失败: "+e.message)}finally{this.renaming=!1}}},showEditDialog(a){this.editingConfig=a,this.editDialog=!0},closeEditDialog(){this.editDialog=!1,this.editingConfig=null,this.saving=!1},async saveConfigInDialog(){if(this.$refs.configEditor){this.saving=!0;try{await this.$refs.configEditor.saveConfig()}catch(a){console.error("保存配置失败:",a)}finally{this.saving=!1}}},onConfigSaved(){this.$message.success("配置保存成功！"),this.loadConfigs(),this.$message.success("配置保存成功！")},onConfigError(a){this.$message.error(a||"保存配置时发生错误"),this.$message.error(a||"保存配置时发生错误")},onConfigOpened(){this.$message.success("配置已在新窗口中打开"),this.$message.success("配置已在新窗口中打开")},onConfigDeleted(a){a.success?(this.$message.success(a.message||"配置删除成功"),this.editDialog=!1,this.loadConfigs()):this.$message.error(a.message||"删除失败")},showImportDialog(){this.importDialog=!0,this.importJson="",this.importError=""},closeImportDialog(){this.importDialog=!1,this.importJson="",this.importError="",this.importing=!1},detectVirtualDates(a){const e=/^0000-00-(\d{2})/;let r=!1,o=1/0,t=-1/0,m=0;if(a.examInfos&&Array.isArray(a.examInfos))for(let c of a.examInfos){if(c.start){const n=c.start.match(e);if(n){r=!0,m++;const d=parseInt(n[1]);o=Math.min(o,d),t=Math.max(t,d)}}if(c.end){const n=c.end.match(e);if(n){r=!0;const d=parseInt(n[1]);o=Math.min(o,d),t=Math.max(t,d)}}}return r?{hasVirtual:!0,count:m,span:t-o+1,minDay:o,maxDay:t}:null},convertVirtualDate(a,e){const r=/^0000-00-(\d{2})\s+(.+)$/,o=a.match(r);if(!o)return a;const t=parseInt(o[1]),m=o[2],c=new Date(e),n=new Date(c);n.setDate(c.getDate()+(t-1));const d=n.getFullYear(),E=String(n.getMonth()+1).padStart(2,"0"),I=String(n.getDate()).padStart(2,"0"),w=m.match(/(\d{2}):(\d{2})(?::(\d{2}))?/);if(w){const b=w[1],_=w[2];return`${d}/${E}/${I} ${b}:${_}`}return`${d}/${E}/${I} ${m}`},normalizeDateFormat(a){if(!a)return"";if(/^\d{4}\/\d{2}\/\d{2}\s+\d{2}:\d{2}$/.test(a))return a;const e=/^(\d{4})-(\d{2})-(\d{2})\s+(\d{2}):(\d{2})(?::(\d{2}))?$/,r=a.match(e);if(r)return`${r[1]}/${r[2]}/${r[3]} ${r[4]}:${r[5]}`;const o=/^(\d{4})-(\d{2})-(\d{2})$/,t=a.match(o);return t?`${t[1]}/${t[2]}/${t[3]} 08:00`:a},validateAndFillConfig(a){const e=this.inferExamType(),r={examName:a.examName||e.examName,message:a.message||e.message,room:a.room||P("server.classNumber")||"",examInfos:[]};if(!a.examInfos||!Array.isArray(a.examInfos))throw new Error("配置中缺少 examInfos 数组");if(a.examInfos.length===0)throw new Error("examInfos 数组不能为空");for(let o=0;o<a.examInfos.length;o++){const t=a.examInfos[o];if(!t.name)throw new Error(`第 ${o+1} 个考试缺少 name 字段`);if(!t.start)throw new Error(`第 ${o+1} 个考试缺少 start 字段`);if(!t.end)throw new Error(`第 ${o+1} 个考试缺少 end 字段`);r.examInfos.push({name:t.name,start:t.start,end:t.end,alertTime:t.alertTime!==void 0?t.alertTime:15,materials:t.materials||[]})}return r},async processImport(){this.importing=!0,this.importError="";try{let a;try{a=JSON.parse(this.importJson)}catch(o){throw new Error("JSON 格式错误: "+o.message)}const e=this.validateAndFillConfig(a),r=this.detectVirtualDates(e);if(r){this.virtualDateInfo=r,this.pendingImportConfig=e;const o=new Date;o.setDate(o.getDate()+1);const t=o.getFullYear(),m=String(o.getMonth()+1).padStart(2,"0"),c=String(o.getDate()).padStart(2,"0");this.baseDate=`${t}-${m}-${c}`,this.datePickerDialog=!0}else await this.finalizeImport(e)}catch(a){this.importError=a.message}finally{this.importing=!1}},cancelDatePicker(){this.datePickerDialog=!1,this.baseDate="",this.virtualDateInfo=null,this.pendingImportConfig=null},async confirmDatePicker(){if(!(!this.baseDate||!this.pendingImportConfig))try{const a=JSON.parse(JSON.stringify(this.pendingImportConfig));for(let e of a.examInfos)e.start&&e.start.startsWith("0000-00-")&&(e.start=this.convertVirtualDate(e.start,this.baseDate)),e.end&&e.end.startsWith("0000-00-")&&(e.end=this.convertVirtualDate(e.end,this.baseDate));this.datePickerDialog=!1,this.baseDate="",this.virtualDateInfo=null,this.pendingImportConfig=null,await this.finalizeImport(a)}catch(a){this.importError="日期转换失败: "+a.message,this.datePickerDialog=!1}},async finalizeImport(a){var r,o;const e=Date.now().toString();for(let t of a.examInfos)t.start=this.normalizeDateFormat(t.start),t.end=this.normalizeDateFormat(t.end);try{const t=await C.saveData(`es_${e}`,a);if(!t)throw new Error(((r=t.error)==null?void 0:r.message)||"保存失败");this.configs.push({id:e,...a});const m=this.configs.map(d=>({id:d.id})),c=await C.saveData("es_list",m);if(!c)throw new Error(((o=c.error)==null?void 0:o.message)||"更新列表失败");this.success="配置导入成功！",this.closeImportDialog();const n=this.configs.find(d=>d.id===e);n&&(this.editingConfig=n,this.editDialog=!0)}catch(t){throw new Error("保存配置失败: "+t.message)}},showAIDialog(){this.aiDialog=!0,this.copied=!1},closeAIDialog(){this.aiDialog=!1,this.copied=!1},async copyPrompt(){try{await navigator.clipboard.writeText(this.aiPrompt),this.copied=!0,setTimeout(()=>{this.copied=!1},3e3)}catch{const e=document.createElement("textarea");e.value=this.aiPrompt,e.style.position="fixed",e.style.left="-999999px",document.body.appendChild(e),e.select();try{document.execCommand("copy"),this.copied=!0,setTimeout(()=>{this.copied=!1},3e3)}catch{this.error="复制失败，请手动复制"}document.body.removeChild(e)}},goToImport(){this.aiDialog=!1,this.showImportDialog()}}},$={class:"d-flex align-center"},ee={class:"d-flex align-center"},te={class:"d-flex justify-space-between align-center mb-4"},ie={class:"d-flex align-center"},se={class:"d-flex align-center"},ae={class:"d-flex align-center mt-1"},oe={class:"d-flex align-center"},ne={class:"text-caption"},re={class:"mb-3"},le={class:"d-flex justify-space-between align-center mb-2"},me={class:"ai-prompt-text"};function de(a,e,r,o,t,m){const c=A;return p(),h(Z,{class:"fill-height"},{default:i(()=>[s(W,null,{default:i(()=>[s(q,{cols:"12"},{default:i(()=>[s(y,{border:"",class:"elevation-12"},{default:i(()=>[s(V,{class:"d-flex align-center primary lighten-1 white--text py-3 px-4"},{default:i(()=>[s(g,{class:"mr-2",color:"white"},{default:i(()=>[...e[12]||(e[12]=[l("mdi-calendar-check",-1)])]),_:1}),e[13]||(e[13]=l(" 考试看板 ",-1))]),_:1}),s(J,null,{default:i(()=>[...e[14]||(e[14]=[l(" 不只是考试看板。 ",-1)])]),_:1}),s(v,null,{default:i(()=>[t.error?(p(),h(N,{key:0,border:"start",class:"mb-4 mt-3 mx-2",closable:"",type:"error",variant:"tonal","onClick:close":e[0]||(e[0]=n=>t.error="")},{default:i(()=>[f("div",$,[s(g,{class:"mr-2"},{default:i(()=>[...e[15]||(e[15]=[l("mdi-alert-circle",-1)])]),_:1}),l(" "+x(t.error),1)])]),_:1})):D("",!0),t.success?(p(),h(N,{key:1,border:"start",class:"mb-4 mt-3 mx-2",closable:"",type:"success",variant:"tonal","onClick:close":e[1]||(e[1]=n=>t.success="")},{default:i(()=>[f("div",ee,[s(g,{class:"mr-2"},{default:i(()=>[...e[16]||(e[16]=[l("mdi-check-circle",-1)])]),_:1}),l(" "+x(t.success),1)])]),_:1})):D("",!0),f("div",te,[f("div",ie,[s(u,{class:"mr-2",color:"primary","prepend-icon":"mdi-plus",onClick:m.createNewConfig},{default:i(()=>[...e[17]||(e[17]=[l(" 新建配置 ",-1)])]),_:1},8,["onClick"]),s(u,{class:"mr-2",color:"success","prepend-icon":"mdi-import",variant:"outlined",onClick:m.showImportDialog},{default:i(()=>[...e[18]||(e[18]=[l(" 导入配置 ",-1)])]),_:1},8,["onClick"]),s(u,{class:"mr-2",color:"purple","prepend-icon":"mdi-brain",variant:"outlined",onClick:m.showAIDialog},{default:i(()=>[...e[19]||(e[19]=[l(" AI生成 ",-1)])]),_:1},8,["onClick"]),s(u,{loading:t.loading,color:"info","prepend-icon":"mdi-refresh",variant:"outlined",onClick:m.loadConfigs},{default:i(()=>[...e[20]||(e[20]=[l(" 刷新 ",-1)])]),_:1},8,["loading","onClick"])]),t.configs.length>0?(p(),h(M,{key:0,color:"primary","prepend-icon":"mdi-format-list-numbered"},{default:i(()=>[l(x(t.configs.length)+" 个配置 ",1)]),_:1})):D("",!0)]),t.loading?(p(),h(y,{key:2,class:"my-4",outlined:""},{default:i(()=>[s(v,null,{default:i(()=>[s(K,{class:"mx-auto",type:"list-item-avatar-two-line@3"})]),_:1})]),_:1})):D("",!0),!t.loading&&t.configs.length>0?(p(),h(y,{key:3,class:"my-4",elevation:"1"},{default:i(()=>[s(V,{class:"d-flex align-center pa-4 bg-primary-lighten-5"},{default:i(()=>[s(g,{class:"mr-2"},{default:i(()=>[...e[21]||(e[21]=[l("mdi-format-list-bulleted",-1)])]),_:1}),e[22]||(e[22]=f("span",{class:"font-weight-bold"},"配置列表",-1))]),_:1}),s(R,null,{default:i(()=>[(p(!0),U(X,null,j(t.configs,n=>(p(),h(z,{key:n.id,class:"border-b",style:{cursor:"pointer"},onClick:d=>m.showEditDialog(n)},{prepend:i(()=>[s(L,{class:"mr-2",color:"primary"},{default:i(()=>[s(g,{color:"white"},{default:i(()=>[...e[23]||(e[23]=[l("mdi-calendar-text",-1)])]),_:1})]),_:1})]),append:i(()=>[f("div",oe,[s(u,{class:"mr-1",color:"primary",icon:"mdi-pencil",size:"small",variant:"text",onClick:d=>m.showEditDialog(n)},{default:i(()=>[s(g,null,{default:i(()=>[...e[26]||(e[26]=[l("mdi-pencil",-1)])]),_:1})]),_:1},8,["onClick"]),s(u,{class:"mr-1",color:"info",icon:"mdi-eye",size:"small",variant:"text",onClick:d=>m.showEditDialog(n)},{default:i(()=>[s(g,null,{default:i(()=>[...e[27]||(e[27]=[l("mdi-eye",-1)])]),_:1})]),_:1},8,["onClick"])])]),default:i(()=>[s(O,{class:"font-weight-medium"},{default:i(()=>[l(x(n.examName||`配置 ${n.id}`),1)]),_:2},1024),s(H,{class:"text-caption mt-1"},{default:i(()=>[f("div",se,[s(g,{class:"mr-1",size:"small"},{default:i(()=>[...e[24]||(e[24]=[l("mdi-information-outline",-1)])]),_:1}),l(" "+x(n.message||"无描述"),1)]),f("div",ae,[s(g,{class:"mr-1",size:"small"},{default:i(()=>[...e[25]||(e[25]=[l("mdi-book-multiple",-1)])]),_:1}),l(" "+x(n.examInfos?n.examInfos.length:0)+" 堂考试 ",1)])]),_:2},1024)]),_:2},1032,["onClick"]))),128))]),_:1})]),_:1})):D("",!0),!t.loading&&t.configs.length===0?(p(),h(y,{key:4,class:"my-4",elevation:"1"},{default:i(()=>[s(v,{class:"text-center py-8"},{default:i(()=>[s(g,{class:"mb-4",color:"grey-lighten-1",size:"64"},{default:i(()=>[...e[28]||(e[28]=[l(" mdi-calendar-blank ",-1)])]),_:1}),e[30]||(e[30]=f("h3",{class:"text-h6 mb-2 text-grey-darken-1"},"暂无配置",-1)),e[31]||(e[31]=f("p",{class:"text-body-2 text-grey-darken-1 mb-4"},' 点击"新建配置"按钮创建您的第一个考试配置 ',-1)),s(u,{color:"primary","prepend-icon":"mdi-plus",onClick:m.createNewConfig},{default:i(()=>[...e[29]||(e[29]=[l(" 新建配置 ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1})):D("",!0)]),_:1})]),_:1})]),_:1})]),_:1}),s(S,{modelValue:t.renameDialog,"onUpdate:modelValue":e[4]||(e[4]=n=>t.renameDialog=n),"max-width":"500"},{default:i(()=>[s(y,null,{default:i(()=>[s(V,{class:"d-flex align-center"},{default:i(()=>[s(g,{class:"mr-2",color:"primary"},{default:i(()=>[...e[32]||(e[32]=[l("mdi-rename-box",-1)])]),_:1}),e[33]||(e[33]=l(" 重命名配置 ",-1))]),_:1}),s(v,null,{default:i(()=>[s(Y,{modelValue:t.newConfigName,"onUpdate:modelValue":e[2]||(e[2]=n=>t.newConfigName=n),rules:[n=>!!n||"配置名称不能为空"],label:"配置名称","prepend-inner-icon":"mdi-calendar-text",variant:"outlined",onKeyup:B(m.renameConfig,["enter"])},null,8,["modelValue","rules","onKeyup"])]),_:1}),s(T,null,{default:i(()=>[s(k),s(u,{color:"grey",variant:"text",onClick:e[3]||(e[3]=n=>t.renameDialog=!1)},{default:i(()=>[...e[34]||(e[34]=[l(" 取消 ",-1)])]),_:1}),s(u,{disabled:!t.newConfigName,loading:t.renaming,color:"primary",variant:"outlined",onClick:m.renameConfig},{default:i(()=>[...e[35]||(e[35]=[l(" 确认 ",-1)])]),_:1},8,["disabled","loading","onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),s(S,{modelValue:t.editDialog,"onUpdate:modelValue":e[5]||(e[5]=n=>t.editDialog=n),"max-width":"1200",persistent:""},{default:i(()=>[s(y,null,{default:i(()=>[s(V,{class:"d-flex align-center primary lighten-1 white--text py-3 px-4"},{default:i(()=>[s(g,{class:"mr-2",color:"white"},{default:i(()=>[...e[36]||(e[36]=[l("mdi-pencil",-1)])]),_:1}),e[38]||(e[38]=l(" 编辑考试配置 ",-1)),s(k),t.editingConfig?(p(),h(M,{key:0,class:"mr-2",color:"white",size:"small","text-color":"primary"},{default:i(()=>[l(" ID: "+x(t.editingConfig.id),1)]),_:1})):D("",!0),s(u,{color:"white",icon:"mdi-close",variant:"text",onClick:m.closeEditDialog},{default:i(()=>[s(g,null,{default:i(()=>[...e[37]||(e[37]=[l("mdi-close",-1)])]),_:1})]),_:1},8,["onClick"])]),_:1}),s(v,{class:"pa-4",style:{"max-height":"70vh","overflow-y":"auto"}},{default:i(()=>[t.editingConfig?(p(),h(c,{key:0,ref:"configEditor","config-id":t.editingConfig.id,"dialog-mode":!0,onDeleted:m.onConfigDeleted,onError:m.onConfigError,onOpened:m.onConfigOpened,onSaved:m.onConfigSaved},null,8,["config-id","onDeleted","onError","onOpened","onSaved"])):D("",!0)]),_:1}),s(T,{class:"pa-4"},{default:i(()=>[s(u,{color:"grey","prepend-icon":"mdi-close",variant:"outlined",onClick:m.closeEditDialog},{default:i(()=>[...e[39]||(e[39]=[l(" 关闭 ",-1)])]),_:1},8,["onClick"]),s(k),s(u,{loading:t.saving,color:"success","prepend-icon":"mdi-content-save",variant:"outlined",onClick:m.saveConfigInDialog},{default:i(()=>[...e[40]||(e[40]=[l(" 保存配置 ",-1)])]),_:1},8,["loading","onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),s(S,{modelValue:t.importDialog,"onUpdate:modelValue":e[8]||(e[8]=n=>t.importDialog=n),"max-width":"800",persistent:""},{default:i(()=>[s(y,null,{default:i(()=>[s(V,{class:"d-flex align-center primary lighten-1 white--text py-3 px-4"},{default:i(()=>[s(g,{class:"mr-2",color:"white"},{default:i(()=>[...e[41]||(e[41]=[l("mdi-import",-1)])]),_:1}),e[43]||(e[43]=l(" 导入考试配置 ",-1)),s(k),s(u,{color:"white",icon:"mdi-close",variant:"text",onClick:m.closeImportDialog},{default:i(()=>[s(g,null,{default:i(()=>[...e[42]||(e[42]=[l("mdi-close",-1)])]),_:1})]),_:1},8,["onClick"])]),_:1}),s(v,{class:"pa-4"},{default:i(()=>[t.importError?(p(),h(N,{key:0,border:"start",class:"mb-4",closable:"",type:"error",variant:"tonal","onClick:close":e[6]||(e[6]=n=>t.importError="")},{default:i(()=>[l(x(t.importError),1)]),_:1})):D("",!0),s(G,{modelValue:t.importJson,"onUpdate:modelValue":e[7]||(e[7]=n=>t.importJson=n),rules:[n=>!!n||"JSON内容不能为空"],label:"请输入JSON配置",placeholder:`{
  "examName": "期末考试",
  "message": "考试信息",
  "room": "01",
  "examInfos": [
    {
      "name": "语文",
      "start": "2025/12/14 09:00",
      "end": "2025/12/14 11:00"
    }
  ]
}`,"prepend-inner-icon":"mdi-code-json",rows:"15",variant:"outlined"},null,8,["modelValue","rules"]),s(N,{border:"start",class:"mt-2",density:"compact",type:"info",variant:"tonal"},{default:i(()=>[...e[44]||(e[44]=[f("div",{class:"text-caption"},[f("strong",null,"提示:"),f("ul",{class:"mt-1"},[f("li",null,"日期格式支持: YYYY/MM/DD HH:mm 或 YYYY-MM-DD HH:mm:ss"),f("li",null,"虚拟日期格式: 0000-00-01 (表示第1天), 0000-00-02 (第2天)..."),f("li",null,"如使用虚拟日期,系统会要求您指定起始日期"),f("li",null,"缺省字段将自动填充默认值")])],-1)])]),_:1})]),_:1}),s(T,{class:"pa-4"},{default:i(()=>[s(u,{color:"grey","prepend-icon":"mdi-close",variant:"outlined",onClick:m.closeImportDialog},{default:i(()=>[...e[45]||(e[45]=[l(" 取消 ",-1)])]),_:1},8,["onClick"]),s(k),s(u,{disabled:!t.importJson,loading:t.importing,color:"success","prepend-icon":"mdi-check",variant:"outlined",onClick:m.processImport},{default:i(()=>[...e[46]||(e[46]=[l(" 导入 ",-1)])]),_:1},8,["disabled","loading","onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),s(S,{modelValue:t.datePickerDialog,"onUpdate:modelValue":e[10]||(e[10]=n=>t.datePickerDialog=n),"max-width":"500",persistent:""},{default:i(()=>[s(y,null,{default:i(()=>[s(V,{class:"d-flex align-center primary lighten-1 white--text py-3 px-4"},{default:i(()=>[s(g,{class:"mr-2",color:"white"},{default:i(()=>[...e[47]||(e[47]=[l("mdi-calendar",-1)])]),_:1}),e[48]||(e[48]=l(" 选择起始日期 ",-1))]),_:1}),s(v,{class:"pa-4"},{default:i(()=>[e[49]||(e[49]=f("p",{class:"mb-4 text-body-2"}," 检测到配置中使用了虚拟日期格式 (0000-00-XX)，请选择第一天的日期，系统将自动推算其他日期。 ",-1)),s(Y,{modelValue:t.baseDate,"onUpdate:modelValue":e[9]||(e[9]=n=>t.baseDate=n),label:"起始日期","prepend-inner-icon":"mdi-calendar",type:"date",variant:"outlined"},null,8,["modelValue"]),t.virtualDateInfo?(p(),h(N,{key:0,border:"start",class:"mt-2",density:"compact",type:"info",variant:"tonal"},{default:i(()=>[f("div",ne," 检测到 "+x(t.virtualDateInfo.count)+" 个虚拟日期，跨度 "+x(t.virtualDateInfo.span)+" 天 ",1)]),_:1})):D("",!0)]),_:1}),s(T,{class:"pa-4"},{default:i(()=>[s(u,{color:"grey","prepend-icon":"mdi-close",variant:"outlined",onClick:m.cancelDatePicker},{default:i(()=>[...e[50]||(e[50]=[l(" 取消 ",-1)])]),_:1},8,["onClick"]),s(k),s(u,{disabled:!t.baseDate,color:"primary","prepend-icon":"mdi-check",variant:"outlined",onClick:m.confirmDatePicker},{default:i(()=>[...e[51]||(e[51]=[l(" 确认 ",-1)])]),_:1},8,["disabled","onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"]),s(S,{modelValue:t.aiDialog,"onUpdate:modelValue":e[11]||(e[11]=n=>t.aiDialog=n),"max-width":"900",persistent:""},{default:i(()=>[s(y,null,{default:i(()=>[s(V,{class:"d-flex align-center purple lighten-1 white--text py-3 px-4"},{default:i(()=>[s(g,{class:"mr-2",color:"white"},{default:i(()=>[...e[52]||(e[52]=[l("mdi-brain",-1)])]),_:1}),e[54]||(e[54]=l(" AI生成考试配置 ",-1)),s(k),s(u,{color:"white",icon:"mdi-close",variant:"text",onClick:m.closeAIDialog},{default:i(()=>[s(g,null,{default:i(()=>[...e[53]||(e[53]=[l("mdi-close",-1)])]),_:1})]),_:1},8,["onClick"])]),_:1}),s(v,{class:"pa-4"},{default:i(()=>[s(N,{border:"start",class:"mb-4",type:"info",variant:"tonal"},{default:i(()=>[...e[55]||(e[55]=[f("div",{class:"d-flex align-center"},[f("div",null," 复制下方提示词到任意AI工具（如ChatGPT、Claude、Copilot等），描述您的考试安排，AI将生成符合格式的JSON配置。生成后复制JSON内容，通过“导入配置”按钮导入即可。 ")],-1)])]),_:1}),f("div",re,[f("div",le,[e[56]||(e[56]=f("h3",{class:"text-h6"},"提示词模板",-1)),s(u,{color:t.copied?"success":"primary","prepend-icon":t.copied?"mdi-check":"mdi-content-copy",size:"small",variant:"tonal",onClick:m.copyPrompt},{default:i(()=>[l(x(t.copied?"已复制":"复制提示词"),1)]),_:1},8,["color","prepend-icon","onClick"])]),s(y,{class:"pa-4",variant:"outlined"},{default:i(()=>[f("pre",me,x(m.aiPrompt),1)]),_:1})])]),_:1}),s(T,{class:"pa-4"},{default:i(()=>[s(u,{color:"grey","prepend-icon":"mdi-close",variant:"outlined",onClick:m.closeAIDialog},{default:i(()=>[...e[57]||(e[57]=[l(" 关闭 ",-1)])]),_:1},8,["onClick"]),s(k),s(u,{color:"success","prepend-icon":"mdi-import",variant:"outlined",onClick:m.goToImport},{default:i(()=>[...e[58]||(e[58]=[l(" 去导入配置 ",-1)])]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue"])]),_:1})}const Ye=F(Q,[["render",de],["__scopeId","data-v-7ffcce90"]]);export{Ye as default};
