@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,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
+ }
@@ -20,7 +20,9 @@ var stdin_default = defineComponent({
20
20
  orgList,
21
21
  deptPath,
22
22
  userList,
23
- getUserInfoById
23
+ getUserInfoById,
24
+ getUsersByDeptId,
25
+ getDeptById
24
26
  } = api;
25
27
  getOrgList();
26
28
  const activeTab = ref("txl");
@@ -39,6 +41,28 @@ var stdin_default = defineComponent({
39
41
  isSearchFocus
40
42
  });
41
43
  const selectedItems = ref([]);
44
+ const fullySelectedDepts = ref(/* @__PURE__ */ new Set());
45
+ const partiallySelectedDepts = ref(/* @__PURE__ */ new Set());
46
+ const updateDeptSelectionStatus = () => {
47
+ if (!props.multiple)
48
+ return;
49
+ const newFullySelected = /* @__PURE__ */ new Set();
50
+ const newPartiallySelected = /* @__PURE__ */ new Set();
51
+ const selectedUserIds = new Set(selectedItems.value.map((item) => item.id));
52
+ api.deptList.value.forEach((dept) => {
53
+ const deptUsers = getUsersByDeptId(dept.id);
54
+ if (deptUsers.length === 0)
55
+ return;
56
+ const selectedCount = deptUsers.filter((user) => selectedUserIds.has(user.id)).length;
57
+ if (selectedCount === deptUsers.length) {
58
+ newFullySelected.add(dept.id);
59
+ } else if (selectedCount > 0) {
60
+ newPartiallySelected.add(dept.id);
61
+ }
62
+ });
63
+ fullySelectedDepts.value = newFullySelected;
64
+ partiallySelectedDepts.value = newPartiallySelected;
65
+ };
42
66
  const sortOrgList = computed(() => {
43
67
  const departments = orgList.value.filter((item) => item.type === "dept");
44
68
  const personnel = orgList.value.filter((item) => item.type !== "dept");
@@ -54,14 +78,39 @@ var stdin_default = defineComponent({
54
78
  selectedItems.value = newValue.map((id) => {
55
79
  return userList.value.find((item) => item.id === id);
56
80
  });
81
+ updateDeptSelectionStatus();
57
82
  }
58
83
  }, {
59
84
  immediate: true
60
85
  });
86
+ watch(() => selectedItems.value, () => {
87
+ updateDeptSelectionStatus();
88
+ }, {
89
+ deep: true
90
+ });
91
+ const handleDeptSelect = (item) => {
92
+ if (item.type !== "dept" || !props.multiple)
93
+ return;
94
+ const deptUsers = getUsersByDeptId(item.id);
95
+ const isFullySelected = fullySelectedDepts.value.has(item.id);
96
+ if (isFullySelected) {
97
+ const userIdsToRemove = new Set(deptUsers.map((user) => user.id));
98
+ selectedItems.value = selectedItems.value.filter((selectedItem) => !userIdsToRemove.has(selectedItem.id));
99
+ } else {
100
+ const currentSelectedIds = new Set(selectedItems.value.map((item2) => item2.id));
101
+ const usersToAdd = deptUsers.filter((user) => !currentSelectedIds.has(user.id));
102
+ selectedItems.value.push(...usersToAdd);
103
+ }
104
+ };
105
+ const handleDeptNavigate = (item) => {
106
+ if (item.type === "dept") {
107
+ getOrgList(item.id);
108
+ }
109
+ };
61
110
  const handleSelect = (item) => {
62
111
  var _a;
63
112
  if (item.type === "dept") {
64
- getOrgList(item.id);
113
+ handleDeptNavigate(item);
65
114
  return;
66
115
  }
67
116
  if (props.multiple) {
@@ -179,19 +228,36 @@ var stdin_default = defineComponent({
179
228
  }, [sortOrgList.value.length === 0 ? _createVNode(Empty, {
180
229
  "description": "\u8BE5\u90E8\u95E8\u4E0B\u6CA1\u6709\u4EBA\u5458"
181
230
  }, null) : _createVNode(List, null, {
182
- default: () => [sortOrgList.value.map((item) => _createVNode("div", {
183
- "class": ["org-item", isSelected(item) ? "selected" : ""],
184
- "onClick": () => handleSelect(item)
185
- }, [item.type === "dept" && !keyword.value ? _createVNode("div", {
186
- "class": "org-avatar"
187
- }, [_createVNode(DeptImg, null, null)]) : _createVNode(Image, {
188
- "class": "org-avatar",
189
- "src": item.avatar
190
- }, null), _createVNode("div", {
191
- "class": "org-name"
192
- }, [item.name, _createVNode("span", {
193
- "class": "org-item-select-icon"
194
- }, [_createTextVNode("\u2713")])])]))]
231
+ default: () => [sortOrgList.value.map((item) => {
232
+ const isDept = item.type === "dept";
233
+ const isFullySelected = isDept && fullySelectedDepts.value.has(item.id);
234
+ const isPartiallySelected = isDept && partiallySelectedDepts.value.has(item.id);
235
+ const isUserSelected = !isDept && isSelected(item);
236
+ return _createVNode("div", {
237
+ "class": ["org-item", isUserSelected ? "selected" : "", isFullySelected ? "dept-fully-selected" : "", isPartiallySelected ? "dept-partially-selected" : ""],
238
+ "onClick": () => !isDept ? handleSelect(item) : void 0
239
+ }, [isDept && props.multiple && _createVNode("div", {
240
+ "class": "dept-selector",
241
+ "onClick": (e) => {
242
+ e.stopPropagation();
243
+ handleDeptSelect(item);
244
+ }
245
+ }, [isFullySelected || isPartiallySelected ? _createVNode("span", {
246
+ "class": "dept-check-icon"
247
+ }, [_createTextVNode("\u2713")]) : null]), _createVNode("div", {
248
+ "class": "dept-content",
249
+ "onClick": () => isDept ? handleDeptNavigate(item) : void 0
250
+ }, [isDept && !keyword.value ? _createVNode("div", {
251
+ "class": "org-avatar"
252
+ }, [_createVNode(DeptImg, null, null)]) : _createVNode(Image, {
253
+ "class": "org-avatar",
254
+ "src": item.avatar
255
+ }, null), _createVNode("div", {
256
+ "class": "org-name"
257
+ }, [item.name, !isDept && _createVNode("span", {
258
+ "class": "org-item-select-icon"
259
+ }, [_createTextVNode("\u2713")])])])]);
260
+ })]
195
261
  })])])]), keyword.value && renderSearchResult({
196
262
  handleHistorySelect,
197
263
  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}