@cmstops/pro-compo 3.0.0-rc.0 → 3.0.0-stable.1
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/dist/index.css +49 -4
- package/dist/index.min.css +1 -1
- package/es/baseFilter/component.js +71 -14
- package/es/config.js +1 -1
- package/es/docHistory/component.js +41 -12
- package/es/docHistory/style/index.css +4 -0
- package/es/docHistory/style/index.less +5 -0
- package/es/hooks/useAttachement.js +2 -9
- package/es/hooks/usePopper.d.ts +1 -1
- package/es/hooks/usePopper.js +3 -3
- package/es/hooks/useUpload.d.ts +50 -2
- package/es/hooks/useUpload.js +43 -4
- package/es/index.css +49 -4
- package/es/selectResourceModal/__demo__/module/DivWrapper.d.ts +268 -0
- package/es/selectResourceModal/__demo__/module/basic.d.ts +299 -0
- package/es/selectResourceModal/components/List/ListLocal/index.js +8 -3
- package/es/selectResourceModal/components/List/ListNormal/Filter.js +201 -89
- package/es/selectResourceModal/components/List/ListNormal/index.js +23 -7
- package/es/selectResourceModal/hooks/useResponsiveFilter.d.ts +21 -0
- package/es/selectResourceModal/hooks/useResponsiveFilter.js +142 -0
- package/es/selectResourceModal/scripts/useCompoLf.js +1 -1
- package/es/selectResourceModal/style/index.css +45 -4
- package/es/selectResourceModal/style/index.less +14 -0
- package/es/selectResourceModal/style/list.less +40 -4
- package/es/utils/index.js +6 -6
- package/lib/baseFilter/component.js +69 -12
- package/lib/config.js +1 -1
- package/lib/docHistory/component.js +39 -10
- package/lib/docHistory/style/index.css +4 -0
- package/lib/docHistory/style/index.less +5 -0
- package/lib/hooks/useAttachement.js +2 -9
- package/lib/hooks/usePopper.js +3 -3
- package/lib/hooks/useUpload.js +43 -3
- package/lib/index.css +49 -4
- package/lib/selectResourceModal/components/List/ListLocal/index.js +6 -1
- package/lib/selectResourceModal/components/List/ListNormal/Filter.js +198 -86
- package/lib/selectResourceModal/components/List/ListNormal/index.js +22 -6
- package/lib/selectResourceModal/hooks/useResponsiveFilter.js +144 -0
- package/lib/selectResourceModal/scripts/useCompoLf.js +1 -1
- package/lib/selectResourceModal/style/index.css +45 -4
- package/lib/selectResourceModal/style/index.less +14 -0
- package/lib/selectResourceModal/style/list.less +40 -4
- package/lib/utils/index.js +6 -6
- package/package.json +1 -1
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { ref, onMounted, nextTick, onUnmounted } from "vue";
|
|
2
|
+
import usePopper from "../../hooks/usePopper.js";
|
|
3
|
+
const getRect = (el) => {
|
|
4
|
+
if (!el || typeof el.getClientRects !== "function")
|
|
5
|
+
return { right: 0, width: 0 };
|
|
6
|
+
const rects = el.getClientRects();
|
|
7
|
+
if (rects.length === 0)
|
|
8
|
+
return { right: 0, width: 0 };
|
|
9
|
+
const rect = rects[0];
|
|
10
|
+
return {
|
|
11
|
+
right: rect.right,
|
|
12
|
+
width: rect.width
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
function useResponsiveFilter(filterItemsRef) {
|
|
16
|
+
const moreBtnRef = ref();
|
|
17
|
+
const popperPanelRef = ref();
|
|
18
|
+
const { initPopper, show, visible, hide } = usePopper(
|
|
19
|
+
popperPanelRef,
|
|
20
|
+
moreBtnRef
|
|
21
|
+
);
|
|
22
|
+
const windowWidth = ref(0);
|
|
23
|
+
const filterContainerRightBoundary = ref(0);
|
|
24
|
+
const hiddenElementList = ref([]);
|
|
25
|
+
const initWidths = () => {
|
|
26
|
+
var _a, _b;
|
|
27
|
+
windowWidth.value = ((_a = document.body) == null ? void 0 : _a.clientWidth) || 0;
|
|
28
|
+
const containerElement = (_b = filterItemsRef.value) == null ? void 0 : _b.parentElement;
|
|
29
|
+
if (containerElement) {
|
|
30
|
+
filterContainerRightBoundary.value = getRect(containerElement).right;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const initResizeListener = () => {
|
|
34
|
+
window.addEventListener("resize", refreshLayout);
|
|
35
|
+
};
|
|
36
|
+
const removeResizeListener = () => {
|
|
37
|
+
window.removeEventListener("resize", refreshLayout);
|
|
38
|
+
};
|
|
39
|
+
const hideElement = (el) => {
|
|
40
|
+
var _a, _b, _c;
|
|
41
|
+
const { width } = getRect(el);
|
|
42
|
+
if (width > 0 && ((_a = filterItemsRef.value) == null ? void 0 : _a.contains(el))) {
|
|
43
|
+
hiddenElementList.value.push({ width, el });
|
|
44
|
+
(_b = filterItemsRef.value) == null ? void 0 : _b.removeChild(el);
|
|
45
|
+
(_c = popperPanelRef.value) == null ? void 0 : _c.insertBefore(el, popperPanelRef.value.firstChild);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const showElement = () => {
|
|
49
|
+
var _a, _b;
|
|
50
|
+
if (!hiddenElementList.value.length || !filterItemsRef.value)
|
|
51
|
+
return;
|
|
52
|
+
const popEl = hiddenElementList.value.pop();
|
|
53
|
+
if (!popEl)
|
|
54
|
+
return;
|
|
55
|
+
const { el } = popEl;
|
|
56
|
+
(_a = popperPanelRef.value) == null ? void 0 : _a.removeChild(el);
|
|
57
|
+
(_b = filterItemsRef.value) == null ? void 0 : _b.appendChild(el);
|
|
58
|
+
};
|
|
59
|
+
const checkOverflow = () => {
|
|
60
|
+
if (!filterItemsRef.value)
|
|
61
|
+
return -1;
|
|
62
|
+
const containerRight = filterContainerRightBoundary.value;
|
|
63
|
+
const children = filterItemsRef.value.children;
|
|
64
|
+
let currentRightmostBoundary = getRect(filterItemsRef.value).right - getRect(filterItemsRef.value).width;
|
|
65
|
+
for (let i = children.length - 1; i >= 0; i--) {
|
|
66
|
+
const item = children[i];
|
|
67
|
+
if (!item || !item.classList || !item.classList.contains("filter-item"))
|
|
68
|
+
continue;
|
|
69
|
+
const itemRect = getRect(item);
|
|
70
|
+
if (itemRect.right > containerRight - 400) {
|
|
71
|
+
hideElement(item);
|
|
72
|
+
} else {
|
|
73
|
+
currentRightmostBoundary = Math.max(
|
|
74
|
+
currentRightmostBoundary,
|
|
75
|
+
itemRect.right
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return currentRightmostBoundary;
|
|
80
|
+
};
|
|
81
|
+
const refreshLayout = async () => {
|
|
82
|
+
await nextTick();
|
|
83
|
+
initWidths();
|
|
84
|
+
if (!filterItemsRef.value || !popperPanelRef.value)
|
|
85
|
+
return;
|
|
86
|
+
const containerRight = filterContainerRightBoundary.value;
|
|
87
|
+
let lastVisibleItemRight = checkOverflow();
|
|
88
|
+
if (lastVisibleItemRight === -1 && filterItemsRef.value.children.length > 0) {
|
|
89
|
+
lastVisibleItemRight = getRect(filterItemsRef.value).left;
|
|
90
|
+
} else if (filterItemsRef.value.children.length === 0) {
|
|
91
|
+
lastVisibleItemRight = getRect(filterItemsRef.value).left;
|
|
92
|
+
}
|
|
93
|
+
await nextTick();
|
|
94
|
+
let availableSpace = containerRight - lastVisibleItemRight;
|
|
95
|
+
while (hiddenElementList.value.length > 0) {
|
|
96
|
+
const nextHiddenItem = hiddenElementList.value[hiddenElementList.value.length - 1];
|
|
97
|
+
const nextHiddenItemWidth = nextHiddenItem.width;
|
|
98
|
+
if (availableSpace > nextHiddenItemWidth + 10) {
|
|
99
|
+
showElement();
|
|
100
|
+
await nextTick();
|
|
101
|
+
const visibleElements = Array.from(
|
|
102
|
+
filterItemsRef.value.children
|
|
103
|
+
);
|
|
104
|
+
if (visibleElements.length > 0) {
|
|
105
|
+
lastVisibleItemRight = visibleElements.reduce((maxRight, el) => {
|
|
106
|
+
var _a;
|
|
107
|
+
if ((_a = el.classList) == null ? void 0 : _a.contains("filter-item")) {
|
|
108
|
+
return Math.max(maxRight, getRect(el).right);
|
|
109
|
+
}
|
|
110
|
+
return maxRight;
|
|
111
|
+
}, getRect(filterItemsRef.value).left);
|
|
112
|
+
} else {
|
|
113
|
+
lastVisibleItemRight = getRect(filterItemsRef.value).left;
|
|
114
|
+
}
|
|
115
|
+
availableSpace = containerRight - lastVisibleItemRight;
|
|
116
|
+
} else {
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
onMounted(async () => {
|
|
122
|
+
initResizeListener();
|
|
123
|
+
initPopper("bottom-start", [0, 40]);
|
|
124
|
+
await nextTick();
|
|
125
|
+
initWidths();
|
|
126
|
+
await nextTick();
|
|
127
|
+
refreshLayout();
|
|
128
|
+
});
|
|
129
|
+
onUnmounted(() => {
|
|
130
|
+
removeResizeListener();
|
|
131
|
+
});
|
|
132
|
+
return {
|
|
133
|
+
moreBtnRef,
|
|
134
|
+
popperPanelRef,
|
|
135
|
+
hiddenElementList,
|
|
136
|
+
visible,
|
|
137
|
+
show,
|
|
138
|
+
hide,
|
|
139
|
+
refreshLayout
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
export { useResponsiveFilter };
|
|
@@ -172,11 +172,13 @@
|
|
|
172
172
|
}
|
|
173
173
|
.resource-list-footer,
|
|
174
174
|
.resource-list-header,
|
|
175
|
+
.resource-list-content .resource-list-content-empty,
|
|
175
176
|
.resource-list-content .arco-scrollbar-container {
|
|
176
177
|
padding: 0 40px;
|
|
177
178
|
}
|
|
178
179
|
.resource-list-footer {
|
|
179
180
|
display: flex;
|
|
181
|
+
flex-wrap: wrap;
|
|
180
182
|
justify-content: space-between;
|
|
181
183
|
padding-bottom: 20px;
|
|
182
184
|
}
|
|
@@ -186,6 +188,10 @@
|
|
|
186
188
|
gap: 10px;
|
|
187
189
|
align-items: center;
|
|
188
190
|
justify-content: flex-end;
|
|
191
|
+
margin-top: 10px;
|
|
192
|
+
}
|
|
193
|
+
.resource-list-footer .footer-right .list-selected-wrapper {
|
|
194
|
+
font-size: 12px;
|
|
189
195
|
}
|
|
190
196
|
.resource-list-content-loading {
|
|
191
197
|
display: flex;
|
|
@@ -197,7 +203,7 @@
|
|
|
197
203
|
.resource-list .list-item-grid {
|
|
198
204
|
display: grid;
|
|
199
205
|
grid-gap: 20px;
|
|
200
|
-
grid-template-columns: repeat(
|
|
206
|
+
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
|
201
207
|
}
|
|
202
208
|
.resource-list .list-content {
|
|
203
209
|
margin-top: 30px;
|
|
@@ -240,7 +246,8 @@
|
|
|
240
246
|
}
|
|
241
247
|
.resource-list .list-filter-wrapper .list-filter-tags {
|
|
242
248
|
display: flex;
|
|
243
|
-
|
|
249
|
+
flex-wrap: wrap;
|
|
250
|
+
gap: 10px;
|
|
244
251
|
margin-top: 10px;
|
|
245
252
|
}
|
|
246
253
|
.resource-list .list-filter-wrapper .list-filter-tags .list-filter-tag {
|
|
@@ -261,16 +268,41 @@
|
|
|
261
268
|
justify-content: space-between;
|
|
262
269
|
}
|
|
263
270
|
.resource-list .list-filter-wrapper .list-filter .filter-list {
|
|
271
|
+
position: relative;
|
|
272
|
+
/** 给 popup 一个参考 */
|
|
264
273
|
display: flex;
|
|
265
|
-
flex-wrap: wrap;
|
|
266
|
-
gap: 10px;
|
|
267
274
|
}
|
|
268
275
|
.resource-list .list-filter-wrapper .list-filter .filter-list .filter-item {
|
|
269
276
|
width: 100px;
|
|
277
|
+
margin-right: 10px;
|
|
278
|
+
}
|
|
279
|
+
.resource-list .list-filter-wrapper .list-filter .filter-list .arco-trigger-popup {
|
|
280
|
+
z-index: 100000 !important;
|
|
270
281
|
}
|
|
271
282
|
.resource-list .list-filter-wrapper .list-filter .arco-input-prepend {
|
|
272
283
|
padding: 0;
|
|
273
284
|
}
|
|
285
|
+
.resource-list .list-filter-wrapper .list-filter .more-btn {
|
|
286
|
+
position: relative;
|
|
287
|
+
/** 给 poperjs 一个参考 */
|
|
288
|
+
}
|
|
289
|
+
.resource-list .list-filter-wrapper .list-filter .more-btn .filter-pannel {
|
|
290
|
+
inset: 40px auto auto auto !important;
|
|
291
|
+
}
|
|
292
|
+
.resource-list .list-filter-wrapper .filter-extra {
|
|
293
|
+
display: flex;
|
|
294
|
+
gap: 10px;
|
|
295
|
+
}
|
|
296
|
+
.resource-list .list-filter-wrapper .filter-pannel {
|
|
297
|
+
z-index: 100000;
|
|
298
|
+
display: flex;
|
|
299
|
+
flex-direction: column;
|
|
300
|
+
gap: 10px;
|
|
301
|
+
padding: 10px;
|
|
302
|
+
background-color: #fff;
|
|
303
|
+
border-radius: 4px;
|
|
304
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
305
|
+
}
|
|
274
306
|
.resource-list .title {
|
|
275
307
|
display: flex;
|
|
276
308
|
gap: 8px;
|
|
@@ -284,6 +316,10 @@
|
|
|
284
316
|
height: 16px;
|
|
285
317
|
background-color: #4886ff;
|
|
286
318
|
}
|
|
319
|
+
.resource-select-wrap {
|
|
320
|
+
width: 100%;
|
|
321
|
+
height: 100%;
|
|
322
|
+
}
|
|
287
323
|
.resource-select-modal-body {
|
|
288
324
|
height: 80vh;
|
|
289
325
|
padding: 0;
|
|
@@ -312,3 +348,8 @@
|
|
|
312
348
|
.resource-select-container .resource-select-header .arco-tabs-content {
|
|
313
349
|
display: none !important;
|
|
314
350
|
}
|
|
351
|
+
.resource-select-container .resource-list-content .resource-list-content-empty {
|
|
352
|
+
box-sizing: border-box;
|
|
353
|
+
width: 100%;
|
|
354
|
+
height: 100%;
|
|
355
|
+
}
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
@import './listCardWrapper.less';
|
|
3
3
|
@import './list.less';
|
|
4
4
|
|
|
5
|
+
.resource-select-wrap {
|
|
6
|
+
width: 100%;
|
|
7
|
+
height: 100%;
|
|
8
|
+
}
|
|
9
|
+
|
|
5
10
|
.resource-select-modal-body {
|
|
6
11
|
height: 80vh;
|
|
7
12
|
padding: 0;
|
|
@@ -38,4 +43,13 @@
|
|
|
38
43
|
display: none !important;
|
|
39
44
|
}
|
|
40
45
|
}
|
|
46
|
+
|
|
47
|
+
// 内容区域样式
|
|
48
|
+
.resource-list-content {
|
|
49
|
+
.resource-list-content-empty {
|
|
50
|
+
box-sizing: border-box;
|
|
51
|
+
width: 100%;
|
|
52
|
+
height: 100%;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
41
55
|
}
|
|
@@ -14,12 +14,14 @@
|
|
|
14
14
|
|
|
15
15
|
&-footer,
|
|
16
16
|
&-header,
|
|
17
|
+
&-content .resource-list-content-empty,
|
|
17
18
|
&-content .arco-scrollbar-container {
|
|
18
19
|
padding: 0 40px;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
&-footer {
|
|
22
23
|
display: flex;
|
|
24
|
+
flex-wrap: wrap;
|
|
23
25
|
justify-content: space-between;
|
|
24
26
|
padding-bottom: 20px;
|
|
25
27
|
|
|
@@ -29,6 +31,11 @@
|
|
|
29
31
|
gap: 10px;
|
|
30
32
|
align-items: center;
|
|
31
33
|
justify-content: flex-end;
|
|
34
|
+
margin-top: 10px;
|
|
35
|
+
|
|
36
|
+
.list-selected-wrapper {
|
|
37
|
+
font-size: 12px;
|
|
38
|
+
}
|
|
32
39
|
}
|
|
33
40
|
}
|
|
34
41
|
|
|
@@ -47,7 +54,7 @@
|
|
|
47
54
|
.list-item-grid {
|
|
48
55
|
display: grid;
|
|
49
56
|
grid-gap: 20px;
|
|
50
|
-
grid-template-columns: repeat(
|
|
57
|
+
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
|
51
58
|
}
|
|
52
59
|
}
|
|
53
60
|
|
|
@@ -108,7 +115,8 @@
|
|
|
108
115
|
.resource-list .list-filter-wrapper {
|
|
109
116
|
.list-filter-tags {
|
|
110
117
|
display: flex;
|
|
111
|
-
|
|
118
|
+
flex-wrap: wrap;
|
|
119
|
+
gap: 10px;
|
|
112
120
|
margin-top: 10px;
|
|
113
121
|
|
|
114
122
|
.list-filter-tag {
|
|
@@ -133,18 +141,46 @@
|
|
|
133
141
|
justify-content: space-between;
|
|
134
142
|
|
|
135
143
|
.filter-list {
|
|
144
|
+
position: relative; /** 给 popup 一个参考 */
|
|
136
145
|
display: flex;
|
|
137
|
-
flex-wrap: wrap;
|
|
138
|
-
gap: 10px;
|
|
139
146
|
|
|
140
147
|
.filter-item {
|
|
141
148
|
width: 100px;
|
|
149
|
+
margin-right: 10px;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.arco-trigger-popup {
|
|
153
|
+
z-index: 100000 !important;
|
|
142
154
|
}
|
|
143
155
|
}
|
|
144
156
|
|
|
145
157
|
.arco-input-prepend {
|
|
146
158
|
padding: 0;
|
|
147
159
|
}
|
|
160
|
+
|
|
161
|
+
.more-btn {
|
|
162
|
+
position: relative; /** 给 poperjs 一个参考 */
|
|
163
|
+
|
|
164
|
+
.filter-pannel {
|
|
165
|
+
inset: 40px auto auto auto !important;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.filter-extra {
|
|
171
|
+
display: flex;
|
|
172
|
+
gap: 10px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.filter-pannel {
|
|
176
|
+
z-index: 100000;
|
|
177
|
+
display: flex;
|
|
178
|
+
flex-direction: column;
|
|
179
|
+
gap: 10px;
|
|
180
|
+
padding: 10px;
|
|
181
|
+
background-color: #fff;
|
|
182
|
+
border-radius: 4px;
|
|
183
|
+
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
|
|
148
184
|
}
|
|
149
185
|
}
|
|
150
186
|
|
package/es/utils/index.js
CHANGED
|
@@ -137,13 +137,13 @@ async function copyContent(content) {
|
|
|
137
137
|
}
|
|
138
138
|
}
|
|
139
139
|
function mediaTime(v) {
|
|
140
|
-
const h = Math.floor(v /
|
|
141
|
-
const m = Math.floor(
|
|
142
|
-
const s = Math.floor(v
|
|
140
|
+
const h = Math.floor(v / 3600);
|
|
141
|
+
const m = Math.floor(v % 3600 / 60);
|
|
142
|
+
const s = Math.floor(v % 60);
|
|
143
143
|
let ret = "";
|
|
144
|
-
ret += `${h < 10 ? `0${h}` : h
|
|
145
|
-
ret += `${m < 10 ? `0${m}` : m
|
|
146
|
-
ret += s < 10 ? `0${s}` : s
|
|
144
|
+
ret += `${h < 10 ? `0${h}` : h}:`;
|
|
145
|
+
ret += `${m < 10 ? `0${m}` : m}:`;
|
|
146
|
+
ret += s < 10 ? `0${s}` : s;
|
|
147
147
|
return ret;
|
|
148
148
|
}
|
|
149
149
|
export { copyContent, dateYYYYDDMMHHmm, generateUUID, getRealUrl, getThemeColor, mediaTime, noCoverText, replaceSuffix, timeFormat, to, validateForm };
|
|
@@ -38,9 +38,11 @@ const _sfc_main = vue.defineComponent({
|
|
|
38
38
|
});
|
|
39
39
|
return _columns;
|
|
40
40
|
});
|
|
41
|
-
const getOptions = (
|
|
42
|
-
return item
|
|
43
|
-
|
|
41
|
+
const getOptions = vue.computed(() => {
|
|
42
|
+
return (item) => {
|
|
43
|
+
return item.options ? item.options : [];
|
|
44
|
+
};
|
|
45
|
+
});
|
|
44
46
|
const hasValue = vue.computed(() => {
|
|
45
47
|
return (key) => {
|
|
46
48
|
var _a, _b;
|
|
@@ -77,7 +79,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
77
79
|
_form[column.range] = rangeTemp[column.range];
|
|
78
80
|
} else if (column.component === "select") {
|
|
79
81
|
_form[column.key] = column.defaultValue || null;
|
|
80
|
-
} else {
|
|
82
|
+
} else if (column.component === "input-group") {
|
|
83
|
+
_form[column.selectKey] = column.selectDefaultValue || "";
|
|
84
|
+
_form[column.inputKey] = column.inputDefaultValue || "";
|
|
85
|
+
} else if (column.component) {
|
|
81
86
|
_form[column.key] = column.defaultValue || "";
|
|
82
87
|
}
|
|
83
88
|
});
|
|
@@ -179,17 +184,48 @@ const _sfc_main = vue.defineComponent({
|
|
|
179
184
|
active: hasValue.value(item.key)
|
|
180
185
|
}, {
|
|
181
186
|
default: vue.withCtx(() => [
|
|
182
|
-
item.component === "input" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.
|
|
183
|
-
|
|
187
|
+
item.slot ? vue.renderSlot(_ctx.$slots, item.slot, { key: 0 }) : item.component === "input-group" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.InputGroup), { key: 1 }, {
|
|
188
|
+
default: vue.withCtx(() => [
|
|
189
|
+
vue.createVNode(vue.unref(webVue.Select), {
|
|
190
|
+
modelValue: form.value[item.selectKey],
|
|
191
|
+
"onUpdate:modelValue": ($event) => form.value[item.selectKey] = $event,
|
|
192
|
+
"default-active-first-option": "",
|
|
193
|
+
style: { "width": "100px" }
|
|
194
|
+
}, {
|
|
195
|
+
default: vue.withCtx(() => [
|
|
196
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.selectOptions, (option, idx) => {
|
|
197
|
+
return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
|
|
198
|
+
key: idx,
|
|
199
|
+
value: option.value
|
|
200
|
+
}, {
|
|
201
|
+
default: vue.withCtx(() => [
|
|
202
|
+
vue.createTextVNode(vue.toDisplayString(option.label), 1)
|
|
203
|
+
]),
|
|
204
|
+
_: 2
|
|
205
|
+
}, 1032, ["value"]);
|
|
206
|
+
}), 128))
|
|
207
|
+
]),
|
|
208
|
+
_: 2
|
|
209
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"]),
|
|
210
|
+
vue.createVNode(vue.unref(webVue.Input), {
|
|
211
|
+
modelValue: form.value[item.inputKey],
|
|
212
|
+
"onUpdate:modelValue": ($event) => form.value[item.inputKey] = $event,
|
|
213
|
+
placeholder: item.placeholder ? item.placeholder : `\u8BF7\u8F93\u5165${item.inputLabel}`,
|
|
214
|
+
style: { "width": "180px" }
|
|
215
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
|
|
216
|
+
]),
|
|
217
|
+
_: 2
|
|
218
|
+
}, 1024)) : item.component === "input" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.InputSearch), {
|
|
219
|
+
key: 2,
|
|
184
220
|
modelValue: form.value[item.key],
|
|
185
221
|
"onUpdate:modelValue": ($event) => form.value[item.key] = $event,
|
|
186
222
|
style: vue.normalizeStyle({ width: styleWidth(columnsMap.value[item.key]) }),
|
|
187
223
|
"allow-clear": "",
|
|
188
224
|
size: "medium",
|
|
189
|
-
placeholder: `\u8BF7\u8F93\u5165${item.label}`
|
|
225
|
+
placeholder: item.placeholder ? item.placeholder : `\u8BF7\u8F93\u5165${item.label}`
|
|
190
226
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "style", "placeholder"])) : vue.createCommentVNode("v-if", true),
|
|
191
227
|
item.component === "select" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Select), {
|
|
192
|
-
key:
|
|
228
|
+
key: 3,
|
|
193
229
|
modelValue: form.value[item.key],
|
|
194
230
|
"onUpdate:modelValue": ($event) => form.value[item.key] = $event,
|
|
195
231
|
"popup-container": "#base-filter-popup-container",
|
|
@@ -197,13 +233,13 @@ const _sfc_main = vue.defineComponent({
|
|
|
197
233
|
"allow-search": item.allowSearch,
|
|
198
234
|
"default-active-first-option": false,
|
|
199
235
|
style: vue.normalizeStyle({ width: styleWidth(columnsMap.value[item.key]) }),
|
|
200
|
-
placeholder: `\u8BF7\u9009\u62E9${item.label}`,
|
|
236
|
+
placeholder: item.placeholder ? item.placeholder : `\u8BF7\u9009\u62E9${item.label}`,
|
|
201
237
|
onSearch: ($event) => handleSelectSearch($event, item),
|
|
202
238
|
onPopupVisibleChange: ($event) => handleSelectPopupChange($event, item),
|
|
203
239
|
onChange: ($event) => handleSelectChange($event, item)
|
|
204
240
|
}, {
|
|
205
241
|
default: vue.withCtx(() => [
|
|
206
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(getOptions(item), (opt) => {
|
|
242
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(getOptions.value(item), (opt) => {
|
|
207
243
|
return vue.openBlock(), vue.createBlock(vue.unref(webVue.Option), {
|
|
208
244
|
key: opt.value,
|
|
209
245
|
label: opt.label,
|
|
@@ -214,7 +250,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
214
250
|
_: 2
|
|
215
251
|
}, 1032, ["modelValue", "onUpdate:modelValue", "allow-search", "style", "placeholder", "onSearch", "onPopupVisibleChange", "onChange"])) : vue.createCommentVNode("v-if", true),
|
|
216
252
|
item.component === "range-picker" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.RangePicker), {
|
|
217
|
-
key:
|
|
253
|
+
key: 4,
|
|
218
254
|
modelValue: form.value[item.key].range,
|
|
219
255
|
"onUpdate:modelValue": ($event) => form.value[item.key].range = $event,
|
|
220
256
|
style: vue.normalizeStyle({ width: styleWidth(form.value[item.key]) }),
|
|
@@ -225,7 +261,28 @@ const _sfc_main = vue.defineComponent({
|
|
|
225
261
|
"popup-container": "#base-filter-popup-container",
|
|
226
262
|
onClick: _cache[1] || (_cache[1] = vue.withModifiers(() => {
|
|
227
263
|
}, ["stop"]))
|
|
228
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "style"])) : vue.createCommentVNode("v-if", true)
|
|
264
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "style"])) : vue.createCommentVNode("v-if", true),
|
|
265
|
+
item.component === "radio" ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.RadioGroup), {
|
|
266
|
+
key: 5,
|
|
267
|
+
modelValue: form.value[item.key],
|
|
268
|
+
"onUpdate:modelValue": ($event) => form.value[item.key] = $event,
|
|
269
|
+
type: "button"
|
|
270
|
+
}, {
|
|
271
|
+
default: vue.withCtx(() => [
|
|
272
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(item.options || [], (option, idx) => {
|
|
273
|
+
return vue.openBlock(), vue.createBlock(vue.unref(webVue.Radio), {
|
|
274
|
+
key: idx,
|
|
275
|
+
value: option.value
|
|
276
|
+
}, {
|
|
277
|
+
default: vue.withCtx(() => [
|
|
278
|
+
vue.createTextVNode(vue.toDisplayString(option.label), 1)
|
|
279
|
+
]),
|
|
280
|
+
_: 2
|
|
281
|
+
}, 1032, ["value"]);
|
|
282
|
+
}), 128))
|
|
283
|
+
]),
|
|
284
|
+
_: 2
|
|
285
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])) : vue.createCommentVNode("v-if", true)
|
|
229
286
|
]),
|
|
230
287
|
_: 2
|
|
231
288
|
}, 1032, ["active"]);
|
package/lib/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
3
3
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
|
|
4
|
-
const DEFAULT_BASE_API = ((_b = (_a = window.situoyun) == null ? void 0 : _a.env) == null ? void 0 : _b.BASE_HOST) || "https://site.cmstop.xyz";
|
|
4
|
+
const DEFAULT_BASE_API = ((_b = (_a = window.situoyun) == null ? void 0 : _a.env) == null ? void 0 : _b.BASE_HOST) || "https://site.r.cmstop.xyz";
|
|
5
5
|
const DEFAULT_BASE_ACCOUNT_HOST = ((_d = (_c = window.situoyun) == null ? void 0 : _c.env) == null ? void 0 : _d.BASE_ACCOUNT_HOST) || "https://account.cmstop.xyz";
|
|
6
6
|
const DEFAULT_UPLOAD_CHUNK_SIZE = ((_f = (_e = window.situoyun) == null ? void 0 : _e.env) == null ? void 0 : _f.UPLOAD_CHUNK_SIZE) || 5242880;
|
|
7
7
|
const DEFAULT_UPLOAD_URL = ((_h = (_g = window.situoyun) == null ? void 0 : _g.env) == null ? void 0 : _h.BASE_STATIC_FILE_API) || "https://oss.cmstop.xyz/maple/v1";
|
|
@@ -14,9 +14,11 @@ const _sfc_main = vue.defineComponent({
|
|
|
14
14
|
__name: "component",
|
|
15
15
|
props: {
|
|
16
16
|
BASE_API: {},
|
|
17
|
+
wrap: { default: "drawer" },
|
|
17
18
|
visible: { type: Boolean },
|
|
18
19
|
docInfo: {},
|
|
19
|
-
pub: { type: Boolean }
|
|
20
|
+
pub: { type: Boolean },
|
|
21
|
+
currentIdx: {}
|
|
20
22
|
},
|
|
21
23
|
emits: ["update:visible", "select"],
|
|
22
24
|
setup(__props, { emit: __emit }) {
|
|
@@ -28,6 +30,20 @@ const _sfc_main = vue.defineComponent({
|
|
|
28
30
|
emits("update:visible", val);
|
|
29
31
|
}
|
|
30
32
|
});
|
|
33
|
+
const wrapProps = vue.computed(() => {
|
|
34
|
+
if (props.wrap === "drawer") {
|
|
35
|
+
return {
|
|
36
|
+
class: "doc-history-drawer-wrap",
|
|
37
|
+
title: "\u7248\u672C\u8BB0\u5F55",
|
|
38
|
+
width: 1e3
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
bodyClass: "doc-history-modal-wrap",
|
|
43
|
+
title: "\u7248\u672C\u8BB0\u5F55",
|
|
44
|
+
width: 1e3
|
|
45
|
+
};
|
|
46
|
+
});
|
|
31
47
|
const BASE_API = props.BASE_API || config.DEFAULT_BASE_API;
|
|
32
48
|
const {
|
|
33
49
|
initParams,
|
|
@@ -38,6 +54,10 @@ const _sfc_main = vue.defineComponent({
|
|
|
38
54
|
list,
|
|
39
55
|
current
|
|
40
56
|
} = useDocHistory.useDocHistory(BASE_API);
|
|
57
|
+
const wrapComponent = {
|
|
58
|
+
drawer: webVue.Drawer,
|
|
59
|
+
modal: webVue.Modal
|
|
60
|
+
};
|
|
41
61
|
function handeRevert() {
|
|
42
62
|
emits("select", list.value[current.value]);
|
|
43
63
|
}
|
|
@@ -50,20 +70,29 @@ const _sfc_main = vue.defineComponent({
|
|
|
50
70
|
},
|
|
51
71
|
{ immediate: true }
|
|
52
72
|
);
|
|
53
|
-
vue.
|
|
73
|
+
vue.watch(
|
|
74
|
+
() => props.currentIdx,
|
|
75
|
+
(val) => {
|
|
76
|
+
if (val) {
|
|
77
|
+
handleSelect(val);
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
{ immediate: true }
|
|
81
|
+
);
|
|
82
|
+
vue.onMounted(async () => {
|
|
54
83
|
if (!props.docInfo)
|
|
55
84
|
return;
|
|
56
85
|
initParams(props.docInfo.id, props.pub);
|
|
57
|
-
loadData();
|
|
86
|
+
await loadData();
|
|
87
|
+
if (props.currentIdx) {
|
|
88
|
+
handleSelect(props.currentIdx);
|
|
89
|
+
}
|
|
58
90
|
});
|
|
59
91
|
return (_ctx, _cache) => {
|
|
60
|
-
return vue.openBlock(), vue.createBlock(vue.
|
|
92
|
+
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(wrapComponent[_ctx.wrap]), vue.mergeProps({
|
|
61
93
|
visible: vis.value,
|
|
62
|
-
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => vis.value = $event)
|
|
63
|
-
|
|
64
|
-
title: "\u7248\u672C\u8BB0\u5F55",
|
|
65
|
-
width: 1e3
|
|
66
|
-
}, {
|
|
94
|
+
"onUpdate:visible": _cache[0] || (_cache[0] = ($event) => vis.value = $event)
|
|
95
|
+
}, wrapProps.value), {
|
|
67
96
|
footer: vue.withCtx(() => [
|
|
68
97
|
vue.createVNode(vue.unref(webVue.Button), {
|
|
69
98
|
type: "primary",
|
|
@@ -124,7 +153,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
124
153
|
])
|
|
125
154
|
]),
|
|
126
155
|
_: 1
|
|
127
|
-
},
|
|
156
|
+
}, 16, ["visible"]);
|
|
128
157
|
};
|
|
129
158
|
}
|
|
130
159
|
});
|
|
@@ -112,7 +112,7 @@ function getSysRsPage(BASE_API, params) {
|
|
|
112
112
|
}
|
|
113
113
|
function getDirectory(BASE_API, params) {
|
|
114
114
|
return request(BASE_API, {
|
|
115
|
-
url: "/poplar/v3/
|
|
115
|
+
url: "/poplar/v3/directory/tree",
|
|
116
116
|
method: "get",
|
|
117
117
|
params
|
|
118
118
|
});
|
|
@@ -125,14 +125,7 @@ function useDirectory(options) {
|
|
|
125
125
|
if (code === 0) {
|
|
126
126
|
if (!Array.isArray(message.data))
|
|
127
127
|
return [];
|
|
128
|
-
return message.data
|
|
129
|
-
return {
|
|
130
|
-
title: alias,
|
|
131
|
-
key: id,
|
|
132
|
-
isLeaf: false,
|
|
133
|
-
children: []
|
|
134
|
-
};
|
|
135
|
-
});
|
|
128
|
+
return message.data;
|
|
136
129
|
}
|
|
137
130
|
return [];
|
|
138
131
|
}
|