V4修复: 操作按钮改用JSX语法(el-button而非h函数)
This commit is contained in:
@@ -140,26 +140,38 @@
|
|||||||
// 自定义操作列
|
// 自定义操作列
|
||||||
columns.push({
|
columns.push({
|
||||||
title: '操作', field: '_actions', width: 300, align: 'left', fixed: 'right',
|
title: '操作', field: '_actions', width: 300, align: 'left', fixed: 'right',
|
||||||
render: (_h, { row }) => {
|
render: (h, { row, column, index }) => {
|
||||||
if (row.DeviceGroup === '视频设备') {
|
if (row.DeviceGroup === '视频设备') {
|
||||||
return _h('div', [
|
return (
|
||||||
h('el-button', { size: 'small', type: 'primary',
|
<div>
|
||||||
onClick: () => openPreview(row)
|
<el-button size="small" type="primary" plain
|
||||||
}, { default: () => '预览' }),
|
style="height:26px;padding:0 8px !important;"
|
||||||
h('el-button', { size: 'small',
|
onClick={($e) => openPreview(row)}>
|
||||||
onClick: () => { curDev.value = row; ptzVisible.value = true }
|
预览
|
||||||
}, { default: () => '云台' }),
|
</el-button>
|
||||||
]);
|
<el-button size="small" plain
|
||||||
|
style="height:26px;padding:0 8px !important;margin-left:4px"
|
||||||
|
onClick={($e) => { curDev.value = row; ptzVisible.value = true }}>
|
||||||
|
云台
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if (row.DeviceGroup === 'IoT设备') {
|
if (row.DeviceGroup === 'IoT设备') {
|
||||||
return _h('div', [
|
return (
|
||||||
h('el-button', { size: 'small', type: 'primary',
|
<div>
|
||||||
onClick: () => openRealtime(row)
|
<el-button size="small" type="primary" plain
|
||||||
}, { default: () => '实时数据' }),
|
style="height:26px;padding:0 8px !important;"
|
||||||
h('el-button', { size: 'small',
|
onClick={($e) => openRealtime(row)}>
|
||||||
onClick: () => openControl(row)
|
实时数据
|
||||||
}, { default: () => '控制' }),
|
</el-button>
|
||||||
]);
|
<el-button size="small" plain
|
||||||
|
style="height:26px;padding:0 8px !important;margin-left:4px"
|
||||||
|
onClick={($e) => openControl(row)}>
|
||||||
|
控制
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user