create-jnrs-template-vue 1.1.12 → 1.1.14

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.
Files changed (41) hide show
  1. package/jnrs-template-vue/README.md +5 -1
  2. package/jnrs-template-vue/components.d.ts +3 -4
  3. package/jnrs-template-vue/package.json +5 -4
  4. package/jnrs-template-vue/src/App.vue +3 -1
  5. package/jnrs-template-vue/src/api/common/index.ts +20 -5
  6. package/jnrs-template-vue/src/api/demos/index.ts +86 -0
  7. package/jnrs-template-vue/src/api/system/index.ts +1 -1
  8. package/jnrs-template-vue/src/api/user/index.ts +1 -1
  9. package/jnrs-template-vue/src/components/base/ImageView.vue +58 -0
  10. package/jnrs-template-vue/src/components/common/JnPagination.vue +83 -0
  11. package/jnrs-template-vue/src/components/common/JnTable.vue +133 -0
  12. package/jnrs-template-vue/src/composables/{common → base}/useAvatar.ts +1 -1
  13. package/jnrs-template-vue/src/composables/{useForm.ts → common/useForm.ts} +1 -1
  14. package/jnrs-template-vue/src/composables/{useModal.ts → common/useModal.ts} +1 -1
  15. package/jnrs-template-vue/src/composables/{useTable.ts → common/usePagination.ts} +1 -1
  16. package/jnrs-template-vue/src/composables/common/useTable.ts +35 -0
  17. package/jnrs-template-vue/src/composables/{useUser.ts → common/useUser.ts} +1 -1
  18. package/jnrs-template-vue/src/composables/tools/useReactivityTableHeight.ts +63 -0
  19. package/jnrs-template-vue/src/layout/SideMenu.vue +1 -1
  20. package/jnrs-template-vue/src/layout/SideMenuItem.vue +1 -1
  21. package/jnrs-template-vue/src/layout/TopHeader.vue +3 -3
  22. package/jnrs-template-vue/src/layout/index.vue +1 -1
  23. package/jnrs-template-vue/src/router/index.ts +1 -1
  24. package/jnrs-template-vue/src/utils/file.ts +15 -1
  25. package/jnrs-template-vue/src/utils/{common.ts → packages.ts} +33 -1
  26. package/jnrs-template-vue/src/utils/permissions.ts +1 -1
  27. package/jnrs-template-vue/src/views/demos/crud/index.vue +104 -2
  28. package/jnrs-template-vue/src/views/demos/unitTest/RequestPage.vue +141 -0
  29. package/jnrs-template-vue/src/views/demos/unitTest/index.vue +5 -99
  30. package/jnrs-template-vue/src/views/login/index.vue +12 -12
  31. package/jnrs-template-vue/src/views/system/menu/index.vue +1 -1
  32. package/jnrs-template-vue/src/views/system/mine/baseInfo.vue +3 -3
  33. package/jnrs-template-vue/src/views/system/mine/securitySettings.vue +1 -1
  34. package/jnrs-template-vue/viteMockServe/index.ts +9 -0
  35. package/jnrs-template-vue/viteMockServe/tableRes.json +275 -0
  36. package/package.json +1 -1
  37. package/jnrs-template-vue/src/api/mock/index.ts +0 -34
  38. package/jnrs-template-vue/src/api/request.ts +0 -40
  39. package/jnrs-template-vue/src/composables/index.ts +0 -11
  40. package/jnrs-template-vue/src/stores/index.ts +0 -2
  41. package/jnrs-template-vue/src/stores/mock.ts +0 -21
@@ -0,0 +1,275 @@
1
+ {
2
+ "data": [
3
+ {
4
+ "id": "DIGI-2025-TRANS-0001-IT-P001",
5
+ "programCode": "DIGI-2025-TRANS-0001",
6
+ "program": "信息化改造项目集",
7
+ "code": "DIGI-2025-TRANS-0001-IT-P001",
8
+ "name": "统一身份认证平台",
9
+ "description": "实现SSO单点登录与权限集中管理",
10
+ "type": "混合型",
11
+ "manager": "张三",
12
+ "budget": "52000.00",
13
+ "plannedStartDate": "2025-08-10",
14
+ "plannedFinishDate": "2025-12-10",
15
+ "progress": "65%",
16
+ "status": "进行中",
17
+ "imageDocument": {
18
+ "id": 1,
19
+ "description": null,
20
+ "attachments": [
21
+ {
22
+ "id": 1,
23
+ "documentId": 1,
24
+ "fileName": "成品.png",
25
+ "uniqueFileName": "20251217171430919-34bcc1a9-a19d-4b91-9ab6-57cb31c3df28.jpg",
26
+ "fileType": "image/png",
27
+ "fileSize": 432866
28
+ },
29
+ {
30
+ "id": 3,
31
+ "documentId": 1,
32
+ "fileName": "02.png",
33
+ "uniqueFileName": "20251216135111546-e33d678c-5099-4c4c-bc81-a97688f433af.png",
34
+ "fileType": "image/png",
35
+ "fileSize": 24306
36
+ }
37
+ ]
38
+ },
39
+ "attachmentDocument": {
40
+ "id": 2,
41
+ "description": null,
42
+ "attachments": [
43
+ {
44
+ "id": 2,
45
+ "documentId": 2,
46
+ "fileName": "Law Policy for Alibaba Sans.pdf",
47
+ "uniqueFileName": "20251216134412671-e3f13c84-a24d-4718-930a-959cd2b41fb1.pdf",
48
+ "fileType": "application/pdf",
49
+ "fileSize": 63610
50
+ },
51
+ {
52
+ "id": 4,
53
+ "documentId": 2,
54
+ "fileName": "信息化项目设计流程规定JND 024.01-2024.pdf",
55
+ "uniqueFileName": "20251216135247581-05eee726-a0fe-4a44-a890-ee64b106c4b7.pdf",
56
+ "fileType": "application/pdf",
57
+ "fileSize": 231295
58
+ }
59
+ ]
60
+ }
61
+ },
62
+ {
63
+ "id": "DIGI-2025-TRANS-0001-MFG-P001",
64
+ "programCode": "DIGI-2025-TRANS-0001",
65
+ "program": "信息化改造项目集",
66
+ "code": "DIGI-2025-TRANS-0001-MFG-P001",
67
+ "name": "生产报工移动端开发",
68
+ "description": "车间工人通过APP实时报工",
69
+ "type": "敏捷型",
70
+ "manager": "李四",
71
+ "budget": "28000.00",
72
+ "plannedStartDate": "2025-09-01",
73
+ "plannedFinishDate": "2025-11-30",
74
+ "progress": "100%",
75
+ "status": "已完成"
76
+ },
77
+ {
78
+ "id": "DIGI-2025-TRANS-0001-IT-P002",
79
+ "programCode": "DIGI-2025-TRANS-0001",
80
+ "program": "信息化改造项目集",
81
+ "code": "DIGI-2025-TRANS-0001-IT-P002",
82
+ "name": "数据湖平台搭建",
83
+ "description": "构建企业级数据湖,支持BI分析",
84
+ "type": "瀑布型",
85
+ "manager": "王磊",
86
+ "budget": "95000.00",
87
+ "plannedStartDate": "2025-07-01",
88
+ "plannedFinishDate": "2025-12-20",
89
+ "progress": "80%",
90
+ "status": "进行中"
91
+ },
92
+ {
93
+ "id": "DIGI-2025-TRANS-0001-MFG-P002",
94
+ "programCode": "DIGI-2025-TRANS-0001",
95
+ "program": "信息化改造项目集",
96
+ "code": "DIGI-2025-TRANS-0001-MFG-P002",
97
+ "name": "设备台账数字化",
98
+ "description": "将纸质设备档案转为数字台账",
99
+ "type": "瀑布型",
100
+ "manager": "赵敏",
101
+ "budget": "18000.00",
102
+ "plannedStartDate": "2025-10-15",
103
+ "plannedFinishDate": "2026-01-15",
104
+ "progress": "0%",
105
+ "status": "未开始"
106
+ },
107
+ {
108
+ "id": "DIGI-2025-TRANS-0001-IT-P003",
109
+ "programCode": "DIGI-2025-TRANS-0001",
110
+ "program": "信息化改造项目集",
111
+ "code": "DIGI-2025-TRANS-0001-IT-P003",
112
+ "name": "API网关升级",
113
+ "description": "提升系统间接口安全与性能",
114
+ "type": "敏捷型",
115
+ "manager": "张三",
116
+ "budget": "35000.00",
117
+ "plannedStartDate": "2025-06-01",
118
+ "plannedFinishDate": "2025-09-30",
119
+ "progress": "100%",
120
+ "status": "已完成"
121
+ },
122
+ {
123
+ "id": "SMART-2025-FACT-0002-MFG-P001",
124
+ "programCode": "SMART-2025-FACT-0002",
125
+ "program": "智能工厂建设项目集",
126
+ "code": "SMART-2025-FACT-0002-MFG-P001",
127
+ "name": "AGV物流调度系统",
128
+ "description": "部署自动导引车及调度平台",
129
+ "type": "混合型",
130
+ "manager": "李四",
131
+ "budget": "120000.00",
132
+ "plannedStartDate": "2025-05-01",
133
+ "plannedFinishDate": "2025-12-31",
134
+ "progress": "90%",
135
+ "status": "进行中"
136
+ },
137
+ {
138
+ "id": "SMART-2025-FACT-0002-IT-P001",
139
+ "programCode": "SMART-2025-FACT-0002",
140
+ "program": "智能工厂建设项目集",
141
+ "code": "SMART-2025-FACT-0002-IT-P001",
142
+ "name": "工厂IoT数据采集平台",
143
+ "description": "接入200+传感器,实现实时监控",
144
+ "type": "敏捷型",
145
+ "manager": "刘洋",
146
+ "budget": "78000.00",
147
+ "plannedStartDate": "2025-08-20",
148
+ "plannedFinishDate": "2026-02-28",
149
+ "progress": "30%",
150
+ "status": "进行中"
151
+ },
152
+ {
153
+ "id": "SMART-2025-FACT-0002-MFG-P002",
154
+ "programCode": "SMART-2025-FACT-0002",
155
+ "program": "智能工厂建设项目集",
156
+ "code": "SMART-2025-FACT-0002-MFG-P002",
157
+ "name": "智能排产系统",
158
+ "description": "基于AI算法优化生产计划",
159
+ "type": "瀑布型",
160
+ "manager": "陈工",
161
+ "budget": "65000.00",
162
+ "plannedStartDate": "2025-11-01",
163
+ "plannedFinishDate": "2026-03-31",
164
+ "progress": "0%",
165
+ "status": "未开始"
166
+ },
167
+ {
168
+ "id": "SMART-2025-FACT-0002-IT-P002",
169
+ "programCode": "SMART-2025-FACT-0002",
170
+ "program": "智能工厂建设项目集",
171
+ "code": "SMART-2025-FACT-0002-IT-P002",
172
+ "name": "边缘计算节点部署",
173
+ "description": "在车间部署边缘服务器处理实时数据",
174
+ "type": "混合型",
175
+ "manager": "王磊",
176
+ "budget": "42000.00",
177
+ "plannedStartDate": "2025-09-10",
178
+ "plannedFinishDate": "2025-12-15",
179
+ "progress": "15%",
180
+ "status": "进行中"
181
+ },
182
+ {
183
+ "id": "SMART-2025-FACT-0002-MFG-P003",
184
+ "programCode": "SMART-2025-FACT-0002",
185
+ "program": "智能工厂建设项目集",
186
+ "code": "SMART-2025-FACT-0002-MFG-P003",
187
+ "name": "质量追溯系统",
188
+ "description": "实现产品全生命周期质量追踪",
189
+ "type": "瀑布型",
190
+ "manager": "李四",
191
+ "budget": "50000.00",
192
+ "plannedStartDate": "2025-04-01",
193
+ "plannedFinishDate": "2025-10-31",
194
+ "progress": "100%",
195
+ "status": "已完成"
196
+ },
197
+ {
198
+ "id": "CLOUD-2025-MIGR-0003-IT-P001",
199
+ "programCode": "CLOUD-2025-MIGR-0003",
200
+ "program": "云迁移项目集",
201
+ "code": "CLOUD-2025-MIGR-0003-IT-P001",
202
+ "name": "ERP系统上云",
203
+ "description": "将SAP ERP迁移至阿里云",
204
+ "type": "瀑布型",
205
+ "manager": "张三",
206
+ "budget": "200000.00",
207
+ "plannedStartDate": "2025-03-01",
208
+ "plannedFinishDate": "2025-11-30",
209
+ "progress": "100%",
210
+ "status": "已完成"
211
+ },
212
+ {
213
+ "id": "CLOUD-2025-MIGR-0003-MFG-P001",
214
+ "programCode": "CLOUD-2025-MIGR-0003",
215
+ "program": "云迁移项目集",
216
+ "code": "CLOUD-2025-MIGR-0003-MFG-P001",
217
+ "name": "MES灾备云环境搭建",
218
+ "description": "为制造执行系统建立异地云灾备",
219
+ "type": "混合型",
220
+ "manager": "李四",
221
+ "budget": "85000.00",
222
+ "plannedStartDate": "2025-10-01",
223
+ "plannedFinishDate": "2026-01-31",
224
+ "progress": "10%",
225
+ "status": "进行中"
226
+ },
227
+ {
228
+ "id": "CLOUD-2025-MIGR-0003-IT-P002",
229
+ "programCode": "CLOUD-2025-MIGR-0003",
230
+ "program": "云迁移项目集",
231
+ "code": "CLOUD-2025-MIGR-0003-IT-P002",
232
+ "name": "数据库云原生改造",
233
+ "description": "将Oracle迁移至PolarDB并优化架构",
234
+ "type": "敏捷型",
235
+ "manager": "周婷",
236
+ "budget": "110000.00",
237
+ "plannedStartDate": "2025-07-15",
238
+ "plannedFinishDate": "2025-12-20",
239
+ "progress": "70%",
240
+ "status": "进行中"
241
+ },
242
+ {
243
+ "id": "CLOUD-2025-MIGR-0003-IT-P003",
244
+ "programCode": "CLOUD-2025-MIGR-0003",
245
+ "program": "云迁移项目集",
246
+ "code": "CLOUD-2025-MIGR-0003-IT-P003",
247
+ "name": "DevOps流水线上云",
248
+ "description": "CI/CD全流程迁移至云效平台",
249
+ "type": "敏捷型",
250
+ "manager": "张三",
251
+ "budget": "45000.00",
252
+ "plannedStartDate": "2025-12-01",
253
+ "plannedFinishDate": "2026-02-28",
254
+ "progress": "0%",
255
+ "status": "未开始"
256
+ },
257
+ {
258
+ "id": "CLOUD-2025-MIGR-0003-MFG-P002",
259
+ "programCode": "CLOUD-2025-MIGR-0003",
260
+ "program": "云迁移项目集",
261
+ "code": "CLOUD-2025-MIGR-0003-MFG-P002",
262
+ "name": "车间监控云存储方案",
263
+ "description": "视频监控数据存入对象存储",
264
+ "type": "瀑布型",
265
+ "manager": "李四",
266
+ "budget": "32000.00",
267
+ "plannedStartDate": "2025-09-01",
268
+ "plannedFinishDate": "2025-11-15",
269
+ "progress": "100%",
270
+ "status": "已完成"
271
+ }
272
+ ],
273
+ "code": 0,
274
+ "msg": "操作成功"
275
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-jnrs-template-vue",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
4
4
  "description": "巨能前端工程化开发,Vue 项目模板脚手架",
5
5
  "keywords": [
6
6
  "vue",
@@ -1,34 +0,0 @@
1
- import { request } from '../request'
2
- import type { ApiResponse } from '@/types'
3
-
4
- /**
5
- * 404 错误
6
- */
7
- export const NotFoundApi = () => {
8
- return request({
9
- url: '/notFound',
10
- method: 'get'
11
- })
12
- }
13
-
14
- /**
15
- * 无权限
16
- * @param showErrorMsg 是否显示错误信息
17
- */
18
- export const NoAuth = (showErrorMsg: boolean) => {
19
- return request({
20
- url: '/auth/no',
21
- method: 'post',
22
- showErrorMsg
23
- })
24
- }
25
-
26
- /**
27
- * 数据详情
28
- */
29
- export const DetailsApi = (): Promise<ApiResponse> => {
30
- return request({
31
- url: '/details',
32
- method: 'get'
33
- })
34
- }
@@ -1,40 +0,0 @@
1
- /**
2
- * @Author : TanRui
3
- * @WeChat : Tan578853789
4
- * @File : request.ts
5
- * @Date : 2025/11/10
6
- * @Desc. : api 网络请求
7
- */
8
-
9
- import { ElMessage } from 'element-plus'
10
- import { createAxiosInstance } from '@jnrs/core/axios'
11
- import type { BusinessRequest, BusinessResponse } from '@jnrs/core/axios'
12
- import { useMockStore, useAuthStore } from '@/stores'
13
- import { handleRouter } from '@jnrs/vue-core/router'
14
-
15
- const axiosInstance = createAxiosInstance({
16
- handleMessageFn: ElMessage,
17
- handleGetTokenFn: () => {
18
- const { token } = useAuthStore()
19
- return token
20
- },
21
- handleNoAuthFn: () => {
22
- handleRouter({ name: 'Login' })
23
- }
24
- })
25
-
26
- /**
27
- * 请求方法(泛型拓展)
28
- */
29
- const request = <T = BusinessResponse>(options: BusinessRequest): Promise<T> => {
30
- const { isMock } = useMockStore()
31
- if (!axiosInstance) {
32
- throw new Error('请先调用 createRequest 初始化 axios 实例')
33
- }
34
- if (isMock) {
35
- options.url = options.mockUrl ? options.mockUrl : '/mock' + options.url
36
- }
37
- return axiosInstance(options)
38
- }
39
-
40
- export { request }
@@ -1,11 +0,0 @@
1
- /**
2
- * @Author : TanRui
3
- * @WeChat : Tan578853789
4
- * @File : index.ts
5
- * @Date : 2025/09/30
6
- * @Desc. : 统一导出
7
- */
8
-
9
- export * from './useTable'
10
- export * from './useModal'
11
- export * from './useForm'
@@ -1,2 +0,0 @@
1
- export { useMockStore } from './mock'
2
- export { useSystemStore, useAuthStore, useMenuStore } from '@jnrs/vue-core/pinia'
@@ -1,21 +0,0 @@
1
- import { defineStore } from 'pinia'
2
- import { ref } from 'vue'
3
-
4
- /**
5
- * Mock仓库
6
- * @returns isMock 是否使用mock数据
7
- */
8
- export const useMockStore = defineStore(
9
- 'jnrs-app-mock',
10
- () => {
11
- // 是否使用mock数据
12
- const isMock = ref(import.meta.env.VITE_USE_MOCK === 'true')
13
-
14
- return { isMock }
15
- },
16
- {
17
- persist: {
18
- pick: ['isMock']
19
- }
20
- }
21
- )