|
|
@@ -86,7 +86,7 @@
|
|
|
" @click.stop="selectComponent(item)" :class="{ selected: selectedComponent === item }" />
|
|
|
<MediaAssetBoard v-if="item.type === 'mediaAsset'" :width="item.width * canvasScale"
|
|
|
:height="item.height * canvasScale" :media-id="item.mediaId" :selected="selectedComponent === item"
|
|
|
- v-model="item.mediaGroup" @resize="
|
|
|
+ v-model="item.mediaGroup" :border-radius="item.borderRadius || 0" @resize="
|
|
|
({ width, height }) => {
|
|
|
item.width = width / canvasScale;
|
|
|
item.height = height / canvasScale;
|
|
|
@@ -94,14 +94,15 @@
|
|
|
" @click.stop="selectComponent(item)" :class="{ selected: selectedComponent === item }" />
|
|
|
<LiveBoard v-if="item.type === 'live'" :width="item.width * canvasScale"
|
|
|
:height="item.height * canvasScale" :live-url="item.liveUrl" :play-audio="item.playAudio"
|
|
|
- :selected="selectedComponent === item" @resize="
|
|
|
+ :selected="selectedComponent === item" :border-radius="item.borderRadius || 0" @resize="
|
|
|
({ width, height }) => {
|
|
|
item.width = width / canvasScale;
|
|
|
item.height = height / canvasScale;
|
|
|
}
|
|
|
" @click.stop="selectComponent(item)" :class="{ selected: selectedComponent === item }" />
|
|
|
<WebPageBoard v-if="item.type === 'webPage'" :width="item.width * canvasScale"
|
|
|
- :height="item.height * canvasScale" :url="item.url" :selected="selectedComponent === item" @resize="
|
|
|
+ :height="item.height * canvasScale" :url="item.url" :selected="selectedComponent === item"
|
|
|
+ :border-radius="item.borderRadius || 0" @resize="
|
|
|
({ width, height }) => {
|
|
|
item.width = width / canvasScale;
|
|
|
item.height = height / canvasScale;
|
|
|
@@ -164,6 +165,9 @@
|
|
|
<el-option label="日期+时间 (YYYY-MM-DD HH:mm:ss)" value="date" />
|
|
|
</el-select>
|
|
|
</template>
|
|
|
+ <template v-else-if="key === 'borderRadius'">
|
|
|
+ <el-input-number v-model="selectedComponent[key]" :min="0" :max="100" :step="1" style="width: 100%" />
|
|
|
+ </template>
|
|
|
<template v-else>
|
|
|
<el-input v-model="selectedComponent[key]" />
|
|
|
</template>
|
|
|
@@ -376,8 +380,21 @@ function selectCanvasFromSidebar() {
|
|
|
function showEditableProp(key: string) {
|
|
|
// 明确排除 type 字段,防止被编辑
|
|
|
if (!selectedComponent.value) return false;
|
|
|
- // 对于文本和滚动文本组件,移除 'fontWeight' 属性
|
|
|
- if ((selectedComponent.value.type === 'text' || selectedComponent.value.type === 'scrollingText') && (key === 'fontWeight' || key === 'align')) {
|
|
|
+ // 对于文本、滚动文本和时钟组件,移除 'fontWeight' 和 'align' 属性
|
|
|
+ if (
|
|
|
+ (selectedComponent.value.type === 'text' || selectedComponent.value.type === 'scrollingText' || selectedComponent.value.type === 'clock') &&
|
|
|
+ (key === 'fontWeight' || key === 'align')
|
|
|
+ ) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ // 画布、文本、滚动文本和时钟组件不显示 borderRadius 属性
|
|
|
+ if (
|
|
|
+ (selectedComponent.value.type === 'canvas' ||
|
|
|
+ selectedComponent.value.type === 'text' ||
|
|
|
+ selectedComponent.value.type === 'scrollingText' ||
|
|
|
+ selectedComponent.value.type === 'clock') &&
|
|
|
+ key === 'borderRadius'
|
|
|
+ ) {
|
|
|
return false;
|
|
|
}
|
|
|
return !['type', 'depth'].includes(key);
|
|
|
@@ -573,7 +590,8 @@ function onCanvasDrop(e: DragEvent) {
|
|
|
y: y,
|
|
|
width: 120,
|
|
|
height: 120,
|
|
|
- depth: getMaxDepth() + 1
|
|
|
+ depth: getMaxDepth() + 1,
|
|
|
+ borderRadius: 0
|
|
|
};
|
|
|
editorContent.value.elements.push(newMediaAsset);
|
|
|
nextTick(() => selectComponent(newMediaAsset));
|
|
|
@@ -586,19 +604,21 @@ function onCanvasDrop(e: DragEvent) {
|
|
|
y: y,
|
|
|
width: 200,
|
|
|
height: 120,
|
|
|
- depth: getMaxDepth() + 1
|
|
|
+ depth: getMaxDepth() + 1,
|
|
|
+ borderRadius: 0
|
|
|
};
|
|
|
editorContent.value.elements.push(newLive);
|
|
|
nextTick(() => selectComponent(newLive));
|
|
|
} else if (dragType.value === 'webPage') {
|
|
|
const newWebPage = {
|
|
|
type: 'webPage',
|
|
|
- url: '',
|
|
|
+ url: 'https://example.com',
|
|
|
x: x,
|
|
|
y: y,
|
|
|
- width: 120,
|
|
|
- height: 120,
|
|
|
- depth: getMaxDepth() + 1
|
|
|
+ width: 300,
|
|
|
+ height: 200,
|
|
|
+ depth: getMaxDepth() + 1,
|
|
|
+ borderRadius: 0
|
|
|
};
|
|
|
editorContent.value.elements.push(newWebPage);
|
|
|
nextTick(() => selectComponent(newWebPage));
|