Compare commits
No commits in common. "e4745ae78923c72847b8429bc45c8de81baf028b" and "62f1343c3b7a2f11f35948148de00731be776f87" have entirely different histories.
e4745ae789
...
62f1343c3b
@ -1,16 +1,8 @@
|
|||||||
import type { Recordable } from '@vben/types';
|
|
||||||
|
|
||||||
import { h } from 'vue';
|
import { h } from 'vue';
|
||||||
|
|
||||||
import { IconifyIcon } from '@vben/icons';
|
|
||||||
import { $te } from '@vben/locales';
|
|
||||||
import { setupVbenVxeTable, useVbenVxeGrid } from '@vben/plugins/vxe-table';
|
import { setupVbenVxeTable, useVbenVxeGrid } from '@vben/plugins/vxe-table';
|
||||||
import { get, isFunction, isString } from '@vben/utils';
|
|
||||||
|
|
||||||
import { objectOmit } from '@vueuse/core';
|
import { Button, Image } from 'ant-design-vue';
|
||||||
import { Button, Image, Popconfirm, Switch, Tag } from 'ant-design-vue';
|
|
||||||
|
|
||||||
import { $t } from '#/locales';
|
|
||||||
|
|
||||||
import { useVbenForm } from './form';
|
import { useVbenForm } from './form';
|
||||||
|
|
||||||
@ -52,25 +44,6 @@ setupVbenVxeTable({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
vxeUI.renderer.add('CellTag', {
|
|
||||||
renderTableDefault({ options, props }, { column, row }) {
|
|
||||||
const value = get(row, column.field);
|
|
||||||
const tagOptions = options ?? [
|
|
||||||
{ color: 'success', label: $t('common.enabled'), value: true },
|
|
||||||
{ color: 'error', label: $t('common.disabled'), value: false },
|
|
||||||
];
|
|
||||||
const tagItem = tagOptions.find((item) => item.value === value);
|
|
||||||
return h(
|
|
||||||
Tag,
|
|
||||||
{
|
|
||||||
...props,
|
|
||||||
...objectOmit(tagItem ?? {}, ['label']),
|
|
||||||
},
|
|
||||||
{ default: () => tagItem?.label ?? value },
|
|
||||||
);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// 表格配置项可以用 cellRender: { name: 'CellLink' },
|
// 表格配置项可以用 cellRender: { name: 'CellLink' },
|
||||||
vxeUI.renderer.add('CellLink', {
|
vxeUI.renderer.add('CellLink', {
|
||||||
renderTableDefault(renderOpts) {
|
renderTableDefault(renderOpts) {
|
||||||
@ -82,181 +55,6 @@ setupVbenVxeTable({
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
vxeUI.renderer.add('CellSwitch', {
|
|
||||||
renderTableDefault({ attrs, props }, { column, row }) {
|
|
||||||
const loadingKey = `__loading_${column.field}`;
|
|
||||||
const finallyProps = {
|
|
||||||
checkedChildren: $t('common.enabled'),
|
|
||||||
checkedValue: true,
|
|
||||||
unCheckedChildren: $t('common.disabled'),
|
|
||||||
unCheckedValue: false,
|
|
||||||
...props,
|
|
||||||
checked: row[column.field],
|
|
||||||
loading: row[loadingKey] ?? false,
|
|
||||||
'onUpdate:checked': onChange,
|
|
||||||
};
|
|
||||||
async function onChange(newVal: any) {
|
|
||||||
row[loadingKey] = true;
|
|
||||||
try {
|
|
||||||
const result = await attrs?.beforeChange?.(newVal, row);
|
|
||||||
if (result !== false) {
|
|
||||||
row[column.field] = newVal;
|
|
||||||
}
|
|
||||||
} finally {
|
|
||||||
row[loadingKey] = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return h(Switch, finallyProps);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
/**
|
|
||||||
* 注册表格的操作按钮渲染器
|
|
||||||
*/
|
|
||||||
vxeUI.renderer.add('CellOperation', {
|
|
||||||
renderTableDefault({ attrs, options, props }, { column, row }) {
|
|
||||||
const defaultProps = { size: 'small', type: 'link', ...props };
|
|
||||||
let align = 'end';
|
|
||||||
switch (column.align) {
|
|
||||||
case 'center': {
|
|
||||||
align = 'center';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'left': {
|
|
||||||
align = 'start';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
default: {
|
|
||||||
align = 'end';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const presets: Recordable<Recordable<any>> = {
|
|
||||||
delete: {
|
|
||||||
danger: true,
|
|
||||||
text: $t('common.delete'),
|
|
||||||
},
|
|
||||||
edit: {
|
|
||||||
text: $t('common.edit'),
|
|
||||||
},
|
|
||||||
};
|
|
||||||
const operations: Array<Recordable<any>> = (
|
|
||||||
options || ['edit', 'delete']
|
|
||||||
)
|
|
||||||
.map((opt) => {
|
|
||||||
if (isString(opt)) {
|
|
||||||
return presets[opt]
|
|
||||||
? { code: opt, ...presets[opt], ...defaultProps }
|
|
||||||
: {
|
|
||||||
code: opt,
|
|
||||||
text: $te(`common.${opt}`) ? $t(`common.${opt}`) : opt,
|
|
||||||
...defaultProps,
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
return { ...defaultProps, ...presets[opt.code], ...opt };
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.map((opt) => {
|
|
||||||
const optBtn: Recordable<any> = {};
|
|
||||||
Object.keys(opt).forEach((key) => {
|
|
||||||
optBtn[key] = isFunction(opt[key]) ? opt[key](row) : opt[key];
|
|
||||||
});
|
|
||||||
return optBtn;
|
|
||||||
})
|
|
||||||
.filter((opt) => opt.show !== false);
|
|
||||||
|
|
||||||
function renderBtn(opt: Recordable<any>, listen = true) {
|
|
||||||
return h(
|
|
||||||
Button,
|
|
||||||
{
|
|
||||||
...props,
|
|
||||||
...opt,
|
|
||||||
icon: undefined,
|
|
||||||
onClick: listen
|
|
||||||
? () =>
|
|
||||||
attrs?.onClick?.({
|
|
||||||
code: opt.code,
|
|
||||||
row,
|
|
||||||
})
|
|
||||||
: undefined,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
default: () => {
|
|
||||||
const content = [];
|
|
||||||
if (opt.icon) {
|
|
||||||
content.push(
|
|
||||||
h(IconifyIcon, { class: 'size-5', icon: opt.icon }),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
content.push(opt.text);
|
|
||||||
return content;
|
|
||||||
},
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function renderConfirm(opt: Recordable<any>) {
|
|
||||||
let viewportWrapper: HTMLElement | null = null;
|
|
||||||
return h(
|
|
||||||
Popconfirm,
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 当popconfirm用在固定列中时,将固定列作为弹窗的容器时可能会因为固定列较窄而无法容纳弹窗
|
|
||||||
* 将表格主体区域作为弹窗容器时又会因为固定列的层级较高而遮挡弹窗
|
|
||||||
* 将body或者表格视口区域作为弹窗容器时又会导致弹窗无法跟随表格滚动。
|
|
||||||
* 鉴于以上各种情况,一种折中的解决方案是弹出层展示时,禁止操作表格的滚动条。
|
|
||||||
* 这样既解决了弹窗的遮挡问题,又不至于让弹窗随着表格的滚动而跑出视口区域。
|
|
||||||
*/
|
|
||||||
getPopupContainer(el) {
|
|
||||||
viewportWrapper = el.closest('.vxe-table--viewport-wrapper');
|
|
||||||
return document.body;
|
|
||||||
},
|
|
||||||
placement: 'topLeft',
|
|
||||||
title: $t('ui.actionTitle.delete', [attrs?.nameTitle || '']),
|
|
||||||
...props,
|
|
||||||
...opt,
|
|
||||||
icon: undefined,
|
|
||||||
onOpenChange: (open: boolean) => {
|
|
||||||
// 当弹窗打开时,禁止表格的滚动
|
|
||||||
if (open) {
|
|
||||||
viewportWrapper?.style.setProperty('pointer-events', 'none');
|
|
||||||
} else {
|
|
||||||
viewportWrapper?.style.removeProperty('pointer-events');
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onConfirm: () => {
|
|
||||||
attrs?.onClick?.({
|
|
||||||
code: opt.code,
|
|
||||||
row,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
default: () => renderBtn({ ...opt }, false),
|
|
||||||
description: () =>
|
|
||||||
h(
|
|
||||||
'div',
|
|
||||||
{ class: 'truncate' },
|
|
||||||
$t('ui.actionMessage.deleteConfirm', [
|
|
||||||
row[attrs?.nameField || 'name'],
|
|
||||||
]),
|
|
||||||
),
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
const btns = operations.map((opt) =>
|
|
||||||
opt.code === 'delete' ? renderConfirm(opt) : renderBtn(opt),
|
|
||||||
);
|
|
||||||
return h(
|
|
||||||
'div',
|
|
||||||
{
|
|
||||||
class: 'flex table-operations',
|
|
||||||
style: { justifyContent: align },
|
|
||||||
},
|
|
||||||
btns,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// 这里可以自行扩展 vxe-table 的全局配置,比如自定义格式化
|
// 这里可以自行扩展 vxe-table 的全局配置,比如自定义格式化
|
||||||
// vxeUI.formats.add
|
// vxeUI.formats.add
|
||||||
@ -265,12 +63,5 @@ setupVbenVxeTable({
|
|||||||
});
|
});
|
||||||
|
|
||||||
export { useVbenVxeGrid };
|
export { useVbenVxeGrid };
|
||||||
export type OnActionClickParams<T = Recordable<any>> = {
|
|
||||||
code: string;
|
|
||||||
row: T;
|
|
||||||
};
|
|
||||||
export type OnActionClickFn<T = Recordable<any>> = (
|
|
||||||
params: OnActionClickParams<T>,
|
|
||||||
) => void;
|
|
||||||
|
|
||||||
export type * from '@vben/plugins/vxe-table';
|
export type * from '@vben/plugins/vxe-table';
|
||||||
|
@ -15,6 +15,13 @@ export namespace ChatflowApi {
|
|||||||
files: [];
|
files: [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface MessagesRequest {
|
||||||
|
conversationId: string;
|
||||||
|
userId: string;
|
||||||
|
firstId: string;
|
||||||
|
limit: number;
|
||||||
|
}
|
||||||
|
|
||||||
export interface ChatListBody {
|
export interface ChatListBody {
|
||||||
userId: string;
|
userId: string;
|
||||||
lastId: string;
|
lastId: string;
|
||||||
@ -57,9 +64,12 @@ export async function getChatList(
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// export function stopChatflow(data){
|
export async function getMessages(
|
||||||
// return requestClient.post('/v1/chat/stopMessagesStream', data);
|
appId: string,
|
||||||
// };
|
data: ChatflowApi.MessagesRequest,
|
||||||
|
) {
|
||||||
|
return requestClient.post(`/v1/chat/messages/${appId}`, data);
|
||||||
|
}
|
||||||
//
|
//
|
||||||
// export function getChatflowList(data){
|
// export function getChatflowList(data){
|
||||||
// return requestClient.post('/v1/chat/messages', data);
|
// return requestClient.post('/v1/chat/messages', data);
|
||||||
|
@ -1,76 +0,0 @@
|
|||||||
import { requestClient } from '#/api/request';
|
|
||||||
|
|
||||||
export namespace DeptApi {
|
|
||||||
export interface Dept {
|
|
||||||
remark: string;
|
|
||||||
createTime: string;
|
|
||||||
name: string;
|
|
||||||
enabled: string;
|
|
||||||
id: string;
|
|
||||||
children?: Dept[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DeptRecord extends Dept {
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface DeptTreeData {
|
|
||||||
id: number;
|
|
||||||
label: string;
|
|
||||||
children?: DeptTreeData[];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 添加部门
|
|
||||||
export function createDept(data: DeptApi.Dept) {
|
|
||||||
return requestClient.post(`/rest/dept`, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新部门信息
|
|
||||||
export function updateDept(id: string, data: DeptApi.DeptRecord) {
|
|
||||||
return requestClient.patch(`/rest/dept/${id}`, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除部门
|
|
||||||
export function removeDept(id: string) {
|
|
||||||
return requestClient.delete(`/rest/dept/${id}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 模糊查询获取部门列表
|
|
||||||
export function queryDeptList(data: DeptApi.DeptRecord) {
|
|
||||||
return requestClient.get('/rest/dept', { data });
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取部门列表
|
|
||||||
export function deptList() {
|
|
||||||
return requestClient.get(`/rest/dept`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 启用状态
|
|
||||||
export function enabledDept(id: string) {
|
|
||||||
return requestClient.patch(`/rest/dept/toggle/${id}`, id);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getAllDeptTree(id?: number | string) {
|
|
||||||
return requestClient.get('/rest/dept/tree', { params: { id } });
|
|
||||||
}
|
|
||||||
|
|
||||||
// export function getDeptTree(params?: Partial<DeptRecord>) {
|
|
||||||
// return axios.get<DeptRecord[]>(`/dept/trees`, {
|
|
||||||
// params,
|
|
||||||
// paramsSerializer: (obj) => {
|
|
||||||
// return qs.stringify(obj);
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// export function listDepts(params?: ListParams<Partial<DeptRecord>>) {
|
|
||||||
// return axios.get<DeptRecord[]>(`/dept`, {
|
|
||||||
// params,
|
|
||||||
// paramsSerializer: (obj) => {
|
|
||||||
// return qs.stringify(obj);
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// export function queryDepts(params?: ListParams<Partial<DeptRecord>>) {
|
|
||||||
// return queryList(`/dept`, params);
|
|
||||||
// }
|
|
@ -1,8 +1,6 @@
|
|||||||
export * from './auth';
|
export * from './auth';
|
||||||
export * from './chatflow';
|
export * from './chatflow';
|
||||||
export * from './dept';
|
|
||||||
export * from './menu';
|
export * from './menu';
|
||||||
export * from './role';
|
|
||||||
export * from './server';
|
export * from './server';
|
||||||
export * from './user';
|
export * from './user';
|
||||||
export * from './workflow';
|
export * from './workflow';
|
||||||
|
@ -1,74 +0,0 @@
|
|||||||
import { requestClient } from '#/api/request';
|
|
||||||
|
|
||||||
export namespace RoleApi {
|
|
||||||
export interface Role {
|
|
||||||
[key: string]: any;
|
|
||||||
name: string;
|
|
||||||
dataScope: string;
|
|
||||||
enabled: boolean;
|
|
||||||
deptId: string;
|
|
||||||
remark?: string;
|
|
||||||
createBy: string;
|
|
||||||
menuIds: [];
|
|
||||||
createTime: string;
|
|
||||||
createId: string;
|
|
||||||
// authorities: (number | undefined)[];
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RoleListParams {
|
|
||||||
page: number;
|
|
||||||
size: number;
|
|
||||||
sort: string;
|
|
||||||
name?: string;
|
|
||||||
enabled?: boolean;
|
|
||||||
deptId?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RoleListRecord extends Role {
|
|
||||||
name: string;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 查询所有的角色列表、
|
|
||||||
export function queryRoleList(data: RoleApi.RoleListParams) {
|
|
||||||
// return axios.get('/rest/role',data);
|
|
||||||
return requestClient.get<Array<RoleApi.Role>>('/rest/role', { params: data });
|
|
||||||
}
|
|
||||||
|
|
||||||
// 切换启用状态
|
|
||||||
export function enabledRole(id: string) {
|
|
||||||
return requestClient.patch(`/rest/role/${id}/toggle`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除
|
|
||||||
export function removeRole(id: string) {
|
|
||||||
return requestClient.delete(`/rest/role/${id}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 添加
|
|
||||||
export function createRole(data: RoleApi.Role) {
|
|
||||||
return requestClient.post(`/rest/role`, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新
|
|
||||||
export function updateRole(id: any, data: RoleApi.Role) {
|
|
||||||
return requestClient.patch(`/rest/role/${id}`, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取详情
|
|
||||||
export function roleDetail(id: string) {
|
|
||||||
return requestClient.get<RoleApi.Role>(`/rest/role/${id}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
export const queryMenuList = (data: string) => {
|
|
||||||
return requestClient.get('/rest/menu/tree', {
|
|
||||||
params: {
|
|
||||||
name: data,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
// export function queryRoles(params?: ListParams<Partial<Role>>) {
|
|
||||||
// return queryList<Role>(`/rest/role/query`, params);
|
|
||||||
// }
|
|
@ -26,73 +26,6 @@ export namespace UserApi {
|
|||||||
user: string | UserInfo;
|
user: string | UserInfo;
|
||||||
csrf: CsrfTokenResult;
|
csrf: CsrfTokenResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Res {
|
|
||||||
code: number;
|
|
||||||
data: object;
|
|
||||||
msg: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 重置密码数据
|
|
||||||
export interface PasswordReSetModel {
|
|
||||||
oldPassword: string;
|
|
||||||
password: string;
|
|
||||||
confirmPassword: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RoleCreateRecord {
|
|
||||||
name: string;
|
|
||||||
dataScope: string;
|
|
||||||
permissionIds: (number | undefined)[];
|
|
||||||
remark: string;
|
|
||||||
authorities: (number | undefined)[];
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface RoleRecord extends RoleCreateRecord {
|
|
||||||
id: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 添加用户数据
|
|
||||||
export interface CreateRecord {
|
|
||||||
value: any;
|
|
||||||
code: any;
|
|
||||||
username: string;
|
|
||||||
nickName: string;
|
|
||||||
password: string;
|
|
||||||
phone: string;
|
|
||||||
email: string;
|
|
||||||
enabled: string;
|
|
||||||
address: string;
|
|
||||||
roleIds: RoleRecord | string[] | undefined;
|
|
||||||
permissionIds: (number | undefined)[];
|
|
||||||
authorities: string[];
|
|
||||||
}
|
|
||||||
|
|
||||||
// 用户数据
|
|
||||||
export interface UserRecord extends CreateRecord {
|
|
||||||
value: any;
|
|
||||||
id?: string;
|
|
||||||
avatar?: string;
|
|
||||||
createAt?: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface User {
|
|
||||||
username?: string;
|
|
||||||
nickName?: string;
|
|
||||||
name: string;
|
|
||||||
avatar?: string;
|
|
||||||
email?: string;
|
|
||||||
phone?: string;
|
|
||||||
address?: string;
|
|
||||||
createAt?: string;
|
|
||||||
remark?: string;
|
|
||||||
id?: number;
|
|
||||||
role?: RoleRecord;
|
|
||||||
roles?: RoleRecord[];
|
|
||||||
// permissions?: string[] | '' | '*' | 'admin' | 'user' | 'auditor';
|
|
||||||
permissions?: string[] | undefined;
|
|
||||||
authorities?: string[];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -101,66 +34,3 @@ export namespace UserApi {
|
|||||||
export async function getUserInfoApi() {
|
export async function getUserInfoApi() {
|
||||||
return requestClient.get<UserApi.UserResult>('/rest/user/me');
|
return requestClient.get<UserApi.UserResult>('/rest/user/me');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 更新密码
|
|
||||||
export function resetPassword(data: UserApi.PasswordReSetModel) {
|
|
||||||
return requestClient.patch('/rest/user/self/update-password', data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 注册用户
|
|
||||||
export function register(data: UserApi.CreateRecord) {
|
|
||||||
return requestClient.post('/rest/user/register', data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 新建用户
|
|
||||||
export function createUser(data: UserApi.CreateRecord) {
|
|
||||||
return requestClient.post('/rest/user', data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 用户切换角色
|
|
||||||
export function switchRole(id: number) {
|
|
||||||
return requestClient.patch(`/rest/user/switch/${id}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 模糊查询用户列表
|
|
||||||
export function queryUserList(params: any) {
|
|
||||||
return requestClient.get('/rest/user', { params });
|
|
||||||
}
|
|
||||||
|
|
||||||
// 根据id查询用户信息
|
|
||||||
export function userDetail(id: any) {
|
|
||||||
return requestClient.get(`/rest/user/${id}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 是否启用
|
|
||||||
export function enabledUser(id: any) {
|
|
||||||
return requestClient.patch(`/rest/user/${id}/toggle`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 删除用户
|
|
||||||
export function removeUser(id: string) {
|
|
||||||
return requestClient.delete(`/rest/user/${id}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 更新用户信息
|
|
||||||
export function updateUser(id: any, data: UserApi.UserRecord) {
|
|
||||||
return requestClient.patch<UserApi.Res>(`/rest/user/${id}`, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function selfUpdate(data: UserApi.User) {
|
|
||||||
return requestClient.patch<UserApi.Res>(`/rest/user/self`, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取个人用户信息
|
|
||||||
export function getUserInfo() {
|
|
||||||
return requestClient.get<UserApi.User>('/rest/user/self');
|
|
||||||
}
|
|
||||||
|
|
||||||
// 部门的审核员
|
|
||||||
export function deptAudit(id: string, roleId: string) {
|
|
||||||
return requestClient.get(`/rest/user/dept/${id}?roleId=${roleId}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getUserDetail(id: number) {
|
|
||||||
return requestClient.get<UserApi.User>(`/user/${id}`);
|
|
||||||
}
|
|
||||||
|
@ -74,6 +74,7 @@ function setupAccessGuard(router: Router) {
|
|||||||
|
|
||||||
// 没有访问权限,跳转登录页面
|
// 没有访问权限,跳转登录页面
|
||||||
if (to.fullPath !== LOGIN_PATH) {
|
if (to.fullPath !== LOGIN_PATH) {
|
||||||
|
console.log('没有访问权限,请登录');
|
||||||
return {
|
return {
|
||||||
path: LOGIN_PATH,
|
path: LOGIN_PATH,
|
||||||
// 如不需要,直接删除 query
|
// 如不需要,直接删除 query
|
||||||
@ -95,13 +96,11 @@ function setupAccessGuard(router: Router) {
|
|||||||
// 生成路由表
|
// 生成路由表
|
||||||
// 当前登录用户拥有的角色标识列表
|
// 当前登录用户拥有的角色标识列表
|
||||||
const userInfo = userStore.userInfo || (await authStore.fetchUserInfo());
|
const userInfo = userStore.userInfo || (await authStore.fetchUserInfo());
|
||||||
// const userRoles = userInfo.roles ?? [];
|
const userRoles = userInfo.roles ?? [];
|
||||||
// permissions Keven自定义
|
|
||||||
const permissions = userInfo.permissions ?? [];
|
|
||||||
|
|
||||||
// 生成菜单和路由
|
// 生成菜单和路由
|
||||||
const { accessibleMenus, accessibleRoutes } = await generateAccess({
|
const { accessibleMenus, accessibleRoutes } = await generateAccess({
|
||||||
roles: permissions,
|
roles: userRoles,
|
||||||
router,
|
router,
|
||||||
// 则会在菜单中显示,但是访问会被重定向到403
|
// 则会在菜单中显示,但是访问会被重定向到403
|
||||||
routes: accessRoutes,
|
routes: accessRoutes,
|
||||||
|
@ -9,7 +9,6 @@ const routes: RouteRecordRaw[] = [
|
|||||||
icon: 'mdi:home',
|
icon: 'mdi:home',
|
||||||
title: '首页',
|
title: '首页',
|
||||||
order: -1,
|
order: -1,
|
||||||
authority: ['dashboard'],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -11,7 +11,6 @@ const routes: RouteRecordRaw[] = [
|
|||||||
icon: SvgPPT,
|
icon: SvgPPT,
|
||||||
title: 'PPT自动生成',
|
title: 'PPT自动生成',
|
||||||
order: 3,
|
order: 3,
|
||||||
authority: ['dify:workflow:run'],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -11,7 +11,6 @@ const routes: RouteRecordRaw[] = [
|
|||||||
icon: SvgSpider,
|
icon: SvgSpider,
|
||||||
title: '数据爬取',
|
title: '数据爬取',
|
||||||
order: 1,
|
order: 1,
|
||||||
authority: ['dify:server:init'],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -1,50 +0,0 @@
|
|||||||
import type { RouteRecordRaw } from 'vue-router';
|
|
||||||
|
|
||||||
import { EosRole, IconSystem, MdiUser, RiDept } from '@vben/icons';
|
|
||||||
|
|
||||||
const routes: RouteRecordRaw[] = [
|
|
||||||
{
|
|
||||||
name: 'system',
|
|
||||||
path: '/system',
|
|
||||||
meta: {
|
|
||||||
icon: IconSystem,
|
|
||||||
title: '系统管理',
|
|
||||||
order: 4,
|
|
||||||
authority: ['system'],
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
name: 'role',
|
|
||||||
path: '/system/role',
|
|
||||||
component: () => import('#/views/role/list.vue'),
|
|
||||||
meta: {
|
|
||||||
icon: EosRole,
|
|
||||||
title: '角色管理',
|
|
||||||
authority: ['system:role'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'dept',
|
|
||||||
path: '/system/dept',
|
|
||||||
component: () => import('#/views/dept/list.vue'),
|
|
||||||
meta: {
|
|
||||||
icon: RiDept,
|
|
||||||
title: '部门管理',
|
|
||||||
authority: ['system:dept'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: 'user',
|
|
||||||
path: '/system/user',
|
|
||||||
component: () => import('#/views/user/list.vue'),
|
|
||||||
meta: {
|
|
||||||
icon: MdiUser,
|
|
||||||
title: '用户管理',
|
|
||||||
authority: ['system:user'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export default routes;
|
|
@ -11,7 +11,6 @@ const routes: RouteRecordRaw[] = [
|
|||||||
icon: SvgWord,
|
icon: SvgWord,
|
||||||
title: 'Word自动生成',
|
title: 'Word自动生成',
|
||||||
order: 2,
|
order: 2,
|
||||||
authority: ['dify:chat:send'],
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -51,8 +51,6 @@ export const useAuthStore = defineStore('auth', () => {
|
|||||||
realName: user.username,
|
realName: user.username,
|
||||||
username: user.username,
|
username: user.username,
|
||||||
roles: [user.role.name],
|
roles: [user.role.name],
|
||||||
// permissions Keven自定义
|
|
||||||
permissions: user.permissions,
|
|
||||||
homePath: '/home',
|
homePath: '/home',
|
||||||
token: csrf.token,
|
token: csrf.token,
|
||||||
};
|
};
|
||||||
|
@ -1,178 +0,0 @@
|
|||||||
import type { VxeTableGridOptions } from '@vben/plugins/vxe-table';
|
|
||||||
|
|
||||||
import type { VbenFormSchema } from '#/adapter/form';
|
|
||||||
import type { OnActionClickFn } from '#/adapter/vxe-table';
|
|
||||||
import type { DeptApi } from '#/api';
|
|
||||||
|
|
||||||
import { ref } from 'vue';
|
|
||||||
|
|
||||||
import { z } from '#/adapter/form';
|
|
||||||
import { getAllDeptTree } from '#/api';
|
|
||||||
import { $t } from '#/locales';
|
|
||||||
|
|
||||||
const treeData = ref([]);
|
|
||||||
|
|
||||||
function transformToTreeData(data: any) {
|
|
||||||
return data.map((item) => ({
|
|
||||||
value: item.id,
|
|
||||||
label: item.name,
|
|
||||||
...(item.children && { children: transformToTreeData(item.children) }),
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 使用示例
|
|
||||||
getAllDeptTree(1).then((res) => {
|
|
||||||
treeData.value = transformToTreeData(res);
|
|
||||||
});
|
|
||||||
/**
|
|
||||||
* 获取编辑表单的字段配置。如果没有使用多语言,可以直接export一个数组常量
|
|
||||||
*/
|
|
||||||
export function useSchema(): VbenFormSchema[] {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'name',
|
|
||||||
label: '部门名称',
|
|
||||||
rules: z.string(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'TreeSelect',
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
// api: getAllDeptTree(1),
|
|
||||||
treeData,
|
|
||||||
class: 'w-full',
|
|
||||||
labelField: 'name',
|
|
||||||
valueField: 'id',
|
|
||||||
childrenField: 'children',
|
|
||||||
},
|
|
||||||
fieldName: 'pid',
|
|
||||||
label: '上级部门',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'RadioGroup',
|
|
||||||
componentProps: {
|
|
||||||
buttonStyle: 'solid',
|
|
||||||
options: [
|
|
||||||
{ label: $t('common.enabled'), value: true },
|
|
||||||
{ label: $t('common.disabled'), value: false },
|
|
||||||
],
|
|
||||||
optionType: 'button',
|
|
||||||
},
|
|
||||||
defaultValue: true,
|
|
||||||
fieldName: 'enabled',
|
|
||||||
label: '状态',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Textarea',
|
|
||||||
componentProps: {
|
|
||||||
maxLength: 50,
|
|
||||||
rows: 3,
|
|
||||||
showCount: true,
|
|
||||||
},
|
|
||||||
fieldName: 'remark',
|
|
||||||
label: '备注',
|
|
||||||
rules: z.string().optional(),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
// export function useGridFormSchema(): VbenFormSchema[] {
|
|
||||||
// return [
|
|
||||||
// {
|
|
||||||
// component: 'Input',
|
|
||||||
// fieldName: 'name',
|
|
||||||
// label: '部门名称',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// component: 'Select',
|
|
||||||
// componentProps: {
|
|
||||||
// allowClear: true,
|
|
||||||
// options: [
|
|
||||||
// { label: $t('common.enabled'), value: true },
|
|
||||||
// { label: $t('common.disabled'), value: false },
|
|
||||||
// ],
|
|
||||||
// },
|
|
||||||
// fieldName: 'enable',
|
|
||||||
// label: '状态',
|
|
||||||
// },
|
|
||||||
// // {
|
|
||||||
// // component: 'Input',
|
|
||||||
// // fieldName: 'remark',
|
|
||||||
// // label: '备注',
|
|
||||||
// // },
|
|
||||||
// // {
|
|
||||||
// // component: 'RangePicker',
|
|
||||||
// // fieldName: 'createTime',
|
|
||||||
// // label: '创建时间',
|
|
||||||
// // },
|
|
||||||
// ];
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取表格列配置
|
|
||||||
* @description 使用函数的形式返回列数据而不是直接export一个Array常量,是为了响应语言切换时重新翻译表头
|
|
||||||
* @param onActionClick 表格操作按钮点击事件
|
|
||||||
*/
|
|
||||||
export function useColumns(
|
|
||||||
onActionClick?: OnActionClickFn<DeptApi.Dept>,
|
|
||||||
): VxeTableGridOptions<DeptApi.Dept>['columns'] {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
align: 'left',
|
|
||||||
field: 'name',
|
|
||||||
fixed: 'left',
|
|
||||||
title: '部门名称',
|
|
||||||
treeNode: true,
|
|
||||||
width: 150,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
cellRender: {
|
|
||||||
name: 'CellTag',
|
|
||||||
},
|
|
||||||
field: 'enabled',
|
|
||||||
title: '状态',
|
|
||||||
width: 100,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'remark',
|
|
||||||
title: '备注',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'createTime',
|
|
||||||
slots: { default: 'createTime' },
|
|
||||||
title: '创建时间',
|
|
||||||
width: 180,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: 'right',
|
|
||||||
cellRender: {
|
|
||||||
attrs: {
|
|
||||||
nameField: 'name',
|
|
||||||
nameTitle: '部门',
|
|
||||||
onClick: onActionClick,
|
|
||||||
},
|
|
||||||
name: 'CellOperation',
|
|
||||||
options: [
|
|
||||||
{
|
|
||||||
code: 'append',
|
|
||||||
text: '新增下级',
|
|
||||||
},
|
|
||||||
'edit', // 默认的编辑按钮
|
|
||||||
{
|
|
||||||
code: 'delete', // 默认的删除按钮
|
|
||||||
disabled: (row: DeptApi.Dept) => {
|
|
||||||
return !!(row.children && row.children.length > 0);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
field: 'operation',
|
|
||||||
fixed: 'right',
|
|
||||||
headerAlign: 'center',
|
|
||||||
showOverflow: false,
|
|
||||||
title: '操作',
|
|
||||||
width: 200,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,155 +0,0 @@
|
|||||||
<script lang="ts" setup>
|
|
||||||
import type {
|
|
||||||
OnActionClickParams,
|
|
||||||
VxeTableGridOptions,
|
|
||||||
} from '#/adapter/vxe-table';
|
|
||||||
import type { DeptApi } from '#/api';
|
|
||||||
|
|
||||||
import { Page, useVbenModal } from '@vben/common-ui';
|
|
||||||
import { Plus } from '@vben/icons';
|
|
||||||
|
|
||||||
import { Button, message } from 'ant-design-vue';
|
|
||||||
import dayjs from 'dayjs';
|
|
||||||
|
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
|
||||||
import { getAllDeptTree, removeDept } from '#/api';
|
|
||||||
import { $t } from '#/locales';
|
|
||||||
|
|
||||||
import { useColumns } from './data';
|
|
||||||
import Form from './modules/form.vue';
|
|
||||||
|
|
||||||
const [FormModal, formModalApi] = useVbenModal({
|
|
||||||
connectedComponent: Form,
|
|
||||||
destroyOnClose: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 编辑部门
|
|
||||||
* @param row
|
|
||||||
*/
|
|
||||||
function onEdit(row: DeptApi.Dept) {
|
|
||||||
formModalApi.setData(row).open();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加下级部门
|
|
||||||
* @param row
|
|
||||||
*/
|
|
||||||
function onAppend(row: DeptApi.Dept) {
|
|
||||||
formModalApi.setData({ pid: row.id }).open();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 创建新部门
|
|
||||||
*/
|
|
||||||
function onCreate() {
|
|
||||||
formModalApi.setData(null).open();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除部门
|
|
||||||
* @param row
|
|
||||||
*/
|
|
||||||
function onDelete(row: DeptApi.Dept) {
|
|
||||||
const hideLoading = message.loading({
|
|
||||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
|
||||||
duration: 0,
|
|
||||||
key: 'action_process_msg',
|
|
||||||
});
|
|
||||||
removeDept(row.id)
|
|
||||||
.then(() => {
|
|
||||||
message.success({
|
|
||||||
content: $t('ui.actionMessage.deleteSuccess', [row.name]),
|
|
||||||
key: 'action_process_msg',
|
|
||||||
});
|
|
||||||
refreshGrid();
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
hideLoading();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 表格操作按钮的回调函数
|
|
||||||
*/
|
|
||||||
function onActionClick({ code, row }: OnActionClickParams<DeptApi.Dept>) {
|
|
||||||
switch (code) {
|
|
||||||
case 'append': {
|
|
||||||
onAppend(row);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'delete': {
|
|
||||||
onDelete(row);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'edit': {
|
|
||||||
onEdit(row);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
|
||||||
// formOptions: {
|
|
||||||
// fieldMappingTime: [['createTime', ['startTime', 'endTime']]],
|
|
||||||
// schema: useGridFormSchema(),
|
|
||||||
// },
|
|
||||||
gridEvents: {},
|
|
||||||
gridOptions: {
|
|
||||||
columns: useColumns(onActionClick),
|
|
||||||
height: 'auto',
|
|
||||||
keepSource: true,
|
|
||||||
pagerConfig: {
|
|
||||||
enabled: false,
|
|
||||||
},
|
|
||||||
proxyConfig: {
|
|
||||||
ajax: {
|
|
||||||
query: async (_params) => {
|
|
||||||
const res = await getAllDeptTree(1);
|
|
||||||
return {
|
|
||||||
items: res,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
toolbarConfig: {
|
|
||||||
custom: true,
|
|
||||||
export: false,
|
|
||||||
refresh: { code: 'query' },
|
|
||||||
zoom: true,
|
|
||||||
},
|
|
||||||
treeConfig: {
|
|
||||||
parentField: 'pid',
|
|
||||||
rowField: 'id',
|
|
||||||
transform: false,
|
|
||||||
},
|
|
||||||
} as VxeTableGridOptions,
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 刷新表格
|
|
||||||
*/
|
|
||||||
function refreshGrid() {
|
|
||||||
gridApi.query();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<Page auto-content-height>
|
|
||||||
<FormModal @success="refreshGrid" />
|
|
||||||
<Grid table-title="部门列表">
|
|
||||||
<template #toolbar-tools>
|
|
||||||
<Button
|
|
||||||
type="primary"
|
|
||||||
@click="onCreate"
|
|
||||||
v-access:code="'system:dept:create'"
|
|
||||||
>
|
|
||||||
<Plus class="size-5" />
|
|
||||||
{{ $t('ui.actionTitle.create', ['部门']) }}
|
|
||||||
</Button>
|
|
||||||
</template>
|
|
||||||
<template #createTime="{ row }">
|
|
||||||
{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm') }}
|
|
||||||
</template>
|
|
||||||
</Grid>
|
|
||||||
</Page>
|
|
||||||
</template>
|
|
@ -1,78 +0,0 @@
|
|||||||
<script lang="ts" setup>
|
|
||||||
import type { DeptApi } from '#/api';
|
|
||||||
|
|
||||||
import { computed, ref } from 'vue';
|
|
||||||
|
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
|
||||||
|
|
||||||
import { Button } from 'ant-design-vue';
|
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
|
||||||
import { createDept, updateDept } from '#/api';
|
|
||||||
import { $t } from '#/locales';
|
|
||||||
|
|
||||||
import { useSchema } from '../data';
|
|
||||||
|
|
||||||
const emit = defineEmits(['success']);
|
|
||||||
const formData = ref<DeptApi.Dept>();
|
|
||||||
const getTitle = computed(() => {
|
|
||||||
return formData.value?.id
|
|
||||||
? $t('ui.actionTitle.edit', ['部门'])
|
|
||||||
: $t('ui.actionTitle.create', ['部门']);
|
|
||||||
});
|
|
||||||
|
|
||||||
const [Form, formApi] = useVbenForm({
|
|
||||||
layout: 'vertical',
|
|
||||||
schema: useSchema(),
|
|
||||||
showDefaultActions: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
function resetForm() {
|
|
||||||
formApi.resetForm();
|
|
||||||
formApi.setValues(formData.value || {});
|
|
||||||
}
|
|
||||||
|
|
||||||
const [Modal, modalApi] = useVbenModal({
|
|
||||||
async onConfirm() {
|
|
||||||
const { valid } = await formApi.validate();
|
|
||||||
if (valid) {
|
|
||||||
modalApi.lock();
|
|
||||||
const data = await formApi.getValues();
|
|
||||||
try {
|
|
||||||
await (formData.value?.id
|
|
||||||
? updateDept(formData.value.id, data)
|
|
||||||
: createDept(data));
|
|
||||||
modalApi.close();
|
|
||||||
emit('success');
|
|
||||||
} finally {
|
|
||||||
modalApi.lock(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onOpenChange(isOpen) {
|
|
||||||
if (isOpen) {
|
|
||||||
const data = modalApi.getData<DeptApi.Dept>();
|
|
||||||
if (data) {
|
|
||||||
if (data.pid === 0) {
|
|
||||||
data.pid = undefined;
|
|
||||||
}
|
|
||||||
formData.value = data;
|
|
||||||
formApi.setValues(formData.value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<template>
|
|
||||||
<Modal :title="getTitle">
|
|
||||||
<Form class="mx-4" />
|
|
||||||
<template #prepend-footer>
|
|
||||||
<div class="flex-auto">
|
|
||||||
<Button type="primary" danger @click="resetForm">
|
|
||||||
{{ $t('common.reset') }}
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</template>
|
|
||||||
</Modal>
|
|
||||||
</template>
|
|
@ -56,10 +56,6 @@ async function handleClick(item: PPTTempItem) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function handleClickMode(item: PPTTempItem) {
|
|
||||||
temp = item;
|
|
||||||
}
|
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getLogs(temp.id);
|
getLogs(temp.id);
|
||||||
});
|
});
|
||||||
@ -75,7 +71,7 @@ onMounted(() => {
|
|||||||
title="运行历史"
|
title="运行历史"
|
||||||
@click="handleClick"
|
@click="handleClick"
|
||||||
/>
|
/>
|
||||||
<PptListView title="选择模板" @click="handleClickMode" />
|
<PptListView title="选择模板" @click="handleClick" />
|
||||||
</div>
|
</div>
|
||||||
<div class="w-full lg:w-3/4">
|
<div class="w-full lg:w-3/4">
|
||||||
<PptWorkView
|
<PptWorkView
|
||||||
|
@ -1,132 +0,0 @@
|
|||||||
import type { VbenFormSchema } from '#/adapter/form';
|
|
||||||
import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table';
|
|
||||||
import type { RoleApi } from '#/api';
|
|
||||||
|
|
||||||
import { $t } from '#/locales';
|
|
||||||
|
|
||||||
export function useFormSchema(): VbenFormSchema[] {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'name',
|
|
||||||
label: '角色名称',
|
|
||||||
rules: 'required',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'RadioGroup',
|
|
||||||
componentProps: {
|
|
||||||
buttonStyle: 'solid',
|
|
||||||
options: [
|
|
||||||
{ label: $t('common.enabled'), value: true },
|
|
||||||
{ label: $t('common.disabled'), value: false },
|
|
||||||
],
|
|
||||||
optionType: 'button',
|
|
||||||
},
|
|
||||||
defaultValue: true,
|
|
||||||
fieldName: 'enabled',
|
|
||||||
label: '状态',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Textarea',
|
|
||||||
fieldName: 'remark',
|
|
||||||
label: '备注',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'menuIds',
|
|
||||||
formItemClass: 'items-start',
|
|
||||||
label: '权限',
|
|
||||||
modelPropName: 'modelValue',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useGridFormSchema(): VbenFormSchema[] {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'name',
|
|
||||||
label: '角色名称',
|
|
||||||
},
|
|
||||||
// { component: 'Input', fieldName: 'id', label: '角色ID' },
|
|
||||||
{
|
|
||||||
component: 'Select',
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
options: [
|
|
||||||
{ label: $t('common.enabled'), value: 1 },
|
|
||||||
{ label: $t('common.disabled'), value: 0 },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
fieldName: 'enabled',
|
|
||||||
label: '状态',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// component: 'Input',
|
|
||||||
// fieldName: 'remark',
|
|
||||||
// label: '备注',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// component: 'RangePicker',
|
|
||||||
// fieldName: 'createTime',
|
|
||||||
// componentProps: {
|
|
||||||
// format: 'YYYY-M-D HH:mm:ss', // 设置日期时间格式
|
|
||||||
// showTime: true, // 确保选择器支持时间选择
|
|
||||||
// },
|
|
||||||
// label: '创建时间',
|
|
||||||
// },
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useColumns<T = RoleApi.Role>(
|
|
||||||
onActionClick: OnActionClickFn<T>,
|
|
||||||
onStatusChange?: (newStatus: any, row: T) => PromiseLike<boolean | undefined>,
|
|
||||||
): VxeTableGridOptions['columns'] {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
field: 'id',
|
|
||||||
title: '角色ID',
|
|
||||||
width: 200,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'name',
|
|
||||||
title: '角色名称',
|
|
||||||
width: 200,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
cellRender: {
|
|
||||||
attrs: { beforeChange: onStatusChange },
|
|
||||||
name: onStatusChange ? 'CellSwitch' : 'CellTag',
|
|
||||||
},
|
|
||||||
field: 'enabled',
|
|
||||||
title: '角色状态',
|
|
||||||
width: 100,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'remark',
|
|
||||||
minWidth: 100,
|
|
||||||
title: '备注',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'createTime',
|
|
||||||
slots: { default: 'createTime' },
|
|
||||||
title: '创建时间',
|
|
||||||
width: 200,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: 'center',
|
|
||||||
cellRender: {
|
|
||||||
attrs: {
|
|
||||||
nameField: 'name',
|
|
||||||
nameTitle: '角色',
|
|
||||||
onClick: onActionClick,
|
|
||||||
},
|
|
||||||
name: 'CellOperation',
|
|
||||||
},
|
|
||||||
field: 'operation',
|
|
||||||
fixed: 'right',
|
|
||||||
title: '操作',
|
|
||||||
width: 200,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,168 +0,0 @@
|
|||||||
<script lang="ts" setup>
|
|
||||||
import type { Recordable } from '@vben/types';
|
|
||||||
|
|
||||||
import type {
|
|
||||||
OnActionClickParams,
|
|
||||||
VxeTableGridOptions,
|
|
||||||
} from '#/adapter/vxe-table';
|
|
||||||
import type { RoleApi } from '#/api';
|
|
||||||
|
|
||||||
import { Page, useVbenDrawer } from '@vben/common-ui';
|
|
||||||
import { Plus } from '@vben/icons';
|
|
||||||
|
|
||||||
import { Button, message, Modal } from 'ant-design-vue';
|
|
||||||
import dayjs from 'dayjs';
|
|
||||||
|
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
|
||||||
import { enabledRole, queryRoleList, removeRole } from '#/api';
|
|
||||||
import { $t } from '#/locales';
|
|
||||||
|
|
||||||
import { useColumns, useGridFormSchema } from './data';
|
|
||||||
import Form from './modules/form.vue';
|
|
||||||
|
|
||||||
const [FormDrawer, formDrawerApi] = useVbenDrawer({
|
|
||||||
connectedComponent: Form,
|
|
||||||
destroyOnClose: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
|
||||||
formOptions: {
|
|
||||||
fieldMappingTime: [['createTime', ['startTime', 'endTime']]],
|
|
||||||
schema: useGridFormSchema(),
|
|
||||||
},
|
|
||||||
gridOptions: {
|
|
||||||
columns: useColumns(onActionClick, onStatusChange),
|
|
||||||
height: 'auto',
|
|
||||||
keepSource: true,
|
|
||||||
proxyConfig: {
|
|
||||||
ajax: {
|
|
||||||
query: async ({ page }, formValues) => {
|
|
||||||
const res = await queryRoleList({
|
|
||||||
page: page.currentPage,
|
|
||||||
size: page.pageSize,
|
|
||||||
...formValues,
|
|
||||||
});
|
|
||||||
return {
|
|
||||||
total: res.total,
|
|
||||||
items: res.records,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
rowConfig: {
|
|
||||||
keyField: 'id',
|
|
||||||
},
|
|
||||||
|
|
||||||
toolbarConfig: {
|
|
||||||
custom: true,
|
|
||||||
export: false,
|
|
||||||
refresh: { code: 'query' },
|
|
||||||
search: true,
|
|
||||||
zoom: true,
|
|
||||||
},
|
|
||||||
} as VxeTableGridOptions<RoleApi.Role>,
|
|
||||||
});
|
|
||||||
|
|
||||||
function onActionClick(e: OnActionClickParams<RoleApi.Role>) {
|
|
||||||
switch (e.code) {
|
|
||||||
case 'delete': {
|
|
||||||
onDelete(e.row);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'edit': {
|
|
||||||
onEdit(e.row);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将Antd的Modal.confirm封装为promise,方便在异步函数中调用。
|
|
||||||
* @param content 提示内容
|
|
||||||
* @param title 提示标题
|
|
||||||
*/
|
|
||||||
function confirm(content: string, title: string) {
|
|
||||||
return new Promise((reslove, reject) => {
|
|
||||||
Modal.confirm({
|
|
||||||
content,
|
|
||||||
onCancel() {
|
|
||||||
reject(new Error('已取消'));
|
|
||||||
},
|
|
||||||
onOk() {
|
|
||||||
reslove(true);
|
|
||||||
},
|
|
||||||
title,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态开关即将改变
|
|
||||||
* @param newStatus 期望改变的状态值
|
|
||||||
* @param row 行数据
|
|
||||||
* @returns 返回false则中止改变,返回其他值(undefined、true)则允许改变
|
|
||||||
*/
|
|
||||||
async function onStatusChange(newStatus: number, row: RoleApi.Role) {
|
|
||||||
const status: Recordable<string> = {
|
|
||||||
0: '禁用',
|
|
||||||
1: '启用',
|
|
||||||
};
|
|
||||||
try {
|
|
||||||
await confirm(
|
|
||||||
`你要将${row.name}的状态切换为 【${status[newStatus.toString()]}】 吗?`,
|
|
||||||
`切换状态`,
|
|
||||||
);
|
|
||||||
await enabledRole(row.id);
|
|
||||||
return true;
|
|
||||||
} catch {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onEdit(row: RoleApi.Role) {
|
|
||||||
formDrawerApi.setData(row).open();
|
|
||||||
}
|
|
||||||
|
|
||||||
function onDelete(row: RoleApi.Role) {
|
|
||||||
const hideLoading = message.loading({
|
|
||||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
|
||||||
duration: 0,
|
|
||||||
key: 'action_process_msg',
|
|
||||||
});
|
|
||||||
removeRole(row.id)
|
|
||||||
.then(() => {
|
|
||||||
message.success({
|
|
||||||
content: $t('ui.actionMessage.deleteSuccess', [row.name]),
|
|
||||||
key: 'action_process_msg',
|
|
||||||
});
|
|
||||||
onRefresh();
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
hideLoading();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function onRefresh() {
|
|
||||||
gridApi.query();
|
|
||||||
}
|
|
||||||
|
|
||||||
function onCreate() {
|
|
||||||
formDrawerApi.setData({}).open();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<Page auto-content-height>
|
|
||||||
<FormDrawer />
|
|
||||||
<Grid table-title="角色列表">
|
|
||||||
<template #toolbar-tools>
|
|
||||||
<Button type="primary" @click="onCreate">
|
|
||||||
<Plus class="size-5" />
|
|
||||||
{{ $t('ui.actionTitle.create', ['角色']) }}
|
|
||||||
</Button>
|
|
||||||
</template>
|
|
||||||
<template #createTime="{ row }">
|
|
||||||
{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm') }}
|
|
||||||
</template>
|
|
||||||
</Grid>
|
|
||||||
</Page>
|
|
||||||
</template>
|
|
@ -1,148 +0,0 @@
|
|||||||
<script lang="ts" setup>
|
|
||||||
import type { DataNode } from 'ant-design-vue/es/tree';
|
|
||||||
|
|
||||||
import type { Recordable } from '@vben/types';
|
|
||||||
|
|
||||||
import type { RoleApi } from '#/api';
|
|
||||||
|
|
||||||
import { computed, ref } from 'vue';
|
|
||||||
|
|
||||||
import { useVbenDrawer, VbenTree } from '@vben/common-ui';
|
|
||||||
// import { IconifyIcon } from '@vben/icons';
|
|
||||||
|
|
||||||
import { Spin } from 'ant-design-vue';
|
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
|
||||||
import { createRole, queryMenuList, roleDetail, updateRole } from '#/api';
|
|
||||||
import { $t } from '#/locales';
|
|
||||||
|
|
||||||
import { useFormSchema } from '../data';
|
|
||||||
|
|
||||||
const emits = defineEmits(['success']);
|
|
||||||
|
|
||||||
const formData = ref<RoleApi.Role>();
|
|
||||||
|
|
||||||
const [Form, formApi] = useVbenForm({
|
|
||||||
schema: useFormSchema(),
|
|
||||||
showDefaultActions: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
const menuIds = ref<DataNode[]>([]);
|
|
||||||
const loadingPermissions = ref(false);
|
|
||||||
|
|
||||||
const id = ref();
|
|
||||||
const [Drawer, drawerApi] = useVbenDrawer({
|
|
||||||
async onConfirm() {
|
|
||||||
const { valid } = await formApi.validate();
|
|
||||||
if (!valid) return;
|
|
||||||
const values = await formApi.getValues();
|
|
||||||
drawerApi.lock();
|
|
||||||
(id.value ? updateRole(id.value, values) : createRole(values))
|
|
||||||
.then(() => {
|
|
||||||
emits('success');
|
|
||||||
drawerApi.close();
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
drawerApi.unlock();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async onOpenChange(isOpen) {
|
|
||||||
if (isOpen) {
|
|
||||||
const data = drawerApi.getData<RoleApi.Role>();
|
|
||||||
await formApi.resetForm();
|
|
||||||
if (data.id) {
|
|
||||||
const roleDetailData = await roleDetail(data.id);
|
|
||||||
formData.value = roleDetailData;
|
|
||||||
|
|
||||||
// 提取 menus 中的 id 并赋值给 menuIds
|
|
||||||
formData.value.menuIds = roleDetailData.menus.map((menu) => menu.id);
|
|
||||||
|
|
||||||
id.value = data.id;
|
|
||||||
formApi.setValues(roleDetailData);
|
|
||||||
} else {
|
|
||||||
id.value = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (menuIds.value.length === 0) {
|
|
||||||
loadPermissions();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
async function loadPermissions() {
|
|
||||||
loadingPermissions.value = true;
|
|
||||||
try {
|
|
||||||
const res = await queryMenuList('all');
|
|
||||||
menuIds.value = res.map((item) => ({
|
|
||||||
key: item.id,
|
|
||||||
title: item.name,
|
|
||||||
children: item.children || null,
|
|
||||||
meta: item.meta,
|
|
||||||
}));
|
|
||||||
} finally {
|
|
||||||
loadingPermissions.value = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const getDrawerTitle = computed(() => {
|
|
||||||
return formData.value?.id
|
|
||||||
? $t('common.edit', '角色')
|
|
||||||
: $t('common.create', '角色');
|
|
||||||
});
|
|
||||||
|
|
||||||
function getNodeClass(node: Recordable<any>) {
|
|
||||||
const classes: string[] = [];
|
|
||||||
if (node.value?.type === 'button') {
|
|
||||||
classes.push('inline-flex');
|
|
||||||
if (node.index % 3 >= 1) {
|
|
||||||
classes.push('!pl-0');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return classes.join(' ');
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<Drawer :title="getDrawerTitle">
|
|
||||||
<Form>
|
|
||||||
<template #menuIds="slotProps">
|
|
||||||
<Spin :spinning="loadingPermissions" wrapper-class-name="w-full">
|
|
||||||
<VbenTree
|
|
||||||
:tree-data="menuIds"
|
|
||||||
multiple
|
|
||||||
bordered
|
|
||||||
:default-expanded-level="2"
|
|
||||||
:get-node-class="getNodeClass"
|
|
||||||
v-bind="slotProps"
|
|
||||||
value-field="id"
|
|
||||||
label-field="meta.title"
|
|
||||||
icon-field="meta.icon"
|
|
||||||
>
|
|
||||||
<template #node="{ value }">
|
|
||||||
<!-- <IconifyIcon v-if="value.meta.icon" :icon="value.meta.icon" />-->
|
|
||||||
{{ value.meta.locale }}
|
|
||||||
</template>
|
|
||||||
</VbenTree>
|
|
||||||
</Spin>
|
|
||||||
</template>
|
|
||||||
</Form>
|
|
||||||
</Drawer>
|
|
||||||
</template>
|
|
||||||
<style lang="css" scoped>
|
|
||||||
:deep(.ant-tree-title) {
|
|
||||||
.tree-actions {
|
|
||||||
display: none;
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.ant-tree-title:hover) {
|
|
||||||
.tree-actions {
|
|
||||||
display: flex;
|
|
||||||
flex: auto;
|
|
||||||
justify-content: flex-end;
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,198 +0,0 @@
|
|||||||
import type { VbenFormSchema } from '#/adapter/form';
|
|
||||||
import type { OnActionClickFn, VxeTableGridOptions } from '#/adapter/vxe-table';
|
|
||||||
import type { UserApi } from '#/api';
|
|
||||||
|
|
||||||
import { ref } from 'vue';
|
|
||||||
|
|
||||||
import { getAllDeptTree, queryRoleList } from '#/api';
|
|
||||||
import { $t } from '#/locales';
|
|
||||||
|
|
||||||
const treeData = ref([]);
|
|
||||||
const optionsRoleData = ref([]);
|
|
||||||
|
|
||||||
queryRoleList('').then((res) => {
|
|
||||||
optionsRoleData.value = res.records.map((item) => ({
|
|
||||||
label: item.name,
|
|
||||||
value: item.id,
|
|
||||||
}));
|
|
||||||
});
|
|
||||||
|
|
||||||
function transformToTreeData(data: any) {
|
|
||||||
return data.map((item) => ({
|
|
||||||
value: item.id,
|
|
||||||
label: item.name,
|
|
||||||
...(item.children && { children: transformToTreeData(item.children) }),
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
// 使用示例
|
|
||||||
getAllDeptTree(1).then((res) => {
|
|
||||||
treeData.value = transformToTreeData(res);
|
|
||||||
});
|
|
||||||
export function useFormSchema(): VbenFormSchema[] {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'username',
|
|
||||||
label: '用户名称',
|
|
||||||
rules: 'required',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'name',
|
|
||||||
label: '昵称',
|
|
||||||
rules: 'required',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'email',
|
|
||||||
label: 'Email',
|
|
||||||
rules: 'required',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'phone',
|
|
||||||
label: '电话',
|
|
||||||
rules: 'required',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'password',
|
|
||||||
label: '密码',
|
|
||||||
rules: 'required',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'address',
|
|
||||||
label: '地址',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'RadioGroup',
|
|
||||||
componentProps: {
|
|
||||||
buttonStyle: 'solid',
|
|
||||||
options: [
|
|
||||||
{ label: $t('common.enabled'), value: true },
|
|
||||||
{ label: $t('common.disabled'), value: false },
|
|
||||||
],
|
|
||||||
optionType: 'button',
|
|
||||||
},
|
|
||||||
defaultValue: true,
|
|
||||||
fieldName: 'enable',
|
|
||||||
label: '状态',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Textarea',
|
|
||||||
fieldName: 'remark',
|
|
||||||
label: '备注',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Select',
|
|
||||||
rules: 'required',
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
mode: 'multiple',
|
|
||||||
// api: queryRoleList(''),
|
|
||||||
options: optionsRoleData,
|
|
||||||
class: 'w-full',
|
|
||||||
labelField: 'name',
|
|
||||||
valueField: 'id',
|
|
||||||
},
|
|
||||||
fieldName: 'roleIds',
|
|
||||||
label: '所属角色',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'TreeSelect',
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
// api: getAllDeptTree(1),
|
|
||||||
treeData,
|
|
||||||
class: 'w-full',
|
|
||||||
labelField: 'name',
|
|
||||||
valueField: 'id',
|
|
||||||
childrenField: 'children',
|
|
||||||
},
|
|
||||||
fieldName: 'deptId',
|
|
||||||
label: '所属部门',
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useGridFormSchema(): VbenFormSchema[] {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
component: 'Input',
|
|
||||||
fieldName: 'username',
|
|
||||||
label: '用户名称',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
component: 'Select',
|
|
||||||
componentProps: {
|
|
||||||
allowClear: true,
|
|
||||||
options: [
|
|
||||||
{ label: $t('common.enabled'), value: true },
|
|
||||||
{ label: $t('common.disabled'), value: false },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
fieldName: 'enableState',
|
|
||||||
label: '状态',
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// component: 'Input',
|
|
||||||
// fieldName: 'remark',
|
|
||||||
// label: '备注',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// component: 'RangePicker',
|
|
||||||
// fieldName: 'createTime',
|
|
||||||
// label: '创建时间',
|
|
||||||
// },
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
export function useColumns<T = UserApi.User>(
|
|
||||||
onActionClick: OnActionClickFn<T>,
|
|
||||||
onStatusChange?: (newStatus: any, row: T) => PromiseLike<boolean | undefined>,
|
|
||||||
): VxeTableGridOptions['columns'] {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
field: 'username',
|
|
||||||
title: '用户名称',
|
|
||||||
width: 200,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
cellRender: {
|
|
||||||
attrs: { beforeChange: onStatusChange },
|
|
||||||
name: onStatusChange ? 'CellSwitch' : 'CellTag',
|
|
||||||
},
|
|
||||||
field: 'enableState',
|
|
||||||
title: '用户状态',
|
|
||||||
width: 100,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'remark',
|
|
||||||
minWidth: 100,
|
|
||||||
title: '备注',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
field: 'createTime',
|
|
||||||
slots: { default: 'createTime' },
|
|
||||||
title: '创建时间',
|
|
||||||
width: 200,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
align: 'center',
|
|
||||||
cellRender: {
|
|
||||||
attrs: {
|
|
||||||
nameField: 'name',
|
|
||||||
nameTitle: '用户',
|
|
||||||
onClick: onActionClick,
|
|
||||||
},
|
|
||||||
name: 'CellOperation',
|
|
||||||
},
|
|
||||||
field: 'operation',
|
|
||||||
fixed: 'right',
|
|
||||||
title: '操作',
|
|
||||||
width: 130,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
@ -1,168 +0,0 @@
|
|||||||
<script lang="ts" setup>
|
|
||||||
import type { Recordable } from '@vben/types';
|
|
||||||
|
|
||||||
import type {
|
|
||||||
OnActionClickParams,
|
|
||||||
VxeTableGridOptions,
|
|
||||||
} from '#/adapter/vxe-table';
|
|
||||||
import type { UserApi } from '#/api';
|
|
||||||
|
|
||||||
import { Page, useVbenDrawer } from '@vben/common-ui';
|
|
||||||
import { Plus } from '@vben/icons';
|
|
||||||
|
|
||||||
import { Button, message, Modal } from 'ant-design-vue';
|
|
||||||
import dayjs from 'dayjs';
|
|
||||||
|
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
|
||||||
import { enabledUser, queryUserList, removeUser } from '#/api';
|
|
||||||
import { $t } from '#/locales';
|
|
||||||
|
|
||||||
import { useColumns, useGridFormSchema } from './data';
|
|
||||||
import Form from './modules/form.vue';
|
|
||||||
|
|
||||||
const [FormDrawer, formDrawerApi] = useVbenDrawer({
|
|
||||||
connectedComponent: Form,
|
|
||||||
destroyOnClose: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
const [Grid, gridApi] = useVbenVxeGrid({
|
|
||||||
formOptions: {
|
|
||||||
fieldMappingTime: [['createTime', ['startTime', 'endTime']]],
|
|
||||||
schema: useGridFormSchema(),
|
|
||||||
},
|
|
||||||
gridOptions: {
|
|
||||||
columns: useColumns(onActionClick, onStatusChange),
|
|
||||||
height: 'auto',
|
|
||||||
keepSource: true,
|
|
||||||
proxyConfig: {
|
|
||||||
ajax: {
|
|
||||||
query: async ({ page }, formValues) => {
|
|
||||||
const res = await queryUserList({
|
|
||||||
page: page.currentPage,
|
|
||||||
size: page.size,
|
|
||||||
...formValues,
|
|
||||||
});
|
|
||||||
return {
|
|
||||||
items: res.records,
|
|
||||||
total: res.total,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
rowConfig: {
|
|
||||||
keyField: 'id',
|
|
||||||
},
|
|
||||||
|
|
||||||
toolbarConfig: {
|
|
||||||
custom: true,
|
|
||||||
export: false,
|
|
||||||
refresh: { code: 'query' },
|
|
||||||
search: true,
|
|
||||||
zoom: true,
|
|
||||||
},
|
|
||||||
} as VxeTableGridOptions<UserApi.User>,
|
|
||||||
});
|
|
||||||
|
|
||||||
function onActionClick(e: OnActionClickParams<UserApi.User>) {
|
|
||||||
switch (e.code) {
|
|
||||||
case 'delete': {
|
|
||||||
onDelete(e.row);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'edit': {
|
|
||||||
onEdit(e.row);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将Antd的Modal.confirm封装为promise,方便在异步函数中调用。
|
|
||||||
* @param content 提示内容
|
|
||||||
* @param title 提示标题
|
|
||||||
*/
|
|
||||||
function confirm(content: string, title: string) {
|
|
||||||
return new Promise((reslove, reject) => {
|
|
||||||
Modal.confirm({
|
|
||||||
content,
|
|
||||||
onCancel() {
|
|
||||||
reject(new Error('已取消'));
|
|
||||||
},
|
|
||||||
onOk() {
|
|
||||||
reslove(true);
|
|
||||||
},
|
|
||||||
title,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 状态开关即将改变
|
|
||||||
* @param newStatus 期望改变的状态值
|
|
||||||
* @param row 行数据
|
|
||||||
* @returns 返回false则中止改变,返回其他值(undefined、true)则允许改变
|
|
||||||
*/
|
|
||||||
async function onStatusChange(newStatus: number, row: UserApi.User) {
|
|
||||||
const status: Recordable<string> = {
|
|
||||||
0: '禁用',
|
|
||||||
1: '启用',
|
|
||||||
};
|
|
||||||
try {
|
|
||||||
await confirm(
|
|
||||||
`你要将${row.name}的状态切换为 【${status[newStatus.toString()]}】 吗?`,
|
|
||||||
`切换状态`,
|
|
||||||
);
|
|
||||||
await enabledUser(row.id);
|
|
||||||
return true;
|
|
||||||
} catch {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function onEdit(row: UserApi.User) {
|
|
||||||
formDrawerApi.setData(row).open();
|
|
||||||
}
|
|
||||||
|
|
||||||
function onDelete(row: UserApi.User) {
|
|
||||||
const hideLoading = message.loading({
|
|
||||||
content: $t('ui.actionMessage.deleting', [row.name]),
|
|
||||||
duration: 0,
|
|
||||||
key: 'action_process_msg',
|
|
||||||
});
|
|
||||||
removeUser(row.id)
|
|
||||||
.then(() => {
|
|
||||||
message.success({
|
|
||||||
content: $t('ui.actionMessage.deleteSuccess', [row.name]),
|
|
||||||
key: 'action_process_msg',
|
|
||||||
});
|
|
||||||
onRefresh();
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
hideLoading();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function onRefresh() {
|
|
||||||
gridApi.query();
|
|
||||||
}
|
|
||||||
|
|
||||||
function onCreate() {
|
|
||||||
formDrawerApi.setData({}).open();
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<Page auto-content-height>
|
|
||||||
<FormDrawer />
|
|
||||||
<Grid table-title="用户列表">
|
|
||||||
<template #toolbar-tools>
|
|
||||||
<Button type="primary" @click="onCreate">
|
|
||||||
<Plus class="size-5" />
|
|
||||||
{{ $t('ui.actionTitle.create', ['用户']) }}
|
|
||||||
</Button>
|
|
||||||
</template>
|
|
||||||
<template #createTime="{ row }">
|
|
||||||
{{ dayjs(row.createTime).format('YYYY-MM-DD HH:mm') }}
|
|
||||||
</template>
|
|
||||||
</Grid>
|
|
||||||
</Page>
|
|
||||||
</template>
|
|
@ -1,138 +0,0 @@
|
|||||||
<script lang="ts" setup>
|
|
||||||
import type { DataNode } from 'ant-design-vue/es/tree';
|
|
||||||
|
|
||||||
import type { Recordable } from '@vben/types';
|
|
||||||
|
|
||||||
import type { UserApi } from '#/api';
|
|
||||||
|
|
||||||
import { computed, ref } from 'vue';
|
|
||||||
|
|
||||||
import { useVbenDrawer, VbenTree } from '@vben/common-ui';
|
|
||||||
import { IconifyIcon } from '@vben/icons';
|
|
||||||
|
|
||||||
import { Spin } from 'ant-design-vue';
|
|
||||||
|
|
||||||
import { useVbenForm } from '#/adapter/form';
|
|
||||||
import { createUser, updateUser, userDetail } from '#/api';
|
|
||||||
import { $t } from '#/locales';
|
|
||||||
|
|
||||||
import { useFormSchema } from '../data';
|
|
||||||
|
|
||||||
const emits = defineEmits(['success']);
|
|
||||||
|
|
||||||
const formData = ref<UserApi.User>();
|
|
||||||
|
|
||||||
const [Form, formApi] = useVbenForm({
|
|
||||||
schema: useFormSchema(),
|
|
||||||
showDefaultActions: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
const permissions = ref<DataNode[]>([]);
|
|
||||||
const loadingPermissions = ref(false);
|
|
||||||
|
|
||||||
const id = ref();
|
|
||||||
const [Drawer, drawerApi] = useVbenDrawer({
|
|
||||||
async onConfirm() {
|
|
||||||
const { valid } = await formApi.validate();
|
|
||||||
if (!valid) return;
|
|
||||||
const values = await formApi.getValues();
|
|
||||||
drawerApi.lock();
|
|
||||||
(id.value ? updateUser(id.value, values) : createUser(values))
|
|
||||||
.then(() => {
|
|
||||||
emits('success');
|
|
||||||
drawerApi.close();
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
drawerApi.unlock();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
async onOpenChange(isOpen) {
|
|
||||||
if (isOpen) {
|
|
||||||
const data = drawerApi.getData<UserApi.User>();
|
|
||||||
await formApi.resetForm();
|
|
||||||
if (data.id) {
|
|
||||||
formData.value = await userDetail(data.id);
|
|
||||||
id.value = data.id;
|
|
||||||
formApi.setValues(data);
|
|
||||||
} else {
|
|
||||||
id.value = undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if (permissions.value.length === 0) {
|
|
||||||
// loadPermissions();
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
// async function loadPermissions() {
|
|
||||||
// loadingPermissions.value = true;
|
|
||||||
// try {
|
|
||||||
// const res = await getMenuList();
|
|
||||||
// permissions.value = res as unknown as DataNode[];
|
|
||||||
// } finally {
|
|
||||||
// loadingPermissions.value = false;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
const getDrawerTitle = computed(() => {
|
|
||||||
return formData.value?.id
|
|
||||||
? $t('common.edit', '用户')
|
|
||||||
: $t('common.create', '用户');
|
|
||||||
});
|
|
||||||
|
|
||||||
function getNodeClass(node: Recordable<any>) {
|
|
||||||
const classes: string[] = [];
|
|
||||||
if (node.value?.type === 'button') {
|
|
||||||
classes.push('inline-flex');
|
|
||||||
if (node.index % 3 >= 1) {
|
|
||||||
classes.push('!pl-0');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return classes.join(' ');
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<template>
|
|
||||||
<Drawer :title="getDrawerTitle">
|
|
||||||
<Form>
|
|
||||||
<template #permissions="slotProps">
|
|
||||||
<Spin :spinning="loadingPermissions" wrapper-class-name="w-full">
|
|
||||||
<VbenTree
|
|
||||||
:tree-data="permissions"
|
|
||||||
multiple
|
|
||||||
bordered
|
|
||||||
:default-expanded-level="2"
|
|
||||||
:get-node-class="getNodeClass"
|
|
||||||
v-bind="slotProps"
|
|
||||||
value-field="id"
|
|
||||||
label-field="meta.title"
|
|
||||||
icon-field="meta.icon"
|
|
||||||
>
|
|
||||||
<template #node="{ value }">
|
|
||||||
<IconifyIcon v-if="value.meta.icon" :icon="value.meta.icon" />
|
|
||||||
{{ $t(value.meta.title) }}
|
|
||||||
</template>
|
|
||||||
</VbenTree>
|
|
||||||
</Spin>
|
|
||||||
</template>
|
|
||||||
</Form>
|
|
||||||
</Drawer>
|
|
||||||
</template>
|
|
||||||
<style lang="css" scoped>
|
|
||||||
:deep(.ant-tree-title) {
|
|
||||||
.tree-actions {
|
|
||||||
display: none;
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
:deep(.ant-tree-title:hover) {
|
|
||||||
.tree-actions {
|
|
||||||
display: flex;
|
|
||||||
flex: auto;
|
|
||||||
justify-content: flex-end;
|
|
||||||
margin-left: 20px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -1,13 +1,13 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { WordTempItem } from '@vben/common-ui';
|
import type { WordHistoryItem, WordTempItem } from '@vben/common-ui';
|
||||||
|
|
||||||
import { onMounted, reactive, ref } from 'vue';
|
import { onMounted, reactive, ref } from 'vue';
|
||||||
|
|
||||||
import { WordHistoryView, WordListView, WordWorkView } from '@vben/common-ui';
|
import { WordHistoryView, WordListView, WordWorkView } from '@vben/common-ui';
|
||||||
|
|
||||||
import { getChatList, sendChatflow } from '#/api';
|
import { getChatList, getMessages, sendChatflow } from '#/api';
|
||||||
|
|
||||||
let temp = reactive<WordTempItem>({
|
const temp = reactive<WordTempItem>({
|
||||||
id: 'baca08c1-e92b-4dc9-a445-3584803f54d4',
|
id: 'baca08c1-e92b-4dc9-a445-3584803f54d4',
|
||||||
name: '职业创新申报书',
|
name: '职业创新申报书',
|
||||||
});
|
});
|
||||||
@ -28,17 +28,15 @@ const getLogs = async (appid: string) => {
|
|||||||
limit: '5',
|
limit: '5',
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
// const res = await getChatList({
|
|
||||||
// appid,
|
|
||||||
// limit: 5,
|
|
||||||
// page: 1,
|
|
||||||
// });
|
|
||||||
hitsory.value = res.data;
|
hitsory.value = res.data;
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
function handleClick(item: WordTempItem) {
|
async function handleClick(item: WordHistoryItem) {
|
||||||
temp = item;
|
await getMessages(temp.id, {
|
||||||
|
conversationId: item.id,
|
||||||
|
userId: '1562',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
@ -10,9 +10,7 @@ export default defineConfig(async () => {
|
|||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||||
// mock代理目标地址
|
// mock代理目标地址
|
||||||
// target: 'http://localhost:8081/api',
|
target: 'http://localhost:8081/api',
|
||||||
target: 'http://43.139.10.64:8082/api',
|
|
||||||
// target: 'http://192.168.3.238:8081/api',
|
|
||||||
ws: true,
|
ws: true,
|
||||||
},
|
},
|
||||||
'/docx': {
|
'/docx': {
|
||||||
@ -28,9 +26,7 @@ export default defineConfig(async () => {
|
|||||||
'/v1': {
|
'/v1': {
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(/^\/v1/, ''),
|
rewrite: (path) => path.replace(/^\/v1/, ''),
|
||||||
// target: 'http://localhost:8081/v1',
|
target: 'http://localhost:8081/v1',
|
||||||
target: 'http://43.139.10.64:8082/v1',
|
|
||||||
// target: 'http://192.168.3.238:8081/v1',
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
"@vueuse/integrations": "catalog:",
|
"@vueuse/integrations": "catalog:",
|
||||||
"ant-design-vue": "catalog:",
|
"ant-design-vue": "catalog:",
|
||||||
"ant-design-x-vue": "^1.1.2",
|
"ant-design-x-vue": "^1.1.2",
|
||||||
"markdown-it": "^14.1.0",
|
"dayjs": "catalog:",
|
||||||
"qrcode": "catalog:",
|
"qrcode": "catalog:",
|
||||||
"tippy.js": "catalog:",
|
"tippy.js": "catalog:",
|
||||||
"vue": "catalog:",
|
"vue": "catalog:",
|
||||||
|
@ -4,26 +4,22 @@ import { ref } from 'vue';
|
|||||||
import { useVbenDrawer } from '@vben/common-ui';
|
import { useVbenDrawer } from '@vben/common-ui';
|
||||||
|
|
||||||
import VueOfficePptx from '@vue-office/pptx';
|
import VueOfficePptx from '@vue-office/pptx';
|
||||||
import { message } from 'ant-design-vue';
|
|
||||||
|
|
||||||
// import '@vue-office/pptx/lib/index.css';
|
// import '@vue-office/pptx/lib/index.css';
|
||||||
// http://47.112.173.8:6802/static/66f3cfd95e364a239d8036390db658ae.pptx
|
// http://47.112.173.8:6802/static/66f3cfd95e364a239d8036390db658ae.pptx
|
||||||
// const url = ref('');
|
// const url = ref('');
|
||||||
const isLoading = ref(false); // 新增:加载状态变量
|
|
||||||
const pptx = ref('/pptx/66f3cfd95e364a239d8036390db658ae.pptx');
|
const pptx = ref('/pptx/66f3cfd95e364a239d8036390db658ae.pptx');
|
||||||
const pptStyle = ref({
|
const pptStyle = ref({
|
||||||
height: 'calc(100vh - 100px)',
|
height: 'calc(100vh - 100px)',
|
||||||
width: '100%',
|
width: 'auto',
|
||||||
margin: 'auto',
|
margin: 'auto',
|
||||||
background: '#ffffff',
|
background: '#ffffff',
|
||||||
});
|
});
|
||||||
const renderedHandler = () => {
|
const renderedHandler = () => {
|
||||||
isLoading.value = false; // 文档渲染完成,关闭加载状态
|
console.warn('渲染完成');
|
||||||
message.success('渲染完成');
|
|
||||||
};
|
};
|
||||||
const errorHandler = () => {
|
const errorHandler = (err) => {
|
||||||
isLoading.value = false; // 出错时也关闭加载状态
|
console.error(`渲染失败:${err}`);
|
||||||
message.error('渲染失败');
|
|
||||||
};
|
};
|
||||||
const [Drawer, drawerApi] = useVbenDrawer({
|
const [Drawer, drawerApi] = useVbenDrawer({
|
||||||
onCancel() {
|
onCancel() {
|
||||||
@ -36,7 +32,6 @@ const [Drawer, drawerApi] = useVbenDrawer({
|
|||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
const data = drawerApi.getData<Record<string, any>>();
|
const data = drawerApi.getData<Record<string, any>>();
|
||||||
if (data) {
|
if (data) {
|
||||||
isLoading.value = true; // 开始加载文档,开启加载状态
|
|
||||||
pptx.value = `/pptx/${data}`; // 更新 docx 的值
|
pptx.value = `/pptx/${data}`; // 更新 docx 的值
|
||||||
}
|
}
|
||||||
// url.value = drawerApi.getData<Record<string, any>>();
|
// url.value = drawerApi.getData<Record<string, any>>();
|
||||||
@ -45,8 +40,7 @@ const [Drawer, drawerApi] = useVbenDrawer({
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<Drawer title="文档预览" :footer="false">
|
<Drawer class="w-[880px]" title="文档预览" :footer="false">
|
||||||
<div v-if="isLoading" class="loading-overlay">正在加载文档,请稍候...</div>
|
|
||||||
<VueOfficePptx
|
<VueOfficePptx
|
||||||
:src="pptx"
|
:src="pptx"
|
||||||
:style="pptStyle"
|
:style="pptStyle"
|
||||||
@ -58,6 +52,6 @@ const [Drawer, drawerApi] = useVbenDrawer({
|
|||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.pptx-preview-wrapper {
|
.pptx-preview-wrapper {
|
||||||
background: #fff;
|
background: #fff !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -12,9 +12,8 @@ import { useVbenDrawer } from '@vben/common-ui';
|
|||||||
import { Card } from '@vben-core/shadcn-ui';
|
import { Card } from '@vben-core/shadcn-ui';
|
||||||
|
|
||||||
import { UserOutlined } from '@ant-design/icons-vue';
|
import { UserOutlined } from '@ant-design/icons-vue';
|
||||||
import { Button, Flex, Typography } from 'ant-design-vue';
|
import { Button, Flex } from 'ant-design-vue';
|
||||||
import { Attachments, BubbleList, Sender } from 'ant-design-x-vue';
|
import { Attachments, BubbleList, Sender } from 'ant-design-x-vue';
|
||||||
import markdownit from 'markdown-it';
|
|
||||||
|
|
||||||
import PptPreview from './ppt-perview.vue';
|
import PptPreview from './ppt-perview.vue';
|
||||||
|
|
||||||
@ -69,24 +68,6 @@ const props = withDefaults(defineProps<Props>(), {
|
|||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
// 初始化 markdown 解析器
|
|
||||||
const md = markdownit({ html: true, breaks: true });
|
|
||||||
|
|
||||||
const renderMarkdown: BubbleListProps['roles'][string]['messageRender'] = (
|
|
||||||
content: string,
|
|
||||||
) => {
|
|
||||||
return h(Typography, [
|
|
||||||
h('div', {
|
|
||||||
innerHTML: content,
|
|
||||||
style: {
|
|
||||||
padding: '8px',
|
|
||||||
lineHeight: '1.6',
|
|
||||||
whiteSpace: 'break-spaces',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
};
|
|
||||||
|
|
||||||
const [PreviewDrawer, previewDrawerApi] = useVbenDrawer({
|
const [PreviewDrawer, previewDrawerApi] = useVbenDrawer({
|
||||||
// 连接抽离的组件
|
// 连接抽离的组件
|
||||||
connectedComponent: PptPreview,
|
connectedComponent: PptPreview,
|
||||||
@ -209,17 +190,6 @@ const roles: BubbleListProps['roles'] = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
avatar: { icon: h(UserOutlined), style: { background: '#fde3cf' } },
|
avatar: { icon: h(UserOutlined), style: { background: '#fde3cf' } },
|
||||||
messageRender: (content) =>
|
|
||||||
h(Typography, [
|
|
||||||
h('div', {
|
|
||||||
innerHTML: md.render(content),
|
|
||||||
style: {
|
|
||||||
padding: '8px',
|
|
||||||
lineHeight: '1.6',
|
|
||||||
whiteSpace: 'break-spaces',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]),
|
|
||||||
},
|
},
|
||||||
file: {
|
file: {
|
||||||
placement: 'start',
|
placement: 'start',
|
||||||
@ -316,21 +286,17 @@ watch(
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<PreviewDrawer />
|
||||||
<PreviewDrawer />
|
<div class="flex h-[910px] flex-col">
|
||||||
<div style="height: calc(67vh - 120px); margin: 20px; overflow-y: auto">
|
<div class="flex-1 overflow-y-auto">
|
||||||
<BubbleList
|
<div style="margin: 20px; overflow-y: auto">
|
||||||
:roles="roles"
|
<BubbleList :auto-scroll="true" :roles="roles" :items="resultItems" />
|
||||||
:typing="true"
|
</div>
|
||||||
:items="resultItems"
|
|
||||||
:message-render="renderMarkdown"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<Card class="w-full">
|
<Card class="w-full">
|
||||||
<Sender
|
<Sender
|
||||||
v-model:value="value"
|
v-model:value="value"
|
||||||
:loading="isFetching"
|
:loading="isFetching"
|
||||||
:disabled="isFetching"
|
|
||||||
:auto-size="{ minRows: 6, maxRows: 12 }"
|
:auto-size="{ minRows: 6, maxRows: 12 }"
|
||||||
@submit="startFetching"
|
@submit="startFetching"
|
||||||
/>
|
/>
|
||||||
|
@ -12,8 +12,6 @@ import {
|
|||||||
CardTitle,
|
CardTitle,
|
||||||
} from '@vben-core/shadcn-ui';
|
} from '@vben-core/shadcn-ui';
|
||||||
|
|
||||||
import { RangePicker } from 'ant-design-vue';
|
|
||||||
|
|
||||||
interface SpiderParams {
|
interface SpiderParams {
|
||||||
appid: string;
|
appid: string;
|
||||||
}
|
}
|
||||||
@ -59,21 +57,11 @@ const props = withDefaults(defineProps<Props>(), {
|
|||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
const selectedDateRange = ref<string[]>([]);
|
|
||||||
|
|
||||||
const startFetching = async () => {
|
const startFetching = async () => {
|
||||||
// 更新状态为“抓取中”
|
// 更新状态为“抓取中”
|
||||||
isFetching.value = true;
|
isFetching.value = true;
|
||||||
fetchStatus.value = 'fetching';
|
fetchStatus.value = 'fetching';
|
||||||
|
|
||||||
let publishStartTime = ''; // 默认值
|
|
||||||
let publishEndTime = ''; // 默认值
|
|
||||||
|
|
||||||
if (selectedDateRange.value && selectedDateRange.value.length === 2) {
|
|
||||||
publishStartTime = selectedDateRange.value[0] || '';
|
|
||||||
publishEndTime = selectedDateRange.value[1] || '';
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await props.runSpider(
|
const res = await props.runSpider(
|
||||||
{
|
{
|
||||||
@ -83,14 +71,12 @@ const startFetching = async () => {
|
|||||||
userId: '1562',
|
userId: '1562',
|
||||||
conversationId: '',
|
conversationId: '',
|
||||||
files: [],
|
files: [],
|
||||||
inputs: {
|
inputs: {},
|
||||||
publishStartTime,
|
|
||||||
publishEndTime,
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
// 保存抓取结果
|
// 保存抓取结果
|
||||||
fetchResult.value = res.data.outputs.result;
|
fetchResult.value = res.data.outputs.result;
|
||||||
|
downloadDisable.value = false;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
@ -124,6 +110,7 @@ const downloadFile = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const isFetching = ref(false);
|
const isFetching = ref(false);
|
||||||
|
const downloadDisable = ref(true);
|
||||||
const fetchResult = ref('');
|
const fetchResult = ref('');
|
||||||
const fetchStatus = ref('');
|
const fetchStatus = ref('');
|
||||||
</script>
|
</script>
|
||||||
@ -138,19 +125,10 @@ const fetchStatus = ref('');
|
|||||||
{{ item ? item.name : '请选择右侧爬虫' }}
|
{{ item ? item.name : '请选择右侧爬虫' }}
|
||||||
</CardContent>
|
</CardContent>
|
||||||
<CardFooter class="flex justify-end">
|
<CardFooter class="flex justify-end">
|
||||||
<RangePicker
|
|
||||||
class="mx-2"
|
|
||||||
v-model:value="selectedDateRange"
|
|
||||||
format="YYYY-MM-DD"
|
|
||||||
/>
|
|
||||||
<Button :disabled="!item" @click="startFetching">
|
<Button :disabled="!item" @click="startFetching">
|
||||||
{{ isFetching ? '抓取中...' : '开始抓取' }}
|
{{ isFetching ? '抓取中...' : '开始抓取' }}
|
||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button class="mx-2" :disabled="downloadDisable" @click="downloadFile">
|
||||||
class="mx-2"
|
|
||||||
:disabled="fetchStatus !== 'completed'"
|
|
||||||
@click="downloadFile"
|
|
||||||
>
|
|
||||||
下载文件
|
下载文件
|
||||||
</Button>
|
</Button>
|
||||||
</CardFooter>
|
</CardFooter>
|
||||||
|
@ -5,13 +5,11 @@ interface WordTempItem {
|
|||||||
|
|
||||||
interface WordHistoryItem {
|
interface WordHistoryItem {
|
||||||
id: string;
|
id: string;
|
||||||
workflowRun: {
|
inputs: {
|
||||||
id: string;
|
projectName: string;
|
||||||
};
|
|
||||||
createdByEndUser: {
|
|
||||||
id: string;
|
|
||||||
sessionId: string;
|
|
||||||
};
|
};
|
||||||
|
name: string;
|
||||||
|
createdAt: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type { WordHistoryItem, WordTempItem };
|
export type { WordHistoryItem, WordTempItem };
|
||||||
|
@ -3,6 +3,8 @@ import type { WordHistoryItem } from '../word';
|
|||||||
|
|
||||||
import { Card, CardContent, CardHeader, CardTitle } from '@vben-core/shadcn-ui';
|
import { Card, CardContent, CardHeader, CardTitle } from '@vben-core/shadcn-ui';
|
||||||
|
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
items?: WordHistoryItem[];
|
items?: WordHistoryItem[];
|
||||||
title: string;
|
title: string;
|
||||||
@ -35,7 +37,10 @@ defineEmits(['click']);
|
|||||||
@click="$emit('click', item)"
|
@click="$emit('click', item)"
|
||||||
class="flex cursor-pointer justify-between gap-x-6 py-5"
|
class="flex cursor-pointer justify-between gap-x-6 py-5"
|
||||||
>
|
>
|
||||||
{{ item.id }}
|
<span>{{ item.name }}</span>
|
||||||
|
<span>{{
|
||||||
|
dayjs.unix(item.createdAt).format('YYYY-MM-DD HH:mm:ss')
|
||||||
|
}}</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
@ -4,12 +4,10 @@ import { ref } from 'vue';
|
|||||||
import { useVbenDrawer } from '@vben/common-ui';
|
import { useVbenDrawer } from '@vben/common-ui';
|
||||||
|
|
||||||
import VueOfficeDocx from '@vue-office/docx';
|
import VueOfficeDocx from '@vue-office/docx';
|
||||||
import { message } from 'ant-design-vue';
|
|
||||||
|
|
||||||
import '@vue-office/docx/lib/index.css';
|
import '@vue-office/docx/lib/index.css';
|
||||||
|
|
||||||
// const url = ref('');
|
// const url = ref('');
|
||||||
const isLoading = ref(false); // 新增:加载状态变量
|
|
||||||
const docx = ref<any>(`/docx/027c6b7c-fea6-4964-839b-27857c4d3181.docx`);
|
const docx = ref<any>(`/docx/027c6b7c-fea6-4964-839b-27857c4d3181.docx`);
|
||||||
const pptStyle = ref({
|
const pptStyle = ref({
|
||||||
height: 'calc(100vh - 100px)',
|
height: 'calc(100vh - 100px)',
|
||||||
@ -17,12 +15,10 @@ const pptStyle = ref({
|
|||||||
margin: 'auto',
|
margin: 'auto',
|
||||||
});
|
});
|
||||||
const renderedHandler = () => {
|
const renderedHandler = () => {
|
||||||
isLoading.value = false; // 文档渲染完成,关闭加载状态
|
console.warn('渲染完成');
|
||||||
message.success('渲染完成');
|
|
||||||
};
|
};
|
||||||
const errorHandler = () => {
|
const errorHandler = (err) => {
|
||||||
isLoading.value = false; // 出错时也关闭加载状态
|
console.error(`渲染失败:${err}`);
|
||||||
message.error('渲染失败');
|
|
||||||
};
|
};
|
||||||
const [Drawer, drawerApi] = useVbenDrawer({
|
const [Drawer, drawerApi] = useVbenDrawer({
|
||||||
onCancel() {
|
onCancel() {
|
||||||
@ -35,7 +31,6 @@ const [Drawer, drawerApi] = useVbenDrawer({
|
|||||||
if (isOpen) {
|
if (isOpen) {
|
||||||
const data = drawerApi.getData<Record<string, any>>();
|
const data = drawerApi.getData<Record<string, any>>();
|
||||||
if (data) {
|
if (data) {
|
||||||
isLoading.value = false; // 出错时也关闭加载状态
|
|
||||||
docx.value = `/docx/${data}`; // 更新 docx 的值
|
docx.value = `/docx/${data}`; // 更新 docx 的值
|
||||||
}
|
}
|
||||||
// url.value = drawerApi.getData<Record<string, any>>();
|
// url.value = drawerApi.getData<Record<string, any>>();
|
||||||
@ -45,7 +40,6 @@ const [Drawer, drawerApi] = useVbenDrawer({
|
|||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<Drawer class="w-[880px]" title="文档预览" :footer="false">
|
<Drawer class="w-[880px]" title="文档预览" :footer="false">
|
||||||
<div v-if="isLoading" class="loading-overlay">正在加载文档,请稍候...</div>
|
|
||||||
<VueOfficeDocx
|
<VueOfficeDocx
|
||||||
:src="docx"
|
:src="docx"
|
||||||
:style="pptStyle"
|
:style="pptStyle"
|
||||||
|
@ -12,9 +12,8 @@ import { useVbenDrawer } from '@vben/common-ui';
|
|||||||
import { Card } from '@vben-core/shadcn-ui';
|
import { Card } from '@vben-core/shadcn-ui';
|
||||||
|
|
||||||
import { UserOutlined } from '@ant-design/icons-vue';
|
import { UserOutlined } from '@ant-design/icons-vue';
|
||||||
import { Button, Flex, Typography } from 'ant-design-vue';
|
import { Button, Flex, notification } from 'ant-design-vue';
|
||||||
import { Attachments, BubbleList, Sender } from 'ant-design-x-vue';
|
import { Attachments, BubbleList, Sender } from 'ant-design-x-vue';
|
||||||
import markdownit from 'markdown-it';
|
|
||||||
|
|
||||||
import WordPreview from './word-preview.vue';
|
import WordPreview from './word-preview.vue';
|
||||||
|
|
||||||
@ -63,24 +62,6 @@ const props = withDefaults(defineProps<Props>(), {
|
|||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
// 初始化 markdown 解析器
|
|
||||||
const md = markdownit({ html: true, breaks: true });
|
|
||||||
|
|
||||||
const renderMarkdown: BubbleListProps['roles'][string]['messageRender'] = (
|
|
||||||
content,
|
|
||||||
) => {
|
|
||||||
return h(Typography, [
|
|
||||||
h('div', {
|
|
||||||
innerHTML: content,
|
|
||||||
style: {
|
|
||||||
padding: '8px',
|
|
||||||
lineHeight: '1.6',
|
|
||||||
whiteSpace: 'break-spaces',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]);
|
|
||||||
};
|
|
||||||
|
|
||||||
const [PreviewDrawer, previewDrawerApi] = useVbenDrawer({
|
const [PreviewDrawer, previewDrawerApi] = useVbenDrawer({
|
||||||
// 连接抽离的组件
|
// 连接抽离的组件
|
||||||
connectedComponent: WordPreview,
|
connectedComponent: WordPreview,
|
||||||
@ -94,7 +75,16 @@ function openPreviewDrawer(
|
|||||||
previewDrawerApi.setState({ placement }).setData(fileData).open();
|
previewDrawerApi.setState({ placement }).setData(fileData).open();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const inputStatus = ref<string>('');
|
||||||
const startFetching = async () => {
|
const startFetching = async () => {
|
||||||
|
if (!projectName.value) {
|
||||||
|
inputStatus.value = 'error';
|
||||||
|
notification.error({
|
||||||
|
duration: 3,
|
||||||
|
message: '请填写项目名称',
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
isFetching.value = true;
|
isFetching.value = true;
|
||||||
fetchStatus.value = 'fetching';
|
fetchStatus.value = 'fetching';
|
||||||
resultItems.value.push({
|
resultItems.value.push({
|
||||||
@ -195,7 +185,7 @@ const startFetching = async () => {
|
|||||||
resultItems.value.push({
|
resultItems.value.push({
|
||||||
key: resultItems.value.length + 1,
|
key: resultItems.value.length + 1,
|
||||||
role: 'ai',
|
role: 'ai',
|
||||||
content: res.answer.trim(),
|
content: res.answer,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,17 +248,6 @@ const roles: BubbleListProps['roles'] = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
avatar: { icon: h(UserOutlined), style: { background: '#fde3cf' } },
|
avatar: { icon: h(UserOutlined), style: { background: '#fde3cf' } },
|
||||||
messageRender: (content) =>
|
|
||||||
h(Typography, [
|
|
||||||
h('div', {
|
|
||||||
innerHTML: md.render(content),
|
|
||||||
style: {
|
|
||||||
padding: '8px',
|
|
||||||
lineHeight: '1.6',
|
|
||||||
whiteSpace: 'break-spaces',
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]),
|
|
||||||
},
|
},
|
||||||
file: {
|
file: {
|
||||||
placement: 'start',
|
placement: 'start',
|
||||||
@ -298,56 +277,33 @@ interface ResultItem {
|
|||||||
footer?: any;
|
footer?: any;
|
||||||
}
|
}
|
||||||
|
|
||||||
const insertTextToInput = (text: string) => {
|
|
||||||
value.value = text + value.value;
|
|
||||||
};
|
|
||||||
|
|
||||||
const resultItems = ref<ResultItem[]>([]);
|
const resultItems = ref<ResultItem[]>([]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<PreviewDrawer />
|
||||||
<PreviewDrawer />
|
<div class="flex h-[910px] flex-col">
|
||||||
<a-space class="w-full" direction="vertical">
|
<div class="flex-1 overflow-y-auto">
|
||||||
<a-input v-model:value="projectName" required placeholder="项目名称" />
|
<a-space class="w-full" direction="vertical">
|
||||||
</a-space>
|
<a-input
|
||||||
<div style="height: calc(67vh - 180px); margin: 20px; overflow-y: auto">
|
size="large"
|
||||||
<BubbleList
|
v-model:value="projectName"
|
||||||
:roles="roles"
|
:status="inputStatus"
|
||||||
:typing="true"
|
required
|
||||||
:items="resultItems"
|
placeholder="项目名称(必填)"
|
||||||
:message-render="renderMarkdown"
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<Flex wrap="wrap" :gap="12">
|
|
||||||
<Button @click="insertTextToInput('生成项目摘要')">生成项目摘要</Button>
|
|
||||||
<Button @click="insertTextToInput('生成目前存在问题')">
|
|
||||||
生成目前存在问题
|
|
||||||
</Button>
|
|
||||||
<Button @click="insertTextToInput('生成项目采用的技术原理')">
|
|
||||||
生成项目采用的技术原理
|
|
||||||
</Button>
|
|
||||||
<Button @click="insertTextToInput('生成能解决的主要问题')">
|
|
||||||
生成能解决的主要问题
|
|
||||||
</Button>
|
|
||||||
<Button @click="insertTextToInput('生成技术关键点和创新点')">
|
|
||||||
生成技术关键点和创新点
|
|
||||||
</Button>
|
|
||||||
<Button @click="insertTextToInput('生成应用前景')">生成应用前景</Button>
|
|
||||||
<Button @click="insertTextToInput('生成项目实施及效益预测')">
|
|
||||||
生成项目实施及效益预测
|
|
||||||
</Button>
|
|
||||||
<Button @click="insertTextToInput('生成预期成果')">生成预期成果</Button>
|
|
||||||
<Button @click="insertTextToInput('生成导出doc')">生成导出doc</Button>
|
|
||||||
<Card class="w-full">
|
|
||||||
<Sender
|
|
||||||
v-model:value="value"
|
|
||||||
:loading="isFetching"
|
|
||||||
:disabled="isFetching"
|
|
||||||
:auto-size="{ minRows: 6, maxRows: 12 }"
|
|
||||||
@submit="startFetching"
|
|
||||||
/>
|
/>
|
||||||
</Card>
|
</a-space>
|
||||||
</Flex>
|
<div style="margin: 20px; overflow-y: auto">
|
||||||
|
<BubbleList :auto-scroll="true" :roles="roles" :items="resultItems" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Card class="w-full">
|
||||||
|
<Sender
|
||||||
|
v-model:value="value"
|
||||||
|
:loading="isFetching"
|
||||||
|
:auto-size="{ minRows: 6, maxRows: 12 }"
|
||||||
|
@submit="startFetching"
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -103,17 +103,6 @@ class RequestClient {
|
|||||||
return this.request<T>(url, { ...config, method: 'GET' });
|
return this.request<T>(url, { ...config, method: 'GET' });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* PATCH请求方法
|
|
||||||
*/
|
|
||||||
public patch<T = any>(
|
|
||||||
url: string,
|
|
||||||
data?: any,
|
|
||||||
config?: RequestClientConfig,
|
|
||||||
): Promise<T> {
|
|
||||||
return this.request<T>(url, { ...config, data, method: 'PATCH' });
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* POST请求方法
|
* POST请求方法
|
||||||
*/
|
*/
|
||||||
|
@ -13,7 +13,3 @@ export const MdiGoogle = createIconifyIcon('mdi:google');
|
|||||||
export const MdiChevron = createIconifyIcon('tabler:chevron-right');
|
export const MdiChevron = createIconifyIcon('tabler:chevron-right');
|
||||||
export const MdiUser = createIconifyIcon('mdi:user');
|
export const MdiUser = createIconifyIcon('mdi:user');
|
||||||
export const MageRobot = createIconifyIcon('mage:robot');
|
export const MageRobot = createIconifyIcon('mage:robot');
|
||||||
export const RiDept = createIconifyIcon('ri:door-open-line');
|
|
||||||
export const EosRole = createIconifyIcon('eos-icons:role-binding-outlined');
|
|
||||||
export const IconSystem = createIconifyIcon('icon-park-twotone:system');
|
|
||||||
// export const MdiUser = createIconifyIcon('mdi:user');
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"welcomeBack": "欢迎回来",
|
"welcomeBack": "欢迎回来",
|
||||||
"pageTitle": "开箱即用的大型中后台管理系统",
|
"pageTitle": "",
|
||||||
"pageDesc": "工程化、高性能、跨组件库的前端模版",
|
"pageDesc": "",
|
||||||
"loginSuccess": "登录成功",
|
"loginSuccess": "登录成功",
|
||||||
"loginSuccessDesc": "欢迎回来",
|
"loginSuccessDesc": "欢迎回来",
|
||||||
"loginSubtitle": "请输入您的帐户信息以开始管理您的项目",
|
"loginSubtitle": "请输入您的帐户信息以开始管理您的项目",
|
||||||
|
@ -1344,9 +1344,9 @@ importers:
|
|||||||
ant-design-x-vue:
|
ant-design-x-vue:
|
||||||
specifier: ^1.1.2
|
specifier: ^1.1.2
|
||||||
version: 1.1.2(ant-design-vue@4.2.6(vue@3.5.13(typescript@5.8.3)))(vue@3.5.13(typescript@5.8.3))
|
version: 1.1.2(ant-design-vue@4.2.6(vue@3.5.13(typescript@5.8.3)))(vue@3.5.13(typescript@5.8.3))
|
||||||
markdown-it:
|
dayjs:
|
||||||
specifier: ^14.1.0
|
specifier: 'catalog:'
|
||||||
version: 14.1.0
|
version: 1.11.13
|
||||||
qrcode:
|
qrcode:
|
||||||
specifier: 'catalog:'
|
specifier: 'catalog:'
|
||||||
version: 1.5.4
|
version: 1.5.4
|
||||||
@ -7056,9 +7056,6 @@ packages:
|
|||||||
lines-and-columns@1.2.4:
|
lines-and-columns@1.2.4:
|
||||||
resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}
|
resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==}
|
||||||
|
|
||||||
linkify-it@5.0.0:
|
|
||||||
resolution: {integrity: sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==}
|
|
||||||
|
|
||||||
lint-staged@15.5.1:
|
lint-staged@15.5.1:
|
||||||
resolution: {integrity: sha512-6m7u8mue4Xn6wK6gZvSCQwBvMBR36xfY24nF5bMTf2MHDYG6S3yhJuOgdYVw99hsjyDt2d4z168b3naI8+NWtQ==}
|
resolution: {integrity: sha512-6m7u8mue4Xn6wK6gZvSCQwBvMBR36xfY24nF5bMTf2MHDYG6S3yhJuOgdYVw99hsjyDt2d4z168b3naI8+NWtQ==}
|
||||||
engines: {node: '>=18.12.0'}
|
engines: {node: '>=18.12.0'}
|
||||||
@ -7226,10 +7223,6 @@ packages:
|
|||||||
resolution: {integrity: sha512-EsS89h6l4vbfJEtBZnENTOFk8mCRpY5ru36Xe5bcX1KYIli2mkSHqoFsp5O1wMDvTJJzxe/4THpCTtygjeeGWQ==}
|
resolution: {integrity: sha512-EsS89h6l4vbfJEtBZnENTOFk8mCRpY5ru36Xe5bcX1KYIli2mkSHqoFsp5O1wMDvTJJzxe/4THpCTtygjeeGWQ==}
|
||||||
engines: {node: '>= 10'}
|
engines: {node: '>= 10'}
|
||||||
|
|
||||||
markdown-it@14.1.0:
|
|
||||||
resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==}
|
|
||||||
hasBin: true
|
|
||||||
|
|
||||||
math-intrinsics@1.1.0:
|
math-intrinsics@1.1.0:
|
||||||
resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==}
|
resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==}
|
||||||
engines: {node: '>= 0.4'}
|
engines: {node: '>= 0.4'}
|
||||||
@ -7249,9 +7242,6 @@ packages:
|
|||||||
mdn-data@2.21.0:
|
mdn-data@2.21.0:
|
||||||
resolution: {integrity: sha512-+ZKPQezM5vYJIkCxaC+4DTnRrVZR1CgsKLu5zsQERQx6Tea8Y+wMx5A24rq8A8NepCeatIQufVAekKNgiBMsGQ==}
|
resolution: {integrity: sha512-+ZKPQezM5vYJIkCxaC+4DTnRrVZR1CgsKLu5zsQERQx6Tea8Y+wMx5A24rq8A8NepCeatIQufVAekKNgiBMsGQ==}
|
||||||
|
|
||||||
mdurl@2.0.0:
|
|
||||||
resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==}
|
|
||||||
|
|
||||||
meow@12.1.1:
|
meow@12.1.1:
|
||||||
resolution: {integrity: sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==}
|
resolution: {integrity: sha512-BhXM0Au22RwUneMPwSCnyhTOizdWoIEPU9sp0Aqa1PnDMR5Wv2FGXYDjuzJEIX+Eo2Rb8xuYe5jrnm5QowQFkw==}
|
||||||
engines: {node: '>=16.10'}
|
engines: {node: '>=16.10'}
|
||||||
@ -8502,10 +8492,6 @@ packages:
|
|||||||
pump@3.0.2:
|
pump@3.0.2:
|
||||||
resolution: {integrity: sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==}
|
resolution: {integrity: sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==}
|
||||||
|
|
||||||
punycode.js@2.3.1:
|
|
||||||
resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==}
|
|
||||||
engines: {node: '>=6'}
|
|
||||||
|
|
||||||
punycode@2.3.1:
|
punycode@2.3.1:
|
||||||
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
|
resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==}
|
||||||
engines: {node: '>=6'}
|
engines: {node: '>=6'}
|
||||||
@ -9537,9 +9523,6 @@ packages:
|
|||||||
engines: {node: '>=14.17'}
|
engines: {node: '>=14.17'}
|
||||||
hasBin: true
|
hasBin: true
|
||||||
|
|
||||||
uc.micro@2.1.0:
|
|
||||||
resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==}
|
|
||||||
|
|
||||||
ufo@1.6.1:
|
ufo@1.6.1:
|
||||||
resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==}
|
resolution: {integrity: sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==}
|
||||||
|
|
||||||
@ -16296,10 +16279,6 @@ snapshots:
|
|||||||
|
|
||||||
lines-and-columns@1.2.4: {}
|
lines-and-columns@1.2.4: {}
|
||||||
|
|
||||||
linkify-it@5.0.0:
|
|
||||||
dependencies:
|
|
||||||
uc.micro: 2.1.0
|
|
||||||
|
|
||||||
lint-staged@15.5.1:
|
lint-staged@15.5.1:
|
||||||
dependencies:
|
dependencies:
|
||||||
chalk: 5.4.1
|
chalk: 5.4.1
|
||||||
@ -16504,15 +16483,6 @@ snapshots:
|
|||||||
- bluebird
|
- bluebird
|
||||||
- supports-color
|
- supports-color
|
||||||
|
|
||||||
markdown-it@14.1.0:
|
|
||||||
dependencies:
|
|
||||||
argparse: 2.0.1
|
|
||||||
entities: 4.5.0
|
|
||||||
linkify-it: 5.0.0
|
|
||||||
mdurl: 2.0.0
|
|
||||||
punycode.js: 2.3.1
|
|
||||||
uc.micro: 2.1.0
|
|
||||||
|
|
||||||
math-intrinsics@1.1.0: {}
|
math-intrinsics@1.1.0: {}
|
||||||
|
|
||||||
mathml-tag-names@2.1.3: {}
|
mathml-tag-names@2.1.3: {}
|
||||||
@ -16525,8 +16495,6 @@ snapshots:
|
|||||||
|
|
||||||
mdn-data@2.21.0: {}
|
mdn-data@2.21.0: {}
|
||||||
|
|
||||||
mdurl@2.0.0: {}
|
|
||||||
|
|
||||||
meow@12.1.1: {}
|
meow@12.1.1: {}
|
||||||
|
|
||||||
meow@13.2.0: {}
|
meow@13.2.0: {}
|
||||||
@ -17788,8 +17756,6 @@ snapshots:
|
|||||||
end-of-stream: 1.4.4
|
end-of-stream: 1.4.4
|
||||||
once: 1.4.0
|
once: 1.4.0
|
||||||
|
|
||||||
punycode.js@2.3.1: {}
|
|
||||||
|
|
||||||
punycode@2.3.1: {}
|
punycode@2.3.1: {}
|
||||||
|
|
||||||
pupa@3.1.0:
|
pupa@3.1.0:
|
||||||
@ -18953,8 +18919,6 @@ snapshots:
|
|||||||
|
|
||||||
typescript@5.8.3: {}
|
typescript@5.8.3: {}
|
||||||
|
|
||||||
uc.micro@2.1.0: {}
|
|
||||||
|
|
||||||
ufo@1.6.1: {}
|
ufo@1.6.1: {}
|
||||||
|
|
||||||
ultrahtml@1.6.0: {}
|
ultrahtml@1.6.0: {}
|
||||||
|
Loading…
Reference in New Issue
Block a user