import{aG as S,bo as z,aA as b,bB as a,u as B,b3 as p,aF as e,P as N,S as A,a4 as O,aC as T,bd as F,_ as M,ai as U,s as D,bm as f,aE as d,bE as I,ab as G,ad as L,bj as j,az as c,ba as P,bb as Y,Y as g,O as $,aa as q,I as H}from"./index-DrvLDslf.js";/* empty css             *//* empty css                *//* empty css                     *//* empty css                  */import"./el-tooltip-l0sNRNKZ.js";/* empty css                    *//* empty css                        *//* empty css               *//* empty css                   *//* empty css                     *//* empty css                  *//* empty css                  *//* empty css                 */const J={style:{display:"flex","align-items":"center",gap:"8px"}},pe=S({__name:"AnnotationView",setup(K){const s=z(),l=P({title:"",target:"",level:"info",content:""}),m=Y([{id:"N001",ts:"2026-05-19 10:25",author:"ops",target:"C05",level:"warn",title:"AGV-005 故障观察",content:"出库点附近频繁停顿，怀疑激光被遮挡"}]);function w(r){return r==="error"?"danger":r==="warn"?"warning":"info"}function v(){if(!l.title){g.warning("请填写标题");return}const r=`N${String(m.value.length+1).padStart(3,"0")}`;m.value.unshift({id:r,ts:new Date().toLocaleString("zh-CN"),author:s.user?.username??"mock",target:l.target,level:l.level,title:l.title,content:l.content}),g.success("已记录（Mock，未写入数据库）"),l.title="",l.content="",l.target=""}return(r,t)=>{const u=L,_=A,i=N,V=M,y=O,E=D,x=$,h=H,n=G,k=q,C=B;return p(),b(C,{shadow:"never"},{header:a(()=>[c("div",J,[t[7]||(t[7]=c("span",null,"运营备注（monitor.note.write · 写 platform.db.Annotations）",-1)),f(s).hasOp("monitor.note.write")?(p(),b(u,{key:0,size:"small",type:"success"},{default:a(()=>[...t[5]||(t[5]=[d("可写",-1)])]),_:1})):(p(),b(u,{key:1,size:"small",type:"danger"},{default:a(()=>[...t[6]||(t[6]=[d("只读",-1)])]),_:1}))])]),default:a(()=>[e(x,{inline:"",onSubmit:t[3]||(t[3]=I(()=>{},["prevent"]))},{default:a(()=>[e(i,{label:"标题"},{default:a(()=>[e(_,{modelValue:l.title,"onUpdate:modelValue":t[0]||(t[0]=o=>l.title=o),style:{width:"240px"}},null,8,["modelValue"])]),_:1}),e(i,{label:"关联目标"},{default:a(()=>[e(_,{modelValue:l.target,"onUpdate:modelValue":t[1]||(t[1]=o=>l.target=o),placeholder:"例如 C01 / M02 / S006",style:{width:"200px"}},null,8,["modelValue"])]),_:1}),e(i,{label:"层级"},{default:a(()=>[e(y,{modelValue:l.level,"onUpdate:modelValue":t[2]||(t[2]=o=>l.level=o),style:{width:"120px"}},{default:a(()=>[(p(),T(U,null,F(["info","warn","error"],o=>e(V,{key:o,label:o,value:o},null,8,["label","value"])),64))]),_:1},8,["modelValue"])]),_:1}),e(i,null,{default:a(()=>[e(E,{type:"primary",disabled:!f(s).hasOp("monitor.note.write"),onClick:v},{default:a(()=>[...t[8]||(t[8]=[d("提交",-1)])]),_:1},8,["disabled"])]),_:1})]),_:1}),e(_,{modelValue:l.content,"onUpdate:modelValue":t[4]||(t[4]=o=>l.content=o),type:"textarea",rows:4,placeholder:"描述备注内容...",disabled:!f(s).hasOp("monitor.note.write")},null,8,["modelValue","disabled"]),e(h),e(k,{data:m.value,size:"small","max-height":"400"},{default:a(()=>[e(n,{prop:"ts",label:"时间",width:"180"}),e(n,{prop:"author",label:"作者",width:"100"}),e(n,{prop:"target",label:"目标",width:"100"}),e(n,{prop:"level",label:"层级",width:"80"},{default:a(o=>[e(u,{size:"small",type:w(o.row.level)},{default:a(()=>[d(j(o.row.level),1)]),_:2},1032,["type"])]),_:1}),e(n,{prop:"title",label:"标题"}),e(n,{prop:"content",label:"内容"})]),_:1},8,["data"])]),_:1})}}});export{pe as default};
