85 lines
2.2 KiB
JavaScript
85 lines
2.2 KiB
JavaScript
import {apiGet, crudCommonOptions} from "../../components/constants.js";
|
|
import {authenticationAddDialog} from "../../components/permission/dialog-permission.js";
|
|
|
|
export function tabMarket() {
|
|
return {
|
|
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',
|
|
columnsCount: 3,
|
|
card: {
|
|
header: {
|
|
title: '${name}',
|
|
subTitle: '${createdTime}',
|
|
avatar: '${icon}',
|
|
avatarClassName: 'pull-left thumb-md avatar b-3x m-r'
|
|
},
|
|
body: '${TRUNCATE(description, 50)}',
|
|
actions: [
|
|
{
|
|
type: 'action',
|
|
label: '查看',
|
|
actionType: 'dialog',
|
|
dialog: {
|
|
title: '数据产品详情',
|
|
size: 'md',
|
|
actions: [],
|
|
body: {
|
|
type: 'service',
|
|
api: apiGet(`\${base}/ware/detail/\${id}`),
|
|
body: [
|
|
{
|
|
type: 'property',
|
|
title: '产品信息',
|
|
items: [
|
|
{
|
|
label: '名称',
|
|
content: '${name}',
|
|
},
|
|
{
|
|
label: '归属',
|
|
content: '${createdUsername}',
|
|
},
|
|
{
|
|
label: '创建时间',
|
|
content: '${createdTime}',
|
|
},
|
|
{
|
|
span: 3,
|
|
label: '描述',
|
|
content: '${description}',
|
|
},
|
|
]
|
|
},
|
|
{
|
|
type: 'tpl',
|
|
tpl: '${content|raw}'
|
|
}
|
|
]
|
|
}
|
|
}
|
|
},
|
|
{
|
|
type: 'action',
|
|
label: '申请授权',
|
|
...authenticationAddDialog(),
|
|
}
|
|
]
|
|
}
|
|
}
|
|
} |