@cmstops/pro-compo 3.9.2-alpha.1 → 3.9.2-alpha.10

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.
Files changed (32) hide show
  1. package/dist/index.css +6 -0
  2. package/dist/index.min.css +1 -1
  3. package/es/baseFilter/component.js +71 -14
  4. package/es/contentDetailList/component.js +24 -0
  5. package/es/contentDetailList/components/Content/index.js +2 -1
  6. package/es/contentDetailList/components/Doc/index.js +6 -0
  7. package/es/hooks/useUpload.d.ts +50 -2
  8. package/es/hooks/useUpload.js +43 -4
  9. package/es/index.css +6 -0
  10. package/es/selectResourceModal/components/List/ListLocal/index.js +8 -3
  11. package/es/selectResourceModal/components/List/ListNormal/Filter.js +55 -26
  12. package/es/selectResourceModal/components/List/ListNormal/index.js +5 -4
  13. package/es/selectResourceModal/hooks/useResponsiveFilter.js +1 -1
  14. package/es/selectResourceModal/style/index.css +6 -0
  15. package/es/selectResourceModal/style/index.less +9 -0
  16. package/es/selectResourceModal/style/list.less +1 -0
  17. package/es/utils/index.js +6 -6
  18. package/lib/baseFilter/component.js +69 -12
  19. package/lib/contentDetailList/component.js +24 -0
  20. package/lib/contentDetailList/components/Content/index.js +2 -1
  21. package/lib/contentDetailList/components/Doc/index.js +6 -0
  22. package/lib/hooks/useUpload.js +43 -3
  23. package/lib/index.css +6 -0
  24. package/lib/selectResourceModal/components/List/ListLocal/index.js +6 -1
  25. package/lib/selectResourceModal/components/List/ListNormal/Filter.js +54 -25
  26. package/lib/selectResourceModal/components/List/ListNormal/index.js +5 -4
  27. package/lib/selectResourceModal/hooks/useResponsiveFilter.js +1 -1
  28. package/lib/selectResourceModal/style/index.css +6 -0
  29. package/lib/selectResourceModal/style/index.less +9 -0
  30. package/lib/selectResourceModal/style/list.less +1 -0
  31. package/lib/utils/index.js +6 -6
  32. package/package.json +1 -1
@@ -67,7 +67,7 @@ function useResponsiveFilter(filterItemsRef) {
67
67
  if (!item || !item.classList || !item.classList.contains("filter-item"))
68
68
  continue;
69
69
  const itemRect = getRect(item);
70
- if (itemRect.right > containerRight - 300) {
70
+ if (itemRect.right > containerRight - 400) {
71
71
  hideElement(item);
72
72
  } else {
73
73
  currentRightmostBoundary = Math.max(
@@ -172,6 +172,7 @@
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
  }
@@ -347,3 +348,8 @@
347
348
  .resource-select-container .resource-select-header .arco-tabs-content {
348
349
  display: none !important;
349
350
  }
351
+ .resource-select-container .resource-list-content .resource-list-content-empty {
352
+ box-sizing: border-box;
353
+ width: 100%;
354
+ height: 100%;
355
+ }
@@ -43,4 +43,13 @@
43
43
  display: none !important;
44
44
  }
45
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
+ }
46
55
  }
@@ -14,6 +14,7 @@
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
  }
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 / (60 * 60));
141
- const m = Math.floor((v - h) / 60);
142
- const s = Math.floor(v - h * 360 - m * 60);
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 = (item) => {
42
- return item.options ? item.options : [];
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.InputSearch), {
183
- key: 0,
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: 1,
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: 2,
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"]);
@@ -109,6 +109,12 @@ const _sfc_main = vue.defineComponent({
109
109
  onCellMouseEnter: tableCellMouseEnter,
110
110
  onCellMouseLeave: tableCellMouseLeave
111
111
  }, {
112
+ "after-index": vue.withCtx(() => [
113
+ vue.renderSlot(_ctx.$slots, "after-index", {
114
+ row: element,
115
+ index: index$4
116
+ })
117
+ ]),
112
118
  batch: vue.withCtx(() => [
113
119
  vue.renderSlot(_ctx.$slots, "batch", {
114
120
  row: element,
@@ -133,6 +139,12 @@ const _sfc_main = vue.defineComponent({
133
139
  onCellMouseEnter: tableCellMouseEnter,
134
140
  onCellMouseLeave: tableCellMouseLeave
135
141
  }, {
142
+ "after-index": vue.withCtx(() => [
143
+ vue.renderSlot(_ctx.$slots, "after-index", {
144
+ row: element,
145
+ index: index$4
146
+ })
147
+ ]),
136
148
  tip: vue.withCtx(() => [
137
149
  vue.renderSlot(_ctx.$slots, "tip", {
138
150
  row: element,
@@ -229,6 +241,12 @@ const _sfc_main = vue.defineComponent({
229
241
  onCellMouseEnter: tableCellMouseEnter,
230
242
  onCellMouseLeave: tableCellMouseLeave
231
243
  }, {
244
+ "after-index": vue.withCtx(() => [
245
+ vue.renderSlot(_ctx.$slots, "after-index", {
246
+ row: item,
247
+ index: index$4
248
+ })
249
+ ]),
232
250
  batch: vue.withCtx(() => [
233
251
  vue.renderSlot(_ctx.$slots, "batch", {
234
252
  row: item,
@@ -253,6 +271,12 @@ const _sfc_main = vue.defineComponent({
253
271
  onCellMouseEnter: tableCellMouseEnter,
254
272
  onCellMouseLeave: tableCellMouseLeave
255
273
  }, {
274
+ "after-index": vue.withCtx(() => [
275
+ vue.renderSlot(_ctx.$slots, "after-index", {
276
+ row: item,
277
+ index: index$4
278
+ })
279
+ ]),
256
280
  tip: vue.withCtx(() => [
257
281
  vue.renderSlot(_ctx.$slots, "tip", {
258
282
  row: item,
@@ -143,7 +143,8 @@ const _sfc_main = vue.defineComponent({
143
143
  })
144
144
  ]),
145
145
  index: vue.withCtx(() => [
146
- vue.createElementVNode("span", _hoisted_1, vue.toDisplayString(_ctx.index + 1), 1)
146
+ vue.createElementVNode("span", _hoisted_1, vue.toDisplayString(_ctx.index + 1), 1),
147
+ vue.renderSlot(_ctx.$slots, "after-index")
147
148
  ]),
148
149
  tip: vue.withCtx(() => [
149
150
  vue.createCommentVNode(" \u5148\u6DFB\u52A0\u6587\u4EF6\u8D44\u6E90\uFF0C\u672A\u53D1\u5E03 "),
@@ -38,6 +38,12 @@ const _sfc_main = vue.defineComponent({
38
38
  index: _ctx.index
39
39
  })
40
40
  ]),
41
+ "after-index": vue.withCtx(() => [
42
+ vue.renderSlot(_ctx.$slots, "after-index", {
43
+ row: _ctx.element,
44
+ index: _ctx.index
45
+ })
46
+ ]),
41
47
  batch: vue.withCtx(() => [
42
48
  vue.renderSlot(_ctx.$slots, "batch", {
43
49
  row: _ctx.item,
@@ -75,7 +75,7 @@ function useUpload(options) {
75
75
  list.value = originList;
76
76
  }
77
77
  };
78
- const uploadFile = (BASE_API, file, dir = 0, repoId, callback) => {
78
+ const uploadFile = (BASE_API, file, dir = 0, repoId, callback, upOptions) => {
79
79
  const newFile = {
80
80
  id: file.id || index.generateUUID(),
81
81
  sig_id: file.sig_id || index.generateUUID(),
@@ -95,18 +95,24 @@ function useUpload(options) {
95
95
  };
96
96
  const uploading = upload.start(progress);
97
97
  uploading.then(async (url) => {
98
+ var _a;
98
99
  if (options == null ? void 0 : options.noAddMedia) {
99
100
  recordTaskStatusChange({ ...newFile, status: 0, url }, 1);
100
101
  callback && callback({ ...newFile, url }, "success");
101
102
  return;
102
103
  }
104
+ const params = {};
105
+ if ((_a = upOptions == null ? void 0 : upOptions.template) == null ? void 0 : _a.watermark) {
106
+ params.watermark = upOptions.template.watermark.default;
107
+ }
103
108
  const { code, message } = await addMedia(BASE_API, {
104
109
  url,
105
110
  size: newFile.size,
106
111
  directory_id: dir,
107
112
  repository_id: repoId,
108
113
  catalog: newFile.type,
109
- alias: newFile.name
114
+ alias: newFile.name,
115
+ ...params
110
116
  });
111
117
  if (code !== 0) {
112
118
  console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u4E0A\u4F20\u5931\u8D25\uFF1A", newFile.name, code, message);
@@ -196,9 +202,16 @@ function getConfiguration(BASE_API, params) {
196
202
  params
197
203
  });
198
204
  }
205
+ function getWatermarkTemplate(BASE_API) {
206
+ return request(BASE_API, {
207
+ url: `/poplar/v2/material/image/watermark`,
208
+ method: "get"
209
+ });
210
+ }
199
211
  function useUploadConfig() {
200
212
  const { get, set, remove } = useLocalStorage["default"]("LOCAL_UPLOAD_CONFIG");
201
213
  const config = vue.ref(get() || {});
214
+ const template = vue.ref({});
202
215
  async function initUploadConfig(BASE_API, domainId) {
203
216
  if (config.value.size_config_enabled != null)
204
217
  return;
@@ -247,16 +260,43 @@ function useUploadConfig() {
247
260
  );
248
261
  return false;
249
262
  }
263
+ async function initTemplate(BASE_API) {
264
+ try {
265
+ const { code, message } = await getWatermarkTemplate(BASE_API);
266
+ if (code !== 0)
267
+ return;
268
+ if (message) {
269
+ let defaultWaterMark;
270
+ if (Array.isArray(message.images)) {
271
+ message.images.forEach((item) => {
272
+ if (message.default === item.id)
273
+ defaultWaterMark = item;
274
+ });
275
+ }
276
+ template.value = {
277
+ watermark: {
278
+ default: defaultWaterMark,
279
+ images: message.images
280
+ }
281
+ };
282
+ }
283
+ } catch (e) {
284
+ console.error(e);
285
+ }
286
+ }
250
287
  window.addEventListener("beforeunload", remove, false);
251
288
  return {
252
289
  config,
290
+ template,
253
291
  checkFileSizeOutLimit,
254
- initUploadConfig
292
+ initUploadConfig,
293
+ initTemplate
255
294
  };
256
295
  }
257
296
  exports.addMedia = addMedia;
258
297
  exports["default"] = useUpload;
259
298
  exports.getMediaDetails = getMediaDetails;
260
299
  exports.getSize = getSize;
300
+ exports.getWatermarkTemplate = getWatermarkTemplate;
261
301
  exports.reTranscodeMedia = reTranscodeMedia;
262
302
  exports.useUploadConfig = useUploadConfig;
package/lib/index.css CHANGED
@@ -4529,6 +4529,7 @@
4529
4529
  }
4530
4530
  .resource-list-footer,
4531
4531
  .resource-list-header,
4532
+ .resource-list-content .resource-list-content-empty,
4532
4533
  .resource-list-content .arco-scrollbar-container {
4533
4534
  padding: 0 40px;
4534
4535
  }
@@ -4704,6 +4705,11 @@
4704
4705
  .resource-select-container .resource-select-header .arco-tabs-content {
4705
4706
  display: none !important;
4706
4707
  }
4708
+ .resource-select-container .resource-list-content .resource-list-content-empty {
4709
+ box-sizing: border-box;
4710
+ width: 100%;
4711
+ height: 100%;
4712
+ }
4707
4713
  .iframe-container {
4708
4714
  position: relative;
4709
4715
  height: 95vh;
@@ -23,6 +23,7 @@ const _sfc_main = vue.defineComponent({
23
23
  var _a;
24
24
  return (_a = userInfo == null ? void 0 : userInfo.value) == null ? void 0 : _a.repository_id;
25
25
  });
26
+ const { template, initTemplate } = useUpload.useUploadConfig();
26
27
  const { list, uploadFile, reTranscode, transcodingFile, removeRecord } = useUpload["default"]();
27
28
  function handleChange(file) {
28
29
  if (!baseAPI || !repoId.value)
@@ -32,7 +33,8 @@ const _sfc_main = vue.defineComponent({
32
33
  file.file,
33
34
  0,
34
35
  repoId.value,
35
- (media) => transcodingFile(baseAPI, media, repoId.value)
36
+ (media) => transcodingFile(baseAPI, media, repoId.value),
37
+ { template: template.value }
36
38
  );
37
39
  }
38
40
  async function handleOptions(e) {
@@ -55,6 +57,9 @@ const _sfc_main = vue.defineComponent({
55
57
  removeRecord(e.item);
56
58
  }
57
59
  }
60
+ vue.onMounted(() => {
61
+ initTemplate(baseAPI);
62
+ });
58
63
  return (_ctx, _cache) => {
59
64
  return vue.openBlock(), vue.createBlock(ListWraper, null, {
60
65
  "footer-extra": vue.withCtx(() => [
@@ -46,10 +46,12 @@ const _hoisted_14 = ["onClick"];
46
46
  const _sfc_main = vue.defineComponent({
47
47
  __name: "Filter",
48
48
  props: {
49
+ smallScreen: { type: Boolean },
49
50
  disableUploadBy: { type: Boolean }
50
51
  },
51
52
  emits: ["upload", "change"],
52
53
  setup(__props, { expose: __expose, emit: __emit }) {
54
+ var _a, _b, _c;
53
55
  const props = __props;
54
56
  const emits = __emit;
55
57
  const userInfo = vue.inject("userInfo");
@@ -63,8 +65,7 @@ const _sfc_main = vue.defineComponent({
63
65
  hiddenElementList,
64
66
  visible,
65
67
  show,
66
- hide,
67
- refreshLayout
68
+ hide
68
69
  } = useResponsiveFilter.useResponsiveFilter(filterItemsRef);
69
70
  const { options, loading, load, loadMore, handleSearch } = useSelection({
70
71
  labelStr: "alias",
@@ -99,7 +100,17 @@ const _sfc_main = vue.defineComponent({
99
100
  sf: "",
100
101
  directory_id: void 0
101
102
  };
102
- const filter = vue.ref(JSON.parse(JSON.stringify(originFilter)));
103
+ if ((_a = filterOptions == null ? void 0 : filterOptions.value) == null ? void 0 : _a.mediaTypeStrict) {
104
+ originFilter.catalog = filterOptions.value.mediaType.split(",");
105
+ }
106
+ const filter = vue.ref(
107
+ JSON.parse(
108
+ JSON.stringify({
109
+ ...originFilter,
110
+ catalog: ((_c = (_b = filterOptions == null ? void 0 : filterOptions.value) == null ? void 0 : _b.mediaType) == null ? void 0 : _c.split(",")) || []
111
+ })
112
+ )
113
+ );
103
114
  const handleReset = () => {
104
115
  filter.value = JSON.parse(JSON.stringify(originFilter));
105
116
  };
@@ -178,27 +189,18 @@ const _sfc_main = vue.defineComponent({
178
189
  }
179
190
  }
180
191
  emits("change", result);
181
- refreshLayout();
182
192
  },
183
193
  { deep: true, immediate: true }
184
194
  );
185
195
  vue.onMounted(() => {
186
- var _a;
187
196
  load();
188
- if ((_a = filterOptions == null ? void 0 : filterOptions.value) == null ? void 0 : _a.mediaType) {
189
- const initialCatalog = filterOptions.value.mediaType.split(",");
190
- filter.value.catalog = initialCatalog;
191
- if (filterOptions.value.mediaTypeStrict) {
192
- originFilter.catalog = initialCatalog;
193
- }
194
- }
195
197
  });
196
198
  __expose({
197
199
  filter,
198
200
  handleReset
199
201
  });
200
202
  return (_ctx, _cache) => {
201
- var _a;
203
+ var _a2;
202
204
  return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
203
205
  vue.createCommentVNode(" Use filterItemsRef's parentElement as the container for boundary checks "),
204
206
  vue.createElementVNode("div", _hoisted_2, [
@@ -221,7 +223,7 @@ const _sfc_main = vue.defineComponent({
221
223
  }, {
222
224
  default: vue.withCtx(() => [
223
225
  vue.createElementVNode("span", _hoisted_4, [
224
- _cache[10] || (_cache[10] = vue.createTextVNode(" \u66F4\u591A\u7B5B\u9009 ")),
226
+ _cache[11] || (_cache[11] = vue.createTextVNode(" \u66F4\u591A ")),
225
227
  vue.createVNode(vue.unref(icon.IconCaretDown))
226
228
  ])
227
229
  ]),
@@ -254,13 +256,13 @@ const _sfc_main = vue.defineComponent({
254
256
  }, {
255
257
  content: vue.withCtx(() => [
256
258
  vue.createVNode(vue.unref(webVue.Doption), { value: 0 }, {
257
- default: vue.withCtx(() => _cache[11] || (_cache[11] = [
259
+ default: vue.withCtx(() => _cache[12] || (_cache[12] = [
258
260
  vue.createTextVNode("\u7CBE\u51C6\u641C")
259
261
  ])),
260
262
  _: 1
261
263
  }),
262
264
  vue.createVNode(vue.unref(webVue.Doption), { value: 1 }, {
263
- default: vue.withCtx(() => _cache[12] || (_cache[12] = [
265
+ default: vue.withCtx(() => _cache[13] || (_cache[13] = [
264
266
  vue.createTextVNode("\u6A21\u7CCA\u641C")
265
267
  ])),
266
268
  _: 1
@@ -292,15 +294,22 @@ const _sfc_main = vue.defineComponent({
292
294
  title: "alias",
293
295
  key: "id"
294
296
  },
295
- "allow-clear": ""
296
- }, null, 8, ["modelValue", "data"])
297
+ "allow-clear": "",
298
+ "allow-search": "",
299
+ "filter-tree-node": (searchValue, nodeData) => {
300
+ console.log(nodeData);
301
+ if (!nodeData.alias)
302
+ return false;
303
+ return nodeData.alias.toLowerCase().indexOf(searchValue.toLowerCase()) > -1;
304
+ }
305
+ }, null, 8, ["modelValue", "data", "filter-tree-node"])
297
306
  ]),
298
307
  vue.createCommentVNode(" \u7D20\u6750\u7C7B\u578B "),
299
308
  vue.createElementVNode("div", _hoisted_7, [
300
309
  vue.createVNode(vue.unref(webVue.Select), {
301
310
  modelValue: filter.value.catalog,
302
311
  "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => filter.value.catalog = $event),
303
- disabled: (_a = vue.unref(filterOptions)) == null ? void 0 : _a.mediaTypeStrict,
312
+ disabled: (_a2 = vue.unref(filterOptions)) == null ? void 0 : _a2.mediaTypeStrict,
304
313
  "popup-container": "#resource-filter-pannel",
305
314
  "allow-clear": "",
306
315
  placeholder: "\u7C7B\u578B",
@@ -378,30 +387,50 @@ const _sfc_main = vue.defineComponent({
378
387
  vue.createElementVNode("div", _hoisted_11, [
379
388
  vue.createCommentVNode(" \u91CD\u7F6E\u6309\u94AE - Wrap in filter-item to be managed by the hook "),
380
389
  vue.withDirectives(vue.createElementVNode("div", _hoisted_12, [
381
- vue.createVNode(vue.unref(webVue.Button), {
390
+ _ctx.smallScreen ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Button), {
391
+ key: 0,
392
+ type: "text",
393
+ onClick: handleReset
394
+ }, {
395
+ icon: vue.withCtx(() => [
396
+ vue.createVNode(vue.unref(icon.IconRefresh))
397
+ ]),
398
+ _: 1
399
+ })) : (vue.openBlock(), vue.createBlock(vue.unref(webVue.Button), {
400
+ key: 1,
382
401
  type: "text",
383
402
  onClick: handleReset
384
403
  }, {
385
- default: vue.withCtx(() => _cache[13] || (_cache[13] = [
404
+ default: vue.withCtx(() => _cache[14] || (_cache[14] = [
386
405
  vue.createTextVNode(" \u91CD\u7F6E ")
387
406
  ])),
388
407
  _: 1
389
- })
408
+ }))
390
409
  ], 512), [
391
410
  [vue.vShow, !isEmpty.value]
392
411
  ]),
393
- vue.createVNode(vue.unref(webVue.Button), {
412
+ _ctx.smallScreen ? (vue.openBlock(), vue.createBlock(vue.unref(webVue.Button), {
413
+ key: 0,
394
414
  type: "primary",
395
415
  onClick: _cache[9] || (_cache[9] = ($event) => emits("upload"))
416
+ }, {
417
+ icon: vue.withCtx(() => [
418
+ vue.createVNode(vue.unref(icon.IconUpload))
419
+ ]),
420
+ _: 1
421
+ })) : (vue.openBlock(), vue.createBlock(vue.unref(webVue.Button), {
422
+ key: 1,
423
+ type: "primary",
424
+ onClick: _cache[10] || (_cache[10] = ($event) => emits("upload"))
396
425
  }, {
397
426
  icon: vue.withCtx(() => [
398
427
  vue.createVNode(vue.unref(icon.IconUpload))
399
428
  ]),
400
429
  default: vue.withCtx(() => [
401
- _cache[14] || (_cache[14] = vue.createTextVNode(" \u4E0A\u4F20 "))
430
+ _cache[15] || (_cache[15] = vue.createTextVNode(" \u4E0A\u4F20 "))
402
431
  ]),
403
432
  _: 1
404
- })
433
+ }))
405
434
  ])
406
435
  ]),
407
436
  searchInput.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_13, [
@@ -28,14 +28,14 @@ const _sfc_main = vue.defineComponent({
28
28
  } = useAttachement["default"]({ key: props.activeKey, BASE_API });
29
29
  vue.watch(() => props.activeKey, changeKey);
30
30
  const listWrapper = vue.ref(null);
31
- const showPageSize = vue.ref(true);
31
+ const smallScreen = vue.ref(false);
32
32
  vue.watch(
33
33
  () => {
34
34
  var _a;
35
35
  return (_a = listWrapper.value) == null ? void 0 : _a.offsetWidth;
36
36
  },
37
37
  (val) => {
38
- showPageSize.value = !(val && val < 480);
38
+ smallScreen.value = !!(val && val < 600);
39
39
  },
40
40
  { immediate: true }
41
41
  );
@@ -52,9 +52,10 @@ const _sfc_main = vue.defineComponent({
52
52
  ]),
53
53
  header: vue.withCtx(() => [
54
54
  vue.createVNode(Filter, {
55
+ smallScreen: smallScreen.value,
55
56
  onChange: vue.unref(changeFilter),
56
57
  onUpload: _cache[0] || (_cache[0] = ($event) => emits("change-tab", "local"))
57
- }, null, 8, ["onChange"])
58
+ }, null, 8, ["smallScreen", "onChange"])
58
59
  ]),
59
60
  footer: vue.withCtx(() => [
60
61
  vue.createVNode(vue.unref(webVue.Pagination), {
@@ -63,7 +64,7 @@ const _sfc_main = vue.defineComponent({
63
64
  total: vue.unref(total),
64
65
  "page-size": vue.unref(limit),
65
66
  "show-total": "",
66
- "show-page-size": showPageSize.value,
67
+ "show-page-size": !smallScreen.value,
67
68
  "base-size": 3,
68
69
  "buffer-size": 1,
69
70
  onChange: _cache[2] || (_cache[2] = (e) => vue.unref(changePage)((e - 1) * vue.unref(limit))),
@@ -69,7 +69,7 @@ function useResponsiveFilter(filterItemsRef) {
69
69
  if (!item || !item.classList || !item.classList.contains("filter-item"))
70
70
  continue;
71
71
  const itemRect = getRect(item);
72
- if (itemRect.right > containerRight - 300) {
72
+ if (itemRect.right > containerRight - 400) {
73
73
  hideElement(item);
74
74
  } else {
75
75
  currentRightmostBoundary = Math.max(