flame-plus 0.1.13 → 0.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.
- package/package.json +2 -1
- package/packages/components/base/flmButton/flmButton.vue +3 -3
- package/packages/components/base/flmCascader/flmCascader.vue +2 -2
- package/packages/components/base/flmCheckbox/flmCheckbox.vue +2 -2
- package/packages/components/base/flmCheckbox/flmCheckboxGroup.vue +3 -3
- package/packages/components/base/flmColorPicker/flmColorPicker.vue +2 -2
- package/packages/components/base/flmDatePicker/flmDatePicker.vue +2 -2
- package/packages/components/base/flmDialog/flmDialog.vue +2 -2
- package/packages/components/base/flmInput/flmInput.vue +2 -2
- package/packages/components/base/flmInputNumber/flmInputNumber.vue +2 -2
- package/packages/components/base/flmPagination/flmPagination.vue +2 -2
- package/packages/components/base/flmRadio/flmRadio.vue +2 -2
- package/packages/components/base/flmRate/flmRate.vue +2 -2
- package/packages/components/base/flmRead/flmRead.vue +1 -1
- package/packages/components/base/flmSelect/flmSelect.vue +2 -2
- package/packages/components/base/flmSlider/flmSlider.vue +2 -2
- package/packages/components/base/flmSwitch/flmSwitch.vue +2 -2
- package/packages/components/base/flmTimePicker/flmTimePicker.vue +2 -2
- package/packages/components/base/flmTimeSelect/flmTimeSelect.vue +2 -2
- package/packages/components/base/flmTransfer/flmTransfer.vue +2 -2
- package/packages/components/complex/flmForm/flmForm.vue +23 -20
- package/packages/components/complex/flmSearch/flmSearch.vue +36 -33
- package/packages/components/complex/flmTable/flmTable.vue +43 -27
- package/packages/components/complex/flmToolbar/flmToolbar.vue +4 -4
- package/packages/components/index.ts +2 -2
- package/packages/components/page/flmReportPage/flmReportPage.vue +97 -381
- package/packages/model/flmComponentConfig/base/flmButton.ts +5 -2
- package/packages/model/flmComponentConfig/base/flmCascader.ts +1 -1
- package/packages/model/flmComponentConfig/base/flmCheckbox.ts +1 -1
- package/packages/model/flmComponentConfig/base/flmColorPicker.ts +1 -1
- package/packages/model/flmComponentConfig/base/flmDatePicker.ts +1 -1
- package/packages/model/flmComponentConfig/base/flmInput.ts +1 -1
- package/packages/model/flmComponentConfig/base/flmInputNumber.ts +1 -1
- package/packages/model/flmComponentConfig/base/flmPagination.ts +0 -1
- package/packages/model/flmComponentConfig/base/flmRadio.ts +1 -1
- package/packages/model/flmComponentConfig/base/flmRate.ts +1 -1
- package/packages/model/flmComponentConfig/base/flmSelect.ts +1 -1
- package/packages/model/flmComponentConfig/base/flmSlider.ts +1 -1
- package/packages/model/flmComponentConfig/base/flmSwitch.ts +1 -1
- package/packages/model/flmComponentConfig/base/flmTimePicker.ts +1 -1
- package/packages/model/flmComponentConfig/base/flmTimeSelect.ts +1 -1
- package/packages/model/flmComponentConfig/complex/flmForm.ts +1 -1
- package/packages/model/flmComponentConfig/complex/flmSearch.ts +5 -0
- package/packages/model/flmComponentConfig/complex/flmTable.ts +23 -1
- package/packages/model/flmComponentConfig/complex/flmToolbar.ts +1 -1
- package/packages/model/flmComponentConfig/index.ts +1 -0
- package/packages/model/flmComponentConfig/page/flmReportPage.ts +1 -1
|
@@ -5,7 +5,6 @@ export { default as flmCheckbox } from './base/flmCheckbox/flmCheckbox.vue'
|
|
|
5
5
|
export { default as flmCheckboxGroup } from './base/flmCheckbox/flmCheckboxGroup.vue' // 多选框组
|
|
6
6
|
export { default as flmColorPicker } from './base/flmColorPicker/flmColorPicker.vue' // 取色器
|
|
7
7
|
export { default as flmDatePicker } from './base/flmDatePicker/flmDatePicker.vue' // 日期选择器
|
|
8
|
-
export { default as flmDialog } from './base/flmDialog/flmDialog.vue' // 弹窗
|
|
9
8
|
export { default as flmInput } from './base/flmInput/flmInput.vue' // 输入框
|
|
10
9
|
export { default as flmInputNumber } from './base/flmInputNumber/flmInputNumber.vue' // 数字输入框
|
|
11
10
|
export { default as flmPagination } from './base/flmPagination/flmPagination.vue' // 分页器
|
|
@@ -18,12 +17,13 @@ export { default as flmSwitch } from './base/flmSwitch/flmSwitch.vue'
|
|
|
18
17
|
export { default as flmTimePicker } from './base/flmTimePicker/flmTimePicker.vue' // 时间选择器
|
|
19
18
|
export { default as flmTimeSelect } from './base/flmTimeSelect/flmTimeSelect.vue' // 时间选择
|
|
20
19
|
export { default as flmTransfer } from './base/flmTransfer/flmTransfer.vue' // 穿梭框
|
|
20
|
+
export { default as flmDialog } from './base/flmDialog/flmDialog.vue' // 弹窗
|
|
21
21
|
|
|
22
22
|
// 复合组件
|
|
23
23
|
export { default as flmForm } from './complex/flmForm/flmForm.vue' // 表单
|
|
24
|
-
export { default as flmSearch } from './complex/flmSearch/flmSearch.vue' // 搜索
|
|
25
24
|
export { default as flmTable } from './complex/flmTable/flmTable.vue' // 表格
|
|
26
25
|
export { default as flmToolbar } from './complex/flmToolbar/flmToolbar.vue' // 操作栏
|
|
26
|
+
export { default as flmSearch } from './complex/flmSearch/flmSearch.vue' // 搜索
|
|
27
27
|
|
|
28
28
|
// 页面组件
|
|
29
29
|
export { default as flmReportPage } from './page/flmReportPage/flmReportPage.vue' // 报表页面
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
</template>
|
|
64
64
|
|
|
65
65
|
<script lang="ts" setup>
|
|
66
|
-
import {
|
|
66
|
+
import { ref, Ref, computed, onMounted } from 'vue'
|
|
67
67
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
68
68
|
import {
|
|
69
69
|
flmForm,
|
|
@@ -72,15 +72,23 @@ import {
|
|
|
72
72
|
flmTable,
|
|
73
73
|
flmPagination,
|
|
74
74
|
flmDialog
|
|
75
|
-
} from '
|
|
75
|
+
} from '@/components'
|
|
76
76
|
import {
|
|
77
|
-
ControlTypes,
|
|
78
77
|
FormItemConfig,
|
|
79
78
|
FormConfig,
|
|
80
79
|
TableColumnConfig,
|
|
81
80
|
ReportPageSetting,
|
|
82
|
-
} from '
|
|
83
|
-
import { isValidKey } from '
|
|
81
|
+
} from '@/model/flmComponentConfig'
|
|
82
|
+
import { isValidKey } from '@/utils'
|
|
83
|
+
import request from '@/plugins/request'
|
|
84
|
+
|
|
85
|
+
const props = defineProps({
|
|
86
|
+
// 表名
|
|
87
|
+
tableName: {
|
|
88
|
+
type: String,
|
|
89
|
+
required: true
|
|
90
|
+
}
|
|
91
|
+
})
|
|
84
92
|
|
|
85
93
|
const emit = defineEmits(['customEvent'])
|
|
86
94
|
const reportPageRef = ref()
|
|
@@ -113,7 +121,8 @@ let reportPageConfig: Ref<ReportPageSetting> = ref({
|
|
|
113
121
|
},
|
|
114
122
|
editForm: {}
|
|
115
123
|
})
|
|
116
|
-
|
|
124
|
+
const searchParams: FormConfig['model'] = ref({}) // 搜索条件
|
|
125
|
+
let tableSelection: Ref<Array<any>> = ref([]) // 表格勾选项
|
|
117
126
|
|
|
118
127
|
onMounted(() => {
|
|
119
128
|
queryPageSetting()
|
|
@@ -125,389 +134,78 @@ const tableHeight = () => {
|
|
|
125
134
|
headerHight = '50px', // 页眉高度
|
|
126
135
|
mainSpacing = '30px', // 主体内容边距
|
|
127
136
|
pageSearch = '50px', // 搜索栏高度
|
|
128
|
-
|
|
137
|
+
pageFooter = '50px', // 分页高度
|
|
129
138
|
pageSpacing = '40px' // 页面边距
|
|
130
|
-
return `calc(${homeHeight} - ${headerHight} - ${mainSpacing} - ${pageSearch} - ${
|
|
139
|
+
return `calc(${homeHeight} - ${headerHight} - ${mainSpacing} - ${pageSearch} - ${pageFooter} - ${pageSpacing})`
|
|
131
140
|
}
|
|
132
141
|
|
|
133
142
|
// 查询页面配置
|
|
134
143
|
const queryPageSetting = () => {
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
]
|
|
154
|
-
},
|
|
155
|
-
{
|
|
156
|
-
'prop': 'email',
|
|
157
|
-
'label': '注册邮箱',
|
|
158
|
-
'controlType': ControlTypes['flm-input'],
|
|
159
|
-
'controlConfig': {},
|
|
160
|
-
'rules': [{
|
|
161
|
-
'trigger': 'blur',
|
|
162
|
-
'validator': (rule: any, value: any, callback: any) => {
|
|
163
|
-
const emailRegExp: RegExp = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
|
164
|
-
if (!value || emailRegExp.test(value)) {
|
|
165
|
-
callback()
|
|
166
|
-
} else {
|
|
167
|
-
callback(new Error('请填写正确的邮箱'))
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}]
|
|
171
|
-
},
|
|
172
|
-
{
|
|
173
|
-
'prop': 'userType',
|
|
174
|
-
'label': '用户类型',
|
|
175
|
-
'controlType': ControlTypes['flm-select'],
|
|
176
|
-
'controlConfig': {
|
|
177
|
-
'options': [
|
|
178
|
-
{ 'value': 0, 'label': '普通用户' },
|
|
179
|
-
{ 'value': 1, 'label': '企业用户' },
|
|
180
|
-
]
|
|
181
|
-
}
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
'prop': 'isAdmin',
|
|
185
|
-
'label': '超级权限',
|
|
186
|
-
'controlType': ControlTypes['flm-switch'],
|
|
187
|
-
'controlConfig': {
|
|
188
|
-
'active-text': "开启",
|
|
189
|
-
'inactive-text': "关闭"
|
|
190
|
-
}
|
|
191
|
-
},
|
|
192
|
-
{
|
|
193
|
-
'prop': 'searchSlotTwo',
|
|
194
|
-
'label': '搜索插槽2',
|
|
195
|
-
'isSlot': true
|
|
196
|
-
},
|
|
197
|
-
],
|
|
198
|
-
'buttons': [
|
|
199
|
-
{
|
|
200
|
-
'text': '重置',
|
|
201
|
-
'event': 'cancel'
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
'type': 'primary',
|
|
205
|
-
'plain': true,
|
|
206
|
-
'text': '搜索',
|
|
207
|
-
'event': 'submit'
|
|
208
|
-
}
|
|
209
|
-
]
|
|
210
|
-
},
|
|
211
|
-
toolbar: {
|
|
212
|
-
publicConfig: { 'type': 'primary', 'plain': true },
|
|
213
|
-
maxButton: 3,
|
|
214
|
-
buttons: [
|
|
215
|
-
{ 'text':'新增', event: 'openAddDialog' },
|
|
216
|
-
{ 'text': '导入', event: 'pageImport' },
|
|
217
|
-
{ 'text': '导出', event: 'pageExport' },
|
|
218
|
-
{ 'text': '批量删除', event: 'pageBatchDelete' },
|
|
219
|
-
{ 'text': '批量审核', event: 'batchAudit' },
|
|
220
|
-
{ 'text': '批量编辑', event: 'batchEdit' },
|
|
221
|
-
]
|
|
222
|
-
},
|
|
223
|
-
table: {
|
|
224
|
-
'border': true,
|
|
225
|
-
'height': "250",
|
|
226
|
-
'max-height': "250",
|
|
227
|
-
'columns': [
|
|
228
|
-
{ prop: 'selection', label: '勾选', type: 'selection', fixed: 'left' },
|
|
229
|
-
{ prop: 'index', label: '序号', type: 'index', width: 60 },
|
|
230
|
-
{ prop: 'userName', label: '用户名' },
|
|
231
|
-
{ prop: 'userType', label: '角色类型', isSlot: true },
|
|
232
|
-
{ prop: 'phone', label: '联系方式' },
|
|
233
|
-
{ prop: 'email', label: '注册邮箱' },
|
|
234
|
-
{
|
|
235
|
-
prop: 'address',
|
|
236
|
-
label: '地址',
|
|
237
|
-
align: 'center',
|
|
238
|
-
columns: [
|
|
239
|
-
{ prop: 'province', label: '省' },
|
|
240
|
-
{ prop: 'city', label: '市' },
|
|
241
|
-
{ prop: 'area', label: '区' },
|
|
242
|
-
{ prop: 'house', label: '详细', 'show-overflow-tooltip': true },
|
|
243
|
-
]
|
|
244
|
-
},
|
|
245
|
-
]
|
|
246
|
-
},
|
|
247
|
-
tableAction: {
|
|
248
|
-
publicConfig: { 'type': 'text' },
|
|
249
|
-
maxButton: 3,
|
|
250
|
-
buttons: [
|
|
251
|
-
{ 'text': '详情', event: 'openReadDialog' },
|
|
252
|
-
{ 'text': '编辑', event: 'openEditDialog' },
|
|
253
|
-
{ 'text': '删除', event: 'pageDelete' },
|
|
254
|
-
{ 'text': '审核', event: 'delete' },
|
|
255
|
-
{ 'text': '忽略', event: 'delete' },
|
|
256
|
-
]
|
|
257
|
-
},
|
|
258
|
-
pagination: {
|
|
259
|
-
'page-size': 100,
|
|
260
|
-
'current-page': 1,
|
|
261
|
-
'page-sizes': [20, 50, 100, 200],
|
|
262
|
-
'total': 400,
|
|
263
|
-
'layout': 'sizes, prev, pager, next, jumper, ->, total',
|
|
264
|
-
},
|
|
265
|
-
readDialog: {
|
|
266
|
-
'model-value': false,
|
|
267
|
-
title: '用户详情'
|
|
268
|
-
},
|
|
269
|
-
readForm: {
|
|
270
|
-
'rules': {
|
|
271
|
-
'userName': [
|
|
272
|
-
{ 'min': 2, 'max': 10, 'message': '用户名字符在 2 ~ 10 以内', 'trigger': 'blur' },
|
|
273
|
-
],
|
|
274
|
-
'email': [{
|
|
275
|
-
'trigger': 'blur',
|
|
276
|
-
'validator': (rule: any, value: any, callback: any) => {
|
|
277
|
-
const emailRegExp: RegExp = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
|
278
|
-
if (!emailRegExp.test(value)) return callback(new Error('请填写正确的邮箱'))
|
|
279
|
-
callback()
|
|
280
|
-
}
|
|
281
|
-
}],
|
|
282
|
-
},
|
|
283
|
-
'label-suffix': ':',
|
|
284
|
-
// 自定义属性
|
|
285
|
-
'items': [
|
|
286
|
-
{
|
|
287
|
-
'prop': 'userName',
|
|
288
|
-
'label': '用户名称',
|
|
289
|
-
'controlType': ControlTypes['flm-read'],
|
|
290
|
-
'controlConfig': {}
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
'prop': 'email',
|
|
294
|
-
'label': '注册邮箱',
|
|
295
|
-
'controlType': ControlTypes['flm-read'],
|
|
296
|
-
'controlConfig': {}
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
'prop': 'userType',
|
|
300
|
-
'label': '用户类型',
|
|
301
|
-
'isSlot': true,
|
|
302
|
-
},
|
|
303
|
-
],
|
|
304
|
-
'buttons': [
|
|
305
|
-
{
|
|
306
|
-
'type': 'primary',
|
|
307
|
-
'text': '确定',
|
|
308
|
-
'event': 'cancel'
|
|
309
|
-
}
|
|
310
|
-
]
|
|
311
|
-
},
|
|
312
|
-
addDialog: {
|
|
313
|
-
'model-value': false,
|
|
314
|
-
title: '新增用户',
|
|
315
|
-
},
|
|
316
|
-
addForm: {
|
|
317
|
-
'label-suffix': ':',
|
|
318
|
-
// 自定义属性
|
|
319
|
-
'items': [
|
|
320
|
-
{
|
|
321
|
-
'prop': 'userName',
|
|
322
|
-
'label': '用户名称',
|
|
323
|
-
'required': true,
|
|
324
|
-
'controlType': ControlTypes['flm-input'],
|
|
325
|
-
'controlConfig': {},
|
|
326
|
-
'rules': [
|
|
327
|
-
{ 'required': true, 'message': '用户名不能为空' },
|
|
328
|
-
{ 'min': 2, 'max': 10, 'message': '用户名字符在 2 ~ 10 以内', 'trigger': 'blur' },
|
|
329
|
-
]
|
|
330
|
-
},
|
|
331
|
-
{
|
|
332
|
-
'prop': 'email',
|
|
333
|
-
'label': '注册邮箱',
|
|
334
|
-
'required': true,
|
|
335
|
-
'controlType': ControlTypes['flm-input'],
|
|
336
|
-
'controlConfig': {},
|
|
337
|
-
'rules': [
|
|
338
|
-
{ 'required': true, 'message': '注册邮箱不能为空' },
|
|
339
|
-
{
|
|
340
|
-
'trigger': 'blur',
|
|
341
|
-
'validator': (rule: any, value: any, callback: any) => {
|
|
342
|
-
const emailRegExp: RegExp = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
|
343
|
-
if (!emailRegExp.test(value)) return callback(new Error('请填写正确的邮箱'))
|
|
344
|
-
callback()
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
]
|
|
348
|
-
},
|
|
349
|
-
{
|
|
350
|
-
'prop': 'userType',
|
|
351
|
-
'label': '用户类型',
|
|
352
|
-
'required': true,
|
|
353
|
-
'controlType': ControlTypes['flm-select'],
|
|
354
|
-
'controlConfig': {
|
|
355
|
-
'options': [
|
|
356
|
-
{ 'value': 0, 'label': '普通用户' },
|
|
357
|
-
{ 'value': 1, 'label': '企业用户' },
|
|
358
|
-
]
|
|
359
|
-
},
|
|
360
|
-
'rules': [
|
|
361
|
-
{ 'required': true, 'message': '用户类型不能为空' },
|
|
362
|
-
]
|
|
363
|
-
},
|
|
364
|
-
{
|
|
365
|
-
'prop': 'isAdmin',
|
|
366
|
-
'label': '超级权限',
|
|
367
|
-
'required': true,
|
|
368
|
-
'controlType': ControlTypes['flm-switch'],
|
|
369
|
-
'controlConfig': {
|
|
370
|
-
'active-text': "开启",
|
|
371
|
-
'inactive-text': "关闭"
|
|
372
|
-
},
|
|
373
|
-
'rules': [
|
|
374
|
-
{ 'required': true, 'message': '超级权限不能为空' },
|
|
375
|
-
]
|
|
376
|
-
},
|
|
377
|
-
{
|
|
378
|
-
'prop': 'addTips',
|
|
379
|
-
'isSlot': true,
|
|
380
|
-
},
|
|
381
|
-
],
|
|
382
|
-
'buttons': [
|
|
383
|
-
{
|
|
384
|
-
'text': '取消',
|
|
385
|
-
'event': 'cancel'
|
|
386
|
-
},
|
|
387
|
-
{
|
|
388
|
-
'type': 'primary',
|
|
389
|
-
'text': '确定',
|
|
390
|
-
'event': 'submit'
|
|
391
|
-
}
|
|
392
|
-
]
|
|
393
|
-
},
|
|
394
|
-
editDialog: {
|
|
395
|
-
'model-value': false,
|
|
396
|
-
title: '编辑用户'
|
|
397
|
-
},
|
|
398
|
-
editForm: {
|
|
399
|
-
'model': {},
|
|
400
|
-
'rules': {
|
|
401
|
-
'userName': [
|
|
402
|
-
{ 'min': 2, 'max': 10, 'message': '用户名字符在 2 ~ 10 以内', 'trigger': 'blur' },
|
|
403
|
-
],
|
|
404
|
-
'email': [{
|
|
405
|
-
'trigger': 'blur',
|
|
406
|
-
'validator': (rule: any, value: any, callback: any) => {
|
|
407
|
-
const emailRegExp: RegExp = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
|
408
|
-
if (!emailRegExp.test(value)) return callback(new Error('请填写正确的邮箱'))
|
|
409
|
-
callback()
|
|
410
|
-
}
|
|
411
|
-
}],
|
|
412
|
-
},
|
|
413
|
-
'label-suffix': ':',
|
|
414
|
-
// 自定义属性
|
|
415
|
-
'items': [
|
|
416
|
-
{
|
|
417
|
-
'prop': 'userName',
|
|
418
|
-
'label': '用户名称',
|
|
419
|
-
'controlType': ControlTypes['flm-input'],
|
|
420
|
-
'controlConfig': {}
|
|
421
|
-
},
|
|
422
|
-
{
|
|
423
|
-
'prop': 'email',
|
|
424
|
-
'label': '注册邮箱',
|
|
425
|
-
'controlType': ControlTypes['flm-input'],
|
|
426
|
-
'controlConfig': {}
|
|
427
|
-
},
|
|
428
|
-
{
|
|
429
|
-
'prop': 'userType',
|
|
430
|
-
'label': '用户类型',
|
|
431
|
-
'controlType': ControlTypes['flm-select'],
|
|
432
|
-
'controlConfig': {
|
|
433
|
-
'options': [
|
|
434
|
-
{ 'value': 0, 'label': '普通用户' },
|
|
435
|
-
{ 'value': 1, 'label': '企业用户' },
|
|
436
|
-
]
|
|
437
|
-
}
|
|
438
|
-
},
|
|
439
|
-
],
|
|
440
|
-
'buttons': [
|
|
441
|
-
{
|
|
442
|
-
'text': '取消',
|
|
443
|
-
'event': 'cancel'
|
|
444
|
-
},
|
|
445
|
-
{
|
|
446
|
-
'type': 'primary',
|
|
447
|
-
'text': '确定',
|
|
448
|
-
'event': 'submit'
|
|
449
|
-
}
|
|
450
|
-
]
|
|
451
|
-
},
|
|
452
|
-
}
|
|
453
|
-
reportPageSetting.table['height'] = tableHeight()
|
|
454
|
-
reportPageSetting.table['max-height'] = tableHeight()
|
|
455
|
-
reportPageSetting.tableAction.buttons.length && reportPageSetting.table.columns?.push({
|
|
456
|
-
prop: 'tableAction',
|
|
457
|
-
label: '操作',
|
|
458
|
-
isSlot: true,
|
|
459
|
-
fixed: 'right',
|
|
460
|
-
'min-width': '100px'
|
|
144
|
+
request.flameRequest({
|
|
145
|
+
tableName: 'flametableinfo',
|
|
146
|
+
flameMethod: 'webgetpagesetting',
|
|
147
|
+
data: { table_name: 'sys_flame_role', menu_id: null }
|
|
148
|
+
})
|
|
149
|
+
.then(({ items }: any) => {
|
|
150
|
+
const reportPageSetting: ReportPageSetting = items
|
|
151
|
+
reportPageSetting.table['height'] = tableHeight()
|
|
152
|
+
reportPageSetting.table['max-height'] = tableHeight()
|
|
153
|
+
reportPageSetting.tableAction.buttons.length && reportPageSetting.table.columns?.push({
|
|
154
|
+
prop: 'tableAction',
|
|
155
|
+
label: '操作',
|
|
156
|
+
isSlot: true,
|
|
157
|
+
fixed: 'right',
|
|
158
|
+
'min-width': '200px'
|
|
159
|
+
})
|
|
160
|
+
reportPageConfig.value = reportPageSetting
|
|
161
|
+
queryPageData()
|
|
461
162
|
})
|
|
462
|
-
reportPageConfig.value = reportPageSetting
|
|
463
|
-
queryPageData()
|
|
464
|
-
}, 500)
|
|
465
163
|
}
|
|
466
164
|
|
|
467
165
|
// 查询页面数据
|
|
468
166
|
const queryPageData = () => {
|
|
469
167
|
const {
|
|
470
|
-
['current-page']:
|
|
471
|
-
['page-size']:
|
|
168
|
+
['current-page']: page_no = 1,
|
|
169
|
+
['page-size']: page_size = 20,
|
|
472
170
|
}: ReportPageSetting['pagination'] = reportPageConfig.value.pagination
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
.
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
171
|
+
request.flameApi.pageSearch({
|
|
172
|
+
tableName: props.tableName,
|
|
173
|
+
data: {
|
|
174
|
+
page_no,
|
|
175
|
+
page_size,
|
|
176
|
+
conditions: searchParams.value,
|
|
177
|
+
ref_level: 1,
|
|
178
|
+
order_by: "flame_id DESC"
|
|
179
|
+
}
|
|
180
|
+
})
|
|
181
|
+
.then(({ items, total }: any) => {
|
|
182
|
+
reportPageConfig.value.table.data = items
|
|
183
|
+
reportPageConfig.value.pagination['total'] = total
|
|
184
|
+
isLoaded.value = true
|
|
185
|
+
})
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// 页面刷新
|
|
189
|
+
const pageRefresh = () => {
|
|
190
|
+
reportPageConfig.value.pagination['current-page'] = 1
|
|
191
|
+
queryPageData()
|
|
493
192
|
}
|
|
494
193
|
|
|
495
194
|
// 搜索栏提交
|
|
496
195
|
const searchSubmit = (event: object) => {
|
|
497
|
-
|
|
196
|
+
searchParams.value = event
|
|
197
|
+
pageRefresh()
|
|
498
198
|
}
|
|
499
199
|
|
|
500
200
|
// 工具栏点击
|
|
501
201
|
const toolbarClick = (event: string) => {
|
|
502
|
-
console.log(`工具栏调用:${event}`)
|
|
503
202
|
isValidKey(event, pageDefaultEvent)
|
|
504
203
|
? pageDefaultEvent[event]()
|
|
505
|
-
: emit('customEvent',
|
|
204
|
+
: emit('customEvent', event)
|
|
506
205
|
}
|
|
507
206
|
|
|
508
207
|
// 表格操作栏点击
|
|
509
208
|
const tableActionClick = (event: string, scope: any) => {
|
|
510
|
-
console.log(`表格操作:${event}, 数据:`, scope)
|
|
511
209
|
isValidKey(event, pageDefaultEvent)
|
|
512
210
|
? pageDefaultEvent[event](scope)
|
|
513
211
|
: emit('customEvent', { event, scope })
|
|
@@ -517,8 +215,7 @@ const tableActionClick = (event: string, scope: any) => {
|
|
|
517
215
|
const tableEvent: Record<string, (event?: any) => void> = {
|
|
518
216
|
// 表格勾选项变化
|
|
519
217
|
selectionChange: ({ row }: any) => {
|
|
520
|
-
|
|
521
|
-
tableSelection = row
|
|
218
|
+
tableSelection.value = row
|
|
522
219
|
}
|
|
523
220
|
}
|
|
524
221
|
|
|
@@ -526,14 +223,12 @@ const tableEvent: Record<string, (event?: any) => void> = {
|
|
|
526
223
|
const paginationEvent: Record<string, (event?: any) => void> = {
|
|
527
224
|
// 每页数量变化
|
|
528
225
|
sizeChange:(pageSize: number) => {
|
|
529
|
-
console.log(`每页 ${pageSize} 条`)
|
|
530
226
|
reportPageConfig.value.pagination['current-page'] = 1
|
|
531
227
|
reportPageConfig.value.pagination['page-size'] = pageSize
|
|
532
228
|
queryPageData()
|
|
533
229
|
},
|
|
534
230
|
// 当前页变化
|
|
535
231
|
currentChange:(current: number) => {
|
|
536
|
-
console.log(`当前为第 ${current} 页`)
|
|
537
232
|
reportPageConfig.value.pagination['current-page'] = current
|
|
538
233
|
queryPageData()
|
|
539
234
|
},
|
|
@@ -543,7 +238,6 @@ const paginationEvent: Record<string, (event?: any) => void> = {
|
|
|
543
238
|
const pageDefaultEvent: Record<string, (event?: any) => void> = {
|
|
544
239
|
// 打开详情弹窗
|
|
545
240
|
openReadDialog:(scope: any) => {
|
|
546
|
-
console.log('查看详情,数据:', scope.row)
|
|
547
241
|
reportPageConfig.value.readForm['model'] = scope.row
|
|
548
242
|
reportPageConfig.value.readDialog['model-value'] = true
|
|
549
243
|
},
|
|
@@ -565,7 +259,6 @@ const pageDefaultEvent: Record<string, (event?: any) => void> = {
|
|
|
565
259
|
},
|
|
566
260
|
// 页面新增
|
|
567
261
|
pageAdd:(formModel: FormConfig['model']) => {
|
|
568
|
-
console.log('页面新增,数据:', formModel)
|
|
569
262
|
pageDefaultEvent.closeAddDialog()
|
|
570
263
|
},
|
|
571
264
|
// 页面删除
|
|
@@ -580,9 +273,14 @@ const pageDefaultEvent: Record<string, (event?: any) => void> = {
|
|
|
580
273
|
}
|
|
581
274
|
)
|
|
582
275
|
.then(() => {
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
276
|
+
request.flameApi.singleDelete({
|
|
277
|
+
tableName: props.tableName,
|
|
278
|
+
data: { key: scope.row.flame_id }
|
|
279
|
+
})
|
|
280
|
+
.then(() => {
|
|
281
|
+
pageRefresh()
|
|
282
|
+
ElMessage.success('删除成功')
|
|
283
|
+
})
|
|
586
284
|
})
|
|
587
285
|
.catch(() => {
|
|
588
286
|
ElMessage.info('取消删除')
|
|
@@ -590,7 +288,6 @@ const pageDefaultEvent: Record<string, (event?: any) => void> = {
|
|
|
590
288
|
},
|
|
591
289
|
// 打开编辑弹窗
|
|
592
290
|
openEditDialog:(scope: any) => {
|
|
593
|
-
console.log('单条编辑,数据:', scope.row)
|
|
594
291
|
reportPageConfig.value.editForm['model'] = scope.row
|
|
595
292
|
reportPageConfig.value.editDialog['model-value'] = true
|
|
596
293
|
},
|
|
@@ -600,17 +297,24 @@ const pageDefaultEvent: Record<string, (event?: any) => void> = {
|
|
|
600
297
|
},
|
|
601
298
|
// 页面编辑
|
|
602
299
|
pageEdit:(formModel: FormConfig['model']) => {
|
|
603
|
-
|
|
604
|
-
|
|
300
|
+
request.flameApi.singleUpdate({
|
|
301
|
+
tableName: props.tableName,
|
|
302
|
+
data: {
|
|
303
|
+
key: formModel?.flame_id,
|
|
304
|
+
data: formModel
|
|
305
|
+
}
|
|
306
|
+
})
|
|
307
|
+
.then(() => {
|
|
308
|
+
pageRefresh()
|
|
309
|
+
ElMessage.success('修改成功')
|
|
310
|
+
pageDefaultEvent.closeEditDialog()
|
|
311
|
+
})
|
|
605
312
|
},
|
|
606
313
|
// 页面导入
|
|
607
|
-
pageImport:() => console.log('页面导入'),
|
|
608
314
|
// 页面导出
|
|
609
|
-
pageExport:() => console.log('页面导出'),
|
|
610
315
|
// 页面批量删除
|
|
611
316
|
pageBatchDelete:() => {
|
|
612
|
-
|
|
613
|
-
if (tableSelection.length) {
|
|
317
|
+
if (tableSelection.value.length) {
|
|
614
318
|
ElMessageBox.confirm(
|
|
615
319
|
'确认要删除勾选数据吗?此操作不可逆',
|
|
616
320
|
'提示',
|
|
@@ -622,8 +326,18 @@ const pageDefaultEvent: Record<string, (event?: any) => void> = {
|
|
|
622
326
|
)
|
|
623
327
|
.then(() => {
|
|
624
328
|
// 此处需要请求删除接口,并完成回显
|
|
625
|
-
|
|
626
|
-
|
|
329
|
+
request.flameApi.batchDelete({
|
|
330
|
+
tableName: props.tableName,
|
|
331
|
+
data: {
|
|
332
|
+
conditions: {
|
|
333
|
+
flame_id: tableSelection.value.map(({ flame_id }) => flame_id)
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
})
|
|
337
|
+
.then(() => {
|
|
338
|
+
pageRefresh()
|
|
339
|
+
ElMessage.success('删除成功')
|
|
340
|
+
})
|
|
627
341
|
})
|
|
628
342
|
.catch(() => {
|
|
629
343
|
ElMessage.info('取消删除')
|
|
@@ -634,6 +348,8 @@ const pageDefaultEvent: Record<string, (event?: any) => void> = {
|
|
|
634
348
|
},
|
|
635
349
|
}
|
|
636
350
|
|
|
351
|
+
defineExpose({ tableSelection, pageRefresh })
|
|
352
|
+
|
|
637
353
|
// 表格插槽
|
|
638
354
|
const getTableSlots = computed((): Array<string> => {
|
|
639
355
|
const columns: Array<TableColumnConfig> = reportPageConfig.value.table.columns || []
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ElementSize } from '
|
|
1
|
+
import { ElementSize } from '@/model/flmComponentConfig'
|
|
2
2
|
|
|
3
3
|
/** @button 按钮 */
|
|
4
4
|
|
|
@@ -25,6 +25,9 @@ export interface ButtonConfig {
|
|
|
25
25
|
'size'?: ElementSize
|
|
26
26
|
'type'?: ButtonType
|
|
27
27
|
'plain'?: boolean
|
|
28
|
+
'text'?: boolean
|
|
29
|
+
'bg'?: boolean
|
|
30
|
+
'link'?: boolean
|
|
28
31
|
'round'?: boolean
|
|
29
32
|
'circle'?: boolean
|
|
30
33
|
'loading'?: boolean
|
|
@@ -35,7 +38,7 @@ export interface ButtonConfig {
|
|
|
35
38
|
'native-type'?: ButtonNativeType
|
|
36
39
|
'auto-insert-space'?: boolean
|
|
37
40
|
// 自定义属性
|
|
38
|
-
'
|
|
41
|
+
'buttonText'?: string // 按钮文字
|
|
39
42
|
}
|
|
40
43
|
// 按钮默认设置
|
|
41
44
|
export const buttonDefaultConfig: ButtonConfig = {
|