| 1 |
- import{d as M,i as p,n as T,r as i,o as $,b as Q,w as l,c as t,C as E,e as o,t as g,v as S,y as W,f as D,F as q,M as O,E as B,D as I,G as A,S as K,p as X,j as Z,_ as ee}from"./index-bed2942a.js";import{C as te}from"./CusNavigation-b2e56c9f.js";import{p as x}from"./index-d139c558.js";import{R as oe}from"./ReloadOutlined-a8f7fbcd.js";const le={style:{overflow:"visible"}},ne=M({__name:"Detail",setup(f,{expose:y}){const w=c=>{console.log(c),a.value=!1},a=p(!1),m=p(),C=c=>{a.value=!0,m.value=c},k=()=>{a.value=!1};return T(()=>{}),y({show:C,hidden:k}),(c,d)=>{const r=i("a-button"),z=i("a-modal");return $(),Q(z,{title:"设备日志",visible:a.value,"onUpdate:visible":d[0]||(d[0]=b=>a.value=b),maskClosable:!1,width:580,bodyStyle:{height:"500px",overflow:"auto",padding:"10px"}},{footer:l(()=>[t(r,{type:"primary",onClick:w},{default:l(()=>[E("知道了")]),_:1})]),default:l(()=>[o("pre",le,g(m.value),1)]),_:1},8,["visible"])}}}),h=f=>(X("data-v-dd49940e"),f=f(),Z(),f),ae={class:"cus-animation",style:{height:"100%",width:"100%",padding:"16px 20px",display:"flex","flex-direction":"column"}},se={style:{display:"flex","justify-content":"space-between","align-items":"flex-end"}},ie={style:{display:"flex"}},ce={style:{display:"flex","align-items":"center"}},de=h(()=>o("span",{style:{"font-size":"16px","margin-right":"5px"}},"当前数据文件大小为",-1)),re={style:{"font-size":"16px","margin-right":"5px"}},pe=h(()=>o("span",{style:{"font-size":"16px"}},",可",-1)),ue=h(()=>o("span",{style:{"font-size":"16px","margin-right":"5px"}},",删除",-1)),_e=h(()=>o("span",{style:{"font-size":"16px","margin-left":"5px"}},"前的数据",-1)),fe={style:{"margin-left":"50px"}},me={style:{"white-space":"nowrap","text-overflow":"ellipsis",overflow:"hidden"}},ve=["onClick"],xe=h(()=>o("a",{style:{"margin-left":"26px"}},"删除",-1)),ge=M({__name:"Index",setup(f){const y=p(null),w=S({x:1300}),a=S({pageSize:20,current:1,size:"default",showQuickJumper:!0,showTotal:function(e){return`共 ${e} 条数据`},onChange:function(e,n){this.current=e,this.pageSize=n,r()}}),m=p([]),C=p(0),k=()=>{x({url:"/system/data-file-size"},e=>{console.log(e),C.value=e.data})},c=p(!1),d=S({size:20,page:1,sort:"time",order:"desc",keyWord:"",mac:""}),r=()=>{c.value=!0,d.size=a.pageSize,d.page=a.current,x({url:"/error-log/search",data:d},e=>{console.log(e),a.total=e.total,m.value=e.data,c.value=!1}),k()},z=function(){a.current=1,r()},b=p(null),N=e=>{var n;console.log(e),(n=b.value)==null||n.show(e)},R=e=>{console.log(e);const n={id:e.id};x({url:"/error-log/delete",data:n},u=>{console.log(u),I.info(u.msg),r()})},Y=()=>{O.confirm({title:"确定清理数据?",icon:t(B),content:"操作耗时较长,且影响系统的正常运行,请在空闲时操作!",onOk(){x({url:"/system/vacuum"},e=>{console.log(e)})},onCancel(){}})},v=p(null),j=()=>{if(console.log(v.value),!v.value){I.error("日期不能为空");return}O.confirm({title:"确定删除数据?",icon:t(B),content:"操作将会批量删除数据,且不可恢复,请谨慎操作!",onOk(){const e=A(v.value).format("YYYY-MM-DD HH:mm:ss");console.log(e),x({url:"/error-log/delete-batch",data:{date:e}},n=>{console.log(n),I.info("删除成功"),r()})},onCancel(){}})};return T(()=>{var e;w.y=((e=y.value)==null?void 0:e.clientHeight)-113,r()}),(e,n)=>{const u=i("a-tooltip"),F=i("a-input"),H=i("a-form-item"),U=i("a-form"),V=i("a-date-picker"),L=i("a-button"),_=i("a-table-column"),G=i("a-popconfirm"),J=i("a-table");return $(),W(q,null,[o("div",ae,[t(D(te),{title:"设备日志"}),o("div",se,[o("div",ie,[t(U,{layout:"inline",model:d},{default:l(()=>[t(H,null,{default:l(()=>[t(F,{allowClear:"",value:d.mac,"onUpdate:value":n[0]||(n[0]=s=>d.mac=s),placeholder:"请输入要查询的内容",style:{width:"280px"}},{suffix:l(()=>[t(u,{title:"点击搜索",onClick:z},{default:l(()=>[t(D(K),{style:{color:"rgba(0, 0, 0, 0.45)"}})]),_:1})]),_:1},8,["value"])]),_:1})]),_:1},8,["model"])]),o("div",ce,[o("div",null,[de,o("span",re,g(C.value),1),pe,o("span",{style:{"font-size":"16px"}},[o("a",{onClick:Y},"清理")]),ue,t(V,{"show-time":"",style:{width:"195px"},value:v.value,"onUpdate:value":n[1]||(n[1]=s=>v.value=s)},null,8,["value"]),_e,t(L,{size:"small",type:"primary",style:{"margin-left":"10px"},onClick:j},{default:l(()=>[E("删除")]),_:1})]),o("div",fe,[t(u,{onClick:r},{default:l(()=>[t(D(oe),{style:{"font-size":"20px"},spin:c.value},null,8,["spin"])]),_:1})])])]),o("div",{ref_key:"table_container",ref:y,style:{"margin-top":"9px","border-top":"1px solid #eee",display:"flex","flex-direction":"column",overflow:"hidden",height:"0px","flex-grow":"1"}},[t(J,{"data-source":m.value,pagination:a,scroll:w,bordered:!0,loading:c.value,size:"middle"},{default:l(()=>[t(_,{title:"序号",width:60,fixed:"left",align:"center"},{default:l(({index:s})=>[o("div",null,g(s+1),1)]),_:1}),t(_,{title:"编号","data-index":"id",width:200,fixed:"left",align:"center"}),t(_,{title:"错误源","data-index":"source",width:160,fixed:"left"}),t(_,{title:"错误记录",width:200,ellipsis:!0},{default:l(({record:s})=>[t(u,{placement:"topLeft",mouseEnterDelay:.8,overlayStyle:{"max-width":"500px"}},{title:l(()=>[o("div",null,g(s.result),1)]),default:l(()=>[o("div",me,g(s.result),1)]),_:2},1024)]),_:1}),t(_,{title:"添加时间","data-index":"createTime",width:200}),t(_,{title:"操作",width:160,fixed:"right"},{default:l(({record:s})=>[o("div",null,[o("a",{style:{"margin-left":"0px"},onClick:P=>N(s)},"查看",8,ve),t(G,{title:"确定删除?",okText:"确定",cancelText:"取消",onConfirm:P=>R(s)},{default:l(()=>[xe]),_:2},1032,["onConfirm"])])]),_:1})]),_:1},8,["data-source","pagination","scroll","loading"])],512)]),t(ne,{ref_key:"detailRef",ref:b},null,512)],64)}}});const be=ee(ge,[["__scopeId","data-v-dd49940e"]]);export{be as default};
|