{
key: 'type',
title: $t('cmdType'),
width: 150,
align: 'center',
render(t) {
switch (t.type) {
case 2:
return h('span', {
innerText: $t('setCmd'),
});
case 3:
return h('span', {
innerText: $t('readCmd'),
});
case 5:
return h('span', {
innerText: $t('timingCmd'),
});
}
},
},
{
key: 'confirmed',
title: $t('device respond'),
width: 150,
align: 'center',
render(t) {
return h(
NTag,
{
type: t.confirmed == 0 ? 'error' : 'success',
},
() => (t.confirmed == 0 ? $t('no-respond') : $t('responded')),
);
},
},
{
key: 'status',
title: $t('progress'),
align: 'center',
width: 120,
render(t) {
switch (t.status) {
case 0:
return h(
NTag,
{
type: 'info',
},
() => $t('in-progress'),
);
case 1:
return h(
'div',
{
class: 'flex flex-col gap-y-2',
},
[
h(
NTag,
{
type: 'error',
class: 'flex items-center justify-center ',
},
() => $t('program-error'),
),
renderErrorMsg(t),
],
);
case 2:
return h(
NTag,
{
type: 'default',
},
() => $t('program-cancel'),
);
case 3:
return h(
NTag,
{
type: 'success',
},
() => $t('program-download-finish'),
);
}
},
},
标签:case,return,center,render,NTag,table,nativeUI,type
From: https://www.cnblogs.com/bingMIN/p/18020759