Commit 9c320785 by Mr. Lan

添加隐藏标签功能。

parent 3f7a4906
<template> <template>
<el-form-item <el-form-item
:label-width="widgetLabelWidth + 'px'" :label-width="widget.options.labelWidthStatus?widgetLabelWidth + 'px': '0px'"
:label="widget.type==='divider' || (widget.type==='text' && widget.options.textLabelStatus===false)?'':widget.name" :label="widget.type==='divider' || !widget.options.labelWidthStatus?'':widget.name"
:prop="widget.model" :prop="widget.model"
> >
<template v-if="widget.type == 'input'"> <template v-if="widget.type == 'input'">
......
...@@ -25,6 +25,16 @@ ...@@ -25,6 +25,16 @@
<el-checkbox v-model="data.options.labelWidthDisabled">自定义</el-checkbox> <el-checkbox v-model="data.options.labelWidthDisabled">自定义</el-checkbox>
<el-input-number v-model="data.options.labelWidth" :min="0" :step="10" :disabled="!data.options.labelWidthDisabled" /> <el-input-number v-model="data.options.labelWidth" :min="0" :step="10" :disabled="!data.options.labelWidthDisabled" />
</el-form-item> </el-form-item>
<el-form-item
v-if="Object.keys(data.options).indexOf('labelWidthStatus')>=0 &&
data.type!=='grid' &&
data.type !== 'divider'"
label="隐藏标签"
>
<el-switch
v-model="data.options.labelWidthStatus"
/>
</el-form-item>
<!-- 兰玉磊结束添加 --> <!-- 兰玉磊结束添加 -->
<!-- 高度 --> <!-- 高度 -->
...@@ -291,12 +301,6 @@ ...@@ -291,12 +301,6 @@
<el-form-item label="字体属性"> <el-form-item label="字体属性">
<el-input v-model="data.options.font_family" placeholder="请输入字体属性" /> <el-input v-model="data.options.font_family" placeholder="请输入字体属性" />
</el-form-item> </el-form-item>
<el-form-item label="是否显示Label">
<el-radio-group v-model="data.options.textLabelStatus">
<el-radio-button :label="true"></el-radio-button>
<el-radio-button :label="false"></el-radio-button>
</el-radio-group>
</el-form-item>
</template> </template>
<!-- 分割符 --> <!-- 分割符 -->
<template v-if="data.type==='divider'"> <template v-if="data.type==='divider'">
...@@ -439,6 +443,7 @@ export default { ...@@ -439,6 +443,7 @@ export default {
computed: { computed: {
show() { show() {
if (this.data && Object.keys(this.data).length > 0) { if (this.data && Object.keys(this.data).length > 0) {
console.log(this.data)
return true return true
} }
return false return false
......
<template> <template>
<el-form-item <el-form-item
v-if="element && element.key" v-if="element && element.key"
:label-width="elementLabelWidth + 'px'" :label-width="element.options.labelWidthStatus?elementLabelWidth + 'px': '0px'"
class="widget-view " class="widget-view "
:class="{active: selectWidget.key === element.key, 'is_req': element.options.required}" :class="{active: selectWidget.key === element.key, 'is_req': element.options.required}"
:label="element.type==='divider' || (element.type==='text' && element.options.textLabelStatus===false)?'':element.name" :label="element.type==='divider' || !element.options.labelWidthStatus?'':element.name"
@click.native.stop="handleSelectWidget(index)" @click.native.stop="handleSelectWidget(index)"
> >
<template v-if="element.type == 'input'"> <template v-if="element.type == 'input'">
......
...@@ -11,7 +11,8 @@ export const basicComponents = [ ...@@ -11,7 +11,8 @@ export const basicComponents = [
placeholder: '', placeholder: '',
disabled: false, disabled: false,
labelWidth: 100, labelWidth: 100,
labelWidthDisabled: false labelWidthDisabled: false,
labelWidthStatus: true
} }
}, },
{ {
...@@ -25,7 +26,8 @@ export const basicComponents = [ ...@@ -25,7 +26,8 @@ export const basicComponents = [
pattern: '', pattern: '',
placeholder: '', placeholder: '',
labelWidth: 100, labelWidth: 100,
labelWidthDisabled: false labelWidthDisabled: false,
labelWidthStatus: true
} }
}, },
{ {
...@@ -41,7 +43,8 @@ export const basicComponents = [ ...@@ -41,7 +43,8 @@ export const basicComponents = [
disabled: false, disabled: false,
controlsPosition: '', controlsPosition: '',
labelWidth: 100, labelWidth: 100,
labelWidthDisabled: false labelWidthDisabled: false,
labelWidthStatus: true
} }
}, },
{ {
...@@ -76,7 +79,8 @@ export const basicComponents = [ ...@@ -76,7 +79,8 @@ export const basicComponents = [
remoteFunc: '', remoteFunc: '',
disabled: false, disabled: false,
labelWidth: 100, labelWidth: 100,
labelWidthDisabled: false labelWidthDisabled: false,
labelWidthStatus: true
} }
}, },
{ {
...@@ -108,7 +112,8 @@ export const basicComponents = [ ...@@ -108,7 +112,8 @@ export const basicComponents = [
remoteFunc: '', remoteFunc: '',
disabled: false, disabled: false,
labelWidth: 100, labelWidth: 100,
labelWidthDisabled: false labelWidthDisabled: false,
labelWidthStatus: true
} }
}, },
{ {
...@@ -129,7 +134,8 @@ export const basicComponents = [ ...@@ -129,7 +134,8 @@ export const basicComponents = [
required: false, required: false,
width: '', width: '',
labelWidth: 100, labelWidth: 100,
labelWidthDisabled: false labelWidthDisabled: false,
labelWidthStatus: true
} }
}, },
{ {
...@@ -150,7 +156,8 @@ export const basicComponents = [ ...@@ -150,7 +156,8 @@ export const basicComponents = [
required: false, required: false,
width: '', width: '',
labelWidth: 100, labelWidth: 100,
labelWidthDisabled: false labelWidthDisabled: false,
labelWidthStatus: true
} }
}, },
{ {
...@@ -163,7 +170,8 @@ export const basicComponents = [ ...@@ -163,7 +170,8 @@ export const basicComponents = [
allowHalf: false, allowHalf: false,
required: false, required: false,
labelWidth: 100, labelWidth: 100,
labelWidthDisabled: false labelWidthDisabled: false,
labelWidthStatus: true
} }
}, },
{ {
...@@ -175,7 +183,8 @@ export const basicComponents = [ ...@@ -175,7 +183,8 @@ export const basicComponents = [
showAlpha: false, showAlpha: false,
required: false, required: false,
labelWidth: 100, labelWidth: 100,
labelWidthDisabled: false labelWidthDisabled: false,
labelWidthStatus: true
} }
}, },
{ {
...@@ -209,7 +218,8 @@ export const basicComponents = [ ...@@ -209,7 +218,8 @@ export const basicComponents = [
}, },
remoteFunc: '', remoteFunc: '',
labelWidth: 100, labelWidth: 100,
labelWidthDisabled: false labelWidthDisabled: false,
labelWidthStatus: true
} }
}, },
{ {
...@@ -220,7 +230,8 @@ export const basicComponents = [ ...@@ -220,7 +230,8 @@ export const basicComponents = [
required: false, required: false,
disabled: false, disabled: false,
labelWidth: 100, labelWidth: 100,
labelWidthDisabled: false labelWidthDisabled: false,
labelWidthStatus: true
} }
}, },
{ {
...@@ -237,7 +248,8 @@ export const basicComponents = [ ...@@ -237,7 +248,8 @@ export const basicComponents = [
range: false, range: false,
width: '', width: '',
labelWidth: 100, labelWidth: 100,
labelWidthDisabled: false labelWidthDisabled: false,
labelWidthStatus: true
} }
}, },
{ {
...@@ -248,8 +260,8 @@ export const basicComponents = [ ...@@ -248,8 +260,8 @@ export const basicComponents = [
font_color: '#606266', // 字体颜色 font_color: '#606266', // 字体颜色
font_weight: '500', // 粗体 font_weight: '500', // 粗体
font_family: '', // 字体属性 font_family: '', // 字体属性
defaultValue: 'This is a text', defaultValue: '这是一句话',
textLabelStatus: true, labelWidthStatus: true,
customClass: '', customClass: '',
labelWidth: 100, labelWidth: 100,
labelWidthDisabled: false labelWidthDisabled: false
...@@ -264,7 +276,8 @@ export const advanceComponents = [ ...@@ -264,7 +276,8 @@ export const advanceComponents = [
options: { options: {
defaultType: 'String', defaultType: 'String',
labelWidth: 100, labelWidth: 100,
labelWidthDisabled: false labelWidthDisabled: false,
labelWidthStatus: true
} }
}, },
{ {
...@@ -289,7 +302,8 @@ export const advanceComponents = [ ...@@ -289,7 +302,8 @@ export const advanceComponents = [
isEdit: false, isEdit: false,
action: 'https://jsonplaceholder.typicode.com/photos/', action: 'https://jsonplaceholder.typicode.com/photos/',
labelWidth: 100, labelWidth: 100,
labelWidthDisabled: false labelWidthDisabled: false,
labelWidthStatus: true
} }
}, },
{ {
...@@ -299,7 +313,8 @@ export const advanceComponents = [ ...@@ -299,7 +313,8 @@ export const advanceComponents = [
defaultValue: '', defaultValue: '',
width: '', width: '',
labelWidth: 100, labelWidth: 100,
labelWidthDisabled: false labelWidthDisabled: false,
labelWidthStatus: true
} }
}, },
{ {
...@@ -320,7 +335,8 @@ export const advanceComponents = [ ...@@ -320,7 +335,8 @@ export const advanceComponents = [
}, },
remoteFunc: '', remoteFunc: '',
labelWidth: 100, labelWidth: 100,
labelWidthDisabled: false labelWidthDisabled: false,
labelWidthStatus: true
} }
} }
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment