chengxiaowen пре 5 месеци
родитељ
комит
22497e6eb6

+ 2 - 1
sso-ui/sso-ui-admin-vue3/src/App.vue

@@ -4,7 +4,7 @@
   import {useDesign} from '@/hooks/web/useDesign'
   import {CACHE_KEY, useCache} from '@/hooks/web/useCache'
   import routerSearch from '@/components/RouterSearch/index.vue'
-  import {removeToken} from '@/utils/auth'
+  //import {removeToken} from '@/utils/auth'
   import {deleteUserCache} from "@/hooks/web/useCache";
   import { ElMessage, ElMessageBox } from 'element-plus'
   defineOptions({name: 'APP'})
@@ -43,6 +43,7 @@
         }
       }
     )
+    openWindows.length = 0
     // _beforeUnload_time = new Date().getTime();
     // event.preventDefault();
     // ElMessageBox.confirm('确认移除该属性吗?', '提示', {

+ 1 - 1
sso-ui/sso-ui-admin-vue3/src/api/system/dept/index.ts

@@ -9,7 +9,7 @@ export interface DeptVO {
   leaderUserId: number
   phone: string
   email: string
-  createTime: Date
+  createTime?: Date
   supportBi: number
   businessStatus: number
   businessPattern: number

+ 1 - 1
sso-ui/sso-ui-admin-vue3/src/api/system/oauth2/client.ts

@@ -19,7 +19,7 @@ export interface OAuth2ClientVO {
   resourceIds: string[]
   additionalInformation: string
   isAdditionalInformationJson: boolean
-  createTime: Date
+  createTime?: Date
 }
 
 // 查询 OAuth2 客户端的列表

+ 4 - 4
sso-ui/sso-ui-admin-vue3/src/api/system/role/index.ts

@@ -6,10 +6,10 @@ export interface RoleVO {
   code: string
   sort: number
   status: number
-  type: number
-  dataScope: number
-  dataScopeDeptIds: number[]
-  createTime: Date
+  type?: number
+  dataScope?: number
+  dataScopeDeptIds?: number[]
+  createTime?: Date
 }
 
 export interface UpdateStatusReqVO {

+ 4 - 4
sso-ui/sso-ui-admin-vue3/src/api/system/user/index.ts

@@ -10,11 +10,11 @@ export interface UserVO {
   mobile: string
   sex: number
   avatar: string
-  loginIp: string
-  status: number
+  loginIp?: string
+  status?: number
   remark: string
-  loginDate: Date
-  createTime: Date
+  loginDate?: Date
+  createTime?: Date
 }
 
 // 查询用户管理列表

+ 1 - 1
sso-ui/sso-ui-admin-vue3/src/permission.ts

@@ -25,7 +25,7 @@ const tagsViewStore = useTagsViewStore()
 
 // 设置用户长时间不操作则退出系统的时间阈值,单位毫秒
 const IDLE_TIME = 3 * 60 * 1000; // 这里设置为30分钟
-const timeOut = 60 * 60 * 1000; //设置超时时间: 15分
+const timeOut = 60 * 60 * 1000 * 12; //设置超时时间: 15分 -> 12小时
 
 const parseURL = (
   url: string | null | undefined

+ 20 - 10
sso-ui/sso-ui-admin-vue3/src/views/Home/index3.vue

@@ -17,36 +17,36 @@
         <div class="col">
           <div class="row2" :style="backgroudColor('44')">
             <img class="image2" :src="img1"  />
-            <div class="text2" @click="handlerLinkDiv('44')"><el-link style="font-size: 30px;color: #fff; font-weight: 500" @click="handlerLink(44)" :disabled="hasNoClientPri('44')">社区居家养老管理系统</el-link></div>
+            <div class="text2" @click="handlerLinkDiv('44')" :style="textShow('44')"><el-link style="font-size: 30px;color: #fff; font-weight: 500" @click="handlerLink(44)" :disabled="hasNoClientPri('44')">社区居家养老管理系统</el-link></div>
           </div>
           <div class="row2" :style="backgroudColor('43')">
             <img class="image2" :src="img2"  />
-            <div class="text2" @click="handlerLinkDiv('43')"><el-link style="font-size: 30px;color: #fff; font-weight: 500" @click="handlerLink(43)" :disabled="hasNoClientPri('43')">智慧养老物联网系统</el-link></div>
+            <div class="text2" @click="handlerLinkDiv('43')" :style="textShow('43')"><el-link style="font-size: 30px;color: #fff; font-weight: 500" @click="handlerLink(43)" :disabled="hasNoClientPri('43')">智慧养老物联网系统</el-link></div>
             <!--            <div class="text2"><a class="aaa" href="http://web.poteviohealth.com/boss/" target="_blank">智慧养老IOT物联网平台</a></div>-->
           </div>
         </div>
         <div class="col col3" :style="backgroudColor('45')">
-          <div class="text0" @click="handlerLinkDiv('45')"><el-link style="font-size: 30px;color: #fff; font-weight: 500" @click="handlerLink(45)" :disabled="hasNoClientPri('45')">数据可视化系统</el-link></div>
+          <div class="text0" @click="handlerLinkDiv('45')" :style="textShow('45')"><el-link style="font-size: 30px;color: #fff; font-weight: 500" @click="handlerLink(45)" :disabled="hasNoClientPri('45')">数据可视化系统</el-link></div>
         </div>
         <div class="col">
           <div class="row2" style="background-color: #c9d6df;">
             <img class="image2" :src="img5"  />
-<!--            <div class="text2" @click="handlerLinkDiv('50')"><el-link style="font-size: 30px;color: #fff; font-weight: 500" @click="handlerLink(50)"  :disabled="hasNoClientPri('45')">机构养老运营管理系统</el-link></div>-->
-            <div class="text2">机构养老运营管理系统</div>
+            <div class="text2" ><el-link style="font-size: 30px;color: #fff; font-weight: 500" @click="handlerLink(50)" >机构养老运营管理系统</el-link></div>
+<!--            <div class="text2" :style="textShow('50')">机构养老运营管理系统</div>-->
           </div>
           <div class="row2" :style="backgroudColor('49')">
             <img class="image2" :src="img6"  />
-            <div class="text2" @click="handlerLinkDiv('49')"><el-link style="font-size: 30px;color: #fff; font-weight: 500" @click="handlerLink(49)"  :disabled="hasNoClientPri('49')">旅居养老运营管理系统</el-link></div>
+            <div class="text2" @click="handlerLinkDiv('49')" :style="textShow('49')"><el-link style="font-size: 30px;color: #fff; font-weight: 500" @click="handlerLink(49)"  :disabled="hasNoClientPri('49')">旅居养老运营管理系统</el-link></div>
           </div>
         </div>
         <div class="col">
           <div class="row2" :style="backgroudColor('46')">
             <img class="img_gray" :src="img7" />
-            <div class="text2" @click="handlerLinkDiv('46')"><el-link style="font-size: 30px;color: #fff; font-weight: 500" @click="handlerLink(46)" :disabled="hasNoClientPri('46')">运营数据分析系统</el-link></div>
+            <div class="text2" @click="handlerLinkDiv('46')" :style="textShow('46')"><el-link style="font-size: 30px;color: #fff; font-weight: 500" @click="handlerLink(46)" :disabled="hasNoClientPri('46')">运营数据分析系统</el-link></div>
           </div>
           <div class="row2" :style="backgroudColor('51')">
             <img class="image2" :src="img8"  />
-            <div class="text2" @click="handlerLinkDiv('51')"><el-link style="font-size: 30px;color: #fff; font-weight: 500" @click="handlerLink(51)" :disabled="hasNoClientPri('51')">技术开发集成系统</el-link></div>
+            <div class="text2" @click="handlerLinkDiv('51')" :style="textShow('51')"><el-link style="font-size: 30px;color: #fff; font-weight: 500" @click="handlerLink(51)" :disabled="hasNoClientPri('51')">技术开发集成系统</el-link></div>
           </div>
         </div>
       </div>
@@ -151,6 +151,15 @@ const backgroudColor =(i)=>{
   }
   }
 
+const textShow =(i)=>{
+
+  // if(hasNoClientPri(i)){
+  //   return 'display: none;'
+  // }else{
+    return ''
+  // }
+}
+
 // 表单校验
 const equalToPassword = (_rule, value, callback) => {
   if (passwordModel.newPassword !== value) {
@@ -210,7 +219,7 @@ const  closeLinks = () =>{
       }
     }
   )
-  globalProperties.$globalWindows = []
+  openWindows.length = 0
 
 }
 const toProfile = async () => {
@@ -251,7 +260,7 @@ const handlerLink = async (id) => {
 
 const handlerLinkDiv = (id) => {
   if(hasNoClientPri(id)){
-    message.error('无该系统权限,请联系系统管理员申请开通')
+    message.error('您在该系统没有权限,请联系管理员授权')
   }
 }
 const roles = wsCache.get(CACHE_KEY.USER)?wsCache.get(CACHE_KEY.USER).roles:[]
@@ -301,6 +310,7 @@ onMounted(() => {
           }
         }
       )
+      openWindows.length = 0
     }
   })
 })

+ 2 - 1
sso-ui/sso-ui-admin-vue3/src/views/Login/Login3.vue

@@ -70,7 +70,7 @@
   import { useAppStore } from '@/store/modules/app'
   import { ThemeSwitch } from '@/layout/components/ThemeSwitch'
   import { LocaleDropdown } from '@/layout/components/LocaleDropdown'
-  import { removeToken } from '@/utils/auth'
+  //import { removeToken } from '@/utils/auth'
   import {deleteUserCache} from "@/hooks/web/useCache";
   import { getCurrentInstance, onBeforeMount, type ComponentInternalInstance } from 'vue';
   const currentInstance= getCurrentInstance() as ComponentInternalInstance;
@@ -97,6 +97,7 @@
         }
       }
     )
+    openWindows.length = 0
     ElNotification({
       title: '提示',
       message: '超时退出',

+ 3 - 3
sso-ui/sso-ui-admin-vue3/src/views/Login/components/LoginForm.vue

@@ -172,11 +172,11 @@ const loginData = reactive({
   captchaEnable: import.meta.env.VITE_APP_CAPTCHA_ENABLE,
   tenantEnable: import.meta.env.VITE_APP_TENANT_ENABLE,
   loginForm: {
-    tenantName: '中康科',
+    // tenantName: '中康科',
     username: 'admin',
     password: 'admin123',
     captchaVerification: '',
-    rememberMe: true // 默认记录我。如果不需要,可手动修改
+    //rememberMe: true // 默认记录我。如果不需要,可手动修改
   }
 })
 
@@ -201,7 +201,7 @@ const getCode = async () => {
 // 获取租户 ID
 const getTenantId = async () => {
   if (loginData.tenantEnable === 'true') {
-    const res = await LoginApi.getTenantIdByName(loginData.loginForm.tenantName)
+    const res = await LoginApi.getTenantIdByName('中康科')
     authUtil.setTenantId(res)
   }
 }

+ 3 - 2
sso-ui/sso-ui-admin-vue3/src/views/system/dept/DeptForm.vue

@@ -172,7 +172,7 @@ const formLoading = ref(false) // 表单的加载中:1)修改时的数据加
 const formType = ref('') // 表单的类型:create - 新增;update - 修改
 const formData = ref({
   id: undefined,
-  title: '',
+  // title: '',
   parentId: undefined,
   name: undefined,
   code: undefined,
@@ -254,6 +254,7 @@ const submitForm = async () => {
       await DeptApi.createDept(data)
       message.success(t('common.createSuccess'))
     } else {
+      delete data.createTime
       await DeptApi.updateDept(data)
       message.success(t('common.updateSuccess'))
     }
@@ -269,7 +270,7 @@ const submitForm = async () => {
 const resetForm = () => {
   formData.value = {
     id: undefined,
-    title: '',
+    // title: '',
     parentId: undefined,
     name: undefined,
     code: undefined,

+ 1 - 0
sso-ui/sso-ui-admin-vue3/src/views/system/oauth2/client/ClientForm.vue

@@ -250,6 +250,7 @@ const submitForm = async () => {
       await ClientApi.createOAuth2Client(data)
       message.success(t('common.createSuccess'))
     } else {
+      delete data.createTime
       await ClientApi.updateOAuth2Client(data)
       message.success(t('common.updateSuccess'))
     }

+ 4 - 0
sso-ui/sso-ui-admin-vue3/src/views/system/role/RoleForm.vue

@@ -113,6 +113,10 @@ const submitForm = async () => {
       await RoleApi.createRole(data)
       message.success(t('common.createSuccess'))
     } else {
+      delete data.createTime
+      delete data.dataScope
+      delete data.dataScopeDeptIds
+      delete data.type
       await RoleApi.updateRole(data)
       message.success(t('common.updateSuccess'))
     }

+ 15 - 6
sso-ui/sso-ui-admin-vue3/src/views/system/user/UserClientForm.vue

@@ -102,6 +102,7 @@
   import { UserClientApi, UserClientVO } from '@/api/system/userclient'
   import { dateFormatter } from '@/utils/formatTime'
   import * as authUtil from '@/utils/auth'
+  import * as RoleApi from "@/api/system/role";
 
   defineOptions({ name: 'SystemUserClientForm' })
 
@@ -141,18 +142,26 @@
     }
   }
 
-  const clientParams = ref<UserClientVO>()
+  const clientParams = ref({
+    id: undefined,
+  userId: undefined,
+  clientId: undefined,
+  syncStatus: undefined,
+  status:undefined,
+  additionalInformation: undefined
+  })
 
   const submitForm = async () => {
     if(clientId.value===undefined){
       message.error("未选择关联系统")
       return
     }
-    clientParams.clientId = clientId.value
-    clientParams.userId = userId.value
-    clientParams.syncStatus = 0
-    clientParams.status = 0
-    await UserClientApi.createUserClient(clientParams)
+    const data = clientParams.value as unknown as UserClientVO
+    data.clientId = clientId.value
+    data.userId = userId.value
+    data.syncStatus = 0
+    data.status = 0
+    await UserClientApi.createUserClient(data)
     getList()
     message.success(t('common.createSuccess'))
   }

+ 22 - 10
sso-ui/sso-ui-admin-vue3/src/views/system/user/UserForm.vue

@@ -20,6 +20,9 @@
       <el-form-item  label="手机号码" prop="mobile" >
         <el-input v-model="formData.mobile" maxlength="11" placeholder="请输入手机号码" :disabled = "formData.id != undefined" />
       </el-form-item>
+      <el-form-item  label="OA账号" prop="oaLoginName" >
+        <el-input v-model="formData.oaLoginName" maxlength="31" placeholder="请输入OA账号" />
+      </el-form-item>
       <el-form-item label="性别">
         <el-select v-model="formData.sex" placeholder="请选择">
           <el-option
@@ -72,14 +75,15 @@
           @input="handlePassInput"
         />
       </el-form-item>
-      <el-form-item label="创建用户" prop="roleType">
+      <el-form-item label="角色" prop="roleType">
         <el-radio-group v-model="formData.roleType" >
-          <el-radio value="0">是</el-radio>
-          <el-radio value="1">否</el-radio>
+          <el-radio value="0">管理员</el-radio>
+          <el-radio value="1">用户</el-radio>
+          <el-radio value="2" v-if="userId===1">超级管理员</el-radio>
         </el-radio-group>
       </el-form-item>
 <!--      <el-form-item v-if="formData.id === undefined || userId===1" label="关联系统" prop="associatedSystem">-->
-      <el-form-item v-if="formData.id === undefined || userId===1" label="关联系统" prop="associatedSystem">
+      <el-form-item label="关联系统" prop="associatedSystem">
         <el-select v-model="formData.associatedSystem" multiple  placeholder="请选择关联系统" @change="selectChanged">
           <el-option
             v-for="item in clientList"
@@ -165,10 +169,11 @@ const formData = ref({
   sex: undefined,
   postIds: [],
   remark: '',
-  status: CommonStatusEnum.ENABLE,
-  roleIds: [],
+  // status: CommonStatusEnum.ENABLE,
+  // roleIds: [],
   roleType: '1',
-  businessRole: '0'
+  businessRole: '0',
+  oaLoginName:''
 })
 const passValidate = (rule, value, callback) => {
   if (/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[._~!@#$^&*])[A-Za-z0-9._~!@#$^&*]{6,16}$/g.test(value)) {
@@ -311,6 +316,12 @@ const submitForm = async () => {
       await UserApi.createUser(data)
       message.success(t('common.createSuccess'))
     } else {
+      delete data.deptName
+      delete data.createTime
+      delete data.status
+      delete data.loginIp
+      delete data.loginDate
+      delete data.creator
       await UserApi.updateUser(data)
       message.success(t('common.updateSuccess'))
     }
@@ -350,10 +361,11 @@ const resetForm = () => {
     sex: undefined,
     postIds: [],
     remark: '',
-    status: CommonStatusEnum.ENABLE,
-    roleIds: [],
+    // status: CommonStatusEnum.ENABLE,
+    // roleIds: [],
     roleType: '1',
-    businessRole: '0'
+    businessRole: '0',
+    oaLoginName:''
   }
   formRef.value?.resetFields()
   //  mobileWatch = watch(

+ 19 - 1
sso-ui/sso-ui-admin-vue3/src/views/system/user/index.vue

@@ -49,6 +49,18 @@
               />
             </el-select>
           </el-form-item>
+          <el-form-item label="角色" prop="roleType">
+            <el-select
+              v-model="queryParams.roleType"
+              placeholder="角色"
+              clearable
+              class="!w-240px"
+            >
+              <el-option key="0" label="管理员" value="0"/>
+              <el-option key="1" label="用户" value="1"/>
+              <el-option key="2" label="超级管理员" value="2"/>
+            </el-select>
+          </el-form-item>
           <el-form-item label="创建时间" prop="createTime">
             <el-date-picker
               v-model="queryParams.createTime"
@@ -122,6 +134,11 @@
               />
             </template>
           </el-table-column>
+          <el-table-column label="角色" key="roleType">
+            <template #default="scope">
+              {{scope.row.roleType==2?'超级管理员':(scope.row.roleType==0?'管理员':'用户')}}
+            </template>
+          </el-table-column>
           <el-table-column
             label="创建时间"
             align="center"
@@ -244,10 +261,11 @@ const list = ref([]) // 列表的数
 const queryParams = reactive({
   pageNo: 1,
   pageSize: 10,
-  username: undefined,
+  nickname: undefined,
   mobile: undefined,
   status: undefined,
   deptId: undefined,
+  roleType: undefined,
   createTime: []
 })
 const queryFormRef = ref() // 搜索的表单