import{B as _e,C as me,G as Fe,H as Ce,w as De,D as fe,J as Ee,K as ye,L as ge,b as ve,M as be,I as ke,a2 as he,a3 as Be,N as xe}from"./element-plus.ae8e286c.js";import{_ as Ae}from"./index.vue_vue_type_script_setup_true_lang.4acf6c9d.js";import{_ as Ve}from"./index.vue_vue_type_script_setup_true_lang.4e44db35.js";import{_ as we}from"./index.vue_vue_type_script_setup_true_lang.4123e411.js";import{u as Te}from"./vue-router.ed788fee.js";import{u as Ue}from"./usePaging.2a59f422.js";import{t as Ie,k as Se,f as Le}from"./index.fccb4ef5.js";import{u as Pe}from"./useDictOptions.7b4b6189.js";import{_ as $e,a as qe,b as Re,c as Ne}from"./edit.vue_vue_type_script_setup_true_name_landPlantEdit_lang.d17974d5.js";import{d as X,s as Me,r as P,_ as g,a3 as ze,ae as Je,o as n,c as D,a as f,T as t,K as u,L as V,u as r,J as E,Q as W,U as k,a6 as w,R as c,S as C,j as je,n as Ke}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 Oe=c("\u67E5\u8BE2"),Ge=c("\u91CD\u7F6E"),He={class:"mt-4"},Qe=c(" \u7F16\u8F91 "),We=c(" \u6EAF\u6E90\u4FE1\u606F "),Xe=c(" \u79CD\u690D\u56FE\u7247 "),Ye=c(" \u79CD\u690D\u64CD\u4F5C "),Ze=c(" \u5220\u9664 "),et={class:"flex mt-4 justify-end"},tt={class:"overflow-y-auto",style:{height:"500px"}},at=c("\u54C1\u7C7B\u4FE1\u606F"),ut={class:"mb-2 text-xl text-tx-gray"},lt={class:"mb-2 text-xl text-tx-gray"},ot={class:"mb-2 text-xl text-tx-gray"},nt={class:"mb-2 text-xl text-tx-gray"},st=X({name:"landPlantLists"}),Wt=X({...st,setup(it){const{query:Y}=Te(),$=Me(),q=P(!1);let R=Y.land_id;typeof R>"u"&&(R="");const l=g({user_id:"",land_id:R,kind:"",breed:"",user:"",status:"",plant_date:"",start_time:"",end_time:""}),Z=P([]),ee=_=>{Z.value=_.map(({id:a})=>a)},{dictData:N}=Pe("plant_status"),{pager:h,getLists:T,resetParams:te,resetPage:ae}=Ue({fetchFun:qe,params:l}),M=P(!1),z=P(!1),B=g({picData:[]}),ue=_=>{B.picData=[];const a=JSON.parse(_.pic);for(const i in a)B.picData.unshift(a[i]);M.value=!0},K=g({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"}}),le=g({1:"\u55B7\u704C",2:"\u6EF4\u704C",3:"\u6C9F\u704C"}),x=g({gridData:[{}]}),o=g({categoryData:{kind:"",group_day:"",harvest_date:"",land_address:"",pic:""},landActionType:[""],landActionData:[g({})]}),oe=_=>{B.picData=[],Re({id:_.id}).then(a=>{var i,p,A,U,I,m,S;z.value=!0,console.log(a),o.categoryData.kind=(i=a.kind)!=null?i:"",o.categoryData.group_day=(p=a.group_day)!=null?p:"",o.categoryData.harvest_date=(A=a.harvest_date)!=null?A:"",o.categoryData.land_address=(U=a.land_address)!=null?U:"",o.categoryData.pic=(I=a.pic)!=null?I:[],x.gridData=[{}];for(const y in a.actions){x.gridData=[{}];const s=a.actions[y].type,v=a.actions[y].type_text,b=a.actions[y].detail;for(const F in K[s]){const J=(m=K[s][F])!=null?m:"-";for(const j in b)j==F&&(s==3&&F=="type"&&(b[F]=le[b[F]]),x.gridData.push({item:J,value:(S=b[F])!=null?S:"-"}))}x.gridData.splice(0,1),o.landActionType.push(v),o.landActionData.push(x.gridData)}o.landActionType.splice(0,1),o.landActionData.splice(0,1)}).catch(a=>{console.log("err",a)})},ne=async _=>{var a,i;q.value=!0,await Ke(),(a=$.value)==null||a.open("edit"),(i=$.value)==null||i.setFormData(_)},se=async _=>{await Le.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await Ne({id:_}),T()};return T(),(_,a)=>{const i=_e,p=me,A=Fe,U=Ce,I=we,m=De,S=fe,y=Ee,s=ye,v=ge,b=Ve,F=ve,J=ze("router-link"),j=be,ie=Ae,O=ke,de=he,re=Be,L=Je("perms"),pe=xe;return n(),D(k,null,[f("div",null,[t(y,{class:"!border-none mb-4",shadow:"never"},{default:u(()=>[t(S,{class:"mb-[-16px]",model:l,inline:""},{default:u(()=>[t(p,{label:"\u7528\u6237ID",prop:"user_id"},{default:u(()=>[t(i,{class:"w-[280px]",modelValue:l.user_id,"onUpdate:modelValue":a[0]||(a[0]=e=>l.user_id=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7528\u6237ID"},null,8,["modelValue"])]),_:1}),t(p,{label:"\u571F\u5730ID",prop:"land_id"},{default:u(()=>[t(i,{class:"w-[280px]",modelValue:l.land_id,"onUpdate:modelValue":a[1]||(a[1]=e=>l.land_id=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u571F\u5730ID"},null,8,["modelValue"])]),_:1}),t(p,{label:"\u79CD\u690D\u79CD\u7C7B",prop:"kind"},{default:u(()=>[t(i,{class:"w-[280px]",modelValue:l.kind,"onUpdate:modelValue":a[2]||(a[2]=e=>l.kind=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u79CD\u690D\u79CD\u7C7B"},null,8,["modelValue"])]),_:1}),t(p,{label:"\u79CD\u690D\u54C1\u724C",prop:"breed"},{default:u(()=>[t(i,{class:"w-[280px]",modelValue:l.breed,"onUpdate:modelValue":a[3]||(a[3]=e=>l.breed=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u79CD\u690D\u54C1\u724C"},null,8,["modelValue"])]),_:1}),t(p,{label:"\u79CD\u690D\u4EBA\u5458",prop:"user"},{default:u(()=>[t(i,{class:"w-[280px]",modelValue:l.user,"onUpdate:modelValue":a[4]||(a[4]=e=>l.user=e),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u79CD\u690D\u4EBA\u5458"},null,8,["modelValue"])]),_:1}),t(p,{label:"\u751F\u957F\u72B6\u6001",prop:"status"},{default:u(()=>[t(U,{class:"w-[280px]",modelValue:l.status,"onUpdate:modelValue":a[5]||(a[5]=e=>l.status=e),clearable:"",placeholder:"\u8BF7\u9009\u62E9\u751F\u957F\u72B6\u6001"},{default:u(()=>[t(A,{label:"\u5168\u90E8",value:""}),(n(!0),D(k,null,w(r(N).plant_status,(e,d)=>(n(),E(A,{key:d,label:e.name,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),t(p,{label:"\u64AD\u79CD\u65F6\u95F4",prop:"plant_date"},{default:u(()=>[t(I,{startTime:l.start_time,"onUpdate:startTime":a[6]||(a[6]=e=>l.start_time=e),endTime:l.end_time,"onUpdate:endTime":a[7]||(a[7]=e=>l.end_time=e)},null,8,["startTime","endTime"])]),_:1}),t(p,null,{default:u(()=>[t(m,{type:"primary",onClick:r(ae)},{default:u(()=>[Oe]),_:1},8,["onClick"]),t(m,{onClick:r(te)},{default:u(()=>[Ge]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),V((n(),E(y,{class:"!border-none",shadow:"never"},{default:u(()=>[f("div",He,[t(j,{data:r(h).lists,onSelectionChange:ee,style:{width:"100%"}},{default:u(()=>[t(s,{type:"selection",width:"55"}),t(s,{label:"ID",prop:"id",width:"80","show-overflow-tooltip":""}),t(s,{label:"\u6240\u5C5E\u571F\u5730",width:"200"},{default:u(({row:e})=>[t(v,{class:"mr-2",type:"info"},{default:u(()=>[c("ID: "+C(e.land_id),1)]),_:2},1024),t(v,{class:"mr-2",type:"info"},{default:u(()=>[c("\u540D\u79F0: "+C(e.title),1)]),_:2},1024)]),_:1}),t(s,{label:"\u79CD\u690D\u79CD\u7C7B",prop:"kind","show-overflow-tooltip":""}),t(s,{label:"\u79CD\u690D\u54C1\u724C",prop:"breed","show-overflow-tooltip":""}),t(s,{label:"\u79CD\u690D\u9762\u79EF",prop:"area","show-overflow-tooltip":""}),t(s,{label:"\u79CD\u690D\u4EBA\u5458",prop:"user","show-overflow-tooltip":""}),t(s,{label:"\u751F\u957F\u72B6\u6001",align:"center",prop:"status"},{default:u(({row:e})=>[t(b,{options:r(N).plant_status,value:e.status},null,8,["options","value"])]),_:1}),t(s,{label:"\u6EAF\u6E90\u4E8C\u7EF4\u7801",width:"150",align:"center",prop:"qr_code"},{default:u(({row:e})=>[e.qr_code!==null&&e.qr_code!==void 0&&e.qr_code!==""?(n(),E(F,{key:0,style:{width:"100px",height:"100px"},src:e.qr_code},null,8,["src"])):W("",!0)]),_:1}),t(s,{label:"\u64AD\u79CD\u65F6\u95F4",width:"180",align:"center",prop:"plant_date"},{default:u(({row:e})=>[f("span",null,C(e.plant_date?r(Ie)(e.plant_date,"yyyy-mm-dd hh:MM:ss"):""),1)]),_:1}),t(s,{label:"\u64CD\u4F5C",width:"340",align:"center",fixed:"right"},{default:u(({row:e})=>[V((n(),E(m,{type:"primary",link:"",onClick:d=>ne(e)},{default:u(()=>[Qe]),_:2},1032,["onClick"])),[[L,["land.land_plant/edit"]]]),V((n(),E(m,{type:"primary",link:"",onClick:d=>oe(e)},{default:u(()=>[We]),_:2},1032,["onClick"])),[[L,["land.land_plant/suyuan"]]]),t(m,{type:"primary",link:"",onClick:d=>ue(e)},{default:u(()=>[Xe]),_:2},1032,["onClick"]),V((n(),E(m,{type:"primary",link:""},{default:u(()=>[t(J,{to:{path:r(Se)("land.land_plant_action/lists"),query:{plant_id:e.id}}},{default:u(()=>[Ye]),_:2},1032,["to"])]),_:2},1024)),[[L,["land.land_plant_action/lists"]]]),V((n(),E(m,{type:"danger",link:"",onClick:d=>se(e.id)},{default:u(()=>[Ze]),_:2},1032,["onClick"])),[[L,["land.land_plant/delete"]]])]),_:1})]),_:1},8,["data"])]),f("div",et,[t(ie,{modelValue:r(h),"onUpdate:modelValue":a[8]||(a[8]=e=>je(h)?h.value=e:null),onChange:r(T)},null,8,["modelValue","onChange"])])]),_:1})),[[pe,r(h).loading]]),q.value?(n(),E($e,{key:0,ref_key:"editRef",ref:$,"dict-data":r(N),onSuccess:r(T),onClose:a[9]||(a[9]=e=>q.value=!1)},null,8,["dict-data","onSuccess"])):W("",!0)]),t(O,{modelValue:M.value,"onUpdate:modelValue":a[10]||(a[10]=e=>M.value=e),title:"\u79CD\u690D\u56FE\u7247",center:""},{default:u(()=>[(n(!0),D(k,null,w(B.picData,e=>(n(),D("div",{style:{display:"inline-block",margin:"12px"},key:e},[t(F,{style:{width:"200px",height:"200px"},src:e,"zoom-rate":1.2,"max-scale":5,"min-scale":.2,"preview-src-list":B.picData,"initial-index":4,fit:"cover",center:""},null,8,["src","zoom-rate","min-scale","preview-src-list"])]))),128))]),_:1},8,["modelValue"]),t(O,{modelValue:z.value,"onUpdate:modelValue":a[11]||(a[11]=e=>z.value=e),title:"\u6EAF\u6E90\u4FE1\u606F"},{default:u(()=>[f("div",tt,[t(re,{"indicator-position":"outside"},{default:u(()=>[(n(!0),D(k,null,w(o.categoryData.pic,(e,d)=>(n(),E(de,{key:d,class:"text-center"},{default:u(()=>[t(F,{style:{width:"auto",height:"100%"},src:o.categoryData.pic[d]},null,8,["src"])]),_:2},1024))),128))]),_:1}),t(v,{size:"large",type:"info"},{default:u(()=>[at]),_:1}),t(y,{class:"box-card mb-4"},{default:u(()=>[f("div",ut," \u5546\u54C1\u540D\u79F0\uFF1A"+C(o.categoryData.kind),1),f("div",lt," \u6536\u83B7\u65E5\u671F\uFF1A"+C(o.categoryData.harvest_date),1),f("div",ot," \u751F\u957F\u5468\u671F\uFF1A"+C(o.categoryData.group_day)+" \u5929 ",1),f("div",nt," \u751F\u4EA7\u5730\u5740\uFF1A"+C(o.categoryData.land_address),1)]),_:1}),(n(!0),D(k,null,w(o.landActionType,(e,d)=>(n(),D("div",{key:d},[t(v,{size:"large",type:"info"},{default:u(()=>[c(C(o.landActionType[d]),1)]),_:2},1024),t(y,{class:"box-card mb-4"},{default:u(()=>[(n(!0),D(k,null,w(o.landActionData[d],(G,ce)=>{var H,Q;return n(),D("div",{key:ce,class:"mb-2 text-xl text-tx-gray"},C((H=G.item)!=null?H:"")+"\uFF1A"+C((Q=G.value)!=null?Q:""),1)}),128))]),_:2},1024)]))),128))])]),_:1},8,["modelValue"])],64)}}});export{Wt as default};