新增角色
This commit is contained in:
parent
9aa1425cfe
commit
f29085ce45
@ -47,3 +47,14 @@ export function getRoleDetail(id) {
|
|||||||
url: `/sys/role/${id}`
|
url: `/sys/role/${id}`
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** *
|
||||||
|
* 新增角色
|
||||||
|
* ***/
|
||||||
|
export function addRole(data) {
|
||||||
|
return request({
|
||||||
|
url: '/sys/role',
|
||||||
|
data,
|
||||||
|
method: 'post'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { updateRole, getRoleDetail } from '@/api/setting'
|
import { updateRole, getRoleDetail, addRole } from '@/api/setting'
|
||||||
export default {
|
export default {
|
||||||
components: {},
|
components: {},
|
||||||
props: {
|
props: {
|
||||||
@ -65,8 +65,7 @@ export default {
|
|||||||
await updateRole(this.roleForm)
|
await updateRole(this.roleForm)
|
||||||
} else {
|
} else {
|
||||||
// 新增场景
|
// 新增场景
|
||||||
// 接口要求拼接一个pid
|
await addRole(this.roleForm)
|
||||||
// await addDepartments({ ...this.formData, pid: this.treeNode.id })
|
|
||||||
}
|
}
|
||||||
// 更新数据
|
// 更新数据
|
||||||
this.$emit('editRoleOK')
|
this.$emit('editRoleOK')
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="small"
|
size="small"
|
||||||
type="primary"
|
type="primary"
|
||||||
|
@click="showDialog = true"
|
||||||
>新增角色</el-button>
|
>新增角色</el-button>
|
||||||
</el-row>
|
</el-row>
|
||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
@ -87,7 +88,6 @@ export default {
|
|||||||
},
|
},
|
||||||
// 编辑弹窗
|
// 编辑弹窗
|
||||||
showDialog: false
|
showDialog: false
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user