Files
my-spring/web-api/src/main/resources/worker/assets/TodoInfo-DIAzbpF6.js

2 lines
5.1 KiB
JavaScript
Raw Normal View History

import{b as X,ak as Z,m as V,j as c,br as J,B as Q,a$ as Y,c as h,o as f,a as t,k as l,F as K,x as ee,v as R,t as _,Z as te,a9 as oe,e as ae,q as d,w as n,D,f as le,fR as se,G as L,ev as M,X as ie}from"./index-BRLZOSuF-1775297478351.js";import{d as ne,e as re,f as de}from"./myNoticeTodo-CyJx6oWb.js";const ce={class:"notice-card"},ue={class:"card-title"},_e={class:"card-tabs"},ve=["onClick"],pe={class:"card-content"},fe={key:0,class:"todo-dialog"},me={class:"todo-dialog__header"},ge={class:"todo-dialog__title"},he={class:"todo-dialog__time"},be={class:"todo-dialog__time-left"},ye={class:"todo-dialog__time-right"},we={class:"todo-dialog__content-panel"},xe=["innerHTML"],ke={class:"todo-dialog__form-panel"},De={class:"todo-dialog__footer"},Ce={key:0,class:"todo-dialog__button-group"},Re=X({__name:"TodoInfo",setup(Te){const U=Z(),B=V(()=>U.getUserInfo),S=[{key:"0",label:"待办"},{key:"1",label:"已办"}],v=c("0"),p=c([]),m=c(),C=c(0),b=c(!1),g=c(!1),y=c(!1),a=c(null),r=J({extraDesc:""}),w=V(()=>v.value==="1");let x=null;function T(o){return{1:"通知",2:"消息",3:"待办"}[String(o??"")]||"-"}async function F(o){g.value=!0,a.value=o,r.extraDesc=o.extraDesc||"";try{const e=await ne({id:o.id}),i=e?.myNoticeTodo||e||o;a.value=i,r.extraDesc=i.extraDesc||""}catch{a.value=o}}async function H(){if(a.value?.id){if(!r.extraDesc.trim()){M.warning("请输入处理意见");return}y.value=!0;try{const o={...a.value,readFlag:"1",clickClose:"1",extraDesc:r.extraDesc.trim()},e={isNewRecord:a.value.isNewRecord,id:a.value.id},i=await re(e,o);M.success(i?.message),a.value={...a.value,extraDesc:r.extraDesc.trim()},p.value=p.value.map(u=>u.id===a.value?.id?{...u,extraDesc:r.extraDesc.trim()}:u),k(),g.value=!1}catch{}finally{y.value=!1}}}function z(){r.extraDesc=a.value?.extraDesc||""}function N(){ie(()=>{const o=m.value;o&&(C.value=Math.max(o.clientHeight,0))})}function O(o){v.value!==o&&(v.value=o,k())}async function k(){b.value=!0;try{const o={type:"3",ustatus:"1",clickClose:v.value,loginUser:B.value.loginCode},e=await de(o);p.value=e||[]}catch{p.value=[]}finally{b.value=!1}}return Q(()=>{k(),N(),m.value&&(x=new ResizeObserver(()=>{N()}),x.observe(m.value))}),Y(()=>{x?.disconnect()}),(o,e)=>{const i=d("el-table-column"),u=d("el-button"),E=d("el-tooltip"),W=d("el-table"),$=d("el-divider"),q=d("el-input"),I=d("el-form-item"),j=d("el-form"),A=d("el-dialog"),G=oe("loading");return f(),h("div",ce,[t("div",ue,[e[2]||(e[2]=t("span",null,"待办信息",-1)),t("div",_e,[(f(),h(K,null,ee(S,s=>t("button",{key:s.key,class:R(["tab-item",{active:v.value===s.key}]),onClick:P=>O(s.key)},_(s.label),11,ve)),64))])]),t("div",pe,[t("div",{ref_key:"tableWrapRef",ref:m,class:"table-container"},[te((f(),ae(W,{data:p.value,height:C.value,"show-header":!0,border:!1},{default:n(()=>[l(i,{prop:"title",label:"标题","min-width":"80","show-overflow-tooltip":"true"}),l(i,{prop:"type",label:"类型",width:"60"},{default:n(({row:s})=>[D(_(T(s.type)),1)]),_:1}),l(i,{prop:"createTime",label:"记录时间",width:"150","show-overflow-tooltip":"true"}),l(i,{prop:"datetime",label:"截至时间",width:"150","show-overflow-tooltip":"true"}),l(i,{prop:"extraDesc",label:"处理意见",width:"120","show-overflow-tooltip":"true"}),l(i,{label:"操作",width:"90",align:"center",fixed:"right"},{default:n(({row:s})=>[l(E,{content:"编辑",placement:"top","show-after":200},{default:n(()=>[l(u,{class:"notice-action-button",link:"",type:"primary",icon:le(se),onClick:P=>F(s)},null,8,["icon","onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data","height"])),[[G,b.value]])],512)]),l(A,{modelValue:g.value,"onUpdate:modelValue":e[1]||(e[1]=s=>g.value=s),class:R(["todo-info-dialog",{"todo-info-dialog--no-footer":a.value?.clickClose==="1"}]),title:"待办详情",width:"50%","destroy-on-close":""},{footer:n(()=>[t("div",De,[w.value?L("",!0):(f(),h("div",Ce,[l(u,{onClick:z},{default:n(()=>[...e[6]||(e[6]=[D("重置",-1)])]),_:1}),l(u,{type:"primary",loading:y.value,onClick:H},{default:n(()=>[...e[7]||(e[7]=[D("保存",-1)])]),_:1},8,["loading"])]))])]),default:n(()=>[a.value?(f(),h("div",fe,[t("div",me,