fix:大屏动态获取公告

This commit is contained in:
shijing 2024-11-27 09:22:35 +08:00
parent 63c7929ea3
commit cea727a691
1 changed files with 45 additions and 5 deletions

View File

@ -161,9 +161,9 @@
</div>
<div class="itemBody">
<video width="100%" height="100%" autoplay controls loop>
<!-- <source :src="videoUrl" type="video/mp4"> -->
<source src="img/gx/gx_video.mp4" type="video/mp4">
</video>
<!-- <img src="img/v_mask.png" style="height: 400px;width:620px;margin-left: 25px;"/> -->
</div>
</div>
<div class="flexItem newsFlexItem">
@ -172,11 +172,12 @@
<div>宣传公告</div>
</div>
<div class="itemBody">
<div class="viewsItem">
<div class="viewsItem" v-for="articleItem in articleList" :key="articleItem.id">
<div class="viewsItem_wrap">
<img style="float: left;" class="viewsItem_img" src="img/gz_logo.png">
<!-- <img style="float: left;" class="viewsItem_img" src="img/gz_logo.png"> -->
<img style="float: left;" class="viewsItem_img" :src="articleItem.poster">
<article>
紧绷安全弦筑牢防护网光芯科技开展五一节前安全生产大检查筑牢防护网紧绷安全弦筑牢防护网光芯科技开展五一节前安全生产大检查筑牢防护网
{{ articleItem.content }}
</article>
</div>
</div>
@ -383,6 +384,7 @@ BABYLON.DracoCompression.Configuration.decoder.fallbackUrl =
"./draco_decoder_gltf.js";
import "babylonjs-loaders";
import "animate.css";
import baseUrl from "@/config";
const configData={
header : ['物料批次','未加工','进行中','已完成','合格数'],
headerBGC : '#0a3f44',
@ -538,6 +540,7 @@ export default {
resizeTimeout: null,
loadedPercent: 0,
percentage: 25,
baseUrl: baseUrl.HOST_URL,
updateTime: "2023-08-17 16:00:00",
//
currentTime: "",
@ -686,6 +689,8 @@ export default {
options13:{},
options14:{},
options15:{},
articleList:[],
videoUrl:'',
};
},
mounted() {
@ -718,10 +723,11 @@ export default {
that.addListener();
that.setIntervalFun();
that.getQulity();
that.getArticles();
that.myChart = echarts.init(document.getElementById('eqPieChart'));
that.myChart.setOption(that.option_eq);
let index2 = 0;
this.chartInterval2 = setInterval(function () {
that.chartInterval2 = setInterval(function () {
if (index2 < that.option_eq.series.data.length) {
that.myChart.dispatchAction({
type: "downplay",
@ -744,6 +750,25 @@ export default {
}, 3000);
},
methods: {
//
getArticles(){
let that = this;
that.$API.cms.article.list.req({page:0}).then((res) => {
if(res.length>0){
let articleList = [],videoList = [];
res.forEach((item)=>{
if(item.video == ''){
articleList.push(item);
}else{
videoList.push(item);
}
})
that.articleList = articleList.slice(0,2);
that.videoUrl = that.baseUrl+videoList[0].video;
}
})
},
//
getQulity(){
let that = this;
let month = that.currentMonth>9?that.currentMonth:'0'+that.currentMonth;
@ -798,6 +823,7 @@ export default {
}
});
},
//
setIntervalFun(){
let that = this;
that.scrollInterval = setInterval(() => {
@ -811,6 +837,7 @@ export default {
document.getElementById("scroll").style.left = lefts +'px';
},6000)
},
//
showTime() {
this.currentTime = this.$TOOL.dateFormat(new Date(), "hh:mm:ss");
this.currentWeek = this.$TOOL.dateFormat(new Date(), "week");
@ -819,6 +846,7 @@ export default {
"yyyy年MM月dd日"
);
},
//
addListener() {
let that = this;
window.addEventListener("resize", function () {
@ -835,6 +863,7 @@ export default {
}, 300); // 300
});
},
//
initDomStyle() {
let that = this;
//
@ -857,6 +886,7 @@ export default {
that.engine.resize();
}
},
//
resizeChart(name) {
// name resize chart
var myChart = echarts.getInstanceByDom(
@ -866,6 +896,7 @@ export default {
myChart.resize();
}
},
////
getTaskNumber(){
let that = this;
let month = that.currentMonth>9?that.currentMonth:'0'+that.currentMonth;
@ -1061,6 +1092,7 @@ export default {
deepCopy(obj) {
return JSON.parse(JSON.stringify(obj));
},
//
getMgroup(){
let that = this;
that.$API.mtm.mgroup.list.req({page:0}).then((res) => {
@ -1072,6 +1104,7 @@ export default {
}
})
},
//
getProcessDatas(name,index){
let that = this;
let month = that.currentMonth>9?that.currentMonth:'0'+that.currentMonth;
@ -1099,6 +1132,7 @@ export default {
}
});
},
//
getProcessCount(name,index){
let that = this;
let optionKey = 'options'+index;
@ -1430,6 +1464,12 @@ export default {
article{
margin-top: 5px;
text-indent: 2em;
display: -webkit-box;
-webkit-line-clamp: 5; /* 限制显示 5 行 */
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
/deep/ .header-item{