diff --git a/src/api/generated/docs/KamiApiCamelOilV1AccountListItem.md b/src/api/generated/docs/KamiApiCamelOilV1AccountListItem.md index 5205e8b..b5ee527 100644 --- a/src/api/generated/docs/KamiApiCamelOilV1AccountListItem.md +++ b/src/api/generated/docs/KamiApiCamelOilV1AccountListItem.md @@ -8,7 +8,6 @@ | **accountName** | **string** | 账号名称 | [optional] [default to undefined] | | **phone** | **string** | 手机号(脱敏) | [optional] [default to undefined] | | **status** | **number** | 状态 | [optional] [default to undefined] | -| **statusText** | **string** | 状态文本 | [optional] [default to undefined] | | **dailyOrderCount** | **number** | 当日下单数 | [optional] [default to undefined] | | **dailyOrderDate** | **string** | 当日日期 | [optional] [default to undefined] | | **totalOrderCount** | **number** | 累计下单数 | [optional] [default to undefined] | @@ -31,7 +30,6 @@ const instance: KamiApiCamelOilV1AccountListItem = { accountName, phone, status, - statusText, dailyOrderCount, dailyOrderDate, totalOrderCount, diff --git a/src/api/generated/docs/KamiApiCamelOilV1AccountOrderListResAccountInfo.md b/src/api/generated/docs/KamiApiCamelOilV1AccountOrderListResAccountInfo.md index 2c75443..f31b28e 100644 --- a/src/api/generated/docs/KamiApiCamelOilV1AccountOrderListResAccountInfo.md +++ b/src/api/generated/docs/KamiApiCamelOilV1AccountOrderListResAccountInfo.md @@ -8,7 +8,6 @@ | **accountName** | **string** | 账号名称 | [optional] [default to undefined] | | **phone** | **string** | 手机号(脱敦) | [optional] [default to undefined] | | **status** | **number** | 状态 | [optional] [default to undefined] | -| **statusText** | **string** | 状态文本 | [optional] [default to undefined] | ## Example @@ -19,8 +18,7 @@ const instance: KamiApiCamelOilV1AccountOrderListResAccountInfo = { accountId, accountName, phone, - status, - statusText + status }; ``` diff --git a/src/api/generated/docs/KamiApiCamelOilV1AccountStatisticsResAccountInfo.md b/src/api/generated/docs/KamiApiCamelOilV1AccountStatisticsResAccountInfo.md index 002dfad..ea99fc3 100644 --- a/src/api/generated/docs/KamiApiCamelOilV1AccountStatisticsResAccountInfo.md +++ b/src/api/generated/docs/KamiApiCamelOilV1AccountStatisticsResAccountInfo.md @@ -8,7 +8,6 @@ | **accountName** | **string** | 账号名称 | [optional] [default to undefined] | | **phone** | **string** | 手机号(脱敏) | [optional] [default to undefined] | | **status** | **number** | 状态 | [optional] [default to undefined] | -| **statusText** | **string** | 状态文本 | [optional] [default to undefined] | | **lastUsedAt** | **string** | 最后使用时间 | [optional] [default to undefined] | | **lastLoginAt** | **string** | 最后登录时间 | [optional] [default to undefined] | | **tokenExpireAt** | **string** | Token过期时间 | [optional] [default to undefined] | @@ -23,7 +22,6 @@ const instance: KamiApiCamelOilV1AccountStatisticsResAccountInfo = { accountName, phone, status, - statusText, lastUsedAt, lastLoginAt, tokenExpireAt diff --git a/src/api/generated/docs/KamiApiCamelOilV1GetSettingsRes.md b/src/api/generated/docs/KamiApiCamelOilV1GetSettingsRes.md index 04ac2b5..e1a23c7 100644 --- a/src/api/generated/docs/KamiApiCamelOilV1GetSettingsRes.md +++ b/src/api/generated/docs/KamiApiCamelOilV1GetSettingsRes.md @@ -5,6 +5,8 @@ | Name | Type | Description | Notes | | ------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------ | --------------------------------- | | **useHaozhuPlatform** | **boolean** | 是否从豪猪平台获取手机号登录 | [optional] [default to undefined] | +| **haozhuUsername** | **string** | 豪猪平台用户名 | [optional] [default to undefined] | +| **haozhuPassword** | **string** | 豪猪平台密码 | [optional] [default to undefined] | | **loginAccountCount** | **number** | 要登录的手机号数量 | [optional] [default to undefined] | | **prefetchConcurrencyAccounts** | **number** | 提前拉单并发的账号数量 | [optional] [default to undefined] | | **singleAccountConcurrency** | **number** | 单个账号的并发数量 | [optional] [default to undefined] | @@ -17,6 +19,8 @@ import { KamiApiCamelOilV1GetSettingsRes } from './api'; const instance: KamiApiCamelOilV1GetSettingsRes = { useHaozhuPlatform, + haozhuUsername, + haozhuPassword, loginAccountCount, prefetchConcurrencyAccounts, singleAccountConcurrency, diff --git a/src/api/generated/docs/KamiApiCamelOilV1OrderDetailResAccountInfo.md b/src/api/generated/docs/KamiApiCamelOilV1OrderDetailResAccountInfo.md index 67e4323..9a98134 100644 --- a/src/api/generated/docs/KamiApiCamelOilV1OrderDetailResAccountInfo.md +++ b/src/api/generated/docs/KamiApiCamelOilV1OrderDetailResAccountInfo.md @@ -8,7 +8,6 @@ | **accountName** | **string** | 账号名称 | [optional] [default to undefined] | | **phone** | **string** | 手机号(脱敦) | [optional] [default to undefined] | | **status** | **number** | 状态 | [optional] [default to undefined] | -| **statusText** | **string** | 状态文本 | [optional] [default to undefined] | | **lastUsedAt** | **string** | 最后使用时间 | [optional] [default to undefined] | ## Example @@ -21,7 +20,6 @@ const instance: KamiApiCamelOilV1OrderDetailResAccountInfo = { accountName, phone, status, - statusText, lastUsedAt }; ``` diff --git a/src/api/generated/docs/KamiApiCamelOilV1OrderDetailResOrderInfo.md b/src/api/generated/docs/KamiApiCamelOilV1OrderDetailResOrderInfo.md index 1cee795..d0f9d9d 100644 --- a/src/api/generated/docs/KamiApiCamelOilV1OrderDetailResOrderInfo.md +++ b/src/api/generated/docs/KamiApiCamelOilV1OrderDetailResOrderInfo.md @@ -2,27 +2,24 @@ ## Properties -| Name | Type | Description | Notes | -| -------------------- | ---------- | ---------------- | --------------------------------- | -| **orderNo** | **string** | 系统订单号 | [optional] [default to undefined] | -| **merchantOrderId** | **string** | 商户订单号 | [optional] [default to undefined] | -| **accountId** | **number** | 账号ID | [optional] [default to undefined] | -| **accountName** | **string** | 账号名称 | [optional] [default to undefined] | -| **amount** | **number** | 订单金额 | [optional] [default to undefined] | -| **alipayUrl** | **string** | 支付宝支付链接 | [optional] [default to undefined] | -| **status** | **number** | 订单状态 | [optional] [default to undefined] | -| **statusText** | **string** | 订单状态文本 | [optional] [default to undefined] | -| **payStatus** | **number** | 支付状态 | [optional] [default to undefined] | -| **payStatusText** | **string** | 支付状态文本 | [optional] [default to undefined] | -| **notifyStatus** | **number** | 回调状态 | [optional] [default to undefined] | -| **notifyStatusText** | **string** | 回调状态文本 | [optional] [default to undefined] | -| **notifyCount** | **number** | 回调次数 | [optional] [default to undefined] | -| **paidAt** | **string** | 支付完成时间 | [optional] [default to undefined] | -| **lastCheckAt** | **string** | 最后检测支付时间 | [optional] [default to undefined] | -| **attach** | **string** | 附加信息 | [optional] [default to undefined] | -| **failureReason** | **string** | 失败原因 | [optional] [default to undefined] | -| **createdAt** | **string** | 创建时间 | [optional] [default to undefined] | -| **updatedAt** | **string** | 更新时间 | [optional] [default to undefined] | +| Name | Type | Description | Notes | +| ------------------- | ---------- | ---------------- | --------------------------------- | +| **orderNo** | **string** | 系统订单号 | [optional] [default to undefined] | +| **merchantOrderId** | **string** | 商户订单号 | [optional] [default to undefined] | +| **accountId** | **number** | 账号ID | [optional] [default to undefined] | +| **accountName** | **string** | 账号名称 | [optional] [default to undefined] | +| **amount** | **number** | 订单金额 | [optional] [default to undefined] | +| **alipayUrl** | **string** | 支付宝支付链接 | [optional] [default to undefined] | +| **status** | **number** | 订单状态 | [optional] [default to undefined] | +| **payStatus** | **number** | 支付状态 | [optional] [default to undefined] | +| **notifyStatus** | **number** | 回调状态 | [optional] [default to undefined] | +| **notifyCount** | **number** | 回调次数 | [optional] [default to undefined] | +| **paidAt** | **string** | 支付完成时间 | [optional] [default to undefined] | +| **lastCheckAt** | **string** | 最后检测支付时间 | [optional] [default to undefined] | +| **attach** | **string** | 附加信息 | [optional] [default to undefined] | +| **failureReason** | **string** | 失败原因 | [optional] [default to undefined] | +| **createdAt** | **string** | 创建时间 | [optional] [default to undefined] | +| **updatedAt** | **string** | 更新时间 | [optional] [default to undefined] | ## Example @@ -37,11 +34,8 @@ const instance: KamiApiCamelOilV1OrderDetailResOrderInfo = { amount, alipayUrl, status, - statusText, payStatus, - payStatusText, notifyStatus, - notifyStatusText, notifyCount, paidAt, lastCheckAt, diff --git a/src/api/generated/docs/KamiApiCamelOilV1OrderListItem.md b/src/api/generated/docs/KamiApiCamelOilV1OrderListItem.md index bd79e80..aa0e5b0 100644 --- a/src/api/generated/docs/KamiApiCamelOilV1OrderListItem.md +++ b/src/api/generated/docs/KamiApiCamelOilV1OrderListItem.md @@ -2,26 +2,23 @@ ## Properties -| Name | Type | Description | Notes | -| -------------------- | ---------- | ---------------- | --------------------------------- | -| **orderNo** | **string** | 系统订单号 | [optional] [default to undefined] | -| **merchantOrderId** | **string** | 商户订单号 | [optional] [default to undefined] | -| **accountId** | **number** | 账号ID | [optional] [default to undefined] | -| **accountName** | **string** | 账号名称 | [optional] [default to undefined] | -| **amount** | **number** | 订单金额 | [optional] [default to undefined] | -| **alipayUrl** | **string** | 支付宝支付链接 | [optional] [default to undefined] | -| **status** | **number** | 订单状态 | [optional] [default to undefined] | -| **statusText** | **string** | 订单状态文本 | [optional] [default to undefined] | -| **payStatus** | **number** | 支付状态 | [optional] [default to undefined] | -| **payStatusText** | **string** | 支付状态文本 | [optional] [default to undefined] | -| **notifyStatus** | **number** | 回调状态 | [optional] [default to undefined] | -| **notifyStatusText** | **string** | 回调状态文本 | [optional] [default to undefined] | -| **notifyCount** | **number** | 回调次数 | [optional] [default to undefined] | -| **paidAt** | **string** | 支付完成时间 | [optional] [default to undefined] | -| **lastCheckAt** | **string** | 最后检测支付时间 | [optional] [default to undefined] | -| **failureReason** | **string** | 失败原因 | [optional] [default to undefined] | -| **createdAt** | **string** | 创建时间 | [optional] [default to undefined] | -| **updatedAt** | **string** | 更新时间 | [optional] [default to undefined] | +| Name | Type | Description | Notes | +| ------------------- | ---------- | ---------------- | --------------------------------- | +| **orderNo** | **string** | 系统订单号 | [optional] [default to undefined] | +| **merchantOrderId** | **string** | 商户订单号 | [optional] [default to undefined] | +| **accountId** | **number** | 账号ID | [optional] [default to undefined] | +| **accountName** | **string** | 账号名称 | [optional] [default to undefined] | +| **amount** | **number** | 订单金额 | [optional] [default to undefined] | +| **alipayUrl** | **string** | 支付宝支付链接 | [optional] [default to undefined] | +| **status** | **number** | 订单状态 | [optional] [default to undefined] | +| **payStatus** | **number** | 支付状态 | [optional] [default to undefined] | +| **notifyStatus** | **number** | 回调状态 | [optional] [default to undefined] | +| **notifyCount** | **number** | 回调次数 | [optional] [default to undefined] | +| **paidAt** | **string** | 支付完成时间 | [optional] [default to undefined] | +| **lastCheckAt** | **string** | 最后检测支付时间 | [optional] [default to undefined] | +| **failureReason** | **string** | 失败原因 | [optional] [default to undefined] | +| **createdAt** | **string** | 创建时间 | [optional] [default to undefined] | +| **updatedAt** | **string** | 更新时间 | [optional] [default to undefined] | ## Example @@ -36,11 +33,8 @@ const instance: KamiApiCamelOilV1OrderListItem = { amount, alipayUrl, status, - statusText, payStatus, - payStatusText, notifyStatus, - notifyStatusText, notifyCount, paidAt, lastCheckAt, diff --git a/src/api/generated/docs/KamiApiCamelOilV1PrefetchOrderLogItem.md b/src/api/generated/docs/KamiApiCamelOilV1PrefetchOrderLogItem.md index 3e4fe02..1acbaac 100644 --- a/src/api/generated/docs/KamiApiCamelOilV1PrefetchOrderLogItem.md +++ b/src/api/generated/docs/KamiApiCamelOilV1PrefetchOrderLogItem.md @@ -5,8 +5,6 @@ | Name | Type | Description | Notes | | ---------------- | ---------- | --------------- | --------------------------------- | | **timestamp** | **string** | 请求时间戳 | [optional] [default to undefined] | -| **phone** | **string** | 手机号(脱敏) | [optional] [default to undefined] | -| **amount** | **number** | 订单面额 | [optional] [default to undefined] | | **responseData** | **string** | API响应原始数据 | [optional] [default to undefined] | ## Example @@ -16,8 +14,6 @@ import { KamiApiCamelOilV1PrefetchOrderLogItem } from './api'; const instance: KamiApiCamelOilV1PrefetchOrderLogItem = { timestamp, - phone, - amount, responseData }; ``` diff --git a/src/api/generated/docs/KamiApiCamelOilV1UpdateSettingsReq.md b/src/api/generated/docs/KamiApiCamelOilV1UpdateSettingsReq.md index 7ca46f5..78cadde 100644 --- a/src/api/generated/docs/KamiApiCamelOilV1UpdateSettingsReq.md +++ b/src/api/generated/docs/KamiApiCamelOilV1UpdateSettingsReq.md @@ -5,6 +5,8 @@ | Name | Type | Description | Notes | | ------------------------------- | ------------------------------------------------------------------------------------------------ | ------------------------------ | --------------------------------- | | **useHaozhuPlatform** | **boolean** | 是否从豪猪平台获取手机号登录 | [optional] [default to undefined] | +| **haozhuUsername** | **string** | 豪猪平台用户名 | [optional] [default to undefined] | +| **haozhuPassword** | **string** | 豪猪平台密码 | [optional] [default to undefined] | | **loginAccountCount** | **number** | 要登录的手机号数量 | [optional] [default to undefined] | | **prefetchConcurrencyAccounts** | **number** | 提前拉单并发的账号数量 | [optional] [default to undefined] | | **singleAccountConcurrency** | **number** | 单个账号的并发数量 | [optional] [default to undefined] | @@ -17,6 +19,8 @@ import { KamiApiCamelOilV1UpdateSettingsReq } from './api'; const instance: KamiApiCamelOilV1UpdateSettingsReq = { useHaozhuPlatform, + haozhuUsername, + haozhuPassword, loginAccountCount, prefetchConcurrencyAccounts, singleAccountConcurrency, diff --git a/src/api/generated/models/kami-api-camel-oil-v1-account-list-item.ts b/src/api/generated/models/kami-api-camel-oil-v1-account-list-item.ts index 7897b34..8047627 100644 --- a/src/api/generated/models/kami-api-camel-oil-v1-account-list-item.ts +++ b/src/api/generated/models/kami-api-camel-oil-v1-account-list-item.ts @@ -29,10 +29,6 @@ export interface KamiApiCamelOilV1AccountListItem { * 状态 */ status?: KamiApiCamelOilV1AccountListItemStatusEnum; - /** - * 状态文本 - */ - statusText?: string; /** * 当日下单数 */ diff --git a/src/api/generated/models/kami-api-camel-oil-v1-account-order-list-res-account-info.ts b/src/api/generated/models/kami-api-camel-oil-v1-account-order-list-res-account-info.ts index 12c408f..bd74959 100644 --- a/src/api/generated/models/kami-api-camel-oil-v1-account-order-list-res-account-info.ts +++ b/src/api/generated/models/kami-api-camel-oil-v1-account-order-list-res-account-info.ts @@ -29,10 +29,6 @@ export interface KamiApiCamelOilV1AccountOrderListResAccountInfo { * 状态 */ status?: KamiApiCamelOilV1AccountOrderListResAccountInfoStatusEnum; - /** - * 状态文本 - */ - statusText?: string; } export enum KamiApiCamelOilV1AccountOrderListResAccountInfoStatusEnum { diff --git a/src/api/generated/models/kami-api-camel-oil-v1-account-statistics-res-account-info.ts b/src/api/generated/models/kami-api-camel-oil-v1-account-statistics-res-account-info.ts index ae31ec2..8cfac5e 100644 --- a/src/api/generated/models/kami-api-camel-oil-v1-account-statistics-res-account-info.ts +++ b/src/api/generated/models/kami-api-camel-oil-v1-account-statistics-res-account-info.ts @@ -29,10 +29,6 @@ export interface KamiApiCamelOilV1AccountStatisticsResAccountInfo { * 状态 */ status?: KamiApiCamelOilV1AccountStatisticsResAccountInfoStatusEnum; - /** - * 状态文本 - */ - statusText?: string; /** * 最后使用时间 */ diff --git a/src/api/generated/models/kami-api-camel-oil-v1-get-settings-res.ts b/src/api/generated/models/kami-api-camel-oil-v1-get-settings-res.ts index e6535e0..d9d7141 100644 --- a/src/api/generated/models/kami-api-camel-oil-v1-get-settings-res.ts +++ b/src/api/generated/models/kami-api-camel-oil-v1-get-settings-res.ts @@ -21,6 +21,14 @@ export interface KamiApiCamelOilV1GetSettingsRes { * 是否从豪猪平台获取手机号登录 */ useHaozhuPlatform?: boolean; + /** + * 豪猪平台用户名 + */ + haozhuUsername?: string; + /** + * 豪猪平台密码 + */ + haozhuPassword?: string; /** * 要登录的手机号数量 */ diff --git a/src/api/generated/models/kami-api-camel-oil-v1-order-detail-res-account-info.ts b/src/api/generated/models/kami-api-camel-oil-v1-order-detail-res-account-info.ts index 763cb1b..0c24074 100644 --- a/src/api/generated/models/kami-api-camel-oil-v1-order-detail-res-account-info.ts +++ b/src/api/generated/models/kami-api-camel-oil-v1-order-detail-res-account-info.ts @@ -29,10 +29,6 @@ export interface KamiApiCamelOilV1OrderDetailResAccountInfo { * 状态 */ status?: KamiApiCamelOilV1OrderDetailResAccountInfoStatusEnum; - /** - * 状态文本 - */ - statusText?: string; /** * 最后使用时间 */ diff --git a/src/api/generated/models/kami-api-camel-oil-v1-order-detail-res-order-info.ts b/src/api/generated/models/kami-api-camel-oil-v1-order-detail-res-order-info.ts index 6825e39..343a615 100644 --- a/src/api/generated/models/kami-api-camel-oil-v1-order-detail-res-order-info.ts +++ b/src/api/generated/models/kami-api-camel-oil-v1-order-detail-res-order-info.ts @@ -41,26 +41,14 @@ export interface KamiApiCamelOilV1OrderDetailResOrderInfo { * 订单状态 */ status?: KamiApiCamelOilV1OrderDetailResOrderInfoStatusEnum; - /** - * 订单状态文本 - */ - statusText?: string; /** * 支付状态 */ payStatus?: KamiApiCamelOilV1OrderDetailResOrderInfoPayStatusEnum; - /** - * 支付状态文本 - */ - payStatusText?: string; /** * 回调状态 */ notifyStatus?: KamiApiCamelOilV1OrderDetailResOrderInfoNotifyStatusEnum; - /** - * 回调状态文本 - */ - notifyStatusText?: string; /** * 回调次数 */ diff --git a/src/api/generated/models/kami-api-camel-oil-v1-order-list-item.ts b/src/api/generated/models/kami-api-camel-oil-v1-order-list-item.ts index fa8a0e7..2df0932 100644 --- a/src/api/generated/models/kami-api-camel-oil-v1-order-list-item.ts +++ b/src/api/generated/models/kami-api-camel-oil-v1-order-list-item.ts @@ -41,26 +41,14 @@ export interface KamiApiCamelOilV1OrderListItem { * 订单状态 */ status?: KamiApiCamelOilV1OrderListItemStatusEnum; - /** - * 订单状态文本 - */ - statusText?: string; /** * 支付状态 */ payStatus?: KamiApiCamelOilV1OrderListItemPayStatusEnum; - /** - * 支付状态文本 - */ - payStatusText?: string; /** * 回调状态 */ notifyStatus?: KamiApiCamelOilV1OrderListItemNotifyStatusEnum; - /** - * 回调状态文本 - */ - notifyStatusText?: string; /** * 回调次数 */ diff --git a/src/api/generated/models/kami-api-camel-oil-v1-prefetch-order-log-item.ts b/src/api/generated/models/kami-api-camel-oil-v1-prefetch-order-log-item.ts index 94feb50..396c17f 100644 --- a/src/api/generated/models/kami-api-camel-oil-v1-prefetch-order-log-item.ts +++ b/src/api/generated/models/kami-api-camel-oil-v1-prefetch-order-log-item.ts @@ -17,14 +17,6 @@ export interface KamiApiCamelOilV1PrefetchOrderLogItem { * 请求时间戳 */ timestamp?: string; - /** - * 手机号(脱敏) - */ - phone?: string; - /** - * 订单面额 - */ - amount?: number; /** * API响应原始数据 */ diff --git a/src/api/generated/models/kami-api-camel-oil-v1-update-settings-req.ts b/src/api/generated/models/kami-api-camel-oil-v1-update-settings-req.ts index a0e9d7d..88ca28f 100644 --- a/src/api/generated/models/kami-api-camel-oil-v1-update-settings-req.ts +++ b/src/api/generated/models/kami-api-camel-oil-v1-update-settings-req.ts @@ -21,6 +21,14 @@ export interface KamiApiCamelOilV1UpdateSettingsReq { * 是否从豪猪平台获取手机号登录 */ useHaozhuPlatform?: boolean; + /** + * 豪猪平台用户名 + */ + haozhuUsername?: string; + /** + * 豪猪平台密码 + */ + haozhuPassword?: string; /** * 要登录的手机号数量 */ diff --git a/src/views/camel-oil-info/prefetch/components/response-data-modal.vue b/src/views/camel-oil-info/prefetch/components/response-data-modal.vue deleted file mode 100644 index 6c7834d..0000000 --- a/src/views/camel-oil-info/prefetch/components/response-data-modal.vue +++ /dev/null @@ -1,133 +0,0 @@ - - - - - diff --git a/src/views/camel-oil-info/prefetch/components/settings-form.vue b/src/views/camel-oil-info/prefetch/components/settings-form.vue index 8e324b6..e5c830f 100644 --- a/src/views/camel-oil-info/prefetch/components/settings-form.vue +++ b/src/views/camel-oil-info/prefetch/components/settings-form.vue @@ -22,6 +22,45 @@ + + + + + + + + + + + + + diff --git a/src/views/camel-oil-info/prefetch/index.vue b/src/views/camel-oil-info/prefetch/index.vue index ff6563a..ae4dea8 100644 --- a/src/views/camel-oil-info/prefetch/index.vue +++ b/src/views/camel-oil-info/prefetch/index.vue @@ -77,49 +77,53 @@ - - - - - - - - + + + 清空日志 + + + +
+
+ + 加载日志中... +
+
+ 暂无日志数据 +
+
+
+
+ {{ formatDateTime(log.timestamp) }} +
+
+
+ 响应数据: +
+
+ {{ log.responseData || '无响应数据' }} +
+
+
+
+
+ @@ -271,12 +275,6 @@ - - - - + @@ -299,18 +292,15 @@ import useLoading from '@/hooks/loading'; import { Pagination } from '@/types/global'; import { onMounted, reactive, ref, computed, watch } from 'vue'; -import { Notification } from '@arco-design/web-vue'; +import { Notification, Message } from '@arco-design/web-vue'; import SettingsForm from './components/settings-form.vue'; -import ResponseDataModal from './components/response-data-modal.vue'; import type { KamiApiCamelOilV1PrefetchOrderLogItem, KamiApiCamelOilV1PrefetchOrderListItem } from '@/api/generated/index.ts'; -import { jdV2PrefetchClient, jdV2SettingsClient } from '@/api/index.ts'; +import { jdV2PrefetchClient } from '@/api/index.ts'; import dayjs from 'dayjs'; -const settingsFormRef = ref(); - // 当前活跃视图 const activeView = ref('logs'); @@ -319,19 +309,6 @@ const cardTitle = computed(() => { return activeView.value === 'logs' ? '预拉取订单日志' : '预拉取订单列表'; }); -// 设置相关状态 -const { loading: settingsLoading, setLoading: setSettingsLoading } = - useLoading(false); - -// 日志相关状态 -const baseLogsPagination: Pagination = { - current: 1, - pageSize: 50 -}; -const logsPagination = reactive({ - ...baseLogsPagination -}); - // 订单列表相关状态 const baseOrdersPagination: Pagination = { current: 1, @@ -341,46 +318,6 @@ const ordersPagination = reactive({ ...baseOrdersPagination }); -const logColumns = [ - { - title: '序号', - dataIndex: 'index', - width: 80, - render: ({ rowIndex }) => { - return ( - rowIndex + 1 + (logsPagination.current - 1) * logsPagination.pageSize - ); - } - }, - { - title: '请求时间', - dataIndex: 'timestamp', - width: 180, - render: ({ record }) => { - return formatDateTime(record.timestamp); - } - }, - { - title: '手机号', - dataIndex: 'phone', - width: 130, - ellipsis: true, - tooltip: true - }, - { - title: '订单面额', - dataIndex: 'amount', - slotName: 'amount', - width: 100 - }, - { - title: '响应数据', - dataIndex: 'responseData', - slotName: 'responseData', - width: 120 - } -]; - const generateLogFormModel = () => { const now = dayjs(); return { @@ -490,58 +427,11 @@ const orderColumns = [ ]; const state = reactive({ - responseModalVisible: false, - selectedResponseData: '', settingsModalVisible: false }); -// 设置相关方法 -const loadSettings = async () => { - setSettingsLoading(true); - try { - const { data } = await jdV2SettingsClient.apiJdV2SettingsGetGet(); - if (settingsFormRef.value) { - settingsFormRef.value.setFormData(data); - } - } catch (err) { - console.error('获取设置失败:', err); - Notification.error({ - content: '获取设置失败', - closable: true - }); - } finally { - setSettingsLoading(false); - } -}; - -const handleSettingsSubmit = async (formData: any) => { - setSettingsLoading(true); - try { - await jdV2SettingsClient.apiJdV2SettingsUpdatePost({ - kamiApiCamelOilV1UpdateSettingsReq: formData - }); - - Notification.success({ - content: '设置保存成功', - closable: true - }); - } catch (err) { - console.error('保存设置失败:', err); - Notification.error({ - content: '保存设置失败', - closable: true - }); - } finally { - setSettingsLoading(false); - } -}; - -const handleSettingsReset = () => { - loadSettings(); -}; - // 日志相关方法 -const fetchLogs = async (params: any = { current: 1, pageSize: 50 }) => { +const fetchLogs = async () => { if (!logFormModel.value.startTime || !logFormModel.value.endTime) { Notification.warning({ content: '请选择开始时间和结束时间', @@ -560,17 +450,8 @@ const fetchLogs = async (params: any = { current: 1, pageSize: 50 }) => { endTime: dayjs(logFormModel.value.endTime).format('YYYY-MM-DD HH:mm:ss') }); - // 模拟分页,因为API返回的是全部数据 - const allData = data.logs || []; - const total = allData.length; - const start = (params.current - 1) * params.pageSize; - const end = start + params.pageSize; - const pageData = allData.slice(start, end); - - logsRenderData.value = pageData; - logsPagination.current = params.current; - logsPagination.pageSize = params.pageSize; - logsPagination.total = total; + // 直接使用API返回的全部日志数据 + logsRenderData.value = data.logs || []; } catch (err) { console.error('获取预拉取订单日志失败:', err); Notification.error({ @@ -582,18 +463,8 @@ const fetchLogs = async (params: any = { current: 1, pageSize: 50 }) => { } }; -const onLogsPageChange = (current: number) => { - fetchLogs({ ...logsPagination, current }); -}; - -const onLogsPageSizeChange = (pageSize: number) => { - fetchLogs({ ...logsPagination, pageSize, current: 1 }); -}; - const searchLogs = () => { - fetchLogs({ - ...baseLogsPagination - }); + fetchLogs(); }; const resetLogs = () => { @@ -601,15 +472,40 @@ const resetLogs = () => { searchLogs(); }; -const showResponseData = (responseData: string) => { - state.selectedResponseData = responseData; - state.responseModalVisible = true; +const copyLogs = async () => { + try { + const logText = logsRenderData.value + .map(log => { + const time = formatDateTime(log.timestamp); + const data = log.responseData || '无响应数据'; + return `[${time}] ${data}`; + }) + .join('\n\n'); + + await navigator.clipboard.writeText(logText); + Message.success({ + content: '日志复制成功', + duration: 2000 + }); + } catch (err) { + console.error('复制日志失败:', err); + Message.error({ + content: '复制日志失败', + duration: 2000 + }); + } +}; + +const clearLogs = () => { + logsRenderData.value = []; + Message.info({ + content: '日志已清空', + duration: 2000 + }); }; const showSettingsModal = () => { state.settingsModalVisible = true; - // 打开弹窗时加载设置 - loadSettings(); }; const formatDateTime = (dateTime: string | undefined): string => { @@ -732,4 +628,84 @@ onMounted(() => { justify-content: flex-end; margin-bottom: 16px; } + +/* 日志容器样式 */ +.log-container { + border: 1px solid var(--color-border-2); + border-radius: var(--border-radius-medium); + overflow: hidden; +} + +.log-header { + padding: 12px 16px; + background-color: var(--color-fill-1); + border-bottom: 1px solid var(--color-border-2); + display: flex; + justify-content: flex-end; +} + +.log-content { + max-height: 600px; + overflow-y: auto; + background-color: var(--color-bg-2); +} + +.log-loading, +.log-empty { + padding: 40px; + text-align: center; + color: var(--color-text-3); + display: flex; + align-items: center; + justify-content: center; + gap: 8px; +} + +.log-entries { + padding: 16px; +} + +.log-entry { + margin-bottom: 16px; + padding: 12px; + background-color: var(--color-bg-1); + border: 1px solid var(--color-border-2); + border-radius: var(--border-radius-small); +} + +.log-entry:last-child { + margin-bottom: 0; +} + +.log-time { + font-size: 12px; + color: var(--color-text-3); + margin-bottom: 8px; + font-family: Monaco, Menlo, 'Ubuntu Mono', monospace; +} + +.log-response-header { + display: flex; + align-items: center; + justify-content: space-between; + margin-bottom: 8px; +} + +.log-response-header span { + font-size: 13px; + font-weight: 500; + color: var(--color-text-1); +} + +.log-response-content { + font-size: 12px; + color: var(--color-text-2); + line-height: 1.5; + word-break: break-all; + background-color: var(--color-fill-1); + padding: 8px; + border-radius: var(--border-radius-small); + max-height: 200px; + overflow-y: auto; +}