2025-03-20 10:25:32 +08:00

2 lines
3.6 KiB
JavaScript

import{_ as B}from"./index.vue_vue_type_style_index_0_lang.9e5f7fb0.js";import{J as F,G as K,H as M,I as H,K as I,B as N,C as R,D as $}from"./element-plus.2acb577d.js";import{_ as q}from"./index.37024cd6.js";import{d as P}from"./department.23a87470.js";import{r as y,Z as T,o,c as f,U as c,L as u,T as D,a9 as k,K as r,Q as d,n as A}from"./@vue.821a47ec.js";const G={key:0},J={__name:"index",props:{config:{type:Array,required:!0},formData:{type:Object,required:!0},type:{type:Number||Object,default:null},extend:{type:Object,default:{}}},setup(l){const n=l,m=y([]);(async()=>{const a=await P();m.value=a.lists})();const x=T({}),p=y(!1),V=y(null);let v;const g=async a=>{p.value=!0,v=a,await A(),V.value.open()},i=a=>{n.formData[v].text=a.name,n.formData[v].value=a.id,p.value=!1},U=a=>{n.formData[a].text=m.value.find(_=>_.id===n.formData[a].value).name};return(()=>{if(Object.keys(n.extend).length)for(let a in n.extend)n.formData[a]=n.extend[a];else n.config.forEach(a=>{n.formData[a.value]={label:a.label,value:"",text:""}})})(),(a,_)=>{const b=N,s=R,h=F,C=K,E=M,Y=H,w=I,L=$,O=B;return o(),f(D,null,[c(L,{ref:"formRef",model:l.formData,"label-width":"100px",rules:x},{default:u(()=>[c(w,null,{default:u(()=>[(o(!0),f(D,null,k(l.config,(e,j)=>(o(),r(Y,{span:8,key:j},{default:u(()=>[e.type==0?(o(),r(s,{key:0,label:e.label},{default:u(()=>[c(b,{modelValue:l.formData[e.value].value,"onUpdate:modelValue":t=>l.formData[e.value].value=t,clearable:"",placeholder:"\u8BF7\u8F93\u5165"+e.label},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["label"])):d("",!0),e.type==1?(o(),r(s,{key:1,label:e.label},{default:u(()=>[l.type==1?(o(),r(h,{key:0,class:"flex-1 !flex",modelValue:l.formData[e.value].value,"onUpdate:modelValue":t=>l.formData[e.value].value=t,clearable:"",type:"datetime","value-format":"YYYY-MM-DD HH:mm:ss",placeholder:"\u8BF7\u9009\u62E9"+e.label},null,8,["modelValue","onUpdate:modelValue","placeholder"])):(o(),r(h,{key:1,class:"flex-1 !flex",modelValue:l.formData[e.value].value,"onUpdate:modelValue":t=>l.formData[e.value].value=t,clearable:"",type:"date","value-format":"YYYY-MM-DD",placeholder:"\u8BF7\u9009\u62E9"+e.label},null,8,["modelValue","onUpdate:modelValue","placeholder"]))]),_:2},1032,["label"])):d("",!0),e.type==2?(o(),r(s,{key:2,label:e.label},{default:u(()=>[c(E,{onChange:t=>U(e.value),modelValue:l.formData[e.value].value,"onUpdate:modelValue":t=>l.formData[e.value].value=t,placeholder:"\u8BF7\u9009\u62E9"+e.label,class:"flex-1"},{default:u(()=>[(o(!0),f(D,null,k(m.value,t=>(o(),r(C,{label:t.name,value:t.id},null,8,["label","value"]))),256))]),_:2},1032,["onChange","modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["label"])):d("",!0),e.type==3?(o(),r(s,{key:3,label:e.label},{default:u(()=>[c(b,{modelValue:l.formData[e.value].text,"onUpdate:modelValue":t=>l.formData[e.value].text=t,readonly:"",placeholder:"\u70B9\u51FB\u9009\u62E9"+e.label,onClick:t=>g(e.value)},null,8,["modelValue","onUpdate:modelValue","placeholder","onClick"])]),_:2},1032,["label"])):d("",!0),e.type==4?(o(),r(s,{key:4,label:e.label},{default:u(()=>[c(b,{modelValue:l.formData[e.value].value,"onUpdate:modelValue":t=>l.formData[e.value].value=t,clearable:"",type:"textarea",placeholder:"\u8BF7\u8F93\u5165"+e.label},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["label"])):d("",!0),e.type==5?(o(),r(s,{key:5,label:e.label},{default:u(()=>[c(q,{"form-data":l.formData},null,8,["form-data"])]),_:2},1032,["label"])):d("",!0)]),_:2},1024))),128))]),_:1})]),_:1},8,["model","rules"]),p.value?(o(),f("div",G,[c(O,{ref_key:"personnel",ref:V,onConfirm:i,type:"1"},null,512)])):d("",!0)],64)}}},le=J;export{le as g};