@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
@@ -1,5 +1,5 @@
1
- import { defineComponent, ref, computed, watch, nextTick, toRaw, openBlock, createElementBlock, Fragment, createElementVNode, withModifiers, createVNode, withCtx, renderList, createBlock, unref, normalizeStyle, createCommentVNode, renderSlot } from "vue";
2
- import { InputSearch, Select, Option, RangePicker } from "@arco-design/web-vue";
1
+ import { defineComponent, ref, computed, watch, nextTick, toRaw, openBlock, createElementBlock, Fragment, createElementVNode, withModifiers, createVNode, withCtx, renderList, createBlock, renderSlot, unref, createTextVNode, toDisplayString, normalizeStyle, createCommentVNode } from "vue";
2
+ import { InputGroup, Select, Option, Input, InputSearch, RangePicker, RadioGroup, Radio } from "@arco-design/web-vue";
3
3
  import _sfc_main$2 from "./components/filterItem.js";
4
4
  import _sfc_main$1 from "./components/FilterGroup.js";
5
5
  const _sfc_main = defineComponent({
@@ -37,9 +37,11 @@ const _sfc_main = defineComponent({
37
37
  });
38
38
  return _columns;
39
39
  });
40
- const getOptions = (item) => {
41
- return item.options ? item.options : [];
42
- };
40
+ const getOptions = computed(() => {
41
+ return (item) => {
42
+ return item.options ? item.options : [];
43
+ };
44
+ });
43
45
  const hasValue = computed(() => {
44
46
  return (key) => {
45
47
  var _a, _b;
@@ -76,7 +78,10 @@ const _sfc_main = defineComponent({
76
78
  _form[column.range] = rangeTemp[column.range];
77
79
  } else if (column.component === "select") {
78
80
  _form[column.key] = column.defaultValue || null;
79
- } else {
81
+ } else if (column.component === "input-group") {
82
+ _form[column.selectKey] = column.selectDefaultValue || "";
83
+ _form[column.inputKey] = column.inputDefaultValue || "";
84
+ } else if (column.component) {
80
85
  _form[column.key] = column.defaultValue || "";
81
86
  }
82
87
  });
@@ -178,17 +183,48 @@ const _sfc_main = defineComponent({
178
183
  active: hasValue.value(item.key)
179
184
  }, {
180
185
  default: withCtx(() => [
181
- item.component === "input" ? (openBlock(), createBlock(unref(InputSearch), {
182
- key: 0,
186
+ item.slot ? renderSlot(_ctx.$slots, item.slot, { key: 0 }) : item.component === "input-group" ? (openBlock(), createBlock(unref(InputGroup), { key: 1 }, {
187
+ default: withCtx(() => [
188
+ createVNode(unref(Select), {
189
+ modelValue: form.value[item.selectKey],
190
+ "onUpdate:modelValue": ($event) => form.value[item.selectKey] = $event,
191
+ "default-active-first-option": "",
192
+ style: { "width": "100px" }
193
+ }, {
194
+ default: withCtx(() => [
195
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.selectOptions, (option, idx) => {
196
+ return openBlock(), createBlock(unref(Option), {
197
+ key: idx,
198
+ value: option.value
199
+ }, {
200
+ default: withCtx(() => [
201
+ createTextVNode(toDisplayString(option.label), 1)
202
+ ]),
203
+ _: 2
204
+ }, 1032, ["value"]);
205
+ }), 128))
206
+ ]),
207
+ _: 2
208
+ }, 1032, ["modelValue", "onUpdate:modelValue"]),
209
+ createVNode(unref(Input), {
210
+ modelValue: form.value[item.inputKey],
211
+ "onUpdate:modelValue": ($event) => form.value[item.inputKey] = $event,
212
+ placeholder: item.placeholder ? item.placeholder : `\u8BF7\u8F93\u5165${item.inputLabel}`,
213
+ style: { "width": "180px" }
214
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])
215
+ ]),
216
+ _: 2
217
+ }, 1024)) : item.component === "input" ? (openBlock(), createBlock(unref(InputSearch), {
218
+ key: 2,
183
219
  modelValue: form.value[item.key],
184
220
  "onUpdate:modelValue": ($event) => form.value[item.key] = $event,
185
221
  style: normalizeStyle({ width: styleWidth(columnsMap.value[item.key]) }),
186
222
  "allow-clear": "",
187
223
  size: "medium",
188
- placeholder: `\u8BF7\u8F93\u5165${item.label}`
224
+ placeholder: item.placeholder ? item.placeholder : `\u8BF7\u8F93\u5165${item.label}`
189
225
  }, null, 8, ["modelValue", "onUpdate:modelValue", "style", "placeholder"])) : createCommentVNode("v-if", true),
190
226
  item.component === "select" ? (openBlock(), createBlock(unref(Select), {
191
- key: 1,
227
+ key: 3,
192
228
  modelValue: form.value[item.key],
193
229
  "onUpdate:modelValue": ($event) => form.value[item.key] = $event,
194
230
  "popup-container": "#base-filter-popup-container",
@@ -196,13 +232,13 @@ const _sfc_main = defineComponent({
196
232
  "allow-search": item.allowSearch,
197
233
  "default-active-first-option": false,
198
234
  style: normalizeStyle({ width: styleWidth(columnsMap.value[item.key]) }),
199
- placeholder: `\u8BF7\u9009\u62E9${item.label}`,
235
+ placeholder: item.placeholder ? item.placeholder : `\u8BF7\u9009\u62E9${item.label}`,
200
236
  onSearch: ($event) => handleSelectSearch($event, item),
201
237
  onPopupVisibleChange: ($event) => handleSelectPopupChange($event, item),
202
238
  onChange: ($event) => handleSelectChange($event, item)
203
239
  }, {
204
240
  default: withCtx(() => [
205
- (openBlock(true), createElementBlock(Fragment, null, renderList(getOptions(item), (opt) => {
241
+ (openBlock(true), createElementBlock(Fragment, null, renderList(getOptions.value(item), (opt) => {
206
242
  return openBlock(), createBlock(unref(Option), {
207
243
  key: opt.value,
208
244
  label: opt.label,
@@ -213,7 +249,7 @@ const _sfc_main = defineComponent({
213
249
  _: 2
214
250
  }, 1032, ["modelValue", "onUpdate:modelValue", "allow-search", "style", "placeholder", "onSearch", "onPopupVisibleChange", "onChange"])) : createCommentVNode("v-if", true),
215
251
  item.component === "range-picker" ? (openBlock(), createBlock(unref(RangePicker), {
216
- key: 2,
252
+ key: 4,
217
253
  modelValue: form.value[item.key].range,
218
254
  "onUpdate:modelValue": ($event) => form.value[item.key].range = $event,
219
255
  style: normalizeStyle({ width: styleWidth(form.value[item.key]) }),
@@ -224,7 +260,28 @@ const _sfc_main = defineComponent({
224
260
  "popup-container": "#base-filter-popup-container",
225
261
  onClick: _cache[1] || (_cache[1] = withModifiers(() => {
226
262
  }, ["stop"]))
227
- }, null, 8, ["modelValue", "onUpdate:modelValue", "style"])) : createCommentVNode("v-if", true)
263
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "style"])) : createCommentVNode("v-if", true),
264
+ item.component === "radio" ? (openBlock(), createBlock(unref(RadioGroup), {
265
+ key: 5,
266
+ modelValue: form.value[item.key],
267
+ "onUpdate:modelValue": ($event) => form.value[item.key] = $event,
268
+ type: "button"
269
+ }, {
270
+ default: withCtx(() => [
271
+ (openBlock(true), createElementBlock(Fragment, null, renderList(item.options || [], (option, idx) => {
272
+ return openBlock(), createBlock(unref(Radio), {
273
+ key: idx,
274
+ value: option.value
275
+ }, {
276
+ default: withCtx(() => [
277
+ createTextVNode(toDisplayString(option.label), 1)
278
+ ]),
279
+ _: 2
280
+ }, 1032, ["value"]);
281
+ }), 128))
282
+ ]),
283
+ _: 2
284
+ }, 1032, ["modelValue", "onUpdate:modelValue"])) : createCommentVNode("v-if", true)
228
285
  ]),
229
286
  _: 2
230
287
  }, 1032, ["active"]);
@@ -104,6 +104,12 @@ const _sfc_main = defineComponent({
104
104
  onCellMouseEnter: tableCellMouseEnter,
105
105
  onCellMouseLeave: tableCellMouseLeave
106
106
  }, {
107
+ "after-index": withCtx(() => [
108
+ renderSlot(_ctx.$slots, "after-index", {
109
+ row: element,
110
+ index
111
+ })
112
+ ]),
107
113
  batch: withCtx(() => [
108
114
  renderSlot(_ctx.$slots, "batch", {
109
115
  row: element,
@@ -128,6 +134,12 @@ const _sfc_main = defineComponent({
128
134
  onCellMouseEnter: tableCellMouseEnter,
129
135
  onCellMouseLeave: tableCellMouseLeave
130
136
  }, {
137
+ "after-index": withCtx(() => [
138
+ renderSlot(_ctx.$slots, "after-index", {
139
+ row: element,
140
+ index
141
+ })
142
+ ]),
131
143
  tip: withCtx(() => [
132
144
  renderSlot(_ctx.$slots, "tip", {
133
145
  row: element,
@@ -224,6 +236,12 @@ const _sfc_main = defineComponent({
224
236
  onCellMouseEnter: tableCellMouseEnter,
225
237
  onCellMouseLeave: tableCellMouseLeave
226
238
  }, {
239
+ "after-index": withCtx(() => [
240
+ renderSlot(_ctx.$slots, "after-index", {
241
+ row: item,
242
+ index
243
+ })
244
+ ]),
227
245
  batch: withCtx(() => [
228
246
  renderSlot(_ctx.$slots, "batch", {
229
247
  row: item,
@@ -248,6 +266,12 @@ const _sfc_main = defineComponent({
248
266
  onCellMouseEnter: tableCellMouseEnter,
249
267
  onCellMouseLeave: tableCellMouseLeave
250
268
  }, {
269
+ "after-index": withCtx(() => [
270
+ renderSlot(_ctx.$slots, "after-index", {
271
+ row: item,
272
+ index
273
+ })
274
+ ]),
251
275
  tip: withCtx(() => [
252
276
  renderSlot(_ctx.$slots, "tip", {
253
277
  row: item,
@@ -142,7 +142,8 @@ const _sfc_main = defineComponent({
142
142
  })
143
143
  ]),
144
144
  index: withCtx(() => [
145
- createElementVNode("span", _hoisted_1, toDisplayString(_ctx.index + 1), 1)
145
+ createElementVNode("span", _hoisted_1, toDisplayString(_ctx.index + 1), 1),
146
+ renderSlot(_ctx.$slots, "after-index")
146
147
  ]),
147
148
  tip: withCtx(() => [
148
149
  createCommentVNode(" \u5148\u6DFB\u52A0\u6587\u4EF6\u8D44\u6E90\uFF0C\u672A\u53D1\u5E03 "),
@@ -37,6 +37,12 @@ const _sfc_main = defineComponent({
37
37
  index: _ctx.index
38
38
  })
39
39
  ]),
40
+ "after-index": withCtx(() => [
41
+ renderSlot(_ctx.$slots, "after-index", {
42
+ row: _ctx.element,
43
+ index: _ctx.index
44
+ })
45
+ ]),
40
46
  batch: withCtx(() => [
41
47
  renderSlot(_ctx.$slots, "batch", {
42
48
  row: _ctx.item,
@@ -7,24 +7,72 @@ export declare type TypeAddMediaParam = {
7
7
  directory_id: number;
8
8
  size: number;
9
9
  };
10
+ declare type WaterMark = {
11
+ id: string;
12
+ position: string;
13
+ url: string;
14
+ title: string;
15
+ };
16
+ declare type UploadTemplate = {
17
+ watermark?: {
18
+ default?: WaterMark;
19
+ images: WaterMark[];
20
+ };
21
+ };
10
22
  export declare function getSize(value: number): string;
11
23
  export declare function addMedia(BASE_API: string, params: TypeAddMediaParam): Promise<import("axios").AxiosResponse<any, any>>;
12
24
  export declare function getMediaDetails(BASE_API: string, repoId: number, id: number): Promise<import("axios").AxiosResponse<any, any>>;
13
25
  export declare function reTranscodeMedia(BASE_API: string, media_id: number): Promise<import("axios").AxiosResponse<any, any>>;
14
26
  declare type UploadOptions = {
15
- noAddMedia: boolean;
27
+ noAddMedia?: boolean;
28
+ };
29
+ declare type UploadFileOptions = {
30
+ template?: UploadTemplate;
16
31
  };
17
32
  export default function useUpload(options?: UploadOptions): {
18
33
  list: import("vue").Ref<any[], any[]>;
19
- uploadFile: (BASE_API: string, file: any, dir: number | undefined, repoId: number, callback?: CallbackFunc | undefined) => void;
34
+ uploadFile: (BASE_API: string, file: any, dir: number | undefined, repoId: number, callback?: CallbackFunc | undefined, upOptions?: UploadFileOptions | undefined) => void;
20
35
  reTranscode: (BASE_API: string, file: any) => Promise<boolean>;
21
36
  transcodingFile: (BASE_API: string, file: any, repoId: number) => void;
22
37
  recordTaskStatusChange: (file: any, progress: number, isTrans?: boolean | undefined) => void;
23
38
  removeRecord: (file: any) => void;
24
39
  };
40
+ export declare function getWatermarkTemplate(BASE_API: string): Promise<import("axios").AxiosResponse<any, any>>;
25
41
  export declare function useUploadConfig(): {
26
42
  config: import("vue").Ref<any, any>;
43
+ template: import("vue").Ref<{
44
+ watermark?: {
45
+ default?: {
46
+ id: string;
47
+ position: string;
48
+ url: string;
49
+ title: string;
50
+ } | undefined;
51
+ images: {
52
+ id: string;
53
+ position: string;
54
+ url: string;
55
+ title: string;
56
+ }[];
57
+ } | undefined;
58
+ }, UploadTemplate | {
59
+ watermark?: {
60
+ default?: {
61
+ id: string;
62
+ position: string;
63
+ url: string;
64
+ title: string;
65
+ } | undefined;
66
+ images: {
67
+ id: string;
68
+ position: string;
69
+ url: string;
70
+ title: string;
71
+ }[];
72
+ } | undefined;
73
+ }>;
27
74
  checkFileSizeOutLimit: (file: File, callback: (msg: string) => void) => boolean;
28
75
  initUploadConfig: (BASE_API: string, domainId: number) => Promise<void>;
76
+ initTemplate: (BASE_API: string) => Promise<void>;
29
77
  };
30
78
  export {};
@@ -73,7 +73,7 @@ function useUpload(options) {
73
73
  list.value = originList;
74
74
  }
75
75
  };
76
- const uploadFile = (BASE_API, file, dir = 0, repoId, callback) => {
76
+ const uploadFile = (BASE_API, file, dir = 0, repoId, callback, upOptions) => {
77
77
  const newFile = {
78
78
  id: file.id || generateUUID(),
79
79
  sig_id: file.sig_id || generateUUID(),
@@ -93,18 +93,24 @@ function useUpload(options) {
93
93
  };
94
94
  const uploading = upload.start(progress);
95
95
  uploading.then(async (url) => {
96
+ var _a;
96
97
  if (options == null ? void 0 : options.noAddMedia) {
97
98
  recordTaskStatusChange({ ...newFile, status: 0, url }, 1);
98
99
  callback && callback({ ...newFile, url }, "success");
99
100
  return;
100
101
  }
102
+ const params = {};
103
+ if ((_a = upOptions == null ? void 0 : upOptions.template) == null ? void 0 : _a.watermark) {
104
+ params.watermark = upOptions.template.watermark.default;
105
+ }
101
106
  const { code, message } = await addMedia(BASE_API, {
102
107
  url,
103
108
  size: newFile.size,
104
109
  directory_id: dir,
105
110
  repository_id: repoId,
106
111
  catalog: newFile.type,
107
- alias: newFile.name
112
+ alias: newFile.name,
113
+ ...params
108
114
  });
109
115
  if (code !== 0) {
110
116
  console.log("\u{1F525}\u{1F525}\u{1F525}\u{1F525}\u{1F525} \u4E0A\u4F20\u5931\u8D25\uFF1A", newFile.name, code, message);
@@ -194,9 +200,16 @@ function getConfiguration(BASE_API, params) {
194
200
  params
195
201
  });
196
202
  }
203
+ function getWatermarkTemplate(BASE_API) {
204
+ return request(BASE_API, {
205
+ url: `/poplar/v2/material/image/watermark`,
206
+ method: "get"
207
+ });
208
+ }
197
209
  function useUploadConfig() {
198
210
  const { get, set, remove } = useLocalstorage("LOCAL_UPLOAD_CONFIG");
199
211
  const config = ref(get() || {});
212
+ const template = ref({});
200
213
  async function initUploadConfig(BASE_API, domainId) {
201
214
  if (config.value.size_config_enabled != null)
202
215
  return;
@@ -245,11 +258,37 @@ function useUploadConfig() {
245
258
  );
246
259
  return false;
247
260
  }
261
+ async function initTemplate(BASE_API) {
262
+ try {
263
+ const { code, message } = await getWatermarkTemplate(BASE_API);
264
+ if (code !== 0)
265
+ return;
266
+ if (message) {
267
+ let defaultWaterMark;
268
+ if (Array.isArray(message.images)) {
269
+ message.images.forEach((item) => {
270
+ if (message.default === item.id)
271
+ defaultWaterMark = item;
272
+ });
273
+ }
274
+ template.value = {
275
+ watermark: {
276
+ default: defaultWaterMark,
277
+ images: message.images
278
+ }
279
+ };
280
+ }
281
+ } catch (e) {
282
+ console.error(e);
283
+ }
284
+ }
248
285
  window.addEventListener("beforeunload", remove, false);
249
286
  return {
250
287
  config,
288
+ template,
251
289
  checkFileSizeOutLimit,
252
- initUploadConfig
290
+ initUploadConfig,
291
+ initTemplate
253
292
  };
254
293
  }
255
- export { addMedia, useUpload as default, getMediaDetails, getSize, reTranscodeMedia, useUploadConfig };
294
+ export { addMedia, useUpload as default, getMediaDetails, getSize, getWatermarkTemplate, reTranscodeMedia, useUploadConfig };
package/es/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;
@@ -1,6 +1,6 @@
1
- import { defineComponent, inject, computed, openBlock, createBlock, withCtx, renderSlot, createElementVNode, createVNode, unref, createElementBlock, toDisplayString, createCommentVNode, Fragment, renderList } from "vue";
1
+ import { defineComponent, inject, computed, onMounted, openBlock, createBlock, withCtx, renderSlot, createElementVNode, createVNode, unref, createElementBlock, toDisplayString, createCommentVNode, Fragment, renderList } from "vue";
2
2
  import _sfc_main$2 from "./Upload.js";
3
- import useUpload from "../../../../hooks/useUpload.js";
3
+ import useUpload, { useUploadConfig } from "../../../../hooks/useUpload.js";
4
4
  import _sfc_main$1 from "../ListWraper.js";
5
5
  const _hoisted_1 = { class: "list-upload" };
6
6
  const _hoisted_2 = { class: "list-content" };
@@ -22,6 +22,7 @@ const _sfc_main = defineComponent({
22
22
  var _a;
23
23
  return (_a = userInfo == null ? void 0 : userInfo.value) == null ? void 0 : _a.repository_id;
24
24
  });
25
+ const { template, initTemplate } = useUploadConfig();
25
26
  const { list, uploadFile, reTranscode, transcodingFile, removeRecord } = useUpload();
26
27
  function handleChange(file) {
27
28
  if (!baseAPI || !repoId.value)
@@ -31,7 +32,8 @@ const _sfc_main = defineComponent({
31
32
  file.file,
32
33
  0,
33
34
  repoId.value,
34
- (media) => transcodingFile(baseAPI, media, repoId.value)
35
+ (media) => transcodingFile(baseAPI, media, repoId.value),
36
+ { template: template.value }
35
37
  );
36
38
  }
37
39
  async function handleOptions(e) {
@@ -54,6 +56,9 @@ const _sfc_main = defineComponent({
54
56
  removeRecord(e.item);
55
57
  }
56
58
  }
59
+ onMounted(() => {
60
+ initTemplate(baseAPI);
61
+ });
57
62
  return (_ctx, _cache) => {
58
63
  return openBlock(), createBlock(_sfc_main$1, null, {
59
64
  "footer-extra": withCtx(() => [
@@ -1,6 +1,6 @@
1
1
  import { defineComponent, inject, computed, ref, watch, onMounted, openBlock, createElementBlock, createCommentVNode, createElementVNode, withDirectives, createVNode, unref, withModifiers, withCtx, createTextVNode, vShow, toDisplayString, Fragment, renderList, createBlock, normalizeClass } from "vue";
2
2
  import { Button, Input, Dropdown, Doption, TreeSelect, Select, Option, RangePicker } from "@arco-design/web-vue";
3
- import { IconCaretDown, IconUpload } from "@arco-design/web-vue/es/icon";
3
+ import { IconCaretDown, IconRefresh, IconUpload } from "@arco-design/web-vue/es/icon";
4
4
  import useSelection from "../../../../hooks/useSelection.js";
5
5
  import { useDirectory } from "../../../../hooks/useAttachement.js";
6
6
  import { RESOURCE_SOURCE_OPTIONS, RESOURCE_CATALOG_OPTIONS } from "../../../../utils/typeMap.js";
@@ -45,10 +45,12 @@ const _hoisted_14 = ["onClick"];
45
45
  const _sfc_main = defineComponent({
46
46
  __name: "Filter",
47
47
  props: {
48
+ smallScreen: { type: Boolean },
48
49
  disableUploadBy: { type: Boolean }
49
50
  },
50
51
  emits: ["upload", "change"],
51
52
  setup(__props, { expose: __expose, emit: __emit }) {
53
+ var _a, _b, _c;
52
54
  const props = __props;
53
55
  const emits = __emit;
54
56
  const userInfo = inject("userInfo");
@@ -62,8 +64,7 @@ const _sfc_main = defineComponent({
62
64
  hiddenElementList,
63
65
  visible,
64
66
  show,
65
- hide,
66
- refreshLayout
67
+ hide
67
68
  } = useResponsiveFilter(filterItemsRef);
68
69
  const { options, loading, load, loadMore, handleSearch } = useSelection({
69
70
  labelStr: "alias",
@@ -98,7 +99,17 @@ const _sfc_main = defineComponent({
98
99
  sf: "",
99
100
  directory_id: void 0
100
101
  };
101
- const filter = ref(JSON.parse(JSON.stringify(originFilter)));
102
+ if ((_a = filterOptions == null ? void 0 : filterOptions.value) == null ? void 0 : _a.mediaTypeStrict) {
103
+ originFilter.catalog = filterOptions.value.mediaType.split(",");
104
+ }
105
+ const filter = ref(
106
+ JSON.parse(
107
+ JSON.stringify({
108
+ ...originFilter,
109
+ catalog: ((_c = (_b = filterOptions == null ? void 0 : filterOptions.value) == null ? void 0 : _b.mediaType) == null ? void 0 : _c.split(",")) || []
110
+ })
111
+ )
112
+ );
102
113
  const handleReset = () => {
103
114
  filter.value = JSON.parse(JSON.stringify(originFilter));
104
115
  };
@@ -177,27 +188,18 @@ const _sfc_main = defineComponent({
177
188
  }
178
189
  }
179
190
  emits("change", result);
180
- refreshLayout();
181
191
  },
182
192
  { deep: true, immediate: true }
183
193
  );
184
194
  onMounted(() => {
185
- var _a;
186
195
  load();
187
- if ((_a = filterOptions == null ? void 0 : filterOptions.value) == null ? void 0 : _a.mediaType) {
188
- const initialCatalog = filterOptions.value.mediaType.split(",");
189
- filter.value.catalog = initialCatalog;
190
- if (filterOptions.value.mediaTypeStrict) {
191
- originFilter.catalog = initialCatalog;
192
- }
193
- }
194
196
  });
195
197
  __expose({
196
198
  filter,
197
199
  handleReset
198
200
  });
199
201
  return (_ctx, _cache) => {
200
- var _a;
202
+ var _a2;
201
203
  return openBlock(), createElementBlock("div", _hoisted_1, [
202
204
  createCommentVNode(" Use filterItemsRef's parentElement as the container for boundary checks "),
203
205
  createElementVNode("div", _hoisted_2, [
@@ -220,7 +222,7 @@ const _sfc_main = defineComponent({
220
222
  }, {
221
223
  default: withCtx(() => [
222
224
  createElementVNode("span", _hoisted_4, [
223
- _cache[10] || (_cache[10] = createTextVNode(" \u66F4\u591A\u7B5B\u9009 ")),
225
+ _cache[11] || (_cache[11] = createTextVNode(" \u66F4\u591A ")),
224
226
  createVNode(unref(IconCaretDown))
225
227
  ])
226
228
  ]),
@@ -253,13 +255,13 @@ const _sfc_main = defineComponent({
253
255
  }, {
254
256
  content: withCtx(() => [
255
257
  createVNode(unref(Doption), { value: 0 }, {
256
- default: withCtx(() => _cache[11] || (_cache[11] = [
258
+ default: withCtx(() => _cache[12] || (_cache[12] = [
257
259
  createTextVNode("\u7CBE\u51C6\u641C")
258
260
  ])),
259
261
  _: 1
260
262
  }),
261
263
  createVNode(unref(Doption), { value: 1 }, {
262
- default: withCtx(() => _cache[12] || (_cache[12] = [
264
+ default: withCtx(() => _cache[13] || (_cache[13] = [
263
265
  createTextVNode("\u6A21\u7CCA\u641C")
264
266
  ])),
265
267
  _: 1
@@ -291,15 +293,22 @@ const _sfc_main = defineComponent({
291
293
  title: "alias",
292
294
  key: "id"
293
295
  },
294
- "allow-clear": ""
295
- }, null, 8, ["modelValue", "data"])
296
+ "allow-clear": "",
297
+ "allow-search": "",
298
+ "filter-tree-node": (searchValue, nodeData) => {
299
+ console.log(nodeData);
300
+ if (!nodeData.alias)
301
+ return false;
302
+ return nodeData.alias.toLowerCase().indexOf(searchValue.toLowerCase()) > -1;
303
+ }
304
+ }, null, 8, ["modelValue", "data", "filter-tree-node"])
296
305
  ]),
297
306
  createCommentVNode(" \u7D20\u6750\u7C7B\u578B "),
298
307
  createElementVNode("div", _hoisted_7, [
299
308
  createVNode(unref(Select), {
300
309
  modelValue: filter.value.catalog,
301
310
  "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => filter.value.catalog = $event),
302
- disabled: (_a = unref(filterOptions)) == null ? void 0 : _a.mediaTypeStrict,
311
+ disabled: (_a2 = unref(filterOptions)) == null ? void 0 : _a2.mediaTypeStrict,
303
312
  "popup-container": "#resource-filter-pannel",
304
313
  "allow-clear": "",
305
314
  placeholder: "\u7C7B\u578B",
@@ -377,30 +386,50 @@ const _sfc_main = defineComponent({
377
386
  createElementVNode("div", _hoisted_11, [
378
387
  createCommentVNode(" \u91CD\u7F6E\u6309\u94AE - Wrap in filter-item to be managed by the hook "),
379
388
  withDirectives(createElementVNode("div", _hoisted_12, [
380
- createVNode(unref(Button), {
389
+ _ctx.smallScreen ? (openBlock(), createBlock(unref(Button), {
390
+ key: 0,
391
+ type: "text",
392
+ onClick: handleReset
393
+ }, {
394
+ icon: withCtx(() => [
395
+ createVNode(unref(IconRefresh))
396
+ ]),
397
+ _: 1
398
+ })) : (openBlock(), createBlock(unref(Button), {
399
+ key: 1,
381
400
  type: "text",
382
401
  onClick: handleReset
383
402
  }, {
384
- default: withCtx(() => _cache[13] || (_cache[13] = [
403
+ default: withCtx(() => _cache[14] || (_cache[14] = [
385
404
  createTextVNode(" \u91CD\u7F6E ")
386
405
  ])),
387
406
  _: 1
388
- })
407
+ }))
389
408
  ], 512), [
390
409
  [vShow, !isEmpty.value]
391
410
  ]),
392
- createVNode(unref(Button), {
411
+ _ctx.smallScreen ? (openBlock(), createBlock(unref(Button), {
412
+ key: 0,
393
413
  type: "primary",
394
414
  onClick: _cache[9] || (_cache[9] = ($event) => emits("upload"))
415
+ }, {
416
+ icon: withCtx(() => [
417
+ createVNode(unref(IconUpload))
418
+ ]),
419
+ _: 1
420
+ })) : (openBlock(), createBlock(unref(Button), {
421
+ key: 1,
422
+ type: "primary",
423
+ onClick: _cache[10] || (_cache[10] = ($event) => emits("upload"))
395
424
  }, {
396
425
  icon: withCtx(() => [
397
426
  createVNode(unref(IconUpload))
398
427
  ]),
399
428
  default: withCtx(() => [
400
- _cache[14] || (_cache[14] = createTextVNode(" \u4E0A\u4F20 "))
429
+ _cache[15] || (_cache[15] = createTextVNode(" \u4E0A\u4F20 "))
401
430
  ]),
402
431
  _: 1
403
- })
432
+ }))
404
433
  ])
405
434
  ]),
406
435
  searchInput.value ? (openBlock(), createElementBlock("div", _hoisted_13, [
@@ -27,14 +27,14 @@ const _sfc_main = defineComponent({
27
27
  } = useAttachement({ key: props.activeKey, BASE_API });
28
28
  watch(() => props.activeKey, changeKey);
29
29
  const listWrapper = ref(null);
30
- const showPageSize = ref(true);
30
+ const smallScreen = ref(false);
31
31
  watch(
32
32
  () => {
33
33
  var _a;
34
34
  return (_a = listWrapper.value) == null ? void 0 : _a.offsetWidth;
35
35
  },
36
36
  (val) => {
37
- showPageSize.value = !(val && val < 480);
37
+ smallScreen.value = !!(val && val < 600);
38
38
  },
39
39
  { immediate: true }
40
40
  );
@@ -51,9 +51,10 @@ const _sfc_main = defineComponent({
51
51
  ]),
52
52
  header: withCtx(() => [
53
53
  createVNode(_sfc_main$2, {
54
+ smallScreen: smallScreen.value,
54
55
  onChange: unref(changeFilter),
55
56
  onUpload: _cache[0] || (_cache[0] = ($event) => emits("change-tab", "local"))
56
- }, null, 8, ["onChange"])
57
+ }, null, 8, ["smallScreen", "onChange"])
57
58
  ]),
58
59
  footer: withCtx(() => [
59
60
  createVNode(unref(Pagination), {
@@ -62,7 +63,7 @@ const _sfc_main = defineComponent({
62
63
  total: unref(total),
63
64
  "page-size": unref(limit),
64
65
  "show-total": "",
65
- "show-page-size": showPageSize.value,
66
+ "show-page-size": !smallScreen.value,
66
67
  "base-size": 3,
67
68
  "buffer-size": 1,
68
69
  onChange: _cache[2] || (_cache[2] = (e) => unref(changePage)((e - 1) * unref(limit))),