From ac4341ea6b66ae02427d39d35f41d42d78b2eb2e Mon Sep 17 00:00:00 2001 From: Junjie <fallin.jie@qq.com> Date: 星期五, 14 二月 2025 10:08:32 +0800 Subject: [PATCH] # --- zy-asrs-flow/src/pages/system/role/components/edit.jsx | 49 +++++++++++-------------------------------------- 1 files changed, 11 insertions(+), 38 deletions(-) diff --git a/zy-asrs-flow/src/pages/system/role/components/edit.jsx b/zy-asrs-flow/src/pages/system/role/components/edit.jsx index e0491ae..2e42b61 100644 --- a/zy-asrs-flow/src/pages/system/role/components/edit.jsx +++ b/zy-asrs-flow/src/pages/system/role/components/edit.jsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from 'react'; +import React, { useState, useRef, useEffect } from 'react'; import { ProForm, ProFormDigit, @@ -6,15 +6,15 @@ ProFormSelect, ProFormDateTimePicker } from '@ant-design/pro-components'; +import { FormattedMessage, useIntl } from '@umijs/max'; import { Form, Modal } from 'antd'; -import { useIntl, FormattedMessage } from '@umijs/max'; import moment from 'moment'; import Http from '@/utils/http'; const Edit = (props) => { + const intl = useIntl(); const [form] = Form.useForm(); const { } = props; - const intl = useIntl(); useEffect(() => { form.resetFields(); @@ -38,7 +38,11 @@ return ( <> <Modal - title="Edit" + title={ + Object.keys(props.values).length > 0 + ? intl.formatMessage({ id: 'page.edit', defaultMessage: '缂栬緫' }) + : intl.formatMessage({ id: 'page.add', defaultMessage: '娣诲姞' }) + } width={640} forceRender destroyOnClose @@ -63,14 +67,12 @@ name="name" label="瑙掕壊鍚嶇О" colProps={{ md: 12, xl: 12 }} - placeholder="璇疯緭鍏�" rules={[{ required: true, message: "璇疯緭鍏ヨ鑹插悕绉帮紒" }]} /> <ProFormText name="code" label="瑙掕壊鏍囪瘑" colProps={{ md: 12, xl: 12 }} - placeholder="璇疯緭鍏�" rules={[{ required: true, message: "璇疯緭鍏ヨ鑹叉爣璇嗭紒" }]} /> </ProForm.Group> @@ -85,41 +87,12 @@ ]} rules={[{ required: true, message: "璇烽�夋嫨鐘舵�侊紒" }]} /> - <ProFormDateTimePicker - name="updateTime" - label="淇敼鏃堕棿" + <ProFormText + name="memo" + label="澶囨敞" colProps={{ md: 12, xl: 12 }} - transform={(value) => { - return moment(value).toISOString(); - }} /> </ProForm.Group> - <ProFormSelect - name="hostId" - label="鎼滅储鏌ヨ" - colProps={{ md: 12, xl: 12 }} - showSearch - debounceTime={300} // 闃叉姈 - request={async ({ keyWords }) => { - const resp = await Http.doPost('api/host/page', { ...keyWords }); - console.log(resp); - // return [ - // { - // value: keyWords, - // label: '鐩爣_target', - // }, - // { value: '520000201604258831', label: 'Patricia Lopez' }, - // { value: '520000198509222123', label: 'Jose Martinez' }, - // { value: '210000200811194757', label: 'Elizabeth Thomas' }, - // { value: '530000198808222758', label: 'Scott Anderson' }, - // { value: '500000198703236285', label: 'George Jackson' }, - // { value: '610000199906148074', label: 'Linda Hernandez' }, - // { value: '150000197210168659', label: 'Sandra Hall' }, - // { label: '鐩爣_target' }, - // ] - }} - placeholder="Please select a country" - /> </ProForm> </Modal> </> -- Gitblit v1.9.1