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
44c06920
Commit
44c06920
authored
Mar 28, 2018
by
王康
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of 115.28.80.125:softwarefactory/vueelementtemplate
parents
3e3e18ee
ae5f2179
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
2 deletions
+23
-2
HmComplexTable.vue
src/views/haomo/components/tables/HmComplexTable.vue
+16
-1
index.vue
src/views/haomo/components/tables/index.vue
+7
-1
No files found.
src/views/haomo/components/tables/HmComplexTable.vue
View file @
44c06920
...
@@ -102,7 +102,7 @@
...
@@ -102,7 +102,7 @@
<!-- 表格 -->
<!-- 表格 -->
<el-table
:data=
"list"
v-loading=
"listLoading"
element-loading-text=
"给我一点时间"
border
fit
highlight-current-row
<el-table
:data=
"list"
v-loading=
"listLoading"
element-loading-text=
"给我一点时间"
border
fit
highlight-current-row
style=
"width: 100%"
@
selection-change=
"handleSelectionChange"
@
sort-change=
"sortChange"
>
style=
"width: 100%"
@
selection-change=
"handleSelectionChange"
@
sort-change=
"sortChange"
@
current-change=
"tableCurrentChange"
>
<el-table-column
type=
"index"
:index=
"indexMethod"
label=
"序号"
width=
"50px"
></el-table-column>
<el-table-column
type=
"index"
:index=
"indexMethod"
label=
"序号"
width=
"50px"
></el-table-column>
<el-table-column
type=
"selection"
width=
"55"
v-if=
"isShowSelection"
></el-table-column>
<el-table-column
type=
"selection"
width=
"55"
v-if=
"isShowSelection"
></el-table-column>
<el-table-column
v-for=
"(column,index) in showColumns"
:key=
"index"
align=
"center"
:label=
"column.name"
:prop=
"column.codeCamel"
:sortable=
"column.isSort"
>
<el-table-column
v-for=
"(column,index) in showColumns"
:key=
"index"
align=
"center"
:label=
"column.name"
:prop=
"column.codeCamel"
:sortable=
"column.isSort"
>
...
@@ -116,6 +116,7 @@
...
@@ -116,6 +116,7 @@
<el-button
@
click=
"openDialog('editData',scope.row)"
v-if=
"isShowEditDataButton"
type=
"text"
size=
"small"
>
编辑
</el-button>
<el-button
@
click=
"openDialog('editData',scope.row)"
v-if=
"isShowEditDataButton"
type=
"text"
size=
"small"
>
编辑
</el-button>
<el-button
@
click=
"deleteData(scope.row)"
type=
"text"
v-if=
"isShowDeleteButton"
size=
"small"
>
删除
</el-button>
<el-button
@
click=
"deleteData(scope.row)"
type=
"text"
v-if=
"isShowDeleteButton"
size=
"small"
>
删除
</el-button>
<el-button
@
click=
"openDialog('detail',scope.row)"
type=
"text"
v-if=
"isShowDetail"
size=
"small"
>
详情
</el-button>
<el-button
@
click=
"openDialog('detail',scope.row)"
type=
"text"
v-if=
"isShowDetail"
size=
"small"
>
详情
</el-button>
<el-button
@
click=
"openDialog('detail',scope.row)"
type=
"text"
v-if=
"isShowDetail"
size=
"small"
></el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -285,6 +286,7 @@
...
@@ -285,6 +286,7 @@
* "showRefresh": false, //默认不显示刷新按钮
* "showRefresh": false, //默认不显示刷新按钮
* "showDeleteButton": false, //默认不显示删除按钮
* "showDeleteButton": false, //默认不显示删除按钮
* "buttonGroup": false //默认不以按钮组的方式呈现button
* "buttonGroup": false //默认不以按钮组的方式呈现button
* tableCurrentChange(value){} // 设置点击某行所执行方法
* showDetail: {
* showDetail: {
* isShow: false, // 默认不显示详情
* isShow: false, // 默认不显示详情
* showColumns: ['mobile', 'loginid', 'username', 'email']
* showColumns: ['mobile', 'loginid', 'username', 'email']
...
@@ -552,6 +554,13 @@
...
@@ -552,6 +554,13 @@
self
.
listLoading
=
false
self
.
listLoading
=
false
})
})
},
},
tableCurrentChange
(
value
)
{
const
self
=
this
if
(
self
.
options
&&
self
.
options
.
tableCurrentChange
)
{
console
.
log
(
'value'
,
value
)
self
.
options
.
tableCurrentChange
(
value
)
}
},
// 数据库字段转化显示,例如(0=否,1=是)
// 数据库字段转化显示,例如(0=否,1=是)
changeValue
(
data
)
{
changeValue
(
data
)
{
const
self
=
this
const
self
=
this
...
@@ -595,12 +604,18 @@
...
@@ -595,12 +604,18 @@
if
(
type
===
'editData'
)
{
if
(
type
===
'editData'
)
{
self
.
dialogName
=
'编辑'
self
.
dialogName
=
'编辑'
self
.
showUserColumns
=
self
.
options
.
editData
.
showUserColumns
self
.
showUserColumns
=
self
.
options
.
editData
.
showUserColumns
if
(
self
.
options
.
editData
.
showUserButtons
)
{
self
.
showUserButtons
=
self
.
options
.
editData
.
showUserButtons
}
self
.
formSchema
=
self
.
options
.
editData
.
formSchema
self
.
formSchema
=
self
.
options
.
editData
.
formSchema
self
.
layout
=
self
.
options
.
editData
.
layout
self
.
layout
=
self
.
options
.
editData
.
layout
self
.
tableId
=
data
.
id
self
.
tableId
=
data
.
id
}
}
if
(
type
===
'newData'
)
{
if
(
type
===
'newData'
)
{
self
.
dialogName
=
'新建'
self
.
dialogName
=
'新建'
if
(
self
.
options
.
newData
.
showUserButtons
)
{
self
.
showUserButtons
=
self
.
options
.
newData
.
showUserButtons
}
self
.
showUserColumns
=
self
.
options
.
newData
.
showUserColumns
self
.
showUserColumns
=
self
.
options
.
newData
.
showUserColumns
self
.
formSchema
=
self
.
options
.
newData
.
formSchema
self
.
formSchema
=
self
.
options
.
newData
.
formSchema
self
.
layout
=
self
.
options
.
newData
.
layout
self
.
layout
=
self
.
options
.
newData
.
layout
...
...
src/views/haomo/components/tables/index.vue
View file @
44c06920
...
@@ -60,12 +60,14 @@
...
@@ -60,12 +60,14 @@
{
name
:
'登录ID'
,
codeCamel
:
'loginid'
,
widgetType
:
1
},
{
name
:
'登录ID'
,
codeCamel
:
'loginid'
,
widgetType
:
1
},
{
name
:
'类型'
,
codeCamel
:
'type'
,
widgetType
:
1
}
{
name
:
'类型'
,
codeCamel
:
'type'
,
widgetType
:
1
}
],
],
showUserButtons
:
[],
formSchema
:
schema
[
'HmUser'
],
formSchema
:
schema
[
'HmUser'
],
layout
:
{
left
:
0
,
middle
:
24
,
right
:
0
}
layout
:
{
left
:
0
,
middle
:
24
,
right
:
0
}
},
},
editData
:
{
editData
:
{
isShow
:
true
,
isShow
:
true
,
showUserColumns
:
[{
name
:
'姓名'
,
codeCamel
:
'username'
,
widgetType
:
1
}],
showUserColumns
:
[{
name
:
'姓名'
,
codeCamel
:
'username'
,
widgetType
:
1
}],
showUserButtons
:
[],
formSchema
:
schema
[
'HmUser'
],
formSchema
:
schema
[
'HmUser'
],
layout
:
{
left
:
0
,
middle
:
24
,
right
:
0
}
layout
:
{
left
:
0
,
middle
:
24
,
right
:
0
}
},
},
...
@@ -77,7 +79,8 @@
...
@@ -77,7 +79,8 @@
showDetail
:
{
showDetail
:
{
isShow
:
true
,
isShow
:
true
,
showColumns
:
[
'mobile'
,
'loginid'
,
'username'
,
'email'
]
showColumns
:
[
'mobile'
,
'loginid'
,
'username'
,
'email'
]
}
},
tableCurrentChange
(
value
)
{}
// dataProcessing(value, params, definedOperate) {} // 处理返回后的数据,必须return 处理后的数据
// dataProcessing(value, params, definedOperate) {} // 处理返回后的数据,必须return 处理后的数据
}
}
this
.
userDefined
=
{
this
.
userDefined
=
{
...
@@ -89,6 +92,9 @@
...
@@ -89,6 +92,9 @@
{
type
:
'input'
,
label
:
''
,
placeholder
:
'邮箱'
,
code
:
'email'
,
value
:
''
},
{
type
:
'input'
,
label
:
''
,
placeholder
:
'邮箱'
,
code
:
'email'
,
value
:
''
},
{
type
:
'datetime'
,
label
:
''
,
placeholder
:
'创建时间'
,
code
:
'createTime'
,
value
:
''
}
{
type
:
'datetime'
,
label
:
''
,
placeholder
:
'创建时间'
,
code
:
'createTime'
,
value
:
''
}
],
],
definedOperation
:
{
label
:
'测试'
},
definedEdit
()
{
definedEdit
()
{
},
},
...
...
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