74 lines
1.8 KiB
Vue
Raw Normal View History

2025-10-21 17:43:57 +08:00
<template>
<!-- 使用仪器 -->
2025-11-04 17:54:29 +08:00
<div>
2025-10-31 15:22:51 +08:00
<div>
2025-11-17 17:42:09 +08:00
<el-button type="primary" @click="onClickAdd">新增</el-button>
<el-button type="primary" @click="onClickDel">删除</el-button>
2025-10-31 15:22:51 +08:00
</div>
2025-11-17 17:42:09 +08:00
<CustomTable ref="tableRef" :data="yqList" :columns="columns" :enable-column-drag="true" @column-drag-end="handleColumnDragEnd"
:config="tableConfig"/>
2025-10-28 16:22:44 +08:00
</div>
2025-10-21 17:43:57 +08:00
</template>
2025-10-24 15:37:24 +08:00
<script setup lang="ts">
2025-10-28 16:22:44 +08:00
import CustomTable from '@/components/elTable/index.vue'
2025-10-31 15:22:51 +08:00
import { LabInstr } from '@/types';
2025-11-07 17:50:06 +08:00
import { ref } from 'vue'
2025-10-21 17:43:57 +08:00
const props = defineProps({
2025-11-17 17:42:09 +08:00
// 显示数据
2025-10-31 15:22:51 +08:00
dataList: {
2025-11-17 17:42:09 +08:00
type: Array,
2025-10-31 15:22:51 +08:00
required: true,
default: () => []
2025-10-21 17:43:57 +08:00
}
});
2025-10-28 16:22:44 +08:00
2025-11-17 17:42:09 +08:00
//const yq = ref<string>('');
const tableRef = ref<any>();
const yqList = ref<any>([]);
2025-10-28 16:22:44 +08:00
const columns = ref([
2025-11-17 17:42:09 +08:00
{ prop: 'xz', label: '选择', visible: true, align: 'center', width: 50 },
2025-10-31 15:22:51 +08:00
{ prop: 'yq', label: '仪器代号', visible: true, align: 'center', width: 150 },
{ prop: 'yqmc', label: '仪器名称', visible: true, align: 'center', width: 200},
2025-10-28 16:22:44 +08:00
{ prop: 'xs', label: '调整系数', visible: true, align: 'center', width: 100 },
{ prop: 'zkxm', label: '质控', visible: true, align: 'center', width: 100 }
]);
const tableConfig = ref({
border: true, // 边框
height: '85vh', // 高度
highlightCurrentRow: true, // 高亮当前行
// cellStyle: cellStyleHd
})
//退拽属性
2025-11-17 17:42:09 +08:00
const handleColumnDragEnd = (data: any) => {
// 更新列配置
columns.value = data.columns;
}
2025-10-31 15:22:51 +08:00
const handInputChange = () => {
2025-11-07 17:50:06 +08:00
// yqList.value = yqList.value.filter(item => {
// return item.yq.includes(yq.value) || item.yqmc.includes(yq.value);
// });
// if (yq.value === '') {
// yqList.value = props.dataList;
// }
2025-10-31 15:22:51 +08:00
}
2025-11-17 17:42:09 +08:00
const onClickAdd = () => {
}
const onClickDel = () => {
}
2025-10-31 15:22:51 +08:00
2025-11-17 17:42:09 +08:00
onActivated(() =>{
yqList.value = props.dataList;
2025-10-31 15:22:51 +08:00
})
2025-10-21 17:43:57 +08:00
</script>