2024-02-03 17:46:05 +08:00
|
|
|
import{B as G,C as H,w as O,D as W,J as X,K as Y,L as Z,M as ee,N as te}from"./element-plus.ae8e286c.js";import{_ as oe}from"./index.vue_vue_type_script_setup_true_lang.4acf6c9d.js";import{_ as ae}from"./index.vue_vue_type_script_setup_true_lang.4e44db35.js";import{t as ie,k as R,f as le,b as ne}from"./index.fccb4ef5.js";import{u as se}from"./vue-router.ed788fee.js";import{u as ue}from"./usePaging.2a59f422.js";import{u as de}from"./useDictOptions.7b4b6189.js";import{g as re,h as ce}from"./device.719ac6f2.js";import me from"./edit.10fdb7a8.js";import{d as L,s as _e,r as $,_ as pe,a3 as fe,ae as ve,o as i,c as he,T as o,K as t,L as c,u as l,J as n,Q as p,a as g,R as s,S as f,j as ye,n as A}from"./@vue.108c970a.js";import"./@vueuse.d3d080b7.js";import"./@element-plus.d6eabd08.js";import"./lodash-es.29c53eac.js";import"./dayjs.664390f6.js";import"./axios.4ebfdb3f.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.e92d81a1.js";import"./pinia.eff1ffd5.js";import"./vue-demi.ebc8116b.js";import"./css-color-function.dbf33394.js";import"./color.e1b5fced.js";import"./clone.0a4e8ac3.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.f174a91e.js";import"./ms.a9ae1d6d.js";import"./nprogress.d7c3ab1b.js";import"./vue-clipboard3.add720e2.js";import"./clipboard.01ea18f5.js";import"./echarts.8d7a50ae.js";import"./zrender.1084fa23.js";import"./tslib.60310f1a.js";import"./highlight.js.4ebdf9a4.js";import"./@highlightjs.241b9b5d.js";import"./index.0d3bed35.js";const Ce=s("\u67E5\u8BE2"),ke=s("\u91CD\u7F6E"),Ee=s(" \u65B0\u589E "),Be=s(" \u5220\u9664 "),Fe={class:"mt-4"},be=s(" \u7F16\u8F91 "),ge=s(" \u8BE6\u60C5 "),De=s(" \u62A5\u8B66 "),we=s(" \u5220\u9664 "),Ve={class:"flex justify-end mt-4"},xe=L({name:"deviceLists"}),yt=L({...xe,setup(Pe){const{query:N}=se(),v=_e(),h=$(!1);let B=N.product_id;typeof B>"u"&&(B="");const y=pe({user_id:"",farm_id:"",product_id:B,code:"",name:"",type:"",status:"",is_online:""}),F=$([]),S=d=>{F.value=d.map(({id:a})=>a)},{dictData:b}=de("device_type,device_status,device_online_status,device_bind_status,monitor_item"),{pager:_,getLists:C,resetParams:T,resetPage:I}=ue({fetchFun:re,params:y}),q=async()=>{var d;h.value=!0,await A(),(d=v.value)==null||d.open("add")},M=async d=>{var a,k;h.value=!0,await A(),(a=v.value)==null||a.open("edit"),(k=v.value)==null||k.setFormData(d)},D=async d=>{await le.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await ce({id:d}),C()};return C(),(d,a)=>{const k=G,w=H,r=O,j=W,V=X,J=ne,u=Y,E=Z,x=ae,P=fe("router-link"),K=ee,U=oe,m=ve("perms"),Q=te;return i(),he("div",null,[o(V,{class:"!border-none mb-4",shadow:"never"},{default:t(()=>[o(j,{class:"mb-[-16px]",model:y,inline:""},{default:t(()=>[o(w,{label:"\u8BBE\u5907\u540D\u79F0",prop:"name"},{default:t(()=>[o(k,{class:"w-[280px]",modelValue:y.name,"onUpdate:modelValue":a[0]||(a[0]=e=>y.name=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BBE\u5907\u540D\u79F0"},null,8,["modelValue"])]),_:1}),o(w,null,{default:t(()=>[o(r,{type:"primary",onClick:l(I)},{default:t(()=>[Ce]),_:1},8,["onClick"]),o(r,{onClick:l(T)},{default:t(()=>[ke]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),c((i(),n(V,{class:"!border-none",shadow:"never"},{default:t(()=>[c((i(),n(r,{type:"primary",onClick:q},{icon:t(()=>[o(J,{name:"el-icon-Plus"})]),default:t(()=>[Ee]),_:1})),[[m,["device.device/add"]]]),c((i(),n(r,{disabled:!F.value.length,onClick:a[1]||(a[1]=e=>D(F.value))},{default:t(()=>[Be]),_:1},8,["disabled"])),[[m,["device.device/delete"]]]),g("div",Fe,[o(K,{data:l(_).lists,onSelectionChange:S,style:{width:"100%"}},{default:t(()=>[o(u,{type:"selection",width:"55"}),o(u,{label:"ID",prop:"id",width:"80","show-overflow-tooltip":""}),o(u,{label:"\u8BBE\u5907\u540D\u79F0",width:"200",prop:"name","show-overflow-tooltip":""}),o(u,{label:"\u6240\u5C5E\u517B\u6B96\u57FA\u5730",width:"200"},{default:t(({row:e})=>[
|