Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hls-easy-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
easyUI
hls-easy-ui
Commits
565bd136
Commit
565bd136
authored
Aug 07, 2019
by
JingChao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
动态配置
parent
fd2ae777
Changes
6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
774 additions
and
133 deletions
+774
-133
Item.vue
packages/components/ListItem/Item.vue
+1
-1
index.vue
packages/components/STab/index.vue
+2
-2
dynamicLayout.Vue
src/pages/dynamicLayout.Vue
+2
-2
form.vue
src/pages/form.vue
+142
-127
home.vue
src/pages/home.vue
+1
-1
layout.json
src/pages/layout.json
+626
-0
No files found.
packages/components/ListItem/Item.vue
View file @
565bd136
...
@@ -159,7 +159,7 @@ export default {
...
@@ -159,7 +159,7 @@ export default {
content: '*';
content: '*';
color: #D24E4E;
color: #D24E4E;
height: 8px;
height: 8px;
padding-top:
4
px;
padding-top:
2
px;
margin-left: 2px;
margin-left: 2px;
}
}
}
}
...
...
packages/components/STab/index.vue
View file @
565bd136
...
@@ -75,9 +75,9 @@ export default {
...
@@ -75,9 +75,9 @@ export default {
},
},
mounted
()
{
mounted
()
{
let
vm
=
this
let
vm
=
this
setTimeout
(()
=>
{
setTimeout
(()
=>
{
this
.
items
[
vm
.
current
].
$el
.
classList
.
add
(
'activated'
)
this
.
items
[
vm
.
current
].
$el
.
classList
.
add
(
'activated'
)
},
100
)
},
100
)
this
.
scrollToActiveTab
(
vm
.
current
,
this
.
items
[
vm
.
current
].
$el
.
clientWidth
)
this
.
scrollToActiveTab
(
vm
.
current
,
this
.
items
[
vm
.
current
].
$el
.
clientWidth
)
},
},
methods
:
{
methods
:
{
...
...
src/pages/dynamicLayout.Vue
View file @
565bd136
...
@@ -45,9 +45,9 @@
...
@@ -45,9 +45,9 @@
<
script
>
<
script
>
import
layoutData
from
'../common/layout'
import
layoutData
from
'../common/layout'
import
ButtonTab
from
"vux/src/components/button-tab/button-tab"
;
export
default
{
export
default
{
components
:
{
ButtonTab
},
data
()
{
data
()
{
return
{
return
{
layoutData
:
[],
layoutData
:
[],
...
...
src/pages/form.vue
View file @
565bd136
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
*/
*/
<
template
>
<
template
>
<h-view>
<h-view
class=
"form"
>
<h-header>
<h-header>
<div
slot=
"left"
class=
"h-header-btn"
@
click=
"$hlsExit()"
>
<div
slot=
"left"
class=
"h-header-btn"
@
click=
"$hlsExit()"
>
<i
class=
"ion-ios-arrow-back"
/>
<i
class=
"ion-ios-arrow-back"
/>
...
@@ -13,158 +13,173 @@
...
@@ -13,158 +13,173 @@
<div
slot=
"right"
class=
"h-header-btn"
>
右边
</div>
<div
slot=
"right"
class=
"h-header-btn"
>
右边
</div>
</h-header>
</h-header>
<h-content>
<h-content>
<section
v-for=
"(com, index) in component"
:key=
"index"
>
<section
v-for=
"(com, index) in layoutData"
:key=
"index"
>
<section
v-if=
"com.name=='tab'"
>
<s-tab
<s-tab
v-if=
"com.item"
:class=
"com.class"
>
v-if=
"com.configType==='TAB' && com.layoutFiledList.length"
<tab-item
v-for=
"(tab,key) in com.item"
:key=
"key"
>
{{
tab
.
name
}}
</tab-item>
:default-active=
"tabIndex"
:class=
"com.cssClass"
@
tabClick=
"layoutTabClick"
@
click
.
native=
"tabClick(com)"
>
<tab-item
v-for=
"(tab,key) in com.layoutFiledList"
:key=
"key"
><section
v-html=
"tab.tabContent || tab.filedName"
/></tab-item>
</s-tab>
</s-tab>
</section>
<list-item
v-if=
"com.configType==='FORM' && com.layoutFiledList.length"
v-show=
"tabFromHide(com)"
:class=
"com.cssClass"
>
<section
v-else-if=
"com.name=='form'"
>
<item
v-show=
"showFormTitle"
class=
"form-title"
@
click
.
native=
"hideFormClick(index)"
>
<list-item
v-if=
"com.fileds"
:class=
"com.class"
>
<div
slot=
"name"
>
{{
com
.
configName
}}
</div>
<item
v-for=
"(filed, index) in com.fileds"
:key=
"index"
:class=
"filed.class"
>
<img
<div
slot=
"name"
:class=
"
{'required':filed.request}">
{{
filed
.
description
}}
</div>
slot=
"right-icon"
:class=
"
{'hide-down-icon':!com.hideForm,'hide-up-icon':com.hideForm}"
<div
slot=
"content"
>
class="right-icon " src="@/assets/image/right-arrow@2x.png">
</item>
<item
v-for=
"(filed, index) in com.layoutFiledList"
v-show=
"!com.hideForm"
:key=
"index"
:class=
"filed.cssClass"
:has-border=
"filed.hasBorder"
:hasContent=
"filed.showContent"
:proportion=
"proportionArray(filed.proportion)"
:showName=
"filed.showName"
:showArrow=
"filed.showArrow"
:item-height=
"filed.filedHeight"
>
<img
v-if=
"filed.leftIcon"
slot=
"left-icon"
:src=
"filed.leftIcon"
class=
"left-icon"
>
<div
slot=
"name"
:class=
"
{'required':filed.inputMode=='required'}">
{{
filed
.
filedName
}}
</div>
<input
<input
v-if=
"filed.type=='input'"
v-model=
"data[com.dataName][filed.name]"
:request=
"filed.reques
t"
v-if=
"filed.filedType==='INPUT'"
slot=
"conten
t"
:readonly=
"filed.readonly
"
:readonly=
"filed.inputMode==='readOnly'
"
:placeholder=
"filed.placeholder
"
>
:placeholder=
"filed.placeholder"
:value=
"filed.defaultValue"
:type=
"filed.inputType"
:name=
"filed.filedName
"
>
<input
<input
v-if=
"filed.type=='select'"
v-model=
"data[com.dataName][filed.name+'_n']"
readonly=
"true"
v-else-if=
"filed.filedType==='SELECT'"
@
click=
"showSelect(filed.selectList,filed.name,com.dataName)"
>
slot=
"content"
:name=
"filed.filedName"
readonly
@
click=
"showSelect(com,filed)"
>
<input
<input
v-if=
"filed.type=='time'"
v-model=
"data[com.dataName][filed.name]"
readonly=
"true"
v-else-if=
"filed.filedType=='TIME'"
@
click=
"showTime(com.dataName,filed)"
>
slot=
"content"
:name=
"filed.filedName"
</div>
readonly
@
click=
"showTime(com,filed)"
>
<h-switch
v-else-if=
"filed.filedType==='SWITCH'"
slot=
"content"
/>
<div
v-else
slot=
"content"
v-html=
"filed.defaultValue"
/>
<img
v-if=
"filed.rightIcon"
slot=
"right-icon"
:src=
"filed.rightIcon"
class=
"right-icon"
>
</item>
</item>
</list-item>
</list-item>
</section>
</section>
</section>
</h-content>
</h-content>
<section
v-for=
"(com, index) in layoutData"
:key=
"index"
>
<bottom-tab
v-if=
"com.configType==='BOTTOM-BUTTON' && com.layoutFiledList.length"
:show-divider=
"true"
>
<tab-button
v-for=
"(btn, index) in com.layoutFiledList"
:key=
"index"
><section
v-html=
"btn.btnContent || btn.filedName"
/></tab-button>
</bottom-tab>
</section>
</h-view>
</h-view>
</
template
>
</
template
>
<
script
>
<
script
>
import
layoutData
from
'./layout.json'
import
ButtonTab
from
'vux/src/components/button-tab/button-tab'
export
default
{
export
default
{
name
:
'Form'
,
name
:
'Form'
,
components
:
{
ButtonTab
},
data
()
{
data
()
{
return
{
return
{
component
:
[
tabIndex
:
1
,
{
showFormTitle
:
true
,
name
:
'tab'
,
layoutData
:
null
,
class
:
''
,
item
:
[
{
name
:
'APP'
,
},
{
name
:
'WeiXin'
,
},
{
name
:
'Vue'
,
},
],
},
{
name
:
'form'
,
readonly
:
false
,
class
:
''
,
dataName
:
'person'
,
fileds
:
[
{
class
:
''
,
type
:
'input'
,
description
:
'手机号'
,
name
:
'phone'
,
defaultValue
:
''
,
request
:
false
,
readonly
:
false
,
placeholder
:
'请输入手机号'
,
},
{
class
:
''
,
type
:
'input'
,
description
:
'姓名'
,
name
:
'name'
,
defaultValue
:
'li'
,
request
:
true
,
readonly
:
false
,
},
{
class
:
''
,
type
:
'select'
,
description
:
'性别'
,
name
:
'sex'
,
defaultValue
:
'N'
,
defaultValueN
:
'男'
,
request
:
false
,
readonly
:
false
,
selectList
:
[{
code
:
'man'
,
code_name
:
'男'
,
},
{
code
:
'woman'
,
code_name
:
'女'
,
}],
},
{
class
:
''
,
type
:
'time'
,
description
:
'出生时间'
,
name
:
'brithDay'
,
defaultValue
:
'2003-05-26'
,
request
:
true
,
format
:
'yyyy-mm-dd'
,
},
],
},
],
data
:
{},
data
:
{},
activeTab
:
null
,
activeTabFiled
:
null
,
}
}
},
},
created
()
{
created
()
{
let
vm
=
this
let
vm
=
this
vm
.
component
.
forEach
((
com
,
index
)
=>
{
if
(
layoutData
.
rows
&&
layoutData
.
rows
[
0
].
layoutConfigList
.
length
)
{
if
(
com
.
name
===
'form'
)
{
vm
.
layoutData
=
layoutData
.
rows
[
0
].
layoutConfigList
vm
.
layoutData
.
forEach
((
com
,
index
)
=>
{
if
(
com
.
configType
===
'FORM'
)
{
let
form
=
com
let
form
=
com
let
temp
=
{
let
temp
=
{}
readonly
:
form
[
'readonly'
],
if
(
form
.
layoutFiledList
.
length
)
{
}
let
filed
=
form
.
layoutFiledList
if
(
form
.
fileds
.
length
)
{
filed
.
forEach
((
filed
,
index
)
=>
{
let
fileds
=
form
.
fileds
temp
[
filed
.
filedCode
]
=
filed
.
defaultValue
fileds
.
forEach
((
filed
,
index
)
=>
{
temp
[
filed
.
name
]
=
filed
.
defaultValue
if
(
filed
.
type
===
'select'
)
{
if
(
filed
.
type
===
'select'
)
{
temp
[
filed
.
nam
e
+
'_n'
]
=
filed
.
defaultValueN
temp
[
filed
.
filedCod
e
+
'_n'
]
=
filed
.
defaultValueN
}
}
})
})
vm
.
$set
(
this
.
data
,
[
form
.
dataNam
e
],
temp
)
vm
.
$set
(
this
.
data
,
[
form
.
configCod
e
],
temp
)
}
}
}
else
if
(
com
.
configType
===
'TAB'
)
{
vm
.
activeTab
=
com
.
configCode
vm
.
activeTabFiled
=
com
.
layoutFiledList
.
length
?
com
.
layoutFiledList
[
vm
.
tabIndex
].
filedCode
:
''
}
}
})
})
}
},
},
methods
:
{
methods
:
{
showSelect
(
list
,
code
,
dataName
)
{
proportionArray
(
proportion
)
{
return
proportion
.
split
(
','
)
},
layoutTabClick
(
index
)
{
let
vm
=
this
let
vm
=
this
vm
.
hlsPopup
.
selectList
({
vm
.
tabIndex
=
index
list
:
list
,
code
:
code
,
object
:
{},
returnItem
(
index
,
obj
)
{
vm
.
data
[
dataName
][
code
]
=
list
[
index
].
code
vm
.
data
[
dataName
][
code
+
'_n'
]
=
list
[
index
].
code_name
},
},
})
tabClick
(
com
)
{
let
vm
=
this
vm
.
activeTab
=
com
.
configCode
vm
.
activeTabFiled
=
com
.
layoutFiledList
.
length
?
com
.
layoutFiledList
[
vm
.
tabIndex
].
filedCode
:
''
},
},
showTime
(
dataName
,
filed
)
{
hideFormClick
(
index
)
{
let
vm
=
this
let
vm
=
this
vm
.
hlsPopup
.
showTime
({
vm
.
layoutData
[
index
][
'hideForm'
]
=
!
vm
.
layoutData
[
index
][
'hideForm'
]
format
:
filed
.
format
,
callback
(
value
)
{
vm
.
data
[
dataName
][
filed
.
name
]
=
value
},
},
})
tabFromHide
(
com
)
{
let
vm
=
this
if
(
com
.
tabConfigCode
&&
com
.
tabFiledCode
)
{
if
(
com
.
tabConfigCode
===
vm
.
activeTab
&&
com
.
tabFiledCode
===
vm
.
activeTabFiled
)
{
return
true
}
}
return
false
},
showSelect
(
com
,
filed
)
{
},
showTime
(
com
,
filed
)
{
},
},
},
},
}
}
</
script
>
</
script
>
<
style
scoped
lang=
"less"
>
<
style
lang=
"less"
>
.form {
.hls-switch-tab {
.tab-content {
.h-tab-item {
.h-item{
img{
width: 20px;
}
}
}
}
}
.content {
.form-title {
.contents {
.add-name {
font-weight: 500;
}
}
}
.hls-item {
.contents {
.add-content {
.right-icon {
height: 12px;
}
.hide-up-icon {
transform: rotate(90deg);
}
.hide-down-icon {
transform: rotate(-90deg);
}
}
}
}
}
}
</
style
>
</
style
>
src/pages/home.vue
View file @
565bd136
...
@@ -17,7 +17,7 @@
...
@@ -17,7 +17,7 @@
</div>
</div>
<div
v-show=
"item.isFromeMe"
class=
"message-wrap"
>
<div
v-show=
"item.isFromeMe"
class=
"message-wrap"
>
<img
v-show=
"userImg"
:src=
"userImg"
class=
"head-pic-right"
>
<img
v-show=
"userImg"
:src=
"userImg"
class=
"head-pic-right"
>
<img
v-show=
"!userImg"
src=
"
..
/assets/image/robot/user7.png"
class=
"head-pic-right"
>
<img
v-show=
"!userImg"
src=
"
@
/assets/image/robot/user7.png"
class=
"head-pic-right"
>
<span
class=
"triangle-right"
/>
<span
class=
"triangle-right"
/>
<p
class=
"message-right"
v-text=
"item.content"
/>
<p
class=
"message-right"
v-text=
"item.content"
/>
</div>
</div>
...
...
src/pages/layout.json
0 → 100644
View file @
565bd136
This diff is collapsed.
Click to expand it.
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