|
|
|
@ -5,9 +5,9 @@
@@ -5,9 +5,9 @@
|
|
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
|
> |
|
|
|
|
<template #toolbar> |
|
|
|
|
<!--<a-button type="primary" |
|
|
|
|
<a-button type="primary" |
|
|
|
|
@click="handleAdd()" |
|
|
|
|
>新增第三方</a-button>--> |
|
|
|
|
>新增企业</a-button> |
|
|
|
|
<a-button |
|
|
|
|
type="primary" |
|
|
|
|
:disabled="state.single" |
|
|
|
@ -19,24 +19,9 @@
@@ -19,24 +19,9 @@
|
|
|
|
|
@click="handleDel()" |
|
|
|
|
>删除企业</a-button> |
|
|
|
|
</template> |
|
|
|
|
<template #action="{ record }"> |
|
|
|
|
<TableAction |
|
|
|
|
:actions="[ |
|
|
|
|
{ |
|
|
|
|
label: '加入黑名单', |
|
|
|
|
icon: 'fa6-regular:pen-to-square', |
|
|
|
|
onClick: handleBlacklist.bind(null, record) |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '加入白名单', |
|
|
|
|
icon: 'fa6-regular:pen-to-square', |
|
|
|
|
onClick: handleWhitelist.bind(null, record) |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '推送申请', |
|
|
|
|
icon: 'fa6-regular:pen-to-square', |
|
|
|
|
onClick: handlePushAdd.bind(null, record) |
|
|
|
|
}, |
|
|
|
|
<template #bodyCell="{ column, record }"> |
|
|
|
|
<template v-if="column.key === 'action'"> |
|
|
|
|
<TableAction :actions="[ |
|
|
|
|
{ |
|
|
|
|
label: '编辑', |
|
|
|
|
icon: 'fa6-regular:pen-to-square', |
|
|
|
@ -50,32 +35,22 @@
@@ -50,32 +35,22 @@
|
|
|
|
|
}]" |
|
|
|
|
/> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</BasicTable> |
|
|
|
|
<!--弹出窗体区域--> |
|
|
|
|
<ThirdPartyModal @register="registerModal" @success="handleRefreshTable"/> |
|
|
|
|
<EnterpriseModal @register="registerModal" @success="handleRefreshTable"/> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
/** |
|
|
|
|
* 提供模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 |
|
|
|
|
* 采用vben-动态表格表单封装组件编写,采用 setup 写法 |
|
|
|
|
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
|
|
|
|
* author entfrm开发团队-王翔 |
|
|
|
|
*/ |
|
|
|
|
import { reactive, toRaw } from 'vue'; |
|
|
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
|
|
|
|
import { listPushThirdParty, delPushThirdParty } from '/@/api/platform/common/controller/pushThirdParty'; |
|
|
|
|
import { listPushEnterprise, delPushEnterprise } from '/@/api/platform/common/controller/pushEnterprise'; |
|
|
|
|
import { useModal } from '/@/components/Modal'; |
|
|
|
|
import ThirdPartyModal from './ThirdPartyModal.vue'; |
|
|
|
|
import { columns, searchFormSchema } from './thirdParty.data'; |
|
|
|
|
import EnterpriseModal from './EnterpriseModal.vue'; |
|
|
|
|
import { columns, searchFormSchema } from './enterprise.data'; |
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
|
import { addPushPassList } from '/@/api/platform/common/controller/pushPassList'; |
|
|
|
|
import { addPushUserManage } from '/@/api/platform/common/controller/pushUserManage'; |
|
|
|
|
import {useUserStore} from '/@/store/modules/user'; |
|
|
|
|
|
|
|
|
|
const userStore = useUserStore(); |
|
|
|
|
const userInfoStore = userStore.getUserInfo; |
|
|
|
|
/** 类型规范统一声明定义区域 */ |
|
|
|
|
interface TableState { |
|
|
|
|
single: boolean; |
|
|
|
@ -93,7 +68,7 @@
@@ -93,7 +68,7 @@
|
|
|
|
|
const [registerModal, { openModal }] = useModal(); |
|
|
|
|
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({ |
|
|
|
|
title: '企业列表', |
|
|
|
|
api: listPushThirdParty, |
|
|
|
|
api: listPushEnterprise, |
|
|
|
|
rowKey: 'id', |
|
|
|
|
columns, |
|
|
|
|
formConfig: { |
|
|
|
@ -114,7 +89,6 @@
@@ -114,7 +89,6 @@
|
|
|
|
|
width: 450, |
|
|
|
|
title: '操作', |
|
|
|
|
dataIndex: 'action', |
|
|
|
|
slots: { customRender: 'action' }, |
|
|
|
|
fixed: false |
|
|
|
|
}, |
|
|
|
|
searchInfo: { |
|
|
|
@ -141,58 +115,6 @@
@@ -141,58 +115,6 @@
|
|
|
|
|
openModal(true, { _tag: 'edit', record }); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handleWhitelist(record?: Recordable) { |
|
|
|
|
createConfirm({ |
|
|
|
|
iconType: 'warning', |
|
|
|
|
title: '警告', |
|
|
|
|
content: `是否添加白名单编号为${record?.userId}的数据?`, |
|
|
|
|
onOk: async () => { |
|
|
|
|
await addPushPassList({ |
|
|
|
|
fromPushId: record?.userId, |
|
|
|
|
toPushId: userInfoStore.id, |
|
|
|
|
type: '1' |
|
|
|
|
}); |
|
|
|
|
createMessage.success('添加成功!'); |
|
|
|
|
handleRefreshTable(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handleBlacklist(record?: Recordable) { |
|
|
|
|
createConfirm({ |
|
|
|
|
iconType: 'warning', |
|
|
|
|
title: '警告', |
|
|
|
|
content: `是否添加黑名单编号为${record?.userId}的数据?`, |
|
|
|
|
onOk: async () => { |
|
|
|
|
await addPushPassList({ |
|
|
|
|
fromPushId: record?.userId, |
|
|
|
|
toPushId: userInfoStore.id, |
|
|
|
|
type: '0' |
|
|
|
|
}); |
|
|
|
|
createMessage.success('添加成功!'); |
|
|
|
|
handleRefreshTable(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function handlePushAdd(record?: Recordable) { |
|
|
|
|
createConfirm({ |
|
|
|
|
iconType: 'warning', |
|
|
|
|
title: '警告', |
|
|
|
|
content: `是否添加推送申请编号为${record?.userId}的数据?`, |
|
|
|
|
onOk: async () => { |
|
|
|
|
await addPushUserManage({ |
|
|
|
|
fromUserId: record?.userId, |
|
|
|
|
toUserId: userInfoStore.id, |
|
|
|
|
userName: record?.entName, |
|
|
|
|
type: '1' |
|
|
|
|
}); |
|
|
|
|
createMessage.success('申请成功!'); |
|
|
|
|
handleRefreshTable(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** 删除按钮操作,行内删除 */ |
|
|
|
|
async function handleDel(record?: Recordable) { |
|
|
|
|
const ids = record?.id || getSelectRowKeys(); |
|
|
|
@ -201,7 +123,7 @@
@@ -201,7 +123,7 @@
|
|
|
|
|
title: '警告', |
|
|
|
|
content: `是否确认删除编号为${ids}的数据?`, |
|
|
|
|
onOk: async () => { |
|
|
|
|
await delPushThirdParty(ids); |
|
|
|
|
await delPushEnterprise(ids); |
|
|
|
|
createMessage.success('删除成功!'); |
|
|
|
|
handleRefreshTable(); |
|
|
|
|
} |
|
|
|
|