import{E as y,a as x}from"./el-form-item-Ct_zBuY0.js";import{E as k}from"./index-CbmPSBt0.js";import{E as U}from"./index-CCavIuTY.js";import{E as C,a as B}from"./el-select-C59URVI0.js";import{a as F,E as I}from"./el-checkbox-Ci1DH0Aj.js";import{E as N,b as R}from"./el-radio-group-B7nPUe8-.js";import{d as G,c as f,q as M,s as o,w as l,o as _,x as r,M as O,ad as S,aa as q,f as z,v as A,y as D,z as L,db as T,A as $}from"./index-CGB0A5x_.js";/* empty css                          */import"./el-scrollbar-p6_f_LH2.js";import"./el-popper-DvBtRO32.js";import"./el-tag-C_D80BPW.js";import{_ as j}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./castArray-Cgg396Sr.js";import"./_baseClone-CX1E8HTZ.js";import"./raf-CCivjDro.js";import"./index-D2-3cnGo.js";import"./index-DMVRI44M.js";import"./index-BPwPlcbL.js";import"./vnode-DFpZw5lG.js";import"./index-khuXz7sd.js";import"./scroll-C0BSy_Rk.js";import"./clamp-BqqU4KQ-.js";import"./toNumber-IRhFg6gN.js";import"./_baseIteratee-uVh0OyD5.js";import"./omit-DaFv1hTo.js";const H={class:"user-create"},J=G({__name:"UserCreateView",setup(K){const d=A(),n=D(!1),a=L({username:"",display_name:"",password:"platform123",role:"viewer",status:"active",permissions:["dashboard"]}),b=["dashboard","fine-tune","model-eval","model-inference","model-manage","dataset","data-process","data-convert","compute","hardware","logs","user-settings"];async function V(){n.value=!0;try{await T(a),$.success("用户已创建"),d.push("/user-settings")}finally{n.value=!1}}return(P,e)=>{const m=k,s=x,u=B,v=C,p=R,c=N,E=I,w=F,i=U,g=y;return _(),f("section",H,[e[11]||(e[11]=M("h1",null,"创建用户",-1)),o(g,{model:a,"label-width":"110px",class:"user-form"},{default:l(()=>[o(s,{label:"账号"},{default:l(()=>[o(m,{modelValue:a.username,"onUpdate:modelValue":e[0]||(e[0]=t=>a.username=t)},null,8,["modelValue"])]),_:1}),o(s,{label:"显示名称"},{default:l(()=>[o(m,{modelValue:a.display_name,"onUpdate:modelValue":e[1]||(e[1]=t=>a.display_name=t)},null,8,["modelValue"])]),_:1}),o(s,{label:"初始密码"},{default:l(()=>[o(m,{modelValue:a.password,"onUpdate:modelValue":e[2]||(e[2]=t=>a.password=t),type:"password","show-password":""},null,8,["modelValue"])]),_:1}),o(s,{label:"角色"},{default:l(()=>[o(v,{modelValue:a.role,"onUpdate:modelValue":e[3]||(e[3]=t=>a.role=t)},{default:l(()=>[o(u,{label:"管理员",value:"admin"}),o(u,{label:"操作员",value:"operator"}),o(u,{label:"观察员",value:"viewer"})]),_:1},8,["modelValue"])]),_:1}),o(s,{label:"状态"},{default:l(()=>[o(c,{modelValue:a.status,"onUpdate:modelValue":e[4]||(e[4]=t=>a.status=t)},{default:l(()=>[o(p,{value:"active"},{default:l(()=>[...e[7]||(e[7]=[r("启用",-1)])]),_:1}),o(p,{value:"disabled"},{default:l(()=>[...e[8]||(e[8]=[r("禁用",-1)])]),_:1})]),_:1},8,["modelValue"])]),_:1}),o(s,{label:"页面权限"},{default:l(()=>[o(w,{modelValue:a.permissions,"onUpdate:modelValue":e[5]||(e[5]=t=>a.permissions=t)},{default:l(()=>[(_(),f(O,null,S(b,t=>o(E,{key:t,value:t},{default:l(()=>[r(q(t),1)]),_:2},1032,["value"])),64))]),_:1},8,["modelValue"])]),_:1}),o(s,null,{default:l(()=>[o(i,{onClick:e[6]||(e[6]=t=>z(d).back())},{default:l(()=>[...e[9]||(e[9]=[r("返回",-1)])]),_:1}),o(i,{type:"primary",loading:n.value,onClick:V},{default:l(()=>[...e[10]||(e[10]=[r("保存",-1)])]),_:1},8,["loading"])]),_:1})]),_:1},8,["model"])])}}}),Ee=j(J,[["__scopeId","data-v-af832a20"]]);export{Ee as default};
