fix:添加返回按钮
All checks were successful
Build and Push Docker Image / build (push) Successful in 3m47s
All checks were successful
Build and Push Docker Image / build (push) Successful in 3m47s
This commit is contained in:
parent
5644ee4325
commit
0b99e45527
@ -6,19 +6,33 @@ import {
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { ProTable } from '@ant-design/pro-components';
|
||||
import { useSearchParams } from '@umijs/max';
|
||||
import { useNavigate, useSearchParams } from '@umijs/max';
|
||||
import { Space } from 'antd';
|
||||
import Create from '../modals/JinGangQuCreate';
|
||||
import Update from '../modals/JinGangQuUpdate';
|
||||
|
||||
export default function Index({ title = '金刚区配置' }) {
|
||||
const [searchParams] = useSearchParams();
|
||||
const navigate = useNavigate();
|
||||
return (
|
||||
<MyPageContainer
|
||||
title={title}
|
||||
enableTabs={true}
|
||||
tabKey={`company-set-gan-info-${searchParams.get('id')}`}
|
||||
tabLabel={title}
|
||||
extra={[
|
||||
<Space
|
||||
key="back"
|
||||
align="center"
|
||||
style={{ marginRight: 20, padding: '10px 0 0 0' }}
|
||||
>
|
||||
<MyButtons.Default
|
||||
title="返回上一页"
|
||||
size="middle"
|
||||
onClick={() => navigate(-1)}
|
||||
/>
|
||||
</Space>,
|
||||
]}
|
||||
>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
|
||||
@ -8,7 +8,7 @@ import { defaultMenu } from '@/common/utils/wxCustomerConfig';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import { CaretDownOutlined } from '@ant-design/icons';
|
||||
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
||||
import { useSearchParams } from '@umijs/max';
|
||||
import { useNavigate, useSearchParams } from '@umijs/max';
|
||||
import { Card, Col, Flex, Form, message, Row, Space, Tag } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
import './style.scss';
|
||||
@ -24,6 +24,7 @@ interface FormData {
|
||||
|
||||
export default function Index({ title = '小程序页面配置' }) {
|
||||
const [form] = Form.useForm<FormData>();
|
||||
const navigate = useNavigate();
|
||||
const [menuIndex, setMenuIndex] = useState<number>(0);
|
||||
const [getShowData, setShowData] = useState<any>({});
|
||||
const [searchParams] = useSearchParams();
|
||||
@ -49,7 +50,8 @@ export default function Index({ title = '小程序页面配置' }) {
|
||||
const handleValuesChange = (row: FormData) => {
|
||||
console.log('row', row);
|
||||
let data: ApiTypes.Company.CompanyConfigs.Store = {
|
||||
companies_id: Number(searchParams.get('id')) || 0,
|
||||
// companies_id: Number(searchParams.get('id')) || 0,
|
||||
companies_id: 4,
|
||||
config_key: 'Theme',
|
||||
config_value: {
|
||||
color: formValues?.color,
|
||||
@ -65,7 +67,8 @@ export default function Index({ title = '小程序页面配置' }) {
|
||||
if (getShowData?.id) {
|
||||
Apis.Company.CompanyConfigs.Update({
|
||||
...data,
|
||||
id: getShowData?.id || 0,
|
||||
// id: getShowData?.id || 0,
|
||||
id: 2,
|
||||
}).then(() => {
|
||||
message.success('保存成功');
|
||||
});
|
||||
@ -120,6 +123,19 @@ export default function Index({ title = '小程序页面配置' }) {
|
||||
enableTabs={true}
|
||||
tabKey="company-set-page-info"
|
||||
tabLabel={title}
|
||||
extra={[
|
||||
<Space
|
||||
key="back"
|
||||
align="center"
|
||||
style={{ marginRight: 20, padding: '10px 0 0 0' }}
|
||||
>
|
||||
<MyButtons.Default
|
||||
title="返回上一页"
|
||||
size="middle"
|
||||
onClick={() => navigate(-1)}
|
||||
/>
|
||||
</Space>,
|
||||
]}
|
||||
>
|
||||
<div className="page-config-container">
|
||||
<Row gutter={[24, 0]}>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user