|
|
|
@ -50,16 +50,21 @@ const [registerTable, { getForm, reload, getDataSource, updateTableDataRecord }] |
|
|
|
dataIndex: 'action', |
|
|
|
fixed: 'right', |
|
|
|
}, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
async function getNow() { |
|
|
|
const params = getDataSource() |
|
|
|
params.forEach((item: any) => { |
|
|
|
// 对数组中的每个元素执行异步操作 |
|
|
|
getExaNow(item.itemName).then((result) => { |
|
|
|
updateTableDataRecord(item.serialNumber, Object.assign(item, { value: result })) |
|
|
|
}) |
|
|
|
const list = getDataSource() |
|
|
|
|
|
|
|
await Promise.all( |
|
|
|
list.map(async (item: any) => { |
|
|
|
const result = await getExaNow(item.itemName) |
|
|
|
|
|
|
|
updateTableDataRecord(item.serialNumber, { |
|
|
|
value: result, |
|
|
|
}) |
|
|
|
}), |
|
|
|
) |
|
|
|
} |
|
|
|
|
|
|
|
let timerId |
|
|
|
@ -110,6 +115,11 @@ async function handleDelete(record: Recordable) { |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<BasicTable @register="registerTable"> |
|
|
|
<!-- <template #emptyText>--> |
|
|
|
<!-- <div style="height:400px; display:flex; align-items:center; justify-content:center; color:#999">--> |
|
|
|
<!-- 暂无数据--> |
|
|
|
<!-- </div>--> |
|
|
|
<!-- </template>--> |
|
|
|
<template #form-advanceAfter> |
|
|
|
<Space > |
|
|
|
<a-button type="primary" :pre-icon="IconEnum.ADD" @click="handleCreate"> |
|
|
|
|