refactor: ♻️ 优化请求接口

This commit is contained in:
tsl 2026-04-16 09:50:30 +08:00
parent cc30c088c4
commit 82c2b0f1bd
24 changed files with 8535 additions and 78 deletions

1
.env
View File

@ -1 +1,2 @@
VITE_APP_NAME=工单系统监测 VITE_APP_NAME=工单系统监测
VITE_API_BASE=https://crm.yunvip123.com/api

27
data/api/README.md Normal file
View File

@ -0,0 +1,27 @@
# API 开发与类型定义流程
为了保持代码健壮性,新增接口时请遵循以下步骤:
## 1. 记录请求与响应 (data/api/)
- **分文件夹管理**:每个接口在 `data/api/` 下拥有独立文件夹。
- **请求逻辑 (`request.ts`)**:使用 Axios 编写接口调用逻辑,调用 `saveResponse(__dirname, data)` 自动保存响应。
- **响应数据 (`response.json`)**:运行 `npx tsx data/api/run.ts` 后,会在该接口文件夹下生成或更新真实数据。
- **自动化工具**:一键同步所有接口数据:
```bash
npx tsx data/api/run.ts
```
## 2. 定义类型 (src/types/api.ts)
- 根据生成的 `response.json` 数据结构,在 `src/types/api.ts` 中创建接口。
- **规则**:新增成员变量时务必添加 JSDoc 注释。
## 3. 注册 URL (src/constants/api.ts)
- 在 `API_BASE` 基础上定义新的常量。
## 4. 业务调用
- 在对应的 Pinia Store 中使用 `ApiResponse<T>` 包装请求返回值。

23
data/api/client.ts Normal file
View File

@ -0,0 +1,23 @@
import fs from "node:fs";
import path from "node:path";
import axios from "axios";
import dotenv from "dotenv";
dotenv.config({ path: path.resolve(process.cwd(), ".env.local") });
const client = axios.create({
baseURL: "https://crm.yunvip123.com/api",
headers: {
"Content-Type": "application/json",
Host: "crm.yunvip123.com",
},
});
/** 保存响应到接口所在目录的 response.json */
export function saveResponse(dirPath: string, data: any) {
const filePath = path.join(dirPath, "response.json");
fs.writeFileSync(filePath, JSON.stringify(data, null, 2), "utf-8");
console.log(`[SUCCESS] 已保存至: ${path.relative(process.cwd(), filePath)}`);
}
export default client;

24
data/api/login/request.ts Normal file
View File

@ -0,0 +1,24 @@
import path from "path";
import { fileURLToPath } from "url";
import client, { saveResponse } from "../client.js";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export async function login() {
const username = process.env.TEST_USERNAME;
const password = process.env.TEST_PASSWORD;
const response = await client.post("/SystemUser/Login", {
Account: username,
PassWord: password,
});
saveResponse(__dirname, response.data);
const setCookie = response.headers["set-cookie"];
if (setCookie) {
client.defaults.headers.common["Cookie"] = setCookie[0].split(";")[0];
}
return response.data;
}

View File

@ -0,0 +1,508 @@
{
"success": true,
"code": null,
"msg": "执行成功",
"data": {
"GID": "512860ad-aa4a-4268-a5d9-6c7d2e28680b",
"SR_GID": "44a2ccd1-bd45-4114-a999-2f2222510e44",
"SD_GID": "f124825e-f2b8-414e-b03c-cfca47a9922e",
"SU_Account": "18688886666_777",
"SU_Password": "PdvNK8uJWJU=",
"SU_AdminType": 11,
"SU_IsDisable": 0,
"SU_UserName": "A田森林",
"SU_Telephone": "",
"SU_LastLoginTime": null,
"SU_CreateTime": "2022-05-27 16:04:24",
"SU_Creator": null,
"SU_Flag": null,
"SU_Code": "777",
"SU_BrowseRole": 2,
"SU_QQCode": "",
"SU_WeChatImageUrl": null,
"SU_IsShunt": 0,
"MaxReception": 0,
"AG_GID": "0000",
"SU_WeChatCode": null,
"SU_UserType": 320,
"SR_Name": "7-开发人员",
"SD_Name": null,
"AG_Domain": null,
"AG_Type": 0,
"AG_SoftwareName": null,
"AG_Contacter": null,
"DL_CreatNum": null,
"DL_SloveNum": null,
"BUGNum": null,
"DMNum": null,
"TESNum": null,
"ACNum": null,
"WorkHour": null,
"WaitCloseNum": null,
"CloseNum": null,
"SRRole": [
{
"GID": "1de667e5-079b-4631-8bad-2077164be47a",
"MM_GID": "2168612e-126c-4df3-a535-35fba7459c1a",
"RS_Name": "获取菜单列表",
"RS_LinkUrl": "/api/SystemMenu/GetListMenu",
"RS_IsShow": 1,
"RS_Sort": 13,
"RS_CreateTime": "2018-04-11 10:27:18",
"RS_Code": null
},
{
"GID": "d6e92461-2511-4c9f-93b0-a8e413520d48",
"MM_GID": "d88b1caa-b4cf-407f-bc25-9339ae2e5ece",
"RS_Name": "修改工单",
"RS_LinkUrl": "/api/DemandManage/EditWorkOrder",
"RS_IsShow": 0,
"RS_Sort": 4,
"RS_CreateTime": "2025-03-04 09:14:57",
"RS_Code": ""
},
{
"GID": "bffee97c-139c-4735-a76d-dbe9c4d64637",
"MM_GID": "a9c87517-4da2-4f98-a5b9-35bf277fb375",
"RS_Name": "查询日志记录",
"RS_LinkUrl": "/api/SystemLog/QueryList",
"RS_IsShow": 1,
"RS_Sort": 100,
"RS_CreateTime": "2019-11-21 13:43:57",
"RS_Code": null
},
{
"GID": "b8bd82f6-e9fa-4e8a-b77c-86803610fc7f",
"MM_GID": "a9c87517-4da2-4f98-a5b9-35bf277fb375",
"RS_Name": "系统日志分页",
"RS_LinkUrl": "/api/SystemLog/QueryPage",
"RS_IsShow": 0,
"RS_Sort": 1,
"RS_CreateTime": "2018-10-25 19:55:07",
"RS_Code": null
},
{
"GID": "a3b894b1-1064-42ca-90c8-6c005439d2ec",
"MM_GID": "2168612e-126c-4df3-a535-35fba7459c1a",
"RS_Name": "根据菜单GID获取对应资源",
"RS_LinkUrl": "/api/SystemResource/GetListResourceByMenuGID",
"RS_IsShow": 1,
"RS_Sort": 5,
"RS_CreateTime": "2018-04-10 09:51:47",
"RS_Code": null
},
{
"GID": "9600f960-3b5f-4e1e-ae84-1e607919ff30",
"MM_GID": "d88b1caa-b4cf-407f-bc25-9339ae2e5ece",
"RS_Name": "解决工单",
"RS_LinkUrl": "/api/DemandManage/ResolveWorkOrders",
"RS_IsShow": 0,
"RS_Sort": 13,
"RS_CreateTime": "2025-03-04 09:17:51",
"RS_Code": ""
},
{
"GID": "4bac85dc-9f40-432d-a851-2f97408d83b6",
"MM_GID": "d88b1caa-b4cf-407f-bc25-9339ae2e5ece",
"RS_Name": "编辑工时",
"RS_LinkUrl": "/api/DemandManage/EditWorkHour",
"RS_IsShow": 1,
"RS_Sort": 6,
"RS_CreateTime": "2025-03-04 09:15:45",
"RS_Code": null
},
{
"GID": "c696815b-da5c-4d9f-ba12-6087ca7beedc",
"MM_GID": "d88b1caa-b4cf-407f-bc25-9339ae2e5ece",
"RS_Name": "获取项目列表",
"RS_LinkUrl": "/api/ProjectMange/GetProject",
"RS_IsShow": 0,
"RS_Sort": 2,
"RS_CreateTime": "2025-03-04 09:14:19",
"RS_Code": ""
},
{
"GID": "ab7ed673-4bce-4865-9688-fa1fd9d31fd7",
"MM_GID": "797aff6a-ecb9-4120-831d-150f96c8d963",
"RS_Name": "编辑项目状态",
"RS_LinkUrl": "/api/ProjectMange/EditProjectState",
"RS_IsShow": 1,
"RS_Sort": 100,
"RS_CreateTime": "2022-09-29 09:25:17",
"RS_Code": null
},
{
"GID": "7b30e174-7472-4d8c-a243-0d5bab682e8e",
"MM_GID": "797aff6a-ecb9-4120-831d-150f96c8d963",
"RS_Name": "更新统计",
"RS_LinkUrl": "/api/ProjectMange/GetProjectStat",
"RS_IsShow": 1,
"RS_Sort": 120,
"RS_CreateTime": "2020-07-27 10:10:37",
"RS_Code": "P42"
},
{
"GID": "e283a777-a7a1-48e9-abb4-030bb0f21990",
"MM_GID": "2e73c23f-f635-45a3-8ed3-1f75245c099c",
"RS_Name": "添加工单",
"RS_LinkUrl": "/api/DemandManage/AddDemandList",
"RS_IsShow": 1,
"RS_Sort": 110,
"RS_CreateTime": "2019-12-02 09:57:30",
"RS_Code": "E42"
},
{
"GID": "a9934927-1756-4b31-a718-2cb4bd7fb9b7",
"MM_GID": "2e73c23f-f635-45a3-8ed3-1f75245c099c",
"RS_Name": "删除工单",
"RS_LinkUrl": "/api/DemandManage/DelDemandList",
"RS_IsShow": 1,
"RS_Sort": 140,
"RS_CreateTime": "2020-07-27 10:01:17",
"RS_Code": "E40"
},
{
"GID": "615b1a1e-f0a2-4596-9cd0-b10e5831db3c",
"MM_GID": "d88b1caa-b4cf-407f-bc25-9339ae2e5ece",
"RS_Name": "删除工单信息",
"RS_LinkUrl": "/api/DemandManage/DeleteWorkOrders",
"RS_IsShow": 1,
"RS_Sort": 5,
"RS_CreateTime": "2025-03-04 09:15:18",
"RS_Code": null
},
{
"GID": "279b5274-3b1c-4d4a-a958-e4da67908c2b",
"MM_GID": "d88b1caa-b4cf-407f-bc25-9339ae2e5ece",
"RS_Name": "工单确认状态",
"RS_LinkUrl": "/api/DemandManage/EditConfirm",
"RS_IsShow": 0,
"RS_Sort": 7,
"RS_CreateTime": "2025-03-04 09:16:19",
"RS_Code": ""
},
{
"GID": "148ddcdf-a466-42af-ac7c-dd5a89043c39",
"MM_GID": "d88b1caa-b4cf-407f-bc25-9339ae2e5ece",
"RS_Name": "关闭工单",
"RS_LinkUrl": "/api/DemandManage/CloseWorkOrders",
"RS_IsShow": 0,
"RS_Sort": 9,
"RS_CreateTime": "2025-03-04 09:16:49",
"RS_Code": ""
},
{
"GID": "35af5158-e717-40c9-8278-30886a926cc9",
"MM_GID": "2168612e-126c-4df3-a535-35fba7459c1a",
"RS_Name": "修改密码",
"RS_LinkUrl": "/api/SystemUser/ChangePwd",
"RS_IsShow": 1,
"RS_Sort": 23,
"RS_CreateTime": "2018-05-04 11:19:09",
"RS_Code": null
},
{
"GID": "dd91bb92-4977-4844-ba71-769572a35c65",
"MM_GID": "2168612e-126c-4df3-a535-35fba7459c1a",
"RS_Name": "根据角色GID获取对应资源",
"RS_LinkUrl": "/api/SystemRole/GetMenuResourceBySR_GID",
"RS_IsShow": 1,
"RS_Sort": 6,
"RS_CreateTime": "2018-04-10 09:52:34",
"RS_Code": null
},
{
"GID": "e62504e6-1e2c-46c8-9d5b-62352a3aea20",
"MM_GID": "2168612e-126c-4df3-a535-35fba7459c1a",
"RS_Name": "获取待处理与待关闭工单统计",
"RS_LinkUrl": "/api/DemandManage/QueryIndexCount",
"RS_IsShow": 0,
"RS_Sort": 100,
"RS_CreateTime": "2020-07-27 10:06:35",
"RS_Code": null
},
{
"GID": "e3913650-20d9-4dfc-98b6-24f9cfee6066",
"MM_GID": "d88b1caa-b4cf-407f-bc25-9339ae2e5ece",
"RS_Name": "获取工单列表数据",
"RS_LinkUrl": "/api/DemandManage/GetWorkOrderListPage",
"RS_IsShow": 0,
"RS_Sort": 1,
"RS_CreateTime": "2025-03-04 09:13:51",
"RS_Code": ""
},
{
"GID": "05277dcc-acdf-400c-972a-ac09100d9ecf",
"MM_GID": "d88b1caa-b4cf-407f-bc25-9339ae2e5ece",
"RS_Name": "创建工单",
"RS_LinkUrl": "/api/DemandManage/AddDemandList",
"RS_IsShow": 0,
"RS_Sort": 3,
"RS_CreateTime": "2025-03-04 09:14:44",
"RS_Code": ""
},
{
"GID": "634305c7-c82d-4ded-89ce-fe2f56bf8e98",
"MM_GID": "2168612e-126c-4df3-a535-35fba7459c1a",
"RS_Name": "获取用户公告",
"RS_LinkUrl": "/api/UsersNotice/GetUsersNoticeList",
"RS_IsShow": 0,
"RS_Sort": 0,
"RS_CreateTime": "2021-04-20 13:29:23",
"RS_Code": null
},
{
"GID": "cd8a461e-61cf-475d-a102-0c847eddfefc",
"MM_GID": "797aff6a-ecb9-4120-831d-150f96c8d963",
"RS_Name": "项目分页",
"RS_LinkUrl": "/api/ProjectMange/GetProjectPage",
"RS_IsShow": 0,
"RS_Sort": 90,
"RS_CreateTime": "2019-12-02 09:16:30",
"RS_Code": ""
},
{
"GID": "1dbe692c-f31c-4dff-86e2-aa457e21061d",
"MM_GID": "2168612e-126c-4df3-a535-35fba7459c1a",
"RS_Name": "获取个人资料",
"RS_LinkUrl": "/api/SystemUser/GetObjectUser",
"RS_IsShow": 1,
"RS_Sort": 21,
"RS_CreateTime": "2018-05-04 11:18:24",
"RS_Code": null
},
{
"GID": "bd9518e0-70e1-47c7-8c6a-5c13694f1af5",
"MM_GID": "2168612e-126c-4df3-a535-35fba7459c1a",
"RS_Name": "历史记录",
"RS_LinkUrl": "/api/SystemLog/QueryList",
"RS_IsShow": 0,
"RS_Sort": 100,
"RS_CreateTime": "2019-11-21 13:41:15",
"RS_Code": ""
},
{
"GID": "8613c0af-89c7-4398-b017-55d2ae2ca157",
"MM_GID": "2168612e-126c-4df3-a535-35fba7459c1a",
"RS_Name": "用户列表",
"RS_LinkUrl": "/api/SystemUser/GetListUser",
"RS_IsShow": 0,
"RS_Sort": 1,
"RS_CreateTime": "2018-04-09 19:50:58",
"RS_Code": null
},
{
"GID": "e513c484-5ec0-4380-a477-c83623b4782b",
"MM_GID": "2168612e-126c-4df3-a535-35fba7459c1a",
"RS_Name": "工单列表",
"RS_LinkUrl": "/api/DemandManage/GetDemandList",
"RS_IsShow": 1,
"RS_Sort": 100,
"RS_CreateTime": "2019-12-02 09:21:38",
"RS_Code": ""
},
{
"GID": "21040880-1df6-494d-866a-b10fc257393d",
"MM_GID": "2168612e-126c-4df3-a535-35fba7459c1a",
"RS_Name": "查询产品",
"RS_LinkUrl": "/api/ProductManage/GetProductMange",
"RS_IsShow": 1,
"RS_Sort": 100,
"RS_CreateTime": "2019-12-02 09:26:23",
"RS_Code": null
},
{
"GID": "baa47e69-9143-4860-84d7-e99c60eeb417",
"MM_GID": "d88b1caa-b4cf-407f-bc25-9339ae2e5ece",
"RS_Name": "完成工单",
"RS_LinkUrl": "/api/DemandManage/FinishWorkOrders",
"RS_IsShow": 0,
"RS_Sort": 8,
"RS_CreateTime": "2025-03-04 09:16:36",
"RS_Code": ""
},
{
"GID": "e79ef9d5-f0ae-4efb-a747-2097d64c857e",
"MM_GID": "2168612e-126c-4df3-a535-35fba7459c1a",
"RS_Name": "工单分页",
"RS_LinkUrl": "/api/DemandManage/GetDemandListPage",
"RS_IsShow": 0,
"RS_Sort": 100,
"RS_CreateTime": "2019-12-02 09:20:16",
"RS_Code": ""
},
{
"GID": "ad92007d-a867-4bee-b719-4e94323c2700",
"MM_GID": "d88b1caa-b4cf-407f-bc25-9339ae2e5ece",
"RS_Name": "编辑备注",
"RS_LinkUrl": "/api/DemandManage/EditWorkOrdersRemark",
"RS_IsShow": 0,
"RS_Sort": 10,
"RS_CreateTime": "2025-03-04 09:17:05",
"RS_Code": ""
},
{
"GID": "2acdfb25-66e3-4473-8f2c-c802122f515b",
"MM_GID": "d88b1caa-b4cf-407f-bc25-9339ae2e5ece",
"RS_Name": "指派工单",
"RS_LinkUrl": "/api/DemandManage/AssignWorkOrder",
"RS_IsShow": 0,
"RS_Sort": 100,
"RS_CreateTime": "2025-03-16 22:34:16",
"RS_Code": ""
},
{
"GID": "a1ce3461-58cd-4b45-8292-71cb73472128",
"MM_GID": "2e73c23f-f635-45a3-8ed3-1f75245c099c",
"RS_Name": "编辑需求",
"RS_LinkUrl": "/api/DemandManage/EditDemandList",
"RS_IsShow": 1,
"RS_Sort": 120,
"RS_CreateTime": "2019-12-02 09:57:58",
"RS_Code": "E41"
},
{
"GID": "31c9f51d-764e-45d5-aaef-82917ddc7013",
"MM_GID": "797aff6a-ecb9-4120-831d-150f96c8d963",
"RS_Name": "项目备注",
"RS_LinkUrl": "/api/ProjectMange/AddProjectRemark",
"RS_IsShow": 1,
"RS_Sort": 130,
"RS_CreateTime": "2020-07-27 10:09:48",
"RS_Code": "P43"
},
{
"GID": "d96bb278-771f-4411-bb22-a74d0141defd",
"MM_GID": "2168612e-126c-4df3-a535-35fba7459c1a",
"RS_Name": "获取部门列表",
"RS_LinkUrl": "/api/SystemDepartment/GetListDepartment",
"RS_IsShow": 0,
"RS_Sort": 2,
"RS_CreateTime": "2018-04-09 20:44:31",
"RS_Code": null
},
{
"GID": "1dc15655-57fc-4505-94e2-90cc3df73e13",
"MM_GID": "2168612e-126c-4df3-a535-35fba7459c1a",
"RS_Name": "修改当前个人资料",
"RS_LinkUrl": "/api/SystemUser/EditProfile",
"RS_IsShow": 1,
"RS_Sort": 22,
"RS_CreateTime": "2018-05-04 11:18:36",
"RS_Code": null
},
{
"GID": "52b98bfb-d55f-457d-a3ff-7bf2eefa55a3",
"MM_GID": "d88b1caa-b4cf-407f-bc25-9339ae2e5ece",
"RS_Name": "添加测试结果",
"RS_LinkUrl": "/api/DemandManage/TestWorkOrdersResult",
"RS_IsShow": 0,
"RS_Sort": 11,
"RS_CreateTime": "2025-03-04 09:17:20",
"RS_Code": ""
},
{
"GID": "03d7a89b-298f-4113-9090-d12fccb7aab4",
"MM_GID": "797aff6a-ecb9-4120-831d-150f96c8d963",
"RS_Name": "关闭项目",
"RS_LinkUrl": "/api/ProjectMange/CloseProject",
"RS_IsShow": 1,
"RS_Sort": 100,
"RS_CreateTime": "2021-01-12 17:13:10",
"RS_Code": "P45"
},
{
"GID": "fcc70c6a-03bb-4739-8676-e4ac42390c5c",
"MM_GID": "2168612e-126c-4df3-a535-35fba7459c1a",
"RS_Name": "修改公告已读状态",
"RS_LinkUrl": "/api/UsersNotice/EditState",
"RS_IsShow": 0,
"RS_Sort": 0,
"RS_CreateTime": "2021-04-20 13:38:11",
"RS_Code": null
},
{
"GID": "76478667-e6be-49ea-b82d-f9f98350e186",
"MM_GID": "d88b1caa-b4cf-407f-bc25-9339ae2e5ece",
"RS_Name": "激活工单",
"RS_LinkUrl": "/api/DemandManage/ActivateWorkOrder",
"RS_IsShow": 0,
"RS_Sort": 12,
"RS_CreateTime": "2025-03-04 09:17:35",
"RS_Code": ""
}
],
"MenuInfoList": [
{
"GID": "fd47e5a8-d361-4cc5-864f-7e19dfd2856e",
"MM_Name": "工单统计",
"MM_LinkUrl": "/WebUI/DemandManagement/WorkOrderStat.html",
"MM_ParentID": "4dd3c69a-01e7-4aed-9c75-a94037ac9b5d",
"MM_Sort": 1,
"MM_Mark": null,
"MM_Ico": "",
"ResourceList": null
},
{
"GID": "797aff6a-ecb9-4120-831d-150f96c8d963",
"MM_Name": "项目管理",
"MM_LinkUrl": "/WebUI/ProjectMange/ProjectList.html",
"MM_ParentID": "",
"MM_Sort": 4,
"MM_Mark": null,
"MM_Ico": "",
"ResourceList": null
},
{
"GID": "d88b1caa-b4cf-407f-bc25-9339ae2e5ece",
"MM_Name": "工单列表",
"MM_LinkUrl": "/WebUI/DemandManagement/DemandListNew.html",
"MM_ParentID": "",
"MM_Sort": 9,
"MM_Mark": null,
"MM_Ico": "",
"ResourceList": null
},
{
"GID": "4dd3c69a-01e7-4aed-9c75-a94037ac9b5d",
"MM_Name": "统计报表",
"MM_LinkUrl": "",
"MM_ParentID": "",
"MM_Sort": 15,
"MM_Mark": null,
"MM_Ico": "",
"ResourceList": null
},
{
"GID": "9ebc0631-149e-4d07-927d-5da9aaea1656",
"MM_Name": "系统管理",
"MM_LinkUrl": "",
"MM_ParentID": "",
"MM_Sort": 20,
"MM_Mark": null,
"MM_Ico": "",
"ResourceList": null
},
{
"GID": "a9c87517-4da2-4f98-a5b9-35bf277fb375",
"MM_Name": "系统日志",
"MM_LinkUrl": "/WebUI/System/SystemLogList.html",
"MM_ParentID": "9ebc0631-149e-4d07-927d-5da9aaea1656",
"MM_Sort": 99,
"MM_Mark": null,
"MM_Ico": "",
"ResourceList": null
},
{
"GID": "2168612e-126c-4df3-a535-35fba7459c1a",
"MM_Name": "公共资源",
"MM_LinkUrl": "",
"MM_ParentID": "",
"MM_Sort": 100,
"MM_Mark": null,
"MM_Ico": "",
"ResourceList": null
}
]
}
}

21
data/api/run.ts Normal file
View File

@ -0,0 +1,21 @@
import { login } from "./login/request.js";
async function main() {
try {
console.log("--- 开始更新 API 响应数据 ---");
await login();
const { getWorkOrderList } = await import("./work_order_list/request.js");
const { getStatusCount } = await import("./status_count/request.js");
await Promise.all([getWorkOrderList(), getStatusCount()]);
console.log("--- 所有接口数据已更新 ---");
} catch (error: any) {
console.error("[ERROR]", error.message || error);
process.exit(1);
}
}
main();

View File

@ -0,0 +1,11 @@
import path from "path";
import { fileURLToPath } from "url";
import client, { saveResponse } from "../client.js";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export async function getStatusCount() {
const response = await client.post("/DemandManage/QueryIndexCount", {});
saveResponse(__dirname, response.data);
return response.data;
}

View File

@ -0,0 +1,10 @@
{
"success": true,
"code": null,
"msg": "执行成功",
"data": {
"PendingCount": 1,
"StaycloseCount": 0,
"ConfirmCount": 0
}
}

View File

@ -0,0 +1,18 @@
import path from "path";
import { fileURLToPath } from "url";
import client, { saveResponse } from "../client.js";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
export async function getWorkOrderList() {
const response = await client.post("/DemandManage/GetWorkOrderListPage", {
isSelect: 8,
isShow: 3,
IsExport: 0,
PageIndex: 1,
PageSize: 20,
});
saveResponse(__dirname, response.data);
return response.data;
}

View File

@ -0,0 +1,58 @@
{
"success": true,
"code": null,
"msg": "执行成功",
"data": {
"PageTotal": 1,
"PageSize": 20,
"DataCount": 1,
"PageIndex": 1,
"DataList": [
{
"ID": 58624,
"DL_OrderType": 2,
"DL_Status": 350,
"DL_StatusID": null,
"DL_ProductID": 64,
"DL_ProductName": "六个羽友",
"DL_ID": 1039,
"DL_ItemID": "六个羽友2.21",
"DL_ProblemDegree": "1",
"DL_Priority": "1",
"DL_TaskName": "一次批量订场,立即支付页面转圈圈",
"DL_ProblemSource": "",
"DL_CreatorGID": "229707a9-8eac-4540-b1d0-f64ce87ce054",
"DL_Creator": "龚诚",
"DL_CreateTime": "2026-03-05 13:54:06",
"DL_AffirmGID": "229707a9-8eac-4540-b1d0-f64ce87ce054",
"DL_AffirmName": "龚诚",
"DL_ConfirmTime": null,
"DL_AffirmRemark": null,
"DL_AssignGID": "512860ad-aa4a-4268-a5d9-6c7d2e28680b",
"DL_AssignName": "A田森林",
"DL_AssignRemark": null,
"DL_SolveGID": null,
"DL_SolveName": null,
"DL_SolveTime": null,
"DL_SolveRemark": null,
"DL_CloseGID": null,
"DL_CloseName": null,
"DL_CloseTime": null,
"DL_CloseRemark": null,
"DL_Remark": null,
"DL_AuditStatus": null,
"DL_DemandContent": " <p class=\"txtContent\"><font color=\"#333333\">一次批量订场(32个场次),立即支付页面转圈圈</font></p><p class=\"txtContent\"><img src=\"https://img1.yunvip123.com/202603/134171636069619186.png\" style=\"max-width: 100% !important; vertical-align: middle !important;\"><img src=\"https://img1.yunvip123.com/202603/134171636323013515.png\" style=\"max-width: 100% !important; vertical-align: middle !important;\"></p><p class=\"txtContent\"></p>\n ",
"DL_TestContent": "",
"DL_DemandName": "一次批量订场,立即支付页面转圈圈",
"DL_OrderLevel": 50,
"DL_RepeatID": null,
"DL_RepeatStatus": null,
"DL_Identitying": null,
"DL_WorkHour": null,
"DL_ConfirmState": null
}
],
"StatisticsInfo": null,
"TrendData": null
}
}

File diff suppressed because it is too large Load Diff

341
package-lock.json generated
View File

@ -30,8 +30,10 @@
"@tauri-apps/cli": "^2.10.1", "@tauri-apps/cli": "^2.10.1",
"@types/lodash-es": "^4.17.12", "@types/lodash-es": "^4.17.12",
"@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue": "^6.0.5",
"axios": "^1.14.0",
"commitizen": "^4.3.1", "commitizen": "^4.3.1",
"cz-git": "^1.12.0", "cz-git": "^1.12.0",
"dotenv": "^17.3.1",
"eslint": "^10.1.0", "eslint": "^10.1.0",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4", "eslint-import-resolver-typescript": "^4.4.4",
@ -41,6 +43,7 @@
"globals": "^17.4.0", "globals": "^17.4.0",
"husky": "^9.1.7", "husky": "^9.1.7",
"lint-staged": "^16.4.0", "lint-staged": "^16.4.0",
"tsx": "^4.21.0",
"typescript": "~5.9.3", "typescript": "~5.9.3",
"typescript-eslint": "^8.57.2", "typescript-eslint": "^8.57.2",
"vite": "^7.3.1", "vite": "^7.3.1",
@ -2760,6 +2763,13 @@
"integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==", "integrity": "sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==",
"license": "MIT" "license": "MIT"
}, },
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmmirror.com/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
"dev": true,
"license": "MIT"
},
"node_modules/at-least-node": { "node_modules/at-least-node": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmmirror.com/at-least-node/-/at-least-node-1.0.0.tgz", "resolved": "https://registry.npmmirror.com/at-least-node/-/at-least-node-1.0.0.tgz",
@ -2770,6 +2780,18 @@
"node": ">= 4.0.0" "node": ">= 4.0.0"
} }
}, },
"node_modules/axios": {
"version": "1.14.0",
"resolved": "https://registry.npmmirror.com/axios/-/axios-1.14.0.tgz",
"integrity": "sha512-3Y8yrqLSwjuzpXuZ0oIYZ/XGgLwUIBU3uLvbcpb0pidD9ctpShJd43KSlEEkVQg6DS0G9NKyzOvBfUtDKEyHvQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.11",
"form-data": "^4.0.5",
"proxy-from-env": "^2.1.0"
}
},
"node_modules/balanced-match": { "node_modules/balanced-match": {
"version": "4.0.4", "version": "4.0.4",
"resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-4.0.4.tgz", "resolved": "https://registry.npmmirror.com/balanced-match/-/balanced-match-4.0.4.tgz",
@ -2890,6 +2912,20 @@
"node": ">=6" "node": ">=6"
} }
}, },
"node_modules/call-bind-apply-helpers": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz",
"integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
"function-bind": "^1.1.2"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/callsites": { "node_modules/callsites": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmmirror.com/callsites/-/callsites-3.1.0.tgz", "resolved": "https://registry.npmmirror.com/callsites/-/callsites-3.1.0.tgz",
@ -3080,6 +3116,19 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmmirror.com/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dev": true,
"license": "MIT",
"dependencies": {
"delayed-stream": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/commander": { "node_modules/commander": {
"version": "14.0.3", "version": "14.0.3",
"resolved": "https://registry.npmmirror.com/commander/-/commander-14.0.3.tgz", "resolved": "https://registry.npmmirror.com/commander/-/commander-14.0.3.tgz",
@ -3409,6 +3458,16 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmmirror.com/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/detect-file": { "node_modules/detect-file": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmmirror.com/detect-file/-/detect-file-1.0.0.tgz", "resolved": "https://registry.npmmirror.com/detect-file/-/detect-file-1.0.0.tgz",
@ -3454,6 +3513,34 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/dotenv": {
"version": "17.3.1",
"resolved": "https://registry.npmmirror.com/dotenv/-/dotenv-17.3.1.tgz",
"integrity": "sha512-IO8C/dzEb6O3F9/twg6ZLXz164a2fhTnEWb95H23Dm4OuN+92NmEAlTrupP9VW6Jm3sO26tQlqyvyi4CsnY9GA==",
"dev": true,
"license": "BSD-2-Clause",
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://dotenvx.com"
}
},
"node_modules/dunder-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/dunder-proto/-/dunder-proto-1.0.1.tgz",
"integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==",
"dev": true,
"license": "MIT",
"dependencies": {
"call-bind-apply-helpers": "^1.0.1",
"es-errors": "^1.3.0",
"gopd": "^1.2.0"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/emoji-regex": { "node_modules/emoji-regex": {
"version": "8.0.0", "version": "8.0.0",
"resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz", "resolved": "https://registry.npmmirror.com/emoji-regex/-/emoji-regex-8.0.0.tgz",
@ -3506,6 +3593,55 @@
"is-arrayish": "^0.2.1" "is-arrayish": "^0.2.1"
} }
}, },
"node_modules/es-define-property": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/es-define-property/-/es-define-property-1.0.1.tgz",
"integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/es-errors": {
"version": "1.3.0",
"resolved": "https://registry.npmmirror.com/es-errors/-/es-errors-1.3.0.tgz",
"integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/es-object-atoms": {
"version": "1.1.1",
"resolved": "https://registry.npmmirror.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz",
"integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==",
"dev": true,
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/es-set-tostringtag": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz",
"integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==",
"dev": true,
"license": "MIT",
"dependencies": {
"es-errors": "^1.3.0",
"get-intrinsic": "^1.2.6",
"has-tostringtag": "^1.0.2",
"hasown": "^2.0.2"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/esbuild": { "node_modules/esbuild": {
"version": "0.27.3", "version": "0.27.3",
"resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.27.3.tgz", "resolved": "https://registry.npmmirror.com/esbuild/-/esbuild-0.27.3.tgz",
@ -4128,6 +4264,44 @@
"dev": true, "dev": true,
"license": "ISC" "license": "ISC"
}, },
"node_modules/follow-redirects": {
"version": "1.15.11",
"resolved": "https://registry.npmmirror.com/follow-redirects/-/follow-redirects-1.15.11.tgz",
"integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==",
"dev": true,
"funding": [
{
"type": "individual",
"url": "https://github.com/sponsors/RubenVerborgh"
}
],
"license": "MIT",
"engines": {
"node": ">=4.0"
},
"peerDependenciesMeta": {
"debug": {
"optional": true
}
}
},
"node_modules/form-data": {
"version": "4.0.5",
"resolved": "https://registry.npmmirror.com/form-data/-/form-data-4.0.5.tgz",
"integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==",
"dev": true,
"license": "MIT",
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"es-set-tostringtag": "^2.1.0",
"hasown": "^2.0.2",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/fs-extra": { "node_modules/fs-extra": {
"version": "9.1.0", "version": "9.1.0",
"resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-9.1.0.tgz", "resolved": "https://registry.npmmirror.com/fs-extra/-/fs-extra-9.1.0.tgz",
@ -4166,6 +4340,16 @@
"node": "^8.16.0 || ^10.6.0 || >=11.0.0" "node": "^8.16.0 || ^10.6.0 || >=11.0.0"
} }
}, },
"node_modules/function-bind": {
"version": "1.1.2",
"resolved": "https://registry.npmmirror.com/function-bind/-/function-bind-1.1.2.tgz",
"integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==",
"dev": true,
"license": "MIT",
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/get-caller-file": { "node_modules/get-caller-file": {
"version": "2.0.5", "version": "2.0.5",
"resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz", "resolved": "https://registry.npmmirror.com/get-caller-file/-/get-caller-file-2.0.5.tgz",
@ -4189,6 +4373,45 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/get-intrinsic": {
"version": "1.3.0",
"resolved": "https://registry.npmmirror.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz",
"integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"call-bind-apply-helpers": "^1.0.2",
"es-define-property": "^1.0.1",
"es-errors": "^1.3.0",
"es-object-atoms": "^1.1.1",
"function-bind": "^1.1.2",
"get-proto": "^1.0.1",
"gopd": "^1.2.0",
"has-symbols": "^1.1.0",
"hasown": "^2.0.2",
"math-intrinsics": "^1.1.0"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/get-proto": {
"version": "1.0.1",
"resolved": "https://registry.npmmirror.com/get-proto/-/get-proto-1.0.1.tgz",
"integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==",
"dev": true,
"license": "MIT",
"dependencies": {
"dunder-proto": "^1.0.1",
"es-object-atoms": "^1.0.0"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/get-tsconfig": { "node_modules/get-tsconfig": {
"version": "4.13.7", "version": "4.13.7",
"resolved": "https://registry.npmmirror.com/get-tsconfig/-/get-tsconfig-4.13.7.tgz", "resolved": "https://registry.npmmirror.com/get-tsconfig/-/get-tsconfig-4.13.7.tgz",
@ -4366,6 +4589,19 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/gopd": {
"version": "1.2.0",
"resolved": "https://registry.npmmirror.com/gopd/-/gopd-1.2.0.tgz",
"integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/graceful-fs": { "node_modules/graceful-fs": {
"version": "4.2.11", "version": "4.2.11",
"resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz", "resolved": "https://registry.npmmirror.com/graceful-fs/-/graceful-fs-4.2.11.tgz",
@ -4383,6 +4619,48 @@
"node": ">=4" "node": ">=4"
} }
}, },
"node_modules/has-symbols": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/has-symbols/-/has-symbols-1.1.0.tgz",
"integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/has-tostringtag": {
"version": "1.0.2",
"resolved": "https://registry.npmmirror.com/has-tostringtag/-/has-tostringtag-1.0.2.tgz",
"integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==",
"dev": true,
"license": "MIT",
"dependencies": {
"has-symbols": "^1.0.3"
},
"engines": {
"node": ">= 0.4"
},
"funding": {
"url": "https://github.com/sponsors/ljharb"
}
},
"node_modules/hasown": {
"version": "2.0.2",
"resolved": "https://registry.npmmirror.com/hasown/-/hasown-2.0.2.tgz",
"integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"function-bind": "^1.1.2"
},
"engines": {
"node": ">= 0.4"
}
},
"node_modules/homedir-polyfill": { "node_modules/homedir-polyfill": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmmirror.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", "resolved": "https://registry.npmmirror.com/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz",
@ -5428,6 +5706,16 @@
"@jridgewell/sourcemap-codec": "^1.5.5" "@jridgewell/sourcemap-codec": "^1.5.5"
} }
}, },
"node_modules/math-intrinsics": {
"version": "1.1.0",
"resolved": "https://registry.npmmirror.com/math-intrinsics/-/math-intrinsics-1.1.0.tgz",
"integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.4"
}
},
"node_modules/meow": { "node_modules/meow": {
"version": "13.2.0", "version": "13.2.0",
"resolved": "https://registry.npmmirror.com/meow/-/meow-13.2.0.tgz", "resolved": "https://registry.npmmirror.com/meow/-/meow-13.2.0.tgz",
@ -5475,6 +5763,29 @@
"url": "https://github.com/sponsors/jonschlinkert" "url": "https://github.com/sponsors/jonschlinkert"
} }
}, },
"node_modules/mime-db": {
"version": "1.52.0",
"resolved": "https://registry.npmmirror.com/mime-db/-/mime-db-1.52.0.tgz",
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mime-types": {
"version": "2.1.35",
"resolved": "https://registry.npmmirror.com/mime-types/-/mime-types-2.1.35.tgz",
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
"dev": true,
"license": "MIT",
"dependencies": {
"mime-db": "1.52.0"
},
"engines": {
"node": ">= 0.6"
}
},
"node_modules/mimic-fn": { "node_modules/mimic-fn": {
"version": "2.1.0", "version": "2.1.0",
"resolved": "https://registry.npmmirror.com/mimic-fn/-/mimic-fn-2.1.0.tgz", "resolved": "https://registry.npmmirror.com/mimic-fn/-/mimic-fn-2.1.0.tgz",
@ -6004,6 +6315,16 @@
"node": ">=6.0.0" "node": ">=6.0.0"
} }
}, },
"node_modules/proxy-from-env": {
"version": "2.1.0",
"resolved": "https://registry.npmmirror.com/proxy-from-env/-/proxy-from-env-2.1.0.tgz",
"integrity": "sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=10"
}
},
"node_modules/punycode": { "node_modules/punycode": {
"version": "2.3.1", "version": "2.3.1",
"resolved": "https://registry.npmmirror.com/punycode/-/punycode-2.3.1.tgz", "resolved": "https://registry.npmmirror.com/punycode/-/punycode-2.3.1.tgz",
@ -6535,6 +6856,26 @@
"dev": true, "dev": true,
"license": "0BSD" "license": "0BSD"
}, },
"node_modules/tsx": {
"version": "4.21.0",
"resolved": "https://registry.npmmirror.com/tsx/-/tsx-4.21.0.tgz",
"integrity": "sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==",
"dev": true,
"license": "MIT",
"dependencies": {
"esbuild": "~0.27.0",
"get-tsconfig": "^4.7.5"
},
"bin": {
"tsx": "dist/cli.mjs"
},
"engines": {
"node": ">=18.0.0"
},
"optionalDependencies": {
"fsevents": "~2.3.3"
}
},
"node_modules/type-check": { "node_modules/type-check": {
"version": "0.4.0", "version": "0.4.0",
"resolved": "https://registry.npmmirror.com/type-check/-/type-check-0.4.0.tgz", "resolved": "https://registry.npmmirror.com/type-check/-/type-check-0.4.0.tgz",

View File

@ -53,8 +53,10 @@
"@tauri-apps/cli": "^2.10.1", "@tauri-apps/cli": "^2.10.1",
"@types/lodash-es": "^4.17.12", "@types/lodash-es": "^4.17.12",
"@vitejs/plugin-vue": "^6.0.5", "@vitejs/plugin-vue": "^6.0.5",
"axios": "^1.14.0",
"commitizen": "^4.3.1", "commitizen": "^4.3.1",
"cz-git": "^1.12.0", "cz-git": "^1.12.0",
"dotenv": "^17.3.1",
"eslint": "^10.1.0", "eslint": "^10.1.0",
"eslint-config-prettier": "^10.1.8", "eslint-config-prettier": "^10.1.8",
"eslint-import-resolver-typescript": "^4.4.4", "eslint-import-resolver-typescript": "^4.4.4",
@ -64,6 +66,7 @@
"globals": "^17.4.0", "globals": "^17.4.0",
"husky": "^9.1.7", "husky": "^9.1.7",
"lint-staged": "^16.4.0", "lint-staged": "^16.4.0",
"tsx": "^4.21.0",
"typescript": "~5.9.3", "typescript": "~5.9.3",
"typescript-eslint": "^8.57.2", "typescript-eslint": "^8.57.2",
"vite": "^7.3.1", "vite": "^7.3.1",

View File

@ -68,13 +68,19 @@ importers:
version: 4.17.12 version: 4.17.12
'@vitejs/plugin-vue': '@vitejs/plugin-vue':
specifier: ^6.0.5 specifier: ^6.0.5
version: 6.0.5(vite@7.3.1(@types/node@25.5.0)(jiti@2.6.1)(yaml@2.8.3))(vue@3.5.31(typescript@5.9.3)) version: 6.0.5(vite@7.3.1(@types/node@25.5.0)(jiti@2.6.1)(tsx@4.21.0)(yaml@2.8.3))(vue@3.5.31(typescript@5.9.3))
axios:
specifier: ^1.14.0
version: 1.14.0
commitizen: commitizen:
specifier: ^4.3.1 specifier: ^4.3.1
version: 4.3.1(@types/node@25.5.0)(typescript@5.9.3) version: 4.3.1(@types/node@25.5.0)(typescript@5.9.3)
cz-git: cz-git:
specifier: ^1.12.0 specifier: ^1.12.0
version: 1.12.0 version: 1.12.0
dotenv:
specifier: ^17.3.1
version: 17.3.1
eslint: eslint:
specifier: ^10.1.0 specifier: ^10.1.0
version: 10.1.0(jiti@2.6.1) version: 10.1.0(jiti@2.6.1)
@ -102,6 +108,9 @@ importers:
lint-staged: lint-staged:
specifier: ^16.4.0 specifier: ^16.4.0
version: 16.4.0 version: 16.4.0
tsx:
specifier: ^4.21.0
version: 4.21.0
typescript: typescript:
specifier: ~5.9.3 specifier: ~5.9.3
version: 5.9.3 version: 5.9.3
@ -110,7 +119,7 @@ importers:
version: 8.57.2(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3) version: 8.57.2(eslint@10.1.0(jiti@2.6.1))(typescript@5.9.3)
vite: vite:
specifier: ^7.3.1 specifier: ^7.3.1
version: 7.3.1(@types/node@25.5.0)(jiti@2.6.1)(yaml@2.8.3) version: 7.3.1(@types/node@25.5.0)(jiti@2.6.1)(tsx@4.21.0)(yaml@2.8.3)
vue-tsc: vue-tsc:
specifier: ^3.2.6 specifier: ^3.2.6
version: 3.2.6(typescript@5.9.3) version: 3.2.6(typescript@5.9.3)
@ -1031,10 +1040,16 @@ packages:
async-validator@4.2.5: async-validator@4.2.5:
resolution: {integrity: sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==} resolution: {integrity: sha512-7HhHjtERjqlNbZtqNqy2rckN/SpOOlmDliet+lP7k+eKZEjPk3DgyeU9lIXLdeLz0uBbbVp+9Qdow9wJWgwwfg==}
asynckit@0.4.0:
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
at-least-node@1.0.0: at-least-node@1.0.0:
resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==} resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==}
engines: {node: '>= 4.0.0'} engines: {node: '>= 4.0.0'}
axios@1.14.0:
resolution: {integrity: sha512-3Y8yrqLSwjuzpXuZ0oIYZ/XGgLwUIBU3uLvbcpb0pidD9ctpShJd43KSlEEkVQg6DS0G9NKyzOvBfUtDKEyHvQ==}
balanced-match@1.0.2: balanced-match@1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
@ -1072,6 +1087,10 @@ packages:
resolution: {integrity: sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==} resolution: {integrity: sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==}
engines: {node: '>=6'} engines: {node: '>=6'}
call-bind-apply-helpers@1.0.2:
resolution: {integrity: sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==}
engines: {node: '>= 0.4'}
callsites@3.1.0: callsites@3.1.0:
resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==}
engines: {node: '>=6'} engines: {node: '>=6'}
@ -1131,6 +1150,10 @@ packages:
colorette@2.0.20: colorette@2.0.20:
resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==}
combined-stream@1.0.8:
resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==}
engines: {node: '>= 0.8'}
commander@14.0.3: commander@14.0.3:
resolution: {integrity: sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==} resolution: {integrity: sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==}
engines: {node: '>=20'} engines: {node: '>=20'}
@ -1234,6 +1257,10 @@ packages:
defaults@1.0.4: defaults@1.0.4:
resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==}
delayed-stream@1.0.0:
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
engines: {node: '>=0.4.0'}
detect-file@1.0.0: detect-file@1.0.0:
resolution: {integrity: sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==} resolution: {integrity: sha512-DtCOLG98P007x7wiiOmfI0fi3eIKyWiLTGJ2MDnVi/E04lWGbf+JzrRHMm0rgIIZJGtHpKpbVgLWHrv8xXpc3Q==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
@ -1252,6 +1279,14 @@ packages:
resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==}
engines: {node: '>=8'} engines: {node: '>=8'}
dotenv@17.3.1:
resolution: {integrity: sha512-IO8C/dzEb6O3F9/twg6ZLXz164a2fhTnEWb95H23Dm4OuN+92NmEAlTrupP9VW6Jm3sO26tQlqyvyi4CsnY9GA==}
engines: {node: '>=12'}
dunder-proto@1.0.1:
resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==}
engines: {node: '>= 0.4'}
emoji-regex@10.6.0: emoji-regex@10.6.0:
resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==} resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==}
@ -1273,6 +1308,22 @@ packages:
error-ex@1.3.4: error-ex@1.3.4:
resolution: {integrity: sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==} resolution: {integrity: sha512-sqQamAnR14VgCr1A618A3sGrygcpK+HEbenA/HiEAkkUwcZIIB/tgWqHFxWgOyDh4nB4JCRimh79dR5Ywc9MDQ==}
es-define-property@1.0.1:
resolution: {integrity: sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==}
engines: {node: '>= 0.4'}
es-errors@1.3.0:
resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==}
engines: {node: '>= 0.4'}
es-object-atoms@1.1.1:
resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==}
engines: {node: '>= 0.4'}
es-set-tostringtag@2.1.0:
resolution: {integrity: sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==}
engines: {node: '>= 0.4'}
esbuild@0.27.3: esbuild@0.27.3:
resolution: {integrity: sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==} resolution: {integrity: sha512-8VwMnyGCONIs6cWue2IdpHxHnAjzxnw2Zr7MkVxB2vjmQ2ivqGFb4LEG3SMnv0Gb2F/G/2yA8zUaiL1gywDCCg==}
engines: {node: '>=18'} engines: {node: '>=18'}
@ -1472,6 +1523,19 @@ packages:
flatted@3.4.2: flatted@3.4.2:
resolution: {integrity: sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==} resolution: {integrity: sha512-PjDse7RzhcPkIJwy5t7KPWQSZ9cAbzQXcafsetQoD7sOJRQlGikNbx7yZp2OotDnJyrDcbyRq3Ttb18iYOqkxA==}
follow-redirects@1.15.11:
resolution: {integrity: sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==}
engines: {node: '>=4.0'}
peerDependencies:
debug: '*'
peerDependenciesMeta:
debug:
optional: true
form-data@4.0.5:
resolution: {integrity: sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==}
engines: {node: '>= 6'}
fs-extra@9.1.0: fs-extra@9.1.0:
resolution: {integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==} resolution: {integrity: sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==}
engines: {node: '>=10'} engines: {node: '>=10'}
@ -1484,6 +1548,9 @@ packages:
engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0}
os: [darwin] os: [darwin]
function-bind@1.1.2:
resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}
get-caller-file@2.0.5: get-caller-file@2.0.5:
resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==}
engines: {node: 6.* || 8.* || >= 10.*} engines: {node: 6.* || 8.* || >= 10.*}
@ -1492,6 +1559,14 @@ packages:
resolution: {integrity: sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA==} resolution: {integrity: sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA==}
engines: {node: '>=18'} engines: {node: '>=18'}
get-intrinsic@1.3.0:
resolution: {integrity: sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==}
engines: {node: '>= 0.4'}
get-proto@1.0.1:
resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==}
engines: {node: '>= 0.4'}
get-tsconfig@4.13.7: get-tsconfig@4.13.7:
resolution: {integrity: sha512-7tN6rFgBlMgpBML5j8typ92BKFi2sFQvIdpAqLA2beia5avZDrMs0FLZiM5etShWq5irVyGcGMEA1jcDaK7A/Q==} resolution: {integrity: sha512-7tN6rFgBlMgpBML5j8typ92BKFi2sFQvIdpAqLA2beia5avZDrMs0FLZiM5etShWq5irVyGcGMEA1jcDaK7A/Q==}
@ -1524,6 +1599,10 @@ packages:
resolution: {integrity: sha512-hjrNztw/VajQwOLsMNT1cbJiH2muO3OROCHnbehc8eY5JyD2gqz4AcMHPqgaOR59DjgUjYAYLeH699g/eWi2jw==} resolution: {integrity: sha512-hjrNztw/VajQwOLsMNT1cbJiH2muO3OROCHnbehc8eY5JyD2gqz4AcMHPqgaOR59DjgUjYAYLeH699g/eWi2jw==}
engines: {node: '>=18'} engines: {node: '>=18'}
gopd@1.2.0:
resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==}
engines: {node: '>= 0.4'}
graceful-fs@4.2.11: graceful-fs@4.2.11:
resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==}
@ -1535,6 +1614,18 @@ packages:
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
engines: {node: '>=8'} engines: {node: '>=8'}
has-symbols@1.1.0:
resolution: {integrity: sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==}
engines: {node: '>= 0.4'}
has-tostringtag@1.0.2:
resolution: {integrity: sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==}
engines: {node: '>= 0.4'}
hasown@2.0.2:
resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}
engines: {node: '>= 0.4'}
homedir-polyfill@1.0.3: homedir-polyfill@1.0.3:
resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==} resolution: {integrity: sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==}
engines: {node: '>=0.10.0'} engines: {node: '>=0.10.0'}
@ -1752,6 +1843,10 @@ packages:
magic-string@0.30.21: magic-string@0.30.21:
resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==}
math-intrinsics@1.1.0:
resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==}
engines: {node: '>= 0.4'}
meow@13.2.0: meow@13.2.0:
resolution: {integrity: sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==} resolution: {integrity: sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==}
engines: {node: '>=18'} engines: {node: '>=18'}
@ -1763,6 +1858,14 @@ packages:
resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==}
engines: {node: '>=8.6'} engines: {node: '>=8.6'}
mime-db@1.52.0:
resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
engines: {node: '>= 0.6'}
mime-types@2.1.35:
resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
engines: {node: '>= 0.6'}
mimic-fn@2.1.0: mimic-fn@2.1.0:
resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==}
engines: {node: '>=6'} engines: {node: '>=6'}
@ -1921,6 +2024,10 @@ packages:
engines: {node: '>=14'} engines: {node: '>=14'}
hasBin: true hasBin: true
proxy-from-env@2.1.0:
resolution: {integrity: sha512-cJ+oHTW1VAEa8cJslgmUZrc+sjRKgAKl3Zyse6+PV38hZe/V6Z14TbCuXcan9F9ghlz4QrFr2c92TNF82UkYHA==}
engines: {node: '>=10'}
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'}
@ -2116,6 +2223,11 @@ packages:
tslib@2.8.1: tslib@2.8.1:
resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}
tsx@4.21.0:
resolution: {integrity: sha512-5C1sg4USs1lfG0GFb2RLXsdpXqBSEhAaA/0kPL01wxzpMqLILNxIxIOKiILz+cdg/pLnOUxFYOR5yhHU666wbw==}
engines: {node: '>=18.0.0'}
hasBin: true
type-check@0.4.0: type-check@0.4.0:
resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
engines: {node: '>= 0.8.0'} engines: {node: '>= 0.8.0'}
@ -2922,10 +3034,10 @@ snapshots:
'@unrs/resolver-binding-win32-x64-msvc@1.11.1': '@unrs/resolver-binding-win32-x64-msvc@1.11.1':
optional: true optional: true
'@vitejs/plugin-vue@6.0.5(vite@7.3.1(@types/node@25.5.0)(jiti@2.6.1)(yaml@2.8.3))(vue@3.5.31(typescript@5.9.3))': '@vitejs/plugin-vue@6.0.5(vite@7.3.1(@types/node@25.5.0)(jiti@2.6.1)(tsx@4.21.0)(yaml@2.8.3))(vue@3.5.31(typescript@5.9.3))':
dependencies: dependencies:
'@rolldown/pluginutils': 1.0.0-rc.2 '@rolldown/pluginutils': 1.0.0-rc.2
vite: 7.3.1(@types/node@25.5.0)(jiti@2.6.1)(yaml@2.8.3) vite: 7.3.1(@types/node@25.5.0)(jiti@2.6.1)(tsx@4.21.0)(yaml@2.8.3)
vue: 3.5.31(typescript@5.9.3) vue: 3.5.31(typescript@5.9.3)
'@volar/language-core@2.4.28': '@volar/language-core@2.4.28':
@ -3115,8 +3227,18 @@ snapshots:
async-validator@4.2.5: {} async-validator@4.2.5: {}
asynckit@0.4.0: {}
at-least-node@1.0.0: {} at-least-node@1.0.0: {}
axios@1.14.0:
dependencies:
follow-redirects: 1.15.11
form-data: 4.0.5
proxy-from-env: 2.1.0
transitivePeerDependencies:
- debug
balanced-match@1.0.2: {} balanced-match@1.0.2: {}
balanced-match@4.0.4: {} balanced-match@4.0.4: {}
@ -3153,6 +3275,11 @@ snapshots:
cachedir@2.3.0: {} cachedir@2.3.0: {}
call-bind-apply-helpers@1.0.2:
dependencies:
es-errors: 1.3.0
function-bind: 1.1.2
callsites@3.1.0: {} callsites@3.1.0: {}
chalk@2.4.2: chalk@2.4.2:
@ -3207,6 +3334,10 @@ snapshots:
colorette@2.0.20: {} colorette@2.0.20: {}
combined-stream@1.0.8:
dependencies:
delayed-stream: 1.0.0
commander@14.0.3: {} commander@14.0.3: {}
comment-parser@1.4.5: {} comment-parser@1.4.5: {}
@ -3317,6 +3448,8 @@ snapshots:
dependencies: dependencies:
clone: 1.0.4 clone: 1.0.4
delayed-stream@1.0.0: {}
detect-file@1.0.0: {} detect-file@1.0.0: {}
detect-indent@6.1.0: {} detect-indent@6.1.0: {}
@ -3329,6 +3462,14 @@ snapshots:
dependencies: dependencies:
is-obj: 2.0.0 is-obj: 2.0.0
dotenv@17.3.1: {}
dunder-proto@1.0.1:
dependencies:
call-bind-apply-helpers: 1.0.2
es-errors: 1.3.0
gopd: 1.2.0
emoji-regex@10.6.0: {} emoji-regex@10.6.0: {}
emoji-regex@8.0.0: {} emoji-regex@8.0.0: {}
@ -3343,6 +3484,21 @@ snapshots:
dependencies: dependencies:
is-arrayish: 0.2.1 is-arrayish: 0.2.1
es-define-property@1.0.1: {}
es-errors@1.3.0: {}
es-object-atoms@1.1.1:
dependencies:
es-errors: 1.3.0
es-set-tostringtag@2.1.0:
dependencies:
es-errors: 1.3.0
get-intrinsic: 1.3.0
has-tostringtag: 1.0.2
hasown: 2.0.2
esbuild@0.27.3: esbuild@0.27.3:
optionalDependencies: optionalDependencies:
'@esbuild/aix-ppc64': 0.27.3 '@esbuild/aix-ppc64': 0.27.3
@ -3576,6 +3732,16 @@ snapshots:
flatted@3.4.2: {} flatted@3.4.2: {}
follow-redirects@1.15.11: {}
form-data@4.0.5:
dependencies:
asynckit: 0.4.0
combined-stream: 1.0.8
es-set-tostringtag: 2.1.0
hasown: 2.0.2
mime-types: 2.1.35
fs-extra@9.1.0: fs-extra@9.1.0:
dependencies: dependencies:
at-least-node: 1.0.0 at-least-node: 1.0.0
@ -3588,10 +3754,30 @@ snapshots:
fsevents@2.3.3: fsevents@2.3.3:
optional: true optional: true
function-bind@1.1.2: {}
get-caller-file@2.0.5: {} get-caller-file@2.0.5: {}
get-east-asian-width@1.5.0: {} get-east-asian-width@1.5.0: {}
get-intrinsic@1.3.0:
dependencies:
call-bind-apply-helpers: 1.0.2
es-define-property: 1.0.1
es-errors: 1.3.0
es-object-atoms: 1.1.1
function-bind: 1.1.2
get-proto: 1.0.1
gopd: 1.2.0
has-symbols: 1.1.0
hasown: 2.0.2
math-intrinsics: 1.1.0
get-proto@1.0.1:
dependencies:
dunder-proto: 1.0.1
es-object-atoms: 1.1.1
get-tsconfig@4.13.7: get-tsconfig@4.13.7:
dependencies: dependencies:
resolve-pkg-maps: 1.0.0 resolve-pkg-maps: 1.0.0
@ -3637,12 +3823,24 @@ snapshots:
globals@17.4.0: {} globals@17.4.0: {}
gopd@1.2.0: {}
graceful-fs@4.2.11: {} graceful-fs@4.2.11: {}
has-flag@3.0.0: {} has-flag@3.0.0: {}
has-flag@4.0.0: {} has-flag@4.0.0: {}
has-symbols@1.1.0: {}
has-tostringtag@1.0.2:
dependencies:
has-symbols: 1.1.0
hasown@2.0.2:
dependencies:
function-bind: 1.1.2
homedir-polyfill@1.0.3: homedir-polyfill@1.0.3:
dependencies: dependencies:
parse-passwd: 1.0.0 parse-passwd: 1.0.0
@ -3837,6 +4035,8 @@ snapshots:
dependencies: dependencies:
'@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/sourcemap-codec': 1.5.5
math-intrinsics@1.1.0: {}
meow@13.2.0: {} meow@13.2.0: {}
merge@2.1.1: {} merge@2.1.1: {}
@ -3846,6 +4046,12 @@ snapshots:
braces: 3.0.3 braces: 3.0.3
picomatch: 2.3.2 picomatch: 2.3.2
mime-db@1.52.0: {}
mime-types@2.1.35:
dependencies:
mime-db: 1.52.0
mimic-fn@2.1.0: {} mimic-fn@2.1.0: {}
mimic-function@5.0.1: {} mimic-function@5.0.1: {}
@ -3986,6 +4192,8 @@ snapshots:
prettier@3.8.1: {} prettier@3.8.1: {}
proxy-from-env@2.1.0: {}
punycode@2.3.1: {} punycode@2.3.1: {}
readable-stream@3.6.2: readable-stream@3.6.2:
@ -4173,6 +4381,13 @@ snapshots:
tslib@2.8.1: {} tslib@2.8.1: {}
tsx@4.21.0:
dependencies:
esbuild: 0.27.3
get-tsconfig: 4.13.7
optionalDependencies:
fsevents: 2.3.3
type-check@0.4.0: type-check@0.4.0:
dependencies: dependencies:
prelude-ls: 1.2.1 prelude-ls: 1.2.1
@ -4226,7 +4441,7 @@ snapshots:
util-deprecate@1.0.2: {} util-deprecate@1.0.2: {}
vite@7.3.1(@types/node@25.5.0)(jiti@2.6.1)(yaml@2.8.3): vite@7.3.1(@types/node@25.5.0)(jiti@2.6.1)(tsx@4.21.0)(yaml@2.8.3):
dependencies: dependencies:
esbuild: 0.27.3 esbuild: 0.27.3
fdir: 6.5.0(picomatch@4.0.3) fdir: 6.5.0(picomatch@4.0.3)
@ -4238,6 +4453,7 @@ snapshots:
'@types/node': 25.5.0 '@types/node': 25.5.0
fsevents: 2.3.3 fsevents: 2.3.3
jiti: 2.6.1 jiti: 2.6.1
tsx: 4.21.0
yaml: 2.8.3 yaml: 2.8.3
vscode-uri@3.1.0: {} vscode-uri@3.1.0: {}

165
src/api/client.ts Normal file
View File

@ -0,0 +1,165 @@
import { fetch } from "@tauri-apps/plugin-http";
import type { ClientOptions } from "@tauri-apps/plugin-http";
/** CRM API 根地址,从环境变量 VITE_API_BASE 读取 */
export const API_BASE = import.meta.env.VITE_API_BASE;
/**
*
* @template D
*/
export type RequestOptions<D = unknown> = RequestInit &
ClientOptions & { data?: D };
/**
* Response
* @template T
*/
export interface ApiResponse<T = unknown> extends Response {
/**
* JSON
* @returns
*/
json(): Promise<T>;
}
/**
*
* @template T
* @template D
* @param path API API_BASE `/SystemUser/Login`
* @param options
* @returns
*/
/**
*
* @template T
* @template D
* @param path API API_BASE `/SystemUser/Login`
* @param options
* @returns ApiResponse
*/
export async function requestRaw<T = unknown, D = unknown>(
path: string,
options: RequestOptions<D> = {},
): Promise<ApiResponse<T>> {
// 如果有 data 参数,将其序列化为 JSON 并设置到 body 中
const { data, ...restOptions } = options;
const requestOptions: RequestInit & ClientOptions = { ...restOptions };
if (data !== undefined) {
requestOptions.body = JSON.stringify(data);
requestOptions.headers ??= {};
(requestOptions.headers as Record<string, string>)["Content-Type"] =
"application/json";
}
const response = await fetch(`${API_BASE}${path}`, requestOptions);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
// 创建增强的响应对象
const enhancedResponse = response as ApiResponse<T>;
// 重写 json 方法,添加泛型支持
const originalJson = response.json.bind(response);
enhancedResponse.json = () => originalJson() as Promise<T>;
return enhancedResponse;
}
/**
*
* @template T
* @template D
* @param path API API_BASE `/SystemUser/Login`
* @param options
* @returns
*/
export async function request<T = unknown, D = unknown>(
path: string,
options: RequestOptions<D> = {},
): Promise<T> {
const response = await requestRaw<T, D>(path, options);
return await response.json();
}
/**
* GET
* @template T
* @param path API
* @param options
* @returns
*/
export async function get<T = unknown>(
path: string,
options: Omit<RequestOptions<never>, "data"> = {},
): Promise<T> {
return request<T>(path, { ...options, method: "GET" });
}
/**
* POST
* @template T
* @template D
* @param path API
* @param data
* @param options
* @returns
*/
export async function post<T = unknown, D = unknown>(
path: string,
data?: D,
options: Omit<RequestOptions<D>, "data"> = {},
): Promise<T> {
return request<T, D>(path, { ...options, method: "POST", data });
}
/**
* PUT
* @template T
* @template D
* @param path API
* @param data
* @param options
* @returns
*/
export async function put<T = unknown, D = unknown>(
path: string,
data?: D,
options: Omit<RequestOptions<D>, "data"> = {},
): Promise<T> {
return request<T, D>(path, { ...options, method: "PUT", data });
}
/**
* DELETE
* @template T
* @param path API
* @param options
* @returns
*/
export async function del<T = unknown>(
path: string,
options: Omit<RequestOptions<never>, "data"> = {},
): Promise<T> {
return request<T>(path, { ...options, method: "DELETE" });
}
/**
* PATCH
* @template T
* @template D
* @param path API
* @param data
* @param options
* @returns
*/
export async function patch<T = unknown, D = unknown>(
path: string,
data?: D,
options: Omit<RequestOptions<D>, "data"> = {},
): Promise<T> {
return request<T, D>(path, { ...options, method: "PATCH", data });
}

101
src/api/monitor.ts Normal file
View File

@ -0,0 +1,101 @@
import { post, requestRaw } from "@/api/client";
import type {
LoginResponseData,
WorkOrderResponseData,
CheckStatusResponse,
ApiResponse,
} from "@/api/types";
/**
*
* @param account
* @param password
* @returns ID
*/
export async function login(
account: string,
password: string,
): Promise<{ data: ApiResponse<LoginResponseData>; sessionId: string }> {
// 登录接口需要特殊处理,因为需要从响应头中获取 sessionId
const loginData = {
Account: account,
PassWord: password,
};
const resp = await requestRaw<
ApiResponse<LoginResponseData>,
typeof loginData
>("/SystemUser/Login", {
method: "POST",
headers: {
"Content-Length": String(
new TextEncoder().encode(JSON.stringify(loginData)).length,
),
Host: "crm.yunvip123.com",
"Cache-Control": "no-cache",
Cookie: "",
},
credentials: "omit",
data: loginData,
});
const setCookie = resp.headers.get("set-cookie") || "";
const match = /ASP\.NET_SessionId=([^;]+)/.exec(setCookie);
const sessionId = match ? match[1] : "";
const data = await resp.json();
return { data, sessionId };
}
/**
*
* @param sessionId ID
* @returns
*/
export async function checkWorkOrders(
sessionId: string,
): Promise<ApiResponse<WorkOrderResponseData>> {
// 请求数据类型
const requestData = {
isSelect: 8,
isShow: 3,
IsExport: 0,
PageIndex: 1,
PageSize: 20,
};
return post<ApiResponse<WorkOrderResponseData>, typeof requestData>(
"/DemandManage/GetWorkOrderListPage",
requestData,
{
headers: {
Cookie: `ASP.NET_SessionId=${sessionId}`,
},
},
);
}
/**
*
* @param sessionId ID
* @param userGid GID
* @returns
*/
export async function checkStatus(
sessionId: string,
userGid?: string,
): Promise<ApiResponse<CheckStatusResponse>> {
// 请求数据类型
const requestData: Record<string, string> = {};
if (userGid) requestData.UserGID = userGid;
return post<ApiResponse<CheckStatusResponse>, typeof requestData>(
"/DemandManage/QueryIndexCount",
requestData,
{
headers: {
Cookie: `ASP.NET_SessionId=${sessionId}`,
},
},
);
}

6
src/api/types/common.ts Normal file
View File

@ -0,0 +1,6 @@
/** 通用 API 响应 */
export interface ApiResponse<T = unknown> {
success: boolean;
msg: string;
data: T;
}

2
src/api/types/index.ts Normal file
View File

@ -0,0 +1,2 @@
export * from "./common";
export * from "./monitor";

111
src/api/types/monitor.ts Normal file
View File

@ -0,0 +1,111 @@
/** 菜单信息 */
export interface MenuInfo {
/** 唯一标识 */
GID: string;
/** 菜单名称 */
MM_Name: string;
/** 链接地址 */
MM_LinkUrl: string;
/** 父级 ID */
MM_ParentID: string;
/** 排序 */
MM_Sort: number;
/** 备注/标记 */
MM_Mark: string | null;
/** 图标 */
MM_Ico: string;
/** 资源列表 */
ResourceList: unknown;
}
/** 角色资源权限 */
export interface SRRoleItem {
/** 唯一标识 */
GID: string;
/** 菜单 GID */
MM_GID: string;
/** 资源名称 */
RS_Name: string;
/** 资源链接 */
RS_LinkUrl: string;
/** 是否显示 */
RS_IsShow: number;
/** 排序 */
RS_Sort: number;
/** 创建时间 */
RS_CreateTime: string;
/** 资源编码 */
RS_Code: string | null;
}
/** 登录 API 响应中的 data 部分 */
export interface LoginResponseData {
/** 用户唯一标识 GID */
GID: string;
/** 用户名 */
SU_UserName: string;
/** 账号/工号 */
SU_Account: string;
/** 角色名称 */
SR_Name: string;
/** 菜单列表 */
MenuInfoList?: MenuInfo[];
/** 角色权限列表 */
SRRole?: SRRoleItem[];
}
/** 检查状态接口返回的计数数据 */
export interface CheckStatusResponse {
PendingCount?: number;
StaycloseCount?: number;
ConfirmCount?: number;
}
/** 工单列表项 */
export interface WorkOrderItem {
/** 工单 ID */
ID: number;
/** 需求名称/标题 */
DL_DemandName: string;
/** 需求内容 */
DL_DemandContent: string;
/** 创建人 */
DL_Creator: string;
/** 创建时间 */
DL_CreateTime: string;
/** 状态码 (如 350) */
DL_Status: number;
/** 优先级 */
DL_Priority: string;
/** 产品名称 */
DL_ProductName: string;
/** 指派人 */
DL_AssignName: string | null;
/** 关联项目 ID */
DL_ID: number;
/** 关联项目名称 */
DL_ItemID: string;
}
/** 工单查询接口返回的 data 部分 */
export interface WorkOrderResponseData {
/** 总页数 */
PageTotal: number;
/** 每页数量 */
PageSize: number;
/** 总数 */
DataCount: number;
/** 当前页码 */
PageIndex: number;
/** 工单列表 */
DataList: WorkOrderItem[];
}
/** 监测状态摘要 */
export interface TicketCounts {
pending: number;
stayclose: number;
confirm: number;
workOrderCount: number;
lastCheck: string;
}

View File

@ -14,9 +14,9 @@ import { TrayIcon } from "@tauri-apps/api/tray";
import { getCurrentWindow } from "@tauri-apps/api/window"; import { getCurrentWindow } from "@tauri-apps/api/window";
import { openUrl } from "@tauri-apps/plugin-opener"; import { openUrl } from "@tauri-apps/plugin-opener";
import { type Ref } from "vue"; import { type Ref } from "vue";
import { type TicketCounts } from "@/api/types";
import { CRM_URL } from "@/constants/app"; import { CRM_URL } from "@/constants/app";
import { useLogStore } from "@/stores/log"; import { useLogStore } from "@/stores/log";
import { type TicketCounts } from "@/stores/monitor";
import { getErrorMessage } from "@/utils/common"; import { getErrorMessage } from "@/utils/common";
/** /**

View File

@ -1,11 +0,0 @@
/** CRM API 根地址 */
export const API_BASE = "https://crm.yunvip123.com/api";
/** 用户登录接口 */
export const LOGIN_URL = `${API_BASE}/SystemUser/Login`;
/** 工单状态计数查询接口 */
export const CHECK_URL = `${API_BASE}/DemandManage/QueryIndexCount`;
/** 工单列表分页查询接口 */
export const WORK_ORDER_URL = `${API_BASE}/DemandManage/GetWorkOrderListPage`;

View File

@ -1,20 +1,12 @@
import { fetch } from "@tauri-apps/plugin-http";
import { defineStore, acceptHMRUpdate, storeToRefs } from "pinia"; import { defineStore, acceptHMRUpdate, storeToRefs } from "pinia";
import { ref, watch } from "vue"; import { ref, watch } from "vue";
import { login, checkWorkOrders, checkStatus } from "@/api/monitor";
import { useNotification } from "@/composables/useNotification"; import { useNotification } from "@/composables/useNotification";
import { useTray } from "@/composables/useTray"; import { useTray } from "@/composables/useTray";
import { LOGIN_URL, CHECK_URL, WORK_ORDER_URL } from "@/constants/api";
import { useAppStore } from "@/stores/app"; import { useAppStore } from "@/stores/app";
import { useLogStore } from "@/stores/log"; import { useLogStore } from "@/stores/log";
import { formatTime, getErrorMessage } from "@/utils/common"; import { formatTime, getErrorMessage } from "@/utils/common";
import type { TicketCounts, CheckStatusResponse } from "@/api/types";
export interface TicketCounts {
pending: number;
stayclose: number;
confirm: number;
workOrderCount: number;
lastCheck: string;
}
export const useMonitorStore = defineStore("monitor", () => { export const useMonitorStore = defineStore("monitor", () => {
// ===== 响应式数据 ===== // ===== 响应式数据 =====
@ -55,29 +47,13 @@ export const useMonitorStore = defineStore("monitor", () => {
/** 使用用户名/密码登录,成功后提取并存储 SessionId返回是否成功 */ /** 使用用户名/密码登录,成功后提取并存储 SessionId返回是否成功 */
async function apiLogin(): Promise<boolean> { async function apiLogin(): Promise<boolean> {
try { try {
const body = JSON.stringify({ const { data, sessionId: newSessionId } = await login(
Account: username.value, username.value,
PassWord: password.value, password.value,
}); );
const resp = await fetch(LOGIN_URL, { if (newSessionId) sessionId = newSessionId;
method: "POST",
headers: {
"Content-Type": "application/json",
"Content-Length": String(new TextEncoder().encode(body).length),
Host: "crm.yunvip123.com",
"Cache-Control": "no-cache",
Cookie: "",
},
body,
credentials: "omit",
});
const setCookie = resp.headers.get("set-cookie") || "";
const match = /ASP\.NET_SessionId=([^;]+)/.exec(setCookie);
if (match) sessionId = match[1];
addLog("DEBUG", `SessionId: ${sessionId || "(未提取)"}`, "LOGIN"); addLog("DEBUG", `SessionId: ${sessionId || "(未提取)"}`, "LOGIN");
const data = await resp.json();
if (data.success && data.data) { if (data.success && data.data) {
userGid = data.data.GID; userGid = data.data.GID;
userName = data.data.SU_UserName || "用户"; userName = data.data.SU_UserName || "用户";
@ -100,21 +76,7 @@ export const useMonitorStore = defineStore("monitor", () => {
/** 查询待审核工单数量(分页接口,取 DataCount 字段) */ /** 查询待审核工单数量(分页接口,取 DataCount 字段) */
async function apiCheckWorkOrders(): Promise<number> { async function apiCheckWorkOrders(): Promise<number> {
try { try {
const resp = await fetch(WORK_ORDER_URL, { const result = await checkWorkOrders(sessionId);
method: "POST",
headers: {
"Content-Type": "application/json",
Cookie: `ASP.NET_SessionId=${sessionId}`,
},
body: JSON.stringify({
isSelect: 8,
isShow: 3,
IsExport: 0,
PageIndex: 1,
PageSize: 20,
}),
});
const result = await resp.json();
if (result.success && result.data) { if (result.success && result.data) {
const count = result.data.DataCount || 0; const count = result.data.DataCount || 0;
addLog("INFO", `待审核检查完成 - 数据条数: ${count}`, "SCHEDULER"); addLog("INFO", `待审核检查完成 - 数据条数: ${count}`, "SCHEDULER");
@ -135,21 +97,14 @@ export const useMonitorStore = defineStore("monitor", () => {
/** 发送工单状态检查请求 */ /** 发送工单状态检查请求 */
async function performStatusCheckRequest() { async function performStatusCheckRequest() {
const body: Record<string, string> = {}; return await checkStatus(sessionId, userGid);
if (userGid) body.UserGID = userGid;
const resp = await fetch(CHECK_URL, {
method: "POST",
headers: {
"Content-Type": "application/json",
Cookie: `ASP.NET_SessionId=${sessionId}`,
},
body: JSON.stringify(body),
});
return await resp.json();
} }
/** 处理检查到的工单数据并更新状态 */ /**
async function updateTicketCountsAndLog(data: any) { *
* @param data
*/
async function updateTicketCountsAndLog(data: CheckStatusResponse) {
const pending = data.PendingCount || 0; const pending = data.PendingCount || 0;
const stayclose = data.StaycloseCount || 0; const stayclose = data.StaycloseCount || 0;
const confirm = data.ConfirmCount || 0; const confirm = data.ConfirmCount || 0;

View File

@ -1,7 +1,7 @@
import { fetch } from "@tauri-apps/plugin-http"; import { fetch } from "@tauri-apps/plugin-http";
import { defineStore, acceptHMRUpdate } from "pinia"; import { defineStore, acceptHMRUpdate } from "pinia";
import { ref } from "vue"; import { ref } from "vue";
import { LOGIN_URL } from "@/constants/api"; import { API_BASE } from "@/api/client";
import { useAppStore } from "@/stores/app"; import { useAppStore } from "@/stores/app";
import { useLogStore } from "@/stores/log"; import { useLogStore } from "@/stores/log";
import { formatTime } from "@/utils/common"; import { formatTime } from "@/utils/common";
@ -49,7 +49,7 @@ export const useNetworkStore = defineStore("network", () => {
if (connected) { if (connected) {
try { try {
const apiStart = Date.now(); const apiStart = Date.now();
const resp = await fetch(LOGIN_URL, { const resp = await fetch(`${API_BASE}/SystemUser/Login`, {
method: "HEAD", method: "HEAD",
connectTimeout: appStore.config.network_timeout * 1000, connectTimeout: appStore.config.network_timeout * 1000,
}); });

1
src/vite-env.d.ts vendored
View File

@ -2,6 +2,7 @@
interface ImportMetaEnv { interface ImportMetaEnv {
readonly VITE_APP_NAME: string; readonly VITE_APP_NAME: string;
readonly VITE_API_BASE: string;
} }
interface ImportMeta { interface ImportMeta {