{
title: `${i18nData[locale].projectName}`,
dataIndex: 'projectName',
customRender: ({ record }) => {
if (isUndefined(record.projectName) || isNull(record.projectName)) {
return '';
} else {
return h(OpenTableModal, {
columnTab: 'projectName',
value: record,
});
}
},
},
{
title: `${i18nData[locale].entrypoint}`,
dataIndex: 'entrypoint',
customRender: ({ record }) => {
if (isUndefined(record.entrypoint) || isNull(record.entrypoint)) {
return '';
} else {
const data = record.entrypoint;
const go = useGo();
return h(
'div',
{
onClick: () => {
go('/specific/ship-detail/' + record.entrypoint);
},
style: {
color: '#0960bd',
cursor: 'pointer',
},
},
`${data}`,
);
}
},
},
<template>
<!-- <QRCodeModal @register="registerQRCodeModal" /> -->
<div @click="openSth" style="color: #0960bd; cursor: pointer">{{ data.showData }}</div>
<ProjectViewModal @register="registerProjectDetailModal" />
<BatteryViewModal @register="registerBatteryDetailModal" />
<BmsViewModal @register="registerBmsDetailModal" />
</template>
<script lang="ts" setup>
import ProjectViewModal from '../project-mgmt/ProjectViewModal.vue';
import BatteryViewModal from '../battery-mgmt/batteryViewModal.vue';
import BmsViewModal from '../bms-mgmt/BmsViewModal.vue';
import { reactive } from 'vue';
import { useModal } from '@/components/Modal';
const props = defineProps({
columnTab: String,
value: Object,
});
const [registerBatteryDetailModal, { openModal }] = useModal();
const [registerProjectDetailModal, { openModal: openProjectModal }] = useModal();
const [registerBmsDetailModal, { openModal: openBmsModal }] = useModal();
let data = reactive({
showData: '',
});
switch (props.columnTab) {
case 'projectName':
data.showData = props.value.projectName;
break;
case 'batteryName':
data.showData = props.value.batteryName;
break;
case 'bmsSn':
data.showData = props.value.bmsSn;
break;
}
function openSth() {
switch (props.columnTab) {
case 'projectName':
openProjectModal(undefined, props.value.projectId);
break;
case 'batteryName':
openModal(undefined, props.value.batteryId);
break;
case 'bmsSn':
openBmsModal(undefined, props.value.bmsBaseInfoId);
break;
}
}
</script>