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,10 +1,9 @@
import {apiGet, useAmis} from '../../components/constants.js'
import {userChangePasswordDialog} from "../../components/user/dialog-user-change-password.js";
import {tabUser} from "./tab-user.js";
import {tabOverview} from "./tab-overview.js";
import {tabMarket} from "./tab-market.js";
import {tabData} from "./tab-data.js";
import {tabLog} from "./tab-log.js";
import {tabSettings} from "./tab-settings.js";
useAmis(information => {
return {
@@ -61,7 +60,7 @@ useAmis(information => {
// tabOverview(),
tabMarket(),
tabUser(),
tabLog(),
tabSettings(),
]
},
}

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: []
},
]
}
]

View File

@@ -1,8 +1,8 @@
export function tabLog() {
export function tabSettings() {
return {
visibleOn: '${role === "ADMINISTRATOR"}',
title: '系统日志',
icon: 'fa fa-file',
title: '系统管理',
icon: 'fa fa-gear',
body: [
'hello world'
]