This commit is contained in:
徐旦 2025-06-19 22:00:41 +08:00
commit 35596ffb58
6 changed files with 31 additions and 7 deletions

View File

@ -378,6 +378,7 @@ interface RobotInfo {
canOrder?: boolean; // 接单状态 canOrder?: boolean; // 接单状态
canStop?: boolean; // 急停状态 canStop?: boolean; // 急停状态
canControl?: boolean; // 控制状态 canControl?: boolean; // 控制状态
targetPoint?: string; // 目标点位(名称)
} }
export interface RobotDetail extends RobotInfo { export interface RobotDetail extends RobotInfo {
isSimulative?: 0 | 1; // 是否仿真机器人 isSimulative?: 0 | 1; // 是否仿真机器人

5
mocks/scene/pushById Normal file
View File

@ -0,0 +1,5 @@
{
"code": 200,
"success": true,
"message": "模拟提示"
}

View File

@ -450,14 +450,24 @@
background-color: none; background-color: none;
box-shadow: none !important; box-shadow: none !important;
& > .ant-message-error { & > .ant-message-custom-content {
display: flex;
align-items: center;
padding: 8px 15px; padding: 8px 15px;
font: 400 14px/22px Roboto; font: 400 14px/22px Roboto;
color: get-color(text1); color: get-color(text1);
background-color: get-color(error_bg);
border: 1px solid get-color(error_border);
border-radius: 2px; border-radius: 2px;
&.ant-message-success {
background-color: get-color(success_bg);
border: 1px solid get-color(success_border);
}
&.ant-message-error {
background-color: get-color(error_bg);
border: 1px solid get-color(error_border);
}
& > .anticon { & > .anticon {
margin-inline-end: 10px; margin-inline-end: 10px;
} }

View File

@ -22,6 +22,7 @@ export interface RobotInfo {
canOrder?: boolean; // 接单状态 canOrder?: boolean; // 接单状态
canStop?: boolean; // 急停状态 canStop?: boolean; // 急停状态
canControl?: boolean; // 控制状态 canControl?: boolean; // 控制状态
targetPoint?: string; // 目标点位(名称)
} }
export interface RobotDetail extends RobotInfo { export interface RobotDetail extends RobotInfo {

View File

@ -50,7 +50,7 @@ const stateDot = computed<string>(() => `state-${robot.value?.state}`);
<a-tag> <a-tag>
<i class="icon size-18 mr-4" :class="batteryIcon" /> <i class="icon size-18 mr-4" :class="batteryIcon" />
<span>{{ robot.battery ?? 0 }}%</span> <span>{{ robot.battery?.toFixed() ?? 0 }}%</span>
</a-tag> </a-tag>
<a-tag v-if="robot.state"> <a-tag v-if="robot.state">
@ -74,6 +74,10 @@ const stateDot = computed<string>(() => `state-${robot.value?.state}`);
<a-typography-text type="secondary">{{ $t('控制权') }}</a-typography-text> <a-typography-text type="secondary">{{ $t('控制权') }}</a-typography-text>
<a-typography-text>{{ $t(robot.canControl ? '已抢占' : '当前无控制权') }}</a-typography-text> <a-typography-text>{{ $t(robot.canControl ? '已抢占' : '当前无控制权') }}</a-typography-text>
</a-list-item> </a-list-item>
<a-list-item>
<a-typography-text style="flex: none" type="secondary">{{ $t('目的地') }}</a-typography-text>
<a-typography-text :content="$t(robot.targetPoint ?? '-')" ellipsis />
</a-list-item>
</a-list> </a-list>
</template> </template>
<a-empty v-else :image="sTheme.empty" /> <a-empty v-else :image="sTheme.empty" />

View File

@ -2,7 +2,7 @@
import { getSceneById, pushSceneById } from '@api/scene'; import { getSceneById, pushSceneById } from '@api/scene';
import { EditorService } from '@core/editor.service'; import { EditorService } from '@core/editor.service';
import { decodeTextFile, downloadFile, selectFile, textToBlob } from '@core/utils'; import { decodeTextFile, downloadFile, selectFile, textToBlob } from '@core/utils';
import { Modal } from 'ant-design-vue'; import { message, Modal } from 'ant-design-vue';
import { computed, watch } from 'vue'; import { computed, watch } from 'vue';
import { ref } from 'vue'; import { ref } from 'vue';
import { onMounted, provide, shallowRef } from 'vue'; import { onMounted, provide, shallowRef } from 'vue';
@ -25,7 +25,10 @@ const readScene = async () => {
}; };
const pushScene = async () => { const pushScene = async () => {
await pushSceneById(props.id); const res = await pushSceneById(props.id);
if (!res) return Promise.reject();
message.success(t('场景推送成功'));
return Promise.resolve();
}; };
//#endregion //#endregion
@ -54,7 +57,7 @@ const toPush = () =>
centered: true, centered: true,
cancelText: t('返回'), cancelText: t('返回'),
okText: t('推送'), okText: t('推送'),
onOk: () => pushScene(), onOk: async () => await pushScene(),
}); });
const importScene = async () => { const importScene = async () => {