Handy_Cao 7 月之前
父節點
當前提交
97cf46e109

+ 11 - 7
src/packages/pc/components/modules/roles/index.vue

@@ -24,20 +24,20 @@ import { ElMessage } from 'element-plus'
 import { handleNoneValue } from '@/filters'
 import { useRequest } from '@/hooks/request'
 import { queryDetail } from '@/services/api/admin'
-import { useRouterStore, i18n } from '@/stores'
+import { getAllMenus } from '@/services/api/user'
+import { i18n } from '@/stores'
 import { CellProp } from '@pc/components/base/table-details/types'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 import AppTableDetails from '@pc/components/base/table-details/index.vue'
 
 const props = defineProps({
-    record: {
-        type: Object as PropType<Model.RoleRsp>,
+    roleid: {
+        type: Number,
         required: true
     }
 })
 
 const { global: { t } } = i18n
-const routerStore = useRouterStore()
 const filteredRoutes = ref<Model.MenusRsp[]>([])
 const show = ref(true)
 
@@ -53,9 +53,11 @@ const getSensitiveWords = () => {
     return handleNoneValue(label)
 }
 
+const allMenus = getAllMenus()
+
 const { data, loading } = useRequest(queryDetail, {
     params: {
-        autoId: 1
+        autoId: props.roleid
     },
     onSuccess: (res) => {
         const codeSet = new Set(res.data.menuids)
@@ -83,8 +85,10 @@ const { data, loading } = useRequest(queryDetail, {
             }, [])
         }
 
-        // 递归过滤菜单
-        filteredRoutes.value = filterMenu(routerStore.userRoutes)
+        allMenus.then((res) => {
+            // 递归过滤菜单
+            filteredRoutes.value = filterMenu(res.data)
+        })
     },
     onError: (err) => {
         ElMessage.error(err)

+ 2 - 2
src/packages/pc/views/member/institution/broker/components/edit/index.vue

@@ -60,7 +60,7 @@
             <el-button @click="onCancel(false)">{{ t('operation.cancel') }}</el-button>
             <el-button type="primary" @click="onSubmit">{{ t('operation.save') }}</el-button>
         </template>
-        <component ref="componentRef" v-bind="{ record }" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
+        <component ref="componentRef" v-bind="{ record, roleid: 7 }" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
     </app-drawer>
 </template>
 
@@ -70,7 +70,7 @@ import { ElMessage, FormInstance, FormRules } from 'element-plus'
 import { useComponent } from '@/hooks/component'
 import { i18n } from '@/stores'
 import { handleNoneValue } from '@/filters'
-import { roleadd, initAdd, getOragnDefaultManager, queryRoleDetail } from '@/services/api/member'
+import { roleadd, initAdd, getOragnDefaultManager } from '@/services/api/member'
 import { useRequest } from '@/hooks/request'
 import AppSelectMember from '@pc/components/modules/select-member/index.vue'
 import AppSelectMember2 from '@pc/components/modules/select-member2/index.vue'

+ 1 - 1
src/packages/pc/views/member/institution/industry/components/edit/index.vue

@@ -57,7 +57,7 @@
             <el-button @click="onCancel(false)">{{ t('operation.cancel') }}</el-button>
             <el-button type="primary" @click="onSubmit">{{ t('operation.save') }}</el-button>
         </template>
-        <component ref="componentRef" v-bind="{ record }" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
+        <component ref="componentRef" v-bind="{ record, roleid: 9 }" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
     </app-drawer>
 </template>
 

+ 1 - 1
src/packages/pc/views/member/institution/marketer/components/edit/index.vue

@@ -38,7 +38,7 @@
             <el-button @click="onCancel(false)">{{ t('operation.cancel') }}</el-button>
             <el-button type="primary" @click="onSubmit">{{ t('operation.save') }}</el-button>
         </template>
-        <component ref="componentRef" v-bind="{ record }" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
+        <component ref="componentRef" v-bind="{ record, roleid: 8 }" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
     </app-drawer>
 </template>
 

+ 2 - 2
src/packages/pc/views/member/institution/marketing/components/edit/index.vue

@@ -18,7 +18,7 @@
             <el-button @click="onCancel(false)">{{ t('operation.cancel') }}</el-button>
             <el-button type="primary" @click="onSubmit">{{ t('operation.save') }}</el-button>
         </template>
-        <component ref="componentRef" v-bind="{ record }" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
+        <component ref="componentRef" v-bind="{ record, roleid: 3 }" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
     </app-drawer>
 </template>
 
@@ -54,7 +54,7 @@ const show = shallowRef(true)
 const refresh = shallowRef(false)
 const organSelect = ref<Model.OrganSelectRsp>()
 
-const { data, loading } = useRequest(initAdd, {
+const { loading } = useRequest(initAdd, {
     params: {
         role: 'marketing'
     },

+ 1 - 1
src/packages/pc/views/member/institution/operation/components/edit/index.vue

@@ -27,7 +27,7 @@
             <el-button @click="onCancel(false)">{{ t('operation.cancel') }}</el-button>
             <el-button type="primary" @click="onSubmit">{{ t('operation.save') }}</el-button>
         </template>
-        <component ref="componentRef" v-bind="{ record }" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
+        <component ref="componentRef" v-bind="{ record, roleid: 2 }" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
     </app-drawer>
 </template>
 

+ 1 - 1
src/packages/pc/views/member/institution/self/components/edit/index.vue

@@ -57,7 +57,7 @@
             <el-button @click="onCancel(false)">{{ t('operation.cancel') }}</el-button>
             <el-button type="primary" @click="onSubmit">{{ t('operation.save') }}</el-button>
         </template>
-        <component ref="componentRef" v-bind="{ record }" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
+        <component ref="componentRef" v-bind="{ record, roleid: 6 }" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
     </app-drawer>
 </template>
 

+ 2 - 2
src/packages/pc/views/member/institution/warehouse/components/edit/index.vue

@@ -18,7 +18,7 @@
             <el-button @click="onCancel(false)">{{ t('operation.cancel') }}</el-button>
             <el-button type="primary" @click="onSubmit">{{ t('operation.save') }}</el-button>
         </template>
-        <component ref="componentRef" v-bind="{ record }" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
+        <component ref="componentRef" v-bind="{ record, roleid: 4 }" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
     </app-drawer>
 </template>
 
@@ -54,7 +54,7 @@ const show = shallowRef(true)
 const refresh = shallowRef(false)
 const organSelect = ref<Model.OrganSelectRsp>()
 
-const { data, loading } = useRequest(initAdd, {
+const { loading } = useRequest(initAdd, {
     params: {
         role: 'warehouse'
     },