dlzn-ui 2.0.27 → 2.0.30
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 +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 +193 -0
- package/views/system/config/index.vue.d.ts +3 -0
- package/views/system/notice/index.mjs +152 -0
- package/views/system/notice/index.vue.d.ts +3 -0
package/package.json
CHANGED
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: refactor-page-list
|
|
3
|
+
description: >-
|
|
4
|
+
将 yq-monitor-front 的 CPageList 列表页重构到 qc-ui 的 TPageList 模式。
|
|
5
|
+
用于页面迁移、列表页重构、CPageList 转 TPageList、yq-monitor-front 到 qc-ui 的 views 迁移。
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# PageList 页面重构(yq-monitor-front → qc-ui)
|
|
9
|
+
|
|
10
|
+
## 项目约定
|
|
11
|
+
|
|
12
|
+
| 角色 | 路径 | 说明 |
|
|
13
|
+
|------|------|------|
|
|
14
|
+
| 原项目 | `e:\code\yq-monitor-front` | 业务行为基准,不做重构性改动 |
|
|
15
|
+
| 目标项目 | `e:\code\qc-ui` | 迁移落地目录,保持 `src/views/...` 路径一致 |
|
|
16
|
+
|
|
17
|
+
路由由后端菜单驱动,组件路径如 `system/config/index` 映射到 `qc-ui/src/views/system/config/index.vue`(`src/views/index.ts` glob),**无需手动注册路由**。
|
|
18
|
+
|
|
19
|
+
## 实现方式选择
|
|
20
|
+
|
|
21
|
+
迁移前先确认实现位置:
|
|
22
|
+
|
|
23
|
+
| 场景 | 做法 | 参考 |
|
|
24
|
+
|------|------|------|
|
|
25
|
+
| 通用系统模块(user/role/dict/post)且 dlzn-ui 已有 | qc-ui 薄封装,引用 `dlzn-ui/views/system/...` | `src/views/system/user/index.vue` |
|
|
26
|
+
| 通用系统模块但 dlzn-ui 尚无 | 在 qc-ui 内完整实现(默认) | `src/views/system/config/index.vue` |
|
|
27
|
+
| 舆情业务页(yq/* API) | 在 qc-ui 内完整实现 | `src/views/system/wbTaskCfg/index.vue` |
|
|
28
|
+
|
|
29
|
+
用户未指定时,**默认在 qc-ui 内完整实现**。
|
|
30
|
+
|
|
31
|
+
## 迁移工作流
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
Task Progress:
|
|
35
|
+
- [ ] 1. 读取原项目页面及 modules/PageListItemForm.vue(如有)
|
|
36
|
+
- [ ] 2. 读取原项目 `@/api/*.ts` 中**每个**接口的 `method`(未写则默认为 `get`,见 yq-monitor-front `$api`)
|
|
37
|
+
- [ ] 3. 在 qc-ui 同路径创建 index.vue
|
|
38
|
+
- [ ] 4. 按映射表转换配置
|
|
39
|
+
- [ ] 5. 内联新增/编辑表单(不迁移 PageListItemForm)
|
|
40
|
+
- [ ] 6. 对**本次修改的文件**执行 `pnpm eslint <路径>` 与 `pnpm vue-tsc --noEmit`,确认无 ESLint/TS 报错后再结束
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Step 1:分析原页面
|
|
44
|
+
|
|
45
|
+
原项目典型结构:
|
|
46
|
+
|
|
47
|
+
- `CPageList` + `config.urls`(list/delete/export)
|
|
48
|
+
- `config.formItems` + `config.columns`(vxe-table 字段名 `field`)
|
|
49
|
+
- `config.btns` 自定义操作
|
|
50
|
+
- `modules/PageListItemForm.vue` 负责新增/编辑
|
|
51
|
+
|
|
52
|
+
### Step 2:建立 formItemMap
|
|
53
|
+
|
|
54
|
+
将所有表单字段(筛选 + 弹窗)集中到 `formItemMap`:
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
const formItemMap = {
|
|
58
|
+
fieldName: {
|
|
59
|
+
_label: '标签',
|
|
60
|
+
_required: true, // 弹窗必填
|
|
61
|
+
component: 'TInput', // 见组件映射表
|
|
62
|
+
model: 'fieldName',
|
|
63
|
+
dicCode: 'dict_code', // 字典字段
|
|
64
|
+
},
|
|
65
|
+
dateRange: {
|
|
66
|
+
_class: 'col-span-2', // 仅用于 TPageList 筛选区;vertical TForm 不加
|
|
67
|
+
_label: '创建时间',
|
|
68
|
+
component: 'TDatePicker',
|
|
69
|
+
model: 'dateRange',
|
|
70
|
+
type: 'daterange',
|
|
71
|
+
},
|
|
72
|
+
} satisfies Record<string, FormItem>
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
筛选用 `TSelect`,弹窗用 `TRadioGroup` 时,通过展开覆盖 component:
|
|
76
|
+
|
|
77
|
+
`formItemMap` 若同时用于筛选区和 vertical 弹窗,详情专用字段不要带 `_class: 'col-span-2'`;或弹窗 items 里单独定义不带 `_class` 的项。
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
formItems: [{ ...formItemMap.status, component: 'TSelect' }]
|
|
81
|
+
// 弹窗内: { ...formItemMap.status, component: 'TRadioGroup' }
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Step 3:配置 PageListProps
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
const pageListRef = useTemplateRef('pageListRef')
|
|
88
|
+
const config: PageListProps = {
|
|
89
|
+
apis: { /* 见 API 映射 */ },
|
|
90
|
+
columns: [ /* 见列映射 */ ],
|
|
91
|
+
formItems: [ /* 筛选项 */ ],
|
|
92
|
+
operations: [ /* 新增、刷新缓存等 */ ],
|
|
93
|
+
tableOtherProps: { rowKey: '主键字段' },
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### Step 4:内联新增/编辑
|
|
98
|
+
|
|
99
|
+
**不要**迁移 `PageListItemForm.vue`,改用 `$confirm` + `h(TForm, ...)`:
|
|
100
|
+
|
|
101
|
+
```typescript
|
|
102
|
+
// 编辑
|
|
103
|
+
const formRef = ref<FormInstance | null>(null)
|
|
104
|
+
watch(formRef, () => { formRef.value!.setFormData(row) }, { once: true })
|
|
105
|
+
$confirm({
|
|
106
|
+
body: () => h(TForm, { items: [...], labelAlign: 'right', layout: 'vertical', ref: formRef }),
|
|
107
|
+
header: '修改xxx',
|
|
108
|
+
width: 460,
|
|
109
|
+
onConfirmCallback: async () => {
|
|
110
|
+
await $alova.Put('module/path', { ...(await formRef.value!.validate()), id: row.id })
|
|
111
|
+
$msg.success('修改成功')
|
|
112
|
+
pageListRef.value!.query()
|
|
113
|
+
},
|
|
114
|
+
})
|
|
115
|
+
|
|
116
|
+
// 新增
|
|
117
|
+
$confirm({
|
|
118
|
+
body: () => h(TForm, {
|
|
119
|
+
data: reactive({ status: '0' }), // 默认值
|
|
120
|
+
items: [...],
|
|
121
|
+
ref: formRef,
|
|
122
|
+
}),
|
|
123
|
+
onConfirmCallback: async () => {
|
|
124
|
+
await $alova.Post('module/path', await formRef.value!.validate())
|
|
125
|
+
$msg.success('添加成功')
|
|
126
|
+
pageListRef.value!.query()
|
|
127
|
+
},
|
|
128
|
+
})
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Step 5:模板
|
|
132
|
+
|
|
133
|
+
```vue
|
|
134
|
+
<template>
|
|
135
|
+
<TPageList ref="pageListRef" v-bind="config"></TPageList>
|
|
136
|
+
</template>
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## 映射表
|
|
140
|
+
|
|
141
|
+
### 组件映射
|
|
142
|
+
|
|
143
|
+
| 原项目 (C*) | 目标项目 (T*) | 说明 |
|
|
144
|
+
|-------------|---------------|------|
|
|
145
|
+
| `CInput` / 默认 | `TInput` | 文本 |
|
|
146
|
+
| `CSelect` | `TSelect` | 筛选下拉 |
|
|
147
|
+
| `CRadio` | `TRadioGroup` | 弹窗单选 |
|
|
148
|
+
| `CDate` type=daterange | `TDatePicker` type=daterange | 筛选表单加 `_class: 'col-span-2'`;`layout: 'vertical'` 的 TForm 不加 |
|
|
149
|
+
| textarea | `TTextarea` | 备注 |
|
|
150
|
+
| append slot | `adornment: { append: () => '单位' }` | TInput 后缀须用函数形式 |
|
|
151
|
+
| `c:dicLabel` | `{ component: 'DicLabel', dicCode }` | 表格字典列 |
|
|
152
|
+
| `c:btns` | `{ component: 'Buttons', buttons: [...] }` | 操作列 |
|
|
153
|
+
|
|
154
|
+
### API 映射
|
|
155
|
+
|
|
156
|
+
**迁移前必查原项目 api 定义**(`yq-monitor-front/src/api/system.ts` 或 `monitor.ts` 等)。原项目 `$api` 默认 `method = 'get'`,**未显式声明 method 的接口一律是 GET**,不能凭语义猜测(如 unlock 不是 DELETE)。
|
|
157
|
+
|
|
158
|
+
| 原 apiConfig | 目标调用 |
|
|
159
|
+
|--------------|----------|
|
|
160
|
+
| 无 `method` 或 `method` 省略 | `$alova.Get('...')` |
|
|
161
|
+
| `url: 'system/xxx/list'` | `apis.list.method: 'system/xxx/list'` 或 `$alova.Get` |
|
|
162
|
+
| `method: 'post'` | `$alova.Post('...', data)` |
|
|
163
|
+
| `method: 'put'` | `$alova.Put('...', data)` |
|
|
164
|
+
| `method: 'delete'` + `{id}` | `$alova.Delete('...')` 或 `apis.delete.method`(TPageList 自动拼接 id) |
|
|
165
|
+
| `responseType: 'blob'` 导出 | `apis.export.method: '.../export'`(POST) |
|
|
166
|
+
| `refreshCache` 且原定义为 delete | `$alova.Delete('.../refreshCache', ...)` |
|
|
167
|
+
| `unlock/{userName}` 且无 method | `$alova.Get('monitor/logininfor/unlock/${userName}', ...)` |
|
|
168
|
+
|
|
169
|
+
路径占位符 `{userName}`、`{id}` 在目标项目中通常拼进 URL 字符串,如 `` `monitor/logininfor/unlock/${row.userName}` ``。
|
|
170
|
+
|
|
171
|
+
**`$alova` 参数个数**(勿与 axios 混用;写完后对照项目内已有调用):
|
|
172
|
+
|
|
173
|
+
| 方法 | 签名 | 仅 meta / params 时 |
|
|
174
|
+
|------|------|---------------------|
|
|
175
|
+
| `Get` | `(url, config?)` | `$alova.Get(url, { meta: { useSuccessMsg: true } })` |
|
|
176
|
+
| `Post` | `(url, data?, config?)` | 无 body 时第二参可省略 |
|
|
177
|
+
| `Put` | `(url, data?, config?)` | |
|
|
178
|
+
| `Delete` | `(url, data?, config?)` | 无 body 时用 `$alova.Delete(url, undefined, { meta })` |
|
|
179
|
+
|
|
180
|
+
`Get` **只有两个参数**,不要把 `undefined` 插在中间;`params` 与 `meta` 同放在第二个 config 对象里。
|
|
181
|
+
|
|
182
|
+
**dateRange 参数转换**(list 与 export 共用 finallyQueryParams;`dateRange` 恒为数组,空数组时 `[0]`/`[1]` 为 `undefined` 可直接传递):
|
|
183
|
+
|
|
184
|
+
```typescript
|
|
185
|
+
list: {
|
|
186
|
+
method: (o: Record<string, any>) =>
|
|
187
|
+
$alova.Get('system/xxx/list', {
|
|
188
|
+
params: {
|
|
189
|
+
...o,
|
|
190
|
+
dateRange: undefined,
|
|
191
|
+
'params[beginTime]': o.dateRange[0],
|
|
192
|
+
'params[endTime]': o.dateRange[1],
|
|
193
|
+
},
|
|
194
|
+
}),
|
|
195
|
+
},
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**批量删除**:原 `handleParams` 拼接 id → 目标设置 `showBatch: true` + `tableOtherProps.rowKey`。
|
|
199
|
+
|
|
200
|
+
### 列映射
|
|
201
|
+
|
|
202
|
+
| 原 columns | 目标 columns |
|
|
203
|
+
|------------|--------------|
|
|
204
|
+
| `field: 'xxx'` | `colKey: 'xxx'` |
|
|
205
|
+
| `title: 'xxx'` | `title: 'xxx'`(不变) |
|
|
206
|
+
| `type: 'checkbox'` | 由 `apis.delete.showBatch: true` 自动处理 |
|
|
207
|
+
| `field: 'c-action'` | `colKey: '_operation'` |
|
|
208
|
+
| 删除按钮 | 由 TPageList 根据 `apis.delete` 自动追加 |
|
|
209
|
+
| `field: 'remark'` / `title: '备注'` | 加 `resize: { maxWidth: 300 }`(内容可能很长) |
|
|
210
|
+
|
|
211
|
+
### 权限
|
|
212
|
+
|
|
213
|
+
原 `permission` 字段**原样保留**,如 `system:config:add/edit/remove/export`。
|
|
214
|
+
|
|
215
|
+
### 即时请求操作需 popconfirm
|
|
216
|
+
|
|
217
|
+
`operations` 中点击即发请求的操作(刷新缓存、同步、重置等),**必须**用 `popconfirm` 二次确认,不用 `onClick` 直接请求:
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
{
|
|
221
|
+
default: '刷新缓存',
|
|
222
|
+
permission: 'system:config:remove',
|
|
223
|
+
popconfirm: {
|
|
224
|
+
content: '确定要刷新缓存吗?',
|
|
225
|
+
onConfirm: async () => {
|
|
226
|
+
await $alova.Delete('system/config/refreshCache', undefined, {
|
|
227
|
+
meta: { useSuccessMsg: true },
|
|
228
|
+
})
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
}
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
新增/编辑等打开弹窗的操作不需要 popconfirm。
|
|
235
|
+
|
|
236
|
+
### 只读详情弹窗($dialog)
|
|
237
|
+
|
|
238
|
+
原项目用旧式 `$dialog({ title, showCancel: false, confirmText: '关闭' }, Component)` 展示只读详情时,目标项目**直接用 `h(TForm, ...)` 内联**,与 `formItemMap` 共用,**不单独建 `modules/Detail.vue`**:
|
|
239
|
+
|
|
240
|
+
```typescript
|
|
241
|
+
onClick: () => {
|
|
242
|
+
const formRef = ref<FormInstance | null>(null)
|
|
243
|
+
|
|
244
|
+
watch(formRef, () => {
|
|
245
|
+
formRef.value!.setFormData(row, {
|
|
246
|
+
override: {
|
|
247
|
+
loginInfo: `${row.operName}/${row.operIp}/${row.operLocation}`,
|
|
248
|
+
},
|
|
249
|
+
})
|
|
250
|
+
}, { once: true })
|
|
251
|
+
|
|
252
|
+
$dialog({
|
|
253
|
+
body: () =>
|
|
254
|
+
h(TForm, {
|
|
255
|
+
items: [formItemMap.title, formItemMap.businessType, /* ... */],
|
|
256
|
+
labelAlign: 'right',
|
|
257
|
+
layout: 'vertical',
|
|
258
|
+
readonly: true,
|
|
259
|
+
ref: formRef,
|
|
260
|
+
}),
|
|
261
|
+
cancelBtn: '关闭',
|
|
262
|
+
confirmBtn: null,
|
|
263
|
+
header: '操作日志详细',
|
|
264
|
+
width: 700,
|
|
265
|
+
})
|
|
266
|
+
}
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
- 用 `cancelBtn: '关闭'` + `confirmBtn: null` 实现仅关闭按钮,**不要用** `footer: false`
|
|
270
|
+
- 详情字段并入 `formItemMap`,筛选与详情共用;用 `setFormData(row)` 赋值,字段转换走 `override`,避免手写 `row.xxx`(Select 等组件内部已处理 number/string,无需 `numberToStringKeys`)
|
|
271
|
+
- `items` 直接内联,无复用时不在函数体内单独声明变量
|
|
272
|
+
- `layout: 'vertical'` 的 TForm 不是 grid 布局,其 `items` 上**不要**写 `_class: 'col-span-2'`(筛选区 inline 表单仍可用)
|
|
273
|
+
- 对应原项目 `showCancel: false` + `confirmText: '关闭'`
|
|
274
|
+
|
|
275
|
+
### 字典
|
|
276
|
+
|
|
277
|
+
| 原项目 | 目标项目 |
|
|
278
|
+
|--------|----------|
|
|
279
|
+
| `$dicStore('sys_yes_no')` | `dicCode: 'sys_yes_no'` |
|
|
280
|
+
|
|
281
|
+
## 不在迁移范围
|
|
282
|
+
|
|
283
|
+
- 不修改 yq-monitor-front
|
|
284
|
+
- 不创建 `modules/PageListItemForm.vue`
|
|
285
|
+
- 不新增 `src/api/*.ts`(qc-ui 无独立 API 层)
|
|
286
|
+
- 不修改 `folder-alias.json`(通常已有描述)
|
|
287
|
+
- 不遗留调试代码(如 `console.log`)
|
|
288
|
+
|
|
289
|
+
## 参考文件
|
|
290
|
+
|
|
291
|
+
| 用途 | 路径 |
|
|
292
|
+
|------|------|
|
|
293
|
+
| 迁移成果示例 | `qc-ui/src/views/system/config/index.vue` |
|
|
294
|
+
| 原项目示例 | `yq-monitor-front/src/views/system/config/index.vue` |
|
|
295
|
+
| 业务页参考 | `qc-ui/src/views/system/wbTaskCfg/index.vue` |
|
|
296
|
+
| 系统页参考(dlzn-ui) | `dlzn-ui/packages/dlzn-ui/views/system/post/index.vue` |
|
|
297
|
+
| 含 dateRange + 刷新缓存 | `dlzn-ui/packages/dlzn-ui/views/system/dict/index.vue` |
|
|
298
|
+
| 只读详情弹窗 | `qc-ui/src/views/monitor/operlog/index.vue` |
|
|
299
|
+
|
|
300
|
+
更多 before/after 片段见 [examples.md](examples.md)。
|
|
301
|
+
|
|
302
|
+
## 验证清单
|
|
303
|
+
|
|
304
|
+
- [ ] 路径与原项目一致(`src/views/.../index.vue`)
|
|
305
|
+
- [ ] 筛选、分页列表正常
|
|
306
|
+
- [ ] 新增、编辑、单删、批量删、导出
|
|
307
|
+
- [ ] 自定义 operations(如刷新缓存)
|
|
308
|
+
- [ ] 权限码与后端一致
|
|
309
|
+
- [ ] 每个非 CRUD 操作(unlock、clean、refreshCache 等)的 HTTP 方法已与原 `@/api` 定义逐项核对
|
|
310
|
+
- [ ] 无路由组件缺失报错
|
|
311
|
+
- [ ] 修改文件 ESLint 通过(`pnpm eslint <文件路径>`)
|
|
312
|
+
- [ ] 修改文件 TS 通过(`pnpm vue-tsc --noEmit`,或至少无本次文件相关报错)
|
|
313
|
+
- [ ] `$alova.Get` 仅两参;带 meta 时写在第二参 config 对象内
|
|
314
|
+
- [ ] `formItemMap` 使用 `satisfies Record<string, FormItem>`;条件显示用 `__others`
|
|
@@ -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 { S as e } from "../../../chunks/provider-BhFm5rvy.mjs";
|
|
2
|
+
import { t } from "../../../chunks/page-list-DUYDkWcj.mjs";
|
|
3
|
+
import "../../../components/page-list/index.mjs";
|
|
4
|
+
import { createBlock as n, defineComponent as r, mergeProps as i, openBlock as a, reactive as o, ref as s, unref as c, useTemplateRef as l } from "vue";
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region ../../packages/dlzn-ui/views/monitor/logininfor/index.vue
|
|
7
|
+
var u = /* @__PURE__ */ r({
|
|
8
|
+
__name: "index",
|
|
9
|
+
setup(r) {
|
|
10
|
+
let u = l("pageListRef"), d = s({
|
|
11
|
+
descending: !0,
|
|
12
|
+
sortBy: "loginTime"
|
|
13
|
+
}), f = {
|
|
14
|
+
dateRange: {
|
|
15
|
+
_class: "col-span-2",
|
|
16
|
+
_label: "登录时间",
|
|
17
|
+
component: "TDatePicker",
|
|
18
|
+
model: "dateRange",
|
|
19
|
+
type: "daterange"
|
|
20
|
+
},
|
|
21
|
+
ipaddr: {
|
|
22
|
+
_label: "登录地址",
|
|
23
|
+
component: "TInput",
|
|
24
|
+
model: "ipaddr"
|
|
25
|
+
},
|
|
26
|
+
status: {
|
|
27
|
+
_label: "状态",
|
|
28
|
+
component: "TSelect",
|
|
29
|
+
dicCode: "sys_common_status",
|
|
30
|
+
model: "status"
|
|
31
|
+
},
|
|
32
|
+
userName: {
|
|
33
|
+
_label: "用户名称",
|
|
34
|
+
component: "TInput",
|
|
35
|
+
model: "userName"
|
|
36
|
+
}
|
|
37
|
+
}, p = {
|
|
38
|
+
apis: {
|
|
39
|
+
delete: {
|
|
40
|
+
method: "monitor/logininfor",
|
|
41
|
+
permission: "monitor:logininfor:remove",
|
|
42
|
+
showBatch: !0
|
|
43
|
+
},
|
|
44
|
+
export: {
|
|
45
|
+
method: "monitor/logininfor/export",
|
|
46
|
+
permission: "monitor:logininfor:export"
|
|
47
|
+
},
|
|
48
|
+
list: { method: (t) => e.Get("monitor/logininfor/list", { params: {
|
|
49
|
+
...t,
|
|
50
|
+
dateRange: void 0,
|
|
51
|
+
"params[beginTime]": t.dateRange[0],
|
|
52
|
+
"params[endTime]": t.dateRange[1],
|
|
53
|
+
...d.value ? {
|
|
54
|
+
isAsc: d.value.descending ? "descending" : "ascending",
|
|
55
|
+
orderByColumn: d.value.sortBy
|
|
56
|
+
} : {}
|
|
57
|
+
} }) }
|
|
58
|
+
},
|
|
59
|
+
columns: [
|
|
60
|
+
{
|
|
61
|
+
colKey: "infoId",
|
|
62
|
+
title: "访问编号"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
colKey: "userName",
|
|
66
|
+
title: "用户名称"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
colKey: "ipaddr",
|
|
70
|
+
title: "地址"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
colKey: "loginLocation",
|
|
74
|
+
title: "登录地点"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
colKey: "os",
|
|
78
|
+
title: "操作系统"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
colKey: "browser",
|
|
82
|
+
title: "浏览器"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
cell: {
|
|
86
|
+
component: "DicLabel",
|
|
87
|
+
dicCode: "sys_common_status"
|
|
88
|
+
},
|
|
89
|
+
colKey: "status",
|
|
90
|
+
title: "登录状态"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
colKey: "msg",
|
|
94
|
+
resize: { maxWidth: 300 },
|
|
95
|
+
title: "描述"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
colKey: "loginTime",
|
|
99
|
+
sorter: !0,
|
|
100
|
+
title: "访问时间"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
cell: {
|
|
104
|
+
buttons: [({ row: t }) => ({
|
|
105
|
+
default: "解锁",
|
|
106
|
+
permission: "monitor:logininfor:unlock",
|
|
107
|
+
popconfirm: {
|
|
108
|
+
content: `是否确认解锁用户${t.userName}数据项?`,
|
|
109
|
+
onConfirm: async () => {
|
|
110
|
+
await e.Get(`monitor/logininfor/unlock/${t.userName}`, { meta: { useSuccessMsg: !0 } });
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
})],
|
|
114
|
+
component: "Buttons"
|
|
115
|
+
},
|
|
116
|
+
colKey: "_operation",
|
|
117
|
+
title: "操作"
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
formItems: [
|
|
121
|
+
f.ipaddr,
|
|
122
|
+
f.userName,
|
|
123
|
+
f.status,
|
|
124
|
+
f.dateRange
|
|
125
|
+
],
|
|
126
|
+
operations: [{
|
|
127
|
+
default: "清空",
|
|
128
|
+
permission: "monitor:logininfor:remove",
|
|
129
|
+
popconfirm: {
|
|
130
|
+
content: "是否确认清空所有登录日志数据项?",
|
|
131
|
+
onConfirm: async () => {
|
|
132
|
+
await e.Delete("monitor/logininfor/clean", void 0, { meta: { useSuccessMsg: !0 } }), u.value.reset();
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}],
|
|
136
|
+
tableOtherProps: o({
|
|
137
|
+
onSortChange: (e) => {
|
|
138
|
+
d.value = e, u.value.query();
|
|
139
|
+
},
|
|
140
|
+
rowKey: "infoId",
|
|
141
|
+
sort: d
|
|
142
|
+
})
|
|
143
|
+
};
|
|
144
|
+
return (e, r) => (a(), n(c(t), i({
|
|
145
|
+
ref_key: "pageListRef",
|
|
146
|
+
ref: u
|
|
147
|
+
}, p), null, 16));
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
//#endregion
|
|
151
|
+
export { u 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 { I as e, S as t, o as n } from "../../../chunks/provider-BhFm5rvy.mjs";
|
|
2
|
+
import { t as r } from "../../../chunks/page-list-DUYDkWcj.mjs";
|
|
3
|
+
import "../../../components/page-list/index.mjs";
|
|
4
|
+
import { createBlock as i, defineComponent as a, h as o, mergeProps as s, openBlock as c, reactive as l, ref as u, unref as d, useTemplateRef as f, watch as p } from "vue";
|
|
5
|
+
//#endregion
|
|
6
|
+
//#region ../../packages/dlzn-ui/views/monitor/operlog/index.vue
|
|
7
|
+
var m = /* @__PURE__ */ a({
|
|
8
|
+
__name: "index",
|
|
9
|
+
setup(a) {
|
|
10
|
+
let m = f("pageListRef"), h = u({
|
|
11
|
+
descending: !0,
|
|
12
|
+
sortBy: "operTime"
|
|
13
|
+
}), g = {
|
|
14
|
+
businessType: {
|
|
15
|
+
_label: "操作类型",
|
|
16
|
+
component: "TSelect",
|
|
17
|
+
dicCode: "sys_oper_type",
|
|
18
|
+
model: "businessType"
|
|
19
|
+
},
|
|
20
|
+
costTime: {
|
|
21
|
+
_label: "消耗时间",
|
|
22
|
+
adornment: { append: () => "毫秒" },
|
|
23
|
+
component: "TInput",
|
|
24
|
+
model: "costTime"
|
|
25
|
+
},
|
|
26
|
+
dateRange: {
|
|
27
|
+
_class: "col-span-2",
|
|
28
|
+
_label: "操作时间",
|
|
29
|
+
component: "TDatePicker",
|
|
30
|
+
model: "dateRange",
|
|
31
|
+
type: "daterange"
|
|
32
|
+
},
|
|
33
|
+
errorMsg: {
|
|
34
|
+
__others: ({ formData: e }) => ({ show: e.status === "1" }),
|
|
35
|
+
_label: "异常信息",
|
|
36
|
+
component: "TTextarea",
|
|
37
|
+
model: "errorMsg"
|
|
38
|
+
},
|
|
39
|
+
jsonResult: {
|
|
40
|
+
_label: "返回参数",
|
|
41
|
+
component: "TTextarea",
|
|
42
|
+
model: "jsonResult"
|
|
43
|
+
},
|
|
44
|
+
loginInfo: {
|
|
45
|
+
_label: "登录信息",
|
|
46
|
+
component: "TInput",
|
|
47
|
+
model: "loginInfo"
|
|
48
|
+
},
|
|
49
|
+
method: {
|
|
50
|
+
_label: "操作方法",
|
|
51
|
+
component: "TInput",
|
|
52
|
+
model: "method"
|
|
53
|
+
},
|
|
54
|
+
operName: {
|
|
55
|
+
_label: "操作人员",
|
|
56
|
+
component: "TInput",
|
|
57
|
+
model: "operName"
|
|
58
|
+
},
|
|
59
|
+
operParam: {
|
|
60
|
+
_label: "请求参数",
|
|
61
|
+
component: "TTextarea",
|
|
62
|
+
model: "operParam"
|
|
63
|
+
},
|
|
64
|
+
operTime: {
|
|
65
|
+
_label: "操作时间",
|
|
66
|
+
component: "TInput",
|
|
67
|
+
model: "operTime"
|
|
68
|
+
},
|
|
69
|
+
operUrl: {
|
|
70
|
+
_label: "请求地址",
|
|
71
|
+
component: "TInput",
|
|
72
|
+
model: "operUrl"
|
|
73
|
+
},
|
|
74
|
+
requestMethod: {
|
|
75
|
+
_label: "请求方式",
|
|
76
|
+
component: "TInput",
|
|
77
|
+
model: "requestMethod"
|
|
78
|
+
},
|
|
79
|
+
status: {
|
|
80
|
+
_label: "操作状态",
|
|
81
|
+
component: "TSelect",
|
|
82
|
+
dicCode: "sys_common_status",
|
|
83
|
+
model: "status"
|
|
84
|
+
},
|
|
85
|
+
title: {
|
|
86
|
+
_label: "系统模块",
|
|
87
|
+
component: "TInput",
|
|
88
|
+
model: "title"
|
|
89
|
+
}
|
|
90
|
+
}, _ = {
|
|
91
|
+
apis: {
|
|
92
|
+
delete: {
|
|
93
|
+
method: "monitor/operlog",
|
|
94
|
+
permission: "monitor:operlog:remove",
|
|
95
|
+
showBatch: !0
|
|
96
|
+
},
|
|
97
|
+
export: {
|
|
98
|
+
method: "monitor/operlog/export",
|
|
99
|
+
permission: "monitor:operlog:export"
|
|
100
|
+
},
|
|
101
|
+
list: { method: (e) => t.Get("monitor/operlog/list", { params: {
|
|
102
|
+
...e,
|
|
103
|
+
dateRange: void 0,
|
|
104
|
+
"params[beginTime]": e.dateRange[0],
|
|
105
|
+
"params[endTime]": e.dateRange[1],
|
|
106
|
+
...h.value ? {
|
|
107
|
+
isAsc: h.value.descending ? "descending" : "ascending",
|
|
108
|
+
orderByColumn: h.value.sortBy
|
|
109
|
+
} : {}
|
|
110
|
+
} }) }
|
|
111
|
+
},
|
|
112
|
+
columns: [
|
|
113
|
+
{
|
|
114
|
+
colKey: "operId",
|
|
115
|
+
title: "日志编号"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
colKey: "title",
|
|
119
|
+
title: "系统模块"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
cell: {
|
|
123
|
+
component: "DicLabel",
|
|
124
|
+
dicCode: "sys_oper_type"
|
|
125
|
+
},
|
|
126
|
+
colKey: "businessType",
|
|
127
|
+
title: "操作类型"
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
colKey: "operName",
|
|
131
|
+
title: "操作人员"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
colKey: "operIp",
|
|
135
|
+
title: "操作地址"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
cell: {
|
|
139
|
+
component: "DicLabel",
|
|
140
|
+
dicCode: "sys_common_status"
|
|
141
|
+
},
|
|
142
|
+
colKey: "status",
|
|
143
|
+
title: "操作状态"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
colKey: "operTime",
|
|
147
|
+
sorter: !0,
|
|
148
|
+
title: "操作日期"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
cell: (e, { row: t }) => `${t.costTime}毫秒`,
|
|
152
|
+
colKey: "costTime",
|
|
153
|
+
sorter: !0,
|
|
154
|
+
title: "消耗时间"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
cell: {
|
|
158
|
+
buttons: [({ row: t }) => ({
|
|
159
|
+
default: "详细",
|
|
160
|
+
onClick: () => {
|
|
161
|
+
let r = u(null);
|
|
162
|
+
p(r, () => {
|
|
163
|
+
r.value.setFormData(t, { override: { loginInfo: `${t.operName}/${t.operIp}/${t.operLocation}` } });
|
|
164
|
+
}, { once: !0 }), e({
|
|
165
|
+
body: () => o(n, {
|
|
166
|
+
items: [
|
|
167
|
+
g.title,
|
|
168
|
+
g.businessType,
|
|
169
|
+
g.loginInfo,
|
|
170
|
+
g.operUrl,
|
|
171
|
+
g.requestMethod,
|
|
172
|
+
g.method,
|
|
173
|
+
g.operParam,
|
|
174
|
+
g.jsonResult,
|
|
175
|
+
g.status,
|
|
176
|
+
g.costTime,
|
|
177
|
+
g.operTime,
|
|
178
|
+
g.errorMsg
|
|
179
|
+
],
|
|
180
|
+
labelAlign: "right",
|
|
181
|
+
layout: "vertical",
|
|
182
|
+
readonly: !0,
|
|
183
|
+
ref: r
|
|
184
|
+
}),
|
|
185
|
+
cancelBtn: "关闭",
|
|
186
|
+
confirmBtn: null,
|
|
187
|
+
header: "操作日志详细",
|
|
188
|
+
width: 700
|
|
189
|
+
});
|
|
190
|
+
},
|
|
191
|
+
permission: "monitor:operlog:query"
|
|
192
|
+
})],
|
|
193
|
+
component: "Buttons"
|
|
194
|
+
},
|
|
195
|
+
colKey: "_operation",
|
|
196
|
+
title: "操作"
|
|
197
|
+
}
|
|
198
|
+
],
|
|
199
|
+
formItems: [
|
|
200
|
+
g.title,
|
|
201
|
+
g.operName,
|
|
202
|
+
g.businessType,
|
|
203
|
+
g.status,
|
|
204
|
+
g.dateRange
|
|
205
|
+
],
|
|
206
|
+
operations: [{
|
|
207
|
+
default: "清空",
|
|
208
|
+
permission: "monitor:operlog:remove",
|
|
209
|
+
popconfirm: {
|
|
210
|
+
content: "是否确认清空所有操作日志数据项?",
|
|
211
|
+
onConfirm: async () => {
|
|
212
|
+
await t.Delete("monitor/operlog/clean", void 0, { meta: { useSuccessMsg: !0 } }), m.value.reset();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}],
|
|
216
|
+
tableOtherProps: l({
|
|
217
|
+
onSortChange: (e) => {
|
|
218
|
+
h.value = e, m.value.query();
|
|
219
|
+
},
|
|
220
|
+
rowKey: "operId",
|
|
221
|
+
sort: h
|
|
222
|
+
})
|
|
223
|
+
};
|
|
224
|
+
return (e, t) => (c(), i(d(r), s({
|
|
225
|
+
ref_key: "pageListRef",
|
|
226
|
+
ref: m
|
|
227
|
+
}, _), null, 16));
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
//#endregion
|
|
231
|
+
export { m 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,193 @@
|
|
|
1
|
+
import { F as e, S as t, o as n } from "../../../chunks/provider-BhFm5rvy.mjs";
|
|
2
|
+
import r from "../../../plugins/autoImport/$msg/index.mjs";
|
|
3
|
+
import { t as i } from "../../../chunks/page-list-DUYDkWcj.mjs";
|
|
4
|
+
import "../../../components/page-list/index.mjs";
|
|
5
|
+
import { createBlock as a, defineComponent as o, h as s, mergeProps as c, openBlock as l, reactive as u, ref as d, unref as f, useTemplateRef as p, watch as m } from "vue";
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region ../../packages/dlzn-ui/views/system/config/index.vue
|
|
8
|
+
var h = /* @__PURE__ */ o({
|
|
9
|
+
__name: "index",
|
|
10
|
+
setup(o) {
|
|
11
|
+
let h = p("pageListRef"), g = {
|
|
12
|
+
configKey: {
|
|
13
|
+
_label: "参数键名",
|
|
14
|
+
_required: !0,
|
|
15
|
+
component: "TInput",
|
|
16
|
+
model: "configKey"
|
|
17
|
+
},
|
|
18
|
+
configName: {
|
|
19
|
+
_label: "参数名称",
|
|
20
|
+
_required: !0,
|
|
21
|
+
component: "TInput",
|
|
22
|
+
model: "configName"
|
|
23
|
+
},
|
|
24
|
+
configType: {
|
|
25
|
+
_label: "系统内置",
|
|
26
|
+
component: "TRadioGroup",
|
|
27
|
+
dicCode: "sys_yes_no",
|
|
28
|
+
model: "configType"
|
|
29
|
+
},
|
|
30
|
+
configValue: {
|
|
31
|
+
_label: "参数键值",
|
|
32
|
+
_required: !0,
|
|
33
|
+
component: "TInput",
|
|
34
|
+
model: "configValue"
|
|
35
|
+
},
|
|
36
|
+
dateRange: {
|
|
37
|
+
_class: "col-span-2",
|
|
38
|
+
_label: "创建时间",
|
|
39
|
+
component: "TDatePicker",
|
|
40
|
+
model: "dateRange",
|
|
41
|
+
type: "daterange"
|
|
42
|
+
},
|
|
43
|
+
remark: {
|
|
44
|
+
_label: "备注",
|
|
45
|
+
component: "TTextarea",
|
|
46
|
+
model: "remark"
|
|
47
|
+
}
|
|
48
|
+
}, _ = {
|
|
49
|
+
apis: {
|
|
50
|
+
delete: {
|
|
51
|
+
method: "system/config",
|
|
52
|
+
permission: "system:config:remove",
|
|
53
|
+
showBatch: !0
|
|
54
|
+
},
|
|
55
|
+
export: {
|
|
56
|
+
method: "system/config/export",
|
|
57
|
+
permission: "system:config:export"
|
|
58
|
+
},
|
|
59
|
+
list: { method: (e) => t.Get("system/config/list", { params: {
|
|
60
|
+
...e,
|
|
61
|
+
dateRange: void 0,
|
|
62
|
+
"params[beginTime]": e.dateRange[0],
|
|
63
|
+
"params[endTime]": e.dateRange[1]
|
|
64
|
+
} }) }
|
|
65
|
+
},
|
|
66
|
+
columns: [
|
|
67
|
+
{
|
|
68
|
+
colKey: "configId",
|
|
69
|
+
title: "参数主键"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
colKey: "configName",
|
|
73
|
+
title: "参数名称"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
colKey: "configKey",
|
|
77
|
+
title: "参数键名"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
colKey: "configValue",
|
|
81
|
+
title: "参数键值"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
cell: {
|
|
85
|
+
component: "DicLabel",
|
|
86
|
+
dicCode: "sys_yes_no"
|
|
87
|
+
},
|
|
88
|
+
colKey: "configType",
|
|
89
|
+
title: "系统内置"
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
colKey: "createTime",
|
|
93
|
+
title: "创建时间"
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
colKey: "remark",
|
|
97
|
+
resize: { maxWidth: 300 },
|
|
98
|
+
title: "备注"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
cell: {
|
|
102
|
+
buttons: [({ row: i }) => ({
|
|
103
|
+
default: "编辑",
|
|
104
|
+
onClick: () => {
|
|
105
|
+
let a = d(null);
|
|
106
|
+
m(a, () => {
|
|
107
|
+
a.value.setFormData(i);
|
|
108
|
+
}, { once: !0 }), e({
|
|
109
|
+
body: () => s(n, {
|
|
110
|
+
items: [
|
|
111
|
+
g.configName,
|
|
112
|
+
g.configKey,
|
|
113
|
+
g.configValue,
|
|
114
|
+
g.configType,
|
|
115
|
+
g.remark
|
|
116
|
+
],
|
|
117
|
+
labelAlign: "right",
|
|
118
|
+
layout: "vertical",
|
|
119
|
+
ref: a
|
|
120
|
+
}),
|
|
121
|
+
header: "修改参数",
|
|
122
|
+
onConfirmCallback: async () => {
|
|
123
|
+
await t.Put("system/config", {
|
|
124
|
+
...await a.value.validate(),
|
|
125
|
+
configId: i.configId
|
|
126
|
+
}), r.success("参数修改成功"), h.value.query();
|
|
127
|
+
},
|
|
128
|
+
width: 460
|
|
129
|
+
});
|
|
130
|
+
},
|
|
131
|
+
permission: "system:config:edit"
|
|
132
|
+
})],
|
|
133
|
+
component: "Buttons"
|
|
134
|
+
},
|
|
135
|
+
colKey: "_operation",
|
|
136
|
+
title: "操作"
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
formItems: [
|
|
140
|
+
g.configName,
|
|
141
|
+
g.configKey,
|
|
142
|
+
{
|
|
143
|
+
...g.configType,
|
|
144
|
+
component: "TSelect"
|
|
145
|
+
},
|
|
146
|
+
g.dateRange
|
|
147
|
+
],
|
|
148
|
+
operations: [{
|
|
149
|
+
default: "新增",
|
|
150
|
+
onClick: () => {
|
|
151
|
+
let i = d(null);
|
|
152
|
+
e({
|
|
153
|
+
body: () => s(n, {
|
|
154
|
+
data: u({ configType: "Y" }),
|
|
155
|
+
items: [
|
|
156
|
+
g.configName,
|
|
157
|
+
g.configKey,
|
|
158
|
+
g.configValue,
|
|
159
|
+
g.configType,
|
|
160
|
+
g.remark
|
|
161
|
+
],
|
|
162
|
+
labelAlign: "right",
|
|
163
|
+
layout: "vertical",
|
|
164
|
+
ref: i
|
|
165
|
+
}),
|
|
166
|
+
header: "添加参数",
|
|
167
|
+
onConfirmCallback: async () => {
|
|
168
|
+
await t.Post("system/config", await i.value.validate()), r.success("参数添加成功"), h.value.query();
|
|
169
|
+
},
|
|
170
|
+
width: 460
|
|
171
|
+
});
|
|
172
|
+
},
|
|
173
|
+
permission: "system:config:add"
|
|
174
|
+
}, {
|
|
175
|
+
default: "刷新缓存",
|
|
176
|
+
permission: "system:config:remove",
|
|
177
|
+
popconfirm: {
|
|
178
|
+
content: "确定要刷新缓存吗?",
|
|
179
|
+
onConfirm: async () => {
|
|
180
|
+
await t.Delete("system/config/refreshCache", void 0, { meta: { useSuccessMsg: !0 } });
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}],
|
|
184
|
+
tableOtherProps: { rowKey: "configId" }
|
|
185
|
+
};
|
|
186
|
+
return (e, t) => (l(), a(f(i), c({
|
|
187
|
+
ref_key: "pageListRef",
|
|
188
|
+
ref: h
|
|
189
|
+
}, _), null, 16));
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
//#endregion
|
|
193
|
+
export { h 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,152 @@
|
|
|
1
|
+
import { F as e, S as t, o as n } from "../../../chunks/provider-BhFm5rvy.mjs";
|
|
2
|
+
import r from "../../../plugins/autoImport/$msg/index.mjs";
|
|
3
|
+
import { t as i } from "../../../chunks/page-list-DUYDkWcj.mjs";
|
|
4
|
+
import "../../../components/page-list/index.mjs";
|
|
5
|
+
import { createBlock as a, defineComponent as o, h as s, mergeProps as c, openBlock as l, reactive as u, ref as d, unref as f, useTemplateRef as p, watch as m } from "vue";
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region ../../packages/dlzn-ui/views/system/notice/index.vue
|
|
8
|
+
var h = /* @__PURE__ */ o({
|
|
9
|
+
__name: "index",
|
|
10
|
+
setup(o) {
|
|
11
|
+
let h = p("pageListRef"), g = {
|
|
12
|
+
createBy: {
|
|
13
|
+
_label: "操作人员",
|
|
14
|
+
component: "TInput",
|
|
15
|
+
model: "createBy"
|
|
16
|
+
},
|
|
17
|
+
noticeContent: {
|
|
18
|
+
_label: "公告内容",
|
|
19
|
+
component: "TTextarea",
|
|
20
|
+
model: "noticeContent"
|
|
21
|
+
},
|
|
22
|
+
noticeTitle: {
|
|
23
|
+
_label: "公告标题",
|
|
24
|
+
_required: !0,
|
|
25
|
+
component: "TInput",
|
|
26
|
+
model: "noticeTitle"
|
|
27
|
+
},
|
|
28
|
+
noticeType: {
|
|
29
|
+
_label: "公告类型",
|
|
30
|
+
_required: !0,
|
|
31
|
+
component: "TSelect",
|
|
32
|
+
dicCode: "sys_notice_type",
|
|
33
|
+
model: "noticeType"
|
|
34
|
+
},
|
|
35
|
+
status: {
|
|
36
|
+
_label: "公告状态",
|
|
37
|
+
component: "TRadioGroup",
|
|
38
|
+
dicCode: "sys_notice_status",
|
|
39
|
+
model: "status"
|
|
40
|
+
}
|
|
41
|
+
}, _ = [
|
|
42
|
+
g.noticeTitle,
|
|
43
|
+
g.noticeType,
|
|
44
|
+
g.status,
|
|
45
|
+
g.noticeContent
|
|
46
|
+
], v = {
|
|
47
|
+
apis: {
|
|
48
|
+
delete: {
|
|
49
|
+
method: "system/notice",
|
|
50
|
+
permission: "system:notice:remove",
|
|
51
|
+
showBatch: !0
|
|
52
|
+
},
|
|
53
|
+
list: { method: "system/notice/list" }
|
|
54
|
+
},
|
|
55
|
+
columns: [
|
|
56
|
+
{
|
|
57
|
+
colKey: "noticeTitle",
|
|
58
|
+
title: "公告标题"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
cell: {
|
|
62
|
+
component: "DicLabel",
|
|
63
|
+
dicCode: "sys_notice_type"
|
|
64
|
+
},
|
|
65
|
+
colKey: "noticeType",
|
|
66
|
+
title: "公告类型"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
cell: {
|
|
70
|
+
component: "DicLabel",
|
|
71
|
+
dicCode: "sys_notice_status"
|
|
72
|
+
},
|
|
73
|
+
colKey: "status",
|
|
74
|
+
title: "公告状态"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
colKey: "createBy",
|
|
78
|
+
title: "创建者"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
colKey: "createTime",
|
|
82
|
+
title: "创建时间"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
cell: {
|
|
86
|
+
buttons: [({ row: i }) => ({
|
|
87
|
+
default: "编辑",
|
|
88
|
+
onClick: () => {
|
|
89
|
+
let a = d(null);
|
|
90
|
+
m(a, () => {
|
|
91
|
+
a.value.setFormData(i);
|
|
92
|
+
}, { once: !0 }), e({
|
|
93
|
+
body: () => s(n, {
|
|
94
|
+
items: _,
|
|
95
|
+
labelAlign: "right",
|
|
96
|
+
layout: "vertical",
|
|
97
|
+
ref: a
|
|
98
|
+
}),
|
|
99
|
+
header: "修改公告",
|
|
100
|
+
onConfirmCallback: async () => {
|
|
101
|
+
await t.Put("system/notice", {
|
|
102
|
+
...await a.value.validate(),
|
|
103
|
+
noticeId: i.noticeId
|
|
104
|
+
}), r.success("公告修改成功"), h.value.query();
|
|
105
|
+
},
|
|
106
|
+
width: 460
|
|
107
|
+
});
|
|
108
|
+
},
|
|
109
|
+
permission: "system:notice:edit"
|
|
110
|
+
})],
|
|
111
|
+
component: "Buttons"
|
|
112
|
+
},
|
|
113
|
+
colKey: "_operation",
|
|
114
|
+
title: "操作"
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
formItems: [
|
|
118
|
+
g.noticeTitle,
|
|
119
|
+
g.noticeType,
|
|
120
|
+
g.createBy
|
|
121
|
+
],
|
|
122
|
+
operations: [{
|
|
123
|
+
default: "新增",
|
|
124
|
+
onClick: () => {
|
|
125
|
+
let i = d(null);
|
|
126
|
+
e({
|
|
127
|
+
body: () => s(n, {
|
|
128
|
+
data: u({ status: "0" }),
|
|
129
|
+
items: _,
|
|
130
|
+
labelAlign: "right",
|
|
131
|
+
layout: "vertical",
|
|
132
|
+
ref: i
|
|
133
|
+
}),
|
|
134
|
+
header: "添加公告",
|
|
135
|
+
onConfirmCallback: async () => {
|
|
136
|
+
await t.Post("system/notice", await i.value.validate()), r.success("公告添加成功"), h.value.query();
|
|
137
|
+
},
|
|
138
|
+
width: 460
|
|
139
|
+
});
|
|
140
|
+
},
|
|
141
|
+
permission: "system:notice:add"
|
|
142
|
+
}],
|
|
143
|
+
tableOtherProps: { rowKey: "noticeId" }
|
|
144
|
+
};
|
|
145
|
+
return (e, t) => (l(), a(f(i), c({
|
|
146
|
+
ref_key: "pageListRef",
|
|
147
|
+
ref: h
|
|
148
|
+
}, v), null, 16));
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
//#endregion
|
|
152
|
+
export { h 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;
|