This commit is contained in:
朱菊兰 2023-02-13 17:24:54 +08:00
parent 9eeb740c2e
commit 16d7c0c4ad
5 changed files with 108 additions and 47 deletions

View File

@ -39,15 +39,6 @@ export function palletIndicatorGetType(data) {
}) })
} }
// 托盘指标分析
export function palletIndicatorAnalysisType(data) {
return request({
url: '/equipment/PalletIndicatorAnalysis/getType',
method: 'post',
data
})
}
// 备品备件 // 备品备件
export function getSparePartStockPage(data) { export function getSparePartStockPage(data) {
return request({ return request({

View File

@ -3,7 +3,6 @@
<el-form-item label="用户名" prop="account"> <el-form-item label="用户名" prop="account">
<el-input <el-input
v-model="form.account" v-model="form.account"
onkeyup="value=value.replace(/[\W]/g,'')"
placeholder="只能输入字母或数字,不可输入汉字" placeholder="只能输入字母或数字,不可输入汉字"
:disabled="isEdit" :disabled="isEdit"
></el-input> ></el-input>
@ -109,6 +108,7 @@ export default {
submitForm() { submitForm() {
this.$refs['form'].validate((valid) => { this.$refs['form'].validate((valid) => {
if (valid) { if (valid) {
this.form.account = this.form.account.replace(/[\W]/g, '')
if (this.isEdit) { if (this.isEdit) {
// //
accountUpdate({ ...this.form }).then((res) => { accountUpdate({ ...this.form }).then((res) => {

View File

@ -12,6 +12,7 @@
:table-props="tableProps" :table-props="tableProps"
:table-data="tableData" :table-data="tableData"
:max-height="tableH" :max-height="tableH"
:row-class-name="tableRowClassName"
> >
<method-btn <method-btn
v-if="tableBtn.length" v-if="tableBtn.length"
@ -297,6 +298,12 @@ export default {
}) })
} }
}, },
tableRowClassName({ row }) {
if (row.flag && row.flag > 0) {
return 'danger-row'
}
return ''
},
handleCancel() { handleCancel() {
this.$refs.inAndOutManagementAdd.formClear() this.$refs.inAndOutManagementAdd.formClear()
this.addAndEdit = '' this.addAndEdit = ''

View File

@ -55,7 +55,7 @@ import { tableHeight } from '@/utils/index'
import palletLevelChart from './../components/palletLevelChart.vue' import palletLevelChart from './../components/palletLevelChart.vue'
import { import {
palletIndicatorAnalysisPage, palletIndicatorAnalysisPage,
palletIndicatorAnalysisType palletIndicatorGetType
} from '@/api/deviceManagement' } from '@/api/deviceManagement'
import { timeFormatter } from '@/utils' import { timeFormatter } from '@/utils'
const tableProps = [ const tableProps = [
@ -159,7 +159,8 @@ export default {
], ],
listQuery: { listQuery: {
current: 1, current: 1,
size: 20 size: 20,
palletId: ''
}, },
total: 0, total: 0,
tableProps, tableProps,
@ -200,7 +201,7 @@ export default {
}, },
getLevel() { getLevel() {
// ID // ID
palletIndicatorAnalysisType({ id: 1 }).then((res) => { palletIndicatorGetType({ id: 1 }).then((res) => {
this.tableData2 = [] this.tableData2 = []
if (res.code === 0) { if (res.code === 0) {
const data = res.data const data = res.data

View File

@ -14,7 +14,7 @@
import * as echarts from 'echarts' import * as echarts from 'echarts'
import { tableHeight } from '@/utils/index' import { tableHeight } from '@/utils/index'
import resize from '@/utils/chartMixins/resize' import resize from '@/utils/chartMixins/resize'
import { getProcessFull } from '@/api/qualityManagement' // import { getProcessFull } from '@/api/qualityManagement'
import moment from 'moment' import moment from 'moment'
export default { export default {
name: 'particleLineChart', name: 'particleLineChart',
@ -49,13 +49,9 @@ export default {
chartDom: '', chartDom: '',
chart: '', chart: '',
chartHeight: tableHeight(320), chartHeight: tableHeight(320),
listQuery: {
size: 1000,
current: 1,
checkOutTime: '', checkOutTime: '',
maxLine: '' maxLine: ''
} }
}
}, },
mounted() { mounted() {
this.chartDom = document.getElementById('particleLineChart') this.chartDom = document.getElementById('particleLineChart')
@ -63,15 +59,15 @@ export default {
window.addEventListener('resize', () => { window.addEventListener('resize', () => {
this.chartHeight = tableHeight(320) this.chartHeight = tableHeight(320)
}) })
this.formConfig[0].defaultSelect = moment().format('YYYY-MM-DDTHH:mm:ss') this.formConfig[0].defaultSelect = moment().format('YYYY-MM-DD HH:mm:ss')
this.getMsg() this.getMsg()
}, },
methods: { methods: {
buttonClick(val) { buttonClick(val) {
console.log(val) console.log(val)
if (val.btnName === 'search') { if (val.btnName === 'search') {
this.listQuery.checkOutTime = val.checkOutTime this.checkOutTime = val.checkOutTime
this.listQuery.maxLine = val.maxLine this.maxLine = val.maxLine
this.getMsg() this.getMsg()
} }
}, },
@ -83,18 +79,14 @@ export default {
let xlList = [] let xlList = []
let sumList = [] let sumList = []
let msg = {} let msg = {}
getProcessFull({ ...this.listQuery }).then((res) => { for (let i = 0; i < 100; i++) {
console.log(res) time.push(moment().add(1, 'days').format('YYYY-MM-DD HH:mm:ss'))
if (res.code === 0 && res.data.length > 0) { sList.push(Math.floor(Math.random() * 80 + 10))
res.data.map((item) => { mList.push(Math.floor(Math.random() * 80 + 20))
console.log(item) lList.push(Math.floor(Math.random() * 80 + 30))
time.push(moment(item.hour).format('MM-DD HH:mm:ss')) xlList.push(Math.floor(Math.random() * 80 + 40))
sList.push(item.s) sumList.push(sList[i] + mList[i] + lList[i] + xlList[i])
mList.push(item.m) }
lList.push(item.l)
xlList.push(item.xl)
sumList.push(item.sum)
})
msg.time = time msg.time = time
msg.sList = sList msg.sList = sList
msg.mList = mList msg.mList = mList
@ -102,10 +94,29 @@ export default {
msg.xlList = xlList msg.xlList = xlList
msg.sumList = sumList msg.sumList = sumList
this.getChart(msg) this.getChart(msg)
} // getProcessFull({ checkOutTime: this.checkOutTime }).then((res) => {
}) // console.log(res)
// if (res.code === 0 && res.data.length > 0) {
// res.data.map((item) => {
// console.log(item)
// time.push(moment(item.hour).format('MM-DD HH:mm:ss'))
// sList.push(item.s)
// mList.push(item.m)
// lList.push(item.l)
// xlList.push(item.xl)
// sumList.push(item.sum)
// })
// msg.time = time
// msg.sList = sList
// msg.mList = mList
// msg.lList = lList
// msg.xlList = xlList
// msg.sumList = sumList
// this.getChart(msg)
// }
// })
}, },
getChart(msg) { getChart1(msg) {
var option = { var option = {
color: ['#5AD8A6', '#5B8FF9', '#5D7092', '#F6BD16', '#E8684A'], color: ['#5AD8A6', '#5B8FF9', '#5D7092', '#F6BD16', '#E8684A'],
title: { title: {
@ -141,7 +152,7 @@ export default {
Symbol: 'none', Symbol: 'none',
label: { label: {
position: 'end', position: 'end',
formatter: '合格线\n' + this.listQuery.maxLine formatter: '合格线\n' + this.maxLine
}, },
data: [ data: [
{ {
@ -150,7 +161,7 @@ export default {
type: 'dashed', type: 'dashed',
color: '#0B58FF' color: '#0B58FF'
}, },
yAxis: this.listQuery.maxLine yAxis: this.maxLine
} }
] ]
} }
@ -178,6 +189,57 @@ export default {
] ]
} }
option && this.chart.setOption(option)
},
getChart(msg) {
console.log(msg)
var option = {
title: {
text: 'Beijing AQI',
left: '1%'
},
tooltip: {
trigger: 'axis'
},
grid: {
left: '5%',
right: '15%',
bottom: '10%'
},
xAxis: msg.time,
yAxis: {},
toolbox: {
right: 10,
feature: {
dataZoom: {
yAxisIndex: 'none'
},
restore: {},
saveAsImage: {}
}
},
dataZoom: [
{
startValue: '2014-06-01'
},
{
type: 'inside'
}
],
visualMap: {
top: 50,
right: 10,
outOfRange: {
color: '#999'
}
},
series: {
name: 'Beijing AQI',
type: 'line',
data: msg.sList
}
}
option && this.chart.setOption(option) option && this.chart.setOption(option)
} }
} }