Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Chatopera OpenSource
/
ferry_web
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Members
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
9c320785
authored
Jul 22, 2020
by
Mr. Lan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加隐藏标签功能。
parent
3f7a4906
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
28 deletions
src/components/VueFormMaking/components/GenerateFormItem.vue
src/components/VueFormMaking/components/WidgetConfig.vue
src/components/VueFormMaking/components/WidgetFormItem.vue
src/components/VueFormMaking/components/componentsConfig.js
src/components/VueFormMaking/components/GenerateFormItem.vue
View file @
9c320785
<
template
>
<el-form-item
:label-width=
"widget
LabelWidth + '
px'"
:label=
"widget.type==='divider' ||
(widget.type==='text' && widget.options.textLabelStatus===false)
?'':widget.name"
:label-width=
"widget
.options.labelWidthStatus?widgetLabelWidth + 'px': '0
px'"
:label=
"widget.type==='divider' ||
!widget.options.labelWidthStatus
?'':widget.name"
:prop=
"widget.model"
>
<template
v-if=
"widget.type == 'input'"
>
...
...
src/components/VueFormMaking/components/WidgetConfig.vue
View file @
9c320785
...
...
@@ -25,6 +25,16 @@
<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-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 @@
<el-form-item
label=
"字体属性"
>
<el-input
v-model=
"data.options.font_family"
placeholder=
"请输入字体属性"
/>
</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
v-if=
"data.type==='divider'"
>
...
...
@@ -439,6 +443,7 @@ export default {
computed
:
{
show
()
{
if
(
this
.
data
&&
Object
.
keys
(
this
.
data
).
length
>
0
)
{
console
.
log
(
this
.
data
)
return
true
}
return
false
...
...
src/components/VueFormMaking/components/WidgetFormItem.vue
View file @
9c320785
<
template
>
<el-form-item
v-if=
"element && element.key"
:label-width=
"element
LabelWidth + '
px'"
:label-width=
"element
.options.labelWidthStatus?elementLabelWidth + 'px': '0
px'"
class=
"widget-view "
: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)"
>
<template
v-if=
"element.type == 'input'"
>
...
...
src/components/VueFormMaking/components/componentsConfig.js
View file @
9c320785
...
...
@@ -11,7 +11,8 @@ export const basicComponents = [
placeholder
:
''
,
disabled
:
false
,
labelWidth
:
100
,
labelWidthDisabled
:
false
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
}
},
{
...
...
@@ -25,7 +26,8 @@ export const basicComponents = [
pattern
:
''
,
placeholder
:
''
,
labelWidth
:
100
,
labelWidthDisabled
:
false
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
}
},
{
...
...
@@ -41,7 +43,8 @@ export const basicComponents = [
disabled
:
false
,
controlsPosition
:
''
,
labelWidth
:
100
,
labelWidthDisabled
:
false
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
}
},
{
...
...
@@ -76,7 +79,8 @@ export const basicComponents = [
remoteFunc
:
''
,
disabled
:
false
,
labelWidth
:
100
,
labelWidthDisabled
:
false
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
}
},
{
...
...
@@ -108,7 +112,8 @@ export const basicComponents = [
remoteFunc
:
''
,
disabled
:
false
,
labelWidth
:
100
,
labelWidthDisabled
:
false
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
}
},
{
...
...
@@ -129,7 +134,8 @@ export const basicComponents = [
required
:
false
,
width
:
''
,
labelWidth
:
100
,
labelWidthDisabled
:
false
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
}
},
{
...
...
@@ -150,7 +156,8 @@ export const basicComponents = [
required
:
false
,
width
:
''
,
labelWidth
:
100
,
labelWidthDisabled
:
false
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
}
},
{
...
...
@@ -163,7 +170,8 @@ export const basicComponents = [
allowHalf
:
false
,
required
:
false
,
labelWidth
:
100
,
labelWidthDisabled
:
false
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
}
},
{
...
...
@@ -175,7 +183,8 @@ export const basicComponents = [
showAlpha
:
false
,
required
:
false
,
labelWidth
:
100
,
labelWidthDisabled
:
false
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
}
},
{
...
...
@@ -209,7 +218,8 @@ export const basicComponents = [
},
remoteFunc
:
''
,
labelWidth
:
100
,
labelWidthDisabled
:
false
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
}
},
{
...
...
@@ -220,7 +230,8 @@ export const basicComponents = [
required
:
false
,
disabled
:
false
,
labelWidth
:
100
,
labelWidthDisabled
:
false
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
}
},
{
...
...
@@ -237,7 +248,8 @@ export const basicComponents = [
range
:
false
,
width
:
''
,
labelWidth
:
100
,
labelWidthDisabled
:
false
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
}
},
{
...
...
@@ -248,8 +260,8 @@ export const basicComponents = [
font_color
:
'#606266'
,
// 字体颜色
font_weight
:
'500'
,
// 粗体
font_family
:
''
,
// 字体属性
defaultValue
:
'
This is a text
'
,
textLabel
Status
:
true
,
defaultValue
:
'
这是一句话
'
,
labelWidth
Status
:
true
,
customClass
:
''
,
labelWidth
:
100
,
labelWidthDisabled
:
false
...
...
@@ -264,7 +276,8 @@ export const advanceComponents = [
options
:
{
defaultType
:
'String'
,
labelWidth
:
100
,
labelWidthDisabled
:
false
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
}
},
{
...
...
@@ -289,7 +302,8 @@ export const advanceComponents = [
isEdit
:
false
,
action
:
'https://jsonplaceholder.typicode.com/photos/'
,
labelWidth
:
100
,
labelWidthDisabled
:
false
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
}
},
{
...
...
@@ -299,7 +313,8 @@ export const advanceComponents = [
defaultValue
:
''
,
width
:
''
,
labelWidth
:
100
,
labelWidthDisabled
:
false
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
}
},
{
...
...
@@ -320,7 +335,8 @@ export const advanceComponents = [
},
remoteFunc
:
''
,
labelWidth
:
100
,
labelWidthDisabled
:
false
labelWidthDisabled
:
false
,
labelWidthStatus
:
true
}
}
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment