2024-10-23 20:53:58 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div class='table-box'>
|
|
|
|
|
|
<ProTable
|
|
|
|
|
|
ref='proTable'
|
|
|
|
|
|
:columns='columns'
|
2024-10-31 08:51:30 +08:00
|
|
|
|
:request-api="getTableList"
|
2024-10-23 20:53:58 +08:00
|
|
|
|
>
|
2024-10-31 08:51:30 +08:00
|
|
|
|
<!-- :data='testSourceData' 如果要显示静态数据,就切换该配置-->
|
2024-10-23 20:53:58 +08:00
|
|
|
|
<!-- 表格 header 按钮 -->
|
|
|
|
|
|
<template #tableHeader='scope'>
|
2024-10-24 13:24:54 +08:00
|
|
|
|
<el-button type='primary' :icon='CirclePlus' >新增</el-button>
|
|
|
|
|
|
<el-button type='primary' :icon='Download' plain >导出数据</el-button>
|
2024-10-23 20:53:58 +08:00
|
|
|
|
<el-button type='danger' :icon='Delete' plain :disabled='!scope.isSelected'>
|
2024-10-24 13:24:54 +08:00
|
|
|
|
批量删除
|
2024-10-23 20:53:58 +08:00
|
|
|
|
</el-button>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
<!-- 表格操作 -->
|
|
|
|
|
|
<template #operation='scope'>
|
|
|
|
|
|
<el-button type='primary' link :icon='View' >查看</el-button>
|
|
|
|
|
|
<el-button type='primary' link :icon='EditPen' >编辑</el-button>
|
|
|
|
|
|
<el-button type='primary' link :icon='Delete' >删除</el-button>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
</ProTable>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang='tsx' name='useRole'>
|
2024-11-26 15:41:20 +08:00
|
|
|
|
import { type TestSource } from '@/api/device/interface/testSource'
|
2024-10-23 20:53:58 +08:00
|
|
|
|
import { useHandleData } from '@/hooks/useHandleData'
|
|
|
|
|
|
import { useDownload } from '@/hooks/useDownload'
|
|
|
|
|
|
import { useAuthButtons } from '@/hooks/useAuthButtons'
|
|
|
|
|
|
import ProTable from '@/components/ProTable/index.vue'
|
|
|
|
|
|
import ImportExcel from '@/components/ImportExcel/index.vue'
|
|
|
|
|
|
import { ProTableInstance, ColumnProps } from '@/components/ProTable/interface'
|
|
|
|
|
|
import { CirclePlus, Delete, EditPen, Share, Download, Upload, View, Refresh } from '@element-plus/icons-vue'
|
|
|
|
|
|
import { useDictStore } from '@/stores/modules/dict'
|
|
|
|
|
|
import {
|
|
|
|
|
|
getTestSourceList,
|
2024-11-26 15:41:20 +08:00
|
|
|
|
} from '@/api/device/testSource/index'
|
|
|
|
|
|
import { reactive, ref } from 'vue'
|
2024-10-23 20:53:58 +08:00
|
|
|
|
|
|
|
|
|
|
const dictStore = useDictStore()
|
|
|
|
|
|
|
2024-10-31 08:51:30 +08:00
|
|
|
|
// const testSourceData = testSourceDataList
|
2024-10-23 20:53:58 +08:00
|
|
|
|
// ProTable 实例
|
|
|
|
|
|
const proTable = ref<ProTableInstance>()
|
|
|
|
|
|
|
2024-10-31 08:51:30 +08:00
|
|
|
|
|
2024-10-23 20:53:58 +08:00
|
|
|
|
// 表格配置项
|
2024-10-31 08:51:30 +08:00
|
|
|
|
const columns = reactive<ColumnProps<TestSource.TestSourceBO>[]>([
|
2024-10-23 20:53:58 +08:00
|
|
|
|
{ type: 'selection', fixed: 'left', width: 70 },
|
|
|
|
|
|
{ type: 'index', fixed: 'left', width: 70, label: '序号' },
|
|
|
|
|
|
{
|
2024-10-31 08:51:30 +08:00
|
|
|
|
prop: 'name',
|
2024-10-23 20:53:58 +08:00
|
|
|
|
label: '名称',
|
|
|
|
|
|
search: { el: 'input' },
|
|
|
|
|
|
minWidth: 180,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
2024-10-31 08:51:30 +08:00
|
|
|
|
prop: 'devType',
|
|
|
|
|
|
label: '设备类型',
|
|
|
|
|
|
enum: dictStore.getDictData('testSourceDevType'),
|
|
|
|
|
|
fieldNames: { label: 'label', value: 'id' },
|
2024-10-24 09:59:31 +08:00
|
|
|
|
search: { el: 'select' },
|
2024-10-23 20:53:58 +08:00
|
|
|
|
minWidth: 220,
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
2024-10-31 08:51:30 +08:00
|
|
|
|
prop: 'type',
|
2024-10-23 20:53:58 +08:00
|
|
|
|
label: '源类型',
|
2024-10-31 08:51:30 +08:00
|
|
|
|
enum: dictStore.getDictData('testSourceType'),
|
|
|
|
|
|
fieldNames: { label: 'label', value: 'id' },
|
2024-10-24 09:59:31 +08:00
|
|
|
|
search: { el: 'select' },
|
2024-10-23 20:53:58 +08:00
|
|
|
|
minWidth: 150,
|
|
|
|
|
|
},
|
2024-11-14 18:26:34 +08:00
|
|
|
|
{ prop: 'operation', label: '操作', fixed: 'right', width: 250 },
|
2024-10-23 20:53:58 +08:00
|
|
|
|
])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|