@cgboiler/biz-mobile 1.18.15 → 1.18.17

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 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.14";
11
+ export const version: "1.18.16";
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.14";
5
+ const version = "1.18.16";
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 userList2 = yield getFinalUserList();
97
- if (userList2 == null ? void 0 : userList2.length) {
94
+ const userList = yield getFinalUserList();
95
+ if (userList == null ? void 0 : userList.length) {
98
96
  selectedItems.value = newValue.map((id) => {
99
- return userList2.find((item) => item.id === id);
97
+ return userList.find((item) => item.id === id);
100
98
  });
101
99
  updateDeptSelectionStatus();
102
100
  }
@@ -19,7 +19,7 @@ var __async = (__this, __arguments, generator) => {
19
19
  });
20
20
  };
21
21
  import { computed, ref } from "vue";
22
- import { useFetch, getUserList, getStorage, getUserInfo, removeStorage } from "@cgboiler/core";
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();
@@ -78,7 +78,7 @@ const useApi = () => {
78
78
  const orgList = ref([]);
79
79
  const orgSearchList = ref([]);
80
80
  const currentDeptId = ref("1");
81
- const deptPath = ref([{ id: "1", name: "\u5DDD\u9505\u516C\u53F8" }]);
81
+ const deptPath = ref([{ id: "1", name: "\u4F01\u4E1A\u901A\u8BAF\u5F55" }]);
82
82
  const dataId = ref("");
83
83
  const userInfo = ref({});
84
84
  const getOrgList = (deptId) => __async(void 0, null, function* () {
@@ -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.records && res.records.length) {
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
- data = res;
214
- } else if (storageData && Array.isArray(storageData) && storageData.length > 0) {
215
- data = storageData;
210
+ return res;
216
211
  }
217
- return data || [];
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
- recentSelectedHistory.value = yield getRecentSelectedUsers();
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.14";
11
+ export const version: "1.18.16";
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.14";
48
+ const version = "1.18.16";
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 userList2 = yield (0, import_useApi.getFinalUserList)();
129
- if (userList2 == null ? void 0 : userList2.length) {
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 userList2.find((item) => item.id === id);
129
+ return userList.find((item) => item.id === id);
132
130
  });
133
131
  updateDeptSelectionStatus();
134
132
  }
@@ -101,7 +101,7 @@ const useApi = () => {
101
101
  const orgList = (0, import_vue.ref)([]);
102
102
  const orgSearchList = (0, import_vue.ref)([]);
103
103
  const currentDeptId = (0, import_vue.ref)("1");
104
- const deptPath = (0, import_vue.ref)([{ id: "1", name: "\u5DDD\u9505\u516C\u53F8" }]);
104
+ const deptPath = (0, import_vue.ref)([{ id: "1", name: "\u4F01\u4E1A\u901A\u8BAF\u5F55" }]);
105
105
  const dataId = (0, import_vue.ref)("");
106
106
  const userInfo = (0, import_vue.ref)({});
107
107
  const getOrgList = (deptId) => __async(void 0, null, function* () {
@@ -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.records && res.records.length) {
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
- data = res;
237
- } else if (storageData && Array.isArray(storageData) && storageData.length > 0) {
238
- data = storageData;
233
+ return res;
239
234
  }
240
- return data || [];
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
- recentSelectedHistory.value = yield getRecentSelectedUsers();
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.15",
3
+ "version": "1.18.17",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -52,7 +52,7 @@
52
52
  "lodash-es": "^4.17.21",
53
53
  "vant": "^4.9.19",
54
54
  "@cgboiler/core": "1.2.10",
55
- "@cgboiler/biz-basic": "1.0.18",
55
+ "@cgboiler/biz-basic": "1.0.24",
56
56
  "@cgboiler/shared": "1.1.2"
57
57
  },
58
58
  "scripts": {