|
|
@ -3,13 +3,13 @@ |
|
|
|
* contributor license agreements. See the NOTICE file distributed with |
|
|
|
* contributor license agreements. See the NOTICE file distributed with |
|
|
|
* this work for additional information regarding copyright ownership. |
|
|
|
* this work for additional information regarding copyright ownership. |
|
|
|
* The ASF licenses this file to You under the Apache License, Version 2.0 |
|
|
|
* The ASF licenses this file to You under the Apache License, Version 2.0 |
|
|
|
* (the 'License'); you may not use this file except in compliance with |
|
|
|
* (the "License"); you may not use this file except in compliance with |
|
|
|
* the License. You may obtain a copy of the License at |
|
|
|
* the License. You may obtain a copy of the License at |
|
|
|
* |
|
|
|
* |
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
* |
|
|
|
* |
|
|
|
* Unless required by applicable law or agreed to in writing, software |
|
|
|
* Unless required by applicable law or agreed to in writing, software |
|
|
|
* distributed under the License is distributed on an 'AS IS' BASIS, |
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, |
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
|
|
* See the License for the specific language governing permissions and |
|
|
|
* See the License for the specific language governing permissions and |
|
|
|
* limitations under the License. |
|
|
|
* limitations under the License. |
|
|
@ -51,7 +51,46 @@ export function useDataList() { |
|
|
|
return () => h(NIcon, null, { default: () => h(icon) }) |
|
|
|
return () => h(NIcon, null, { default: () => h(icon) }) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const menuOptions = [ |
|
|
|
const languageOptions = [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: 'English', |
|
|
|
|
|
|
|
key: 'en_US', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: '中文', |
|
|
|
|
|
|
|
key: 'zh_CN', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const userDropdownOptions = [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: t('userDropdown.profile'), |
|
|
|
|
|
|
|
key: 'profile', |
|
|
|
|
|
|
|
icon: renderIcon(UserOutlined), |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: t('userDropdown.password'), |
|
|
|
|
|
|
|
key: 'password', |
|
|
|
|
|
|
|
icon: renderIcon(KeyOutlined), |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: t('userDropdown.logout'), |
|
|
|
|
|
|
|
key: 'logout', |
|
|
|
|
|
|
|
icon: renderIcon(LogoutOutlined), |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const state = reactive({ |
|
|
|
|
|
|
|
isShowSide: false, |
|
|
|
|
|
|
|
languageOptions, |
|
|
|
|
|
|
|
userDropdownOptions, |
|
|
|
|
|
|
|
menuOptions: [], |
|
|
|
|
|
|
|
headerMenuOptions: [], |
|
|
|
|
|
|
|
sideMenuOptions: [] |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const changeMenuOption = (state: any) => { |
|
|
|
|
|
|
|
state.menuOptions = [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
label: t('menu.home'), |
|
|
|
label: t('menu.home'), |
|
|
|
key: 'home', |
|
|
|
key: 'home', |
|
|
@ -214,39 +253,10 @@ export function useDataList() { |
|
|
|
], |
|
|
|
], |
|
|
|
}, |
|
|
|
}, |
|
|
|
] |
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const languageOptions = [ |
|
|
|
const changeHeaderMenuOptions = (state: any) => { |
|
|
|
{ |
|
|
|
state.headerMenuOptions = state.menuOptions.map( |
|
|
|
label: 'English', |
|
|
|
|
|
|
|
key: 'en_US', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: '中文', |
|
|
|
|
|
|
|
key: 'zh_CN', |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const userDropdownOptions = [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: t('userDropdown.profile'), |
|
|
|
|
|
|
|
key: 'profile', |
|
|
|
|
|
|
|
icon: renderIcon(UserOutlined), |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: t('userDropdown.password'), |
|
|
|
|
|
|
|
key: 'password', |
|
|
|
|
|
|
|
icon: renderIcon(KeyOutlined), |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
label: t('userDropdown.logout'), |
|
|
|
|
|
|
|
key: 'logout', |
|
|
|
|
|
|
|
icon: renderIcon(LogoutOutlined), |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const getHeaderMenuOptions = (MenuOptions: any) => { |
|
|
|
|
|
|
|
let headerMenuOptions = [] |
|
|
|
|
|
|
|
headerMenuOptions = MenuOptions.map( |
|
|
|
|
|
|
|
(item: { label: string; key: string; icon: any }) => { |
|
|
|
(item: { label: string; key: string; icon: any }) => { |
|
|
|
return { |
|
|
|
return { |
|
|
|
label: item.label, |
|
|
|
label: item.label, |
|
|
@ -255,18 +265,11 @@ export function useDataList() { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
return headerMenuOptions |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const state = reactive({ |
|
|
|
|
|
|
|
isShowSide: false, |
|
|
|
|
|
|
|
menuOptions, |
|
|
|
|
|
|
|
languageOptions, |
|
|
|
|
|
|
|
userDropdownOptions, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
|
state, |
|
|
|
state, |
|
|
|
getHeaderMenuOptions, |
|
|
|
changeHeaderMenuOptions, |
|
|
|
|
|
|
|
changeMenuOption |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|