master
吴普建 11 months ago
parent 5e7cb579bb
commit 9dbf604a39

@ -15,6 +15,9 @@ export const getEcmElectricityConsumption = () => {
return request.get('/ecm/ecmElectricityConsumption/getKanban'); return request.get('/ecm/ecmElectricityConsumption/getKanban');
}; };
export const getEcmElectricityIndex = () => {
return request.get('/ecm/ecmElectricityConsumption/getKanbanByIndex');
};
// 获取生产 // 获取生产
export const getMesProductWorkorder = () => { export const getMesProductWorkorder = () => {
return request.get('/mes/mesProductWorkorder/getkanbanPage'); return request.get('/mes/mesProductWorkorder/getkanbanPage');

@ -8,37 +8,37 @@
<div class="energy"> <div class="energy">
<div class="text-div"> <div class="text-div">
<h5 class="pt-32px text-20px font-bold"> <h5 class="pt-32px text-20px font-bold">
<count-to :start-value="0" :end-value="5310" /> <count-to :start-value="0" :end-value="yearElectricQuantity.length && yearElectricQuantity[0].electricQuantity" />
kwh kwh
</h5> </h5>
<p class="text-#aaa">点焊车间能耗</p> <p class="text-#aaa">{{yearElectricQuantity.length && yearElectricQuantity[0].workshopType}}能耗</p>
<h5 class="pt-32px text-20px font-bold"> <h5 class="pt-32px text-20px font-bold">
<count-to :start-value="0" :end-value="3327" /> <count-to :start-value="0" :end-value="yearElectricQuantity.length && yearElectricQuantity[2].electricQuantity" />
kwh kwh
</h5> </h5>
<p class="text-#aaa">CNC车间能耗</p> <p class="text-#aaa">{{yearElectricQuantity.length && yearElectricQuantity[2].workshopType}}能耗</p>
<h5 class="pt-32px text-20px font-bold"> <!-- <h5 class="pt-32px text-20px font-bold">-->
<count-to :start-value="0" :end-value="1021" /> <!-- <count-to :start-value="0" :end-value="1021" />-->
kwh <!-- kwh-->
</h5> <!-- </h5>-->
<p class="text-#aaa">滚筒车间能耗</p> <!-- <p class="text-#aaa">滚筒车间能耗</p>-->
</div> </div>
<div class="text-div"> <div class="text-div">
<h5 class="pt-32px text-20px font-bold"> <h5 class="pt-32px text-20px font-bold">
<count-to :start-value="0" :end-value="945" /> <count-to :start-value="0" :end-value="yearElectricQuantity.length && yearElectricQuantity[1].electricQuantity" />
kwh
</h5>
<p class="text-#aaa">钉胶车间能耗</p>
<h5 class="pt-32px text-20px font-bold">
<count-to :start-value="0" :end-value="3921" />
kwh kwh
</h5> </h5>
<p class="text-#aaa">抛光车间能耗</p> <p class="text-#aaa">{{yearElectricQuantity.length && yearElectricQuantity[1].workshopType}}能耗</p>
<h5 class="pt-32px text-20px font-bold"> <h5 class="pt-32px text-20px font-bold">
<count-to :start-value="0" :end-value="1607" /> <count-to :start-value="0" :end-value="yearElectricQuantity.length && yearElectricQuantity[3].electricQuantity" />
kwh kwh
</h5> </h5>
<p class="text-#aaa">割片车间能耗</p> <p class="text-#aaa">{{yearElectricQuantity.length && yearElectricQuantity[3].workshopType}}能耗</p>
<!-- <h5 class="pt-32px text-20px font-bold">-->
<!-- <count-to :start-value="0" :end-value="1607" />-->
<!-- kwh-->
<!-- </h5>-->
<!-- <p class="text-#aaa">割片车间能耗</p>-->
</div> </div>
</div> </div>
<!-- <n-button class="mt-24px whitespace-pre-wrap" type="primary">Last Month Summary</n-button> --> <!-- <n-button class="mt-24px whitespace-pre-wrap" type="primary">Last Month Summary</n-button> -->
@ -63,11 +63,16 @@ import { ref, onMounted } from 'vue';
import type { Ref } from 'vue'; import type { Ref } from 'vue';
// eslint-disable-next-line import/no-unresolved // eslint-disable-next-line import/no-unresolved
import { type ECOption, useEcharts } from '@/composables'; import { type ECOption, useEcharts } from '@/composables';
import {
getEcmElectricityIndex,
} from '@/service/api/board/kanBan';
defineOptions({ name: 'DashboardAnalysisTopCard' }); defineOptions({ name: 'DashboardAnalysisTopCard' });
const myData = ref<any[]>(['fda']); const myData = ref<any[]>(['fda']);
const yearElectricQuantity = ref<any[]>([]);
onMounted(() => { onMounted(() => {
getData();
// eslint-disable-next-line no-plusplus // eslint-disable-next-line no-plusplus
for (let i = 0; i < 1000; i++) { for (let i = 0; i < 1000; i++) {
myData.value.push(i); myData.value.push(i);
@ -76,6 +81,18 @@ onMounted(() => {
// myData.value.push('321'); // myData.value.push('321');
// }, 1000); // }, 1000);
}); });
function getData() {
getEcmElectricityIndex().then(res => {
if (res.code === 200) {
console.log(res.data);
res.data.yearElectricQuantity.forEach((item: any) => {
item.electricQuantity = item.electricQuantity / 1000;
});
yearElectricQuantity.value = res.data.yearElectricQuantity;
}
});
}
const lineOptions = ref<ECOption>({ const lineOptions = ref<ECOption>({
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',

Loading…
Cancel
Save