新增角色

This commit is contained in:
jiutianzhiyu 2021-03-30 04:05:48 +08:00
parent 9aa1425cfe
commit f29085ce45
3 changed files with 14 additions and 4 deletions

View File

@ -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'
})
}

View File

@ -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')

View File

@ -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: {