v1.5 beta版发布,详细查看发行版说明

This commit is contained in:
郑杰
2019-01-20 19:34:40 +08:00
parent 5bb9c0a156
commit 45655e2bec
37 changed files with 634 additions and 293 deletions

View File

@@ -12,18 +12,18 @@
</el-table-column>
<el-table-column label="操作" width="150px" align="center">
<template slot-scope="scope">
<edit v-if="checkPermission(['ADMIN','ROLE_ALL','ROLE_EDIT'])" :permissions="permissions" :data="scope.row" :sup_this="sup_this"/>
<edit v-if="checkPermission(['ADMIN','ROLES_ALL','ROLES_EDIT'])" :permissions="permissions" :data="scope.row" :sup_this="sup_this"/>
<el-popover
v-if="checkPermission(['ADMIN','ROLE_ALL','ROLE_DELETE'])"
v-model="scope.row.delPopover"
v-if="checkPermission(['ADMIN','ROLES_ALL','ROLES_DELETE'])"
:ref="scope.row.id"
placement="top"
width="180">
<p>确定删除本条数据吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="scope.row.delPopover = false">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.$index, scope.row)">确定</el-button>
<el-button size="mini" type="text" @click="$refs[scope.row.id].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="subDelete(scope.row.id)">确定</el-button>
</div>
<el-button slot="reference" :disabled="scope.row.id === 1" type="danger" size="mini" @click="scope.row.delPopover = true">删除</el-button>
<el-button slot="reference" :disabled="scope.row.id === 1" type="danger" size="mini">删除</el-button>
</el-popover>
</template>
</el-table-column>
@@ -40,7 +40,7 @@
<script>
import checkPermission from '@/utils/permission'
import initData from '../../../mixins/initData'
import initData from '@/mixins/initData'
import { del } from '@/api/role'
import { getPermissionTree } from '@/api/permission'
import { parseTime } from '@/utils/index'
@@ -72,11 +72,11 @@ export default {
if (value) { this.params['name'] = value }
return true
},
subDelete(index, row) {
subDelete(id) {
this.delLoading = true
del(row.id).then(res => {
del(id).then(res => {
this.delLoading = false
row.delPopover = false
this.$refs[id].doClose()
this.init()
this.$notify({
title: '删除成功',
@@ -85,7 +85,7 @@ export default {
})
}).catch(err => {
this.delLoading = false
row.delPopover = false
this.$refs[id].doClose()
console.log(err.response.data.message)
})
},

View File

@@ -6,7 +6,7 @@
<!-- 新增 -->
<div style="display: inline-block;margin: 0px 2px;">
<el-button
v-if="checkPermission(['ADMIN','ROLE_ALL','ROLE_CREATE'])"
v-if="checkPermission(['ADMIN','ROLES_ALL','ROLES_CREATE'])"
class="filter-item"
size="mini"
type="primary"