import{a1 as e,g as t,e as a,$ as r,J as o,q as s,c as l,w as d,i,o as u,t as m,v as p,A as n}from"./index-DL8B2Mxu.js";import{_ as b}from"./u-input.B4n5960Q.js";import{r as f}from"./uni-app.es.BSVEa1f2.js";import{_ as h,a as c}from"./u-form.UL3ywNK9.js";import{_ as g}from"./index.DO4NYH_9.js";import{_ as F}from"./u-button.D-oh2uo-.js";import{b as y,u as j,c as _}from"./reportLog.Ba0GZTt5.js";import{_ as q}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./u-icon.CLOPtL2B.js";import"./emitter.DrjJCwnj.js";import"./u-search.C1fh-wIV.js";import"./u-avatar.oTnux-Fl.js";import"./ly-tree.vn0DIbc6.js";import"./u-badge.B5SA0J9t.js";import"./resources.DipqUmnN.js";import"./ly-checkbox.DwGV7MZ3.js";import"./u-popup.0TcTDuv5.js";const V=q({data:()=>({dataForm:{title:"",todayContent:"",tomorrowContent:"",question:"",userIds:""},rules:{title:[{required:!0,message:"日志标题不能为空",trigger:["change","blur"]}],todayContent:[{required:!0,message:"今日内容不能为空",trigger:["change","blur"]}],tomorrowContent:[{required:!0,message:"明日内容不能为空",trigger:["change","blur"]}],question:[{required:!0,message:"问题不能为空",trigger:["change","blur"]}],userIds:[{required:!0,message:"用户不能为空",trigger:["change","blur"],type:"array"}]},type:"0",disabled:!1}),onReady(){this.$refs.dataForm.setRules(this.rules)},onLoad(a){if(this.type=a.type,a.id)"1"==this.type&&(this.disabled=!0),y(a.id).then((t=>{this.dataForm=t.data,this.dataForm.userIds=this.dataForm.userIds.split(","),e({title:this.dataForm.title})}));else{e({title:"新增日志"});let a=t("userInfo")||{};if(!a.userName)return;this.dataForm.title=a.userName+"的日志"}},methods:{save(){this.$refs.dataForm.validate((e=>{if(this.dataForm.toUserId=this.dataForm.userIds.join(","),e){(this.dataForm.id?j:_)(this.dataForm).then((e=>{a({title:e.msg,complete:()=>{setTimeout((()=>{r("refresh"),o()}),1500)}})}))}}))}}},[["render",function(e,t,a,r,o,y){const j=f(s("u-input"),b),_=f(s("u-form-item"),h),q=f(s("JnpfUserSelect"),g),V=i,C=f(s("u-form"),c),I=f(s("u-button"),F);return u(),l(V,{class:"logForm-v jnpf-wrap"},{default:d((()=>[m(C,{model:o.dataForm,rules:o.rules,ref:"dataForm",errorType:["toast"],"label-position":"left","label-width":"150","label-align":"left"},{default:d((()=>[m(V,{class:"u-p-l-20 u-p-r-20 form-item-box"},{default:d((()=>[m(_,{label:"日志标题",prop:"title",required:""},{default:d((()=>[m(j,{modelValue:o.dataForm.title,"onUpdate:modelValue":t[0]||(t[0]=e=>o.dataForm.title=e),placeholder:"请输入日志标题",disabled:o.disabled},null,8,["modelValue","disabled"])])),_:1}),m(_,{label:"今日内容",prop:"todayContent",required:""},{default:d((()=>[m(j,{modelValue:o.dataForm.todayContent,"onUpdate:modelValue":t[1]||(t[1]=e=>o.dataForm.todayContent=e),type:"textarea",placeholder:"请输入今日内容",disabled:o.disabled},null,8,["modelValue","disabled"])])),_:1}),m(_,{label:"明日内容",prop:"tomorrowContent",required:""},{default:d((()=>[m(j,{modelValue:o.dataForm.tomorrowContent,"onUpdate:modelValue":t[2]||(t[2]=e=>o.dataForm.tomorrowContent=e),type:"textarea",placeholder:"请输入明日内容",disabled:o.disabled},null,8,["modelValue","disabled"])])),_:1}),m(_,{label:"遇到问题",prop:"question",required:""},{default:d((()=>[m(j,{modelValue:o.dataForm.question,"onUpdate:modelValue":t[3]||(t[3]=e=>o.dataForm.question=e),type:"textarea",placeholder:"请输入遇到问题",disabled:o.disabled},null,8,["modelValue","disabled"])])),_:1}),m(_,{label:"发送给谁",prop:"userIds",required:""},{default:d((()=>[m(q,{modelValue:o.dataForm.userIds,"onUpdate:modelValue":t[4]||(t[4]=e=>o.dataForm.userIds=e),multiple:"",disabled:o.disabled},null,8,["modelValue","disabled"])])),_:1})])),_:1})])),_:1},8,["model","rules"]),o.disabled?n("",!0):(u(),l(V,{key:0,class:"com-saveBox"},{default:d((()=>[m(I,{type:"primary",onClick:y.save},{default:d((()=>[p("保存")])),_:1},8,["onClick"])])),_:1}))])),_:1})}],["__scopeId","data-v-302b3ff5"]]);export{V as default};
