马宇豪
2024-01-05 6a33c71f381aec0dbc778f80527b62d343fd0146
1
import{_ as I,a as U,E as g,t as N,o as P,w as R,d as $}from"./index.1683511265143.js";import{e as h}from"./index.168351126514326.js";import{J as M,aF as H,f as j,a1 as J,k as O,a as D,b as o,Y as a,R as s,u as f,a5 as d,o as E,F as W,a8 as X,Q as Y,X as _,aC as G,aD as K,W as m}from"./vue.1683511265143.js";const B=v=>(G("data-v-2e068057"),v=v(),K(),v),Z={class:"home-container"},ee={style:{height:"100%"}},ae={class:"basic-line"},te=B(()=>o("span",null,"\u8BBE\u5907\u7F16\u7801\uFF1A",-1)),ue={class:"basic-line"},oe=B(()=>o("span",null,"\u8BBE\u5907\u540D\u79F0\uFF1A",-1)),le={class:"basic-line"},se=B(()=>o("span",null,"\u989D\u5B9A\u529F\u7387\uFF1A",-1)),ne={class:"basic-line"},ie=B(()=>o("span",null,"\u662F\u5426\u7279\u79CD\u8BBE\u5907\uFF1A",-1)),de={style:{"padding-bottom":"10px"}},ce=m("\u67E5\u8BE2"),pe=m("\u91CD\u7F6E"),re={class:"homeCard"},_e={class:"main-card"},me=m("\u65B0\u589E"),ve=m("\u7F16\u8F91"),fe=m("\u5220\u9664"),Be={class:"pageBtn"},ye=M({name:"index",setup(v){const C=H(()=>U(()=>import("./equipmentDialog.1683511265143.js"),["assets/equipmentDialog.1683511265143.js","assets/index.168351126514326.js","assets/index.1683511265143.js","assets/index.168351126514326.css","assets/vue.1683511265143.js"])),F=j(),t=J({equipmentData:[],equipmentTypeList:[],searchQuery:{pageIndex:1,pageSize:10,deviceCode:"",deviceName:"",devicePower:"",specialDevice:null},total:0,specialDeviceList:[{id:1,name:"\u662F"},{id:2,name:"\u5426"}],deviceUnitList:[{id:1,name:"\u53F0"},{id:2,name:"\u4E2A"},{id:3,name:"\u4EF6"}]}),x=async()=>{const l=await h().getAllType();l.data.code===100&&(t.equipmentTypeList=l.data.data)},c=async()=>{let l=await h().getEquipmentByList(t.searchQuery);l.data.code===100?(t.equipmentData=l.data.data,t.total=l.data.total):g({type:"warning",message:l.data.msg})},b=(l,u)=>{F.value.showEquipmentDialog(l,u,t.specialDeviceList)},A=l=>{$.confirm(`\u6B64\u64CD\u4F5C\u5C06\u6C38\u4E45\u5220\u9664\u8BE5\u8BBE\u5907\uFF1A\u201C${l.deviceName}\u201D\uFF0C\u662F\u5426\u7EE7\u7EED?`,"\u63D0\u793A",{confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(async()=>{let u=await h().deleteEquipmentById({id:l.id});u.data.code===100?(g({type:"success",duration:2e3,message:"\u5220\u9664\u6210\u529F"}),await c()):g({type:"warning",message:u.data.msg})}).catch(u=>{})},q=l=>{t.searchQuery.pageSize=l,c()},T=l=>{t.searchQuery.pageIndex=l,c()},Q=()=>{t.searchQuery={pageIndex:1,pageSize:10,deviceCode:"",deviceName:"",devicePower:"",specialDevice:null}};return O(()=>{c(),x()}),(l,u)=>{const y=d("el-input"),V=d("el-option"),k=d("el-select"),p=d("el-button"),w=d("el-row"),z=d("el-col"),n=d("el-table-column"),L=d("el-table"),S=d("el-pagination");return E(),D("div",Z,[o("div",ee,[a(w,{class:"homeCard"},{default:s(()=>[o("div",ae,[te,a(y,{modelValue:t.searchQuery.deviceCode,"onUpdate:modelValue":u[0]||(u[0]=e=>t.searchQuery.deviceCode=e),clearable:"",filterable:"",class:"input-box",placeholder:"\u8BBE\u5907\u7F16\u7801"},null,8,["modelValue"])]),o("div",ue,[oe,a(y,{modelValue:t.searchQuery.deviceName,"onUpdate:modelValue":u[1]||(u[1]=e=>t.searchQuery.deviceName=e),clearable:"",filterable:"",class:"input-box",placeholder:"\u8BBE\u5907\u540D\u79F0"},null,8,["modelValue"])]),o("div",le,[se,a(y,{modelValue:t.searchQuery.devicePower,"onUpdate:modelValue":u[2]||(u[2]=e=>t.searchQuery.devicePower=e),clearable:"",filterable:"",class:"input-box",placeholder:"\u989D\u5B9A\u529F\u7387"},null,8,["modelValue"])]),o("div",ne,[ie,a(k,{modelValue:t.searchQuery.specialDevice,"onUpdate:modelValue":u[3]||(u[3]=e=>t.searchQuery.specialDevice=e),clearable:"",filterable:"",class:"input-box",placeholder:"\u662F\u5426\u7279\u79CD\u8BBE\u5907"},{default:s(()=>[(E(!0),D(W,null,X(t.specialDeviceList,e=>(E(),Y(V,{key:e.id,label:e.name,value:e.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),o("div",de,[a(p,{type:"primary",onClick:c},{default:s(()=>[ce]),_:1}),a(p,{plain:"",onClick:Q},{default:s(()=>[pe]),_:1})])]),_:1}),o("div",re,[o("div",_e,[a(w,{class:"cardTop"},{default:s(()=>[a(z,{span:12,class:"mainCardBtn"},{default:s(()=>[a(p,{type:"primary",icon:f(N),size:"default",onClick:u[4]||(u[4]=e=>b("\u65B0\u589E",{}))},{default:s(()=>[me]),_:1},8,["icon"])]),_:1})]),_:1}),a(L,{ref:"multipleTableRef",data:t.equipmentData,style:{width:"100%"},height:"calc(100% - 100px)","header-cell-style":{background:"#fafafa"}},{default:s(()=>[a(n,{prop:"deviceCode",label:"\u8BBE\u5907\u7F16\u53F7"}),a(n,{prop:"deviceName",label:"\u8BBE\u5907\u540D\u79F0"}),a(n,{prop:"deviceTypeId",label:"\u8BBE\u5907\u7C7B\u578B","show-overflow-tooltip":""},{default:s(e=>{var i;return[o("span",null,_((i=t.equipmentTypeList.find(r=>r.id===e.row.deviceTypeId))==null?void 0:i.deviceType),1)]}),_:1}),a(n,{prop:"deviceDesc",label:"\u8BBE\u5907\u578B\u53F7"}),a(n,{prop:"devicePower",label:"\u989D\u5B9A\u529F\u7387"},{default:s(e=>[o("span",null,_(e.row.devicePower),1)]),_:1}),a(n,{prop:"deviceStatus",label:"\u8BBE\u5907\u72B6\u6001"},{default:s(e=>[o("span",null,_(e.row.deviceStatus==1?"\u5B8C\u597D":"\u5F02\u5E38"),1)]),_:1}),a(n,{prop:"deviceUnit",label:"\u8BA1\u91CF\u5355\u4F4D","show-overflow-tooltip":""},{default:s(e=>{var i;return[o("span",null,_(`${(i=t.deviceUnitList.find(r=>r.id===e.row.deviceUnit))==null?void 0:i.name}`),1)]}),_:1}),a(n,{prop:"specialDevice",label:"\u662F\u5426\u7279\u6B8A\u88C5\u5907","show-overflow-tooltip":""},{default:s(e=>{var i;return[o("span",null,_(`${(i=t.specialDeviceList.find(r=>r.id===e.row.specialDevice))==null?void 0:i.name}`),1)]}),_:1}),a(n,{prop:"safeProtect",label:"\u5B89\u5168\u9632\u62A4"}),a(n,{prop:"createTime",label:"\u521B\u5EFA\u65F6\u95F4","show-overflow-tooltip":""}),a(n,{prop:"createByUserName",label:"\u521B\u5EFA\u4EBA","show-overflow-tooltip":""}),a(n,{prop:"updateTime",label:"\u6700\u540E\u4FEE\u6539\u65F6\u95F4","show-overflow-tooltip":""}),a(n,{prop:"updateByUserName",label:"\u6700\u540E\u4FEE\u6539\u4EBA","show-overflow-tooltip":""}),a(n,{label:"\u64CD\u4F5C",width:"150"},{default:s(e=>[a(p,{size:"small",text:"",type:"primary",icon:f(P),onClick:i=>b("\u4FEE\u6539",e.row)},{default:s(()=>[ve]),_:2},1032,["icon","onClick"]),a(p,{size:"small",text:"",type:"danger",icon:f(R),onClick:i=>A(e.row)},{default:s(()=>[fe]),_:2},1032,["icon","onClick"])]),_:1})]),_:1},8,["data"]),o("div",Be,[a(S,{onSizeChange:q,onCurrentChange:T,"pager-count":5,"page-sizes":[10,20,30],"current-page":t.searchQuery.pageIndex,"onUpdate:current-page":u[5]||(u[5]=e=>t.searchQuery.pageIndex=e),background:"","page-size":t.searchQuery.pageSize,"onUpdate:page-size":u[6]||(u[6]=e=>t.searchQuery.pageSize=e),layout:"total, sizes, prev, pager, next, jumper",total:t.total,class:"page-position"},null,8,["current-page","page-size","total"])])])])]),a(f(C),{ref_key:"equipmentDialogRef",ref:F,onRefresh:c,equipmentTypeList:t.equipmentTypeList},null,8,["equipmentTypeList"])])}}});var Fe=I(ye,[["__scopeId","data-v-2e068057"]]);export{Fe as default};