import f from"./ExamConfigEditor-De5SQpL4.js";import{_ as u,g as v,h as n}from"./index-CsRk2AqG.js";import{a as _,V as g}from"./VAppBarTitle-DFo-aqXW.js";import{V as p}from"./VContainer-C6YXnkuM.js";import{X as m,Y as d,Z as o,j as i,a1 as l,$ as x}from"./vendor-vue-wu2SJQxD.js";import"./dataProvider-CZSEeRvI.js";import"./vendor-utils-DwjQ18Dh.js";import"./serverRotation-BLypxz6S.js";import"./VAlert-BgQXBXzr.js";import"./vendor-vuetify-BaOIwHiz.js";import"./VSkeletonLoader-1nFMV3Hy.js";import"./VTooltip-BqDuOSRz.js";import"./VChip-CViYTCJs.js";import"./VRow-DHfYjRE7.js";import"./VTextField-Bo6WlR6l.js";import"./VTextarea-D3srWVzb.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";const E={name:"ExamEditorPage",components:{ExamConfigEditor:f},data(){return{id:this.$route.params.id,saving:!1}},watch:{"$route.params.id"(r){this.id=r}},methods:{async save(){if(this.$refs.editor){this.saving=!0;try{await this.$refs.editor.saveConfig()}finally{this.saving=!1}}},onSaved(){var r,t;(t=(r=this.$toast)==null?void 0:r.success)==null||t.call(r,"保存成功")},onError(r){var t,e;(e=(t=this.$toast)==null?void 0:t.error)==null||e.call(t,r||"保存失败")}}};function V(r,t,e,h,a,s){const c=f;return m(),d(p,{class:"pa-0"},{default:o(()=>[i(_,{elevation:"1"},{prepend:o(()=>[i(n,{icon:"mdi-arrow-left",variant:"text",onClick:t[0]||(t[0]=C=>r.$router.back())})]),default:o(()=>[i(g,{class:"text-h6"},{default:o(()=>[...t[1]||(t[1]=[l(" 编辑考试配置 ",-1)])]),_:1}),i(v),i(n,{loading:a.saving,color:"success","prepend-icon":"mdi-content-save",variant:"outlined",onClick:s.save},{default:o(()=>[...t[2]||(t[2]=[l(" 保存 ",-1)])]),_:1},8,["loading","onClick"])]),_:1}),i(p,{class:"py-4",style:{"max-width":"1200px"}},{default:o(()=>[a.id?(m(),d(c,{key:0,ref:"editor","config-id":a.id,onError:s.onError,onSaved:s.onSaved},null,8,["config-id","onError","onSaved"])):x("",!0)]),_:1})]),_:1})}const L=u(E,[["render",V]]);export{L as default};
