import{d as N,Z as s,a_ as ue,k as E,aZ as X,a0 as S,b3 as ce,$ as Y,a1 as de,B as D,bJ as ee,hv as j,hw as te,b7 as ae,hx as pe,hy as me,a2 as fe,hz as ve,r as O,ba as q,b9 as _e,a3 as se,hA as ge,a4 as K,b0 as he,bu as ye,a5 as be,cE as ke,hB as H,bU as Z,hC as Ve,bP as G,u as Ie,a as Pe,c as ne,o as J,w as o,j as n,U as Ce,M as le,W as Re,i as re,h as we,l as f,aB as Ae,ds as oe,H as Be,N as Se,hD as Ue,n as De,p as T,t as Oe,_ as $e,c8 as xe,c9 as je,aA as Te,X as Ne}from"./index-9PRMimni.js";import{_ as Fe}from"./ButtonGroup-C8-zHw_m.js";const ze=N({name:"ArrowUp",render(){return s("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20"},s("g",{fill:"none"},s("path",{d:"M3.13 9.163a.5.5 0 1 0 .74.674L9.5 3.67V17.5a.5.5 0 0 0 1 0V3.672l5.63 6.165a.5.5 0 0 0 .738-.674l-6.315-6.916a.746.746 0 0 0-.632-.24a.746.746 0 0 0-.476.24L3.131 9.163z",fill:"currentColor"})))}}),Q=ue("n-dynamic-input"),Me=N({name:"DynamicInputInputPreset",props:{clsPrefix:{type:String,required:!0},value:{type:String,default:""},disabled:Boolean,parentPath:String,path:String,onUpdateValue:{type:Function,required:!0}},setup(){const{mergedThemeRef:a,placeholderRef:y}=X(Q);return{mergedTheme:a,placeholder:y}},render(){const{mergedTheme:a,placeholder:y,value:v,clsPrefix:i,onUpdateValue:d,disabled:V}=this;return s("div",{class:`${i}-dynamic-input-preset-input`},s(E,{theme:a.peers.Input,"theme-overrides":a.peerOverrides.Input,value:v,placeholder:y,onUpdateValue:d,disabled:V}))}}),qe=N({name:"DynamicInputPairPreset",props:{clsPrefix:{type:String,required:!0},value:{type:Object,default:()=>({key:"",value:""})},disabled:Boolean,parentPath:String,path:String,onUpdateValue:{type:Function,required:!0}},setup(a){const{mergedThemeRef:y,keyPlaceholderRef:v,valuePlaceholderRef:i}=X(Q);return{mergedTheme:y,keyPlaceholder:v,valuePlaceholder:i,handleKeyInput(d){a.onUpdateValue({key:d,value:a.value.value})},handleValueInput(d){a.onUpdateValue({key:a.value.key,value:d})}}},render(){const{mergedTheme:a,keyPlaceholder:y,valuePlaceholder:v,value:i,clsPrefix:d,disabled:V}=this;return s("div",{class:`${d}-dynamic-input-preset-pair`},s(E,{theme:a.peers.Input,"theme-overrides":a.peerOverrides.Input,value:i.key,class:`${d}-dynamic-input-pair-input`,placeholder:y,onUpdateValue:this.handleKeyInput,disabled:V}),s(E,{theme:a.peers.Input,"theme-overrides":a.peerOverrides.Input,value:i.value,class:`${d}-dynamic-input-pair-input`,placeholder:v,onUpdateValue:this.handleValueInput,disabled:V}))}}),Ke=S("dynamic-input",{width:"100%"},[S("dynamic-input-item",`
 margin-bottom: 10px;
 display: flex;
 flex-wrap: nowrap;
 `,[S("dynamic-input-preset-input",{flex:1,alignItems:"center"}),S("dynamic-input-preset-pair",`
 flex: 1;
 display: flex;
 align-items: center;
 `,[S("dynamic-input-pair-input",[Y("&:first-child",{"margin-right":"12px"})])]),ce("action",`
 align-self: flex-start;
 display: flex;
 justify-content: flex-end;
 flex-shrink: 0;
 flex-grow: 0;
 margin: var(--action-margin);
 `,[de("icon",{cursor:"pointer"})]),Y("&:last-child",{marginBottom:0})]),S("form-item",`
 padding-top: 0 !important;
 margin-right: 0 !important;
 `,[S("form-item-blank",{paddingTop:"0 !important"})])]),L=new WeakMap,Le=Object.assign(Object.assign({},se.props),{max:Number,min:{type:Number,default:0},value:Array,defaultValue:{type:Array,default:()=>[]},preset:{type:String,default:"input"},keyField:String,itemClass:String,itemStyle:[String,Object],keyPlaceholder:{type:String,default:""},valuePlaceholder:{type:String,default:""},placeholder:{type:String,default:""},disabled:Boolean,showSortButton:Boolean,createButtonProps:Object,onCreate:Function,onRemove:Function,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onClear:Function,onInput:[Function,Array]}),Ee=N({name:"DynamicInput",props:Le,setup(a,{slots:y}){const{mergedComponentPropsRef:v,mergedClsPrefixRef:i,mergedRtlRef:d,inlineThemeDisabled:V}=fe(),g=X(ve,null),I=O(a.defaultValue),$=q(a,"value"),P=_e($,I),p=se("DynamicInput","-dynamic-input",Ke,ge,a,i),_=K(()=>{const{value:e}=P;if(Array.isArray(e)){const{max:t}=a;return t!==void 0&&e.length>=t}return!1}),x=K(()=>{const{value:e}=P;return Array.isArray(e)?e.length<=a.min:!0}),l=K(()=>{var e,t;return(t=(e=v?.value)===null||e===void 0?void 0:e.DynamicInput)===null||t===void 0?void 0:t.buttonSize});function b(e){const{onInput:t,"onUpdate:value":u,onUpdateValue:r}=a;t&&G(t,e),u&&G(u,e),r&&G(r,e),I.value=e}function U(e,t){if(e==null||typeof e!="object")return t;const u=H(e)?Z(e):e;let r=L.get(u);return r===void 0&&L.set(u,r=Ve()),r}function w(e,t){const{value:u}=P,r=Array.from(u??[]),C=r[e];if(r[e]=t,C&&t&&typeof C=="object"&&typeof t=="object"){const W=H(C)?Z(C):C,m=H(t)?Z(t):t,M=L.get(W);M!==void 0&&L.set(m,M)}b(r)}function R(){k(-1)}function k(e){const{value:t}=P,{onCreate:u}=a,r=Array.from(t??[]);if(u)r.splice(e+1,0,u(e+1)),b(r);else if(y.default)r.splice(e+1,0,null),b(r);else switch(a.preset){case"input":r.splice(e+1,0,""),b(r);break;case"pair":r.splice(e+1,0,{key:"",value:""}),b(r);break}}function A(e){const{value:t}=P;if(!Array.isArray(t))return;const{min:u}=a;if(t.length<=u)return;const{onRemove:r}=a;r&&r(e);const C=Array.from(t);C.splice(e,1),b(C)}function c(e,t,u){if(t<0||u<0||t>=e.length||u>=e.length||t===u)return;const r=e[t];e[t]=e[u],e[u]=r}function B(e,t){const{value:u}=P;if(!Array.isArray(u))return;const r=Array.from(u);e==="up"&&c(r,t,t-1),e==="down"&&c(r,t,t+1),b(r)}he(Q,{mergedThemeRef:p,keyPlaceholderRef:q(a,"keyPlaceholder"),valuePlaceholderRef:q(a,"valuePlaceholder"),placeholderRef:q(a,"placeholder")});const F=ye("DynamicInput",d,i),z=K(()=>{const{self:{actionMargin:e,actionMarginRtl:t}}=p.value;return{"--action-margin":e,"--action-margin-rtl":t}}),h=V?be("dynamic-input",void 0,z,a):void 0;return{locale:ke("DynamicInput").localeRef,rtlEnabled:F,buttonSize:l,mergedClsPrefix:i,NFormItem:g,uncontrolledValue:I,mergedValue:P,insertionDisabled:_,removeDisabled:x,handleCreateClick:R,ensureKey:U,handleValueChange:w,remove:A,move:B,createItem:k,mergedTheme:p,cssVars:V?void 0:z,themeClass:h?.themeClass,onRender:h?.onRender}},render(){const{$slots:a,itemClass:y,buttonSize:v,mergedClsPrefix:i,mergedValue:d,locale:V,mergedTheme:g,keyField:I,itemStyle:$,preset:P,showSortButton:p,NFormItem:_,ensureKey:x,handleValueChange:l,remove:b,createItem:U,move:w,onRender:R,disabled:k}=this;return R?.(),s("div",{class:[`${i}-dynamic-input`,this.rtlEnabled&&`${i}-dynamic-input--rtl`,this.themeClass],style:this.cssVars},!Array.isArray(d)||d.length===0?s(D,Object.assign({block:!0,ghost:!0,dashed:!0,size:v},this.createButtonProps,{disabled:this.insertionDisabled||k,theme:g.peers.Button,themeOverrides:g.peerOverrides.Button,onClick:this.handleCreateClick}),{default:()=>ee(a["create-button-default"],()=>[V.create]),icon:()=>ee(a["create-button-icon"],()=>[s(j,{clsPrefix:i},{default:()=>s(te,null)})])}):d.map((A,c)=>s("div",{key:I?A[I]:x(A,c),"data-key":I?A[I]:x(A,c),class:[`${i}-dynamic-input-item`,y],style:$},ae(a.default,{value:d[c],index:c},()=>[P==="input"?s(Me,{disabled:k,clsPrefix:i,value:d[c],parentPath:_?_.path.value:void 0,path:_?.path.value?`${_.path.value}[${c}]`:void 0,onUpdateValue:B=>{l(c,B)}}):P==="pair"?s(qe,{disabled:k,clsPrefix:i,value:d[c],parentPath:_?_.path.value:void 0,path:_?.path.value?`${_.path.value}[${c}]`:void 0,onUpdateValue:B=>{l(c,B)}}):null]),ae(a.action,{value:d[c],index:c,create:U,remove:b,move:w},()=>[s("div",{class:`${i}-dynamic-input-item__action`},s(Fe,{size:v},{default:()=>[s(D,{disabled:this.removeDisabled||k,theme:g.peers.Button,themeOverrides:g.peerOverrides.Button,circle:!0,onClick:()=>{b(c)}},{icon:()=>s(j,{clsPrefix:i},{default:()=>s(pe,null)})}),s(D,{disabled:this.insertionDisabled||k,circle:!0,theme:g.peers.Button,themeOverrides:g.peerOverrides.Button,onClick:()=>{U(c)}},{icon:()=>s(j,{clsPrefix:i},{default:()=>s(te,null)})}),p?s(D,{disabled:c===0||k,circle:!0,theme:g.peers.Button,themeOverrides:g.peerOverrides.Button,onClick:()=>{w("up",c)}},{icon:()=>s(j,{clsPrefix:i},{default:()=>s(ze,null)})}):null,p?s(D,{disabled:c===d.length-1||k,circle:!0,theme:g.peers.Button,themeOverrides:g.peerOverrides.Button,onClick:()=>{w("down",c)}},{icon:()=>s(j,{clsPrefix:i},{default:()=>s(me,null)})}):null]}))]))))}}),We={class:"w-full menu"},He={class:"py-3 menu-list"},Ze={key:0,class:"flex items-center justify-center py-4"},Xe=N({__name:"item",setup(a){const y=O(!1),v=O([]),i=O(!1),d=O([]);Ie();const V=O(null),g=[{label:"种牙",value:1},{label:"补牙",value:2},{label:"根管",value:3}],I=[{label:"李医生",value:1},{label:"黄医生",value:2},{label:"张医生",value:3}],$={name:{required:!0,message:"请输入预约姓名",trigger:"blur"},remark:{required:!0,message:"请输入预约备注",trigger:"blur"},mobile:{required:!0,message:"请输入预约电话号码",trigger:["input"]},datetime:{required:!0,type:"number",message:"请选择预约时间",trigger:["blur","change"]},doctor:{required:!0,type:"number",message:"请选择预约医生",trigger:"change"}};let p=Pe({name:"",mobile:"",remark:"",sex:1,matter:null,doctor:null,datetime:[]});d.value=[{value:"cargo_property",label:"Cargo",children:[{value:"bulk_carrier_cargo",label:"Bulk Carrier Inspection",tag:"cargo_property"},{value:"internal_vessel_cargo",label:"Internal Audit Vessel",tag:"cargo_property"},{value:"internal_company_cargo",label:"Internal Audit Company",tag:"cargo_property"}]},{value:"tanker_property",label:"Tanker",children:[{value:"internal_vessel_tanker",label:"Internal Audit Vessel",tag:"tanker_property"},{value:"static_navigation_tanker",label:"Static Navigation Audit",tag:"tanker_property"},{value:"internal_company_tanker",label:"Internal Audit Company",tag:"tanker_property"}]}];function _(){}return(x,l)=>{const b=Ae,U=Se,w=D,R=Be,k=De,A=Ee,c=Re,B=le,F=je,z=xe,h=$e,e=E,t=Te,u=Oe,r=le,C=Ce,W=Ne;return J(),ne(W,null,{default:o(()=>[n(C,{cols:"1 s:1 m:1 l:4 xl:4 2xl:4",responsive:"screen","x-gap":12},{default:o(()=>[n(B,{span:"1"},{default:o(()=>[n(c,{title:"Assigned Group",segmented:{content:"hard"},bordered:!1,size:"small"},{default:o(()=>[re("div",We,[re("div",He,[f(y)?(J(),we("div",Ze,[n(b,{size:"medium"})])):(J(),ne(A,{key:1,value:f(v),"onUpdate:value":l[1]||(l[1]=m=>oe(v)?v.value=m:null),placeholder:"",min:3,max:6},{"create-button-default":o(()=>l[9]||(l[9]=[T(" New ")])),action:o(({index:m,create:M})=>[n(R,{class:"ml-2"},{default:o(()=>[n(w,{onClick:()=>M(m)},{default:o(()=>[n(U,null,{default:o(()=>[n(f(Ue))]),_:1})]),_:2},1032,["onClick"])]),_:2},1024),n(R,{class:"ml-2 mt-1"},{default:o(()=>[n(k,{checked:f(i),"onUpdate:checked":l[0]||(l[0]=ie=>oe(i)?i.value=ie:null)},null,8,["checked"])]),_:1})]),_:1},8,["value"]))])])]),_:1})]),_:1}),n(B,{span:"3"},{default:o(()=>[n(c,{bordered:!1,class:"proCard"},{default:o(()=>[n(R,{class:"flex justify-end"},{default:o(()=>[n(w,{type:"primary"},{default:o(()=>l[10]||(l[10]=[T("Submit")])),_:1}),n(w,{onClick:_},{default:o(()=>l[11]||(l[11]=[T("Log")])),_:1})]),_:1}),n(C,{cols:"1 s:1 m:3 l:3 xl:3 2xl:3",responsive:"screen"},{default:o(()=>[n(r,{offset:"0 s:0 m:1 l:1 xl:1 2xl:1"},{default:o(()=>[n(u,{ref_key:"formRef",ref:V,"label-width":160,model:f(p),rules:$,class:"py-8","label-placement":"left"},{default:o(()=>[n(h,{label:"Status",path:"sex"},{default:o(()=>[n(z,{value:f(p).sex,"onUpdate:value":l[2]||(l[2]=m=>f(p).sex=m),name:"sex"},{default:o(()=>[n(R,null,{default:o(()=>[n(F,{value:1},{default:o(()=>l[12]||(l[12]=[T("Active")])),_:1}),n(F,{value:2},{default:o(()=>l[13]||(l[13]=[T("Inactive")])),_:1})]),_:1})]),_:1},8,["value"])]),_:1}),n(h,{label:"Drill Item(English)",path:"name"},{default:o(()=>[n(e,{value:f(p).name,"onUpdate:value":l[3]||(l[3]=m=>f(p).name=m),placeholder:""},null,8,["value"])]),_:1}),n(h,{label:"Drill Item(Chinese)",path:"mobile"},{default:o(()=>[n(e,{value:f(p).mobile,"onUpdate:value":l[4]||(l[4]=m=>f(p).mobile=m),placeholder:""},null,8,["value"])]),_:1}),n(h,{label:"Peroid",path:"datetime"},{default:o(()=>[n(t,{value:f(p).doctor,"onUpdate:value":l[5]||(l[5]=m=>f(p).doctor=m),options:I,placeholder:""},null,8,["value"])]),_:1}),n(h,{label:"Ship Type",path:"doctor"},{default:o(()=>[n(t,{value:f(p).doctor,"onUpdate:value":l[6]||(l[6]=m=>f(p).doctor=m),options:I,placeholder:""},null,8,["value"])]),_:1}),n(h,{label:"Drill Category",path:"matter"},{default:o(()=>[n(t,{value:f(p).matter,"onUpdate:value":l[7]||(l[7]=m=>f(p).matter=m),options:g,multiple:"",placeholder:""},null,8,["value"])]),_:1}),n(h,{label:"Remark",path:"remark"},{default:o(()=>[n(e,{value:f(p).remark,"onUpdate:value":l[8]||(l[8]=m=>f(p).remark=m),placeholder:"",type:"textarea"},null,8,["value"])]),_:1})]),_:1},8,["model"])]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})]),_:1})}}});export{Xe as default};
