|
@@ -12,19 +12,21 @@
|
|
|
<div class="topbar">
|
|
|
<el-form style=" background-color: rgba(0,0,0,0%);" :inline="true" :model="queryLine"
|
|
|
class="demo-form-inline">
|
|
|
-
|
|
|
<el-form-item label="设备名称">
|
|
|
<el-input v-model="queryLine.equipmentName" placeholder="请输入设备名称" clearable/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="设备类型">
|
|
|
<el-input v-model="queryLine.equipmentTypeName" placeholder="请输入设备类型" clearable/>
|
|
|
</el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="danger" @click="onSubmit">查询</el-button>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item>
|
|
|
- <el-button type="danger" @click="onSubmit">重置</el-button>
|
|
|
- </el-form-item>
|
|
|
+ <div style="float: right">
|
|
|
+ <el-form-item >
|
|
|
+ <el-button type="danger" @click="onSubmit">查询</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="danger" @click="onSubmit">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+
|
|
|
</el-form>
|
|
|
</div>
|
|
|
<el-table stripe style="background-color: rgba(255,0,0,99%);width: 100%" border :data="tableData"
|
|
@@ -60,165 +62,18 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
-import {onBeforeMount, ref} from "vue";
|
|
|
+import {onBeforeMount, reactive, ref} from "vue";
|
|
|
import axios from "axios";
|
|
|
-import {reactive} from 'vue'
|
|
|
import {ElTable} from "element-plus";
|
|
|
-import {useRouter} from 'vue-router'; // 导入 Vue Router 的 useRouter 钩子
|
|
|
|
|
|
|
|
|
-const value = ref(true)
|
|
|
-const router = useRouter();
|
|
|
-const algorithmContainerState = ref(false)
|
|
|
-const gazeboState = ref(false)
|
|
|
-const rvizState = ref(false)
|
|
|
const multipleTableRef = ref<InstanceType<typeof ElTable>>
|
|
|
|
|
|
-const dialogVisible = ref(false)
|
|
|
-
|
|
|
-const handleClose = (done: () => void) => {
|
|
|
- done()
|
|
|
-}
|
|
|
-
|
|
|
-// do not use same name with ref
|
|
|
-const form = reactive({
|
|
|
- sudoPassword: '',
|
|
|
- tag: '',
|
|
|
- // date1: '',
|
|
|
- // date2: '',
|
|
|
- // delivery: false,
|
|
|
- // type: [],
|
|
|
- // resource: '',
|
|
|
- // desc: '',
|
|
|
-})
|
|
|
-const currentTag = ref('')
|
|
|
-
|
|
|
-
|
|
|
-const algorithmImport = async () => {
|
|
|
- dialogVisible.value = false
|
|
|
- try {
|
|
|
- const result = await window.electronAPI.openFileManager();
|
|
|
- console.log('用户选择的文件路径为:', result, ',版本为:', form.tag);
|
|
|
- window.electronAPI.dockerImport(form.sudoPassword, result, form.tag)
|
|
|
- } catch (error) {
|
|
|
- console.error('打开文件管理器时出错:', error);
|
|
|
- }
|
|
|
-};
|
|
|
-
|
|
|
-const goToDetail = () => {
|
|
|
- router.push('/about')
|
|
|
-}
|
|
|
-
|
|
|
-const goToMapUpdate = () => {
|
|
|
- router.push('/map_update')
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-// 数据容量单位从B转成MB
|
|
|
-const dataSizeFormatter = (row, column, cellValue, index) => {
|
|
|
- // 假设 1MB = 1024 * 1024 字节
|
|
|
- if (cellValue) {
|
|
|
- const mb = (cellValue / (1024 * 1024)).toFixed(2); // 保留两位小数
|
|
|
- return `${mb}MB`;
|
|
|
- }
|
|
|
- return cellValue; // 如果cellValue为null或undefined,则返回原值或你想要的默认值
|
|
|
-}
|
|
|
-
|
|
|
-const gazebo = () => {
|
|
|
- if (gazeboState.value) {
|
|
|
- if (window.electronAPI) {
|
|
|
- window.electronAPI.openGazebo(); // 关闭 gazebo
|
|
|
- } else {
|
|
|
- console.error('electronAPI is not defined');
|
|
|
- }
|
|
|
- // gazeboState.value = false
|
|
|
- } else {
|
|
|
- if (window.electronAPI) {
|
|
|
- window.electronAPI.closeGazebo();
|
|
|
- } else {
|
|
|
- console.error('electronAPI is not defined');
|
|
|
- }
|
|
|
- // gazeboState.value = true
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-const rviz = () => {
|
|
|
- if (rvizState.value) {
|
|
|
- if (window.electronAPI) {
|
|
|
- window.electronAPI.openRviz();
|
|
|
- } else {
|
|
|
- console.error('electronAPI is not defined');
|
|
|
- }
|
|
|
- } else {
|
|
|
- if (window.electronAPI) {
|
|
|
- window.electronAPI.closeRviz();
|
|
|
- } else {
|
|
|
- console.error('electronAPI is not defined');
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-const downloadPdf = (index: number, row: any) => {
|
|
|
- console.log(index, row)
|
|
|
- axios.post('http://36.110.106.142:12341/web_server/exam/report',
|
|
|
- {
|
|
|
- "id": row.id,
|
|
|
- "teamName": row.teamName,
|
|
|
- "scoreOnline": row.scoreOnline,
|
|
|
- "beginTime": row.beginTime,
|
|
|
- "endTime": row.endTime
|
|
|
- },
|
|
|
- {
|
|
|
- headers: {
|
|
|
- "Authorization": "U9yKpD6kZZDDe4LFKK6myAxBUT1XRrDM"
|
|
|
- },
|
|
|
- responseType: 'blob' // 设置响应类型为二进制流
|
|
|
- }
|
|
|
- ).then(function (response) {
|
|
|
- const url = window.URL.createObjectURL(new Blob([response.data]));
|
|
|
- const link = document.createElement('a');
|
|
|
- link.href = url;
|
|
|
- link.setAttribute('download', row.topic + "-" + row.teamName + "-评分报告.pdf"); // 设置下载的文件名
|
|
|
- document.body.appendChild(link);
|
|
|
- link.click();
|
|
|
- }).catch(function (error) {
|
|
|
- console.log(error);
|
|
|
- });
|
|
|
-}
|
|
|
-
|
|
|
-
|
|
|
-const openPdf = (index: number, row: any) => {
|
|
|
- console.log(index, row)
|
|
|
- axios.post('http://36.110.106.142:12341/web_server/exam/report',
|
|
|
- {
|
|
|
- "id": row.id,
|
|
|
- "teamName": row.teamName,
|
|
|
- "scoreOnline": row.scoreOnline,
|
|
|
- "beginTime": row.beginTime,
|
|
|
- "endTime": row.endTime
|
|
|
- },
|
|
|
- {
|
|
|
- headers: {
|
|
|
- "Authorization": "U9yKpD6kZZDDe4LFKK6myAxBUT1XRrDM"
|
|
|
- },
|
|
|
- responseType: 'blob' // 设置响应类型为二进制流
|
|
|
- }
|
|
|
- ).then(function (response) {
|
|
|
- const url = window.URL.createObjectURL(new Blob([response.data], {type: 'application/pdf'}));
|
|
|
- window.open(url, '_blank');
|
|
|
- }).catch(function (error) {
|
|
|
- console.log(error);
|
|
|
- });
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
const queryLine = reactive({
|
|
|
dataName: '',
|
|
|
equipmentName: '',
|
|
|
equipmentTypeName: '',
|
|
|
- triggerName: '',
|
|
|
- triggerTypeName: '',
|
|
|
})
|
|
|
|
|
|
const onSubmit = () => {
|
|
@@ -265,9 +120,6 @@ const handleCurrentChange = (val: number) => {
|
|
|
currentPage.value = val
|
|
|
page()
|
|
|
}
|
|
|
-const handleClick = () => {
|
|
|
- console.log('click')
|
|
|
-}
|
|
|
|
|
|
|
|
|
</script>
|