Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VueElementTemplate
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
JIRA
JIRA
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
黄瑜
VueElementTemplate
Commits
cc10fa0c
Commit
cc10fa0c
authored
May 10, 2018
by
王康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
f
parent
27385195
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
167 additions
and
61 deletions
+167
-61
HmComplexForm.vue
src/views/haomo/components/forms/HmComplexForm.vue
+86
-29
HmComplexTable.vue
src/views/haomo/components/tables/HmComplexTable.vue
+81
-32
No files found.
src/views/haomo/components/forms/HmComplexForm.vue
View file @
cc10fa0c
This diff is collapsed.
Click to expand it.
src/views/haomo/components/tables/HmComplexTable.vue
View file @
cc10fa0c
...
@@ -147,8 +147,11 @@
...
@@ -147,8 +147,11 @@
:formStyle=
"HmComplexForm.formStyle"
:formStyle=
"HmComplexForm.formStyle"
:funObject=
"HmComplexForm.funObject"
:funObject=
"HmComplexForm.funObject"
:refers=
"HmComplexForm.formRefers"
:refers=
"HmComplexForm.formRefers"
:includes=
"HmComplexForm.formIncludes"
:foreignFormFields=
"HmComplexForm.foreignFormFields"
:foreignFormFields=
"HmComplexForm.foreignFormFields"
:relates=
"HmComplexForm.formRelates"
>
:relates=
"HmComplexForm.formRelates"
:rules=
"HmComplexForm.rules"
v-on:formVisible=
'dialogClose'
>
</hm-complex-form>
</hm-complex-form>
</el-dialog>
</el-dialog>
...
@@ -394,15 +397,19 @@
...
@@ -394,15 +397,19 @@
formStyle
:
{},
formStyle
:
{},
funObject
:
{},
funObject
:
{},
formRefers
:
{},
formRefers
:
{},
formIncludes
:
{},
foreignFormFields
:
[],
foreignFormFields
:
[],
formRelates
:
[]
formRelates
:
[],
rules
:
{
}
},
},
showOverflowTooltip
:
false
,
// 设置当内容过长被隐藏时显示 tooltip
showOverflowTooltip
:
false
,
// 设置当内容过长被隐藏时显示 tooltip
HmFullCalendar
:
{},
//
HmFullCalendar
:
{},
//
isShowRefresh
:
false
,
isShowRefresh
:
false
,
buttonGroup
:
false
,
buttonGroup
:
false
,
operationWidth
:
0
,
// 操作栏的宽度
operationWidth
:
2
0
,
// 操作栏的宽度
isShowDetail
:
false
,
// 是否显示详情按钮
isShowDetail
:
false
,
// 是否显示详情按钮
definedOperate
:
[],
// 自定义操作
definedOperate
:
[],
// 自定义操作
...
@@ -421,6 +428,21 @@
...
@@ -421,6 +428,21 @@
return
ret
return
ret
}
}
_
.
map
(
ret
,
function
(
item
)
{
_
.
forEach
(
item
,
function
(
value
,
key
)
{
if
(
value
.
lessThanOrEqualTo
!==
undefined
&&
value
.
greaterThanOrEqualTo
!==
undefined
&&
(
value
.
greaterThanOrEqualTo
===
''
||
value
.
greaterThanOrEqualTo
===
null
)
&&
(
value
.
lessThanOrEqualTo
===
''
||
value
.
lessThanOrEqualTo
===
null
))
{
delete
item
[
key
]
}
if
(
value
.
greaterThanOrEqualTo
!==
undefined
&&
(
value
.
greaterThanOrEqualTo
===
''
||
value
.
greaterThanOrEqualTo
===
null
)
&&
value
.
lessThanOrEqualTo
)
{
delete
item
[
key
].
greaterThanOrEqualTo
}
if
(
value
.
lessThanOrEqualTo
!==
undefined
&&
(
value
.
lessThanOrEqualTo
===
''
||
value
.
lessThanOrEqualTo
===
null
)
&&
value
.
greaterThanOrEqualTo
)
{
delete
item
[
key
].
lessThanOrEqualTo
}
})
})
_
.
each
(
Object
.
keys
(
ret
[
self
.
schema
[
'modelUnderscore'
]]),
function
(
column
)
{
_
.
each
(
Object
.
keys
(
ret
[
self
.
schema
[
'modelUnderscore'
]]),
function
(
column
)
{
const
operValue
=
ret
[
self
.
schema
[
'modelUnderscore'
]][
column
]
const
operValue
=
ret
[
self
.
schema
[
'modelUnderscore'
]][
column
]
if
(
Object
.
keys
(
operValue
)[
0
]
===
'like'
)
{
if
(
Object
.
keys
(
operValue
)[
0
]
===
'like'
)
{
...
@@ -435,6 +457,7 @@
...
@@ -435,6 +457,7 @@
// this.validate()
// this.validate()
const
self
=
this
const
self
=
this
if
(
this
.
userDefined
&&
this
.
userDefined
.
pretreatment
)
{
if
(
this
.
userDefined
&&
this
.
userDefined
.
pretreatment
)
{
self
.
init
()
self
.
userDefined
.
pretreatment
().
then
(
function
()
{
self
.
userDefined
.
pretreatment
().
then
(
function
()
{
self
.
init
()
self
.
init
()
self
.
getList
()
self
.
getList
()
...
@@ -472,7 +495,7 @@
...
@@ -472,7 +495,7 @@
init
()
{
init
()
{
const
self
=
this
const
self
=
this
self
.
operationWidth
=
0
self
.
operationWidth
=
2
0
// 处理要显示的列
// 处理要显示的列
if
(
!
self
.
columns
||
!
self
.
columns
.
length
)
{
if
(
!
self
.
columns
||
!
self
.
columns
.
length
)
{
_
.
each
(
self
.
schema
[
'columns'
],
function
(
column
)
{
_
.
each
(
self
.
schema
[
'columns'
],
function
(
column
)
{
...
@@ -534,7 +557,20 @@
...
@@ -534,7 +557,20 @@
self
.
definedOperate
=
self
.
userDefined
.
definedOperate
self
.
definedOperate
=
self
.
userDefined
.
definedOperate
}
}
if
(
self
.
userDefined
.
definedOperation
)
{
if
(
self
.
userDefined
.
definedOperation
)
{
self
.
operationWidth
+=
50
*
self
.
userDefined
.
definedOperation
.
length
_
.
each
(
self
.
userDefined
.
definedOperation
,
function
(
item
,
index
)
{
_
.
each
(
item
.
label
,
function
(
value
)
{
if
(
!
isNaN
(
Number
(
value
)))
{
self
.
operationWidth
+=
8
// 如果是数字+8
}
else
{
self
.
operationWidth
+=
13
// 如果是汉字加13
}
})
if
(
self
.
userDefined
.
definedOperation
.
length
>
1
&&
index
>
1
)
{
self
.
operationWidth
+=
13
// 每添加一条需加上margin
}
else
{
self
.
operationWidth
+=
5
}
})
self
.
definedOperation
=
self
.
userDefined
.
definedOperation
self
.
definedOperation
=
self
.
userDefined
.
definedOperation
}
}
},
},
...
@@ -664,6 +700,7 @@
...
@@ -664,6 +700,7 @@
formStyle
:
{},
formStyle
:
{},
funObject
:
{},
funObject
:
{},
formRefers
:
{},
formRefers
:
{},
formIncludes
:
{},
foreignFormFields
:
[],
foreignFormFields
:
[],
formRelates
:
[]
formRelates
:
[]
}
}
...
@@ -681,6 +718,7 @@
...
@@ -681,6 +718,7 @@
self
.
options
.
editData
.
formStyle
?
self
.
HmComplexForm
.
formStyle
=
self
.
options
.
editData
.
formStyle
:
''
self
.
options
.
editData
.
formStyle
?
self
.
HmComplexForm
.
formStyle
=
self
.
options
.
editData
.
formStyle
:
''
self
.
options
.
editData
.
funObject
?
self
.
HmComplexForm
.
funObject
=
self
.
options
.
editData
.
funObject
:
''
self
.
options
.
editData
.
funObject
?
self
.
HmComplexForm
.
funObject
=
self
.
options
.
editData
.
funObject
:
''
self
.
options
.
editData
.
formRefers
?
self
.
HmComplexForm
.
formRefers
=
self
.
options
.
editData
.
formRefers
:
''
self
.
options
.
editData
.
formRefers
?
self
.
HmComplexForm
.
formRefers
=
self
.
options
.
editData
.
formRefers
:
''
self
.
options
.
editData
.
formIncludes
?
self
.
HmComplexForm
.
formIncludes
=
self
.
options
.
editData
.
formIncludes
:
''
self
.
options
.
editData
.
foreignFormFields
?
self
.
HmComplexForm
.
foreignFormFields
=
self
.
options
.
editData
.
foreignFormFields
:
''
self
.
options
.
editData
.
foreignFormFields
?
self
.
HmComplexForm
.
foreignFormFields
=
self
.
options
.
editData
.
foreignFormFields
:
''
self
.
options
.
editData
.
formRelates
?
self
.
HmComplexForm
.
formRelates
=
self
.
options
.
editData
.
formRelates
:
''
self
.
options
.
editData
.
formRelates
?
self
.
HmComplexForm
.
formRelates
=
self
.
options
.
editData
.
formRelates
:
''
}
}
...
@@ -696,6 +734,7 @@
...
@@ -696,6 +734,7 @@
self
.
options
.
newData
.
formStyle
?
self
.
HmComplexForm
.
formStyle
=
self
.
options
.
newData
.
formStyle
:
''
self
.
options
.
newData
.
formStyle
?
self
.
HmComplexForm
.
formStyle
=
self
.
options
.
newData
.
formStyle
:
''
self
.
options
.
newData
.
funObject
?
self
.
HmComplexForm
.
funObject
=
self
.
options
.
newData
.
funObject
:
''
self
.
options
.
newData
.
funObject
?
self
.
HmComplexForm
.
funObject
=
self
.
options
.
newData
.
funObject
:
''
self
.
options
.
newData
.
formRefers
?
self
.
HmComplexForm
.
formRefers
=
self
.
options
.
newData
.
formRefers
:
''
self
.
options
.
newData
.
formRefers
?
self
.
HmComplexForm
.
formRefers
=
self
.
options
.
newData
.
formRefers
:
''
self
.
options
.
newData
.
formIncludes
?
self
.
HmComplexForm
.
formIncludes
=
self
.
options
.
newData
.
formIncludes
:
''
self
.
options
.
newData
.
foreignFormFields
?
self
.
HmComplexForm
.
foreignFormFields
=
self
.
options
.
newData
.
foreignFormFields
:
''
self
.
options
.
newData
.
foreignFormFields
?
self
.
HmComplexForm
.
foreignFormFields
=
self
.
options
.
newData
.
foreignFormFields
:
''
self
.
options
.
newData
.
formRelates
?
self
.
HmComplexForm
.
formRelates
=
self
.
options
.
newData
.
formRelates
:
''
self
.
options
.
newData
.
formRelates
?
self
.
HmComplexForm
.
formRelates
=
self
.
options
.
newData
.
formRelates
:
''
}
}
...
@@ -712,9 +751,15 @@
...
@@ -712,9 +751,15 @@
self
.
options
.
showDetail
.
formStyle
?
self
.
HmComplexForm
.
formStyle
=
self
.
options
.
showDetail
.
formStyle
:
''
self
.
options
.
showDetail
.
formStyle
?
self
.
HmComplexForm
.
formStyle
=
self
.
options
.
showDetail
.
formStyle
:
''
self
.
options
.
showDetail
.
funObject
?
self
.
HmComplexForm
.
funObject
=
self
.
options
.
showDetail
.
funObject
:
''
self
.
options
.
showDetail
.
funObject
?
self
.
HmComplexForm
.
funObject
=
self
.
options
.
showDetail
.
funObject
:
''
self
.
options
.
showDetail
.
formRefers
?
self
.
HmComplexForm
.
formRefers
=
self
.
options
.
showDetail
.
formRefers
:
''
self
.
options
.
showDetail
.
formRefers
?
self
.
HmComplexForm
.
formRefers
=
self
.
options
.
showDetail
.
formRefers
:
''
self
.
options
.
showDetail
.
formIncludes
?
self
.
HmComplexForm
.
formIncludes
=
self
.
options
.
showDetail
.
formIncludes
:
''
self
.
options
.
showDetail
.
foreignFormFields
?
self
.
HmComplexForm
.
foreignFormFields
=
self
.
options
.
showDetail
.
foreignFormFields
:
''
self
.
options
.
showDetail
.
foreignFormFields
?
self
.
HmComplexForm
.
foreignFormFields
=
self
.
options
.
showDetail
.
foreignFormFields
:
''
self
.
options
.
showDetail
.
formRelates
?
self
.
HmComplexForm
.
formRelates
=
self
.
options
.
showDetail
.
formRelates
:
''
self
.
options
.
showDetail
.
formRelates
?
self
.
HmComplexForm
.
formRelates
=
self
.
options
.
showDetail
.
formRelates
:
''
self
.
HmComplexForm
.
tableId
=
data
.
id
self
.
HmComplexForm
.
tableId
=
data
.
id
// wk 2018年05月09日11:57:06
if
(
self
.
options
.
showDetail
.
funCallback
)
{
self
.
options
.
showDetail
.
funCallback
(
data
)
}
}
}
self
.
dialogFormVisible
=
true
self
.
dialogFormVisible
=
true
...
@@ -797,7 +842,7 @@
...
@@ -797,7 +842,7 @@
}).
then
(
resp
=>
{
}).
then
(
resp
=>
{
if
(
resp
.
data
.
message
===
'delete success'
)
{
if
(
resp
.
data
.
message
===
'delete success'
)
{
self
.
$message
({
self
.
$message
({
message
:
resp
.
data
.
message
,
message
:
'删除成功'
,
type
:
'success'
type
:
'success'
})
})
self
.
getList
()
self
.
getList
()
...
@@ -820,7 +865,7 @@
...
@@ -820,7 +865,7 @@
}
}
if
(
self
.
options
.
editData
&&
self
.
options
.
editData
.
isShow
)
{
// 判断是否显示编辑按钮
if
(
self
.
options
.
editData
&&
self
.
options
.
editData
.
isShow
)
{
// 判断是否显示编辑按钮
self
.
isShowEditDataButton
=
self
.
options
.
editData
.
isShow
self
.
isShowEditDataButton
=
self
.
options
.
editData
.
isShow
self
.
operationWidth
+=
5
0
self
.
operationWidth
+=
3
0
}
}
if
(
self
.
options
.
showRefresh
)
{
// 判断是否显示刷新按钮
if
(
self
.
options
.
showRefresh
)
{
// 判断是否显示刷新按钮
self
.
isShowRefresh
=
self
.
options
.
showRefresh
self
.
isShowRefresh
=
self
.
options
.
showRefresh
...
@@ -839,14 +884,14 @@
...
@@ -839,14 +884,14 @@
}
}
if
(
self
.
options
.
showDeleteButton
)
{
// 判断是否显示删除按钮
if
(
self
.
options
.
showDeleteButton
)
{
// 判断是否显示删除按钮
self
.
isShowDeleteButton
=
self
.
options
.
showDeleteButton
self
.
isShowDeleteButton
=
self
.
options
.
showDeleteButton
self
.
operationWidth
+=
5
0
self
.
operationWidth
+=
3
0
}
}
if
(
self
.
options
.
buttonGroup
)
{
// 设置按钮是否以按钮组呈现
if
(
self
.
options
.
buttonGroup
)
{
// 设置按钮是否以按钮组呈现
self
.
buttonGroup
=
self
.
options
.
buttonGroup
self
.
buttonGroup
=
self
.
options
.
buttonGroup
}
}
if
(
self
.
options
.
showDetail
&&
self
.
options
.
showDetail
.
isShow
)
{
// 设置按钮是否以按钮组呈现
if
(
self
.
options
.
showDetail
&&
self
.
options
.
showDetail
.
isShow
)
{
// 设置按钮是否以按钮组呈现
self
.
isShowDetail
=
self
.
options
.
showDetail
.
isShow
self
.
isShowDetail
=
self
.
options
.
showDetail
.
isShow
self
.
operationWidth
+=
5
0
self
.
operationWidth
+=
3
0
}
}
if
(
self
.
options
.
showSelection
)
{
// 设置是否显示多选
if
(
self
.
options
.
showSelection
)
{
// 设置是否显示多选
self
.
isShowSelection
=
self
.
options
.
showSelection
self
.
isShowSelection
=
self
.
options
.
showSelection
...
@@ -930,6 +975,10 @@
...
@@ -930,6 +975,10 @@
},
},
getFilterOperTwin
(
filter
)
{
getFilterOperTwin
(
filter
)
{
return
Object
.
keys
(
filter
[
this
.
getFilterColumn
(
filter
)])[
1
]
return
Object
.
keys
(
filter
[
this
.
getFilterColumn
(
filter
)])[
1
]
},
dialogClose
()
{
this
.
dialogFormVisible
=
false
this
.
getList
()
}
}
}
}
}
}
...
...
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