@cmstops/pro-compo 0.3.99 → 3.0.0-rc.0

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,4 +1,3 @@
1
- import { Ref } from 'vue';
2
1
  export declare function getAttachmentsAll(BASE_API: string, query?: any): Promise<import("axios").AxiosResponse<any, any>>;
3
2
  export declare function getAttachmentsMy(BASE_API: string, query?: any): Promise<import("axios").AxiosResponse<any, any>>;
4
3
  export declare function getAttachmentsMyMessage(BASE_API: string, query: any): Promise<import("axios").AxiosResponse<any, any>>;
@@ -7,12 +6,12 @@ declare type OptionsType = {
7
6
  BASE_API: string;
8
7
  };
9
8
  export default function useAttachement(options: OptionsType): {
10
- list: Ref<any[], any[]>;
11
- total: Ref<number, number>;
12
- limit: Ref<number, number>;
13
- offset: Ref<number, number>;
9
+ list: import("vue").Ref<any[], any[]>;
10
+ total: import("vue").Ref<number, number>;
11
+ limit: import("vue").Ref<number, number>;
12
+ offset: import("vue").Ref<number, number>;
14
13
  pageIdx: import("vue").ComputedRef<number>;
15
- loading: Ref<boolean, boolean>;
14
+ loading: import("vue").Ref<boolean, boolean>;
16
15
  changeFilter: (f: any) => void;
17
16
  changeKey: (k: string) => void;
18
17
  changePage: (o: number) => void;
@@ -20,7 +19,7 @@ export default function useAttachement(options: OptionsType): {
20
19
  loadData: () => Promise<void>;
21
20
  };
22
21
  export declare function useLocalRecource(): {
23
- localList: Ref<any[], any[]>;
22
+ localList: import("vue").Ref<any[], any[]>;
24
23
  initLocalList: () => void;
25
24
  setLocalList: (list: any[]) => void;
26
25
  };
@@ -31,4 +30,24 @@ export declare const mediaUseEnum: {
31
30
  export declare function getSysRsByTag(BASE_API: string, params: any): Promise<import("axios").AxiosResponse<any, any>>;
32
31
  export declare function getSysRsClassifyList(BASE_API: string, sys_tag: number): Promise<import("axios").AxiosResponse<any, any>>;
33
32
  export declare function getSysRsPage(BASE_API: string, params: any): Promise<import("axios").AxiosResponse<any, any>>;
33
+ export declare function getDirectory(BASE_API: string, params: any): Promise<import("axios").AxiosResponse<any, any>>;
34
+ /**
35
+ * 数据结构:
36
+ * Array<{
37
+ * "id": {dirid},
38
+ * "alias": {dirname},
39
+ * "parent_id": {parent_dirid},
40
+ * "children": [],
41
+ * ...
42
+ * }>
43
+ */
44
+ declare type DirOptionsType = {
45
+ key?: string;
46
+ BASE_API: string;
47
+ };
48
+ export declare function useDirectory(options: DirOptionsType): {
49
+ tree: import("vue").Ref<any[], any[]>;
50
+ init: () => Promise<void>;
51
+ loadMore: (target: any) => Promise<void>;
52
+ };
34
53
  export {};
@@ -1,4 +1,4 @@
1
- import { ref, computed } from "vue";
1
+ import { ref, computed, onMounted } from "vue";
2
2
  import request from "../utils/request.js";
3
3
  function getAttachmentsAll(BASE_API, query) {
4
4
  return request(BASE_API, {
@@ -108,4 +108,51 @@ function getSysRsPage(BASE_API, params) {
108
108
  params
109
109
  });
110
110
  }
111
- export { useAttachement as default, getAttachmentsAll, getAttachmentsMy, getAttachmentsMyMessage, getSysRsByTag, getSysRsPage };
111
+ function getDirectory(BASE_API, params) {
112
+ return request(BASE_API, {
113
+ url: "/poplar/v3/directories",
114
+ method: "get",
115
+ params
116
+ });
117
+ }
118
+ function useDirectory(options) {
119
+ const tree = ref([]);
120
+ async function loadDirTree(parent_id) {
121
+ const params = parent_id ? { parent_id } : {};
122
+ const { code, message } = await getDirectory(options.BASE_API, params);
123
+ if (code === 0) {
124
+ if (!Array.isArray(message.data))
125
+ return [];
126
+ return message.data.map(({ alias, id }) => {
127
+ return {
128
+ title: alias,
129
+ key: id,
130
+ isLeaf: false,
131
+ children: []
132
+ };
133
+ });
134
+ }
135
+ return [];
136
+ }
137
+ async function init() {
138
+ const result = await loadDirTree();
139
+ if (!Array.isArray(result))
140
+ return;
141
+ tree.value = result;
142
+ }
143
+ async function loadMore(target) {
144
+ const children = await loadDirTree(target.key);
145
+ target.children = children;
146
+ if (children.length === 0)
147
+ target.isLeaf = true;
148
+ }
149
+ onMounted(() => {
150
+ init();
151
+ });
152
+ return {
153
+ tree,
154
+ init,
155
+ loadMore
156
+ };
157
+ }
158
+ export { useAttachement as default, getAttachmentsAll, getAttachmentsMy, getAttachmentsMyMessage, getDirectory, getSysRsByTag, getSysRsPage, useDirectory };
package/es/index.css CHANGED
@@ -4619,6 +4619,7 @@
4619
4619
  }
4620
4620
  .resource-list .list-filter-wrapper .list-filter .filter-list {
4621
4621
  display: flex;
4622
+ flex-wrap: wrap;
4622
4623
  gap: 10px;
4623
4624
  }
4624
4625
  .resource-list .list-filter-wrapper .list-filter .filter-list .filter-item {
@@ -32,8 +32,9 @@ const _sfc_main = defineComponent({
32
32
  return false;
33
33
  if (filterOptions == null ? void 0 : filterOptions.value) {
34
34
  const { mediaType, mediaTypeStrict } = filterOptions.value;
35
- if (mediaTypeStrict)
36
- return props.item.catalog === mediaType;
35
+ if (mediaTypeStrict) {
36
+ return mediaType.split(",").includes(props.item.catalog);
37
+ }
37
38
  }
38
39
  if (props.item.progress >= 0)
39
40
  return false;
@@ -1,7 +1,8 @@
1
1
  import { defineComponent, inject, computed, ref, watch, onMounted, openBlock, createElementBlock, createElementVNode, createCommentVNode, createVNode, unref, withCtx, createTextVNode, toDisplayString, Fragment, renderList, createBlock, normalizeClass } from "vue";
2
- import { Input, Dropdown, Doption, Button, Select, Option, RangePicker } from "@arco-design/web-vue";
2
+ import { Input, Dropdown, Doption, Button, Select, Option, TreeSelect, RangePicker } from "@arco-design/web-vue";
3
3
  import { IconUpload } from "@arco-design/web-vue/es/icon";
4
4
  import useSelection from "../../../../hooks/useSelection.js";
5
+ import { useDirectory } from "../../../../hooks/useAttachement.js";
5
6
  import { RESOURCE_SOURCE_OPTIONS, RESOURCE_CATALOG_OPTIONS } from "../../../../utils/typeMap.js";
6
7
  import { getAccountList } from "../../../scripts/selectionApis.js";
7
8
  import { keywordsSelection } from "../../../../utils/resource.js";
@@ -9,7 +10,10 @@ const _hoisted_1 = { class: "list-filter-wrapper" };
9
10
  const _hoisted_2 = { class: "list-filter" };
10
11
  const _hoisted_3 = { class: "filter-list" };
11
12
  const _hoisted_4 = { style: { "width": "200px" } };
12
- const _hoisted_5 = { class: "filter-item" };
13
+ const _hoisted_5 = {
14
+ class: "filter-item",
15
+ style: { "width": "200px" }
16
+ };
13
17
  const _hoisted_6 = { class: "filter-item" };
14
18
  const _hoisted_7 = {
15
19
  key: 0,
@@ -53,15 +57,19 @@ const _sfc_main = defineComponent({
53
57
  });
54
58
  const resourceSource = RESOURCE_SOURCE_OPTIONS;
55
59
  const resourceCatalog = RESOURCE_CATALOG_OPTIONS;
60
+ const { tree, loadMore: loadDirMore } = useDirectory({
61
+ BASE_API: baseAPI
62
+ });
56
63
  const originFilter = {
57
- catalog: "",
64
+ catalog: [],
58
65
  source: "",
59
66
  created_begin: "",
60
67
  created_end: "",
61
68
  keyword: "",
62
69
  precise_keyword: "",
63
70
  upload_by: null,
64
- sf: ""
71
+ sf: "",
72
+ directory_id: void 0
65
73
  };
66
74
  const filter = ref(JSON.parse(JSON.stringify(originFilter)));
67
75
  const handleReset = () => {
@@ -133,6 +141,8 @@ const _sfc_main = defineComponent({
133
141
  });
134
142
  if (!result.catalog)
135
143
  result.catalog = "image,video,audio";
144
+ else
145
+ result.catalog = result.catalog.join(",");
136
146
  emits("change", result);
137
147
  },
138
148
  { deep: true, immediate: true }
@@ -142,9 +152,9 @@ const _sfc_main = defineComponent({
142
152
  () => {
143
153
  var _a;
144
154
  if ((_a = filterOptions == null ? void 0 : filterOptions.value) == null ? void 0 : _a.mediaType) {
145
- filter.value.catalog = filterOptions == null ? void 0 : filterOptions.value.mediaType;
155
+ filter.value.catalog = filterOptions == null ? void 0 : filterOptions.value.mediaType.split(",");
146
156
  if (filterOptions == null ? void 0 : filterOptions.value.mediaTypeStrict) {
147
- originFilter.catalog = filterOptions == null ? void 0 : filterOptions.value.mediaType;
157
+ originFilter.catalog = filterOptions == null ? void 0 : filterOptions.value.mediaType.split(",");
148
158
  }
149
159
  }
150
160
  },
@@ -175,13 +185,13 @@ const _sfc_main = defineComponent({
175
185
  }, {
176
186
  content: withCtx(() => [
177
187
  createVNode(unref(Doption), { value: 0 }, {
178
- default: withCtx(() => _cache[7] || (_cache[7] = [
188
+ default: withCtx(() => _cache[8] || (_cache[8] = [
179
189
  createTextVNode("\u7CBE\u51C6\u641C")
180
190
  ])),
181
191
  _: 1
182
192
  }),
183
193
  createVNode(unref(Doption), { value: 1 }, {
184
- default: withCtx(() => _cache[8] || (_cache[8] = [
194
+ default: withCtx(() => _cache[9] || (_cache[9] = [
185
195
  createTextVNode("\u6A21\u7CCA\u641C")
186
196
  ])),
187
197
  _: 1
@@ -208,7 +218,8 @@ const _sfc_main = defineComponent({
208
218
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => filter.value.catalog = $event),
209
219
  disabled: (_a = unref(filterOptions)) == null ? void 0 : _a.mediaTypeStrict,
210
220
  "allow-clear": "",
211
- placeholder: "\u7C7B\u578B"
221
+ placeholder: "\u7C7B\u578B",
222
+ multiple: ""
212
223
  }, {
213
224
  default: withCtx(() => [
214
225
  (openBlock(true), createElementBlock(Fragment, null, renderList(unref(resourceCatalog), (item) => {
@@ -222,10 +233,20 @@ const _sfc_main = defineComponent({
222
233
  _: 1
223
234
  }, 8, ["modelValue", "disabled"])
224
235
  ]),
236
+ createCommentVNode(" \u76EE\u5F55 "),
237
+ createVNode(unref(TreeSelect), {
238
+ modelValue: filter.value.directory_id,
239
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => filter.value.directory_id = $event),
240
+ data: unref(tree),
241
+ "load-more": unref(loadDirMore),
242
+ placeholder: "\u8BF7\u9009\u62E9\u76EE\u5F55",
243
+ style: { "width": "180px" },
244
+ "allow-clear": ""
245
+ }, null, 8, ["modelValue", "data", "load-more"]),
225
246
  createCommentVNode(" \u65F6\u95F4\u8303\u56F4 "),
226
247
  createVNode(unref(RangePicker), {
227
248
  modelValue: rangeTime.value,
228
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => rangeTime.value = $event),
249
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => rangeTime.value = $event),
229
250
  "allow-clear": "",
230
251
  style: { "width": "240px" }
231
252
  }, null, 8, ["modelValue"]),
@@ -233,7 +254,7 @@ const _sfc_main = defineComponent({
233
254
  createElementVNode("div", _hoisted_6, [
234
255
  createVNode(unref(Select), {
235
256
  modelValue: filter.value.source,
236
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => filter.value.source = $event),
257
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => filter.value.source = $event),
237
258
  "allow-clear": "",
238
259
  placeholder: "\u6765\u6E90"
239
260
  }, {
@@ -253,7 +274,7 @@ const _sfc_main = defineComponent({
253
274
  !_ctx.disableUploadBy ? (openBlock(), createElementBlock("div", _hoisted_7, [
254
275
  createVNode(unref(Select), {
255
276
  modelValue: filter.value.upload_by,
256
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => filter.value.upload_by = $event),
277
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => filter.value.upload_by = $event),
257
278
  "allow-clear": "",
258
279
  placeholder: "\u4E0A\u4F20\u4EBA",
259
280
  loading: unref(loading),
@@ -278,7 +299,7 @@ const _sfc_main = defineComponent({
278
299
  type: "text",
279
300
  onClick: handleReset
280
301
  }, {
281
- default: withCtx(() => _cache[9] || (_cache[9] = [
302
+ default: withCtx(() => _cache[10] || (_cache[10] = [
282
303
  createTextVNode(" \u91CD\u7F6E ")
283
304
  ])),
284
305
  _: 1
@@ -287,13 +308,13 @@ const _sfc_main = defineComponent({
287
308
  createElementVNode("div", _hoisted_8, [
288
309
  createVNode(unref(Button), {
289
310
  type: "primary",
290
- onClick: _cache[6] || (_cache[6] = ($event) => emits("upload"))
311
+ onClick: _cache[7] || (_cache[7] = ($event) => emits("upload"))
291
312
  }, {
292
313
  icon: withCtx(() => [
293
314
  createVNode(unref(IconUpload))
294
315
  ]),
295
316
  default: withCtx(() => [
296
- _cache[10] || (_cache[10] = createTextVNode(" \u4E0A\u4F20 "))
317
+ _cache[11] || (_cache[11] = createTextVNode(" \u4E0A\u4F20 "))
297
318
  ]),
298
319
  _: 1
299
320
  })
@@ -262,6 +262,7 @@
262
262
  }
263
263
  .resource-list .list-filter-wrapper .list-filter .filter-list {
264
264
  display: flex;
265
+ flex-wrap: wrap;
265
266
  gap: 10px;
266
267
  }
267
268
  .resource-list .list-filter-wrapper .list-filter .filter-list .filter-item {
@@ -134,6 +134,7 @@
134
134
 
135
135
  .filter-list {
136
136
  display: flex;
137
+ flex-wrap: wrap;
137
138
  gap: 10px;
138
139
 
139
140
  .filter-item {
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, provide, computed, watch, nextTick, openBlock, createElementBlock, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, Fragment, renderList, createBlock, createVNode, unref, withCtx, createTextVNode } from "vue";
1
+ import { defineComponent, ref, provide, computed, watch, nextTick, onMounted, openBlock, createElementBlock, createCommentVNode, createElementVNode, normalizeClass, normalizeStyle, toDisplayString, Fragment, renderList, createBlock, createVNode, unref, withCtx, createTextVNode } from "vue";
2
2
  import { RadioGroup, Radio, Switch } from "@arco-design/web-vue";
3
3
  import { docThumbObjMap, docThumbArrMap } from "../utils/doc.js";
4
4
  import _sfc_main$4 from "../imageCrop/component.js";
@@ -234,7 +234,6 @@ const _sfc_main = defineComponent({
234
234
  thumbOptionIndex.value = index;
235
235
  };
236
236
  const openDialogMediaSelection = (type, index) => {
237
- console.log(type, index, "dkdk");
238
237
  thumbBannerModel.value = type || "thumb";
239
238
  thumbOptionIndex.value = index || 0;
240
239
  dialogMediaSelectionShow.value = true;
@@ -271,6 +270,16 @@ const _sfc_main = defineComponent({
271
270
  temp = [{ url: data[0].url, thumb: data[0].url }];
272
271
  }
273
272
  styleData.value.data = temp;
273
+ styleData.value.cover_url = data[0].url;
274
+ const getColors = getThemeColor(BASE_API, data[0].url);
275
+ getColors.then((themes) => {
276
+ styleData.value.cover_colorList = JSON.parse(JSON.stringify(themes));
277
+ styleData.value.cover_theme_color = `rgb(${themes[1]})`;
278
+ callback(styleData.value);
279
+ }).catch((e) => {
280
+ styleData.value.banner_theme_color = `rgb(255, 255, 255)`;
281
+ callback(styleData.value);
282
+ });
274
283
  } else if (thumbBannerModel.value === "banner") {
275
284
  styleData.value.banner_url = data[0].url;
276
285
  const getColors = getThemeColor(BASE_API, data[0].url);
@@ -338,10 +347,13 @@ const _sfc_main = defineComponent({
338
347
  });
339
348
  };
340
349
  const modelChange = () => {
350
+ styleData.value.cover_theme_color = "";
341
351
  if (!props.dataValue)
342
352
  return;
343
353
  if (styleData.value.model === oldData.value.model) {
344
354
  styleData.value.data = oldData.value.data;
355
+ styleData.value.cover_theme_color = oldData.value.cover_theme_color;
356
+ styleData.value.cover_colorList = oldData.value.cover_colorList;
345
357
  } else {
346
358
  styleData.value.data = [];
347
359
  }
@@ -354,6 +366,15 @@ const _sfc_main = defineComponent({
354
366
  },
355
367
  set(value) {
356
368
  styleData.value.banner_url = value.url;
369
+ styleData.value.cover_colorList = styleData.value.banner_colorList;
370
+ }
371
+ });
372
+ const cover = computed({
373
+ get() {
374
+ const { cover_theme_color } = styleData.value;
375
+ return cover_theme_color;
376
+ },
377
+ set() {
357
378
  }
358
379
  });
359
380
  const hasBanner = computed({
@@ -366,6 +387,15 @@ const _sfc_main = defineComponent({
366
387
  callback(styleData.value);
367
388
  }
368
389
  });
390
+ const hasCover = computed({
391
+ get() {
392
+ return !!cover.value;
393
+ },
394
+ set(value) {
395
+ styleData.value.cover = value;
396
+ callback(styleData.value);
397
+ }
398
+ });
369
399
  const pcBanner = computed({
370
400
  get() {
371
401
  const { pc_banner_url_info, pc_banner_url } = styleData.value;
@@ -378,6 +408,23 @@ const _sfc_main = defineComponent({
378
408
  const colorChange = (styleData2) => {
379
409
  callback(styleData2);
380
410
  };
411
+ onMounted(() => {
412
+ if (!styleData.value.cover_url) {
413
+ setTimeout(() => {
414
+ styleData.value.cover_url = styleData.value.data[0].url;
415
+ const getColors = getThemeColor(BASE_API, styleData.value.data[0].url);
416
+ getColors.then((themes) => {
417
+ styleData.value.cover_colorList = JSON.parse(JSON.stringify(themes));
418
+ styleData.value.cover_theme_color = `rgb(${themes[1]})`;
419
+ oldData.value = JSON.parse(JSON.stringify(styleData.value));
420
+ callback(styleData.value);
421
+ }).catch((e) => {
422
+ styleData.value.banner_theme_color = `rgb(255, 255, 255)`;
423
+ callback(styleData.value);
424
+ });
425
+ }, 700);
426
+ }
427
+ });
381
428
  return (_ctx, _cache) => {
382
429
  var _a, _b, _c, _d, _e, _f;
383
430
  return openBlock(), createElementBlock("div", {
@@ -470,7 +517,14 @@ const _sfc_main = defineComponent({
470
517
  ]),
471
518
  _: 1
472
519
  }, 8, ["modelValue"])
473
- ], 64)) : createCommentVNode("v-if", true)
520
+ ], 64)) : createCommentVNode("v-if", true),
521
+ hasCover.value ? (openBlock(), createBlock(_sfc_main$2, {
522
+ key: 3,
523
+ "style-data": styleData.value,
524
+ model: "cover",
525
+ style: { "margin-top": "10px" },
526
+ onChange: colorChange
527
+ }, null, 8, ["style-data"])) : createCommentVNode("v-if", true)
474
528
  ])
475
529
  ], 2),
476
530
  _ctx.mode === "doc" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
@@ -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,
@@ -110,9 +110,58 @@ function getSysRsPage(BASE_API, params) {
110
110
  params
111
111
  });
112
112
  }
113
+ function getDirectory(BASE_API, params) {
114
+ return request(BASE_API, {
115
+ url: "/poplar/v3/directories",
116
+ method: "get",
117
+ params
118
+ });
119
+ }
120
+ function useDirectory(options) {
121
+ const tree = vue.ref([]);
122
+ async function loadDirTree(parent_id) {
123
+ const params = parent_id ? { parent_id } : {};
124
+ const { code, message } = await getDirectory(options.BASE_API, params);
125
+ if (code === 0) {
126
+ if (!Array.isArray(message.data))
127
+ return [];
128
+ return message.data.map(({ alias, id }) => {
129
+ return {
130
+ title: alias,
131
+ key: id,
132
+ isLeaf: false,
133
+ children: []
134
+ };
135
+ });
136
+ }
137
+ return [];
138
+ }
139
+ async function init() {
140
+ const result = await loadDirTree();
141
+ if (!Array.isArray(result))
142
+ return;
143
+ tree.value = result;
144
+ }
145
+ async function loadMore(target) {
146
+ const children = await loadDirTree(target.key);
147
+ target.children = children;
148
+ if (children.length === 0)
149
+ target.isLeaf = true;
150
+ }
151
+ vue.onMounted(() => {
152
+ init();
153
+ });
154
+ return {
155
+ tree,
156
+ init,
157
+ loadMore
158
+ };
159
+ }
113
160
  exports["default"] = useAttachement;
114
161
  exports.getAttachmentsAll = getAttachmentsAll;
115
162
  exports.getAttachmentsMy = getAttachmentsMy;
116
163
  exports.getAttachmentsMyMessage = getAttachmentsMyMessage;
164
+ exports.getDirectory = getDirectory;
117
165
  exports.getSysRsByTag = getSysRsByTag;
118
166
  exports.getSysRsPage = getSysRsPage;
167
+ exports.useDirectory = useDirectory;
package/lib/index.css CHANGED
@@ -4619,6 +4619,7 @@
4619
4619
  }
4620
4620
  .resource-list .list-filter-wrapper .list-filter .filter-list {
4621
4621
  display: flex;
4622
+ flex-wrap: wrap;
4622
4623
  gap: 10px;
4623
4624
  }
4624
4625
  .resource-list .list-filter-wrapper .list-filter .filter-list .filter-item {
@@ -33,8 +33,9 @@ const _sfc_main = vue.defineComponent({
33
33
  return false;
34
34
  if (filterOptions == null ? void 0 : filterOptions.value) {
35
35
  const { mediaType, mediaTypeStrict } = filterOptions.value;
36
- if (mediaTypeStrict)
37
- return props.item.catalog === mediaType;
36
+ if (mediaTypeStrict) {
37
+ return mediaType.split(",").includes(props.item.catalog);
38
+ }
38
39
  }
39
40
  if (props.item.progress >= 0)
40
41
  return false;