Files
fini-ui/src/views/login/modelComponents/Drawer.vue
T

233 lines
5.9 KiB
Vue
Raw Normal View History

2023-04-12 14:40:19 +08:00
<template>
2023-04-14 14:52:32 +08:00
<div class="wrapddd">
<div class="imgWrap22222">
2023-04-12 14:40:19 +08:00
<img src="@/assets/1x/1x/source8.png" alt="menu" >
</div>
<div class="nav">
<li :class="state == 1 && 'active'" @click="setState(1)" >
<img src="@/assets/1x/source10.png" alt="menu">
<span>Home</span>
</li>
<li :class="state == 2 && 'active'" @click="setState(2)">
<img src="@/assets/1x/source5.png" alt="menu">
<span>Dashboard</span>
</li>
<li :class="state == 3 && 'active'" class="IPO" @click="setState(3)">
<div class="ipoWrap">
<div>
<img src="@/assets/1x/source2.png" alt="menu">
<span>IPO Reference Data</span>
</div>
2023-04-28 14:33:16 +08:00
<!-- <div class="arrow" :style="{ transform: state == 3 ? 'rotateZ(90deg)' : 'rotateZ(-90deg)' }">
2023-04-12 14:40:19 +08:00
<img src="@/assets/1x/source11.png" alt="" class="icon">
2023-04-28 14:33:16 +08:00
</div> -->
2023-04-12 14:40:19 +08:00
</div>
2023-04-28 14:33:16 +08:00
<!-- <div class="report" v-if="state == 3">
2023-04-12 14:40:19 +08:00
<span>report</span>
<img src="@/assets/1x/source3.png" alt="">
2023-04-28 14:33:16 +08:00
</div> -->
2023-04-12 14:40:19 +08:00
</li>
<li :class="state == 4 && 'active'" @click="setState(4)">
<img src="@/assets/1x/source6.png" alt="menu">
<span>IPO Calendar</span>
</li>
<li :class="state == 5 && 'active'" @click="setState(5)" class="IPO">
<div class="ipoWrap">
<div>
<img src="@/assets/1x/1x/source6.png" alt="menu">
<span>Languages</span>
</div>
<div class="arrow" :style="{ transform: state == 5 ? 'rotateZ(90deg)' : 'rotateZ(-90deg)' }">
<img src="@/assets/1x/source11.png" alt="">
</div>
</div>
2023-04-17 16:01:46 +08:00
<div class="lang" v-if="state == 5" >
<li @click="handleLang1">English</li>
<li @click="handleLang2">繁體中文</li>
<li @click="handleLang3">简体中文</li>
2023-04-12 14:40:19 +08:00
</div>
</li>
</div>
</div>
</template>
<script lang="ts">
export default {
name: "drawer",
};
</script>
<script lang="ts" setup>
import { ref } from "vue"
2023-04-21 16:54:59 +08:00
import { getCurrentInstance, onUnmounted,inject } from 'vue'
2023-04-17 16:01:46 +08:00
import { ipoStore } from "@/stores/ipo"
2023-04-21 16:54:59 +08:00
import { useRouter } from "vue-router";
const route=useRouter()
2023-04-17 16:01:46 +08:00
const store = ipoStore()
2023-04-14 18:15:01 +08:00
const { proxy } = (getCurrentInstance() as any)
2023-04-19 17:41:10 +08:00
let emit = defineEmits(['childfn'])
2023-04-21 16:54:59 +08:00
const reflashRouter=inject('reflashRouter') as Function
const IpoReflash=()=>{
if(route.options.history.location=="/IPO"||route.options.history.location=="/home"){
reflashRouter()
}
}
2023-04-19 17:41:10 +08:00
const props = defineProps({
drawer:Boolean
})
let drawer = props.drawer
console.log(props);
2023-04-17 16:01:46 +08:00
2023-04-12 14:40:19 +08:00
const state = ref(1)
// const drawer = ref(true)
const setState = (number: number) => {
state.value = number;
2023-04-14 18:15:01 +08:00
if(number == 1){
proxy.$router.push("/home")
}
if(number == 2){
proxy.$router.push("/dashboard")
}
if(number == 3){
proxy.$router.push("/IPO")
}
if(number == 4){
proxy.$router.push("/IPOcalendar")
}
2023-04-12 14:40:19 +08:00
}
2023-04-17 16:01:46 +08:00
const handleLang1 = () => {
2023-04-19 17:41:10 +08:00
2023-04-17 16:01:46 +08:00
if (proxy.$i18n.locale = 'en') {
proxy.$i18n.locale = 'en'
}
store.setLocale(1)
2023-04-19 17:41:10 +08:00
emit('childfn',!drawer)
2023-04-21 16:54:59 +08:00
IpoReflash()
2023-04-17 16:01:46 +08:00
}
const handleLang2 = () => {
if (proxy.$i18n.locale = 'zhCt') {
proxy.$i18n.locale = 'zhCt'
2023-04-21 16:54:59 +08:00
IpoReflash()
2023-04-17 16:01:46 +08:00
}
store.setLocale(2)
2023-04-19 17:41:10 +08:00
emit('childfn',!drawer)
2023-04-21 16:54:59 +08:00
IpoReflash()
2023-04-17 16:01:46 +08:00
}
const handleLang3 = () => {
if (proxy.$i18n.locale = 'zhCn') {
proxy.$i18n.locale = 'zhCn'
}
store.setLocale(3)
2023-04-19 17:41:10 +08:00
emit('childfn',!drawer)
2023-04-21 16:54:59 +08:00
IpoReflash()
2023-04-17 16:01:46 +08:00
}
2023-04-19 17:41:10 +08:00
2023-04-12 14:40:19 +08:00
</script>
<style lang="scss" scoped>
2023-04-14 14:52:32 +08:00
.wrapddd {
2023-04-12 14:40:19 +08:00
width: 80vw;
2023-04-18 17:04:41 +08:00
transform: translateX(-20px);
2023-04-14 14:52:32 +08:00
display: flex;
flex-direction: column;
.imgWrap22222 {
2023-04-18 17:04:41 +08:00
margin-top: 20px;
width: 25px;
height: 20px;
margin-left: 15px;
2023-04-12 14:40:19 +08:00
img {
width: 100%;
height: 100%;
}
}
.nav {
height: fit-content;
2023-04-18 17:04:41 +08:00
margin-top: 20px;
2023-04-12 14:40:19 +08:00
width: 100%;
>li {
display: flex;
align-items: center;
justify-self: center;
2023-04-18 17:04:41 +08:00
min-height: 50px;
padding-left: 15px;
margin-top: 10px;
2023-04-12 14:40:19 +08:00
background-color: #B4C0C7;
&.active {
2023-04-17 16:01:46 +08:00
background-color: #fff
2023-04-12 14:40:19 +08:00
}
img {
2023-04-18 17:04:41 +08:00
width: 22px;
height: 22px;
2023-04-12 14:40:19 +08:00
}
span {
2023-04-18 17:04:41 +08:00
margin-left: 25px;
font-size: 20px;
2023-04-12 14:40:19 +08:00
font-weight: 700;
color: #1C3F56;
}
}
.IPO {
flex-direction: column;
justify-content: center;
height: fit-content;
.lang {
2023-04-18 17:04:41 +08:00
margin-left: -90px;
2023-04-12 14:40:19 +08:00
color: #1C3F56;
2023-04-18 17:04:41 +08:00
font-size: 18px;
2023-04-12 14:40:19 +08:00
>li {
2023-04-18 17:04:41 +08:00
line-height: 24px;
2023-04-12 14:40:19 +08:00
}
}
.report {
2023-04-18 17:04:41 +08:00
margin-left: -120px;
2023-04-12 14:40:19 +08:00
span {
2023-04-18 17:04:41 +08:00
margin-right: 10px;
2023-04-12 14:40:19 +08:00
}
}
.ipoWrap {
display: flex;
justify-content: space-between;
align-items: center;
width: 100%;
.arrow {
2023-04-18 17:04:41 +08:00
width: 12px;
height: 19px;
margin-right: 14px;
2023-04-12 14:40:19 +08:00
img {
width: 100%;
height: 100%;
}
}
}
span {
display: inline-block;
2023-04-18 17:04:41 +08:00
transform: translateY(-3px);
2023-04-12 14:40:19 +08:00
}
}
}
2023-04-17 16:01:46 +08:00
2023-04-12 14:40:19 +08:00
}
</style>