代码调整

This commit is contained in:
joylink_cuiweidong 2021-04-07 15:35:35 +08:00
parent 8e13a2190b
commit 7ed95d2701
3 changed files with 70 additions and 43 deletions

View File

@ -37,6 +37,7 @@ class BuilderFactory {
} }
}); });
temp.formGroup.push({name:'样式配置', code:'style', styleList:styleList}); temp.formGroup.push({name:'样式配置', code:'style', styleList:styleList});
// shape // shape
// element // element

View File

@ -1,6 +1,20 @@
import types from './types'; import types from './types';
export default [ export default [
{
prop: 'lineWidth',
label: '线宽',
type: types.Number,
min: 0,
max: 100,
step: 1,
precisionFlag: 0,
rules:[
{ required: true, message:'请输入线宽', trigger: 'blur' }
],
value: 0,
description: '线宽'
},
{ {
prop: 'fill', prop: 'fill',
label: '填充样式', label: '填充样式',
@ -11,16 +25,6 @@ export default [
value: '', value: '',
description: '填充样式。' description: '填充样式。'
}, },
{
prop: 'stroke',
label: '描边样式',
type: types.Color,
rules:[
{ required: true, message:'请输入描边样式', trigger: 'blur' }
],
value: '',
description: '描边样式。'
},
{ {
prop: 'opacity', prop: 'opacity',
label: '不透明度', label: '不透明度',
@ -35,10 +39,21 @@ export default [
value: 1, value: 1,
description: '不透明度。' description: '不透明度。'
}, },
{
prop: 'stroke',
label: '描边样式',
type: types.Color,
rules:[
{ required: true, message:'请输入描边样式', trigger: 'blur' }
],
value: '',
description: '描边样式。'
},
{ {
prop: 'lineDash', prop: 'lineDash',
label: '描边虚线', label: '描边虚线',
type: types.NumberArray, type: types.NumberArray,
length:2,
min: 0, min: 0,
max: 100, max: 100,
step: 1, step: 1,
@ -46,13 +61,13 @@ export default [
rules:[ rules:[
{ required: true, message:'请输入描边虚线样式', trigger: 'blur' } { required: true, message:'请输入描边虚线样式', trigger: 'blur' }
], ],
value: 1, value: [0, 0],
description: '描边虚线样式,参考 SVG stroke-dasharray。' description: '描边虚线样式,参考 SVG stroke-dasharray。'
}, },
{ {
prop: 'lineDashOffset', prop: 'lineDashOffset',
label: '描边虚线偏移', label: '描边虚线偏移',
type: types.Point, type: types.Number,
min: 0, min: 0,
max: 100, max: 100,
step: 1, step: 1,
@ -63,24 +78,10 @@ export default [
value: [0, 0], value: [0, 0],
description: '描边虚线偏移,参考 SVG stroke-dashoffset。' description: '描边虚线偏移,参考 SVG stroke-dashoffset。'
}, },
{
prop: 'shadowBlur',
label: '阴影模糊大小',
type: types.Number,
min: 0,
max: 100,
step: 1,
precisionFlag: 0,
rules:[
{ required: true, message:'请输入阴影模糊大小', trigger: 'blur' }
],
value: 0,
description: '阴影模糊大小。'
},
{ {
prop: 'shadowColor', prop: 'shadowColor',
label: '阴影颜色', label: '阴影颜色',
type: types.String, type: types.Color,
rules:[ rules:[
{ required: true, message:'请输入阴影颜色', trigger: 'blur' } { required: true, message:'请输入阴影颜色', trigger: 'blur' }
], ],
@ -116,18 +117,18 @@ export default [
description: '阴影纵向偏移。' description: '阴影纵向偏移。'
}, },
{ {
prop: 'lineWidth', prop: 'shadowBlur',
label: '线宽', label: '阴影模糊大小',
type: types.Number, type: types.Number,
min: 0, min: 0,
max: 100, max: 100,
step: 1, step: 1,
precisionFlag: 0, precisionFlag: 0,
rules:[ rules:[
{ required: true, message:'请输入线宽', trigger: 'blur' } { required: true, message:'请输入阴影模糊大小', trigger: 'blur' }
], ],
value: 0, value: 0,
description: '线宽。' description: '阴影模糊大小。'
}, },
{ {
prop: 'strokeNoScale', prop: 'strokeNoScale',
@ -138,15 +139,15 @@ export default [
], ],
value: false, value: false,
description: '描边粗细不随缩放而改变,不选中时则会根据缩放同比例缩放描边粗细。' description: '描边粗细不随缩放而改变,不选中时则会根据缩放同比例缩放描边粗细。'
},
{
prop: 'blend',
label: '混合模式',
type: types.String,
rules:[
{ required: true, message:'请输入混合模式', trigger: 'blur' }
],
value: '',
description: '混合模式,同 Canvas globalCompositeOperation。'
} }
// {
// prop: 'blend',
// label: '混合模式',
// type: types.String,
// rules:[
// { required: true, message:'请输入混合模式', trigger: 'blur' }
// ],
// value: '',
// description: '混合模式,同 Canvas globalCompositeOperation。'
// }
]; ];

View File

@ -11,7 +11,7 @@
<el-input-number <el-input-number
v-if="item.precisionFlag" v-if="item.precisionFlag"
v-model="formModel[styleGroup.code][item.prop]" v-model="formModel[styleGroup.code][item.prop]"
size="mini" size="small"
:min="isNaN(item.min) ? -Infinity : item.min" :min="isNaN(item.min) ? -Infinity : item.min"
:max="isNaN(item.max)? Infinity : item.max" :max="isNaN(item.max)? Infinity : item.max"
:step="isNaN(item.step) ? -Infinity : item.step" :step="isNaN(item.step) ? -Infinity : item.step"
@ -20,7 +20,7 @@
<el-input-number <el-input-number
v-else v-else
v-model="formModel[styleGroup.code][item.prop]" v-model="formModel[styleGroup.code][item.prop]"
size="mini" size="small"
:min="isNaN(item.min) ? -Infinity : item.min" :min="isNaN(item.min) ? -Infinity : item.min"
:max="isNaN(item.max)? Infinity : item.max" :max="isNaN(item.max)? Infinity : item.max"
:step="isNaN(item.step) ? -Infinity : item.step" :step="isNaN(item.step) ? -Infinity : item.step"
@ -29,10 +29,35 @@
<template v-else-if="checkFieldType(item, 'Boolean')"> <template v-else-if="checkFieldType(item, 'Boolean')">
<el-switch <el-switch
v-model="formModel[styleGroup.code][item.prop]" v-model="formModel[styleGroup.code][item.prop]"
size="small"
:active-color="item.activeColor || '#409eff'" :active-color="item.activeColor || '#409eff'"
:inactive-color="item.inactiveColor || '#dcdfe6'" :inactive-color="item.inactiveColor || '#dcdfe6'"
/> />
</template> </template>
<template v-else-if="checkFieldType(item, 'Color')">
<el-color-picker
v-model="formModel[styleGroup.code][item.prop]"
size="small"
/>
</template>
<template v-else-if="checkFieldType(item, 'NumberArray')">
<el-input-number
v-for="count in item.length"
:key="count"
v-model="formModel[styleGroup.code][item.prop][count-1]"
size="small"
:min="isNaN(item.min) ? -Infinity : item.min"
:max="isNaN(item.max)? Infinity : item.max"
:step="isNaN(item.step) ? -Infinity : item.step"
:precision="item.precision"
/>
</template>
<!-- <template v-else-if="checkFieldType(item, 'Color')">
<el-color-picker
v-model="formModel[styleGroup.code][item.prop]"
size="small"
/>
</template> -->
</el-form-item> </el-form-item>
</template> </template>
</div> </div>