@cgboiler/biz-mobile 1.4.0 → 1.5.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.
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/es/org-picker/OrgPicker.js +4 -2
- package/es/org-picker/components/deptImg.js +4 -6
- package/es/org-picker/index.css +1 -1
- package/es/org-picker/index.less +7 -5
- package/es/org-picker/useApi.js +16 -7
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/org-picker/OrgPicker.js +3 -1
- package/lib/org-picker/components/deptImg.js +4 -6
- package/lib/org-picker/index.css +1 -1
- package/lib/org-picker/index.less +7 -5
- package/lib/org-picker/useApi.js +16 -7
- package/package.json +1 -1
package/es/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare namespace _default {
|
|
|
6
6
|
}
|
|
7
7
|
export default _default;
|
|
8
8
|
export function install(app: any): void;
|
|
9
|
-
export const version: "1.
|
|
9
|
+
export const version: "1.4.0";
|
|
10
10
|
import OrgPicker from './org-picker';
|
|
11
11
|
import ProjectSelect from './project-select';
|
|
12
12
|
export { OrgPicker, ProjectSelect };
|
package/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createVNode as _createVNode, createTextVNode as _createTextVNode } from "vue";
|
|
2
2
|
import "./_atomic.css";
|
|
3
3
|
import { defineComponent, ref, computed, watch } from "vue";
|
|
4
|
-
import { ActionSheet, Search, List, Image } from "vant";
|
|
4
|
+
import { ActionSheet, Search, List, Image, Empty } from "vant";
|
|
5
5
|
import DeptImg from "./components/deptImg";
|
|
6
6
|
import { orgPickerProps } from "./types";
|
|
7
7
|
import { useApi } from "./useApi";
|
|
@@ -102,7 +102,9 @@ var stdin_default = defineComponent({
|
|
|
102
102
|
"class": "separator"
|
|
103
103
|
}, [_createTextVNode(" / ")])]))]), _createVNode("div", {
|
|
104
104
|
"class": "feed-list-wrap"
|
|
105
|
-
}, [_createVNode(
|
|
105
|
+
}, [!keyword.value && filteredOrgList.value.filter((item) => item.type !== "dept").length === 0 ? _createVNode(Empty, {
|
|
106
|
+
"description": "\u8BE5\u90E8\u95E8\u4E0B\u6CA1\u6709\u4EBA\u5458"
|
|
107
|
+
}, null) : _createVNode(List, {
|
|
106
108
|
"loading": loading.value,
|
|
107
109
|
"finished": finished.value,
|
|
108
110
|
"onLoad": onLoad
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { createVNode as _createVNode } from "vue";
|
|
2
2
|
import "./_atomic.css";
|
|
3
3
|
const DeptImg = () => _createVNode("svg", {
|
|
4
|
+
"style": "width: 100%;height: 100%;",
|
|
4
5
|
"viewBox": "0 0 1204 1024",
|
|
5
6
|
"version": "1.1",
|
|
6
|
-
"xmlns": "http://www.w3.org/2000/svg"
|
|
7
|
-
"p-id": "7601"
|
|
7
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
8
8
|
}, [_createVNode("path", {
|
|
9
9
|
"d": "M561.63235285 164.57352927h335.01838211c27.29779432 0 49.63235285 22.33455854 49.63235366 49.63235284v62.04044147c0 27.29779432-22.33455854 49.63235285-49.63235366 49.63235284H561.63235285c-27.29779432 0-49.63235285-22.33455854-49.63235285-49.63235284v-62.04044147c0-27.29779432 22.33455854-49.63235285 49.63235285-49.63235284z",
|
|
10
|
-
"fill": "#AFFCFE"
|
|
11
|
-
"p-id": "7602"
|
|
10
|
+
"fill": "#AFFCFE"
|
|
12
11
|
}, null), _createVNode("path", {
|
|
13
12
|
"d": "M983.50735284 933.875H189.38970568c-54.59558862 0-99.26470568-44.66911789-99.26470568-99.26470568V189.38970568c0-54.59558862 44.66911789-99.26470568 99.26470568-99.26470568h285.38602928c68.24448496 18.61213211 54.59558862 53.35477927 99.2647065 99.26470568l31.02021992 49.63235286H983.50735284c54.59558862 0 99.26470568 44.66911789 99.26470569 99.2647065v496.32352928c0 54.59558862-44.66911789 99.26470568-99.26470569 99.26470568z",
|
|
14
|
-
"fill": "#2F77F1"
|
|
15
|
-
"p-id": "7603"
|
|
13
|
+
"fill": "#2F77F1"
|
|
16
14
|
}, null)]);
|
|
17
15
|
var stdin_default = DeptImg;
|
|
18
16
|
export {
|
package/es/org-picker/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root:root{--van-action-sheet-max-height: 100%}.org-list{height:85vh;display:flex;flex-direction:column}.org-list .breadcrumb-nav{margin-bottom:4px;padding:2px 16px;border-radius:4px;font-size:12px}.org-list .breadcrumb-nav .dept-name.current-dept{color:#969799}.org-list .breadcrumb-nav .separator{color:#969799;margin:0 4px}.org-list .search-bar{position:-webkit-sticky;position:-webkit-sticky;position:sticky;top:0;z-index:1}.org-list .bottom-section{border-top:1px solid #eee;background-color:#fff}.org-list .bottom-section .selected-items{display:flex;flex-wrap:nowrap;padding:12px 16px;gap:12px;background-color:#fff;overflow-x:auto;height:35px}.org-list .bottom-section .selected-items .selected-tag{flex-shrink:0;background:none;border:none;padding:0;margin:0}.org-list .bottom-section .selected-items .selected-tag .tag-avatar{width:
|
|
1
|
+
:root:root{--van-action-sheet-max-height: 100%}.org-list{height:85vh;display:flex;flex-direction:column}.org-list .breadcrumb-nav{margin-bottom:4px;padding:2px 16px;border-radius:4px;font-size:12px}.org-list .breadcrumb-nav .dept-name.current-dept{color:#969799}.org-list .breadcrumb-nav .separator{color:#969799;margin:0 4px}.org-list .search-bar{position:-webkit-sticky;position:-webkit-sticky;position:sticky;top:0;z-index:1}.org-list .bottom-section{border-top:1px solid #eee;background-color:#fff}.org-list .bottom-section .selected-items{display:flex;flex-wrap:nowrap;padding:12px 16px;gap:12px;background-color:#fff;overflow-x:auto;height:35px}.org-list .bottom-section .selected-items .selected-tag{flex-shrink:0;background:none;border:none;padding:0;margin:0}.org-list .bottom-section .selected-items .selected-tag .tag-avatar{width:36px;height:36px}.org-list .bottom-section .selected-items .selected-tag .tag-avatar img{border-radius:4px;border:1px solid #eee}.org-list .van-list{flex:1;overflow-y:auto;padding:0 16px}.org-list .feed-list-wrap{flex:1;display:flex;overflow:hidden;position:relative;justify-content:center}.org-list .search-result-list{position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:#fff;overflow-y:auto;padding:0 16px}.org-list .org-item{padding:12px 0;border-bottom:1px solid #eee;cursor:pointer;display:flex;align-items:center;gap:12px}.org-list .org-item.selected{color:var(--van-primary-color)}.org-list .org-item .org-avatar{flex-shrink:0;width:40px;height:40px;display:flex;align-items:center;justify-content:center}.org-list .org-item .org-avatar img{border-radius:4px;border:1px solid #eee}.org-list .org-item .org-name{font-size:14px;flex:1}.org-list .org-item:last-child{border-bottom:none}.org-list .action-buttons{padding:16px;display:flex;justify-content:center;border-top:1px solid #eee}.org-list .action-buttons .confirm-button{background-color:var(--van-primary-color);color:#fff;padding:10px 0;border-radius:4px;text-align:center;width:100%;font-size:14px}
|
package/es/org-picker/index.less
CHANGED
|
@@ -51,11 +51,12 @@
|
|
|
51
51
|
margin: 0;
|
|
52
52
|
|
|
53
53
|
.tag-avatar {
|
|
54
|
-
width:
|
|
55
|
-
height:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
width: 36px;
|
|
55
|
+
height: 36px;
|
|
56
|
+
img {
|
|
57
|
+
border-radius: 4px;
|
|
58
|
+
border: 1px solid #eee;
|
|
59
|
+
}
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
}
|
|
@@ -72,6 +73,7 @@
|
|
|
72
73
|
display: flex;
|
|
73
74
|
overflow: hidden;
|
|
74
75
|
position: relative;
|
|
76
|
+
justify-content: center;
|
|
75
77
|
}
|
|
76
78
|
.search-result-list {
|
|
77
79
|
position: absolute;
|
package/es/org-picker/useApi.js
CHANGED
|
@@ -21,6 +21,20 @@ var __async = (__this, __arguments, generator) => {
|
|
|
21
21
|
import { ref } from "vue";
|
|
22
22
|
import { useFetch } from "@cgboiler/core";
|
|
23
23
|
import { debounce } from "lodash-es";
|
|
24
|
+
const orgListCache = /* @__PURE__ */ new Map();
|
|
25
|
+
const fetchOrgList = (deptId) => __async(void 0, null, function* () {
|
|
26
|
+
if (orgListCache.has(deptId || "")) {
|
|
27
|
+
return orgListCache.get(deptId || "");
|
|
28
|
+
}
|
|
29
|
+
const res = (yield useFetch(
|
|
30
|
+
`https://wflow.cgboiler.com/v1/oa/org/tree/cloud?deptId=${deptId}&type=user`,
|
|
31
|
+
{
|
|
32
|
+
method: "GET"
|
|
33
|
+
}
|
|
34
|
+
)) || [];
|
|
35
|
+
orgListCache.set(deptId || "", res);
|
|
36
|
+
return res;
|
|
37
|
+
});
|
|
24
38
|
const useApi = () => {
|
|
25
39
|
const orgList = ref([]);
|
|
26
40
|
const currentDeptId = ref("1");
|
|
@@ -38,13 +52,8 @@ const useApi = () => {
|
|
|
38
52
|
}
|
|
39
53
|
}
|
|
40
54
|
}
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
{
|
|
44
|
-
method: "GET"
|
|
45
|
-
}
|
|
46
|
-
);
|
|
47
|
-
orgList.value = res || [];
|
|
55
|
+
const list = yield fetchOrgList(currentDeptId.value);
|
|
56
|
+
orgList.value = list || [];
|
|
48
57
|
});
|
|
49
58
|
const searchOrgList = debounce((userName) => __async(void 0, null, function* () {
|
|
50
59
|
if (!userName) {
|
package/lib/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare namespace _default {
|
|
|
6
6
|
}
|
|
7
7
|
export default _default;
|
|
8
8
|
export function install(app: any): void;
|
|
9
|
-
export const version: "1.
|
|
9
|
+
export const version: "1.4.0";
|
|
10
10
|
import OrgPicker from './org-picker';
|
|
11
11
|
import ProjectSelect from './project-select';
|
|
12
12
|
export { OrgPicker, ProjectSelect };
|
package/lib/index.js
CHANGED
|
@@ -39,7 +39,7 @@ var import_org_picker = __toESM(require("./org-picker"));
|
|
|
39
39
|
var import_project_select = __toESM(require("./project-select"));
|
|
40
40
|
__reExport(stdin_exports, require("./org-picker"), module.exports);
|
|
41
41
|
__reExport(stdin_exports, require("./project-select"), module.exports);
|
|
42
|
-
const version = "1.
|
|
42
|
+
const version = "1.4.0";
|
|
43
43
|
function install(app) {
|
|
44
44
|
const components = [
|
|
45
45
|
import_org_picker.default,
|
|
@@ -134,7 +134,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
134
134
|
"class": "separator"
|
|
135
135
|
}, [(0, import_vue.createTextVNode)(" / ")])]))]), (0, import_vue.createVNode)("div", {
|
|
136
136
|
"class": "feed-list-wrap"
|
|
137
|
-
}, [(0, import_vue.createVNode)(import_vant.
|
|
137
|
+
}, [!keyword.value && filteredOrgList.value.filter((item) => item.type !== "dept").length === 0 ? (0, import_vue.createVNode)(import_vant.Empty, {
|
|
138
|
+
"description": "\u8BE5\u90E8\u95E8\u4E0B\u6CA1\u6709\u4EBA\u5458"
|
|
139
|
+
}, null) : (0, import_vue.createVNode)(import_vant.List, {
|
|
138
140
|
"loading": loading.value,
|
|
139
141
|
"finished": finished.value,
|
|
140
142
|
"onLoad": onLoad
|
|
@@ -23,17 +23,15 @@ module.exports = __toCommonJS(stdin_exports);
|
|
|
23
23
|
var import_vue = require("vue");
|
|
24
24
|
var import_atomic = require("./_atomic.css");
|
|
25
25
|
const DeptImg = () => (0, import_vue.createVNode)("svg", {
|
|
26
|
+
"style": "width: 100%;height: 100%;",
|
|
26
27
|
"viewBox": "0 0 1204 1024",
|
|
27
28
|
"version": "1.1",
|
|
28
|
-
"xmlns": "http://www.w3.org/2000/svg"
|
|
29
|
-
"p-id": "7601"
|
|
29
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
30
30
|
}, [(0, import_vue.createVNode)("path", {
|
|
31
31
|
"d": "M561.63235285 164.57352927h335.01838211c27.29779432 0 49.63235285 22.33455854 49.63235366 49.63235284v62.04044147c0 27.29779432-22.33455854 49.63235285-49.63235366 49.63235284H561.63235285c-27.29779432 0-49.63235285-22.33455854-49.63235285-49.63235284v-62.04044147c0-27.29779432 22.33455854-49.63235285 49.63235285-49.63235284z",
|
|
32
|
-
"fill": "#AFFCFE"
|
|
33
|
-
"p-id": "7602"
|
|
32
|
+
"fill": "#AFFCFE"
|
|
34
33
|
}, null), (0, import_vue.createVNode)("path", {
|
|
35
34
|
"d": "M983.50735284 933.875H189.38970568c-54.59558862 0-99.26470568-44.66911789-99.26470568-99.26470568V189.38970568c0-54.59558862 44.66911789-99.26470568 99.26470568-99.26470568h285.38602928c68.24448496 18.61213211 54.59558862 53.35477927 99.2647065 99.26470568l31.02021992 49.63235286H983.50735284c54.59558862 0 99.26470568 44.66911789 99.26470569 99.2647065v496.32352928c0 54.59558862-44.66911789 99.26470568-99.26470569 99.26470568z",
|
|
36
|
-
"fill": "#2F77F1"
|
|
37
|
-
"p-id": "7603"
|
|
35
|
+
"fill": "#2F77F1"
|
|
38
36
|
}, null)]);
|
|
39
37
|
var stdin_default = DeptImg;
|
package/lib/org-picker/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root:root{--van-action-sheet-max-height: 100%}.org-list{height:85vh;display:flex;flex-direction:column}.org-list .breadcrumb-nav{margin-bottom:4px;padding:2px 16px;border-radius:4px;font-size:12px}.org-list .breadcrumb-nav .dept-name.current-dept{color:#969799}.org-list .breadcrumb-nav .separator{color:#969799;margin:0 4px}.org-list .search-bar{position:-webkit-sticky;position:-webkit-sticky;position:sticky;top:0;z-index:1}.org-list .bottom-section{border-top:1px solid #eee;background-color:#fff}.org-list .bottom-section .selected-items{display:flex;flex-wrap:nowrap;padding:12px 16px;gap:12px;background-color:#fff;overflow-x:auto;height:35px}.org-list .bottom-section .selected-items .selected-tag{flex-shrink:0;background:none;border:none;padding:0;margin:0}.org-list .bottom-section .selected-items .selected-tag .tag-avatar{width:
|
|
1
|
+
:root:root{--van-action-sheet-max-height: 100%}.org-list{height:85vh;display:flex;flex-direction:column}.org-list .breadcrumb-nav{margin-bottom:4px;padding:2px 16px;border-radius:4px;font-size:12px}.org-list .breadcrumb-nav .dept-name.current-dept{color:#969799}.org-list .breadcrumb-nav .separator{color:#969799;margin:0 4px}.org-list .search-bar{position:-webkit-sticky;position:-webkit-sticky;position:sticky;top:0;z-index:1}.org-list .bottom-section{border-top:1px solid #eee;background-color:#fff}.org-list .bottom-section .selected-items{display:flex;flex-wrap:nowrap;padding:12px 16px;gap:12px;background-color:#fff;overflow-x:auto;height:35px}.org-list .bottom-section .selected-items .selected-tag{flex-shrink:0;background:none;border:none;padding:0;margin:0}.org-list .bottom-section .selected-items .selected-tag .tag-avatar{width:36px;height:36px}.org-list .bottom-section .selected-items .selected-tag .tag-avatar img{border-radius:4px;border:1px solid #eee}.org-list .van-list{flex:1;overflow-y:auto;padding:0 16px}.org-list .feed-list-wrap{flex:1;display:flex;overflow:hidden;position:relative;justify-content:center}.org-list .search-result-list{position:absolute;top:0;left:0;right:0;bottom:0;z-index:1;background-color:#fff;overflow-y:auto;padding:0 16px}.org-list .org-item{padding:12px 0;border-bottom:1px solid #eee;cursor:pointer;display:flex;align-items:center;gap:12px}.org-list .org-item.selected{color:var(--van-primary-color)}.org-list .org-item .org-avatar{flex-shrink:0;width:40px;height:40px;display:flex;align-items:center;justify-content:center}.org-list .org-item .org-avatar img{border-radius:4px;border:1px solid #eee}.org-list .org-item .org-name{font-size:14px;flex:1}.org-list .org-item:last-child{border-bottom:none}.org-list .action-buttons{padding:16px;display:flex;justify-content:center;border-top:1px solid #eee}.org-list .action-buttons .confirm-button{background-color:var(--van-primary-color);color:#fff;padding:10px 0;border-radius:4px;text-align:center;width:100%;font-size:14px}
|
|
@@ -51,11 +51,12 @@
|
|
|
51
51
|
margin: 0;
|
|
52
52
|
|
|
53
53
|
.tag-avatar {
|
|
54
|
-
width:
|
|
55
|
-
height:
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
54
|
+
width: 36px;
|
|
55
|
+
height: 36px;
|
|
56
|
+
img {
|
|
57
|
+
border-radius: 4px;
|
|
58
|
+
border: 1px solid #eee;
|
|
59
|
+
}
|
|
59
60
|
}
|
|
60
61
|
}
|
|
61
62
|
}
|
|
@@ -72,6 +73,7 @@
|
|
|
72
73
|
display: flex;
|
|
73
74
|
overflow: hidden;
|
|
74
75
|
position: relative;
|
|
76
|
+
justify-content: center;
|
|
75
77
|
}
|
|
76
78
|
.search-result-list {
|
|
77
79
|
position: absolute;
|
package/lib/org-picker/useApi.js
CHANGED
|
@@ -43,6 +43,20 @@ module.exports = __toCommonJS(stdin_exports);
|
|
|
43
43
|
var import_vue = require("vue");
|
|
44
44
|
var import_core = require("@cgboiler/core");
|
|
45
45
|
var import_lodash_es = require("lodash-es");
|
|
46
|
+
const orgListCache = /* @__PURE__ */ new Map();
|
|
47
|
+
const fetchOrgList = (deptId) => __async(void 0, null, function* () {
|
|
48
|
+
if (orgListCache.has(deptId || "")) {
|
|
49
|
+
return orgListCache.get(deptId || "");
|
|
50
|
+
}
|
|
51
|
+
const res = (yield (0, import_core.useFetch)(
|
|
52
|
+
`https://wflow.cgboiler.com/v1/oa/org/tree/cloud?deptId=${deptId}&type=user`,
|
|
53
|
+
{
|
|
54
|
+
method: "GET"
|
|
55
|
+
}
|
|
56
|
+
)) || [];
|
|
57
|
+
orgListCache.set(deptId || "", res);
|
|
58
|
+
return res;
|
|
59
|
+
});
|
|
46
60
|
const useApi = () => {
|
|
47
61
|
const orgList = (0, import_vue.ref)([]);
|
|
48
62
|
const currentDeptId = (0, import_vue.ref)("1");
|
|
@@ -60,13 +74,8 @@ const useApi = () => {
|
|
|
60
74
|
}
|
|
61
75
|
}
|
|
62
76
|
}
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
{
|
|
66
|
-
method: "GET"
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
orgList.value = res || [];
|
|
77
|
+
const list = yield fetchOrgList(currentDeptId.value);
|
|
78
|
+
orgList.value = list || [];
|
|
70
79
|
});
|
|
71
80
|
const searchOrgList = (0, import_lodash_es.debounce)((userName) => __async(void 0, null, function* () {
|
|
72
81
|
if (!userName) {
|