-
{{ item.proportion !== null && item.proportion !== undefined ? (item.proportion) + '%' : '0%' }}
+
+ {{ item.proportion != null ? (item.proportion + '%') : '0%' }}
完成率
@@ -35,23 +39,15 @@ export default {
components: {},
props: [
'itemList',
- 'height',
- 'flag' // 新增 flag 属性,用于控制颜色
+ 'height'
+ // 移除组件级的flag属性,不再需要
],
data() {
return {
progress: 90,
};
},
- computed: {
- // 根据 flag 计算实际值和完成率的颜色
- flagColor() {
- // flag 为 0 时使用灰色,为 1 时使用橙色
- return this.flag === 1
- ? 'rgba(255, 132, 0, 1)'
- : 'rgba(54, 181, 138, 1)';
- }
- },
+ // 移除flagColor计算属性,改为item级判断
watch: {
itemList: {
handler(newList) {
@@ -65,7 +61,7 @@ export default {
diff --git a/src/views/home/costComponents/profitImpactLineChart.vue b/src/views/home/costComponents/profitImpactLineChart.vue
new file mode 100644
index 00000000..9286fde0
--- /dev/null
+++ b/src/views/home/costComponents/profitImpactLineChart.vue
@@ -0,0 +1,145 @@
+
+
+
+
+
diff --git a/src/views/home/costComponents/profitLineChart.vue b/src/views/home/costComponents/profitLineChart.vue
index 2e27890e..d92e07b6 100644
--- a/src/views/home/costComponents/profitLineChart.vue
+++ b/src/views/home/costComponents/profitLineChart.vue
@@ -26,7 +26,7 @@ export default {
default: () => [] // 默认空数组,避免报错
},
dateData: { // 接收父组件传递的设备数据数组
- type: Array,
+ type: Object,
default: () => {} // 默认空数组,避免报错
},
yName: { // 接收父组件传递的设备数据数组
diff --git a/src/views/home/costComponents/profitTotalChart.vue b/src/views/home/costComponents/profitTotalChart.vue
new file mode 100644
index 00000000..39b446d6
--- /dev/null
+++ b/src/views/home/costComponents/profitTotalChart.vue
@@ -0,0 +1,233 @@
+
+
+
+
+
+
+
+
diff --git a/src/views/home/costComponents/rawSheet-Item.vue b/src/views/home/costComponents/rawSheet-Item.vue
index 255309fb..6c0609e8 100644
--- a/src/views/home/costComponents/rawSheet-Item.vue
+++ b/src/views/home/costComponents/rawSheet-Item.vue
@@ -134,12 +134,12 @@ export default {
getColorByFlag(flag, isProgressBar = false) {
const colorMap = {
1: {
- text: 'rgba(54, 181, 138, 1)',
- progress: 'rgba(103, 103, 103, 0.5)' // 进度条颜色稍浅
+ text: 'rgba(98, 213, 180, 1)',
+ progress: 'rgba(98, 213, 180, 1)' // 进度条颜色稍浅
},
0: {
text: 'rgba(255, 132, 0, 1)',
- progress: 'rgba(255, 132, 0, 0.7)' // 进度条颜色稍浅
+ progress: 'rgba(249, 164, 74, 1)' // 进度条颜色稍浅
}
};
const currentFlag = flag === 1 ? 1 : 0;
diff --git a/src/views/home/index.vue b/src/views/home/index.vue
index 0b1174bf..3249e54d 100644
--- a/src/views/home/index.vue
+++ b/src/views/home/index.vue
@@ -86,14 +86,6 @@ export default {
this.destroy()
},
mounted() {
- const startTime = moment().startOf('week').format('YYYY-MM-DD')
- const endTime = moment().format('YYYY-MM-DD')
- console.log(this.date, 'date')
- this.date = [startTime, endTime]
- // this.weekDay = this.weekArr[moment(this.date).format('e')]
- // this.getData()
- this.loopTime()
- console.log(1111);
const _this = this;
_this.beilv = document.documentElement.clientWidth / 1920
window.onresize = () => {
@@ -104,39 +96,6 @@ export default {
}
},
methods: {
- handleTimeChange(data) {
- console.log(data);
-
- },
- windowWidth(value) {
- this.clientWidth = value
- this.beilv2 = this.clientWidth / 1920
- },
- getToday8StartTimestamp() {
- const date = new Date(); // 获取当前时间
- // 将时设为8、分0、秒0、毫秒0
- date.setHours(8, 0, 0, 0);
- return date.getTime(); // 转换为时间戳(毫秒)
- },
-
- // 获取第二天早上八点的时间戳
- getTomorrow8EndTimestamp() {
- const date = new Date(); // 获取当前时间
- // 先加一天,再设置为早上八点
- date.setDate(date.getDate() + 1);
- date.setHours(8, 0, 0, 0);
- return date.getTime(); // 转换为时间戳(毫秒)
- },
-
-
-
- loopTime() {
- const _this = this
- _this.timer = setInterval(
- function() {
- // _this.getData()
- }, 60000)
- },
change() {
this.isFullScreen = screenfull.isFullscreen
},
@@ -173,37 +132,6 @@ export default {
}
screenfull.toggle(this.$refs.dayReportB)
},
- changeDate(val) {
- this.date = val
- // this.weekDay = this.weekArr[moment(this.date).format('e')]
- // this.getData()
- if (this.date === moment().format('yyyy-MM-DD')) {
- this.loopTime()
- } else {
- clearInterval(this.timer)
- }
- },
- // 导出
- // exportPDF() {
- // this.$message.success('正在导出,请稍等!')
- // const element = document.getElementById('dayRepDom')
- // element.style.display = 'block'
- // const fileName = '株洲碲化镉生产日报' + moment().format('yyMMDD') + '.pdf'
- // html2canvas(element, {
- // dpi: 300, // Set to 300 DPI
- // scale: 3 // Adjusts your resolution
- // }).then(function(canvas) {
- // const imgWidth = 595.28
- // const imgHeight = 841.89
- // const pageData = canvas.toDataURL('image/jpeg', 1.0)
- // const PDF = new JsPDF('', 'pt', [imgWidth, imgHeight])
- // PDF.addImage(pageData, 'JPEG', 0, 0, imgWidth, imgHeight)
- // setTimeout(() => {
- // PDF.save(fileName) // 导出文件名
- // }, 1000)
- // })
- // element.style.display = 'none'
- // }
}
}
diff --git a/src/views/home/profitImpactAnalysis.vue b/src/views/home/profitImpactAnalysis.vue
index ecb65183..d2502d1f 100644
--- a/src/views/home/profitImpactAnalysis.vue
+++ b/src/views/home/profitImpactAnalysis.vue
@@ -34,7 +34,7 @@
gap: 12px;
grid-template-columns: 1624px;
">
-
+