5 changed files with 132 additions and 20 deletions
-
32src/components/craft/AddCraft/index.vue
-
69src/components/home/CheckCraft/index.vue
-
23src/layouts/default.vue
-
26src/stores/systemStore.ts
-
2src/types/system.d.ts
@ -0,0 +1,69 @@ |
|||
<script setup lang="ts"> |
|||
import { resumeCraft, stopCraft } from 'apis/crafts' |
|||
import { useSystemStore } from 'stores/systemStore' |
|||
|
|||
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 resumeCraftHandle = async (heatId: string) => { |
|||
await resumeCraft({ |
|||
heatId, |
|||
}) |
|||
} |
|||
|
|||
const stopCraftHandle = async (heatId: string) => { |
|||
await stopCraft({ |
|||
heatId, |
|||
}) |
|||
} |
|||
|
|||
const cancel = () => { |
|||
emits('close') |
|||
} |
|||
</script> |
|||
|
|||
<template> |
|||
<FtDialog visible 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="当前执行步骤"> |
|||
<template #default="{ row }"> |
|||
<span>{{ row.craftStepList?.[row.currentIndex]?.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> |
|||
<ft-button type="danger" :click-handle="() => stopCraftHandle(row.heatModuleCode)"> |
|||
停止 |
|||
</ft-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<template #footer> |
|||
<ft-button @click="cancel"> |
|||
关闭 |
|||
</ft-button> |
|||
</template> |
|||
</FtDialog> |
|||
</template> |
|||
|
|||
<style scoped lang="scss"> |
|||
|
|||
</style> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue