DevicePreviewModal.vue
1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<template>
<div>
<BasicModal
v-bind="$attrs"
width="55rem"
:height="heightNum"
@register="register"
title="执行设备及属性"
@cancel="handleCancel"
:showOkBtn="false"
>
<div>
<BasicTable @register="registerTable" :dataSource="tableData" />
</div>
</BasicModal>
</div>
</template>
<script setup lang="ts">
import { ref, nextTick } from 'vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import { BasicTable, useTable } from '/@/components/Table';
import { viewDeviceColumn } from './config.data';
const heightNum = ref(800);
const tableData: any = ref([]);
const [registerTable] = useTable({
title: '执行设备及属性',
columns: viewDeviceColumn,
showIndexColumn: false,
clickToRowSelect: false,
showTableSetting: false,
bordered: true,
});
const [register] = useModalInner((data) => {
console.log(data);
const getTableData = () => {
for (let i = 0; i < 100; i++) {
tableData.value.push({
tdDevice: `设备${i}`,
attr: `CO${i}、Temp${i}`,
});
}
};
nextTick(() => {
getTableData();
});
});
const handleCancel = () => {};
</script>
<style></style>