import{E as c}from"./index.CL7yl-Wb.js";import{a as k,r as p,aj as n,J as C,o as w,K as r,S as s,b as N,P as d}from"./vue.D1BjjNmv.js";import{_ as B}from"./_plugin-vue_export-helper.DlAUqK2U.js";const D={class:"dialog-footer"},J=k({__name:"ScoringStandardDialog",emits:["update"],setup(E,{expose:m,emit:f}){const l=p(!1),u=p(),o=p({scoring_reference:"",options:[{option_text:"无",score:0},{option_text:"轻度",score:1},{option_text:"中度",score:2},{option_text:"偏重",score:3},{option_text:"严重",score:4}]}),x=f,g=t=>{l.value=!0,t&&(o.value=JSON.parse(JSON.stringify(t)))},a=()=>{l.value=!1,o.value={scoring_reference:"",options:[{option_text:"无",score:0},{option_text:"轻度",score:1},{option_text:"中度",score:2},{option_text:"偏重",score:3},{option_text:"严重",score:4}]}},v=async()=>{try{if(!o.value.options.every(e=>e.option_text.trim()!==""&&e.score!==void 0)){c.warning("请填写完整的选项内容和分值");return}x("update",o.value),a(),c.success("保存成功")}catch(t){console.error("保存失败:",t),c.error("保存失败，请重试")}};return m({open:g}),(t,e)=>{const V=n("el-input"),b=n("el-form-item"),y=n("el-form"),_=n("el-button"),S=n("el-dialog");return w(),C(S,{modelValue:l.value,"onUpdate:modelValue":e[1]||(e[1]=i=>l.value=i),title:"设置评分标准",width:"600px","close-on-click-modal":!1,"before-close":a},{footer:r(()=>[N("span",D,[s(_,{onClick:a},{default:r(()=>e[2]||(e[2]=[d("取消")])),_:1}),s(_,{type:"primary",onClick:v},{default:r(()=>e[3]||(e[3]=[d("确认")])),_:1})])]),default:r(()=>[s(y,{ref_key:"formRef",ref:u,model:o.value,"label-width":"100px"},{default:r(()=>[s(b,{label:"评分说明"},{default:r(()=>[s(V,{modelValue:o.value.scoring_reference,"onUpdate:modelValue":e[0]||(e[0]=i=>o.value.scoring_reference=i),type:"textarea",rows:4,placeholder:"请输入评分标准说明，例如：【团队协作能力】1.优秀：xxxxxx。2.xxxx。3.一般：xxxxx。"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])}}}),h=B(J,[["__scopeId","data-v-eeba1d46"]]);export{h as default};
