dlzn-ui 2.0.26 → 2.0.28
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/chunks/{AssignUser-B8KO6qit.mjs → AssignUser-DZvNJ6_v.mjs} +2 -2
- package/chunks/{DictTypeDetail-DDv2c9JG.mjs → DictTypeDetail--OE6JJ5s.mjs} +1 -1
- package/chunks/{Log-CPni6oj5.mjs → Log-DTQeRVz1.mjs} +1 -1
- package/chunks/{SelectUser-Ce69wfaR.mjs → SelectUser-Y-2MCvw3.mjs} +1 -1
- package/chunks/{custom-page-list-DNONwY-V.mjs → custom-page-list-Dkjf1nLR.mjs} +2 -2
- package/chunks/{page-list-DMDDWHTe.mjs → page-list-DUYDkWcj.mjs} +4 -4
- package/chunks/{page-query-CRbcQbQW.mjs → page-query-oFiHpSCX.mjs} +9 -6
- package/components/custom-page-list/index.mjs +1 -1
- package/components/custom-page-list/src/custom-page-list.mjs +1 -1
- package/components/index.mjs +3 -3
- package/components/page-list/index.mjs +1 -1
- package/components/page-list/src/page-list.d.ts +1 -1
- package/components/page-list/src/page-list.mjs +1 -1
- package/components/page-query/index.mjs +1 -1
- package/components/page-query/src/page-query.mjs +1 -1
- package/components/page-query/src/page-query.vue.d.ts +2 -2
- package/components/select-sys-user/src/Picker.mjs +1 -1
- package/package.json +1 -1
- package/proj-template/.cursor/skills/refactor-page-list/SKILL.md +314 -0
- package/proj-template/.cursor/skills/refactor-page-list/examples.md +261 -0
- package/proj-template/.vscode/settings.json +1 -0
- package/views/index.mjs +4 -0
- package/views/monitor/logininfor/index.mjs +151 -0
- package/views/monitor/logininfor/index.vue.d.ts +3 -0
- package/views/monitor/operlog/index.mjs +231 -0
- package/views/monitor/operlog/index.vue.d.ts +3 -0
- package/views/system/config/index.mjs +192 -0
- package/views/system/config/index.vue.d.ts +3 -0
- package/views/system/dept/index.mjs +1 -1
- package/views/system/dict/index.mjs +2 -2
- package/views/system/dict/modules/DictTypeDetail.mjs +1 -1
- package/views/system/menu/index.mjs +1 -1
- package/views/system/notice/index.mjs +151 -0
- package/views/system/notice/index.vue.d.ts +3 -0
- package/views/system/post/index.mjs +1 -1
- package/views/system/role/index.mjs +2 -2
- package/views/system/role/modules/AssignUser.mjs +1 -1
- package/views/system/role/modules/SelectUser.mjs +1 -1
- package/views/system/user/index.mjs +1 -1
- package/views/tool/job/index.mjs +2 -2
- package/views/tool/job/modules/Log.mjs +1 -1
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
# refactor-page-list 示例
|
|
2
|
+
|
|
3
|
+
## 完整案例:system/config 参数设置
|
|
4
|
+
|
|
5
|
+
| 文件 | 项目 |
|
|
6
|
+
|------|------|
|
|
7
|
+
| 原 | `yq-monitor-front/src/views/system/config/index.vue` |
|
|
8
|
+
| 原表单 | `yq-monitor-front/src/views/system/config/modules/PageListItemForm.vue` |
|
|
9
|
+
| 目标 | `qc-ui/src/views/system/config/index.vue` |
|
|
10
|
+
|
|
11
|
+
## 原项目:列表 API + dateRange
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
// yq-monitor-front
|
|
15
|
+
urls: {
|
|
16
|
+
list: {
|
|
17
|
+
api: listConfig,
|
|
18
|
+
handleParams: (o) => {
|
|
19
|
+
const obj = {
|
|
20
|
+
...o,
|
|
21
|
+
'params[beginTime]': o.dateRange[0],
|
|
22
|
+
'params[endTime]': o.dateRange[1],
|
|
23
|
+
}
|
|
24
|
+
delete obj.dateRange
|
|
25
|
+
return obj
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 目标项目:等效写法
|
|
32
|
+
|
|
33
|
+
```typescript
|
|
34
|
+
// qc-ui
|
|
35
|
+
apis: {
|
|
36
|
+
list: {
|
|
37
|
+
method: (o: Record<string, any>) =>
|
|
38
|
+
$alova.Get('system/config/list', {
|
|
39
|
+
params: {
|
|
40
|
+
...o,
|
|
41
|
+
dateRange: undefined,
|
|
42
|
+
'params[beginTime]': o.dateRange[0],
|
|
43
|
+
'params[endTime]': o.dateRange[1],
|
|
44
|
+
},
|
|
45
|
+
}),
|
|
46
|
+
},
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## 原项目:批量删除
|
|
51
|
+
|
|
52
|
+
```typescript
|
|
53
|
+
delete: {
|
|
54
|
+
api: delConfig,
|
|
55
|
+
showBatch: true,
|
|
56
|
+
permission: 'system:config:remove',
|
|
57
|
+
handleParams: (rows) => ({
|
|
58
|
+
id: rows.map((item) => item.configId).join(','),
|
|
59
|
+
}),
|
|
60
|
+
}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## 目标项目:等效写法
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
apis: {
|
|
67
|
+
delete: {
|
|
68
|
+
method: 'system/config',
|
|
69
|
+
permission: 'system:config:remove',
|
|
70
|
+
showBatch: true,
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
tableOtherProps: { rowKey: 'configId' },
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
TPageList 自动执行 `$alova.Delete('system/config/1,2,3')`。
|
|
77
|
+
|
|
78
|
+
## 原项目:刷新缓存按钮
|
|
79
|
+
|
|
80
|
+
```typescript
|
|
81
|
+
btns: [{
|
|
82
|
+
text: '刷新缓存',
|
|
83
|
+
permission: 'system:config:remove',
|
|
84
|
+
onClick: () => { $api(refreshConfigCache) },
|
|
85
|
+
}]
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## 目标项目:等效写法
|
|
89
|
+
|
|
90
|
+
```typescript
|
|
91
|
+
operations: [{
|
|
92
|
+
default: '刷新缓存',
|
|
93
|
+
permission: 'system:config:remove',
|
|
94
|
+
popconfirm: {
|
|
95
|
+
content: '确定要刷新缓存吗?',
|
|
96
|
+
onConfirm: async () => {
|
|
97
|
+
await $alova.Delete('system/config/refreshCache', undefined, {
|
|
98
|
+
meta: { useSuccessMsg: true },
|
|
99
|
+
})
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
}]
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## 原项目:字典列
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
{
|
|
109
|
+
title: '系统内置',
|
|
110
|
+
field: 'configType',
|
|
111
|
+
cellRender: { name: 'c:dicLabel', dicCode: 'sys_yes_no' },
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## 目标项目:等效写法
|
|
116
|
+
|
|
117
|
+
```typescript
|
|
118
|
+
{
|
|
119
|
+
colKey: 'configType',
|
|
120
|
+
title: '系统内置',
|
|
121
|
+
cell: { component: 'DicLabel', dicCode: 'sys_yes_no' },
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
## 原项目:PageListItemForm 新增默认值
|
|
126
|
+
|
|
127
|
+
```typescript
|
|
128
|
+
// PageListItemForm.vue
|
|
129
|
+
const formData = reactive({ configType: 'Y', ... })
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## 目标项目:等效写法
|
|
133
|
+
|
|
134
|
+
```typescript
|
|
135
|
+
h(TForm, {
|
|
136
|
+
data: reactive({ configType: 'Y' }),
|
|
137
|
+
items: [formItemMap.configName, ...],
|
|
138
|
+
ref: formRef,
|
|
139
|
+
})
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## 原项目:只读详情弹窗
|
|
143
|
+
|
|
144
|
+
```typescript
|
|
145
|
+
// yq-monitor-front(如 operlog)
|
|
146
|
+
const { componentRef } = $dialog(
|
|
147
|
+
{
|
|
148
|
+
title: '操作日志详细',
|
|
149
|
+
width: '700',
|
|
150
|
+
noneCardTextPb: true,
|
|
151
|
+
showCancel: false,
|
|
152
|
+
confirmText: '关闭',
|
|
153
|
+
},
|
|
154
|
+
Detail,
|
|
155
|
+
)
|
|
156
|
+
nextTick(() => {
|
|
157
|
+
componentRef.value!.setFormData(row)
|
|
158
|
+
})
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## 目标项目:等效写法
|
|
162
|
+
|
|
163
|
+
```typescript
|
|
164
|
+
onClick: () => {
|
|
165
|
+
const formRef = ref<FormInstance | null>(null)
|
|
166
|
+
|
|
167
|
+
watch(formRef, () => {
|
|
168
|
+
formRef.value!.setFormData(row, {
|
|
169
|
+
override: {
|
|
170
|
+
loginInfo: `${row.operName}/${row.operIp}/${row.operLocation}`,
|
|
171
|
+
},
|
|
172
|
+
})
|
|
173
|
+
}, { once: true })
|
|
174
|
+
|
|
175
|
+
$dialog({
|
|
176
|
+
body: () =>
|
|
177
|
+
h(TForm, {
|
|
178
|
+
items: [formItemMap.title, formItemMap.businessType, /* ... */],
|
|
179
|
+
labelAlign: 'right',
|
|
180
|
+
layout: 'vertical',
|
|
181
|
+
readonly: true,
|
|
182
|
+
ref: formRef,
|
|
183
|
+
}),
|
|
184
|
+
cancelBtn: '关闭',
|
|
185
|
+
confirmBtn: null,
|
|
186
|
+
header: '操作日志详细',
|
|
187
|
+
width: 700,
|
|
188
|
+
})
|
|
189
|
+
}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
## 原项目:Input append slot
|
|
193
|
+
|
|
194
|
+
```vue
|
|
195
|
+
<CInput v-model="formData.costTime">
|
|
196
|
+
<template #append>毫秒</template>
|
|
197
|
+
</CInput>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## 目标项目:等效写法
|
|
201
|
+
|
|
202
|
+
```typescript
|
|
203
|
+
costTime: {
|
|
204
|
+
_label: '消耗时间',
|
|
205
|
+
adornment: { append: () => '毫秒' },
|
|
206
|
+
component: 'TInput',
|
|
207
|
+
model: 'costTime',
|
|
208
|
+
},
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
## 备注列宽度限制
|
|
212
|
+
|
|
213
|
+
`title: '备注'` 或 `colKey: 'remark'` 的列内容可能很长,需限制宽度:
|
|
214
|
+
|
|
215
|
+
```typescript
|
|
216
|
+
{
|
|
217
|
+
colKey: 'remark',
|
|
218
|
+
resize: { maxWidth: 300 },
|
|
219
|
+
title: '备注',
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
## 易错:HTTP 方法须查原 api 定义
|
|
224
|
+
|
|
225
|
+
原项目 `unlockLogininfor` **没有** `method` 字段 → 默认 **GET**,不是 DELETE:
|
|
226
|
+
|
|
227
|
+
```typescript
|
|
228
|
+
// yq-monitor-front/src/api/monitor.ts
|
|
229
|
+
export const unlockLogininfor: apiConfig = {
|
|
230
|
+
url: `${prefix}/logininfor/unlock/{userName}`,
|
|
231
|
+
msgOnSuccess: true,
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
// 错误 ❌
|
|
235
|
+
await $alova.Delete(`monitor/logininfor/unlock/${row.userName}`, ...)
|
|
236
|
+
|
|
237
|
+
// 错误 ❌ Get 不能传三个参数
|
|
238
|
+
await $alova.Get(`monitor/logininfor/unlock/${row.userName}`, undefined, {
|
|
239
|
+
meta: { useSuccessMsg: true },
|
|
240
|
+
})
|
|
241
|
+
|
|
242
|
+
// 正确 ✅
|
|
243
|
+
await $alova.Get(`monitor/logininfor/unlock/${row.userName}`, {
|
|
244
|
+
meta: { useSuccessMsg: true },
|
|
245
|
+
})
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
## API 路径推导
|
|
249
|
+
|
|
250
|
+
原 `@/api/system.ts`:
|
|
251
|
+
|
|
252
|
+
```typescript
|
|
253
|
+
export const listConfig = { url: `${prefix}/config/list` }
|
|
254
|
+
export const addConfig = { url: `${prefix}/config`, method: 'post' }
|
|
255
|
+
export const updateConfig = { url: `${prefix}/config`, method: 'put' }
|
|
256
|
+
export const delConfig = { url: `${prefix}/config/{id}`, method: 'delete' }
|
|
257
|
+
export const exportConfig = { url: `${prefix}/config/export`, method: 'post', responseType: 'blob' }
|
|
258
|
+
export const refreshConfigCache = { url: `${prefix}/config/refreshCache`, method: 'delete' }
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
`prefix` 通常为 `system`,目标直接使用 `system/config/...` 路径。
|
package/views/index.mjs
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import e from "virtual:dlzn-ui/app-params";
|
|
2
2
|
var t = {
|
|
3
3
|
.../* @__PURE__ */ Object.assign({
|
|
4
|
+
"./monitor/logininfor/index.vue": () => import("./monitor/logininfor/index.mjs"),
|
|
5
|
+
"./monitor/operlog/index.vue": () => import("./monitor/operlog/index.mjs"),
|
|
6
|
+
"./system/config/index.vue": () => import("./system/config/index.mjs"),
|
|
4
7
|
"./system/dept/index.vue": () => import("./system/dept/index.mjs"),
|
|
5
8
|
"./system/dict/index.vue": () => import("./system/dict/index.mjs"),
|
|
6
9
|
"./system/menu/index.vue": () => import("./system/menu/index.mjs"),
|
|
10
|
+
"./system/notice/index.vue": () => import("./system/notice/index.mjs"),
|
|
7
11
|
"./system/post/index.vue": () => import("./system/post/index.mjs"),
|
|
8
12
|
"./system/role/index.vue": () => import("./system/role/index.mjs"),
|
|
9
13
|
"./system/user/index.vue": () => import("./system/user/index.mjs"),
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { createBlock as e, defineComponent as t, mergeProps as n, openBlock as r, resolveComponent as i } from "vue";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region ../../packages/dlzn-ui/views/monitor/logininfor/index.vue
|
|
4
|
+
var a = /* @__PURE__ */ t({
|
|
5
|
+
__name: "index",
|
|
6
|
+
setup(t) {
|
|
7
|
+
let a = useTemplateRef("pageListRef"), o = ref({
|
|
8
|
+
descending: !0,
|
|
9
|
+
sortBy: "loginTime"
|
|
10
|
+
}), s = {
|
|
11
|
+
dateRange: {
|
|
12
|
+
_class: "col-span-2",
|
|
13
|
+
_label: "登录时间",
|
|
14
|
+
component: "TDatePicker",
|
|
15
|
+
model: "dateRange",
|
|
16
|
+
type: "daterange"
|
|
17
|
+
},
|
|
18
|
+
ipaddr: {
|
|
19
|
+
_label: "登录地址",
|
|
20
|
+
component: "TInput",
|
|
21
|
+
model: "ipaddr"
|
|
22
|
+
},
|
|
23
|
+
status: {
|
|
24
|
+
_label: "状态",
|
|
25
|
+
component: "TSelect",
|
|
26
|
+
dicCode: "sys_common_status",
|
|
27
|
+
model: "status"
|
|
28
|
+
},
|
|
29
|
+
userName: {
|
|
30
|
+
_label: "用户名称",
|
|
31
|
+
component: "TInput",
|
|
32
|
+
model: "userName"
|
|
33
|
+
}
|
|
34
|
+
}, c = {
|
|
35
|
+
apis: {
|
|
36
|
+
delete: {
|
|
37
|
+
method: "monitor/logininfor",
|
|
38
|
+
permission: "monitor:logininfor:remove",
|
|
39
|
+
showBatch: !0
|
|
40
|
+
},
|
|
41
|
+
export: {
|
|
42
|
+
method: "monitor/logininfor/export",
|
|
43
|
+
permission: "monitor:logininfor:export"
|
|
44
|
+
},
|
|
45
|
+
list: { method: (e) => $alova.Get("monitor/logininfor/list", { params: {
|
|
46
|
+
...e,
|
|
47
|
+
dateRange: void 0,
|
|
48
|
+
"params[beginTime]": e.dateRange[0],
|
|
49
|
+
"params[endTime]": e.dateRange[1],
|
|
50
|
+
...o.value ? {
|
|
51
|
+
isAsc: o.value.descending ? "descending" : "ascending",
|
|
52
|
+
orderByColumn: o.value.sortBy
|
|
53
|
+
} : {}
|
|
54
|
+
} }) }
|
|
55
|
+
},
|
|
56
|
+
columns: [
|
|
57
|
+
{
|
|
58
|
+
colKey: "infoId",
|
|
59
|
+
title: "访问编号"
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
colKey: "userName",
|
|
63
|
+
title: "用户名称"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
colKey: "ipaddr",
|
|
67
|
+
title: "地址"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
colKey: "loginLocation",
|
|
71
|
+
title: "登录地点"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
colKey: "os",
|
|
75
|
+
title: "操作系统"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
colKey: "browser",
|
|
79
|
+
title: "浏览器"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
cell: {
|
|
83
|
+
component: "DicLabel",
|
|
84
|
+
dicCode: "sys_common_status"
|
|
85
|
+
},
|
|
86
|
+
colKey: "status",
|
|
87
|
+
title: "登录状态"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
colKey: "msg",
|
|
91
|
+
resize: { maxWidth: 300 },
|
|
92
|
+
title: "描述"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
colKey: "loginTime",
|
|
96
|
+
sorter: !0,
|
|
97
|
+
title: "访问时间"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
cell: {
|
|
101
|
+
buttons: [({ row: e }) => ({
|
|
102
|
+
default: "解锁",
|
|
103
|
+
permission: "monitor:logininfor:unlock",
|
|
104
|
+
popconfirm: {
|
|
105
|
+
content: `是否确认解锁用户${e.userName}数据项?`,
|
|
106
|
+
onConfirm: async () => {
|
|
107
|
+
await $alova.Get(`monitor/logininfor/unlock/${e.userName}`, { meta: { useSuccessMsg: !0 } });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
})],
|
|
111
|
+
component: "Buttons"
|
|
112
|
+
},
|
|
113
|
+
colKey: "_operation",
|
|
114
|
+
title: "操作"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
formItems: [
|
|
118
|
+
s.ipaddr,
|
|
119
|
+
s.userName,
|
|
120
|
+
s.status,
|
|
121
|
+
s.dateRange
|
|
122
|
+
],
|
|
123
|
+
operations: [{
|
|
124
|
+
default: "清空",
|
|
125
|
+
permission: "monitor:logininfor:remove",
|
|
126
|
+
popconfirm: {
|
|
127
|
+
content: "是否确认清空所有登录日志数据项?",
|
|
128
|
+
onConfirm: async () => {
|
|
129
|
+
await $alova.Delete("monitor/logininfor/clean", void 0, { meta: { useSuccessMsg: !0 } }), a.value.reset();
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
}],
|
|
133
|
+
tableOtherProps: reactive({
|
|
134
|
+
onSortChange: (e) => {
|
|
135
|
+
o.value = e, a.value.query();
|
|
136
|
+
},
|
|
137
|
+
rowKey: "infoId",
|
|
138
|
+
sort: o
|
|
139
|
+
})
|
|
140
|
+
};
|
|
141
|
+
return (t, o) => {
|
|
142
|
+
let s = i("TPageList");
|
|
143
|
+
return r(), e(s, n({
|
|
144
|
+
ref_key: "pageListRef",
|
|
145
|
+
ref: a
|
|
146
|
+
}, c), null, 16);
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
//#endregion
|
|
151
|
+
export { a as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { createBlock as e, defineComponent as t, mergeProps as n, openBlock as r, resolveComponent as i } from "vue";
|
|
2
|
+
//#endregion
|
|
3
|
+
//#region ../../packages/dlzn-ui/views/monitor/operlog/index.vue
|
|
4
|
+
var a = /* @__PURE__ */ t({
|
|
5
|
+
__name: "index",
|
|
6
|
+
setup(t) {
|
|
7
|
+
let a = useTemplateRef("pageListRef"), o = ref({
|
|
8
|
+
descending: !0,
|
|
9
|
+
sortBy: "operTime"
|
|
10
|
+
}), s = {
|
|
11
|
+
businessType: {
|
|
12
|
+
_label: "操作类型",
|
|
13
|
+
component: "TSelect",
|
|
14
|
+
dicCode: "sys_oper_type",
|
|
15
|
+
model: "businessType"
|
|
16
|
+
},
|
|
17
|
+
costTime: {
|
|
18
|
+
_label: "消耗时间",
|
|
19
|
+
adornment: { append: () => "毫秒" },
|
|
20
|
+
component: "TInput",
|
|
21
|
+
model: "costTime"
|
|
22
|
+
},
|
|
23
|
+
dateRange: {
|
|
24
|
+
_class: "col-span-2",
|
|
25
|
+
_label: "操作时间",
|
|
26
|
+
component: "TDatePicker",
|
|
27
|
+
model: "dateRange",
|
|
28
|
+
type: "daterange"
|
|
29
|
+
},
|
|
30
|
+
errorMsg: {
|
|
31
|
+
__others: ({ formData: e }) => ({ show: e.status === "1" }),
|
|
32
|
+
_label: "异常信息",
|
|
33
|
+
component: "TTextarea",
|
|
34
|
+
model: "errorMsg"
|
|
35
|
+
},
|
|
36
|
+
jsonResult: {
|
|
37
|
+
_label: "返回参数",
|
|
38
|
+
component: "TTextarea",
|
|
39
|
+
model: "jsonResult"
|
|
40
|
+
},
|
|
41
|
+
loginInfo: {
|
|
42
|
+
_label: "登录信息",
|
|
43
|
+
component: "TInput",
|
|
44
|
+
model: "loginInfo"
|
|
45
|
+
},
|
|
46
|
+
method: {
|
|
47
|
+
_label: "操作方法",
|
|
48
|
+
component: "TInput",
|
|
49
|
+
model: "method"
|
|
50
|
+
},
|
|
51
|
+
operName: {
|
|
52
|
+
_label: "操作人员",
|
|
53
|
+
component: "TInput",
|
|
54
|
+
model: "operName"
|
|
55
|
+
},
|
|
56
|
+
operParam: {
|
|
57
|
+
_label: "请求参数",
|
|
58
|
+
component: "TTextarea",
|
|
59
|
+
model: "operParam"
|
|
60
|
+
},
|
|
61
|
+
operTime: {
|
|
62
|
+
_label: "操作时间",
|
|
63
|
+
component: "TInput",
|
|
64
|
+
model: "operTime"
|
|
65
|
+
},
|
|
66
|
+
operUrl: {
|
|
67
|
+
_label: "请求地址",
|
|
68
|
+
component: "TInput",
|
|
69
|
+
model: "operUrl"
|
|
70
|
+
},
|
|
71
|
+
requestMethod: {
|
|
72
|
+
_label: "请求方式",
|
|
73
|
+
component: "TInput",
|
|
74
|
+
model: "requestMethod"
|
|
75
|
+
},
|
|
76
|
+
status: {
|
|
77
|
+
_label: "操作状态",
|
|
78
|
+
component: "TSelect",
|
|
79
|
+
dicCode: "sys_common_status",
|
|
80
|
+
model: "status"
|
|
81
|
+
},
|
|
82
|
+
title: {
|
|
83
|
+
_label: "系统模块",
|
|
84
|
+
component: "TInput",
|
|
85
|
+
model: "title"
|
|
86
|
+
}
|
|
87
|
+
}, c = {
|
|
88
|
+
apis: {
|
|
89
|
+
delete: {
|
|
90
|
+
method: "monitor/operlog",
|
|
91
|
+
permission: "monitor:operlog:remove",
|
|
92
|
+
showBatch: !0
|
|
93
|
+
},
|
|
94
|
+
export: {
|
|
95
|
+
method: "monitor/operlog/export",
|
|
96
|
+
permission: "monitor:operlog:export"
|
|
97
|
+
},
|
|
98
|
+
list: { method: (e) => $alova.Get("monitor/operlog/list", { params: {
|
|
99
|
+
...e,
|
|
100
|
+
dateRange: void 0,
|
|
101
|
+
"params[beginTime]": e.dateRange[0],
|
|
102
|
+
"params[endTime]": e.dateRange[1],
|
|
103
|
+
...o.value ? {
|
|
104
|
+
isAsc: o.value.descending ? "descending" : "ascending",
|
|
105
|
+
orderByColumn: o.value.sortBy
|
|
106
|
+
} : {}
|
|
107
|
+
} }) }
|
|
108
|
+
},
|
|
109
|
+
columns: [
|
|
110
|
+
{
|
|
111
|
+
colKey: "operId",
|
|
112
|
+
title: "日志编号"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
colKey: "title",
|
|
116
|
+
title: "系统模块"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
cell: {
|
|
120
|
+
component: "DicLabel",
|
|
121
|
+
dicCode: "sys_oper_type"
|
|
122
|
+
},
|
|
123
|
+
colKey: "businessType",
|
|
124
|
+
title: "操作类型"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
colKey: "operName",
|
|
128
|
+
title: "操作人员"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
colKey: "operIp",
|
|
132
|
+
title: "操作地址"
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
cell: {
|
|
136
|
+
component: "DicLabel",
|
|
137
|
+
dicCode: "sys_common_status"
|
|
138
|
+
},
|
|
139
|
+
colKey: "status",
|
|
140
|
+
title: "操作状态"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
colKey: "operTime",
|
|
144
|
+
sorter: !0,
|
|
145
|
+
title: "操作日期"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
cell: (e, { row: t }) => `${t.costTime}毫秒`,
|
|
149
|
+
colKey: "costTime",
|
|
150
|
+
sorter: !0,
|
|
151
|
+
title: "消耗时间"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
cell: {
|
|
155
|
+
buttons: [({ row: e }) => ({
|
|
156
|
+
default: "详细",
|
|
157
|
+
onClick: () => {
|
|
158
|
+
let t = ref(null);
|
|
159
|
+
watch(t, () => {
|
|
160
|
+
t.value.setFormData(e, { override: { loginInfo: `${e.operName}/${e.operIp}/${e.operLocation}` } });
|
|
161
|
+
}, { once: !0 }), $dialog({
|
|
162
|
+
body: () => h(TForm, {
|
|
163
|
+
items: [
|
|
164
|
+
s.title,
|
|
165
|
+
s.businessType,
|
|
166
|
+
s.loginInfo,
|
|
167
|
+
s.operUrl,
|
|
168
|
+
s.requestMethod,
|
|
169
|
+
s.method,
|
|
170
|
+
s.operParam,
|
|
171
|
+
s.jsonResult,
|
|
172
|
+
s.status,
|
|
173
|
+
s.costTime,
|
|
174
|
+
s.operTime,
|
|
175
|
+
s.errorMsg
|
|
176
|
+
],
|
|
177
|
+
labelAlign: "right",
|
|
178
|
+
layout: "vertical",
|
|
179
|
+
readonly: !0,
|
|
180
|
+
ref: t
|
|
181
|
+
}),
|
|
182
|
+
cancelBtn: "关闭",
|
|
183
|
+
confirmBtn: null,
|
|
184
|
+
header: "操作日志详细",
|
|
185
|
+
width: 700
|
|
186
|
+
});
|
|
187
|
+
},
|
|
188
|
+
permission: "monitor:operlog:query"
|
|
189
|
+
})],
|
|
190
|
+
component: "Buttons"
|
|
191
|
+
},
|
|
192
|
+
colKey: "_operation",
|
|
193
|
+
title: "操作"
|
|
194
|
+
}
|
|
195
|
+
],
|
|
196
|
+
formItems: [
|
|
197
|
+
s.title,
|
|
198
|
+
s.operName,
|
|
199
|
+
s.businessType,
|
|
200
|
+
s.status,
|
|
201
|
+
s.dateRange
|
|
202
|
+
],
|
|
203
|
+
operations: [{
|
|
204
|
+
default: "清空",
|
|
205
|
+
permission: "monitor:operlog:remove",
|
|
206
|
+
popconfirm: {
|
|
207
|
+
content: "是否确认清空所有操作日志数据项?",
|
|
208
|
+
onConfirm: async () => {
|
|
209
|
+
await $alova.Delete("monitor/operlog/clean", void 0, { meta: { useSuccessMsg: !0 } }), a.value.reset();
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}],
|
|
213
|
+
tableOtherProps: reactive({
|
|
214
|
+
onSortChange: (e) => {
|
|
215
|
+
o.value = e, a.value.query();
|
|
216
|
+
},
|
|
217
|
+
rowKey: "operId",
|
|
218
|
+
sort: o
|
|
219
|
+
})
|
|
220
|
+
};
|
|
221
|
+
return (t, o) => {
|
|
222
|
+
let s = i("TPageList");
|
|
223
|
+
return r(), e(s, n({
|
|
224
|
+
ref_key: "pageListRef",
|
|
225
|
+
ref: a
|
|
226
|
+
}, c), null, 16);
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
//#endregion
|
|
231
|
+
export { a as default };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|