|
|
@@ -47,7 +47,7 @@
|
|
|
<span class="c-grid-form__label u-required">位置</span>
|
|
|
<el-select
|
|
|
v-model="position"
|
|
|
- class="u-width--xs"
|
|
|
+ class="u-width--sm"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="option in positionOptions"
|
|
|
@@ -56,6 +56,31 @@
|
|
|
:value="option.value"
|
|
|
/>
|
|
|
</el-select>
|
|
|
+ <span class="c-grid-form__label u-required">字体颜色</span>
|
|
|
+ <el-select
|
|
|
+ v-model="textColor"
|
|
|
+ class="u-width--sm"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="option in textColorOptions"
|
|
|
+ :key="option.value"
|
|
|
+ :label="option.label"
|
|
|
+ :value="option.value"
|
|
|
+ :style="{ color: option.color || option.value }"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ <span class="c-grid-form__label u-required">背景颜色</span>
|
|
|
+ <el-select
|
|
|
+ v-model="textBackgroundColor"
|
|
|
+ class="u-width--sm"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="option in textBackgroundColorOptions"
|
|
|
+ :key="option.value"
|
|
|
+ :label="option.label"
|
|
|
+ :value="option.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
<span class="c-grid-form__label">失效时间</span>
|
|
|
<el-date-picker
|
|
|
v-model="endDateTime"
|
|
|
@@ -105,6 +130,16 @@
|
|
|
<div class="l-flex--row c-grid-form__option c-grid-form__text">{{ selectedDeviceName }}</div>
|
|
|
<span class="c-grid-form__label">失效时间:</span>
|
|
|
<div class="l-flex--row c-grid-form__option c-grid-form__text">{{ endDateTime || '不限定' }}</div>
|
|
|
+ <div class="c-grid-form__row c-preview-broadcast u-relative is-ratio--16_9">
|
|
|
+ <marquee
|
|
|
+ class="c-preview-broadcast__text"
|
|
|
+ :class="{ bottom: position === 1 }"
|
|
|
+ :style="{ color: textColor, 'background-color': backgroundColor }"
|
|
|
+ behavior="scroll"
|
|
|
+ >
|
|
|
+ {{ targetContent }}
|
|
|
+ </marquee>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</wrapper>
|
|
|
@@ -139,7 +174,21 @@ export default {
|
|
|
targetContent: '',
|
|
|
endDateTime: '',
|
|
|
keywordMap: [],
|
|
|
- selectedDevices: []
|
|
|
+ selectedDevices: [],
|
|
|
+ textColor: '#FFFFFF',
|
|
|
+ textColorOptions: [
|
|
|
+ { label: '白色', value: '#FFFFFF', color: '#999' },
|
|
|
+ { label: '黑色', value: '#000000' },
|
|
|
+ { label: '蓝色', value: '#0000FF' },
|
|
|
+ { label: '黄色', value: '#FFFF00' },
|
|
|
+ { label: '红色', value: '#FF0000' }
|
|
|
+ ],
|
|
|
+ textBackgroundColor: '#C0000000',
|
|
|
+ textBackgroundColorOptions: [
|
|
|
+ { label: '黑色(75%)', value: '#C0000000' },
|
|
|
+ { label: '半透黑(50%)', value: '#7F000000' },
|
|
|
+ { label: '透明黑(25%)', value: '#40000000' }
|
|
|
+ ]
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
@@ -170,6 +219,14 @@ export default {
|
|
|
},
|
|
|
selectedDeviceName () {
|
|
|
return this.selectedDevices.map(device => device.name).join(', ')
|
|
|
+ },
|
|
|
+ backgroundColor () {
|
|
|
+ const argb = /^#(.{2})(.{2})(.{2})(.{2})$/i.exec(this.textBackgroundColor)
|
|
|
+ if (argb) {
|
|
|
+ const alpha = parseInt(argb[1], 16)
|
|
|
+ return `rgba(${parseInt(argb[2], 16)}, ${parseInt(argb[3], 16)}, ${parseInt(argb[4], 16)}, ${alpha === 0 ? 0 : alpha === 255 ? 1 : Math.round(alpha / 255 * 100) / 100})`
|
|
|
+ }
|
|
|
+ return this.textBackgroundColor
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -267,10 +324,31 @@ export default {
|
|
|
keywordMap,
|
|
|
startTime: parseTime(Date.now(), '{y}-{m}-{d} {h}:{i}:{s}'),
|
|
|
endTime: this.endDateTime,
|
|
|
- deviceIds: this.selectedDevices.map(device => device.id)
|
|
|
+ deviceIds: this.selectedDevices.map(device => device.id),
|
|
|
+ textColor: this.textColor,
|
|
|
+ textBackgroundColor: this.textBackgroundColor
|
|
|
})
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.c-preview-broadcast {
|
|
|
+ background: url("~@/assets/program_bg.png") center center / 100% 100%
|
|
|
+ no-repeat;
|
|
|
+
|
|
|
+ &__text {
|
|
|
+ position: absolute;
|
|
|
+ top: $spacing--xs;
|
|
|
+ width: 100%;
|
|
|
+ padding: $padding--sm 0;
|
|
|
+
|
|
|
+ &.bottom {
|
|
|
+ top: auto;
|
|
|
+ bottom: $spacing--xs;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|