Commit 62a270e3 authored by 张牧越's avatar 张牧越

安全帽页面

parent da344cd0
......@@ -15,6 +15,11 @@
"js-message": "1.0.7"
}
},
"@amap/amap-jsapi-loader": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@amap/amap-jsapi-loader/-/amap-jsapi-loader-1.0.1.tgz",
"integrity": "sha512-nPyLKt7Ow/ThHLkSvn2etQlUzqxmTVgK7bIgwdBRTg2HK5668oN7xVxkaiRe3YZEzGzfV2XgH5Jmu2T73ljejw=="
},
"@ampproject/remapping": {
"version": "2.2.0",
"resolved": "https://registry.npmmirror.com/@ampproject/remapping/-/remapping-2.2.0.tgz",
......
......@@ -8,6 +8,7 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"@amap/amap-jsapi-loader": "^1.0.1",
"autoprefixer": "^10.4.14",
"axios": "^1.3.4",
"core-js": "^3.8.3",
......
......@@ -16,6 +16,14 @@
.el-loading-text {
font-size: 24px !important;
}
.amap-logo {
display: none !important;
}
.amap-copyright {
opacity: 0 !important;
}
</style>
</head>
......
......@@ -16,22 +16,21 @@ export default {
},
methods: {
getXAccessToken() {
getXAccessToken(localStorage.getItem("token")).then((res) => {
if (this.$route.query.token_code != localStorage.getItem("token")) {
getXAccessToken(this.$route.query.token_code).then((res) => {
if (res.status == 200) {
localStorage.setItem("token", this.$route.query.token_code);
localStorage.setItem("Authorization", res.data.access_token);
this.$nextTick(() => {
this.signIn = true;
});
}
});
},
},
beforeCreate() {
console.log(this.$route);
if (this.$route.query.token_code) {
localStorage.setItem("token", this.$route.query.token_code);
} else {
this.signIn = true;
}
},
},
mounted() {
this.getXAccessToken();
},
......
......@@ -20,6 +20,14 @@ export function getBaseData() {
})
}
export function getSecurityData() {
return request({
url: '/pweb/s/project/safe/statis',
method: 'get',
})
}
export function getDeviceStatus() {
return request({
url: '/pweb/s/project/device/statis',
......@@ -51,10 +59,11 @@ export function getInOutData() {
})
}
export function getCurrentAttendance() {
export function getCurrentAttendance(params) {
return request({
url: '/pweb/s/personel/attendance',
method: 'get',
params
})
}
export function getPersonAreaStatus() {
......@@ -94,10 +103,11 @@ export function getAIdata() {
})
}
export function getWarningList() {
export function getWarningList(params) {
return request({
url: '/pweb/s/aiwarning/list',
method: 'get',
params
})
}
......
......@@ -48,7 +48,7 @@
</div>
</template>
<script>
import { getBaseInfo, getBaseData } from "@/api/index";
import { getBaseInfo } from "@/api/index";
export default {
name: "Index",
data() {
......@@ -57,8 +57,6 @@ export default {
weekDay: "",
date: "",
zoom: 1,
mainTitle:
"绍兴二院兰亭院区(康复医院)工程绍兴二院兰亭院区(康复医院)工程绍兴二院兰亭院区(康复医院)工程绍兴二院兰亭院区(康复医院)工程",
screenDetail: {},
leftNav: [],
rightNav: [],
......@@ -130,6 +128,7 @@ export default {
getBaseInfo().then((res) => {
console.log(res);
this.screenDetail = res.data;
document.title = res.data.project_name;
if (res.data.menu.length >= 4) {
this.leftNav = res.data.menu.slice(0, 4);
this.rightNav = res.data.menu.slice(4, res.data.menu.length);
......
......@@ -117,7 +117,7 @@
</div>
</div>
</ShadowContainer>
<Title text="安全管理"></Title>
<Title text="项目人员"></Title>
<ShadowContainer>
<div class="chart-container">
<img class="custom-chart" src="@/assets/chart.png" />
......@@ -204,7 +204,7 @@
</div>
</div>
</ShadowContainer>
<Title text="质量问题"> </Title>
<Title text="AI预警"> </Title>
<ShadowContainer>
<div class="chart-container">
<img class="custom-chart" src="@/assets/chart.png" />
......@@ -215,7 +215,12 @@
</div>
</template>
<script>
import { getBaseData, getDeviceStatus, getProgressDetail } from "@/api/index";
import {
getBaseData,
getSecurityData,
getDeviceStatus,
getProgressDetail,
} from "@/api/index";
export default {
name: "Construction",
data() {
......@@ -247,6 +252,11 @@ export default {
{ value: 735, name: "整改中" },
{ value: 580, name: "已完成" },
],
securityPieData: {
wzg: 0,
zgz: 0,
ywc: 0,
},
active: 4,
deviceStatus: [
{
......@@ -315,13 +325,22 @@ export default {
},
methods: {
renderSecurityChart() {
const chartData = [
{ value: this.securityPieData.wzg, name: "未整改" },
{ value: this.securityPieData.zgz, name: "整改中" },
{ value: this.securityPieData.ywc, name: "已完成" },
];
const chart = this.$echarts.init(this.$refs.securityChart);
let total = 0;
chartData.map((item) => {
total += item.value;
});
const option = {
title: {
x: "49%", //X坐标
y: "30%",
text: "0",
subtext: "安全管理",
text: total,
subtext: "项目人员",
textAlign: "center",
textStyle: {
//标题样式
......@@ -364,7 +383,7 @@ export default {
},
},
formatter: (name) => {
let data = this.pieChartData;
let data = chartData;
let target;
for (let i = 0, l = data.length; i < l; i++) {
if (data[i].name == name) {
......@@ -390,11 +409,20 @@ export default {
position: "center",
},
data: this.pieChartData,
data: chartData,
},
],
};
chart.setOption(option);
this.$nextTick(() => {
// 解决echarts图表放大溢出父容器
const resizeOb = new ResizeObserver((entries) => {
for (const entry of entries) {
this.$echarts.getInstanceByDom(entry.target).resize();
}
});
resizeOb.observe(document.getElementById("security-chart"));
});
},
renderQualityChart() {
const chart = this.$echarts.init(this.$refs.qualityChart);
......@@ -403,7 +431,7 @@ export default {
x: "49%", //X坐标
y: "30%",
text: "0",
subtext: "质量问题",
subtext: "AI预警",
textAlign: "center",
textStyle: {
//标题样式
......@@ -484,6 +512,12 @@ export default {
this.screenDetail = res.data;
}
});
getSecurityData().then((res) => {
if (res.status == 200) {
this.securityPieData = res.data;
this.renderSecurityChart();
}
});
getDeviceStatus().then((res) => {
if (res.status == 200) {
this.deviceStatus = res.data;
......@@ -497,7 +531,6 @@ export default {
},
},
mounted() {
this.renderSecurityChart();
this.renderQualityChart();
this.getBaseData();
this.$nextTick(() => {
......@@ -507,7 +540,6 @@ export default {
this.$echarts.getInstanceByDom(entry.target).resize();
}
});
resizeOb.observe(document.getElementById("security-chart"));
resizeOb.observe(document.getElementById("quality-chart"));
});
},
......
......@@ -47,12 +47,7 @@
<div class="today-warning">
<Title type="long" text="今日预警"></Title>
<ShadowContainer>
<vue-seamless-scroll
:data="warningList"
:class-option="classOption"
class="warp"
refs="scroll"
>
<div class="warp">
<div
class="person-check"
v-for="(warns, index) in warningList"
......@@ -80,10 +75,10 @@
</div>
</div>
<div class="status">状态:{{ warns.status_text }}</div>
<div class="time">时间:{{ warns.log_time }}</div>
<div class="time">时间:{{ warns.log_time_cn }}</div>
</div>
</div>
</div>
</vue-seamless-scroll>
</ShadowContainer>
</div>
<div class="right-container">
......@@ -123,9 +118,20 @@ export default {
{ value: 10, name: "未处理" },
],
screenDetail: {},
date: "",
};
},
methods: {
getTime() {
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
month = month > 9 ? month : "0" + month;
day = day < 10 ? "0" + day : day;
let today = year + "-" + month + "-" + day;
this.date = today;
},
renderWarningChart() {
const xAxisData = this.warningChartData.map((item) => {
return item.date;
......@@ -376,9 +382,22 @@ export default {
this.screenDetail = res.data;
}
});
getWarningList().then((res) => {
getWarningList({
start_log_time: `${this.date} 00:00:00`,
end_log_time: `${this.date} 23:59:59`,
}).then((res) => {
if (res.status == 200) {
this.warningList = res.data;
this.warningList = [...res.data];
setInterval(() => {
getWarningList({
start_log_time: `${this.date} 00:00:00`,
end_log_time: `${this.date} 23:59:59`,
}).then((res) => {
if (res.status == 200) {
this.warningList = [...res.data];
}
});
}, 60000);
}
});
getMonthWarningStatis().then((res) => {
......@@ -391,6 +410,7 @@ export default {
},
mounted() {
this.getTime();
this.getAIdata();
this.renderTodayChart();
this.renderHistoryChart();
......
......@@ -154,12 +154,7 @@
<div class="side-area">
<Title text="报警信息"></Title>
<ShadowContainer>
<vue-seamless-scroll
:data="warnings"
:class-option="classOption"
class="warp"
refs="scroll"
>
<div class="warp">
<div
class="warn-title"
:style="{ borderColor: '#fff' }"
......@@ -169,7 +164,7 @@
<div class="warn-text">{{ warn.text }}</div>
<div class="warn-time">{{ warn.time }}</div>
</div>
</vue-seamless-scroll>
</div>
</ShadowContainer>
<Title text="扬尘噪音"></Title>
<ShadowContainer>
......
......@@ -85,12 +85,7 @@
<div class="mid-area">
<Title text="实时考勤"></Title>
<ShadowContainer>
<vue-seamless-scroll
:data="checkList"
:class-option="classOption"
class="warp"
refs="scroll"
>
<div class="warp">
<div
class="person-check"
v-for="(person, index) in checkList"
......@@ -113,14 +108,14 @@
</div>
<div class="person-detail">
<div class="name">
<div class="name-text">姓名:{{ person.name }}</div>
<div class="name-text">姓名:{{ person.person_name }}</div>
<div class="work-no">工号:{{ person.job_number }}</div>
</div>
<div class="status">状态:{{ person.in_out_status_text }}</div>
<div class="time">时间:{{ person.latest_record_time }}</div>
<div class="status">状态:{{ person.type_str }}</div>
<div class="time">时间:{{ person.record_time_cn }}</div>
</div>
</div>
</div>
</vue-seamless-scroll>
</ShadowContainer>
<Title text="人员地域分布"></Title>
<ShadowContainer>
......@@ -205,9 +200,20 @@ export default {
lastweekAttendanceData: [],
lastweekWorkTypeData: [],
industryTypesTotal: 0,
date: "",
};
},
methods: {
getTime() {
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
month = month > 9 ? month : "0" + month;
day = day < 10 ? "0" + day : day;
let today = year + "-" + month + "-" + day;
this.date = today;
},
renderAreaChart() {
const chart = this.$echarts.init(this.$refs.areaChart);
......@@ -562,9 +568,21 @@ export default {
getRealNameStatus().then((res) => {
this.screenDetail = res.data;
});
getCurrentAttendance().then((res) => {
this.checkList = res.data;
getCurrentAttendance({
start_date: this.date,
end_date: this.date,
}).then((res) => {
this.checkList = [...res.data];
setInterval(() => {
getCurrentAttendance({
start_date: this.date,
end_date: this.date,
}).then((res) => {
this.checkList = [...res.data];
});
}, 60000);
});
getPersonAreaStatus().then((res) => {
this.personAreaDetail = res.data;
this.renderAreaChart();
......@@ -594,6 +612,7 @@ export default {
},
},
mounted() {
this.getTime();
this.getRealNameStatus();
},
};
......
This diff is collapsed.
......@@ -7,6 +7,8 @@ import EarlyWarning from "@/components/earlywarning/Index"
import Supervisory from "@/components/supervisory/Index"
import Tower from "@/components/tower/Index"
import Noise from "@/components/noise/Index"
import Safecap from "@/components/safecap/Index"
Vue.use(VueRouter)
......@@ -22,6 +24,7 @@ const router = new VueRouter({
{ path: 'supervisory', component: Supervisory },
{ path: 'tower', component: Tower },
{ path: 'noise', component: Noise },
{ path: 'safecap', component: Safecap },
]
},
......
......@@ -64,7 +64,7 @@ request.interceptors.response.use(
})
}
if (response.data.status == 401) {
// window.location.href = process.env.VUE_APP_RESOURCE_URL + 'pweb/m/login?is_screen=1'
window.location.href = process.env.VUE_APP_RESOURCE_URL + 'pweb/m/login?is_screen=1'
}
return response.data
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment