优化系统全局状态管理结构
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onMounted, reactive } from 'vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { useJobStore } from '@/store';
|
||||
import { useTraceOrderStore } from '@/store';
|
||||
import type { ColumnsType } from 'ant-design-vue/es/table/interface';
|
||||
import {
|
||||
getEquipmentByCode,
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
delEquipmentEntry,
|
||||
} from '@/api/pwoManage/equipment';
|
||||
|
||||
const jobStore = useJobStore();
|
||||
const traceOrderStore = useTraceOrderStore();
|
||||
|
||||
interface EquipmentTableItem {
|
||||
key: string;
|
||||
@@ -50,7 +50,7 @@ const handleBind = async () => {
|
||||
try {
|
||||
await addEquipmentEntry({
|
||||
equipmentCode: equipmentInput.value,
|
||||
stationCode: jobStore.jobInfo.code,
|
||||
stationCode: traceOrderStore.currentStationCode,
|
||||
});
|
||||
message.success('绑定成功');
|
||||
equipmentInput.value = '';
|
||||
@@ -73,7 +73,7 @@ const handleUnbind = async (id: number) => {
|
||||
// 获取已绑定的设备列表
|
||||
const loadingEquipmentTableData = ref(false);
|
||||
const fetchBoundEquipmentList = async () => {
|
||||
const stationId = jobStore.jobInfo.id;
|
||||
const stationId = traceOrderStore.currentStationCode;
|
||||
if (!stationId) return;
|
||||
loadingEquipmentTableData.value = true;
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user