|
@@ -14,17 +14,10 @@
|
|
|
{{ renderOwnTypeLabel(record.own) }}
|
|
|
</template>
|
|
|
|
|
|
- <template #action>
|
|
|
+ <template #action="{ record }">
|
|
|
<TableAction
|
|
|
:actions="[
|
|
|
{
|
|
|
- icon: 'clarity:note-edit-line',
|
|
|
- label: t('common.operating'),
|
|
|
- onClick: () => {
|
|
|
- createMessage.info(`暂未接入`);
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
icon: 'ant-design:delete-outlined',
|
|
|
color: 'error',
|
|
|
label: t('common.delText'),
|
|
@@ -35,6 +28,14 @@
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
+ {
|
|
|
+ icon: 'clarity:unlink-line',
|
|
|
+ label: t('common.unbind'),
|
|
|
+ popConfirm: {
|
|
|
+ title: t('routes.corporation.isUnBind'),
|
|
|
+ confirm: handleUnbindDevice.bind(null, record),
|
|
|
+ },
|
|
|
+ },
|
|
|
]"
|
|
|
/>
|
|
|
</template>
|
|
@@ -48,9 +49,10 @@
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
import { Tag } from 'ant-design-vue';
|
|
|
import { useModal } from '/@/components/Modal';
|
|
|
- import { ListApi } from '/@/api/device/list';
|
|
|
+ import { ListApi, unDeviceApi } from '/@/api/device/list';
|
|
|
import AddModal from './AddModal.vue';
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
+ import { RoleEnum } from '/@/enums/roleEnum';
|
|
|
|
|
|
// param type 0
|
|
|
export default defineComponent({
|
|
@@ -103,6 +105,13 @@
|
|
|
slots: { customRender: 'own' },
|
|
|
width: 120,
|
|
|
},
|
|
|
+ {
|
|
|
+ title: t('common.operating'),
|
|
|
+ dataIndex: 'action',
|
|
|
+ slots: { customRender: 'action' },
|
|
|
+ auth: [RoleEnum.SUPER, RoleEnum.PLAT_ADMIN],
|
|
|
+ width: 140,
|
|
|
+ },
|
|
|
];
|
|
|
|
|
|
const searchForm: Partial<FormProps> = {
|
|
@@ -173,7 +182,13 @@
|
|
|
return searchData;
|
|
|
},
|
|
|
});
|
|
|
- // pagination.value = { pageSize: 20 };
|
|
|
+ async function handleUnbindDevice(record: Recordable) {
|
|
|
+ await unDeviceApi({
|
|
|
+ childName: record.childName,
|
|
|
+ });
|
|
|
+ createMessage.success(t('common.optSuccess'));
|
|
|
+ reload();
|
|
|
+ }
|
|
|
function rendercameraTypeLabel(cameraType: number): string {
|
|
|
switch (cameraType) {
|
|
|
case 4:
|
|
@@ -212,6 +227,7 @@
|
|
|
renderOwnTypeLabel,
|
|
|
registerAddModal,
|
|
|
openAddModal,
|
|
|
+ handleUnbindDevice,
|
|
|
t,
|
|
|
reload,
|
|
|
};
|