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

356 lines
9.3 KiB
Vue
Raw Normal View History

2023-04-12 14:40:19 +08:00
<template>
2023-06-16 16:02:24 +08:00
<div class="wrapddd">
2023-04-14 14:52:32 +08:00
<div class="imgWrap22222">
2023-06-16 16:02:24 +08:00
<img src="@/assets/1x/1x/source8.png" alt="menu">
<h4 v-if="data != null && store.$state.mobileActiveShow != 1">{{ store.$state.locale == 1 ?
data.title.split(";")[0] : data.title.split(";")[1] }}
</h4>
2023-04-12 14:40:19 +08:00
</div>
<div class="nav">
2023-06-16 16:02:24 +08:00
<li :class="store.$state.mobileActiveShow == 1 && 'active'" @click="setState(1)">
2023-04-12 14:40:19 +08:00
<img src="@/assets/1x/source10.png" alt="menu">
2023-06-16 16:02:24 +08:00
<span>{{ $t(i18n.global.t('dashboard.Home')) }}</span>
2023-04-12 14:40:19 +08:00
</li>
2023-06-16 16:02:24 +08:00
<li :class="store.$state.mobileActiveShow == 2 && 'active'" @click="setState(2)">
2023-04-12 14:40:19 +08:00
<img src="@/assets/1x/source5.png" alt="menu">
2023-06-16 16:02:24 +08:00
<span>{{ $t(i18n.global.t('dashboard.Dashboard')) }}</span>
2023-04-12 14:40:19 +08:00
</li>
2023-06-16 16:02:24 +08:00
<li :class="store.$state.mobileActiveShow == 3 && 'active'" @click="setState(3)">
<!-- <div class="ipoWrap">
2023-04-12 14:40:19 +08:00
<div>
2023-06-16 16:02:24 +08:00
2023-04-12 14:40:19 +08:00
</div>
2023-06-16 16:02:24 +08:00
2023-04-28 14:33:16 +08:00
</div> -->
2023-06-16 16:02:24 +08:00
<img src="@/assets/1x/source2.png" alt="menu">
<span>{{ $t(i18n.global.t('dashboard.IPOReferenceData')) }}</span>
2023-04-12 14:40:19 +08:00
</li>
2023-06-16 16:02:24 +08:00
<li :class="store.$state.mobileActiveShow == 4 && 'active'" @click="setState(4)">
2023-04-12 14:40:19 +08:00
<img src="@/assets/1x/source6.png" alt="menu">
2023-06-16 15:53:06 +08:00
<span>{{ $t(i18n.global.t('home.IPOcalendar')) }}</span>
2023-06-16 16:02:24 +08:00
2023-04-12 14:40:19 +08:00
</li>
2023-06-16 16:02:24 +08:00
<li :class="store.$state.mobileActiveShow == 5 && 'active'" @click="setState2(5)" class="IPO">
2023-04-12 14:40:19 +08:00
<div class="ipoWrap">
2023-06-16 16:02:24 +08:00
<div class="icon">
2023-04-12 14:40:19 +08:00
<img src="@/assets/1x/1x/source6.png" alt="menu">
2023-06-16 15:53:06 +08:00
<span>{{ $t(i18n.global.t('home.Languages')) }}</span>
2023-04-12 14:40:19 +08:00
</div>
2023-06-16 16:02:24 +08:00
<div class="arrow" :style="{
transform: store.$state.mobileActiveShow == 5 && showalanguge ? 'rotateZ(90deg)' : 'rotateZ(-90deg)', marginRight: store.$state.mobileActiveShow == 5 && showalanguge ? '10px' : '28px'
}
">
<img src="@/assets/1x/source14.png" alt="">
2023-04-12 14:40:19 +08:00
</div>
</div>
2023-06-16 16:02:24 +08:00
<div class="lang" v-if="store.$state.mobileActiveShow == 5 && showalanguge">
<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>
2023-06-16 16:02:24 +08:00
2023-04-12 14:40:19 +08:00
</template>
<script lang="ts">
export default {
name: "drawer",
};
</script>
<script lang="ts" setup>
2023-06-16 16:02:24 +08:00
import { 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";
2023-06-16 16:02:24 +08:00
//import calendar from '@/views/IpoCalendar/index.vue'
import { ElMessageBox } from 'element-plus'
import { ref, onMounted, onUnmounted, watch } from 'vue';
import moment from "moment"
2023-06-16 15:53:06 +08:00
import i18n from '@/locales'
2023-06-16 16:02:24 +08:00
import { getCurrentInstance } from 'vue'
import Event from '@/views/login/components/Event.vue';
import { getEventData, getSearchListing, getDate } from "@/api/reqIpo/ipo";
import { getDataFromId } from "@/api/mock/home"
2023-04-14 18:15:01 +08:00
const { proxy } = (getCurrentInstance() as any)
2023-06-16 16:02:24 +08:00
const dayValue = ref(new Date())
const calendar = ref()
const handleDrawer = (done: () => void) => {
done();
}
//const Eventdata = ref([])
const selectDate = (val: string) => {
calendar.value.selectDate(val)
}
const dayTime = ref()
const getcalendar = async () => {
const res = await getDate()
dayTime.value = (res as any).data
console.log(dayTime.value);
}
const showMounth = (date: any) => {
const arr = date.split(" ")
if (arr.length == 3) {
return arr[2]
} else if (arr.length == 4) {
return arr[2] + " " + arr[3]
2023-04-21 16:54:59 +08:00
}
}
2023-04-19 17:41:10 +08:00
2023-06-16 16:02:24 +08:00
const drawer2 = ref(false)
const radio1 = ref('Option 1')
const handleClose = (done: () => void) => {
done()
}
//const drawer1 = ref(false)
const setState = (number: number) => {
store.setMobileActiveShow(number)
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")
store.setMobileActiveShow(1)
// emit('childfn', !drawer1)
// emit('childfn', !drawer)
// drawer1.value = true
// console.log(drawer1.value);
}
setTimeout(() => {
handleOnDrwaer(false)
})
}
//console.log(drawer1.value);
const dialogVisible = ref(true)
const route = useRouter()
const store = ipoStore()
const showalanguge = ref(false)
//const { proxy } = (getCurrentInstance() as any)
let emit = defineEmits(['childfn'])
//let emit1 = defineEmits(['childfn1'])
const reflashRouter = inject('reflashRouter') as Function
const handleOnDrwaer = inject('handleOnDrwaer') as Function
const props = defineProps({
drawer: Boolean,
drawer1:Boolean
})
const data = ref()
onMounted(
() => {
// data.value = JSON.parse(localStorage.getItem('itemData') as string)
const obj = JSON.parse(sessionStorage.getItem('itemData') as string);
data.value = obj
// console.log(data.value);
// text();
}
)
2023-04-19 17:41:10 +08:00
let drawer = props.drawer
2023-06-16 16:02:24 +08:00
let drawer1 = props.drawer1
//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)
2023-06-16 16:02:24 +08:00
const setState2 = (number: number) => {
store.setMobileActiveShow(number)
showalanguge.value = !showalanguge.value
2023-04-12 14:40:19 +08:00
}
2023-04-17 16:01:46 +08:00
const handleLang1 = () => {
2023-06-16 16:02:24 +08:00
2023-04-17 16:01:46 +08:00
if (proxy.$i18n.locale = 'en') {
proxy.$i18n.locale = 'en'
}
store.setLocale(1)
2023-06-16 16:02:24 +08:00
emit('childfn', !drawer)
// IpoReflash()
2023-04-17 16:01:46 +08:00
}
const handleLang2 = () => {
if (proxy.$i18n.locale = 'zhCt') {
proxy.$i18n.locale = 'zhCt'
2023-06-16 16:02:24 +08:00
// IpoReflash()
2023-04-17 16:01:46 +08:00
}
store.setLocale(2)
2023-06-16 16:02:24 +08:00
emit('childfn', !drawer)
/// IpoReflash()
2023-04-17 16:01:46 +08:00
}
const handleLang3 = () => {
if (proxy.$i18n.locale = 'zhCn') {
proxy.$i18n.locale = 'zhCn'
}
store.setLocale(3)
2023-06-16 16:02:24 +08:00
emit('childfn', !drawer)
// 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;
2023-06-16 16:02:24 +08:00
2023-04-14 14:52:32 +08:00
.imgWrap22222 {
2023-04-18 17:04:41 +08:00
margin-top: 20px;
2023-06-16 16:02:24 +08:00
width: fit-content;
2023-04-18 17:04:41 +08:00
height: 20px;
2023-06-16 16:02:24 +08:00
margin-left: 15px;
display: flex;
justify-content: center;
align-items: center;
// background-color: black;
2023-04-12 14:40:19 +08:00
img {
2023-06-16 16:02:24 +08:00
width: 25px;
height: 20px;
}
h4 {
font-size: 18px;
margin-left: 10px;
color: #fff;
font-weight: 400;
2023-04-12 14:40:19 +08:00
}
}
.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-06-16 16:02:24 +08:00
// background-color: red;
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;
2023-06-16 16:02:24 +08:00
display: block;
line-height: 50px;
padding-top: 6px;
2023-04-12 14:40:19 +08:00
}
}
.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%;
2023-06-16 16:02:24 +08:00
.icon {
min-height: 50px;
display: flex;
align-items: center;
justify-self: center;
img {
width: 22px;
height: 22px;
}
span {
margin-left: 25px;
font-size: 20px;
font-weight: 700;
color: #1C3F56;
display: block;
line-height: 50px;
padding: 0;
vertical-align: bottom;
}
}
2023-04-12 14:40:19 +08:00
.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-06-16 16:02:24 +08:00
// transform: translateY(-3px);
2023-04-12 14:40:19 +08:00
}
2023-06-16 16:02:24 +08:00
2023-04-12 14:40:19 +08:00
}
}
2023-06-16 16:02:24 +08:00
2023-04-12 14:40:19 +08:00
}
2023-06-16 16:02:24 +08:00
</style>
<style>
/* .el-drawer__body{
padding: 0
} */
2023-04-12 14:40:19 +08:00
</style>