Browse Source

前端用户中心

lusa 1 month ago
parent
commit
eea411c016

+ 2 - 2
ui/sp-storlead-center/src/api/system/dept/index.ts

@@ -4,11 +4,11 @@ import { DeptForm, DeptQuery, DeptVO } from './types';
 
 
 // 查询部门列表
-export const listDeptList = (types: number[], menuId: string | undefined, enable?: number) => {
+export const listDeptList = (types: number[], menuId: string | undefined, enable?: number, appId?: string | number) => {
   return request({
     url: '/sys/dept/orgTree',
     method: 'post',
-    data: { orgTypes: types, reviewTag: 1, scopeMenuId: menuId, enable }
+    data: { orgTypes: types, reviewTag: 1, scopeMenuId: menuId, enable, appId }
   });
 };
 // 查询部门列表

+ 1 - 1
ui/sp-storlead-center/src/settings.ts

@@ -9,7 +9,7 @@ const setting: DefaultSettings = {
   /**
    * 侧边栏主题 深色主题theme-dark,浅色主题theme-light
    */
-  sideTheme: 'theme-dark',
+  sideTheme: 'theme-light',
   /**
    * 是否系统布局配置
    */

+ 1 - 1
ui/sp-storlead-center/src/store/modules/app.ts

@@ -4,7 +4,7 @@ import enUS from 'element-plus/es/locale/lang/en';
 export const useAppStore = defineStore('app', () => {
   const sidebarStatus = useStorage('sidebarStatus', '1');
   const sidebar = reactive({
-    opened: sidebarStatus.value ? !!+sidebarStatus.value : true,
+    opened: true,
     withoutAnimation: false,
     hide: false,
 

+ 5 - 0
ui/sp-storlead-center/src/store/modules/permission.ts

@@ -123,6 +123,11 @@ export const usePermissionStore = defineStore('permission', () => {
      */
     const filterAsyncRouter = (asyncRouterMap: RouteOption[], lastRouter?: RouteOption, type = false): RouteOption[] => {
         return asyncRouterMap.filter((route) => {
+            // 统一 hidden 字段类型:后端可能返回 Integer 0/1 或 String "0"/"1"
+            // JS 中 "0" 是 truthy,会导致可见路由被错误当成隐藏路由
+            const rawHidden = (route as any).hidden;
+            (route as any).hidden = rawHidden === true || rawHidden === 1 || rawHidden === '1';
+
             if (type && route.children) {
                 route.children = filterChildren(route.children, undefined);
             }

+ 6 - 2
ui/sp-storlead-center/src/utils/common.ts

@@ -185,9 +185,13 @@ export const handleTree = <T>(data: any[], id?: string, parentId?: string, child
       tree.push(d);
     }
   }
+  const visited = new Set<any>();
   const adaptToChildrenList = (o: any) => {
-    if (childrenListMap[o[config.id]] !== null) {
-      o[config.childrenList] = childrenListMap[o[config.id]];
+    const id = o[config.id];
+    if (visited.has(id)) return;
+    visited.add(id);
+    if (childrenListMap[id] != null) {
+      o[config.childrenList] = childrenListMap[id];
     }
     if (o[config.childrenList]) {
       for (const c of o[config.childrenList]) {

+ 17 - 5
ui/sp-storlead-center/src/views/system/bulletin/index.vue

@@ -1,6 +1,7 @@
 <template>
     <el-card shadow="never" class="list-card">
         <template #header>
+            <AppTabs v-model="currentAppId" @change="handleAppChange" />
             <div class="search" v-show="showSearch">
                 <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
                     <el-form-item  prop="noticeUserIds">
@@ -39,7 +40,7 @@
             </div>
         </template>
 
-        <Table ref="bulletinTable"
+        <Table v-if="currentAppId" ref="bulletinTable"
                :tableParams="tableParams"
                :btnRole="leftBtn"
                @handleAdd="handleAdd"
@@ -119,6 +120,14 @@
     import Table from '@/components/Table/index.vue'
     import { tableTypes } from '@/components/Table/types'
     import {useDictCache} from '@/hooks/web/useDict'
+    import AppTabs from '@/components/AppTabs/index.vue'
+
+    const currentAppId = ref('')
+    const handleAppChange = () => {
+        ;(tableParams.queryParams as any).appId = currentAppId.value
+        bulletinTable.value?.getData()
+    }
+
     const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 
 
@@ -179,7 +188,7 @@
             },
         ],
         keyId: 'id',
-        queryParams: {
+                queryParams: {
             deadlineDate: undefined,
             title: undefined,
             content: undefined,
@@ -191,13 +200,14 @@
             ownerBy: undefined,
             formerOwnerBy: undefined,
             sort: undefined,
+            appId: undefined,
         },
         listFn: listBulletin,
         delFn: delBulletin,
     })
 
 
-    const initFormData: BulletinForm = {
+        const initFormData: BulletinForm = {
         id: undefined,
         deadlineDate: undefined,
         title: undefined,
@@ -210,7 +220,8 @@
         ownerBy: undefined,
         formerOwnerBy: undefined,
         sort: undefined,
-        noticeUserIdList:[]
+        noticeUserIdList: [],
+        appId: undefined,
     }
     const data = reactive<PageData<BulletinForm, BulletinQuery>>({
         form: {...initFormData},
@@ -278,9 +289,10 @@
         multiple.value = !selection.length;
     }
 
-    /** 新增按钮操作 */
+        /** 新增按钮操作 */
     const handleAdd = () => {
         reset();
+        form.value.appId = currentAppId.value;
         dialog.visible = true;
         dialog.title = "添加公告主";
     }

+ 11 - 0
ui/sp-storlead-center/src/views/system/cueWordTemplate/index.vue

@@ -1,6 +1,10 @@
 <template>
 	<el-card shadow="never" class="list-card">
+		<template #header>
+			<AppTabs v-model="currentAppId" @change="handleAppChange" />
+		</template>
 		<Table
+            v-if="currentAppId"
             ref="cueWordTemplateTable"
             :tableParams="tableParams"
             :btnRole="roleBtn"
@@ -21,6 +25,13 @@ import auth from '@/plugins/auth'
 import Table from '@/components/Table/index.vue'
 import { tableTypes } from '@/components/Table/types'
 import addCueWordTemplate from './add.vue'
+import AppTabs from '@/components/AppTabs/index.vue'
+
+const currentAppId = ref('')
+const handleAppChange = () => {
+	;(tableParams.queryParams as any).appId = currentAppId.value
+	cueWordTemplateTable.value?.getData()
+}
 
 const roleBtn = ref([
     { type: 'add', hasPermi: 'system:cueWordTemplate:add', },

+ 11 - 1
ui/sp-storlead-center/src/views/system/currencySetting/index.vue

@@ -1,6 +1,9 @@
 <template>
     <el-card shadow="never" class="list-card">
-        <Table ref="currencySettingTable"
+        <template #header>
+            <AppTabs v-model="currentAppId" @change="handleAppChange" />
+        </template>
+        <Table v-if="currentAppId" ref="currencySettingTable"
                :tableParams="tableParams"
                :btnRole="leftBtn"
                @handleAdd="handleAdd"
@@ -49,6 +52,13 @@ import {CurrencySettingVO, CurrencySettingQuery, CurrencySettingForm} from '@/ap
 import auth from '@/plugins/auth'
 import Table from '@/components/Table/index.vue'
 import {tableTypes} from '@/components/Table/types'
+import AppTabs from '@/components/AppTabs/index.vue'
+
+const currentAppId = ref('')
+const handleAppChange = () => {
+    ;(tableParams.queryParams as any).appId = currentAppId.value
+    currencySettingTable.value?.getData()
+}
 
 const {proxy} = getCurrentInstance() as ComponentInternalInstance;
 

+ 1 - 1
ui/sp-storlead-center/src/views/system/dept/index.vue

@@ -169,7 +169,7 @@ const { form, rules } = toRefs<PageData<DeptForm, DeptQuery>>(data)
 const getList = async () => {
     loading.value = true;
     // queryParams.value = [10, 20, 30]
-    const res = await listDeptList([10, 20, 30], undefined);
+    const res = await listDeptList([10, 20, 30], undefined, undefined, undefined);
     // const data = proxy?.handleTree<DeptVO>(res.data, "deptId")
     // if (data) {
     //   deptList.value = res

+ 9 - 2
ui/sp-storlead-center/src/views/system/dict/index.vue

@@ -1,8 +1,8 @@
 <template>
-
     <el-card shadow="never" class="list-card">
 
         <template #header>
+            <AppTabs v-model="currentAppId" @change="handleAppChange" />
             <el-tabs v-model="queryParams.dictType"  @tab-change="changeTab">
                 <el-tab-pane name="" label="全部" ></el-tab-pane>
                 <el-tab-pane name="1" label="业务字典" ></el-tab-pane>
@@ -25,7 +25,7 @@
             </div>
         </template>
 
-        <Table ref="dictTable"
+        <Table v-if="currentAppId" ref="dictTable"
                :tableParams="tableParams"
                :btnRole="leftBtn"
                @handleAdd="handleAdd"
@@ -79,6 +79,13 @@ import auth from '@/plugins/auth'
 import Table from '@/components/Table/index.vue'
 import indexDetail from './indexDetail.vue'
 import { tableTypes } from '@/components/Table/types'
+import AppTabs from '@/components/AppTabs/index.vue'
+
+const currentAppId = ref('')
+const handleAppChange = () => {
+    ;(tableParams.queryParams as any).appId = currentAppId.value
+    dictTable.value?.getData()
+}
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const dictDetailref = ref()

+ 8 - 1
ui/sp-storlead-center/src/views/system/menu/index.vue

@@ -1,5 +1,6 @@
 <template>
     <div class="p-2" style="width: 100%;overflow-y: scroll">
+        <AppTabs v-model="currentAppId" @change="handleAppChange" />
         <!--        <transition :enter-active-class="proxy?.animate.searchAnimate.enter"-->
         <!--                    :leave-active-class="proxy?.animate.searchAnimate.leave">-->
         <div class="mb-[10px]">
@@ -249,6 +250,13 @@
 import {addMenu, delMenu, getMenu, listMenu, allMenuList, updateMenu, listAllMenu} from '@/api/system/menu';
 import {MenuForm, MenuQuery, MenuVO, MenuFormEntity, MenuVOEntity} from '@/api/system/menu/types';
 import {MenuTypeEnum} from '@/enums/MenuTypeEnum';
+import AppTabs from '@/components/AppTabs/index.vue'
+
+const currentAppId = ref('')
+const handleAppChange = () => {
+    ;(queryParams as any).appId = currentAppId.value
+    getList()
+}
 
 interface MenuOptionsType {
     id?: number;
@@ -448,6 +456,5 @@ const handleDelete = async (row: MenuVO) => {
 }
 
 onMounted(() => {
-    getList();
 });
 </script>

+ 9 - 1
ui/sp-storlead-center/src/views/system/messageTemplate/index.vue

@@ -1,6 +1,7 @@
 <template>
 	<el-card shadow="never" class="list-card">
 		<template #header>
+			<AppTabs v-model="currentAppId" @change="handleAppChange" />
 			<div class="search">
 				<el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="90px">
 					<el-form-item label="输入搜索:" prop="blurry">
@@ -17,7 +18,7 @@
 			</div>
 		</template>
 
-		<Table ref="messageTemplateTable" :tableParams="tableParams" :btnRole="[]" :right-btn="[]">
+		<Table v-if="currentAppId" ref="messageTemplateTable" :tableParams="tableParams" :btnRole="[]" :right-btn="[]">
 		</Table>
 	</el-card>
 
@@ -32,6 +33,13 @@ import Table from '@/components/Table/index.vue'
 import { tableTypes } from '@/components/Table/types'
 import { useDictCache } from '@/hooks/web/useDict'
 import MessageDetail from './detail.vue'
+import AppTabs from '@/components/AppTabs/index.vue'
+
+const currentAppId = ref('')
+const handleAppChange = () => {
+	;(tableParams.queryParams as any).appId = currentAppId.value
+	messageTemplateTable.value?.getData()
+}
 
 const { queryDictDetailByCodes } = useDictCache(['query_work_data_group'])
 queryDictDetailByCodes()

+ 6 - 0
ui/sp-storlead-center/src/views/system/post/index.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="p-2">
+    <AppTabs v-model="currentAppId" @change="handleAppChange" />
 <!--    <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">-->
 <!--      <div class="mb-[10px]" v-show="showSearch">-->
 <!--        <el-card shadow="hover">-->
@@ -107,6 +108,11 @@
 </template>
 
 <script setup name="Post" lang="ts">
+import AppTabs from '@/components/AppTabs/index.vue'
+
+const currentAppId = ref('')
+const handleAppChange = () => {}
+
 // import { listPost, addPost, delPost, getPost, updatePost } from "@/api/system/post";
 // import { PostForm, PostQuery, PostVO } from "@/api/system/post/types";
 //

+ 10 - 1
ui/sp-storlead-center/src/views/system/role/index.vue

@@ -1,6 +1,7 @@
 <template>
     <el-card shadow="never" class="list-card">
         <template #header>
+            <AppTabs v-model="currentAppId" @change="handleAppChange" />
             <div class="search" v-show="showSearch">
                 <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
                     <el-form-item prop="name">
@@ -21,7 +22,7 @@
             </div>
         </template>
 
-        <Table ref="roleTable"
+        <Table v-if="currentAppId" ref="roleTable"
                :tableParams="tableParams"
                :btnRole="leftBtn"
                @handleAdd="handleAdd"
@@ -151,6 +152,14 @@ import {Check, Close} from '@element-plus/icons-vue'
 import {MenuFormEntity, MenuQuery, MenuTreeOption, RoleMenuTree, DeptTreeOption} from '@/api/system/menu/types';
 import {DeptQuery} from "@/api/system/dept/types";
 import MobileAuth from './MobileAuth.vue'
+import AppTabs from '@/components/AppTabs/index.vue'
+
+const currentAppId = ref('')
+const handleAppChange = () => {
+    ;(tableParams.queryParams as any).appId = currentAppId.value
+    roleTable.value?.getData()
+}
+
 const roleList = ref<RoleVO[]>([]);
 const buttonLoading = ref(false);
 const buttonDataLoading = ref(false);

+ 11 - 1
ui/sp-storlead-center/src/views/system/ruleConfig/index.vue

@@ -1,5 +1,8 @@
 <template>
     <el-card shadow="never" class="list-card">
+        <template #header>
+            <AppTabs v-model="currentAppId" @change="handleAppChange" />
+        </template>
         <!-- <template #header>
             <div class="search" v-show="showSearch">
                 <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
@@ -14,7 +17,7 @@
             </div>
         </template> -->
 
-        <Table ref="ruleConfigTable"
+        <Table v-if="currentAppId" ref="ruleConfigTable"
                :tableParams="tableParams"
                :rightBtn="[]"
                @handleEdit="handleUpdate"
@@ -262,6 +265,13 @@ import auth from '@/plugins/auth'
 import Table from '@/components/Table/index.vue'
 import { tableTypes } from '@/components/Table/types'
 import { useDictCache } from '@/hooks/web/useDict'
+import AppTabs from '@/components/AppTabs/index.vue'
+
+const currentAppId = ref('')
+const handleAppChange = () => {
+    ;(tableParams.queryParams as any).appId = currentAppId.value
+    ruleConfigTable.value?.getData()
+}
 
 const { queryDictDetailByCodes } = useDictCache(['customer_type'])
 queryDictDetailByCodes()

+ 9 - 1
ui/sp-storlead-center/src/views/system/task/index.vue

@@ -2,6 +2,7 @@
     <el-card shadow="never" class="list-card">
 
         <template #header>
+            <AppTabs v-model="currentAppId" @change="handleAppChange" />
 
             <div class="search" v-show="showSearch">
                 <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
@@ -19,7 +20,7 @@
             </div>
         </template>
 
-        <Table ref="taskTableRef" :tableParams="tableParams" :btnRole="leftBtn" @handleAdd="handleAddTask"
+        <Table v-if="currentAppId" ref="taskTableRef" :tableParams="tableParams" :btnRole="leftBtn" @handleAdd="handleAddTask"
             @handleEdit="handleUpdate" @selectionChange="handleSelectionChange">
 
 
@@ -61,6 +62,13 @@ import { addTask, editTask, deleteTask, pauseTask, resumeTask, triggerTask, task
 import { getToday, getYesterday, getCurrentWeek, getMonthLastDay, addDateTime, subDateTime, getDayInfo, getWeekDay, dateFormate } from '@/utils/datetime';
 import { tableTypes } from '@/components/Table/types'
 import { TaskInfo, TaskInfoQuery } from '@/api/system/task/types';
+import AppTabs from '@/components/AppTabs/index.vue'
+
+const currentAppId = ref('')
+const handleAppChange = () => {
+    ;(tableParams.queryParams as any).appId = currentAppId.value
+    taskTableRef.value?.getData()
+}
 
 const querys = reactive({
     showLoading: false,

+ 9 - 1
ui/sp-storlead-center/src/views/system/user/index.vue

@@ -1,6 +1,7 @@
 <template>
     <el-card shadow="never" class="list-card">
         <template #header>
+            <AppTabs v-model="currentAppId" @change="handleAppChange" />
             <div class="search" v-show="showSearch">
                 <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
                     <el-form-item prop="mobile">
@@ -16,7 +17,7 @@
             </div>
         </template>
 
-        <MyTable ref="userTable" :tableParams="tableParams" :btnRole="leftBtn" :rightBtn="[]"
+        <MyTable v-if="currentAppId" ref="userTable" :tableParams="tableParams" :btnRole="leftBtn" :rightBtn="[]"
             @selectionChange="handleSelectionChange">
             <template #left>
                 <el-button v-hasPermi="[`system:user:syncOa`]" :loading="syncOaLoading" @click="syncOa">同步用户</el-button>
@@ -81,6 +82,13 @@ import { resignTransfer, ResignTransferTypes } from '@/api/customer';
 
 import auth from '@/plugins/auth'
 import {completelyDelEmails} from "@/api/emails";
+import AppTabs from '@/components/AppTabs/index.vue'
+
+const currentAppId = ref('')
+const handleAppChange = () => {
+    ;(tableParams.queryParams as any).appId = currentAppId.value
+    userTable.value?.getData()
+}
 
 const {proxy} = getCurrentInstance() as ComponentInternalInstance;