From 76e92b461da70da961261e04ebfb74c9f2e113b2 Mon Sep 17 00:00:00 2001 From: LYC Date: Sat, 26 Apr 2025 18:08:23 +0800 Subject: [PATCH] =?UTF-8?q?[tag]=20=E5=AE=9E=E7=8E=B0=E4=BA=86=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E5=92=8C=E8=AE=BE=E6=96=BD=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B8=80=E4=BA=9B=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=EF=BC=8C=E5=B0=81=E8=A3=85=E4=BA=86=E4=B8=80=E4=BA=9BAPI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env | 4 +- public/favicon.svg | 204 ++++++++++++++++++++++++++- src/locales/langs/zh-cn.ts | 4 +- src/router/elegant/routes.ts | 3 +- src/store/modules/auth/index.ts | 1 + src/typings/components.d.ts | 1 + src/utils/api.ts | 19 +++ src/views/ai/index.vue | 93 ++++++++++++- src/views/department/index.vue | 236 +++++++++++++++++++++++++++++++- src/views/orders/list/index.vue | 175 ++++++++++++++--------- 10 files changed, 665 insertions(+), 75 deletions(-) create mode 100644 src/utils/api.ts diff --git a/.env b/.env index 092304b..5a2f46b 100644 --- a/.env +++ b/.env @@ -2,9 +2,9 @@ # if use a sub directory, it must be end with "/", like "/admin/" but not "/admin" VITE_BASE_URL=/ -VITE_APP_TITLE=SoybeanAdmin +VITE_APP_TITLE=Admin -VITE_APP_DESC=SoybeanAdmin is a fresh and elegant admin template +VITE_APP_DESC=Admin is a fresh and elegant admin template # the prefix of the icon name VITE_ICON_PREFIX=icon diff --git a/public/favicon.svg b/public/favicon.svg index 169b2ab..9249c78 100644 --- a/public/favicon.svg +++ b/public/favicon.svg @@ -1 +1,203 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 9334932..451fef0 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -199,7 +199,9 @@ const local: App.I18n.Schema = { plan: "计划管理", department: "部门管理", orders_create: "创建工单", - orders_list: "工单列表" + orders_list: "工单列表", + ai: "AI服务状态", + employee_list: "人员列表" }, page: { login: { diff --git a/src/router/elegant/routes.ts b/src/router/elegant/routes.ts index 9a78c4f..5b7d901 100644 --- a/src/router/elegant/routes.ts +++ b/src/router/elegant/routes.ts @@ -56,7 +56,8 @@ export const generatedRoutes: GeneratedRoute[] = [ component: 'layout.base$view.ai', meta: { title: 'ai', - i18nKey: 'route.ai' + i18nKey: 'route.ai', + order: 25 } }, { diff --git a/src/store/modules/auth/index.ts b/src/store/modules/auth/index.ts index c1c7672..a8b4da3 100644 --- a/src/store/modules/auth/index.ts +++ b/src/store/modules/auth/index.ts @@ -112,6 +112,7 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => { //console.log(error?.status == 200) if (error?.status == 200) { + console.log("200") let info: Api.Auth.UserInfo = { userId: data.employeeId.toString(), userName: data.name, diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index b3e8227..81e99a0 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -18,6 +18,7 @@ declare module 'vue' { ADivider: typeof import('ant-design-vue/es')['Divider'] ADrawer: typeof import('ant-design-vue/es')['Drawer'] ADropdown: typeof import('ant-design-vue/es')['Dropdown'] + AEmpty: typeof import('ant-design-vue/es')['Empty'] AForm: typeof import('ant-design-vue/es')['Form'] AFormItem: typeof import('ant-design-vue/es')['FormItem'] AInput: typeof import('ant-design-vue/es')['Input'] diff --git a/src/utils/api.ts b/src/utils/api.ts new file mode 100644 index 0000000..c67a85e --- /dev/null +++ b/src/utils/api.ts @@ -0,0 +1,19 @@ +// api.ts +import axios from 'axios'; +import { localStg } from '@/utils/storage'; + +// 封装网络请求的接口 +export const apiRequest = async (path: string, data: any) => { + let url = "http://localhost:8080" + path; + const token = localStg.get('token'); // 获取 token + try { + const response = await axios.post(url, data, { + headers: { + Authorization: `Bearer ${token}`, // 添加 Authorization 头 + }, + }); + return response.data; // 返回响应数据 + } catch (error) { + throw new Error('请求失败'); // 抛出错误 + } +}; \ No newline at end of file diff --git a/src/views/ai/index.vue b/src/views/ai/index.vue index 8c16bd2..00034ac 100644 --- a/src/views/ai/index.vue +++ b/src/views/ai/index.vue @@ -1,7 +1,92 @@ - - - + + + \ No newline at end of file diff --git a/src/views/department/index.vue b/src/views/department/index.vue index 138af6f..fabda97 100644 --- a/src/views/department/index.vue +++ b/src/views/department/index.vue @@ -1,7 +1,235 @@ - - - + + + \ No newline at end of file diff --git a/src/views/orders/list/index.vue b/src/views/orders/list/index.vue index d442c03..347a7fb 100644 --- a/src/views/orders/list/index.vue +++ b/src/views/orders/list/index.vue @@ -1,127 +1,178 @@ + \ No newline at end of file