@@ -101,7 +102,7 @@ function open(parmas: TaskCreateParams) {
paramsData.value = parmas
visible.value = true
}
-
+const btnLoading = ref(false)
async function onSave() {
if (!verifyData()) return
if (!paramsData.value) {
@@ -111,14 +112,15 @@ async function onSave() {
const params = paramsData.value
params.startTime = dayjs(startTime.value).format('YYYY-MM-DD HH:mm:ss')
params.endTime = dayjs(endTime.value).format('YYYY-MM-DD HH:mm:ss')
+ btnLoading.value = true
const res = await createTask(params)
if (res.code !== 0) {
message.error(`任务创建失败`)
} else {
message.success('任务创建成功,请在任务列表中查看')
}
-
+ btnLoading.value = false
emit('on-save')
close()
}
diff --git a/src/views/stationData/transferData.vue b/src/views/stationData/transferData.vue
index 0d30cea..267a468 100644
--- a/src/views/stationData/transferData.vue
+++ b/src/views/stationData/transferData.vue
@@ -369,6 +369,7 @@ async function onFirmwareUpload(devices: IOnlineDevice[]) {
site,
devices: deivcesParms,
mode: 'update',
+ firmware: firmwarePath.value,
}
const res = await createTask(parmas)
if (res.code !== 0) {
diff --git a/src/views/taskList/index.vue b/src/views/taskList/index.vue
index d50c9d6..36dc371 100644
--- a/src/views/taskList/index.vue
+++ b/src/views/taskList/index.vue
@@ -93,6 +93,7 @@ const tableCol = [
{ label: '任务类型', prop: 'mode', minWidth: '10%' },
{ label: '任务状态', prop: 'status', minWidth: '10%' },
{ label: '创建时间', prop: 'startTime', minWidth: '10%' },
+ { label: '任务详情', prop: 'info', minWidth: '20%' },
]
@@ -102,7 +103,6 @@ const list = ref([])
const queryParams = reactive({
page: 1,
size: undefined,
-
})
const tableRef = ref()
const getList = async () => {
@@ -139,7 +139,7 @@ const onCancel = async (id: string) => {
await getList()
}
-function onTaskFinish(id: string, status: -1 | 0 | 1 | 2 | 3) {
+function onTaskFinish(id: string, status: -1 | 0 | 1 | 2 | 3) {
const curTask = list.value.findIndex(item => item.id === id)
if (curTask !== -1) {
list.value[curTask].status = status
diff --git a/src/views/taskList/infoDrawer.vue b/src/views/taskList/infoDrawer.vue
index 525843b..5e1f982 100644
--- a/src/views/taskList/infoDrawer.vue
+++ b/src/views/taskList/infoDrawer.vue
@@ -5,9 +5,9 @@
:before-close="handleBeforeClose">
-
+
- {{
+ {{
statusList.find(r => r.value ===
detail.status)?.label || '--'
}}
@@ -24,11 +24,11 @@
{{ detail?.info ? detail.info : '暂无信息' }}
-
+
暂无进度
-
@@ -92,6 +92,14 @@ const statusList = [
}
]
+const statusTypeMap = {
+ '-1': 'danger',
+ '0': 'info',
+ '1': 'warning',
+ '2': 'info',
+ '3': 'primary'
+}
+
function zmqTaskCb(msg: SubMsgData) {
const { feedback } = msg