jmash-core-merchant-mp 0.1.1
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 -0
- package/README.md +28 -0
- package/babel.config.json +34 -0
- package/eslint.config.mjs +5 -0
- package/lib/api/auth/index.d.ts +12 -0
- package/lib/api/auth/index.js +74 -0
- package/lib/api/auth/types.d.ts +110 -0
- package/lib/api/auth/types.js +1 -0
- package/lib/api/authConstant.d.ts +11 -0
- package/lib/api/authConstant.js +12 -0
- package/lib/api/myorgan/index.d.ts +7 -0
- package/lib/api/myorgan/index.js +15 -0
- package/lib/api/myorgan/types.d.ts +5 -0
- package/lib/api/myorgan/types.js +1 -0
- package/lib/api/organConstant.d.ts +14 -0
- package/lib/api/organConstant.js +18 -0
- package/lib/api/shop/index.d.ts +20 -0
- package/lib/api/shop/index.js +158 -0
- package/lib/api/shop/types.d.ts +198 -0
- package/lib/api/shop/types.js +1 -0
- package/lib/api/storage/index.d.ts +14 -0
- package/lib/api/storage/index.js +97 -0
- package/lib/api/storage/types.d.ts +61 -0
- package/lib/api/storage/types.js +1 -0
- package/lib/index.d.ts +6 -0
- package/lib/index.js +6 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/helper/config-provider.d.ts +6 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/helper/confirm-button-group.d.ts +53 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/helper/create-component.d.ts +28 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/helper/utils.d.ts +15 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/common/config-provider.d.ts +2 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/common/options.d.ts +7 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/common/theme-props.d.ts +13 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/confirm-button-group.d.ts +43 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/form/checkbox-group.d.ts +62 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/form/form-item.d.ts +33 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/form/radio-group.d.ts +51 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/index.d.ts +21 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/mask.d.ts +18 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/methods.d.ts +10 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/modal/props.d.ts +50 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/picker/date-picker.d.ts +37 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/picker/picker-common.d.ts +24 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/picker/picker.d.ts +20 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/picker/time-picker.d.ts +85 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/picker-modal/picker-modal-base.d.ts +57 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/picker-popup/index.d.ts +24 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/picker-popup/picker-popup-base.d.ts +27 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/popup.d.ts +30 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/transition.d.ts +30 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/var-context.d.ts +8 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/common/mixins/visibility.d.ts +21 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/components/icon/icon.d.ts +1 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/components/picker/picker.d.ts +10 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/components/popup/popup.d.ts +1 -0
- package/lib/node_modules/.pnpm/@mpxjs+mpx-cube-ui@1.4.17/node_modules/@mpxjs/mpx-cube-ui/src/types/form-item.d.ts +48 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.44_typescript@4.9.5/node_modules/jmash-core-mp/src/api/types.d.ts +43 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.44_typescript@4.9.5/node_modules/jmash-core-mp/src/components/common/jmash-form-cell.mpx.d.ts +1 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.44_typescript@4.9.5/node_modules/jmash-core-mp/src/components/common/jmash-none-data.mpx.d.ts +1 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.44_typescript@4.9.5/node_modules/jmash-core-mp/src/components/common/jmash-popup.mpx.d.ts +1 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.44_typescript@4.9.5/node_modules/jmash-core-mp/src/components/common/jmash-single-btn.mpx.d.ts +1 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.44_typescript@4.9.5/node_modules/jmash-core-mp/src/components/common/jmash-swipe-cell.mpx.d.ts +1 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.44_typescript@4.9.5/node_modules/jmash-core-mp/src/components/common/jmash-top-navigation.mpx.d.ts +1 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.44_typescript@4.9.5/node_modules/jmash-core-mp/src/components/common/jmash-upload-picture.mpx.d.ts +1 -0
- package/lib/node_modules/.pnpm/jmash-core-mp@0.1.44_typescript@4.9.5/node_modules/jmash-core-mp/src/utils/db.d.ts +21 -0
- package/lib/src/api/auth/index.d.ts +12 -0
- package/lib/src/api/auth/types.d.ts +110 -0
- package/lib/src/api/authConstant.d.ts +11 -0
- package/lib/src/api/myorgan/index.d.ts +7 -0
- package/lib/src/api/myorgan/types.d.ts +5 -0
- package/lib/src/api/organConstant.d.ts +14 -0
- package/lib/src/api/shop/index.d.ts +20 -0
- package/lib/src/api/shop/types.d.ts +198 -0
- package/lib/src/api/storage/index.d.ts +14 -0
- package/lib/src/api/storage/types.d.ts +61 -0
- package/lib/src/app.mpx.d.ts +1 -0
- package/lib/src/components/add-admin-popup.mpx.d.ts +1 -0
- package/lib/src/components/change-shop.mpx.d.ts +1 -0
- package/lib/src/components/work-grid.mpx.d.ts +1 -0
- package/lib/src/index.d.ts +6 -0
- package/lib/src/packages/shop-merchant/components/add-customer-service-popup.mpx.d.ts +1 -0
- package/lib/src/packages/shop-merchant/components/admin-list.mpx.d.ts +1 -0
- package/lib/src/packages/shop-merchant/components/employee-list-branch.mpx.d.ts +1 -0
- package/lib/src/packages/shop-merchant/components/employee-list-shop.mpx.d.ts +1 -0
- package/lib/src/packages/shop-merchant/pages/admin-list.mpx.d.ts +1 -0
- package/lib/src/packages/shop-merchant/pages/customer-service.mpx.d.ts +1 -0
- package/lib/src/packages/shop-merchant/pages/employee-edit.mpx.d.ts +1 -0
- package/lib/src/packages/shop-merchant/pages/employee-list.mpx.d.ts +1 -0
- package/lib/src/pages/index.mpx.d.ts +1 -0
- package/lib/src/pages/welcome.mpx.d.ts +1 -0
- package/lib/src/pages/work.mpx.d.ts +1 -0
- package/mpx.config.js +25 -0
- package/package.json +62 -0
- package/postcss.config.js +11 -0
- package/public/index.html +17 -0
- package/src/api/auth/index.ts +90 -0
- package/src/api/auth/types.ts +217 -0
- package/src/api/authConstant.ts +13 -0
- package/src/api/myorgan/index.ts +18 -0
- package/src/api/myorgan/types.ts +9 -0
- package/src/api/organConstant.ts +19 -0
- package/src/api/shop/index.ts +210 -0
- package/src/api/shop/types.ts +390 -0
- package/src/api/storage/index.ts +136 -0
- package/src/api/storage/types.ts +119 -0
- package/src/app.mpx +41 -0
- package/src/components/add-admin-popup.mpx +238 -0
- package/src/components/change-shop.mpx +388 -0
- package/src/components/work-grid.mpx +178 -0
- package/src/global.d.ts +11 -0
- package/src/index.ts +55 -0
- package/src/packages/shop-merchant/components/add-customer-service-popup.mpx +140 -0
- package/src/packages/shop-merchant/components/admin-list.mpx +221 -0
- package/src/packages/shop-merchant/components/employee-list-branch.mpx +223 -0
- package/src/packages/shop-merchant/components/employee-list-shop.mpx +224 -0
- package/src/packages/shop-merchant/index.mpx +10 -0
- package/src/packages/shop-merchant/pages/admin-list.mpx +86 -0
- package/src/packages/shop-merchant/pages/customer-service.mpx +255 -0
- package/src/packages/shop-merchant/pages/employee-edit.mpx +141 -0
- package/src/packages/shop-merchant/pages/employee-list.mpx +100 -0
- package/src/pages/index.mpx +125 -0
- package/src/pages/welcome.mpx +63 -0
- package/src/pages/work.mpx +48 -0
- package/src/styles/index.scss +19 -0
- package/src/styles/vars.scss +27 -0
- package/static/wx/project.config.json +41 -0
package/.editorconfig
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# xyvcard-core-merchant-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
|
+
```
|
|
@@ -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,12 @@
|
|
|
1
|
+
import { ResponseData } from "jmash-core-mp";
|
|
2
|
+
import { UserKey, UserUpdateReq, UserDeleteReq, UserRoleReq, UserPageReq, UserModel, UserPage } from "./types";
|
|
3
|
+
declare class AuthApiImpl {
|
|
4
|
+
findUserPage(data: UserPageReq): Promise<ResponseData<UserPage>>;
|
|
5
|
+
findUserById(data: UserKey): Promise<ResponseData<UserModel>>;
|
|
6
|
+
updateUser(data: UserUpdateReq): Promise<ResponseData<UserModel>>;
|
|
7
|
+
deleteUser(data: UserDeleteReq): Promise<ResponseData<UserModel>>;
|
|
8
|
+
assignUser(data: UserRoleReq): Promise<ResponseData<any>>;
|
|
9
|
+
deAssignUser(data: UserRoleReq): Promise<ResponseData<any>>;
|
|
10
|
+
}
|
|
11
|
+
declare const authApi: AuthApiImpl;
|
|
12
|
+
export { authApi };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import mpx from "@mpxjs/core";
|
|
2
|
+
import { config, grpc } from "jmash-core-mp";
|
|
3
|
+
class AuthApiImpl {
|
|
4
|
+
// 查询翻页信息用户
|
|
5
|
+
findUserPage(data) {
|
|
6
|
+
data.tenant = data.tenant || config.tenant;
|
|
7
|
+
data.hasUserStatus = data.userStatus !== undefined;
|
|
8
|
+
data.hasApproved = data.approved !== undefined;
|
|
9
|
+
grpc.clearEmpty(data);
|
|
10
|
+
return mpx.xfetch.fetch({
|
|
11
|
+
url: "/v1/rbac/user/page",
|
|
12
|
+
method: "GET",
|
|
13
|
+
data,
|
|
14
|
+
header: { "Grpc-Metadata-Tenant": data.tenant },
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
// 查询用户详情
|
|
18
|
+
findUserById(data) {
|
|
19
|
+
data.tenant = data.tenant || config.tenant;
|
|
20
|
+
grpc.clearEmpty(data);
|
|
21
|
+
return mpx.xfetch.fetch({
|
|
22
|
+
url: "/v1/rbac/user/id",
|
|
23
|
+
method: "GET",
|
|
24
|
+
data,
|
|
25
|
+
header: { "Grpc-Metadata-Tenant": data.tenant },
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
// 修改实体用户
|
|
29
|
+
updateUser(data) {
|
|
30
|
+
data.tenant = data.tenant || config.tenant;
|
|
31
|
+
grpc.clearEmpty(data);
|
|
32
|
+
return mpx.xfetch.fetch({
|
|
33
|
+
url: "/v1/rbac/user",
|
|
34
|
+
method: "PATCH",
|
|
35
|
+
data,
|
|
36
|
+
header: { "Grpc-Metadata-Tenant": data.tenant },
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
// 删除用户
|
|
40
|
+
deleteUser(data) {
|
|
41
|
+
data.tenant = data.tenant || config.tenant;
|
|
42
|
+
grpc.clearEmpty(data);
|
|
43
|
+
return mpx.xfetch.fetch({
|
|
44
|
+
url: "/v1/rbac/user/id",
|
|
45
|
+
method: "DELETE",
|
|
46
|
+
data,
|
|
47
|
+
header: { "Grpc-Metadata-Tenant": data.tenant },
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
// 给用户分配角色
|
|
51
|
+
assignUser(data) {
|
|
52
|
+
data.tenant = data.tenant || config.tenant;
|
|
53
|
+
grpc.clearEmpty(data);
|
|
54
|
+
return mpx.xfetch.fetch({
|
|
55
|
+
url: "/v1/rbac/user/assign",
|
|
56
|
+
method: "PATCH",
|
|
57
|
+
data,
|
|
58
|
+
header: { "Grpc-Metadata-Tenant": data.tenant },
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
// 取消用户分配角色
|
|
62
|
+
deAssignUser(data) {
|
|
63
|
+
data.tenant = data.tenant || config.tenant;
|
|
64
|
+
grpc.clearEmpty(data);
|
|
65
|
+
return mpx.xfetch.fetch({
|
|
66
|
+
url: "/v1/rbac/user/deassign",
|
|
67
|
+
method: "PATCH",
|
|
68
|
+
data,
|
|
69
|
+
header: { "Grpc-Metadata-Tenant": data.tenant },
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const authApi = new AuthApiImpl();
|
|
74
|
+
export { authApi };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export interface UserKey {
|
|
2
|
+
tenant?: string;
|
|
3
|
+
userId?: string;
|
|
4
|
+
}
|
|
5
|
+
export interface UserJobs {
|
|
6
|
+
deptId?: string;
|
|
7
|
+
jobId?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface UserUpdateReq {
|
|
10
|
+
tenant?: string;
|
|
11
|
+
requestId?: string;
|
|
12
|
+
updateMask?: string;
|
|
13
|
+
userId?: string;
|
|
14
|
+
directoryId?: string;
|
|
15
|
+
loginName?: string;
|
|
16
|
+
mobilePhone?: string;
|
|
17
|
+
email?: string;
|
|
18
|
+
realName?: string;
|
|
19
|
+
nickName?: string;
|
|
20
|
+
avatar?: string;
|
|
21
|
+
birthDate?: string;
|
|
22
|
+
gender?: string;
|
|
23
|
+
phoneApproved?: boolean;
|
|
24
|
+
emailApproved?: boolean;
|
|
25
|
+
approved?: boolean;
|
|
26
|
+
status?: string;
|
|
27
|
+
roleIds?: string[];
|
|
28
|
+
userJobs?: UserJobs[];
|
|
29
|
+
unifiedId?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface UserDeleteReq {
|
|
32
|
+
tenant?: string;
|
|
33
|
+
userId?: string;
|
|
34
|
+
unified?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface UserRoleReq {
|
|
37
|
+
tenant?: string;
|
|
38
|
+
userId?: string;
|
|
39
|
+
roleCodes?: string[];
|
|
40
|
+
}
|
|
41
|
+
export interface UserPageReq {
|
|
42
|
+
tenant?: string;
|
|
43
|
+
curPage: number;
|
|
44
|
+
pageSize?: number;
|
|
45
|
+
showDeleted?: boolean;
|
|
46
|
+
createBy?: string;
|
|
47
|
+
deptId?: string;
|
|
48
|
+
loginName?: string;
|
|
49
|
+
hasUserStatus?: boolean;
|
|
50
|
+
userStatus?: string;
|
|
51
|
+
roleCode?: string;
|
|
52
|
+
roleId?: string;
|
|
53
|
+
directoryId?: string;
|
|
54
|
+
userId?: string[];
|
|
55
|
+
jobCode?: string;
|
|
56
|
+
jobId?: string;
|
|
57
|
+
realName?: string;
|
|
58
|
+
likeNickName?: string;
|
|
59
|
+
hasApproved?: boolean;
|
|
60
|
+
approved?: boolean;
|
|
61
|
+
}
|
|
62
|
+
export interface UserModel {
|
|
63
|
+
userId?: string;
|
|
64
|
+
unifiedId?: string;
|
|
65
|
+
directoryId?: string;
|
|
66
|
+
loginName?: string;
|
|
67
|
+
mobilePhone?: string;
|
|
68
|
+
mobilePhoneIns?: string;
|
|
69
|
+
email?: string;
|
|
70
|
+
realName?: string;
|
|
71
|
+
nickName?: string;
|
|
72
|
+
avatar?: string;
|
|
73
|
+
birthDate?: string;
|
|
74
|
+
gender?: string;
|
|
75
|
+
phoneApproved?: boolean;
|
|
76
|
+
emailApproved?: boolean;
|
|
77
|
+
approved?: boolean;
|
|
78
|
+
status?: string;
|
|
79
|
+
storage?: string;
|
|
80
|
+
lastLockoutTime?: string;
|
|
81
|
+
failedTime?: string;
|
|
82
|
+
failedCount?: number;
|
|
83
|
+
lastLoginTime?: string;
|
|
84
|
+
version?: number;
|
|
85
|
+
createBy?: string;
|
|
86
|
+
createTime?: string;
|
|
87
|
+
updateBy?: string;
|
|
88
|
+
updateTime?: string;
|
|
89
|
+
deleteBy?: string;
|
|
90
|
+
deleted?: boolean;
|
|
91
|
+
deleteTime?: string;
|
|
92
|
+
roleIds?: string[];
|
|
93
|
+
userJobs?: UserJobs[];
|
|
94
|
+
runAs?: boolean;
|
|
95
|
+
primaryUserId?: string;
|
|
96
|
+
emailIns?: string;
|
|
97
|
+
realNameIns?: string;
|
|
98
|
+
}
|
|
99
|
+
export interface UserPage {
|
|
100
|
+
results: UserModel[];
|
|
101
|
+
curPage?: number;
|
|
102
|
+
pageSize?: number;
|
|
103
|
+
totalSize?: number;
|
|
104
|
+
subTotalDto?: UserModelTotal;
|
|
105
|
+
totalDto?: UserModelTotal;
|
|
106
|
+
pageCount?: number;
|
|
107
|
+
}
|
|
108
|
+
export interface UserModelTotal {
|
|
109
|
+
totalSize?: number;
|
|
110
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import mpx from "@mpxjs/core";
|
|
2
|
+
import { config } from "jmash-core-mp";
|
|
3
|
+
class OrganApiImpl {
|
|
4
|
+
// 获取组织token
|
|
5
|
+
getOrganToken(data) {
|
|
6
|
+
data.tenant = data.tenant || config.tenant;
|
|
7
|
+
return mpx.xfetch.fetch({
|
|
8
|
+
url: `/v1/front/organ/token/${data.sceneType}/${data.tenant}`,
|
|
9
|
+
method: "GET",
|
|
10
|
+
header: { "Grpc-Metadata-Tenant": data.tenant },
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
const organApi = new OrganApiImpl();
|
|
15
|
+
export { organApi };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export class OrganConstant {
|
|
2
|
+
/**
|
|
3
|
+
* 模块
|
|
4
|
+
*/
|
|
5
|
+
static MODULE_ORGAN = "organ";
|
|
6
|
+
/**
|
|
7
|
+
* 枚举
|
|
8
|
+
*/
|
|
9
|
+
// 场景类型[用于组织访问Token]
|
|
10
|
+
static SceneTypeCompanyEnum = {
|
|
11
|
+
// 邀请同事
|
|
12
|
+
INVITE: "0",
|
|
13
|
+
// 分享公众号
|
|
14
|
+
SHARE_WECHAT_AUTH: "1",
|
|
15
|
+
// 分享网站
|
|
16
|
+
SHARE_WEBSITE: "2",
|
|
17
|
+
};
|
|
18
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ResponseData } from "jmash-core-mp";
|
|
2
|
+
import { ShopInfoListReq, ShopInfoList, BranchList, BranchModel, FindBranchAccessTokenReq, FindConsumerBranchByAccessTokenReq, ShopBranchUserApplyReq, ShopBranchsUsersModel, ConsumerExistsMyBranchByTokenReq, DeleteBranchUserReq, ShopSetBranchLeaderReq, ShopBranchsUsersPageReq, ShopBranchsUsersPage, WechatKfListReq, WechatKfListResp, WechatKfCreateReq, WechatKfDeleteReq, WechatKfResultResp } from "./types";
|
|
3
|
+
declare class ShopApiImpl {
|
|
4
|
+
findInfoList(data: ShopInfoListReq): Promise<ResponseData<ShopInfoList>>;
|
|
5
|
+
findMyBranchList(): Promise<ResponseData<BranchList>>;
|
|
6
|
+
findBranchAccessToken(data: FindBranchAccessTokenReq): Promise<ResponseData<string>>;
|
|
7
|
+
findConsumerBranchByAccessToken(data: FindConsumerBranchByAccessTokenReq): Promise<ResponseData<BranchModel>>;
|
|
8
|
+
consumerApplyBranchUser(data: ShopBranchUserApplyReq): Promise<ResponseData<ShopBranchsUsersModel>>;
|
|
9
|
+
consumerExistsMyBranchByToken(data: ConsumerExistsMyBranchByTokenReq): Promise<ResponseData<any>>;
|
|
10
|
+
deleteBranchUser(data: DeleteBranchUserReq): Promise<ResponseData<ShopBranchsUsersModel>>;
|
|
11
|
+
setBranchLeader(data: ShopSetBranchLeaderReq): Promise<ResponseData<any>>;
|
|
12
|
+
findShopBranchsUsersPage(data: ShopBranchsUsersPageReq): Promise<ResponseData<ShopBranchsUsersPage>>;
|
|
13
|
+
private fillCommonParams;
|
|
14
|
+
private genRequestId;
|
|
15
|
+
getKfList(data?: WechatKfListReq): Promise<ResponseData<WechatKfListResp>>;
|
|
16
|
+
createKf(data: WechatKfCreateReq): Promise<ResponseData<WechatKfResultResp>>;
|
|
17
|
+
deleteKf(data: WechatKfDeleteReq): Promise<ResponseData<WechatKfResultResp>>;
|
|
18
|
+
}
|
|
19
|
+
declare const shopApi: ShopApiImpl;
|
|
20
|
+
export { shopApi };
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import mpx from "@mpxjs/core";
|
|
2
|
+
import { config, grpc } from "jmash-core-mp";
|
|
3
|
+
class ShopApiImpl {
|
|
4
|
+
// 查询列表信息店铺管理
|
|
5
|
+
findInfoList(data) {
|
|
6
|
+
data.tenant = data.tenant || config.tenant;
|
|
7
|
+
data.hasStatus = data.status !== undefined;
|
|
8
|
+
grpc.clearEmpty(data);
|
|
9
|
+
return mpx.xfetch.fetch({
|
|
10
|
+
url: "/v1/front/shop/info/list/" + data.tenant,
|
|
11
|
+
method: "GET",
|
|
12
|
+
data,
|
|
13
|
+
header: { "Grpc-Metadata-Tenant": data.tenant },
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
// 查询我的门店列表
|
|
17
|
+
findMyBranchList() {
|
|
18
|
+
const tenant = config.tenant;
|
|
19
|
+
return mpx.xfetch.fetch({
|
|
20
|
+
url: "/v1/front/shop/branch/my_list/" + tenant,
|
|
21
|
+
method: "GET",
|
|
22
|
+
header: { "Grpc-Metadata-Tenant": tenant },
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
// 获取门店AccessToken(邀请员工)
|
|
26
|
+
findBranchAccessToken(data) {
|
|
27
|
+
data.tenant = data.tenant || config.tenant;
|
|
28
|
+
grpc.clearEmpty(data);
|
|
29
|
+
return mpx.xfetch.fetch({
|
|
30
|
+
url: "/v1/front/shop/branch/token/" + data.tenant,
|
|
31
|
+
method: "GET",
|
|
32
|
+
data,
|
|
33
|
+
header: { "Grpc-Metadata-Tenant": data.tenant },
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
// 根据AccessToken查询门店信息(开放接口)
|
|
37
|
+
findConsumerBranchByAccessToken(data) {
|
|
38
|
+
data.tenant = data.tenant || config.tenant;
|
|
39
|
+
grpc.clearEmpty(data);
|
|
40
|
+
return mpx.xfetch.fetch({
|
|
41
|
+
url: "/v1/front/shop/consumer_branch/access_token/" + data.tenant,
|
|
42
|
+
method: "GET",
|
|
43
|
+
data,
|
|
44
|
+
header: { "Grpc-Metadata-Tenant": data.tenant },
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
// 申请加入门店
|
|
48
|
+
consumerApplyBranchUser(data) {
|
|
49
|
+
data.tenant = data.tenant || config.tenant;
|
|
50
|
+
data.requestId = data.requestId || this.genRequestId();
|
|
51
|
+
grpc.clearEmpty(data);
|
|
52
|
+
return mpx.xfetch.fetch({
|
|
53
|
+
url: "/v1/front/shop/consumer_branch/apply",
|
|
54
|
+
method: "POST",
|
|
55
|
+
data,
|
|
56
|
+
header: { "Grpc-Metadata-Tenant": data.tenant },
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
// 查询当前用户是否已加入该门店
|
|
60
|
+
consumerExistsMyBranchByToken(data) {
|
|
61
|
+
data.tenant = data.tenant || config.tenant;
|
|
62
|
+
grpc.clearEmpty(data);
|
|
63
|
+
return mpx.xfetch.fetch({
|
|
64
|
+
url: "/v1/front/shop/consumer_branch/exists/" +
|
|
65
|
+
data.tenant +
|
|
66
|
+
"/" +
|
|
67
|
+
data.accessToken,
|
|
68
|
+
method: "GET",
|
|
69
|
+
data,
|
|
70
|
+
header: { "Grpc-Metadata-Tenant": data.tenant },
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
// 删除门店员工
|
|
74
|
+
deleteBranchUser(data) {
|
|
75
|
+
data.tenant = data.tenant || config.tenant;
|
|
76
|
+
grpc.clearEmpty(data);
|
|
77
|
+
return mpx.xfetch.fetch({
|
|
78
|
+
url: "/v1/front/shop/consumer_branch/id",
|
|
79
|
+
method: "DELETE",
|
|
80
|
+
data,
|
|
81
|
+
header: { "Grpc-Metadata-Tenant": data.tenant },
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
// 设置门店店长
|
|
85
|
+
setBranchLeader(data) {
|
|
86
|
+
data.tenant = data.tenant || config.tenant;
|
|
87
|
+
grpc.clearEmpty(data);
|
|
88
|
+
return mpx.xfetch.fetch({
|
|
89
|
+
url: "/v1/front/shop/consumer_branch/set_branch_leader",
|
|
90
|
+
method: "PATCH",
|
|
91
|
+
data,
|
|
92
|
+
header: { "Grpc-Metadata-Tenant": data.tenant },
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// 查询门店员工翻页信息
|
|
96
|
+
findShopBranchsUsersPage(data) {
|
|
97
|
+
data.tenant = data.tenant || config.tenant;
|
|
98
|
+
data.hasStatus = data.status !== undefined;
|
|
99
|
+
data.hasLeader = data.isLeader !== undefined;
|
|
100
|
+
grpc.clearEmpty(data);
|
|
101
|
+
return mpx.xfetch.fetch({
|
|
102
|
+
url: "/v1/front/shop/branchs_users/page/" + data.tenant,
|
|
103
|
+
method: "GET",
|
|
104
|
+
data,
|
|
105
|
+
header: { "Grpc-Metadata-Tenant": data.tenant },
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
// 自动填充公共参数(authorizerAppid / componentAppid / businessId)
|
|
109
|
+
fillCommonParams(data) {
|
|
110
|
+
if (!data.authorizerAppid)
|
|
111
|
+
data.authorizerAppid = config.appId;
|
|
112
|
+
if (!data.componentAppid)
|
|
113
|
+
data.componentAppid = config.componentAppid;
|
|
114
|
+
// TODO: 确认 businessId 是否需要传
|
|
115
|
+
// if (!data.businessId) data.businessId = config.siteId;
|
|
116
|
+
return data;
|
|
117
|
+
}
|
|
118
|
+
// 生成 requestId
|
|
119
|
+
genRequestId() {
|
|
120
|
+
return Date.now() + "_" + Math.floor(Math.random() * 10000);
|
|
121
|
+
}
|
|
122
|
+
// 获取客服列表
|
|
123
|
+
getKfList(data) {
|
|
124
|
+
const tenant = config.tenant;
|
|
125
|
+
const params = this.fillCommonParams({ ...(data || {}) });
|
|
126
|
+
grpc.clearEmpty(params);
|
|
127
|
+
return mpx.xfetch.fetch({
|
|
128
|
+
url: "/v1/wechat/kf/list/" + tenant,
|
|
129
|
+
method: "GET",
|
|
130
|
+
data: params,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
// 添加客服账号
|
|
134
|
+
createKf(data) {
|
|
135
|
+
data.tenant = data.tenant || config.tenant;
|
|
136
|
+
data.requestId = data.requestId || this.genRequestId();
|
|
137
|
+
this.fillCommonParams(data);
|
|
138
|
+
return mpx.xfetch.fetch({
|
|
139
|
+
url: "/v1/wechat/kf",
|
|
140
|
+
method: "POST",
|
|
141
|
+
data: data,
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
// 删除客服账号
|
|
145
|
+
deleteKf(data) {
|
|
146
|
+
data.tenant = data.tenant || config.tenant;
|
|
147
|
+
data.requestId = data.requestId || this.genRequestId();
|
|
148
|
+
this.fillCommonParams(data);
|
|
149
|
+
grpc.clearEmpty(data);
|
|
150
|
+
return mpx.xfetch.fetch({
|
|
151
|
+
url: "/v1/wechat/kf",
|
|
152
|
+
method: "DELETE",
|
|
153
|
+
data: data,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
const shopApi = new ShopApiImpl();
|
|
158
|
+
export { shopApi };
|