@yorha2b-lab/autodev 1.0.33 → 1.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -52,7 +52,9 @@ const watchApi = () => {
|
|
|
52
52
|
`🤖 Pod 153: [肯定] 字段对齐协议执行完毕:耗时 ${(endTime - startTime) / 1000} 秒。9S 的骇客任务很顺利。`,
|
|
53
53
|
`🤖 Pod 153: [Affirmative] Field alignment protocol executed. Time: ${(endTime - startTime) / 1000}s. 9S's hacking mission was successful.`
|
|
54
54
|
)))
|
|
55
|
-
|
|
55
|
+
if (fs.existsSync(filePath)) {
|
|
56
|
+
fs.unlinkSync(filePath)
|
|
57
|
+
}
|
|
56
58
|
} catch (error) {
|
|
57
59
|
// 失败报告:提到“防火墙”
|
|
58
60
|
spinner.fail(chalk.red(language(
|
|
@@ -122,6 +122,9 @@ const watchPage = options => {
|
|
|
122
122
|
`🤖 Pod 042: [报告] 模块 [${fileName}] 物理装配完成!耗时 ${(endTime - startTime) / 1000} 秒`,
|
|
123
123
|
`🤖 Pod 042: [Report] Module [${fileName}] assembly complete! Elapsed time: ${(endTime - startTime) / 1000}s`
|
|
124
124
|
)))
|
|
125
|
+
if (fs.existsSync(filePath)) {
|
|
126
|
+
fs.unlinkSync(filePath)
|
|
127
|
+
}
|
|
125
128
|
} catch (error) {
|
|
126
129
|
spinner.fail(chalk.red(language(
|
|
127
130
|
`🤖 Pod 042: [警告] 模块 [${fileName}] 构筑失败。原因:${error}`,
|
|
@@ -57,17 +57,15 @@ const watchPart = () => {
|
|
|
57
57
|
`🤖 Pod 042: [报告] 识别程序结束!耗时 ${(endTime - startTime) / 1000} 秒\n================\n\n${finalResult}\n\n================`,
|
|
58
58
|
`🤖 Pod 042: [Report] Recognition complete! Elapsed time: ${(endTime - startTime) / 1000}s\n================\n\n${finalResult}\n\n================`
|
|
59
59
|
))
|
|
60
|
-
|
|
60
|
+
if (fs.existsSync(filePath)) {
|
|
61
|
+
fs.unlinkSync(filePath)
|
|
62
|
+
}
|
|
61
63
|
} catch (error) {
|
|
62
64
|
// 失败报告
|
|
63
65
|
spinner.fail(chalk.red(language(
|
|
64
66
|
`🤖 Pod 042: [警告] 识别程序失败。原因:${error}`,
|
|
65
67
|
`🤖 Pod 042: [Warning] Recognition failed. Reason: ${error}`
|
|
66
68
|
)))
|
|
67
|
-
} finally {
|
|
68
|
-
if (fs.existsSync(filePath)) {
|
|
69
|
-
fs.unlinkSync(filePath)
|
|
70
|
-
}
|
|
71
69
|
}
|
|
72
70
|
})
|
|
73
71
|
}
|
|
@@ -21,8 +21,9 @@ export const useTableQuery = (api, formatResponse, initialParams = {}) => {
|
|
|
21
21
|
try {
|
|
22
22
|
const response = await apiRef.current(search)
|
|
23
23
|
if (currentFetchId !== fetchIdRef.current) return
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
const { data, total } = formatResponse(response ?? {})
|
|
25
|
+
setDataSource(data)
|
|
26
|
+
setTotal(total ?? 0)
|
|
26
27
|
} catch (error) {
|
|
27
28
|
console.error('查询失败', error)
|
|
28
29
|
} finally {
|
|
@@ -18,7 +18,7 @@ export default props => {
|
|
|
18
18
|
|
|
19
19
|
const { total, loading, dataSource, search, setSearch, refresh } = useTableQuery(
|
|
20
20
|
async params => await request('/api/{{fileName}}', { method: 'POST', body: params }),
|
|
21
|
-
response => response?.data ?? [],
|
|
21
|
+
response => ({ data: response?.data ?? [], total: response?.total ?? 0 }),
|
|
22
22
|
{...initParams, ...query},
|
|
23
23
|
)
|
|
24
24
|
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import dayjs from 'dayjs'
|
|
2
2
|
import { request } from './request'
|
|
3
3
|
|
|
4
|
+
//常用工具函数,使用前确保已安装对应模块
|
|
5
|
+
|
|
4
6
|
export const initOSS = async (url, options) => {
|
|
5
|
-
const OSS = require('ali-oss')
|
|
7
|
+
/* const OSS = require('ali-oss')
|
|
6
8
|
const crypto = require('crypto-js')
|
|
7
9
|
const response = await request(url, options)
|
|
8
10
|
const { bucket, endpoint, stsToken, expiration, accessKeyId, accessKeySecret } = response?.data || {}
|
|
@@ -14,7 +16,7 @@ export const initOSS = async (url, options) => {
|
|
|
14
16
|
],
|
|
15
17
|
}))
|
|
16
18
|
const signature = crypto.enc.Base64.stringify(crypto.HmacSHA1(policy, accessKeySecret))
|
|
17
|
-
return { client, policy, signature, ...response?.data }
|
|
19
|
+
return { client, policy, signature, ...response?.data } */
|
|
18
20
|
}
|
|
19
21
|
|
|
20
22
|
export const formatQuery = (params, formItems) => {
|
|
@@ -54,7 +56,7 @@ export const moneyRender = (value, { decimals = 2, showSymbol = true } = {}) =>
|
|
|
54
56
|
}
|
|
55
57
|
|
|
56
58
|
export const exportDataToExcel = async (url, options, columns, fileName, resultKey = 'data') => {
|
|
57
|
-
const response = await request(url, options)
|
|
59
|
+
/* const response = await request(url, options)
|
|
58
60
|
if (response?.[resultKey]?.length > 0) {
|
|
59
61
|
const XLSX = require('xlsx')
|
|
60
62
|
const datas = response?.[resultKey]?.map(item => Object.fromEntries(columns.map(col => {
|
|
@@ -74,7 +76,7 @@ export const exportDataToExcel = async (url, options, columns, fileName, resultK
|
|
|
74
76
|
worksheet['!cols'] = Array.from(new Array(header.length)).fill({ wpx: 120 })
|
|
75
77
|
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1')
|
|
76
78
|
XLSX.writeFile(workbook, `${fileName}.xlsx`)
|
|
77
|
-
}
|
|
79
|
+
} */
|
|
78
80
|
}
|
|
79
81
|
|
|
80
82
|
export const formatUnit = (value, { k = 1024, units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB'], decimals = 2 } = {}) => {
|