Commit 2d000bb4 by zhangzhen

驾驶舱细节优化

parent fa33466c
......@@ -194,28 +194,26 @@
</div>
</div>
<div class="left-device device" style="margin-left: 2vw;">
<div v-for="(item,index) in querySbYesList"
:key="index" class="device-echarts-background">
<div v-for="(item,index) in querySbYesList" :key="index" class="device-echarts-background">
<manage-echarts :option="item.option" :width="17" :height="23"></manage-echarts>
</div>
<div class="device-echarts-background">
<manage-echarts :option="lineOption1" :width="17" :height="23"></manage-echarts>
</div>
<div class="device-echarts-background">
<manage-echarts :option="lineOption1" :width="17" :height="23"></manage-echarts>
</div>
<%-- <div class="device-echarts-background">--%>
<%-- <manage-echarts :option="lineOption1" :width="17" :height="23"></manage-echarts>--%>
<%-- </div>--%>
<%-- <div class="device-echarts-background">--%>
<%-- <manage-echarts :option="lineOption1" :width="17" :height="23"></manage-echarts>--%>
<%-- </div>--%>
</div>
<div class="left-device device" style="margin-left: 2vw;">
<div v-for="(item,index) in querySbNoList"
:key="index" class="device-echarts-background">
<div v-for="(item,index) in querySbNoList" :key="index" class="device-echarts-background">
<manage-echarts :option="item.option" :width="17" :height="23"></manage-echarts>
</div>
<div class="device-echarts-background">
<manage-echarts :option="lineOption2" :width="17" :height="23"></manage-echarts>
</div>
<div class="device-echarts-background">
<manage-echarts :option="lineOption2" :width="17" :height="23"></manage-echarts>
</div>
<%-- <div class="device-echarts-background">--%>
<%-- <manage-echarts :option="lineOption2" :width="17" :height="23"></manage-echarts>--%>
<%-- </div>--%>
<%-- <div class="device-echarts-background">--%>
<%-- <manage-echarts :option="lineOption2" :width="17" :height="23"></manage-echarts>--%>
<%-- </div>--%>
</div>
</div>
</el-main>
......@@ -315,9 +313,19 @@
IPLAT.EiCommunicator.send('HGSB010', 'queryBySbStatus', inInfo, {
onSuccess: function (res) {
if(undefined != res.extAttr.result){
if(res.extAttr.result.length){
_this.queryBySbStatusList = res.extAttr.result;
}
if(!res.extAttr.result.length){
_this.queryBySbStatusList.push({
deviceName:'龙门加工中心',
status:'3',
deviceModel:'LM-899S',
})
}
if(res.extAttr.result.length <= 1){
_this.queryBySbStatusList.push({
deviceName:'切割机',
status:'3',
......@@ -328,6 +336,7 @@
status:'3',
deviceModel:'H9830',
})
}
},
onFail: function (err) {
......@@ -337,17 +346,19 @@
);
},
querySbYes(){
console.log('querySbYes')
let _this = this;
var inInfo = new EiInfo();
inInfo.set('inqu_status-0-factoryCode',this.factory)
inInfo.set('inqu_status-0-date',this.dataPicker)
IPLAT.EiCommunicator.send('HGSB010', 'querySbYes', inInfo, {
onSuccess: function (res) {
if(undefined != res.extAttr.result[0]){
const dataList = res.extAttr.result;
_this.querySbYesDate = res.extAttr.date;
_this.querySbYesList = [];
if(res.extAttr.result.length){
const dataList = res.extAttr.result;
_this.querySbYesList = dataList.map((item, index) => {
const getChartOptionByIndex = (index) => {
return {
......@@ -400,7 +411,6 @@
]
};
};
// 返回包含正确 option 属性的对象
return {
...item,
......@@ -408,11 +418,175 @@
};
});
}
else {
_this.querySbYesList = []
_this.querySbYesDate = []
if(res.extAttr.result.length <= 1){
let str = ''
let dateArr = [];
if(_this.querySbYesDate.length){
str = dayjs().format('YYYY') + _this.querySbYesDate[_this.querySbYesDate.length-1];
dateArr.unshift(_this.querySbYesDate[_this.querySbYesDate.length-1])
for (let i = 0; i < 6; i++){
dateArr.unshift(dayjs(str).subtract(i,'day').format('MMDD'));
}
}else{
for (let i = 0; i < 7; i++){
dateArr.unshift(dayjs(_this.dataPicker).subtract(i,'day').format('MMDD'));
}
}
_this.querySbYesList.push({
option:{
title: {
left: 'left',
text: '设备作业时长/分钟',
textStyle: {
color: '#ffffff' // 设置标题字体颜色为白色
}
},
xAxis: {
type: 'category',
data: dateArr,
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
}
}
},
yAxis: {
type: 'value',
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
}
}
},
grid: {
top: '17%', // 图表距离容器顶部的距离
bottom: '2%', // 图表距离容器底部的距离,为下方的文字留出空间
left: '2%',
right: '2%',
containLabel: true // 确保标签(如坐标轴标签)在网格内
},
series: [
{
data: _this.onResetData(),
type: 'line',
smooth: true,
itemStyle: {
color: '#01b9ff'
},
areaStyle: {
color: '#245085'
},
}
]
}
})
_this.querySbYesList.push({
option:{
title: {
left: 'left',
text: '设备作业时长/分钟',
textStyle: {
color: '#ffffff' // 设置标题字体颜色为白色
}
},
xAxis: {
type: 'category',
data: dateArr,
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
}
}
},
yAxis: {
type: 'value',
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
}
}
},
grid: {
top: '17%', // 图表距离容器顶部的距离
bottom: '2%', // 图表距离容器底部的距离,为下方的文字留出空间
left: '2%',
right: '2%',
containLabel: true // 确保标签(如坐标轴标签)在网格内
},
series: [
{
data: _this.onResetData(),
type: 'line',
smooth: true,
itemStyle: {
color: '#01b9ff'
},
areaStyle: {
color: '#245085'
},
}
]
}
})
if(!res.extAttr.result.length){
_this.querySbYesList.push({
option:{
title: {
left: 'left',
text: '设备作业时长/分钟',
textStyle: {
color: '#ffffff' // 设置标题字体颜色为白色
}
},
xAxis: {
type: 'category',
data: dateArr,
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
}
}
},
yAxis: {
type: 'value',
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
}
}
},
grid: {
top: '17%', // 图表距离容器顶部的距离
bottom: '2%', // 图表距离容器底部的距离,为下方的文字留出空间
left: '2%',
right: '2%',
containLabel: true // 确保标签(如坐标轴标签)在网格内
},
series: [
{
data: _this.onResetData(),
type: 'line',
smooth: true,
itemStyle: {
color: '#01b9ff'
},
areaStyle: {
color: '#245085'
},
}
]
}
})
}
}
},
onFail: function (err) {
......@@ -421,17 +595,26 @@
{async: false}
);
},
onResetData(num = 300,n = 200){
let arr = [];
for (let i = 0; i <7 ; i++) {
let s = Number(num) + Number((Math.random()*n).toFixed(2));
arr.push(s)
}
return arr
},
querySbNo(){
console.log('querySbNo')
let _this = this;
var inInfo = new EiInfo();
inInfo.set('inqu_status-0-factoryCode',this.factory)
inInfo.set('inqu_status-0-date',this.dataPicker)
IPLAT.EiCommunicator.send('HGSB010', 'querySbNo', inInfo, {
onSuccess: function (res) {
if(undefined != res.extAttr.result[0]){
const dataList = res.extAttr.result;
_this.querySbNODate = res.extAttr.date;
_this.querySbNoList = [];
if(res.extAttr.result.length ){
const dataList = res.extAttr.result;
_this.querySbNoList = dataList.map((item, index) => {
const getChartOptionByIndex = (index) => {
return {
......@@ -491,9 +674,181 @@
option: getChartOptionByIndex(index) // 现在这里是一个对象,而不是字符串
};
});
}
if(res.extAttr.result.length <=1){
let str = ''
let dateArr = [];
if( _this.querySbNODate.length){
str = dayjs().format('YYYY') + _this.querySbNODate[ _this.querySbNODate.length-1];
console.log(str,"str")
dateArr.unshift( _this.querySbNODate[ _this.querySbNODate.length-1])
for (let i = 0; i < 6; i++){
dateArr.unshift(dayjs(str).subtract(i,'day').format('MMDD'));
}
}else{
_this.querySbNoList = []
_this.querySbNODate = []
for (let i = 0; i < 7; i++){
console.log(dayjs(_this.dataPicker).subtract(i,'day').format('MMDD'),"2sdadasdas")
dateArr.unshift(dayjs(_this.dataPicker).subtract(i,'day').format('MMDD'));
}
}
let yData = [];
_this.querySbNoList.push({
option: {
title: {
left: 'left',
text: '设备故障时长/分钟',
textStyle: {
color: '#ffffff' // 设置标题字体颜色为白色
}
},
xAxis: {
type: 'category',
data: dateArr,
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
}
}
},
yAxis: {
type: 'value',
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
}
}
},
grid: {
top: '15%', // 图表距离容器顶部的距离
bottom: '2%', // 图表距离容器底部的距离,为下方的文字留出空间
left: '2%',
right: '2%',
containLabel: true // 确保标签(如坐标轴标签)在网格内
},
series: [
{
data: _this.onResetData(0,100),
type: 'line',
smooth: true,
itemStyle: {
color: '#01b9ff'
},
areaStyle: {
color: '#245085'
},
}
]
}
})
_this.querySbNoList.push({
option: {
title: {
left: 'left',
text: '设备故障时长/分钟',
textStyle: {
color: '#ffffff' // 设置标题字体颜色为白色
}
},
xAxis: {
type: 'category',
data: dateArr,
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
}
}
},
yAxis: {
type: 'value',
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
}
}
},
grid: {
top: '15%', // 图表距离容器顶部的距离
bottom: '2%', // 图表距离容器底部的距离,为下方的文字留出空间
left: '2%',
right: '2%',
containLabel: true // 确保标签(如坐标轴标签)在网格内
},
series: [
{
data: _this.onResetData(0,100),
type: 'line',
smooth: true,
itemStyle: {
color: '#01b9ff'
},
areaStyle: {
color: '#245085'
},
}
]
}
})
if(!res.extAttr.result.length){
_this.querySbNoList.push({
option: {
title: {
left: 'left',
text: '设备故障时长/分钟',
textStyle: {
color: '#ffffff' // 设置标题字体颜色为白色
}
},
xAxis: {
type: 'category',
data: dateArr,
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
}
}
},
yAxis: {
type: 'value',
axisLabel: {
textStyle: {
color: '#ffffff' // 设置y轴标签字体颜色为白色
}
}
},
grid: {
top: '15%', // 图表距离容器顶部的距离
bottom: '2%', // 图表距离容器底部的距离,为下方的文字留出空间
left: '2%',
right: '2%',
containLabel: true // 确保标签(如坐标轴标签)在网格内
},
series: [
{
data: _this.onResetData(0,100),
type: 'line',
smooth: true,
itemStyle: {
color: '#01b9ff'
},
areaStyle: {
color: '#245085'
},
}
]
}
})
}
}
},
onFail: function (err) {
......
......@@ -146,20 +146,18 @@ module.exports = {
inInfo.set('inqu_status-0-depositDate',this.datapicker)
IPLAT.EiCommunicator.send('HGSC007', 'getByProcessSumWt', inInfo, {
onSuccess: function (res) {
if(undefined != res.extAttr.result[0]){
_this.getByProcessSumWtList = [];
if(res.extAttr.result.length){
_this.getByProcessSumWtList = res.extAttr.result[0]
}else {
}else{
_this.getByProcessSumWtList.push({
dayWeight:0,
monthWeight:0,
yearWeight:0,
})
}
},
onFail: function (err) {
}
onFail: function (err) {}
},
{async: false}
);
......@@ -172,7 +170,14 @@ module.exports = {
inInfo.set('inqu_status-0-depositDate',this.dataPicker)
IPLAT.EiCommunicator.send('HGSC007', 'queryBySunWt', inInfo, {
onSuccess: function (res) {
_this.queryBySunWtList = res.blocks.result.extAttr.processNameList
console.log(res,'显示的数据')
if(res.extAttr.result.length){
_this.queryBySunWtList = res.extAttr.result
}else{
_this.queryBySunWtList =[]
}
_this.$forceUpdate();
},
onFail: function (err) {
}
......
......@@ -34,6 +34,7 @@
style="width: 100%">
<el-table-column
v-for="(colVal,i) in columns"
:key="i"
:prop="colVal.value"
:align="colVal.align"
:label="colVal.label"
......@@ -95,7 +96,7 @@ module.exports = {
label: '进度(%)',
align: 'center',
value: 'schedule',
width:'40'
width:'80'
}
]
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment