yudao-init/src/views/index.vue

501 lines
16 KiB
Vue
Raw Normal View History

2024-04-07 15:30:59 +08:00
<template>
2024-04-18 17:01:10 +08:00
<div class="dashboard-factory-all">
<div id="map-container">
2024-06-03 08:23:40 +08:00
<!-- <div v-if="visible" class="cdLine"></div> -->
<!-- <div v-if="visible" class="zzLine"></div> -->
2024-06-03 08:57:04 +08:00
<!-- <div v-if="visible" class="rcLine"></div> -->
<!-- <div v-if="visible" class="rcLineTwo"></div> -->
2024-06-05 14:14:12 +08:00
<!-- <div v-if="visible" class="hdLine"></div> -->
<!-- <div v-if="visible" class="hdLineTwo"></div> -->
2024-06-03 08:23:40 +08:00
<!-- <div v-if="visible" class="ksLine"></div> -->
<!-- <div v-if="visible" class="bbLine"></div> -->
<!-- <div v-if="visible" class="bbLineTwo"></div> -->
<!-- <div v-if="visible" class="bbLineThree"></div> -->
<!-- <div v-if="visible" class="jmsLine"></div> -->
<!-- <div v-if="visible" class="jmsLineTwo"></div> -->
2024-04-18 17:01:10 +08:00
<div class="databoard">
<db-header class="db-header"></db-header>
<div class="db-body">
<div class="db-left">
2024-07-08 16:54:58 +08:00
<left-container icon="cube" title="FTO投入" @refresh="() => (ftoKey = Math.random())">
2024-04-18 17:01:10 +08:00
<fto-chart :key="ftoKey" />
2024-07-08 16:54:58 +08:00
</left-container>
<left-container icon="chip2" title="芯片投入" @refresh="() => (chipInvestKey = Math.random())">
2024-04-18 17:01:10 +08:00
<chip-invest-chart :key="chipInvestKey" />
2024-07-08 16:54:58 +08:00
</left-container>
2024-04-18 17:01:10 +08:00
</div>
<div class="db-right">
2024-05-29 17:05:55 +08:00
<db-container side="right" icon="chip" title="芯片产出" @refresh="() => (chipYieldKey = Math.random())">
2024-04-18 17:01:10 +08:00
<chip-yield-chart :key="chipYieldKey" />
</db-container>
2024-05-29 17:05:55 +08:00
<db-container side="right" icon="std" title="标准组件产出" @refresh="() => (stdKey = Math.random())">
2024-04-18 17:01:10 +08:00
<std-chart :key="stdKey" />
</db-container>
2024-05-29 17:05:55 +08:00
<db-container side="right" icon="bipv" title="BIPV产出" @refresh="() => (bipvKey = Math.random())">
2024-04-18 17:01:10 +08:00
<bipv-chart :key="bipvKey" />
</db-container>
</div>
2024-04-07 15:30:59 +08:00
</div>
2024-04-18 17:01:10 +08:00
</div>
</div>
2024-05-29 17:05:55 +08:00
<company-info v-if="visible" :info="info" :position="rcHintPosition" />
2024-06-03 08:57:04 +08:00
<!-- <ks-company-info v-if="visible" :info="ksInfo" :position="ksHintPosition" /> -->
<!-- <jms-company-info v-if="visible" :info="jmsInfo" :position="jmsHintPosition" /> -->
2024-05-29 17:05:55 +08:00
<hd-company-info v-if="visible" :info="hdInfo" :position="hdHintPosition" />
2024-06-03 08:57:04 +08:00
<!-- <bb-company-info v-if="visible" :info="bbInfo" :position="bbHintPosition" /> -->
<!-- <cd-company-info v-if="visible" :info="cdInfo" :position="cdHintPosition" /> -->
<!-- <zz-company-info v-if="visible" :info="zzInfo" :position="zzHintPosition" /> -->
2024-04-07 15:30:59 +08:00
</div>
</template>
<script>
2024-04-18 17:01:10 +08:00
import store from "@/store";
import DashboardHeader from "./dashboard/components/Header.vue";
import CompanyInfo from "./dashboard/components/CompanyInfo.vue";
import Container from "./dashboard/components/Container.vue";
2024-07-08 16:54:58 +08:00
import leftContainer from "./dashboard/components/leftContainer.vue";
2024-04-18 17:01:10 +08:00
import FtoChart from "./dashboard/charts/Fto.vue";
import ChipInvestChart from "./dashboard/charts/ChipInvest.vue";
import BipvChart from "./dashboard/charts/Bipv.vue";
import ChipYieldChart from "./dashboard/charts/ChipYield.vue";
import StdChart from "./dashboard/charts/StdChart.vue";
const LOCATIONS = [
// 佳木斯
2024-06-03 08:23:40 +08:00
// { x: 67, y: 20, tx: 60, ty: 29, path: 'factoryData/jmsIndex' },
2024-04-18 17:01:10 +08:00
// 成都
2024-06-03 08:23:40 +08:00
// { x: 46, y: 56, tx: 46, ty: 93, path: 'factoryData/cdIndex' },
2024-04-18 17:01:10 +08:00
// 蚌埠1
2024-06-03 08:23:40 +08:00
// { x: 60, y: 52, tx: 35.5, ty: 48.3, path: 'factoryData/bbIndex' },
2024-04-18 17:01:10 +08:00
// 蚌埠2
2024-06-03 08:23:40 +08:00
// { x: 61, y: 53, tx: 39, ty: 68, path: 'factoryData/ksIndex' },
2024-04-18 17:01:10 +08:00
// 江西 瑞昌
2024-06-05 14:14:12 +08:00
{ x: 60, y: 58, tx: 68, ty: 52,lx:61,ly:61.5,ltx:69.5,lty:52, path: 'factoryData/factory-data' },
2024-04-18 17:01:10 +08:00
// 湖南 株洲
2024-06-03 08:23:40 +08:00
// { x: 56, y: 60, tx: 60, ty: 95, path: 'factoryData/zzIndex' },
2024-04-18 17:01:10 +08:00
// 邯郸
2024-06-05 14:14:12 +08:00
{ x: 58, y: 45, tx: 47.4, ty: 34.3, lx: 58.7, ly: 34, ltx: 53.2, lty: 34, path: 'factoryData/hdIndex' },
2024-04-18 17:01:10 +08:00
];
2024-06-03 08:57:04 +08:00
// rcLine.style.left = `66.8%`;
// rcLine.style.top = `52%`;
// rcLineTwo.className = "rcLineTwo";
// rcLineTwo.style.left = `58.7%`;
// rcLineTwo.style.top = `34%`;
2024-04-07 15:30:59 +08:00
export default {
2024-04-18 17:01:10 +08:00
name: "Index",
2024-04-07 15:30:59 +08:00
components: {
2024-04-18 17:01:10 +08:00
CompanyInfo,
2024-07-08 16:54:58 +08:00
leftContainer,
2024-05-29 17:05:55 +08:00
ksCompanyInfo: CompanyInfo,
hdCompanyInfo: CompanyInfo,
bbCompanyInfo: CompanyInfo,
cdCompanyInfo: CompanyInfo,
zzCompanyInfo: CompanyInfo,
jmsCompanyInfo: CompanyInfo,
2024-04-18 17:01:10 +08:00
DbHeader: DashboardHeader,
DbContainer: Container,
FtoChart,
ChipInvestChart,
ChipYieldChart,
BipvChart,
StdChart,
2024-04-07 15:30:59 +08:00
},
data() {
return {
2024-05-29 17:05:55 +08:00
// homeStore:undefined,
2024-04-18 17:01:10 +08:00
visible: false,
hintPosition: null,
2024-05-29 17:05:55 +08:00
zzHintPosition: null,
ksHintPosition: null,
bbHintPosition: null,
hdHintPosition: null,
cdHintPosition: null,
jmsHintPosition: null,
2024-04-18 17:01:10 +08:00
ftoKey: Math.random(),
chipInvestKey: Math.random(),
chipYieldKey: Math.random(),
stdKey: Math.random(),
bipvKey: Math.random(),
};
},
2024-05-29 17:05:55 +08:00
computed: {
homeStore() {
return this.$store.getters.home
}
},
2024-04-18 17:01:10 +08:00
mounted() {
2024-05-30 16:00:18 +08:00
// 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} + ")`
// };
2024-05-29 17:05:55 +08:00
this.$store.dispatch("copilot/initHome").then((res) => {
this.$nextTick(() => {
this.initPins();
// 调整 echarts 大小
window.onresize = () => { };
})
})
2024-04-18 17:01:10 +08:00
},
beforeRouteEnter(to, from, next) {
next((vm) => {
store.dispatch("app/closeSideBar", { withoutAnimation: true });
});
2024-04-07 15:30:59 +08:00
},
methods: {
2024-04-18 17:01:10 +08:00
initPins() {
2024-05-30 16:00:18 +08:00
// 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";
2024-05-29 17:05:55 +08:00
2024-05-30 16:00:18 +08:00
// 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);
2024-05-29 17:05:55 +08:00
// console.log(" this.homeStore", this.$store.getters.home);
2024-04-18 17:01:10 +08:00
LOCATIONS.map((loc) => {
2024-05-29 17:05:55 +08:00
console.log("loc", loc);
2024-04-18 17:01:10 +08:00
const pin = document.createElement("div");
pin.className = "pin";
pin.style.left = `${loc.x}%`;
pin.style.top = `${loc.y}%`;
2024-05-29 17:05:55 +08:00
// pin.addEventListener("mouseenter", () => {
2024-04-18 17:01:10 +08:00
this.showHint(loc);
2024-05-29 17:05:55 +08:00
// });
// pin.addEventListener("mouseleave", () => {
2024-05-30 16:00:18 +08:00
// this.closeHint();
2024-05-29 17:05:55 +08:00
// });
// pin.addEventListener("click", () => {
// this.$router.push({
// path:loc.path
// })
// });
2024-04-18 17:01:10 +08:00
document.getElementById("map-container").appendChild(pin);
});
},
closeHint() {
this.visible = false;
this.hintPosition = null;
},
showHint(position) {
const templateInfo = {
companyName: "",
items: [
{ label: "FTO投入", value: 0 }, // Math.floor(Math.random() * 1000000) },
{ label: "芯片产出", value: 0 }, // Math.floor(Math.random() * 10000000) },
{ label: "芯片投入", value: 0 }, // Math.floor(Math.random() * 1000000) },
{ label: "标准组件产出", value: 0 }, // Math.floor(Math.random() * 1000000) },
],
};
2024-06-03 08:23:40 +08:00
if
// (position === LOCATIONS[0]) {
// templateInfo.companyName = "佳木斯中建材";
// this.jmsHintPosition = position;
// templateInfo.items[0].value = this.homeStore.ftoInvest.current[3];
// templateInfo.items[2].value = this.homeStore.chipInvest.current[3];
// templateInfo.items[1].value = this.homeStore.chipOutput.current[3];
// templateInfo.items[3].value = this.homeStore.stdOutput.current[3];
// this.jmsInfo = templateInfo;
// } else if (position === LOCATIONS[1]) {
// this.cdHintPosition = position;
// templateInfo.companyName = "成都中建材";
// templateInfo.items[0].value = this.homeStore.ftoInvest?.current[4];
// templateInfo.items[2].value = this.homeStore.chipInvest.current[4];
// templateInfo.items[1].value = this.homeStore.chipOutput.current[4];
// templateInfo.items[3].value = this.homeStore.stdOutput.current[4];
// this.cdInfo = templateInfo;
// } else if (position === LOCATIONS[2]) {
// this.bbHintPosition = position;
// templateInfo.companyName = "蚌埠兴科";
// templateInfo.items[0].value = this.homeStore.ftoInvest?.current[6];
// templateInfo.items[2].value = this.homeStore.chipInvest.current[6];
// templateInfo.items[1].value = this.homeStore.chipOutput?.current[6];
// templateInfo.items[3].value = this.homeStore.stdOutput.current[6];
// this.bbInfo = templateInfo;
// } else if (position === LOCATIONS[3]) {
// this.ksHintPosition = position;
// templateInfo.companyName = "凯盛光伏";
// templateInfo.items[0].value = this.homeStore.ftoInvest?.current[5];
// templateInfo.items[2].value = this.homeStore.chipInvest.current[5];
// templateInfo.items[1].value = this.homeStore.chipOutput.current[5];
// templateInfo.items[3].value = this.homeStore.stdOutput.current[5];
// this.ksInfo = templateInfo;
// }
2024-06-03 08:57:04 +08:00
(position === LOCATIONS[0]) {
const rcLine = document.createElement("div");
const rcLineTwo = document.createElement("div");
rcLine.className = "rcLine";
rcLine.style.left = `${position.lx}%`;
rcLine.style.top = `${position.ly}%`;
rcLineTwo.className = "rcLineTwo";
rcLineTwo.style.left = `${position.ltx}%`;
rcLineTwo.style.top = `${position.lty}%`;
document.getElementById("map-container").appendChild(rcLine);
document.getElementById("map-container").appendChild(rcLineTwo);
2024-05-29 17:05:55 +08:00
this.rcHintPosition = position;
2024-05-30 16:00:18 +08:00
templateInfo.companyName = "瑞昌中建材";
2024-05-29 17:05:55 +08:00
templateInfo.items[0].value = this.homeStore.ftoInvest?.current[0];
templateInfo.items[2].value = this.homeStore.chipInvest.current[0];
templateInfo.items[1].value = this.homeStore.chipOutput.current[0];
templateInfo.items[3].value = this.homeStore.stdOutput.current[0];
this.info = templateInfo;
2024-06-03 08:23:40 +08:00
// } else if (position === LOCATIONS[5]) {
// this.zzHintPosition = position;
// templateInfo.companyName = "株洲中建材";
// templateInfo.items[0].value = this.homeStore.ftoInvest?.current[2];
// templateInfo.items[2].value = this.homeStore.chipInvest.current[2];
// templateInfo.items[1].value = this.homeStore.chipOutput.current[2];
// templateInfo.items[3].value = this.homeStore.stdOutput.current[2];
// this.zzInfo = templateInfo;
} else if (position === LOCATIONS[1]) {
2024-06-03 08:57:04 +08:00
const hdLine = document.createElement("div");
const hdLineTwo = document.createElement("div");
hdLine.className = "hdLine";
hdLine.style.left = `${position.lx}%`;
hdLine.style.top = `${position.ly}%`;
hdLineTwo.className = "hdLineTwo";
hdLineTwo.style.left = `${position.ltx}%`;
hdLineTwo.style.top = `${position.lty}%`;
document.getElementById("map-container").appendChild(hdLine);
document.getElementById("map-container").appendChild(hdLineTwo);
2024-05-29 17:05:55 +08:00
this.hdHintPosition = position;
2024-05-30 16:00:18 +08:00
templateInfo.companyName = "邯郸中建材";
2024-05-29 17:05:55 +08:00
templateInfo.items[0].value = this.homeStore.ftoInvest?.current[1];
templateInfo.items[2].value = this.homeStore.chipInvest.current[1];
templateInfo.items[1].value = this.homeStore.chipOutput.current[1];
templateInfo.items[3].value = this.homeStore.stdOutput.current[1];
this.hdInfo = templateInfo
2024-04-18 17:01:10 +08:00
}
this.$nextTick(() => {
this.visible = true;
});
},
},
};
2024-04-07 15:30:59 +08:00
</script>
<style lang="scss" scoped>
2024-04-18 17:01:10 +08:00
.dashboard-factory-all {
background: #151516;
position: fixed;
top: 0;
left: 54px;
height: 100vh;
width: calc(100vw - 54px);
z-index: 1001;
color: #fff;
}
#map-container {
height: 100%;
background: url(../assets/bgearth.png) no-repeat 0 0 / 100% 100%;
2024-05-29 17:05:55 +08:00
// background-size: cover;
2024-04-07 15:30:59 +08:00
position: relative;
2024-04-18 17:01:10 +08:00
.databoard {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
display: flex;
flex-direction: column;
}
.db-body {
flex: 1;
display: flex;
justify-content: space-between;
2024-04-07 15:30:59 +08:00
}
2024-04-18 17:01:10 +08:00
.db-left,
.db-right {
// width: 420px;
2024-07-08 16:54:58 +08:00
width: 24.5vw;
2024-04-18 17:01:10 +08:00
padding: 20px;
display: flex;
flex-direction: column;
gap: 20px;
2024-04-07 15:30:59 +08:00
}
}
</style>
2024-04-18 17:01:10 +08:00
<style>
2024-05-30 16:00:18 +08:00
.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;
2024-06-03 08:57:04 +08:00
/* left: 61%; */
width: 7.9vw;
/* top: 61.5%; */
2024-05-30 16:00:18 +08:00
/* x: 60, y: 58, */
2024-06-03 08:57:04 +08:00
height: 1px;
2024-05-30 16:00:18 +08:00
border: 2px dashed #FFCF00;
}
.rcLineTwo {
position: absolute;
2024-06-03 08:57:04 +08:00
/* left: 66.8%; */
2024-05-30 16:00:18 +08:00
width: 1px;
2024-06-03 08:57:04 +08:00
/* top: 52%; */
2024-05-30 16:00:18 +08:00
display: inline-block;
/* // x: 60, y: 58, */
2024-06-03 08:57:04 +08:00
height: 5vw;
2024-05-30 16:00:18 +08:00
border: 2px dashed #FFCF00;
}
.hdLine {
position: absolute;
2024-06-05 14:14:12 +08:00
/* left: 58.7%; */
2024-05-30 16:00:18 +08:00
width: 1px;
2024-06-05 14:14:12 +08:00
/* top: 34%; */
2024-05-30 16:00:18 +08:00
display: inline-block;
/* // x: 60, y: 58, */
2024-06-03 08:57:04 +08:00
height: 6vw;
2024-05-30 16:00:18 +08:00
border: 2px dashed #FFCF00;
}
.hdLineTwo {
position: absolute;
2024-06-05 14:14:12 +08:00
/* left: 53%; */
2024-06-03 08:57:04 +08:00
width: 5vw;
2024-06-05 14:14:12 +08:00
/* top: 34%; */
2024-05-30 16:00:18 +08:00
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;
}
2024-04-18 17:01:10 +08:00
.pin {
display: inline-block;
position: absolute;
z-index: 9998;
width: 1.702vw;
height: 1.702vw;
2024-05-08 16:38:05 +08:00
/*
2024-04-18 17:01:10 +08:00
width: 32px;
2024-05-08 16:38:05 +08:00
height: 32px;
2024-04-18 17:01:10 +08:00
*/
background: url(../assets/pinicon.png) no-repeat 0 0 / 100% 100%;
transition: transform 0.1s linear;
cursor: pointer;
}
.pin:hover {
transform: scale(1.2);
}
</style>