| 1 |
- import{S as T,E as _}from"./index.BeV-poOC.js";import{a as z,r as d,w as g,ae as n,E as D,o as G,H as t,G as o,u as H,b as J,U as V}from"./vue.D_RgHSVm.js";import{_ as L}from"./_plugin-vue_export-helper.DlAUqK2U.js";const M={class:"dialog-footer"},R=z({__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://10.68.32.3: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"),E=n("el-select"),N=n("Plus"),S=n("el-icon"),A=n("el-upload"),I=n("el-form"),b=n("el-button"),P=n("el-dialog");return G(),D(P,{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(()=>[J("span",M,[o(b,{onClick:p},{default:t(()=>[...e[3]||(e[3]=[V("取消",-1)])]),_:1}),o(b,{type:"primary",onClick:B},{default:t(()=>[...e[4]||(e[4]=[V("确认",-1)])]),_:1})])]),default:t(()=>[o(I,{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(E,{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(A,{class:"upload-demo","list-type":"picture-card",action:C.value,headers:{Authorization:"JWT "+H(T).get("token")},"on-success":k,"on-error":w,"file-list":v.value,multiple:"","on-remove":U},{default:t(()=>[o(S,null,{default:t(()=>[o(N)]),_:1})]),_:1},8,["action","headers","file-list"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])}}}),q=L(R,[["__scopeId","data-v-550a6539"]]);export{q as default};
|