Skip to content

Commit cf68b1e

Browse files
YunaiVgitee-org
authored andcommitted
!91 【众测版】合并最新的 Vue3 重构
Merge pull request !91 from 芋道源码/dev
2 parents 5daf0be + 37ffc2b commit cf68b1e

File tree

167 files changed

+1229
-1099
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+1229
-1099
lines changed

.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ VITE_APP_TENANT_ENABLE=true
1313
# 验证码的开关
1414
VITE_APP_CAPTCHA_ENABLE=true
1515

16+
# 验证码的开关
17+
VITE_APP_CAPTCHA_ENABLE=true

build/vite/index.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ import progress from 'vite-plugin-progress'
66
import EslintPlugin from 'vite-plugin-eslint'
77
import PurgeIcons from 'vite-plugin-purge-icons'
88
import { ViteEjsPlugin } from 'vite-plugin-ejs'
9+
// @ts-ignore
910
import ElementPlus from 'unplugin-element-plus/vite'
1011
import AutoImport from 'unplugin-auto-import/vite'
1112
import Components from 'unplugin-vue-components/vite'
1213
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
1314
import viteCompression from 'vite-plugin-compression'
15+
import topLevelAwait from 'vite-plugin-top-level-await'
1416
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
1517
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
1618
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
@@ -95,6 +97,12 @@ export function createVitePlugins() {
9597
ext: '.gz', // 生成的压缩包后缀
9698
deleteOriginFile: false //压缩后是否删除源文件
9799
}),
98-
ViteEjsPlugin()
100+
ViteEjsPlugin(),
101+
topLevelAwait({ // https://juejin.cn/post/7152191742513512485
102+
// The export name of top-level await promise for each chunk module
103+
promiseExportName: '__tla',
104+
// The function to generate import names of top-level await promise in each chunk module
105+
promiseImportName: (i) => `__tla_${i}`
106+
})
99107
]
100108
}

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"build:dev": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode dev",
1414
"build:test": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode test",
1515
"build:static": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode static",
16+
"build:front": "node --max_old_space_size=8000 ./node_modules/vite/bin/vite.js build --mode front",
1617
"serve:pro": "vite preview --mode pro",
1718
"serve:dev": "vite preview --mode dev",
1819
"serve:test": "vite preview --mode test",
@@ -122,6 +123,7 @@
122123
"vite-plugin-progress": "^0.0.6",
123124
"vite-plugin-purge-icons": "^0.9.2",
124125
"vite-plugin-svg-icons": "^2.0.1",
126+
"vite-plugin-top-level-await": "^1.3.0",
125127
"vite-plugin-vue-setup-extend": "^0.4.0",
126128
"vite-plugin-windicss": "^1.8.10",
127129
"vue-tsc": "^1.2.0",

src/api/bpm/leave/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ export type LeaveVO = {
1212
}
1313

1414
// 创建请假申请
15-
export const createLeaveApi = async (data: LeaveVO) => {
15+
export const createLeave = async (data: LeaveVO) => {
1616
return await request.post({ url: '/bpm/oa/leave/create', data: data })
1717
}
1818

1919
// 获得请假申请
20-
export const getLeaveApi = async (id: number) => {
20+
export const getLeave = async (id: number) => {
2121
return await request.get({ url: '/bpm/oa/leave/get?id=' + id })
2222
}
2323

2424
// 获得请假申请分页
25-
export const getLeavePageApi = async (params) => {
25+
export const getLeavePage = async (params) => {
2626
return await request.get({ url: '/bpm/oa/leave/page', params })
2727
}

src/api/bpm/processInstance/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,22 @@ export type ProcessInstanceVO = {
2020
endTime: string
2121
}
2222

23-
export const getMyProcessInstancePageApi = async (params) => {
23+
export const getMyProcessInstancePage = async (params) => {
2424
return await request.get({ url: '/bpm/process-instance/my-page', params })
2525
}
2626

27-
export const createProcessInstanceApi = async (data) => {
27+
export const createProcessInstance = async (data) => {
2828
return await request.post({ url: '/bpm/process-instance/create', data: data })
2929
}
3030

31-
export const cancelProcessInstanceApi = async (id: number, reason: string) => {
31+
export const cancelProcessInstance = async (id: number, reason: string) => {
3232
const data = {
3333
id: id,
3434
reason: reason
3535
}
3636
return await request.delete({ url: '/bpm/process-instance/cancel', data: data })
3737
}
3838

39-
export const getProcessInstanceApi = async (id: number) => {
39+
export const getProcessInstance = async (id: number) => {
4040
return await request.get({ url: '/bpm/process-instance/get?id=' + id })
4141
}

src/api/bpm/task/index.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import request from '@/config/axios'
22

3+
export type TaskVO = {
4+
id: number
5+
}
6+
37
export const getTodoTaskPage = async (params) => {
48
return await request.get({ url: '/bpm/task/todo-page', params })
59
}
@@ -32,3 +36,8 @@ export const getTaskListByProcessInstanceId = async (processInstanceId) => {
3236
url: '/bpm/task/list-by-process-instance-id?processInstanceId=' + processInstanceId
3337
})
3438
}
39+
40+
// 导出任务
41+
export const exportTask = async (params) => {
42+
return await request.download({ url: '/bpm/task/export', params })
43+
}

src/api/infra/config/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ export const deleteConfig = (id: number) => {
4343
}
4444

4545
// 导出参数
46-
export const exportConfigApi = (params) => {
46+
export const exportConfig = (params) => {
4747
return request.download({ url: '/infra/config/export', params })
4848
}

src/api/infra/dbDoc/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import request from '@/config/axios'
22

33
// 导出Html
4-
export const exportHtmlApi = () => {
4+
export const exportHtml = () => {
55
return request.download({ url: '/infra/db-doc/export-html' })
66
}
77

88
// 导出Word
9-
export const exportWordApi = () => {
9+
export const exportWord = () => {
1010
return request.download({ url: '/infra/db-doc/export-word' })
1111
}
1212

1313
// 导出Markdown
14-
export const exportMarkdownApi = () => {
14+
export const exportMarkdown = () => {
1515
return request.download({ url: '/infra/db-doc/export-markdown' })
1616
}

src/api/infra/job/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const updateJobStatus = (id: number, status: number) => {
5353
}
5454

5555
// 定时任务立即执行一次
56-
export const runJobApi = (id: number) => {
56+
export const runJob = (id: number) => {
5757
return request.put({ url: '/infra/job/trigger?id=' + id })
5858
}
5959

src/api/infra/redis/index.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,38 @@ import request from '@/config/axios'
33
/**
44
* 获取redis 监控信息
55
*/
6-
export const getCacheApi = () => {
6+
export const getCache = () => {
77
return request.get({ url: '/infra/redis/get-monitor-info' })
88
}
9+
910
// 获取模块
10-
export const getKeyDefineListApi = () => {
11+
export const getKeyDefineList = () => {
1112
return request.get({ url: '/infra/redis/get-key-define-list' })
1213
}
14+
1315
/**
1416
* 获取redis key列表
1517
*/
16-
export const getKeyListApi = (keyTemplate: string) => {
18+
export const getKeyList = (keyTemplate: string) => {
1719
return request.get({
1820
url: '/infra/redis/get-key-list',
1921
params: {
2022
keyTemplate
2123
}
2224
})
2325
}
26+
2427
// 获取缓存内容
25-
export const getKeyValueApi = (key: string) => {
28+
export const getKeyValue = (key: string) => {
2629
return request.get({ url: '/infra/redis/get-key-value?key=' + key })
2730
}
2831

2932
// 根据键名删除缓存
30-
export const deleteKeyApi = (key: string) => {
33+
export const deleteKey = (key: string) => {
3134
return request.delete({ url: '/infra/redis/delete-key?key=' + key })
3235
}
3336

34-
export const deleteKeysApi = (keyTemplate: string) => {
37+
export const deleteKeys = (keyTemplate: string) => {
3538
return request.delete({
3639
url: '/infra/redis/delete-keys?',
3740
params: {

0 commit comments

Comments
 (0)