@cgboiler/biz-mobile 1.18.16 → 1.18.18
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 +18 -6
- package/es/org-picker/useApi.js +5 -10
- package/es/org-picker/useSearch.js +3 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/lib/org-picker/OrgPicker.js +18 -6
- package/lib/org-picker/useApi.js +4 -9
- package/lib/org-picker/useSearch.js +3 -1
- package/package.json +3 -3
package/es/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare namespace _default {
|
|
|
8
8
|
}
|
|
9
9
|
export default _default;
|
|
10
10
|
export function install(app: any): void;
|
|
11
|
-
export const version: "1.18.
|
|
11
|
+
export const version: "1.18.17";
|
|
12
12
|
import MdPreview from './md-preview';
|
|
13
13
|
import OrgPicker from './org-picker';
|
|
14
14
|
import ProjectSelect from './project-select';
|
package/es/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import MdPreview from "./md-preview";
|
|
|
2
2
|
import OrgPicker from "./org-picker";
|
|
3
3
|
import ProjectSelect from "./project-select";
|
|
4
4
|
import RichTextEditor from "./rich-text-editor";
|
|
5
|
-
const version = "1.18.
|
|
5
|
+
const version = "1.18.17";
|
|
6
6
|
function install(app) {
|
|
7
7
|
const components = [
|
|
8
8
|
MdPreview,
|
|
@@ -39,10 +39,8 @@ var stdin_default = defineComponent({
|
|
|
39
39
|
getOrgList,
|
|
40
40
|
orgList,
|
|
41
41
|
deptPath,
|
|
42
|
-
userList,
|
|
43
42
|
getUserInfoById,
|
|
44
|
-
getUsersByDeptId
|
|
45
|
-
getDeptById
|
|
43
|
+
getUsersByDeptId
|
|
46
44
|
} = api;
|
|
47
45
|
getOrgList();
|
|
48
46
|
const activeTab = ref("txl");
|
|
@@ -93,10 +91,10 @@ var stdin_default = defineComponent({
|
|
|
93
91
|
selectedItems.value = [];
|
|
94
92
|
return;
|
|
95
93
|
}
|
|
96
|
-
const
|
|
97
|
-
if (
|
|
94
|
+
const userList = yield getFinalUserList();
|
|
95
|
+
if (userList == null ? void 0 : userList.length) {
|
|
98
96
|
selectedItems.value = newValue.map((id) => {
|
|
99
|
-
return
|
|
97
|
+
return userList.find((item) => item.id === id);
|
|
100
98
|
});
|
|
101
99
|
updateDeptSelectionStatus();
|
|
102
100
|
}
|
|
@@ -108,6 +106,20 @@ var stdin_default = defineComponent({
|
|
|
108
106
|
}, {
|
|
109
107
|
deep: true
|
|
110
108
|
});
|
|
109
|
+
watch(() => props.show, (newValue) => {
|
|
110
|
+
const handleKeyDown = (event) => {
|
|
111
|
+
if (event.key === "Escape") {
|
|
112
|
+
emit("update:show", false);
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
if (newValue) {
|
|
116
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
117
|
+
} else {
|
|
118
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
119
|
+
}
|
|
120
|
+
}, {
|
|
121
|
+
immediate: true
|
|
122
|
+
});
|
|
111
123
|
const handleDeptSelect = (item) => {
|
|
112
124
|
if (item.type !== "dept" || !props.multiple)
|
|
113
125
|
return;
|
package/es/org-picker/useApi.js
CHANGED
|
@@ -19,7 +19,7 @@ var __async = (__this, __arguments, generator) => {
|
|
|
19
19
|
});
|
|
20
20
|
};
|
|
21
21
|
import { computed, ref } from "vue";
|
|
22
|
-
import { useFetch, getUserList,
|
|
22
|
+
import { useFetch, getUserList, getUserInfo } from "@cgboiler/core";
|
|
23
23
|
import { getDeptList } from "@cgboiler/core";
|
|
24
24
|
import { debounce } from "lodash-es";
|
|
25
25
|
const orgListCache = /* @__PURE__ */ new Map();
|
|
@@ -112,9 +112,9 @@ const useApi = () => {
|
|
|
112
112
|
const searchResults = yield fetchData(url);
|
|
113
113
|
orgSearchList.value = searchResults.filter((item) => item.type !== "user" || item.status !== 5).filter((item, index, self) => index === self.findIndex((other) => other.id === item.id));
|
|
114
114
|
}), 300);
|
|
115
|
-
const RECENT_SELECTED_USERS_KEY = "recent_selected_users_history";
|
|
116
115
|
const MAX_RECENT_SELECTIONS = 15;
|
|
117
116
|
const getRecentUsers = () => __async(void 0, null, function* () {
|
|
117
|
+
var _a;
|
|
118
118
|
const user = yield getUserInfo();
|
|
119
119
|
let name = "";
|
|
120
120
|
userList.value = yield getUserList();
|
|
@@ -129,7 +129,7 @@ const useApi = () => {
|
|
|
129
129
|
);
|
|
130
130
|
const res = yield fetchData(url);
|
|
131
131
|
let recentList = [];
|
|
132
|
-
if (res
|
|
132
|
+
if ((_a = res == null ? void 0 : res.records) == null ? void 0 : _a.length) {
|
|
133
133
|
res.records.forEach((item) => {
|
|
134
134
|
const data = JSON.parse(item.data);
|
|
135
135
|
if (data.field6713678545899 === userInfo.value.name + "_" + user.userId) {
|
|
@@ -197,7 +197,6 @@ const useApi = () => {
|
|
|
197
197
|
result = { success: true, message: responseText };
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
|
-
yield removeStorage(RECENT_SELECTED_USERS_KEY);
|
|
201
200
|
return result;
|
|
202
201
|
} catch (error) {
|
|
203
202
|
console.error("Failed to add or update recent users", error);
|
|
@@ -207,14 +206,10 @@ const useApi = () => {
|
|
|
207
206
|
const getRecentSelectedUsers = () => __async(void 0, null, function* () {
|
|
208
207
|
try {
|
|
209
208
|
const res = yield getRecentUsers();
|
|
210
|
-
const storageData = yield getStorage(RECENT_SELECTED_USERS_KEY);
|
|
211
|
-
let data = [];
|
|
212
209
|
if (res && Array.isArray(res) && res.length > 0) {
|
|
213
|
-
|
|
214
|
-
} else if (storageData && Array.isArray(storageData) && storageData.length > 0) {
|
|
215
|
-
data = storageData;
|
|
210
|
+
return res;
|
|
216
211
|
}
|
|
217
|
-
return
|
|
212
|
+
return [];
|
|
218
213
|
} catch (error) {
|
|
219
214
|
console.error("Failed to get recent selected users history from localStorage", error);
|
|
220
215
|
return [];
|
|
@@ -43,7 +43,9 @@ function useSearch({
|
|
|
43
43
|
const recentSelectedHistory = ref([]);
|
|
44
44
|
const filterRecentSelectedHistory = ref([]);
|
|
45
45
|
watchEffect(() => __async(this, null, function* () {
|
|
46
|
-
|
|
46
|
+
if (props.show && props.multiple && !recentSelectedHistory.value.length) {
|
|
47
|
+
recentSelectedHistory.value = yield getRecentSelectedUsers();
|
|
48
|
+
}
|
|
47
49
|
}));
|
|
48
50
|
const setRecentUsers = (users) => __async(this, null, function* () {
|
|
49
51
|
yield setRecentSelectedUsers(users);
|
package/lib/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ declare namespace _default {
|
|
|
8
8
|
}
|
|
9
9
|
export default _default;
|
|
10
10
|
export function install(app: any): void;
|
|
11
|
-
export const version: "1.18.
|
|
11
|
+
export const version: "1.18.17";
|
|
12
12
|
import MdPreview from './md-preview';
|
|
13
13
|
import OrgPicker from './org-picker';
|
|
14
14
|
import ProjectSelect from './project-select';
|
package/lib/index.js
CHANGED
|
@@ -45,7 +45,7 @@ __reExport(stdin_exports, require("./md-preview"), module.exports);
|
|
|
45
45
|
__reExport(stdin_exports, require("./org-picker"), module.exports);
|
|
46
46
|
__reExport(stdin_exports, require("./project-select"), module.exports);
|
|
47
47
|
__reExport(stdin_exports, require("./rich-text-editor"), module.exports);
|
|
48
|
-
const version = "1.18.
|
|
48
|
+
const version = "1.18.17";
|
|
49
49
|
function install(app) {
|
|
50
50
|
const components = [
|
|
51
51
|
import_md_preview.default,
|
|
@@ -71,10 +71,8 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
71
71
|
getOrgList,
|
|
72
72
|
orgList,
|
|
73
73
|
deptPath,
|
|
74
|
-
userList,
|
|
75
74
|
getUserInfoById,
|
|
76
|
-
getUsersByDeptId
|
|
77
|
-
getDeptById
|
|
75
|
+
getUsersByDeptId
|
|
78
76
|
} = api;
|
|
79
77
|
getOrgList();
|
|
80
78
|
const activeTab = (0, import_vue2.ref)("txl");
|
|
@@ -125,10 +123,10 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
125
123
|
selectedItems.value = [];
|
|
126
124
|
return;
|
|
127
125
|
}
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
126
|
+
const userList = yield (0, import_useApi.getFinalUserList)();
|
|
127
|
+
if (userList == null ? void 0 : userList.length) {
|
|
130
128
|
selectedItems.value = newValue.map((id) => {
|
|
131
|
-
return
|
|
129
|
+
return userList.find((item) => item.id === id);
|
|
132
130
|
});
|
|
133
131
|
updateDeptSelectionStatus();
|
|
134
132
|
}
|
|
@@ -140,6 +138,20 @@ var stdin_default = (0, import_vue2.defineComponent)({
|
|
|
140
138
|
}, {
|
|
141
139
|
deep: true
|
|
142
140
|
});
|
|
141
|
+
(0, import_vue2.watch)(() => props.show, (newValue) => {
|
|
142
|
+
const handleKeyDown = (event) => {
|
|
143
|
+
if (event.key === "Escape") {
|
|
144
|
+
emit("update:show", false);
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
if (newValue) {
|
|
148
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
149
|
+
} else {
|
|
150
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
151
|
+
}
|
|
152
|
+
}, {
|
|
153
|
+
immediate: true
|
|
154
|
+
});
|
|
143
155
|
const handleDeptSelect = (item) => {
|
|
144
156
|
if (item.type !== "dept" || !props.multiple)
|
|
145
157
|
return;
|
package/lib/org-picker/useApi.js
CHANGED
|
@@ -135,9 +135,9 @@ const useApi = () => {
|
|
|
135
135
|
const searchResults = yield fetchData(url);
|
|
136
136
|
orgSearchList.value = searchResults.filter((item) => item.type !== "user" || item.status !== 5).filter((item, index, self) => index === self.findIndex((other) => other.id === item.id));
|
|
137
137
|
}), 300);
|
|
138
|
-
const RECENT_SELECTED_USERS_KEY = "recent_selected_users_history";
|
|
139
138
|
const MAX_RECENT_SELECTIONS = 15;
|
|
140
139
|
const getRecentUsers = () => __async(void 0, null, function* () {
|
|
140
|
+
var _a;
|
|
141
141
|
const user = yield (0, import_core.getUserInfo)();
|
|
142
142
|
let name = "";
|
|
143
143
|
userList.value = yield (0, import_core.getUserList)();
|
|
@@ -152,7 +152,7 @@ const useApi = () => {
|
|
|
152
152
|
);
|
|
153
153
|
const res = yield fetchData(url);
|
|
154
154
|
let recentList = [];
|
|
155
|
-
if (res
|
|
155
|
+
if ((_a = res == null ? void 0 : res.records) == null ? void 0 : _a.length) {
|
|
156
156
|
res.records.forEach((item) => {
|
|
157
157
|
const data = JSON.parse(item.data);
|
|
158
158
|
if (data.field6713678545899 === userInfo.value.name + "_" + user.userId) {
|
|
@@ -220,7 +220,6 @@ const useApi = () => {
|
|
|
220
220
|
result = { success: true, message: responseText };
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
yield (0, import_core.removeStorage)(RECENT_SELECTED_USERS_KEY);
|
|
224
223
|
return result;
|
|
225
224
|
} catch (error) {
|
|
226
225
|
console.error("Failed to add or update recent users", error);
|
|
@@ -230,14 +229,10 @@ const useApi = () => {
|
|
|
230
229
|
const getRecentSelectedUsers = () => __async(void 0, null, function* () {
|
|
231
230
|
try {
|
|
232
231
|
const res = yield getRecentUsers();
|
|
233
|
-
const storageData = yield (0, import_core.getStorage)(RECENT_SELECTED_USERS_KEY);
|
|
234
|
-
let data = [];
|
|
235
232
|
if (res && Array.isArray(res) && res.length > 0) {
|
|
236
|
-
|
|
237
|
-
} else if (storageData && Array.isArray(storageData) && storageData.length > 0) {
|
|
238
|
-
data = storageData;
|
|
233
|
+
return res;
|
|
239
234
|
}
|
|
240
|
-
return
|
|
235
|
+
return [];
|
|
241
236
|
} catch (error) {
|
|
242
237
|
console.error("Failed to get recent selected users history from localStorage", error);
|
|
243
238
|
return [];
|
|
@@ -65,7 +65,9 @@ function useSearch({
|
|
|
65
65
|
const recentSelectedHistory = (0, import_vue2.ref)([]);
|
|
66
66
|
const filterRecentSelectedHistory = (0, import_vue2.ref)([]);
|
|
67
67
|
(0, import_vue2.watchEffect)(() => __async(this, null, function* () {
|
|
68
|
-
|
|
68
|
+
if (props.show && props.multiple && !recentSelectedHistory.value.length) {
|
|
69
|
+
recentSelectedHistory.value = yield getRecentSelectedUsers();
|
|
70
|
+
}
|
|
69
71
|
}));
|
|
70
72
|
const setRecentUsers = (users) => __async(this, null, function* () {
|
|
71
73
|
yield setRecentSelectedUsers(users);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cgboiler/biz-mobile",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.18",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "es/index.js",
|
|
@@ -52,8 +52,8 @@
|
|
|
52
52
|
"lodash-es": "^4.17.21",
|
|
53
53
|
"vant": "^4.9.19",
|
|
54
54
|
"@cgboiler/core": "1.2.10",
|
|
55
|
-
"@cgboiler/
|
|
56
|
-
"@cgboiler/
|
|
55
|
+
"@cgboiler/biz-basic": "1.0.37",
|
|
56
|
+
"@cgboiler/shared": "1.1.2"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"dev": "cg-cli dev",
|