1
0
Files
gringotts/gringotts-frontend/pages/index/main.js

70 lines
2.3 KiB
JavaScript

import {apiGet, useAmis} from '../../components/constants.js'
import {userChangePasswordDialog} from "../../components/user/dialog-user-change-password.js";
import {tabUser} from "./tab-user.js";
import {tabMarket} from "./tab-market.js";
import {tabData} from "./tab-data.js";
import {tabSettings} from "./tab-settings.js";
useAmis(information => {
return {
id: 'header-service',
className: 'h-full',
type: 'service',
api: apiGet('${base}/user/state'),
onEvent: {
fetchInited: {
actions: [
{
expression: '${!event.data.responseData.token}',
actionType: 'url',
args: {
url: '/pages/login/index.html',
blank: false,
}
}
]
}
},
body: [
{
type: 'page',
title: information.title,
subTitle: '提供合法合规的数据要素可信供给工具',
toolbar: [
{
type: 'dropdown-button',
label: '${username}',
align: 'right',
trigger: 'hover',
buttons: [
{
label: '修改密码',
...userChangePasswordDialog(),
},
{
label: '退出登陆',
actionType: 'ajax',
api: apiGet('${base}/user/logout'),
reload: 'header-service',
}
]
}
],
bodyClassName: 'p-0',
body: {
className: 'h-full border-0',
type: 'tabs',
tabsMode: 'vertical',
tabs: [
tabData(),
// tabOverview(),
tabMarket(),
tabUser(),
tabSettings(),
]
},
}
]
}
})