index.f15972fc.js 7.1 KB

1
  1. import{b as e,a6 as l,f as a,g as t,h as n,j as u,w as o,a7 as s,a4 as d,o as i,F as m,v,y as r,a as p,$ as c,X as b,a0 as h,a8 as g,m as w,a2 as f,a3 as x,c as V,_}from"./vendor.fceb02b1.js";/* empty css */import{s as y,c as C}from"./index.e2e9e653.js";const H={class:"bg-white py-[10px] px-[10px] relative"},Y={class:"pl-[20px] h-[250px] mb-[20px] shadow rounded-[6px] shadow-blue-500"},U=n("br",null,null,-1),$=r("添加"),k=r("查询"),D={class:"relative shadow rounded-[6px] shadow-blue-500 px-[10px] pt-[20px] pb-[10px]"},L=r("删除"),M={__name:"index",setup(r){const M=e(window.innerHeight-260+"px"),j=e(window.innerHeight-260+"px"),R=e(window.innerHeight-260+"px"),z=[{value:"1",label:"计划检修"},{value:"2",label:"受累"},{value:"3",label:"故障"},{value:"4",label:"限电"}],q=l({value1:"",lbval:"",luval:"",value2:"",value3:"",shuoming:""}),T=l({value1:"",lbval:"",value4:"",value5:""}),Z=e(),F=e([]),I=e([]),E=e([]),X=async()=>{const e=C.baseURL1;let l={station:q.value1,equipment:q.lbval.join(),startTime:q.value2,endTime:q.value3,event:q.luval,eventDescription:q.shuoming};const a=await y.post(`${e}/mark/info`,l);console.log("添加",a)},A=async()=>{const e=C.baseURL1,l=await y.get(`${e}/mark/info?station=${T.value1}&projects=${T.lbval}&startDate=${T.value4}&endDate=${T.value5}`);console.log("查询",l),Z.value=l.data},B=e=>{var l=new Date,a=l.getFullYear(),t=l.getMonth()+1,n=l.getDate();return t>=1&&t<=9&&(t="0"+t),n>=0&&n<=9&&(n="0"+n),1==e?a+"-"+t+"-01 00:00:00":2==e?a+"-"+t+"-"+n+" 00:00:00":void 0};return a((()=>{R.value=window.innerHeight-260+"px",j.value=window.innerHeight-260+"px",M.value=window.innerHeight-260+"px",window.addEventListener("resize",(()=>{R.value=window.innerHeight-260+"px",j.value=window.innerHeight-260+"px",M.value=window.innerHeight-260+"px"})),(async()=>{const e=C.baseURL1,l=await y.get(`${e}/powergen/stationList`);F.value=l.data})(),q.value2=B(1),q.value3=B(2),T.value4=B(1),T.value5=B(2)})),(e,l)=>{const a=_,r=c,M=b,j=h,R=g,B=w,G=s,J=f,K=x,N=d;return i(),t("div",H,[n("div",Y,[u(G,{inline:!0,model:q,class:"demo-form-inline"},{default:o((()=>[u(M,{label:"场站",class:"!mb-0 mt-2"},{default:o((()=>[u(r,{modelValue:q.value1,"onUpdate:modelValue":l[0]||(l[0]=e=>q.value1=e),class:"w-[150px]",onChange:l[1]||(l[1]=e=>(async()=>{const e=C.baseURL1,l=await y.get(`${e}/mark/equipmentList?stationId=${q.value1}`);console.log("拿风机上",l),I.value=l.data})(q.value1)),clearable:"",placeholder:"请选择","popper-class":"select"},{default:o((()=>[(i(!0),t(m,null,v(F.value,(e=>(i(),V(a,{key:e.id,value:e.id,label:e.name},null,8,["value","label"])))),128))])),_:1},8,["modelValue"])])),_:1}),u(M,{label:"风机",class:"!mb-0 mt-2"},{default:o((()=>[u(r,{modelValue:q.lbval,"onUpdate:modelValue":l[2]||(l[2]=e=>q.lbval=e),class:"w-[180px]",onChange:l[3]||(l[3]=l=>e.ChangZhanChange1(q.lbval)),multiple:"",placeholder:"请选择","popper-class":"select"},{default:o((()=>[(i(!0),t(m,null,v(I.value,(e=>(i(),V(a,{key:e.id,value:e.id,label:e.name},null,8,["value","label"])))),128))])),_:1},8,["modelValue"])])),_:1}),u(M,{label:"事件",class:"!mb-0 mt-2"},{default:o((()=>[u(r,{modelValue:q.luval,"onUpdate:modelValue":l[4]||(l[4]=e=>q.luval=e),class:"w-[180px]",onChange:l[5]||(l[5]=l=>e.ChangZhanChange2(q.luval)),clearable:"",placeholder:"请选择","popper-class":"select"},{default:o((()=>[(i(),t(m,null,v(z,(e=>u(a,{key:e.value,label:e.label,value:e.label},null,8,["label","value"]))),64))])),_:1},8,["modelValue"])])),_:1}),u(M,{label:"开始",class:"!mb-0 mt-2"},{default:o((()=>[u(j,{modelValue:q.value2,"onUpdate:modelValue":l[6]||(l[6]=e=>q.value2=e),onChange:l[7]||(l[7]=e=>{return l=q.value2,void(q.value2=l);var l}),type:"datetime","value-format":"YYYY-MM-DD HH:mm:ss",placeholder:"选择日期"},null,8,["modelValue"])])),_:1}),u(M,{label:"结束",class:"!mb-0 mt-2"},{default:o((()=>[u(j,{modelValue:q.value3,"onUpdate:modelValue":l[8]||(l[8]=e=>q.value3=e),onChange:l[9]||(l[9]=e=>{return l=q.value3,void(q.value3=l);var l}),type:"datetime","value-format":"YYYY-MM-DD HH:mm:ss",placeholder:"选择日期"},null,8,["modelValue"])])),_:1}),U,u(M,{label:"事件说明",class:"!mb-0 mt-5"},{default:o((()=>[u(R,{modelValue:q.shuoming,"onUpdate:modelValue":l[10]||(l[10]=e=>q.shuoming=e),type:"textarea",rows:4,placeholder:"请输入事件说明",style:{width:"300px"}},null,8,["modelValue"])])),_:1}),u(M,{class:"!mb-0 ml-2"},{default:o((()=>[u(B,{type:"primary",onClick:X},{default:o((()=>[$])),_:1})])),_:1})])),_:1},8,["model"]),u(G,{inline:!0,model:T,class:"demo-form-inline"},{default:o((()=>[u(M,{label:"场站",class:"!mb-0 mt-5"},{default:o((()=>[u(r,{modelValue:T.value1,"onUpdate:modelValue":l[11]||(l[11]=e=>T.value1=e),class:"w-[150px]",onChange:l[12]||(l[12]=e=>(async()=>{const e=C.baseURL1,l=await y.get(`${e}/mark/equipmentList?stationId=${T.value1}`);console.log("拿风机下",l),E.value=l.data})(T.value1)),clearable:"",placeholder:"请选择","popper-class":"select"},{default:o((()=>[(i(!0),t(m,null,v(F.value,(e=>(i(),V(a,{key:e.id,value:e.id,label:e.name},null,8,["value","label"])))),128))])),_:1},8,["modelValue"])])),_:1}),u(M,{label:"风机",class:"!mb-0 mt-5"},{default:o((()=>[u(r,{modelValue:T.lbval,"onUpdate:modelValue":l[13]||(l[13]=e=>T.lbval=e),class:"w-[180px]",onChange:l[14]||(l[14]=l=>e.ChangZhanChange1(T.lbval)),multiple:"",placeholder:"请选择","popper-class":"select"},{default:o((()=>[(i(!0),t(m,null,v(E.value,(e=>(i(),V(a,{key:e.id,value:e.id,label:e.name},null,8,["value","label"])))),128))])),_:1},8,["modelValue"])])),_:1}),u(M,{label:"开始",class:"!mb-0 mt-5"},{default:o((()=>[u(j,{modelValue:T.value4,"onUpdate:modelValue":l[15]||(l[15]=e=>T.value4=e),onChange:l[16]||(l[16]=e=>{return l=T.value4,void(T.value4=l);var l}),type:"datetime","value-format":"YYYY-MM-DD HH:mm:ss",placeholder:"选择日期"},null,8,["modelValue"])])),_:1}),u(M,{label:"结束",class:"!mb-0 mt-5"},{default:o((()=>[u(j,{modelValue:T.value5,"onUpdate:modelValue":l[17]||(l[17]=e=>T.value5=e),onChange:l[18]||(l[18]=e=>{return l=T.value5,void(T.value5=l);var l}),type:"datetime","value-format":"YYYY-MM-DD HH:mm:ss",placeholder:"选择日期"},null,8,["modelValue"])])),_:1}),u(M,{class:"!mb-0 mt-5"},{default:o((()=>[u(B,{type:"primary",onClick:A},{default:o((()=>[k])),_:1})])),_:1})])),_:1},8,["model"])]),n("div",D,[n("div",null,[u(N,{"max-height":"500px"},{default:o((()=>[u(K,{data:Z.value,height:"500",style:{width:"100%"},border:!0},{default:o((()=>[u(J,{prop:"station",label:"场站",align:"center",width:"200",resizable:""}),u(J,{prop:"equipment",label:"风机",align:"center",width:"150",resizable:""}),u(J,{prop:"event",label:"事件",align:"center",width:"150",resizable:""}),u(J,{prop:"startTime",label:"开始时间",align:"center",width:"150"}),u(J,{prop:"endTime",label:"结束时间",align:"center",width:"150"}),u(J,{prop:"eventDescription",label:"事件说明",align:"center",width:"150"}),u(J,{label:"操作",align:"center",width:"150"},{default:o((e=>[u(B,{size:"small",type:"danger",onClick:l=>(async(e,l)=>{console.log("删除",l.id);const a=C.baseURL1,t=await y.delete(`${a}/mark/${l.id}`);p.success(t.msg),A()})(e.$index,e.row)},{default:o((()=>[L])),_:2},1032,["onClick"])])),_:1})])),_:1},8,["data"])])),_:1})])])])}}};export default M;