Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xichonght
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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
zhangdishen
xichonght
Commits
a17cdc74
Commit
a17cdc74
authored
Aug 12, 2019
by
ytbdmhy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
禁用启用更换成switch
parent
8533a855
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
8 deletions
+39
-8
KtTable.vue
xichongSys/src/views/Core/KtTable.vue
+39
-8
No files found.
xichongSys/src/views/Core/KtTable.vue
View file @
a17cdc74
...
@@ -13,12 +13,21 @@
...
@@ -13,12 +13,21 @@
<el-table-column
:label=
"$t('action.operation')"
width=
"185"
fixed=
"right"
v-if=
"showOperation"
header-align=
"center"
align=
"center"
>
<el-table-column
:label=
"$t('action.operation')"
width=
"185"
fixed=
"right"
v-if=
"showOperation"
header-align=
"center"
align=
"center"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<kt-button
icon=
"fa fa-edit"
:label=
"$t('action.edit')"
:perms=
"permsEdit"
:size=
"size"
@
click=
"handleEdit(scope.$index, scope.row)"
style=
"float: left"
/>
<kt-button
icon=
"fa fa-edit"
:label=
"$t('action.edit')"
:perms=
"permsEdit"
:size=
"size"
@
click=
"handleEdit(scope.$index, scope.row)"
style=
"float: left"
/>
<div
v-if=
"scope.row.status == 1"
>
<el-switch
<kt-button
icon=
"fa fa-trash"
label=
"禁用"
:perms=
"permsDelete"
:size=
"size"
type=
"danger"
@
click=
"handleDelete(scope.$index, scope.row)"
/>
class=
"statusSwitch"
</div>
style=
"display: block"
<div
v-else
>
v-model=
"scope.row.status==0?true:false"
<kt-button
icon=
"fa fa-check-circle"
label=
"启用"
:perms=
"permsDelete"
:size=
"size"
type=
"success"
@
click=
"handleDelete(scope.$index, scope.row)"
/>
active-color=
"#13ce66"
</div>
inactive-color=
"#ff4949"
active-text=
"启"
inactive-text=
"禁"
@
change=
"handleDelete(scope.$index, scope.row)"
>
</el-switch>
<!--
<div
v-if=
"scope.row.status == 1"
>
-->
<!--
<kt-button
icon=
"fa fa-trash"
label=
"禁用"
:perms=
"permsDelete"
:size=
"size"
type=
"danger"
@
click=
"handleDelete(scope.$index, scope.row)"
/>
-->
<!--
</div>
-->
<!--
<div
v-else
>
-->
<!--
<kt-button
icon=
"fa fa-check-circle"
label=
"启用"
:perms=
"permsDelete"
:size=
"size"
type=
"success"
@
click=
"handleDelete(scope.$index, scope.row)"
/>
-->
<!--
</div>
-->
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -164,6 +173,28 @@ export default {
...
@@ -164,6 +173,28 @@ export default {
}
}
</
script
>
</
script
>
<
style
scoped
>
<
style
>
.statusSwitch
.el-switch__label
{
position
:
absolute
;
display
:
none
;
color
:
#fff
;
}
/*打开时文字位置设置*/
.statusSwitch
.el-switch__label--right
{
z-index
:
2
;
left
:
92px
;
bottom
:
0px
;
color
:
#000
;
}
/*关闭时文字位置设置*/
.statusSwitch
.el-switch__label--left
{
z-index
:
2
;
right
:
22px
;
bottom
:
0px
;
color
:
#fff
;
}
/*显示文字*/
.statusSwitch
.el-switch__label.is-active
{
display
:
block
;
}
</
style
>
</
style
>
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