taiji_caozhaorui il y a 2 semaines
Parent
commit
e29715df35

+ 1 - 0
src/views/manage/center/role/index.vue

@@ -202,6 +202,7 @@ const onPage = (pageNum, pageSize) => {
   const params = {
     page: state.query.page.pageNum,
     size: state.query.page.pageSize,
+    tenantId: AppStore.tenantInfo?.id,
   }
   //  添加表单参数
   for (const [k, v] of Object.entries(state.query.formReal)) {

+ 5 - 1
src/views/manage/center/user/detail.vue

@@ -171,7 +171,11 @@ watch(
 )
 const initDictionary = () => {
   if (state.roleOptions.length === 0) {
-    rolesPage({ page: 1, size: 100000 }).then(({ data }: any) => {
+    rolesPage({
+      page: 1,
+      size: 100000,
+      tenantId: AppStore.tenantInfo?.id,
+    }).then(({ data }: any) => {
       state.roleOptions = data.content || []
     })
   }

+ 17 - 4
src/views/manage/center/user/index.vue

@@ -234,7 +234,9 @@ const state: any = reactive({
       pageSize: 20,
     },
     form: {},
-    formReal: {},
+    formReal: {
+      tenantId: AppStore.tenantInfo?.id,
+    },
     sort: {},
     result: {
       total: 0,
@@ -394,14 +396,25 @@ onMounted(() => {
   initDictionary()
   onReset()
 })
-const initDictionary = () => {
-  DictionaryStore.initTenants()
+watch(
+  () => state.query.form.tenantId,
+  () => initRoles(),
+)
+const initRoles = () => {
   state.invite.roleOptions = []
-  rolesPage({ page: 1, size: 100000 }).then(({ data }: any) => {
+  rolesPage({
+    page: 1,
+    size: 100000,
+    tenantId: state.query.form.tenantId,
+  }).then(({ data }: any) => {
     state.invite.roleOptions =
       data.content?.map((v) => ({ label: v.roleName, value: v.id })) || []
   })
 }
+const initDictionary = () => {
+  DictionaryStore.initTenants()
+  initRoles()
+}
 </script>
 
 <style lang="scss" scoped></style>