Browse Source

feat: 任务zmq回显调整

main
betaqi 4 weeks ago
parent
commit
d98895a001
  1. 1
      package.json
  2. 5336
      pnpm-lock.yaml
  3. 6
      src/views/taskList/index.vue
  4. 7
      src/views/taskList/infoDrawer.vue

1
package.json

@ -13,6 +13,7 @@ @@ -13,6 +13,7 @@
"type-check": "vue-tsc --build"
},
"dependencies": {
"@antv/g": "^6.1.28",
"@antv/g-svg": "^2.0.42",
"@antv/g6": "^5.0.49",
"@types/qs": "^6.9.18",

5336
pnpm-lock.yaml

File diff suppressed because it is too large Load Diff

6
src/views/taskList/index.vue

@ -113,7 +113,7 @@ function zmqTaskCb(msg: SubMsgData) { @@ -113,7 +113,7 @@ function zmqTaskCb(msg: SubMsgData) {
console.log('rootPage', msg)
const { feedback } = msg
const taskId = feedback[0]
const deviceSN = feedback[1]
const id = feedback[1]
const deviceStatus = feedback[2] || '未知状态'
const finish = feedback[3] || 0
const total = feedback[4] || 0
@ -122,8 +122,8 @@ function zmqTaskCb(msg: SubMsgData) { @@ -122,8 +122,8 @@ function zmqTaskCb(msg: SubMsgData) {
try {
const deviceList = findTask.snList.split(',')
const lastDevice = deviceList[deviceList.length - 1]
console.log(taskId, deviceSN, lastDevice, deviceStatus, finish, total)
onTaskFinish(taskId, deviceSN === lastDevice && ((total - finish) === 0) ? 3 : 1)
console.log(taskId, id, lastDevice, deviceStatus, finish, total)
onTaskFinish(taskId, id === lastDevice && ((total - finish) === 0) ? 3 : 1)
} catch (error) {
console.error(error)
}

7
src/views/taskList/infoDrawer.vue

@ -72,20 +72,23 @@ async function open(row: TaskList) { @@ -72,20 +72,23 @@ async function open(row: TaskList) {
await onDetail(row)
worker.subscribe(getSubTopic('server', 'event', 'task'), zmqTaskCb)
}
function zmqTaskCb(msg: SubMsgData) {
console.log('info', msg)
const { feedback } = msg
const taskId = feedback[0]
const deviceSN = feedback[1]
const id = feedback[1]
const deviceStatus = feedback[2] || '未知状态'
const finish = feedback[3] || 0
const total = feedback[4] || 0
if (currentTaskId.value !== taskId) return
const detail = detailList.value.find(item => item.sn === deviceSN)
const detail = detailList.value.find(item => item.id === id)
if (!detail) return
detail.status = deviceStatus
detail.finish = finish
detail.total = total
detail.info = `子任务${statusList.find(r => r.value ===
detail.status)?.label || '--'}`
}
function handleBeforeClose(done: () => void) {

Loading…
Cancel
Save