import{E as y,a as x}from"./el-form-item-D5kF3B90.js";import{E as k}from"./index-TFUf94PZ.js";import{E as U}from"./index-BjEW7-SA.js";import{E as C,a as B}from"./el-select-Dl-FRZQd.js";import{a as F,E as I}from"./el-checkbox-qGZ2-RM2.js";import{E as N,b as R}from"./el-radio-group-BkCoTeQL.js";import{d as G,c as _,q as M,s as o,w as l,o as f,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-BKKvzUDD.js";/* empty css                          */import"./el-scrollbar-ClJnvz-9.js";import"./el-popper-D6_hxRbQ.js";/* empty css               */import{_ as j}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./castArray-5uErZEc3.js";import"./_baseClone-B5RBzbh5.js";import"./raf-C-x62Pcl.js";import"./index-DLzof2Fz.js";import"./index-GAnQrJsQ.js";import"./index-CWUnzf90.js";import"./vnode-78qeDweP.js";import"./index-D5ryD3I5.js";import"./index-BDEF353-.js";import"./scroll-BkzZKETR.js";import"./clamp-CbbY8h6F.js";import"./toNumber-Dkj3QRv9.js";import"./_baseIteratee-BAilevJ_.js";import"./omit-BTSq4AYh.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"])])}}}),we=j(J,[["__scopeId","data-v-57777381"]]);export{we as default};
