11 Commits

Author SHA1 Message Date
5a3e16df1b Merge pull request 'fzq' (#32) from fzq into develop
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #32
2023-09-12 15:37:15 +08:00
Fanzink
6815ac4cc4 '修改设备与PLC关联-新增-下拉框条数' 2023-09-12 12:44:54 +05:30
Fanzink
4ffbdaef8a '设备与PLC,设备获取所有' 2023-04-22 10:51:10 +05:30
36e6551465 Merge pull request ''厂务设备参数修改设备列表size,设备分析状态监控去掉默认产线工厂'' (#29) from fzq into develop
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #29
2023-04-18 15:42:29 +08:00
Fanzink
b1ab1962b1 '厂务设备参数修改设备列表size,设备分析状态监控去掉默认产线工厂' 2023-04-18 09:48:13 +05:30
2cefabc24b Merge pull request ''修改日期选择器样式文件index.css'' (#28) from fzq into develop
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #28
2023-03-30 15:40:27 +08:00
Fanzink
db47bffb18 '修改日期选择器样式文件index.css' 2023-03-30 11:28:14 +05:30
65b489d37c Merge pull request ''数据分析bug修改2次'' (#27) from fzq into develop
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #27
2023-03-27 10:59:39 +08:00
Fanzink
5afadfb1ce '数据分析bug修改2次' 2023-03-24 17:23:26 +05:30
67612107ea Merge pull request ''改数据分析bug'' (#26) from fzq into develop
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #26
2023-03-23 17:09:52 +08:00
Fanzink
e0d4e5327f '改数据分析bug' 2023-03-23 11:31:59 +05:30
10 changed files with 172 additions and 51 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -358,7 +358,8 @@ export default {
dialogEqList: [], dialogEqList: [],
count: 0, count: 0,
// 产线默认产线1 // 产线默认产线1
lineIds: ['1'], // lineIds: ['1'],
lineIds: [],
sectionIds: [], sectionIds: [],
lineList: [], lineList: [],
// tableConfigStatic, // tableConfigStatic,
@@ -428,10 +429,10 @@ export default {
if (data && data.code === 0) { if (data && data.code === 0) {
this.lineList = data.data this.lineList = data.data
// console.log('产线数组', this.lineList) // console.log('产线数组', this.lineList)
/** set default */ /** set default 默认*/
if (this.lineList.length) { // if (this.lineList.length) {
this.lineIds = [this.lineList[this.lineList.length - 1].id] // this.lineIds = [this.lineList[this.lineList.length - 1].id]
} // }
} else { } else {
this.lineList = [] this.lineList = []
} }
@@ -446,6 +447,7 @@ export default {
// 获取工序列表 // 获取工序列表
getWorksetionList() { getWorksetionList() {
// 分页列表才有根据产线过滤功能 // 分页列表才有根据产线过滤功能
// this.wsList = []
for (let i = 0; i < this.lineIds.length; i++) { for (let i = 0; i < this.lineIds.length; i++) {
this.$http({ this.$http({
// url: this.$http.adornUrl('/monitoring/workshopSection/list'), // url: this.$http.adornUrl('/monitoring/workshopSection/list'),
@@ -582,6 +584,8 @@ export default {
// this.renderChart() // this.renderChart()
// }) // })
} }
}).catch((err) => {
// console.error(err)
}) })
}, },
setOptions(opts) { setOptions(opts) {
@@ -592,29 +596,29 @@ export default {
if (this.chart) this.chart.setOption(this.defaultOpts, true) if (this.chart) this.chart.setOption(this.defaultOpts, true)
}, },
// 失效函数 // 失效函数
parseTableProps(nameData) { // parseTableProps(nameData) {
const subProps = [] // const subProps = []
const labelNameMap = new Map() // const labelNameMap = new Map()
// if (nameData.length) { // // if (nameData.length) {
// /** 处理 nameData */ // // /** 处理 nameData */
// nameData.forEach((item) => { // // nameData.forEach((item) => {
// if (!labelNameMap.get(item.name)) { // // if (!labelNameMap.get(item.name)) {
// labelNameMap.set(item.name, 1) // // labelNameMap.set(item.name, 1)
// subProps.push({ name: item.name, prop: item.name }) // // subProps.push({ name: item.name, prop: item.name })
// } // // }
// }) // // })
// } // // }
this.tableConfigDynamic = [ // this.tableConfigDynamic = [
{ type: 'index', width: 100, name: i18n.t('index') }, // { type: 'index', width: 100, name: i18n.t('index') },
{ name: i18n.t('pl.name'), prop: '0' }, // { 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 })) // ...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 */ // /** echarts related */
// this.echartCategories = subProps.map((item) => item.name) // // this.echartCategories = subProps.map((item) => item.name)
this.echartCategories = this.dataListDynamic.map((item) => item.name) // this.echartCategories = this.dataListDynamic.map((item) => item.name)
}, // },
// parseDynamicData(data) { // parseDynamicData(data) {
// this.echartCheckTypes.splice(0) // this.echartCheckTypes.splice(0)
@@ -740,9 +744,11 @@ export default {
//遍历属性 //遍历属性
this.keys = [...Object.keys(res.data),...this.keys] this.keys = [...Object.keys(res.data),...this.keys]
// console.log('this.finalVal', this.finalVal) // console.log('this.finalVal', this.finalVal)
// console.log('keys', this.keys) console.log('keys', this.keys)
this.values = Object.values(res.data) this.values = Object.values(res.data)
// console.log('values', this.values) // console.log('values', this.values)
// 初始化values2
this.values2 = []
for (let c = 0; c < this.values.length; c++) { for (let c = 0; c < this.values.length; c++) {
this.values2.push( this.values2.push(
this.values[c].map((item) => { this.values[c].map((item) => {
@@ -750,8 +756,9 @@ export default {
}) })
) )
} }
console.log('values2', this.values2)
this.finalVal = [...this.values2,...this.finalVal] 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.$message.success(this.$t('pl.success'))
this.$nextTick(() => { this.$nextTick(() => {
this.dialogVisible = false this.dialogVisible = false

View File

@@ -165,7 +165,11 @@ export default {
getEqList() { getEqList() {
this.$http({ this.$http({
url: this.$http.adornUrl('/monitoring/equipment/page'), url: this.$http.adornUrl('/monitoring/equipment/page'),
method: 'get' method: 'get',
params: this.$http.adornParams({
limit: 99999,
page: 1
})
}).then(({ data }) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.eqList = data.data.list this.eqList = data.data.list

View File

@@ -207,7 +207,7 @@ export default {
this.factoryList = res.data this.factoryList = res.data
/** set default */ /** set default */
if (this.factoryList.length) { if (this.factoryList.length) {
this.dataForm.ftId = this.factoryList[0].id // this.dataForm.ftId = this.factoryList[0].id
} }
} else { } else {
this.factoryList = [] this.factoryList = []
@@ -236,7 +236,7 @@ export default {
if (res && res.code === 0 && res.data.length) { if (res && res.code === 0 && res.data.length) {
this.productLineList = res.data this.productLineList = res.data
/** set default */ /** set default */
this.dataForm.productlines = [this.productLineList[0].id] // this.dataForm.productlines = [this.productLineList[0].id]
} else { } else {
this.productLineList = [] this.productLineList = []
this.dataForm.productlines = [] this.dataForm.productlines = []

View File

@@ -135,10 +135,10 @@ export default {
}).then(({ data: res }) => { }).then(({ data: res }) => {
if (res && res.code === 0) { if (res && res.code === 0) {
this.productLineList = res.data this.productLineList = res.data
/** set default */ /** set default 默认*/
if (this.productLineList.length) { // if (this.productLineList.length) {
this.dataForm.productlines = [this.productLineList[0].id] // this.dataForm.productlines = [this.productLineList[0].id]
} // }
} else { } else {
this.productLineList = [] this.productLineList = []
this.dataForm.productlines = [] this.dataForm.productlines = []

View File

@@ -165,6 +165,8 @@ export default {
// page: this.pageIndex, // page: this.pageIndex,
// limit: this.pageSize, // limit: this.pageSize,
// key: this.dataForm.key // key: this.dataForm.key
limit: 99999,
page: 1
}) })
}).then(({ data }) => { }).then(({ data }) => {
const eqConfig = this.addOrUpdateConfigs.fields.find(item => item.name === 'equipmentId') const eqConfig = this.addOrUpdateConfigs.fields.find(item => item.name === 'equipmentId')
@@ -180,6 +182,8 @@ export default {
// page: this.pageIndex, // page: this.pageIndex,
// limit: this.pageSize, // limit: this.pageSize,
// key: this.dataForm.key // key: this.dataForm.key
limit: 99999,
page: 1
}) })
}).then(({ data }) => { }).then(({ data }) => {
const plcConfig = this.addOrUpdateConfigs.fields.find(item => item.name === 'plcId') const plcConfig = this.addOrUpdateConfigs.fields.find(item => item.name === 'plcId')

View File

@@ -270,10 +270,10 @@ export default {
}).then(({ data: res }) => { }).then(({ data: res }) => {
if (res && res.code === 0) { if (res && res.code === 0) {
this.productLineList = res.data this.productLineList = res.data
/** set default */ /** set default 默认*/
if (this.productLineList.length) { // if (this.productLineList.length) {
this.dataForm.productlines = this.productLineList[0].id // this.dataForm.productlines = this.productLineList[0].id
} // }
} else { } else {
this.productLineList = [] this.productLineList = []
} }

View File

@@ -167,7 +167,9 @@ const FakeChart = {
show: true show: true
}, },
/** end */ /** 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: { xAxis: {
type: 'category', type: 'category',
@@ -268,8 +270,8 @@ const FakeChart = {
typeList: { typeList: {
handler: function (val, oldVal) { handler: function (val, oldVal) {
if (val && val !== oldVal) { if (val && val !== oldVal) {
this.defaultOpts.legend.data.push(...val) // this.defaultOpts.legend.data.push(...val)
// this.defaultOpts.legend.data = val this.defaultOpts.legend.data = val
} }
}, },
immediate: true immediate: true
@@ -423,10 +425,10 @@ export default {
if (data && data.code === 0) { if (data && data.code === 0) {
this.lineList = data.data this.lineList = data.data
// console.log('产线数组', this.lineList) // console.log('产线数组', this.lineList)
/** set default */ /** set default 默认 */
if (this.lineList.length) { // if (this.lineList.length) {
this.lineIds = [this.lineList[this.lineList.length - 1].id] // this.lineIds = [this.lineList[this.lineList.length - 1].id]
} // }
} else { } else {
this.lineList = [] this.lineList = []
} }
@@ -641,6 +643,24 @@ export default {
// { name: '11', type: 'bar', data: [/**产线1*/ 2, /**产线2*/ 3] }, // { name: '11', type: 'bar', data: [/**产线1*/ 2, /**产线2*/ 3] },
// { name: '222', type: 'bar', data: [1, 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) { fetchList(startTime, endTime, lineIds) {
@@ -696,4 +716,14 @@ export default {
color: #fff; color: #fff;
background: #0b58ff; 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> </style>

View File

@@ -151,7 +151,7 @@ const FakeChart = {
left: '5%', left: '5%',
right: '12%', right: '12%',
top: '20%', top: '20%',
bottom: '10%' bottom: '22%'
}, },
title: { title: {
text: i18n.t('eq.productQuality') text: i18n.t('eq.productQuality')
@@ -165,7 +165,64 @@ const FakeChart = {
}, },
toolbox: { toolbox: {
feature: { 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 }, restore: { show: true },
saveAsImage: { 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: [ series: [
// dynamic // dynamic
{ {
@@ -531,7 +601,7 @@ export default {
this.echartRealtime = this.echartCategories this.echartRealtime = this.echartCategories
// this.parseTableProps(res.data.nameData) // this.parseTableProps(res.data.nameData)
// console.log('this.dataListDynamic', this.dataListDynamic) console.log('this.dataListDynamic', this.dataListDynamic)
this.buildGraphData() this.buildGraphData()
}) })