Browse Source

详细table

master
maochaoying 2 years ago
parent
commit
2c885cdd84
  1. 41
      src/components/DetailTable.vue

41
src/components/DetailTable.vue

@ -2,9 +2,10 @@
<t-table rowKey="id" :data="data" :columns="columns" bordered /> <t-table rowKey="id" :data="data" :columns="columns" bordered />
</template> </template>
<script setup>
<script setup lang="jsx">
import { computed, ref } from 'vue' import { computed, ref } from 'vue'
import { useImageStore } from '@/store' import { useImageStore } from '@/store'
import moment from 'moment'
const imageStore = useImageStore() const imageStore = useImageStore()
const data = computed(() => { const data = computed(() => {
const res = { ...imageStore.coreInfo } const res = { ...imageStore.coreInfo }
@ -17,22 +18,56 @@ const columns = ref([
{ {
colKey: 'operatorName', colKey: 'operatorName',
title: '操作员', title: '操作员',
width: 120,
}, },
{ {
colKey: 'serialNumber', colKey: 'serialNumber',
width: 120,
title: '核查坐标', title: '核查坐标',
cell: (h, { row }) => (row.serialNumber ? row.serialNumber : '---'),
}, },
{ {
colKey: 'firstSign', colKey: 'firstSign',
title: '坐标信息', title: '坐标信息',
width: 120,
cell: (h, { row }) =>
row.firstSign && row.secondSign ? (
<div>
<p>{row.firstSign?.substr(-4)}</p>
<p>{row.secondSign?.substr(-4)}</p>
</div>
) : (
'---'
),
}, },
{ {
colKey: 'resultSerial',
colKey: 'result',
title: '核对结果', title: '核对结果',
cell: (h, { row }) => {
if (row.result == 1) {
return (
<div>
<p>{row.resultSerial}</p>
<p>正确</p>
</div>
)
} else if (row.result == 2) {
return (
<div>
<p>{row.resultSerial}</p>
<p>错误</p>
</div>
)
} else {
return '---'
}
},
}, },
{ {
colKey: 'id',
colKey: 'checkTime',
title: '核对时间', title: '核对时间',
cell: (h, { row }) =>
row.checkTime ? moment(checkTime).format('YYYY-MM-DD HH:mm') : '---',
}, },
{ {
colKey: 'nuclearStationName', colKey: 'nuclearStationName',

Loading…
Cancel
Save