|
@@ -3,7 +3,7 @@
|
|
<div class="desc-wrap-BasicTable">
|
|
<div class="desc-wrap-BasicTable">
|
|
<BasicTable @register="registerTable">
|
|
<BasicTable @register="registerTable">
|
|
<template #toolbar>
|
|
<template #toolbar>
|
|
- <a-button type="primary" @click="handleAdd"> {{t('routes.retailer.allff')}}</a-button>
|
|
|
|
|
|
+ <a-button type="primary" v-if="hasPermission([RoleEnum.SUPER])" @click="handleAdd"> {{t('routes.retailer.allff')}}</a-button>
|
|
</template>
|
|
</template>
|
|
<template #action="{ record }">
|
|
<template #action="{ record }">
|
|
<TableAction
|
|
<TableAction
|
|
@@ -11,9 +11,16 @@
|
|
:actions="[
|
|
:actions="[
|
|
{
|
|
{
|
|
label: t('routes.retailer.ff'),
|
|
label: t('routes.retailer.ff'),
|
|
|
|
+ ifShow: !record.subAgentName,
|
|
//icon: 'la:file-invoice-dollar',
|
|
//icon: 'la:file-invoice-dollar',
|
|
onClick: headleDetails.bind(null, record),
|
|
onClick: headleDetails.bind(null, record),
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ label: t('routes.retailer.Unbind'),
|
|
|
|
+ ifShow: !!record.subAgentName,
|
|
|
|
+ //icon: 'la:file-invoice-dollar',
|
|
|
|
+ onClick: headleUnbind.bind(null, record),
|
|
|
|
+ },
|
|
]"
|
|
]"
|
|
/>
|
|
/>
|
|
</template>
|
|
</template>
|
|
@@ -32,6 +39,8 @@
|
|
TableImg,
|
|
TableImg,
|
|
FormProps,
|
|
FormProps,
|
|
} from '/@/components/Table';
|
|
} from '/@/components/Table';
|
|
|
|
+ import { usePermission } from '/@/hooks/web/usePermission';
|
|
|
|
+ import { RoleEnum } from '/@/enums/roleEnum';
|
|
import { PageWrapper } from '/@/components/Page';
|
|
import { PageWrapper } from '/@/components/Page';
|
|
import { Descriptions } from 'ant-design-vue';
|
|
import { Descriptions } from 'ant-design-vue';
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
@@ -61,7 +70,7 @@
|
|
const { t } = useI18n();
|
|
const { t } = useI18n();
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
const getUserInfo = userStore.getUserInfo;
|
|
const getUserInfo = userStore.getUserInfo;
|
|
- console.log('getUserInfo', getUserInfo);
|
|
|
|
|
|
+ const { hasPermission } = usePermission();
|
|
const { createMessage, createConfirm } = useMessage();
|
|
const { createMessage, createConfirm } = useMessage();
|
|
const permissionStore = usePermissionStore();
|
|
const permissionStore = usePermissionStore();
|
|
const { getCheckPerm } = permissionStore;
|
|
const { getCheckPerm } = permissionStore;
|
|
@@ -110,7 +119,9 @@
|
|
{
|
|
{
|
|
title: t('routes.retailer.fxs'),
|
|
title: t('routes.retailer.fxs'),
|
|
dataIndex: 'subAgentName',
|
|
dataIndex: 'subAgentName',
|
|
- width: 120,
|
|
|
|
|
|
+ ellipsis: true,
|
|
|
|
+ width: 160,
|
|
|
|
+ ifShow: hasPermission([RoleEnum.SUPER]),
|
|
customRender({ record }) {
|
|
customRender({ record }) {
|
|
return record.subAgentName || '-';
|
|
return record.subAgentName || '-';
|
|
}
|
|
}
|
|
@@ -286,6 +297,7 @@
|
|
{
|
|
{
|
|
field: 'subAgentId',
|
|
field: 'subAgentId',
|
|
component: 'ApiSelect',
|
|
component: 'ApiSelect',
|
|
|
|
+ ifShow: hasPermission([RoleEnum.SUPER]),
|
|
label: t('routes.device.subAgentName'),
|
|
label: t('routes.device.subAgentName'),
|
|
componentProps: {
|
|
componentProps: {
|
|
maxLength: 50,
|
|
maxLength: 50,
|
|
@@ -325,20 +337,21 @@
|
|
totalField: 'total',
|
|
totalField: 'total',
|
|
},
|
|
},
|
|
actionColumn: {
|
|
actionColumn: {
|
|
- width: 100,
|
|
|
|
|
|
+ width: 150,
|
|
title: t('common.operating'),
|
|
title: t('common.operating'),
|
|
|
|
+ ifShow: hasPermission([RoleEnum.SUPER]),
|
|
dataIndex: 'action',
|
|
dataIndex: 'action',
|
|
slots: { customRender: 'action' },
|
|
slots: { customRender: 'action' },
|
|
},
|
|
},
|
|
canResize: false,
|
|
canResize: false,
|
|
});
|
|
});
|
|
- async function handleUnbind(record: Recordable) {
|
|
|
|
|
|
+ async function headleUnbind(record: Recordable) {
|
|
createConfirm({
|
|
createConfirm({
|
|
iconType: 'warning',
|
|
iconType: 'warning',
|
|
- title: () => h('span', t('common.optSuccess')),
|
|
|
|
- content: '解绑后用户将看不到该相机拍摄的场景。<br/>确定解绑吗?',
|
|
|
|
|
|
+ title: () => h('span', t('common.reminder')),
|
|
|
|
+ content: t('routes.retailer.UnbindTips'),
|
|
onOk: async () => {
|
|
onOk: async () => {
|
|
- await UnbindCameraApi({ cameraId: record.id });
|
|
|
|
|
|
+ await UnbindCameraApi({ id: record.id });
|
|
createMessage.success(t('common.optSuccess'));
|
|
createMessage.success(t('common.optSuccess'));
|
|
reload();
|
|
reload();
|
|
},
|
|
},
|
|
@@ -347,7 +360,7 @@
|
|
async function handleDelete(record: Recordable) {
|
|
async function handleDelete(record: Recordable) {
|
|
createConfirm({
|
|
createConfirm({
|
|
iconType: 'warning',
|
|
iconType: 'warning',
|
|
- title: () => h('span', t('common.optSuccess')),
|
|
|
|
|
|
+ title: () => h('span', t('common.reminder')),
|
|
content: '删除设备后需要重新入库<br/>确定删除吗?',
|
|
content: '删除设备后需要重新入库<br/>确定删除吗?',
|
|
onOk: async () => {
|
|
onOk: async () => {
|
|
await cameraDelete({ id: record.id });
|
|
await cameraDelete({ id: record.id });
|
|
@@ -364,13 +377,15 @@
|
|
}
|
|
}
|
|
return {
|
|
return {
|
|
registerTable,
|
|
registerTable,
|
|
- handleUnbind,
|
|
|
|
|
|
+ headleUnbind,
|
|
reload,
|
|
reload,
|
|
handleDelete,
|
|
handleDelete,
|
|
getCheckPerm,
|
|
getCheckPerm,
|
|
handleAdd,
|
|
handleAdd,
|
|
headleDetails,
|
|
headleDetails,
|
|
registerAddModal,
|
|
registerAddModal,
|
|
|
|
+ hasPermission,
|
|
|
|
+ RoleEnum,
|
|
t,
|
|
t,
|
|
};
|
|
};
|
|
},
|
|
},
|