|
|
@ -1,30 +1,24 @@ |
|
|
|
<script setup lang="ts"> |
|
|
|
import { resumeCraft, stopCraft } from 'apis/crafts' |
|
|
|
import { useSystemStore } from 'stores/systemStore' |
|
|
|
import { craftList, craftRemove, craftRestart } from 'apis/crafts' |
|
|
|
import { onMounted, ref } from 'vue' |
|
|
|
|
|
|
|
const emits = defineEmits(['close']) |
|
|
|
const systemStore = useSystemStore() |
|
|
|
|
|
|
|
const tableData = computed(() => { |
|
|
|
return systemStore.systemStatus.trays?.filter(item => item.crafts?.craft?.status === 'RESTORE').map((item) => { |
|
|
|
return { |
|
|
|
...item, |
|
|
|
craftStepList: JSON.parse(item.crafts?.craft?.steps || '[]'), |
|
|
|
currentIndex: item.crafts?.currentIndex, |
|
|
|
} |
|
|
|
}) |
|
|
|
const loading = ref(true) |
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
|
tableData.value = await craftList() |
|
|
|
loading.value = false |
|
|
|
}) |
|
|
|
|
|
|
|
const resumeCraftHandle = async (heatId: string) => { |
|
|
|
await resumeCraft({ |
|
|
|
heatId, |
|
|
|
}) |
|
|
|
const tableData = ref<any[]>([]) |
|
|
|
|
|
|
|
const resumeCraftHandle = async (monitorId: string) => { |
|
|
|
await craftRestart(monitorId) |
|
|
|
} |
|
|
|
|
|
|
|
const stopCraftHandle = async (heatId: string) => { |
|
|
|
await stopCraft({ |
|
|
|
heatId, |
|
|
|
}) |
|
|
|
const stopCraftHandle = async (monitorId: string) => { |
|
|
|
await craftRemove(monitorId) |
|
|
|
} |
|
|
|
|
|
|
|
const cancel = () => { |
|
|
@ -33,25 +27,21 @@ const cancel = () => { |
|
|
|
</script> |
|
|
|
|
|
|
|
<template> |
|
|
|
<FtDialog visible title="工艺恢复" width="70%" :ok-handle="okHandle" @cancel="cancel"> |
|
|
|
<FtDialog visible :loading title="预设恢复" width="70%" :ok-handle="okHandle" @cancel="cancel"> |
|
|
|
<el-table :data="tableData"> |
|
|
|
<el-table-column label="工艺名称"> |
|
|
|
<template #default="{ row }"> |
|
|
|
<span>{{ row.crafts?.craft?.name }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="预设名称" prop="craftsName" /> |
|
|
|
<el-table-column label="当前执行步骤"> |
|
|
|
<template #default="{ row }"> |
|
|
|
<span>{{ row.craftStepList?.[row.currentIndex]?.params?.description }}</span> |
|
|
|
<span>{{ row.steps?.[row.currentstepIndex]?.params?.description }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="操作"> |
|
|
|
<template #default="{ row }"> |
|
|
|
<ft-button type="primary" :click-handle="() => resumeCraftHandle(row.heatModuleCode)"> |
|
|
|
<ft-button type="primary" :click-handle="() => resumeCraftHandle(row.monitorId)"> |
|
|
|
恢复 |
|
|
|
</ft-button> |
|
|
|
<ft-button type="danger" :click-handle="() => stopCraftHandle(row.heatModuleCode)"> |
|
|
|
停止 |
|
|
|
<ft-button type="danger" :click-handle="() => stopCraftHandle(row.monitorId)"> |
|
|
|
删除 |
|
|
|
</ft-button> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|