From c606a7210097ca126fcf9fdb123cebf2a964f51d Mon Sep 17 00:00:00 2001
From: xiejun <xiejun@vci-tech.com>
Date: 星期四, 26 十二月 2024 16:51:44 +0800
Subject: [PATCH] 集成获取mdm分发通用数据格式接口集成 日志输出到日志文件中
---
Source/BladeX-Tool/blade-starter-develop/src/main/resources/templates/sword/edit.js.vm | 99 +++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 99 insertions(+), 0 deletions(-)
diff --git a/Source/BladeX-Tool/blade-starter-develop/src/main/resources/templates/sword/edit.js.vm b/Source/BladeX-Tool/blade-starter-develop/src/main/resources/templates/sword/edit.js.vm
new file mode 100644
index 0000000..7a4f33d
--- /dev/null
+++ b/Source/BladeX-Tool/blade-starter-develop/src/main/resources/templates/sword/edit.js.vm
@@ -0,0 +1,99 @@
+#set($upperEntityPath=$table.entityPath.toUpperCase())
+import React, { PureComponent } from 'react';
+import { Form, Input, Card, Button } from 'antd';
+import { connect } from 'dva';
+import Panel from '../../../components/Panel';
+import styles from '../../../layouts/Sword.less';
+import { $!{upperEntityPath}_DETAIL, $!{upperEntityPath}_SUBMIT } from '../../../actions/$!{table.entityPath}';
+
+const FormItem = Form.Item;
+
+@connect(({ $!{table.entityPath}, loading }) => ({
+ $!{table.entityPath},
+ submitting: loading.effects['$!{table.entityPath}/submit'],
+}))
+@Form.create()
+class $!{entity}Edit extends PureComponent {
+ componentWillMount() {
+ const {
+ dispatch,
+ match: {
+ params: { id },
+ },
+ } = this.props;
+ dispatch($!{upperEntityPath}_DETAIL(id));
+ }
+
+ handleSubmit = e => {
+ e.preventDefault();
+ const {
+ dispatch,
+ match: {
+ params: { id },
+ },
+ form,
+ } = this.props;
+ form.validateFieldsAndScroll((err, values) => {
+ if (!err) {
+ const params = {
+ id,
+ ...values,
+ };
+ console.log(params);
+ dispatch($!{upperEntityPath}_SUBMIT(params));
+ }
+ });
+ };
+
+ render() {
+ const {
+ form: { getFieldDecorator },
+ $!{table.entityPath}: { detail },
+ submitting,
+ } = this.props;
+
+ const formItemLayout = {
+ labelCol: {
+ xs: { span: 24 },
+ sm: { span: 7 },
+ },
+ wrapperCol: {
+ xs: { span: 24 },
+ sm: { span: 12 },
+ md: { span: 10 },
+ },
+ };
+
+ const action = (
+ <Button type="primary" onClick={this.handleSubmit} loading={submitting}>
+ 鎻愪氦
+ </Button>
+ );
+
+ return (
+ <Panel title="淇敼" back="/$!{servicePackage}/$!{table.entityPath}" action={action}>
+ <Form hideRequiredMark style={{ marginTop: 8 }}>
+ <Card className={styles.card} bordered={false}>
+#foreach($field in $!{table.fields})
+#if($!{field.name}!=$!{tenantColumn})
+ <FormItem {...formItemLayout} label="$!{field.comment}">
+ {getFieldDecorator('$!{field.propertyName}', {
+ rules: [
+ {
+ required: true,
+ message: '璇疯緭鍏�$!{field.comment}',
+ },
+ ],
+ initialValue: detail.$!{field.propertyName},
+ })(<Input placeholder="璇疯緭鍏�$!{field.comment}" />)}
+ </FormItem>
+#end
+#end
+ </Card>
+ </Form>
+ </Panel>
+ );
+ }
+}
+
+export default $!{entity}Edit;
--
Gitblit v1.10.0