import{S as J,E as _}from"./index.Df8UJ10K.js";import{a as T,r as d,w as g,aj as n,J as j,o as z,K as t,S as o,u as D,b as K,P as V}from"./vue.D1BjjNmv.js";import{_ as L}from"./_plugin-vue_export-helper.DlAUqK2U.js";const M={class:"dialog-footer"},R=T({__name:"index",props:{visible:{type:Boolean}},emits:["update:visible","confirm"],setup(x,{expose:h,emit:y}){const f=x,u=y,s=d(f.visible),C=d("http://127.0.0.1:8086/api/system/upload/");g(()=>f.visible,l=>{s.value=l}),g(()=>s.value,l=>{u("update:visible",l)});const v=d([]),a=d({damage_type:0,condition:"",photos:[]}),k=(l,e)=>{l.code===2e3?(a.value.photos.push(l.data.url),_.success("上传成功")):_.error(l.msg||"上传失败")},w=l=>{_.error("上传失败："+(l.message||"未知错误"))},U=l=>{const e=a.value.photos.findIndex(c=>c.filename===l.name);e!==-1&&a.value.photos.splice(e,1)},p=()=>{a.value={damage_type:0,condition:"",photos:[]},v.value=[],u("update:visible",!1)},B=()=>{u("confirm",a.value),p()};return h({dialogVisible:s}),(l,e)=>{const c=n("el-input"),m=n("el-form-item"),r=n("el-option"),S=n("el-select"),E=n("Plus"),N=n("el-icon"),P=n("el-upload"),A=n("el-form"),b=n("el-button"),I=n("el-dialog");return z(),j(I,{modelValue:s.value,"onUpdate:modelValue":e[2]||(e[2]=i=>s.value=i),title:"异常操作",width:"500px","close-on-click-modal":!1,onClose:p},{footer:t(()=>[K("span",M,[o(b,{onClick:p},{default:t(()=>e[3]||(e[3]=[V("取消")])),_:1}),o(b,{type:"primary",onClick:B},{default:t(()=>e[4]||(e[4]=[V("确认")])),_:1})])]),default:t(()=>[o(A,{model:a.value,"label-width":"80px"},{default:t(()=>[o(m,{label:"异常说明"},{default:t(()=>[o(c,{modelValue:a.value.condition,"onUpdate:modelValue":e[0]||(e[0]=i=>a.value.condition=i),type:"textarea",rows:3,placeholder:"请输入异常说明"},null,8,["modelValue"])]),_:1}),o(m,{label:"异常类型"},{default:t(()=>[o(S,{modelValue:a.value.damage_type,"onUpdate:modelValue":e[1]||(e[1]=i=>a.value.damage_type=i),placeholder:"请选择异常类型"},{default:t(()=>[o(r,{label:"严重损坏",value:0}),o(r,{label:"中度损坏",value:1}),o(r,{label:"轻度损坏",value:2})]),_:1},8,["modelValue"])]),_:1}),o(m,{label:"照片"},{default:t(()=>[o(P,{class:"upload-demo","list-type":"picture-card",action:C.value,headers:{Authorization:"JWT "+D(J).get("token")},"on-success":k,"on-error":w,"file-list":v.value,multiple:"","on-remove":U},{default:t(()=>[o(N,null,{default:t(()=>[o(E)]),_:1})]),_:1},8,["action","headers","file-list"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])}}}),F=L(R,[["__scopeId","data-v-550a6539"]]);export{F as default};
