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

1619

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