|
@@ -6,7 +6,7 @@
|
|
</evan-form-item>
|
|
</evan-form-item>
|
|
<view class="role-box">
|
|
<view class="role-box">
|
|
<view>岗位权限:</view>
|
|
<view>岗位权限:</view>
|
|
- <roleAuthSet ref="roleSet" @addPowerOk="addPowerOk"></roleAuthSet>
|
|
|
|
|
|
+ <roleAuthSet ref="roleSet"></roleAuthSet>
|
|
</view>
|
|
</view>
|
|
<view class="form-footer-btn flex align_center justify_center">
|
|
<view class="form-footer-btn flex align_center justify_center">
|
|
<u-button shape="circle" v-if="!formData.isEnable" @click="delRole()" :custom-style="{width:'300rpx' }">删除</u-button>
|
|
<u-button shape="circle" v-if="!formData.isEnable" @click="delRole()" :custom-style="{width:'300rpx' }">删除</u-button>
|
|
@@ -19,7 +19,7 @@
|
|
<script>
|
|
<script>
|
|
import roleAuthSet from './roleAuthSet.vue'
|
|
import roleAuthSet from './roleAuthSet.vue'
|
|
import { clzConfirm } from '@/libs/tools.js'
|
|
import { clzConfirm } from '@/libs/tools.js'
|
|
- import {saveRolePower, delectRolePower} from '@/api/powerRole-md.js'
|
|
|
|
|
|
+ import {saveRoleMenu, delectRolePower} from '@/api/powerRole-md.js'
|
|
export default{
|
|
export default{
|
|
name:"formData",
|
|
name:"formData",
|
|
components:{
|
|
components:{
|
|
@@ -78,22 +78,21 @@
|
|
this.$refs[name].validate((valid) => {
|
|
this.$refs[name].validate((valid) => {
|
|
if (valid) {
|
|
if (valid) {
|
|
this.loading = true
|
|
this.loading = true
|
|
- this.$refs.roleSet.handleSubmit()
|
|
|
|
|
|
+ const menusIds = this.$refs.roleSet.getSelMenu()
|
|
|
|
+ console.log(menusIds,'menus--')
|
|
|
|
+ const params = Object.assign(this.formData,menusIds)
|
|
|
|
+ saveRoleMenu(this.formData).then(res=>{
|
|
|
|
+ if(res.status == 200){
|
|
|
|
+ this.cancel()
|
|
|
|
+ }
|
|
|
|
+ uni.showToast({icon: 'none', title: res.message})
|
|
|
|
+ this.loading = false
|
|
|
|
+ }).catch(err=>{
|
|
|
|
+ this.loading = false
|
|
|
|
+ })
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- // 保存角色
|
|
|
|
- addPowerOk(){
|
|
|
|
- saveRolePower(this.formData).then(res=>{
|
|
|
|
- if(res.status == 200){
|
|
|
|
- this.cancel()
|
|
|
|
- }
|
|
|
|
- uni.showToast({icon: 'none', title: res.message})
|
|
|
|
- this.loading = false
|
|
|
|
- }).catch(err=>{
|
|
|
|
- this.loading = false
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
// 删除角色
|
|
// 删除角色
|
|
delRole(){
|
|
delRole(){
|
|
let _this = this
|
|
let _this = this
|