Browse Source

🚀 push 模块编写

master
wangxiang 2 years ago
parent
commit
caf9c9d8e0
  1. 25
      src/api/platform/common/controller/pushBlacklist.ts
  2. 25
      src/api/platform/common/controller/pushCertification.ts
  3. 25
      src/api/platform/common/controller/pushCustomType.ts
  4. 25
      src/api/platform/common/controller/pushManage.ts
  5. 25
      src/api/platform/common/controller/pushPassList.ts
  6. 25
      src/api/platform/common/controller/pushThirdParty.ts
  7. 25
      src/api/platform/common/controller/pushThirdPartyManage.ts
  8. 25
      src/api/platform/common/controller/pushTodoAuth.ts
  9. 25
      src/api/platform/common/controller/pushType.ts
  10. 25
      src/api/platform/common/controller/pushUserManage.ts
  11. 25
      src/api/platform/common/controller/pushWhitelist.ts
  12. 3
      src/api/platform/common/entity/pushApplication.ts
  13. 11
      src/api/platform/common/entity/pushBlacklist.ts
  14. 21
      src/api/platform/common/entity/pushCertification.ts
  15. 15
      src/api/platform/common/entity/pushCustomType.ts
  16. 14
      src/api/platform/common/entity/pushManage.ts
  17. 13
      src/api/platform/common/entity/pushPassList.ts
  18. 19
      src/api/platform/common/entity/pushThirdParty.ts
  19. 16
      src/api/platform/common/entity/pushThirdPartyManage.ts
  20. 13
      src/api/platform/common/entity/pushTodoAuth.ts
  21. 12
      src/api/platform/common/entity/pushType.ts
  22. 18
      src/api/platform/common/entity/pushUserManage.ts
  23. 11
      src/api/platform/common/entity/pushWhitelist.ts
  24. 38
      src/views/common/push/application/application.data.ts
  25. 53
      src/views/common/push/blacklist/blacklist.data.ts
  26. 10
      src/views/common/push/pushCustomType/CustomTypeModal.vue
  27. 73
      src/views/common/push/pushCustomType/customType.data.ts
  28. 8
      src/views/common/push/pushCustomType/index.vue
  29. 89
      src/views/common/push/pushManage/PushManageModal.vue
  30. 106
      src/views/common/push/pushManage/index.vue
  31. 14
      src/views/common/push/pushPassList/PassListModal.vue
  32. 20
      src/views/common/push/pushPassList/index.vue
  33. 22
      src/views/common/push/pushPassList/passList.data.ts
  34. 16
      src/views/common/push/pushThirdParty/ThirdPartyModal.vue
  35. 20
      src/views/common/push/pushThirdParty/index.vue
  36. 93
      src/views/common/push/pushThirdParty/thirdParty.data.ts
  37. 14
      src/views/common/push/pushThirdPartyManage/ThirdPartyManageModal.vue
  38. 135
      src/views/common/push/pushThirdPartyManage/index.vue
  39. 126
      src/views/common/push/pushThirdPartyManage/thirdPartyManage.data.ts
  40. 14
      src/views/common/push/pushUserManage/UserManageModal.vue
  41. 20
      src/views/common/push/pushUserManage/index.vue
  42. 148
      src/views/common/push/pushUserManage/userManage.data.ts
  43. 89
      src/views/common/push/todoAuth/todoAuth.data.ts
  44. 135
      src/views/common/push/whitelist/index.vue
  45. 53
      src/views/common/push/whitelist/whitelist.data.ts

25
src/api/platform/common/controller/pushBlacklist.ts

@ -1,25 +0,0 @@ @@ -1,25 +0,0 @@
/**
* api模板规范代码参考,
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import type { PushBlacklist, PushBlacklistParams, PushBlacklistResult } from '/@/api/platform/common/entity/pushBlacklist';
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/common_proxy/common/pushCertification/list',
add = '/common_proxy/common/pushCertification/save',
get = '/common_proxy/common/pushCertification',
edit = '/common_proxy/common/pushCertification/update',
del = '/common_proxy/common/pushCertification/remove',
}
export const listPushBlacklist = (params?: Partial<PushBlacklistParams>) => defHttp.get<PushBlacklistResult>({ url: Api.list, params }, { isReturnResultResponse: true });
export const addPushBlacklist = (params: Partial<PushBlacklist>) => defHttp.post({ url: Api.add, data: params });
export const editPushBlacklist = (params: Partial<PushBlacklist>) => defHttp.put({ url: Api.edit, data: params });
export const getPushBlacklist = (id: string) => defHttp.get<PushBlacklist>({ url: `${Api.get}/${id}` });
export const delPushBlacklist = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` });

25
src/api/platform/common/controller/pushCertification.ts

@ -1,25 +0,0 @@ @@ -1,25 +0,0 @@
/**
* api模板规范代码参考,
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import type { PushCertification, PushCertificationParams, PushCertificationResult } from '/@/api/platform/common/entity/pushCertification';
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/common_proxy/common/pushCertification/list',
add = '/common_proxy/common/pushCertification/save',
get = '/common_proxy/common/pushCertification',
edit = '/common_proxy/common/pushCertification/update',
del = '/common_proxy/common/pushCertification/remove',
}
export const listPushCertification = (params?: Partial<PushCertificationParams>) => defHttp.get<PushCertificationResult>({ url: Api.list, params }, { isReturnResultResponse: true });
export const addPushCertification = (params: Partial<PushCertification>) => defHttp.post({ url: Api.add, data: params });
export const editPushCertification = (params: Partial<PushCertification>) => defHttp.put({ url: Api.edit, data: params });
export const getPushCertification = (id: string) => defHttp.get<PushCertification>({ url: `${Api.get}/${id}` });
export const delPushCertification = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` });

25
src/api/platform/common/controller/pushCustomType.ts

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
/**
* api模板规范代码参考,
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import type { PushCustomType, PushCustomTypeParams, PushCustomTypeResult } from '/@/api/platform/common/entity/pushCustomType';
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/common_proxy/common/pushCustomType/list',
add = '/common_proxy/common/pushCustomType/save',
get = '/common_proxy/common/pushCustomType',
edit = '/common_proxy/common/pushCustomType/update',
del = '/common_proxy/common/pushCustomType/remove',
}
export const listPushCustomType = (params?: Partial<PushCustomTypeParams>) => defHttp.get<PushCustomTypeResult>({ url: Api.list, params }, { isReturnResultResponse: true });
export const addPushCustomType = (params: Partial<PushCustomType>) => defHttp.post({ url: Api.add, data: params });
export const editPushCustomType = (params: Partial<PushCustomType>) => defHttp.put({ url: Api.edit, data: params });
export const getPushCustomType = (id: string) => defHttp.get<PushCustomType>({ url: `${Api.get}/${id}` });
export const delPushCustomType = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` });

25
src/api/platform/common/controller/pushManage.ts

@ -1,25 +0,0 @@ @@ -1,25 +0,0 @@
/**
* api模板规范代码参考,
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import type { PushManage, PushManageParams } from '/@/api/platform/common/entity/pushManage';
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/common_proxy/common/pushManage/list',
add = '/common_proxy/common/pushManage/save',
get = '/common_proxy/common/pushManage',
edit = '/common_proxy/common/pushManage/update',
del = '/common_proxy/common/pushManage/remove',
}
export const listPushManage = (params?: Partial<PushManageParams>) => defHttp.get({ url: Api.list, params });
export const addPushManage = (params: Partial<PushManage>) => defHttp.post({ url: Api.add, data: params });
export const editPushManage = (params: Partial<PushManage>) => defHttp.put({ url: Api.edit, data: params });
export const getPushManage = (id: string) => defHttp.get<PushManage>({ url: `${Api.get}/${id}` });
export const delPushManage = (id: string) => defHttp.delete({ url: `${Api.del}/${id}` });

25
src/api/platform/common/controller/pushPassList.ts

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
/**
* api模板规范代码参考,
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import type { PushPassList, PushPassListParams, PushPassListResult } from '/@/api/platform/common/entity/pushPassList';
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/common_proxy/common/pushPassList/list',
add = '/common_proxy/common/pushPassList/save',
get = '/common_proxy/common/pushPassList',
edit = '/common_proxy/common/pushPassList/update',
del = '/common_proxy/common/pushPassList/remove',
}
export const listPushPassList = (params?: Partial<PushPassListParams>) => defHttp.get<PushPassListResult>({ url: Api.list, params }, { isReturnResultResponse: true });
export const addPushPassList = (params: Partial<PushPassList>) => defHttp.post({ url: Api.add, data: params });
export const editPushPassList = (params: Partial<PushPassList>) => defHttp.put({ url: Api.edit, data: params });
export const getPushPassList = (id: string) => defHttp.get<PushPassList>({ url: `${Api.get}/${id}` });
export const delPushPassList = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` });

25
src/api/platform/common/controller/pushThirdParty.ts

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
/**
* api模板规范代码参考,
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import type { PushThirdParty, PushThirdPartyParams, PushThirdPartyResult } from '/@/api/platform/common/entity/pushThirdParty';
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/common_proxy/common/pushThirdParty/list',
add = '/common_proxy/common/pushThirdParty/save',
get = '/common_proxy/common/pushThirdParty',
edit = '/common_proxy/common/pushThirdParty/update',
del = '/common_proxy/common/pushThirdParty/remove',
}
export const listPushThirdParty = (params?: Partial<PushThirdPartyParams>) => defHttp.get<PushThirdPartyResult>({ url: Api.list, params }, { isReturnResultResponse: true });
export const addPushThirdParty = (params: Partial<PushThirdParty>) => defHttp.post({ url: Api.add, data: params });
export const editPushThirdParty = (params: Partial<PushThirdParty>) => defHttp.put({ url: Api.edit, data: params });
export const getPushThirdParty = (id: string) => defHttp.get<PushThirdParty>({ url: `${Api.get}/${id}` });
export const delPushThirdParty = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` });

25
src/api/platform/common/controller/pushThirdPartyManage.ts

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
/**
* api模板规范代码参考,
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import type { PushThirdPartyManage, PushThirdPartyManageParams, PushThirdPartyManageResult } from '/@/api/platform/common/entity/pushThirdPartyManage';
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/common_proxy/common/pushThirdPartyManage/list',
add = '/common_proxy/common/pushThirdPartyManage/save',
get = '/common_proxy/common/pushThirdPartyManage',
edit = '/common_proxy/common/pushThirdPartyManage/update',
del = '/common_proxy/common/pushThirdPartyManage/remove',
}
export const listPushThirdPartyManage = (params?: Partial<PushThirdPartyManageParams>) => defHttp.get<PushThirdPartyManageResult>({ url: Api.list, params }, { isReturnResultResponse: true });
export const addPushThirdPartyManage = (params: Partial<PushThirdPartyManage>) => defHttp.post({ url: Api.add, data: params });
export const editPushThirdPartyManage = (params: Partial<PushThirdPartyManage>) => defHttp.put({ url: Api.edit, data: params });
export const getPushThirdPartyManage = (id: string) => defHttp.get<PushThirdPartyManage>({ url: `${Api.get}/${id}` });
export const delPushThirdPartyManage = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` });

25
src/api/platform/common/controller/pushTodoAuth.ts

@ -1,25 +0,0 @@ @@ -1,25 +0,0 @@
/**
* api模板规范代码参考,
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import type { PushTodoAuth, PushTodoAuthParams, PushTodoAuthResult } from '/@/api/platform/common/entity/pushTodoAuth';
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/common_proxy/common/pushTodoAuth/list',
add = '/common_proxy/common/pushTodoAuth/save',
get = '/common_proxy/common/pushTodoAuth',
edit = '/common_proxy/common/pushTodoAuth/update',
del = '/common_proxy/common/pushTodoAuth/remove',
}
export const listPushTodoAuth = (params?: Partial<PushTodoAuthParams>) => defHttp.get<PushTodoAuthResult>({ url: Api.list, params }, { isReturnResultResponse: true });
export const addPushTodoAuth = (params: Partial<PushTodoAuth>) => defHttp.post({ url: Api.add, data: params });
export const editPushTodoAuth = (params: Partial<PushTodoAuth>) => defHttp.put({ url: Api.edit, data: params });
export const getPushTodoAuth = (id: string) => defHttp.get<PushTodoAuth>({ url: `${Api.get}/${id}` });
export const delPushTodoAuth = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` });

25
src/api/platform/common/controller/pushType.ts

@ -1,25 +0,0 @@ @@ -1,25 +0,0 @@
/**
* api模板规范代码参考,
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import type { PushType, PushTypeParams, PushTypeResult } from '/@/api/platform/common/entity/pushType';
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/common_proxy/common/pushType/list',
add = '/common_proxy/common/pushType/save',
get = '/common_proxy/common/pushType',
edit = '/common_proxy/common/pushType/update',
del = '/common_proxy/common/pushType/remove',
}
export const listPushType= (params?: Partial<PushTypeParams>) => defHttp.get<PushTypeResult>({ url: Api.list, params }, { isReturnResultResponse: true });
export const addPushType = (params: Partial<PushType>) => defHttp.post({ url: Api.add, data: params });
export const editPushType = (params: Partial<PushType>) => defHttp.put({ url: Api.edit, data: params });
export const getPushType = (id: string) => defHttp.get<PushType>({ url: `${Api.get}/${id}` });
export const delPushType = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` });

25
src/api/platform/common/controller/pushUserManage.ts

@ -0,0 +1,25 @@ @@ -0,0 +1,25 @@
/**
* api模板规范代码参考,
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import type { PushUserManage, PushUserManageParams, PushUserManageResult } from '/@/api/platform/common/entity/pushUserManage';
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/common_proxy/common/pushUserManage/list',
add = '/common_proxy/common/pushUserManage/save',
get = '/common_proxy/common/pushUserManage',
edit = '/common_proxy/common/pushUserManage/update',
del = '/common_proxy/common/pushUserManage/remove',
}
export const listPushUserManage = (params?: Partial<PushUserManageParams>) => defHttp.get<PushUserManageResult>({ url: Api.list, params }, { isReturnResultResponse: true });
export const addPushUserManage = (params: Partial<PushUserManage>) => defHttp.post({ url: Api.add, data: params });
export const editPushUserManage = (params: Partial<PushUserManage>) => defHttp.put({ url: Api.edit, data: params });
export const getPushUserManage = (id: string) => defHttp.get<PushUserManage>({ url: `${Api.get}/${id}` });
export const delPushUserManage = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` });

25
src/api/platform/common/controller/pushWhitelist.ts

@ -1,25 +0,0 @@ @@ -1,25 +0,0 @@
/**
* api模板规范代码参考,
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-
*/
import type { PushWhitelist, PushWhitelistParams, PushWhitelistResult } from '/@/api/platform/common/entity/pushWhitelist';
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/common_proxy/common/pushWhitelist/list',
add = '/common_proxy/common/pushWhitelist/save',
get = '/common_proxy/common/pushWhitelist',
edit = '/common_proxy/common/pushWhitelist/update',
del = '/common_proxy/common/pushWhitelist/remove',
}
export const listPushWhitelist = (params?: Partial<PushWhitelistParams>) => defHttp.get<PushWhitelistResult>({ url: Api.list, params }, { isReturnResultResponse: true });
export const addPushWhitelist = (params: Partial<PushWhitelist>) => defHttp.post({ url: Api.add, data: params });
export const editPushWhitelist = (params: Partial<PushWhitelist>) => defHttp.put({ url: Api.edit, data: params });
export const getPushWhitelist = (id: string) => defHttp.get<PushWhitelist>({ url: `${Api.get}/${id}` });
export const delPushWhitelist = (ids: string) => defHttp.delete({ url: `${Api.del}/${ids}` });

3
src/api/platform/common/entity/pushApplication.ts

@ -6,11 +6,8 @@ export type PushApplicationParams = Page & PushApplication; @@ -6,11 +6,8 @@ export type PushApplicationParams = Page & PushApplication;
export interface PushApplication extends CommonEntity {
id: string;
name: string;
pushSize: number;
sendSize: number;
status: string;
url: string;
appKey: string;
messageSecret: string;
}

11
src/api/platform/common/entity/pushBlacklist.ts

@ -1,11 +0,0 @@ @@ -1,11 +0,0 @@
import type { R } from '/#/axios';
import type { CommonEntity, Page } from '/@/api/common/data/entity';
export type PushBlacklistParams = Page & PushBlacklist;
export interface PushBlacklist extends CommonEntity {
id: string;
pushId: string;
}
export type PushBlacklistResult = R<PushBlacklist[]>;

21
src/api/platform/common/entity/pushCertification.ts

@ -1,21 +0,0 @@ @@ -1,21 +0,0 @@
import type { R } from '/#/axios';
import type { CommonEntity, Page } from '/@/api/common/data/entity';
export type PushCertificationParams = Page & PushCertification;
export interface PushCertification extends CommonEntity {
id: string;
name: string;
license: string;
phone: string;
idCard: string;
contact: string;
creditCode: string;
type: string;
fileId: string;
status: string;
corpName: string;
detailedAddress: string;
}
export type PushCertificationResult = R<PushCertification[]>;

15
src/api/platform/common/entity/pushCustomType.ts

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
import type { R } from '/#/axios';
import type { CommonEntity, Page } from '/@/api/common/data/entity';
export type PushCustomTypeParams = Page & PushCustomType;
export interface PushCustomType extends CommonEntity {
id: string;
name: string;
level: string;
isVibration: string;
isSound: string;
customSound: string;
}
export type PushCustomTypeResult = R<PushCustomType[]>;

14
src/api/platform/common/entity/pushManage.ts

@ -1,14 +0,0 @@ @@ -1,14 +0,0 @@
import type { R } from '/#/axios';
import type { CommonEntity, Page } from '/@/api/common/data/entity';
import {TreeEntity} from "/@/api/common/data/entity";
export type PushManageParams = Page & PushManage;
export interface PushManage extends TreeEntity {
isVibration: string;
isSound: string;
appKey: number;
customSound: number;
}
export type PushManageResult = R<PushManage[]>;

13
src/api/platform/common/entity/pushPassList.ts

@ -0,0 +1,13 @@ @@ -0,0 +1,13 @@
import type { R } from '/#/axios';
import type { CommonEntity, Page } from '/@/api/common/data/entity';
export type PushPassListParams = Page & PushPassList;
export interface PushPassList extends CommonEntity {
id: string;
pushManageId: string;
name: string;
type: string;
}
export type PushPassListResult = R<PushPassList[]>;

19
src/api/platform/common/entity/pushThirdParty.ts

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
import type { R } from '/#/axios';
import type { CommonEntity, Page } from '/@/api/common/data/entity';
export type PushThirdPartyParams = Page & PushThirdParty;
export interface PushThirdParty extends CommonEntity {
id: string;
statutoryRepName: string;
idCard: string;
enterpName: string;
licenseFileId: string;
phone: string;
creditCode: string;
userId: string;
detailedAddress: string;
status: string;
}
export type PushThirdPartyResult = R<PushThirdParty[]>;

16
src/api/platform/common/entity/pushThirdPartyManage.ts

@ -0,0 +1,16 @@ @@ -0,0 +1,16 @@
import type { R } from '/#/axios';
import type { CommonEntity, Page } from '/@/api/common/data/entity';
export type PushThirdPartyManageParams = Page & PushThirdPartyManage;
export interface PushThirdPartyManage extends CommonEntity {
id: string;
thirdPartyId: string;
enterpName: string;
pushTypeId: string;
isVibration: string;
isSound: string;
customSound: string;
}
export type PushThirdPartyManageResult = R<PushThirdPartyManage[]>;

13
src/api/platform/common/entity/pushTodoAuth.ts

@ -1,13 +0,0 @@ @@ -1,13 +0,0 @@
import type { R } from '/#/axios';
import type { CommonEntity, Page } from '/@/api/common/data/entity';
export type PushTodoAuthParams = Page & PushTodoAuth;
export interface PushTodoAuth extends CommonEntity {
id: string;
name: string;
certificationId: string;
status: string;
}
export type PushTodoAuthResult = R<PushTodoAuth[]>;

12
src/api/platform/common/entity/pushType.ts

@ -1,12 +0,0 @@ @@ -1,12 +0,0 @@
import type { R } from '/#/axios';
import type { CommonEntity, Page } from '/@/api/common/data/entity';
export type PushTypeParams = Page & PushType;
export interface PushType extends CommonEntity {
id: string;
name: string;
level: string;
}
export type PushTypeResult = R<PushType[]>;

18
src/api/platform/common/entity/pushUserManage.ts

@ -0,0 +1,18 @@ @@ -0,0 +1,18 @@
import type { R } from '/#/axios';
import type { CommonEntity, Page } from '/@/api/common/data/entity';
export type PushUserManageParams = Page & PushUserManage;
export interface PushUserManage extends CommonEntity {
id: string;
userId: string;
nickName: string;
sex: string;
avatar: string;
pushTypeId: string;
isVibration: string;
isSound: string;
customSound: string;
}
export type PushUserManageResult = R<PushUserManage[]>;

11
src/api/platform/common/entity/pushWhitelist.ts

@ -1,11 +0,0 @@ @@ -1,11 +0,0 @@
import type { R } from '/#/axios';
import type { CommonEntity, Page } from '/@/api/common/data/entity';
export type PushWhitelistParams = Page & PushWhitelist;
export interface PushWhitelist extends CommonEntity {
id: string;
pushId: string;
}
export type PushWhitelistResult = R<PushWhitelist[]>;

38
src/views/common/push/application/application.data.ts

@ -6,19 +6,23 @@ import { Tag } from 'ant-design-vue'; @@ -6,19 +6,23 @@ import { Tag } from 'ant-design-vue';
/** 表格列配置 */
export const columns: BasicColumn[] = [
{
title: '多租户名称',
title: '应用名称',
dataIndex: 'name'
},
{
title: '创建推送数量',
dataIndex: 'pushSize'
},
{
title: '消息发送数量',
dataIndex: 'sendSize'
title: '状态',
dataIndex: 'status',
width: 120,
customRender: ({record}) => {
const status = record.status;
const enable = ~~status === 0;
const color = enable ? 'green' : 'red';
const text = enable ? '开通' : '关闭';
return h(Tag, { color: color }, () => text);
}
},
{
title: '请求地址',
title: '匹配域',
dataIndex: 'url'
},
{
@ -30,18 +34,6 @@ export const columns: BasicColumn[] = [ @@ -30,18 +34,6 @@ export const columns: BasicColumn[] = [
dataIndex: 'createTime',
width: 200
},
{
title: '状态',
dataIndex: 'status',
width: 120,
customRender: ({record}) => {
const status = record.status;
const enable = ~~status === 0;
const color = enable ? 'green' : 'red';
const text = enable ? '启动' : '停止';
return h(Tag, { color: color }, () => text);
}
},
{
title: '备注',
dataIndex: 'remarks',
@ -61,7 +53,7 @@ export const searchFormSchema: FormSchema[] = [ @@ -61,7 +53,7 @@ export const searchFormSchema: FormSchema[] = [
componentProps: {
placeholder: '请输入应用名称',
},
colProps: { span: 8 }
colProps: { span: 6 }
}
];
@ -84,7 +76,7 @@ export const formSchema: FormSchema[] = [ @@ -84,7 +76,7 @@ export const formSchema: FormSchema[] = [
},
{
field: 'url',
label: '请求地址',
label: '匹配域',
component: 'Input',
required: true,
colProps: {
@ -98,7 +90,7 @@ export const formSchema: FormSchema[] = [ @@ -98,7 +90,7 @@ export const formSchema: FormSchema[] = [
defaultValue: '0',
componentProps: {
options: [
{ label: '启动', value: '0' },
{ label: '开通', value: '0' },
{ label: '停止', value: '1' }
]
},

53
src/views/common/push/blacklist/blacklist.data.ts

@ -1,53 +0,0 @@ @@ -1,53 +0,0 @@
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { h } from 'vue';
import { Tag } from 'ant-design-vue';
/** 表格列配置 */
export const columns: BasicColumn[] = [
{
title: '推送ID',
dataIndex: 'pushId'
},
{
title: '创建人',
dataIndex: 'createByName'
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 200
}
];
/** 搜索表单配置 */
export const searchFormSchema: FormSchema[] = [
{
field: 'createByName',
label: '创建人',
component: 'Input',
componentProps: {
placeholder: '请输入创建人',
},
colProps: { span: 8 }
}
];
/** 表单配置 */
export const formSchema: FormSchema[] = [
{
field: 'id',
label: 'ID',
component: 'Input',
show: false
},
{
field: 'pushId',
label: '推送ID',
component: 'Input',
required: true,
colProps: {
span: 24
}
}
];

10
src/views/common/push/pushType/PushTypeModal.vue → src/views/common/push/pushCustomType/CustomTypeModal.vue

@ -16,8 +16,8 @@ @@ -16,8 +16,8 @@
*/
import { ref, unref } from 'vue';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from './pushType.data';
import { addPushType, editPushType, getPushType } from '/@/api/platform/common/controller/pushType';
import { formSchema } from './customType.data';
import { addPushCustomType, editPushCustomType, getPushCustomType } from '/@/api/platform/common/controller/pushCustomType';
import { BasicModal, ModalProps, useModalInner } from '/@/components/Modal';
/** 通用变量统一声明区域 */
@ -45,7 +45,7 @@ @@ -45,7 +45,7 @@
break;
case 'edit':
props.title = '编辑推送类型';
await setFieldsValue(await getPushType(refId));
await setFieldsValue(await getPushCustomType(refId));
break;
}
// :
@ -62,10 +62,10 @@ @@ -62,10 +62,10 @@
// tag
switch (unref(tag)) {
case 'add':
await addPushType(formData);
await addPushCustomType(formData);
break;
case 'edit':
await editPushType(formData);
await editPushCustomType(formData);
break;
}
//

73
src/views/common/push/pushManage/pushManage.data.ts → src/views/common/push/pushCustomType/customType.data.ts

@ -1,34 +1,24 @@ @@ -1,34 +1,24 @@
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { h } from 'vue';
import { Tag } from 'ant-design-vue';
/** 表格列配置 */
export const columns: BasicColumn[] = [
{
title: '推送名称',
dataIndex: 'name',
align: 'left'
title: '类型名称',
dataIndex: 'name'
},
{
title: '是否震动',
dataIndex: 'isVibration'
title: '紧急级别',
dataIndex: 'level'
},
{
title: '是否声音',
dataIndex: 'isVibration'
},
{
title: '自定义声音',
dataIndex: 'isVibration'
},
{
title: '排序',
dataIndex: 'sort'
title: '创建人',
dataIndex: 'createByName'
},
{
title: '创建时间',
dataIndex: 'createTime'
dataIndex: 'createTime',
width: 200
}
];
@ -36,12 +26,12 @@ export const columns: BasicColumn[] = [ @@ -36,12 +26,12 @@ export const columns: BasicColumn[] = [
export const searchFormSchema: FormSchema[] = [
{
field: 'name',
label: '推送名称',
label: '类型名称',
component: 'Input',
componentProps: {
placeholder: '请输入推送名称'
placeholder: '请输入类型名称',
},
colProps: {span: 8}
colProps: { span: 6 }
}
];
@ -54,22 +44,17 @@ export const formSchema: FormSchema[] = [ @@ -54,22 +44,17 @@ export const formSchema: FormSchema[] = [
show: false
},
{
field: 'parentId',
label: '上级推送',
component: 'TreeSelect',
defaultValue: '0',
componentProps: {
replaceFields: {
title: 'name',
key: 'id',
value: 'id',
},
getPopupContainer: () => document.body,
field: 'name',
label: '类型名称',
component: 'Input',
required: true,
colProps: {
span: 24
}
},
{
field: 'name',
label: '推送名称',
field: 'level',
label: '紧急级别',
component: 'Input',
required: true,
colProps: {
@ -79,7 +64,7 @@ export const formSchema: FormSchema[] = [ @@ -79,7 +64,7 @@ export const formSchema: FormSchema[] = [
{
field: 'isVibration',
label: '是否震动',
component: 'Select',
component: 'RadioGroup',
defaultValue: '0',
componentProps: {
options: [
@ -87,12 +72,14 @@ export const formSchema: FormSchema[] = [ @@ -87,12 +72,14 @@ export const formSchema: FormSchema[] = [
{ label: '否', value: '1' }
]
},
colProps: { span: 12 }
colProps: {
span: 12
}
},
{
field: 'isSound',
label: '是否声音',
component: 'Select',
label: '是否响铃',
component: 'RadioGroup',
defaultValue: '0',
componentProps: {
options: [
@ -100,15 +87,17 @@ export const formSchema: FormSchema[] = [ @@ -100,15 +87,17 @@ export const formSchema: FormSchema[] = [
{ label: '否', value: '1' }
]
},
colProps: { span: 12 }
colProps: {
span: 12
}
},
{
field: 'customSound',
label: '自定义声音',
label: '自定义响铃',
component: 'Input',
required: true,
colProps: {
span: 12
span: 24
}
}
},
];

8
src/views/common/push/pushType/index.vue → src/views/common/push/pushCustomType/index.vue

@ -46,10 +46,10 @@ @@ -46,10 +46,10 @@
*/
import { reactive, toRaw } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { listPushType, delPushType } from '/@/api/platform/common/controller/pushType';
import { listPushCustomType, delPushCustomType } from '/@/api/platform/common/controller/pushCustomType';
import { useModal } from '/@/components/Modal';
import PushTypeModal from './PushTypeModal.vue';
import { columns, searchFormSchema } from './pushType.data';
import { columns, searchFormSchema } from './customType.data';
import { useMessage } from '/@/hooks/web/useMessage';
/** 类型规范统一声明定义区域 */
@ -69,7 +69,7 @@ @@ -69,7 +69,7 @@
const [registerModal, { openModal }] = useModal();
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({
title: '推送类型列表',
api: listPushType,
api: listPushCustomType,
rowKey: 'id',
columns,
formConfig: {
@ -119,7 +119,7 @@ @@ -119,7 +119,7 @@
title: '警告',
content: `是否确认删除编号为${ids}的数据?`,
onOk: async () => {
await delPushType(ids);
await delPushCustomType(ids);
createMessage.success('删除成功!');
handleRefreshTable();
}

89
src/views/common/push/pushManage/PushManageModal.vue

@ -1,89 +0,0 @@ @@ -1,89 +0,0 @@
<template>
<BasicModal v-bind="$attrs"
width="720px"
@ok="handleSubmit"
@register="registerModal"
>
<BasicForm @register="registerForm"/>
</BasicModal>
</template>
<script lang="ts" setup>
/**
* 提供模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致
* 采用vben-动态表格表单封装组件编写,采用 setup 写法
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved.
* author entfrm开发团队-王翔
*/
import { ref, unref } from 'vue';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from './pushManage.data';
import { BasicModal, ModalProps, useModalInner } from '/@/components/Modal';
import { listPushManage, addPushManage, editPushManage, getPushManage } from '/@/api/platform/common/controller/pushManage';
import { listToTree } from '/@/utils/helper/treeHelper';
/** 通用变量统一声明区域 */
const tag = ref<Nullable<string>>('');
/** https://v3.cn.vuejs.org/api/options-data.html#emits */
const emit = defineEmits(['success', 'register']);
const [registerForm, { resetFields, setFieldsValue, updateSchema, validate, clearValidate }] = useForm({
labelWidth: 100,
schemas: formSchema,
showActionButtonGroup: false,
baseColProps: { span: 24 }
});
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data: WindowInnerData = { _tag: '' }) => {
//
await resetFields();
await clearValidate();
//
tag.value = data._tag;
const topTree = { deptId: '0', name: '顶级推送', children: [] };
topTree.children = listToTree(await listPushManage());
await updateSchema({
field: 'parentId',
componentProps: {
treeData: [topTree]
}
});
const refId = data.record?.id;
const props: Partial<ModalProps> = { confirmLoading: false };
// tag
switch (unref(tag)) {
case 'add':
props.title = '新增推送';
refId && await setFieldsValue({ parentId: refId });
break;
case 'edit':
props.title = '编辑推送';
await setFieldsValue(await getPushManage(refId));
break;
}
// :
setModalProps(props);
});
/** 处理弹出框提交 */
async function handleSubmit() {
try {
//
const formData = await validate();
//
setModalProps({ confirmLoading: true });
// tag
switch (unref(tag)) {
case 'add':
await addPushManage(formData);
break;
case 'edit':
await editPushManage(formData);
break;
}
//
closeModal();
emit('success');
} finally {
setModalProps({ confirmLoading: false });
}
}
</script>

106
src/views/common/push/pushManage/index.vue

@ -1,106 +0,0 @@ @@ -1,106 +0,0 @@
<template>
<div>
<BasicTable @register="registerTable">
<template #toolbar>
<a-button type="primary" @click="handleAdd()">新增推送</a-button>
<a-button type="default" @click="expandAll">展开全部</a-button>
<a-button type="default" @click="collapseAll">折叠全部</a-button>
</template>
<template #action="{ record }">
<TableAction
:actions="[
{
label: '编辑',
icon: 'fa6-regular:pen-to-square',
onClick: handleEdit.bind(null, record)
},
{
label: '新增',
icon: 'ant-design:plus-circle-outlined',
onClick: handleAdd.bind(null, record)
},
{
label: '删除',
icon: 'ant-design:delete-outlined',
color: 'error',
popConfirm: {
title: '是否确认删除',
confirm: handleDel.bind(null, record)
}
}
]"
/>
</template>
</BasicTable>
<PushManageModal @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 { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useModal } from '/@/components/Modal';
import PushManageModal from './PushManageModal.vue';
import { columns, searchFormSchema } from './pushManage.data';
import { delPushManage, listPushManage } from '/@/api/platform/common/controller/pushManage';
import { useMessage } from '/@/hooks/web/useMessage';
import { listToTree } from '/@/utils/helper/treeHelper';
/** 通用变量统一声明区域 */
const { createMessage } = useMessage();
const [registerModal, { openModal }] = useModal();
const [registerTable, { reload, expandAll, collapseAll, getDataSource }] = useTable({
title: '推送列表',
api: listPushManage,
rowKey: 'deptId',
columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true,
fieldMapToTime: [['dateRange', ['beginTime', 'endTime'], 'YYYY-MM-DD']]
},
isTreeTable: true,
pagination: false,
striped: false,
useSearchForm: true,
showTableSetting: true,
bordered: true,
showIndexColumn: false,
canResize: false,
actionColumn: {
width: 250,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
fixed: false
},
afterFetch: result => listToTree(result, { id: 'deptId' }),
});
/** 新增按钮操作,行内新增与工具栏局域新增通用 */
function handleAdd(record?: Recordable) {
openModal(true, { _tag: 'add', record });
}
/** 编辑按钮操作,行内编辑 */
function handleEdit(record: Recordable) {
openModal(true, { _tag: 'edit', record });
}
/** 删除按钮操作,行内删除 */
async function handleDel(record: Recordable) {
await delPushManage(record.deptId);
createMessage.success('删除成功!');
handleRefreshTable();
}
/** 处理表格刷新 */
function handleRefreshTable() {
reload();
}
</script>

14
src/views/common/push/todoAuth/TodoAuthModal.vue → src/views/common/push/pushPassList/PassListModal.vue

@ -16,8 +16,8 @@ @@ -16,8 +16,8 @@
*/
import { ref, unref } from 'vue';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from './todoAuth.data';
import { addPushTodoAuth, editPushTodoAuth, getPushTodoAuth } from '/@/api/platform/common/controller/pushTodoAuth';
import { formSchema } from './passList.data';
import { addPushPassList, editPushPassList, getPushPassList } from '/@/api/platform/common/controller/pushPassList';
import { BasicModal, ModalProps, useModalInner } from '/@/components/Modal';
/** 通用变量统一声明区域 */
@ -41,11 +41,11 @@ @@ -41,11 +41,11 @@
// tag
switch (unref(tag)) {
case 'add':
props.title = '新增认证代办';
props.title = '新增名单';
break;
case 'edit':
props.title = '编辑认证代办';
await setFieldsValue(await getPushTodoAuth(refId));
props.title = '编辑名单';
await setFieldsValue(await getPushPassList(refId));
break;
}
// :
@ -62,10 +62,10 @@ @@ -62,10 +62,10 @@
// tag
switch (unref(tag)) {
case 'add':
await addPushTodoAuth(formData);
await addPushPassList(formData);
break;
case 'edit':
await editPushTodoAuth(formData);
await editPushPassList(formData);
break;
}
//

20
src/views/common/push/todoAuth/index.vue → src/views/common/push/pushPassList/index.vue

@ -6,15 +6,15 @@ @@ -6,15 +6,15 @@
<template #toolbar>
<a-button type="primary"
@click="handleAdd()"
>新增认证代办</a-button>
>新增名单</a-button>
<a-button type="primary"
:disabled="state.single"
@click="handleEdit()"
>修改认证代办</a-button>
>修改名单</a-button>
<a-button type="primary"
:disabled="state.multiple"
@click="handleDel()"
>删除认证代办</a-button>
>删除名单</a-button>
</template>
<template #action="{ record }">
<TableAction :actions="[
@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
</template>
</BasicTable>
<!--弹出窗体区域-->
<TodoAuthModal @register="registerModal" @success="handleRefreshTable"/>
<PassListModal @register="registerModal" @success="handleRefreshTable"/>
</div>
</template>
@ -46,10 +46,10 @@ @@ -46,10 +46,10 @@
*/
import { reactive, toRaw } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { listPushTodoAuth, delPushTodoAuth } from '/@/api/platform/common/controller/pushTodoAuth';
import { listPushPassList, delPushPassList } from '/@/api/platform/common/controller/pushPassList';
import { useModal } from '/@/components/Modal';
import TodoAuthModal from './TodoAuthModal.vue';
import { columns, searchFormSchema } from './todoAuth.data';
import PassListModal from './PassListModal.vue';
import { columns, searchFormSchema } from './passList.data';
import { useMessage } from '/@/hooks/web/useMessage';
/** 类型规范统一声明定义区域 */
@ -68,8 +68,8 @@ @@ -68,8 +68,8 @@
const { createConfirm, createMessage } = useMessage();
const [registerModal, { openModal }] = useModal();
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({
title: '代办列表',
api: listPushTodoAuth,
title: '名单列表',
api: listPushPassList,
rowKey: 'id',
columns,
formConfig: {
@ -119,7 +119,7 @@ @@ -119,7 +119,7 @@
title: '警告',
content: `是否确认删除编号为${ids}的数据?`,
onOk: async () => {
await delPushTodoAuth(ids);
await delPushPassList(ids);
createMessage.success('删除成功!');
handleRefreshTable();
}

22
src/views/common/push/pushType/pushType.data.ts → src/views/common/push/pushPassList/passList.data.ts

@ -1,17 +1,15 @@ @@ -1,17 +1,15 @@
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { h } from 'vue';
import { Tag } from 'ant-design-vue';
/** 表格列配置 */
export const columns: BasicColumn[] = [
{
title: '类型名称',
title: '推送名称',
dataIndex: 'name'
},
{
title: '紧急级别',
dataIndex: 'level'
title: '推送ID',
dataIndex: 'pushManageId'
},
{
title: '创建人',
@ -28,12 +26,12 @@ export const columns: BasicColumn[] = [ @@ -28,12 +26,12 @@ export const columns: BasicColumn[] = [
export const searchFormSchema: FormSchema[] = [
{
field: 'name',
label: '类型名称',
label: '推送名称',
component: 'Input',
componentProps: {
placeholder: '请输入类型名称',
placeholder: '请输入推送名称',
},
colProps: { span: 8 }
colProps: { span: 6 }
}
];
@ -47,7 +45,7 @@ export const formSchema: FormSchema[] = [ @@ -47,7 +45,7 @@ export const formSchema: FormSchema[] = [
},
{
field: 'name',
label: '类型名称',
label: '推送名称',
component: 'Input',
required: true,
colProps: {
@ -55,12 +53,12 @@ export const formSchema: FormSchema[] = [ @@ -55,12 +53,12 @@ export const formSchema: FormSchema[] = [
}
},
{
field: 'level',
label: '紧急级别',
field: 'pushManageId',
label: '推送ID',
component: 'Input',
required: true,
colProps: {
span: 12
span: 24
}
}
];

16
src/views/common/push/blacklist/BlacklistModal.vue → src/views/common/push/pushThirdParty/ThirdPartyModal.vue vendored

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
<template>
PushThirdPartyModal<template>
<BasicModal v-bind="$attrs"
width="720px"
@register="registerModal"
@ -16,8 +16,8 @@ @@ -16,8 +16,8 @@
*/
import { ref, unref } from 'vue';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from './blacklist.data';
import { addPushBlacklist, editPushBlacklist, getPushBlacklist } from '/@/api/platform/common/controller/pushBlacklist';
import { formSchema } from './thirdParty.data';
import { addPushThirdParty, editPushThirdParty, getPushThirdParty } from '/@/api/platform/common/controller/pushThirdParty';
import { BasicModal, ModalProps, useModalInner } from '/@/components/Modal';
/** 通用变量统一声明区域 */
@ -41,11 +41,11 @@ @@ -41,11 +41,11 @@
// tag
switch (unref(tag)) {
case 'add':
props.title = '新增黑名单';
props.title = '新增第三方';
break;
case 'edit':
props.title = '编辑黑名单';
await setFieldsValue(await getPushBlacklist(refId));
props.title = '编辑第三方';
await setFieldsValue(await getPushThirdParty(refId));
break;
}
// :
@ -62,10 +62,10 @@ @@ -62,10 +62,10 @@
// tag
switch (unref(tag)) {
case 'add':
await addPushBlacklist(formData);
await addPushThirdParty(formData);
break;
case 'edit':
await editPushBlacklist(formData);
await editPushThirdParty(formData);
break;
}
//

20
src/views/common/push/blacklist/index.vue → src/views/common/push/pushThirdParty/index.vue vendored

@ -6,15 +6,15 @@ @@ -6,15 +6,15 @@
<template #toolbar>
<a-button type="primary"
@click="handleAdd()"
>新增黑名单</a-button>
>新增第三方</a-button>
<a-button type="primary"
:disabled="state.single"
@click="handleEdit()"
>修改黑名单</a-button>
>修改第三方</a-button>
<a-button type="primary"
:disabled="state.multiple"
@click="handleDel()"
>删除黑名单</a-button>
>删除第三方</a-button>
</template>
<template #action="{ record }">
<TableAction :actions="[
@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
</template>
</BasicTable>
<!--弹出窗体区域-->
<BlacklistModal @register="registerModal" @success="handleRefreshTable"/>
<ThirdPartyModal @register="registerModal" @success="handleRefreshTable"/>
</div>
</template>
@ -46,10 +46,10 @@ @@ -46,10 +46,10 @@
*/
import { reactive, toRaw } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { listPushBlacklist, delPushBlacklist } from '/@/api/platform/common/controller/pushBlacklist';
import { listPushThirdParty, delPushThirdParty } from '/@/api/platform/common/controller/pushThirdParty';
import { useModal } from '/@/components/Modal';
import BlacklistModal from './BlacklistModal.vue';
import { columns, searchFormSchema } from './blacklist.data';
import ThirdPartyModal from './ThirdPartyModal.vue';
import { columns, searchFormSchema } from './thirdParty.data';
import { useMessage } from '/@/hooks/web/useMessage';
/** 类型规范统一声明定义区域 */
@ -68,8 +68,8 @@ @@ -68,8 +68,8 @@
const { createConfirm, createMessage } = useMessage();
const [registerModal, { openModal }] = useModal();
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({
title: '黑名单列表',
api: listPushBlacklist,
title: '第三方列表',
api: listPushThirdParty,
rowKey: 'id',
columns,
formConfig: {
@ -119,7 +119,7 @@ @@ -119,7 +119,7 @@
title: '警告',
content: `是否确认删除编号为${ids}的数据?`,
onOk: async () => {
await delPushBlacklist(ids);
await delPushThirdParty(ids);
createMessage.success('删除成功!');
handleRefreshTable();
}

93
src/views/common/push/authManage/authManage.data.ts → src/views/common/push/pushThirdParty/thirdParty.data.ts vendored

@ -6,54 +6,41 @@ import { Tag } from 'ant-design-vue'; @@ -6,54 +6,41 @@ import { Tag } from 'ant-design-vue';
/** 表格列配置 */
export const columns: BasicColumn[] = [
{
title: '姓名',
dataIndex: 'name'
title: '法定代表人',
dataIndex: 'statutoryRepName',
},
{
title: '营业证书',
dataIndex: 'license'
title: '企业名称',
dataIndex: 'enterpName'
},
{
title: '手机号',
dataIndex: 'phone'
},
{
title: '联系人',
dataIndex: 'contact'
},
{
title: '行用代码',
title: '信用代码',
dataIndex: 'creditCode'
},
{
title: '类型',
dataIndex: 'type',
customRender: ({record}) => {
const type = record.type;
const enable = ~~type === 0;
return enable ? '企业' : '个人';
}
},
{
title: '公司名称',
dataIndex: 'corpName'
},
{
title: '详细地址',
dataIndex: 'detailedAddress'
},
{
title: '创建时间',
dataIndex: 'createTime'
}
];
/** 搜索表单配置 */
export const searchFormSchema: FormSchema[] = [
{
field: 'name',
label: '姓名',
field: 'enterpName',
label: '企业名称',
component: 'Input',
componentProps: {
placeholder: '请输入姓名',
placeholder: '请输入企业名称'
},
colProps: { span: 8 }
colProps: { span: 6 }
}
];
@ -66,35 +53,8 @@ export const formSchema: FormSchema[] = [ @@ -66,35 +53,8 @@ export const formSchema: FormSchema[] = [
show: false
},
{
field: 'name',
label: '姓名',
component: 'Input',
required: true,
colProps: {
span: 12
}
},
{
field: 'license',
label: '营业执照',
component: 'Input',
required: true,
colProps: {
span: 12
}
},
{
field: 'phone',
label: '手机号',
component: 'Input',
required: true,
colProps: {
span: 12
}
},
{
field: 'contact',
label: '联系人',
field: 'statutoryRepName',
label: '法定代表人',
component: 'Input',
required: true,
colProps: {
@ -111,8 +71,8 @@ export const formSchema: FormSchema[] = [ @@ -111,8 +71,8 @@ export const formSchema: FormSchema[] = [
}
},
{
field: 'creditCode',
label: '行用代码',
field: 'enterpName',
label: '企业名称',
component: 'Input',
required: true,
colProps: {
@ -120,8 +80,8 @@ export const formSchema: FormSchema[] = [ @@ -120,8 +80,8 @@ export const formSchema: FormSchema[] = [
}
},
{
field: 'type',
label: '认证类型',
field: 'phone',
label: '手机号',
component: 'Input',
required: true,
colProps: {
@ -129,8 +89,8 @@ export const formSchema: FormSchema[] = [ @@ -129,8 +89,8 @@ export const formSchema: FormSchema[] = [
}
},
{
field: 'corpName',
label: '公司名称',
field: 'creditCode',
label: '信用代码',
component: 'Input',
required: true,
colProps: {
@ -142,17 +102,6 @@ export const formSchema: FormSchema[] = [ @@ -142,17 +102,6 @@ export const formSchema: FormSchema[] = [
label: '详细地址',
component: 'Input',
required: true,
colProps: {
span: 12
}
},
{
label: '备注',
field: 'remarks',
component: 'InputTextArea',
componentProps: {
rows: 6
},
colProps: {
span: 24
}

14
src/views/common/push/authManage/AuthManageModal.vue → src/views/common/push/pushThirdPartyManage/ThirdPartyManageModal.vue

@ -16,8 +16,8 @@ @@ -16,8 +16,8 @@
*/
import { ref, unref } from 'vue';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from './authManage.data';
import { addPushCertification, editPushCertification, getPushCertification } from '/@/api/platform/common/controller/pushCertification';
import { formSchema } from './thirdPartyManage.data';
import { addPushThirdPartyManage, editPushThirdPartyManage, getPushThirdPartyManage } from '/@/api/platform/common/controller/pushThirdPartyManage';
import { BasicModal, ModalProps, useModalInner } from '/@/components/Modal';
/** 通用变量统一声明区域 */
@ -41,11 +41,11 @@ @@ -41,11 +41,11 @@
// tag
switch (unref(tag)) {
case 'add':
props.title = '新增推送认证';
props.title = '新增第三方推送';
break;
case 'edit':
props.title = '编辑推送认证';
await setFieldsValue(await getPushCertification(refId));
props.title = '编辑第三方推送';
await setFieldsValue(await getPushThirdPartyManage(refId));
break;
}
// :
@ -62,10 +62,10 @@ @@ -62,10 +62,10 @@
// tag
switch (unref(tag)) {
case 'add':
await addPushCertification(formData);
await addPushThirdPartyManage(formData);
break;
case 'edit':
await editPushCertification(formData);
await editPushThirdPartyManage(formData);
break;
}
//

135
src/views/common/push/pushThirdPartyManage/index.vue

@ -0,0 +1,135 @@ @@ -0,0 +1,135 @@
<template>
<div>
<BasicTable @register="registerTable"
@selection-change="handleSelectionChange"
>
<template #toolbar>
<a-button type="primary"
@click="handleAdd()"
>新增第三方推送</a-button>
<a-button type="primary"
:disabled="state.single"
@click="handleEdit()"
>修改第三方推送</a-button>
<a-button type="primary"
:disabled="state.multiple"
@click="handleDel()"
>删除第三方推送</a-button>
</template>
<template #action="{ record }">
<TableAction :actions="[
{
label: '编辑',
icon: 'fa6-regular:pen-to-square',
onClick: handleEdit.bind(null, record)
},
{
label: '删除',
icon: 'ant-design:delete-outlined',
color: 'error',
onClick: handleDel.bind(null, record)
}]"
/>
</template>
</BasicTable>
<!--弹出窗体区域-->
<ThirdPartyManageModal @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 { listPushThirdPartyManage, delPushThirdPartyManage } from '/@/api/platform/common/controller/pushThirdPartyManage';
import { useModal } from '/@/components/Modal';
import ThirdPartyManageModal from './ThirdPartyManageModal.vue';
import { columns, searchFormSchema } from './thirdPartyManage.data';
import { useMessage } from '/@/hooks/web/useMessage';
/** 类型规范统一声明定义区域 */
interface TableState {
single: boolean;
multiple: boolean;
}
/** 通用变量统一声明区域 */
const state = reactive<TableState>({
//
single: true,
//
multiple: true
});
const { createConfirm, createMessage } = useMessage();
const [registerModal, { openModal }] = useModal();
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({
title: '第三方推送列表',
api: listPushThirdPartyManage,
rowKey: 'id',
columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true
},
rowSelection: { type: 'checkbox' },
useSearchForm: true,
showTableSetting: true,
bordered: true,
clickToRowSelect: false,
showIndexColumn: false,
actionColumn: {
width: 220,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
fixed: false
},
handleSearchInfoFn: () => clearSelectedRowKeys()
});
/** 处理多选框选中数据 */
function handleSelectionChange(selection?: Recordable) {
const rowSelection = toRaw(selection?.keys) || [];
state.single = rowSelection.length != 1;
state.multiple = !rowSelection.length;
}
/** 新增按钮操作,行内新增与工具栏局域新增通用 */
function handleAdd() {
openModal(true,{ _tag: 'add' });
}
/** 编辑按钮操作,行内编辑 */
function handleEdit(record?: Recordable) {
record = record || { id: getSelectRowKeys() };
openModal(true, { _tag: 'edit', record });
}
/** 删除按钮操作,行内删除 */
async function handleDel(record?: Recordable) {
const ids = record?.id || getSelectRowKeys();
createConfirm({
iconType: 'warning',
title: '警告',
content: `是否确认删除编号为${ids}的数据?`,
onOk: async () => {
await delPushThirdPartyManage(ids);
createMessage.success('删除成功!');
handleRefreshTable();
}
});
}
/** 处理表格刷新 */
function handleRefreshTable() {
clearSelectedRowKeys();
reload();
}
</script>

126
src/views/common/push/pushThirdPartyManage/thirdPartyManage.data.ts

@ -0,0 +1,126 @@ @@ -0,0 +1,126 @@
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
/** 表格列配置 */
export const columns: BasicColumn[] = [
{
title: '企业名称',
dataIndex: 'enterpName'
},
{
title: '是否震动',
dataIndex: 'isVibration',
customRender: ({record}) => {
return ~~record?.isVibration === 0 ? '是' : '否';
}
},
{
title: '是否响铃',
dataIndex: 'isSound',
customRender: ({record}) => {
return ~~record?.isSound === 0 ? '是' : '否';
}
},
{
title: '自定义响铃',
dataIndex: 'customSound',
},
{
title: '创建人',
dataIndex: 'createByName',
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 200
}
];
/** 搜索表单配置 */
export const searchFormSchema: FormSchema[] = [
{
field: 'enterpName',
label: '企业名称',
component: 'Input',
componentProps: {
placeholder: '请输入企业名称',
},
colProps: { span: 6 }
}
];
/** 表单配置 */
export const formSchema: FormSchema[] = [
{
field: 'id',
label: 'ID',
component: 'Input',
show: false
},
{
field: 'enterpName',
label: '企业名称',
component: 'Input',
required: true,
colProps: {
span: 24
}
},
{
field: 'thirdPartyId',
label: '第三方ID',
component: 'Input',
required: true,
colProps: {
span: 12
}
},
{
field: 'pushTypeId',
label: '推送类型ID',
component: 'Input',
required: true,
colProps: {
span: 12
}
},
{
field: 'isVibration',
label: '是否震动',
component: 'RadioGroup',
defaultValue: '0',
componentProps: {
options: [
{ label: '是', value: '0' },
{ label: '否', value: '1' }
]
},
colProps: {
span: 12
}
},
{
field: 'isSound',
label: '是否响铃',
component: 'RadioGroup',
defaultValue: '0',
componentProps: {
options: [
{ label: '是', value: '0' },
{ label: '否', value: '1' }
]
},
colProps: {
span: 12
}
},
{
field: 'customSound',
label: '自定义响铃',
component: 'Input',
required: true,
colProps: {
span: 24
}
},
];

14
src/views/common/push/whitelist/WhitelistModal.vue → src/views/common/push/pushUserManage/UserManageModal.vue

@ -16,8 +16,8 @@ @@ -16,8 +16,8 @@
*/
import { ref, unref } from 'vue';
import { BasicForm, useForm } from '/@/components/Form/index';
import { formSchema } from './whitelist.data';
import { addPushWhitelist, editPushWhitelist, getPushWhitelist } from '/@/api/platform/common/controller/pushWhitelist';
import { formSchema } from './userManage.data';
import { addPushUserManage, editPushUserManage, getPushUserManage } from '/@/api/platform/common/controller/pushUserManage';
import { BasicModal, ModalProps, useModalInner } from '/@/components/Modal';
/** 通用变量统一声明区域 */
@ -41,11 +41,11 @@ @@ -41,11 +41,11 @@
// tag
switch (unref(tag)) {
case 'add':
props.title = '新增白名单';
props.title = '新增用户推送';
break;
case 'edit':
props.title = '编辑白名单';
await setFieldsValue(await getPushWhitelist(refId));
props.title = '编辑用户推送';
await setFieldsValue(await getPushUserManage(refId));
break;
}
// :
@ -62,10 +62,10 @@ @@ -62,10 +62,10 @@
// tag
switch (unref(tag)) {
case 'add':
await addPushWhitelist(formData);
await addPushUserManage(formData);
break;
case 'edit':
await editPushWhitelist(formData);
await editPushUserManage(formData);
break;
}
//

20
src/views/common/push/authManage/index.vue → src/views/common/push/pushUserManage/index.vue

@ -6,15 +6,15 @@ @@ -6,15 +6,15 @@
<template #toolbar>
<a-button type="primary"
@click="handleAdd()"
>新增推送认证</a-button>
>新增用户推送</a-button>
<a-button type="primary"
:disabled="state.single"
@click="handleEdit()"
>修改推送认证</a-button>
>修改用户推送</a-button>
<a-button type="primary"
:disabled="state.multiple"
@click="handleDel()"
>删除推送认证</a-button>
>删除用户推送</a-button>
</template>
<template #action="{ record }">
<TableAction :actions="[
@ -33,7 +33,7 @@ @@ -33,7 +33,7 @@
</template>
</BasicTable>
<!--弹出窗体区域-->
<AuthManageModal @register="registerModal" @success="handleRefreshTable"/>
<UserManageModal @register="registerModal" @success="handleRefreshTable"/>
</div>
</template>
@ -46,10 +46,10 @@ @@ -46,10 +46,10 @@
*/
import { reactive, toRaw } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { listPushCertification, delPushCertification } from '/@/api/platform/common/controller/pushCertification';
import { listPushUserManage, delPushUserManage } from '/@/api/platform/common/controller/pushUserManage';
import { useModal } from '/@/components/Modal';
import AuthManageModal from './AuthManageModal.vue';
import { columns, searchFormSchema } from './authManage.data';
import UserManageModal from './UserManageModal.vue';
import { columns, searchFormSchema } from './userManage.data';
import { useMessage } from '/@/hooks/web/useMessage';
/** 类型规范统一声明定义区域 */
@ -68,8 +68,8 @@ @@ -68,8 +68,8 @@
const { createConfirm, createMessage } = useMessage();
const [registerModal, { openModal }] = useModal();
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({
title: '推送认证列表',
api: listPushCertification,
title: '用户推送列表',
api: listPushUserManage,
rowKey: 'id',
columns,
formConfig: {
@ -119,7 +119,7 @@ @@ -119,7 +119,7 @@
title: '警告',
content: `是否确认删除编号为${ids}的数据?`,
onOk: async () => {
await delPushCertification(ids);
await delPushUserManage(ids);
createMessage.success('删除成功!');
handleRefreshTable();
}

148
src/views/common/push/pushUserManage/userManage.data.ts

@ -0,0 +1,148 @@ @@ -0,0 +1,148 @@
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
/** 表格列配置 */
export const columns: BasicColumn[] = [
{
title: '用户昵称',
dataIndex: 'nickName'
},
{
title: '性别',
dataIndex: 'sex',
customRender: ({record}) => {
return ~~record?.isVibration === 0 ? '男' : '女';
}
},
{
title: '是否震动',
dataIndex: 'isVibration',
customRender: ({record}) => {
return ~~record?.isVibration === 0 ? '是' : '否';
}
},
{
title: '是否响铃',
dataIndex: 'isSound',
customRender: ({record}) => {
return ~~record?.isSound === 0 ? '是' : '否';
}
},
{
title: '自定义响铃',
dataIndex: 'customSound',
},
{
title: '创建人',
dataIndex: 'createByName'
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 200
}
];
/** 搜索表单配置 */
export const searchFormSchema: FormSchema[] = [
{
field: 'nickName',
label: '用户昵称',
component: 'Input',
componentProps: {
placeholder: '请输入用户昵称',
},
colProps: { span: 6 }
}
];
/** 表单配置 */
export const formSchema: FormSchema[] = [
{
field: 'id',
label: 'ID',
component: 'Input',
show: false
},
{
field: 'nickName',
label: '用户昵称',
component: 'Input',
required: true,
colProps: {
span: 12
}
},
{
field: 'sex',
label: '性别',
component: 'Select',
required: true,
componentProps: {
options: [
{ label: '男', value: '0' },
{ label: '女', value: '1' }
]
},
colProps: {
span: 12
}
},
{
field: 'userId',
label: '用户ID',
component: 'Input',
required: true,
colProps: {
span: 12
}
},
{
field: 'pushTypeId',
label: '推送类型ID',
component: 'Input',
required: true,
colProps: {
span: 12
}
},
{
field: 'isVibration',
label: '是否震动',
component: 'RadioGroup',
defaultValue: '0',
componentProps: {
options: [
{ label: '是', value: '0' },
{ label: '否', value: '1' }
]
},
colProps: {
span: 12
}
},
{
field: 'isSound',
label: '是否响铃',
component: 'RadioGroup',
defaultValue: '0',
componentProps: {
options: [
{ label: '是', value: '0' },
{ label: '否', value: '1' }
]
},
colProps: {
span: 12
}
},
{
field: 'customSound',
label: '自定义响铃',
component: 'Input',
required: true,
colProps: {
span: 24
}
},
];

89
src/views/common/push/todoAuth/todoAuth.data.ts

@ -1,89 +0,0 @@ @@ -1,89 +0,0 @@
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { h } from 'vue';
import { Tag } from 'ant-design-vue';
/** 表格列配置 */
export const columns: BasicColumn[] = [
{
title: '申请名称',
dataIndex: 'name'
},
{
title: '认证ID',
dataIndex: 'certificationId'
},
{
title: '创建人',
dataIndex: 'createByName'
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 200
},
{
title: '状态',
dataIndex: 'status',
},
{
title: '备注',
dataIndex: 'remarks',
width: 200,
customRender: ({record}) => {
return record.remarks || h(Tag, { color: 'red' }, () => '暂无数据');
}
}
];
/** 搜索表单配置 */
export const searchFormSchema: FormSchema[] = [
{
field: 'name',
label: '申请名称',
component: 'Input',
componentProps: {
placeholder: '请输入申请名称',
},
colProps: { span: 8 }
}
];
/** 表单配置 */
export const formSchema: FormSchema[] = [
{
field: 'id',
label: 'ID',
component: 'Input',
show: false
},
{
field: 'name',
label: '申请名称',
component: 'Input',
required: true,
colProps: {
span: 24
}
},
{
field: 'status',
label: '状态',
component: 'Input',
required: true,
colProps: {
span: 24
}
},
{
label: '备注',
field: 'remarks',
component: 'InputTextArea',
componentProps: {
rows: 6
},
colProps: {
span: 24
}
}
];

135
src/views/common/push/whitelist/index.vue

@ -1,135 +0,0 @@ @@ -1,135 +0,0 @@
<template>
<div>
<BasicTable @register="registerTable"
@selection-change="handleSelectionChange"
>
<template #toolbar>
<a-button type="primary"
@click="handleAdd()"
>新增白名单</a-button>
<a-button type="primary"
:disabled="state.single"
@click="handleEdit()"
>修改白名单</a-button>
<a-button type="primary"
:disabled="state.multiple"
@click="handleDel()"
>删除白名单</a-button>
</template>
<template #action="{ record }">
<TableAction :actions="[
{
label: '编辑',
icon: 'fa6-regular:pen-to-square',
onClick: handleEdit.bind(null, record)
},
{
label: '删除',
icon: 'ant-design:delete-outlined',
color: 'error',
onClick: handleDel.bind(null, record)
}]"
/>
</template>
</BasicTable>
<!--弹出窗体区域-->
<WhitelistModal @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 { listPushWhitelist, delPushWhitelist } from '/@/api/platform/common/controller/pushWhitelist';
import { useModal } from '/@/components/Modal';
import WhitelistModal from './WhitelistModal.vue';
import { columns, searchFormSchema } from './whitelist.data';
import { useMessage } from '/@/hooks/web/useMessage';
/** 类型规范统一声明定义区域 */
interface TableState {
single: boolean;
multiple: boolean;
}
/** 通用变量统一声明区域 */
const state = reactive<TableState>({
//
single: true,
//
multiple: true
});
const { createConfirm, createMessage } = useMessage();
const [registerModal, { openModal }] = useModal();
const [registerTable, { reload, clearSelectedRowKeys, getSelectRowKeys }] = useTable({
title: '白名单列表',
api: listPushWhitelist,
rowKey: 'id',
columns,
formConfig: {
labelWidth: 120,
schemas: searchFormSchema,
autoSubmitOnEnter: true
},
rowSelection: { type: 'checkbox' },
useSearchForm: true,
showTableSetting: true,
bordered: true,
clickToRowSelect: false,
showIndexColumn: false,
actionColumn: {
width: 220,
title: '操作',
dataIndex: 'action',
slots: { customRender: 'action' },
fixed: false
},
handleSearchInfoFn: () => clearSelectedRowKeys()
});
/** 处理多选框选中数据 */
function handleSelectionChange(selection?: Recordable) {
const rowSelection = toRaw(selection?.keys) || [];
state.single = rowSelection.length != 1;
state.multiple = !rowSelection.length;
}
/** 新增按钮操作,行内新增与工具栏局域新增通用 */
function handleAdd() {
openModal(true,{ _tag: 'add' });
}
/** 编辑按钮操作,行内编辑 */
function handleEdit(record?: Recordable) {
record = record || { id: getSelectRowKeys() };
openModal(true, { _tag: 'edit', record });
}
/** 删除按钮操作,行内删除 */
async function handleDel(record?: Recordable) {
const ids = record?.id || getSelectRowKeys();
createConfirm({
iconType: 'warning',
title: '警告',
content: `是否确认删除编号为${ids}的数据?`,
onOk: async () => {
await delPushWhitelist(ids);
createMessage.success('删除成功!');
handleRefreshTable();
}
});
}
/** 处理表格刷新 */
function handleRefreshTable() {
clearSelectedRowKeys();
reload();
}
</script>

53
src/views/common/push/whitelist/whitelist.data.ts

@ -1,53 +0,0 @@ @@ -1,53 +0,0 @@
import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Table';
import { h } from 'vue';
import { Tag } from 'ant-design-vue';
/** 表格列配置 */
export const columns: BasicColumn[] = [
{
title: '推送ID',
dataIndex: 'pushId'
},
{
title: '创建人',
dataIndex: 'createByName'
},
{
title: '创建时间',
dataIndex: 'createTime',
width: 200
}
];
/** 搜索表单配置 */
export const searchFormSchema: FormSchema[] = [
{
field: 'createByName',
label: '创建人',
component: 'Input',
componentProps: {
placeholder: '请输入创建人',
},
colProps: { span: 8 }
}
];
/** 表单配置 */
export const formSchema: FormSchema[] = [
{
field: 'id',
label: 'ID',
component: 'Input',
show: false
},
{
field: 'pushId',
label: '推送ID',
component: 'Input',
required: true,
colProps: {
span: 24
}
}
];
Loading…
Cancel
Save