|
@@ -154,6 +154,7 @@ |
|
@@ -154,6 +154,7 @@ |
154
|
import {
|
154
|
import {
|
155
|
deleteDevice,
|
155
|
deleteDevice,
|
156
|
devicePage,
|
156
|
devicePage,
|
|
|
157
|
+ checkDeviceOccupied,
|
157
|
cancelDispatchCustomer,
|
158
|
cancelDispatchCustomer,
|
158
|
getGATEWAY,
|
159
|
getGATEWAY,
|
159
|
} from '/@/api/device/deviceManager';
|
160
|
} from '/@/api/device/deviceManager';
|
|
@@ -197,6 +198,7 @@ |
|
@@ -197,6 +198,7 @@ |
197
|
const [registerModal, { openModal }] = useModal();
|
198
|
const [registerModal, { openModal }] = useModal();
|
198
|
const [registerCustomerModal, { openModal: openCustomerModal }] = useModal();
|
199
|
const [registerCustomerModal, { openModal: openCustomerModal }] = useModal();
|
199
|
const [registerDetailDrawer, { openDrawer }] = useDrawer();
|
200
|
const [registerDetailDrawer, { openDrawer }] = useDrawer();
|
|
|
201
|
+
|
200
|
const [registerTable, { reload, setSelectedRowKeys, setProps }] = useTable({
|
202
|
const [registerTable, { reload, setSelectedRowKeys, setProps }] = useTable({
|
201
|
title: '设备列表',
|
203
|
title: '设备列表',
|
202
|
api: devicePage,
|
204
|
api: devicePage,
|
|
@@ -253,8 +255,16 @@ |
|
@@ -253,8 +255,16 @@ |
253
|
}
|
255
|
}
|
254
|
// 取消分配客户
|
256
|
// 取消分配客户
|
255
|
async function handleCancelDispatchCustomer(record: Recordable) {
|
257
|
async function handleCancelDispatchCustomer(record: Recordable) {
|
256
|
- await cancelDispatchCustomer(record);
|
|
|
257
|
- handleReload();
|
258
|
+ try {
|
|
|
259
|
+ // 该设备是否正在被场景联动使用中?
|
|
|
260
|
+ const isEnabled = await checkDeviceOccupied(record.id);
|
|
|
261
|
+ if (!isEnabled) {
|
|
|
262
|
+ await cancelDispatchCustomer(record);
|
|
|
263
|
+ handleReload();
|
|
|
264
|
+ } else {
|
|
|
265
|
+ createMessage.warn('该设备正在使用中~');
|
|
|
266
|
+ }
|
|
|
267
|
+ } catch {}
|
258
|
}
|
268
|
}
|
259
|
|
269
|
|
260
|
function handleDetail(record: Recordable) {
|
270
|
function handleDetail(record: Recordable) {
|