Browse Source

问题修改

1178232204@qq.com 3 years ago
parent
commit
4442580d71

+ 1 - 1
src/api/index.js

@@ -2,7 +2,7 @@ import api from './request';
 import { getCookie,setCookie } from '@utils/index'
 import { Modal } from 'antd';
 const axios=require('axios');
-// axios.defaults.baseURL = 'http://192.168.2.237:8871';//'http://192.168.2.237:8871/';
+axios.defaults.baseURL = 'http://192.168.2.237:8871';//'http://192.168.2.237:8871/';
 const CancelToken = axios.CancelToken;
 const source = CancelToken.source();
 const post=(url,data)=>{

+ 9 - 2
src/components/AMenu/index.js

@@ -1,7 +1,7 @@
 import { Menu, message } from 'antd';
 import { useState, useEffect } from 'react';
 import { useDispatch, useSelector } from 'react-redux'
-import { add, active } from '@reducers/tabPanes'
+import { add, active,close } from '@reducers/tabPanes'
 import { HomeOutlined, BarChartOutlined, SafetyCertificateOutlined, TableOutlined, SettingOutlined, BellOutlined,FileProtectOutlined } from '@ant-design/icons';
 import { NotebookAndPen,ChartPie } from '@icon-park/react';
 import { createFromIconfontCN } from '@ant-design/icons';
@@ -76,8 +76,15 @@ function AMenu() {
     function changeMenu(val) {
         const idName = val.key.split("&");
         const item = panes.find((it) => it.key === val.key);
+        const paneIndex = panes.findIndex((it)=>it.key===val.key);
         if (item) {   //已存在当前tab,则定位即可不增加
-            dispatch(active({ idName: val.key }));
+            dispatch(close({delIndex:paneIndex,active:val.key}))
+            setTimeout(function (){
+                dispatch(
+                    add({ title: idName[1], content: pageMap[idName[0]] || <NullPage />, key: val.key })
+                )
+            }, 50);
+            
             return;
         }
         dispatch(

+ 1 - 0
src/components/ATabs/index.js

@@ -26,6 +26,7 @@ function ATabs(){
     }
     //关闭当前tab
     function onDelTab(activeKey){
+        console.log(activeKey);
         if(panes.length===1){
             message.warning("至少保留一个标签哦~",1);
             return;

+ 1 - 1
src/components/BlockLossManage/editBlock.js

@@ -254,7 +254,7 @@ function EditBlock(props) {
                         <Button htmlType="button" onClick={e => cancel()}>
                             取消
                         </Button>
-                        <Button type="primary" htmlType="submit" disabled={disable}>
+                        <Button type="primary" htmlType="submit" disabled={disable &&  type != 3}>
                             {type == 3 ? '保存' : '确定'}
                         </Button>
                     </Space>

+ 3 - 4
src/components/FieldProblem/editProblem.js

@@ -181,13 +181,12 @@ function EditBlock(props) {
 
                     </Form.Item>
                 </Col>
-                <Col span={12} hidden={type != 3}>
+                <Col span={24} hidden={type != 3}>
                     <Form.Item
                         name="tableVal"
                         label="上传字段值"
                     >
-                        <span>{initialValues.tableVal}</span>
-
+                        <span>{initialValues.tableVal? initialValues.tableVal.length > 15 ? <span title={initialValues.tableVal}>{initialValues.tableVal.substring(0, 15) + '...'}</span> : initialValues.tableVal : '-'}</span>
                     </Form.Item>
                 </Col>
                 <Col span={12} hidden={type != 3}>
@@ -199,7 +198,7 @@ function EditBlock(props) {
 
                     </Form.Item>
                 </Col>
-                <Col span={24} hidden={type != 3}>
+                <Col span={12} hidden={type != 3}>
                     <Form.Item
                         name="status"
                         label="状态"

+ 1 - 1
src/components/FieldProblem/index.js

@@ -165,7 +165,7 @@ function FieldProblem() {
         { title: '字段名称(英文)', dataIndex: 'columnEname', key: 'columnEname' },
         {
             title: '上传字段值', dataIndex: 'tableVal', key: 'tableVal', render: (text, record) => {
-                return record.tableVal || '-';
+                return record.tableVal ? record.tableVal.length > 8 ? <span title={record.tableVal}>{record.tableVal.substring(0, 8) + '...'}</span> : record.tableVal : '-';
             }
         },
         {