Commit 805d5ec4 authored by 左玲玲's avatar 左玲玲 😬

1619

parent 74b9d280
......@@ -42,7 +42,7 @@ export default defineConfig({
publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
initialState: {},
model: {},
keepalive: keepalive,
// keepalive: keepalive,
layout: {
// https://umijs.org/zh-CN/plugins/plugin-layout
locale: false,
......
......@@ -54,7 +54,6 @@ const Mtable = (props) => {
[valueColumns, setvalueColumns] = useState({});
const [columnes, setcolumnes] = useState(columns ?? []);
const [newparames, setnewparams] = useState({});
//调用接口
const request = async (params, sort, filter) => {
if (!path) return;
......@@ -369,7 +368,6 @@ const Mtable = (props) => {
{...datas}
size={size}
onSubmit={(params) => {
console.log(params);
let newparams = {},
curkey = Object.keys(params)[Object.keys(params).length - 1],
curval = Object.values(params)[Object.keys(params).length - 1];
......
......@@ -21,7 +21,7 @@ function DrawerPro(props) {
placement="right"
closable={true}
getContainer={false}
style={{ position: 'absolute', transform: 'translateX(0)' }}
style={{ position: 'absolute', transform: 'translateX(0)', zIndex: 10 }}
width={'100%'}
destroyOnClose={true}
{...props}
......
......@@ -137,7 +137,6 @@ const TagView = ({ children, home }) => {
await setrefresh(false);
setrefresh(true);
};
return (
<>
<RouteContext.Consumer>
......@@ -163,14 +162,6 @@ const TagView = ({ children, home }) => {
</div>
<div className={styles.child}>
<div className={styles.contianbox}>
{/* <Scrollbars
thumbMinSize={10}
autoHide
style={{ width: '100%', height: '100%' }}
hideTracksWhenNotNeeded={true}
>
{refresh && children}
</Scrollbars> */}
<div style={{ width: "100%", height: "100%" }}> {refresh && children}</div>
</div>
</div>
......
......@@ -103,7 +103,7 @@ function Contract(props) {
[activeTabKey, setactiveTabKey] = useState('1'),
[amount, camount] = useState(0),
[intelligenceList, cil] = useState([]),
[flag, cflag] = useState(false);
[extraparams, setextraparams] = useState({});
const { run, loading, runAsync } = useRequest(doFetch, {
manual: true,
......@@ -506,15 +506,13 @@ function Contract(props) {
}
useEffect(() => {
if (state) {
cflag(false)
if (state.isFinish == 1) {
setactiveTabKey('1')
} else {
setactiveTabKey('2')
}
setTimeout(() => {
tableRef?.current?.setFieldsValue({ 'contractNo': state.contractNo });
}, 500)
setextraparams({ 'contractNo': state.contractNo })
tableRef?.current?.setFieldsValue({ 'contractNo': state.contractNo });
}
}, [state])
const columns = useMemo(() => {
......@@ -534,7 +532,7 @@ function Contract(props) {
const tabList = useMemo(() => {
return getcolumns();
}, [activeTabKey]);
}, [activeTabKey, extraparams]);
const pathconfig = useMemo(() => {
let defpath = getcolumns(setdrawer).filter((it) => it.key == activeTabKey)[0]?.pathconfig ?? {};
return defpath;
......@@ -614,10 +612,10 @@ function Contract(props) {
activeTabKey={activeTabKey}
onTabChange={(key) => {
setactiveTabKey(key);
cflag(true);
setextraparams({});
}}
formRef={tableRef}
extraparams={state?.contractNo && !flag ? { 'contractNo': state?.contractNo } : {}}
extraparams={extraparams}
/>
<DrawerPro
{...drawer}
......
......@@ -42,7 +42,7 @@ const Costanalysis = () => {
}, [activeKey]);
const tabList = useMemo(() => {
return getcolumns();
}, [activeKey]);
}, [activeKey, extraparams]);
const rightExtra = (text, row, _, action) => {
return [
activeKey == 'item-1' && <PremButton
......@@ -194,8 +194,7 @@ const Costanalysis = () => {
catk(state.pageStatus == 1 ? 'item-1' : 'item-2');
setextraparams(state.extraparams);
}
}, [state])
}, [state]);
return <div ref={boxRef}>
<AutoTable
pagetitle={<h3 className="page-title">费用分析</h3>}
......@@ -205,10 +204,9 @@ const Costanalysis = () => {
resizeable={false}
bordered={false}
x={2500}
extraparams={extraparams}
onTabChange={(key) => {
catk(key);
setextraparams({})
setextraparams({});
}}
activeTabKey={activeKey}
tabList={tabList}
......@@ -226,6 +224,7 @@ const Costanalysis = () => {
}
}
}}
extraparams={extraparams}
/>
......
import React, { useState, useRef } from 'react';
import React, { useState, useRef, useEffect } from 'react';
import AutoTable from '@/components/AutoTable/mtable';
import { useRequest } from 'ahooks';
import { doFetch } from '@/utils/doFetch';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment