头部样式调整
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-08-25 17:12:05 +08:00
parent 3f8e2e84ae
commit 1c5e8edc15
1 changed files with 38 additions and 81 deletions

View File

@ -1,125 +1,82 @@
<template>
<div class="notice-marquee_wrapper">
<marquee ref="mar" hspace="0" direction="left" :width="isEN ? '400' : '500'" @mouseout="start()" @mouseover="stop()">
<marquee ref="mar" hspace="0" direction="left" width="100%" @mouseout="start()" @mouseover="stop()">
<!-- <i class="el-icon-message-solid" /> -->
<svg-icon v-if="noticeList.length > 0" icon-class="speaker" />
<span v-for="item in noticeList" :key="item.Id" style="cursor: pointer" @click="showDetail(item)">
<span v-for="item in noticeList" :key="item.Id" style="cursor:pointer;" @click="showDetail(item)">
{{ item.Content }}
</span>
</marquee>
</div>
</template>
<script>
import { setSystemNoticeHaveRead } from "@/api/global";
import { getBasicDataSelects } from "@/api/dictionary/dictionary";
import { setSystemNoticeHaveRead } from '@/api/global'
import { getBasicDataSelects } from '@/api/dictionary/dictionary'
export default {
name: "NoticeMarquee",
name: 'NoticeMarquee',
data() {
return {
noteType: [],
};
noteType: []
}
},
computed: {
noticeList() {
return this.$store.state.global.noticeList || [];
},
isEN() {
return this.$i18n.locale !== 'zh'
return this.$store.state.global.noticeList || []
}
},
mounted() {
this.getDicData();
this.getDicData()
},
methods: {
start() {
this.$refs["mar"].start();
this.$refs['mar'].start()
},
stop() {
this.$refs["mar"].stop();
this.$refs['mar'].stop()
},
showDetail(item) {
var currentNoticeType = "";
const i = this.noteType.findIndex(
(note) => note.Code * 1 === item.NoticeTypeEnum
);
var currentNoticeType = ''
const i = this.noteType.findIndex(note => note.Code * 1 === item.NoticeTypeEnum)
if (i > -1) {
currentNoticeType = this.noteType[i].Value;
currentNoticeType = this.noteType[i].Value
}
const h = this.$createElement;
let _this = this;
const h = this.$createElement
this.$msgbox({
title: currentNoticeType,
message: h("div", null, [
h("span", null, item.Content),
item.Path
? h(
"div",
{
style: {
marginTop: "10px",
},
},
_this.$t("trials:notice:message:tipTitle")
)
: "",
item.Path
? h(
"a",
{
attrs: {
href: _this.OSSclientConfig.basePath + item.Path,
target: "_blank",
},
style: {
color: "#428bca",
},
},
item.FileName
)
: "",
]),
message: h('span', null, item.Content),
beforeClose: (action, instance, done) => {
if (action === "confirm") {
instance.confirmButtonLoading = true;
setSystemNoticeHaveRead(item.Id)
.then(async (res) => {
if (res.IsSuccess) {
await this.$store.dispatch("global/getNoticeList");
}
instance.confirmButtonLoading = false;
done();
})
.catch(() => {
instance.confirmButtonLoading = false;
});
if (action === 'confirm') {
instance.confirmButtonLoading = true
setSystemNoticeHaveRead(item.Id).then(async res => {
if (res.IsSuccess) {
await this.$store.dispatch('global/getNoticeList')
}
instance.confirmButtonLoading = false
done()
}).catch(() => { instance.confirmButtonLoading = false })
} else {
done();
done()
}
},
});
}
})
},
getDicData() {
getBasicDataSelects(["NoteType"]).then((res) => {
this.noteType = res.Result.NoteType;
});
},
},
};
getBasicDataSelects(['NoteType']).then(res => {
this.noteType = res.Result.NoteType
})
}
}
}
</script>
<style lang="scss" scoped>
.notice-marquee_wrapper {
.notice-marquee_wrapper{
width: 100%;
display: flex;
align-items: center;
span {
font-size: 20px;
}
>>>.el-dialog__header {
::v-deep .el-dialog__header{
padding: 10px;
}
>>>.el-dialog__body {
::v-deep .el-dialog__body{
padding: 10px 20px;
line-height: 25px;
}