颗粒折线图
This commit is contained in:
@@ -119,3 +119,21 @@ export function getProcessFull(data) {
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 厚度分布图--查询
|
||||
export function queryThickness(data) {
|
||||
return request({
|
||||
url: '/quality/ProcessFull/queryThickness',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
// 厚度分布图--绘图
|
||||
export function drawThickness(val) {
|
||||
return request({
|
||||
url: '/quality/ProcessFull/drawThickness',
|
||||
method: 'post',
|
||||
formState: true,
|
||||
data: val
|
||||
})
|
||||
}
|
||||
|
||||
@@ -68,6 +68,7 @@ export default {
|
||||
data.push(arr)
|
||||
}
|
||||
}
|
||||
console.log(data)
|
||||
var option = {
|
||||
tooltip: {
|
||||
position: 'top'
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
import * as echarts from 'echarts'
|
||||
import { tableHeight } from '@/utils/index'
|
||||
import resize from '@/utils/chartMixins/resize'
|
||||
// import { getProcessFull } from '@/api/qualityManagement'
|
||||
import { getProcessFull } from '@/api/qualityManagement'
|
||||
import moment from 'moment'
|
||||
export default {
|
||||
name: 'particleLineChart',
|
||||
@@ -25,13 +25,15 @@ export default {
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '检验时间',
|
||||
dateType: 'datetime',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
placeholder: '抽检时间',
|
||||
param: 'checkOutTime',
|
||||
defaultSelect: '',
|
||||
width: 200
|
||||
valueFormat: 'yyyy-MM-ddTHH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 350
|
||||
},
|
||||
{
|
||||
type: 'input',
|
||||
@@ -49,6 +51,10 @@ export default {
|
||||
chartDom: '',
|
||||
chart: '',
|
||||
chartHeight: tableHeight(320),
|
||||
listQuery: {
|
||||
startTime: '',
|
||||
endTime: ''
|
||||
},
|
||||
checkOutTime: '',
|
||||
maxLine: ''
|
||||
}
|
||||
@@ -59,14 +65,21 @@ export default {
|
||||
window.addEventListener('resize', () => {
|
||||
this.chartHeight = tableHeight(320)
|
||||
})
|
||||
this.formConfig[0].defaultSelect = moment().format('YYYY-MM-DD HH:mm:ss')
|
||||
this.formConfig[0].defaultSelect = [
|
||||
moment().format('yyyy-MM-DD') + 'T00:00:00',
|
||||
moment().format('yyyy-MM-DD') + 'T23:59:59'
|
||||
]
|
||||
this.listQuery.startTime = moment().format('yyyy-MM-DD') + 'T00:00:00'
|
||||
this.listQuery.endTime = moment().format('yyyy-MM-DD') + 'T23:59:59'
|
||||
this.getList()
|
||||
this.getMsg()
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {
|
||||
console.log(val)
|
||||
if (val.btnName === 'search') {
|
||||
this.checkOutTime = val.checkOutTime
|
||||
this.listQuery.startTime = val.timeVal ? val.timeVal[0] : ''
|
||||
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : ''
|
||||
this.maxLine = val.maxLine
|
||||
this.getMsg()
|
||||
}
|
||||
@@ -79,42 +92,42 @@ export default {
|
||||
let xlList = []
|
||||
let sumList = []
|
||||
let msg = {}
|
||||
for (let i = 0; i < 1000; i++) {
|
||||
time.push(moment().add(i, 'days').format('YYYY-MM-DD HH:mm:ss'))
|
||||
sList.push(Math.floor(Math.random() * 80 + 10))
|
||||
mList.push(Math.floor(Math.random() * 100 + 20))
|
||||
lList.push(Math.floor(Math.random() * 130 + 30))
|
||||
xlList.push(Math.floor(Math.random() * 150 + 40))
|
||||
sumList.push(sList[i] + mList[i] + lList[i] + xlList[i])
|
||||
}
|
||||
msg.time = time
|
||||
msg.sList = sList
|
||||
msg.mList = mList
|
||||
msg.lList = lList
|
||||
msg.xlList = xlList
|
||||
msg.sumList = sumList
|
||||
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)
|
||||
// }
|
||||
// })
|
||||
// for (let i = 0; i < 1000; i++) {
|
||||
// time.push(moment().add(i, 'days').format('YYYY-MM-DD HH:mm:ss'))
|
||||
// sList.push(Math.floor(Math.random() * 80 + 10))
|
||||
// mList.push(Math.floor(Math.random() * 100 + 20))
|
||||
// lList.push(Math.floor(Math.random() * 130 + 30))
|
||||
// xlList.push(Math.floor(Math.random() * 150 + 40))
|
||||
// sumList.push(sList[i] + mList[i] + lList[i] + xlList[i])
|
||||
// }
|
||||
// msg.time = time
|
||||
// msg.sList = sList
|
||||
// msg.mList = mList
|
||||
// msg.lList = lList
|
||||
// msg.xlList = xlList
|
||||
// msg.sumList = sumList
|
||||
// this.getChart(msg)
|
||||
getProcessFull({ ...this.listQuery }).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('YY-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)
|
||||
}
|
||||
})
|
||||
},
|
||||
getChart1(msg) {
|
||||
var option = {
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
<div class="left-box">
|
||||
<search-bar :formConfigs="formConfig" @headBtnClick="buttonClick" />
|
||||
<base-table
|
||||
:page="listQuery.current"
|
||||
:limit="listQuery.size"
|
||||
:selectWidth="50"
|
||||
ref="thicknessDistributionTable"
|
||||
id="thicknessDistributionTable1"
|
||||
:table-props="tableProps"
|
||||
:table-data="tableData"
|
||||
:max-height="tableH"
|
||||
highlight-current-row
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</el-col>
|
||||
@@ -23,17 +24,22 @@
|
||||
<script>
|
||||
import { tableHeight } from '@/utils/index'
|
||||
import thicknessDistributionChart from './../components/thicknessDistributionChart.vue'
|
||||
import { queryThickness, drawThickness } from '@/api/qualityManagement'
|
||||
import { timeFormatter } from '@/utils'
|
||||
import moment from 'moment'
|
||||
const tableProps = [
|
||||
{
|
||||
prop: 'glassID',
|
||||
prop: 'glassId',
|
||||
label: 'ID'
|
||||
},
|
||||
{
|
||||
prop: 'time',
|
||||
label: '检测时间'
|
||||
prop: 'testTime',
|
||||
label: '检测时间',
|
||||
filter: timeFormatter,
|
||||
minWidth: 160
|
||||
},
|
||||
{
|
||||
prop: 'type',
|
||||
prop: 'grindType',
|
||||
label: '研磨类型'
|
||||
}
|
||||
]
|
||||
@@ -46,25 +52,21 @@ export default {
|
||||
{
|
||||
type: 'datePicker',
|
||||
label: '检验时间',
|
||||
dateType: 'datetime',
|
||||
dateType: 'datetimerange',
|
||||
format: 'yyyy-MM-dd HH:mm:ss',
|
||||
valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
||||
placeholder: '检验时间',
|
||||
param: 'testTime',
|
||||
width: 200
|
||||
valueFormat: 'yyyy-MM-ddTHH:mm:ss',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'timeVal',
|
||||
defaultSelect: [],
|
||||
width: 350
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
type: 'input',
|
||||
label: '玻璃ID',
|
||||
selectOptions: [
|
||||
{ id: '1', name: '521321545' },
|
||||
{ id: '2', name: '932234561' },
|
||||
{ id: '3', name: '542121212' },
|
||||
{ id: '4', name: '354855321' }
|
||||
],
|
||||
param: 'fullInspectionType',
|
||||
defaultSelect: '',
|
||||
width: 150
|
||||
placeholder: '玻璃ID',
|
||||
param: 'glassId'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -80,38 +82,65 @@ export default {
|
||||
}
|
||||
],
|
||||
listQuery: {
|
||||
current: 1,
|
||||
size: 20
|
||||
startTime: '',
|
||||
endTime: '',
|
||||
glassId: ''
|
||||
},
|
||||
tableProps,
|
||||
tableData: [],
|
||||
tableH: tableHeight(300)
|
||||
tableH: tableHeight(350),
|
||||
drawGlassId: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
window.addEventListener('resize', () => {
|
||||
this.tableH = tableHeight(300)
|
||||
this.tableH = tableHeight(350)
|
||||
})
|
||||
this.formConfig[0].defaultSelect = [
|
||||
moment().format('yyyy-MM-DD') + 'T00:00:00',
|
||||
moment().format('yyyy-MM-DD') + 'T23:59:59'
|
||||
]
|
||||
this.listQuery.startTime = moment().format('yyyy-MM-DD') + 'T00:00:00'
|
||||
this.listQuery.endTime = moment().format('yyyy-MM-DD') + 'T23:59:59'
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
let arr = []
|
||||
for (let i = 0; i < 30; i++) {
|
||||
let obj = {}
|
||||
obj.glassID = i
|
||||
arr.push(obj)
|
||||
}
|
||||
this.tableData = arr
|
||||
queryThickness({ ...this.listQuery }).then((res) => {
|
||||
console.log(res)
|
||||
if (res.code === 0 && res.data.length > 0) {
|
||||
let _this = this
|
||||
_this.tableData = res.data
|
||||
_this.$nextTick(() => {
|
||||
_this.$refs.thicknessDistributionTable.setCurrent(
|
||||
'thicknessDistributionTable1',
|
||||
0
|
||||
)
|
||||
})
|
||||
_this.drawGlassId = _this.tableData[0].id
|
||||
} else {
|
||||
this.tableData = []
|
||||
this.drawGlassId = ''
|
||||
}
|
||||
})
|
||||
},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.startTime = val.timeVal ? val.timeVal[0] : ''
|
||||
this.listQuery.endTime = val.timeVal ? val.timeVal[1] : ''
|
||||
this.listQuery.glassId = val.glassId
|
||||
this.listQuery.current = 1
|
||||
this.getList()
|
||||
break
|
||||
default:
|
||||
alert('导出')
|
||||
drawThickness(this.drawGlassId).then((res) => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.drawGlassId = val.newVal.id
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user