diff --git a/haiwei-admin/src/main/resources/static/board/board.js b/haiwei-admin/src/main/resources/static/board/board.js index df916b7..eb0f55f 100644 --- a/haiwei-admin/src/main/resources/static/board/board.js +++ b/haiwei-admin/src/main/resources/static/board/board.js @@ -16,32 +16,33 @@ $(() => { }) - $.get(ctx + 'broad/home/queryParam', {name}, (e) => { + let request = () =>{ + $.get(ctx + 'broad/home/queryParam', {name}, (e) => { - let enumArr = { - '转速': ' rpm', - '电流': ' A', - '温度': ' ℃', - '压力': ' MPa', - } - let data = e.data - let arrNum = Array.from(new Set([...e.data.map(e => e.order_by)])) - let arr = arrNum.map(e => { - let data1 = data.filter(val => val.order_by === e) - let obj = {} - data1.forEach((e, i) => { - obj.left = e.location_x + '%' - obj.top = e.location_y + '%' - obj.name = e.name - obj['data' + (i + 1)] = e.pointname - obj['num' + (i + 1)] = e.data - obj['unit' + (i + 1)] = enumArr[e.pointname] + let enumArr = { + '转速': ' rpm', + '电流': ' A', + '温度': ' ℃', + '压力': ' MPa', + } + let data = e.data + let arrNum = Array.from(new Set([...e.data.map(e => e.order_by)])) + let arr = arrNum.map(e => { + let data1 = data.filter(val => val.order_by === e) + let obj = {} + data1.forEach((e, i) => { + obj.left = e.location_x + '%' + obj.top = e.location_y + '%' + obj.name = e.name + obj['data' + (i + 1)] = e.pointname + obj['num' + (i + 1)] = e.data + obj['unit' + (i + 1)] = enumArr[e.pointname] + }) + return obj }) - return obj - }) - arr.forEach(val => { - let html = ` -