Skip to content

Commit

Permalink
Merge pull request eee555#63 from putianyi889/patch-48
Browse files Browse the repository at this point in the history
`clickable` style 改成 `el-link`
  • Loading branch information
eee555 authored Jul 17, 2024
2 parents bb5e552 + 5dd16c3 commit caa7408
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 52 deletions.
43 changes: 7 additions & 36 deletions front_end/src/components/PlayerName.vue
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<template>
<span @click.stop>
<el-popover v-if="render" :visible="visible" placement="bottom" width="298px"
popper-class="max-h-300px overflow-auto" @show="pop_show" @hide="pop_hide" popper-style="z-index:888;"
:show-after="0" :hide-after="0">
popper-class="max-h-300px overflow-auto" @show="pop_show" @hide="pop_hide" popper-style="z-index:888;">
<div>
<div style="width: 80px;float: left;line-height: 200%;">
<el-image style="width: 72px; height: 72px;margin-top: 10px;border-radius: 8px;" :src="image_url"
Expand Down Expand Up @@ -33,29 +32,24 @@

</div>
<template #reference>
<span href="" target="_blank" class="clickable" @click="visible = !visible">{{ data.user_name }}
</span>
<el-link :underline="false" @click="visible = !visible">{{ data.user_name }}</el-link>
</template>
</el-popover>
<span v-else href="" target="_blank" class="clickable" @click="render = true; visible = true">{{ data.user_name
}}
</span>
<el-link v-else :underline="false" @click="render = true; visible = true">{{ data.user_name }}</el-link>
</span>
</template>

<script setup lang="ts" name="PlayerName">
// 用户的名字,鼠标移上去以后弹出气泡框,可以访问他的主页
import { onMounted, watch, ref, toRefs } from "vue";
import { getCurrentInstance } from 'vue';
import { ref } from "vue";
import useCurrentInstance from "@/utils/common/useCurrentInstance";
const { proxy } = useCurrentInstance();
import { genFileId, ElMessage } from 'element-plus'
import image_url_default from '@/assets/person.png';
const image_url = ref(image_url_default);
// import PreviewDownload from '@/components/PreviewDownload.vue';
import PreviewNumber from '@/components/PreviewNumber.vue';
import { useRouter } from 'vue-router'
import { ms_to_s } from "@/utils"
import { ms_to_s, to_fixed_n } from "@/utils"
const router = useRouter()
import { useUserStore } from '../store'
const store = useUserStore()
Expand All @@ -72,6 +66,7 @@ const data = defineProps({
const render = ref<Boolean>(false);
const visible = ref<Boolean>(false);
const is_loading = ref(true);
const realname = ref("");
const id = ref("");
Expand All @@ -88,10 +83,6 @@ const e_bvs = ref("");
const e_t_id = ref("");
const e_bvs_id = ref("");
// 控制加载时的小圈圈
const is_loading = ref(true);
const pop_show = async () => {
is_loading.value = true;
Expand Down Expand Up @@ -138,7 +129,6 @@ const pop_show = async () => {
}
// 用户记录小弹窗关闭后,删除其中的数据
const pop_hide = () => {
image_url.value = image_url_default;
Expand All @@ -159,20 +149,6 @@ const pop_hide = () => {
is_loading.value = true;
}
function to_fixed_n(input: string | number | undefined, to_fixed: number): string | number | undefined {
// 返回保留to_fixed位小数的字符串,四舍六入五取双
if (input === undefined) {
return input;
}
if (to_fixed <= 0) {
return input;
}
if (typeof (input) == "string") {
return parseFloat(input).toFixed(to_fixed);
}
return (input as number).toFixed(to_fixed);
}
const visit_me = (user_id: Number) => {
// proxy.$store.commit('updatePlayer', { "id": id.value, "realname":realname.value });
// localStorage.setItem("player", JSON.stringify({ "id": id.value, "realname":realname.value }));
Expand All @@ -183,9 +159,4 @@ const visit_me = (user_id: Number) => {
</script>

<style lang="less" scoped>
.clickable:hover {
color: rgb(26, 127, 228);
cursor: pointer;
}
</style>
<style lang="less" scoped></style>
21 changes: 7 additions & 14 deletions front_end/src/components/PreviewNumber.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
<template>
<Teleport to=".common-layout">
<el-dialog v-if="preview_visible" v-model="preview_visible"
style="backdrop-filter: blur(1px);" draggable align-center
destroy-on-close :modal="false" :lock-scroll="false">
<iframe class="flop-player-iframe flop-player-display-none"
style="width: 100%; height: 500px; border: 0px" src="/flop/index.html" ref="video_iframe"></iframe>
<el-dialog v-if="preview_visible" v-model="preview_visible" style="backdrop-filter: blur(1px);" draggable
align-center destroy-on-close :modal="false" :lock-scroll="false">
<iframe class="flop-player-iframe flop-player-display-none" style="width: 100%; height: 500px; border: 0px"
src="/flop/index.html" ref="video_iframe"></iframe>
</el-dialog>
</Teleport>
<span v-if="data.id" @click="preview(data.id);" class="clickable">{{ data.text }}</span>
<el-link v-if="data.id" :underline="false" @click="preview(data.id);" class="clickable">{{ data.text }}</el-link>
<span v-else>--</span>
</template>

<script setup lang="ts" name="PreviewNumber">
// 某个数字或字符串,点击后预览
import { onMounted, watch, ref, toRefs } from "vue";
import { ref } from "vue";
import useCurrentInstance from "@/utils/common/useCurrentInstance";
import { generalNotification } from "@/utils/system/status";
import { useI18n } from "vue-i18n";
Expand All @@ -31,7 +30,6 @@ const data = defineProps({
})
const preview = (id: Number | undefined) => {
if (!id) {
return
Expand Down Expand Up @@ -89,9 +87,4 @@ const playVideo = function (uri: string) {
</script>

<style lang="less" scoped>
.clickable:hover {
color: rgb(26, 127, 228);
cursor: pointer;
}
</style>
<style lang="less" scoped></style>
3 changes: 1 addition & 2 deletions front_end/src/components/VideoList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@
<script setup lang="ts">
// 录像列表的组件
import { ref, watch, computed } from 'vue'
import { ref, computed } from 'vue'
import { utc_to_local_format } from "@/utils/system/tools";
import PlayerName from '@/components/PlayerName.vue';
const preview_visible = ref(false);
import useCurrentInstance from "@/utils/common/useCurrentInstance";
import { getRowIdentity } from 'element-plus/es/components/table/src/util';
import { Check, Close } from '@element-plus/icons-vue';
import { ElNotification } from 'element-plus';
Expand Down

0 comments on commit caa7408

Please sign in to comment.