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