HelpDoc.vue
4.75 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<template>
<Card title="帮助文档">
<div>
<template v-for="item in helpDoc" :key="item.title">
<AnchorLink v-bind="item" />
</template>
</div>
<Card
:tab-list="tabListTitle"
v-bind="$attrs"
:active-tab-key="activeKey"
:bordered="false"
@tabChange="onTabChange"
:bodyStyle="{ padding: 0 }"
>
<div v-if="activeKey === 'tab1'">
<List item-layout="horizontal" :data-source="data">
<template #renderItem="{ item }">
<ListItem>
<ListItemMeta :description="item.description">
<template #title>
<a href="https://www.antdv.com/">{{ item.title }}</a>
</template>
<template #avatar>
<Avatar :src="item.avatar" />
</template>
</ListItemMeta>
<template #extra> {{ item.date }} </template>
</ListItem>
</template>
</List>
</div>
<div v-else>222</div>
</Card>
<Card hoverable title="联系我们" :bordered="false">
<template #cover>
<img :src="getQrCode" alt="" style="width: 150px; height: 150px; margin: 50px auto" />
</template>
<CardMeta>
<template #description>
<p>联系人: {{ getContacts }}</p>
<p>联系电话: {{ getTel }}</p>
<p>联系地址: {{ getAddress }} </p>
</template>
</CardMeta>
</Card>
</Card>
</template>
<script lang="ts">
import { defineComponent, ref, computed, onMounted } from 'vue';
import { Card, AnchorLink, List, ListItem, ListItemMeta, Avatar, CardMeta } from 'ant-design-vue';
import { useUserStore } from '/@/store/modules/user';
import { getEnterPriseDetail } from '/@/api/oem';
export default defineComponent({
components: {
Card,
AnchorLink,
List,
ListItem,
ListItemMeta,
Avatar,
CardMeta,
},
setup() {
onMounted(async () => {
const res = await getEnterPriseDetail();
userStore.setEnterPriseInfo(res);
});
const helpDoc = ref([
{
title: '如何接入设备?',
href: '',
},
{
title: '什么是设备配置?',
href: '',
},
{
title: '云组态模板如何使用?',
href: '',
},
{
title: '查看全部>>',
href: '',
},
]);
const activeKey = ref('tab1');
const tabListTitle = [
{
key: 'tab1',
tab: '通知公告',
},
{
key: 'tab2',
tab: '系统公告',
},
];
const onTabChange = (key) => {
activeKey.value = key;
};
// 列表
interface DataItem {
title: string;
description: string;
avatar: string;
date: string;
}
const data: DataItem[] = [
{
title: '企业管理员',
description: '现在就来开创新的记录吧!',
avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
date: '5分钟前',
},
{
title: '企业管理员',
description: '有新的告警数据需要处理,现在去查看吧',
avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
date: '7小时前',
},
{
title: '管理员',
description: '有新的告警数据需要处理,现在去查看吧',
avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
date: '6小时前',
},
{
title: '管理员',
description: '现在就来开创新的记录吧!',
avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
date: '1小时前',
},
{
title: '管理员',
description: '现在就来开创新的记录吧!',
avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
date: '7小时前',
},
];
const userStore = useUserStore();
const getContacts = computed(() => {
return userStore.enterPriseInfo?.contacts;
});
const getAddress = computed(() => {
return userStore.enterPriseInfo?.address;
});
const getTel = computed(() => {
return userStore.enterPriseInfo?.tel;
});
const getQrCode = computed(() => {
return userStore.enterPriseInfo?.qrCode;
});
return {
activeKey,
tabListTitle,
onTabChange,
data,
helpDoc,
getQrCode,
getContacts,
getAddress,
getTel,
};
},
});
</script>
<style lang="less" scoped></style>