flx:修复大屏bug

This commit is contained in:
X_Rian 2024-07-15 17:29:15 +08:00
parent f423dc8cee
commit 6191db0d2a
7 changed files with 241 additions and 11 deletions

View File

@ -109,3 +109,11 @@ export const getcountDangerEngineerApi = (params: {}, noLoading: boolean) => {
headers: { noLoading: noLoading }
});
};
// 查询天气实况
export const getWeatherLiveData = (params: {}, noLoading: boolean) => {
// return http.get(BASEURL + `/xmgl/xzFlow/getStatBySpecial`, params, { headers: { noLoading: noLoading } });
return http.post(BASEURL + `/xmgl/airQualityAnalysis/getWeatherLiveData`, params, {
headers: { noLoading: noLoading }
});
};

View File

@ -184,7 +184,8 @@ function loginOut() {
height: 100%;
background: url("@/assets/images/bigImg.gif") no-repeat;
background-size: 100% 100%;
position: relative;
overflow: hidden;
.header {
width: 100%;
height: 10%;

View File

@ -140,7 +140,7 @@ const onChange = (newIndex: number, oldIndex?: number) => {
if (videoInfo.videoList[newIndex].fileType == 1) {
const resIndex = videoInfo.videoList.filter((item: any) => item.fileType == 1);
console.log(videoInfo.newVideoIndex, resIndex.length - 1);
if (videoInfo.newVideoIndex == resIndex.length - 1) {
videoInfo.newVideoIndex = videoInfo.isPlus > 0 ? -1 : resIndex.length;
}
@ -210,7 +210,7 @@ const getLiveScreenDanmuList = async () => {
// console.log("", res.result.records);
videoInfo.barrageString = res.result.records[0].content;
const htmlText = videoInfo.barrageString.replace(/<[^>]*>/g, "");
videoInfo.secondTime = Math.ceil(htmlText.length / 2);
videoInfo.secondTime = Math.ceil(htmlText.length / 1.2);
// console.log(videoInfo.secondTime);
// videoInfo.videoList = res.result.records;
}
@ -326,9 +326,9 @@ onMounted(() => {
.barrageText {
font-size: 36px;
color: #fff;
position: relative;
// position: relative;
height: 10%;
overflow: hidden;
// overflow: hidden;
div {
// width: 100vw;

View File

@ -24,6 +24,40 @@
<rightCenter class="rightCenter" ref="rightCenterRef"></rightCenter>
<rightBottom class="rightBottom" ref="rightBottomRef"></rightBottom>
</div>
<div class="headerWeathe" v-if="userInfo.weatherInfo.tem">
<div class="headerWeatheLeft">
<div class="imgBox">
<img :src="userInfo.weatherInfo.url" />
<!-- <img v-else src="@/assets/images/dustNoise/weatherIcon/yu.png" /> -->
</div>
<div>
<text>{{ userInfo.weatherInfo.tem }}</text>
</div>
</div>
<div class="headerWeatheRight">
<div>
<text>{{ userInfo.weatherInfo.wea }}</text>
<text>{{ userInfo.weatherInfo.win }}{{ userInfo.weatherInfo.win_speed }}</text>
</div>
<div>
<div>
<text>{{ userInfo.weatherInfo.tem_night }} ~ {{ userInfo.weatherInfo.tem_day }}</text>
</div>
<div
:class="{
color_2ec831: userInfo.pollutionDegree == 1,
color_ffaf00: userInfo.pollutionDegree == 2,
color_c82e38: userInfo.pollutionDegree >= 3
}"
>
{{ userInfo.weatherInfo.air == 0 ? "" : userInfo.weatherInfo.air
}}{{ userInfo.pollutionDegree != -1 ? userInfo.pollutionDegreeList[userInfo.pollutionDegree] : "" }}
</div>
</div>
</div>
</div>
</div>
</template>
@ -39,8 +73,10 @@ import rightCenter from "@/views/agjtLiveScreen/liveScreen/rightCenter.vue";
import rightBottom from "@/views/agjtLiveScreen/liveScreen/rightBottom.vue";
import { GlobalStore } from "@/stores";
import { getWorkerStatisticsCountApi, getProjectDetail } from "@/api/modules/projectOverview";
import { ref, onMounted, onBeforeUnmount, nextTick } from "vue";
import { ref, onMounted, onBeforeUnmount, nextTick, reactive } from "vue";
import { COMPANY } from "@/config/config";
import { getWeatherLiveData } from "@/api/modules/agjtLiveApi";
import { getTaskTimeDetail } from "@/api/modules/schedulePlan";
//API
import { getEnterpriseIdApi, countTaskProgressApi } from "@/api/modules/agjtLiveApi";
const store = GlobalStore();
@ -76,6 +112,102 @@ async function countTaskProgress() {
// });
}
//
const userInfo = reactive({
projectTimeInfo: {} as any,
weatherInfo: {} as any,
weatherIcon: [
{
Image: new URL("@/assets/images/dustNoise/bingbao.png", import.meta.url).href
},
{
Image: new URL("@/assets/images/dustNoise/qing.png", import.meta.url).href
},
{
Image: new URL("@/assets/images/dustNoise/shachen.png", import.meta.url).href
},
{
Image: new URL("@/assets/images/dustNoise/weather4.png", import.meta.url).href
},
{
Image: new URL("@/assets/images/dustNoise/weather5.png", import.meta.url).href
},
{
Image: new URL("@/assets/images/dustNoise/wu.png", import.meta.url).href
},
{
Image: new URL("@/assets/images/dustNoise/xue.png", import.meta.url).href
},
{
Image: new URL("@/assets/images/dustNoise/yin.png", import.meta.url).href
},
{
Image: new URL("@/assets/images/dustNoise/yu.png", import.meta.url).href
},
{
Image: new URL("@/assets/images/dustNoise/yu1.png", import.meta.url).href
},
{
Image: new URL("@/assets/images/dustNoise/yun.png", import.meta.url).href
},
{
Image: new URL("@/assets/images/dustNoise/yun1.png", import.meta.url).href
}
],
pollutionDegree: -1,
pollutionDegreeList: ["数据错误", "优", "良", "轻度污染", "中度污染", "重度污染", "严重污染"]
});
const getProjectInfo = async () => {
const res: any = await getTaskTimeDetail({ projectSn: store.sn });
console.log("获取项目信息", res);
userInfo.projectTimeInfo = res.result;
loadWeather();
// AMap.plugin("AMap.CitySearch", function () {
// let citySearch = new AMap.CitySearch();
// citySearch.getLocalCity(function (status, result) {
// if (status === "complete" && result.info === "OK") {
// // result
// console.log(status, result);
// }
// });
// });
};
//
const loadWeather = async () => {
const res: any = await getWeatherLiveData(
{
cityid: userInfo.projectTimeInfo.cityCode
// areaId: userInfo.projectTimeInfo.areaCode
},
false
);
const weatherImg = userInfo.weatherIcon.find((icon: any) => icon.Image.includes(res.result.wea_img));
if (weatherImg) {
const imageUrl = weatherImg.Image;
// URLelement.url
res.result.url = imageUrl;
}
userInfo.weatherInfo = res.result;
// let json = JSON.parse(res.result);
// let list = json;
console.log("获取天气", userInfo.weatherInfo);
res.result.air = Number(res.result.air);
if (!(new Number(res.result.air) instanceof Number)) return (userInfo.pollutionDegree = 0);
if (res.result.air <= 50) {
userInfo.pollutionDegree = 1;
} else if (res.result.air > 50 && res.result.air <= 100) {
userInfo.pollutionDegree = 2;
} else if (res.result.air > 100 && res.result.air <= 150) {
userInfo.pollutionDegree = 3;
} else if (res.result.air > 150 && res.result.air <= 200) {
userInfo.pollutionDegree = 4;
} else if (res.result.air > 200 && res.result.air <= 300) {
userInfo.pollutionDegree = 5;
} else if (res.result.air > 300) {
userInfo.pollutionDegree = 6;
}
};
const leftTopRef = ref();
const leftCenterRef = ref();
const leftBottomRef = ref();
@ -124,9 +256,81 @@ window.onbeforeunload = e => {
onMounted(async () => {
startInterval();
countTaskProgress();
getProjectInfo();
});
</script>
<style lang="scss" scoped>
.headerWeathe {
position: absolute;
transform: translateY(-53px);
right: 20px;
display: flex;
align-items: center;
color: #fff;
.headerWeatheLeft {
display: flex;
align-items: center;
> div:first-child {
width: 60px;
height: 60px;
> img {
width: 100%;
height: 100%;
}
}
> div:last-child {
font-size: 14px;
display: flex;
> text {
font-size: 32px;
}
}
}
.headerWeatheRight {
display: flex;
flex-direction: column;
justify-content: space-between;
margin-left: 10px;
> div:first-child {
font-size: 14px;
> text:last-child {
margin-left: 10px;
}
}
> div:last-child {
display: flex;
align-items: center;
font-size: 14px;
> div:first-child {
font-size: 12px;
display: flex;
> text {
font-size: 14px;
}
}
> div:last-child {
display: flex;
align-items: center;
justify-content: center;
margin-left: 10px;
font-size: 13px;
// background-color: #47bcec;
padding: 0 4px;
height: 20px;
border-radius: 4px;
}
.color_2ec831 {
background-color: #2ec831;
}
.color_ffaf00 {
background-color: #ffaf00;
}
.color_c82e38 {
background-color: #c82e38;
}
}
}
}
.projectContent {
width: 100%;
height: 100%;

View File

@ -97,7 +97,8 @@ s
</div>
<div class="pRight">
<div class="prTop">
<div class="prtLeft">{{ item.enterpriseName }}</div>
<!-- enterpriseName -->
<div class="prtLeft">{{ item.cbsName }}</div>
<div class="prtRight">{{ item.changeAfter }}%</div>
</div>
<div class="prBottom">
@ -130,7 +131,8 @@ s
</div>
<div class="pRight">
<div class="prTop">
<div class="prtLeft">{{ item.enterpriseName }}</div>
<!-- {{ item.enterpriseName }} -->
<div class="prtLeft">{{ item.cbsName }}</div>
<div class="prtRight">{{ item.changeAfter }}%</div>
</div>
<div class="prBottom">

View File

@ -187,6 +187,7 @@ function loginOut() {
}
//
function jumpBgd() {
const envList = ["agjtLocationLive"]; //
// window.location.replace("http://192.168.34.226:8080/#/projectIndex");
if (COMPANY === "syhy") {
window.location.replace("http://101.43.164.214:45020/#/projectIndex"); //
@ -203,10 +204,15 @@ function jumpBgd() {
if (COMPANY === "as") {
window.location.replace("http://182.90.224.237:15551/#/projectIndex"); //
}
if (COMPANY === "agjtLocationLive") {
// window.location.replace("http://47.93.215.234:9809" + "/#/login?token=" + store.token);
if (envList.includes(COMPANY)) {
window.location.replace(BASEURL + "/#/projectIndex?token=" + store.token);
// if (process.env.NODE_ENV === "development") {
// window.location.replace("http://42.180.188.17:11211" + "/#/login?token=" + store.token);
// } else {
// window.location.replace("http://42.180.188.17:9809" + "/#/login?token=" + store.token);
// }
// command=1&pathItem=project/smartSafeHat/dataPay
window.location.replace("http://192.168.34.175:8080/#/projectIndex"); //
// window.location.replace("http://192.168.34.175:8080/#/projectIndex"); //
// window.location.replace("http://192.168.34.175:8080" + "/#/login?projectIndex" + "&token=" + store.token);
}
}

View File

@ -139,6 +139,15 @@ const login = (formEl: FormInstance | undefined) => {
return;
}
router.push("/overviewScreen");
} else if (COMPANY === "agjtLocationLive") {
if (![5, 10].includes(result.accountType)) {
ElMessage({
message: "账号类型不匹配",
type: "warning"
});
return;
}
router.push("/locationLive");
} else {
router.push("/projectOverview");
}