jmash-diy-mp 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/.editorconfig +9 -0
  2. package/README.md +57 -0
  3. package/babel.config.json +34 -0
  4. package/eslint.config.mjs +7 -0
  5. package/lib/api/diy/comp/index.d.ts +17 -0
  6. package/lib/api/diy/comp/index.js +115 -0
  7. package/lib/api/diy/comp/types.d.ts +46 -0
  8. package/lib/api/diy/comp/types.js +1 -0
  9. package/lib/api/diy/page/index.d.ts +11 -0
  10. package/lib/api/diy/page/index.js +64 -0
  11. package/lib/api/diy/page/types.d.ts +33 -0
  12. package/lib/api/diy/page/types.js +1 -0
  13. package/lib/api/diy/types.d.ts +95 -0
  14. package/lib/api/diy/types.js +32 -0
  15. package/lib/index.d.ts +5 -0
  16. package/lib/index.js +3 -0
  17. package/lib/node_modules/.pnpm/jmash-core-mp@0.1.8_typescript@4.9.5/node_modules/jmash-core-mp/src/api/auth/index.d.ts +21 -0
  18. package/lib/node_modules/.pnpm/jmash-core-mp@0.1.8_typescript@4.9.5/node_modules/jmash-core-mp/src/api/auth/types.d.ts +86 -0
  19. package/lib/node_modules/.pnpm/jmash-core-mp@0.1.8_typescript@4.9.5/node_modules/jmash-core-mp/src/api/cms/index.d.ts +9 -0
  20. package/lib/node_modules/.pnpm/jmash-core-mp@0.1.8_typescript@4.9.5/node_modules/jmash-core-mp/src/api/files/index.d.ts +25 -0
  21. package/lib/node_modules/.pnpm/jmash-core-mp@0.1.8_typescript@4.9.5/node_modules/jmash-core-mp/src/api/files/types.d.ts +38 -0
  22. package/lib/node_modules/.pnpm/jmash-core-mp@0.1.8_typescript@4.9.5/node_modules/jmash-core-mp/src/components/auth-user/jmash-update-user.mpx.d.ts +1 -0
  23. package/lib/node_modules/.pnpm/jmash-core-mp@0.1.8_typescript@4.9.5/node_modules/jmash-core-mp/src/components/core/jmash-login.mpx.d.ts +1 -0
  24. package/lib/node_modules/.pnpm/jmash-core-mp@0.1.8_typescript@4.9.5/node_modules/jmash-core-mp/src/store/user.d.ts +31 -0
  25. package/lib/node_modules/.pnpm/jmash-core-mp@0.1.8_typescript@4.9.5/node_modules/jmash-core-mp/src/types/core.d.ts +41 -0
  26. package/lib/node_modules/.pnpm/jmash-core-mp@0.1.8_typescript@4.9.5/node_modules/jmash-core-mp/src/utils/config.d.ts +3 -0
  27. package/lib/node_modules/.pnpm/jmash-core-mp@0.1.8_typescript@4.9.5/node_modules/jmash-core-mp/src/utils/db.d.ts +21 -0
  28. package/lib/node_modules/.pnpm/jmash-core-mp@0.1.8_typescript@4.9.5/node_modules/jmash-core-mp/src/utils/grpc.d.ts +5 -0
  29. package/lib/node_modules/.pnpm/jmash-core-mp@0.1.8_typescript@4.9.5/node_modules/jmash-core-mp/src/utils/net.d.ts +7 -0
  30. package/lib/src/api/diy/comp/index.d.ts +17 -0
  31. package/lib/src/api/diy/comp/types.d.ts +46 -0
  32. package/lib/src/api/diy/page/index.d.ts +11 -0
  33. package/lib/src/api/diy/page/types.d.ts +33 -0
  34. package/lib/src/api/diy/types.d.ts +95 -0
  35. package/lib/src/components/custom/custom-view.mpx.d.ts +1 -0
  36. package/lib/src/components/custom/organ-custom-view.mpx.d.ts +1 -0
  37. package/lib/src/components/organ/organ-contact-view.mpx.d.ts +1 -0
  38. package/lib/src/components/organ/organ-map-view.mpx.d.ts +1 -0
  39. package/lib/src/components/organ/organ-notice-view.mpx.d.ts +1 -0
  40. package/lib/src/index.d.ts +5 -0
  41. package/lib/src/pages/index.mpx.d.ts +1 -0
  42. package/mpx.config.js +26 -0
  43. package/package.json +73 -0
  44. package/postcss.config.js +11 -0
  45. package/project.config.json +25 -0
  46. package/project.private.config.json +14 -0
  47. package/public/index.html +15 -0
  48. package/src/api/diy/comp/index.ts +161 -0
  49. package/src/api/diy/comp/types.ts +87 -0
  50. package/src/api/diy/page/index.ts +80 -0
  51. package/src/api/diy/page/types.ts +64 -0
  52. package/src/api/diy/types.ts +197 -0
  53. package/src/app.mpx +40 -0
  54. package/src/components/basic/basic-image-view.mpx +156 -0
  55. package/src/components/basic/basic-none-data.mpx +58 -0
  56. package/src/components/basic/basic-text-view.mpx +62 -0
  57. package/src/components/basic/basic-title-view.mpx +120 -0
  58. package/src/components/basic/basic-video-view.mpx +116 -0
  59. package/src/components/custom/basic-custom-view.mpx +61 -0
  60. package/src/components/custom/custom-view-list.mpx +80 -0
  61. package/src/components/custom/custom-view.mpx +44 -0
  62. package/src/components/custom/organ-custom-view.mpx +62 -0
  63. package/src/components/organ/organ-contact-view.mpx +76 -0
  64. package/src/components/organ/organ-map-view.mpx +93 -0
  65. package/src/components/organ/organ-notice-view.mpx +176 -0
  66. package/src/global.d.ts +11 -0
  67. package/src/index.ts +34 -0
  68. package/src/pages/custom.mpx +34 -0
  69. package/src/pages/index.mpx +27 -0
  70. package/src/styles/index.scss +1 -0
  71. package/src/styles/vars.scss +27 -0
  72. package/static/ali/mini.project.json +4 -0
  73. package/static/dd/project.config.json +15 -0
  74. package/static/swan/project.swan.json +14 -0
  75. package/static/tt/project.config.json +11 -0
  76. package/static/wx/project.config.json +42 -0
  77. package/uno.config.js +9 -0
package/.editorconfig ADDED
@@ -0,0 +1,9 @@
1
+ root = true
2
+
3
+ [*]
4
+ charset = utf-8
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ insert_final_newline = true
9
+ trim_trailing_whitespace = true
package/README.md ADDED
@@ -0,0 +1,57 @@
1
+ # jmash-diy-mp
2
+
3
+ ## Project setup
4
+
5
+ ```javascript
6
+ // 开发构建,默认输出微信小程序
7
+ npm run serve
8
+
9
+ // 开发构建,跨平台输出支付宝小程序
10
+ npm run serve:ali
11
+
12
+ // 开发构建,跨平台输出 Web
13
+ npm run serve:web
14
+
15
+ // 开发构建,跨平台输出其他平台小程序target = swan|tt|qq|jd|ks
16
+ npm run serve -- --targets={target}
17
+
18
+ // 开发构建,同时输出多平台产物
19
+ npm run serve -- --targets=wx,ali,web
20
+
21
+ // 生产构建,默认输出微信小程序
22
+ npm run build
23
+
24
+ // 生产构建,跨平台输出
25
+ npm run build:ali
26
+ npm run build:web
27
+ npm run build -- --targets=wx,ali,web
28
+ ```
29
+
30
+ # ALi 小程序
31
+
32
+ 登录
33
+ minidev login
34
+
35
+ 调试开发
36
+ minidev dev
37
+
38
+ 本地 IP 调试
39
+ minidev dev --host 192.168.1.154
40
+
41
+ 真机调试
42
+ minidev remote-debug -a 2021006137629651
43
+
44
+ Web 端调试
45
+ minidev dev
46
+ web -a 2021006137629651
47
+ 真机预览
48
+ minidev preview -a 2021006137629651
49
+
50
+ # pnpm publish --no-git-checks
51
+
52
+ 官方镜像
53
+ npm config set registry https://registry.npmjs.org/
54
+ 国内镜像
55
+ npm config set registry https://registry.npmmirror.com/
56
+ 代理镜像
57
+ npm config set registry https://npm.crenjoy.com/
@@ -0,0 +1,34 @@
1
+ {
2
+ "presets": [
3
+ [
4
+ "@babel/preset-env",
5
+ {
6
+ "modules": false,
7
+ "shippedProposals": true
8
+ }
9
+ ],
10
+ ],
11
+ "plugins": [
12
+ [
13
+ "@babel/transform-runtime",
14
+ {
15
+ "corejs": 3,
16
+ "version": "^7.10.4"
17
+ }
18
+ ],
19
+ "@mpxjs/babel-plugin-inject-page-events",
20
+ ],
21
+ "sourceType": "unambiguous",
22
+ "env": {
23
+ "test": {
24
+ "presets": [
25
+ [
26
+ "@babel/env",
27
+ {
28
+ "shippedProposals": true
29
+ }
30
+ ]
31
+ ]
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,7 @@
1
+ import { mpxConfig } from '@mpxjs/eslint-config'
2
+ export default mpxConfig(
3
+ {
4
+ mpx: true,
5
+ typescript: true
6
+ }
7
+ )
@@ -0,0 +1,17 @@
1
+ import { ResponseData } from "jmash-core-mp";
2
+ import { DiyCompModel, DiyCompCreateReq, DiyCompList, DiyCompReq, DiyCompUpdateReq } from "./types";
3
+ import { CompModel } from "../types";
4
+ declare class DiyCompApiImpl {
5
+ convertModel(diyModel: DiyCompModel): CompModel;
6
+ convertModels(diyComps: Array<DiyCompModel>): Array<CompModel>;
7
+ findListByPage(pageId: string, vcardToken: string, tenant: string): Promise<ResponseData<DiyCompList>>;
8
+ findList(query: DiyCompReq, tenant: string): Promise<ResponseData<DiyCompList>>;
9
+ findById(compId: string, tenant: string): Promise<ResponseData<DiyCompModel>>;
10
+ create(data: DiyCompCreateReq, tenant: string): Promise<ResponseData<DiyCompModel>>;
11
+ move(compId: string, up: boolean, tenant: string): Promise<ResponseData<string>>;
12
+ moveTop(compId: string, top: boolean, tenant: string): Promise<ResponseData<string>>;
13
+ delete(compId: string, tenant: string): Promise<ResponseData<DiyCompModel>>;
14
+ update(data: DiyCompUpdateReq, tenant: string): Promise<ResponseData<DiyCompModel>>;
15
+ }
16
+ declare const diyCompApi: DiyCompApiImpl;
17
+ export { diyCompApi };
@@ -0,0 +1,115 @@
1
+ import mpx from "@mpxjs/core";
2
+ import { grpc } from "jmash-core-mp";
3
+ class DiyCompApiImpl {
4
+ // 转换组件模型
5
+ convertModel(diyModel) {
6
+ return Object.assign(diyModel, {
7
+ compData: JSON.parse(diyModel.compJson),
8
+ });
9
+ }
10
+ // 转换组件模型
11
+ convertModels(diyComps) {
12
+ const compModels = [];
13
+ for (const model of diyComps) {
14
+ const compModel = this.convertModel(model);
15
+ compModels.push(compModel);
16
+ }
17
+ return compModels;
18
+ }
19
+ // 获取页面组件
20
+ findListByPage(pageId, vcardToken, tenant) {
21
+ const diyCompReq = { pageId: pageId, vcardToken: vcardToken };
22
+ return this.findList(diyCompReq, tenant);
23
+ }
24
+ // 查询列表信息DIY模板组件
25
+ findList(query, tenant) {
26
+ grpc.clearEmpty(query);
27
+ return mpx.xfetch.fetch({
28
+ url: "/v1/front/diy/diy_component/list/" + tenant,
29
+ method: "GET",
30
+ data: query,
31
+ header: {
32
+ "Grpc-Metadata-Tenant": tenant,
33
+ },
34
+ });
35
+ }
36
+ // 查询DIY模板组件
37
+ findById(compId, tenant) {
38
+ return mpx.xfetch.fetch({
39
+ url: "/v1/front/diy/diy_component/id/" + tenant + "/" + compId,
40
+ method: "GET",
41
+ });
42
+ }
43
+ // 创建实体DIY模板组件
44
+ create(data, tenant) {
45
+ data.tenant = tenant;
46
+ grpc.clearEmpty(data);
47
+ return mpx.xfetch.fetch({
48
+ url: "/v1/front/diy/diy_component",
49
+ method: "POST",
50
+ data: data,
51
+ header: {
52
+ "Grpc-Metadata-Tenant": tenant,
53
+ },
54
+ });
55
+ }
56
+ // 上移下移
57
+ move(compId, up, tenant) {
58
+ const data = { compId: compId, up: up, tenant: tenant };
59
+ grpc.clearEmpty(data);
60
+ return mpx.xfetch.fetch({
61
+ url: "/v1/front/diy/diy_component/move",
62
+ method: "PUT",
63
+ data: data,
64
+ header: {
65
+ "Grpc-Metadata-Tenant": tenant,
66
+ },
67
+ });
68
+ }
69
+ // 置顶/置底
70
+ moveTop(compId, top, tenant) {
71
+ const data = {
72
+ compId: compId,
73
+ top: top,
74
+ tenant: tenant,
75
+ };
76
+ grpc.clearEmpty(data);
77
+ return mpx.xfetch.fetch({
78
+ url: "/v1/front/diy/diy_component/top",
79
+ method: "PUT",
80
+ data: data,
81
+ header: {
82
+ "Grpc-Metadata-Tenant": tenant,
83
+ },
84
+ });
85
+ }
86
+ // 删除DIY模板组件
87
+ delete(compId, tenant) {
88
+ return mpx.xfetch.fetch({
89
+ url: "/v1/front/diy/diy_component/id?" +
90
+ "tenant=" +
91
+ tenant +
92
+ "&compId=" +
93
+ compId,
94
+ method: "DELETE",
95
+ header: {
96
+ "Grpc-Metadata-Tenant": tenant,
97
+ },
98
+ });
99
+ }
100
+ // 修改实体DIY模板组件
101
+ update(data, tenant) {
102
+ data.tenant = tenant;
103
+ grpc.clearEmpty(data);
104
+ return mpx.xfetch.fetch({
105
+ url: "/v1/front/diy/diy_component",
106
+ method: "PATCH",
107
+ data: data,
108
+ header: {
109
+ "Grpc-Metadata-Tenant": tenant,
110
+ },
111
+ });
112
+ }
113
+ }
114
+ const diyCompApi = new DiyCompApiImpl();
115
+ export { diyCompApi };
@@ -0,0 +1,46 @@
1
+ export interface DiyCompModel {
2
+ compId?: string;
3
+ pageId?: string;
4
+ compCode?: string;
5
+ compName?: string;
6
+ compType?: string;
7
+ compJson: string;
8
+ orderBy?: number;
9
+ }
10
+ export interface DiyCompCreateReq {
11
+ tenant?: string;
12
+ requestId?: string;
13
+ pageId?: string;
14
+ compCode?: string;
15
+ compName?: string;
16
+ compType?: string;
17
+ compJson?: string;
18
+ orderBy?: number;
19
+ }
20
+ export interface DiyCompList {
21
+ results: Array<DiyCompModel>;
22
+ }
23
+ export interface DiyCompReq {
24
+ createBy: string;
25
+ pageId: string;
26
+ vcardToken: string;
27
+ }
28
+ export interface DiyCompMoveKey {
29
+ tenant?: string;
30
+ compId?: string;
31
+ up?: boolean;
32
+ }
33
+ export interface DiyCompMoveTopKey {
34
+ tenant?: string;
35
+ compId?: string;
36
+ top?: boolean;
37
+ }
38
+ export interface DiyCompUpdateReq {
39
+ tenant?: string;
40
+ requestId?: string;
41
+ updateMask?: string;
42
+ compId?: string;
43
+ compName?: string;
44
+ compJson?: string;
45
+ }
46
+ export type DiyCompFormReq = (DiyCompCreateReq | DiyCompUpdateReq);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { ResponseData } from "jmash-core-mp";
2
+ import { PageModel } from "../types";
3
+ import { DiyPageModel, DiyPageVcardReq, DiyPageUpdateReq } from "./types";
4
+ declare class DiyPageApiImpl {
5
+ convertModel(diyPageModel: DiyPageModel): PageModel;
6
+ findHomePage(vcardKey: string): Promise<ResponseData<DiyPageModel>>;
7
+ findDiyPageCandidate(query: DiyPageVcardReq): Promise<ResponseData<DiyPageModel>>;
8
+ update(data: DiyPageUpdateReq, tenant: string): Promise<ResponseData<DiyPageModel>>;
9
+ }
10
+ declare const diyPageApi: DiyPageApiImpl;
11
+ export { diyPageApi };
@@ -0,0 +1,64 @@
1
+ import mpx from "@mpxjs/core";
2
+ import { grpc } from "jmash-core-mp";
3
+ import { diyCompApi } from "../comp/index";
4
+ class DiyPageApiImpl {
5
+ // 转换为PageModel
6
+ convertModel(diyPageModel) {
7
+ const pageModel = Object.assign(diyPageModel, {
8
+ pageData: JSON.parse(diyPageModel.pageJson),
9
+ });
10
+ if (diyPageModel.compModels) {
11
+ const compModels = diyCompApi.convertModels(diyPageModel.compModels);
12
+ pageModel.compModels = compModels;
13
+ }
14
+ return pageModel;
15
+ }
16
+ // 获取首页
17
+ findHomePage(vcardKey) {
18
+ const diyPageVcardKey = {
19
+ vcardKey: vcardKey,
20
+ pageCode: "home",
21
+ hasComps: true,
22
+ };
23
+ return this.findDiyPageCandidate(diyPageVcardKey);
24
+ }
25
+ // 通过候选键查询DIY页面模板
26
+ findDiyPageCandidate(query) {
27
+ grpc.clearEmpty(query);
28
+ if (query.vcardKey) {
29
+ return mpx.xfetch.fetch({
30
+ url: "/v1/front/diy/diy_page/candidate/" +
31
+ query.vcardKey +
32
+ "/" +
33
+ query.pageCode,
34
+ method: "GET",
35
+ data: query,
36
+ });
37
+ }
38
+ else {
39
+ return mpx.xfetch.fetch({
40
+ url: "/v1/front/diy/diy_page/candidate/share/" +
41
+ query.vcardToken +
42
+ "/" +
43
+ query.pageCode,
44
+ method: "GET",
45
+ data: query,
46
+ });
47
+ }
48
+ }
49
+ // 修改实体DIY页面模板
50
+ update(data, tenant) {
51
+ data.tenant = tenant;
52
+ // pageTemplate字段默认传空 所以不能使用这个 grpc.clearEmpty(data);
53
+ return mpx.xfetch.fetch({
54
+ url: "/v1/front/diy/diy_page",
55
+ method: "PATCH",
56
+ data: data,
57
+ header: {
58
+ "Grpc-Metadata-Tenant": tenant,
59
+ },
60
+ });
61
+ }
62
+ }
63
+ const diyPageApi = new DiyPageApiImpl();
64
+ export { diyPageApi };
@@ -0,0 +1,33 @@
1
+ import { PageData } from "../types";
2
+ import { DiyCompModel } from "../comp/types";
3
+ export interface DiyPageModel {
4
+ pageId: string;
5
+ vcardId?: string;
6
+ pageName?: string;
7
+ pageCode?: string;
8
+ pageTemplate?: string;
9
+ pageImgUrl?: string;
10
+ pageData: PageData;
11
+ pageJson: string;
12
+ orderBy?: number;
13
+ compModels?: Array<DiyCompModel>;
14
+ }
15
+ export interface DiyPageVcardReq {
16
+ vcardKey?: string;
17
+ vcardToken?: string;
18
+ pageCode?: string;
19
+ hasComps?: boolean;
20
+ }
21
+ export interface DiyPageUpdateReq {
22
+ requestId: string;
23
+ updateMask: string;
24
+ tenant?: string;
25
+ pageId: string;
26
+ vcardId?: string;
27
+ pageName: string;
28
+ pageCode?: string;
29
+ pageTemplate: string;
30
+ pageImgUrl: string;
31
+ pageJson: string;
32
+ orderBy?: number;
33
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,95 @@
1
+ export interface Comp {
2
+ compCode: CompCode;
3
+ compName: string;
4
+ compType: CompType;
5
+ compData: CompDataType;
6
+ }
7
+ export interface CompData {
8
+ showTitle: boolean;
9
+ titleStyle: TitleStyle;
10
+ init: boolean;
11
+ style?: any;
12
+ showMore?: boolean;
13
+ }
14
+ export type CompType = "BASIC" | "VCARD" | "ORGAN" | "MALL" | "OTHER";
15
+ export type TitleStyle = "left" | "center" | "right";
16
+ export interface ImageComp extends CompData {
17
+ style: ImageStyle;
18
+ imageUrls: Array<string>;
19
+ }
20
+ export declare enum ImageStyle {
21
+ swiper = "swiper",
22
+ flat = "flat",
23
+ grid = "grid"
24
+ }
25
+ export interface AudioComp extends CompData {
26
+ url: string;
27
+ autoPlay: boolean;
28
+ hidden: boolean;
29
+ external: boolean;
30
+ }
31
+ export interface VideoComp extends CompData {
32
+ imageUrl: string;
33
+ width: number;
34
+ height: number;
35
+ size: number;
36
+ duration: number;
37
+ videoUrl: string;
38
+ external: boolean;
39
+ }
40
+ export interface MapComp extends CompData {
41
+ }
42
+ export type CompCode = "text" | "image" | "video" | "audio" | "map";
43
+ export type CompDataType = MapComp | TextComp | ImageComp | VideoComp | AudioComp;
44
+ export interface TextComp extends CompData {
45
+ text: string;
46
+ }
47
+ export interface PageData {
48
+ theme: ThemeStyle;
49
+ edition: Edition;
50
+ themeIndex: number;
51
+ }
52
+ export declare enum ThemeStyle {
53
+ blue = 0,
54
+ red = 1,
55
+ gray = 2,
56
+ while = 3
57
+ }
58
+ export declare enum Edition {
59
+ com = 0,
60
+ gov = 1,
61
+ edu = 2
62
+ }
63
+ export interface PageModel {
64
+ pageId?: string;
65
+ vcardId?: string;
66
+ pageName?: string;
67
+ pageCode?: string;
68
+ pageTemplate?: string;
69
+ pageImgUrl?: string;
70
+ pageData?: PageData;
71
+ pageJson: string;
72
+ compModels?: Array<CompModel>;
73
+ }
74
+ export interface CompModel {
75
+ compId: string;
76
+ pageId: string;
77
+ compCode: CompCode;
78
+ compName: string;
79
+ compType: CompType;
80
+ compData: CompDataType;
81
+ orderBy: number;
82
+ }
83
+ export interface BusiDataModel {
84
+ }
85
+ export interface CompEventModel {
86
+ pageModel: PageModel;
87
+ compModel: CompModel;
88
+ busiDataModel: BusiDataModel;
89
+ }
90
+ export interface OrganDataModel extends BusiDataModel {
91
+ latitude: number;
92
+ longitude: number;
93
+ address: string;
94
+ mobilePhone: string;
95
+ }
@@ -0,0 +1,32 @@
1
+ // 图片样式
2
+ export var ImageStyle;
3
+ (function (ImageStyle) {
4
+ // 轮播
5
+ ImageStyle["swiper"] = "swiper";
6
+ // 平铺
7
+ ImageStyle["flat"] = "flat";
8
+ // 九宫格
9
+ ImageStyle["grid"] = "grid";
10
+ })(ImageStyle || (ImageStyle = {}));
11
+ // 页面主题
12
+ export var ThemeStyle;
13
+ (function (ThemeStyle) {
14
+ // 科技蓝
15
+ ThemeStyle[ThemeStyle["blue"] = 0] = "blue";
16
+ // 中国红
17
+ ThemeStyle[ThemeStyle["red"] = 1] = "red";
18
+ // 优雅灰
19
+ ThemeStyle[ThemeStyle["gray"] = 2] = "gray";
20
+ // 简约白
21
+ ThemeStyle[ThemeStyle["while"] = 3] = "while";
22
+ })(ThemeStyle || (ThemeStyle = {}));
23
+ // 页面版式
24
+ export var Edition;
25
+ (function (Edition) {
26
+ // 商务版
27
+ Edition[Edition["com"] = 0] = "com";
28
+ // 政务版
29
+ Edition[Edition["gov"] = 1] = "gov";
30
+ // 教育版
31
+ Edition[Edition["edu"] = 2] = "edu";
32
+ })(Edition || (Edition = {}));
package/lib/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ export type { DiyPageModel, DiyPageUpdateReq } from "./api/diy/page/types";
2
+ export type { DiyCompModel, DiyCompCreateReq, DiyCompList, DiyCompReq, DiyCompMoveKey, DiyCompMoveTopKey, DiyCompUpdateReq, } from "./api/diy/comp/types";
3
+ export { CompModel, PageModel, Edition, ThemeStyle, PageData, TextComp, CompData, CompDataType, CompCode, VideoComp, MapComp, ImageComp, AudioComp, ImageStyle, TitleStyle, CompType, Comp, BusiDataModel, OrganDataModel, CompEventModel, } from "./api/diy/types";
4
+ export { diyCompApi } from "./api/diy/comp";
5
+ export { diyPageApi } from "./api/diy/page";
package/lib/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { Edition, ThemeStyle, ImageStyle, } from "./api/diy/types";
2
+ export { diyCompApi } from "./api/diy/comp";
3
+ export { diyPageApi } from "./api/diy/page";
@@ -0,0 +1,21 @@
1
+ import { ResponseData } from "../../types/core";
2
+ import type { LoginReq, LoginRes, RolesPerms, WebLoginReq, TokenModel, PhoneRegisterReq, PhoneReplaceReq, UpdateUserReq, UserInfoReq, UserInfo } from "./types";
3
+ declare class AuthApi {
4
+ mpLogin(data: LoginReq): Promise<ResponseData<LoginRes>>;
5
+ mpPhoneRegister(data: PhoneRegisterReq): Promise<ResponseData<LoginRes>>;
6
+ replaceBindphone(data: PhoneReplaceReq): Promise<ResponseData<string>>;
7
+ webLogin(data: WebLoginReq): Promise<ResponseData<TokenModel>>;
8
+ refreshToken(): Promise<ResponseData<TokenModel>>;
9
+ userInfo(): Promise<ResponseData<UserInfo>>;
10
+ userRolesPerms(): Promise<ResponseData<RolesPerms>>;
11
+ allowRunAsUser(): Promise<ResponseData<any[]>>;
12
+ runAsUser(userId: string): Promise<ResponseData<any>>;
13
+ updateUser(data: any): Promise<ResponseData<any>>;
14
+ updatePwd(encodeOldPwd: string, encodeNewPwd: string): Promise<ResponseData<any>>;
15
+ deptTree(deptId?: string, tenant?: string): Promise<ResponseData<any[]>>;
16
+ jobTree(jobId?: string, tenant?: string): Promise<ResponseData<any[]>>;
17
+ updateUserInfo(data: UpdateUserReq): Promise<ResponseData<UserInfo>>;
18
+ findUserInfo(data: UserInfoReq): Promise<ResponseData<UserInfo>>;
19
+ }
20
+ export declare const authApi: AuthApi;
21
+ export {};
@@ -0,0 +1,86 @@
1
+ export interface TokenModel {
2
+ accessToken: string;
3
+ expiresIn: number;
4
+ refreshToken: string;
5
+ tokenType: string;
6
+ }
7
+ export declare enum OpensType {
8
+ wechat = 0,
9
+ ali_pay = 1,
10
+ union_pay = 2
11
+ }
12
+ export interface LoginReq {
13
+ appId: string;
14
+ loginCode: string;
15
+ componentAppid?: string;
16
+ opensType?: OpensType;
17
+ }
18
+ /**
19
+ * 登录请求参数
20
+ */
21
+ export interface WebLoginReq {
22
+ tenant?: string;
23
+ directoryId?: string;
24
+ scope?: string;
25
+ userName: string;
26
+ encodePwd: string;
27
+ captchaId?: string;
28
+ captchaCode?: string;
29
+ clientId?: string;
30
+ }
31
+ export interface LoginRes {
32
+ cacheKey?: string;
33
+ token: TokenModel;
34
+ status: boolean;
35
+ message: string;
36
+ }
37
+ export interface PhoneRegisterReq {
38
+ tenant?: string;
39
+ appId: string;
40
+ loginCode?: string;
41
+ phoneCode: string;
42
+ nickName?: string;
43
+ avatar?: string;
44
+ componentAppid?: string;
45
+ opensType?: OpensType;
46
+ }
47
+ export interface PhoneReplaceReq {
48
+ tenant?: string;
49
+ appId: string;
50
+ phoneCode: string;
51
+ componentAppid?: string;
52
+ opensType?: OpensType;
53
+ }
54
+ export interface RefreshTokenReq {
55
+ tenant: string;
56
+ refreshToken: string;
57
+ clientId: string;
58
+ }
59
+ export interface UserInfo {
60
+ userId: string;
61
+ loginName: string;
62
+ nickName: string;
63
+ realName: string;
64
+ avatar: string;
65
+ mobilePhone: string;
66
+ mobilePhoneIns: string;
67
+ storage: string;
68
+ unifiedId: string;
69
+ }
70
+ export interface RolesPerms {
71
+ roleCodes: string[];
72
+ permCodes: string[];
73
+ }
74
+ export interface UpdateUserReq {
75
+ tenant?: string;
76
+ requestId?: string;
77
+ updateMask?: string;
78
+ nickName?: string;
79
+ avatar?: string;
80
+ realName?: string;
81
+ gender?: string;
82
+ birthDate?: string;
83
+ }
84
+ export interface UserInfoReq {
85
+ tenant?: string;
86
+ }
@@ -0,0 +1,9 @@
1
+ import { CmsSiteList, CmsChannelReq, CmsChannelList, CmsContentInfoReq, CmsContentInfoModel } from "./types";
2
+ import { ResponseData } from "../../types/core";
3
+ declare class CmsApiImpl {
4
+ findCmsSiteList(tenant: string): Promise<ResponseData<CmsSiteList>>;
5
+ findCmsChannelList(data: CmsChannelReq): Promise<ResponseData<CmsChannelList>>;
6
+ findCmsContentInfo(data: CmsContentInfoReq): Promise<ResponseData<CmsContentInfoModel>>;
7
+ }
8
+ declare const cmsApi: CmsApiImpl;
9
+ export { cmsApi };