2 lines
9.5 KiB
JavaScript
2 lines
9.5 KiB
JavaScript
import{B as X,C as Y,Q as Z,R as ee,w as le,D as te,I as ue,L as ae,_ as oe,M as ne,N as ie}from"./element-plus.a3f01f50.js";import{_ as de}from"./index.vue_vue_type_script_setup_true_lang.b069f63a.js";import{_ as se}from"./index.vue_vue_type_script_setup_true_lang.4e44db35.js";import{t as re,k as S,f as pe,b as _e}from"./index.8312bf00.js";import{u as me}from"./vue-router.ed788fee.js";import{u as ce}from"./usePaging.2a59f422.js";import{a as fe}from"./useDictOptions.6c5e56d7.js";import{f as ve,h as be}from"./device.d21aaa27.js";import{_ as Be}from"./edit.vue_vue_type_script_setup_true_name_deviceEdit_lang.f11bbc4b.js";import{d as N,s as Ee,r as P,_ as Fe,a3 as ye,ae as he,o as n,c as F,T as l,K as t,L as b,u as o,J as d,Q as Ce,U as g,a6 as x,a as A,R as s,S as y,j as Ve,n as T}from"./@vue.108c970a.js";import"./@vueuse.d3d080b7.js";import"./@element-plus.f258b2c3.js";import"./lodash-es.29c53eac.js";import"./dayjs.ff93117e.js";import"./axios.eb055ccc.js";import"./async-validator.fb49d0f5.js";import"./@ctrl.82a509e0.js";import"./@popperjs.36402333.js";import"./escape-html.e5dfadb9.js";import"./normalize-wheel-es.8aeb3683.js";import"./lodash.ec5da75f.js";import"./pinia.eff1ffd5.js";import"./vue-demi.ebc8116b.js";import"./css-color-function.31dc130b.js";import"./color.b6d632a4.js";import"./clone.7a47b02c.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.3a33898e.js";import"./ms.a9ae1d6d.js";import"./nprogress.fa64f2fc.js";import"./vue-clipboard3.be0dfeee.js";import"./clipboard.824ba320.js";import"./echarts.8d7a50ae.js";import"./zrender.1084fa23.js";import"./tslib.60310f1a.js";import"./highlight.js.4ebdf9a4.js";import"./@highlightjs.241b9b5d.js";import"./index.9fde0396.js";const we=s("\u67E5\u8BE2"),De=s("\u91CD\u7F6E"),ke=s(" \u65B0\u589E "),ge=s(" \u5220\u9664 "),xe={class:"mt-4"},Ie=s(" \u7F16\u8F91 "),Ue=s(" \u67E5\u770B\u8BE6\u60C5 "),Ae=s(" \u67E5\u770B\u62A5\u8B66 "),Re=s(" \u5220\u9664 "),$e={class:"flex mt-4 justify-end"},Le=N({name:"deviceLists"}),Vl=N({...Le,setup(Se){const{query:q}=me(),h=Ee(),C=P(!1);let I=q.product_id;typeof I>"u"&&(I="");const a=Fe({user_id:"",land_id:"",product_id:I,code:"",name:"",type:"",status:"",is_online:"",is_bind:""}),U=P([]),M=_=>{U.value=_.map(({id:u})=>u)},{dictData:p}=fe("device_type,device_status,device_online_status,device_bind_status,monitor_item"),{pager:E,getLists:V,resetParams:j,resetPage:Q}=ce({fetchFun:ve,params:a}),J=async()=>{var _;C.value=!0,await T(),(_=h.value)==null||_.open("add")},K=async _=>{var u,c;C.value=!0,await T(),(u=h.value)==null||u.open("edit"),(c=h.value)==null||c.setFormData(_)},R=async _=>{await pe.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await be({id:_}),V()};return V(),(_,u)=>{const c=X,r=Y,f=Z,w=ee,v=le,O=te,$=ue,z=_e,i=ae,D=se,k=oe,L=ye("router-link"),G=ne,H=de,B=he("perms"),W=ie;return n(),F("div",null,[l($,{class:"!border-none mb-4",shadow:"never"},{default:t(()=>[l(O,{class:"mb-[-16px]",model:a,inline:""},{default:t(()=>[l(r,{label:"\u7528\u6237ID",prop:"user_id"},{default:t(()=>[l(c,{class:"w-[280px]",modelValue:a.user_id,"onUpdate:modelValue":u[0]||(u[0]=e=>a.user_id=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7528\u6237ID"},null,8,["modelValue"])]),_:1}),l(r,{label:"\u571F\u5730ID",prop:"land_id"},{default:t(()=>[l(c,{class:"w-[280px]",modelValue:a.land_id,"onUpdate:modelValue":u[1]||(u[1]=e=>a.land_id=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u571F\u5730ID"},null,8,["modelValue"])]),_:1}),l(r,{label:"\u4EA7\u54C1ID",prop:"product_id"},{default:t(()=>[l(c,{class:"w-[280px]",modelValue:a.product_id,"onUpdate:modelValue":u[2]||(u[2]=e=>a.product_id=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4EA7\u54C1ID"},null,8,["modelValue"])]),_:1}),l(r,{label:"\u8BBE\u5907\u7F16\u7801",prop:"code"},{default:t(()=>[l(c,{class:"w-[280px]",modelValue:a.code,"onUpdate:modelValue":u[3]||(u[3]=e=>a.code=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BBE\u5907\u7F16\u7801"},null,8,["modelValue"])]),_:1}),l(r,{label:"\u8BBE\u5907\u540D\u79F0",prop:"name"},{default:t(()=>[l(c,{class:"w-[280px]",modelValue:a.name,"onUpdate:modelValue":u[4]||(u[4]=e=>a.name=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BBE\u5907\u540D\u79F0"},null,8,["modelValue"])]),_:1}),l(r,{label:"\u8BBE\u5907\u7C7B\u578B",prop:"type"},{default:t(()=>[l(w,{class:"w-[280px]",modelValue:a.type,"onUpdate:modelValue":u[5]||(u[5]=e=>a.type=e),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u8BBE\u5907\u7C7B\u578B"},{default:t(()=>[l(f,{label:"\u5168\u90E8",value:""}),(n(!0),F(g,null,x(o(p).device_type,(e,m)=>(n(),d(f,{key:m,label:e.name,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(r,{label:"\u8BBE\u5907\u72B6\u6001",prop:"status"},{default:t(()=>[l(w,{class:"w-[280px]",modelValue:a.status,"onUpdate:modelValue":u[6]||(u[6]=e=>a.status=e),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u8BBE\u5907\u72B6\u6001"},{default:t(()=>[l(f,{label:"\u5168\u90E8",value:""}),(n(!0),F(g,null,x(o(p).device_status,(e,m)=>(n(),d(f,{key:m,label:e.name,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(r,{label:"\u662F\u5426\u5728\u7EBF",prop:"is_online"},{default:t(()=>[l(w,{class:"w-[280px]",modelValue:a.is_online,"onUpdate:modelValue":u[7]||(u[7]=e=>a.is_online=e),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u662F\u5426\u5728\u7EBF"},{default:t(()=>[l(f,{label:"\u5168\u90E8",value:""}),(n(!0),F(g,null,x(o(p).device_online_status,(e,m)=>(n(),d(f,{key:m,label:e.name,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(r,{label:"\u662F\u5426\u7ED1\u5B9A\u571F\u5730",prop:"is_bind"},{default:t(()=>[l(w,{class:"w-[280px]",modelValue:a.is_bind,"onUpdate:modelValue":u[8]||(u[8]=e=>a.is_bind=e),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u662F\u5426\u7ED1\u5B9A\u571F\u5730"},{default:t(()=>[l(f,{label:"\u5168\u90E8",value:""}),(n(!0),F(g,null,x(o(p).device_bind_status,(e,m)=>(n(),d(f,{key:m,label:e.name,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),l(r,null,{default:t(()=>[l(v,{type:"primary",onClick:o(Q)},{default:t(()=>[we]),_:1},8,["onClick"]),l(v,{onClick:o(j)},{default:t(()=>[De]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),b((n(),d($,{class:"!border-none",shadow:"never"},{default:t(()=>[b((n(),d(v,{type:"primary",onClick:J},{icon:t(()=>[l(z,{name:"el-icon-Plus"})]),default:t(()=>[ke]),_:1})),[[B,["device.device/add"]]]),b((n(),d(v,{disabled:!U.value.length,onClick:u[9]||(u[9]=e=>R(U.value))},{default:t(()=>[ge]),_:1},8,["disabled"])),[[B,["device.device/delete"]]]),A("div",xe,[l(G,{data:o(E).lists,onSelectionChange:M,style:{width:"100%"}},{default:t(()=>[l(i,{type:"selection",width:"55"}),l(i,{label:"ID",prop:"id",width:"80","show-overflow-tooltip":""}),l(i,{label:"\u8BBE\u5907\u540D\u79F0",width:"200",prop:"name","show-overflow-tooltip":""}),l(i,{label:"\u8BBE\u5907\u7C7B\u578B",width:"150",prop:"type"},{default:t(({row:e})=>[l(D,{options:o(p).device_type,value:e.type},null,8,["options","value"])]),_:1}),l(i,{label:"\u6240\u5C5E\u571F\u5730",width:"200"},{default:t(({row:e})=>[l(k,{class:"mr-2",type:"info"},{default:t(()=>[s("ID: "+y(e.land_id),1)]),_:2},1024),l(k,{class:"mr-2",type:"info"},{default:t(()=>[s("\u540D\u79F0: "+y(e.land_title),1)]),_:2},1024)]),_:1}),l(i,{label:"\u6240\u5C5E\u4EA7\u54C1",width:"200"},{default:t(({row:e})=>[l(k,{class:"mr-2",type:"info"},{default:t(()=>[s("ID: "+y(e.product_id),1)]),_:2},1024),l(k,{class:"mr-2",type:"info"},{default:t(()=>[s("\u540D\u79F0: "+y(e.product_name),1)]),_:2},1024)]),_:1}),l(i,{label:"\u8BBE\u5907\u7F16\u7801",width:"120",prop:"code","show-overflow-tooltip":""}),l(i,{label:"\u8BBE\u5907\u72B6\u6001",width:"100",align:"center",prop:"status"},{default:t(({row:e})=>[l(D,{options:o(p).device_status,value:e.status},null,8,["options","value"])]),_:1}),l(i,{label:"\u662F\u5426\u5728\u7EBF",width:"100",align:"center",prop:"is_online"},{default:t(({row:e})=>[l(D,{options:o(p).device_online_status,value:e.is_online},null,8,["options","value"])]),_:1}),l(i,{label:"\u662F\u5426\u7ED1\u5B9A\u571F\u5730",width:"150",align:"center",prop:"is_bind"},{default:t(({row:e})=>[l(D,{options:o(p).device_bind_status,value:e.is_bind},null,8,["options","value"])]),_:1}),l(i,{label:"\u521B\u5EFA\u65F6\u95F4",width:"160",align:"center",prop:"create_time"},{default:t(({row:e})=>[A("span",null,y(e.create_time?o(re)(e.create_time,"yyyy-mm-dd hh:MM:ss"):""),1)]),_:1}),l(i,{label:"\u64CD\u4F5C",width:"260",align:"center",fixed:"right"},{default:t(({row:e})=>[b((n(),d(v,{type:"primary",link:"",onClick:m=>K(e)},{default:t(()=>[Ie]),_:2},1032,["onClick"])),[[B,["device.device/edit"]]]),b((n(),d(v,{type:"primary",link:""},{default:t(()=>[l(L,{to:{path:o(S)("device.device/detail"),query:{device_id:e.id}}},{default:t(()=>[Ue]),_:2},1032,["to"])]),_:2},1024)),[[B,["device.device/detail"]]]),b((n(),d(v,{type:"primary",link:""},{default:t(()=>[l(L,{to:{path:o(S)("device.monitor_alarm/lists"),query:{device_id:e.id}}},{default:t(()=>[Ae]),_:2},1032,["to"])]),_:2},1024)),[[B,["device.monitor_alarm/lists"]]]),b((n(),d(v,{type:"danger",link:"",onClick:m=>R(e.id)},{default:t(()=>[Re]),_:2},1032,["onClick"])),[[B,["device.device/delete"]]])]),_:1})]),_:1},8,["data"])]),A("div",$e,[l(H,{modelValue:o(E),"onUpdate:modelValue":u[10]||(u[10]=e=>Ve(E)?E.value=e:null),onChange:o(V)},null,8,["modelValue","onChange"])])]),_:1})),[[W,o(E).loading]]),C.value?(n(),d(Be,{key:0,ref_key:"editRef",ref:h,"dict-data":o(p),onSuccess:o(V),onClose:u[11]||(u[11]=e=>C.value=!1)},null,8,["dict-data","onSuccess"])):Ce("",!0)])}}});export{Vl as default};
|