fix:项目添加网格
All checks were successful
Build and Push Docker Image / build (push) Successful in 3m27s

This commit is contained in:
zsqtony 2025-09-19 09:45:31 +08:00
parent e736f95419
commit d773694c97
2 changed files with 14 additions and 24 deletions

View File

@ -15,10 +15,9 @@ export default defineConfig({
proxy: {
'/api/': {
// target: 'http://yt:8003',
// target: 'http://10.39.13.78:8001/',
target: 'http://10.39.13.78:8001/',
// target: 'https://test-admin.linyikj.com.cn/',
target: 'https://admin.linyikj.com.cn/',
// target: 'https://admin.linyikj.com.cn/',
changeOrigin: true,
pathRewrite: { '^': '' },

View File

@ -6,8 +6,9 @@ import {
} from '@/common';
import { Selects } from '@/components/Select';
import MyTransferUnits from '@/components/TransferUnits';
import { Apis } from '@/gen/Apis';
import { BetaSchemaForm } from '@ant-design/pro-components';
import { Form } from 'antd';
import { Form, message } from 'antd';
export default function Create(props: MyBetaModalFormProps) {
const [form] = Form.useForm();
@ -36,23 +37,14 @@ export default function Create(props: MyBetaModalFormProps) {
// }
// }}
onFinish={async (values: any) => {
console.log(values, 'values');
// (values.asset_projects_id =
// values?.asset_projects_id || props?.item?.id),
// values?.grid_ranges?.map(
// (res: { asset_projects_id: string }) => {
// res.asset_projects_id = props?.item?.id;
// },
// );
// return Apis.Grid.Grids.Store({
// ...values,
// })
// .then(() => {
// props.reload?.();
// message.success('网格添加成功');
// return true;
// })
// .catch(() => false);
return Apis.Grid.Grids.Store({
asset_projects_id: props?.item?.id || values?.asset_projects_id,
...values,
}).then(() => {
props.reload?.();
message.success('网格添加成功');
return true;
});
}}
columns={[
...(props?.item?.id
@ -84,11 +76,10 @@ export default function Create(props: MyBetaModalFormProps) {
formItemProps: { ...rulesHelper.text },
}),
{
valueType: 'formItem',
dataIndex: 'grid_units_id',
dataIndex: 'grid_ranges',
title: '选择单元',
colProps: { span: 24 },
formItemProps: { ...rulesHelper.text },
formItemProps: { ...rulesHelper.array },
renderFormItem: () => (
<MyTransferUnits
item={{