<template>
	<el-container class="dashboard">
		<el-header class="header">
			<div class="title">黑化车间生产数据看板</div>
			<div class="timer">{{ currentDay }} {{ currentTime }}</div>
		</el-header>
		<el-main>
			<!-- 黑化 -->
			<el-row style="height: 60%" :gutter="10">
				<el-col :span="12" style="height: 100%">
					<el-col style="height: 50%">
						<div class="box">
							<div class="boxtitle">
								<div class="boxlabel">
									黑化设备
								</div>
								<div class="boxlabel">
									<span class="stateIcon bwIcon"></span>
									<span>保温中</span>
									<span class="eqNum">{{hh.bw}}台</span>
								</div>
								<div class="boxlabel">
									<span class="stateIcon lqIcon"></span>
									<span>冷却中</span>
									<span class="eqNum">{{hh.lq}}台</span>
								</div>
								<div class="boxlabel">
									<span class="stateIcon wyxIcon"></span>
									<span>未运行</span>
									<span class="eqNum">{{hh.wyx}}台</span>
								</div>
								<div class="boxlabel">
									<span class="stateIcon gzIcon"></span>
									<span>故障</span>
									<span class="eqNum">{{hh.gz}}台</span>
								</div>
							</div>
							<div style="height: 2px"></div>
							<div class="boxmain" id="scrollContainer">
								<dv-scroll-board :config="configData01" style="width:98%;margin:auto" />
							</div>
						</div>
					</el-col>
					<el-col style="height: 50%">
						<div class="box">
							<div class="boxtitle">
								<div class="boxlabel">
									退火设备
								</div>
								<div class="boxlabel">
									<span class="stateIcon bwIcon"></span>
									<span>保温中</span>
									<span class="eqNum">{{th.bw}}台</span>
								</div>
								<div class="boxlabel">
									<span class="stateIcon lqIcon"></span>
									<span>冷却中</span>
									<span class="eqNum">{{th.lq}}台</span>
								</div>
								<div class="boxlabel">
									<span class="stateIcon wyxIcon"></span>
									<span>未运行</span>
									<span class="eqNum">{{th.wyx}}台</span>
								</div>
								<div class="boxlabel">
									<span class="stateIcon gzIcon"></span>
									<span>故障</span>
									<span class="eqNum">{{th.gz}}台</span>
								</div>
							</div>
							<div style="height: 2px"></div>
							<div class="boxmain" id="scrollContainer">
								<dv-scroll-board :config="configData02" style="width:98%;margin:auto" />
							</div>
						</div>
					</el-col>
				</el-col>
				<el-col :span="12" style="height: 100%">
					<div class="box">
						<div class="boxtitle">
							<div class="boxlabel">合格数统计</div>
						</div>
						<div style="height: 2px"></div>
						<div class="boxmain" id="scrollContainer">
							<div class="boxmain boxmaintop" id="chart3"></div>
						</div>
					</div>
				</el-col>
			</el-row>
			<div style="height: 0.3%"></div>
			<!-- 退火 -->
			<!-- <el-row style="height: 30%" :gutter="10">
				<el-col :span="12" style="height: 100%">
					<div class="box">
						<div class="boxtitle">
							<div class="boxlabel">
								退火设备
							</div>
							<div class="boxlabel">
								<span class="stateIcon bwIcon"></span>
								<span>保温中</span>
								<span class="eqNum">{{th.bw}}台</span>
							</div>
							<div class="boxlabel">
								<span class="stateIcon lqIcon"></span>
								<span>冷却中</span>
								<span class="eqNum">{{th.lq}}台</span>
							</div>
							<div class="boxlabel">
								<span class="stateIcon wyxIcon"></span>
								<span>未运行</span>
								<span class="eqNum">{{th.wyx}}台</span>
							</div>
							<div class="boxlabel">
								<span class="stateIcon gzIcon"></span>
								<span>故障</span>
								<span class="eqNum">{{th.gz}}台</span>
							</div>
						</div>
						<div style="height: 2px"></div>
						<div class="boxmain" id="scrollContainer">
							<dv-scroll-board :config="configData02" style="width:98%;margin:auto" />
						</div>
					</div>
				</el-col>
				<el-col :span="12" style="height: 100%">
					<div class="box">
						<div class="boxtitle">
							<div class="boxlabel">退火任务进度</div>
						</div>
						<div style="height: 2px"></div>
						<div class="boxmain" id="scrollContainer">
							<dv-scroll-board :config="configData2" style="width:98%;margin:auto" />
						</div>
					</div>
				</el-col>
			</el-row> -->
			<!-- 投产/生产 分析 -->
			<div style="height: 0.3%"></div>
			<el-row style="height: 39%" :gutter="10">
				<el-col :xs="8" :md="8" style="height: 100%;">
					<div class="box">
						<div class="boxtitle">
							<div class="boxlabel">投产分析（2:00 — 次日2:00）</div>
						</div>
						<div class="totalStatic">
							<span class="totalStaticItem">昨日退火投产统计</span>
							<span class="totalStaticItem">今日退火投产预测</span>
							<span class="totalStaticItem">明日退火投产预测</span>
						</div>
						<div class="totalStatic">
							<span class="totalStaticItem totalStaticItemNum">{{ tcfx.yesterday }}</span>
							<span class="totalStaticItem totalStaticItemNum">{{ tcfx.today }}</span>
							<span class="totalStaticItem totalStaticItemNum">{{ tcfx.tomorrow }}</span>
						</div>
						<div class="boxmain boxmainbottom" id="chart1"></div>
					</div>
				</el-col>
				<el-col :xs="8" :md="8" style="height: 100%;">
					<div class="box">
						<div class="boxtitle">
							<div class="boxlabel">生产分析（7:00 — 次日7:00）</div>
						</div>
						<div class="totalStatic">
							<span class="totalStaticItem">昨日黑化进炉统计</span>
							<span class="totalStaticItem">昨日退火进炉统计</span>
						</div>
						<div class="totalStatic">
							<span class="totalStaticItem totalStaticItemNum">{{ sctj_ysetday.hh }}</span>
							<span class="totalStaticItem totalStaticItemNum">{{ sctj_ysetday.th }}</span>
						</div>
						<div class="boxmain boxmainbottom" id="chart2"></div>
					</div>
				</el-col>
				<el-col :xs="8" :md="8" style="height: 100%;">
					<div class="box">
						<div class="boxtitle">
							<div class="boxlabel">库存统计</div>
						</div>
						<div class="totalStatic">
							<span class="totalStaticItem">待黑化片</span>
							<span class="totalStaticItem">黑化中</span>
							<span class="totalStaticItem">退火中</span>
							<span class="totalStaticItem">退火合格数</span>
						</div>
						<div class="totalStatic">
							<span class="totalStaticItem totalStaticItemNum">{{ kctj.dhh }}</span>
							<span class="totalStaticItem totalStaticItemNum">{{ kctj.hhz }}</span>
							<span class="totalStaticItem totalStaticItemNum">{{ kctj.thz }}</span>
							<span class="totalStaticItem totalStaticItemNum">{{ kctj.thok }}</span>
						</div>
						<dv-scroll-board :config="configData" class="boxmain boxmainbottom" style="width:98%;margin:auto" />
					</div>
				</el-col>
			</el-row>
		</el-main>
	</el-container>
</template>

<script>
import * as echarts from "echarts";
import scScrollTavle from "@/components/scScrollTable.vue";
function deepCopy(obj) {
	return JSON.parse(JSON.stringify(obj));
}
export default {
	components: { scScrollTavle },
	data() {
		return {
			basicOption: {
				backgroundColor: "",
				tooltip: {
					trigger: "axis",
					axisPointer: {
						type: "cross",
						label: {
							backgroundColor: "#6a7985",
						},
					},
				},
				legend: {
					icon: "stack",
					right: 0,
					data: [
						{
							backgroundColor: "rgb(1,235,239)",
							name: "黑化",
							itemStyle: {
								color: new echarts.graphic.LinearGradient(0,0,0,1,
									[
										{
											offset: 0,
											color: "rgb(250,205,0)",
										},
										{
											offset: 1,
											color: "rgb(254,129,0)",
										},
									]
								),
							},
							textStyle: {
								color: "#fff",
							},
						},
						{
							backgroundColor: "rgb(250,205,0)",
							name: "退火",
							itemStyle: {
								color: new echarts.graphic.LinearGradient(0,0,0,1,
									[
										{
											offset: 0,
											color: "rgb(1,235,239)",
										},
										{
											offset: 1,
											color: "rgb(5, 158, 163)",
										},
									]
								),
							},
							textStyle: {
								color: "#fff",
							},
						},
					],
				},
				grid: {
					left: "3%",
					right: "2%",
					bottom: "3%",
					containLabel: true,
				},
				xAxis: {
					type: "category",
					boundaryGap: true,
					data: [],
					nameTextStyle: {
						color: "#ffffff",
					},
					axisLabel: {
						color: "#ffffff",
					},
				},
				yAxis: {
					name: "",
					type: "value",
					nameTextStyle: {
						color: "#ffffff",
					},
					axisLabel: {
						color: "#ffffff",
					},
					splitLine: {
						show: false,
						lineStyle: {
							type: "dashed", //y轴分割线类型
							color: "rgba(102,102,102,0.9)",
							width: 1,
						},
					},
				},
				series: [
					{
						name: "今日统计",
						type: "bar",
						// stack: "Ad",
						barWidth: 10,
						emphasis: {
							focus: "series",
						},
						label: {
							show: true,
							position: "top",
							color: "#fff",
						},
						itemStyle: {
							borderRadius: [5, 5, 0, 0],
							color: new echarts.graphic.LinearGradient(
								0,
								0,
								0,
								1,
								[
									{
										offset: 0,
										color: "rgb(250,205,0)",
									},
									{
										offset: 1,
										color: "rgb(254,129,0)",
									},
								]
							),
						},
						
						data: [],
					},
					{
						name: "",
						type: "bar",
						// stack: "Ad",
						barWidth: 10,
						emphasis: {
							focus: "series",
						},
						label: {
							show: true,
							position: "top",
							color: "#fff",
						},
						itemStyle: {
							borderRadius: [5, 5, 0, 0],
							color: new echarts.graphic.LinearGradient(
								0,
								0,
								0,
								1,
								[
									{
										offset: 0,
										color: "rgb(1,235,239)",
									},
									{
										offset: 1,
										color: "rgb(5, 158, 163)",
									},
								]
							),
						},
						data: [],
					},
				],
			},
			tableHeight: 100,
			speed: 2000,
			time: null,
			hh:{
				bw:0,
				lq:0,
				wyx:0,
				gz:0,
			},
			th:{
				bw:0,
				lq:0,
				wyx:0,
				gz:0,
			},
			sctj_ysetday:{
				hh:0,
				th:0
			},
			tcfx:{
				yesterday:0,
				today:0,
				tomorrow:0,

			},
			kctj:{
				dhh:0,
				hhz:0,
				thz:0,
				thok:0,
			},
			dayInterval: null,
			chartInterval2: null,
			configData:{
				header:['物料名称','批次号','数量'],
				headerBGC:'#0a3f44',
				headerHeight:40,
				align:'center',
				data:[],
				// carousel:'page',
				waitTime:1000,
				// columnWidth: [,,50]
			},
			// configData1:{
			// 	headerBGC:'#0a3f44',
			// 	header:['产出名称','规格','型号','开始时间','结束时间','完成进度','产量','状态'],
			// 	headerHeight:40,
			// 	data:[]
			// },
			// configData2:{
			// 	headerBGC:'#0a3f44',
			// 	header:['产出名称','规格','型号','开始时间','结束时间','完成进度','产量','状态'],
			// 	headerHeight:40,
			// 	data:[]
			// },
			configData01:{
				headerBGC:'#0a3f44',
				header:['设备名称','设备编号','设备状态','生产进度','物料数量','保温剩余时间'],
				headerHeight:40,
				data:[]
			},
			configData02:{
				headerBGC:'#0a3f44',
				header:['设备名称','设备编号','设备状态','生产进度','物料数量','保温剩余时间'],
				headerHeight:40,
				data:[]
			},
			currentTime: "",
			currentDay: "",
			today: "",
			end_time:'',
			start_time:'',
			end_date:'',
			start_date:'',
		};
	},
	mounted() {
		//表格table的高度
		this.tableHeight = document.getElementById("scrollContainer").clientHeight;
		this.showTime();
		this.dayInterval = setInterval(() => {
			this.showTime();
		}, 1000);
		//近七天的日期数组
		let daysArr = this.getMondayOfCurrentWeek();
		this.daysArr = daysArr;
		let xAxisData = [];
		daysArr.forEach((item)=>{
			let dates  = item.split('-');
			let obj = dates[1]+'-'+dates[2];
			xAxisData.push(obj);
		})
		this.xAxisData = xAxisData;
		let startDate = new Date(daysArr[0]).getTime()-(1000*60*60*24);
		let endDate = new Date(daysArr[6]).getTime()+(1000*60*60*24);
		let start_time = this.$TOOL.dateFormat(new Date(startDate), "yyyy-MM-dd hh:mm:ss");
		let end_time = this.$TOOL.dateFormat(new Date(endDate), "yyyy-MM-dd hh:mm:ss");
		this.start_time = start_time;
		this.end_time = end_time;
		this.start_date =  daysArr[0];
		this.end_date = daysArr[6];
		this.getMgroups();
		this.$nextTick(() => {
			//投产/生产分析
		    this.getProductLine1();
			this.getProductLine2();
			//库存统计
			this.getMaterials();
			//投产分析统计数
			this.getLeftBottomNum();
			//工段生产数量
			this.getMgroupCount();
			this.getCountOkNok();
		})
	},
	methods: {
		getMondayOfCurrentWeek() {
			let today = new Date();
			let days = [];
			for (let i = 6; i >= 0; i--) {
				let date = new Date(today);
				date.setDate(today.getDate() - i);
				days.push(date.toISOString().split('T')[0]); // 格式化为 YYYY-MM-DD
			}
			return days;
		},
		//时间
		showTime() {
			this.currentTime = this.$TOOL.dateFormat(new Date(), "hh:mm:ss");
			this.currentDay = this.$TOOL.dateFormat(
				new Date(),
				"yyyy年MM月dd日"
			);
		},
		setChart(name, option = null) {
			var myChart = echarts.getInstanceByDom(document.getElementById(name));
			if (myChart == undefined) {
				myChart = echarts.init(document.getElementById(name), "dark", {
					renderer: "svg",
				});
			}
			if (option == null) {
				option = Object.assign({}, this.basicOption);
			}
			setTimeout(() => {
				try {
					myChart.setOption(option);
				} catch (error) {}
			}, 500);
			return myChart;
		},
		//投产分析
		getProductLine1() {
			let that = this;
			let obj = {
				query: {start_time: that.start_time,end_time: that.end_time},
			};
			that.$API.bi.dataset.exec.req("thslrk", obj).then((res) => {
				let list = res.data2.ds0;
				let seriesData1 = [];
				for (let i = 0; i < that.xAxisData.length; i++) {
					seriesData1[i] = 0;
				}
				if (list.length > 0) {
					list.forEach((item) => {
						let date = item.日期.split("-")[1]+'-'+item.日期.split("-")[2];
						let index = that.xAxisData.indexOf(date);
						seriesData1[index] = item.送料数+item.入库数;
					});
				}
				that.tcfx.yesterday = seriesData1[5];
				let chart1Option = deepCopy(this.basicOption);
				chart1Option.xAxis.data = that.xAxisData;
				chart1Option.series[0].data = seriesData1;
				let chart1 = this.setChart("chart1", chart1Option);
				let index1 = 0;
				this.chartInterval2 = setInterval(function () {
					if (index1 < chart1Option.series[0].data.length) {
						chart1.dispatchAction({
							type: "downplay",
							seriesIndex: 0,
						});
						chart1.dispatchAction({
							type: "highlight",
							seriesIndex: 0,
							dataIndex: index1,
						});
						chart1.dispatchAction({
							type: "showTip",
							seriesIndex: 0,
							dataIndex: index1,
						});
						index1++;
					} else {
						index1 = 0;
					}
				}, 3000);
			});
		},
		//生产分析
		getProductLine2() {
			let that = this;
			let obj = {
				query: {start_time: that.start_time,end_time: that.end_time},
			};
			that.$API.bi.dataset.exec.req("jltj", obj).then((res) => {
				let list = res.data2.ds0;
				let seriesData1 = [],seriesData2 = [];
				for (let i = 0; i < that.xAxisData.length; i++) {
					seriesData1[i] = 0;
					seriesData2[i] = 0;
				}
				if (list.length > 0) {
					list.forEach((item) => {
						let date = item.日期.split("-")[1]+'-'+item.日期.split("-")[2];
						let index = that.xAxisData.indexOf(date);
						seriesData1[index] = item.黑化数;
						seriesData2[index] = item.退火数;
					});
				}
				that.sctj_ysetday.hh = seriesData1[5];
				that.sctj_ysetday.th = seriesData2[5];
				let chart2Option = deepCopy(this.basicOption);
				chart2Option.xAxis.data = that.xAxisData;
				chart2Option.series[0].name = '黑化数';
				chart2Option.series[1].name = '退火数';
				chart2Option.series[0].data = seriesData1;
				chart2Option.series[1].data = seriesData2;
				let chart2 = this.setChart("chart2", chart2Option);
				let index2 = 0;
				this.chartInterval2 = setInterval(function () {
					if (index2 < chart2Option.series[0].data.length) {
						chart2.dispatchAction({
							type: "downplay",
							seriesIndex: 0,
						});
						chart2.dispatchAction({
							type: "highlight",
							seriesIndex: 0,
							dataIndex: index2,
						});
						chart2.dispatchAction({
							type: "showTip",
							seriesIndex: 0,
							dataIndex: index2,
						});
						index2++;
					} else {
						index2 = 0;
					}
				}, 3000);
			});
		},
		getMgroups(){
			let that = this;
			that.$API.mtm.mgroup.list.req({page:0}).then((res) => {
				res.forEach((item) => {
					if(item.name == '黑化'){
						that.mgroup_hh = item.id;
						that.getEqState1();
					}
					if(item.name == '退火'){
						that.mgroup_th = item.id;
						that.getEqState2();
					}
				});
				
			});
		},
		//黑化设备运行状态
		getEqState1() {
			let that = this;
			that.$API.wpm.ana.equipLastMlog.req({mgroup:that.mgroup_hh}).then((res) => {
				that.hh.bw = res.保温;
				that.hh.lq = res.冷却;
				that.hh.wyx = res.未运行;
				that.hh.gz = res.故障;
				that.configData01.data = [];
				let nowTime = new Date(res.now).getTime();
				if(res.rows.length>0){
					res.rows.forEach((item) => {
						let arr = [];
						arr[0] = item.name;
						arr[1] =  item.number;
						if(item.mstate=='保温'){
							arr[2] =   '<span style="color:rgb(245, 196, 0)">保温</span>';
						}else if(item.mstate=='冷却'){
							arr[2] =   '<span style="color:rgb(0,163,245)">冷却</span>';
						}else if(item.mstate=='未运行'){
							arr[2] =   '<span style="color:rgb(69,176,118)">未运行</span>';
						}else if(item.mstate=='故障'){
							arr[2] =  '<span style="color:rgb(222,60,54)">故障</span>';
						}
						let process = null, workTime =0,saveTime=null,sumTime=0;
						if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
							item.reminder_interval_list.forEach(item=>{
								sumTime += item;
							})
							let startTime = new Date(item.work_start_time).getTime();
							workTime = (nowTime-startTime)/60000;//已工作时间
							process = Math.round((workTime/sumTime)*100);
							process = process>100?'100%':process+'%';
							let bwSaveTime =  Math.round(item.reminder_interval_list[0]-workTime);
							if(bwSaveTime>0){
								saveTime = bwSaveTime;
							}else{
								saveTime = 0;
							}
						}else{
							process = '';
							saveTime = '';
						}
						arr[3] = process;
						arr[4] = item.t_count_use?item.t_count_use:0;
						arr[5] = saveTime;
						that.configData01.data.push(arr);
					});
				}	
			});
		},
		//退火设备运行状态
		getEqState2() {
			let that = this;
			that.$API.wpm.ana.equipLastMlog.req({mgroup:that.mgroup_th}).then((res) => {
				that.th.bw = res.保温;
				that.th.lq = res.冷却;
				that.th.wyx = res.未运行;
				that.th.gz = res.故障;
				that.configData02.data = [];
				let nowTime = new Date(res.now).getTime();
				if(res.rows.length>0){
					res.rows.forEach((item) => {
						let arr = [];
						arr[0] = item.name;
						arr[1] =  item.number;
						if(item.mstate=='保温'){
							arr[2] =   '<span style="color:rgb(245, 196, 0)">保温</span>';
						}else if(item.mstate=='冷却'){
							arr[2] =   '<span style="color:rgb(0,163,245)">冷却</span>';
						}else if(item.mstate=='未运行'){
							arr[2] =   '<span style="color:rgb(69,176,118)">未运行</span>';
						}else if(item.mstate=='故障'){
							arr[2] =  '<span style="color:rgb(222,60,54)">故障</span>';
						}
						let process = null, workTime =0,saveTime=null,sumTime=0;
						if(item.reminder_interval_list&&item.reminder_interval_list.length>0){
							item.reminder_interval_list.forEach(item=>{
								sumTime += item;
							})
							let startTime = new Date(item.work_start_time).getTime();
							workTime = (nowTime-startTime)/60000;//已工作时间
							process = Math.round((workTime/sumTime)*100);
							process = process>100?'100%':process+'%';
							let bwSaveTime = Math.round(item.reminder_interval_list[0]-workTime);
							if(bwSaveTime>0){
								saveTime = bwSaveTime;
							}else{
								saveTime = 0;
							}
						}else{
							process = '';
							saveTime = '';
						}
						arr[3] = process;
						arr[4] = item.t_count_use?item.t_count_use:0;
						arr[5] = saveTime;
						that.configData02.data.push(arr);
					});
				}	
			});
		},
		getLeftBottomNum(){
			let that = this;
			this.$API.wpm.ana.put_prod.req().then((res) => {
			    that.tcfx.today = res.今日退火投产预测;
			    that.tcfx.tomorrow = res.明日退火投产预测;
			})
		},
		//库存统计列表
		getMaterials() {
			let that = this;
			that.$API.wpm.wmaterial.list.req({ page: 0,mgroup__name__in:'退火,黑化' }).then((res) => {
				that.configData.data = [];
				if(res.length>0){
					res.forEach((item) => {
					    let arr = [];
						arr[0] = item.material_name;
						arr[1] = item.batch;
						arr[2] = item.count;
						that.configData.data .push(arr);
					})
				}
			})
		},
		//工段生产数量
		getMgroupCount(){
			let that = this;
			that.$API.bi.dataset.exec.req("	gdscs").then((res) => {
				let arr = res.data2.ds0;
				arr.forEach((item) => {
					if(item.工段=='退火'){
						that.kctj.thz = item.生产中数;
						that.kctj.thok = item.合格品数;
					}else if(item.工段=='黑化'){
						that.kctj.dhh = item.待生产数;
						that.kctj.hhz = item.生产中数;
					}
				})
			})
		},
		//合格不合格统计
		getCountOkNok(){
			let that = this;
			let chart3Option = deepCopy(this.basicOption);
			chart3Option.xAxis.data = that.xAxisData;
			chart3Option.series[0].name = '合格数';
			chart3Option.series[1].name = '不合格数';
			let seriesData1 = [0,0,0,0,0,0,0],seriesData2 = [0,0,0,0,0,0,0];
			let params = {
				query: {
					end_date: that.end_date,
					start_date: that.start_date,
					mgroup_name: "黑化",
					group_bys_date: ", 月, 日",
					order_bys_date: ", 月, 日",
					select_cols_date: ",EXTRACT(MONTH FROM mlog.handle_date) AS 月,EXTRACT(DAY FROM mlog.handle_date) AS 日"
				},
			};
			that.$API.bi.dataset.exec.req("lineDay_m2",params).then((res) => {
				let arr = res.data2.ds0;
				arr.forEach((item) => {
					let month = item.月<10?'0'+item.月:item.月;
					let day = item.日<10?'0'+item.日:item.日;
					let date = month+'-'+day;
					let index = that.xAxisData.indexOf(date);
					seriesData1[index] += item.合格数;
					seriesData2[index] += item.不合格数;
				})
				let params2 = {
					query: {
						end_date: that.end_date,
						start_date: that.start_date,
						mgroup_name: "退火",
						group_bys_date: ", 月, 日",
						order_bys_date: ", 月, 日",
						select_cols_date: ",EXTRACT(MONTH FROM mlog.handle_date) AS 月,EXTRACT(DAY FROM mlog.handle_date) AS 日"
					},
				};
				that.$API.bi.dataset.exec.req("lineDay_m2",params2).then((res) => {
					let arr2 = res.data2.ds0;
					arr2.forEach((item2) => {
						let month2 = item2.月<10?'0'+item2.月:item2.月;
						let day2 = item2.日<10?'0'+item2.日:item2.日;
						let date2 = month2 +'-'+day2;
						let index2 = that.xAxisData.indexOf(date2);
						seriesData1[index2] += item2.合格数;
						seriesData2[index2] += item2.不合格数;
					})
					chart3Option.series[0].data = seriesData1;
					chart3Option.series[1].data = seriesData2;
					let chart3 = this.setChart("chart3", chart3Option);
					let index3 = 0;
					this.chartInterval2 = setInterval(function () {
					if (index3 < chart3Option.series[0].data.length) {
						chart3.dispatchAction({
							type: "downplay",
							seriesIndex: 0,
						});
						chart3.dispatchAction({
							type: "highlight",
							seriesIndex: 0,
							dataIndex: index3,
						});
						chart3.dispatchAction({
							type: "showTip",
							seriesIndex: 0,
							dataIndex: index3,
						});
						index3++;
					} else {
						index3 = 0;
					}
				}, 3000);
				});
			})
		},
	},
};
</script>
<style scoped>
@font-face {
	font-family: "myfont";
	/* 字体名称 */
	src: url("../../utils/youShe.ttf");
	/* 字体文件相对路径 */
}

.dashboard {
	background-image: url("/public/img/photon_bg.png");
	color: #fff;
	font-family: "Microsoft Yahei" !important;
	background-size: cover;
}

.header {
	background: url("/public/img/photon_header.png");
	border-bottom: none;
	background-size: 100% 100%;
	font-size: 26px;
	display: block;
	height: 80px;
	color: rgb(149, 255, 255);
	font-family: "Microsoft Yahei";
	text-align: center;
	padding: 12px 0px;
}
.header > .title {
	font-weight: bold;
	font-family: "myfont";
	font-size: 32px;
}
.header > .timer {
	font-size: 14px;
	margin-top: 18px;
}
.box {
	background: rgba(10, 63, 68, 0.5);
	height: 100%;
}

.boxtitle {
	color: #fff;
	font-size: 16px;
	display: flex;
	height: 36px;
	line-height: 36px;
	background: linear-gradient(
		40deg,
		rgba(11, 101, 140, 0.451),
		rgba(0, 34, 48, 0.335),
		rgba(11, 101, 140, 0.451)
	);
}

.bgimg {
	background-image: url("https://cdn-upload.datav.aliyun.com/upload/download/1678762309227-E6RP8z2R.png");
	background-size: 140% 100%;
}

.boxlabel {
	margin-left: 6px;
	font-size: 18px;
	/* margin-top: 6px; */
}
.stateIcon{
	width:16px;
	height: 16px;
	margin: 0 5px;
	border-radius: 8px;
	display: inline-block;
}
.bwIcon{
	background-color: rgb(245, 196, 0);
}
.lqIcon{
	background-color: rgb(0,163,245);
}
.wyxIcon{
	background-color: rgb(69,176,118);
}
.gzIcon{
	background-color: rgb(222,60,54);
}
.eqNum{
	margin: 0 10px;
}
.boxmain {
	height: calc(100% - 50px);
}
.boxmain.boxmainbottom{
	height: calc(100% - 120px);
}
.boxmain.boxmaintop{
	height: calc(100% - 10px);
}
.lineDiv {
    height: 40px;
    line-height: 40px;
    padding-left: 0.5em;
}
 .boxmainItemNumber {
	color: rgb(42,234,200);
	margin-left: 10px;
	font-weight: bold;
	font-face:24px;
	font-family: electronicFont;
}
@media screen and (max-width: 800px) {
	.boxmain {
		height: 200px;
	}
}

.flex_center {
	display: flex;
	align-items: center;
	justify-content: center;
}

.border {
	border: 1px dashed #49bcf7;
}

.bigdata {
	font-size: 20px;
}

.title {
	height: 40px;
	line-height: 40px;
	text-align: center;
}

.marquee_top {
	transition: all 0.5s ease-in-out;
	margin-top: -26px;
}

.totall {
	color: #fff;
	background-color: rgb(10, 63, 68);
}

.rollData {
	background-color: rgb(10, 39, 50);
}

.rollData:nth-of-type(2n + 1) {
	background-color: rgb(0, 59, 81);
}
.halfBox {
	height: 50%;
}

.totalStatic{
	display: flex;
}
.totalStaticItem{
	flex: 1;
	height: 25px;
	text-align: center;
	line-height: 25px;
	font-size: 14px;
	margin-top: 5px;
}
.totalStaticItemNum{
	font-size: 24px;
	height: 40px;
	line-height: 40px;
	font-family: "myfont";
	text-align: center;
	margin-top: 0;
	color: rgb(149, 255, 255);
}
</style>
