jmash-diy-mp 0.1.0 → 0.1.2
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.
- package/.editorconfig +9 -9
- package/README.md +57 -57
- package/babel.config.json +34 -34
- package/eslint.config.mjs +7 -7
- package/lib/api/diy/comp/index.d.ts +17 -17
- package/lib/api/diy/comp/index.js +115 -115
- package/lib/api/diy/comp/types.d.ts +46 -46
- package/lib/api/diy/comp/types.js +1 -1
- package/lib/api/diy/page/index.d.ts +11 -11
- package/lib/api/diy/page/index.js +64 -64
- package/lib/api/diy/page/types.d.ts +33 -33
- package/lib/api/diy/page/types.js +1 -1
- package/lib/api/diy/types.d.ts +104 -95
- package/lib/api/diy/types.js +32 -32
- package/lib/components/basic/basic-title-view.mpx.d.ts +1 -0
- package/lib/components/custom/basic-custom-view.mpx.d.ts +1 -0
- package/lib/components/custom/organ-custom-view.mpx.d.ts +1 -0
- package/lib/components/organ/organ-map-view.mpx.d.ts +1 -0
- package/lib/components/organ/organ-notice-view.mpx.d.ts +1 -0
- package/lib/index.d.ts +5 -5
- package/lib/index.js +3 -3
- package/lib/node_modules/.pnpm/{jmash-core-mp@0.1.8_typescript@4.9.5 → jmash-core-mp@0.1.13_typescript@4.9.5}/node_modules/jmash-core-mp/src/api/auth/index.d.ts +21 -21
- package/lib/node_modules/.pnpm/{jmash-core-mp@0.1.8_typescript@4.9.5 → jmash-core-mp@0.1.13_typescript@4.9.5}/node_modules/jmash-core-mp/src/api/auth/types.d.ts +86 -86
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.13_typescript@4.9.5/node_modules/jmash-core-mp/src/api/cms/index.d.ts +20 -0
- package/lib/node_modules/.pnpm/{jmash-core-mp@0.1.8_typescript@4.9.5 → jmash-core-mp@0.1.13_typescript@4.9.5}/node_modules/jmash-core-mp/src/api/files/index.d.ts +25 -25
- package/lib/node_modules/.pnpm/{jmash-core-mp@0.1.8_typescript@4.9.5 → jmash-core-mp@0.1.13_typescript@4.9.5}/node_modules/jmash-core-mp/src/api/files/types.d.ts +38 -38
- 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 → jmash-core-mp@0.1.13_typescript@4.9.5/node_modules/jmash-core-mp/src/api/types.d.ts} +41 -41
- package/lib/node_modules/.pnpm/{jmash-core-mp@0.1.8_typescript@4.9.5 → jmash-core-mp@0.1.13_typescript@4.9.5}/node_modules/jmash-core-mp/src/components/auth-user/jmash-update-user.mpx.d.ts +1 -1
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.13_typescript@4.9.5/node_modules/jmash-core-mp/src/components/cms/jmash-cms-article.mpx.d.ts +1 -0
- package/lib/node_modules/.pnpm/{jmash-core-mp@0.1.8_typescript@4.9.5 → jmash-core-mp@0.1.13_typescript@4.9.5}/node_modules/jmash-core-mp/src/components/core/jmash-login.mpx.d.ts +1 -1
- package/lib/node_modules/.pnpm/{jmash-core-mp@0.1.8_typescript@4.9.5 → jmash-core-mp@0.1.13_typescript@4.9.5}/node_modules/jmash-core-mp/src/store/user.d.ts +31 -31
- package/lib/node_modules/.pnpm/{jmash-core-mp@0.1.8_typescript@4.9.5 → jmash-core-mp@0.1.13_typescript@4.9.5}/node_modules/jmash-core-mp/src/utils/config.d.ts +3 -3
- package/lib/node_modules/.pnpm/{jmash-core-mp@0.1.8_typescript@4.9.5 → jmash-core-mp@0.1.13_typescript@4.9.5}/node_modules/jmash-core-mp/src/utils/db.d.ts +21 -21
- package/lib/node_modules/.pnpm/{jmash-core-mp@0.1.8_typescript@4.9.5 → jmash-core-mp@0.1.13_typescript@4.9.5}/node_modules/jmash-core-mp/src/utils/grpc.d.ts +5 -5
- package/lib/node_modules/.pnpm/{jmash-core-mp@0.1.8_typescript@4.9.5 → jmash-core-mp@0.1.13_typescript@4.9.5}/node_modules/jmash-core-mp/src/utils/net.d.ts +7 -7
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.14_typescript@4.9.5/node_modules/jmash-core-mp/src/api/auth/index.d.ts +21 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.14_typescript@4.9.5/node_modules/jmash-core-mp/src/api/auth/types.d.ts +86 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.14_typescript@4.9.5/node_modules/jmash-core-mp/src/api/cms/index.d.ts +20 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.14_typescript@4.9.5/node_modules/jmash-core-mp/src/api/cms/types.d.ts +200 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.14_typescript@4.9.5/node_modules/jmash-core-mp/src/api/files/index.d.ts +25 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.14_typescript@4.9.5/node_modules/jmash-core-mp/src/api/types.d.ts +41 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.14_typescript@4.9.5/node_modules/jmash-core-mp/src/components/auth-user/jmash-update-user.mpx.d.ts +1 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.14_typescript@4.9.5/node_modules/jmash-core-mp/src/components/cms/jmash-cms-article.mpx.d.ts +1 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.14_typescript@4.9.5/node_modules/jmash-core-mp/src/components/core/jmash-login.mpx.d.ts +1 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.14_typescript@4.9.5/node_modules/jmash-core-mp/src/packages/pages/cms/cms-article-list.mpx.d.ts +1 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.14_typescript@4.9.5/node_modules/jmash-core-mp/src/store/user.d.ts +31 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.14_typescript@4.9.5/node_modules/jmash-core-mp/src/utils/config.d.ts +3 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.14_typescript@4.9.5/node_modules/jmash-core-mp/src/utils/db.d.ts +21 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.14_typescript@4.9.5/node_modules/jmash-core-mp/src/utils/grpc.d.ts +5 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.14_typescript@4.9.5/node_modules/jmash-core-mp/src/utils/net.d.ts +7 -0
- package/lib/src/api/diy/comp/index.d.ts +17 -17
- package/lib/src/api/diy/comp/types.d.ts +46 -46
- package/lib/src/api/diy/page/index.d.ts +11 -11
- package/lib/src/api/diy/page/types.d.ts +33 -33
- package/lib/src/api/diy/types.d.ts +104 -95
- package/lib/src/app.mpx.d.ts +1 -0
- package/lib/src/components/basic/basic-image-view.mpx.d.ts +1 -0
- package/lib/src/components/basic/basic-none-data.mpx.d.ts +1 -0
- package/lib/src/components/basic/basic-text-view.mpx.d.ts +1 -0
- package/lib/src/components/basic/basic-title-view.mpx.d.ts +1 -0
- package/lib/src/components/basic/basic-video-view.mpx.d.ts +1 -0
- package/lib/src/components/custom/basic-custom-view.mpx.d.ts +1 -0
- package/lib/src/components/custom/custom-view-list.mpx.d.ts +1 -0
- package/lib/src/components/custom/custom-view.mpx.d.ts +1 -1
- package/lib/src/components/custom/organ-custom-view.mpx.d.ts +1 -1
- package/lib/src/components/organ/organ-contact-view.mpx.d.ts +1 -1
- package/lib/src/components/organ/organ-map-view.mpx.d.ts +1 -1
- package/lib/src/components/organ/organ-notice-view.mpx.d.ts +1 -1
- package/lib/src/index.d.ts +5 -5
- package/lib/src/pages/custom.mpx.d.ts +1 -0
- package/lib/src/pages/index.mpx.d.ts +1 -1
- package/mpx.config.js +26 -26
- package/package.json +2 -2
- package/postcss.config.js +11 -11
- package/project.config.json +24 -24
- package/project.private.config.json +13 -13
- package/public/index.html +15 -15
- package/src/api/diy/comp/index.ts +161 -161
- package/src/api/diy/comp/types.ts +86 -86
- package/src/api/diy/page/index.ts +80 -80
- package/src/api/diy/page/types.ts +64 -64
- package/src/api/diy/types.ts +220 -197
- package/src/app.mpx +40 -40
- package/src/components/basic/basic-image-view.mpx +156 -156
- package/src/components/basic/basic-none-data.mpx +57 -57
- package/src/components/basic/basic-text-view.mpx +61 -61
- package/src/components/basic/basic-title-view.mpx +135 -119
- package/src/components/basic/basic-video-view.mpx +115 -115
- package/src/components/custom/basic-custom-view.mpx +65 -61
- package/src/components/custom/custom-view-list.mpx +80 -80
- package/src/components/custom/custom-view.mpx +44 -44
- package/src/components/custom/organ-custom-view.mpx +66 -62
- package/src/components/organ/organ-contact-view.mpx +75 -75
- package/src/components/organ/organ-map-view.mpx +106 -92
- package/src/components/organ/organ-notice-view.mpx +190 -175
- package/src/global.d.ts +11 -11
- package/src/index.ts +34 -34
- package/src/pages/custom.mpx +32 -34
- package/src/pages/index.mpx +27 -27
- package/src/styles/index.scss +1 -1
- package/src/styles/vars.scss +27 -27
- package/static/ali/mini.project.json +4 -4
- package/static/dd/project.config.json +15 -15
- package/static/swan/project.swan.json +14 -14
- package/static/tt/project.config.json +11 -11
- package/static/wx/project.config.json +41 -41
- package/uno.config.js +9 -9
- 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 +0 -9
package/.editorconfig
CHANGED
|
@@ -1,9 +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
|
|
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
CHANGED
|
@@ -1,57 +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/
|
|
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/
|
package/babel.config.json
CHANGED
|
@@ -1,34 +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
|
-
}
|
|
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
|
+
}
|
package/eslint.config.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { mpxConfig } from '@mpxjs/eslint-config'
|
|
2
|
-
export default mpxConfig(
|
|
3
|
-
{
|
|
4
|
-
mpx: true,
|
|
5
|
-
typescript: true
|
|
6
|
-
}
|
|
7
|
-
)
|
|
1
|
+
import { mpxConfig } from '@mpxjs/eslint-config'
|
|
2
|
+
export default mpxConfig(
|
|
3
|
+
{
|
|
4
|
+
mpx: true,
|
|
5
|
+
typescript: true
|
|
6
|
+
}
|
|
7
|
+
)
|
|
@@ -1,17 +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 };
|
|
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 };
|
|
@@ -1,115 +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 };
|
|
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 };
|
|
@@ -1,46 +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);
|
|
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);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export {};
|
|
@@ -1,11 +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 };
|
|
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 };
|