diff --git a/frontend/index.html b/frontend/index.html index 9ad9cd07..0ee429f4 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -59,38 +59,37 @@ } .loading-container .loading-container-item { - position: relative; - display: inline-block; - width: 60px; - height: 60px; - vertical-align: middle; - border-radius: 50%; - } + position: relative; + display: inline-block; + width: 60px; + height: 60px; + vertical-align: middle; + border-radius: 50%; + } .loading-container .loading-container-outter { - position: absolute; - width: 100%; - height: 100%; - border: 4px solid #2d8cf0; - border-bottom: 0; - border-left-color: transparent; - border-radius: 50%; - animation: loader-outter 1s cubic-bezier(0.42, 0.61, 0.58, 0.41) infinite; - } - + position: absolute; + width: 100%; + height: 100%; + border: 4px solid #2d8cf0; + border-bottom: 0; + border-left-color: transparent; + border-radius: 50%; + animation: loader-outter 1s cubic-bezier(0.42, 0.61, 0.58, 0.41) infinite; + } + .loading-container .loading-container-inner { - position: absolute; - top: calc(50% - 20px); - left: calc(50% - 20px); - width: 40px; - height: 40px; - border: 4px solid #87bdff; - border-right: 0; - border-top-color: transparent; - border-radius: 50%; - animation: loader-inner 1s cubic-bezier(0.42, 0.61, 0.58, 0.41) infinite; - } + position: absolute; + top: calc(50% - 20px); + left: calc(50% - 20px); + width: 40px; + height: 40px; + border: 4px solid #87bdff; + border-right: 0; + border-top-color: transparent; + border-radius: 50%; + animation: loader-inner 1s cubic-bezier(0.42, 0.61, 0.58, 0.41) infinite; + } - @-webkit-keyframes loader-outter { 0% { -webkit-transform: rotate(0deg); diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 567706f1..7a5f3ff6 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -29,5 +29,4 @@ const showWatermark = computed(() => settingsStore.showWatermark); const fontColor = computed(() => { return settingsStore.theme === ThemeMode.DARK ? "rgba(255, 255, 255, .15)" : "rgba(0, 0, 0, .15)"; }); - diff --git a/frontend/src/api/module_application/job.ts b/frontend/src/api/module_application/job.ts index e2f4900f..dc191282 100644 --- a/frontend/src/api/module_application/job.ts +++ b/frontend/src/api/module_application/job.ts @@ -117,7 +117,6 @@ const JobAPI = { responseType: "blob", }); }, - }; export default JobAPI; diff --git a/frontend/src/api/module_generator/demo.ts b/frontend/src/api/module_generator/demo.ts index 55258151..ef70a8d9 100644 --- a/frontend/src/api/module_generator/demo.ts +++ b/frontend/src/api/module_generator/demo.ts @@ -12,7 +12,7 @@ const ExampleAPI = { }, getExampleDetail(query: number) { - return request>({ + return request>({ url: `${API_PATH}/detail/${query}`, method: "get", }); diff --git a/frontend/src/api/module_generator/gencode.ts b/frontend/src/api/module_generator/gencode.ts index e1551d4b..1c6d4122 100644 --- a/frontend/src/api/module_generator/gencode.ts +++ b/frontend/src/api/module_generator/gencode.ts @@ -7,97 +7,97 @@ const GencodeAPI = { listTable(query: GenTablePageQuery) { return request>>({ url: `${API_PATH}/list`, - method: 'get', - params: query - }) + method: "get", + params: query, + }); }, // 查询db数据库列表 listDbTable(query: DBTablePageQuery) { return request>>({ url: `${API_PATH}/db/list`, - method: 'get', - params: query - }) + method: "get", + params: query, + }); }, // 导入表 importTable(table_names: string[]) { return request({ url: `${API_PATH}/import`, - method: 'post', - data: table_names - }) + method: "post", + data: table_names, + }); }, // 查询表详细信息 getGenTableDetail(table_id: number) { return request>({ url: `${API_PATH}/detail/${table_id}`, - method: 'get' - }) + method: "get", + }); }, // 创建表 createTable(sql: string) { return request({ url: `${API_PATH}/create`, - method: 'post', - data: sql - }) + method: "post", + data: sql, + }); }, // 更新表信息 updateTable(data: GenTableSchema, table_id: number) { return request({ url: `${API_PATH}/update/${table_id}`, - method: 'put', - data - }) + method: "put", + data, + }); }, // 删除表数据 deleteTable(table_ids: number[]) { return request({ url: `${API_PATH}/delete`, - method: 'delete', - data: table_ids - }) + method: "delete", + data: table_ids, + }); }, // 批量生成代码 batchGenCode(table_names: string[]) { return request({ url: `${API_PATH}/batch/output`, - method: 'patch', + method: "patch", data: table_names, - responseType: 'blob' - }) + responseType: "blob", + }); }, // 生成代码到指定路径 genCodeToPath(table_name: string) { return request({ url: `${API_PATH}/output/${table_name}`, - method: 'post' - }) + method: "post", + }); }, // 预览生成代码 previewTable(id: number) { return request>>({ url: `${API_PATH}/preview/${id}`, - method: 'get' - }) + method: "get", + }); }, // 同步数据库 syncDb(table_name: string) { return request({ url: `${API_PATH}/sync_db/${table_name}`, - method: 'post' - }) - } + method: "post", + }); + }, }; export default GencodeAPI; @@ -219,4 +219,3 @@ export interface GenTableColumnSchema { /** 功能描述 */ description?: string; } - diff --git a/frontend/src/api/module_monitor/resource.ts b/frontend/src/api/module_monitor/resource.ts index 2e98fe8b..dc5867ef 100644 --- a/frontend/src/api/module_monitor/resource.ts +++ b/frontend/src/api/module_monitor/resource.ts @@ -15,7 +15,6 @@ export const ResourceAPI = { }); }, - /** * 上传文件 * @param formData 文件数据 @@ -118,8 +117,6 @@ export const ResourceAPI = { export default ResourceAPI; - - /** * 资源列表查询参数 */ diff --git a/frontend/src/api/module_system/menu.ts b/frontend/src/api/module_system/menu.ts index e7e8f30c..13ff7143 100644 --- a/frontend/src/api/module_system/menu.ts +++ b/frontend/src/api/module_system/menu.ts @@ -80,7 +80,7 @@ export interface MenuTable { hidden?: boolean; always_show?: boolean; title?: string; - params?: { key: string; value: string; }[]; + params?: { key: string; value: string }[]; affix?: boolean; status?: boolean; description?: string; diff --git a/frontend/src/api/module_system/tenant.ts b/frontend/src/api/module_system/tenant.ts index 043d22f7..6f81de1e 100644 --- a/frontend/src/api/module_system/tenant.ts +++ b/frontend/src/api/module_system/tenant.ts @@ -12,7 +12,7 @@ const TenantAPI = { }, detail(query: number) { - return request>({ + return request>({ url: `${API_PATH}/detail/${query}`, method: "get", }); diff --git a/frontend/src/api/module_system/user.ts b/frontend/src/api/module_system/user.ts index 155920d4..47df580a 100644 --- a/frontend/src/api/module_system/user.ts +++ b/frontend/src/api/module_system/user.ts @@ -250,7 +250,7 @@ export interface UserForm { id?: number; username?: string; name?: string; - dept_id?: number; + dept_id?: number; dept_name?: string; role_ids?: number[]; role_names?: string[]; diff --git a/frontend/src/components/CURD/ExportModal.vue b/frontend/src/components/CURD/ExportModal.vue index c9e01dba..546fd5aa 100644 --- a/frontend/src/components/CURD/ExportModal.vue +++ b/frontend/src/components/CURD/ExportModal.vue @@ -26,7 +26,11 @@ - + +const cols = computed(() => props.contentConfig.cols.map((col) => { if (col.initFn) { col.initFn(col); @@ -177,25 +180,28 @@ function handleExports() { } }); worksheet.columns = columns; - + if (exportsFormData.origin === ExportsOriginEnum.REMOTE) { if (props.contentConfig.exportsAction) { const lastFormData = props.queryParams ?? {}; - props.contentConfig.exportsAction(lastFormData).then((res) => { - worksheet.addRows(res); - workbook.xlsx - .writeBuffer() - .then((buffer) => { - saveXlsx(buffer, filename as string); - }) - .catch((error) => { - console.error("导出远程数据失败:", error); - ElMessage.error("导出远程数据失败"); - }); - }).catch((error) => { - console.error("获取远程数据失败:", error); - ElMessage.error("获取远程数据失败"); - }); + props.contentConfig + .exportsAction(lastFormData) + .then((res) => { + worksheet.addRows(res); + workbook.xlsx + .writeBuffer() + .then((buffer) => { + saveXlsx(buffer, filename as string); + }) + .catch((error) => { + console.error("导出远程数据失败:", error); + ElMessage.error("导出远程数据失败"); + }); + }) + .catch((error) => { + console.error("获取远程数据失败:", error); + ElMessage.error("获取远程数据失败"); + }); } else { ElMessage.error("未配置exportsAction"); } diff --git a/frontend/src/components/CURD/ImportModal.vue b/frontend/src/components/CURD/ImportModal.vue index 6cc1a270..726b3b52 100644 --- a/frontend/src/components/CURD/ImportModal.vue +++ b/frontend/src/components/CURD/ImportModal.vue @@ -1,43 +1,54 @@ + + - 搜索 - 重置 + + + + + + + + + + @@ -59,9 +122,26 @@ diff --git a/frontend/src/components/CURD/types.ts b/frontend/src/components/CURD/types.ts index fd9d87ef..909c1618 100644 --- a/frontend/src/components/CURD/types.ts +++ b/frontend/src/components/CURD/types.ts @@ -19,8 +19,23 @@ export type IObject = Record; */ type DateComponent = "date-picker" | "time-picker" | "time-select" | "custom-tag" | "input-tag"; type InputComponent = "input" | "select" | "input-number" | "cascader" | "tree-select"; -type OtherComponent = "text" | "radio" | "checkbox" | "switch" | "icon-select" | "custom"; -export type ISearchComponent = DateComponent | InputComponent; +type OtherComponent = + | "text" + | "radio" + | "checkbox" + | "switch" + | "rate" + | "slider" + | "icon-select" + | "custom"; +export type ISearchComponent = + | DateComponent + | InputComponent + | "radio" + | "checkbox" + | "switch" + | "rate" + | "slider"; export type IComponentType = DateComponent | InputComponent | OtherComponent; /** @@ -87,6 +102,33 @@ export interface ISearchConfig { form?: IForm; /** 自适应网格布局(使用时表单不要添加 style: { width: "200px" }) */ grid?: boolean | "left" | "right"; + /** 自定义组件映射 */ + customComponents?: Record; + /** 是否显示搜索按钮(默认:true) */ + showSearchButton?: boolean; + /** 是否显示重置按钮(默认:true) */ + showResetButton?: boolean; + /** 搜索按钮权限 */ + searchButtonPerm?: string | string[]; + /** 重置按钮权限 */ + resetButtonPerm?: string | string[]; + /** 是否显示搜索区域切换按钮(默认:false) */ + showToggle?: boolean; + /** 搜索区域切换按钮权限 */ + togglePerm?: string | string[]; + /** 自定义按钮组 */ + customButtons?: Array<{ + /** 按钮唯一标识 */ + key: string; + /** 按钮文本 */ + text: string; + /** 按钮属性 */ + attrs?: IObject; + /** 按钮权限 */ + perm?: string | string[]; + /** 点击事件处理函数 */ + handler?: (params: IObject, instance: any) => void; + }>; } /** @@ -105,13 +147,13 @@ export interface IContentConfig { pagePosition?: "left" | "right"; /** pagination组件属性 */ pagination?: - | boolean - | Partial< - Omit< - PaginationProps, - "v-model:page-size" | "v-model:current-page" | "total" | "currentPage" - > - >; + | boolean + | Partial< + Omit< + PaginationProps, + "v-model:page-size" | "v-model:current-page" | "total" | "currentPage" + > + >; /** 列表的网络请求函数(需返回promise) */ indexAction: (queryParams: T) => Promise; /** 默认的分页相关的请求参数 */ @@ -173,17 +215,17 @@ export interface IContentConfig { show?: boolean; /** 模板类型 */ templet?: - | "image" - | "list" - | "url" - | "switch" - | "input" - | "price" - | "percent" - | "icon" - | "date" - | "tool" - | "custom"; + | "image" + | "list" + | "url" + | "switch" + | "input" + | "price" + | "percent" + | "icon" + | "date" + | "tool" + | "custom"; /** image模板相关参数 */ imageWidth?: number; /** image模板相关参数 */ @@ -270,7 +312,7 @@ export type IFormItems = Array<{ /** 属性 */ attrs?: IObject; /** 选项 */ - options?: Array<{ label: string; value: any;[key: string]: any }> | Ref; + options?: Array<{ label: string; value: any; [key: string]: any }> | Ref; /** 规则 */ rules?: FormItemRule[]; /** 初始值 */ diff --git a/frontend/src/components/CURD/usePage.ts b/frontend/src/components/CURD/usePage.ts index bf836331..0005a30d 100644 --- a/frontend/src/components/CURD/usePage.ts +++ b/frontend/src/components/CURD/usePage.ts @@ -55,7 +55,9 @@ function usePage() { } } catch (error) { console.error("打开新增模态框失败:", error); - ElMessage.error("打开新增模态框失败: " + (error instanceof Error ? error.message : String(error))); + ElMessage.error( + "打开新增模态框失败: " + (error instanceof Error ? error.message : String(error)) + ); } } @@ -84,7 +86,9 @@ function usePage() { } } catch (error) { console.error("打开编辑模态框失败:", error); - ElMessage.error("打开编辑模态框失败: " + (error instanceof Error ? error.message : String(error))); + ElMessage.error( + "打开编辑模态框失败: " + (error instanceof Error ? error.message : String(error)) + ); } } @@ -113,7 +117,9 @@ function usePage() { } } catch (error) { console.error("打开查看模态框失败:", error); - ElMessage.error("打开查看模态框失败: " + (error instanceof Error ? error.message : String(error))); + ElMessage.error( + "打开查看模态框失败: " + (error instanceof Error ? error.message : String(error)) + ); } } @@ -153,7 +159,9 @@ function usePage() { searchRef.value?.toggleVisible(); } catch (error) { console.error("切换搜索栏失败:", error); - ElMessage.error("切换搜索栏失败: " + (error instanceof Error ? error.message : String(error))); + ElMessage.error( + "切换搜索栏失败: " + (error instanceof Error ? error.message : String(error)) + ); } } @@ -190,7 +198,9 @@ function usePage() { handleSubmitClick(); } catch (error) { console.error("处理更多操作失败:", error); - ElMessage.error("处理更多操作失败: " + (error instanceof Error ? error.message : String(error))); + ElMessage.error( + "处理更多操作失败: " + (error instanceof Error ? error.message : String(error)) + ); } } diff --git a/frontend/src/components/DatePicker/index.vue b/frontend/src/components/DatePicker/index.vue index 805b0860..6982b4d0 100644 --- a/frontend/src/components/DatePicker/index.vue +++ b/frontend/src/components/DatePicker/index.vue @@ -15,67 +15,66 @@ diff --git a/frontend/src/components/IntervalTab/index.vue b/frontend/src/components/IntervalTab/index.vue index 75e2b752..8eeba257 100644 --- a/frontend/src/components/IntervalTab/index.vue +++ b/frontend/src/components/IntervalTab/index.vue @@ -1,33 +1,58 @@ @@ -54,7 +54,9 @@ const displayText = computed(() => { white-space: pre-wrap; word-break: break-word; margin: 0; - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + font-family: + ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", + monospace; font-size: 12px; } diff --git a/frontend/src/components/MenuSearch/index.vue b/frontend/src/components/MenuSearch/index.vue index 4fd06e7e..2036b54d 100644 --- a/frontend/src/components/MenuSearch/index.vue +++ b/frontend/src/components/MenuSearch/index.vue @@ -296,7 +296,8 @@ function loadRoutes(routes: RouteRecordRaw[], parentPath = "") { : `${parentPath}${parentPath.endsWith("/") ? "" : "/"}${route.path}`; // 检查是否需要排除 - if (excludedRoutes.value.includes(route.path) || isExternal(route.path) || route.meta?.hidden) return; + if (excludedRoutes.value.includes(route.path) || isExternal(route.path) || route.meta?.hidden) + return; // 处理有子路由的情况 if (route.children) { @@ -316,7 +317,7 @@ function loadRoutes(routes: RouteRecordRaw[], parentPath = "") { } // 递归处理子路由 loadRoutes(route.children, path); - } + } // 处理没有子路由但有title的情况 else if (route.meta?.title) { const title = route.meta.title === "dashboard" ? "首页" : route.meta.title; diff --git a/frontend/src/components/Notification/index.vue b/frontend/src/components/Notification/index.vue index c5887c7f..56866001 100644 --- a/frontend/src/components/Notification/index.vue +++ b/frontend/src/components/Notification/index.vue @@ -13,11 +13,11 @@
- {{ item.notice_type === '1' ? '通知' : '公告' }} + {{ item.notice_type === "1" ? "通知" : "公告" }} - + {{ item.notice_content }} @@ -28,7 +28,7 @@
- +
查看更多 @@ -36,7 +36,12 @@ - + 全部已读
@@ -50,7 +55,12 @@ - +
@@ -89,7 +99,7 @@ const noticeDetail = ref(null); * 获取我的通知公告 */ async function featchMyNotice() { - await noticeStore.getNotice() + await noticeStore.getNotice(); noticeList.value = noticeStore.noticeList; } @@ -100,7 +110,9 @@ function handleViewMoreNotice() { // 全部已读:将这些公告禁用(status=false),刷新后不再出现 function handleMarkAllAsRead() { - const ids = noticeList.value.map((item) => item.id).filter((id): id is number => id !== undefined); + const ids = noticeList.value + .map((item) => item.id) + .filter((id): id is number => id !== undefined); NoticeAPI.batchAvailableNotice({ ids, status: false }).then(async () => { await noticeStore.getNotice(); noticeList.value = noticeStore.noticeList; @@ -110,8 +122,6 @@ function handleMarkAllAsRead() { onMounted(() => { featchMyNotice(); }); - - diff --git a/frontend/src/components/OperationColumn/index.vue b/frontend/src/components/OperationColumn/index.vue index b5d007ea..eb5c1354 100644 --- a/frontend/src/components/OperationColumn/index.vue +++ b/frontend/src/components/OperationColumn/index.vue @@ -49,8 +49,8 @@ const calculateWidth = () => { // 计算最终宽度 const finalWidth = computed(() => { - const widthNum = typeof props.width === 'number' ? props.width : Number(props.width); - const minWidthNum = typeof props.minWidth === 'number' ? props.minWidth : Number(props.minWidth); + const widthNum = typeof props.width === "number" ? props.width : Number(props.width); + const minWidthNum = typeof props.minWidth === "number" ? props.minWidth : Number(props.minWidth); return widthNum || operationWidth.value || minWidthNum; }); diff --git a/frontend/src/components/SizeSelect/index.vue b/frontend/src/components/SizeSelect/index.vue index e4993724..a329289d 100644 --- a/frontend/src/components/SizeSelect/index.vue +++ b/frontend/src/components/SizeSelect/index.vue @@ -1,4 +1,4 @@ - + - 清空对话 - {{ isConnected ? '断开连接' : '重新连接' }} + + 清空对话 + + + {{ isConnected ? "断开连接" : "重新连接" }} +
@@ -30,8 +45,10 @@

FA智能助手

-

我是您的专属AI助手,可以帮您回答问题、处理任务和进行智能对话

- +

+ 我是您的专属AI助手,可以帮您回答问题、处理任务和进行智能对话 +

+

系统介绍

@@ -55,9 +72,9 @@
-
@@ -71,11 +88,14 @@
- {{ message.type === 'user' ? 'You' : 'FA助手' }} + {{ message.type === "user" ? "You" : "FA助手" }}
-
+
@@ -85,8 +105,18 @@
- - + +
@@ -94,13 +124,7 @@
- +
@@ -132,9 +156,7 @@
@@ -143,8 +165,8 @@ + diff --git a/frontend/src/views/module_application/myapp/components/InternalApp.vue b/frontend/src/views/module_application/myapp/components/InternalApp.vue index 9710bbf8..a6e72f96 100644 --- a/frontend/src/views/module_application/myapp/components/InternalApp.vue +++ b/frontend/src/views/module_application/myapp/components/InternalApp.vue @@ -2,9 +2,9 @@