|
@@ -2,7 +2,7 @@
|
|
|
<div class="p-4">
|
|
<div class="p-4">
|
|
|
<BasicTable @register="registerTable" :rowSelection="{ type: 'checkbox' }">
|
|
<BasicTable @register="registerTable" :rowSelection="{ type: 'checkbox' }">
|
|
|
<template #toolbar>
|
|
<template #toolbar>
|
|
|
- <a-button type="primary" @click="handleLiveOpen"> 新增</a-button>
|
|
|
|
|
|
|
+ <a-button type="primary" @click="handleAddLiveScene"> 新增</a-button>
|
|
|
<!-- <a-button type="primary" color="warning" @click="() => {}"> 编辑</a-button>
|
|
<!-- <a-button type="primary" color="warning" @click="() => {}"> 编辑</a-button>
|
|
|
<a-button type="primary" color="error" @click="() => {}"> 删除</a-button> -->
|
|
<a-button type="primary" color="error" @click="() => {}"> 删除</a-button> -->
|
|
|
</template>
|
|
</template>
|
|
@@ -30,7 +30,7 @@
|
|
|
icon: 'ant-design:delete-outlined',
|
|
icon: 'ant-design:delete-outlined',
|
|
|
color: 'warning',
|
|
color: 'warning',
|
|
|
label: '编辑',
|
|
label: '编辑',
|
|
|
- onClick: () => {},
|
|
|
|
|
|
|
+ onClick: handleEditLiveScene.bind(null, record),
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
icon: 'ant-design:delete-outlined',
|
|
icon: 'ant-design:delete-outlined',
|
|
@@ -252,9 +252,18 @@
|
|
|
console.log('record', record);
|
|
console.log('record', record);
|
|
|
openBindModal(true, record);
|
|
openBindModal(true, record);
|
|
|
}
|
|
}
|
|
|
- function handleLiveOpen(record: Recordable) {
|
|
|
|
|
- // console.log('record', record);
|
|
|
|
|
- openLiveDrawer(true, record);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ function handleAddLiveScene() {
|
|
|
|
|
+ openLiveDrawer(true, {
|
|
|
|
|
+ isUpdate: false,
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ function handleEditLiveScene(record: Recordable) {
|
|
|
|
|
+ console.log('record', record);
|
|
|
|
|
+ openLiveDrawer(true, {
|
|
|
|
|
+ record,
|
|
|
|
|
+ isUpdate: true,
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
async function handleDeleteLiveScene(record: Recordable) {
|
|
async function handleDeleteLiveScene(record: Recordable) {
|
|
|
try {
|
|
try {
|
|
@@ -274,8 +283,9 @@
|
|
|
|
|
|
|
|
reload,
|
|
reload,
|
|
|
registerLiveDrawer,
|
|
registerLiveDrawer,
|
|
|
- handleLiveOpen,
|
|
|
|
|
|
|
+ handleAddLiveScene,
|
|
|
handleDeleteLiveScene,
|
|
handleDeleteLiveScene,
|
|
|
|
|
+ handleEditLiveScene,
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|