Explorar o código

fix(审批流-表单设计): 修复表格控件不可改名问题

ZhaoJun hai 1 ano
pai
achega
050f892975

+ 22 - 0
src/components/AuditForm/ItemAttribute.js

@@ -59,6 +59,8 @@ function ItemAttribute(props) {
       case 'DDDateField':
         FormContent = <DDDateField {...formProps} />;
         break;
+      case 'DIYTable':
+        FormContent = <TableName {...formProps} />;
     }
 
     return FormContent;
@@ -539,3 +541,23 @@ function NumberField(props) {
     </Form>
   );
 }
+
+function TableName(props) {
+  const { item, btns, onFinish } = props;
+  const [form] = Form.useForm();
+  return (
+    <Form
+      form={form}
+      labelCol={{ span: 4 }}
+      wrapperCol={{ span: 20 }}
+      autoComplete="off"
+      initialValues={item.props}
+      onFinish={onFinish}
+    >
+      <Form.Item label="表格名称" name="label">
+        <Input />
+      </Form.Item>
+      {btns}
+    </Form>
+  );
+}

+ 3 - 0
src/components/AuditForm/index.js

@@ -124,6 +124,9 @@ function AuditForm(props) {
 
     if (formItem?.isTable) {
       // 如果是表格的话,还要寻找内部的被点击的col
+      if (selectList.length) {
+        return formItem || null;
+      }
       return (
         formItem.columns.find(
           (item) => item.props.id === selectList[selectList.length - 1],