1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- import Http from '../../utils/net/Http'
- import Urls from '../Urls'
- import { ElMessage } from 'element-plus'
- import { ref } from 'vue'
- const role = Urls.role
- export interface Role {
-
- codes?: string
-
- codes_cn?: string
-
- id: number
-
- name: string
-
- remark: string
-
- valid: number
- create_time?: Date | string
- update_time?: Date | string
- delete_time?: Date | string
- }
- export interface CodeTree {
- code: string
- cn: string
- children?: CodeTree[]
- }
- export const list = async () => {
- const res = await Http.get(role.list)
- return res
- }
- export const init = async () => {
- const roles = ref(null)
- const res = await list()
- roles.value = res.data
- return roles
- }
- export const create = async (param: object) => {
- const res = await Http.post(role.add, param)
- return res
- }
- export const update = async (param: any) => {
- const res = await Http.post(role.update, param)
- return res
- }
- export const del = async (id: number[]) => {
- const res = await Http.post(role.del, { id })
- return res
- }
- export const codes = async () => {
- const res = await Http.get(role.codes)
- return res
- }
|