调整检测首页布局;根据不同的功能,实现不同的表格展示

This commit is contained in:
GYYM
2024-11-14 11:45:25 +08:00
parent 65cb7826d3
commit 8f89252d8b
5 changed files with 136 additions and 36 deletions

View File

@@ -1,24 +1,55 @@
<template>
<el-dropdown @command="handleCommand">
<span class="el-dropdown-link">
<div class="device-list-container">
<!-- :model-value="visible" -->
<el-dropdown @command="handleCommand" >
<el-button link type='primary' class='table-operate'>
<div class='table-operate-text'>更多...</div>
</el-button>
<!-- <span class="el-dropdown-link">
更多<el-icon class="el-icon--right"><arrow-down /></el-icon>
</span>
</span> -->
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="a">高精度设备-PQV520-2</el-dropdown-item>
<el-dropdown-item command="b">高精度设备-PQV520-3</el-dropdown-item>
<el-dropdown-item command="c">高精度设备-PQV520-4</el-dropdown-item>
<el-dropdown-item command="高精度设备-PQV520-2">高精度设备-PQV520-2</el-dropdown-item>
<el-dropdown-item command="高精度设备-PQV520-3">高精度设备-PQV520-3</el-dropdown-item>
<el-dropdown-item command="高精度设备-PQV520-4">高精度设备-PQV520-4</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
</template>
<!-- 查看误差体系详细信息 -->
<ErrorStandardDialog
:visible='detail_dialogFormVisible'
:formData='detail_dialogForm'
:dialogTitle='detail_dialogTitle'
@update:visible='detail_dialogFormVisible = $event'
/>
</div>
</template>
<script lang="ts" setup>
import { ElMessage } from 'element-plus'
import { ArrowDown } from '@element-plus/icons-vue'
import ErrorStandardDialog from '@/views/machine/errorSystem/components/ErrorStandardDialog.vue' // 导入子组件
import type { ErrorSystem } from '@/api/error/interface'
const detail_dialogFormVisible = ref(false)
const detail_dialogTitle = ref('Q/GDW 10650.2-2021 误差体系')
const detail_dialogForm = ref<ErrorSystem.Error_detail>({
measured: '',//被测量
deviceLevel: '',//检测装置级别
measurementType: '',
condition: '',//测量条件
maxErrorValue: '',//最大误差
})
// const props = defineProps<{
// visible: boolean;
// }>();
const handleCommand = (command: string | number | object) => {
ElMessage(`click on item ${command}`)
detail_dialogTitle.value = command as string;
detail_dialogFormVisible.value = true // 显示对话框
}
</script>
<style scoped>

View File

@@ -45,8 +45,14 @@
</template>
</ProTable>
@update:visible="dialogFormVisible = $event"/>
<!-- 向计划导入/导出设备对话框 -->
<planPopup
:visible="dialogFormVisible"
:formData="dialogForm"
:dialogTitle="dialogTitle"
:is-read-only="isReadOnly"
@update:visible="dialogFormVisible = $event"
/>
<!-- 查看误差体系详细信息 -->
<ErrorStandardDialog
:visible='detail_dialogFormVisible'
@@ -89,7 +95,7 @@ import type { Plan } from '@/api/plan/interface'
import planPopup from '@/views/plan/planList/components/planPopup.vue' // 导入子组件
import DeviceOpen from '@/views/plan/planList/components/devPopup.vue'
import SourceOpen from '@/views/plan/planList/components/sourcePopup.vue'
import temp from './components/temp.vue'
import Temp from './components/Temp.vue'
import devTransfer from './components/devTransfer.vue'
import sourceTransfer from './components/sourceTransfer.vue'
import { useViewSize } from '@/hooks/useViewSize'
@@ -142,6 +148,14 @@ const detail_dialogForm = ref<ErrorSystem.Error_detail>({
maxErrorValue: '',//最大误差
})
// <el-button
// v-for="(button, index) in scope.row.testSourceList"
// :key="index"
// @click="handleClick(button)"
// >
// {{ button.text }}
// </el-button>
// 表格配置项
const columns = reactive<ColumnProps<Plan.PlanAndSourceBO>[]>([
{ type: 'selection', fixed: 'left', width: 70 },
@@ -158,19 +172,15 @@ const columns = reactive<ColumnProps<Plan.PlanAndSourceBO>[]>([
width: 300,
render: scope => {
return (
// <el-button
// v-for="(button, index) in scope.row.testSourceList"
// :key="index"
// @click="handleClick(button)"
// >
// {{ button.text }}
// </el-button>
<div class='flx-flex-start'>
<el-button type='primary' link onClick={() => showData(scope.row.testSourceName)}>
{scope.row.testSourceName}
</el-button>
<temp></temp>
</div>
<Temp></Temp>
</div>
// <Temp { visible: scope.row.testSourceList.length > 1 }></Temp>
// <Temp :visible='{scope.row.testSourceList.length > 1}'></Temp>
// <Temp :visible="scope.row.testSourceList.length > 1"></Temp>
)
},