import{u as e}from"./useCreate-b3492f2b.js";import{u as a}from"./useShow-ca493df3.js";import{d as l,p as o,r as t,K as s,J as r,f as u,o as m,j as d,w as n,a as i,c as p,F as c,q as b,b as f,t as _,e as V}from"./index-018fb6dd.js";const y={class:"flex justify-end"},g=l({__name:"create",props:{primary:String|Number,api:String},emits:["close"],setup(l,{emit:g}){const j=l,{formData:v,form:x,loading:U,submitForm:k,close:w}=e(j.api,j.primary);v.value.status=1,v.value.sort=1,j.primary&&a(j.api,j.primary,v),o((()=>{w((()=>g("close")))}));const S=[{label:"正常",value:1},{label:"禁用",value:2}];return(e,a)=>{const l=t("el-input"),o=t("el-form-item"),g=t("el-radio"),j=t("el-radio-group"),w=t("el-input-number"),h=t("el-button"),q=t("el-form"),C=s("loading");return r((m(),d(q,{model:u(v),"label-width":"120px",ref_key:"form",ref:x,class:"pr-4"},{default:n((()=>[i(o,{label:"岗位名称",prop:"job_name",rules:[{required:!0,message:"岗位名称必须填写"}]},{default:n((()=>[i(l,{modelValue:u(v).job_name,"onUpdate:modelValue":a[0]||(a[0]=e=>u(v).job_name=e),name:"job_name",clearable:""},null,8,["modelValue"])])),_:1}),i(o,{label:"岗位编码",prop:"coding"},{default:n((()=>[i(l,{modelValue:u(v).coding,"onUpdate:modelValue":a[1]||(a[1]=e=>u(v).coding=e),name:"coding",clearable:""},null,8,["modelValue"])])),_:1}),i(o,{label:"状态",prop:"status"},{default:n((()=>[i(j,{modelValue:u(v).status,"onUpdate:modelValue":a[2]||(a[2]=e=>u(v).status=e)},{default:n((()=>[(m(),p(c,null,b(S,(e=>i(g,{key:e.value,label:e.value,name:"status"},{default:n((()=>[f(_(e.label),1)])),_:2},1032,["label"]))),64))])),_:1},8,["modelValue"])])),_:1}),i(o,{label:"排序",prop:"sort"},{default:n((()=>[i(w,{modelValue:u(v).sort,"onUpdate:modelValue":a[3]||(a[3]=e=>u(v).sort=e),name:"sort",min:1},null,8,["modelValue"])])),_:1}),i(o,{label:"岗位描述",prop:"description"},{default:n((()=>[i(l,{modelValue:u(v).description,"onUpdate:modelValue":a[4]||(a[4]=e=>u(v).description=e),name:"description",clearable:"",type:"textarea"},null,8,["modelValue"])])),_:1}),V("div",y,[i(h,{type:"primary",onClick:a[5]||(a[5]=e=>u(k)(u(x)))},{default:n((()=>[f(_(e.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model"])),[[C,u(U)]])}}});export{g as _};
