shaogen1995 7 saat önce
ebeveyn
işleme
48626fb93b

+ 8 - 12
src/pages/Abench/A2bench/index.tsx

@@ -1,6 +1,6 @@
 import React, { useCallback, useEffect, useState } from 'react'
 import React, { useCallback, useEffect, useState } from 'react'
 import styles from './index.module.scss'
 import styles from './index.module.scss'
-import { useDispatch, useSelector } from 'react-redux'
+import { useSelector } from 'react-redux'
 import store, { RootState } from '@/store'
 import store, { RootState } from '@/store'
 import { Button } from 'antd'
 import { Button } from 'antd'
 import { baseURL, iconUrl } from '@/utils/http'
 import { baseURL, iconUrl } from '@/utils/http'
@@ -10,8 +10,6 @@ import MyPopconfirm from '@/components/MyPopconfirm'
 import history from '@/utils/history'
 import history from '@/utils/history'
 import { getUserInfoByIdAPI } from '@/store/action/Isystem/I7user'
 import { getUserInfoByIdAPI } from '@/store/action/Isystem/I7user'
 import { RouterType } from '@/pages/Layout/data'
 import { RouterType } from '@/pages/Layout/data'
-import { treeLastIdFindFatherFu } from '@/utils/dataChange'
-import { I5_APIgetTree } from '@/store/action/Isystem/I5organization'
 import A2table from './A2table'
 import A2table from './A2table'
 import A2setStock from './A2setStock'
 import A2setStock from './A2setStock'
 import A2editUser from './A2editUser'
 import A2editUser from './A2editUser'
@@ -40,12 +38,12 @@ function A2bench() {
   }, [getUserInfo])
   }, [getUserInfo])
 
 
   // 获取组织管理列表
   // 获取组织管理列表
-  const dispatch = useDispatch()
-  useEffect(() => {
-    dispatch(I5_APIgetTree())
-  }, [dispatch])
+  // const dispatch = useDispatch()
+  // useEffect(() => {
+  //   dispatch(I5_APIgetTree())
+  // }, [dispatch])
 
 
-  const { treeData } = useSelector((state: RootState) => state.I5organization)
+  // const { treeData } = useSelector((state: RootState) => state.I5organization)
 
 
   const { userInfo } = useSelector((state: RootState) => state.A0Layout)
   const { userInfo } = useSelector((state: RootState) => state.A0Layout)
 
 
@@ -86,10 +84,8 @@ function A2bench() {
             <div className='A2ll1_1Txt'>
             <div className='A2ll1_1Txt'>
               <h1>{userInfo.realName || userInfo.userName || '匿名'}</h1>
               <h1>{userInfo.realName || userInfo.userName || '匿名'}</h1>
               <p>
               <p>
-                {userInfo.userName}&emsp;
-                {userInfo.deptId
-                  ? treeLastIdFindFatherFu(treeData, userInfo.deptId + '', 'name').join(' / ')
-                  : '-'}
+                {userInfo.userName}
+                {userInfo.deptName ? <>&emsp;{userInfo.deptName}</> : null}
                 &emsp;|&emsp;{userInfo.roleName}
                 &emsp;|&emsp;{userInfo.roleName}
               </p>
               </p>
             </div>
             </div>

+ 1 - 1
src/pages/Isystem/I7user/I7add/index.tsx

@@ -129,7 +129,7 @@ function I7add({ id, closePage, upTableList, addTableList, formOld }: Props) {
             name='userName'
             name='userName'
             rules={[
             rules={[
               { required: true, message: '请输入账号名!' },
               { required: true, message: '请输入账号名!' },
-              { min: 6, message: '最少6个字!' }
+              { min: window.location.href.includes('?k=4DAGE') ? 5 : 6, message: '最少6个字!' }
             ]}
             ]}
             getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
             getValueFromEvent={e => e.target.value.replace(/\s+/g, '')}
           >
           >

+ 1 - 1
src/pages/Isystem/I7user/index.tsx

@@ -135,7 +135,7 @@ function I7user() {
       {
       {
         title: '操作',
         title: '操作',
         render: (item: UserTableListType) => {
         render: (item: UserTableListType) => {
-          return item.isAdmin === 1 ? (
+          return item.isAdmin === 1 && !window.location.href.includes('?k=4DAGE') ? (
             '-'
             '-'
           ) : (
           ) : (
             <>
             <>

+ 4 - 0
src/pages/Layout/index.tsx

@@ -24,6 +24,7 @@ import { I2_APIgetDict } from '@/store/action/Isystem/I2dict'
 import { E1_APIgetTree } from '@/store/action/Eculture/E1tag'
 import { E1_APIgetTree } from '@/store/action/Eculture/E1tag'
 import { baseURL } from '@/utils/http'
 import { baseURL } from '@/utils/http'
 import baseTouXiangImg from '@/assets/img/user.png'
 import baseTouXiangImg from '@/assets/img/user.png'
+import { ZFbaseFu } from '@/store/reducer/ZformData'
 
 
 function Layout() {
 function Layout() {
   const [loding, setLoding] = useState(false)
   const [loding, setLoding] = useState(false)
@@ -203,6 +204,9 @@ function Layout() {
 
 
   // 点击跳转
   // 点击跳转
   const pathCutFu = useCallback((item: RouterTypeRow) => {
   const pathCutFu = useCallback((item: RouterTypeRow) => {
+    if (item.name === '工作台') {
+      ZFbaseFu()
+    }
     history.push(item.path)
     history.push(item.path)
     // if (item.name !== '工作台') changSetFu(item)
     // if (item.name !== '工作台') changSetFu(item)
   }, [])
   }, [])

+ 14 - 4
src/store/reducer/ZformData.ts

@@ -1,6 +1,6 @@
-// 初始化状态
-const initState = {
-  // 列表筛选回显
+import store from '..'
+
+const ZFbaseData = {
   A2formData: {
   A2formData: {
     pageNum: 1,
     pageNum: 1,
     pageSize: 10,
     pageSize: 10,
@@ -10,7 +10,12 @@ const initState = {
     startTime: '',
     startTime: '',
     endTime: '',
     endTime: '',
     status: ''
     status: ''
-  } as any
+  }
+} as any
+
+// 初始化状态
+const initState = {
+  A2formData: ZFbaseData.A2formData
 }
 }
 
 
 // 定义 action 类型
 // 定义 action 类型
@@ -29,3 +34,8 @@ export default function Reducer(state = initState, action: Props) {
       return state
       return state
   }
   }
 }
 }
+
+// 初始化数据
+export const ZFbaseFu = () => {
+  store.dispatch({ type: 'ZF/A2formData', payload: ZFbaseData.A2formData })
+}