Browse Source

refactor: 推送模块

master
wangxiang 2 years ago
parent
commit
4efa19136b
  1. 0
      src/views/common/push/pushChatMessage/index.vue
  2. 0
      src/views/common/push/pushChatMessage/message.data.ts
  3. 0
      src/views/common/push/pushConcern/UserManageModal.vue
  4. 0
      src/views/common/push/pushConcern/index.vue
  5. 0
      src/views/common/push/pushConcern/userManage.data.ts
  6. 0
      src/views/common/push/pushEnterprise/ThirdPartyModal.vue
  7. 0
      src/views/common/push/pushEnterprise/index.vue
  8. 0
      src/views/common/push/pushEnterprise/thirdParty.data.ts
  9. 0
      src/views/common/push/pushEnterpriseAudit/ThirdPartyModal.vue
  10. 0
      src/views/common/push/pushEnterpriseAudit/index.vue
  11. 0
      src/views/common/push/pushEnterpriseAudit/thirdParty.data.ts
  12. 34
      src/views/common/push/pushFan/UserManageModal.vue
  13. 41
      src/views/common/push/pushFan/index.vue
  14. 0
      src/views/common/push/pushFan/userManage.data.ts
  15. 0
      src/views/common/push/pushFriendAudit/UserManageModal.vue
  16. 0
      src/views/common/push/pushFriendAudit/index.vue
  17. 132
      src/views/common/push/pushFriendAudit/userManage.data.ts
  18. 0
      src/views/common/push/pushRingtone/file.data.ts
  19. 0
      src/views/common/push/pushRingtone/index.vue
  20. 71
      src/views/common/push/pushWhitelist/passList.data.ts
  21. 2
      src/views/system/user/account/setting/entCertification/Step1.vue
  22. 2
      src/views/system/user/account/setting/entCertification/Step3.vue

0
src/views/common/push/pushMessage/index.vue → src/views/common/push/pushChatMessage/index.vue

0
src/views/common/push/pushMessage/message.data.ts → src/views/common/push/pushChatMessage/message.data.ts

0
src/views/common/push/pushUserManage/UserManageModal.vue → src/views/common/push/pushConcern/UserManageModal.vue

0
src/views/common/push/pushUserManage/index.vue → src/views/common/push/pushConcern/index.vue

0
src/views/common/push/pushTodoUserManage/userManage.data.ts → src/views/common/push/pushConcern/userManage.data.ts

0
src/views/common/push/pushThirdParty/ThirdPartyModal.vue → src/views/common/push/pushEnterprise/ThirdPartyModal.vue

0
src/views/common/push/pushThirdParty/index.vue → src/views/common/push/pushEnterprise/index.vue

0
src/views/common/push/pushThirdParty/thirdParty.data.ts → src/views/common/push/pushEnterprise/thirdParty.data.ts

0
src/views/common/push/pushTodoThirdParty/ThirdPartyModal.vue → src/views/common/push/pushEnterpriseAudit/ThirdPartyModal.vue

0
src/views/common/push/pushTodoThirdParty/index.vue → src/views/common/push/pushEnterpriseAudit/index.vue

0
src/views/common/push/pushTodoThirdParty/thirdParty.data.ts → src/views/common/push/pushEnterpriseAudit/thirdParty.data.ts

34
src/views/common/push/pushWhitelist/PassListModal.vue → src/views/common/push/pushFan/UserManageModal.vue

@ -9,19 +9,19 @@
</BasicModal> </BasicModal>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
/** /**
* 提供模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 * 提供模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致
* 采用vben-动态表格表单封装组件编写,采用 setup 写法 * 采用vben-动态表格表单封装组件编写,采用 setup 写法
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. * Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-王翔 * author entfrm开发团队-王翔
*/ */
import {ref, unref} from 'vue'; import { ref, unref } from 'vue';
import {BasicForm, useForm} from '/@/components/Form/index'; import { BasicForm, useForm } from '/@/components/Form/index';
import {formSchema} from './passList.data'; import { formSchema } from './userManage.data';
import {addPushPassList, editPushPassList, getPushPassList} from '/@/api/platform/common/controller/pushPassList'; import { addPushUserManage, editPushUserManage, getPushUserManage } from '/@/api/platform/common/controller/pushUserManage';
import {BasicModal, ModalProps, useModalInner} from '/@/components/Modal'; import { BasicModal, ModalProps, useModalInner } from '/@/components/Modal';
/** 通用变量统一声明区域 */ /** 通用变量统一声明区域 */
const tag = ref<Nullable<string>>(''); const tag = ref<Nullable<string>>('');
/** https://v3.cn.vuejs.org/api/options-data.html#emits */ /** https://v3.cn.vuejs.org/api/options-data.html#emits */
const emit = defineEmits(['success', 'register']); const emit = defineEmits(['success', 'register']);
@ -42,11 +42,11 @@ import {BasicModal, ModalProps, useModalInner} from '/@/components/Modal';
// tag // tag
switch (unref(tag)) { switch (unref(tag)) {
case 'add': case 'add':
props.title = '新增白名单'; props.title = '新增推送';
break; break;
case 'edit': case 'edit':
props.title = '编辑白名单'; props.title = '编辑推送';
await setFieldsValue(await getPushPassList(refId)); await setFieldsValue(await getPushUserManage(refId));
break; break;
} }
// : // :
@ -63,10 +63,10 @@ import {BasicModal, ModalProps, useModalInner} from '/@/components/Modal';
// tag // tag
switch (unref(tag)) { switch (unref(tag)) {
case 'add': case 'add':
await addPushPassList(formData); await addPushUserManage(formData);
break; break;
case 'edit': case 'edit':
await editPushPassList(formData); await editPushUserManage(formData);
break; break;
} }
// //

41
src/views/common/push/pushWhitelist/index.vue → src/views/common/push/pushFan/index.vue

@ -7,20 +7,26 @@
<template #toolbar> <template #toolbar>
<!--<a-button type="primary" <!--<a-button type="primary"
@click="handleAdd()" @click="handleAdd()"
>新增白名单</a-button> >新增推送</a-button>-->
<a-button type="primary" <a-button
:disabled="state.single" type="primary"
@click="handleEdit()" :disabled="state.single"
>修改白名单</a-button>--> @click="handleEdit()"
>修改推送</a-button>
<a-button <a-button
type="primary" type="primary"
:disabled="state.multiple" :disabled="state.multiple"
@click="handleDel()" @click="handleDel()"
>移除白名单</a-button> >移除推送</a-button>
</template> </template>
<template #action="{ record }"> <template #action="{ record }">
<TableAction <TableAction
:actions="[ :actions="[
{
label: '编辑',
icon: 'fa6-regular:pen-to-square',
onClick: handleEdit.bind(null, record)
},
{ {
label: '移除', label: '移除',
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
@ -31,7 +37,7 @@
</template> </template>
</BasicTable> </BasicTable>
<!--弹出窗体区域--> <!--弹出窗体区域-->
<PassListModal @register="registerModal" @success="handleRefreshTable"/> <UserManageModal @register="registerModal" @success="handleRefreshTable"/>
</div> </div>
</template> </template>
@ -44,11 +50,15 @@
*/ */
import { reactive, toRaw } from 'vue'; import { reactive, toRaw } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table'; import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { listPushPassList, delPushPassList } from '/@/api/platform/common/controller/pushPassList'; import { listPushUserManage, delPushUserManage } from '/@/api/platform/common/controller/pushUserManage';
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import PassListModal from './PassListModal.vue'; import UserManageModal from './UserManageModal.vue';
import { columns, searchFormSchema } from './passList.data'; import { columns, searchFormSchema } from './userManage.data';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';
import {useUserStore} from '/@/store/modules/user';
const userStore = useUserStore();
const userInfoStore = userStore.getUserInfo;
/** 类型规范统一声明定义区域 */ /** 类型规范统一声明定义区域 */
interface TableState { interface TableState {
@ -66,13 +76,13 @@
const { createConfirm, createMessage } = useMessage(); const { createConfirm, createMessage } = useMessage();
const [registerModal, { openModal }] = useModal(); const [registerModal, { openModal }] = useModal();
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({ const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({
title: '白名单列表', title: '推送列表',
api: listPushPassList, api: listPushUserManage,
rowKey: 'id', rowKey: 'id',
columns, columns,
formConfig: { formConfig: {
compact: true, compact: true,
labelWidth: 100, labelWidth: 80,
schemas: searchFormSchema, schemas: searchFormSchema,
autoSubmitOnEnter: true, autoSubmitOnEnter: true,
showAdvancedButton: true, showAdvancedButton: true,
@ -92,7 +102,8 @@
fixed: false fixed: false
}, },
searchInfo: { searchInfo: {
type: '1' status: '1',
fromUserId: userInfoStore.id
}, },
handleSearchInfoFn: () => clearSelectedRowKeys() handleSearchInfoFn: () => clearSelectedRowKeys()
}); });
@ -123,7 +134,7 @@
title: '警告', title: '警告',
content: `是否确认移除编号为${ids}的数据?`, content: `是否确认移除编号为${ids}的数据?`,
onOk: async () => { onOk: async () => {
await delPushPassList(ids); await delPushUserManage(ids);
createMessage.success('移除成功!'); createMessage.success('移除成功!');
handleRefreshTable(); handleRefreshTable();
} }

0
src/views/common/push/pushUserManage/userManage.data.ts → src/views/common/push/pushFan/userManage.data.ts

0
src/views/common/push/pushTodoUserManage/UserManageModal.vue → src/views/common/push/pushFriendAudit/UserManageModal.vue

0
src/views/common/push/pushTodoUserManage/index.vue → src/views/common/push/pushFriendAudit/index.vue

132
src/views/common/push/pushFriendAudit/userManage.data.ts

@ -0,0 +1,132 @@
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
/** 表格列配置 */
export const columns: BasicColumn[] = [
{
title: '名称',
dataIndex: 'userName'
},
{
title: '是否播放声音',
dataIndex: 'playSound',
customRender: ({record}) => {
return ~~record?.playSound === 0 ? '是' : '否';
}
},
{
title: '是否震动',
dataIndex: 'playVibrate',
customRender: ({record}) => {
return ~~record?.playVibrate === 0 ? '是' : '否';
}
},
{
title: '是否闪光',
dataIndex: 'playLights',
customRender: ({record}) => {
return ~~record?.playLights === 0 ? '是' : '否';
}
},
{
title: '创建人',
dataIndex: 'createByName'
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 200
}
];
/** 搜索表单配置 */
export const searchFormSchema: FormSchema[] = [
{
field: 'userName',
label: '名称',
component: 'Input',
componentProps: {
placeholder: '请输入名称',
},
colProps: { span: 6 }
}
];
/** 表单配置 */
export const formSchema: FormSchema[] = [
{
field: 'id',
label: 'ID',
component: 'Input',
show: false
},
{
field: 'toUserId',
label: '对方用户id',
component: 'Input',
show: false
},
{
field: 'fromUserId',
label: '发送方用户id',
component: 'Input',
show: false
},
{
field: 'userName',
label: '名称',
component: 'Input',
required: true,
componentProps: {
disabled: true
},
},
{
field: 'playSound',
label: '是否播放声音',
component: 'RadioGroup',
required: true,
defaultValue: '0',
componentProps: {
options: [
{ label: '是', value: '0' },
{ label: '否', value: '1' }
]
},
colProps: {
span: 12
}
},
{
field: 'playVibrate',
label: '是否震动',
component: 'RadioGroup',
required: true,
defaultValue: '0',
componentProps: {
options: [
{ label: '是', value: '0' },
{ label: '否', value: '1' }
]
},
colProps: {
span: 12
}
},
{
field: 'playLights',
label: '是否闪光',
component: 'RadioGroup',
required: true,
defaultValue: '0',
componentProps: {
options: [
{ label: '是', value: '0' },
{ label: '否', value: '1' }
]
},
colProps: {
span: 12
}
},
];

0
src/views/common/push/pushFile/file.data.ts → src/views/common/push/pushRingtone/file.data.ts

0
src/views/common/push/pushFile/index.vue → src/views/common/push/pushRingtone/index.vue

71
src/views/common/push/pushWhitelist/passList.data.ts

@ -1,71 +0,0 @@
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
/** 表格列配置 */
export const columns: BasicColumn[] = [
{
title: '发送方用户id',
dataIndex: 'fromPushId'
},
{
title: '对方用户id',
dataIndex: 'toPushId'
},
{
title: '创建人',
dataIndex: 'createByName'
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 200
}
];
/** 搜索表单配置 */
export const searchFormSchema: FormSchema[] = [
{
field: 'fromPushId',
label: '发送方用户id',
component: 'Input',
componentProps: {
placeholder: '请输入发送方用户id',
},
colProps: { span: 6 }
}
];
/** 表单配置 */
export const formSchema: FormSchema[] = [
{
field: 'id',
label: 'ID',
component: 'Input',
show: false
},
{
field: 'type',
label: '白名单类型',
component: 'Input',
defaultValue: '1',
show: false
},
{
field: 'fromPushId',
label: '发送方用户id',
component: 'Input',
required: true,
colProps: {
span: 24
}
},
{
field: 'toPushId',
label: '对方用户id',
component: 'Input',
required: true,
colProps: {
span: 24
}
},
];

2
src/views/system/user/account/setting/entCertification/Step1.vue

@ -6,7 +6,7 @@
<script lang="ts"> <script lang="ts">
import { defineComponent, ref, unref } from 'vue'; import { defineComponent, ref, unref } from 'vue';
import { BasicForm, useForm } from '/@/components/Form'; import { BasicForm, useForm } from '/@/components/Form';
import { formSchema } from '/@/views/common/push/pushThirdParty/thirdParty.data'; import { formSchema } from '/@/views/common/push/pushEnterprise/thirdParty.data';
import { addPushThirdParty } from '/@/api/platform/common/controller/pushThirdParty'; import { addPushThirdParty } from '/@/api/platform/common/controller/pushThirdParty';
import { useMessage } from '/@/hooks/web/useMessage'; import { useMessage } from '/@/hooks/web/useMessage';

2
src/views/system/user/account/setting/entCertification/Step3.vue

@ -12,7 +12,7 @@
import { Result } from 'ant-design-vue'; import { Result } from 'ant-design-vue';
const AResult = Result; const AResult = Result;
import { useModal } from '/@/components/Modal'; import { useModal } from '/@/components/Modal';
import ThirdPartyModal from '/@/views/common/push/pushThirdParty/ThirdPartyModal.vue'; import ThirdPartyModal from '/@/views/common/push/pushEnterprise/ThirdPartyModal.vue';
import { useUserStore } from '/@/store/modules/user'; import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore(); const userStore = useUserStore();

Loading…
Cancel
Save