2025-12-08 17:49:43 +08:00

46 lines
1.2 KiB
Vue

<template>
<!-- 知识库 -->
<div>
<CustomTable ref="tableRef" :data="dataList" :columns="columns" :enable-column-drag="true"
@column-drag-end="handleColumnDragEnd" :config="tableConfig" />
</div>
</template>
<script setup lang="ts">
import CustomTable from '@/components/elTable/index.vue'
import { ref } from 'vue';
const props = defineProps({
// 是否显示
// visible: {
// type: Boolean,
// required: true,
// default: false
// }
});
const tableRef = ref<any>(null);
const dataList = ref();
const columns = ref([
{ prop: 'reserve', label: '类别', visible: true, align: 'center', width: 200 },
{ prop: 'textresult', label: '描述', visible: true, align: 'center', width: 100 },
{ prop: 'yxjs', label: '医学解释', visible: true, align: 'center', width: 100 },
{ prop: 'cjyy', label: '常见原因,', visible: true, align: 'center', width: 100 },
{ prop: 'zd', label: '指导,', visible: true, align: 'center', width: 100 },
]);
const tableConfig = ref({
border: true, // 边框
height: '81.5vh', // 高度
highlightCurrentRow: true, // 高亮当前行
// cellStyle: cellStyleHd
})
//退拽属性
const handleColumnDragEnd = (data: any) => {
// 更新列配置
columns.value = data.columns;
}
</script>