shaogen1995 недель назад: 3
Родитель
Сommit
5b43a1ed40

+ 3 - 3
public/index.html

@@ -1,4 +1,4 @@
-<!DOCTYPE html>
+<!doctype html>
 <html lang="zh">
   <head>
     <meta charset="utf-8" />
@@ -20,9 +20,9 @@
       // const baseUrlTempOne = 'http://192.168.20.61:8096'
 
       // 钉钉模式
-      const isDingTemp = true
+      const isDingTemp = false
 
-      // 是否弹窗
+      // 是否显示调试器
       const isMyAlert = true
 
       // const script = document.createElement('script')

+ 1 - 18
src/components/DingLogin/index.tsx

@@ -2,22 +2,11 @@ import React, { useCallback, useEffect, useRef, useState } from 'react'
 import dd from 'gdt-jsapi'
 import styles from './index.module.scss'
 import { MessageFu } from '@/utils/message'
-import { API_ddLogin, API_LoginGetCode } from '@/store/action/layout'
+import { API_ddLogin } from '@/store/action/layout'
 import { Button } from 'antd'
 import { setTokenInfo } from '@/utils/storage'
 import history from '@/utils/history'
 function DingLogin() {
-  // 获取验证码
-  const LoginGetCodeFu = useCallback(async () => {
-    const res: any = await API_LoginGetCode()
-
-    console.log('pppp', res)
-  }, [])
-
-  useEffect(() => {
-    if (isMyAlert) LoginGetCodeFu()
-  }, [LoginGetCodeFu])
-
   const DDloginFu = useCallback(() => {
     dd.ready(function () {
       dd.getAuthCode({
@@ -26,12 +15,8 @@ function DingLogin() {
         .then(async res1 => {
           const code = res1.auth_code
 
-          // if (isMyAlert) alert(`code:${code}`)
-
           const res = await API_ddLogin(code!)
 
-          // if (isMyAlert) alert(JSON.stringify(res))
-
           if (res.code === 0) {
             MessageFu.success('登录成功')
             // 用户信息存到本地
@@ -45,8 +30,6 @@ function DingLogin() {
           }
         })
         .catch(err => {
-          // if (isMyAlert) alert(JSON.stringify(err))
-
           MessageFu.error(err)
         })
     })

+ 2 - 1
src/pages/A3_ledger/ComPage/C4import/C4imgModal/index.tsx

@@ -35,7 +35,8 @@ function C4imgModal({ info, closeFu, againUpFu, succFu }: Props) {
         id: null,
         importId: res1.data.id,
         moduleName: 'goods',
-        importError: v.description === '成功' ? '0' : '1'
+        importError: v.description === '成功' ? '0' : '1',
+        fileSize: info.file?.fileSize
       }))
 
       const res2 = await A3m_APIaddZip_2(obj2)

+ 2 - 1
src/pages/A3_ledger/ComPage/C4import/C4impImg/index.tsx

@@ -88,7 +88,8 @@ function C4impImg({ hidden }: Props) {
             err: errArr,
             file: {
               fileName: res.data.fileName,
-              filePath: res.data.filePath
+              filePath: res.data.filePath,
+              fileSize: res.data.fileSize
             }
           })
         }

+ 1 - 1
src/pages/A3_ledger/ComPage/C4import/data.ts

@@ -17,7 +17,7 @@ export type C4zipType = {
   type: '' | '上传' | '查看'
   succ: C4zipArrType[]
   err: C4zipArrType[]
-  file?: { fileName: string; filePath: string }
+  file?: { fileName: string; filePath: string; fileSize: number }
 }
 
 // zip数据整理

+ 24 - 0
src/pages/C_goodsManage/C22goodEdit/index.tsx

@@ -17,6 +17,7 @@ import history from '@/utils/history'
 import MyPopconfirm from '@/components/MyPopconfirm'
 import { FourTableType } from '@/pages/B_enterTibet/B1collect/type'
 import C22revamp from './C22revamp'
+import ZGaddNow from '@/components/ZGaddNow'
 const { RangePicker } = DatePicker
 
 function C22goodEdit() {
@@ -118,6 +119,9 @@ function C22goodEdit() {
     history.push(url)
   }, [])
 
+  // 点击新增
+  const [addFlag, setAddFlag] = useState(false)
+
   const lastBtn = useMemo(() => {
     return [
       {
@@ -353,6 +357,10 @@ function C22goodEdit() {
           </div>
         </div>
         <div className='B1toprr'>
+          {/* <Button type='primary' onClick={() => setAddFlag(true)}>
+            新增
+          </Button>
+          &emsp; */}
           <Button type='primary' onClick={clickSearch}>
             查询
           </Button>
@@ -388,6 +396,22 @@ function C22goodEdit() {
           />
         </div>
       ) : null}
+
+      {/* 点击新增 */}
+      {/* 从入馆入藏藏品中选择一个 */}
+      {addFlag ? (
+        <ZGaddNow
+          menuId={18}
+          register={true}
+          nowSta={{ key: '藏品编辑', id: 'cms/orderEdit/goods/getList' }}
+          closeFu={() => setAddFlag(false)}
+          dataResFu={data => {
+            console.log(123456, data)
+          }}
+          oldCheckArr={[]}
+          isOne={true}
+        />
+      ) : null}
     </div>
   )
 }

+ 1 - 1
src/pages/D_storeManage/D4impStor/D4edit/index.tsx

@@ -56,7 +56,7 @@ function D4edit() {
 
   useEffect(() => {
     dispatch(D2_APIgetList({ pageNum: 1, pageSize: 99999 }))
-    dispatch(FourAPI_getList({ pageNum: 1, pageSize: 99999 }, '1'))
+    dispatch(FourAPI_getList({ pageNum: 1, pageSize: 99999, status: 4 }, '1'))
   }, [dispatch])
 
   const { list: storageIdArr } = useSelector((state: RootState) => state.D2storSet.tableInfo)

+ 2 - 2
src/pages/Layout/index.tsx

@@ -375,14 +375,14 @@ function Layout() {
             onMouseLeave={() => setIsUserBtnShow(false)}
           >
             <div
-              className={classNames('userNameBox', isDing && !isMyAlert ? 'userNameBoxDing' : '')}
+              className={classNames('userNameBox', isDing ? 'userNameBoxDing' : '')}
               onClick={() => setIsUserBtnShow(true)}
             >
               <img src={userInfo.thumb ? baseURL + userInfo.thumb : baseTouXiangImg} alt='' />
 
               {userInfo.realName || userInfo.userName || '匿名'}
 
-              {isDing && !isMyAlert ? null : (
+              {isDing ? null : (
                 <div className='userInco userInco2'>
                   <CaretRightOutlined />
                 </div>

+ 1 - 1
src/pages/Z_system/Z6user/index.tsx

@@ -227,7 +227,7 @@ function Z6user() {
           emptyText={true}
           yHeight={630}
           list={buMenRes(tableInfo.list)}
-          columnsTemp={Z6tableC}
+          columnsTemp={Z6tableC()}
           lastBtn={tableLastBtn}
           pageNum={formData.pageNum}
           pageSize={formData.pageSize}

+ 5 - 1
src/store/action/Z6user.ts

@@ -6,7 +6,11 @@ import { SaveUserType } from '@/types'
  */
 export const getUserListAPI = (data: any, back?: () => void): any => {
   return async (dispatch: AppDispatch) => {
-    const url = 'sys/user/list?scope=' + (isDing ? 'DING' : 'SYS')
+    let url = 'sys/user/list'
+
+    if (isDing) url += '?scope=DING'
+
+    // const url = 'sys/user/list?scope=' + (isDing ? 'DING' : 'SYS')
 
     const res = await http.post(url, data)
     if (res.code === 0) {

+ 0 - 1
src/types/declaration.d.ts

@@ -7,7 +7,6 @@ declare module '*.svg'
 declare module 'js-export-excel'
 declare module 'braft-utils'
 declare const isDingTemp: boolean
-declare const isMyAlert: boolean
 declare const baseUrlTempOne: string
 // 埋点信息
 declare const aplus_queue: any[]

+ 6 - 11
src/utils/http.ts

@@ -1,5 +1,5 @@
 import axios from 'axios'
-import { getTokenInfo, removeTokenInfo } from './storage'
+import { getTokenInfo, hasToken, removeTokenInfo } from './storage'
 import store from '@/store'
 import { MessageFu } from './message'
 import { domShowFu } from './domShow'
@@ -39,7 +39,6 @@ let axajInd = 0
 // 请求拦截器
 http.interceptors.request.use(
   function (config: any) {
-    // if (isMyAlert) alert(`开始发送接口:${JSON.stringify(config)}`)
     // 发请求前打开加载提示
     domShowFu('#AsyncSpinLoding', true)
 
@@ -68,8 +67,6 @@ let timeId = -1
 // 响应拦截器
 http.interceptors.response.use(
   function (response) {
-    // if (isMyAlert) alert(`发送请求成功:${JSON.stringify(response)}`)
-
     // 请求回来的关闭加载提示
     axajInd--
     if (axajInd === 0) {
@@ -86,17 +83,15 @@ http.interceptors.response.use(
       // MessageFu.success(response.data.msg);
     } else if (![3014, 3101, 3510].includes(response.data.code)) {
       if (response.data.code === -1 && response.data.msg === '对象不存在') {
-        history.replace('/abnormal?k=5')
+        if (hasToken()) history.replace('/abnormal?k=5')
       } else MessageFu.warning(response.data.msg)
     }
 
-    if (response.data.code === 3510) history.replace('/abnormal')
+    if (response.data.code === 3510) if (hasToken()) history.replace('/abnormal')
 
     return response.data
   },
   async function (err) {
-    // if (isMyAlert) alert(`发送请求失败:${err}`)
-
     clearTimeout(timeId)
     timeId = window.setTimeout(() => {
       axajInd = 0
@@ -106,7 +101,7 @@ http.interceptors.response.use(
         if (store.getState().A0Layout.closeUpFile.state) MessageFu.warning('取消上传!')
         else {
           MessageFu.error('网络繁忙,请稍后重试!')
-          history.replace('/abnormal?k=2')
+          if (hasToken()) history.replace('/abnormal?k=2')
         }
       } else {
         if (
@@ -120,10 +115,10 @@ http.interceptors.response.use(
           if (err.response.data.code === 5003) {
             removeTokenInfo()
             loginOutFu()
-          } else history.replace('/abnormal?k=1')
+          } else if (hasToken()) history.replace('/abnormal?k=1')
         } else {
           MessageFu.error('响应错误,请联系管理员!')
-          history.replace('/abnormal?k=1')
+          if (hasToken()) history.replace('/abnormal?k=1')
         }
       }
     }, 100)

+ 12 - 8
src/utils/tableData.ts

@@ -17,6 +17,7 @@
 import { D6typeArr } from '@/pages/D_storeManage/D6putsStor/data'
 import { selectObj } from './select'
 import { SON_TYPE_NAME } from '@/pages/D_storeManage/D3staff/types'
+import { isDing } from './http'
 
 // 附件归档
 export const ZypFileTable = [
@@ -471,14 +472,17 @@ export const Z5tableC = [
   ['txt', '排序值', 'sort']
 ]
 
-export const Z6tableC = [
-  ['txt', '登录账号', 'userName'],
-  ['txt', '所属部门', 'deptNameRes'],
-  ['txt', '角色', 'roleName'],
-  ['txt', '真实姓名', 'realName'],
-  ['txt', '创建日期', 'createTime']
-]
-
+export const Z6tableC = () => {
+  let arr: any = [
+    ['txt', '登录账号', 'userName'],
+    ['txt', '所属部门', 'deptNameRes'],
+    ['txt', '角色', 'roleName'],
+    ['txt', '真实姓名', 'realName'],
+    ['txt', '创建日期', 'createTime']
+  ]
+  if (!isDing) arr.push(['txtChange', '类型', 'source', { SYS: 'web用户', DING: '浙政钉用户' }])
+  return arr
+}
 export const Z7tableC = [
   ['index', '序号'],
   ['txt', '账号', 'userName'],