import{_ as c}from"./ExamConfigEditor--fOzfihv.js";import{_ as u,j as n,o as d,w as r,d as e,t as p,x as v,y as m,B as _}from"./index-BBhBboPS.js";import{c as g,b as x}from"./VAppBarTitle-DzkwrUdS.js";import{V as l}from"./VContainer-CvKHPctk.js";import"./dataProvider-Df79D6P7.js";import"./axios-CvdON-CO.js";import"./VAlert-DALo1B8l.js";import"./VSkeletonLoader-Caem4NRN.js";import"./VBadge-i7pqHSnB.js";import"./VChip-BfKPtxQh.js";import"./VRow-DPRU2lkb.js";import"./VTextField-B0ZitX9S.js";import"./VTextarea-BR_H10GT.js";import"./VMenu-BiA210FN.js";import"./VDatePicker-BaKLPx7V.js";import"./VSheet-BFguZvdq.js";const E={name:"ExamEditorPage",components:{ExamConfigEditor:c},data(){return{id:this.$route.params.id,saving:!1}},watch:{"$route.params.id"(o){this.id=o}},methods:{async save(){if(this.$refs.editor){this.saving=!0;try{await this.$refs.editor.saveConfig()}finally{this.saving=!1}}},onSaved(){var o,t;(t=(o=this.$toast)==null?void 0:o.success)==null||t.call(o,"保存成功")},onError(o){var t,i;(i=(t=this.$toast)==null?void 0:t.error)==null||i.call(t,o||"保存失败")}}};function C(o,t,i,V,a,s){const f=c;return d(),n(l,{class:"pa-0"},{default:r(()=>[e(g,{elevation:"1"},{prepend:r(()=>[e(m,{icon:"mdi-arrow-left",variant:"text",onClick:t[0]||(t[0]=h=>o.$router.back())})]),default:r(()=>[e(x,{class:"text-h6"},{default:r(()=>[...t[1]||(t[1]=[p(" 编辑考试配置 ",-1)])]),_:1}),e(v),e(m,{loading:a.saving,color:"success","prepend-icon":"mdi-content-save",variant:"outlined",onClick:s.save},{default:r(()=>[...t[2]||(t[2]=[p(" 保存 ",-1)])]),_:1},8,["loading","onClick"])]),_:1}),e(l,{class:"py-4",style:{"max-width":"1200px"}},{default:r(()=>[a.id?(d(),n(f,{key:0,ref:"editor","config-id":a.id,onError:s.onError,onSaved:s.onSaved},null,8,["config-id","onError","onSaved"])):_("",!0)]),_:1})]),_:1})}const G=u(E,[["render",C]]);export{G as default};
