chore: 重新编译前端产物(补装CodeMirror依赖)
This commit is contained in:
1 parent
23e9e3da62
commit
4e384ca401
115 files changed
+147
-147
No files matched your search
@@ -0,0 +1,2 @@
|
||||
import{r as n,j as s}from"./vendor-codemirror-B1SGo4xl.js";import{u as K,D as J,a as X,b as Y,c as Z,d as ss,e as os,B as x,ax as ve,f as Ws,t as H,j as Hs,l as $,k as De}from"./index-Dungj95X.js";import{T as fe,a as Le,b as Gs,c as Ks}from"./tabs-D87nAyJR.js";import{B as cs}from"./badge-CGJlVD3L.js";import{C as ys,a as gs,b as fs,c as Ls,d as Ts}from"./card-BIfzBCEy.js";import{I as D}from"./input-CXoUQQLm.js";import{T as Es,a as zs,b as es,c as C,d as $s,e as w}from"./table-B2F10oba.js";import{S as Rs,a as Is,b as _s,c as Fs,d as G}from"./select-CiTqGGhE.js";import{U as le,ag as Bs,aJ as ws,ah as Qs,v as de,y as qs,a as Js,N as Xs,L as Ss,R as Ys,S as Te,P as Zs,ar as we,aq as Ue,x as pe,T as se,j as ee,aO as te,ax as Ce,Q as Me,V as ie,a3 as ke,aw as Re,p as xe}from"./vendor-icons-DmqcWdzX.js";import{T as Ie}from"./textarea-BxfjmLq5.js";import{L as bs}from"./label-CMpUoC87.js";import{C as _e}from"./checkbox-Bu55mX0G.js";import{S as Ds}from"./switch-Bxiq4EHp.js";import{u as Fe}from"./use-toast-DNZLibQY.js";import"./index-5FEebgvX.js";function Oe({open:e,onOpenChange:l,editingUser:t,form:a,setForm:m,saving:p,onSubmit:b}){const[f,S]=n.useState([]);return n.useEffect(()=>{if(!e)return;let c=!1;return(async()=>{try{const L=await K.getRoles();if(c)return;const h=L?.list??[];S(h.map(y=>({id:String(y.id??""),name:y.name??y.code??""})))}catch{c||S([])}})(),()=>{c=!0}},[e]),s.jsx(J,{"code-path":"src/components/system/UserFormDialog.tsx:79:5",open:e,onOpenChange:l,children:s.jsxs(X,{"code-path":"src/components/system/UserFormDialog.tsx:80:7",className:"bg-slate-900 border-slate-800",children:[s.jsxs(Y,{"code-path":"src/components/system/UserFormDialog.tsx:81:9",children:[s.jsxs(Z,{"code-path":"src/components/system/UserFormDialog.tsx:82:11",className:"text-slate-100 flex items-center gap-2",children:[s.jsx(le,{"code-path":"src/components/system/UserFormDialog.tsx:83:13",className:"h-5 w-5 text-blue-400"}),t?"编辑用户":"新建用户"]}),s.jsx(ss,{"code-path":"src/components/system/UserFormDialog.tsx:86:11",className:"text-slate-500",children:t?"修改用户信息":"创建新的系统用户"})]}),s.jsxs("div",{"code-path":"src/components/system/UserFormDialog.tsx:91:9",className:"space-y-4",children:[s.jsxs("div",{"code-path":"src/components/system/UserFormDialog.tsx:92:11",className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{"code-path":"src/components/system/UserFormDialog.tsx:93:13",className:"space-y-2",children:[s.jsx("label",{"code-path":"src/components/system/UserFormDialog.tsx:94:15",className:"text-xs text-slate-500",children:"用户名"}),s.jsx(D,{"code-path":"src/components/system/UserFormDialog.tsx:95:15",value:a.username,onChange:c=>m({...a,username:c.target.value}),disabled:!!t,className:"bg-slate-800/50 border-slate-700 text-slate-200 placeholder:text-slate-500",placeholder:"登录用户名"})]}),s.jsxs("div",{"code-path":"src/components/system/UserFormDialog.tsx:103:13",className:"space-y-2",children:[s.jsx("label",{"code-path":"src/components/system/UserFormDialog.tsx:104:15",className:"text-xs text-slate-500",children:"昵称"}),s.jsx(D,{"code-path":"src/components/system/UserFormDialog.tsx:105:15",value:a.nickname,onChange:c=>m({...a,nickname:c.target.value}),className:"bg-slate-800/50 border-slate-700 text-slate-200 placeholder:text-slate-500",placeholder:"显示昵称"})]}),s.jsxs("div",{"code-path":"src/components/system/UserFormDialog.tsx:112:13",className:"space-y-2",children:[s.jsx("label",{"code-path":"src/components/system/UserFormDialog.tsx:113:15",className:"text-xs text-slate-500",children:"邮箱"}),s.jsx(D,{"code-path":"src/components/system/UserFormDialog.tsx:114:15",value:a.email,onChange:c=>m({...a,email:c.target.value}),className:"bg-slate-800/50 border-slate-700 text-slate-200 placeholder:text-slate-500",placeholder:"user@example.com"})]}),s.jsxs("div",{"code-path":"src/components/system/UserFormDialog.tsx:121:13",className:"space-y-2",children:[s.jsx("label",{"code-path":"src/components/system/UserFormDialog.tsx:122:15",className:"text-xs text-slate-500",children:"手机号"}),s.jsx(D,{"code-path":"src/components/system/UserFormDialog.tsx:123:15",value:a.phone,onChange:c=>m({...a,phone:c.target.value}),className:"bg-slate-800/50 border-slate-700 text-slate-200 placeholder:text-slate-500",placeholder:"可选"})]}),s.jsxs("div",{"code-path":"src/components/system/UserFormDialog.tsx:130:13",className:"space-y-2",children:[s.jsx("label",{"code-path":"src/components/system/UserFormDialog.tsx:131:15",className:"text-xs text-slate-500",children:"角色"}),s.jsxs(Rs,{"code-path":"src/components/system/UserFormDialog.tsx:132:15",value:a.role,onValueChange:c=>m({...a,role:c}),children:[s.jsx(Is,{"code-path":"src/components/system/UserFormDialog.tsx:133:17",className:"bg-slate-800/50 border-slate-700 text-slate-200",children:s.jsx(_s,{"code-path":"src/components/system/UserFormDialog.tsx:134:19",placeholder:"选择角色"})}),s.jsx(Fs,{"code-path":"src/components/system/UserFormDiLine truncated
|
||||
`).filter(v=>v.trim()&&!v.startsWith(""));if(ms.length<2)return;const xs=ms[0].split(",").map(v=>v.trim().toLowerCase()),Os=xs.findIndex(v=>v.includes("用户名")||v.includes("username")),Us=xs.findIndex(v=>v.includes("昵称")||v.includes("name")||v.includes("显示名")),Ps=xs.findIndex(v=>v.includes("邮箱")||v.includes("email")||v.includes("mail")),us=xs.findIndex(v=>v.includes("手机")||v.includes("phone")),Ns=xs.findIndex(v=>v.includes("角色")||v.includes("role")),vs=xs.findIndex(v=>v.includes("密码")||v.includes("password")),Cs=[];for(let v=1;v<ms.length;v++){const rs=ms[v].split(",").map(Ms=>Ms.trim());Cs.push({username:Os>=0?rs[Os]:"",nickname:Us>=0?rs[Us]:"",email:Ps>=0?rs[Ps]:"",phone:us>=0?rs[us]:"",role:Ns>=0?rs[Ns]:"",password:vs>=0?rs[vs]:""})}Q(Cs),F(null)},is.readAsText(ns,"UTF-8")},as=async()=>{U.setImporting(!0);try{const i=await K.batchImport({users:V,skip_existing:!0});F(i),await W()}catch(i){F({code:500,message:i?.message||"导入失败"})}finally{U.setImporting(!1)}};return s.jsxs("div",{"code-path":"src/components/system/SystemManager.tsx:234:5",className:"space-y-6",children:[s.jsx("div",{"code-path":"src/components/system/SystemManager.tsx:236:7",className:"flex items-center justify-between",children:s.jsxs("div",{"code-path":"src/components/system/SystemManager.tsx:237:9",children:[s.jsx("h1",{"code-path":"src/components/system/SystemManager.tsx:238:11",className:"text-2xl font-bold text-slate-100",children:"系统管理"}),s.jsx("p",{"code-path":"src/components/system/SystemManager.tsx:239:11",className:"text-sm text-slate-500 mt-1",children:"用户、权限与系统配置"})]})}),s.jsxs(fe,{"code-path":"src/components/system/SystemManager.tsx:244:7",value:a,onValueChange:m,className:"w-full",children:[s.jsxs(Le,{"code-path":"src/components/system/SystemManager.tsx:245:9",className:"bg-slate-800 border border-slate-700",children:[s.jsxs(Gs,{"code-path":"src/components/system/SystemManager.tsx:246:11",value:"users",className:"data-[state=active]:bg-slate-700",children:[s.jsx(ie,{"code-path":"src/components/system/SystemManager.tsx:247:13",className:"h-4 w-4 mr-2"}),"用户管理"]}),s.jsxs(Gs,{"code-path":"src/components/system/SystemManager.tsx:250:11",value:"roles",className:"data-[state=active]:bg-slate-700",children:[s.jsx(ee,{"code-path":"src/components/system/SystemManager.tsx:251:13",className:"h-4 w-4 mr-2"}),"角色权限"]}),s.jsxs(Gs,{"code-path":"src/components/system/SystemManager.tsx:254:11",value:"settings",className:"data-[state=active]:bg-slate-700",children:[s.jsx(xe,{"code-path":"src/components/system/SystemManager.tsx:255:13",className:"h-4 w-4 mr-2"}),"系统设置"]})]}),s.jsx(Ks,{"code-path":"src/components/system/SystemManager.tsx:260:9",value:"users",className:"mt-4 space-y-4",children:s.jsx(ze,{"code-path":"src/components/system/SystemManager.tsx:261:11",searchQuery:p,setSearchQuery:b,filteredUsers:ls,loading:c,selectedUser:h,setSelectedUser:y,getUserStatusBadge:ds,dialogOpen:M,setDialogOpen:E,editingUser:k,form:r,setForm:I,saving:ts,handleSubmit:A,openCreate:q,openEdit:ps,handleDelete:T,onResetPassword:i=>{y(null),j(i)},importDialogOpen:u,setImportDialogOpen:_,importPreview:V,setImportPreview:Q,importing:U.importing,importResult:hs,setImportResult:F,handleCsvUpload:O,handleBatchImport:as,ldapUsers:U.ldapUsers,ldapSelected:U.ldapSelected,setLdapSelected:U.setLdapSelected,ldapLoading:U.ldapLoading,ldapImportOUs:U.ldapImportOUs,ldapImportOUDN:U.ldapImportOUDN,setLdapImportOUDN:U.setLdapImportOUDN,loadLdapUsers:U.loadLdapUsers,handleLdapImport:U.handleLdapImport,setLdapUsers:U.setLdapUsers})}),s.jsx(Ks,{"code-path":"src/components/system/SystemManager.tsx:302:9",value:"roles",className:"mt-4 space-y-4",children:s.jsx(We,{"code-path":"src/components/system/SystemManager.tsx:303:11",selectedRole:g,setSelectedRole:P})}),s.jsx(Ks,{"code-path":"src/components/system/SystemManager.tsx:309:9",value:"settings",className:"mt-4",children:s.jsx(Xe,{"code-path":"src/components/system/SystemManager.tsx:310:11",...U.settingsTabProps})})]}),s.jsx(Ye,{"code-path":"src/components/system/SystemManager.tsx:314:7",user:N,onClose:()=>j(null)})]})}export{St as SystemManager};
|
||||
Reference in new issue
Block a user