2 lines
8.1 KiB
JavaScript
2 lines
8.1 KiB
JavaScript
import{B as J,C as O,R as z,S as G,w as Q,D as W,H as X,I as Y,J as Z,K as ee}from"./element-plus.c4a2af8a.js";import{_ as te}from"./index.vue_vue_type_script_setup_true_lang.2a46e71f.js";import{_ as le}from"./index.vue_vue_type_script_setup_true_lang.23d19169.js";import{u as ae}from"./usePaging.160b82b8.js";import{t as ue,k as A,f as oe}from"./index.7b0058f7.js";import{u as ie}from"./useDictOptions.6d454027.js";import{_ as ne,a as se,b as de}from"./edit.vue_vue_type_script_setup_true_name_deviceEdit_lang.eaf7fc54.js";import{d as L,s as re,r as R,$ as pe,a4 as me,af as _e,o,c as y,U as t,L as l,M as v,u,K as s,R as C,V,a7 as D,a as S,T as ce,k as ve,S as _,n as fe}from"./@vue.e8706010.js";import"./@vueuse.1e5a6e21.js";import"./@element-plus.196c7323.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"./vue-router.12d45bc3.js";import"./pinia.dfca86b4.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.2cdc8407.js";import"./index.3c28be6f.js";const Be=_("\u67E5\u8BE2"),be=_("\u91CD\u7F6E"),Ee={class:"mt-4"},ye=_(" \u7F16\u8F91 "),Fe=_(" \u67E5\u770B\u571F\u58E4 "),ke=_(" \u67E5\u770B\u7A7A\u6C14 "),he=_(" \u67E5\u770B\u89C6\u9891 "),Ce=_(" \u67E5\u770B\u62A5\u8B66 "),Ve=_(" \u5220\u9664 "),De={class:"flex mt-4 justify-end"},we=L({name:"deviceLists"}),vt=L({...we,setup(ge){const w=re(),g=R(!1),i=pe({code:"",name:"",type:"",status:"",is_online:"",is_bind:""}),I=R([]),P=f=>{I.value=f.map(({id:a})=>a)},{dictData:r}=ie("device_type,device_status,device_online_status,device_bind_status"),{pager:b,getLists:F,resetParams:T,resetPage:q}=ae({fetchFun:se,params:i}),U=async f=>{var a,E;g.value=!0,await fe(),(a=w.value)==null||a.open("edit"),(E=w.value)==null||E.setFormData(f)},N=async f=>{await oe.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await de({id:f}),F()};return F(),(f,a)=>{const E=J,c=O,p=z,k=G,m=Q,M=W,$=X,n=Y,h=le,x=me("router-link"),K=Z,j=te,B=_e("perms"),H=ee;return o(),y("div",null,[t($,{class:"!border-none mb-4",shadow:"never"},{default:l(()=>[t(M,{class:"mb-[-16px]",model:i,inline:""},{default:l(()=>[t(c,{label:"\u8BBE\u5907\u7F16\u7801",prop:"code"},{default:l(()=>[t(E,{class:"w-[280px]",modelValue:i.code,"onUpdate:modelValue":a[0]||(a[0]=e=>i.code=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BBE\u5907\u7F16\u7801"},null,8,["modelValue"])]),_:1}),t(c,{label:"\u8BBE\u5907\u540D\u79F0",prop:"name"},{default:l(()=>[t(E,{class:"w-[280px]",modelValue:i.name,"onUpdate:modelValue":a[1]||(a[1]=e=>i.name=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BBE\u5907\u540D\u79F0"},null,8,["modelValue"])]),_:1}),t(c,{label:"\u8BBE\u5907\u7C7B\u578B",prop:"type"},{default:l(()=>[t(k,{class:"w-[280px]",modelValue:i.type,"onUpdate:modelValue":a[2]||(a[2]=e=>i.type=e),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u8BBE\u5907\u7C7B\u578B"},{default:l(()=>[t(p,{label:"\u5168\u90E8",value:""}),(o(!0),y(V,null,D(u(r).device_type,(e,d)=>(o(),s(p,{key:d,label:e.name,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(c,{label:"\u8BBE\u5907\u72B6\u6001",prop:"status"},{default:l(()=>[t(k,{class:"w-[280px]",modelValue:i.status,"onUpdate:modelValue":a[3]||(a[3]=e=>i.status=e),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u8BBE\u5907\u72B6\u6001"},{default:l(()=>[t(p,{label:"\u5168\u90E8",value:""}),(o(!0),y(V,null,D(u(r).device_status,(e,d)=>(o(),s(p,{key:d,label:e.name,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(c,{label:"\u662F\u5426\u5728\u7EBF",prop:"is_online"},{default:l(()=>[t(k,{class:"w-[280px]",modelValue:i.is_online,"onUpdate:modelValue":a[4]||(a[4]=e=>i.is_online=e),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u662F\u5426\u5728\u7EBF"},{default:l(()=>[t(p,{label:"\u5168\u90E8",value:""}),(o(!0),y(V,null,D(u(r).device_online_status,(e,d)=>(o(),s(p,{key:d,label:e.name,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(c,{label:"\u662F\u5426\u7ED1\u5B9A\u571F\u5730",prop:"is_bind"},{default:l(()=>[t(k,{class:"w-[280px]",modelValue:i.is_bind,"onUpdate:modelValue":a[5]||(a[5]=e=>i.is_bind=e),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u662F\u5426\u7ED1\u5B9A\u571F\u5730"},{default:l(()=>[t(p,{label:"\u5168\u90E8",value:""}),(o(!0),y(V,null,D(u(r).device_bind_status,(e,d)=>(o(),s(p,{key:d,label:e.name,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(c,null,{default:l(()=>[t(m,{type:"primary",onClick:u(q)},{default:l(()=>[Be]),_:1},8,["onClick"]),t(m,{onClick:u(T)},{default:l(()=>[be]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),v((o(),s($,{class:"!border-none",shadow:"never"},{default:l(()=>[S("div",Ee,[t(K,{data:u(b).lists,onSelectionChange:P},{default:l(()=>[t(n,{type:"selection",width:"55"}),t(n,{label:"ID",prop:"id","show-overflow-tooltip":""}),t(n,{label:"\u8BBE\u5907\u7F16\u7801",prop:"code","show-overflow-tooltip":""}),t(n,{label:"\u8BBE\u5907\u540D\u79F0",prop:"name","show-overflow-tooltip":""}),t(n,{label:"\u571F\u5730ID",prop:"land_id","show-overflow-tooltip":""}),t(n,{label:"\u571F\u5730\u540D\u79F0",prop:"title","show-overflow-tooltip":""}),t(n,{label:"\u8BBE\u5907\u7C7B\u578B",prop:"type"},{default:l(({row:e})=>[t(h,{options:u(r).device_type,value:e.type},null,8,["options","value"])]),_:1}),t(n,{label:"\u8BBE\u5907\u72B6\u6001",prop:"status"},{default:l(({row:e})=>[t(h,{options:u(r).device_status,value:e.status},null,8,["options","value"])]),_:1}),t(n,{label:"\u662F\u5426\u5728\u7EBF",prop:"is_online"},{default:l(({row:e})=>[t(h,{options:u(r).device_online_status,value:e.is_online},null,8,["options","value"])]),_:1}),t(n,{label:"\u662F\u5426\u7ED1\u5B9A\u571F\u5730",prop:"is_bind"},{default:l(({row:e})=>[t(h,{options:u(r).device_bind_status,value:e.is_bind},null,8,["options","value"])]),_:1}),t(n,{label:"\u521B\u5EFA\u65F6\u95F4",width:"160",prop:"create_time"},{default:l(({row:e})=>[S("span",null,ce(e.create_time?u(ue)(e.create_time,"yyyy-mm-dd hh:MM:ss"):""),1)]),_:1}),t(n,{label:"\u64CD\u4F5C",width:"300",align:"center",fixed:"right"},{default:l(({row:e})=>[v((o(),s(m,{type:"primary",link:"",onClick:d=>U(e)},{default:l(()=>[ye]),_:2},1032,["onClick"])),[[B,["device.device/edit"]]]),e.type==1?v((o(),s(m,{key:0,type:"primary",link:""},{default:l(()=>[t(x,{to:{path:u(A)("device.soil_monitor/lists"),query:{device_id:e.id}}},{default:l(()=>[Fe]),_:2},1032,["to"])]),_:2},1024)),[[B,["device.soil_monitor/lists"]]]):C("",!0),e.type==2?v((o(),s(m,{key:1,type:"primary",link:""},{default:l(()=>[t(x,{to:{path:u(A)("device.air_monitor/lists"),query:{device_id:e.id}}},{default:l(()=>[ke]),_:2},1032,["to"])]),_:2},1024)),[[B,["device.air_monitor/lists"]]]):C("",!0),e.type==3?v((o(),s(m,{key:2,type:"primary",link:"",onClick:d=>U(e)},{default:l(()=>[he]),_:2},1032,["onClick"])),[[B,["device.device/edit"]]]):C("",!0),v((o(),s(m,{type:"primary",link:""},{default:l(()=>[t(x,{to:{path:u(A)("device.monitor_alarm/lists"),query:{device_id:e.id}}},{default:l(()=>[Ce]),_:2},1032,["to"])]),_:2},1024)),[[B,["device.monitor_alarm/lists"]]]),v((o(),s(m,{type:"danger",link:"",onClick:d=>N(e.id)},{default:l(()=>[Ve]),_:2},1032,["onClick"])),[[B,["device.device/delete"]]])]),_:1})]),_:1},8,["data"])]),S("div",De,[t(j,{modelValue:u(b),"onUpdate:modelValue":a[6]||(a[6]=e=>ve(b)?b.value=e:null),onChange:u(F)},null,8,["modelValue","onChange"])])]),_:1})),[[H,u(b).loading]]),g.value?(o(),s(ne,{key:0,ref_key:"editRef",ref:w,"dict-data":u(r),onSuccess:u(F),onClose:a[7]||(a[7]=e=>g.value=!1)},null,8,["dict-data","onSuccess"])):C("",!0)])}}});export{vt as default};
|