Browse Source

角色管理

test
wangxy 3 years ago
parent
commit
a24e76cbc4
1 changed files with 8 additions and 7 deletions
  1. +8
    -7
      src/views/system/role/index.vue

+ 8
- 7
src/views/system/role/index.vue View File

@ -45,6 +45,7 @@
</div>
</template>
<script>
import { put } from "@/server/api.js";
import { ListMixin } from "@/mixins/ListMixin";
export default {
mixins: [ListMixin],
@ -69,22 +70,22 @@ export default {
},
//
handleStatusChange(row) {
if (row['User-UserId']) {
const text = row['User-Status'] === '0' ? '启用' : '停用'
this.$confirm('确认要"' + text + '""' + row['User-UserId'] + '"用户吗?', '警告', {
if (row['Role-RoleId']) {
const text = row['Role-Status'] === '0' ? '启用' : '停用'
this.$confirm('确认要"' + text + '""' + row['Role-RoleId'] + '"角色吗?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let params = {
'User-Status': row['User-Status'],
'User-UserId': row['User-UserId']
'Role-Status': row['Role-Status'],
'Role-RoleId': row['Role-RoleId']
}
return put('/admin/base/user/updatestatus', params)
return put('/admin/base/role/updatestatus', params)
}).then(() => {
this.msgSuccess(text + '成功')
}).catch(() => {
row['User-Status'] = row['User-Status'] === '0' ? '1' : '0'
row['Role-Status'] = row['Role-Status'] === '0' ? '1' : '0'
})
}
},


Loading…
Cancel
Save