diff --git a/src/components/AIcon/index.tsx b/src/components/AIcon/index.tsx
index 366a7b1c..2c589ac5 100644
--- a/src/components/AIcon/index.tsx
+++ b/src/components/AIcon/index.tsx
@@ -57,6 +57,7 @@ const iconKeys = [
'DownloadOutlined',
'PauseOutlined',
'ControlOutlined',
+ 'RedoOutlined',
]
const Icon = (props: {type: string}) => {
diff --git a/src/views/device/Firmware/Task/Detail/Save.vue b/src/views/device/Firmware/Task/Detail/Save.vue
new file mode 100644
index 00000000..9aca484d
--- /dev/null
+++ b/src/views/device/Firmware/Task/Detail/Save.vue
@@ -0,0 +1,32 @@
+
+
+ 失败原因:{{ data }}
+
+
+
+
+
diff --git a/src/views/device/Firmware/Task/Detail/index.vue b/src/views/device/Firmware/Task/Detail/index.vue
index 1ddc9b87..dc4f4d29 100644
--- a/src/views/device/Firmware/Task/Detail/index.vue
+++ b/src/views/device/Firmware/Task/Detail/index.vue
@@ -17,22 +17,27 @@
-
- 批量重试
-
-
![]()
+
+
+
+
![]()
+
@@ -114,6 +119,7 @@
+
@@ -124,12 +130,14 @@ import {
history,
historyCount,
queryProduct,
+ startTask,
+ startOneTask,
} from '@/api/device/firmware';
import { message } from 'ant-design-vue';
import { getImage } from '@/utils/comm';
import moment from 'moment';
import { cloneDeep } from 'lodash-es';
-
+import Save from './Save.vue';
const tableRef = ref>({});
const router = useRouter();
const route = useRoute();
@@ -276,22 +284,7 @@ const getActions = (data: Partial>): ActionsType[] => {
if (!data) {
return [];
}
-
- const stop = data.waiting > 0 && data?.state?.value === 'processing';
- const pause = data?.state?.value === 'canceled';
-
const Actions = [
- {
- key: 'details',
- text: '详情',
- tooltip: {
- title: '详情',
- },
- icon: 'icon-details',
- onClick: async () => {
- handlDetails(data.id);
- },
- },
{
key: 'eye',
text: '查看',
@@ -300,45 +293,21 @@ const getActions = (data: Partial>): ActionsType[] => {
},
icon: 'EyeOutlined',
onClick: async () => {
- handlEye(data);
+ handlEye(data.errorReason);
+ },
+ },
+ {
+ key: 'try',
+ text: '重试',
+ tooltip: {
+ title: '重试',
+ },
+ icon: 'RedoOutlined',
+ onClick: async () => {
+ handlTry(data.id);
},
},
];
-
- if (stop) {
- Actions.push({
- key: 'actions',
- text: '停止',
- tooltip: {
- title: '停止',
- },
- onClick: async () => {
- const res = await stopTask(data.id);
- if (res.success) {
- message.success('操作成功');
- tableRef.value.reload();
- }
- },
- icon: 'StopOutlined',
- });
- } else if (pause) {
- Actions.push({
- key: 'actions',
- text: '继续升级',
- tooltip: {
- title: '继续升级',
- },
- onClick: async () => {
- const res = await startTask(data.id, ['canceled']);
- if (res.success) {
- message.success('操作成功');
- tableRef.value.reload();
- }
- },
- icon: 'ControlOutlined',
- });
- }
-
return Actions;
};
@@ -347,28 +316,29 @@ const handlAdd = () => {
visible.value = true;
};
-const handlEye = (data: object) => {
- current.value = toRaw({ ...data, view: true });
+const handlEye = (data: string) => {
+ current.value = data || '';
visible.value = true;
};
-const handlDetails = (id: string) => {
- // router.push({
- // path: `/iot/link/certificate/detail/${id}`,
- // query: { view: false },
- // });
-};
-const saveChange = (value: boolean) => {
- visible.value = false;
- current.value = {};
- if (value) {
+const handlTry = async (id: string) => {
+ const res = await startOneTask([id]);
+ if (res.success) {
message.success('操作成功');
tableRef.value.reload();
}
};
-const confirm = (e: MouseEvent) => {
- console.log(e);
- message.success('Click on Yes');
+const saveChange = (value: boolean) => {
+ visible.value = false;
+ current.value = {};
+};
+const confirm = async (e: MouseEvent) => {
+ const res = await startTask(taskId, ['failed']);
+ if (res.success) {
+ message.success('操作成功');
+ handleRefresh('failed');
+ tableRef.value.reload();
+ }
};
const handleRefresh = async (key: string) => {
@@ -416,6 +386,7 @@ const handleSearch = (e: any) => {
rgba(255, 255, 255, 0.86) 91.82%
);
min-width: 185px;
+ max-width: 580px;
flex: 1px;
margin: 0 12px;
.state-content {
@@ -430,12 +401,18 @@ const handleSearch = (e: any) => {
height: 22px;
.state-title-right {
z-index: 1;
- img {
- margin: 0 10px;
+ display: flex;
+ .img {
width: 22px;
- // margin-top: -12px;
- margin-top: -5px;
+ margin: 0 10px;
cursor: pointer;
+ img {
+ width: 22px;
+ margin-top: -5px;
+ }
+ }
+ .img:active {
+ border: 1px #40a9ff solid;
}
}
}