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

安全帽页面

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