fix: 编写龙门吊页面

This commit is contained in:
cjp 2023-10-13 17:50:08 +08:00
parent f0aba8f3cb
commit d97289697f
10 changed files with 323 additions and 96 deletions

View File

@ -0,0 +1,3 @@
// AI预警接口API
import http from "@/api";
const BASEURL = import.meta.env.VITE_API_URL;

View File

@ -0,0 +1,3 @@
// 智慧党建接口API
import http from "@/api";
const BASEURL = import.meta.env.VITE_API_URL;

View File

@ -72,7 +72,6 @@ import { reactive, ref, onMounted } from "vue";
import textIcon from "@/assets/images/vehicleManagement/car.png"; import textIcon from "@/assets/images/vehicleManagement/car.png";
import { GlobalStore } from "@/stores"; import { GlobalStore } from "@/stores";
const store = GlobalStore(); const store = GlobalStore();
let showDialog = ref(false as any);
const list = reactive([ const list = reactive([
{ {
id: 1, id: 1,
@ -153,7 +152,7 @@ const list = reactive([
warnTime: "2023-01-01 12:00:00" warnTime: "2023-01-01 12:00:00"
} }
]); ]);
let showDialog = ref(false as any);
function handleClick(event: any) { function handleClick(event: any) {
console.log("点击", event.target.className); console.log("点击", event.target.className);
if (event.target.className == "list-detail") { if (event.target.className == "list-detail") {

View File

@ -18,13 +18,20 @@ type Props = {
yData?: any; // y yData?: any; // y
lineId?: any; // 线domid lineId?: any; // 线domid
lineSmooth?: any; // 线 0-1,(0:线 1:) lineSmooth?: any; // 线 0-1,(0:线 1:)
grid?: any; //线
}; };
// withDefaults () // withDefaults ()
const props = withDefaults(defineProps<Props>(), { const props = withDefaults(defineProps<Props>(), {
xData: ["09-01", "09-02", "09-03", "09-04", "09-05", "09-06", "09-07"], xData: ["09-01", "09-02", "09-03", "09-04", "09-05", "09-06", "09-07"],
yData: [10, 5, 20, 25, 15, 25, 12], yData: [10, 5, 20, 25, 15, 25, 12],
lineId: "waterShortTerm", lineId: "waterShortTerm",
lineSmooth: 0 lineSmooth: 0,
grid: {
top: "20%",
left: "6%",
right: "4%",
bottom: "10%"
}
// num: () => [12, 13, 14] // 使 // num: () => [12, 13, 14] // 使
}); });
@ -58,13 +65,7 @@ function initOption() {
tooltip: { tooltip: {
trigger: "axis" trigger: "axis"
}, },
grid: { grid: props.grid,
top: "20%",
left: "6%",
right: "4%",
bottom: "10%"
// containLabel: true
},
xAxis: [ xAxis: [
{ {
type: "category", type: "category",
@ -219,5 +220,6 @@ onBeforeUnmount(async () => {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative; position: relative;
// transform: rotate(90deg);
} }
</style> </style>

View File

@ -33,11 +33,11 @@ const store = GlobalStore();
// x // x
let xData = ref(["09-01", "09-02", "09-03", "09-04", "09-05", "09-06", "09-07"] as any); let xData = ref(["09-01", "09-02", "09-03", "09-04", "09-05", "09-06", "09-07"] as any);
// Y // Y
let unit = ref("单位:V" as any); // let unit = ref(":V" as any);
// Y // Y
let yData = ref([10, 5, 20, 25, 15, 25, 12] as any); let yData = ref([10, 5, 20, 35, 25, 15, 12] as any);
// //
let option = ref(null as any); // let option = ref(null as any);
// //
let checked = ref(1); let checked = ref(1);

View File

@ -27,7 +27,7 @@ const props = withDefaults(defineProps<Props>(), {
lineId: "waterShortTerm", lineId: "waterShortTerm",
lineSmooth: 0, lineSmooth: 0,
grid: { grid: {
top: "20%", top: "15%",
left: "10%", left: "10%",
right: "10%", right: "10%",
bottom: "10%" bottom: "10%"
@ -65,12 +65,7 @@ function initOption() {
tooltip: { tooltip: {
trigger: "axis" trigger: "axis"
}, },
grid: { grid: props.grid,
top: "20%",
left: "10%",
right: "10%",
bottom: "10%"
},
xAxis: [ xAxis: [
{ {
type: "category", type: "category",
@ -214,7 +209,7 @@ onMounted(async () => {
drawChart(); drawChart();
}); });
// 线miits.on 7.14 by CJP // 线mitts.on 7.14 by CJP
onBeforeUnmount(async () => { onBeforeUnmount(async () => {
mitts.off("devSn"); mitts.off("devSn");
}); });

View File

@ -10,13 +10,14 @@
</div> </div>
<!-- <div id="waterShortTerm" ref="waterShortTerm" style="width: 100%; height: 100%"></div> <!-- <div id="waterShortTerm" ref="waterShortTerm" style="width: 100%; height: 100%"></div>
--> -->
<greenLineEchart <blueLineEchart
:xData="xData" :xData="xData"
:yData="yData" :yData="yData"
:lineId="'gantryWorkTime'" :lineId="'gantryWorkTime'"
:lineSmooth="0" :lineSmooth="0"
:grid="lineGrid"
style="width: 100%; height: 100%" style="width: 100%; height: 100%"
></greenLineEchart> ></blueLineEchart>
</div> </div>
</div> </div>
</Card> </Card>
@ -26,18 +27,25 @@
import Card from "@/components/card.vue"; import Card from "@/components/card.vue";
import symbolIcon from "@/assets/images/lineSymbol.png"; import symbolIcon from "@/assets/images/lineSymbol.png";
import { onMounted, reactive, ref, onBeforeUnmount } from "vue"; import { onMounted, reactive, ref, onBeforeUnmount } from "vue";
import greenLineEchart from "@/views/sevenLargeScreen/greenConstruct/waterMonitor/greenLineEchart.vue"; import blueLineEchart from "@/views/sevenLargeScreen/greenConstruct/waterMonitor/blueLineEchart.vue";
import { GlobalStore } from "@/stores"; import { GlobalStore } from "@/stores";
import mitts from "@/utils/bus"; // import mitts from "@/utils/bus"; //
const store = GlobalStore(); const store = GlobalStore();
// x // x
let xData = ref(["09-01", "09-02", "09-03", "09-04", "09-05", "09-06", "09-07"] as any); let xData = ref(["09-01", "09-02", "09-03", "09-04", "09-05", "09-06", "09-07"] as any);
// Y // Y
let unit = ref("单位:V" as any); // let unit = ref(":V" as any);
// Y // Y
let yData = ref([10, 5, 20, 25, 15, 25, 12] as any); let yData = ref([10, 5, 20, 25, 15, 25, 12] as any);
// //
let option = ref(null as any); // let option = ref(null as any);
//
let lineGrid = ref({
top: "20%",
left: "10%",
right: "8%",
bottom: "10%"
});
// //
let checked = ref(1); let checked = ref(1);
@ -69,9 +77,11 @@ function getRecentSevenDays() {
for (let i = 0; i < 7; i++) { for (let i = 0; i < 7; i++) {
const date = new Date(today.getTime() - i * millisecondsPerDay); const date = new Date(today.getTime() - i * millisecondsPerDay);
//
const year = today.getFullYear();
const month = ("0" + (date.getMonth() + 1)).slice(-2); const month = ("0" + (date.getMonth() + 1)).slice(-2);
const day = ("0" + date.getDate()).slice(-2); const day = ("0" + date.getDate()).slice(-2);
dates.unshift(`${month}-${day}`); dates.unshift(`${year}-${month}-${day}`);
} }
return dates; return dates;
} }
@ -94,7 +104,7 @@ function getPassedDaysOfMonth() {
while (currentDate <= today) { while (currentDate <= today) {
const month = currentDate.getMonth() + 1; const month = currentDate.getMonth() + 1;
const day = currentDate.getDate(); const day = currentDate.getDate();
dates.push(`${("0" + month).slice(-2)}-${("0" + day).slice(-2)}`); dates.push(`${year}-${("0" + month).slice(-2)}-${("0" + day).slice(-2)}`);
currentDate.setDate(currentDate.getDate() + 1); currentDate.setDate(currentDate.getDate() + 1);
} }
@ -102,7 +112,9 @@ function getPassedDaysOfMonth() {
return dates; return dates;
} }
onMounted(async () => {}); onMounted(async () => {
getWeekData(1);
});
// 线miits.on 7.14 by CJP // 线miits.on 7.14 by CJP
onBeforeUnmount(async () => { onBeforeUnmount(async () => {

View File

@ -10,13 +10,14 @@
</div> --> </div> -->
<!-- <div id="waterShortTerm" ref="waterShortTerm" style="width: 100%; height: 100%"></div> <!-- <div id="waterShortTerm" ref="waterShortTerm" style="width: 100%; height: 100%"></div>
--> -->
<greenLineEchart <blueLineEchart
:xData="xData" :xData="xData"
:yData="yData" :yData="yData"
:lineId="'gantryWindSpeed'" :lineId="'gantryWindSpeed'"
:lineSmooth="0" :lineSmooth="0"
:grid="lineGrid"
style="width: 100%; height: 100%" style="width: 100%; height: 100%"
></greenLineEchart> ></blueLineEchart>
</div> </div>
</div> </div>
</Card> </Card>
@ -26,87 +27,94 @@
import Card from "@/components/card.vue"; import Card from "@/components/card.vue";
import symbolIcon from "@/assets/images/lineSymbol.png"; import symbolIcon from "@/assets/images/lineSymbol.png";
import { onMounted, reactive, ref, onBeforeUnmount } from "vue"; import { onMounted, reactive, ref, onBeforeUnmount } from "vue";
import greenLineEchart from "@/views/sevenLargeScreen/greenConstruct/waterMonitor/greenLineEchart.vue"; import blueLineEchart from "@/views/sevenLargeScreen/greenConstruct/waterMonitor/blueLineEchart.vue";
import { GlobalStore } from "@/stores"; import { GlobalStore } from "@/stores";
import mitts from "@/utils/bus"; // import mitts from "@/utils/bus"; //
const store = GlobalStore(); const store = GlobalStore();
// x // x
let xData = ref(["09-01", "09-02", "09-03", "09-04", "09-05", "09-06", "09-07"] as any); let xData = ref(["02:00", "04:00", "06:00", "08:00", "10:00", "12:00", "14:00"] as any);
// Y // Y
let unit = ref("单位:V" as any); // let unit = ref(":V" as any);
// Y // Y
let yData = ref([10, 5, 25, 20, 15, 25, 12] as any); let yData = ref([10, 5, 25, 20, 15, 25, 12] as any);
// //
let option = ref(null as any); // let option = ref(null as any);
//
let lineGrid = ref({
top: "10%",
left: "10%",
right: "8%",
bottom: "10%"
});
// //
let checked = ref(1); // let checked = ref(1);
function getWeekData(type: any) { // function getWeekData(type: any) {
checked.value = type; // checked.value = type;
let currentWeek = getRecentSevenDays(); // let currentWeek = getRecentSevenDays();
// console.log(currentWeek, ""); // // console.log(currentWeek, "");
// // //
xData.value = currentWeek; // xData.value = currentWeek;
yData.value = [20, 15, 25, 15, 25, 35, 12]; // yData.value = [20, 15, 25, 15, 25, 35, 12];
} // }
function getMonthData(type: any) { // function getMonthData(type: any) {
checked.value = type; // checked.value = type;
let currentWeek = getPassedDaysOfMonth(); // let currentWeek = getPassedDaysOfMonth();
// console.log(currentWeek.length, ""); // // console.log(currentWeek.length, "");
let testyData: any = []; // let testyData: any = [];
for (let i = 0; i < currentWeek.length; i++) { // for (let i = 0; i < currentWeek.length; i++) {
testyData.push((i % 2) + 10); // testyData.push((i % 2) + 10);
} // }
xData.value = currentWeek; // xData.value = currentWeek;
yData.value = testyData; // yData.value = testyData;
} // }
// // //
function getRecentSevenDays() { // function getRecentSevenDays() {
const dates: any = []; // const dates: any = [];
const millisecondsPerDay = 24 * 60 * 60 * 1000; // // const millisecondsPerDay = 24 * 60 * 60 * 1000; //
const today = new Date(); // // const today = new Date(); //
for (let i = 0; i < 7; i++) { // for (let i = 0; i < 7; i++) {
const date = new Date(today.getTime() - i * millisecondsPerDay); // const date = new Date(today.getTime() - i * millisecondsPerDay);
const month = ("0" + (date.getMonth() + 1)).slice(-2); // const month = ("0" + (date.getMonth() + 1)).slice(-2);
const day = ("0" + date.getDate()).slice(-2); // const day = ("0" + date.getDate()).slice(-2);
dates.unshift(`${month}-${day}`); // dates.unshift(`${month}-${day}`);
} // }
return dates; // return dates;
} // }
// // //
function getPassedDaysOfMonth() { // function getPassedDaysOfMonth() {
// // //
const dates: any = []; // const dates: any = [];
// // //
const today = new Date(); // const today = new Date();
// // //
const year = today.getFullYear(); // const year = today.getFullYear();
// // //
const month = today.getMonth(); // const month = today.getMonth();
// // //
const startDate = new Date(year, month, 1); // 0 8 9 // const startDate = new Date(year, month, 1); // 0 8 9
let currentDate = startDate; // let currentDate = startDate;
// // //
while (currentDate <= today) { // while (currentDate <= today) {
const month = currentDate.getMonth() + 1; // const month = currentDate.getMonth() + 1;
const day = currentDate.getDate(); // const day = currentDate.getDate();
dates.push(`${("0" + month).slice(-2)}-${("0" + day).slice(-2)}`); // dates.push(`${("0" + month).slice(-2)}-${("0" + day).slice(-2)}`);
currentDate.setDate(currentDate.getDate() + 1); // currentDate.setDate(currentDate.getDate() + 1);
} // }
return dates; // return dates;
} // }
onMounted(async () => {}); onMounted(async () => {});
// 线miits.on 7.14 by CJP // 线miits.on 7.14 by CJP
onBeforeUnmount(async () => { onBeforeUnmount(async () => {
mitts.off("devSn"); // mitts.off("devSn");
}); });
</script> </script>

View File

@ -1,7 +1,7 @@
<template> <template>
<Card title="实时监测"> <Card title="实时监测">
<div class="gantry-list"> <div class="gantry-list">
<div class="people-message"> </div> <div class="people-message" @click="showDialog = !showDialog"> </div>
<div class="gantry-icon"></div> <div class="gantry-icon"></div>
<div class="gantry-data"> <div class="gantry-data">
<div class="box-contain"> <div class="box-contain">
@ -27,6 +27,44 @@
<div class="number">34<span>m</span></div> <div class="number">34<span>m</span></div>
</div> </div>
</div> </div>
<div class="list-detail" v-if="showDialog" @click="handleClick">
<div class="dialog-content">
<div class="dialog-title"><i>人员详情</i></div>
<div class="dialog-detail">
<div class="detail-top">
<div class="top-left">
<img src="@/assets/images/comprehensiveManage/project3.png" />
</div>
<div class="top-right">
<div style="margin-top: 2%"><span style="font-size: 20px; color: #65d7f9; margin-right: 5%">陈建 </span> </div>
<div style="margin-top: 18%">佳信捷软件_451班组</div>
<div style="margin-top: 18%">13324904501</div>
</div>
</div>
<div class="detail-text">
<div class="text-box">
<div class="type">身份证</div>
<div class="text">******************</div>
</div>
<div class="text-box" style="margin-top: 5%">
<div class="type">班组</div>
<div class="text">佳信捷软件_451班组</div>
</div>
<div class="text-box" style="margin-top: 5%">
<div class="type">工种</div>
<div class="text">窑炉修筑工</div>
</div>
<div class="text-box" style="margin-top: 5%">
<div class="type">参见单位</div>
<div class="text">中建四局</div>
</div>
</div>
</div>
<div class="close-icon" @click="showDialog = false">
<el-icon><Close /></el-icon>
</div>
</div>
</div>
</div> </div>
</Card> </Card>
</template> </template>
@ -34,6 +72,13 @@
<script lang="ts" setup> <script lang="ts" setup>
import Card from "@/components/card.vue"; import Card from "@/components/card.vue";
import { reactive, ref, onMounted } from "vue"; import { reactive, ref, onMounted } from "vue";
let showDialog = ref(false as any);
function handleClick(event: any) {
console.log("点击", event.target.className);
if (event.target.className == "list-detail") {
showDialog.value = false;
}
}
onMounted(async () => {}); onMounted(async () => {});
</script> </script>
@ -47,6 +92,7 @@ onMounted(async () => {});
width: 3%; width: 3%;
left: 0%; left: 0%;
top: 10%; top: 10%;
cursor: pointer;
font-size: 12px; font-size: 12px;
padding-left: 5px; padding-left: 5px;
padding-bottom: 1%; padding-bottom: 1%;
@ -115,4 +161,120 @@ onMounted(async () => {});
} }
} }
} }
.list-detail {
position: absolute;
width: 100%;
height: 100%;
.dialog-content {
position: absolute;
box-sizing: border-box;
padding: 2%;
left: 5%;
top: 5%;
width: 36%;
height: 92%;
background: url("@/assets/images/aIEarlyWarning/dialogBg.png") no-repeat;
background-size: 100% 100%;
z-index: 21;
.dialog-icon {
position: absolute;
left: 4%;
top: 4%;
width: 7%;
height: 7%;
img {
width: 100%;
height: 100%;
}
}
.pic-icon {
position: absolute;
left: 3%;
top: 40%;
width: 7%;
height: 7%;
img {
width: 100%;
height: 100%;
}
}
.close-icon {
position: absolute;
right: 3%;
top: 3%;
cursor: pointer;
color: #ffffff;
font-size: calc(100vw * 18 / 1920);
}
.dialog-title {
color: #ffffff;
font-weight: bold;
margin-left: 3%;
font-size: calc(100vw * 18 / 1920);
font-family: "OPPOSans-Bold";
}
.dialog-detail {
width: 100%;
height: 100%;
margin-top: 8%;
.detail-top {
height: 38%;
display: flex;
.top-left {
width: 35%;
height: 90%;
img {
width: 100%;
height: 100%;
object-fit: contain;
}
}
.top-right {
margin-left: 6%;
font-size: 12px;
color: #fff;
}
}
.detail-text {
width: 100%;
height: 100%;
margin-top: 3%;
.text-box {
height: 8%;
display: flex;
align-items: center;
background: url("@/assets/images/aIEarlyWarning/contentBg.png") no-repeat;
background-size: 100% 100%;
.type {
width: 25%;
margin-left: 4%;
color: #a1accb;
font-size: calc(100vw * 12 / 1920);
}
.text {
font-size: calc(100vw * 12 / 1920);
color: #ffffff;
}
}
}
}
.pic-title {
color: #ffffff;
font-weight: bold;
font-size: calc(100vw * 18 / 1920);
font-family: "OPPOSans-Bold";
margin-top: 5%;
margin-left: 8%;
}
.big-pic {
width: 100%;
height: 50%;
margin-top: 10%;
img {
width: 100%;
height: 100%;
}
}
}
}
</style> </style>

View File

@ -1,6 +1,10 @@
<template> <template>
<Card title="作业统计"> <Card title="作业统计">
<div class="gantry-top-left"> <div class="gantry-top-left">
<div class="select-right">
<div class="today selected" @click="tabChange(1)" :class="checked == 1 ? 'active' : ''">今日</div>
<div class="total selected" @click="tabChange(2)" :class="checked == 2 ? 'active' : ''">累计</div>
</div>
<div class="right-box"> <div class="right-box">
<div class="yesterday-use"> <div class="yesterday-use">
<div class="text">工作时长(小时)</div> <div class="text">工作时长(小时)</div>
@ -32,6 +36,12 @@
<script lang="ts" setup> <script lang="ts" setup>
import Card from "@/components/card.vue"; import Card from "@/components/card.vue";
import { reactive, ref, onMounted } from "vue"; import { reactive, ref, onMounted } from "vue";
//
let checked = ref(1);
function tabChange(type: any) {
checked.value = type;
}
onMounted(async () => {}); onMounted(async () => {});
</script> </script>
@ -39,6 +49,39 @@ onMounted(async () => {});
.gantry-top-left { .gantry-top-left {
width: 100%; width: 100%;
height: 100%; height: 100%;
position: relative;
.select-right {
width: 25%;
display: flex;
position: absolute;
z-index: 10;
color: #fff;
font-size: 10px;
text-align: center;
line-height: 20px;
right: 0%;
top: 5%;
.selected {
height: 5%;
background: url("@/assets/images/dustNoise/rightImg2.png") no-repeat;
background-size: 100% 100%;
cursor: pointer;
}
.today {
width: 40%;
margin-right: 5%;
z-index: 99;
}
.total {
width: 40%;
margin-right: 5%;
z-index: 99;
}
.active {
background: url("@/assets/images/dustNoise/rightImg.png") no-repeat;
background-size: 100% 100%;
}
}
.right-box { .right-box {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -57,7 +100,7 @@ onMounted(async () => {});
.text { .text {
font-size: 16px; font-size: 16px;
color: #65d7f9; color: #65d7f9;
margin-top: 5%; margin-top: 10%;
} }
.num { .num {
transform: skew(-5deg); transform: skew(-5deg);
@ -80,7 +123,7 @@ onMounted(async () => {});
.text { .text {
font-size: 16px; font-size: 16px;
color: #65d7f9; color: #65d7f9;
margin-top: 5%; margin-top: 10%;
} }
.num { .num {
transform: skew(-5deg); transform: skew(-5deg);
@ -104,7 +147,7 @@ onMounted(async () => {});
font-family: Source Han Sans CN-Medium, Source Han Sans CN; font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500; font-weight: 500;
color: #ffffff; color: #ffffff;
margin-top: 5%; margin-top: 10%;
} }
.num { .num {
transform: skew(-5deg); transform: skew(-5deg);
@ -123,7 +166,7 @@ onMounted(async () => {});
background: url("@/assets/images/aIEarlyWarning/weekWarn.png") no-repeat; background: url("@/assets/images/aIEarlyWarning/weekWarn.png") no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
.text { .text {
margin-top: 5%; margin-top: 10%;
font-size: 16px; font-size: 16px;
font-family: Source Han Sans CN-Medium, Source Han Sans CN; font-family: Source Han Sans CN-Medium, Source Han Sans CN;
font-weight: 500; font-weight: 500;