diff --git a/src/api/system/dept.ts b/src/api/system/dept.ts index 0e341bbc..d84b7058 100644 --- a/src/api/system/dept.ts +++ b/src/api/system/dept.ts @@ -1,13 +1,5 @@ import request from '@/utils/request' -// export function list(queryParams:object) { -// return request({ -// url: '/youlai-admin/api/v1/oauth-clients', -// method: 'get', -// params: queryParams -// }) -// } - export const listDept = (queryParams?: object) => { return request({ url: '/youlai-admin/api/v1/depts/table', @@ -18,15 +10,11 @@ export const listDept = (queryParams?: object) => { export const getDept = (deptId: any) => { return request({ - url: '/youlai-admin/api/v1/depts/select', + url: '/youlai-admin/api/v1/depts/'+deptId, method: 'get' }) } -// export const listDeptExcludeChild = (deptId: any) => { -// return https().request>(`system/dept/list/exclude/${deptId}`, Method.GET, undefined, ContentType.form) -// } - export const delDept = (deptId: any) => { return request({ url: '/youlai-admin/api/v1/depts/'+deptId, @@ -34,10 +22,7 @@ export const delDept = (deptId: any) => { }) } - - // 新增部门 - export const addDept = (data: any) => { return request({ url: '/youlai-admin/api/v1/depts', @@ -47,22 +32,18 @@ export const addDept = (data: any) => { } // 修改部门 - -export const updateDept = (data: any) => { +export const updateDept = (id:string,data: any) => { return request({ - url: '/youlai-admin/api/v1/depts/' + id, + url: '/youlai-admin/api/v1/depts/'+id, method: 'put', data: data }) } -// // 根据角色ID查询部门树结构 -// export const roleDeptTreeselect = (roleId: number | string) => { -// return https().request(`system/dept/roleDeptTreeselect/${roleId}`, Method.GET, undefined, ContentType.form) -// } -// -// // 查询部门下拉树结构 -// -// export const treeselect = () => { -// return https().request>('system/dept/treeselect', Method.GET, undefined, ContentType.form) -// } + +export const getDeptSelectList = ()=> { + return request({ + url: '/youlai-admin/api/v1/depts/select', + method: 'get' + }) +} diff --git a/src/components/TreeSelect/index.vue b/src/components/TreeSelect/index.vue index 76289cb4..5d0087be 100644 --- a/src/components/TreeSelect/index.vue +++ b/src/components/TreeSelect/index.vue @@ -38,7 +38,7 @@ export default defineComponent({ name: 'ElTreeSelect', props: { placeholder: { - type: String, + type: [String,Number], default: '' }, user: { @@ -50,7 +50,7 @@ export default defineComponent({ // 选项列表数据(树形结构的对象数组) options: { type: Array, required: true }, // 初始值 - defalut: { type: Number, default: null }, + defalut: { type: [String,Number], default: null }, // 可清空选项 clearable: { type: Boolean, default: true }, // 自动收起 @@ -71,9 +71,6 @@ export default defineComponent({ }, emits: ['callBack'], setup(props, ctx) { - console.log(props.options) - console.log(props.treeProps) - const instance = getCurrentInstance() as any const state = reactive({ valueId: 0, @@ -105,8 +102,6 @@ export default defineComponent({ // 处理默认值并显示 const defaultValue = () => { - console.log('xxxxxx') - if (props.defalut !== null) { const deafaultModels = props.originOptions.filter((item: any) => { return item[props.treeProps.value] === props.defalut @@ -169,7 +164,7 @@ export default defineComponent({