@cgboiler/biz-mobile 1.18.8 → 1.18.9

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.
@@ -1,24 +1,24 @@
1
- import 'vue';
2
-
3
- type EventHandler = (...args: any[]) => void;
4
-
5
- declare module 'vue' {
6
- interface ComponentCustomProps {
7
- id?: string;
8
- role?: string;
9
- tabindex?: number;
10
- onClick?: EventHandler;
11
- onTouchend?: EventHandler;
12
- onTouchmove?: EventHandler;
13
- onTouchstart?: EventHandler;
14
- onTouchcancel?: EventHandler;
15
- onTouchmovePassive?: EventHandler;
16
- onTouchstartPassive?: EventHandler;
17
- }
18
-
19
- interface HTMLAttributes {
20
- onTouchmovePassive?: EventHandler;
21
- onTouchstartPassive?: EventHandler;
22
- onClickCapture?: EventHandler;
23
- }
24
- }
1
+ import 'vue';
2
+
3
+ type EventHandler = (...args: any[]) => void;
4
+
5
+ declare module 'vue' {
6
+ interface ComponentCustomProps {
7
+ id?: string;
8
+ role?: string;
9
+ tabindex?: number;
10
+ onClick?: EventHandler;
11
+ onTouchend?: EventHandler;
12
+ onTouchmove?: EventHandler;
13
+ onTouchstart?: EventHandler;
14
+ onTouchcancel?: EventHandler;
15
+ onTouchmovePassive?: EventHandler;
16
+ onTouchstartPassive?: EventHandler;
17
+ }
18
+
19
+ interface HTMLAttributes {
20
+ onTouchmovePassive?: EventHandler;
21
+ onTouchstartPassive?: EventHandler;
22
+ onClickCapture?: EventHandler;
23
+ }
24
+ }
@@ -1,101 +1,101 @@
1
- .katex-block {
2
- display: block;
3
- margin: 1em 0;
4
- text-align: center;
5
- overflow-x: auto;
6
- overflow-y: hidden;
7
- }
8
-
9
- .cgx-markdown-preview {
10
-
11
- /* 差异对比样式 */
12
- .diff-container {
13
- border: 1px solid #ebeef5;
14
- border-radius: 4px;
15
- overflow: auto;
16
- }
17
-
18
- .diff-equal {
19
- color: #606266;
20
- }
21
-
22
- .diff-delete {
23
- background-color: #ffeef0;
24
- color: #f56c6c;
25
- text-decoration: line-through;
26
- }
27
-
28
- .diff-insert {
29
- background-color: #e6ffec;
30
- color: #67c23a;
31
- }
32
-
33
- .diff-unified-view pre {
34
- margin: 0;
35
- padding: 8px;
36
- white-space: pre-wrap;
37
- word-break: break-word;
38
- }
39
- }
40
-
41
- .cgx-markdown-preview {
42
- line-height: 1.6;
43
- font-size: var(--font-base, 16px);
44
- ol {
45
- list-style: auto;
46
- }
47
-
48
- ul {
49
- list-style: disc;
50
- }
51
-
52
- ol,
53
- ul {
54
- padding-left: 1.5em;
55
- margin: 0 0 12px 0;
56
- }
57
-
58
- li::marker {
59
- text-align: start !important;
60
- }
61
-
62
- h1 {
63
- font-size: 2em;
64
- font-weight: bold;
65
- margin: 16px 0;
66
- }
67
-
68
- h2 {
69
- font-size: 1.5em;
70
- font-weight: bold;
71
- margin: 14px 0;
72
- }
73
-
74
- p {
75
- margin: 12px 0;
76
- }
77
-
78
- blockquote {
79
- margin: 0;
80
- padding-left: 1em;
81
- border-left: 4px solid #ddd;
82
- color: #666;
83
- }
84
-
85
- table {
86
- border-collapse: collapse;
87
- width: 100%;
88
- margin-bottom: 16px;
89
- }
90
-
91
- th,
92
- td {
93
- border: 1px solid #ddd;
94
- padding: 8px;
95
- text-align: left;
96
- }
97
-
98
- th {
99
- background-color: #f6f8fa;
100
- }
101
- }
1
+ .katex-block {
2
+ display: block;
3
+ margin: 1em 0;
4
+ text-align: center;
5
+ overflow-x: auto;
6
+ overflow-y: hidden;
7
+ }
8
+
9
+ .cgx-markdown-preview {
10
+
11
+ /* 差异对比样式 */
12
+ .diff-container {
13
+ border: 1px solid #ebeef5;
14
+ border-radius: 4px;
15
+ overflow: auto;
16
+ }
17
+
18
+ .diff-equal {
19
+ color: #606266;
20
+ }
21
+
22
+ .diff-delete {
23
+ background-color: #ffeef0;
24
+ color: #f56c6c;
25
+ text-decoration: line-through;
26
+ }
27
+
28
+ .diff-insert {
29
+ background-color: #e6ffec;
30
+ color: #67c23a;
31
+ }
32
+
33
+ .diff-unified-view pre {
34
+ margin: 0;
35
+ padding: 8px;
36
+ white-space: pre-wrap;
37
+ word-break: break-word;
38
+ }
39
+ }
40
+
41
+ .cgx-markdown-preview {
42
+ line-height: 1.6;
43
+ font-size: var(--font-base, 16px);
44
+ ol {
45
+ list-style: auto;
46
+ }
47
+
48
+ ul {
49
+ list-style: disc;
50
+ }
51
+
52
+ ol,
53
+ ul {
54
+ padding-left: 1.5em;
55
+ margin: 0 0 12px 0;
56
+ }
57
+
58
+ li::marker {
59
+ text-align: start !important;
60
+ }
61
+
62
+ h1 {
63
+ font-size: 2em;
64
+ font-weight: bold;
65
+ margin: 16px 0;
66
+ }
67
+
68
+ h2 {
69
+ font-size: 1.5em;
70
+ font-weight: bold;
71
+ margin: 14px 0;
72
+ }
73
+
74
+ p {
75
+ margin: 12px 0;
76
+ }
77
+
78
+ blockquote {
79
+ margin: 0;
80
+ padding-left: 1em;
81
+ border-left: 4px solid #ddd;
82
+ color: #666;
83
+ }
84
+
85
+ table {
86
+ border-collapse: collapse;
87
+ width: 100%;
88
+ margin-bottom: 16px;
89
+ }
90
+
91
+ th,
92
+ td {
93
+ border: 1px solid #ddd;
94
+ padding: 8px;
95
+ text-align: left;
96
+ }
97
+
98
+ th {
99
+ background-color: #f6f8fa;
100
+ }
101
+ }
@@ -52,7 +52,9 @@ var stdin_default = (0, import_vue2.defineComponent)({
52
52
  orgList,
53
53
  deptPath,
54
54
  userList,
55
- getUserInfoById
55
+ getUserInfoById,
56
+ getUsersByDeptId,
57
+ getDeptById
56
58
  } = api;
57
59
  getOrgList();
58
60
  const activeTab = (0, import_vue2.ref)("txl");
@@ -71,6 +73,28 @@ var stdin_default = (0, import_vue2.defineComponent)({
71
73
  isSearchFocus
72
74
  });
73
75
  const selectedItems = (0, import_vue2.ref)([]);
76
+ const fullySelectedDepts = (0, import_vue2.ref)(/* @__PURE__ */ new Set());
77
+ const partiallySelectedDepts = (0, import_vue2.ref)(/* @__PURE__ */ new Set());
78
+ const updateDeptSelectionStatus = () => {
79
+ if (!props.multiple)
80
+ return;
81
+ const newFullySelected = /* @__PURE__ */ new Set();
82
+ const newPartiallySelected = /* @__PURE__ */ new Set();
83
+ const selectedUserIds = new Set(selectedItems.value.map((item) => item.id));
84
+ api.deptList.value.forEach((dept) => {
85
+ const deptUsers = getUsersByDeptId(dept.id);
86
+ if (deptUsers.length === 0)
87
+ return;
88
+ const selectedCount = deptUsers.filter((user) => selectedUserIds.has(user.id)).length;
89
+ if (selectedCount === deptUsers.length) {
90
+ newFullySelected.add(dept.id);
91
+ } else if (selectedCount > 0) {
92
+ newPartiallySelected.add(dept.id);
93
+ }
94
+ });
95
+ fullySelectedDepts.value = newFullySelected;
96
+ partiallySelectedDepts.value = newPartiallySelected;
97
+ };
74
98
  const sortOrgList = (0, import_vue2.computed)(() => {
75
99
  const departments = orgList.value.filter((item) => item.type === "dept");
76
100
  const personnel = orgList.value.filter((item) => item.type !== "dept");
@@ -86,14 +110,39 @@ var stdin_default = (0, import_vue2.defineComponent)({
86
110
  selectedItems.value = newValue.map((id) => {
87
111
  return userList.value.find((item) => item.id === id);
88
112
  });
113
+ updateDeptSelectionStatus();
89
114
  }
90
115
  }, {
91
116
  immediate: true
92
117
  });
118
+ (0, import_vue2.watch)(() => selectedItems.value, () => {
119
+ updateDeptSelectionStatus();
120
+ }, {
121
+ deep: true
122
+ });
123
+ const handleDeptSelect = (item) => {
124
+ if (item.type !== "dept" || !props.multiple)
125
+ return;
126
+ const deptUsers = getUsersByDeptId(item.id);
127
+ const isFullySelected = fullySelectedDepts.value.has(item.id);
128
+ if (isFullySelected) {
129
+ const userIdsToRemove = new Set(deptUsers.map((user) => user.id));
130
+ selectedItems.value = selectedItems.value.filter((selectedItem) => !userIdsToRemove.has(selectedItem.id));
131
+ } else {
132
+ const currentSelectedIds = new Set(selectedItems.value.map((item2) => item2.id));
133
+ const usersToAdd = deptUsers.filter((user) => !currentSelectedIds.has(user.id));
134
+ selectedItems.value.push(...usersToAdd);
135
+ }
136
+ };
137
+ const handleDeptNavigate = (item) => {
138
+ if (item.type === "dept") {
139
+ getOrgList(item.id);
140
+ }
141
+ };
93
142
  const handleSelect = (item) => {
94
143
  var _a;
95
144
  if (item.type === "dept") {
96
- getOrgList(item.id);
145
+ handleDeptNavigate(item);
97
146
  return;
98
147
  }
99
148
  if (props.multiple) {
@@ -211,19 +260,36 @@ var stdin_default = (0, import_vue2.defineComponent)({
211
260
  }, [sortOrgList.value.length === 0 ? (0, import_vue.createVNode)(import_vant.Empty, {
212
261
  "description": "\u8BE5\u90E8\u95E8\u4E0B\u6CA1\u6709\u4EBA\u5458"
213
262
  }, null) : (0, import_vue.createVNode)(import_vant.List, null, {
214
- default: () => [sortOrgList.value.map((item) => (0, import_vue.createVNode)("div", {
215
- "class": ["org-item", isSelected(item) ? "selected" : ""],
216
- "onClick": () => handleSelect(item)
217
- }, [item.type === "dept" && !keyword.value ? (0, import_vue.createVNode)("div", {
218
- "class": "org-avatar"
219
- }, [(0, import_vue.createVNode)(import_DeptImg.default, null, null)]) : (0, import_vue.createVNode)(import_vant.Image, {
220
- "class": "org-avatar",
221
- "src": item.avatar
222
- }, null), (0, import_vue.createVNode)("div", {
223
- "class": "org-name"
224
- }, [item.name, (0, import_vue.createVNode)("span", {
225
- "class": "org-item-select-icon"
226
- }, [(0, import_vue.createTextVNode)("\u2713")])])]))]
263
+ default: () => [sortOrgList.value.map((item) => {
264
+ const isDept = item.type === "dept";
265
+ const isFullySelected = isDept && fullySelectedDepts.value.has(item.id);
266
+ const isPartiallySelected = isDept && partiallySelectedDepts.value.has(item.id);
267
+ const isUserSelected = !isDept && isSelected(item);
268
+ return (0, import_vue.createVNode)("div", {
269
+ "class": ["org-item", isUserSelected ? "selected" : "", isFullySelected ? "dept-fully-selected" : "", isPartiallySelected ? "dept-partially-selected" : ""],
270
+ "onClick": () => !isDept ? handleSelect(item) : void 0
271
+ }, [isDept && props.multiple && (0, import_vue.createVNode)("div", {
272
+ "class": "dept-selector",
273
+ "onClick": (e) => {
274
+ e.stopPropagation();
275
+ handleDeptSelect(item);
276
+ }
277
+ }, [isFullySelected || isPartiallySelected ? (0, import_vue.createVNode)("span", {
278
+ "class": "dept-check-icon"
279
+ }, [(0, import_vue.createTextVNode)("\u2713")]) : null]), (0, import_vue.createVNode)("div", {
280
+ "class": "dept-content",
281
+ "onClick": () => isDept ? handleDeptNavigate(item) : void 0
282
+ }, [isDept && !keyword.value ? (0, import_vue.createVNode)("div", {
283
+ "class": "org-avatar"
284
+ }, [(0, import_vue.createVNode)(import_DeptImg.default, null, null)]) : (0, import_vue.createVNode)(import_vant.Image, {
285
+ "class": "org-avatar",
286
+ "src": item.avatar
287
+ }, null), (0, import_vue.createVNode)("div", {
288
+ "class": "org-name"
289
+ }, [item.name, !isDept && (0, import_vue.createVNode)("span", {
290
+ "class": "org-item-select-icon"
291
+ }, [(0, import_vue.createTextVNode)("\u2713")])])])]);
292
+ })]
227
293
  })])])]), keyword.value && renderSearchResult({
228
294
  handleHistorySelect,
229
295
  isSelected,
@@ -1 +1 @@
1
- :root:root{--van-action-sheet-max-height: 100%}.org-list{height:85vh;display:flex;flex-direction:column}.org-list .highlight{color:var(--van-primary-color);font-weight:700}.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 .org-selected-items{display:flex;flex-wrap:nowrap;padding:12px 16px;gap:12px;background-color:#fff;overflow-x:auto;height:68px;border-bottom:1px solid #eee}.org-list .org-selected-items .selected-tag{flex-shrink:0;background:none;border:none;padding:0;margin:0;position:relative}.org-list .org-selected-items .selected-tag .close-icon{position:absolute;top:0;right:0;z-index:1;background-color:#fff;border-radius:50%;border:1px solid #eee;width:10px;height:10px;display:flex;align-items:center;justify-content:center;font-size:6px;color:#969799}.org-list .org-selected-items .selected-tag .tag-avatar{width:40px;height:40px}.org-list .org-selected-items .selected-tag .tag-avatar img{border-radius:4px;border:1px solid #eee;object-fit:contain}.org-list .bottom-section{border-top:1px solid #eee;background-color:#fff}.org-list .van-list{flex:1;overflow-y:auto;padding:0 16px}.org-list .org-content-wrap{flex:1;display:flex;flex-direction:column;overflow:hidden;position:relative;padding-top:4px}.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 .org-item-select-icon{display:none;padding-left:4px}.org-list .org-item.selected{color:var(--van-primary-color)}.org-list .org-item.selected .org-item-select-icon{display:inline}.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;object-fit:contain}.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}.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}
1
+ :root:root{--van-action-sheet-max-height: 100%}.org-list{height:85vh;display:flex;flex-direction:column}.org-list .highlight{color:var(--van-primary-color);font-weight:700}.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 .org-selected-items{display:flex;flex-wrap:nowrap;padding:12px 16px;gap:12px;background-color:#fff;overflow-x:auto;height:68px;border-bottom:1px solid #eee}.org-list .org-selected-items .selected-tag{flex-shrink:0;background:none;border:none;padding:0;margin:0;position:relative}.org-list .org-selected-items .selected-tag .close-icon{position:absolute;top:0;right:0;z-index:1;background-color:#fff;border-radius:50%;border:1px solid #eee;width:10px;height:10px;display:flex;align-items:center;justify-content:center;font-size:6px;color:#969799}.org-list .org-selected-items .selected-tag .tag-avatar{width:40px;height:40px}.org-list .org-selected-items .selected-tag .tag-avatar img{border-radius:4px;border:1px solid #eee;object-fit:contain}.org-list .bottom-section{border-top:1px solid #eee;background-color:#fff}.org-list .van-list{flex:1;overflow-y:auto;padding:0 16px}.org-list .org-content-wrap{flex:1;display:flex;flex-direction:column;overflow:hidden;position:relative;padding-top:4px}.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 .org-item-select-icon{display:none;padding-left:4px}.org-list .org-item.selected{color:var(--van-primary-color)}.org-list .org-item.selected .org-item-select-icon{display:inline}.org-list .org-item .dept-selector{width:20px;height:20px;border:2px solid #ddd;border-radius:4px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.org-list .org-item .dept-selector .dept-check-icon{font-size:12px;color:var(--van-primary-color);font-weight:700}.org-list .org-item.dept-fully-selected .dept-selector{background-color:var(--van-primary-color);border-color:var(--van-primary-color)}.org-list .org-item.dept-fully-selected .dept-selector .dept-check-icon{color:#fff}.org-list .org-item.dept-partially-selected .dept-selector{border-color:var(--van-primary-color)}.org-list .org-item.dept-partially-selected .dept-selector .dept-check-icon{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;object-fit:contain}.org-list .org-item .dept-content{display:flex;align-items:center;flex:1;cursor:pointer;gap:12px}.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}.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}