1
0
Files
gringotts/gringotts-frontend/pages/index/tab-market.js
lanyuanxiaoyao 43e9306017 refactor(web): 将权限对话框按类型拆分为独立文件- 将 dialog-permission.js拆分为 dialog-confirmation.js 和 dialog-authentication.js
- 更新 resourceList 函数以支持 showMode 参数
- 调整 tab-data.js 和 tab-market.js 以适应新的对话框结构
2024-12-18 16:26:36 +08:00

52 lines
1.3 KiB
JavaScript

import {wareDetailDialog} from "../../components/ware/dialog-ware.js";
import {apiGet, crudCommonOptions} from "../../components/constants.js";
import {authenticationAddDialog} from "../../components/permission/dialog-permission.js";
export function tabMarket() {
return {
title: '数据市场',
icon: 'fa fa-store',
reload: true,
body: {
type: 'crud',
api: {
...apiGet('${base}/ware/list_public'),
adaptor: (payload, response, api, context) => {
payload.data = payload.data.map(i => {
return {
...i,
targetId: i.resourceId,
}
})
return payload
}
},
...crudCommonOptions(),
headerToolbar: [
'reload',
],
mode: 'cards',
card: {
header: {
title: '${name}',
subTitle: '${createdTime}',
description: '${description}',
avatar: '${icon}',
avatarClassName: 'pull-left thumb-md avatar b-3x m-r'
},
actions: [
{
type: 'action',
label: '查看',
...wareDetailDialog(),
},
{
type: 'action',
label: '申请授权',
...authenticationAddDialog(),
}
]
},
}
}
}