1
0

feat(frontend): 增加数据资源查看界面

This commit is contained in:
2024-11-21 19:18:04 +08:00
parent c51228bf42
commit aeb89e2367
5 changed files with 360 additions and 264 deletions

View File

@@ -1,5 +1,5 @@
import {resourceAddDialog} from "../../components/resource/dialog-resource.js";
import {apiPost, inputFileFormItemCommonOptions} from "../../components/constants.js";
import {resourceAddDialog, resourceDetailDialog} from "../../components/resource/dialog-resource.js";
import {apiPost, copyField, crudCommonOptions} from "../../components/constants.js";
export function tabData() {
return {
@@ -7,24 +7,51 @@ export function tabData() {
icon: 'fa fa-database',
body: [
{
type: 'action',
label: '',
icon: 'fa fa-plus',
...resourceAddDialog()
},
{
type: 'form',
body: [
type: 'crud',
api: {
...apiPost('${base}/data_resource/list')
},
...crudCommonOptions(),
headerToolbar: [
'reload',
{
type: 'input-file',
name: 'file',
label: '测试文件上传',
...inputFileFormItemCommonOptions(undefined, 1073741824),
useChunk: true,
startChunkApi: apiPost('${base}/upload/start'),
chunkApi: apiPost('${base}/upload/slice'),
finishChunkApi: apiPost('${base}/upload/finish')
}
type: 'action',
label: '新增数据资源',
icon: 'fa fa-plus',
...resourceAddDialog()
},
],
columns: [
{
label: '名称',
name: 'name',
width: 200,
...copyField(
'name',
'查看详情',
undefined,
resourceDetailDialog(),
)
},
{
label: '描述',
name: 'description',
},
{
label: '创建时间',
width: 150,
align: 'center',
type: 'tpl',
tpl: "${IF(createdTime, DATETOSTR(createdTime), '-')}"
},
{
label: '操作',
width: 200,
type: 'operation',
fixed: 'right',
className: 'nowrap',
buttons: []
},
]
}
]