1
1
<template >
2
2
<span @click.stop >
3
3
<el-popover v-if =" render" :visible =" visible" placement =" bottom" width =" 298px"
4
- popper-class =" max-h-300px overflow-auto" @show =" pop_show" @hide =" pop_hide" popper-style =" z-index:888;"
5
- :show-after =" 0" :hide-after =" 0" >
4
+ popper-class =" max-h-300px overflow-auto" @show =" pop_show" @hide =" pop_hide" popper-style =" z-index:888;" >
6
5
<div >
7
6
<div style =" width : 80px ;float : left ;line-height : 200% ;" >
8
7
<el-image style =" width : 72px ; height : 72px ;margin-top : 10px ;border-radius : 8px ;" :src =" image_url"
33
32
34
33
</div >
35
34
<template #reference >
36
- <span href =" " target =" _blank" class =" clickable" @click =" visible = !visible" >{{ data.user_name }}
37
- </span >
35
+ <el-link :underline =" false" @click =" visible = !visible" >{{ data.user_name }}</el-link >
38
36
</template >
39
37
</el-popover >
40
- <span v-else href =" " target =" _blank" class =" clickable" @click =" render = true; visible = true" >{{ data.user_name
41
- }}
42
- </span >
38
+ <el-link v-else :underline =" false" @click =" render = true; visible = true" >{{ data.user_name }}</el-link >
43
39
</span >
44
40
</template >
45
41
46
42
<script setup lang="ts" name="PlayerName">
47
43
// 用户的名字,鼠标移上去以后弹出气泡框,可以访问他的主页
48
- import { onMounted , watch , ref , toRefs } from " vue" ;
49
- import { getCurrentInstance } from ' vue' ;
44
+ import { ref } from " vue" ;
50
45
import useCurrentInstance from " @/utils/common/useCurrentInstance" ;
51
46
const { proxy } = useCurrentInstance ();
52
- import { genFileId , ElMessage } from ' element-plus'
53
47
import image_url_default from ' @/assets/person.png' ;
54
48
const image_url = ref (image_url_default );
55
49
// import PreviewDownload from '@/components/PreviewDownload.vue';
56
50
import PreviewNumber from ' @/components/PreviewNumber.vue' ;
57
51
import { useRouter } from ' vue-router'
58
- import { ms_to_s } from " @/utils"
52
+ import { ms_to_s , to_fixed_n } from " @/utils"
59
53
const router = useRouter ()
60
54
import { useUserStore } from ' ../store'
61
55
const store = useUserStore ()
@@ -72,6 +66,7 @@ const data = defineProps({
72
66
73
67
const render = ref <Boolean >(false );
74
68
const visible = ref <Boolean >(false );
69
+ const is_loading = ref (true );
75
70
76
71
const realname = ref (" " );
77
72
const id = ref (" " );
@@ -88,10 +83,6 @@ const e_bvs = ref("");
88
83
const e_t_id = ref (" " );
89
84
const e_bvs_id = ref (" " );
90
85
91
- // 控制加载时的小圈圈
92
- const is_loading = ref (true );
93
-
94
-
95
86
const pop_show = async () => {
96
87
is_loading .value = true ;
97
88
@@ -138,7 +129,6 @@ const pop_show = async () => {
138
129
139
130
}
140
131
141
-
142
132
// 用户记录小弹窗关闭后,删除其中的数据
143
133
const pop_hide = () => {
144
134
image_url .value = image_url_default ;
@@ -159,20 +149,6 @@ const pop_hide = () => {
159
149
is_loading .value = true ;
160
150
}
161
151
162
- function to_fixed_n(input : string | number | undefined , to_fixed : number ): string | number | undefined {
163
- // 返回保留to_fixed位小数的字符串,四舍六入五取双
164
- if (input === undefined ) {
165
- return input ;
166
- }
167
- if (to_fixed <= 0 ) {
168
- return input ;
169
- }
170
- if (typeof (input ) == " string" ) {
171
- return parseFloat (input ).toFixed (to_fixed );
172
- }
173
- return (input as number ).toFixed (to_fixed );
174
- }
175
-
176
152
const visit_me = (user_id : Number ) => {
177
153
// proxy.$store.commit('updatePlayer', { "id": id.value, "realname":realname.value });
178
154
// localStorage.setItem("player", JSON.stringify({ "id": id.value, "realname":realname.value }));
@@ -183,9 +159,4 @@ const visit_me = (user_id: Number) => {
183
159
184
160
</script >
185
161
186
- <style lang="less" scoped>
187
- .clickable :hover {
188
- color : rgb (26 , 127 , 228 );
189
- cursor : pointer ;
190
- }
191
- </style >
162
+ <style lang="less" scoped></style >
0 commit comments