From f9f60bb0dd17a764ba03faa8041f5b6e9e071553 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期六, 18 一月 2025 23:37:44 +0800
Subject: [PATCH] 2025-01-18

---
 src/menu/components/form/step-form/index.jsx |   56 +++++++++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 43 insertions(+), 13 deletions(-)

diff --git a/src/menu/components/form/step-form/index.jsx b/src/menu/components/form/step-form/index.jsx
index 4395d59..eb48849 100644
--- a/src/menu/components/form/step-form/index.jsx
+++ b/src/menu/components/form/step-form/index.jsx
@@ -2,7 +2,7 @@
 import PropTypes from 'prop-types'
 import { is, fromJS } from 'immutable'
 import { Popover, Modal, Button, Switch, notification, message } from 'antd'
-import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, SwapOutlined, FontColorsOutlined } from '@ant-design/icons'
+import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, SwapOutlined, FontColorsOutlined, VerticalRightOutlined } from '@ant-design/icons'
 
 import asyncComponent from '@/utils/asyncComponent'
 import asyncIconComponent from '@/utils/asyncIconComponent'
@@ -273,7 +273,7 @@
   closeGroup = (cell) => {
     const { group } = this.state
     let card = fromJS(this.state.card).toJS()
-    const _this = this
+    const that = this
 
     confirm({
       content: '纭畾鍒犻櫎鍒嗙粍鍚楋紵',
@@ -285,8 +285,8 @@
           _group = card.subcards[0] || null
         }
 
-        _this.setState({group: _group})
-        _this.updateComponent(card)
+        that.setState({group: _group})
+        that.updateComponent(card)
       },
       onCancel() {}
     })
@@ -317,7 +317,7 @@
   changecols = (type) => {
     let card = fromJS(this.state.card).toJS()
     let config = fromJS(this.state.group).toJS()
-    let _this = this
+    let that = this
 
     config.fields = config.fields.map(item => {
       item.labelwidth = 33.3
@@ -349,8 +349,8 @@
           }
           return item
         })
-        _this.setState({group: config})
-        _this.updateComponent(card)
+        that.setState({group: config})
+        that.updateComponent(card)
       },
       onCancel() {}
     })
@@ -380,7 +380,7 @@
   closeForm = (cell) => {
     let group = fromJS(this.state.group).toJS()
     let card = fromJS(this.state.card).toJS()
-    let _this = this
+    let that = this
 
     group.fields = group.fields.filter(item => item.uuid !== cell.uuid)
 
@@ -394,8 +394,8 @@
     confirm({
       content: `纭畾鍒犻櫎<<${cell.label}>>鍚楋紵`,
       onOk() {
-        _this.setState({group})
-        _this.updateComponent(card)
+        that.setState({group})
+        that.updateComponent(card)
       },
       onCancel() {}
     })
@@ -571,7 +571,7 @@
   clearGroup = () => {
     let group = fromJS(this.state.group).toJS()
     let card = fromJS(this.state.card).toJS()
-    let _this = this
+    let that = this
 
     group.fields = []
 
@@ -585,8 +585,8 @@
     confirm({
       content: `纭畾娓呯┖琛ㄥ崟鍚楋紵`,
       onOk() {
-        _this.setState({group})
-        _this.updateComponent(card)
+        that.setState({group})
+        that.updateComponent(card)
       },
       onCancel() {}
     })
@@ -612,6 +612,35 @@
     } else {
       this.updateComponent(card)
     }
+  }
+
+  toLower = () => {
+    let group = fromJS(this.state.group).toJS()
+    let card = fromJS(this.state.card).toJS()
+    let that = this
+
+    group.fields = group.fields.map(item => {
+      if (item.field) {
+        item.field = item.field.toLowerCase()
+      }
+      return item
+    })
+
+    card.subcards = card.subcards.map(item => {
+      if (item.uuid === group.uuid) {
+        return group
+      }
+      return item
+    })
+
+    confirm({
+      content: `纭畾灏嗗瓧娈佃浆涓哄皬鍐欏悧锛焋,
+      onOk() {
+        that.setState({group})
+        that.updateComponent(card)
+      },
+      onCancel() {}
+    })
   }
 
   clickComponent = (e) => {
@@ -677,6 +706,7 @@
             } trigger="hover">
               <SwapOutlined />
             </Popover> : null}
+            <VerticalRightOutlined style={{color: 'orange', transform: 'rotate(270deg)'}} title="瀛楁杞皬鍐�" onClick={this.toLower}/>
             <FormFork forms={group.fields}/>
             {/* <CopyOutlined title="澶嶅埗" onClick={this.triggerCopy} /> */}
             <Switch checkedChildren="寮�" unCheckedChildren="鍏�" defaultChecked={this.state.showField} onChange={(val) => this.setState({showField: val})} />

--
Gitblit v1.8.0