|
|
@@ -2,8 +2,7 @@
|
|
|
<Dropdown trigger="click">
|
|
|
<template #overlay>
|
|
|
<Menu @click="handleMenuClick">
|
|
|
- <MenuItem key="采空区密闭分析">采空区密闭分析</MenuItem>
|
|
|
- <MenuItem key="采空区密闭监测">采空区密闭监测</MenuItem>
|
|
|
+ <MenuItem v-for="(title, key) in OPTIONS" :key="key">{{ title }}</MenuItem>
|
|
|
</Menu>
|
|
|
</template>
|
|
|
<Button :class="prefixCls" type="primary">
|
|
|
@@ -17,14 +16,31 @@
|
|
|
import { Button, Dropdown, Menu, MenuItem } from 'ant-design-vue';
|
|
|
import { DownOutlined } from '@ant-design/icons-vue';
|
|
|
import { useDesign } from '/@/hooks/web/useDesign';
|
|
|
- import { ref } from 'vue';
|
|
|
+ import { onMounted, ref } from 'vue';
|
|
|
+ import { PageEnum } from '/@/enums/pageEnum';
|
|
|
+ import { useRouter } from 'vue-router';
|
|
|
+ import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
|
|
|
const { prefixCls } = useDesign('system-select');
|
|
|
- const text = ref('采空区密闭分析');
|
|
|
+ const router = useRouter();
|
|
|
+ const { t } = useI18n();
|
|
|
+ const text = ref('');
|
|
|
|
|
|
function handleMenuClick({ key }) {
|
|
|
- text.value = key;
|
|
|
+ text.value = OPTIONS.value[key];
|
|
|
+ router.push({ path: key });
|
|
|
}
|
|
|
+
|
|
|
+ const OPTIONS = ref({
|
|
|
+ [PageEnum.BASE_HOME]: t('routes.basic.baseHome'),
|
|
|
+ [PageEnum.SECONDARY_HOME]: t('routes.basic.secondaryHome'),
|
|
|
+ });
|
|
|
+
|
|
|
+ onMounted(() => {
|
|
|
+ text.value = OPTIONS.value[router.currentRoute.value.path];
|
|
|
+ });
|
|
|
+
|
|
|
+ defineExpose({ OPTIONS, prefixCls, handleMenuClick });
|
|
|
</script>
|
|
|
<style lang="less" scoped>
|
|
|
@prefix-cls: ~'@{namespace}-system-select';
|
|
|
@@ -34,7 +50,7 @@
|
|
|
margin-top: 10px;
|
|
|
width: 210px;
|
|
|
position: relative;
|
|
|
- z-index: 2;
|
|
|
+ z-index: @layout-basic-z-index;
|
|
|
|
|
|
// :deep(.ant-select-selector) {
|
|
|
// background-color: @primary-color;
|