Commit 39acbc07 authored by miaohaoyun's avatar miaohaoyun

Merge branch 'mhy2' into 'master'

Mhy2

See merge request !26
parents d5e1c8fb 7aee102d
...@@ -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>
...@@ -94,7 +103,7 @@ export default { ...@@ -94,7 +103,7 @@ export default {
pageSize: 10 pageSize: 10
}, },
loading: false, // 加载标识 loading: false, // 加载标识
selections: [] // 列表选中列 selections: [], // 列表选中列
} }
}, },
methods: { methods: {
...@@ -165,5 +174,27 @@ export default { ...@@ -165,5 +174,27 @@ export default {
</script> </script>
<style scoped> <style scoped>
.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>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment