@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.
@@ -3,6 +3,7 @@ var vue = require("vue");
3
3
  var webVue = require("@arco-design/web-vue");
4
4
  var icon = require("@arco-design/web-vue/es/icon");
5
5
  var useSelection = require("../../../../hooks/useSelection.js");
6
+ var useAttachement = require("../../../../hooks/useAttachement.js");
6
7
  var typeMap = require("../../../../utils/typeMap.js");
7
8
  var selectionApis = require("../../../scripts/selectionApis.js");
8
9
  var resource = require("../../../../utils/resource.js");
@@ -10,7 +11,10 @@ const _hoisted_1 = { class: "list-filter-wrapper" };
10
11
  const _hoisted_2 = { class: "list-filter" };
11
12
  const _hoisted_3 = { class: "filter-list" };
12
13
  const _hoisted_4 = { style: { "width": "200px" } };
13
- const _hoisted_5 = { class: "filter-item" };
14
+ const _hoisted_5 = {
15
+ class: "filter-item",
16
+ style: { "width": "200px" }
17
+ };
14
18
  const _hoisted_6 = { class: "filter-item" };
15
19
  const _hoisted_7 = {
16
20
  key: 0,
@@ -54,15 +58,19 @@ const _sfc_main = vue.defineComponent({
54
58
  });
55
59
  const resourceSource = typeMap.RESOURCE_SOURCE_OPTIONS;
56
60
  const resourceCatalog = typeMap.RESOURCE_CATALOG_OPTIONS;
61
+ const { tree, loadMore: loadDirMore } = useAttachement.useDirectory({
62
+ BASE_API: baseAPI
63
+ });
57
64
  const originFilter = {
58
- catalog: "",
65
+ catalog: [],
59
66
  source: "",
60
67
  created_begin: "",
61
68
  created_end: "",
62
69
  keyword: "",
63
70
  precise_keyword: "",
64
71
  upload_by: null,
65
- sf: ""
72
+ sf: "",
73
+ directory_id: void 0
66
74
  };
67
75
  const filter = vue.ref(JSON.parse(JSON.stringify(originFilter)));
68
76
  const handleReset = () => {
@@ -134,6 +142,8 @@ const _sfc_main = vue.defineComponent({
134
142
  });
135
143
  if (!result.catalog)
136
144
  result.catalog = "image,video,audio";
145
+ else
146
+ result.catalog = result.catalog.join(",");
137
147
  emits("change", result);
138
148
  },
139
149
  { deep: true, immediate: true }
@@ -143,9 +153,9 @@ const _sfc_main = vue.defineComponent({
143
153
  () => {
144
154
  var _a;
145
155
  if ((_a = filterOptions == null ? void 0 : filterOptions.value) == null ? void 0 : _a.mediaType) {
146
- filter.value.catalog = filterOptions == null ? void 0 : filterOptions.value.mediaType;
156
+ filter.value.catalog = filterOptions == null ? void 0 : filterOptions.value.mediaType.split(",");
147
157
  if (filterOptions == null ? void 0 : filterOptions.value.mediaTypeStrict) {
148
- originFilter.catalog = filterOptions == null ? void 0 : filterOptions.value.mediaType;
158
+ originFilter.catalog = filterOptions == null ? void 0 : filterOptions.value.mediaType.split(",");
149
159
  }
150
160
  }
151
161
  },
@@ -176,13 +186,13 @@ const _sfc_main = vue.defineComponent({
176
186
  }, {
177
187
  content: vue.withCtx(() => [
178
188
  vue.createVNode(vue.unref(webVue.Doption), { value: 0 }, {
179
- default: vue.withCtx(() => _cache[7] || (_cache[7] = [
189
+ default: vue.withCtx(() => _cache[8] || (_cache[8] = [
180
190
  vue.createTextVNode("\u7CBE\u51C6\u641C")
181
191
  ])),
182
192
  _: 1
183
193
  }),
184
194
  vue.createVNode(vue.unref(webVue.Doption), { value: 1 }, {
185
- default: vue.withCtx(() => _cache[8] || (_cache[8] = [
195
+ default: vue.withCtx(() => _cache[9] || (_cache[9] = [
186
196
  vue.createTextVNode("\u6A21\u7CCA\u641C")
187
197
  ])),
188
198
  _: 1
@@ -209,7 +219,8 @@ const _sfc_main = vue.defineComponent({
209
219
  "onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => filter.value.catalog = $event),
210
220
  disabled: (_a = vue.unref(filterOptions)) == null ? void 0 : _a.mediaTypeStrict,
211
221
  "allow-clear": "",
212
- placeholder: "\u7C7B\u578B"
222
+ placeholder: "\u7C7B\u578B",
223
+ multiple: ""
213
224
  }, {
214
225
  default: vue.withCtx(() => [
215
226
  (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(resourceCatalog), (item) => {
@@ -223,10 +234,20 @@ const _sfc_main = vue.defineComponent({
223
234
  _: 1
224
235
  }, 8, ["modelValue", "disabled"])
225
236
  ]),
237
+ vue.createCommentVNode(" \u76EE\u5F55 "),
238
+ vue.createVNode(vue.unref(webVue.TreeSelect), {
239
+ modelValue: filter.value.directory_id,
240
+ "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => filter.value.directory_id = $event),
241
+ data: vue.unref(tree),
242
+ "load-more": vue.unref(loadDirMore),
243
+ placeholder: "\u8BF7\u9009\u62E9\u76EE\u5F55",
244
+ style: { "width": "180px" },
245
+ "allow-clear": ""
246
+ }, null, 8, ["modelValue", "data", "load-more"]),
226
247
  vue.createCommentVNode(" \u65F6\u95F4\u8303\u56F4 "),
227
248
  vue.createVNode(vue.unref(webVue.RangePicker), {
228
249
  modelValue: rangeTime.value,
229
- "onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => rangeTime.value = $event),
250
+ "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => rangeTime.value = $event),
230
251
  "allow-clear": "",
231
252
  style: { "width": "240px" }
232
253
  }, null, 8, ["modelValue"]),
@@ -234,7 +255,7 @@ const _sfc_main = vue.defineComponent({
234
255
  vue.createElementVNode("div", _hoisted_6, [
235
256
  vue.createVNode(vue.unref(webVue.Select), {
236
257
  modelValue: filter.value.source,
237
- "onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => filter.value.source = $event),
258
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => filter.value.source = $event),
238
259
  "allow-clear": "",
239
260
  placeholder: "\u6765\u6E90"
240
261
  }, {
@@ -254,7 +275,7 @@ const _sfc_main = vue.defineComponent({
254
275
  !_ctx.disableUploadBy ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
255
276
  vue.createVNode(vue.unref(webVue.Select), {
256
277
  modelValue: filter.value.upload_by,
257
- "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => filter.value.upload_by = $event),
278
+ "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => filter.value.upload_by = $event),
258
279
  "allow-clear": "",
259
280
  placeholder: "\u4E0A\u4F20\u4EBA",
260
281
  loading: vue.unref(loading),
@@ -279,7 +300,7 @@ const _sfc_main = vue.defineComponent({
279
300
  type: "text",
280
301
  onClick: handleReset
281
302
  }, {
282
- default: vue.withCtx(() => _cache[9] || (_cache[9] = [
303
+ default: vue.withCtx(() => _cache[10] || (_cache[10] = [
283
304
  vue.createTextVNode(" \u91CD\u7F6E ")
284
305
  ])),
285
306
  _: 1
@@ -288,13 +309,13 @@ const _sfc_main = vue.defineComponent({
288
309
  vue.createElementVNode("div", _hoisted_8, [
289
310
  vue.createVNode(vue.unref(webVue.Button), {
290
311
  type: "primary",
291
- onClick: _cache[6] || (_cache[6] = ($event) => emits("upload"))
312
+ onClick: _cache[7] || (_cache[7] = ($event) => emits("upload"))
292
313
  }, {
293
314
  icon: vue.withCtx(() => [
294
315
  vue.createVNode(vue.unref(icon.IconUpload))
295
316
  ]),
296
317
  default: vue.withCtx(() => [
297
- _cache[10] || (_cache[10] = vue.createTextVNode(" \u4E0A\u4F20 "))
318
+ _cache[11] || (_cache[11] = vue.createTextVNode(" \u4E0A\u4F20 "))
298
319
  ]),
299
320
  _: 1
300
321
  })
@@ -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 {
@@ -235,7 +235,6 @@ const _sfc_main = vue.defineComponent({
235
235
  thumbOptionIndex.value = index2;
236
236
  };
237
237
  const openDialogMediaSelection = (type, index2) => {
238
- console.log(type, index2, "dkdk");
239
238
  thumbBannerModel.value = type || "thumb";
240
239
  thumbOptionIndex.value = index2 || 0;
241
240
  dialogMediaSelectionShow.value = true;
@@ -272,6 +271,16 @@ const _sfc_main = vue.defineComponent({
272
271
  temp = [{ url: data[0].url, thumb: data[0].url }];
273
272
  }
274
273
  styleData.value.data = temp;
274
+ styleData.value.cover_url = data[0].url;
275
+ const getColors = index.getThemeColor(BASE_API, data[0].url);
276
+ getColors.then((themes) => {
277
+ styleData.value.cover_colorList = JSON.parse(JSON.stringify(themes));
278
+ styleData.value.cover_theme_color = `rgb(${themes[1]})`;
279
+ callback(styleData.value);
280
+ }).catch((e) => {
281
+ styleData.value.banner_theme_color = `rgb(255, 255, 255)`;
282
+ callback(styleData.value);
283
+ });
275
284
  } else if (thumbBannerModel.value === "banner") {
276
285
  styleData.value.banner_url = data[0].url;
277
286
  const getColors = index.getThemeColor(BASE_API, data[0].url);
@@ -339,10 +348,13 @@ const _sfc_main = vue.defineComponent({
339
348
  });
340
349
  };
341
350
  const modelChange = () => {
351
+ styleData.value.cover_theme_color = "";
342
352
  if (!props.dataValue)
343
353
  return;
344
354
  if (styleData.value.model === oldData.value.model) {
345
355
  styleData.value.data = oldData.value.data;
356
+ styleData.value.cover_theme_color = oldData.value.cover_theme_color;
357
+ styleData.value.cover_colorList = oldData.value.cover_colorList;
346
358
  } else {
347
359
  styleData.value.data = [];
348
360
  }
@@ -355,6 +367,15 @@ const _sfc_main = vue.defineComponent({
355
367
  },
356
368
  set(value) {
357
369
  styleData.value.banner_url = value.url;
370
+ styleData.value.cover_colorList = styleData.value.banner_colorList;
371
+ }
372
+ });
373
+ const cover = vue.computed({
374
+ get() {
375
+ const { cover_theme_color } = styleData.value;
376
+ return cover_theme_color;
377
+ },
378
+ set() {
358
379
  }
359
380
  });
360
381
  const hasBanner = vue.computed({
@@ -367,6 +388,15 @@ const _sfc_main = vue.defineComponent({
367
388
  callback(styleData.value);
368
389
  }
369
390
  });
391
+ const hasCover = vue.computed({
392
+ get() {
393
+ return !!cover.value;
394
+ },
395
+ set(value) {
396
+ styleData.value.cover = value;
397
+ callback(styleData.value);
398
+ }
399
+ });
370
400
  const pcBanner = vue.computed({
371
401
  get() {
372
402
  const { pc_banner_url_info, pc_banner_url } = styleData.value;
@@ -379,6 +409,23 @@ const _sfc_main = vue.defineComponent({
379
409
  const colorChange = (styleData2) => {
380
410
  callback(styleData2);
381
411
  };
412
+ vue.onMounted(() => {
413
+ if (!styleData.value.cover_url) {
414
+ setTimeout(() => {
415
+ styleData.value.cover_url = styleData.value.data[0].url;
416
+ const getColors = index.getThemeColor(BASE_API, styleData.value.data[0].url);
417
+ getColors.then((themes) => {
418
+ styleData.value.cover_colorList = JSON.parse(JSON.stringify(themes));
419
+ styleData.value.cover_theme_color = `rgb(${themes[1]})`;
420
+ oldData.value = JSON.parse(JSON.stringify(styleData.value));
421
+ callback(styleData.value);
422
+ }).catch((e) => {
423
+ styleData.value.banner_theme_color = `rgb(255, 255, 255)`;
424
+ callback(styleData.value);
425
+ });
426
+ }, 700);
427
+ }
428
+ });
382
429
  return (_ctx, _cache) => {
383
430
  var _a, _b, _c, _d, _e, _f;
384
431
  return vue.openBlock(), vue.createElementBlock("div", {
@@ -471,7 +518,14 @@ const _sfc_main = vue.defineComponent({
471
518
  ]),
472
519
  _: 1
473
520
  }, 8, ["modelValue"])
474
- ], 64)) : vue.createCommentVNode("v-if", true)
521
+ ], 64)) : vue.createCommentVNode("v-if", true),
522
+ hasCover.value ? (vue.openBlock(), vue.createBlock(colorPalette, {
523
+ key: 3,
524
+ "style-data": styleData.value,
525
+ model: "cover",
526
+ style: { "margin-top": "10px" },
527
+ onChange: colorChange
528
+ }, null, 8, ["style-data"])) : vue.createCommentVNode("v-if", true)
475
529
  ])
476
530
  ], 2),
477
531
  _ctx.mode === "doc" ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cmstops/pro-compo",
3
- "version": "0.3.99",
3
+ "version": "3.0.0-rc.0",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "vue",