flame-plus 0.1.20 → 0.1.22
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
CHANGED
|
@@ -294,6 +294,63 @@ const pageDefaultEvent: Record<string, (event?: any) => void> = {
|
|
|
294
294
|
pageDefaultEvent.closeAddDialog()
|
|
295
295
|
})
|
|
296
296
|
},
|
|
297
|
+
// 页面导入
|
|
298
|
+
pageImport:() => {
|
|
299
|
+
const inputFile: any = document.createElement('input')
|
|
300
|
+
inputFile.type = 'file'
|
|
301
|
+
inputFile.style.display = 'none'
|
|
302
|
+
document.body.appendChild(inputFile)
|
|
303
|
+
inputFile.click()
|
|
304
|
+
inputFile.addEventListener('change', () => {
|
|
305
|
+
const file = inputFile.files[0]
|
|
306
|
+
var fileType = file.name.substring(file.name.lastIndexOf('.') + 1)
|
|
307
|
+
if (!['xls', 'xlsx', 'et'].includes(fileType)) {
|
|
308
|
+
ElMessage.warning('请上传 xls、xlsx、et 格式的文件!')
|
|
309
|
+
document.body.removeChild(inputFile)
|
|
310
|
+
return false
|
|
311
|
+
}
|
|
312
|
+
const formData = new FormData()
|
|
313
|
+
formData.append("file", file)
|
|
314
|
+
request.flameAxios({
|
|
315
|
+
headers: { 'Content-Type': 'multipart/form-data' },
|
|
316
|
+
method: 'post',
|
|
317
|
+
url: `/resource-service/upload_file?source=mongo&token=${request.token}`,
|
|
318
|
+
data: formData
|
|
319
|
+
})
|
|
320
|
+
.then(({ key: code }: any) => {
|
|
321
|
+
request.flameRequest({
|
|
322
|
+
tableName: safeTableName.value,
|
|
323
|
+
flameMethod: 'importfile',
|
|
324
|
+
data: { code }
|
|
325
|
+
})
|
|
326
|
+
.then((res: any) => {
|
|
327
|
+
if(res.result){
|
|
328
|
+
ElMessage.success('导入成功!')
|
|
329
|
+
pageRefresh()
|
|
330
|
+
}
|
|
331
|
+
else{
|
|
332
|
+
ElMessage.error(res.message)
|
|
333
|
+
}
|
|
334
|
+
})
|
|
335
|
+
})
|
|
336
|
+
.finally(() => document.body.removeChild(inputFile))
|
|
337
|
+
})
|
|
338
|
+
},
|
|
339
|
+
// 页面导出
|
|
340
|
+
pageExport:() => {
|
|
341
|
+
request.flameApi.exportFile({
|
|
342
|
+
tableName: safeTableName.value,
|
|
343
|
+
data: {
|
|
344
|
+
conditions: searchParams.value,
|
|
345
|
+
ref_level: 1,
|
|
346
|
+
order_by: "flame_id DESC"
|
|
347
|
+
}
|
|
348
|
+
})
|
|
349
|
+
.then(({ items }: any) => {
|
|
350
|
+
window.open(items.download_url)
|
|
351
|
+
ElMessage.success('导出成功')
|
|
352
|
+
})
|
|
353
|
+
},
|
|
297
354
|
// 页面删除
|
|
298
355
|
pageDelete:(scope: any) => {
|
|
299
356
|
ElMessageBox.confirm(
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Author: 关羽 xiaobing525@163.com
|
|
3
|
+
* @Date: 2023-01-04 22:32:16
|
|
4
|
+
* @LastEditors: 关羽 xiaobing525@163.com
|
|
5
|
+
* @LastEditTime: 2023-01-11 21:37:39
|
|
6
|
+
* @FilePath: /flame-components/packages/model/flmComponentConfig/page/flmReportPage.ts
|
|
7
|
+
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
8
|
+
*/
|
|
1
9
|
import {
|
|
2
10
|
FormConfig,
|
|
11
|
+
SearchConfig,
|
|
3
12
|
ToolbarConfig,
|
|
4
13
|
TableConfig,
|
|
5
14
|
PaginationConfig,
|
|
@@ -8,7 +17,7 @@ import {
|
|
|
8
17
|
|
|
9
18
|
// 报表页面设置
|
|
10
19
|
export interface ReportPageSetting {
|
|
11
|
-
'search':
|
|
20
|
+
'search': SearchConfig
|
|
12
21
|
'toolbar': ToolbarConfig
|
|
13
22
|
'table': TableConfig
|
|
14
23
|
'tableAction': ToolbarConfig
|