|
@@ -7,7 +7,13 @@
|
|
|
<el-row v-if="!onlyRadius" :gutter="12">
|
|
<el-row v-if="!onlyRadius" :gutter="12">
|
|
|
<el-col :span="hideRadius ? 24 : 12">
|
|
<el-col :span="hideRadius ? 24 : 12">
|
|
|
<el-form-item label-position="left" label-width="0px">
|
|
<el-form-item label-position="left" label-width="0px">
|
|
|
- <input-number v-model="width" controls-position="right" style="width: 100%" :min="0">
|
|
|
|
|
|
|
+ <input-number
|
|
|
|
|
+ v-model="width"
|
|
|
|
|
+ controls-position="right"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :min="0"
|
|
|
|
|
+ :max="max"
|
|
|
|
|
+ >
|
|
|
<template #prefix>
|
|
<template #prefix>
|
|
|
<span>宽度</span>
|
|
<span>宽度</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -16,7 +22,13 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="12" v-if="!hideRadius">
|
|
<el-col :span="12" v-if="!hideRadius">
|
|
|
<el-form-item label-position="left" label-width="0px">
|
|
<el-form-item label-position="left" label-width="0px">
|
|
|
- <input-number v-model="radius" controls-position="right" style="width: 100%" :min="0">
|
|
|
|
|
|
|
+ <input-number
|
|
|
|
|
+ v-model="radius"
|
|
|
|
|
+ controls-position="right"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :min="0"
|
|
|
|
|
+ :max="max"
|
|
|
|
|
+ >
|
|
|
<template #prefix>
|
|
<template #prefix>
|
|
|
<span>圆角</span>
|
|
<span>圆角</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -26,7 +38,13 @@
|
|
|
</el-row>
|
|
</el-row>
|
|
|
|
|
|
|
|
<el-form-item v-if="onlyRadius" label-position="left" label-width="0px">
|
|
<el-form-item v-if="onlyRadius" label-position="left" label-width="0px">
|
|
|
- <input-number v-model="radius" controls-position="right" style="width: 100%" :min="0">
|
|
|
|
|
|
|
+ <input-number
|
|
|
|
|
+ v-model="radius"
|
|
|
|
|
+ controls-position="right"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ :min="0"
|
|
|
|
|
+ :max="max"
|
|
|
|
|
+ >
|
|
|
<template #prefix>
|
|
<template #prefix>
|
|
|
<span>圆角</span>
|
|
<span>圆角</span>
|
|
|
</template>
|
|
</template>
|
|
@@ -74,6 +92,7 @@ import {
|
|
|
BsBorderRight,
|
|
BsBorderRight,
|
|
|
BsBorderOuter
|
|
BsBorderOuter
|
|
|
} from 'vue-icons-plus/bs'
|
|
} from 'vue-icons-plus/bs'
|
|
|
|
|
+import { useProjectStore } from '@/store/modules/project'
|
|
|
|
|
|
|
|
defineProps<{
|
|
defineProps<{
|
|
|
hideRadius?: boolean
|
|
hideRadius?: boolean
|
|
@@ -87,6 +106,8 @@ const modelValue = defineModel<{
|
|
|
side: string[]
|
|
side: string[]
|
|
|
}>('modelValue')
|
|
}>('modelValue')
|
|
|
|
|
|
|
|
|
|
+const projectStore = useProjectStore()
|
|
|
|
|
+
|
|
|
// 颜色
|
|
// 颜色
|
|
|
const color = computed({
|
|
const color = computed({
|
|
|
get: () => modelValue.value?.color,
|
|
get: () => modelValue.value?.color,
|
|
@@ -127,6 +148,15 @@ const side = computed({
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+// 最大值为控件宽高最小值的一半
|
|
|
|
|
+const max = computed(() => {
|
|
|
|
|
+ const activeWidget = projectStore.activeWidget
|
|
|
|
|
+ if (!activeWidget) return
|
|
|
|
|
+ const width = activeWidget.props.width || 0
|
|
|
|
|
+ const height = activeWidget.props.height || 0
|
|
|
|
|
+ return Math.min(width, height) / 2
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
const handleBorder = (val: string) => {
|
|
const handleBorder = (val: string) => {
|
|
|
if (side.value?.includes(val)) {
|
|
if (side.value?.includes(val)) {
|
|
|
side.value = side.value.filter((item) => item !== val)
|
|
side.value = side.value.filter((item) => item !== val)
|