|
@@ -36,14 +36,14 @@ |
|
@@ -36,14 +36,14 @@ |
36
|
onConfirm: () => handleDelete(),
|
36
|
onConfirm: () => handleDelete(),
|
37
|
},
|
37
|
},
|
38
|
},
|
38
|
},
|
39
|
- {
|
|
|
40
|
- text: '分配客户',
|
|
|
41
|
- auth: DeviceListAuthEnum.ASSIGN,
|
|
|
42
|
- icon: 'mdi:account-arrow-left',
|
|
|
43
|
- event: '',
|
|
|
44
|
- disabled: !batchPrivateFlag,
|
|
|
45
|
- onClick: handleBatchAssign.bind(null),
|
|
|
46
|
- },
|
39
|
+ // {
|
|
|
40
|
+ // text: '分配客户',
|
|
|
41
|
+ // auth: DeviceListAuthEnum.ASSIGN,
|
|
|
42
|
+ // icon: 'mdi:account-arrow-left',
|
|
|
43
|
+ // event: '',
|
|
|
44
|
+ // disabled: !batchPrivateFlag,
|
|
|
45
|
+ // onClick: handleBatchAssign.bind(null),
|
|
|
46
|
+ // },
|
47
|
{
|
47
|
{
|
48
|
text: '更新产品',
|
48
|
text: '更新产品',
|
49
|
auth: DeviceListAuthEnum.UPDATE_PRODUCT,
|
49
|
auth: DeviceListAuthEnum.UPDATE_PRODUCT,
|
|
@@ -178,24 +178,24 @@ |
|
@@ -178,24 +178,24 @@ |
178
|
},
|
178
|
},
|
179
|
]"
|
179
|
]"
|
180
|
:dropDownActions="[
|
180
|
:dropDownActions="[
|
181
|
- record.customerId
|
|
|
182
|
- ? {
|
|
|
183
|
- label: '取消分配',
|
|
|
184
|
- icon: 'mdi:account-arrow-left',
|
|
|
185
|
- ifShow: authBtn(role) && !record?.customerAdditionalInfo?.isPublic,
|
|
|
186
|
- auth: DeviceListAuthEnum.ASSIGN,
|
|
|
187
|
- popConfirm: {
|
|
|
188
|
- title: '是否取消分配客户',
|
|
|
189
|
- confirm: handleCancelDispatchCustomer.bind(null, record),
|
|
|
190
|
- },
|
|
|
191
|
- }
|
|
|
192
|
- : {
|
|
|
193
|
- label: '分配客户',
|
|
|
194
|
- icon: 'mdi:account-arrow-right',
|
|
|
195
|
- ifShow: authBtn(role),
|
|
|
196
|
- auth: DeviceListAuthEnum.ASSIGN,
|
|
|
197
|
- onClick: handleDispatchCustomer.bind(null, record),
|
|
|
198
|
- },
|
181
|
+ // record.customerId
|
|
|
182
|
+ // ? {
|
|
|
183
|
+ // label: '取消分配',
|
|
|
184
|
+ // icon: 'mdi:account-arrow-left',
|
|
|
185
|
+ // ifShow: authBtn(role) && !record?.customerAdditionalInfo?.isPublic,
|
|
|
186
|
+ // auth: DeviceListAuthEnum.ASSIGN,
|
|
|
187
|
+ // popConfirm: {
|
|
|
188
|
+ // title: '是否取消分配客户',
|
|
|
189
|
+ // confirm: handleCancelDispatchCustomer.bind(null, record),
|
|
|
190
|
+ // },
|
|
|
191
|
+ // }
|
|
|
192
|
+ // : {
|
|
|
193
|
+ // label: '分配客户',
|
|
|
194
|
+ // icon: 'mdi:account-arrow-right',
|
|
|
195
|
+ // ifShow: authBtn(role),
|
|
|
196
|
+ // auth: DeviceListAuthEnum.ASSIGN,
|
|
|
197
|
+ // onClick: handleDispatchCustomer.bind(null, record),
|
|
|
198
|
+ // },
|
199
|
{
|
199
|
{
|
200
|
label: record?.customerAdditionalInfo?.isPublic ? '私有' : '公开',
|
200
|
label: record?.customerAdditionalInfo?.isPublic ? '私有' : '公开',
|
201
|
auth: DeviceListAuthEnum.PUBLIC,
|
201
|
auth: DeviceListAuthEnum.PUBLIC,
|
|
@@ -249,7 +249,7 @@ |
|
@@ -249,7 +249,7 @@ |
249
|
<DeviceDetailDrawer @register="registerGatewayDetailDrawer" />
|
249
|
<DeviceDetailDrawer @register="registerGatewayDetailDrawer" />
|
250
|
|
250
|
|
251
|
<DeviceModal @register="registerModal" @success="handleSuccess" @reload="handleSuccess" />
|
251
|
<DeviceModal @register="registerModal" @success="handleSuccess" @reload="handleSuccess" />
|
252
|
- <CustomerModal @register="registerCustomerModal" @reload="handleReload" />
|
252
|
+ <!-- <CustomerModal @register="registerCustomerModal" @reload="handleReload" /> -->
|
253
|
<OrgModal @register="registerOrgModal" @reload="handleReload" />
|
253
|
<OrgModal @register="registerOrgModal" @reload="handleReload" />
|
254
|
|
254
|
|
255
|
<BatchImportModal @register="registerImportModal" @import-finally="handleImportFinally" />
|
255
|
<BatchImportModal @register="registerImportModal" @import-finally="handleImportFinally" />
|
|
@@ -276,7 +276,7 @@ |
|
@@ -276,7 +276,7 @@ |
276
|
deleteDevice,
|
276
|
deleteDevice,
|
277
|
devicePage,
|
277
|
devicePage,
|
278
|
deviceCollect,
|
278
|
deviceCollect,
|
279
|
- cancelDispatchCustomer,
|
279
|
+ // cancelDispatchCustomer,
|
280
|
getGATEWAY,
|
280
|
getGATEWAY,
|
281
|
privateDevice,
|
281
|
privateDevice,
|
282
|
publicDevice,
|
282
|
publicDevice,
|
|
@@ -291,7 +291,7 @@ |
|
@@ -291,7 +291,7 @@ |
291
|
import DeviceModal from './cpns/modal/DeviceModal.vue';
|
291
|
import DeviceModal from './cpns/modal/DeviceModal.vue';
|
292
|
import { useDrawer } from '/@/components/Drawer';
|
292
|
import { useDrawer } from '/@/components/Drawer';
|
293
|
import DeviceDetailDrawer from './cpns/modal/DeviceDetailDrawer.vue';
|
293
|
import DeviceDetailDrawer from './cpns/modal/DeviceDetailDrawer.vue';
|
294
|
- import CustomerModal from './cpns/modal/CustomerModal.vue';
|
294
|
+ // import CustomerModal from './cpns/modal/CustomerModal.vue';
|
295
|
import OrgModal from './cpns/modal/OrgModal.vue';
|
295
|
import OrgModal from './cpns/modal/OrgModal.vue';
|
296
|
import BatchImportModal from './cpns/modal/BatchImportModal/index.vue';
|
296
|
import BatchImportModal from './cpns/modal/BatchImportModal/index.vue';
|
297
|
import { useMessage } from '/@/hooks/web/useMessage';
|
297
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
@@ -320,7 +320,7 @@ |
|
@@ -320,7 +320,7 @@ |
320
|
const searchInfo = reactive<Recordable>({});
|
320
|
const searchInfo = reactive<Recordable>({});
|
321
|
const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo);
|
321
|
const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo);
|
322
|
const [registerModal, { openModal }] = useModal();
|
322
|
const [registerModal, { openModal }] = useModal();
|
323
|
- const [registerCustomerModal, { openModal: openCustomerModal }] = useModal();
|
323
|
+ // const [registerCustomerModal, { openModal: openCustomerModal }] = useModal();
|
324
|
const [registerOrgModal, { openModal: openOrgodal }] = useModal();
|
324
|
const [registerOrgModal, { openModal: openOrgodal }] = useModal();
|
325
|
const [registerDetailDrawer, { openDrawer }] = useDrawer();
|
325
|
const [registerDetailDrawer, { openDrawer }] = useDrawer();
|
326
|
const [registerTbDetailDrawer, { openDrawer: openTbDeviceDrawer }] = useDrawer();
|
326
|
const [registerTbDetailDrawer, { openDrawer: openTbDeviceDrawer }] = useDrawer();
|
|
@@ -470,21 +470,21 @@ |
|
@@ -470,21 +470,21 @@ |
470
|
});
|
470
|
});
|
471
|
}
|
471
|
}
|
472
|
// 分配客户
|
472
|
// 分配客户
|
473
|
- function handleDispatchCustomer(record: Recordable) {
|
|
|
474
|
- openCustomerModal(true, record);
|
|
|
475
|
- }
|
473
|
+ // function handleDispatchCustomer(record: Recordable) {
|
|
|
474
|
+ // openCustomerModal(true, record);
|
|
|
475
|
+ // }
|
476
|
function handleReload() {
|
476
|
function handleReload() {
|
477
|
setSelectedRowKeys([]);
|
477
|
setSelectedRowKeys([]);
|
478
|
handleSuccess();
|
478
|
handleSuccess();
|
479
|
}
|
479
|
}
|
480
|
// 取消分配客户
|
480
|
// 取消分配客户
|
481
|
- async function handleCancelDispatchCustomer(record: Recordable) {
|
|
|
482
|
- try {
|
|
|
483
|
- // 该设备是否正在被场景联动使用中?
|
|
|
484
|
- await cancelDispatchCustomer(record);
|
|
|
485
|
- handleReload();
|
|
|
486
|
- } catch {}
|
|
|
487
|
- }
|
481
|
+ // async function handleCancelDispatchCustomer(record: Recordable) {
|
|
|
482
|
+ // try {
|
|
|
483
|
+ // // 该设备是否正在被场景联动使用中?
|
|
|
484
|
+ // await cancelDispatchCustomer(record);
|
|
|
485
|
+ // handleReload();
|
|
|
486
|
+ // } catch {}
|
|
|
487
|
+ // }
|
488
|
|
488
|
|
489
|
function handleDetail(record: Recordable) {
|
489
|
function handleDetail(record: Recordable) {
|
490
|
const { id, tbDeviceId, deviceProfile, deviceType } = record;
|
490
|
const { id, tbDeviceId, deviceProfile, deviceType } = record;
|
|
@@ -533,28 +533,28 @@ |
|
@@ -533,28 +533,28 @@ |
533
|
});
|
533
|
});
|
534
|
};
|
534
|
};
|
535
|
|
535
|
|
536
|
- const handleCheckHasDiffenterOrg = (options: DeviceModel[]) => {
|
|
|
537
|
- let orgId: string | undefined;
|
|
|
538
|
- let flag = false;
|
|
|
539
|
- for (const item of options) {
|
|
|
540
|
- const _orgId = item.organizationId;
|
|
|
541
|
- if (!orgId) orgId = _orgId;
|
|
|
542
|
- if (orgId !== _orgId) {
|
|
|
543
|
- flag = true;
|
|
|
544
|
- break;
|
|
|
545
|
- }
|
|
|
546
|
- }
|
|
|
547
|
- return flag;
|
|
|
548
|
- };
|
|
|
549
|
-
|
|
|
550
|
- const handleBatchAssign = () => {
|
|
|
551
|
- const options = getSelectRows();
|
|
|
552
|
- if (handleCheckHasDiffenterOrg(options as DeviceModel[])) {
|
|
|
553
|
- createMessage.error('当前选中项中存在不同所属组织的设备!');
|
|
|
554
|
- return;
|
|
|
555
|
- }
|
|
|
556
|
- openCustomerModal(true, options);
|
|
|
557
|
- };
|
536
|
+ // const handleCheckHasDiffenterOrg = (options: DeviceModel[]) => {
|
|
|
537
|
+ // let orgId: string | undefined;
|
|
|
538
|
+ // let flag = false;
|
|
|
539
|
+ // for (const item of options) {
|
|
|
540
|
+ // const _orgId = item.organizationId;
|
|
|
541
|
+ // if (!orgId) orgId = _orgId;
|
|
|
542
|
+ // if (orgId !== _orgId) {
|
|
|
543
|
+ // flag = true;
|
|
|
544
|
+ // break;
|
|
|
545
|
+ // }
|
|
|
546
|
+ // }
|
|
|
547
|
+ // return flag;
|
|
|
548
|
+ // };
|
|
|
549
|
+
|
|
|
550
|
+ // const handleBatchAssign = () => {
|
|
|
551
|
+ // const options = getSelectRows();
|
|
|
552
|
+ // if (handleCheckHasDiffenterOrg(options as DeviceModel[])) {
|
|
|
553
|
+ // createMessage.error('当前选中项中存在不同所属组织的设备!');
|
|
|
554
|
+ // return;
|
|
|
555
|
+ // }
|
|
|
556
|
+ // openCustomerModal(true, options);
|
|
|
557
|
+ // };
|
558
|
|
558
|
|
559
|
const handleBatchOrg = () => {
|
559
|
const handleBatchOrg = () => {
|
560
|
const options = getSelectRows();
|
560
|
const options = getSelectRows();
|