import{B as H,C as W,Q as X,R as Y,w as Z,D as ee,I as te,L as ae,_ as oe,M as le,N as ue}from"./element-plus.a3f01f50.js";import{_ as ne}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 ie,k as de,f as re,b as me}from"./index.8312bf00.js";import{_ as pe}from"./index.vue_vue_type_script_setup_true_lang.6c01626d.js";import{u as ce}from"./vue-router.ed788fee.js";import{u as _e}from"./usePaging.2a59f422.js";import{a as fe}from"./useDictOptions.6c5e56d7.js";import{_ as ve,a as Fe,b as be}from"./edit.vue_vue_type_script_setup_true_name_productEdit_lang.54dd2067.js";import{d as U,s as Ce,r as A,_ as Ee,a3 as ye,ae as ge,o as n,c as T,T as e,K as a,L as _,u,J as r,Q as he,U as ke,a6 as we,a as k,R as i,S as w,j as De,n as I}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 Be=i("\u67E5\u8BE2"),Ve=i("\u91CD\u7F6E"),xe=i(" \u65B0\u589E "),Ae=i(" \u5220\u9664 "),Te={class:"mt-4"},Ie=i(" \u7F16\u8F91 "),Ue=i(" \u67E5\u770B\u8BBE\u5907 "),$e=i(" \u5220\u9664 "),Pe={class:"flex mt-4 justify-end"},Re=U({name:"productLists"}),wt=U({...Re,setup(Le){const{query:$}=ce(),F=Ce(),b=A(!1);let E=$.land_id;typeof E>"u"&&(E="");const l=Ee({user_id:"",land_id:E,code:"",name:"",status:"",create_time:"",start_time:"",end_time:""}),y=A([]),P=s=>{y.value=s.map(({id:o})=>o)},{dictData:g}=fe("product_status"),{pager:f,getLists:C,resetParams:R,resetPage:L}=_e({fetchFun:Fe,params:l}),S=async()=>{var s;b.value=!0,await I(),(s=F.value)==null||s.open("add")},N=async s=>{var o,m;b.value=!0,await I(),(o=F.value)==null||o.open("edit"),(m=F.value)==null||m.setFormData(s)},D=async s=>{await re.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await be({id:s}),C()};return C(),(s,o)=>{const m=H,p=W,B=X,q=Y,M=pe,c=Z,j=ee,V=te,Q=me,d=ae,x=oe,J=se,K=ye("router-link"),O=le,z=ne,v=ge("perms"),G=ue;return n(),T("div",null,[e(V,{class:"!border-none mb-4",shadow:"never"},{default:a(()=>[e(j,{class:"mb-[-16px]",model:l,inline:""},{default:a(()=>[e(p,{label:"\u7528\u6237ID",prop:"user_id"},{default:a(()=>[e(m,{class:"w-[280px]",modelValue:l.user_id,"onUpdate:modelValue":o[0]||(o[0]=t=>l.user_id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7528\u6237ID"},null,8,["modelValue"])]),_:1}),e(p,{label:"\u571F\u5730ID",prop:"land_id"},{default:a(()=>[e(m,{class:"w-[280px]",modelValue:l.land_id,"onUpdate:modelValue":o[1]||(o[1]=t=>l.land_id=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u571F\u5730ID"},null,8,["modelValue"])]),_:1}),e(p,{label:"\u4EA7\u54C1\u7F16\u53F7",prop:"code"},{default:a(()=>[e(m,{class:"w-[280px]",modelValue:l.code,"onUpdate:modelValue":o[2]||(o[2]=t=>l.code=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4EA7\u54C1\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),e(p,{label:"\u4EA7\u54C1\u540D\u79F0",prop:"name"},{default:a(()=>[e(m,{class:"w-[280px]",modelValue:l.name,"onUpdate:modelValue":o[3]||(o[3]=t=>l.name=t),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4EA7\u54C1\u540D\u79F0"},null,8,["modelValue"])]),_:1}),e(p,{label:"\u4EA7\u54C1\u72B6\u6001",prop:"status"},{default:a(()=>[e(q,{class:"w-[280px]",modelValue:l.status,"onUpdate:modelValue":o[4]||(o[4]=t=>l.status=t),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u4EA7\u54C1\u72B6\u6001"},{default:a(()=>[e(B,{label:"\u5168\u90E8",value:""}),(n(!0),T(ke,null,we(u(g).product_status,(t,h)=>(n(),r(B,{key:h,label:t.name,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(p,{label:"\u521B\u5EFA\u65F6\u95F4",prop:"create_time"},{default:a(()=>[e(M,{startTime:l.start_time,"onUpdate:startTime":o[5]||(o[5]=t=>l.start_time=t),endTime:l.end_time,"onUpdate:endTime":o[6]||(o[6]=t=>l.end_time=t)},null,8,["startTime","endTime"])]),_:1}),e(p,null,{default:a(()=>[e(c,{type:"primary",onClick:u(L)},{default:a(()=>[Be]),_:1},8,["onClick"]),e(c,{onClick:u(R)},{default:a(()=>[Ve]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),_((n(),r(V,{class:"!border-none",shadow:"never"},{default:a(()=>[_((n(),r(c,{type:"primary",onClick:S},{icon:a(()=>[e(Q,{name:"el-icon-Plus"})]),default:a(()=>[xe]),_:1})),[[v,["land.product/add"]]]),_((n(),r(c,{disabled:!y.value.length,onClick:o[7]||(o[7]=t=>D(y.value))},{default:a(()=>[Ae]),_:1},8,["disabled"])),[[v,["land.product/delete"]]]),k("div",Te,[e(O,{data:u(f).lists,onSelectionChange:P,style:{width:"100%"}},{default:a(()=>[e(d,{type:"selection",width:"55"}),e(d,{label:"ID",prop:"id",width:"80","show-overflow-tooltip":""}),e(d,{label:"\u4EA7\u54C1\u540D\u79F0",prop:"name","show-overflow-tooltip":""}),e(d,{label:"\u4EA7\u54C1\u7F16\u53F7",prop:"code","show-overflow-tooltip":""}),e(d,{label:"\u6240\u5C5E\u571F\u5730",width:"200"},{default:a(({row:t})=>[e(x,{class:"mr-2",type:"info"},{default:a(()=>[i("ID: "+w(t.land_id),1)]),_:2},1024),e(x,{class:"mr-2",type:"info"},{default:a(()=>[i("\u540D\u79F0: "+w(t.title),1)]),_:2},1024)]),_:1}),e(d,{label:"\u4EA7\u54C1\u72B6\u6001",align:"center",prop:"status"},{default:a(({row:t})=>[e(J,{options:u(g).product_status,value:t.status},null,8,["options","value"])]),_:1}),e(d,{label:"\u521B\u5EFA\u65F6\u95F4",width:"180",align:"center",prop:"create_time"},{default:a(({row:t})=>[k("span",null,w(t.create_time?u(ie)(t.create_time,"yyyy-mm-dd hh:MM:ss"):""),1)]),_:1}),e(d,{label:"\u64CD\u4F5C",width:"200",align:"center",fixed:"right"},{default:a(({row:t})=>[_((n(),r(c,{type:"primary",link:"",onClick:h=>N(t)},{default:a(()=>[Ie]),_:2},1032,["onClick"])),[[v,["land.product/edit"]]]),_((n(),r(c,{type:"primary",link:""},{default:a(()=>[e(K,{to:{path:u(de)("device.device/lists"),query:{product_id:t.id}}},{default:a(()=>[Ue]),_:2},1032,["to"])]),_:2},1024)),[[v,["device.device/lists"]]]),_((n(),r(c,{type:"danger",link:"",onClick:h=>D(t.id)},{default:a(()=>[$e]),_:2},1032,["onClick"])),[[v,["land.product/delete"]]])]),_:1})]),_:1},8,["data"])]),k("div",Pe,[e(z,{modelValue:u(f),"onUpdate:modelValue":o[8]||(o[8]=t=>De(f)?f.value=t:null),onChange:u(C)},null,8,["modelValue","onChange"])])]),_:1})),[[G,u(f).loading]]),b.value?(n(),r(ve,{key:0,ref_key:"editRef",ref:F,"dict-data":u(g),onSuccess:u(C),onClose:o[9]||(o[9]=t=>b.value=!1)},null,8,["dict-data","onSuccess"])):he("",!0)])}}});export{wt as default};