diff --git a/src/api/board/cs2.js b/src/api/board/cs2.js index c59cc56..b6aca0f 100644 --- a/src/api/board/cs2.js +++ b/src/api/board/cs2.js @@ -5,7 +5,10 @@ export function getHourProductionList(query) { return request({ url: '/mes/reportWork/getHourProductionList', method: 'get', - params: query + params: query, + header:{ + PoolName:'ds_999' + } }); } @@ -14,6 +17,9 @@ export function getAgvData(query) { return request({ url: 'http://192.168.202.25:9001/api/scada/agvdata', method: 'get', - params: query + params: query, + header:{ + PoolName:'ds_999' + } }); } diff --git a/src/api/board/cs3.js b/src/api/board/cs3.js new file mode 100644 index 0000000..16a9822 --- /dev/null +++ b/src/api/board/cs3.js @@ -0,0 +1,79 @@ +import request from '@/utils/request' + +// 查询产量 +export function dryRoomDataCarousel(query) { + return request({ + url: '/mes/wcsInterface/dryRoomDataCarousel', + method: 'post', + data: { + "factory": "999" + } + }); +} + +// 查询产量 +export function getHourProductionList(query) { + return request({ + url: '/mes/reportWork/getHourProductionList', + method: 'get', + params: query, + header:{ + PoolName:'ds_999' + } + }); +} + +export function EnergyExpend(query) { + return request({ + url: '/mes/h5/EnergyExpend', + method: 'get', + params: query, + header:{ + PoolName:'ds_1000' + } + }); +} + +export function agvdata(query) { + return request({ + url: 'http://192.168.202.25:9001/api/scada/agvdata', + method: 'get', + params: query, + header:{ + PoolName:'ds_999' + } + }); +} + +export function PlanAchievementRate(query) { + return request({ + url: '/mes/reportWork/PlanAchievementRate', + method: 'get', + params: query, + header:{ + PoolName:'ds_999' + } + }); +} + +export function getHfChartDatas(query) { + return request({ + url: '/quality/qcProCheck/getHfChartDatas', + method: 'get', + params: query, + header:{ + PoolName:'ds_999' + } + }); +} + +export function getHourProductionLists(query) { + return request({ + url: '/mes/reportWork/getHourProductionLists', + method: 'get', + params: query, + header:{ + PoolName:'ds_999' + } + }); +} diff --git a/src/assets/board/cs3/bg.jpg b/src/assets/board/cs3/bg.jpg new file mode 100644 index 0000000..527d30c Binary files /dev/null and b/src/assets/board/cs3/bg.jpg differ diff --git a/src/assets/board/cs3/bg.png b/src/assets/board/cs3/bg.png new file mode 100644 index 0000000..8873759 Binary files /dev/null and b/src/assets/board/cs3/bg.png differ diff --git a/src/components/Charts/Chart.vue b/src/components/Charts/Chart.vue new file mode 100644 index 0000000..0899129 --- /dev/null +++ b/src/components/Charts/Chart.vue @@ -0,0 +1,35 @@ + + + diff --git a/src/router/index.js b/src/router/index.js index a07ce7a..f5a8fcd 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -33,6 +33,7 @@ export const constantRoutes = [ {path: '/cs', component: () => import('@/views/cs/index.vue')}, {path: '/cs2', component: () => import('@/views/cs/index2.vue')}, {path: '/cs3', component: () => import('@/views/cs/index3.vue')}, + {path: '/cs3_1', component: () => import('@/views/cs/index3_1.vue')}, { path: '/redirect', component: Layout, diff --git a/src/utils/request.js b/src/utils/request.js index c46b968..8099fad 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -24,8 +24,8 @@ const service = axios.create({ // request拦截器 service.interceptors.request.use(config => { if(localStorage.getItem('USER_POOL_NAME_CURRENT')){ - config.headers['poolName'] = localStorage.getItem('USER_POOL_NAME_CURRENT'); - console.log(localStorage.getItem('USER_POOL_NAME_CURRENT')) + config.headers['poolName'] = config.header?.PoolName || localStorage.getItem('USER_POOL_NAME_CURRENT'); + console.log(config.headers['poolName']) } // 是否需要设置 token const isToken = (config.headers || {}).isToken === false diff --git a/src/views/cs/index2.vue b/src/views/cs/index2.vue index 3bd0e7a..cd41368 100644 --- a/src/views/cs/index2.vue +++ b/src/views/cs/index2.vue @@ -7,7 +7,8 @@
烘房区
收坯区
1F
-
2F
+ +
2F
3F
4F
5F
@@ -84,7 +85,10 @@
{{ i.equName }}
设备产量: {{ i.quantity }}
-
设备状态: {{ parseFloat(i.quantity) > 0 ? '运行' : '停机' }}
+
设备状态: {{ + parseFloat(i.quantity) > 0 ? '运行' : '停机' + }} +
@@ -94,14 +98,17 @@ :style="`display:${loopIndex === 18+k?'inline-block':''}`">
{{ i.equName }}
设备产量: {{ i.quantity }}
-
设备状态: {{ parseFloat(i.quantity) > 0 ? '运行' : '停机' }} +
设备状态: {{ + parseFloat(i.quantity) > 0 ? '运行' : '停机' + }}
-
+
-
@@ -110,6 +117,7 @@ import * as TWEEN from '@tweenjs/tween.js' import {getAgvData, getHourProductionList} from "../../api/board/cs2"; +import {parseTime} from "../../utils/openPlatform"; export default { data() { @@ -278,30 +286,29 @@ export default { equipmentData: [], agvData: [], siteData: { - x: 121000, - y: 82000 + x: 120565, + y: 71313 } } }, methods: { getLocation(x, y) { - let a = (66 + (90 - 66) * y) * x - let b = 12 * y - let xLocation = 16 - b + a - let yLocation = 22 + (84 - 22) * y + let a = (70 + (91 - 70) * y) * x + let b = 10.5 * y + let xLocation = 14.5 - b + a + let yLocation = 29 + (85 - 29) * y return ` left: ${xLocation}%;top: ${yLocation}%;` }, getAgvLocation() { let agvArr = [] getAgvData().then(e => { - console.log(Math.max(...e.Data.map(v => v.X)), Math.max(...e.Data.map(v => v.Y))) e.Data.forEach(v => { agvArr.push({ id: v.AgvId, - x: (v.X - 126000) / this.siteData.x, - y: (72000 - (v.Y - 116000)) / this.siteData.y, + x: (v.X - 126061) / this.siteData.x, + y: (71313 - (v.Y - 116722)) / this.siteData.y, rotate: v.Angle, - isGoods: false, + IsLoad: v.IsLoad, show: v.X < 245000 && v.X > 126000 && v.Y < 187000 && v.Y > 116000 // show: true }) @@ -315,24 +322,25 @@ export default { if (this.agvData.filter(r => r.id === v.AgvId).length >= 1) { let f1 = new TWEEN.Tween(this.agvData.find(r => r.id === v.AgvId)).to({ rotate: v.Angle, - }, 100).start().onComplete(()=>{ + }, 100).start().onComplete(() => { f1 = null }) let f2 = new TWEEN.Tween(this.agvData.find(r => r.id === v.AgvId)).to({ - x: (v.X - 126000) / this.siteData.x, - y: (72000 - (v.Y - 116000)) / this.siteData.y, - show: v.X < 245000 && v.X > 126000 && v.Y < 187000 && v.Y > 116000 + x: (v.X - 126061) / this.siteData.x, + y: (71313 - (v.Y - 116722)) / this.siteData.y, + show: v.X < 245000 && v.X > 126000 && v.Y < 187000 && v.Y > 116000, + IsLoad: v.IsLoad, // show: true - }, time - 100).start().onComplete(()=>{ + }, time - 100).start().onComplete(() => { f2 = null }) } else { this.agvData.push({ id: v.AgvId, - x: (v.X - 126000) / this.siteData.x, - y: (72000 - (v.Y - 116000)) / this.siteData.y, + x: (v.X - 126061) / this.siteData.x, + y: (71313 - (v.Y - 116722)) / this.siteData.y, rotate: v.Angle, - isGoods: false, + IsLoad: v.IsLoad, show: v.X < 245000 && v.X > 126000 && v.Y < 187000 && v.Y > 116000 // show: true }) @@ -341,7 +349,29 @@ export default { }) }, getData() { - getHourProductionList().then(e => { + + let time = parseTime(new Date(), '{h}-{i}').split('-') + let i = parseFloat(time[0]) || 0 + let s = parseFloat(time [1]) || 0 + let createTimeStart = `${parseTime(new Date(), '{y}-{m}-{d}')} 07:30:00` + let createTimeEnd = `${parseTime(new Date(), '{y}-{m}-{d}')} 19:30:00` + if (parseFloat(`${i}.${s}`) > 7.3 && parseFloat(`${i}.${s}`) < 19.3) { + createTimeStart = `${parseTime(new Date(), '{y}-{m}-{d}')} 07:30:00` + createTimeEnd = `${parseTime(new Date(), '{y}-{m}-{d}')} 19:30:00` + } else if (parseFloat(`${i}.${s}`) < 7.3) { + createTimeStart = `${parseTime(new Date(), '{y}-{m}-')}${parseFloat(parseTime(new Date(), '${d}')) - 1} 19:30:00` + createTimeEnd = `${parseTime(new Date(), '{y}-{m}-{d}')} 07:30:00` + } else if (parseFloat(`${i}.${s}`) > 19.3) { + createTimeStart = `${parseTime(new Date(), '{y}-{m}-{d}')} 19:30:00` + createTimeEnd = `${parseTime(new Date(), '{y}-{m}-')}${parseFloat(parseTime(new Date(), '${d}')) + 1} 07:30:00` + } else { + createTimeStart = `${parseTime(new Date(), '{y}-{m}-{d}')} 07:30:00` + createTimeEnd = `${parseTime(new Date(), '{y}-{m}-{d}')} 19:30:00` + } + getHourProductionList({ + productDateStart: createTimeStart, + productDateEnd: createTimeEnd + }).then(e => { let hfArr = [] let equipmentArr = [] for (let i = 0; i < 18; i++) { @@ -360,6 +390,7 @@ export default { this.getAgvLocation() let time = 2 * 1000 setInterval(() => { + this.getData() this.updateAGVLocation(time) }, time) diff --git a/src/views/cs/index3.vue b/src/views/cs/index3.vue index aedf388..2d17b18 100644 --- a/src/views/cs/index3.vue +++ b/src/views/cs/index3.vue @@ -1,30 +1,503 @@ diff --git a/src/views/cs/index3_1.vue b/src/views/cs/index3_1.vue new file mode 100644 index 0000000..aedf388 --- /dev/null +++ b/src/views/cs/index3_1.vue @@ -0,0 +1,30 @@ + + +