@cgboiler/biz-mobile 1.18.11 → 1.18.13

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.10";
11
+ export const version: "1.18.12";
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.10";
5
+ const version = "1.18.12";
6
6
  function install(app) {
7
7
  const components = [
8
8
  MdPreview,
@@ -1,10 +1,30 @@
1
+ var __async = (__this, __arguments, generator) => {
2
+ return new Promise((resolve, reject) => {
3
+ var fulfilled = (value) => {
4
+ try {
5
+ step(generator.next(value));
6
+ } catch (e) {
7
+ reject(e);
8
+ }
9
+ };
10
+ var rejected = (value) => {
11
+ try {
12
+ step(generator.throw(value));
13
+ } catch (e) {
14
+ reject(e);
15
+ }
16
+ };
17
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
18
+ step((generator = generator.apply(__this, __arguments)).next());
19
+ });
20
+ };
1
21
  import { createVNode as _createVNode, createTextVNode as _createTextVNode, Fragment as _Fragment } from "vue";
2
22
  import "./_atomic.css";
3
23
  import { defineComponent, ref, computed, watch } from "vue";
4
24
  import { ActionSheet, Search, List, Image, Empty, Tabs, Tab, Icon } from "vant";
5
25
  import DeptImg from "./components/DeptImg";
6
26
  import { orgPickerProps } from "./types";
7
- import { useApi } from "./useApi";
27
+ import { useApi, getFinalUserList } from "./useApi";
8
28
  import "./index.css";
9
29
  import { useSearch } from "./useSearch";
10
30
  var stdin_default = defineComponent({
@@ -68,19 +88,19 @@ var stdin_default = defineComponent({
68
88
  const personnel = orgList.value.filter((item) => item.type !== "dept");
69
89
  return [...personnel, ...departments];
70
90
  });
71
- watch(() => props.modelValue, (newValue) => {
72
- var _a;
91
+ watch(() => props.modelValue, (newValue) => __async(this, null, function* () {
73
92
  if (!newValue) {
74
93
  selectedItems.value = [];
75
94
  return;
76
95
  }
77
- if ((_a = userList.value) == null ? void 0 : _a.length) {
96
+ const userList2 = yield getFinalUserList();
97
+ if (userList2 == null ? void 0 : userList2.length) {
78
98
  selectedItems.value = newValue.map((id) => {
79
- return userList.value.find((item) => item.id === id);
99
+ return userList2.find((item) => item.id === id);
80
100
  });
81
101
  updateDeptSelectionStatus();
82
102
  }
83
- }, {
103
+ }), {
84
104
  immediate: true
85
105
  });
86
106
  watch(() => selectedItems.value, () => {
@@ -1,4 +1,5 @@
1
1
  import { type OrgItem, RecentSelection } from './types';
2
+ export declare function getFinalUserList(): Promise<any[]>;
2
3
  export declare const useApi: () => {
3
4
  userList: import("vue").Ref<{
4
5
  [x: string]: any;
@@ -65,6 +65,15 @@ function initDeptList() {
65
65
  }
66
66
  initUserList();
67
67
  initDeptList();
68
+ function getFinalUserList() {
69
+ return __async(this, null, function* () {
70
+ var _a;
71
+ if ((_a = userList.value) == null ? void 0 : _a.length) {
72
+ return userList.value;
73
+ }
74
+ return yield getUserList();
75
+ });
76
+ }
68
77
  const useApi = () => {
69
78
  const orgList = ref([]);
70
79
  const orgSearchList = ref([]);
@@ -101,9 +110,7 @@ const useApi = () => {
101
110
  }
102
111
  const url = `https://wflow.cgboiler.com/v1/oa/org/tree/user/search/cloud?userName=${userName}`;
103
112
  const searchResults = yield fetchData(url);
104
- orgSearchList.value = searchResults.filter(
105
- (item) => item.type !== "user" || item.status !== 5
106
- );
113
+ orgSearchList.value = searchResults.filter((item) => item.type !== "user" || item.status !== 5);
107
114
  }), 300);
108
115
  const RECENT_SELECTED_USERS_KEY = "recent_selected_users_history";
109
116
  const MAX_RECENT_SELECTIONS = 15;
@@ -261,9 +268,7 @@ const useApi = () => {
261
268
  };
262
269
  const getUsersByDeptId = (deptId) => {
263
270
  const users = [];
264
- const directUsers = userList.value.filter(
265
- (user) => user.deptId === deptId && user.status !== 5
266
- );
271
+ const directUsers = userList.value.filter((user) => user.deptId === deptId && user.status !== 5);
267
272
  users.push(...directUsers);
268
273
  const childDepts = deptList.value.filter((dept) => dept.parentId === deptId);
269
274
  childDepts.forEach((childDept) => {
@@ -293,5 +298,6 @@ const useApi = () => {
293
298
  };
294
299
  };
295
300
  export {
301
+ getFinalUserList,
296
302
  useApi
297
303
  };
@@ -101,20 +101,7 @@ function useSearch({
101
101
  }) => {
102
102
  return _createVNode("div", {
103
103
  "class": "absolute top-0 left-0 right-0 bottom-0 bg-[#fff] z-1 overflow-auto"
104
- }, [filterRecentSelectedHistory.value.length && props.multiple ? _createVNode(_Fragment, null, [_createVNode("p", {
105
- "class": "text-[14px] text-[#333] font-bold px-[16px] py-[12px] border-b border-[#eee]"
106
- }, [_createTextVNode("\u6700\u8FD1\u9009\u62E9")]), _createVNode("div", {
107
- "class": "recent-list-wrap flex-1 py-[8px]"
108
- }, [filterRecentSelectedHistory.value.map((historyItem) => _createVNode("div", {
109
- "key": historyItem.id,
110
- "onClick": () => handleHistorySelect(historyItem),
111
- "class": "px-16px py-8px border-b border-[#eee]"
112
- }, [_createVNode("span", null, [historyItem.selectedUsers.map((user) => {
113
- var _a;
114
- return highlightText((_a = getUserInfoById(user.id)) == null ? void 0 : _a.name, keyword.value);
115
- }).reduce((prev, curr) => [prev, "\uFF0C", curr])])]))])]) : "", filteredOrgList.value.length ? _createVNode(_Fragment, null, [" ", _createVNode("p", {
116
- "class": "text-[14px] text-[#333] font-bold px-[16px] py-[12px] border-b border-[#eee]"
117
- }, [_createTextVNode("\u901A\u8BAF\u5F55")]), _createVNode("div", {
104
+ }, [filteredOrgList.value.length ? _createVNode(_Fragment, null, [" ", _createVNode("div", {
118
105
  "class": "px-16px"
119
106
  }, [filteredOrgList.value.length === 0 ? _createVNode(Empty, {
120
107
  "description": "\u672A\u627E\u5230\u76F8\u5173\u4EBA\u5458"
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.10";
11
+ export const version: "1.18.12";
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.10";
48
+ const version = "1.18.12";
49
49
  function install(app) {
50
50
  const components = [
51
51
  import_md_preview.default,
@@ -25,6 +25,26 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  mod
26
26
  ));
27
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+ var __async = (__this, __arguments, generator) => {
29
+ return new Promise((resolve, reject) => {
30
+ var fulfilled = (value) => {
31
+ try {
32
+ step(generator.next(value));
33
+ } catch (e) {
34
+ reject(e);
35
+ }
36
+ };
37
+ var rejected = (value) => {
38
+ try {
39
+ step(generator.throw(value));
40
+ } catch (e) {
41
+ reject(e);
42
+ }
43
+ };
44
+ var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
45
+ step((generator = generator.apply(__this, __arguments)).next());
46
+ });
47
+ };
28
48
  var stdin_exports = {};
29
49
  __export(stdin_exports, {
30
50
  default: () => stdin_default
@@ -100,19 +120,19 @@ var stdin_default = (0, import_vue2.defineComponent)({
100
120
  const personnel = orgList.value.filter((item) => item.type !== "dept");
101
121
  return [...personnel, ...departments];
102
122
  });
103
- (0, import_vue2.watch)(() => props.modelValue, (newValue) => {
104
- var _a;
123
+ (0, import_vue2.watch)(() => props.modelValue, (newValue) => __async(this, null, function* () {
105
124
  if (!newValue) {
106
125
  selectedItems.value = [];
107
126
  return;
108
127
  }
109
- if ((_a = userList.value) == null ? void 0 : _a.length) {
128
+ const userList2 = yield (0, import_useApi.getFinalUserList)();
129
+ if (userList2 == null ? void 0 : userList2.length) {
110
130
  selectedItems.value = newValue.map((id) => {
111
- return userList.value.find((item) => item.id === id);
131
+ return userList2.find((item) => item.id === id);
112
132
  });
113
133
  updateDeptSelectionStatus();
114
134
  }
115
- }, {
135
+ }), {
116
136
  immediate: true
117
137
  });
118
138
  (0, import_vue2.watch)(() => selectedItems.value, () => {
@@ -1,4 +1,5 @@
1
1
  import { type OrgItem, RecentSelection } from './types';
2
+ export declare function getFinalUserList(): Promise<any[]>;
2
3
  export declare const useApi: () => {
3
4
  userList: import("vue").Ref<{
4
5
  [x: string]: any;
@@ -37,6 +37,7 @@ var __async = (__this, __arguments, generator) => {
37
37
  };
38
38
  var stdin_exports = {};
39
39
  __export(stdin_exports, {
40
+ getFinalUserList: () => getFinalUserList,
40
41
  useApi: () => useApi
41
42
  });
42
43
  module.exports = __toCommonJS(stdin_exports);
@@ -87,6 +88,15 @@ function initDeptList() {
87
88
  }
88
89
  initUserList();
89
90
  initDeptList();
91
+ function getFinalUserList() {
92
+ return __async(this, null, function* () {
93
+ var _a;
94
+ if ((_a = userList.value) == null ? void 0 : _a.length) {
95
+ return userList.value;
96
+ }
97
+ return yield (0, import_core.getUserList)();
98
+ });
99
+ }
90
100
  const useApi = () => {
91
101
  const orgList = (0, import_vue.ref)([]);
92
102
  const orgSearchList = (0, import_vue.ref)([]);
@@ -123,9 +133,7 @@ const useApi = () => {
123
133
  }
124
134
  const url = `https://wflow.cgboiler.com/v1/oa/org/tree/user/search/cloud?userName=${userName}`;
125
135
  const searchResults = yield fetchData(url);
126
- orgSearchList.value = searchResults.filter(
127
- (item) => item.type !== "user" || item.status !== 5
128
- );
136
+ orgSearchList.value = searchResults.filter((item) => item.type !== "user" || item.status !== 5);
129
137
  }), 300);
130
138
  const RECENT_SELECTED_USERS_KEY = "recent_selected_users_history";
131
139
  const MAX_RECENT_SELECTIONS = 15;
@@ -283,9 +291,7 @@ const useApi = () => {
283
291
  };
284
292
  const getUsersByDeptId = (deptId) => {
285
293
  const users = [];
286
- const directUsers = userList.value.filter(
287
- (user) => user.deptId === deptId && user.status !== 5
288
- );
294
+ const directUsers = userList.value.filter((user) => user.deptId === deptId && user.status !== 5);
289
295
  users.push(...directUsers);
290
296
  const childDepts = deptList.value.filter((dept) => dept.parentId === deptId);
291
297
  childDepts.forEach((childDept) => {
@@ -123,20 +123,7 @@ function useSearch({
123
123
  }) => {
124
124
  return (0, import_vue.createVNode)("div", {
125
125
  "class": "absolute top-0 left-0 right-0 bottom-0 bg-[#fff] z-1 overflow-auto"
126
- }, [filterRecentSelectedHistory.value.length && props.multiple ? (0, import_vue.createVNode)(import_vue.Fragment, null, [(0, import_vue.createVNode)("p", {
127
- "class": "text-[14px] text-[#333] font-bold px-[16px] py-[12px] border-b border-[#eee]"
128
- }, [(0, import_vue.createTextVNode)("\u6700\u8FD1\u9009\u62E9")]), (0, import_vue.createVNode)("div", {
129
- "class": "recent-list-wrap flex-1 py-[8px]"
130
- }, [filterRecentSelectedHistory.value.map((historyItem) => (0, import_vue.createVNode)("div", {
131
- "key": historyItem.id,
132
- "onClick": () => handleHistorySelect(historyItem),
133
- "class": "px-16px py-8px border-b border-[#eee]"
134
- }, [(0, import_vue.createVNode)("span", null, [historyItem.selectedUsers.map((user) => {
135
- var _a;
136
- return highlightText((_a = getUserInfoById(user.id)) == null ? void 0 : _a.name, keyword.value);
137
- }).reduce((prev, curr) => [prev, "\uFF0C", curr])])]))])]) : "", filteredOrgList.value.length ? (0, import_vue.createVNode)(import_vue.Fragment, null, [" ", (0, import_vue.createVNode)("p", {
138
- "class": "text-[14px] text-[#333] font-bold px-[16px] py-[12px] border-b border-[#eee]"
139
- }, [(0, import_vue.createTextVNode)("\u901A\u8BAF\u5F55")]), (0, import_vue.createVNode)("div", {
126
+ }, [filteredOrgList.value.length ? (0, import_vue.createVNode)(import_vue.Fragment, null, [" ", (0, import_vue.createVNode)("div", {
140
127
  "class": "px-16px"
141
128
  }, [filteredOrgList.value.length === 0 ? (0, import_vue.createVNode)(import_vant.Empty, {
142
129
  "description": "\u672A\u627E\u5230\u76F8\u5173\u4EBA\u5458"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cgboiler/biz-mobile",
3
- "version": "1.18.11",
3
+ "version": "1.18.13",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
@@ -52,7 +52,7 @@
52
52
  "vant": "^4.9.19",
53
53
  "@cgboiler/core": "1.2.8",
54
54
  "@cgboiler/shared": "1.1.1",
55
- "@cgboiler/biz-basic": "1.0.9"
55
+ "@cgboiler/biz-basic": "1.0.14"
56
56
  },
57
57
  "scripts": {
58
58
  "dev": "cg-cli dev",