|
@@ -1,26 +1,27 @@
|
|
<template>
|
|
<template>
|
|
- <BasicTable @register="registerTable">
|
|
|
|
- <template #toolbar>
|
|
|
|
- <a-button type="primary" @click="deviceLink"> 设备关联</a-button>
|
|
|
|
- <a-button type="primary" @click="back">返回</a-button>
|
|
|
|
- </template>
|
|
|
|
- <template #action="{ record }">
|
|
|
|
- <TableAction
|
|
|
|
- stopButtonPropagation
|
|
|
|
- :actions="[
|
|
|
|
- {
|
|
|
|
- label: '解绑',
|
|
|
|
- color: 'error',
|
|
|
|
- popConfirm: {
|
|
|
|
- title: '是否解绑?',
|
|
|
|
- confirm: handleDelete.bind(null, record),
|
|
|
|
- placement: 'topLeft',
|
|
|
|
- },
|
|
|
|
- },
|
|
|
|
- ]"
|
|
|
|
- />
|
|
|
|
- </template>
|
|
|
|
- </BasicTable>
|
|
|
|
|
|
+ <PageWrapper contentBackground>
|
|
|
|
+ <div class="desc-wrap-BasicTable">
|
|
|
|
+ <BasicTable @register="registerTable">
|
|
|
|
+ <template #toolbar>
|
|
|
|
+ <a-button type="primary" @click="deviceLink"> 设备关联</a-button>
|
|
|
|
+ <a-button type="primary" @click="back">返回</a-button>
|
|
|
|
+ </template>
|
|
|
|
+ <template #action="{ record }">
|
|
|
|
+ <TableAction
|
|
|
|
+ stopButtonPropagation
|
|
|
|
+ :actions="[
|
|
|
|
+ {
|
|
|
|
+ label: '解绑',
|
|
|
|
+ color: 'error',
|
|
|
|
+ onClick: handleUnbind.bind(null, record),
|
|
|
|
+ },
|
|
|
|
+ ]"
|
|
|
|
+ />
|
|
|
|
+ </template>
|
|
|
|
+ </BasicTable>
|
|
|
|
+ </div>
|
|
|
|
+ <DeviceLinkModal @register="registerLinkModal" />
|
|
|
|
+ </PageWrapper>
|
|
</template>
|
|
</template>
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
import { defineComponent, h, reactive, toRefs, onMounted } from 'vue';
|
|
import { defineComponent, h, reactive, toRefs, onMounted } from 'vue';
|
|
@@ -39,7 +40,8 @@
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
import { cameraList } from '/@/api/customer';
|
|
import { cameraList } from '/@/api/customer';
|
|
import { message } from 'ant-design-vue';
|
|
import { message } from 'ant-design-vue';
|
|
-
|
|
|
|
|
|
+ import DeviceLinkModal from './modal/DeviceLinkModal.vue';
|
|
|
|
+ import { useModal } from '/@/components/Modal';
|
|
import { useRouter } from 'vue-router';
|
|
import { useRouter } from 'vue-router';
|
|
export default defineComponent({
|
|
export default defineComponent({
|
|
components: {
|
|
components: {
|
|
@@ -47,12 +49,14 @@
|
|
TableAction,
|
|
TableAction,
|
|
PageWrapper,
|
|
PageWrapper,
|
|
TableImg,
|
|
TableImg,
|
|
|
|
+ DeviceLinkModal,
|
|
[Descriptions.name]: Descriptions,
|
|
[Descriptions.name]: Descriptions,
|
|
[Descriptions.Item.name]: Descriptions.Item,
|
|
[Descriptions.Item.name]: Descriptions.Item,
|
|
},
|
|
},
|
|
setup() {
|
|
setup() {
|
|
const { t } = useI18n();
|
|
const { t } = useI18n();
|
|
const { createMessage, createConfirm } = useMessage();
|
|
const { createMessage, createConfirm } = useMessage();
|
|
|
|
+ const [registerLinkModal, { openModal: openLinkModal }] = useModal();
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
const companyId: Number = router.currentRoute.value.params.id - 0;
|
|
const companyId: Number = router.currentRoute.value.params.id - 0;
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
@@ -200,43 +204,54 @@
|
|
},
|
|
},
|
|
canResize: false,
|
|
canResize: false,
|
|
});
|
|
});
|
|
- async function handleDelete(record: Recordable) {
|
|
|
|
|
|
+ async function handleUnbind(record: Recordable) {
|
|
console.log('handleDelete', record);
|
|
console.log('handleDelete', record);
|
|
|
|
|
|
- sceneDelete({ num: record.num })
|
|
|
|
- .then(() => {
|
|
|
|
- message.success({
|
|
|
|
- content: '删除成功',
|
|
|
|
- });
|
|
|
|
|
|
+ // sceneDelete({ num: record.num })
|
|
|
|
+ // .then(() => {
|
|
|
|
+ // message.success({
|
|
|
|
+ // content: '删除成功',
|
|
|
|
+ // });
|
|
|
|
|
|
- reload();
|
|
|
|
- })
|
|
|
|
- .catch(() => {
|
|
|
|
- message.success({
|
|
|
|
- content: '删除失败',
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
+ // reload();
|
|
|
|
+ // })
|
|
|
|
+ // .catch(() => {
|
|
|
|
+ // message.success({
|
|
|
|
+ // content: '删除失败',
|
|
|
|
+ // });
|
|
|
|
+ // });
|
|
|
|
|
|
- function deviceLink() {
|
|
|
|
createConfirm({
|
|
createConfirm({
|
|
iconType: 'warning',
|
|
iconType: 'warning',
|
|
title: () => h('span', '温馨提示'),
|
|
title: () => h('span', '温馨提示'),
|
|
- content: () => h('span', '确定当前标签下的订单记录?'),
|
|
|
|
|
|
+ content: '解绑后用户将看不到该相机拍摄的场景。<br/>确定解绑吗?',
|
|
onOk: async () => {
|
|
onOk: async () => {
|
|
// await DownExport();
|
|
// await DownExport();
|
|
},
|
|
},
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ function deviceLink() {
|
|
|
|
+ openLinkModal(true);
|
|
|
|
+ }
|
|
function back() {
|
|
function back() {
|
|
router.push('/customer/index');
|
|
router.push('/customer/index');
|
|
}
|
|
}
|
|
return {
|
|
return {
|
|
registerTable,
|
|
registerTable,
|
|
- handleDelete,
|
|
|
|
|
|
+ handleUnbind,
|
|
deviceLink,
|
|
deviceLink,
|
|
|
|
+ registerLinkModal,
|
|
back,
|
|
back,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
});
|
|
});
|
|
</script>
|
|
</script>
|
|
|
|
+<style lang="less" scoped>
|
|
|
|
+ .desc-wrap-BasicTable {
|
|
|
|
+ background-color: #f0f2f5;
|
|
|
|
+ .vben-basic-table-form-container {
|
|
|
|
+ padding: 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+</style>
|