fix: BUG修改
This commit is contained in:
parent
46c8f4e183
commit
c9284dd84b
@ -7,18 +7,34 @@
|
||||
<span :class="activeTab == 2 ? 'active-span' : ''" @click="changeActive(2)">质量控制要点</span>
|
||||
</div>
|
||||
<div class="text-content">
|
||||
<div v-html="activeTab == 0?props.dataObj.dangerPointIdentification:activeTab == 1?props.dataObj.riskControlMeasure:activeTab == 2?props.dataObj.constructionKeyPoint:''"></div>
|
||||
<div class="content-data" v-if="isShowContent" v-html="activeTab == 0?props.dataObj.dangerPointIdentification:activeTab == 1?props.dataObj.riskControlMeasure:activeTab == 2?props.dataObj.constructionKeyPoint:''"></div>
|
||||
<div class="notoDta" v-else>
|
||||
<img src="@/assets/images/noData.png" alt="" />
|
||||
<p>暂无数据</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted } from "vue";
|
||||
import { ref, onMounted, computed } from "vue";
|
||||
import { GlobalStore } from "@/stores";
|
||||
const store = GlobalStore();
|
||||
const props = defineProps(["dataObj"]);
|
||||
const activeTab = ref(0);
|
||||
const isShowContent = computed(() => {
|
||||
// 判断没内容时,显示暂无数据
|
||||
if(activeTab.value == 0 && !props.dataObj.dangerPointIdentification){
|
||||
return false;
|
||||
} else if(activeTab.value == 1 && !props.dataObj.riskControlMeasure){
|
||||
return false;
|
||||
} else if(activeTab.value == 2 && !props.dataObj.constructionKeyPoint){
|
||||
return false;
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
})
|
||||
const changeActive = (activeIndex: any) => {
|
||||
activeTab.value = activeIndex;
|
||||
};
|
||||
@ -61,7 +77,9 @@ onMounted(async () => {
|
||||
}
|
||||
}
|
||||
.text-content{
|
||||
div{
|
||||
position: relative;
|
||||
height: 500px;
|
||||
.content-data{
|
||||
font-size: 16px;
|
||||
color: #fff;
|
||||
height: 500px;
|
||||
@ -69,6 +87,21 @@ onMounted(async () => {
|
||||
margin-top: 20px;
|
||||
line-height: 25px;
|
||||
}
|
||||
.notoDta {
|
||||
top: 22%;
|
||||
width: 30%;
|
||||
left: 32%;
|
||||
position: absolute;
|
||||
img {
|
||||
width: 40%;
|
||||
margin: 0% 30%;
|
||||
}
|
||||
p {
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -303,7 +303,7 @@ const activeBtn = (item: any) => {
|
||||
}
|
||||
// 取消编辑态
|
||||
isEdit.value = false;
|
||||
console.log(detailData.value.videoList[0].serialNumber);
|
||||
setVideoElement();
|
||||
};
|
||||
const boxStyle = (item: any) => {
|
||||
if (item.isActive) {
|
||||
@ -334,11 +334,25 @@ const getDataList = async () => {
|
||||
newArray[0].isActive = true;
|
||||
articleNewList.value = newArray;
|
||||
detailData.value = newArray[0];
|
||||
setVideoElement();
|
||||
} else {
|
||||
articleNewList.value = [];
|
||||
detailData.value = {};
|
||||
}
|
||||
};
|
||||
const setVideoElement = () => {
|
||||
// 为了解决视频播放器渲染,第二个总是会默认显示一半,我动态设置样式让视图刷新,只要设置百分百就有问题,所以只能使用此方法
|
||||
setTimeout(() => {
|
||||
// 获取所有的 video 元素
|
||||
var videos = document.getElementsByTagName("video");
|
||||
// 遍历所有的 video 元素
|
||||
for (var i = 0; i < videos.length; i++) {
|
||||
// 修改视频元素的样式
|
||||
videos[i].style.width = "99.9%";
|
||||
videos[i].style.height = "99.9%";
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
const searchChange = (e: any) => {
|
||||
getDataList();
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user