Commit 5a76927375337d0994dd9c2fd8b94d6bb579ae51

Authored by xp.Huang
2 parents 414ecd6b 378642fc

Merge branch 'perf/device-customer-06-03' into 'v1.4.0_dev'

perf: 设备列表 注释与客户相关的代码

See merge request yunteng/thingskit-front!1362
... ... @@ -139,11 +139,11 @@ export const columns: BasicColumn[] = [
139 139 dataIndex: 'organizationDTO.name',
140 140 width: 100,
141 141 },
142   - {
143   - title: '客户',
144   - dataIndex: 'customerName',
145   - width: 100,
146   - },
  142 + // {
  143 + // title: '客户',
  144 + // dataIndex: 'customerName',
  145 + // width: 100,
  146 + // },
147 147 {
148 148 title: '公开',
149 149 dataIndex: 'public',
... ...
... ... @@ -36,14 +36,14 @@
36 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 48 text: '更新产品',
49 49 auth: DeviceListAuthEnum.UPDATE_PRODUCT,
... ... @@ -178,24 +178,24 @@
178 178 },
179 179 ]"
180 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 200 label: record?.customerAdditionalInfo?.isPublic ? '私有' : '公开',
201 201 auth: DeviceListAuthEnum.PUBLIC,
... ... @@ -249,7 +249,7 @@
249 249 <DeviceDetailDrawer @register="registerGatewayDetailDrawer" />
250 250
251 251 <DeviceModal @register="registerModal" @success="handleSuccess" @reload="handleSuccess" />
252   - <CustomerModal @register="registerCustomerModal" @reload="handleReload" />
  252 + <!-- <CustomerModal @register="registerCustomerModal" @reload="handleReload" /> -->
253 253 <OrgModal @register="registerOrgModal" @reload="handleReload" />
254 254
255 255 <BatchImportModal @register="registerImportModal" @import-finally="handleImportFinally" />
... ... @@ -276,7 +276,7 @@
276 276 deleteDevice,
277 277 devicePage,
278 278 deviceCollect,
279   - cancelDispatchCustomer,
  279 + // cancelDispatchCustomer,
280 280 getGATEWAY,
281 281 privateDevice,
282 282 publicDevice,
... ... @@ -291,7 +291,7 @@
291 291 import DeviceModal from './cpns/modal/DeviceModal.vue';
292 292 import { useDrawer } from '/@/components/Drawer';
293 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 295 import OrgModal from './cpns/modal/OrgModal.vue';
296 296 import BatchImportModal from './cpns/modal/BatchImportModal/index.vue';
297 297 import { useMessage } from '/@/hooks/web/useMessage';
... ... @@ -320,7 +320,7 @@
320 320 const searchInfo = reactive<Recordable>({});
321 321 const { organizationIdTreeRef, resetFn } = useResetOrganizationTree(searchInfo);
322 322 const [registerModal, { openModal }] = useModal();
323   - const [registerCustomerModal, { openModal: openCustomerModal }] = useModal();
  323 + // const [registerCustomerModal, { openModal: openCustomerModal }] = useModal();
324 324 const [registerOrgModal, { openModal: openOrgodal }] = useModal();
325 325 const [registerDetailDrawer, { openDrawer }] = useDrawer();
326 326 const [registerTbDetailDrawer, { openDrawer: openTbDeviceDrawer }] = useDrawer();
... ... @@ -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 476 function handleReload() {
477 477 setSelectedRowKeys([]);
478 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 489 function handleDetail(record: Recordable) {
490 490 const { id, tbDeviceId, deviceProfile, deviceType } = record;
... ... @@ -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 559 const handleBatchOrg = () => {
560 560 const options = getSelectRows();
... ...