Newer
Older
intelligentRobot / src / views / system / index.vue
wangxitong on 3 Sep 2 KB first commit
<script lang="ts" setup name="AlarmList">
import type { Ref } from 'vue'
import { reactive, ref } from 'vue'
import { ElLoading, ElMessage, ElMessageBox } from 'element-plus'
import {changePcd, dataRecord, getRobotList, slam, trackRecord} from "@/api/home/robot/robot";
import useSettingsStore from "@/store/modules/settings";

const $router = useRouter()
const settingsStore = useSettingsStore()
const mapSize = ref(0)
const threshold = ref(0)

// todo: 系统设置

function setMapSize() {
  dataRecord({
    action: 1,
    robotId: settingsStore.robot.id,
  }).then((response) => {
    if (response.code === 200) {
      if(response.data === 1) {
        ElMessage.success('设置栅格地图尺寸成功')
      } else if(response.data === 0) {
        ElMessage.error('设置栅格地图尺寸失败')
      }
    }
  })
}

function setThreshold() {
  dataRecord({
    action: 1,
    robotId: settingsStore.robot.id,
  }).then((response) => {
    if (response.code === 200) {
      if(response.data === 1) {
        ElMessage.success('设置本底参数成功')
      } else if(response.data === 0) {
        ElMessage.error('设置本底参数失败')
      }
    }
  })
}


</script>

<template>
  <app-container>
<!--    <div class="bag-title">-->
<!--      <el-icon>-->
<!--        <svg-icon name="icon-base" />-->
<!--      </el-icon> 栅格地图尺寸(米)</div>-->
<!--    <div class="bag-content">-->
<!--      <el-input-number v-model="mapSize" placeholder="栅格地图尺寸" :precision="1" :step="0.1" style="width: 200px;margin-right: 10px"/>-->
<!--      <el-button type="primary" @click="setMapSize">设置</el-button>-->
<!--    </div>-->
    <div class="bag-title">
      <el-icon>
        <svg-icon name="icon-base" />
      </el-icon> 本底参数</div>
    <div class="bag-content">
      <el-input-number v-model="threshold" placeholder="本底参数" clearable style="width: 200px;margin-right: 10px"/>
      <el-button type="primary" @click="setThreshold">设置</el-button>
    </div>
  </app-container>
</template>
<style lang="scss">
.bag-title {
  margin: 25px;
  color: #356ab0;
  font-weight: bold;
}
.bag-content {
  margin: 10px 60px;
}
.el-progress-bar__outer {
  background-color: #d6e6fd;
}
</style>