flame-plus 0.1.33 → 0.1.36
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/flameDist/flame-plus.es.js +4 -4
- package/flameDist/flame-plus.es.js.map +1 -1
- package/flameDist/flame-plus.umd.js +1 -1
- package/flameDist/flame-plus.umd.js.map +1 -1
- package/flameDist/style.css +1 -1
- package/package.json +2 -2
- package/.vscode/extensions.json +0 -3
- package/index.html +0 -13
- package/pnpm-lock.yaml +0 -2107
- package/src/App.vue +0 -10
- package/src/assets/vue.svg +0 -1
- package/src/components/HelloWorld.vue +0 -33
- package/src/main.ts +0 -19
- package/src/packages/components/base/flmButton/flmButton.vue +0 -29
- package/src/packages/components/base/flmCascader/flmCascader.vue +0 -39
- package/src/packages/components/base/flmCheckbox/flmCheckbox.vue +0 -34
- package/src/packages/components/base/flmCheckbox/flmCheckboxGroup.vue +0 -71
- package/src/packages/components/base/flmColorPicker/flmColorPicker.vue +0 -34
- package/src/packages/components/base/flmDatePicker/flmDatePicker.vue +0 -47
- package/src/packages/components/base/flmDialog/flmDialog.vue +0 -39
- package/src/packages/components/base/flmInput/flmInput.vue +0 -38
- package/src/packages/components/base/flmInputNumber/flmInputNumber.vue +0 -36
- package/src/packages/components/base/flmPagination/flmPagination.vue +0 -37
- package/src/packages/components/base/flmRadio/flmRadio.vue +0 -64
- package/src/packages/components/base/flmRate/flmRate.vue +0 -34
- package/src/packages/components/base/flmRead/flmRead.vue +0 -18
- package/src/packages/components/base/flmSelect/flmSelect.vue +0 -74
- package/src/packages/components/base/flmSlider/flmSlider.vue +0 -35
- package/src/packages/components/base/flmSwitch/flmSwitch.vue +0 -29
- package/src/packages/components/base/flmTimePicker/flmTimePicker.vue +0 -37
- package/src/packages/components/base/flmTimeSelect/flmTimeSelect.vue +0 -36
- package/src/packages/components/base/flmTransfer/flmTransfer.vue +0 -42
- package/src/packages/components/complex/flmForm/flmForm.vue +0 -243
- package/src/packages/components/complex/flmSearch/flmSearch.vue +0 -145
- package/src/packages/components/complex/flmTable/flmTable.vue +0 -106
- package/src/packages/components/complex/flmToolbar/flmToolbar.vue +0 -55
- package/src/packages/components/index.ts +0 -30
- package/src/packages/components/page/flmExportPage/flmExportPage.vue +0 -219
- package/src/packages/components/page/flmReportPage/flmReportPage.vue +0 -496
- package/src/packages/index.ts +0 -96
- package/src/packages/utils/filterConfig.ts +0 -39
- package/src/packages/utils/index.ts +0 -2
- package/src/packages/utils/isValidKey.ts +0 -13
- package/src/shims-vue.d.ts +0 -9
- package/tsconfig.json +0 -39
- package/vite.config.js +0 -37
|
@@ -1,496 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="report-page" ref="reportPageRef">
|
|
3
|
-
<template v-if="isLoaded">
|
|
4
|
-
<flmSearch
|
|
5
|
-
class="page-search"
|
|
6
|
-
:config="reportPageConfig.search"
|
|
7
|
-
@searchSubmit="searchSubmit"
|
|
8
|
-
>
|
|
9
|
-
<template v-for="searchSlot in searchSlots" #[searchSlot]="{ prop, formModel }">
|
|
10
|
-
<slot :name="`search-${searchSlot}`" :prop="prop" :formModel="formModel"></slot>
|
|
11
|
-
</template>
|
|
12
|
-
</flmSearch>
|
|
13
|
-
<flmToolbar class="page-toolbar" :config="reportPageConfig.toolbar" @toolbarClick="toolbarClick" />
|
|
14
|
-
<flmTable
|
|
15
|
-
class="page-table"
|
|
16
|
-
:config="reportPageConfig.table"
|
|
17
|
-
@selectionChange="tableEvent.selectionChange"
|
|
18
|
-
>
|
|
19
|
-
<template v-for="tableSlot in getTableSlots" #[tableSlot]="{ index, row, column }">
|
|
20
|
-
<slot :name="`table-${tableSlot}`" :index="index" :row="row" :column="column"></slot>
|
|
21
|
-
</template>
|
|
22
|
-
<template v-if="reportPageConfig.tableAction.buttons.length" #tableAction="scope">
|
|
23
|
-
<flmToolbar :config="reportPageConfig.tableAction" @toolbarClick="tableActionClick($event, scope)" />
|
|
24
|
-
</template>
|
|
25
|
-
</flmTable>
|
|
26
|
-
<flmPagination
|
|
27
|
-
class="page-pagination"
|
|
28
|
-
:config="reportPageConfig.pagination"
|
|
29
|
-
@size-change="paginationEvent.sizeChange"
|
|
30
|
-
@current-change="paginationEvent.currentChange"
|
|
31
|
-
/>
|
|
32
|
-
</template>
|
|
33
|
-
<flmDialog :config="reportPageConfig.readDialog" @close="pageDefaultEvent.closeReadDialog">
|
|
34
|
-
<flmForm class="form-read" :config="reportPageConfig.readForm" @cancel="pageDefaultEvent.closeReadDialog">
|
|
35
|
-
<template v-for="readFormSlot in readFormSlots" #[readFormSlot]="{ prop, formModel }">
|
|
36
|
-
<slot :name="`read-${readFormSlot}`" :prop="prop" :formModel="formModel"></slot>
|
|
37
|
-
</template>
|
|
38
|
-
</flmForm>
|
|
39
|
-
</flmDialog>
|
|
40
|
-
<flmDialog :config="reportPageConfig.addDialog" @close="pageDefaultEvent.closeAddDialog">
|
|
41
|
-
<flmForm
|
|
42
|
-
class="form-add"
|
|
43
|
-
:config="reportPageConfig.addForm"
|
|
44
|
-
@submit="pageDefaultEvent.pageAdd"
|
|
45
|
-
@cancel="pageDefaultEvent.closeAddDialog"
|
|
46
|
-
>
|
|
47
|
-
<template v-for="addFormSlot in addFormSlots" #[addFormSlot]="{ prop, formModel }">
|
|
48
|
-
<slot :name="`add-${addFormSlot}`" :prop="prop" :formModel="formModel"></slot>
|
|
49
|
-
</template>
|
|
50
|
-
</flmForm>
|
|
51
|
-
</flmDialog>
|
|
52
|
-
<flmDialog :config="reportPageConfig.editDialog" @close="pageDefaultEvent.closeEditDialog">
|
|
53
|
-
<flmForm
|
|
54
|
-
class="form-edit"
|
|
55
|
-
:config="reportPageConfig.editForm"
|
|
56
|
-
@submit="pageDefaultEvent.pageEdit"
|
|
57
|
-
@cancel="pageDefaultEvent.closeEditDialog"
|
|
58
|
-
>
|
|
59
|
-
<template v-for="editFormSlot in editFormSlots" #[editFormSlot]="{ prop, formModel }">
|
|
60
|
-
<slot :name="`edit-${editFormSlot}`" :prop="prop" :formModel="formModel"></slot>
|
|
61
|
-
</template>
|
|
62
|
-
</flmForm>
|
|
63
|
-
</flmDialog>
|
|
64
|
-
</div>
|
|
65
|
-
</template>
|
|
66
|
-
|
|
67
|
-
<script lang="ts" setup>
|
|
68
|
-
import { PropType, ref, Ref, computed, onMounted } from 'vue'
|
|
69
|
-
// import store from '@/store'
|
|
70
|
-
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
71
|
-
import {
|
|
72
|
-
flmForm,
|
|
73
|
-
flmSearch,
|
|
74
|
-
flmToolbar,
|
|
75
|
-
flmTable,
|
|
76
|
-
flmPagination,
|
|
77
|
-
flmDialog
|
|
78
|
-
} from '../../index'
|
|
79
|
-
import {
|
|
80
|
-
FormItemConfig,
|
|
81
|
-
FormConfig,
|
|
82
|
-
TableColumnConfig,
|
|
83
|
-
ReportPageSetting,
|
|
84
|
-
} from 'flame-types'
|
|
85
|
-
import { isValidKey } from '../../../utils'
|
|
86
|
-
|
|
87
|
-
const props = defineProps({
|
|
88
|
-
// 表名
|
|
89
|
-
tableName: {
|
|
90
|
-
type: String,
|
|
91
|
-
required: true
|
|
92
|
-
},
|
|
93
|
-
// 请求方式
|
|
94
|
-
request: {
|
|
95
|
-
type: Object as PropType<any>,
|
|
96
|
-
required: true
|
|
97
|
-
}
|
|
98
|
-
})
|
|
99
|
-
|
|
100
|
-
const emit = defineEmits(['customEvent'])
|
|
101
|
-
const reportPageRef = ref()
|
|
102
|
-
|
|
103
|
-
const safeTableName = computed(() => props.tableName.replace(/_/g, ''))
|
|
104
|
-
|
|
105
|
-
let isLoaded: Ref<boolean> = ref(false)
|
|
106
|
-
let reportPageConfig: Ref<ReportPageSetting> = ref({
|
|
107
|
-
search: {},
|
|
108
|
-
toolbar: {
|
|
109
|
-
publicConfig: {},
|
|
110
|
-
maxButton: 3,
|
|
111
|
-
buttons: []
|
|
112
|
-
},
|
|
113
|
-
table: {},
|
|
114
|
-
tableAction: {
|
|
115
|
-
publicConfig: {},
|
|
116
|
-
maxButton: 3,
|
|
117
|
-
buttons: []
|
|
118
|
-
},
|
|
119
|
-
pagination: {},
|
|
120
|
-
readDialog: {
|
|
121
|
-
'model-value': false
|
|
122
|
-
},
|
|
123
|
-
readForm: {},
|
|
124
|
-
addDialog: {
|
|
125
|
-
'model-value': false
|
|
126
|
-
},
|
|
127
|
-
addForm: {},
|
|
128
|
-
editDialog: {
|
|
129
|
-
'model-value': false
|
|
130
|
-
},
|
|
131
|
-
editForm: {}
|
|
132
|
-
})
|
|
133
|
-
const searchParams: FormConfig['model'] = ref({}) // 搜索条件
|
|
134
|
-
let tableSelection: Ref<Array<any>> = ref([]) // 表格勾选项
|
|
135
|
-
|
|
136
|
-
onMounted(() => {
|
|
137
|
-
queryPageSetting()
|
|
138
|
-
})
|
|
139
|
-
|
|
140
|
-
// 表格高度
|
|
141
|
-
const tableHeight = () => {
|
|
142
|
-
const homeHeight = '100vh',
|
|
143
|
-
headerHight = '50px', // 页眉高度
|
|
144
|
-
mainSpacing = '30px', // 主体内容边距
|
|
145
|
-
pageSearch = '50px', // 搜索栏高度
|
|
146
|
-
pageFooter = '50px', // 分页高度
|
|
147
|
-
pageSpacing = '40px' // 页面边距
|
|
148
|
-
return `calc(${homeHeight} - ${headerHight} - ${mainSpacing} - ${pageSearch} - ${pageFooter} - ${pageSpacing})`
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
// 查询页面配置
|
|
152
|
-
const queryPageSetting = () => {
|
|
153
|
-
props.request.flameprops.request({
|
|
154
|
-
tableName: 'flametableinfo',
|
|
155
|
-
flameMethod: 'webgetpagesetting',
|
|
156
|
-
data: { table_name: props.tableName, menu_id: null }
|
|
157
|
-
})
|
|
158
|
-
.then(({ items }: any) => {
|
|
159
|
-
const reportPageSetting: ReportPageSetting = items
|
|
160
|
-
reportPageSetting.table['height'] = tableHeight()
|
|
161
|
-
reportPageSetting.table['max-height'] = tableHeight()
|
|
162
|
-
reportPageSetting.tableAction.buttons.length && reportPageSetting.table.columns?.push({
|
|
163
|
-
prop: 'tableAction',
|
|
164
|
-
label: '操作',
|
|
165
|
-
isSlot: true,
|
|
166
|
-
fixed: 'right',
|
|
167
|
-
'min-width': '200px'
|
|
168
|
-
})
|
|
169
|
-
reportPageConfig.value = reportPageSetting
|
|
170
|
-
queryPageData()
|
|
171
|
-
})
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
// 查询页面数据
|
|
175
|
-
const queryPageData = () => {
|
|
176
|
-
const {
|
|
177
|
-
['current-page']: page_no = 1,
|
|
178
|
-
['page-size']: page_size = 20,
|
|
179
|
-
}: ReportPageSetting['pagination'] = reportPageConfig.value.pagination
|
|
180
|
-
props.request.flameApi.pageSearch({
|
|
181
|
-
tableName: safeTableName.value,
|
|
182
|
-
data: {
|
|
183
|
-
page_no,
|
|
184
|
-
page_size,
|
|
185
|
-
conditions: searchParams.value,
|
|
186
|
-
ref_level: 1,
|
|
187
|
-
order_by: "flame_id DESC"
|
|
188
|
-
}
|
|
189
|
-
})
|
|
190
|
-
.then(({ items, total }: any) => {
|
|
191
|
-
reportPageConfig.value.table.data = items
|
|
192
|
-
reportPageConfig.value.pagination['total'] = total
|
|
193
|
-
isLoaded.value = true
|
|
194
|
-
})
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
// 页面刷新
|
|
198
|
-
const pageRefresh = () => {
|
|
199
|
-
reportPageConfig.value.pagination['current-page'] = 1
|
|
200
|
-
queryPageData()
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
// 搜索栏提交
|
|
204
|
-
const searchSubmit = (event: object) => {
|
|
205
|
-
searchParams.value = event
|
|
206
|
-
pageRefresh()
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
// 工具栏点击
|
|
210
|
-
const toolbarClick = (event: string) => {
|
|
211
|
-
isValidKey(event, pageDefaultEvent)
|
|
212
|
-
? pageDefaultEvent[event]()
|
|
213
|
-
: emit('customEvent', event)
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
// 表格操作栏点击
|
|
217
|
-
const tableActionClick = (event: string, scope: any) => {
|
|
218
|
-
isValidKey(event, pageDefaultEvent)
|
|
219
|
-
? pageDefaultEvent[event](scope)
|
|
220
|
-
: emit('customEvent', { event, scope })
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
// 表格操作
|
|
224
|
-
const tableEvent: Record<string, (event?: any) => void> = {
|
|
225
|
-
// 表格勾选项变化
|
|
226
|
-
selectionChange: ({ row }: any) => {
|
|
227
|
-
tableSelection.value = row
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
// 分页器操作
|
|
232
|
-
const paginationEvent: Record<string, (event?: any) => void> = {
|
|
233
|
-
// 每页数量变化
|
|
234
|
-
sizeChange:(pageSize: number) => {
|
|
235
|
-
reportPageConfig.value.pagination['current-page'] = 1
|
|
236
|
-
reportPageConfig.value.pagination['page-size'] = pageSize
|
|
237
|
-
queryPageData()
|
|
238
|
-
},
|
|
239
|
-
// 当前页变化
|
|
240
|
-
currentChange:(current: number) => {
|
|
241
|
-
reportPageConfig.value.pagination['current-page'] = current
|
|
242
|
-
queryPageData()
|
|
243
|
-
},
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
// 页面默认操作
|
|
247
|
-
const pageDefaultEvent: Record<string, (event?: any) => void> = {
|
|
248
|
-
// 打开详情弹窗
|
|
249
|
-
openReadDialog:(scope: any) => {
|
|
250
|
-
props.request.flameApi.singleSearch({
|
|
251
|
-
tableName: safeTableName.value,
|
|
252
|
-
data: { key: scope.row.flame_id }
|
|
253
|
-
})
|
|
254
|
-
.then(({ items }: any) => {
|
|
255
|
-
reportPageConfig.value.readForm['model'] = items
|
|
256
|
-
reportPageConfig.value.readDialog['model-value'] = true
|
|
257
|
-
})
|
|
258
|
-
},
|
|
259
|
-
// 关闭详情弹窗
|
|
260
|
-
closeReadDialog:() => {
|
|
261
|
-
reportPageConfig.value.readDialog['model-value'] = false
|
|
262
|
-
},
|
|
263
|
-
// 查看详情
|
|
264
|
-
pageRead:(scope: any) => {
|
|
265
|
-
props.request.flameApi.singleSearch({
|
|
266
|
-
tableName: safeTableName.value,
|
|
267
|
-
data: { key: scope.row.flame_id }
|
|
268
|
-
})
|
|
269
|
-
.then(({ items }: any) => {
|
|
270
|
-
reportPageConfig.value.readForm['model'] = items
|
|
271
|
-
reportPageConfig.value.readDialog['model-value'] = true
|
|
272
|
-
})
|
|
273
|
-
},
|
|
274
|
-
// 打开新增弹窗
|
|
275
|
-
openAddDialog:() => {
|
|
276
|
-
reportPageConfig.value.addDialog['model-value'] = true
|
|
277
|
-
},
|
|
278
|
-
// 关闭新增弹窗
|
|
279
|
-
closeAddDialog:() => {
|
|
280
|
-
reportPageConfig.value.addDialog['model-value'] = false
|
|
281
|
-
},
|
|
282
|
-
// 页面新增
|
|
283
|
-
pageAdd:(formModel: FormConfig['model']) => {
|
|
284
|
-
props.request.flameApi.singleAdd({
|
|
285
|
-
tableName: safeTableName.value,
|
|
286
|
-
data: { data: formModel }
|
|
287
|
-
})
|
|
288
|
-
.then(() => {
|
|
289
|
-
pageRefresh()
|
|
290
|
-
ElMessage.success('新增成功')
|
|
291
|
-
pageDefaultEvent.closeAddDialog()
|
|
292
|
-
})
|
|
293
|
-
},
|
|
294
|
-
// 页面删除
|
|
295
|
-
pageDelete:(scope: any) => {
|
|
296
|
-
ElMessageBox.confirm(
|
|
297
|
-
'确认要删除本条数据吗?此操作不可逆',
|
|
298
|
-
'提示',
|
|
299
|
-
{
|
|
300
|
-
confirmButtonText: '确定',
|
|
301
|
-
cancelButtonText: '取消',
|
|
302
|
-
type: 'warning',
|
|
303
|
-
}
|
|
304
|
-
)
|
|
305
|
-
.then(() => {
|
|
306
|
-
props.request.flameApi.singleDelete({
|
|
307
|
-
tableName: safeTableName.value,
|
|
308
|
-
data: { key: scope.row.flame_id }
|
|
309
|
-
})
|
|
310
|
-
.then(() => {
|
|
311
|
-
pageRefresh()
|
|
312
|
-
ElMessage.success('删除成功')
|
|
313
|
-
})
|
|
314
|
-
})
|
|
315
|
-
.catch(() => {
|
|
316
|
-
ElMessage.info('取消删除')
|
|
317
|
-
})
|
|
318
|
-
},
|
|
319
|
-
// 打开编辑弹窗
|
|
320
|
-
openEditDialog:(scope: any) => {
|
|
321
|
-
props.request.flameApi.singleSearch({
|
|
322
|
-
tableName: safeTableName.value,
|
|
323
|
-
data: { key: scope.row.flame_id }
|
|
324
|
-
})
|
|
325
|
-
.then(({ result, message, items }: any) => {
|
|
326
|
-
if (result) {
|
|
327
|
-
reportPageConfig.value.editForm['model'] = items
|
|
328
|
-
reportPageConfig.value.editDialog['model-value'] = true
|
|
329
|
-
} else {
|
|
330
|
-
ElMessage.warning(message)
|
|
331
|
-
}
|
|
332
|
-
})
|
|
333
|
-
},
|
|
334
|
-
// 关闭详情弹窗
|
|
335
|
-
closeEditDialog:() => {
|
|
336
|
-
reportPageConfig.value.editDialog['model-value'] = false
|
|
337
|
-
},
|
|
338
|
-
// 页面编辑
|
|
339
|
-
pageEdit:(formModel: FormConfig['model']) => {
|
|
340
|
-
props.request.flameApi.singleUpdate({
|
|
341
|
-
tableName: safeTableName.value,
|
|
342
|
-
data: {
|
|
343
|
-
key: formModel?.flame_id,
|
|
344
|
-
data: formModel
|
|
345
|
-
}
|
|
346
|
-
})
|
|
347
|
-
.then(() => {
|
|
348
|
-
pageRefresh()
|
|
349
|
-
ElMessage.success('修改成功')
|
|
350
|
-
pageDefaultEvent.closeEditDialog()
|
|
351
|
-
})
|
|
352
|
-
},
|
|
353
|
-
// 页面导入
|
|
354
|
-
// pageImport:() => {
|
|
355
|
-
// const inputFile: any = document.createElement('input')
|
|
356
|
-
// inputFile.type = 'file'
|
|
357
|
-
// inputFile.style.display = 'none'
|
|
358
|
-
// document.body.appendChild(inputFile)
|
|
359
|
-
// inputFile.click()
|
|
360
|
-
// inputFile.addEventListener('change', () => {
|
|
361
|
-
// const file = inputFile.files[0]
|
|
362
|
-
// var fileType = file.name.substring(file.name.lastIndexOf('.') + 1)
|
|
363
|
-
// if (!['xls', 'xlsx', 'et'].includes(fileType)) {
|
|
364
|
-
// ElMessage.warning('请上传 xls、xlsx、et 格式的文件!')
|
|
365
|
-
// document.body.removeChild(inputFile)
|
|
366
|
-
// return false
|
|
367
|
-
// }
|
|
368
|
-
// const formData = new FormData()
|
|
369
|
-
// formData.append("file", file)
|
|
370
|
-
// props.request.flameAxios({
|
|
371
|
-
// headers: { 'Content-Type': 'multipart/form-data' },
|
|
372
|
-
// method: 'post',
|
|
373
|
-
// url: `/resource-service/upload_file?source=mongo&token=${store.state.token}`,
|
|
374
|
-
// data: formData
|
|
375
|
-
// })
|
|
376
|
-
// .then(({ key: code }: any) => {
|
|
377
|
-
// props.request.flameprops.request({
|
|
378
|
-
// tableName: safeTableName.value,
|
|
379
|
-
// flameMethod: 'importfile',
|
|
380
|
-
// data: { code }
|
|
381
|
-
// })
|
|
382
|
-
// .then((res: any) => {
|
|
383
|
-
// ElMessage.success('上传成功!')
|
|
384
|
-
// pageRefresh()
|
|
385
|
-
// })
|
|
386
|
-
// })
|
|
387
|
-
// .finally(() => document.body.removeChild(inputFile))
|
|
388
|
-
// })
|
|
389
|
-
// },
|
|
390
|
-
// 页面导出
|
|
391
|
-
pageExport:() => {
|
|
392
|
-
props.request.flameApi.exportFile({
|
|
393
|
-
tableName: safeTableName.value,
|
|
394
|
-
data: {
|
|
395
|
-
conditions: searchParams.value,
|
|
396
|
-
ref_level: 1,
|
|
397
|
-
order_by: 'flame_id DESC'
|
|
398
|
-
}
|
|
399
|
-
})
|
|
400
|
-
.then(({ items }: any) => {
|
|
401
|
-
window.open(items.download_url)
|
|
402
|
-
ElMessage.success('导出成功')
|
|
403
|
-
})
|
|
404
|
-
},
|
|
405
|
-
// 页面批量删除
|
|
406
|
-
pageBatchDelete:() => {
|
|
407
|
-
if (tableSelection.value.length) {
|
|
408
|
-
ElMessageBox.confirm(
|
|
409
|
-
'确认要删除勾选数据吗?此操作不可逆',
|
|
410
|
-
'提示',
|
|
411
|
-
{
|
|
412
|
-
confirmButtonText: '确定',
|
|
413
|
-
cancelButtonText: '取消',
|
|
414
|
-
type: 'warning',
|
|
415
|
-
}
|
|
416
|
-
)
|
|
417
|
-
.then(() => {
|
|
418
|
-
// 此处需要请求删除接口,并完成回显
|
|
419
|
-
props.request.flameApi.batchDelete({
|
|
420
|
-
tableName: safeTableName.value,
|
|
421
|
-
data: {
|
|
422
|
-
conditions: {
|
|
423
|
-
flame_id: tableSelection.value.map(({ flame_id }) => flame_id)
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
})
|
|
427
|
-
.then(() => {
|
|
428
|
-
pageRefresh()
|
|
429
|
-
ElMessage.success('删除成功')
|
|
430
|
-
})
|
|
431
|
-
})
|
|
432
|
-
.catch(() => {
|
|
433
|
-
ElMessage.info('取消删除')
|
|
434
|
-
})
|
|
435
|
-
} else {
|
|
436
|
-
ElMessage.warning('未勾选删除项!')
|
|
437
|
-
}
|
|
438
|
-
},
|
|
439
|
-
}
|
|
440
|
-
|
|
441
|
-
defineExpose({ tableSelection, pageRefresh })
|
|
442
|
-
|
|
443
|
-
// 表格插槽
|
|
444
|
-
const getTableSlots = computed((): Array<string> => {
|
|
445
|
-
const columns: Array<TableColumnConfig> = reportPageConfig.value.table.columns || []
|
|
446
|
-
const slotColumns: Array<string> = []
|
|
447
|
-
const slotFilter = (columns: Array<TableColumnConfig>) => {
|
|
448
|
-
columns.forEach(({ prop, isSlot, columns }: TableColumnConfig) => {
|
|
449
|
-
(isSlot && prop && prop !== 'tableAction') && slotColumns.push(prop)
|
|
450
|
-
columns?.length && slotFilter(columns)
|
|
451
|
-
})
|
|
452
|
-
}
|
|
453
|
-
slotFilter(columns)
|
|
454
|
-
return slotColumns
|
|
455
|
-
})
|
|
456
|
-
|
|
457
|
-
const getFormSlots = (items: FormConfig['items'] = []): Array<string> => {
|
|
458
|
-
let slots: Array<string> = []
|
|
459
|
-
items.forEach((item: FormItemConfig) => {
|
|
460
|
-
if (isValidKey('isSlot', item)) {
|
|
461
|
-
const { prop } = item
|
|
462
|
-
prop && typeof(prop) === 'string' && slots.push(prop)
|
|
463
|
-
}
|
|
464
|
-
})
|
|
465
|
-
return slots
|
|
466
|
-
}
|
|
467
|
-
const searchSlots = computed((): Array<string> => getFormSlots(reportPageConfig.value.search.items))
|
|
468
|
-
const readFormSlots = computed((): Array<string> => getFormSlots(reportPageConfig.value.readForm.items))
|
|
469
|
-
const addFormSlots = computed((): Array<string> => getFormSlots(reportPageConfig.value.addForm.items))
|
|
470
|
-
const editFormSlots = computed((): Array<string> => getFormSlots(reportPageConfig.value.editForm.items))
|
|
471
|
-
</script>
|
|
472
|
-
|
|
473
|
-
<style lang="scss" scoped>
|
|
474
|
-
.report-page {
|
|
475
|
-
display: grid;
|
|
476
|
-
grid-template-columns: repeat(24, 1fr);
|
|
477
|
-
grid-template-rows: 50px 1fr 50px;
|
|
478
|
-
padding: 20px;
|
|
479
|
-
border-radius: 2px;
|
|
480
|
-
background: #FFF;
|
|
481
|
-
.page-search {
|
|
482
|
-
grid-column: span 18;
|
|
483
|
-
}
|
|
484
|
-
.page-toolbar {
|
|
485
|
-
grid-column: span 6;
|
|
486
|
-
justify-self: end;
|
|
487
|
-
}
|
|
488
|
-
.page-table, .page-pagination {
|
|
489
|
-
grid-column: span 24;
|
|
490
|
-
}
|
|
491
|
-
.page-pagination {
|
|
492
|
-
align-self: end;
|
|
493
|
-
justify-self: end;
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
</style>
|
package/src/packages/index.ts
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import 'element-plus/dist/index.css'
|
|
2
|
-
// 基础组件
|
|
3
|
-
import flmButton from './components/base/flmButton/flmButton.vue' // 按钮
|
|
4
|
-
import flmCascader from './components/base/flmCascader/flmCascader.vue' // 级联选择器
|
|
5
|
-
import flmCheckbox from './components/base/flmCheckbox/flmCheckbox.vue' // 多选框
|
|
6
|
-
import flmCheckboxGroup from './components/base/flmCheckbox/flmCheckboxGroup.vue' // 多选框组
|
|
7
|
-
import flmColorPicker from './components/base/flmColorPicker/flmColorPicker.vue' // 取色器
|
|
8
|
-
import flmDatePicker from './components/base/flmDatePicker/flmDatePicker.vue' // 日期选择器
|
|
9
|
-
import flmInput from './components/base/flmInput/flmInput.vue' // 输入框
|
|
10
|
-
import flmInputNumber from './components/base/flmInputNumber/flmInputNumber.vue' // 数字输入框
|
|
11
|
-
import flmPagination from './components/base/flmPagination/flmPagination.vue' // 分页器
|
|
12
|
-
import flmRadio from './components/base/flmRadio/flmRadio.vue' // 单选框
|
|
13
|
-
import flmRate from './components/base/flmRate/flmRate.vue' // 评分
|
|
14
|
-
import flmRead from './components/base/flmRead/flmRead.vue' // 查看
|
|
15
|
-
import flmSelect from './components/base/flmSelect/flmSelect.vue' // 选择器
|
|
16
|
-
import flmSlider from './components/base/flmSlider/flmSlider.vue' // 滑块
|
|
17
|
-
import flmSwitch from './components/base/flmSwitch/flmSwitch.vue' // 开关
|
|
18
|
-
import flmTimePicker from './components/base/flmTimePicker/flmTimePicker.vue' // 时间选择器
|
|
19
|
-
import flmTimeSelect from './components/base/flmTimeSelect/flmTimeSelect.vue' // 时间选择
|
|
20
|
-
import flmTransfer from './components/base/flmTransfer/flmTransfer.vue' // 穿梭框
|
|
21
|
-
import flmDialog from './components/base/flmDialog/flmDialog.vue' // 弹窗
|
|
22
|
-
// 复合组件
|
|
23
|
-
import flmForm from './components/complex/flmForm/flmForm.vue' // 表单
|
|
24
|
-
import flmTable from './components/complex/flmTable/flmTable.vue' // 表格
|
|
25
|
-
import flmToolbar from './components/complex/flmToolbar/flmToolbar.vue' // 操作栏
|
|
26
|
-
import flmSearch from './components/complex/flmSearch/flmSearch.vue' // 搜索
|
|
27
|
-
// 页面组件
|
|
28
|
-
import flmReportPage from './components/page/flmReportPage/flmReportPage.vue' // 报表页面
|
|
29
|
-
import flmExportPage from './components/page/flmExportPage/flmExportPage.vue' // 导出页面
|
|
30
|
-
|
|
31
|
-
import type { App } from "vue";
|
|
32
|
-
|
|
33
|
-
const components: any = {
|
|
34
|
-
flmButton,
|
|
35
|
-
flmCascader,
|
|
36
|
-
flmCheckbox,
|
|
37
|
-
flmCheckboxGroup,
|
|
38
|
-
flmColorPicker,
|
|
39
|
-
flmDatePicker,
|
|
40
|
-
flmInput,
|
|
41
|
-
flmInputNumber,
|
|
42
|
-
flmPagination,
|
|
43
|
-
flmRadio,
|
|
44
|
-
flmRate,
|
|
45
|
-
flmRead,
|
|
46
|
-
flmSelect,
|
|
47
|
-
flmSlider,
|
|
48
|
-
flmSwitch,
|
|
49
|
-
flmTimePicker,
|
|
50
|
-
flmTimeSelect,
|
|
51
|
-
flmTransfer,
|
|
52
|
-
flmDialog,
|
|
53
|
-
flmForm,
|
|
54
|
-
flmTable,
|
|
55
|
-
flmToolbar,
|
|
56
|
-
flmSearch,
|
|
57
|
-
flmReportPage,
|
|
58
|
-
flmExportPage
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const install = (app: App) => {
|
|
62
|
-
Object.entries(components).forEach(([name, component]: any) => app.component(name, component))
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export {
|
|
66
|
-
flmButton,
|
|
67
|
-
flmCascader,
|
|
68
|
-
flmCheckbox,
|
|
69
|
-
flmCheckboxGroup,
|
|
70
|
-
flmColorPicker,
|
|
71
|
-
flmDatePicker,
|
|
72
|
-
flmInput,
|
|
73
|
-
flmInputNumber,
|
|
74
|
-
flmPagination,
|
|
75
|
-
flmRadio,
|
|
76
|
-
flmRate,
|
|
77
|
-
flmRead,
|
|
78
|
-
flmSelect,
|
|
79
|
-
flmSlider,
|
|
80
|
-
flmSwitch,
|
|
81
|
-
flmTimePicker,
|
|
82
|
-
flmTimeSelect,
|
|
83
|
-
flmTransfer,
|
|
84
|
-
flmDialog,
|
|
85
|
-
flmForm,
|
|
86
|
-
flmTable,
|
|
87
|
-
flmToolbar,
|
|
88
|
-
flmSearch,
|
|
89
|
-
flmReportPage,
|
|
90
|
-
flmExportPage
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
export default {
|
|
94
|
-
install,
|
|
95
|
-
...components
|
|
96
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 过滤设置
|
|
3
|
-
* @date 2022-04-11
|
|
4
|
-
* @param {any} defaultConfig - 默认设置
|
|
5
|
-
* @param {any} config - 当前设置
|
|
6
|
-
* @returns {Object} - 过滤后的设置
|
|
7
|
-
*/
|
|
8
|
-
const filterConfig = (defaultConfig: any, config: any) => {
|
|
9
|
-
let currentConfig: any = {}
|
|
10
|
-
Object
|
|
11
|
-
.keys({...defaultConfig, ...config})
|
|
12
|
-
.forEach((configKey: string) => {
|
|
13
|
-
const inConfig: boolean = configKey in config
|
|
14
|
-
const valueDifferent: boolean = isValueDifferent(defaultConfig[configKey], config[configKey])
|
|
15
|
-
if (valueDifferent && inConfig)
|
|
16
|
-
currentConfig[configKey] = config[configKey]
|
|
17
|
-
})
|
|
18
|
-
return currentConfig
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* 判断两个值是否不同
|
|
23
|
-
* @date 2022-05-30
|
|
24
|
-
* @param {any} baseValue - 默认值
|
|
25
|
-
* @param {any} value - 当前值
|
|
26
|
-
* @returns {boolean} - 对比结果
|
|
27
|
-
*/
|
|
28
|
-
const isValueDifferent = (baseValue: any, value: any) => {
|
|
29
|
-
const valueType = typeof(value)
|
|
30
|
-
if (['boolean', 'number', 'string'].includes(valueType)) {
|
|
31
|
-
return value !== baseValue
|
|
32
|
-
} else if (['function'].includes(valueType)) {
|
|
33
|
-
return true
|
|
34
|
-
} else {
|
|
35
|
-
return JSON.stringify(value) !== JSON.stringify(baseValue)
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export default filterConfig
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 判断key是否有效
|
|
3
|
-
* @date 2022-04-11
|
|
4
|
-
* @param {string | number | symbol} key
|
|
5
|
-
* @param {object} object
|
|
6
|
-
* @returns {boolean}
|
|
7
|
-
*/
|
|
8
|
-
export default function isValidKey(
|
|
9
|
-
key: string | number | symbol,
|
|
10
|
-
object: object
|
|
11
|
-
): key is keyof typeof object {
|
|
12
|
-
return key in object
|
|
13
|
-
}
|
package/src/shims-vue.d.ts
DELETED
package/tsconfig.json
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "esnext",
|
|
4
|
-
"module": "esnext",
|
|
5
|
-
"strict": true,
|
|
6
|
-
"jsx": "preserve",
|
|
7
|
-
"importHelpers": true,
|
|
8
|
-
"moduleResolution": "node",
|
|
9
|
-
"experimentalDecorators": true,
|
|
10
|
-
"skipLibCheck": true,
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"allowSyntheticDefaultImports": true,
|
|
13
|
-
"sourceMap": true,
|
|
14
|
-
"baseUrl": ".",
|
|
15
|
-
"types": ["webpack-env", "element-plus/global"],
|
|
16
|
-
"paths": {
|
|
17
|
-
"@/*": [
|
|
18
|
-
"src/*"
|
|
19
|
-
]
|
|
20
|
-
},
|
|
21
|
-
"lib": [
|
|
22
|
-
"esnext",
|
|
23
|
-
"dom",
|
|
24
|
-
"dom.iterable",
|
|
25
|
-
"scripthost"
|
|
26
|
-
]
|
|
27
|
-
},
|
|
28
|
-
"include": [
|
|
29
|
-
"**/*.ts",
|
|
30
|
-
"**/*.tsx",
|
|
31
|
-
"**/*.vue",
|
|
32
|
-
"tests/**/*.ts",
|
|
33
|
-
"tests/**/*.tsx",
|
|
34
|
-
"typings"
|
|
35
|
-
],
|
|
36
|
-
"exclude": [
|
|
37
|
-
"node_modules"
|
|
38
|
-
]
|
|
39
|
-
}
|