diff --git a/src/api/user/user.js b/src/api/user/user.js index e1eefb0..30d10b5 100644 --- a/src/api/user/user.js +++ b/src/api/user/user.js @@ -1,10 +1,11 @@ import request from '@/utils/request.js' // 根据角色或者部门id获取对应数据 -export const getDeptOpt = () => { +export const getDeptOpt = (params = {}) => { return request({ url: `/admin/mosr/department/option`, - method: 'get' + method: 'get', + params }) } diff --git a/src/fvcomponents/fvSearchForm/index.vue b/src/fvcomponents/fvSearchForm/index.vue index 2b4f2fc..8afc13b 100644 --- a/src/fvcomponents/fvSearchForm/index.vue +++ b/src/fvcomponents/fvSearchForm/index.vue @@ -107,7 +107,7 @@ onMounted(()=>{ } .btn-col { display: flex; - justify-content: flex-end; + justify-content: space-evenly; align-items: center; } \ No newline at end of file diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 0222510..81b688c 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -11,35 +11,35 @@ import { getDeptOpt, getSubCompOpt } from '../../../api/user/user'; const authStore = useAuthStore() -const localData = reactive({ - deptOption:[], - subCompanyOpt:[], -}) - -const deptOption = ref([]) -const subCompanyOpt = ref([]) - const searchConfig = ref([ { label: '子公司ID', prop: 'subCompanyId', - component: shallowRef(fvSelect), + component: 'el-tree-select', props: { placeholder: '请输入', clearable: true, - options: [], - filterable: true + data: [], + filterable: true, + checkStrictly: true + }, + on: { + change: async (val) =>{ + const { data } = await getDeptOpt({subCompanyId: val.value}) + searchConfig.value.find(item=>item.prop == 'departmentId').props.data = data + } } }, { label: '部门ID', prop: 'departmentId', - component: 'el-cascader', + component: 'el-tree-select', props: { placeholder: '请选择', clearable: true, - options: [], - filterable: true + data: [], + filterable: true, + checkStrictly: true } }, { @@ -108,24 +108,36 @@ const tableConfig = reactive({ label: '创建时间', align: 'center', }, + { + prop: 'oper', + label: '操作', + fixed: 'right', + width: '150', + align: 'center', + currentRender: ({row, index}) => { + return ( +