工厂驾驶舱

This commit is contained in:
‘937886381’ 2024-05-30 16:00:18 +08:00
parent 4569d047d7
commit 91fd1b09d5
22 changed files with 1357 additions and 315 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 257 KiB

View File

@ -4,16 +4,16 @@ function __resizeHandler(entries) {
console.log(entries) console.log(entries)
for (const entry of entries) { for (const entry of entries) {
if (entry.contentBoxSize) { if (entry.contentBoxSize) {
// const contentBoxSize = Array.isArray(entry.contentBoxSize) const contentBoxSize = Array.isArray(entry.contentBoxSize)
// ? entry.contentBoxSize[0] ? entry.contentBoxSize[0]
// : entry.contentBoxSize; : entry.contentBoxSize;
// this.chart_mixin_chartInstance.resize({ this.chart_mixin_chartInstance.resize({
// width: width:
// contentBoxSize.inlineSize < this.MIN_WIDTH contentBoxSize.inlineSize < this.MIN_WIDTH
// ? this.MIN_WIDTH ? this.MIN_WIDTH
// : contentBoxSize.inlineSize, : contentBoxSize.inlineSize,
// height: contentBoxSize.blockSize, height: contentBoxSize.blockSize,
// }); });
} else { } else {
// manipulate contentRect // manipulate contentRect
this.chart_mixin_chartInstance.resize({ this.chart_mixin_chartInstance.resize({

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-10 11:10:54 * @Date: 2024-05-10 11:10:54
* @LastEditTime: 2024-05-29 09:09:43 * @LastEditTime: 2024-05-30 13:23:03
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->

View File

@ -1,13 +1,14 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-07 10:25:10 * @Date: 2024-05-07 10:25:10
* @LastEditTime: 2024-05-29 16:10:45 * @LastEditTime: 2024-05-30 11:19:51
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
<template> <template>
<div class="std-rate"> <!-- <div class="order"> -->
<div class="std-rate" style="width: 100%; overflow: hidden scroll; height: 400px">
<div class="span-2"> <div class="span-2">
<StdRateItem :period="period" :city="cities[5]" /> <StdRateItem :period="period" :city="cities[5]" />
</div> </div>
@ -103,7 +104,7 @@ export default {
.std-rate { .std-rate {
display: flex; display: flex;
// gap: 1px; // gap: 1px;
flex: 1 1 auto; // flex: 1 1 auto;
// display: -webkit-box; // display: -webkit-box;
flex-wrap: wrap; flex-wrap: wrap;
@ -111,6 +112,9 @@ export default {
// grid-template-columns: repeat(2, 1fr); // grid-template-columns: repeat(2, 1fr);
// grid-template-rows: repeat(4, 1fr); // grid-template-rows: repeat(4, 1fr);
} }
.std-rate::-webkit-scrollbar {
display: none;
}
.flex-item{ .flex-item{
// flex: 1 1 auto; // flex: 1 1 auto;
width: 50%; width: 50%;

View File

@ -218,7 +218,7 @@ export default {
// width: 290px; // width: 290px;
align-self: stretch; align-self: stretch;
// flex: 1 1 auto; // flex: 1 1 auto;
align-items: center; // align-items: center;
// margin:0 auto; // margin:0 auto;
// padding: 0 10%;; // padding: 0 10%;;
/* margin: 10%; */ /* margin: 10%; */

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-07 10:04:53 * @Date: 2024-05-07 10:04:53
* @LastEditTime: 2024-05-29 14:24:48 * @LastEditTime: 2024-05-30 11:13:01
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-20 16:04:18 * @Date: 2024-05-20 16:04:18
* @LastEditTime: 2024-05-29 16:08:31 * @LastEditTime: 2024-05-30 11:14:17
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -114,7 +114,7 @@ export default {
height: calc(100% + 38px); height: calc(100% + 38px);
} }
.other { .other {
height: calc(100% + 490px); height: calc(100% + 240px);
} }
.copilot-footer { .copilot-footer {
/** position: absolute; /** position: absolute;

View File

@ -1,10 +1,3 @@
<!--
* @Author: zhp
* @Date: 2024-05-21 10:13:48
* @LastEditTime: 2024-05-24 15:03:11
* @LastEditors: zhp
* @Description:
-->
<template> <template>
<div class="factory-layout"> <div class="factory-layout">
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period" <FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
@ -12,15 +5,21 @@
<div class="factory-section"> <div class="factory-section">
<section class="top flex"> <section class="top flex">
<db-container title="生产监控" icon="prod"> <db-container title="生产监控" icon="prod">
<prod-monitor :prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" /> <prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
</db-container> </db-container>
<db-container title="单监控" icon="order"> <db-container title="单监控" icon="order">
<order :prodOrder="prodOrder" /> <order :prodOrder="prodOrder" />
</db-container> </db-container>
<!-- <db-container title="" icon="store"> --> <!-- <db-container title="" icon="store"> -->
<!-- <store :stock="stock" /> --> <!-- <store :stock="stock" /> -->
<!-- </db-container> --> <!-- </db-container> -->
</section> </section>
<!-- <section class="bottom flex"> -->
<!-- <db-container title="" icon="energy"> -->
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
<!-- </db-container> -->
<!-- </section> -->
</div> </div>
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div> <div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
</div> </div>
@ -29,8 +28,9 @@
import FactoryDataHeader from "./../components/FactoryDataHeader.vue"; import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
import Container from "./components/Container.vue"; import Container from "./components/Container.vue";
import ProdMonitor from "./components/ProdMonitor.vue"; import ProdMonitor from "./components/ProdMonitor.vue";
import Store from "./components/Store.vue"; import { deepClone } from "@/utils";
import Energy from "./components/Energy.vue"; // import Store from "./components/Store.vue";
// import Energy from "./components/Energy.vue";
import Order from "./components/Order.vue"; import Order from "./components/Order.vue";
import { cockpitDataMonitor } from "@/api/produceData"; import { cockpitDataMonitor } from "@/api/produceData";
export default { export default {
@ -39,21 +39,27 @@ export default {
FactoryDataHeader, FactoryDataHeader,
DbContainer: Container, DbContainer: Container,
ProdMonitor, ProdMonitor,
Store, // Store,
Energy, // Energy,
Order, Order,
}, },
data() { data() {
return { return {
companyId: 6, companyId: 6,
than: '同比',
companyName: "蚌埠中建材光电材料有限公司", companyName: "蚌埠中建材光电材料有限公司",
period: 1, period: 1,
show:true, show: false,
than: '同比',
data: {},
// //
prodOutPut: [], // prodOutPut: [], //
prodFto: [], // prodFto: [], //
stock: {}, // stock: {}, //
factoryData: {
preDataDetail: [],
currentDataDetail: {},
targetDataDetail: [],
},
energyCockpits: [], // energyCockpits: [], //
prodOrder: [], // prodOrder: [], //
energyLegend: [ energyLegend: [
@ -67,16 +73,16 @@ export default {
this.getMes(); this.getMes();
}, },
methods: { methods: {
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updateCompany(obj) { updateCompany(obj) {
this.companyId = obj.companyId; this.companyId = obj.companyId;
this.companyName = obj.companyName; this.companyName = obj.companyName;
this.getMes(); this.getMes();
}, },
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updatePeriod(val) { updatePeriod(val) {
this.period = val; this.period = val;
this.getMes(); this.getMes();
@ -85,13 +91,77 @@ export default {
cockpitDataMonitor({ cockpitDataMonitor({
factorys: [this.companyId], factorys: [this.companyId],
date: this.period, date: this.period,
mode: this.than === '同比' ? 0 : 1
}).then((res) => { }).then((res) => {
console.log(res); console.log(res);
this.prodOutPut = res.data.prodOutputMonitorShDO || []; this.prodOutPut = res.data.prodOutputMonitorShDO || [];
this.prodFto = res.data.prodOutputFtoDO || []; this.prodFto = res.data.prodOutputFtoDO || [];
this.stock = res.data.stockDO || {}; this.prodOrder = res.data.prodWorkOrderDO || [];
this.energyCockpits = res.data.energyCockpitsDO || []; let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
this.prodOrder = res.data.prodOrderMonitorDO || []; let preFtoData = res.data.previousProdOutputFtoDO || [];
let preData = res.data.previousProdOutputMonitorShDO || [];
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
let targetListResponse = res.data.prodTargetMonitorDO || [];
let preDataDetail = []
let currentDataDetail = []
let targetDataDetail = []
if (prodOutputFtoListRes) {
for (const factory of prodOutputFtoListRes) {
console.log(factory);
currentDataDetail[0] = factory.chipInput
}
}
if (preFtoData) {
for (const factory of preFtoData) {
console.log(factory);
// const fId = this.getPreFactoryId(factory);
// const preFId = getPreFactoryId(factory);
// if (fId) {
preDataDetail[0] = factory.previousYearChipInput
// }
// if (preFId) {
// ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
}
}
if (preData && preData[0] != null) {
for (const factory of preData) {
if (factory.previousGlassType === 0) {
preDataDetail[1] = factory.previousYearOutputNumber
} else if (factory.previousGlassType === 1) {
preDataDetail[2] = factory.previousYearOutputNumber
} else if (factory.previousYearOutputNumber === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
if (targetListResponse && targetListResponse[0] != null) {
for (const factory of targetListResponse) {
targetDataDetail[0] = factory.ftoInput
// if (factory.previousGlassType === 0) {
targetDataDetail[1] = factory.chipYield
// } else if (factory.previousGlassType === 1) {
targetDataDetail[2] = factory.componentYield
targetDataDetail[3] = factory.bipvProductoutput
// }
}
}
// console.log('ftoInvest',ftoInvest)
if (factoryListResponse && factoryListResponse[0] != null) {
for (const factory of factoryListResponse) {
// targetDataDetail[0] = factory.ftoInput
if (factory.glassType === 0) {
currentDataDetail[1] = factory.outputNumber
} else if (factory.glassType === 1) {
currentDataDetail[2] = factory.outputNumber
}else if (factory.glassType === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
this.factoryData.preDataDetail = preDataDetail
this.factoryData.currentDataDetail = currentDataDetail
this.factoryData.targetDataDetail = targetDataDetail
}); });
}, },
}, },
@ -100,8 +170,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.factory-layout { .factory-layout {
padding: 16px; padding: 16px;
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
no-repeat;
position: absolute; position: absolute;
height: calc(100% + 38px); height: calc(100% + 38px);
left: -16px; left: -16px;
@ -112,21 +181,25 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 8px; gap: 8px;
.factory-section { .factory-section {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 16px; gap: 16px;
.flex { .flex {
display: flex; display: flex;
gap: 16px; gap: 16px;
flex: 1; flex: 1;
} }
.top > div,
.bottom > div { .top>div,
.bottom>div {
height: 100%; height: 100%;
} }
} }
.factory-footer { .factory-footer {
/** position: absolute; /** position: absolute;
bottom: 10px; **/ bottom: 10px; **/

View File

@ -1,10 +1,3 @@
<!--
* @Author: zhp
* @Date: 2024-05-21 10:13:36
* @LastEditTime: 2024-05-24 15:03:16
* @LastEditors: zhp
* @Description:
-->
<template> <template>
<div class="factory-layout"> <div class="factory-layout">
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period" <FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
@ -12,15 +5,21 @@
<div class="factory-section"> <div class="factory-section">
<section class="top flex"> <section class="top flex">
<db-container title="生产监控" icon="prod"> <db-container title="生产监控" icon="prod">
<prod-monitor :prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" /> <prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
</db-container> </db-container>
<db-container title="单监控" icon="order"> <db-container title="单监控" icon="order">
<order :prodOrder="prodOrder" /> <order :prodOrder="prodOrder" />
</db-container> </db-container>
<!-- <db-container title="" icon="store"> --> <!-- <db-container title="" icon="store"> -->
<!-- <store :stock="stock" /> --> <!-- <store :stock="stock" /> -->
<!-- </db-container> --> <!-- </db-container> -->
</section> </section>
<!-- <section class="bottom flex"> -->
<!-- <db-container title="" icon="energy"> -->
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
<!-- </db-container> -->
<!-- </section> -->
</div> </div>
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div> <div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
</div> </div>
@ -29,8 +28,9 @@
import FactoryDataHeader from "./../components/FactoryDataHeader.vue"; import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
import Container from "./components/Container.vue"; import Container from "./components/Container.vue";
import ProdMonitor from "./components/ProdMonitor.vue"; import ProdMonitor from "./components/ProdMonitor.vue";
import Store from "./components/Store.vue"; import { deepClone } from "@/utils";
import Energy from "./components/Energy.vue"; // import Store from "./components/Store.vue";
// import Energy from "./components/Energy.vue";
import Order from "./components/Order.vue"; import Order from "./components/Order.vue";
import { cockpitDataMonitor } from "@/api/produceData"; import { cockpitDataMonitor } from "@/api/produceData";
export default { export default {
@ -39,8 +39,8 @@ export default {
FactoryDataHeader, FactoryDataHeader,
DbContainer: Container, DbContainer: Container,
ProdMonitor, ProdMonitor,
Store, // Store,
Energy, // Energy,
Order, Order,
}, },
data() { data() {
@ -48,12 +48,18 @@ export default {
companyId: 4, companyId: 4,
companyName: "成都中建材光电材料有限公司", companyName: "成都中建材光电材料有限公司",
period: 1, period: 1,
show: false,
than: '同比', than: '同比',
show: true, data: {},
// //
prodOutPut: [], // prodOutPut: [], //
prodFto: [], // prodFto: [], //
stock: {}, // stock: {}, //
factoryData: {
preDataDetail: [],
currentDataDetail: {},
targetDataDetail: [],
},
energyCockpits: [], // energyCockpits: [], //
prodOrder: [], // prodOrder: [], //
energyLegend: [ energyLegend: [
@ -67,16 +73,16 @@ export default {
this.getMes(); this.getMes();
}, },
methods: { methods: {
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updateCompany(obj) { updateCompany(obj) {
this.companyId = obj.companyId; this.companyId = obj.companyId;
this.companyName = obj.companyName; this.companyName = obj.companyName;
this.getMes(); this.getMes();
}, },
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updatePeriod(val) { updatePeriod(val) {
this.period = val; this.period = val;
this.getMes(); this.getMes();
@ -85,13 +91,77 @@ export default {
cockpitDataMonitor({ cockpitDataMonitor({
factorys: [this.companyId], factorys: [this.companyId],
date: this.period, date: this.period,
mode: this.than === '同比' ? 0 : 1
}).then((res) => { }).then((res) => {
console.log(res); console.log(res);
this.prodOutPut = res.data.prodOutputMonitorShDO || []; this.prodOutPut = res.data.prodOutputMonitorShDO || [];
this.prodFto = res.data.prodOutputFtoDO || []; this.prodFto = res.data.prodOutputFtoDO || [];
this.stock = res.data.stockDO || {}; this.prodOrder = res.data.prodWorkOrderDO || [];
this.energyCockpits = res.data.energyCockpitsDO || []; let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
this.prodOrder = res.data.prodOrderMonitorDO || []; let preFtoData = res.data.previousProdOutputFtoDO || [];
let preData = res.data.previousProdOutputMonitorShDO || [];
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
let targetListResponse = res.data.prodTargetMonitorDO || [];
let preDataDetail = []
let currentDataDetail = []
let targetDataDetail = []
if (prodOutputFtoListRes) {
for (const factory of prodOutputFtoListRes) {
console.log(factory);
currentDataDetail[0] = factory.chipInput
}
}
if (preFtoData) {
for (const factory of preFtoData) {
console.log(factory);
// const fId = this.getPreFactoryId(factory);
// const preFId = getPreFactoryId(factory);
// if (fId) {
preDataDetail[0] = factory.previousYearChipInput
// }
// if (preFId) {
// ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
}
}
if (preData && preData[0] != null) {
for (const factory of preData) {
if (factory.previousGlassType === 0) {
preDataDetail[1] = factory.previousYearOutputNumber
} else if (factory.previousGlassType === 1) {
preDataDetail[2] = factory.previousYearOutputNumber
} else if (factory.previousYearOutputNumber === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
if (targetListResponse && targetListResponse[0] != null) {
for (const factory of targetListResponse) {
targetDataDetail[0] = factory.ftoInput
// if (factory.previousGlassType === 0) {
targetDataDetail[1] = factory.chipYield
// } else if (factory.previousGlassType === 1) {
targetDataDetail[2] = factory.componentYield
targetDataDetail[3] = factory.bipvProductoutput
// }
}
}
// console.log('ftoInvest',ftoInvest)
if (factoryListResponse && factoryListResponse[0] != null) {
for (const factory of factoryListResponse) {
// targetDataDetail[0] = factory.ftoInput
if (factory.glassType === 0) {
currentDataDetail[1] = factory.outputNumber
} else if (factory.glassType === 1) {
currentDataDetail[2] = factory.outputNumber
} else if (factory.glassType === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
this.factoryData.preDataDetail = preDataDetail
this.factoryData.currentDataDetail = currentDataDetail
this.factoryData.targetDataDetail = targetDataDetail
}); });
}, },
}, },
@ -100,8 +170,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.factory-layout { .factory-layout {
padding: 16px; padding: 16px;
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
no-repeat;
position: absolute; position: absolute;
height: calc(100% + 38px); height: calc(100% + 38px);
left: -16px; left: -16px;
@ -112,21 +181,25 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 8px; gap: 8px;
.factory-section { .factory-section {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 16px; gap: 16px;
.flex { .flex {
display: flex; display: flex;
gap: 16px; gap: 16px;
flex: 1; flex: 1;
} }
.top > div,
.bottom > div { .top>div,
.bottom>div {
height: 100%; height: 100%;
} }
} }
.factory-footer { .factory-footer {
/** position: absolute; /** position: absolute;
bottom: 10px; **/ bottom: 10px; **/

View File

@ -134,10 +134,27 @@ export default {
// { offset: 1, color: "#12FFF5" + "00" }, // { offset: 1, color: "#12FFF5" + "00" },
// ]), // ]),
// }, // },
barWidth: '18', barWidth: 12,
itemStyle: { itemStyle: {
// barWidth: 2, borderRadius: [10, 10, 0, 0],
color: '#12FFF5' color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "#57abf8", // 0%
},
{
offset: 1,
color: "#364BFE66", // 100%
},
],
global: false, // false
},
}, },
symbol: "circle", symbol: "circle",
symbolSize: 8, symbolSize: 8,
@ -211,15 +228,16 @@ export default {
}, 500)(); }, 500)();
}, },
initChart() { initChart() {
console.log("this.energyCockpits", this.energyCockpits);
let orderXAxis = ['目标产量', '计划投入量', '实际投入量', '实际产出量', '废品数量', '待再加工数量']; let orderXAxis = ['目标产量', '计划投入量', '实际投入量', '实际产出量', '废品数量', '待再加工数量'];
// let n = 0; // let n = 0;
let seriesArr =[] let seriesArr =[]
seriesArr[0] = this.energyCockpits[0].targetProduction ? this.energyCockpits[0].targetProduction :0 seriesArr[0] = this.energyCockpits.length != 0 && this.energyCockpits[0].targetProduction ? this.energyCockpits[0].targetProduction :0
seriesArr[1] = this.energyCockpits[0].plannedInvestment ? this.energyCockpits[0].plannedInvestment : 0 seriesArr[1] = this.energyCockpits.length != 0 && this.energyCockpits[0].plannedInvestment ? this.energyCockpits[0].plannedInvestment : 0
seriesArr[2] = this.energyCockpits[0].actualInvestment ? this.energyCockpits[0].actualInvestment : 0 seriesArr[2] = this.energyCockpits.length != 0 && this.energyCockpits[0].actualInvestment ? this.energyCockpits[0].actualInvestment : 0
seriesArr[3] = this.energyCockpits[0].actualProduction ? this.energyCockpits[0].actualProduction : 0 seriesArr[3] = this.energyCockpits.length != 0 && this.energyCockpits[0].actualProduction ? this.energyCockpits[0].actualProduction : 0
seriesArr[4] = this.energyCockpits[0].wasteNum ? this.energyCockpits[0].wasteNum : 0 seriesArr[4] = this.energyCockpits.length != 0 && this.energyCockpits[0].wasteNum ? this.energyCockpits[0].wasteNum : 0
seriesArr[5] = this.energyCockpits[0].reworkNum ? this.energyCockpits[0].reworkNum : 0 seriesArr[5] = this.energyCockpits.length != 0 && this.energyCockpits[0].reworkNum ? this.energyCockpits[0].reworkNum : 0
console.log(seriesArr); console.log(seriesArr);
// let seriesArr = [ // let seriesArr = [

View File

@ -0,0 +1,343 @@
<!--
* @Author: zhp
* @Date: 2024-05-30 08:58:39
* @LastEditTime: 2024-05-30 10:38:32
* @LastEditors: zhp
* @Description:
-->
<template>
<chart-container class="bar-chart-base">
<div class="legend">
<span v-for="(item,index) in legend" :key="index" class="legend-item"
:style="{ fontSize: isFullscreen ? '0.58vw' : '0.54vw' }">{{ item.label }}</span>
</div>
<div ref="oeeChart" style="height:96%;width:100%"></div>
</chart-container>
</template>
<script>
import screenfull from "screenfull";
import ChartContainer from "./ChartContainer.vue";
// import chartMixin from "@/mixins/chart.js";
import { debounce } from "@/utils/debounce";
import * as echarts from "echarts";
export default {
name: "BarChartBase",
components: {
ChartContainer,
},
// mixins: [chartMixin],
props: {
vHeight: {
type: Number,
default: 36,
},
legend: {
type: Array,
required: true,
},
xAxis: {
type: Array,
required: true,
},
series: {
type: Array,
required: true,
},
in: {
type: String,
default: "",
},
},
data() {
return {
width: '100%',
isFullscreen: false,
actualOptions: null,
options: {
grid: {
left: "5%",
right: "0%",
bottom: "3%",
top: "15%",
containLabel: true,
},
tooltip: {},
xAxis: {
axisTick: {
show: false,
},
axisLine: {
lineStyle: {
color: "#4561AE",
},
},
axisLabel: {
color: "#fff",
fontSize: 12,
},
data: this.xAxis,
},
yAxis: {
name: "单位/%",
nameTextStyle: {
color: "#fff",
fontSize: 12,
},
axisTick: {
show: false,
},
axisLabel: {
color: "#fff",
fontSize: 12,
},
axisLine: {
show: true,
lineStyle: {
color: "#4561AE",
},
},
splitLine: {
lineStyle: {
color: "#4561AE",
},
},
},
series: [
{
name: "fto", // this.series[0].name,
type: "bar",
barWidth: 12,
itemStyle: {
borderRadius: [10, 10, 0, 0],
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "#12f7f1", // 0%
},
{
offset: 0.35,
color: "#12f7f177", // 100%
},
{
offset: 0.75,
color: "#12f7f133", // 100%
},
{
offset: 1,
color: "transparent", // 100%
},
],
global: false, // false
},
},
data: [], // this.series[0].data,
},
{
name: "", // this.series[1].name,
type: "bar",
barWidth: 12,
// tooltip: {
// valueFormatter: function (value) {
// return value + " ml";
// },
// },
itemStyle: {
borderRadius: [10, 10, 0, 0],
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "#57abf8", // 0%
},
{
offset: 1,
color: "#364BFE66", // 100%
},
],
global: false, // false
},
},
data: [], // this.series[1].data,
},
{
name: "", // "2024",
type: "bar",
barWidth: 12,
itemStyle: {
borderRadius: [10, 10, 0, 0],
color: {
type: "linear",
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: "#f3c000", // 0%
},
{
offset: 1,
color: "#f3c00033",
},
{
offset: 1,
color: "transparent", // 100%
},
],
global: false, // false
},
},
data: [], // this.series[0].data,
},
],
},
};
},
computed: {
isOpen() {
return this.$store.getters.sidebar.opened
},
},
watch: {
xAxis(val) {
this.options.xAxis.data = val
this.canvasReset()
},
isOpen(val) {
this.canvasReset()
},
/** 全屏状态切换时,对柱子粗细和字体大小进行相应调整 */
isFullscreen(val) {
this.actualOptions.series.map((item) => {
item.barWidth = val ? 18 : 12;
});
this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
// if (val === false && this.isOpen === true) {
// console.log(val)
// this.width = 97 + '%'
// this.canvasReset()
// } else if (val === false && this.isOpen === false) {
// this.width = 100 + '%'
// this.canvasReset()
// }
// this.actualOptions.series.map((item) => {
// item.barWidth = val ? 18 : 12;
// });
// this.actualOptions.xAxis.axisLabel.fontSize = val ? 18 : 12;
// this.actualOptions.yAxis.axisLabel.fontSize = val ? 18 : 12;
// this.actualOptions.yAxis.nameTextStyle.fontSize = val ? 18 : 12;
this.initChart(this.actualOptions)
this.canvasReset()
},
series(val) {
if (!val) {
this.initChart(this.options);
return;
}
// console.log('val', val)
const actualOptions = JSON.parse(JSON.stringify(this.options))
// actualOptions.xAxis.data = val
console.log(actualOptions)
actualOptions.series[0].data = val[0].data;
actualOptions.series[0].name = val[0].name;
actualOptions.series[1].data = val?.[1]?.data;
actualOptions.series[1].name = val?.[1]?.name;
actualOptions.series[2].data = val?.[2]?.data || [];
actualOptions.series[2].name = val?.[2]?.name || "";
this.actualOptions = actualOptions;
this.initChart(actualOptions);
},
},
mounted() {
// if (screenfull.isEnabled) {
// screenfull.on("change", () => {
// this.isFullscreen = screenfull.isFullscreen;
// });
// }
// if (screenfull.isEnabled) {
// screenfull.on("change", () => {
// this.isFullscreen = screenfull.isFullscreen;
// });
// }
this.actualOptions = this.options
this.canvasReset();
window.addEventListener("resize", this.canvasReset);
},
beforeDestroy() {
if (this.chart) {
this.chart.dispose();
}
},
destroyed() {
window.removeEventListener("resize", this.canvasReset);
},
methods: {
canvasReset() {
debounce(() => {
this.initChart();
}, 500)();
},
initChart() {
if (this.chart) {
this.chart.dispose();
}
this.chart = echarts.init(this.$refs.oeeChart);
this.chart.setOption(this.actualOptions);
},
},
};
</script>
<style scoped lang="scss">
.bar-chart-base {
// position: relative;
.legend {
position: absolute;
top: 5.2vh;
right: 1vw;
}
.legend-item {
position: relative;
// font-size: 12px;
margin-right: 1.3vw;
&::before {
content: "";
display: inline-block;
width: 0.531vw;
height: 0.531vw;
background-color: #ccc;
border-radius: 2px;
margin-right: 0.22vw;
}
}
.legend-item:nth-child(1):before {
background-color: #12f7f1;
}
.legend-item:nth-child(2):before {
background-color: #58adfa;
}
.legend-item:nth-child(3):before {
background-color: #f3c000;
}
}
</style>

View File

@ -0,0 +1,69 @@
<!--
* @Author: zhp
* @Date: 2024-05-30 09:00:01
* @LastEditTime: 2024-05-30 09:50:02
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="chart-container" :class="{ 'no-scroll': noScroll }">
<slot />
</div>
</template>
<script>
export default {
name: "ChartContainer",
components: {},
props: {
noScroll: {
type: Boolean,
default: false,
},
},
data() {
return {};
},
computed: {},
methods: {},
};
</script>
<style scoped lang="scss">
.chart-container {
height: 0;
flex: 1;
overflow-x: scroll;
}
.no-scroll::-webkit-scrollbar {
width: 0;
height: 0;
}
::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::-webkit-scrollbar-button {
width: 0;
height: 0;
// width: 10px;
// height: 10px;
// background: #14305f;
}
::-webkit-scrollbar-track {
background: #14305f;
border: 0 none;
border-radius: 0;
}
::-webkit-scrollbar-thumb {
background: #004798;
border: 0 none;
border-radius: 6px;
}
</style>

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-29 14:48:06 * @Date: 2024-05-29 14:48:06
* @LastEditTime: 2024-05-29 14:58:51 * @LastEditTime: 2024-05-30 10:54:00
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -17,7 +17,7 @@
</template> </template>
<script> <script>
import BarChartBase from "@/views/copilot/efficiency/components/sub/bar/BarChartChipOEE.vue"; import BarChartBase from "./BarChartChipOEE.vue";
export default { export default {
name: "ChipOEE", name: "ChipOEE",
components: { BarChartBase }, components: { BarChartBase },
@ -30,6 +30,10 @@ export default {
type: String, type: String,
default: "同比", default: "同比",
}, },
companyId: {
type: Number,
default: 0
},
data: { data: {
type: Object, type: Object,
default:{} default:{}
@ -37,12 +41,16 @@ export default {
}, },
data() { data() {
// //
const cities = ["瑞昌", "邯郸", "株洲", "佳木斯", "成都", "凯盛", "蚌埠"]; const cities = ["fto投入", "芯片产量", "标准组件产量"];
return { return {
xAxis: cities, // xAxis: cities,
}; };
}, },
computed: { computed: {
xAxis() {
console.log(' this.companyId', this.companyId);
return this.companyId === 0 ? ["fto投入", "芯片产量", "标准组件产量"] : ["fto投入", "芯片产量", "标准组件产量", 'BIPV产量'];
},
legend() { legend() {
let items = []; let items = [];
var day1 = new Date(); var day1 = new Date();
@ -95,7 +103,7 @@ export default {
items = [ items = [
{ label: `${year - 1}`, color: "#12f7f1" }, { label: `${year - 1}`, color: "#12f7f1" },
{ label: `${year}`, color: "#58adfa" }, { label: `${year}`, color: "#58adfa" },
{ label: `${year}`, color: "#58adfa" }, { label: `${year}目标`, color: "#58adfa" },
// { label: `${year}`, value: valueTuple[2] }, // { label: `${year}`, value: valueTuple[2] },
]; ];
@ -133,24 +141,12 @@ export default {
// }, // },
series() { series() {
// console.log('aaaaaaaa', this.$store.getters.copilot.efficiency.chipOee); // console.log('aaaaaaaa', this.$store.getters.copilot.efficiency.chipOee);
const chipOeeRate = this.chipOeeRate // const chipOeeRate = this.data
// console.log('chipOee', chipOeeRate) // console.log('chipOee', chipOeeRate)
let dataList = null let dataList = []
switch (this.period) { dataList[0] = this.data.preDataDetail
case 1: dataList[1] = this.data.currentDataDetail
dataList = []; dataList[2] = this.data.targetDataDetail
dataList[0] = chipOeeRate?.previous;
dataList[1] = chipOeeRate?.current;
case 2:
dataList = [];
dataList[0] = chipOeeRate?.previous;
dataList[1] = chipOeeRate?.current;
default:
dataList = [];
dataList[0] = chipOeeRate?.previous;
dataList[1] = chipOeeRate?.current
dataList[2] = chipOeeRate?.target
}
console.log(dataList) console.log(dataList)
return getTemplate(this.period, dataList,this.than); return getTemplate(this.period, dataList,this.than);
}, },

View File

@ -81,7 +81,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="bipv-box" v-if="showBipv"> <div class="bipv-box" v-if="companyId != 0">
<div class="icon"> <div class="icon">
<img src="./../assets/images/bipv.png" alt="" style="width: 2.1875vw; height: 2.1875vw" /> <img src="./../assets/images/bipv.png" alt="" style="width: 2.1875vw; height: 2.1875vw" />
</div> </div>
@ -120,11 +120,14 @@
<span class="title">生产情况</span> <span class="title">生产情况</span>
<span class="line"></span> <span class="line"></span>
</div> </div>
<barChartBase :than="than" :period="period" :data="data" ref="barChart" style="height: 0;flex:1"></barChartBase> <barChartBase :companyId="companyId" :than="than" :period="period" :data="factoryData" ref="barChart"
style="height: 0;flex:1">
</barChartBase>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { number } from 'echarts';
import barChartBase from './ChipOee' import barChartBase from './ChipOee'
export default { export default {
@ -147,6 +150,10 @@ export default {
type: Number, type: Number,
default: 1, default: 1,
}, },
companyId: {
type: Number,
default:0
},
than: { than: {
type: String, type: String,
default: '同比', default: '同比',
@ -159,7 +166,7 @@ export default {
type: Array, type: Array,
default: [], default: [],
}, },
data: { factoryData: {
type: Object, type: Object,
default: {}, default: {},
}, },

View File

@ -1,10 +1,3 @@
<!--
* @Author: zhp
* @Date: 2024-05-21 09:25:42
* @LastEditTime: 2024-05-24 15:03:21
* @LastEditors: zhp
* @Description:
-->
<template> <template>
<div class="factory-layout"> <div class="factory-layout">
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period" <FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
@ -12,15 +5,21 @@
<div class="factory-section"> <div class="factory-section">
<section class="top flex"> <section class="top flex">
<db-container title="生产监控" icon="prod"> <db-container title="生产监控" icon="prod">
<prod-monitor :prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" /> <prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
</db-container> </db-container>
<db-container title="单监控" icon="order"> <db-container title="单监控" icon="order">
<order :prodOrder="prodOrder" /> <order :prodOrder="prodOrder" />
</db-container> </db-container>
<!-- <db-container title="" icon="store"> --> <!-- <db-container title="" icon="store"> -->
<!-- <store :stock="stock" /> --> <!-- <store :stock="stock" /> -->
<!-- </db-container> --> <!-- </db-container> -->
</section> </section>
<!-- <section class="bottom flex"> -->
<!-- <db-container title="" icon="energy"> -->
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
<!-- </db-container> -->
<!-- </section> -->
</div> </div>
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div> <div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
</div> </div>
@ -29,8 +28,9 @@
import FactoryDataHeader from "./../components/FactoryDataHeader.vue"; import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
import Container from "./components/Container.vue"; import Container from "./components/Container.vue";
import ProdMonitor from "./components/ProdMonitor.vue"; import ProdMonitor from "./components/ProdMonitor.vue";
import Store from "./components/Store.vue"; import { deepClone } from "@/utils";
import Energy from "./components/Energy.vue"; // import Store from "./components/Store.vue";
// import Energy from "./components/Energy.vue";
import Order from "./components/Order.vue"; import Order from "./components/Order.vue";
import { cockpitDataMonitor } from "@/api/produceData"; import { cockpitDataMonitor } from "@/api/produceData";
export default { export default {
@ -39,8 +39,8 @@ export default {
FactoryDataHeader, FactoryDataHeader,
DbContainer: Container, DbContainer: Container,
ProdMonitor, ProdMonitor,
Store, // Store,
Energy, // Energy,
Order, Order,
}, },
data() { data() {
@ -48,12 +48,18 @@ export default {
companyId: 1, companyId: 1,
companyName: "邯郸中建材光电材料有限公司", companyName: "邯郸中建材光电材料有限公司",
period: 1, period: 1,
show: false,
than: '同比', than: '同比',
show: true, data: {},
// //
prodOutPut: [], // prodOutPut: [], //
prodFto: [], // prodFto: [], //
stock: {}, // stock: {}, //
factoryData: {
preDataDetail: [],
currentDataDetail: {},
targetDataDetail: [],
},
energyCockpits: [], // energyCockpits: [], //
prodOrder: [], // prodOrder: [], //
energyLegend: [ energyLegend: [
@ -67,16 +73,16 @@ export default {
this.getMes(); this.getMes();
}, },
methods: { methods: {
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updateCompany(obj) { updateCompany(obj) {
this.companyId = obj.companyId; this.companyId = obj.companyId;
this.companyName = obj.companyName; this.companyName = obj.companyName;
this.getMes(); this.getMes();
}, },
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updatePeriod(val) { updatePeriod(val) {
this.period = val; this.period = val;
this.getMes(); this.getMes();
@ -85,13 +91,77 @@ export default {
cockpitDataMonitor({ cockpitDataMonitor({
factorys: [this.companyId], factorys: [this.companyId],
date: this.period, date: this.period,
mode: this.than === '同比' ? 0 : 1
}).then((res) => { }).then((res) => {
console.log(res); console.log(res);
this.prodOutPut = res.data.prodOutputMonitorShDO || []; this.prodOutPut = res.data.prodOutputMonitorShDO || [];
this.prodFto = res.data.prodOutputFtoDO || []; this.prodFto = res.data.prodOutputFtoDO || [];
this.stock = res.data.stockDO || {}; this.prodOrder = res.data.prodWorkOrderDO || [];
this.energyCockpits = res.data.energyCockpitsDO || []; let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
this.prodOrder = res.data.prodOrderMonitorDO || []; let preFtoData = res.data.previousProdOutputFtoDO || [];
let preData = res.data.previousProdOutputMonitorShDO || [];
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
let targetListResponse = res.data.prodTargetMonitorDO || [];
let preDataDetail = []
let currentDataDetail = []
let targetDataDetail = []
if (prodOutputFtoListRes) {
for (const factory of prodOutputFtoListRes) {
console.log(factory);
currentDataDetail[0] = factory.chipInput
}
}
if (preFtoData) {
for (const factory of preFtoData) {
console.log(factory);
// const fId = this.getPreFactoryId(factory);
// const preFId = getPreFactoryId(factory);
// if (fId) {
preDataDetail[0] = factory.previousYearChipInput
// }
// if (preFId) {
// ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
}
}
if (preData && preData[0] != null) {
for (const factory of preData) {
if (factory.previousGlassType === 0) {
preDataDetail[1] = factory.previousYearOutputNumber
} else if (factory.previousGlassType === 1) {
preDataDetail[2] = factory.previousYearOutputNumber
} else if (factory.previousYearOutputNumber === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
if (targetListResponse && targetListResponse[0] != null) {
for (const factory of targetListResponse) {
targetDataDetail[0] = factory.ftoInput
// if (factory.previousGlassType === 0) {
targetDataDetail[1] = factory.chipYield
// } else if (factory.previousGlassType === 1) {
targetDataDetail[2] = factory.componentYield
targetDataDetail[3] = factory.bipvProductoutput
// }
}
}
// console.log('ftoInvest',ftoInvest)
if (factoryListResponse && factoryListResponse[0] != null) {
for (const factory of factoryListResponse) {
// targetDataDetail[0] = factory.ftoInput
if (factory.glassType === 0) {
currentDataDetail[1] = factory.outputNumber
} else if (factory.glassType === 1) {
currentDataDetail[2] = factory.outputNumber
} else if (factory.glassType === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
this.factoryData.preDataDetail = preDataDetail
this.factoryData.currentDataDetail = currentDataDetail
this.factoryData.targetDataDetail = targetDataDetail
}); });
}, },
}, },
@ -100,8 +170,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.factory-layout { .factory-layout {
padding: 16px; padding: 16px;
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
no-repeat;
position: absolute; position: absolute;
height: calc(100% + 38px); height: calc(100% + 38px);
left: -16px; left: -16px;
@ -112,21 +181,25 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 8px; gap: 8px;
.factory-section { .factory-section {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 16px; gap: 16px;
.flex { .flex {
display: flex; display: flex;
gap: 16px; gap: 16px;
flex: 1; flex: 1;
} }
.top > div,
.bottom > div { .top>div,
.bottom>div {
height: 100%; height: 100%;
} }
} }
.factory-footer { .factory-footer {
/** position: absolute; /** position: absolute;
bottom: 10px; **/ bottom: 10px; **/

View File

@ -5,8 +5,8 @@
<div class="factory-section"> <div class="factory-section">
<section class="top flex"> <section class="top flex">
<db-container title="生产监控" icon="prod"> <db-container title="生产监控" icon="prod">
<prod-monitor :than="than" :period="period" :data="data" :prodOutPut="prodOutPut" :prodFto="prodFto" <prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
:showBipv="show" /> :prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
</db-container> </db-container>
<db-container title="工单监控" icon="order"> <db-container title="工单监控" icon="order">
<order :prodOrder="prodOrder" /> <order :prodOrder="prodOrder" />
@ -28,6 +28,7 @@
import FactoryDataHeader from "./../components/FactoryDataHeader.vue"; import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
import Container from "./components/Container.vue"; import Container from "./components/Container.vue";
import ProdMonitor from "./components/ProdMonitor.vue"; import ProdMonitor from "./components/ProdMonitor.vue";
import { deepClone } from "@/utils";
// import Store from "./components/Store.vue"; // import Store from "./components/Store.vue";
// import Energy from "./components/Energy.vue"; // import Energy from "./components/Energy.vue";
import Order from "./components/Order.vue"; import Order from "./components/Order.vue";
@ -54,6 +55,11 @@ export default {
prodOutPut: [], // prodOutPut: [], //
prodFto: [], // prodFto: [], //
stock: {}, // stock: {}, //
factoryData: {
preDataDetail: [],
currentDataDetail: {},
targetDataDetail: [],
},
energyCockpits: [], // energyCockpits: [], //
prodOrder: [], // prodOrder: [], //
energyLegend: [ energyLegend: [
@ -90,9 +96,69 @@ export default {
console.log(res); console.log(res);
this.prodOutPut = res.data.prodOutputMonitorShDO || []; this.prodOutPut = res.data.prodOutputMonitorShDO || [];
this.prodFto = res.data.prodOutputFtoDO || []; this.prodFto = res.data.prodOutputFtoDO || [];
this.stock = res.data.stockDO || {};
this.energyCockpits = res.data.energyCockpitsDO || [];
this.prodOrder = res.data.prodWorkOrderDO || []; this.prodOrder = res.data.prodWorkOrderDO || [];
let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
let preFtoData = res.data.previousProdOutputFtoDO || [];
let preData = res.data.previousProdOutputMonitorShDO || [];
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
let targetListResponse = res.data.prodTargetMonitorDO || [];
let preDataDetail = []
let currentDataDetail = []
let targetDataDetail = []
if (prodOutputFtoListRes) {
for (const factory of prodOutputFtoListRes) {
console.log(factory);
currentDataDetail[0] = factory.chipInput
}
}
if (preFtoData) {
for (const factory of preFtoData) {
console.log(factory);
// const fId = this.getPreFactoryId(factory);
// const preFId = getPreFactoryId(factory);
// if (fId) {
preDataDetail[0] = factory.previousYearChipInput
// }
// if (preFId) {
// ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
}
}
if (preData && preData[0] != null) {
for (const factory of preData) {
if (factory.previousGlassType === 0) {
preDataDetail[1] = factory.previousYearOutputNumber
} else if (factory.previousGlassType === 1) {
preDataDetail[2] = factory.previousYearOutputNumber
}
}
}
if (targetListResponse && targetListResponse[0] != null) {
for (const factory of targetListResponse) {
targetDataDetail[0] = factory.ftoInput
// if (factory.previousGlassType === 0) {
targetDataDetail[1] = factory.chipYield
// } else if (factory.previousGlassType === 1) {
targetDataDetail[2] = factory.componentYield
// }
}
}
// console.log('ftoInvest',ftoInvest)
if (factoryListResponse && factoryListResponse[0] != null) {
for (const factory of factoryListResponse) {
// targetDataDetail[0] = factory.ftoInput
if (factory.glassType === 0) {
currentDataDetail[1] = factory.outputNumber
} else if (factory.glassType === 1) {
currentDataDetail[2] = factory.outputNumber
}
}
}
this.factoryData.preDataDetail = preDataDetail
this.factoryData.currentDataDetail = currentDataDetail
this.factoryData.targetDataDetail = targetDataDetail
console.log(' this.factoryData', this.factoryData);
}); });
}, },
}, },

View File

@ -1,10 +1,3 @@
<!--
* @Author: zhp
* @Date: 2024-05-21 10:13:30
* @LastEditTime: 2024-05-24 15:03:26
* @LastEditors: zhp
* @Description:
-->
<template> <template>
<div class="factory-layout"> <div class="factory-layout">
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period" <FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
@ -12,15 +5,21 @@
<div class="factory-section"> <div class="factory-section">
<section class="top flex"> <section class="top flex">
<db-container title="生产监控" icon="prod"> <db-container title="生产监控" icon="prod">
<prod-monitor :prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" /> <prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
</db-container> </db-container>
<db-container title="单监控" icon="order"> <db-container title="单监控" icon="order">
<order :prodOrder="prodOrder" /> <order :prodOrder="prodOrder" />
</db-container> </db-container>
<!-- <db-container title="" icon="store"> --> <!-- <db-container title="" icon="store"> -->
<!-- <store :stock="stock" /> --> <!-- <store :stock="stock" /> -->
<!-- </db-container> --> <!-- </db-container> -->
</section> </section>
<!-- <section class="bottom flex"> -->
<!-- <db-container title="" icon="energy"> -->
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
<!-- </db-container> -->
<!-- </section> -->
</div> </div>
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div> <div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
</div> </div>
@ -29,8 +28,9 @@
import FactoryDataHeader from "./../components/FactoryDataHeader.vue"; import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
import Container from "./components/Container.vue"; import Container from "./components/Container.vue";
import ProdMonitor from "./components/ProdMonitor.vue"; import ProdMonitor from "./components/ProdMonitor.vue";
import Store from "./components/Store.vue"; import { deepClone } from "@/utils";
import Energy from "./components/Energy.vue"; // import Store from "./components/Store.vue";
// import Energy from "./components/Energy.vue";
import Order from "./components/Order.vue"; import Order from "./components/Order.vue";
import { cockpitDataMonitor } from "@/api/produceData"; import { cockpitDataMonitor } from "@/api/produceData";
export default { export default {
@ -39,8 +39,8 @@ export default {
FactoryDataHeader, FactoryDataHeader,
DbContainer: Container, DbContainer: Container,
ProdMonitor, ProdMonitor,
Store, // Store,
Energy, // Energy,
Order, Order,
}, },
data() { data() {
@ -48,12 +48,18 @@ export default {
companyId: 3, companyId: 3,
companyName: "佳木斯中建材光电材料有限公司", companyName: "佳木斯中建材光电材料有限公司",
period: 1, period: 1,
show: false,
than: '同比', than: '同比',
show: true, data: {},
// //
prodOutPut: [], // prodOutPut: [], //
prodFto: [], // prodFto: [], //
stock: {}, // stock: {}, //
factoryData: {
preDataDetail: [],
currentDataDetail: {},
targetDataDetail: [],
},
energyCockpits: [], // energyCockpits: [], //
prodOrder: [], // prodOrder: [], //
energyLegend: [ energyLegend: [
@ -67,16 +73,16 @@ export default {
this.getMes(); this.getMes();
}, },
methods: { methods: {
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updateCompany(obj) { updateCompany(obj) {
this.companyId = obj.companyId; this.companyId = obj.companyId;
this.companyName = obj.companyName; this.companyName = obj.companyName;
this.getMes(); this.getMes();
}, },
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updatePeriod(val) { updatePeriod(val) {
this.period = val; this.period = val;
this.getMes(); this.getMes();
@ -85,13 +91,77 @@ export default {
cockpitDataMonitor({ cockpitDataMonitor({
factorys: [this.companyId], factorys: [this.companyId],
date: this.period, date: this.period,
mode: this.than === '同比' ? 0 : 1
}).then((res) => { }).then((res) => {
console.log(res); console.log(res);
this.prodOutPut = res.data.prodOutputMonitorShDO || []; this.prodOutPut = res.data.prodOutputMonitorShDO || [];
this.prodFto = res.data.prodOutputFtoDO || []; this.prodFto = res.data.prodOutputFtoDO || [];
this.stock = res.data.stockDO || {}; this.prodOrder = res.data.prodWorkOrderDO || [];
this.energyCockpits = res.data.energyCockpitsDO || []; let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
this.prodOrder = res.data.prodOrderMonitorDO || []; let preFtoData = res.data.previousProdOutputFtoDO || [];
let preData = res.data.previousProdOutputMonitorShDO || [];
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
let targetListResponse = res.data.prodTargetMonitorDO || [];
let preDataDetail = []
let currentDataDetail = []
let targetDataDetail = []
if (prodOutputFtoListRes) {
for (const factory of prodOutputFtoListRes) {
console.log(factory);
currentDataDetail[0] = factory.chipInput
}
}
if (preFtoData) {
for (const factory of preFtoData) {
console.log(factory);
// const fId = this.getPreFactoryId(factory);
// const preFId = getPreFactoryId(factory);
// if (fId) {
preDataDetail[0] = factory.previousYearChipInput
// }
// if (preFId) {
// ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
}
}
if (preData && preData[0] != null) {
for (const factory of preData) {
if (factory.previousGlassType === 0) {
preDataDetail[1] = factory.previousYearOutputNumber
} else if (factory.previousGlassType === 1) {
preDataDetail[2] = factory.previousYearOutputNumber
} else if (factory.previousYearOutputNumber === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
if (targetListResponse && targetListResponse[0] != null) {
for (const factory of targetListResponse) {
targetDataDetail[0] = factory.ftoInput
// if (factory.previousGlassType === 0) {
targetDataDetail[1] = factory.chipYield
// } else if (factory.previousGlassType === 1) {
targetDataDetail[2] = factory.componentYield
targetDataDetail[3] = factory.bipvProductoutput
// }
}
}
// console.log('ftoInvest',ftoInvest)
if (factoryListResponse && factoryListResponse[0] != null) {
for (const factory of factoryListResponse) {
// targetDataDetail[0] = factory.ftoInput
if (factory.glassType === 0) {
currentDataDetail[1] = factory.outputNumber
} else if (factory.glassType === 1) {
currentDataDetail[2] = factory.outputNumber
} else if (factory.glassType === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
this.factoryData.preDataDetail = preDataDetail
this.factoryData.currentDataDetail = currentDataDetail
this.factoryData.targetDataDetail = targetDataDetail
}); });
}, },
}, },
@ -100,8 +170,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.factory-layout { .factory-layout {
padding: 16px; padding: 16px;
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
no-repeat;
position: absolute; position: absolute;
height: calc(100% + 38px); height: calc(100% + 38px);
left: -16px; left: -16px;
@ -112,21 +181,25 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 8px; gap: 8px;
.factory-section { .factory-section {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 16px; gap: 16px;
.flex { .flex {
display: flex; display: flex;
gap: 16px; gap: 16px;
flex: 1; flex: 1;
} }
.top > div,
.bottom > div { .top>div,
.bottom>div {
height: 100%; height: 100%;
} }
} }
.factory-footer { .factory-footer {
/** position: absolute; /** position: absolute;
bottom: 10px; **/ bottom: 10px; **/

View File

@ -1,10 +1,3 @@
<!--
* @Author: zhp
* @Date: 2024-05-21 10:13:45
* @LastEditTime: 2024-05-24 15:03:31
* @LastEditors: zhp
* @Description:
-->
<template> <template>
<div class="factory-layout"> <div class="factory-layout">
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period" <FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
@ -12,15 +5,21 @@
<div class="factory-section"> <div class="factory-section">
<section class="top flex"> <section class="top flex">
<db-container title="生产监控" icon="prod"> <db-container title="生产监控" icon="prod">
<prod-monitor :prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" /> <prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
</db-container> </db-container>
<db-container title="单监控" icon="order"> <db-container title="单监控" icon="order">
<order :prodOrder="prodOrder" /> <order :prodOrder="prodOrder" />
</db-container> </db-container>
<!-- <db-container title="" icon="store"> --> <!-- <db-container title="" icon="store"> -->
<!-- <store :stock="stock" /> --> <!-- <store :stock="stock" /> -->
<!-- </db-container> --> <!-- </db-container> -->
</section> </section>
<!-- <section class="bottom flex"> -->
<!-- <db-container title="" icon="energy"> -->
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
<!-- </db-container> -->
<!-- </section> -->
</div> </div>
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div> <div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
</div> </div>
@ -29,8 +28,9 @@
import FactoryDataHeader from "./../components/FactoryDataHeader.vue"; import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
import Container from "./components/Container.vue"; import Container from "./components/Container.vue";
import ProdMonitor from "./components/ProdMonitor.vue"; import ProdMonitor from "./components/ProdMonitor.vue";
import Store from "./components/Store.vue"; import { deepClone } from "@/utils";
import Energy from "./components/Energy.vue"; // import Store from "./components/Store.vue";
// import Energy from "./components/Energy.vue";
import Order from "./components/Order.vue"; import Order from "./components/Order.vue";
import { cockpitDataMonitor } from "@/api/produceData"; import { cockpitDataMonitor } from "@/api/produceData";
export default { export default {
@ -39,8 +39,8 @@ export default {
FactoryDataHeader, FactoryDataHeader,
DbContainer: Container, DbContainer: Container,
ProdMonitor, ProdMonitor,
Store, // Store,
Energy, // Energy,
Order, Order,
}, },
data() { data() {
@ -48,12 +48,18 @@ export default {
companyId: 5, companyId: 5,
companyName: "凯盛中建材光电材料有限公司", companyName: "凯盛中建材光电材料有限公司",
period: 1, period: 1,
show: false,
than: '同比', than: '同比',
show: true, data: {},
// //
prodOutPut: [], // prodOutPut: [], //
prodFto: [], // prodFto: [], //
stock: {}, // stock: {}, //
factoryData: {
preDataDetail: [],
currentDataDetail: {},
targetDataDetail: [],
},
energyCockpits: [], // energyCockpits: [], //
prodOrder: [], // prodOrder: [], //
energyLegend: [ energyLegend: [
@ -67,16 +73,16 @@ export default {
this.getMes(); this.getMes();
}, },
methods: { methods: {
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updateCompany(obj) { updateCompany(obj) {
this.companyId = obj.companyId; this.companyId = obj.companyId;
this.companyName = obj.companyName; this.companyName = obj.companyName;
this.getMes(); this.getMes();
}, },
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updatePeriod(val) { updatePeriod(val) {
this.period = val; this.period = val;
this.getMes(); this.getMes();
@ -85,13 +91,77 @@ export default {
cockpitDataMonitor({ cockpitDataMonitor({
factorys: [this.companyId], factorys: [this.companyId],
date: this.period, date: this.period,
mode: this.than === '同比' ? 0 : 1
}).then((res) => { }).then((res) => {
console.log(res); console.log(res);
this.prodOutPut = res.data.prodOutputMonitorShDO || []; this.prodOutPut = res.data.prodOutputMonitorShDO || [];
this.prodFto = res.data.prodOutputFtoDO || []; this.prodFto = res.data.prodOutputFtoDO || [];
this.stock = res.data.stockDO || {}; this.prodOrder = res.data.prodWorkOrderDO || [];
this.energyCockpits = res.data.energyCockpitsDO || []; let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
this.prodOrder = res.data.prodOrderMonitorDO || []; let preFtoData = res.data.previousProdOutputFtoDO || [];
let preData = res.data.previousProdOutputMonitorShDO || [];
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
let targetListResponse = res.data.prodTargetMonitorDO || [];
let preDataDetail = []
let currentDataDetail = []
let targetDataDetail = []
if (prodOutputFtoListRes) {
for (const factory of prodOutputFtoListRes) {
console.log(factory);
currentDataDetail[0] = factory.chipInput
}
}
if (preFtoData) {
for (const factory of preFtoData) {
console.log(factory);
// const fId = this.getPreFactoryId(factory);
// const preFId = getPreFactoryId(factory);
// if (fId) {
preDataDetail[0] = factory.previousYearChipInput
// }
// if (preFId) {
// ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
}
}
if (preData && preData[0] != null) {
for (const factory of preData) {
if (factory.previousGlassType === 0) {
preDataDetail[1] = factory.previousYearOutputNumber
} else if (factory.previousGlassType === 1) {
preDataDetail[2] = factory.previousYearOutputNumber
} else if (factory.previousYearOutputNumber === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
if (targetListResponse && targetListResponse[0] != null) {
for (const factory of targetListResponse) {
targetDataDetail[0] = factory.ftoInput
// if (factory.previousGlassType === 0) {
targetDataDetail[1] = factory.chipYield
// } else if (factory.previousGlassType === 1) {
targetDataDetail[2] = factory.componentYield
targetDataDetail[3] = factory.bipvProductoutput
// }
}
}
// console.log('ftoInvest',ftoInvest)
if (factoryListResponse && factoryListResponse[0] != null) {
for (const factory of factoryListResponse) {
// targetDataDetail[0] = factory.ftoInput
if (factory.glassType === 0) {
currentDataDetail[1] = factory.outputNumber
} else if (factory.glassType === 1) {
currentDataDetail[2] = factory.outputNumber
} else if (factory.glassType === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
this.factoryData.preDataDetail = preDataDetail
this.factoryData.currentDataDetail = currentDataDetail
this.factoryData.targetDataDetail = targetDataDetail
}); });
}, },
}, },
@ -100,8 +170,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.factory-layout { .factory-layout {
padding: 16px; padding: 16px;
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
no-repeat;
position: absolute; position: absolute;
height: calc(100% + 38px); height: calc(100% + 38px);
left: -16px; left: -16px;
@ -112,21 +181,25 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 8px; gap: 8px;
.factory-section { .factory-section {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 16px; gap: 16px;
.flex { .flex {
display: flex; display: flex;
gap: 16px; gap: 16px;
flex: 1; flex: 1;
} }
.top > div,
.bottom > div { .top>div,
.bottom>div {
height: 100%; height: 100%;
} }
} }
.factory-footer { .factory-footer {
/** position: absolute; /** position: absolute;
bottom: 10px; **/ bottom: 10px; **/

View File

@ -1,10 +1,3 @@
<!--
* @Author: zhp
* @Date: 2024-05-21 09:47:21
* @LastEditTime: 2024-05-24 15:03:37
* @LastEditors: zhp
* @Description:
-->
<template> <template>
<div class="factory-layout"> <div class="factory-layout">
<FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period" <FactoryDataHeader :than="than" :companyName="companyName" :companyId="companyId" :period="period"
@ -12,15 +5,21 @@
<div class="factory-section"> <div class="factory-section">
<section class="top flex"> <section class="top flex">
<db-container title="生产监控" icon="prod"> <db-container title="生产监控" icon="prod">
<prod-monitor :prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" /> <prod-monitor :companyId="companyId" :factoryData="factoryData" :than="than" :period="period" :data="data"
:prodOutPut="prodOutPut" :prodFto="prodFto" :showBipv="show" />
</db-container> </db-container>
<db-container title="单监控" icon="order"> <db-container title="单监控" icon="order">
<order :prodOrder="prodOrder" /> <order :prodOrder="prodOrder" />
</db-container> </db-container>
<!-- <db-container title="" icon="store"> --> <!-- <db-container title="" icon="store"> -->
<!-- <store :stock="stock" /> --> <!-- <store :stock="stock" /> -->
<!-- </db-container> --> <!-- </db-container> -->
</section> </section>
<!-- <section class="bottom flex"> -->
<!-- <db-container title="" icon="energy"> -->
<!-- <energy :legend="energyLegend" :energyCockpits="energyCockpits" /> -->
<!-- </db-container> -->
<!-- </section> -->
</div> </div>
<div class="factory-footer">© 中建材智能自动化研究院有限公司</div> <div class="factory-footer">© 中建材智能自动化研究院有限公司</div>
</div> </div>
@ -29,8 +28,9 @@
import FactoryDataHeader from "./../components/FactoryDataHeader.vue"; import FactoryDataHeader from "./../components/FactoryDataHeader.vue";
import Container from "./components/Container.vue"; import Container from "./components/Container.vue";
import ProdMonitor from "./components/ProdMonitor.vue"; import ProdMonitor from "./components/ProdMonitor.vue";
import Store from "./components/Store.vue"; import { deepClone } from "@/utils";
import Energy from "./components/Energy.vue"; // import Store from "./components/Store.vue";
// import Energy from "./components/Energy.vue";
import Order from "./components/Order.vue"; import Order from "./components/Order.vue";
import { cockpitDataMonitor } from "@/api/produceData"; import { cockpitDataMonitor } from "@/api/produceData";
export default { export default {
@ -39,8 +39,8 @@ export default {
FactoryDataHeader, FactoryDataHeader,
DbContainer: Container, DbContainer: Container,
ProdMonitor, ProdMonitor,
Store, // Store,
Energy, // Energy,
Order, Order,
}, },
data() { data() {
@ -48,12 +48,18 @@ export default {
companyId: 2, companyId: 2,
companyName: "株洲中建材光电材料有限公司", companyName: "株洲中建材光电材料有限公司",
period: 1, period: 1,
show: false,
than: '同比', than: '同比',
show: true, data: {},
// //
prodOutPut: [], // prodOutPut: [], //
prodFto: [], // prodFto: [], //
stock: {}, // stock: {}, //
factoryData: {
preDataDetail: [],
currentDataDetail: {},
targetDataDetail: [],
},
energyCockpits: [], // energyCockpits: [], //
prodOrder: [], // prodOrder: [], //
energyLegend: [ energyLegend: [
@ -67,16 +73,16 @@ export default {
this.getMes(); this.getMes();
}, },
methods: { methods: {
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updateCompany(obj) { updateCompany(obj) {
this.companyId = obj.companyId; this.companyId = obj.companyId;
this.companyName = obj.companyName; this.companyName = obj.companyName;
this.getMes(); this.getMes();
}, },
updateThan(val) {
console.log(val);
this.than = val;
// this.getMes();
},
updatePeriod(val) { updatePeriod(val) {
this.period = val; this.period = val;
this.getMes(); this.getMes();
@ -85,13 +91,77 @@ export default {
cockpitDataMonitor({ cockpitDataMonitor({
factorys: [this.companyId], factorys: [this.companyId],
date: this.period, date: this.period,
mode: this.than === '同比' ? 0 : 1
}).then((res) => { }).then((res) => {
console.log(res); console.log(res);
this.prodOutPut = res.data.prodOutputMonitorShDO || []; this.prodOutPut = res.data.prodOutputMonitorShDO || [];
this.prodFto = res.data.prodOutputFtoDO || []; this.prodFto = res.data.prodOutputFtoDO || [];
this.stock = res.data.stockDO || {}; this.prodOrder = res.data.prodWorkOrderDO || [];
this.energyCockpits = res.data.energyCockpitsDO || []; let prodOutputFtoListRes = res.data.prodOutputFtoDO || [];
this.prodOrder = res.data.prodOrderMonitorDO || []; let preFtoData = res.data.previousProdOutputFtoDO || [];
let preData = res.data.previousProdOutputMonitorShDO || [];
let factoryListResponse = res.data.prodOutputMonitorShDO || [];
let targetListResponse = res.data.prodTargetMonitorDO || [];
let preDataDetail = []
let currentDataDetail = []
let targetDataDetail = []
if (prodOutputFtoListRes) {
for (const factory of prodOutputFtoListRes) {
console.log(factory);
currentDataDetail[0] = factory.chipInput
}
}
if (preFtoData) {
for (const factory of preFtoData) {
console.log(factory);
// const fId = this.getPreFactoryId(factory);
// const preFId = getPreFactoryId(factory);
// if (fId) {
preDataDetail[0] = factory.previousYearChipInput
// }
// if (preFId) {
// ftoInvest.previous[fId] = factory.previousYearChipInput;
// }
}
}
if (preData && preData[0] != null) {
for (const factory of preData) {
if (factory.previousGlassType === 0) {
preDataDetail[1] = factory.previousYearOutputNumber
} else if (factory.previousGlassType === 1) {
preDataDetail[2] = factory.previousYearOutputNumber
} else if (factory.previousYearOutputNumber === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
if (targetListResponse && targetListResponse[0] != null) {
for (const factory of targetListResponse) {
targetDataDetail[0] = factory.ftoInput
// if (factory.previousGlassType === 0) {
targetDataDetail[1] = factory.chipYield
// } else if (factory.previousGlassType === 1) {
targetDataDetail[2] = factory.componentYield
targetDataDetail[3] = factory.bipvProductoutput
// }
}
}
// console.log('ftoInvest',ftoInvest)
if (factoryListResponse && factoryListResponse[0] != null) {
for (const factory of factoryListResponse) {
// targetDataDetail[0] = factory.ftoInput
if (factory.glassType === 0) {
currentDataDetail[1] = factory.outputNumber
} else if (factory.glassType === 1) {
currentDataDetail[2] = factory.outputNumber
} else if (factory.glassType === 2) {
currentDataDetail[3] = factory.outputNumber
}
}
}
this.factoryData.preDataDetail = preDataDetail
this.factoryData.currentDataDetail = currentDataDetail
this.factoryData.targetDataDetail = targetDataDetail
}); });
}, },
}, },
@ -100,8 +170,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.factory-layout { .factory-layout {
padding: 16px; padding: 16px;
background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% background: url(../../../assets/images/copilot-bg.png) 0 0 / 100% 100% no-repeat;
no-repeat;
position: absolute; position: absolute;
height: calc(100% + 38px); height: calc(100% + 38px);
left: -16px; left: -16px;
@ -112,21 +181,25 @@ export default {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 8px; gap: 8px;
.factory-section { .factory-section {
flex: 1; flex: 1;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 16px; gap: 16px;
.flex { .flex {
display: flex; display: flex;
gap: 16px; gap: 16px;
flex: 1; flex: 1;
} }
.top > div,
.bottom > div { .top>div,
.bottom>div {
height: 100%; height: 100%;
} }
} }
.factory-footer { .factory-footer {
/** position: absolute; /** position: absolute;
bottom: 10px; **/ bottom: 10px; **/

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-05-20 13:32:59 * @Date: 2024-05-20 13:32:59
* @LastEditTime: 2024-05-29 09:31:49 * @LastEditTime: 2024-05-30 13:35:00
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -281,6 +281,7 @@ function calculateItems(period, valueTuple,than) {
padding: 0 10%; padding: 0 10%;
/* margin: 10%; */ /* margin: 10%; */
/* min-width: 300px; */ /* min-width: 300px; */
align-self: stretch;
height: 0; height: 0;
} }

View File

@ -65,6 +65,7 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
@font-face { @font-face {
font-family: 优设标题黑; font-family: 优设标题黑;
src: url(../../../assets/YouSheBiaoTiHei-2.ttf); src: url(../../../assets/YouSheBiaoTiHei-2.ttf);
@ -77,19 +78,25 @@ export default {
z-index: 9999; z-index: 9999;
// padding: 14px; // padding: 14px;
padding: 0.745vw; padding: 0.745vw;
// padding: 0 vw;
cursor: pointer; cursor: pointer;
backdrop-filter: blur(2px); // backdrop-filter: blur(2px);
border-radius: 4px; // border-radius: 4px;
transform: translate(-50%, -100%); transform: translate(-50%, -100%);
box-shadow: inset 0 0 12px 2px #fff3; box-shadow: inset 0 0 12px 2px #fff3;
background: url(../../../assets/images/homeindex/info.png) no-repeat 0 0 / 100% 100%;
// background: radial-gradient(circle farthest-corner at bottom center,rgba(255,239,162,.7) 10%, #021842 30%);
// //
font-size: 1vw; font-size: 1vw;
// filter: blur(13);
} }
h2 { h2 {
padding: 0 1vw;
margin: 6px 0; margin: 6px 0;
font-family: 优设标题黑; font-family: 优设标题黑;
color: #fff; color: #fff;
letter-spacing:5px;
// font-size: 24px; // font-size: 24px;
font-size: 1.276em; font-size: 1.276em;
} }

View File

@ -6,10 +6,13 @@
<div v-if="visible" class="rcLine"></div> <div v-if="visible" class="rcLine"></div>
<div v-if="visible" class="rcLineTwo"></div> <div v-if="visible" class="rcLineTwo"></div>
<div v-if="visible" class="hdLine"></div> <div v-if="visible" class="hdLine"></div>
<div v-if="visible" class="hdLineTwo"></div>
<div v-if="visible" class="ksLine"></div> <div v-if="visible" class="ksLine"></div>
<div v-if="visible" class="bbLine"></div> <div v-if="visible" class="bbLine"></div>
<div v-if="visible" class="bbLineTwo"></div> <div v-if="visible" class="bbLineTwo"></div>
<div v-if="visible" class="bbLineThree"></div> <div v-if="visible" class="bbLineThree"></div>
<div v-if="visible" class="jmsLine"></div>
<div v-if="visible" class="jmsLineTwo"></div>
<div class="databoard"> <div class="databoard">
<db-header class="db-header"></db-header> <db-header class="db-header"></db-header>
<div class="db-body"> <div class="db-body">
@ -58,19 +61,19 @@ import StdChart from "./dashboard/charts/StdChart.vue";
const LOCATIONS = [ const LOCATIONS = [
// //
{ x: 67, y: 20, tx: 67, ty: 26, path: 'copilot/jmsIndex' }, { x: 67, y: 20, tx: 60, ty: 29, path: 'copilot/jmsIndex' },
// //
{ x: 46, y: 56,tx:40,ty:93, path: 'copilot/cdIndex' }, { x: 46, y: 56,tx:46,ty:93, path: 'copilot/cdIndex' },
// 1 // 1
{ x: 60, y: 52, tx: 33, ty: 48.3, path: 'copilot/bbIndex' }, { x: 60, y: 52, tx: 35.5, ty: 48.3, path: 'copilot/bbIndex' },
// 2 // 2
{ x: 61, y: 53,tx:34,ty:68, path: 'copilot/ksIndex' }, { x: 61, y: 53,tx:39,ty:68, path: 'copilot/ksIndex' },
// 西 // 西
{ x: 60, y: 58, tx: 68, ty: 52, path: 'copilot/factory-data' }, { x: 60, y: 58, tx: 68, ty: 52, path: 'copilot/factory-data' },
// //
{ x: 56, y: 60, tx: 60, ty: 95, path: 'copilot/zzIndex' }, { x: 56, y: 60, tx: 60, ty: 95, path: 'copilot/zzIndex' },
// //
{ x: 58, y: 45, tx: 49, ty: 34, path: 'copilot/hdIndex' }, { x: 58, y: 45, tx: 47, ty: 34, path: 'copilot/hdIndex' },
]; ];
export default { export default {
@ -115,6 +118,14 @@ export default {
} }
}, },
mounted() { mounted() {
// var w = window.screen.width;
// var zoom = w / 1920;
// let screen = document.getElementById("map-container")
// console.log(screen);
// screen.style.zoom = zoom
// // "zoom": ,
// screen.style.transform = `scale(" + ${zoom} + ")`
// };
this.$store.dispatch("copilot/initHome").then((res) => { this.$store.dispatch("copilot/initHome").then((res) => {
this.$nextTick(() => { this.$nextTick(() => {
this.initPins(); this.initPins();
@ -131,7 +142,42 @@ export default {
}, },
methods: { methods: {
initPins() { initPins() {
// const cdLine = document.createElement("div");
// const zzLine = document.createElement("div");
// const rcLine = document.createElement("div");
// const rcLineTwo = document.createElement("div");
// const hdLine = document.createElement("div");
// const ksLine = document.createElement("div");
// const bbLine = document.createElement("div");
// const bbLineTwo = document.createElement("div");
// const bbLineThree = document.createElement("div");
// cdLine.className = "cdLine";
// cdLine.style.left = `46.71%`;
// cdLine.style.top = `59%`;
// zzLine.className = "zzLine";
// zzLine.style.left = `56.8%`;
// zzLine.style.top = `60.8%`;
// rcLine.className = "rcLine";
// rcLine.style.left = `66.8%`;
// rcLine.style.top = `52%`;
// rcLineTwo.className = "rcLineTwo";
// rcLineTwo.style.left = `58.7%`;
// rcLineTwo.style.top = `34%`;
// hdLine.className = "hdLine";
// ksLine.className = "ksLine";
// bbLine.className = "bbLine";
// bbLineTwo.className = "bbLineTwo";
// bbLineThree.className = "bbLineThree";
// document.getElementById("map-container").appendChild(cdLine);
// document.getElementById("map-container").appendChild(zzLine);
// document.getElementById("map-container").appendChild(rcLine);
// document.getElementById("map-container").appendChild(rcLineTwo);
// document.getElementById("map-container").appendChild(hdLine);
// document.getElementById("map-container").appendChild(ksLine);
// document.getElementById("map-container").appendChild(bbLine);
// document.getElementById("map-container").appendChild(bbLineTwo);
// document.getElementById("map-container").appendChild(bbLineThree);
// console.log(" this.homeStore", this.$store.getters.home); // console.log(" this.homeStore", this.$store.getters.home);
LOCATIONS.map((loc) => { LOCATIONS.map((loc) => {
console.log("loc", loc); console.log("loc", loc);
@ -168,7 +214,7 @@ export default {
], ],
}; };
if (position === LOCATIONS[0]) { if (position === LOCATIONS[0]) {
templateInfo.companyName = "佳木斯中建材光电材料有限公司"; templateInfo.companyName = "佳木斯中建材";
this.jmsHintPosition = position; this.jmsHintPosition = position;
templateInfo.items[0].value = this.homeStore.ftoInvest.current[3]; templateInfo.items[0].value = this.homeStore.ftoInvest.current[3];
templateInfo.items[2].value = this.homeStore.chipInvest.current[3]; templateInfo.items[2].value = this.homeStore.chipInvest.current[3];
@ -177,7 +223,7 @@ export default {
this.jmsInfo = templateInfo; this.jmsInfo = templateInfo;
} else if (position === LOCATIONS[1]) { } else if (position === LOCATIONS[1]) {
this.cdHintPosition = position; this.cdHintPosition = position;
templateInfo.companyName = "成都中建材光电材料有限公司"; templateInfo.companyName = "成都中建材";
templateInfo.items[0].value = this.homeStore.ftoInvest?.current[4]; templateInfo.items[0].value = this.homeStore.ftoInvest?.current[4];
templateInfo.items[2].value = this.homeStore.chipInvest.current[4]; templateInfo.items[2].value = this.homeStore.chipInvest.current[4];
templateInfo.items[1].value = this.homeStore.chipOutput.current[4]; templateInfo.items[1].value = this.homeStore.chipOutput.current[4];
@ -185,7 +231,7 @@ export default {
this.cdInfo = templateInfo; this.cdInfo = templateInfo;
} else if (position === LOCATIONS[2]) { } else if (position === LOCATIONS[2]) {
this.bbHintPosition = position; this.bbHintPosition = position;
templateInfo.companyName = "蚌埠兴科玻璃有限公司"; templateInfo.companyName = "蚌埠兴科";
templateInfo.items[0].value = this.homeStore.ftoInvest?.current[6]; templateInfo.items[0].value = this.homeStore.ftoInvest?.current[6];
templateInfo.items[2].value = this.homeStore.chipInvest.current[6]; templateInfo.items[2].value = this.homeStore.chipInvest.current[6];
templateInfo.items[1].value = this.homeStore.chipOutput?.current[6]; templateInfo.items[1].value = this.homeStore.chipOutput?.current[6];
@ -193,7 +239,7 @@ export default {
this.bbInfo = templateInfo; this.bbInfo = templateInfo;
} else if (position === LOCATIONS[3]) { } else if (position === LOCATIONS[3]) {
this.ksHintPosition = position; this.ksHintPosition = position;
templateInfo.companyName = "凯盛光伏材料有限公司(本部)"; templateInfo.companyName = "凯盛光伏";
templateInfo.items[0].value = this.homeStore.ftoInvest?.current[5]; templateInfo.items[0].value = this.homeStore.ftoInvest?.current[5];
templateInfo.items[2].value = this.homeStore.chipInvest.current[5]; templateInfo.items[2].value = this.homeStore.chipInvest.current[5];
templateInfo.items[1].value = this.homeStore.chipOutput.current[5]; templateInfo.items[1].value = this.homeStore.chipOutput.current[5];
@ -201,7 +247,7 @@ export default {
this.ksInfo = templateInfo; this.ksInfo = templateInfo;
} else if (position === LOCATIONS[4]) { } else if (position === LOCATIONS[4]) {
this.rcHintPosition = position; this.rcHintPosition = position;
templateInfo.companyName = "瑞昌中建材光电材料有限公司"; templateInfo.companyName = "瑞昌中建材";
templateInfo.items[0].value = this.homeStore.ftoInvest?.current[0]; templateInfo.items[0].value = this.homeStore.ftoInvest?.current[0];
templateInfo.items[2].value = this.homeStore.chipInvest.current[0]; templateInfo.items[2].value = this.homeStore.chipInvest.current[0];
templateInfo.items[1].value = this.homeStore.chipOutput.current[0]; templateInfo.items[1].value = this.homeStore.chipOutput.current[0];
@ -209,7 +255,7 @@ export default {
this.info = templateInfo; this.info = templateInfo;
} else if (position === LOCATIONS[5]) { } else if (position === LOCATIONS[5]) {
this.zzHintPosition = position; this.zzHintPosition = position;
templateInfo.companyName = "中建材(株洲)光电材料有限公司"; templateInfo.companyName = "株洲中建材";
templateInfo.items[0].value = this.homeStore.ftoInvest?.current[2]; templateInfo.items[0].value = this.homeStore.ftoInvest?.current[2];
templateInfo.items[2].value = this.homeStore.chipInvest.current[2]; templateInfo.items[2].value = this.homeStore.chipInvest.current[2];
templateInfo.items[1].value = this.homeStore.chipOutput.current[2]; templateInfo.items[1].value = this.homeStore.chipOutput.current[2];
@ -217,7 +263,7 @@ export default {
this.zzInfo = templateInfo; this.zzInfo = templateInfo;
} else if (position === LOCATIONS[6]) { } else if (position === LOCATIONS[6]) {
this.hdHintPosition = position; this.hdHintPosition = position;
templateInfo.companyName = "中建材(邯郸)光电材料有限公司"; templateInfo.companyName = "邯郸中建材";
templateInfo.items[0].value = this.homeStore.ftoInvest?.current[1]; templateInfo.items[0].value = this.homeStore.ftoInvest?.current[1];
templateInfo.items[2].value = this.homeStore.chipInvest.current[1]; templateInfo.items[2].value = this.homeStore.chipInvest.current[1];
templateInfo.items[1].value = this.homeStore.chipOutput.current[1]; templateInfo.items[1].value = this.homeStore.chipOutput.current[1];
@ -248,86 +294,6 @@ export default {
background: url(../assets/bgearth.png) no-repeat 0 0 / 100% 100%; background: url(../assets/bgearth.png) no-repeat 0 0 / 100% 100%;
// background-size: cover; // background-size: cover;
position: relative; position: relative;
.cdLine{
position: absolute;
left: 46.71%;
width: 2px;
top: 59%;
height: 148px;
border: 2px dashed #FFCF00;
}
.zzLine {
position: absolute;
left: 56.8%;
width: 2px;
top: 60.8%;
// x: 60, y: 58,
height: 148px;
border: 2px dashed #FFCF00;
}
.rcLine {
position: absolute;
left: 61%;
width: 100px;
top: 61.5%;
// x: 60, y: 58,
height: 1px;
border: 2px dashed #FFCF00;
}
.rcLineTwo {
position: absolute;
left: 66.8%;
width: 1px;
top: 52%;
// x: 60, y: 58,
height: 90px;
border: 2px dashed #FFCF00;
}
.hdLine {
position: absolute;
left: 58.7%;
width: 1px;
top: 34%;
// x: 60, y: 58,
height: 100px;
border: 2px dashed #FFCF00;
}
.ksLine {
position: absolute;
left: 43.2%;
width: 350px;
top: 56.8%;
// x: 60, y: 58,
height: 1px;
border: 2px dashed #FFCF00;
}
.bbLine{
position: absolute;
left: 42.4%;
width: 350px;
top: 55.5%;
// x: 60, y: 58,
height: 1px;
border: 2px dashed #FFCF00;
}
.bbLineTwo{
position: absolute;
left: 42.4%;
width: 1px;
top: 48%;
// x: 60, y: 58,
height: 70px;
border: 2px dashed #FFCF00;
}
.bbLineThree{
position: absolute;
left: 40%;
width: 40px;
top: 48%;
// x: 60, y: 58,
height: 1px;
border: 2px dashed #FFCF00;
}
.databoard { .databoard {
position: absolute; position: absolute;
top: 0; top: 0;
@ -358,6 +324,133 @@ export default {
</style> </style>
<style> <style>
.cdLine {
display: inline-block;
position: absolute;
left: 46.71%;
width: 2px;
top: 59%;
height: 148px;
border: 2px dashed #FFCF00;
}
.zzLine {
display: inline-block;
position: absolute;
left: 56.8%;
width: 2px;
top: 60.8%;
/* x: 60, y: 58, */
height: 148px;
border: 2px dashed #FFCF00;
}
.rcLine {
display: inline-block;
position: absolute;
left: 61%;
width: 100px;
top: 61.5%;
/* x: 60, y: 58, */
height: 1px;
border: 2px dashed #FFCF00;
}
.rcLineTwo {
position: absolute;
left: 66.8%;
width: 1px;
top: 52%;
display: inline-block;
/* // x: 60, y: 58, */
height: 90px;
border: 2px dashed #FFCF00;
}
.hdLine {
position: absolute;
left: 58.7%;
width: 1px;
top: 34%;
display: inline-block;
/* // x: 60, y: 58, */
height: 100px;
border: 2px dashed #FFCF00;
}
.hdLineTwo {
position: absolute;
left: 53%;
width: 90px;
top: 34%;
display: inline-block;
/* // x: 60, y: 58, */
height: 1px;
border: 2px dashed #FFCF00;
}
.ksLine {
position: absolute;
left: 43.2%;
width: 350px;
top: 56.8%;
display: inline-block;
/* // x: 60, y: 58, */
height: 1px;
border: 2px dashed #FFCF00;
}
.bbLine {
position: absolute;
left: 42.4%;
width: 350px;
top: 55.5%;
display: inline-block;
/* // x: 60, y: 58, */
height: 1px;
border: 2px dashed #FFCF00;
}
.bbLineTwo {
position: absolute;
left: 42.4%;
width: 1px;
top: 48%;
display: inline-block;
/* // x: 60, y: 58, */
height: 70px;
border: 2px dashed #FFCF00;
}
.jmsLine {
position: absolute;
left: 67.8%;
width: 1px;
top: 24%;
display: inline-block;
/* // x: 60, y: 58, */
height: 40px;
border: 2px dashed #FFCF00;
}
.jmsLineTwo {
position: absolute;
left: 65.4%;
width: 50px;
top: 28.5%;
display: inline-block;
/* // x: 60, y: 58, */
height: 1px;
border: 2px dashed #FFCF00;
}
.bbLineThree {
position: absolute;
left: 40%;
width: 40px;
top: 48%;
display: inline-block;
/* // x: 60, y: 58, */
height: 1px;
border: 2px dashed #FFCF00;
}
.pin { .pin {
display: inline-block; display: inline-block;
position: absolute; position: absolute;