2 lines
5.2 KiB
JavaScript
2 lines
5.2 KiB
JavaScript
import{B as y,C as D,D as k}from"./element-plus.c4a2af8a.js";import{P as A}from"./index.3c28be6f.js";import{a as U,b as q,c as w}from"./soil_monitor.846239cc.js";import{t as h}from"./index.7b0058f7.js";import{d as B,s as c,r as M,e as R,$ as F,o as x,c as I,U as t,L as a,u as S}from"./@vue.e8706010.js";import"./@vueuse.1e5a6e21.js";import"./@element-plus.196c7323.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"./vue-router.12d45bc3.js";import"./pinia.dfca86b4.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.2cdc8407.js";const P={class:"edit-popup"},j=B({name:"soilMonitorEdit"}),Ce=B({...j,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(L,{expose:E,emit:m}){const n=c(),d=c(),p=M("add"),f=R(()=>p.value=="edit"?"\u571F\u58E4\u76D1\u6D4B\u6570\u636E":"\u65B0\u589E\u571F\u58E4\u76D1\u6D4B"),u=F({id:"",device_id:"",temperature:"",moisture:"",conductivity:"",ph:"",n_content:"",p_content:"",k_content:""}),_=F({device_id:[{required:!0,message:"\u8BF7\u8F93\u5165\u8BBE\u5907ID",trigger:["blur"]}],temperature:[{required:!0,message:"\u8BF7\u8F93\u5165\u571F\u58E4\u6E29\u5EA6",trigger:["blur"]}],moisture:[{required:!0,message:"\u8BF7\u8F93\u5165\u571F\u58E4\u6E7F\u5EA6",trigger:["blur"]}],conductivity:[{required:!0,message:"\u8BF7\u8F93\u5165\u7535\u5BFC\u7387",trigger:["blur"]}],ph:[{required:!0,message:"\u8BF7\u8F93\u5165\u571F\u58E4\u9178\u78B1\u5EA6",trigger:["blur"]}],n_content:[{required:!0,message:"\u8BF7\u8F93\u5165\u6C2E\u542B\u91CF",trigger:["blur"]}],p_content:[{required:!0,message:"\u8BF7\u8F93\u5165\u78F7\u542B\u91CF",trigger:["blur"]}],k_content:[{required:!0,message:"\u8BF7\u8F93\u5165\u94BE\u542B\u91CF",trigger:["blur"]}]}),s=async l=>{for(const e in u)l[e]!=null&&l[e]!=null&&(u[e]=l[e]);u.create_time=h(u.create_time,"yyyy-mm-dd hh:MM:ss")},b=async l=>{const e=await U({id:l.id});s(e)},g=async()=>{var e,r;await((e=n.value)==null?void 0:e.validate());const l={...u};p.value=="edit"?await q(l):await w(l),(r=d.value)==null||r.close(),m("success")},V=(l="add")=>{var e;p.value=l,(e=d.value)==null||e.open()},C=()=>{m("close")};return E({open:V,setFormData:s,getDetail:b}),(l,e)=>{const r=y,i=D,v=k;return x(),I("div",P,[t(A,{ref_key:"popupRef",ref:d,title:S(f),async:!0,width:"550px",onConfirm:g,onClose:C},{default:a(()=>[t(v,{ref_key:"formRef",ref:n,model:u,"label-width":"120px",rules:_},{default:a(()=>[t(i,{label:"\u8BBE\u5907ID",prop:"device_id"},{default:a(()=>[t(r,{modelValue:u.device_id,"onUpdate:modelValue":e[0]||(e[0]=o=>u.device_id=o),disabled:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u8BBE\u5907ID"},null,8,["modelValue"])]),_:1}),t(i,{label:"\u571F\u58E4\u6E29\u5EA6",prop:"temperature"},{default:a(()=>[t(r,{modelValue:u.temperature,"onUpdate:modelValue":e[1]||(e[1]=o=>u.temperature=o),disabled:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u571F\u58E4\u6E29\u5EA6"},null,8,["modelValue"])]),_:1}),t(i,{label:"\u571F\u58E4\u6E7F\u5EA6",prop:"moisture"},{default:a(()=>[t(r,{modelValue:u.moisture,"onUpdate:modelValue":e[2]||(e[2]=o=>u.moisture=o),disabled:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u571F\u58E4\u6E7F\u5EA6"},null,8,["modelValue"])]),_:1}),t(i,{label:"\u7535\u5BFC\u7387",prop:"conductivity"},{default:a(()=>[t(r,{modelValue:u.conductivity,"onUpdate:modelValue":e[3]||(e[3]=o=>u.conductivity=o),disabled:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u7535\u5BFC\u7387"},null,8,["modelValue"])]),_:1}),t(i,{label:"\u571F\u58E4\u9178\u78B1\u5EA6",prop:"ph"},{default:a(()=>[t(r,{modelValue:u.ph,"onUpdate:modelValue":e[4]||(e[4]=o=>u.ph=o),disabled:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u571F\u58E4\u9178\u78B1\u5EA6"},null,8,["modelValue"])]),_:1}),t(i,{label:"\u6C2E\u542B\u91CF",prop:"n_content"},{default:a(()=>[t(r,{modelValue:u.n_content,"onUpdate:modelValue":e[5]||(e[5]=o=>u.n_content=o),disabled:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u6C2E\u542B\u91CF"},null,8,["modelValue"])]),_:1}),t(i,{label:"\u78F7\u542B\u91CF",prop:"p_content"},{default:a(()=>[t(r,{modelValue:u.p_content,"onUpdate:modelValue":e[6]||(e[6]=o=>u.p_content=o),disabled:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u78F7\u542B\u91CF"},null,8,["modelValue"])]),_:1}),t(i,{label:"\u94BE\u542B\u91CF",prop:"k_content"},{default:a(()=>[t(r,{modelValue:u.k_content,"onUpdate:modelValue":e[7]||(e[7]=o=>u.k_content=o),disabled:"",clearable:"",placeholder:"\u8BF7\u8F93\u5165\u94BE\u542B\u91CF"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["title"])])}}});export{Ce as default};
|