头部样式调整
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
3f8e2e84ae
commit
1c5e8edc15
|
@ -1,125 +1,82 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="notice-marquee_wrapper">
|
<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" /> -->
|
<!-- <i class="el-icon-message-solid" /> -->
|
||||||
<svg-icon v-if="noticeList.length > 0" icon-class="speaker" />
|
<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 }}
|
{{ item.Content }}
|
||||||
</span>
|
</span>
|
||||||
</marquee>
|
</marquee>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { setSystemNoticeHaveRead } from "@/api/global";
|
import { setSystemNoticeHaveRead } from '@/api/global'
|
||||||
import { getBasicDataSelects } from "@/api/dictionary/dictionary";
|
import { getBasicDataSelects } from '@/api/dictionary/dictionary'
|
||||||
export default {
|
export default {
|
||||||
name: "NoticeMarquee",
|
name: 'NoticeMarquee',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
noteType: [],
|
noteType: []
|
||||||
};
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
noticeList() {
|
noticeList() {
|
||||||
return this.$store.state.global.noticeList || [];
|
return this.$store.state.global.noticeList || []
|
||||||
},
|
|
||||||
isEN() {
|
|
||||||
return this.$i18n.locale !== 'zh'
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getDicData();
|
this.getDicData()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
start() {
|
start() {
|
||||||
this.$refs["mar"].start();
|
this.$refs['mar'].start()
|
||||||
},
|
},
|
||||||
stop() {
|
stop() {
|
||||||
this.$refs["mar"].stop();
|
this.$refs['mar'].stop()
|
||||||
},
|
},
|
||||||
showDetail(item) {
|
showDetail(item) {
|
||||||
var currentNoticeType = "";
|
var currentNoticeType = ''
|
||||||
const i = this.noteType.findIndex(
|
const i = this.noteType.findIndex(note => note.Code * 1 === item.NoticeTypeEnum)
|
||||||
(note) => note.Code * 1 === item.NoticeTypeEnum
|
|
||||||
);
|
|
||||||
if (i > -1) {
|
if (i > -1) {
|
||||||
currentNoticeType = this.noteType[i].Value;
|
currentNoticeType = this.noteType[i].Value
|
||||||
}
|
}
|
||||||
const h = this.$createElement;
|
const h = this.$createElement
|
||||||
let _this = this;
|
|
||||||
this.$msgbox({
|
this.$msgbox({
|
||||||
title: currentNoticeType,
|
title: currentNoticeType,
|
||||||
message: h("div", null, [
|
message: h('span', null, item.Content),
|
||||||
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
|
|
||||||
)
|
|
||||||
: "",
|
|
||||||
]),
|
|
||||||
beforeClose: (action, instance, done) => {
|
beforeClose: (action, instance, done) => {
|
||||||
if (action === "confirm") {
|
if (action === 'confirm') {
|
||||||
instance.confirmButtonLoading = true;
|
instance.confirmButtonLoading = true
|
||||||
setSystemNoticeHaveRead(item.Id)
|
setSystemNoticeHaveRead(item.Id).then(async res => {
|
||||||
.then(async (res) => {
|
if (res.IsSuccess) {
|
||||||
if (res.IsSuccess) {
|
await this.$store.dispatch('global/getNoticeList')
|
||||||
await this.$store.dispatch("global/getNoticeList");
|
}
|
||||||
}
|
instance.confirmButtonLoading = false
|
||||||
instance.confirmButtonLoading = false;
|
done()
|
||||||
done();
|
}).catch(() => { instance.confirmButtonLoading = false })
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
instance.confirmButtonLoading = false;
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
done();
|
done()
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
getDicData() {
|
getDicData() {
|
||||||
getBasicDataSelects(["NoteType"]).then((res) => {
|
getBasicDataSelects(['NoteType']).then(res => {
|
||||||
this.noteType = res.Result.NoteType;
|
this.noteType = res.Result.NoteType
|
||||||
});
|
})
|
||||||
},
|
}
|
||||||
},
|
}
|
||||||
};
|
}
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.notice-marquee_wrapper {
|
.notice-marquee_wrapper{
|
||||||
|
width: 100%;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
::v-deep .el-dialog__header{
|
||||||
span {
|
|
||||||
font-size: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
>>>.el-dialog__header {
|
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
::v-deep .el-dialog__body{
|
||||||
>>>.el-dialog__body {
|
|
||||||
padding: 10px 20px;
|
padding: 10px 20px;
|
||||||
line-height: 25px;
|
line-height: 25px;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue