import{az as c,d as E,Q as N,r as m,x as j,o as _,A as y,B as r,f as s,a as e,E as b,k as P,c as Q,F as W,R as Z,a2 as G,a8 as H,V as I,S as J,U as L,W as X,K as Y,Z as $,__tla as aa}from"./index-92ad187a.js";import{_ as ea,__tla as ta}from"./Dialog-44c9fa34.js";import{_ as la,__tla as ra}from"./style.css_vue_type_style_index_0_src_true_lang-4e9b772e.js";import{a as sa,D as oa,__tla as ua}from"./dict-221f3e01.js";import{u as da,__tla as na}from"./useMessage-d9788660.js";let k,U,x,S,ca=Promise.all([(()=>{try{return aa}catch{}})(),(()=>{try{return ta}catch{}})(),(()=>{try{return ra}catch{}})(),(()=>{try{return ua}catch{}})(),(()=>{try{return na}catch{}})()]).then(async()=>{S=async u=>await c.get({url:"/report/ureport-data/page",params:u}),U=async u=>await c.delete({url:"/report/ureport-data/delete?id="+u}),x=async u=>await c.download({url:"/report/ureport-data/export-excel",params:u}),k=E({__name:"UReportDataForm",emits:["success"],setup(u,{expose:C,emit:q}){const{t:v}=N(),V=da(),d=m(!1),g=m(""),n=m(!1),h=m(""),l=m({id:void 0,name:void 0,status:void 0,content:void 0,remark:void 0}),R=j({name:[{required:!0,message:"\u6587\u4EF6\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],status:[{required:!0,message:"\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"change"}]}),f=m();C({open:async(o,a)=>{if(d.value=!0,g.value=v("action."+o),h.value=o,A(),a){n.value=!0;try{l.value=await(async i=>await c.get({url:"/report/ureport-data/get?id="+i}))(a)}finally{n.value=!1}}}});const D=q,F=async()=>{await f.value.validate(),n.value=!0;try{const o=l.value;h.value==="create"?(await(async a=>await c.post({url:"/report/ureport-data/create",data:a}))(o),V.success(v("common.createSuccess"))):(await(async a=>await c.put({url:"/report/ureport-data/update",data:a}))(o),V.success(v("common.updateSuccess"))),d.value=!1,D("success")}finally{n.value=!1}},A=()=>{var o;l.value={id:void 0,name:void 0,status:void 0,content:void 0,remark:void 0},(o=f.value)==null||o.resetFields()};return(o,a)=>{const i=H,p=I,K=J,M=L,O=la,T=X,w=Y,z=ea,B=$;return _(),y(z,{title:e(g),modelValue:e(d),"onUpdate:modelValue":a[5]||(a[5]=t=>G(d)?d.value=t:null)},{footer:r(()=>[s(w,{onClick:F,type:"primary",disabled:e(n)},{default:r(()=>[b("\u786E \u5B9A")]),_:1},8,["disabled"]),s(w,{onClick:a[4]||(a[4]=t=>d.value=!1)},{default:r(()=>[b("\u53D6 \u6D88")]),_:1})]),default:r(()=>[P((_(),y(T,{ref_key:"formRef",ref:f,model:e(l),rules:e(R),"label-width":"100px"},{default:r(()=>[s(p,{label:"\u6587\u4EF6\u540D\u79F0",prop:"name"},{default:r(()=>[s(i,{modelValue:e(l).name,"onUpdate:modelValue":a[0]||(a[0]=t=>e(l).name=t),placeholder:"\u8BF7\u8F93\u5165\u6587\u4EF6\u540D\u79F0"},null,8,["modelValue"])]),_:1}),s(p,{label:"\u72B6\u6001",prop:"status"},{default:r(()=>[s(M,{modelValue:e(l).status,"onUpdate:modelValue":a[1]||(a[1]=t=>e(l).status=t),placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001"},{default:r(()=>[(_(!0),Q(W,null,Z(e(sa)(e(oa).COMMON_STATUS),t=>(_(),y(K,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),s(p,{label:"\u6587\u4EF6\u5185\u5BB9",prop:"content"},{default:r(()=>[s(O,{modelValue:e(l).content,"onUpdate:modelValue":a[2]||(a[2]=t=>e(l).content=t),height:"150px"},null,8,["modelValue"])]),_:1}),s(p,{label:"\u5907\u6CE8",prop:"remark"},{default:r(()=>[s(i,{modelValue:e(l).remark,"onUpdate:modelValue":a[3]||(a[3]=t=>e(l).remark=t),placeholder:"\u8BF7\u8F93\u5165\u5907\u6CE8"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[B,e(n)]])]),_:1},8,["title","modelValue"])}}})});export{k as _,ca as __tla,U as d,x as e,S as g};
