suyuan-breed/public/admin/assets/edit.f677a3ee.js

2 lines
5.5 KiB
JavaScript
Raw Normal View History

2024-01-09 15:59:23 +08:00
import{B as H,C as X,c as Y,W as Z,Q as ee,R as oe,D as te,k as ae}from"./element-plus.5df6f736.js";import{u as le}from"./useDictOptions.8d220934.js";import{P as ue}from"./index.5f547370.js";import{c as se,g as h,d as k,e as re,f as ne,h as de}from"./product.b8535e4b.js";import{a as ie,t as pe,j as U,d as me}from"./index.1f78e617.js";import{d as P,s as A,r as c,b as ce,_ as w,a3 as _e,o as n,c as p,T as l,K as u,u as _,J as F,U as B,a6 as D,Q as fe}from"./@vue.108c970a.js";import"./@vueuse.d3d080b7.js";import"./@element-plus.d6eabd08.js";import"./lodash-es.29c53eac.js";import"./dayjs.50c3b6f7.js";import"./axios.c2a2014a.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.33f675f2.js";import"./vue-router.ed788fee.js";import"./pinia.eff1ffd5.js";import"./vue-demi.ebc8116b.js";import"./css-color-function.5d5b8bda.js";import"./color.da05fa89.js";import"./clone.06747a68.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./debug.1c707d7b.js";import"./ms.a9ae1d6d.js";import"./nprogress.fc605139.js";import"./vue-clipboard3.dc900a40.js";import"./clipboard.6beb87aa.js";import"./echarts.8d7a50ae.js";import"./zrender.1084fa23.js";import"./tslib.60310f1a.js";import"./highlight.js.4ebdf9a4.js";import"./@highlightjs.241b9b5d.js";const ge={class:"edit-popup"},xe=["src"],ve={key:1,class:"avatar-uploader-icon"},Fe=P({name:"productEdit"}),Ee=P({...Fe,props:{dictData:{type:Object,default:()=>({})}},emits:["success","close"],setup(ye,{expose:L,emit:E}){const y=A(),f=A(),g=c("add"),R=c(".png, .jpg, .jpeg, image/png, image/jpeg"),S=c(`${U.baseUrl}${U.urlPrefix}/upload/image`),j=ie(),I=(o,e)=>{if(o.code==0){ae.error(o.msg);return}t.image=o.data.uri},M=ce(()=>g.value=="edit"?"\u7F16\u8F91\u4EA7\u54C1":"\u65B0\u589E\u4EA7\u54C1"),t=w({id:"",user_id:"",root:0,land_id:"",code:"",name:"",desc:"",image:"",status:""}),T=w({code:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EA7\u54C1\u7F16\u53F7",trigger:["blur"]}],name:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EA7\u54C1\u540D\u79F0",trigger:["blur"]}]}),C=async o=>{for(const e in t)o[e]!=null&&o[e]!=null&&(t[e]=o[e]);t.create_time=pe(t.create_time,"yyyy-mm-dd hh:MM:ss")},O=async o=>{const e=await se({id:o.id});C(e)},{optionsData:i}=le({user:{api:h},land:{api:k}}),d=c(!1),N=async o=>{d.value=!0;const e=await h({keyword:o!=null?o:""});i.user=e,d.value=!1},Q=o=>{i.land=[],t.land_id="",x(o)},x=async o=>{d.value=!0;const e=await k({user_id:o!=null?o:""});d.value=!1,i.land=e,d.value=!1},$=async()=>{var e,s;await((e=y.value)==null?void 0:e.validate());const o={...t};g.value=="edit"?await re(o):await ne(o),(s=f.value)==null||s.close(),E("success")},J=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(o){const e=Math.random()*16|0;return(o=="x"?e:e&3|8).toString(16)}),K=(o="add")=>{var e;g.value=o,(e=f.value)==null||e.open(),t.code=J(),de().then(s=>{var m;const r=(m=s.user.root)!=null?m:0;t.root=r,o=="edit"&&x(t.user_id)}).catch(s=>{console.log("err",s)})},W=()=>{E("close")};return L({open:K,setFormData:C,getDetail:O}),(o,e)=>{const s=H,r=X,m=_e("Plus"),q=Y,z=Z,b=ee,V=oe,G=te;return n(),p("div",ge,[l(ue,{ref_key:"popupRef",ref:f,title:_(M),async:!0,width:"550px",onConfirm:$,onClose:W},{default:u(()=>[l(G,{ref_key:"formRef",ref:y,model:t,"label-width":"90px",rules:T},{default:u(()=>[l(r,{label:"\u4EA7\u54C1\u540D\u79F0",prop:"name"},{default:u(()=>[l(s,{modelValue:t.name,"onUpdate:modelValue":e[0]||(e[0]=a=>t.name=a),clearable:"",placeholder:"\u8BF7\u8F93\u5165\u4EA7\u54C1\u540D\u79F0"},null,8,["modelValue"])]),_:1}),l(r,{label:"\u4EA7\u54C1\u7F16\u53F7",prop:"code"},{default:u(()=>[l(s,{modelValue:t.code,"onUpdate:modelValue":e[1]||(e[1]=a=>t.code=a),clearable:"",disabled:"",placeholder:"\u8BF7\u8F93\u5165\u4EA7\u54C1\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),l(r,{label:"\u4EA7\u54C1\u4ECB\u7ECD",prop:"desc"},{default:u(()=>[l(s,{modelValue:t.desc,"onU