优化进站界面结构
This commit is contained in:
@@ -1,20 +1,39 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue';
|
||||
import { useRouter, useRoute } from 'vue-router';
|
||||
import { startStation } from '@/api/pwoManage/station';
|
||||
import { useJobStore } from '@/store/job';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
|
||||
const jobStore = useJobStore();
|
||||
|
||||
const menuItems = [
|
||||
{ label: '主材', key: 'PrimaryMaterial', progress: 30 },
|
||||
{ label: '材料', key: 'RawMaterial', progress: 50 },
|
||||
{ label: '治具', key: 'Mask', progress: 80 },
|
||||
{ label: '设备', key: 'Equipment', progress: 80 },
|
||||
];
|
||||
|
||||
const activeKey = computed(() => route.name as string);
|
||||
|
||||
const handleMenuClick = (key: string) => {
|
||||
router.push({ name: key });
|
||||
const handleMenuClick = (name: string) => {
|
||||
router.push({ name});
|
||||
};
|
||||
|
||||
// 确认进站
|
||||
const infeeding = ref(false);
|
||||
const handleInfeed = async () => {
|
||||
infeeding.value = true;
|
||||
try {
|
||||
await startStation(jobStore.jobInfo.id);
|
||||
router.push({ name: 'PwoManage' });
|
||||
} catch (error: any) {
|
||||
message.error(error.message || '进站失败');
|
||||
} finally {
|
||||
infeeding.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const infeedChildRef = ref<any>(null);
|
||||
@@ -30,7 +49,13 @@ defineExpose({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a-spin :spinning="infeeding">
|
||||
<a-row class="infeed-layout">
|
||||
<a-col :span="20" class="content-wrapper">
|
||||
<router-view v-slot="{ Component }">
|
||||
<component :is="Component" ref="infeedChildRef" />
|
||||
</router-view>
|
||||
</a-col>
|
||||
<a-col :span="4" class="menu-wrapper">
|
||||
<div class="menu-list">
|
||||
<span class="infeed-title">进站</span>
|
||||
@@ -52,15 +77,11 @@ defineExpose({
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<a-button type="primary" size="large">确认进站</a-button>
|
||||
<a-button type="primary" size="large" @click="handleInfeed">确认进站</a-button>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="20" class="content-wrapper">
|
||||
<router-view v-slot="{ Component }">
|
||||
<component :is="Component" ref="infeedChildRef" />
|
||||
</router-view>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
Reference in New Issue
Block a user