|
@@ -13,7 +13,7 @@
|
|
|
<el-form-item v-if="!onlyColor" label="背景图片" label-position="left" label-width="60px">
|
|
<el-form-item v-if="!onlyColor" label="背景图片" label-position="left" label-width="60px">
|
|
|
<ImageSelect v-model="image" />
|
|
<ImageSelect v-model="image" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item v-if="!onlyColor" label="图片颜色" label-position="left" label-width="60px">
|
|
|
|
|
|
|
+ <el-form-item v-if="!onlyColor" label="图片遮罩" label-position="left" label-width="60px">
|
|
|
<ColorPicker
|
|
<ColorPicker
|
|
|
use-type="pure"
|
|
use-type="pure"
|
|
|
picker-type="chrome"
|
|
picker-type="chrome"
|
|
@@ -23,6 +23,14 @@
|
|
|
/>
|
|
/>
|
|
|
<span class="text-text-active">{{ imageColor }}</span>
|
|
<span class="text-text-active">{{ imageColor }}</span>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
+ <el-form-item v-if="!onlyColor" label="透明度" label-position="left" label-width="60px">
|
|
|
|
|
+ <el-slider
|
|
|
|
|
+ v-model="imageAlpha"
|
|
|
|
|
+ :disabled="!modelValue?.image"
|
|
|
|
|
+ :max="255"
|
|
|
|
|
+ :min="0"
|
|
|
|
|
+ ></el-slider>
|
|
|
|
|
+ </el-form-item>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -43,6 +51,7 @@ const modelValue = defineModel<{
|
|
|
image?: {
|
|
image?: {
|
|
|
imgId: string
|
|
imgId: string
|
|
|
color: string
|
|
color: string
|
|
|
|
|
+ alpha: number
|
|
|
}
|
|
}
|
|
|
}>('modelValue')
|
|
}>('modelValue')
|
|
|
// 纯色
|
|
// 纯色
|
|
@@ -73,7 +82,7 @@ const gradientColor = computed({
|
|
|
// 图像颜色
|
|
// 图像颜色
|
|
|
const imageColor = computed({
|
|
const imageColor = computed({
|
|
|
get() {
|
|
get() {
|
|
|
- return modelValue.value?.image?.color
|
|
|
|
|
|
|
+ return modelValue.value?.image?.color || '#ffffff00'
|
|
|
},
|
|
},
|
|
|
set(val: string) {
|
|
set(val: string) {
|
|
|
if (modelValue.value?.image) {
|
|
if (modelValue.value?.image) {
|
|
@@ -81,6 +90,17 @@ const imageColor = computed({
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+// 图像透明度
|
|
|
|
|
+const imageAlpha = computed({
|
|
|
|
|
+ get() {
|
|
|
|
|
+ return modelValue.value?.image?.alpha
|
|
|
|
|
+ },
|
|
|
|
|
+ set(val: number) {
|
|
|
|
|
+ if (modelValue.value?.image) {
|
|
|
|
|
+ modelValue.value.image.alpha = val
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+})
|
|
|
|
|
|
|
|
const image = computed({
|
|
const image = computed({
|
|
|
get() {
|
|
get() {
|
|
@@ -91,10 +111,14 @@ const image = computed({
|
|
|
if (!modelValue.value?.image) {
|
|
if (!modelValue.value?.image) {
|
|
|
modelValue.value.image = {
|
|
modelValue.value.image = {
|
|
|
imgId: '',
|
|
imgId: '',
|
|
|
- color: ''
|
|
|
|
|
|
|
+ color: '',
|
|
|
|
|
+ alpha: 255
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
modelValue.value.image.imgId = val
|
|
modelValue.value.image.imgId = val
|
|
|
|
|
+ if (!imageColor.value) {
|
|
|
|
|
+ imageColor.value = '#ffffff00'
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|