This commit is contained in:
helloDy 2024-06-24 16:57:15 +08:00
parent 510f12e40b
commit 8437d52c1b
7 changed files with 133 additions and 42 deletions

View File

@ -1,7 +1,7 @@
### ###
# @Author: zhp # @Author: zhp
# @Date: 2024-04-28 13:42:51 # @Date: 2024-04-28 13:42:51
# @LastEditTime: 2024-06-20 10:16:40 # @LastEditTime: 2024-06-24 08:52:00
# @LastEditors: DY # @LastEditors: DY
# @Description: # @Description:
### ###

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-11-06 15:15:30 * @Date: 2023-11-06 15:15:30
* @LastEditTime: 2024-06-18 14:41:07 * @LastEditTime: 2024-06-24 15:15:02
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -116,6 +116,10 @@
<p class="title">标准组件平均功率(W)</p> <p class="title">标准组件平均功率(W)</p>
<p class="text">{{ dataForm.componentAveragePower }}</p> <p class="text">{{ dataForm.componentAveragePower }}</p>
</el-col> </el-col>
<el-col :span="6">
<p class="title">标准组件转化效率</p>
<p class="text">{{ dataForm.componentTransRate }}</p>
</el-col>
</el-row> </el-row>
</div> </div>
<div v-if="glass === 2"> <div v-if="glass === 2">

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-15 10:49:13 * @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-06-20 10:16:25 * @LastEditTime: 2024-06-24 14:38:17
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -10,7 +10,7 @@
<div class="app-container" style="padding: 16px 24px 0; height: auto; flex-grow: 1;"> <div class="app-container" style="padding: 16px 24px 0; height: auto; flex-grow: 1;">
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="时间维度" prop="type"> <el-form-item label="时间维度" prop="type">
<el-select size="small" clearable v-model="listQuery.type" placeholder="请选择"> <el-select v-model="listQuery.type" size="small" clearable placeholder="请选择">
<el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value"> <el-option v-for="item in timeList" :key="item.value" :label="item.label" :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
@ -74,7 +74,7 @@
<!-- <el-row :gutter="24"> --> <!-- <el-row :gutter="24"> -->
<!-- <el-col :span="12" v-for="item in dataList" :key="item.id"> --> <!-- <el-col :span="12" v-for="item in dataList" :key="item.id"> -->
<search-bar :formConfigs="formConfig1" ref="searchBarForm1" style="margin-bottom: 0" /> <search-bar :formConfigs="formConfig1" ref="searchBarForm1" style="margin-bottom: 0" />
<line-chart class="yearChart" ref="lineChart" style="height: 40vh;width: 100%"></line-chart> <line-chart ref="lineChart" class="yearChart" style="height: 45vh;width: 100%"></line-chart>
<!-- </el-col> --> <!-- </el-col> -->
<!-- <el-col :span="12"> <!-- <el-col :span="12">
<line-chart :id=" 'second' " class="yearChart" ref="lineChart" style="height: 40vh;width: 100%"></line-chart> <line-chart :id=" 'second' " class="yearChart" ref="lineChart" style="height: 40vh;width: 100%"></line-chart>
@ -135,9 +135,9 @@ export default {
// reportType: 2, // reportType: 2,
startDate: undefined, startDate: undefined,
endDate:undefined, endDate:undefined,
reportTime: [], reportTime: null,
start: undefined, start: null,
end: undefined end: null
}, },
detailOrUpdateVisible:false, detailOrUpdateVisible:false,
date1: undefined, date1: undefined,
@ -241,7 +241,7 @@ export default {
lineData: [], lineData: [],
chart: null, chart: null,
seriesList: [], seriesList: [],
colorList: ['#2760FF', '#8167F6', '#5B9BFF', '#FFD160'] colorList: ['#7164FF', '#63BDFF', '#8EF0AB', '#FFCE6A']
// proLineList: [], // proLineList: [],
// all: {} // all: {}
}; };
@ -289,7 +289,6 @@ export default {
// console.log(e); // console.log(e);
}, },
onValueChange(picker, k) { // k onValueChange(picker, k) { // k
// console.log(this.listQuery.reportTime[0], this.listQuery.reportTime[1])
if (this.listQuery.start && this.listQuery.end) { if (this.listQuery.start && this.listQuery.end) {
console.log(this.listQuery.reportTime) console.log(this.listQuery.reportTime)
this.date1 = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss') this.date1 = moment(this.listQuery.start.getTime() - 24 * 60 * 60 * 1000).format('YYYY-MM-DD HH:mm:ss')
@ -351,6 +350,13 @@ export default {
} }
}, },
async getDataList() { async getDataList() {
if (this.listQuery.type === '') {
this.$message.warning('请选择时间维度!')
return
}
if (this.listQuery.startDate === undefined) {
this.$message.warning('请选择时间范围!')
} else {
await getProduceDataPage(this.listQuery).then(res => { await getProduceDataPage(this.listQuery).then(res => {
console.log(res) console.log(res)
if (res.code === 0) { if (res.code === 0) {
@ -368,6 +374,7 @@ export default {
this.$refs.lineChart.initChart([], []) this.$refs.lineChart.initChart([], [])
} }
}) })
}
}, },
buildChart(data, dataList) { buildChart(data, dataList) {
let xAxisData = [] let xAxisData = []
@ -392,6 +399,13 @@ export default {
barWidth: 20, barWidth: 20,
itemStyle: { itemStyle: {
color: this.colorList[i] color: this.colorList[i]
},
label: {
show: i === 2 ? true : false,
position: 'top',
formatter(params) {
return fac.name.substring(0, 2)
}
} }
} }
dataList.forEach(item => { dataList.forEach(item => {
@ -411,6 +425,18 @@ export default {
barWidth: 20, barWidth: 20,
itemStyle: { itemStyle: {
color: this.colorList[i] color: this.colorList[i]
},
label: {
show: true,
position: 'top',
formatter(params) {
if (params.value === 0) {
return ''
} else {
// return ['', ''][params.seriesName.split('-')[1]]
return fac.name.substring(0, 2)
}
}
} }
} }
dataList.forEach(item => { dataList.forEach(item => {

View File

@ -2,7 +2,7 @@
* @Author: zwq * @Author: zwq
* @Date: 2022-01-21 14:43:06 * @Date: 2022-01-21 14:43:06
* @LastEditors: DY * @LastEditors: DY
* @LastEditTime: 2024-06-19 15:13:23 * @LastEditTime: 2024-06-24 11:13:48
* @Description: * @Description:
--> -->
<template> <template>
@ -40,7 +40,7 @@ export default {
}, },
height: { height: {
type: String, type: String,
default: '30vh' default: '35vh'
}, },
legendPosition: { legendPosition: {
type: String, type: String,
@ -140,20 +140,24 @@ export default {
xAxis: [ xAxis: [
{ {
type: 'category', type: 'category',
// prettier-ignore name: '日期',
data: xAxis data: xAxis,
axisLabel: {
rotate: 25
}
} }
], ],
yAxis: [ yAxis: [
{ {
type: 'value' type: 'value',
name: '单位:个'
} }
], ],
grid: { grid: {
top: '20%', top: '10%',
left: "1%", left: "1%",
right: "3%", right: "5%",
bottom: "1%", bottom: "0%",
containLabel: true containLabel: true
}, },
series: seriesList series: seriesList

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-17 16:31:51 * @Date: 2024-04-17 16:31:51
* @LastEditTime: 2024-06-17 16:55:04 * @LastEditTime: 2024-06-24 15:43:50
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -375,7 +375,12 @@ export default {
this.visible = true this.visible = true
if (this.dataForm.id) { if (this.dataForm.id) {
getProduceTargetDetail(this.dataForm.id).then(res => { getProduceTargetDetail(this.dataForm.id).then(res => {
this.dataForm = res.data // this.dataForm = res.data
for (const i in res.data) {
if (res.data[i] !== null) {
this.dataForm[i] = res.data[i]
}
}
if (this.dataForm.targetType === 0 || this.dataForm.targetType === 2 || this.dataForm.targetType === 3) { if (this.dataForm.targetType === 0 || this.dataForm.targetType === 2 || this.dataForm.targetType === 3) {
// this.dataForm.reportTime = String(this.dataForm.targetTime) // this.dataForm.reportTime = String(this.dataForm.targetTime)
this.$set(this.dataForm, 'reportTime', String(this.dataForm.targetTime)) this.$set(this.dataForm, 'reportTime', String(this.dataForm.targetTime))

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-04-15 10:49:13 * @Date: 2024-04-15 10:49:13
* @LastEditTime: 2024-06-17 16:32:02 * @LastEditTime: 2024-06-24 15:08:34
* @LastEditors: DY * @LastEditors: DY
* @Description: * @Description:
--> -->
@ -76,7 +76,8 @@ import tableHeightMixin from "@/mixins/tableHeightMixin";
import basicPage from '@/mixins/basic-page' import basicPage from '@/mixins/basic-page'
import AddOrUpdate from './add-or-updata'; import AddOrUpdate from './add-or-updata';
import { factoryList, factoryArray } from "@/utils/constants"; import { factoryList, factoryArray } from "@/utils/constants";
import { publicFormatter } from "@/utils/dict"; // import { publicFormatter } from "@/utils/dict";
import statusChart from "./statusChart.vue";
// import FileSaver from 'file-saver' // import FileSaver from 'file-saver'
// import * as XLSX from 'xlsx' // import * as XLSX from 'xlsx'
@ -206,13 +207,13 @@ export default {
prop: 'factory', prop: 'factory',
label: '工厂名称', label: '工厂名称',
filter: (val) => factoryList[val], filter: (val) => factoryList[val],
minWidth: 200, minWidth: 220,
showOverflowtooltip: true showOverflowtooltip: true
}, },
{ {
prop: 'workOrderNumber', prop: 'workOrderNumber',
label: '工单号', label: '工单号',
minWidth: 120, minWidth: 130,
showOverflowtooltip: true showOverflowtooltip: true
// filter: (val) => ['', '', 'BIPV', ''][val] // filter: (val) => ['', '', 'BIPV', ''][val]
}, },
@ -246,8 +247,8 @@ export default {
{ {
prop: 'orderStatus', prop: 'orderStatus',
label: '工单状态', label: '工单状态',
// filter: publicFormatter('workorder_status') subcomponent: statusChart
filter: (val) => ['', '未开始', '生产中', '已完成'][val], // filter: (val) => ['', '', '', ''][val],
}, },
{ {
prop: 'startTime', prop: 'startTime',

View File

@ -0,0 +1,51 @@
<!--
* @Author: Do not edit
* @Date: 2024-06-24 15:03:19
* @LastEditTime: 2024-06-24 15:07:42
* @LastEditors: DY
* @Description:
-->
<template>
<div>
<span class="dot" :class="myClass"></span>
<span>{{ state }}</span>
</div>
</template>
<script>
export default {
name: "statusChart",
props: {
injectData: {
type: Object,
default: () => ({}),
},
},
computed: {
state() {
return ['', '未开始', '生产中', '已完成'][this.injectData.orderStatus]
},
myClass() {
return ['', 'yellow', 'blue', 'green'][this.injectData.orderStatus]
}
},
};
</script>
<style scoped>
.dot {
display: inline-block;
width: 6px;
height: 6px;
border-radius: 3px;
vertical-align: middle;
margin-right: 8px;
}
.green {
background: #10DC76;
}
.yellow {
background: #FFBD02;
}
.blue {
background: #3B79FF;
}
</style>