@cmstops/pro-compo 3.9.0 → 3.9.1-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,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 }, [
|
|
@@ -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 }, [
|