@cgboiler/biz-mobile 1.2.0 → 1.4.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 +58 -9
- package/es/org-picker/components/_atomic.css +32 -0
- package/es/org-picker/components/deptImg.d.ts +2 -0
- package/es/org-picker/components/deptImg.js +20 -0
- package/es/org-picker/index.css +1 -1
- package/es/org-picker/index.less +46 -3
- package/es/org-picker/types.d.ts +1 -0
- package/es/org-picker/useApi.d.ts +15 -1
- package/es/org-picker/useApi.js +41 -761
- package/es/project-select/index.css +1 -1
- package/es/project-select/index.less +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/org-picker/OrgPicker.js +67 -8
- package/lib/org-picker/components/_atomic.css +32 -0
- package/lib/org-picker/components/deptImg.d.ts +2 -0
- package/lib/org-picker/components/deptImg.js +39 -0
- package/lib/org-picker/index.css +1 -1
- package/lib/org-picker/index.less +46 -3
- package/lib/org-picker/types.d.ts +1 -0
- package/lib/org-picker/useApi.d.ts +15 -1
- package/lib/org-picker/useApi.js +41 -761
- package/lib/project-select/index.css +1 -1
- package/lib/project-select/index.less +1 -1
- package/package.json +3 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
:root:root{--van-action-sheet-max-height: 100%}.project-list{height:
|
|
1
|
+
:root:root{--van-action-sheet-max-height: 100%}.project-list{height:85vh;display:flex;flex-direction:column}.project-list .search-bar{position:-webkit-sticky;position:-webkit-sticky;position:sticky;top:0;z-index:1}.project-list .van-list{flex:1;overflow-y:auto;padding:0 16px}.project-list .project-item{padding:12px 0;border-bottom:1px solid #eee;cursor:pointer}.project-list .project-item.selected{color:var(--van-primary-color)}.project-list .project-item .project-name{font-size:14px}.project-list .project-item:last-child{border-bottom:none}
|
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.3.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.3.0";
|
|
43
43
|
function install(app) {
|
|
44
44
|
const components = [
|
|
45
45
|
import_org_picker.default,
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,6 +16,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
18
|
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
var stdin_exports = {};
|
|
19
29
|
__export(stdin_exports, {
|
|
@@ -24,6 +34,7 @@ var import_vue = require("vue");
|
|
|
24
34
|
var import_atomic = require("./_atomic.css");
|
|
25
35
|
var import_vue2 = require("vue");
|
|
26
36
|
var import_vant = require("vant");
|
|
37
|
+
var import_deptImg = __toESM(require("./components/deptImg"));
|
|
27
38
|
var import_types = require("./types");
|
|
28
39
|
var import_useApi = require("./useApi");
|
|
29
40
|
var import_index = require("./index.css");
|
|
@@ -36,10 +47,17 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
36
47
|
}) {
|
|
37
48
|
const {
|
|
38
49
|
orgList,
|
|
39
|
-
getOrgList
|
|
50
|
+
getOrgList,
|
|
51
|
+
currentDeptId,
|
|
52
|
+
deptPath,
|
|
53
|
+
searchOrgList
|
|
40
54
|
} = (0, import_useApi.useApi)();
|
|
41
55
|
getOrgList();
|
|
42
56
|
const handleSelect = (item) => {
|
|
57
|
+
if (item.type === "dept") {
|
|
58
|
+
getOrgList(item.id);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
43
61
|
if (props.multiple) {
|
|
44
62
|
const currentValue = props.modelValue ? [...Array.isArray(props.modelValue) ? props.modelValue : [props.modelValue]] : [];
|
|
45
63
|
const index = currentValue.findIndex((selected) => selected.id === item.id);
|
|
@@ -60,10 +78,20 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
60
78
|
const keyword = (0, import_vue2.ref)("");
|
|
61
79
|
const loading = (0, import_vue2.ref)(false);
|
|
62
80
|
const finished = (0, import_vue2.ref)(true);
|
|
81
|
+
(0, import_vue2.watch)(keyword, (newKeyword) => {
|
|
82
|
+
if (newKeyword) {
|
|
83
|
+
searchOrgList(newKeyword);
|
|
84
|
+
} else {
|
|
85
|
+
getOrgList(currentDeptId.value);
|
|
86
|
+
}
|
|
87
|
+
});
|
|
63
88
|
const filteredOrgList = (0, import_vue2.computed)(() => {
|
|
64
|
-
|
|
65
|
-
return
|
|
66
|
-
}
|
|
89
|
+
if (keyword.value) {
|
|
90
|
+
return orgList.value;
|
|
91
|
+
}
|
|
92
|
+
const departments = orgList.value.filter((item) => item.type === "dept");
|
|
93
|
+
const personnel = orgList.value.filter((item) => item.type !== "dept");
|
|
94
|
+
return [...personnel, ...departments];
|
|
67
95
|
});
|
|
68
96
|
const isSelected = (item) => {
|
|
69
97
|
var _a;
|
|
@@ -92,7 +120,21 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
92
120
|
"onUpdate:modelValue": ($event) => keyword.value = $event,
|
|
93
121
|
"placeholder": "\u641C\u7D22\u4EBA\u5458",
|
|
94
122
|
"class": "search-bar"
|
|
95
|
-
}, null), (0, import_vue.createVNode)(
|
|
123
|
+
}, null), !keyword.value && (0, import_vue.createVNode)("div", {
|
|
124
|
+
"class": "breadcrumb-nav"
|
|
125
|
+
}, [deptPath.value.map((dept, index) => (0, import_vue.createVNode)("span", {
|
|
126
|
+
"key": dept.id
|
|
127
|
+
}, [(0, import_vue.createVNode)("span", {
|
|
128
|
+
"class": ["dept-name", index === deptPath.value.length - 1 ? "current-dept" : ""],
|
|
129
|
+
"onClick": () => handleSelect({
|
|
130
|
+
id: dept.id,
|
|
131
|
+
type: "dept"
|
|
132
|
+
})
|
|
133
|
+
}, [dept.name]), index < deptPath.value.length - 1 && (0, import_vue.createVNode)("span", {
|
|
134
|
+
"class": "separator"
|
|
135
|
+
}, [(0, import_vue.createTextVNode)(" / ")])]))]), (0, import_vue.createVNode)("div", {
|
|
136
|
+
"class": "feed-list-wrap"
|
|
137
|
+
}, [(0, import_vue.createVNode)(import_vant.List, {
|
|
96
138
|
"loading": loading.value,
|
|
97
139
|
"finished": finished.value,
|
|
98
140
|
"onLoad": onLoad
|
|
@@ -100,15 +142,32 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
100
142
|
default: () => [filteredOrgList.value.map((item) => (0, import_vue.createVNode)("div", {
|
|
101
143
|
"class": ["org-item", isSelected(item) ? "selected" : ""],
|
|
102
144
|
"onClick": () => handleSelect(item)
|
|
145
|
+
}, [item.type === "dept" ? (0, import_vue.createVNode)("div", {
|
|
146
|
+
"class": "org-avatar"
|
|
147
|
+
}, [(0, import_vue.createVNode)(import_deptImg.default, null, null)]) : (0, import_vue.createVNode)(import_vant.Image, {
|
|
148
|
+
"class": "org-avatar",
|
|
149
|
+
"src": item.avatar
|
|
150
|
+
}, null), (0, import_vue.createVNode)("div", {
|
|
151
|
+
"class": "org-name"
|
|
152
|
+
}, [item.name])]))]
|
|
153
|
+
}), keyword.value && (0, import_vue.createVNode)(import_vant.List, {
|
|
154
|
+
"loading": loading.value,
|
|
155
|
+
"finished": finished.value,
|
|
156
|
+
"onLoad": onLoad,
|
|
157
|
+
"class": "search-result-list"
|
|
158
|
+
}, {
|
|
159
|
+
default: () => [filteredOrgList.value.filter((item) => item.type !== "dept").map((item) => (0, import_vue.createVNode)("div", {
|
|
160
|
+
"class": ["org-item", isSelected(item) ? "selected" : ""],
|
|
161
|
+
"onClick": () => handleSelect(item)
|
|
103
162
|
}, [(0, import_vue.createVNode)(import_vant.Image, {
|
|
104
163
|
"class": "org-avatar",
|
|
105
|
-
"width": "40",
|
|
106
|
-
"height": "40",
|
|
107
164
|
"src": item.avatar
|
|
108
165
|
}, null), (0, import_vue.createVNode)("div", {
|
|
109
166
|
"class": "org-name"
|
|
110
167
|
}, [item.name])]))]
|
|
111
|
-
}),
|
|
168
|
+
}), keyword.value && filteredOrgList.value.filter((item) => item.type !== "dept").length === 0 && (0, import_vue.createVNode)("div", {
|
|
169
|
+
"class": "empty-search-result"
|
|
170
|
+
}, [(0, import_vue.createTextVNode)("\u672A\u627E\u5230\u76F8\u5173\u4EBA\u5458")])]), props.multiple && (0, import_vue.createVNode)("div", {
|
|
112
171
|
"class": "bottom-section"
|
|
113
172
|
}, [Array.isArray(props.modelValue) && props.modelValue.length > 0 && (0, import_vue.createVNode)("div", {
|
|
114
173
|
"class": "selected-items"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
.cgx-atm .flex {
|
|
3
|
+
align-items: initial;
|
|
4
|
+
flex-direction: initial;
|
|
5
|
+
justify-content: initial;
|
|
6
|
+
flex-wrap: initial;
|
|
7
|
+
}
|
|
8
|
+
.cgx-atm .flex-row {
|
|
9
|
+
flex-direction: row;
|
|
10
|
+
}
|
|
11
|
+
.cgx-atm .flex-col {
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
}
|
|
14
|
+
.cgx-atm .justify-center {
|
|
15
|
+
justify-content: center;
|
|
16
|
+
}
|
|
17
|
+
.cgx-atm .justify-between {
|
|
18
|
+
justify-content: space-between;
|
|
19
|
+
}
|
|
20
|
+
.cgx-atm .justify-around {
|
|
21
|
+
justify-content: space-around;
|
|
22
|
+
}
|
|
23
|
+
.cgx-atm .justify-end {
|
|
24
|
+
justify-content: flex-end;
|
|
25
|
+
}
|
|
26
|
+
.cgx-atm .items-center {
|
|
27
|
+
align-items: center;
|
|
28
|
+
}
|
|
29
|
+
.cgx-atm .flex-wrap {
|
|
30
|
+
flex-wrap: wrap;
|
|
31
|
+
}
|
|
32
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var stdin_exports = {};
|
|
19
|
+
__export(stdin_exports, {
|
|
20
|
+
default: () => stdin_default
|
|
21
|
+
});
|
|
22
|
+
module.exports = __toCommonJS(stdin_exports);
|
|
23
|
+
var import_vue = require("vue");
|
|
24
|
+
var import_atomic = require("./_atomic.css");
|
|
25
|
+
const DeptImg = () => (0, import_vue.createVNode)("svg", {
|
|
26
|
+
"viewBox": "0 0 1204 1024",
|
|
27
|
+
"version": "1.1",
|
|
28
|
+
"xmlns": "http://www.w3.org/2000/svg",
|
|
29
|
+
"p-id": "7601"
|
|
30
|
+
}, [(0, import_vue.createVNode)("path", {
|
|
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"
|
|
34
|
+
}, null), (0, import_vue.createVNode)("path", {
|
|
35
|
+
"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"
|
|
38
|
+
}, null)]);
|
|
39
|
+
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:
|
|
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:32px;height:32px;cursor:pointer;border-radius:4px;overflow:hidden}.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}.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}
|
|
@@ -2,10 +2,28 @@
|
|
|
2
2
|
--van-action-sheet-max-height: 100%;
|
|
3
3
|
}
|
|
4
4
|
.org-list {
|
|
5
|
-
height:
|
|
5
|
+
height: 85vh;
|
|
6
6
|
display: flex;
|
|
7
7
|
flex-direction: column;
|
|
8
8
|
|
|
9
|
+
.breadcrumb-nav {
|
|
10
|
+
margin-bottom: 4px;
|
|
11
|
+
padding: 2px 16px;
|
|
12
|
+
border-radius: 4px;
|
|
13
|
+
font-size: 12px;
|
|
14
|
+
|
|
15
|
+
.dept-name {
|
|
16
|
+
&.current-dept {
|
|
17
|
+
color: #969799; /* 提示文字颜色 */
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.separator {
|
|
22
|
+
color: #969799;
|
|
23
|
+
margin: 0 4px;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
9
27
|
.search-bar {
|
|
10
28
|
position: sticky;
|
|
11
29
|
top: 0;
|
|
@@ -49,6 +67,24 @@
|
|
|
49
67
|
padding: 0 16px;
|
|
50
68
|
}
|
|
51
69
|
|
|
70
|
+
.feed-list-wrap {
|
|
71
|
+
flex: 1;
|
|
72
|
+
display: flex;
|
|
73
|
+
overflow: hidden;
|
|
74
|
+
position: relative;
|
|
75
|
+
}
|
|
76
|
+
.search-result-list {
|
|
77
|
+
position: absolute;
|
|
78
|
+
top: 0; /* Adjust based on search bar and breadcrumb height */
|
|
79
|
+
left: 0;
|
|
80
|
+
right: 0;
|
|
81
|
+
bottom: 0; /* Adjust based on bottom section height if multiple is true */
|
|
82
|
+
z-index: 1;
|
|
83
|
+
background-color: #fff; /* Ensure background is white */
|
|
84
|
+
overflow-y: auto;
|
|
85
|
+
padding: 0 16px;
|
|
86
|
+
}
|
|
87
|
+
|
|
52
88
|
.org-item {
|
|
53
89
|
padding: 12px 0;
|
|
54
90
|
border-bottom: 1px solid #eee;
|
|
@@ -63,8 +99,15 @@
|
|
|
63
99
|
|
|
64
100
|
.org-avatar {
|
|
65
101
|
flex-shrink: 0;
|
|
66
|
-
|
|
67
|
-
|
|
102
|
+
width: 40px;
|
|
103
|
+
height: 40px;
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
img {
|
|
108
|
+
border-radius: 4px;
|
|
109
|
+
border: 1px solid #eee;
|
|
110
|
+
}
|
|
68
111
|
}
|
|
69
112
|
|
|
70
113
|
.org-name {
|
|
@@ -3,11 +3,25 @@ export declare const useApi: () => {
|
|
|
3
3
|
orgList: import("vue").Ref<{
|
|
4
4
|
id: string | number;
|
|
5
5
|
name: string;
|
|
6
|
+
type: string;
|
|
6
7
|
avatar?: string | undefined;
|
|
7
8
|
}[], OrgItem[] | {
|
|
8
9
|
id: string | number;
|
|
9
10
|
name: string;
|
|
11
|
+
type: string;
|
|
10
12
|
avatar?: string | undefined;
|
|
11
13
|
}[]>;
|
|
12
|
-
getOrgList: () => Promise<void>;
|
|
14
|
+
getOrgList: (deptId?: string) => Promise<void>;
|
|
15
|
+
currentDeptId: import("vue").Ref<string, string>;
|
|
16
|
+
deptPath: import("vue").Ref<{
|
|
17
|
+
id: string | number;
|
|
18
|
+
name: string;
|
|
19
|
+
}[], {
|
|
20
|
+
id: string | number;
|
|
21
|
+
name: string;
|
|
22
|
+
}[] | {
|
|
23
|
+
id: string | number;
|
|
24
|
+
name: string;
|
|
25
|
+
}[]>;
|
|
26
|
+
searchOrgList: import("lodash-es").DebouncedFunc<(userName: string) => Promise<void>>;
|
|
13
27
|
};
|