import{B as ue,C as ae,Q as le,R as oe,w as ne,D as ie,I as se,L as re,_ as de,M as pe,J as me,b as ce,N as _e}from"./element-plus.7a22678c.js";import{_ as Ce}from"./index.vue_vue_type_script_setup_true_lang.cabb2d32.js";import{_ as Ee}from"./index.vue_vue_type_script_setup_true_lang.4e44db35.js";import{_ as Fe}from"./index.vue_vue_type_script_setup_true_lang.f8debc0c.js";import{u as fe}from"./vue-router.ed788fee.js";import{u as De}from"./usePaging.2a59f422.js";import{a as ve}from"./useDictOptions.82ca10d3.js";import{_ as ye,a as Be,b as be}from"./edit.vue_vue_type_script_setup_true_name_landPlantActionEdit_lang.cdcb4ec6.js";import{t as ge,f as ke}from"./index.5f377089.js";import{d as J,s as he,r as D,_ as A,ae as Ve,o as r,c as v,a as y,T as t,K as a,L as T,u as n,J as F,Q as we,U as I,a6 as R,R as m,S as B,j as xe,n as Ae}from"./@vue.108c970a.js";import"./@vueuse.d3d080b7.js";import"./@element-plus.d6eabd08.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"./index.3e52675c.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";const Te=m("\u67E5\u8BE2"),Ie=m("\u91CD\u7F6E"),Le={class:"mt-4"},Pe=m(" \u7F16\u8F91 "),Se=m(" \u64CD\u4F5C\u8BE6\u60C5 "),Ue=m(" \u64CD\u4F5C\u56FE\u7247 "),$e=m(" \u5220\u9664 "),Ne={class:"flex mt-4 justify-end"},Re=J({name:"landPlantActionLists"}),wt=J({...Re,setup(Je){const{query:M}=fe(),b=he(),g=D(!1);let k=M.plant_id;typeof k>"u"&&(k="");const l=A({user_id:"",plant_id:k,type:"",start_time:"",end_time:""}),L=A({1:{kind:"\u80A5\u6599\u79CD\u7C7B",breed:"\u80A5\u6599\u54C1\u724C",dosage:"\u80A5\u6599\u7528\u91CF",start_date:"\u5F00\u59CB\u65E5\u671F",end_date:"\u7ED3\u675F\u65E5\u671F",area:"\u65BD\u80A5\u9762\u79EF",user:"\u53C2\u4E0E\u4EBA",pic:"\u65BD\u80A5\u56FE\u7247",remark:"\u5907\u6CE8\u4FE1\u606F"},2:{kind:"\u9664\u8349\u5242\u79CD\u7C7B",breed:"\u9664\u8349\u5242\u54C1\u724C",dosage:"\u9664\u8349\u5242\u7528\u91CF",start_date:"\u5F00\u59CB\u65E5\u671F",end_date:"\u7ED3\u675F\u65E5\u671F",area:"\u4F5C\u4E1A\u9762\u79EF",user:"\u53C2\u4E0E\u4EBA",pic:"\u9664\u8349\u56FE\u7247",remark:"\u5907\u6CE8\u4FE1\u606F"},3:{type:"\u704C\u6E89\u7C7B\u578B",start_date:"\u5F00\u59CB\u65E5\u671F",end_date:"\u7ED3\u675F\u65E5\u671F",area:"\u704C\u6E89\u9762\u79EF",user:"\u53C2\u4E0E\u4EBA",pic:"\u704C\u6E89\u56FE\u7247",remark:"\u5907\u6CE8\u4FE1\u606F"},4:{kind:"\u6740\u866B\u5242\u79CD\u7C7B",breed:"\u6740\u866B\u5242\u54C1\u724C",dosage:"\u6740\u866B\u5242\u7528\u91CF",start_date:"\u5F00\u59CB\u65E5\u671F",end_date:"\u7ED3\u675F\u65E5\u671F",area:"\u4F5C\u4E1A\u9762\u79EF",user:"\u53C2\u4E0E\u4EBA",pic:"\u6740\u866B\u56FE\u7247",remark:"\u5907\u6CE8\u4FE1\u606F"},5:{user:"\u53C2\u4E0E\u4EBA",pic:"\u6536\u83B7\u56FE\u7247",remark:"\u5907\u6CE8\u4FE1\u606F"}}),O=D([]),j=o=>{O.value=o.map(({id:u})=>u)},{dictData:h}=ve("land_plant_action"),{pager:_,getLists:f,resetParams:q,resetPage:z}=De({fetchFun:Be,params:l}),V=D(!1),w=D(!1),d=A({gridData:[{}],picData:[]}),Q=o=>{var i,p;const u=JSON.parse(o.detail);d.gridData=[{}];for(const C in L[o.type]){const x=(i=L[o.type][C])!=null?i:"-";d.gridData.push({item:x,value:(p=u[C])!=null?p:"-"})}d.gridData.splice(0,1),w.value=!0},K=o=>{d.picData=[];const u=JSON.parse(o.detail);for(const i in u.pic)d.picData.unshift(u.pic[i]);V.value=!0},G=async o=>{var u,i;g.value=!0,await Ae(),(u=b.value)==null||u.open("edit"),(i=b.value)==null||i.setFormData(o)},H=async o=>{await ke.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await be({id:o}),f()};return f(),(o,u)=>{const i=ue,p=ae,C=le,x=oe,W=Fe,c=ne,X=ie,P=se,s=re,S=de,Y=Ee,U=pe,Z=Ce,$=me,ee=ce,N=Ve("perms"),te=_e;return r(),v(I,null,[y("div",null,[t(P,{class:"!border-none mb-4",shadow:"never"},{default:a(()=>[t(X,{class:"mb-[-16px]",model:l,inline:""},{default:a(()=>[t(p,{label:"\u7528\u6237ID",prop:"user_id"},{default:a(()=>[t(i,{class:"w-[280px]",modelValue:l.user_id,"onUpdate:modelValue":u[0]||(u[0]=e=>l.user_id=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7528\u6237ID"},null,8,["modelValue"])]),_:1}),t(p,{label:"\u79CD\u690DID",prop:"plant_id"},{default:a(()=>[t(i,{class:"w-[280px]",modelValue:l.plant_id,"onUpdate:modelValue":u[1]||(u[1]=e=>l.plant_id=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u79CD\u690DID"},null,8,["modelValue"])]),_:1}),t(p,{label:"\u64CD\u4F5C\u7C7B\u578B",prop:"type"},{default:a(()=>[t(x,{class:"w-[280px]",modelValue:l.type,"onUpdate:modelValue":u[2]||(u[2]=e=>l.type=e),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u64CD\u4F5C\u7C7B\u578B"},{default:a(()=>[t(C,{label:"\u5168\u90E8",value:""}),(r(!0),v(I,null,R(n(h).land_plant_action,(e,E)=>(r(),F(C,{key:E,label:e.name,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(p,{label:"\u79CD\u690D\u64CD\u4F5C\u65F6\u95F4",prop:"create_time"},{default:a(()=>[t(W,{startTime:l.start_time,"onUpdate:startTime":u[3]||(u[3]=e=>l.start_time=e),endTime:l.end_time,"onUpdate:endTime":u[4]||(u[4]=e=>l.end_time=e)},null,8,["startTime","endTime"])]),_:1}),t(p,null,{default:a(()=>[t(c,{type:"primary",onClick:n(z)},{default:a(()=>[Te]),_:1},8,["onClick"]),t(c,{onClick:n(q)},{default:a(()=>[Ie]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),T((r(),F(P,{class:"!border-none",shadow:"never"},{default:a(()=>[y("div",Le,[t(U,{data:n(_).lists,onSelectionChange:j,style:{width:"100%"}},{default:a(()=>[t(s,{type:"selection",width:"55"}),t(s,{label:"ID",prop:"id",width:"80","show-overflow-tooltip":""}),t(s,{label:"\u6240\u5C5E\u571F\u5730\u79CD\u690D",width:"200"},{default:a(({row:e})=>[t(S,{class:"mr-2",type:"info"},{default:a(()=>[m("ID: "+B(e.plant_id),1)]),_:2},1024),t(S,{class:"mr-2",type:"info"},{default:a(()=>[m("\u7C7B\u578B: "+B(e.kind)+" \u54C1\u724C: "+B(e.breed),1)]),_:2},1024)]),_:1}),t(s,{label:"\u79CD\u690D\u64CD\u4F5C\u7C7B\u578B",align:"center",prop:"type"},{default:a(({row:e})=>[t(Y,{options:n(h).land_plant_action,value:e.type},null,8,["options","value"])]),_:1}),t(s,{label:"\u79CD\u690D\u64CD\u4F5C",prop:"type_text","show-overflow-tooltip":""}),t(s,{label:"\u79CD\u690D\u64CD\u4F5C\u65F6\u95F4",width:"180",align:"center",prop:"plant_date"},{default:a(({row:e})=>[y("span",null,B(e.create_time?n(ge)(e.create_time,"yyyy-mm-dd hh:MM:ss"):""),1)]),_:1}),t(s,{label:"\u64CD\u4F5C",width:"260",align:"center",fixed:"right"},{default:a(({row:e})=>[T((r(),F(c,{type:"primary",link:"",onClick:E=>G(e)},{default:a(()=>[Pe]),_:2},1032,["onClick"])),[[N,["land.land_plant_action/edit"]]]),t(c,{type:"primary",link:"",onClick:E=>Q(e)},{default:a(()=>[Se]),_:2},1032,["onClick"]),t(c,{type:"primary",link:"",onClick:E=>K(e)},{default:a(()=>[Ue]),_:2},1032,["onClick"]),T((r(),F(c,{type:"danger",link:"",onClick:E=>H(e.id)},{default:a(()=>[$e]),_:2},1032,["onClick"])),[[N,["land.land_plant_action/delete"]]])]),_:1})]),_:1},8,["data"])]),y("div",Ne,[t(Z,{modelValue:n(_),"onUpdate:modelValue":u[5]||(u[5]=e=>xe(_)?_.value=e:null),onChange:n(f)},null,8,["modelValue","onChange"])])]),_:1})),[[te,n(_).loading]]),g.value?(r(),F(ye,{key:0,ref_key:"editRef",ref:b,"dict-data":n(h),onSuccess:n(f),onClose:u[6]||(u[6]=e=>g.value=!1)},null,8,["dict-data","onSuccess"])):we("",!0)]),t($,{modelValue:w.value,"onUpdate:modelValue":u[7]||(u[7]=e=>w.value=e),title:"\u79CD\u690D\u64CD\u4F5C\u8BE6\u60C5"},{default:a(()=>[t(U,{data:d.gridData},{default:a(()=>[t(s,{property:"item",label:"\u64CD\u4F5C\u9879",width:"150"}),t(s,{property:"value",label:"\u64CD\u4F5C\u5185\u5BB9"})]),_:1},8,["data"])]),_:1},8,["modelValue"]),t($,{modelValue:V.value,"onUpdate:modelValue":u[8]||(u[8]=e=>V.value=e),title:"\u79CD\u690D\u64CD\u4F5C\u56FE\u7247",center:""},{default:a(()=>[(r(!0),v(I,null,R(d.picData,e=>(r(),v("div",{style:{display:"inline-block",margin:"12px"},key:e},[t(ee,{style:{width:"200px",height:"200px"},src:e,"zoom-rate":1.2,"max-scale":5,"min-scale":.2,"preview-src-list":d.picData,"initial-index":4,fit:"cover",center:""},null,8,["src","zoom-rate","min-scale","preview-src-list"])]))),128))]),_:1},8,["modelValue"])],64)}}});export{wt as default};