chore: upload current WCS changes

This commit is contained in:
zgw
2026-07-24 08:51:41 +08:00
parent cbc76be62f
commit 72b88ed0e3
73 changed files with 2989 additions and 693 deletions

View File

@@ -0,0 +1,33 @@
<template>
<div class="app-container tidy-page">
<el-card>
<div slot="header"><span>理货控制</span></div>
<el-switch v-model="manual" active-text="手动理货" inactive-text="自动理货" :disabled="loading || !hasEdit" @change="changeMode" />
<span class="mode-status">当前模式:{{ modeLabel }}</span>
</el-card>
</div>
</template>
<script>
import { getTidyStatus, updateTidyMode } from '@/api/algorithm/tidy'
export default {
name: 'TidyControl',
data() { return { manual: false, mode: 'AUTO', loading: false, timer: null, hasEdit: this.$auth.hasPermi('algorithm:tidy:edit') } },
computed: { modeLabel() { return this.mode === 'MANUAL' ? '手动' : '自动' } },
created() { this.refresh(); this.timer = setInterval(this.refresh, 5000) },
beforeDestroy() { if (this.timer) { clearInterval(this.timer); this.timer = null } },
methods: {
refresh() { getTidyStatus().then(res => { const data = res.data || {}; this.mode = data.mode || 'AUTO'; this.manual = this.mode === 'MANUAL' }).catch(() => {}) },
changeMode(value) {
const previous = this.mode
this.loading = true
updateTidyMode(value ? 'MANUAL' : 'AUTO').then(res => { const data = res.data || {}; this.mode = data.mode || (value ? 'MANUAL' : 'AUTO') }).catch(() => { this.manual = previous === 'MANUAL'; this.$message.error('理货模式切换失败') }).finally(() => { this.loading = false })
}
}
}
</script>
<style scoped>
.mode-status { margin-left: 16px; color: #606266; }
</style>