li.shaoyi 8 months ago
parent
commit
1265770d48

+ 2 - 2
src/packages/pc/components/layouts/sidebar/index.vue

@@ -6,9 +6,9 @@
     <div class="app-sidebar__menu">
       <app-sidemenu :collapse="globalStore.isMobile ? false : collapse" @select="routerTo" />
     </div>
-    <div :class="['app-sidebar__copyright', globalStore.isMobile ? 'is-show' : collapse && 'is-hide']">
+    <!-- <div :class="['app-sidebar__copyright', globalStore.isMobile ? 'is-show' : collapse && 'is-hide']">
       <span>&copy;{{ year }} Muchinfo</span>
-    </div>
+    </div> -->
     <div :class="['app-sidebar__mask', collapse && 'is-hide']" @click="hideSidebar()" v-if="globalStore.isMobile"></div>
   </el-scrollbar>
 </template>

+ 2 - 2
src/packages/pc/views/investor/manage/user/components/details/view.vue

@@ -37,11 +37,11 @@
                 {{ handleNoneValue(oldData?.userinfoDetailVo.pathName + value) }}
             </template>
             <!-- 法人身份证正面 -->
-            <template #legalcardfrontphotourl="{ value }">
+            <template #legalCardFrontPhotoUrl="{ value }">
                 <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
             </template>
             <!-- 法人身份证反面 -->
-            <template #legalcardbackphotourl="{ value }">
+            <template #legalCardBackPhotoUrl="{ value }">
                 <el-image :src="value" fit="cover" lazy style="width: 128px; height: 72px" />
             </template>
             <!-- 法人授权书 -->

+ 5 - 5
src/packages/pc/views/investor/manage/user/components/login/index.vue

@@ -14,18 +14,18 @@
                 <!-- 操作 -->
                 <template #operate="{ row }">
                     <el-button size="small" icon="Document" @click="showComponent('Log', row)" circle plain />
+                    <el-button size="small" icon="Key" @click="showComponent('Password', row)" circle plain
+                        v-if="[1, 2].includes(row.loginstatus)" />
                     <template v-if="row.loginstatus === 1">
-                        <el-button size="small" icon="Key" @click="showComponent('Password', row)" circle plain />
                         <el-button size="small" icon="Lock" @click="showComponent('Lock', row)" circle plain />
                         <el-button size="small" icon="SwitchButton" @click="showComponent('Delete', row)" circle plain
                             v-if="userStore.userInfo.releType === 1" />
+                        <el-button size="small" icon="Iphone" @click="showComponent('Details', row)" circle plain />
                     </template>
-                    <el-button size="small" icon="RefreshLeft" @click="showComponent('Recover', row)" circle plain
-                        v-if="userStore.userInfo.releType === 1 && row.loginstatus === 3" />
                     <el-button size="small" icon="Unlock" @click="showComponent('Lock', row)" circle plain
                         v-if="row.loginstatus === 2" />
-                    <el-button size="small" icon="Iphone" @click="showComponent('Details', row)" circle plain
-                        v-if="row.loginstatus === 1" />
+                    <el-button size="small" icon="RefreshLeft" @click="showComponent('Recover', row)" circle plain
+                        v-if="row.loginstatus === 3" />
                 </template>
                 <template #footer>
                     <app-pagination :total="total" v-model:page-size="pageSize" v-model:page-index="pageIndex"

+ 4 - 2
src/packages/pc/views/investor/user/open/components/details/index.vue

@@ -33,7 +33,8 @@
         </app-table-details>
         <template #footer>
             <el-button @click="onCancel(false)">{{ t('operation.close') }}</el-button>
-            <template v-if="audit">
+            <template
+                v-if="audit && (userStore.userInfo.releType === 1 || (userStore.userInfo.releType === 2 && [2, 4].includes(record.userState)))">
                 <el-button type="primary" @click="onAudit(1)">{{ t('investor.user.open.details.aduit') }}</el-button>
                 <el-button type="primary" @click="onAudit(0)">{{ t('investor.user.open.details.unaduit') }}</el-button>
             </template>
@@ -51,9 +52,9 @@ import { useEnum } from '@/hooks/enum'
 import { useRequest } from '@/hooks/request'
 import { queryInvestorDetail, investorProcess } from '@/services/api/investor'
 import { CellProp } from '@pc/components/base/table-details/types'
+import { useUserStore, i18n } from '@/stores'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
 import AppTableDetails from '@pc/components/base/table-details/index.vue'
-import { i18n } from '@/stores'
 
 const props = defineProps({
     record: {
@@ -64,6 +65,7 @@ const props = defineProps({
 })
 
 const { global: { t } } = i18n
+const userStore = useUserStore()
 const show = shallowRef(true)
 const refresh = shallowRef(false)
 

+ 19 - 3
src/packages/pc/views/member/institution/role/components/details/index.vue

@@ -6,8 +6,8 @@
                 {{ getSensitiveWords() }}
             </template>
             <template #menuids>
-                <el-scrollbar max-height="300px" style="width: 100%;">
-                    <el-tree :data="routerStore.userRoutes" :props="{ label: 'title' }" node-key="resourceCode" />
+                <el-scrollbar max-height="300px" style="width: 100%; border: 1px solid #f2f2f2;">
+                    <el-tree :data="filteredRoutes" :props="{ label: 'title' }" node-key="resourceCode" />
                 </el-scrollbar>
             </template>
         </app-table-details>
@@ -20,6 +20,7 @@
 <script lang="ts" setup>
 import { ref, PropType } from 'vue'
 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'
@@ -36,6 +37,7 @@ const props = defineProps({
 
 const { global: { t } } = i18n
 const routerStore = useRouterStore()
+const filteredRoutes = ref<Model.MenusRsp[]>([])
 const show = ref(true)
 
 const getSensitiveWords = () => {
@@ -46,13 +48,27 @@ const getSensitiveWords = () => {
     ]
     const checkedValues = data.value?.sensitivefields.split(',') ?? []
     const selectedOptions = options.filter((e) => checkedValues.includes(e.value.toString()))
-    return selectedOptions.map((e) => e.label).join(',')
+    const label = selectedOptions.map((e) => e.label).join(',')
+    return handleNoneValue(label)
 }
 
 const { data, loading } = useRequest(queryDetail, {
     params: {
         autoId: props.record.autoid
     },
+    onSuccess: (res) => {
+        const codeSet = new Set(res.data.menuids)
+        // 递归过滤菜单
+        filteredRoutes.value = routerStore.userRoutes.filter(menu => {
+            if (codeSet.has(menu.resourceCode)) {
+                return true
+            }
+            if (menu.children && menu.children.length) {
+                return menu.children.some(child => codeSet.has(child.resourceCode))
+            }
+            return false
+        })
+    },
     onError: (err) => {
         ElMessage.error(err)
     }

+ 53 - 5
src/packages/pc/views/member/institution/role/components/users/index.vue

@@ -1,17 +1,65 @@
 <!-- 会员机构管理-机构管理-系统角色管理-用户 -->
 <template>
-    <app-drawer title="用户" width="900" v-model:show="show" :loading="loading" :refresh="refresh">
+    <app-drawer title="关联用户" width="480" v-model:show="show" :loading="loading">
+        <app-table :data="dataList" :columns="tableColumns" :highlight-current-row="false"
+            :span-method="objectSpanMethod" />
+        <template #footer>
+            <el-button @click="onCancel">{{ t('operation.cancel') }}</el-button>
+        </template>
     </app-drawer>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, PropType, defineAsyncComponent } from 'vue'
+import { shallowRef, PropType } from 'vue'
+import { ElMessage } from 'element-plus'
+import { useRequest } from '@/hooks/request'
+import { queryRoleUser } from '@/services/api/admin'
 import { i18n } from '@/stores'
 import AppDrawer from '@pc/components/base/drawer/index.vue'
+import AppTable from '@pc/components/base/table/index.vue'
 
-const { global: { t } } = i18n
+const props = defineProps({
+    record: {
+        type: Object as PropType<Model.RoleRsp>,
+        required: true
+    }
+})
 
+const t = i18n.global.t
 const show = shallowRef(true)
-const refresh = shallowRef(false)
-const loading = shallowRef(false)
+
+const { dataList, loading } = useRequest(queryRoleUser, {
+    params: {
+        autoId: props.record.autoid
+    },
+    onError: (err) => {
+        ElMessage.error(err)
+    }
+})
+
+const tableColumns: Model.TableColumn[] = [
+    { field: 'rolename', label: '角色名称', formatValue: () => props.record.rolename },
+    { field: 'username', label: '用户名称' }
+]
+
+// 计算行合并值
+const objectSpanMethod = (data: { rowIndex: number; columnIndex: number; }) => {
+    if (data.columnIndex === 0) {
+        if (data.rowIndex === 0) {
+            return {
+                rowspan: dataList.value.length,
+                colspan: 1,
+            }
+        } else {
+            return {
+                rowspan: 0,
+                colspan: 0,
+            }
+        }
+    }
+}
+
+const onCancel = () => {
+    show.value = false
+}
 </script>

+ 7 - 0
src/services/api/admin/index.ts

@@ -57,6 +57,13 @@ export function queryDetail(options: CommonFetchOptions<{ request: Model.RoleDet
 }
 
 /**
+ * 会员机构管理-->机构管理-->系统角色管理-->获取当前角色关联关系
+ */
+export function queryRoleUser(options: CommonFetchOptions<{ request: Model.RoleUserReq; response: Model.RoleUserRsp[]; }>) {
+    return httpClient.commonRequest('/organDetail/queryRoleUser', 'get', options)
+}
+
+/**
  * 处理角色菜单信息
  */
 export function dealRoleMenus(options: CommonFetchOptions<{ request: Partial<Model.RoleRsp>; }>) {

+ 36 - 0
src/types/model/admin.d.ts

@@ -26,6 +26,42 @@ declare namespace Model {
         autoId: number;
     }
 
+    /** 会员机构管理-->机构管理-->系统角色管理-->获取当前角色关联关系 请求 */
+    interface RoleUserReq {
+        autoId: number;
+    }
+
+    /** 会员机构管理-->机构管理-->系统角色管理-->获取当前角色关联关系 响应 */
+    interface RoleUserRsp {
+        accountNonExpired: boolean;
+        accountNonLocked: boolean;
+        areauserid: number; // 所属机构ID
+        authorities: {
+            authority: string;
+        }[];
+        autoid: number; // 自增ID
+        credentialsNonExpired: boolean;
+        enabled: boolean;
+        isdefault: number; // 是否默认管理员 - 0:不是默认 1:默认管理员
+        logincode: string; // 用户登录账号,唯一索引
+        loginfailnum: number; // 登录失败次数
+        loginip: string; // 登录IP
+        loginport: number; // 登录端口
+        loginstatus: number; // 登录状态:1未登录 2已登录
+        logintime: string; // 登录时间
+        managerstatus: number; // 用户状态: 1启用 2停用 3锁定(密码错误时锁定)
+        managertype: number; // 账号类型 - 1:管理员 2:交易员
+        modifytime: string; // 修改时间
+        onymac: number; // 是否启用MAC地址 - 0:否 1:是
+        password: string; // 加密方式采用 用户名+密码 ,采用 SHA 算法
+        pwdexpdate: string; // 密码失效日期
+        reletype: number; // 用户类型 - 1- 交易所管理员 2- 机构管理员 3-子机构管理员
+        remark: string; // 备注
+        systemtype: number; // 系统类型 - 1:旧管理端 2:新管理端
+        uploginid: number; // 修改人ID
+        username: string; // 用户姓名
+    }
+
     /** 管理员查询 请求 */
     interface SystemmanagerReq {
         areaUserId?: number; // 所属机构