|
@@ -2,43 +2,8 @@
|
|
|
<PageWrapper contentBackground>
|
|
|
<div class="desc-wrap-BasicTable">
|
|
|
<BasicTable @register="registerTable">
|
|
|
- <!--<template #toolbar>
|
|
|
- <a-button type="primary" @click="put" v-if="getCheckPerm('device-in')"> 入库</a-button>
|
|
|
- <a-button type="primary" @click="batchPut" v-if="getCheckPerm('device-all-in')"> 批量入库</a-button>
|
|
|
- <a-button type="primary" @click="batchOutflow" v-if="getCheckPerm('device-all-out')">批量出库</a-button>
|
|
|
- </template>
|
|
|
- <template #action="{ record }">
|
|
|
- <TableAction
|
|
|
- stopButtonPropagation
|
|
|
- :actions="[
|
|
|
- {
|
|
|
- label: '删除',
|
|
|
- color: 'error',
|
|
|
- ifShow: getCheckPerm('device-delete') && !(Boolean(record.outType) || Boolean(record.userName)),
|
|
|
- onClick: handleDelete.bind(null, record),
|
|
|
- },{
|
|
|
- label: '出库',
|
|
|
- ifShow: getCheckPerm('device-out') && !Boolean(record.outType),
|
|
|
- onClick: handleCheckout.bind(null, record),
|
|
|
- },{
|
|
|
- label: '编辑',
|
|
|
- ifShow: getCheckPerm('device-update') && Boolean(record.outType),
|
|
|
- onClick: handleEdit.bind(null, record),
|
|
|
- },{
|
|
|
- label: '解绑',
|
|
|
- ifShow: getCheckPerm('device-unbind') && Boolean(record.userName),
|
|
|
- color: 'error',
|
|
|
- onClick: handleUnbind.bind(null, record),
|
|
|
- },
|
|
|
- ]"
|
|
|
- />
|
|
|
- </template> -->
|
|
|
</BasicTable>
|
|
|
</div>
|
|
|
- <!-- <batchOutflowModal @register="registerLinkModal" @reload="reload" />
|
|
|
- <detailModal @register="register" @reload="reload" />
|
|
|
- <batchPutModal @register="registerPut" @reload="reload" />
|
|
|
- <PutModal @register="registerEnter" @reload="reload" /> -->
|
|
|
</PageWrapper>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
@@ -56,12 +21,7 @@
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
import { cameraList } from '/@/api/customer';
|
|
|
- import { cameraDelete } from '/@/api/device'
|
|
|
- // import batchOutflowModal from './OutflowModal.vue';
|
|
|
- // import detailModal from './detailsMoadl.vue';
|
|
|
- // import batchPutModal from './batchPutModal.vue';
|
|
|
- // import PutModal from './putModal.vue';
|
|
|
- import { useModal } from '/@/components/Modal';
|
|
|
+ import { cameraDelete } from '/@/api/device';
|
|
|
import { useRouter } from 'vue-router';
|
|
|
import { UnbindCameraApi } from '/@/api/account';
|
|
|
import { usePermissionStore } from '/@/store/modules/permission';
|
|
@@ -71,10 +31,6 @@
|
|
|
TableAction,
|
|
|
PageWrapper,
|
|
|
TableImg,
|
|
|
- // batchOutflowModal,
|
|
|
- // detailModal,
|
|
|
- // batchPutModal,
|
|
|
- // PutModal,
|
|
|
[Descriptions.name]: Descriptions,
|
|
|
[Descriptions.Item.name]: Descriptions.Item,
|
|
|
},
|
|
@@ -83,10 +39,6 @@
|
|
|
const { createMessage, createConfirm } = useMessage();
|
|
|
const permissionStore = usePermissionStore();
|
|
|
const { getCheckPerm } = permissionStore;
|
|
|
- // const [registerLinkModal, { openModal: openLinkModal }] = useModal();
|
|
|
- // const [register, { openModal }] = useModal();
|
|
|
- // const [registerPut, { openModal:openModalPut }] = useModal();
|
|
|
- // const [registerEnter, { openModal:openModalEnter }] = useModal();
|
|
|
const router = useRouter();
|
|
|
const companyId: Number = router.currentRoute.value.params.id - 0;
|
|
|
onMounted(() => {
|
|
@@ -94,68 +46,57 @@
|
|
|
});
|
|
|
const columns: BasicColumn[] = [
|
|
|
{
|
|
|
- title: 'SN码',
|
|
|
+ title: t('routes.device.snCode'),
|
|
|
dataIndex: 'snCode',
|
|
|
width: 180,
|
|
|
},
|
|
|
{
|
|
|
- title: 'wifi名称',
|
|
|
+ title: t('routes.device.wifiName'),
|
|
|
dataIndex: 'wifiName',
|
|
|
width: 150,
|
|
|
},
|
|
|
{
|
|
|
- title: '设备类型',
|
|
|
+ title: t('routes.device.deviceType'),
|
|
|
dataIndex: 'type',
|
|
|
ellipsis: false,
|
|
|
width: 80,
|
|
|
customRender: ({ record }) => {
|
|
|
let typeObj ={
|
|
|
- '0':'旧双目相机',
|
|
|
- '1':'四维看看',
|
|
|
- '2':'四维看看lite',
|
|
|
- '9':'四维看见',
|
|
|
- '10':'四维深时',
|
|
|
+ '0':t('routes.device.type.0'),
|
|
|
+ '1':t('routes.device.type.1'),
|
|
|
+ '2':t('routes.device.type.2'),
|
|
|
+ '9':t('routes.device.type.9'),
|
|
|
+ '10':t('routes.device.type.10'),
|
|
|
}
|
|
|
return typeObj[record.type]
|
|
|
}
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- title: '出库时间',
|
|
|
+ title: t('routes.device.activatedTime'),
|
|
|
dataIndex: 'activatedTime',
|
|
|
width: 180,
|
|
|
},
|
|
|
{
|
|
|
- title: '绑定账号',
|
|
|
+ title: t('routes.device.activatedTime'),
|
|
|
dataIndex: 'userName',
|
|
|
width: 180,
|
|
|
customRender({ record }) {
|
|
|
- return record.userName?record.userName:'未绑定'
|
|
|
+ return record.userName?record.userName:t('routes.device.activatedTime')
|
|
|
},
|
|
|
},
|
|
|
- {
|
|
|
- title: '操作',
|
|
|
- dataIndex: 'action',
|
|
|
- slots: { customRender: 'action' },
|
|
|
- ifShow: true,
|
|
|
- fixed: 'right',
|
|
|
- flag: 'ACTION',
|
|
|
- width: 120,
|
|
|
- },
|
|
|
];
|
|
|
const searchForm: Partial<FormProps> = {
|
|
|
labelWidth: 80,
|
|
|
- // showAdvancedButton: true,
|
|
|
autoAdvancedLine:1,
|
|
|
actionColOptions: {
|
|
|
span: 24,
|
|
|
},
|
|
|
- // compact: true,
|
|
|
schemas: [
|
|
|
{
|
|
|
field: 'snCode',
|
|
|
component: 'Input',
|
|
|
- label: 'SN码',
|
|
|
+ label: t('routes.device.snCode'),
|
|
|
colProps: {
|
|
|
xl: 6,
|
|
|
xxl: 6,
|
|
@@ -163,7 +104,7 @@
|
|
|
},{
|
|
|
field: 'type',
|
|
|
component: 'Select',
|
|
|
- label: '设备类型',
|
|
|
+ label: t('routes.device.deviceType'),
|
|
|
colProps: {
|
|
|
xl: 6,
|
|
|
xxl: 6,
|
|
@@ -171,19 +112,19 @@
|
|
|
componentProps: {
|
|
|
options: [
|
|
|
{
|
|
|
- label: t('routes.product.type.0'),
|
|
|
+ label: t('routes.device.type.0'),
|
|
|
value: 0,
|
|
|
key: '0',
|
|
|
},{
|
|
|
- label: t('routes.product.type.1'),
|
|
|
+ label: t('routes.device.type.1'),
|
|
|
value: 1,
|
|
|
key: '1',
|
|
|
},{
|
|
|
- label: t('routes.product.type.2'),
|
|
|
+ label: t('routes.device.type.2'),
|
|
|
value: 9,
|
|
|
key: '9',
|
|
|
},{
|
|
|
- label: t('routes.product.type.3'),
|
|
|
+ label: t('routes.device.type.3'),
|
|
|
value: 10,
|
|
|
key: '10',
|
|
|
},
|
|
@@ -193,7 +134,7 @@
|
|
|
{
|
|
|
field: 'userName',
|
|
|
component: 'Input',
|
|
|
- label: '绑定账号',
|
|
|
+ label: t('routes.device.userName'),
|
|
|
colProps: {
|
|
|
xl: 6,
|
|
|
xxl: 6,
|
|
@@ -203,10 +144,7 @@
|
|
|
};
|
|
|
const [registerTable, { reload }] = useTable({
|
|
|
api: cameraList,
|
|
|
- // title: '四维深时场景列表',
|
|
|
- // titleHelpMessage: ['已启用expandRowByClick', '已启用stopButtonPropagation'],
|
|
|
columns: columns,
|
|
|
- // rowSelection: { type: 'checkbox',onChange: onSelectChange },
|
|
|
searchInfo: { companyId },
|
|
|
useSearchForm: true,
|
|
|
formConfig: searchForm,
|
|
@@ -231,7 +169,7 @@
|
|
|
async function handleUnbind(record: Recordable) {
|
|
|
createConfirm({
|
|
|
iconType: 'warning',
|
|
|
- title: () => h('span', '温馨提示'),
|
|
|
+ title: () => h('span', t('common.optSuccess')),
|
|
|
content: '解绑后用户将看不到该相机拍摄的场景。<br/>确定解绑吗?',
|
|
|
onOk: async () => {
|
|
|
await UnbindCameraApi({cameraId:record.id})
|
|
@@ -243,7 +181,7 @@
|
|
|
async function handleDelete(record: Recordable){
|
|
|
createConfirm({
|
|
|
iconType: 'warning',
|
|
|
- title: () => h('span', '温馨提示'),
|
|
|
+ title: () => h('span', t('common.optSuccess')),
|
|
|
content: '删除设备后需要重新入库<br/>确定删除吗?',
|
|
|
onOk: async () => {
|
|
|
await cameraDelete({id:record.id})
|
|
@@ -252,46 +190,9 @@
|
|
|
},
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
- // function deviceLink() {
|
|
|
- // openLinkModal(true);
|
|
|
- // }
|
|
|
- // function handleCheckout(record: Recordable) {
|
|
|
- // openModal(true, {
|
|
|
- // ...record,
|
|
|
- // isUpdate: false,
|
|
|
- // });
|
|
|
- // }
|
|
|
- // function handleEdit(record: Recordable) {
|
|
|
- // openModal(true, {
|
|
|
- // ...record,
|
|
|
- // isUpdate: true,
|
|
|
- // });
|
|
|
- // }
|
|
|
- // function put() {
|
|
|
- // openModalEnter(true)
|
|
|
- // }
|
|
|
- // function batchPut() {
|
|
|
- // console.log('批量入库');
|
|
|
- // openModalPut(true, {})
|
|
|
- // }
|
|
|
- // function batchOutflow() {
|
|
|
- // console.log('批量出库');
|
|
|
- // openLinkModal(true, {})
|
|
|
- // }
|
|
|
return {
|
|
|
registerTable,
|
|
|
handleUnbind,
|
|
|
- // deviceLink,
|
|
|
- // registerLinkModal,
|
|
|
- // register,
|
|
|
- // registerEnter,
|
|
|
- // put,
|
|
|
- // batchPut,
|
|
|
- // batchOutflow,
|
|
|
- // handleEdit,
|
|
|
- // handleCheckout,
|
|
|
- // registerPut,
|
|
|
reload,
|
|
|
handleDelete,
|
|
|
getCheckPerm,
|