index.vue
1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<template>
<div class="p-4 md:flex">
<div class="md:w-7/10 w-full !mr-4 enter-y">
<GrowCard :loading="loading" class="enter-y" :role="role" />
<SiteAnalysis class="!my-4 enter-y" :loading="loading" :role="role" />
<div class="md:flex enter-y" v-if="!isAdmin(role)">
<Card title="核心流程指南" style="width: 100%">
<img alt="核心流程指南" src="/src/assets/images/flow.png" />
</Card>
</div>
</div>
<div class="md:w-3/10 w-full enter-y">
<HelpDoc :role="role" ref="helpDocRef" />
</div>
</div>
</template>
<script lang="ts" setup>
import { ref, defineExpose } from 'vue';
import GrowCard from './components/GrowCard.vue';
import SiteAnalysis from './components/SiteAnalysis.vue';
import { Card } from 'ant-design-vue';
import HelpDoc from './components/HelpDoc.vue';
import { USER_INFO_KEY } from '/@/enums/cacheEnum';
import { getAuthCache } from '/@/utils/auth';
import { isAdmin } from '/@/enums/roleEnum';
defineExpose({
isAdmin,
});
const userInfo: any = getAuthCache(USER_INFO_KEY);
const role = userInfo.roles[0];
console.log(role);
const loading = ref(true);
const helpDocRef = ref();
setTimeout(() => {
loading.value = false;
}, 1500);
window.addEventListener(
'scroll',
() => {
const scrollBottom =
document.body.scrollHeight - document.body.scrollTop - document.body.clientHeight;
if (scrollBottom <= 0) {
helpDocRef.value.redoHeight();
}
},
true
);
</script>