diff --git a/src/views/system/user/add.vue b/src/views/system/user/add.vue index af2541d..ec6dae6 100644 --- a/src/views/system/user/add.vue +++ b/src/views/system/user/add.vue @@ -1,9 +1,11 @@ @@ -21,6 +23,7 @@ const cacheStore = useCacheStore(); const route = useRoute() const form = ref(null) +const loading = ref(false) const localData = reactive({ subCompanyIdOpt: [], @@ -185,6 +188,10 @@ const getInfo = async () => { if(!route.query.id) return // 获取详情数据 const { data } = await getUserDetail(route.query.id) + if(data.subCompanyId) { + const res = await getDeptOpt({subCompanyId: data.subCompanyId}) + localData.departmentIdOpt = res.data + } form.value.setValues(data) } @@ -221,11 +228,13 @@ const handleBack = () => { history.back() } -onMounted(()=>{ +onMounted(async ()=>{ + loading.value = true + await init() if(!route.query.isAdd) { - getInfo() + await getInfo() } - init() + loading.value = false }) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 674b2a4..2c99e60 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -119,8 +119,14 @@ const tableConfig = reactive({ currentRender: ({row, index}) => { return (
- handleEdit(row)}>编辑 - handleDel(row)}>删除 + { + row.userType == 0 ? + '--' : +
+ handleEdit(row)}>编辑 + handleDel(row)}>删除 +
+ }
) }