|
@@ -62,6 +62,8 @@ export interface DeviceOption {
|
|
|
deviceId: string;
|
|
deviceId: string;
|
|
|
/** 设备名称/编码 / Device name or code */
|
|
/** 设备名称/编码 / Device name or code */
|
|
|
label: string;
|
|
label: string;
|
|
|
|
|
+ /** 门店名称 / Shop name */
|
|
|
|
|
+ shopName?: string;
|
|
|
/** 在线状态 / Online status */
|
|
/** 在线状态 / Online status */
|
|
|
isOnline?: number;
|
|
isOnline?: number;
|
|
|
}
|
|
}
|
|
@@ -194,10 +196,10 @@ export function useProduct(tableRef?: Ref) {
|
|
|
.filter((device: any) => device && device.deviceId) // 过滤掉无效数据
|
|
.filter((device: any) => device && device.deviceId) // 过滤掉无效数据
|
|
|
.map((device: any) => ({
|
|
.map((device: any) => ({
|
|
|
deviceId: String(device.deviceId || ""), // 确保转换为字符串
|
|
deviceId: String(device.deviceId || ""), // 确保转换为字符串
|
|
|
- label:
|
|
|
|
|
- device.name ||
|
|
|
|
|
- device.deviceName ||
|
|
|
|
|
- `设备 ${device.deviceId || "未知"}`,
|
|
|
|
|
|
|
+ label: device.shopName
|
|
|
|
|
+ ? `${device.deviceId} — ${device.shopName}`
|
|
|
|
|
+ : device.deviceId,
|
|
|
|
|
+ shopName: device.shopName || "",
|
|
|
isOnline: device.isOnline ?? (device.status === 1), // 兼容处理
|
|
isOnline: device.isOnline ?? (device.status === 1), // 兼容处理
|
|
|
status: device.status // 保留原始状态值
|
|
status: device.status // 保留原始状态值
|
|
|
}));
|
|
}));
|
|
@@ -353,7 +355,7 @@ export function useProduct(tableRef?: Ref) {
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
const res = await syncLayerTemplate(deviceId);
|
|
const res = await syncLayerTemplate(deviceId);
|
|
|
- if (res.code === 0) {
|
|
|
|
|
|
|
+ if (res.code === 200 || res.code === 0) {
|
|
|
message(`已提交设备 "${deviceLabel}" 的同步请求`, { type: "success" });
|
|
message(`已提交设备 "${deviceLabel}" 的同步请求`, { type: "success" });
|
|
|
// 延迟刷新以获取最新状态
|
|
// 延迟刷新以获取最新状态
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|