Compare commits
11 Commits
7ec1c5f3fc
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a3e16df1b | |||
|
|
6815ac4cc4 | ||
|
|
4ffbdaef8a | ||
| 36e6551465 | |||
|
|
b1ab1962b1 | ||
| 2cefabc24b | |||
|
|
db47bffb18 | ||
| 65b489d37c | |||
|
|
5afadfb1ce | ||
| 67612107ea | |||
|
|
e0d4e5327f |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -358,7 +358,8 @@ export default {
|
||||
dialogEqList: [],
|
||||
count: 0,
|
||||
// 产线默认产线1
|
||||
lineIds: ['1'],
|
||||
// lineIds: ['1'],
|
||||
lineIds: [],
|
||||
sectionIds: [],
|
||||
lineList: [],
|
||||
// tableConfigStatic,
|
||||
@@ -428,10 +429,10 @@ export default {
|
||||
if (data && data.code === 0) {
|
||||
this.lineList = data.data
|
||||
// console.log('产线数组', this.lineList)
|
||||
/** set default */
|
||||
if (this.lineList.length) {
|
||||
this.lineIds = [this.lineList[this.lineList.length - 1].id]
|
||||
}
|
||||
/** set default 默认*/
|
||||
// if (this.lineList.length) {
|
||||
// this.lineIds = [this.lineList[this.lineList.length - 1].id]
|
||||
// }
|
||||
} else {
|
||||
this.lineList = []
|
||||
}
|
||||
@@ -446,6 +447,7 @@ export default {
|
||||
// 获取工序列表
|
||||
getWorksetionList() {
|
||||
// 分页列表才有根据产线过滤功能
|
||||
// this.wsList = []
|
||||
for (let i = 0; i < this.lineIds.length; i++) {
|
||||
this.$http({
|
||||
// url: this.$http.adornUrl('/monitoring/workshopSection/list'),
|
||||
@@ -582,6 +584,8 @@ export default {
|
||||
// this.renderChart()
|
||||
// })
|
||||
}
|
||||
}).catch((err) => {
|
||||
// console.error(err)
|
||||
})
|
||||
},
|
||||
setOptions(opts) {
|
||||
@@ -592,29 +596,29 @@ export default {
|
||||
if (this.chart) this.chart.setOption(this.defaultOpts, true)
|
||||
},
|
||||
// 失效函数
|
||||
parseTableProps(nameData) {
|
||||
const subProps = []
|
||||
const labelNameMap = new Map()
|
||||
// parseTableProps(nameData) {
|
||||
// const subProps = []
|
||||
// const labelNameMap = new Map()
|
||||
|
||||
// if (nameData.length) {
|
||||
// /** 处理 nameData */
|
||||
// nameData.forEach((item) => {
|
||||
// if (!labelNameMap.get(item.name)) {
|
||||
// labelNameMap.set(item.name, 1)
|
||||
// subProps.push({ name: item.name, prop: item.name })
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// // if (nameData.length) {
|
||||
// // /** 处理 nameData */
|
||||
// // nameData.forEach((item) => {
|
||||
// // if (!labelNameMap.get(item.name)) {
|
||||
// // labelNameMap.set(item.name, 1)
|
||||
// // subProps.push({ name: item.name, prop: item.name })
|
||||
// // }
|
||||
// // })
|
||||
// // }
|
||||
|
||||
this.tableConfigDynamic = [
|
||||
{ type: 'index', width: 100, name: i18n.t('index') },
|
||||
{ name: i18n.t('pl.name'), prop: '0' },
|
||||
...Array.from(new Set(res.data.data[0].records.map((item) => moment(item.recordTime).format('MM-DD')))).map((name) => ({ prop: String(++this.count), name }))
|
||||
]
|
||||
/** echarts related */
|
||||
// this.echartCategories = subProps.map((item) => item.name)
|
||||
this.echartCategories = this.dataListDynamic.map((item) => item.name)
|
||||
},
|
||||
// this.tableConfigDynamic = [
|
||||
// { type: 'index', width: 100, name: i18n.t('index') },
|
||||
// { name: i18n.t('pl.name'), prop: '0' },
|
||||
// ...Array.from(new Set(res.data.data[0].records.map((item) => moment(item.recordTime).format('MM-DD')))).map((name) => ({ prop: String(++this.count), name }))
|
||||
// ]
|
||||
// /** echarts related */
|
||||
// // this.echartCategories = subProps.map((item) => item.name)
|
||||
// this.echartCategories = this.dataListDynamic.map((item) => item.name)
|
||||
// },
|
||||
|
||||
// parseDynamicData(data) {
|
||||
// this.echartCheckTypes.splice(0)
|
||||
@@ -740,9 +744,11 @@ export default {
|
||||
//遍历属性
|
||||
this.keys = [...Object.keys(res.data),...this.keys]
|
||||
// console.log('this.finalVal', this.finalVal)
|
||||
// console.log('keys', this.keys)
|
||||
console.log('keys', this.keys)
|
||||
this.values = Object.values(res.data)
|
||||
// console.log('values', this.values)
|
||||
// 初始化values2
|
||||
this.values2 = []
|
||||
for (let c = 0; c < this.values.length; c++) {
|
||||
this.values2.push(
|
||||
this.values[c].map((item) => {
|
||||
@@ -750,8 +756,9 @@ export default {
|
||||
})
|
||||
)
|
||||
}
|
||||
console.log('values2', this.values2)
|
||||
this.finalVal = [...this.values2,...this.finalVal]
|
||||
// console.log('this.finalVal', this.finalVal)
|
||||
console.log('this.finalVal', this.finalVal)
|
||||
this.$message.success(this.$t('pl.success'))
|
||||
this.$nextTick(() => {
|
||||
this.dialogVisible = false
|
||||
|
||||
@@ -165,7 +165,11 @@ export default {
|
||||
getEqList() {
|
||||
this.$http({
|
||||
url: this.$http.adornUrl('/monitoring/equipment/page'),
|
||||
method: 'get'
|
||||
method: 'get',
|
||||
params: this.$http.adornParams({
|
||||
limit: 99999,
|
||||
page: 1
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
if (data && data.code === 0) {
|
||||
this.eqList = data.data.list
|
||||
|
||||
@@ -207,7 +207,7 @@ export default {
|
||||
this.factoryList = res.data
|
||||
/** set default */
|
||||
if (this.factoryList.length) {
|
||||
this.dataForm.ftId = this.factoryList[0].id
|
||||
// this.dataForm.ftId = this.factoryList[0].id
|
||||
}
|
||||
} else {
|
||||
this.factoryList = []
|
||||
@@ -236,7 +236,7 @@ export default {
|
||||
if (res && res.code === 0 && res.data.length) {
|
||||
this.productLineList = res.data
|
||||
/** set default */
|
||||
this.dataForm.productlines = [this.productLineList[0].id]
|
||||
// this.dataForm.productlines = [this.productLineList[0].id]
|
||||
} else {
|
||||
this.productLineList = []
|
||||
this.dataForm.productlines = []
|
||||
|
||||
@@ -135,10 +135,10 @@ export default {
|
||||
}).then(({ data: res }) => {
|
||||
if (res && res.code === 0) {
|
||||
this.productLineList = res.data
|
||||
/** set default */
|
||||
if (this.productLineList.length) {
|
||||
this.dataForm.productlines = [this.productLineList[0].id]
|
||||
}
|
||||
/** set default 默认*/
|
||||
// if (this.productLineList.length) {
|
||||
// this.dataForm.productlines = [this.productLineList[0].id]
|
||||
// }
|
||||
} else {
|
||||
this.productLineList = []
|
||||
this.dataForm.productlines = []
|
||||
|
||||
@@ -165,6 +165,8 @@ export default {
|
||||
// page: this.pageIndex,
|
||||
// limit: this.pageSize,
|
||||
// key: this.dataForm.key
|
||||
limit: 99999,
|
||||
page: 1
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
const eqConfig = this.addOrUpdateConfigs.fields.find(item => item.name === 'equipmentId')
|
||||
@@ -180,6 +182,8 @@ export default {
|
||||
// page: this.pageIndex,
|
||||
// limit: this.pageSize,
|
||||
// key: this.dataForm.key
|
||||
limit: 99999,
|
||||
page: 1
|
||||
})
|
||||
}).then(({ data }) => {
|
||||
const plcConfig = this.addOrUpdateConfigs.fields.find(item => item.name === 'plcId')
|
||||
|
||||
@@ -270,10 +270,10 @@ export default {
|
||||
}).then(({ data: res }) => {
|
||||
if (res && res.code === 0) {
|
||||
this.productLineList = res.data
|
||||
/** set default */
|
||||
if (this.productLineList.length) {
|
||||
this.dataForm.productlines = this.productLineList[0].id
|
||||
}
|
||||
/** set default 默认*/
|
||||
// if (this.productLineList.length) {
|
||||
// this.dataForm.productlines = this.productLineList[0].id
|
||||
// }
|
||||
} else {
|
||||
this.productLineList = []
|
||||
}
|
||||
|
||||
@@ -167,7 +167,9 @@ const FakeChart = {
|
||||
show: true
|
||||
},
|
||||
/** end */
|
||||
data: [this.$t('eq.line1'), this.$t('eq.line2'), this.$t('eq.line3'), this.$t('eq.line4')]
|
||||
data: []
|
||||
// selected:{'产线1':(this.echartsData1 === [] ? false : true) , 'Line 1':(this.echartsData1 === [] ? false : true) ,
|
||||
// '产线2':(this.echartsData2 === [] ? false : true) , 'Line 2':(this.echartsData2 === [] ? false : true) }
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
@@ -268,8 +270,8 @@ const FakeChart = {
|
||||
typeList: {
|
||||
handler: function (val, oldVal) {
|
||||
if (val && val !== oldVal) {
|
||||
this.defaultOpts.legend.data.push(...val)
|
||||
// this.defaultOpts.legend.data = val
|
||||
// this.defaultOpts.legend.data.push(...val)
|
||||
this.defaultOpts.legend.data = val
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
@@ -423,10 +425,10 @@ export default {
|
||||
if (data && data.code === 0) {
|
||||
this.lineList = data.data
|
||||
// console.log('产线数组', this.lineList)
|
||||
/** set default */
|
||||
if (this.lineList.length) {
|
||||
this.lineIds = [this.lineList[this.lineList.length - 1].id]
|
||||
}
|
||||
/** set default 默认 */
|
||||
// if (this.lineList.length) {
|
||||
// this.lineIds = [this.lineList[this.lineList.length - 1].id]
|
||||
// }
|
||||
} else {
|
||||
this.lineList = []
|
||||
}
|
||||
@@ -641,6 +643,24 @@ export default {
|
||||
// { name: '11', type: 'bar', data: [/**产线1*/ 2, /**产线2*/ 3] },
|
||||
// { name: '222', type: 'bar', data: [1, 2, 3] }
|
||||
// ]
|
||||
// 没有数据的产线legend隐藏
|
||||
if (this.echartsData1.length !== 0) {
|
||||
this.echartCheckTypes.push(this.$t('eq.line1'))
|
||||
}
|
||||
if (this.echartsData2.length !== 0) {
|
||||
this.echartCheckTypes.push(this.$t('eq.line2'))
|
||||
}
|
||||
if (this.echartsData3.length !== 0) {
|
||||
this.echartCheckTypes.push(this.$t('eq.line3'))
|
||||
}
|
||||
if (this.echartsData4.length !== 0) {
|
||||
this.echartCheckTypes.push(this.$t('eq.line4'))
|
||||
}
|
||||
// console.log('this.echartCheckTypes', this.echartCheckTypes)
|
||||
// console.log(this.echartsData1.length)
|
||||
// console.log(this.echartsData2.length)
|
||||
// console.log(this.echartsData3)
|
||||
// console.log(this.echartsData4)
|
||||
},
|
||||
|
||||
fetchList(startTime, endTime, lineIds) {
|
||||
@@ -696,4 +716,14 @@ export default {
|
||||
color: #fff;
|
||||
background: #0b58ff;
|
||||
}
|
||||
.el-month-table td.today .cell {
|
||||
font-weight: normal;
|
||||
color: #000 !important;
|
||||
}
|
||||
.el-month-table td.current:not(.disabled) .cell{
|
||||
color: #ffffff;
|
||||
font-weight: bold !important;
|
||||
background-color: var(--el-datepicker-active-color);
|
||||
border-radius: 100px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -151,7 +151,7 @@ const FakeChart = {
|
||||
left: '5%',
|
||||
right: '12%',
|
||||
top: '20%',
|
||||
bottom: '10%'
|
||||
bottom: '22%'
|
||||
},
|
||||
title: {
|
||||
text: i18n.t('eq.productQuality')
|
||||
@@ -165,7 +165,64 @@ const FakeChart = {
|
||||
},
|
||||
toolbox: {
|
||||
feature: {
|
||||
dataView: { show: true, readOnly: false },
|
||||
dataView: {
|
||||
show: true,
|
||||
readOnly: true,
|
||||
optionToContent: function (opt) {
|
||||
var axisData = opt.xAxis[0].data
|
||||
var series = opt.series
|
||||
//验证是否是中文
|
||||
var pattern = new RegExp('[\u4E00-\u9FA5]+')
|
||||
if (pattern.test(series[0].name)) {
|
||||
var table =
|
||||
'<table class="layui-table" style="width:100%;text-align:center"><tbody><tr>' +
|
||||
'<td>设备名称</td>' +
|
||||
'<td>' +
|
||||
series[0].name +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
series[1].name +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
series[2].name +
|
||||
'</td>' +
|
||||
'</tr>'
|
||||
} else {
|
||||
var table =
|
||||
'<table class="layui-table" style="width:100%;text-align:center"><tbody><tr>' +
|
||||
'<td>Equipment Name</td>' +
|
||||
'<td>' +
|
||||
series[0].name +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
series[1].name +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
series[2].name +
|
||||
'</td>' +
|
||||
'</tr>'
|
||||
}
|
||||
for (var i = 0, l = axisData.length; i < l; i++) {
|
||||
table +=
|
||||
'<tr>' +
|
||||
'<td>' +
|
||||
axisData[i] +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
series[0].data[i] +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
series[1].data[i] +
|
||||
'</td>' +
|
||||
'<td>' +
|
||||
series[2].data[i] +
|
||||
'</td>' +
|
||||
'</tr>'
|
||||
}
|
||||
table += '</tbody></table>'
|
||||
return table
|
||||
}
|
||||
},
|
||||
restore: { show: true },
|
||||
saveAsImage: { show: true }
|
||||
}
|
||||
@@ -261,6 +318,19 @@ const FakeChart = {
|
||||
}
|
||||
}
|
||||
],
|
||||
dataZoom: [
|
||||
{
|
||||
type: 'slider',
|
||||
start: 0,
|
||||
end: 100,
|
||||
// 最大的放大是图形的2%
|
||||
// maxSpan: 2
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
end: 10
|
||||
}
|
||||
],
|
||||
series: [
|
||||
// dynamic
|
||||
{
|
||||
@@ -531,7 +601,7 @@ export default {
|
||||
this.echartRealtime = this.echartCategories
|
||||
// this.parseTableProps(res.data.nameData)
|
||||
|
||||
// console.log('this.dataListDynamic', this.dataListDynamic)
|
||||
console.log('this.dataListDynamic', this.dataListDynamic)
|
||||
|
||||
this.buildGraphData()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user