2 lines
12 KiB
JavaScript
2 lines
12 KiB
JavaScript
import{B as ce,C as _e,Q as me,R as Fe,w as Ce,D as De,I as fe,L as Ee,_ as ye,b as ge,M as ve,J as be,a1 as ke,a2 as he,N as Be}from"./element-plus.7a22678c.js";import{_ as xe}from"./index.vue_vue_type_script_setup_true_lang.cabb2d32.js";import{_ as Ae}from"./index.vue_vue_type_script_setup_true_lang.4e44db35.js";import{_ as Ve}from"./index.vue_vue_type_script_setup_true_lang.f8debc0c.js";import{u as we}from"./vue-router.ed788fee.js";import{u as Te}from"./usePaging.2a59f422.js";import{t as Ue,k as Ie,f as Se}from"./index.2eb94ba0.js";import{a as Le}from"./useDictOptions.f8827d58.js";import{_ as Pe,a as $e,b as qe,c as Re}from"./edit.vue_vue_type_script_setup_true_name_landPlantEdit_lang.7a00602b.js";import{d as X,s as Ne,r as P,_ as v,a3 as ze,ae as Me,o as n,c as C,a as D,T as t,K as u,L as A,u as r,J as f,Q as W,U as b,a6 as V,R as c,S as F,j as Je,n as je}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"./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.8c7044a6.js";const Oe=c("\u67E5\u8BE2"),Qe=c("\u91CD\u7F6E"),Ke={class:"mt-4"},Ge=c(" \u7F16\u8F91 "),He=c(" \u6EAF\u6E90\u4FE1\u606F "),We=c(" \u79CD\u690D\u56FE\u7247 "),Xe=c(" \u79CD\u690D\u64CD\u4F5C "),Ye=c(" \u5220\u9664 "),Ze={class:"flex mt-4 justify-end"},et={class:"overflow-y-auto",style:{height:"500px"}},tt=c("\u54C1\u7C7B\u4FE1\u606F"),at={class:"mb-2 text-xl text-tx-gray"},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=X({name:"landPlantLists"}),Ht=X({...nt,setup(st){const{query:Y}=we(),$=Ne(),q=P(!1);let R=Y.land_id;typeof R>"u"&&(R="");const l=v({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}=Le("plant_status"),{pager:k,getLists:w,resetParams:te,resetPage:ae}=Te({fetchFun:$e,params:l}),z=P(!1),M=P(!1),h=v({picData:[]}),ue=_=>{h.picData=[];const a=JSON.parse(_.pic);for(const i in a)h.picData.unshift(a[i]);z.value=!0},O=v({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"}}),B=v({gridData:[{}]}),o=v({categoryData:{kind:"",group_day:"",harvest_date:"",land_address:"",pic:""},landActionType:[""],landActionData:[v({})]}),le=_=>{h.picData=[],qe({id:_.id}).then(a=>{var i,p,x,T,U,m,I;M.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=(x=a.harvest_date)!=null?x:"",o.categoryData.land_address=(T=a.land_address)!=null?T:"",o.categoryData.pic=(U=a.pic)!=null?U:[],B.gridData=[{}];for(const E in a.actions){B.gridData=[{}];const s=a.actions[E].type,g=a.actions[E].type_text,S=a.actions[E].detail;for(const y in O[s]){const J=(m=O[s][y])!=null?m:"-";for(const j in S)j==y&&B.gridData.push({item:J,value:(I=S[y])!=null?I:"-"})}B.gridData.splice(0,1),o.landActionType.push(g),o.landActionData.push(B.gridData)}o.landActionType.splice(0,1),o.landActionData.splice(0,1)}).catch(a=>{console.log("err",a)})},oe=async _=>{var a,i;q.value=!0,await je(),(a=$.value)==null||a.open("edit"),(i=$.value)==null||i.setFormData(_)},ne=async _=>{await Se.confirm("\u786E\u5B9A\u8981\u5220\u9664\uFF1F"),await Re({id:_}),w()};return w(),(_,a)=>{const i=ce,p=_e,x=me,T=Fe,U=Ve,m=Ce,I=De,E=fe,s=Ee,g=ye,S=Ae,y=ge,J=ze("router-link"),j=ve,se=xe,Q=be,ie=ke,de=he,L=Me("perms"),re=Be;return n(),C(b,null,[D("div",null,[t(E,{class:"!border-none mb-4",shadow:"never"},{default:u(()=>[t(I,{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(T,{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(x,{label:"\u5168\u90E8",value:""}),(n(!0),C(b,null,V(r(N).plant_status,(e,d)=>(n(),f(x,{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(U,{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(()=>[Qe]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),A((n(),f(E,{class:"!border-none",shadow:"never"},{default:u(()=>[D("div",Ke,[t(j,{data:r(k).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(g,{class:"mr-2",type:"info"},{default:u(()=>[c("ID: "+F(e.land_id),1)]),_:2},1024),t(g,{class:"mr-2",type:"info"},{default:u(()=>[c("\u540D\u79F0: "+F(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(S,{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(),f(y,{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})=>[D("span",null,F(e.plant_date?r(Ue)(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})=>[A((n(),f(m,{type:"primary",link:"",onClick:d=>oe(e)},{default:u(()=>[Ge]),_:2},1032,["onClick"])),[[L,["land.land_plant/edit"]]]),A((n(),f(m,{type:"primary",link:"",onClick:d=>le(e)},{default:u(()=>[He]),_:2},1032,["onClick"])),[[L,["land.land_plant/suyuan"]]]),t(m,{type:"primary",link:"",onClick:d=>ue(e)},{default:u(()=>[We]),_:2},1032,["onClick"]),A((n(),f(m,{type:"primary",link:""},{default:u(()=>[t(J,{to:{path:r(Ie)("land.land_plant_action/lists"),query:{plant_id:e.id}}},{default:u(()=>[Xe]),_:2},1032,["to"])]),_:2},1024)),[[L,["land.land_plant_action/lists"]]]),A((n(),f(m,{type:"danger",link:"",onClick:d=>ne(e.id)},{default:u(()=>[Ye]),_:2},1032,["onClick"])),[[L,["land.land_plant/delete"]]])]),_:1})]),_:1},8,["data"])]),D("div",Ze,[t(se,{modelValue:r(k),"onUpdate:modelValue":a[8]||(a[8]=e=>Je(k)?k.value=e:null),onChange:r(w)},null,8,["modelValue","onChange"])])]),_:1})),[[re,r(k).loading]]),q.value?(n(),f(Pe,{key:0,ref_key:"editRef",ref:$,"dict-data":r(N),onSuccess:r(w),onClose:a[9]||(a[9]=e=>q.value=!1)},null,8,["dict-data","onSuccess"])):W("",!0)]),t(Q,{modelValue:z.value,"onUpdate:modelValue":a[10]||(a[10]=e=>z.value=e),title:"\u79CD\u690D\u56FE\u7247",center:""},{default:u(()=>[(n(!0),C(b,null,V(h.picData,e=>(n(),C("div",{style:{display:"inline-block",margin:"12px"},key:e},[t(y,{style:{width:"200px",height:"200px"},src:e,"zoom-rate":1.2,"max-scale":5,"min-scale":.2,"preview-src-list":h.picData,"initial-index":4,fit:"cover",center:""},null,8,["src","zoom-rate","min-scale","preview-src-list"])]))),128))]),_:1},8,["modelValue"]),t(Q,{modelValue:M.value,"onUpdate:modelValue":a[11]||(a[11]=e=>M.value=e),title:"\u6EAF\u6E90\u4FE1\u606F"},{default:u(()=>[D("div",et,[t(de,{"indicator-position":"outside"},{default:u(()=>[(n(!0),C(b,null,V(o.categoryData.pic,(e,d)=>(n(),f(ie,{key:d,class:"text-center"},{default:u(()=>[t(y,{style:{width:"auto",height:"100%"},src:o.categoryData.pic[d]},null,8,["src"])]),_:2},1024))),128))]),_:1}),t(g,{size:"large",type:"info"},{default:u(()=>[tt]),_:1}),t(E,{class:"box-card mb-4"},{default:u(()=>[D("div",at," \u5546\u54C1\u540D\u79F0\uFF1A"+F(o.categoryData.kind),1),D("div",ut," \u6536\u83B7\u65E5\u671F\uFF1A"+F(o.categoryData.harvest_date),1),D("div",lt," \u751F\u957F\u5468\u671F\uFF1A"+F(o.categoryData.group_day)+" \u5929 ",1),D("div",ot," \u751F\u4EA7\u5730\u5740\uFF1A"+F(o.categoryData.land_address),1)]),_:1}),(n(!0),C(b,null,V(o.landActionType,(e,d)=>(n(),C("div",{key:d},[t(g,{size:"large",type:"info"},{default:u(()=>[c(F(o.landActionType[d]),1)]),_:2},1024),t(E,{class:"box-card mb-4"},{default:u(()=>[(n(!0),C(b,null,V(o.landActionData[d],(K,pe)=>{var G,H;return n(),C("div",{key:pe,class:"mb-2 text-xl text-tx-gray"},F((G=K.item)!=null?G:"")+"\uFF1A"+F((H=K.value)!=null?H:""),1)}),128))]),_:2},1024)]))),128))])]),_:1},8,["modelValue"])],64)}}});export{Ht as default};
|