From 8d66ff34fae5b048a6b7923cc75d34f13a08be9d Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 02 八月 2022 11:42:43 +0800
Subject: [PATCH] Merge branch 'develop'

---
 src/templates/zshare/createinterface/index.jsx |   34 ++++++++++++++++++----------------
 1 files changed, 18 insertions(+), 16 deletions(-)

diff --git a/src/templates/zshare/createinterface/index.jsx b/src/templates/zshare/createinterface/index.jsx
index 1583cd2..4156e22 100644
--- a/src/templates/zshare/createinterface/index.jsx
+++ b/src/templates/zshare/createinterface/index.jsx
@@ -7,10 +7,11 @@
 import MutilForm from './mutilform'
 import Utils from '@/utils/utils.js'
 import options from '@/store/options.js'
+import { updateForm } from '@/utils/utils-update.js'
 import Api from '@/api'
 import './index.scss'
 
-class CreateFunc extends Component {
+class CreateInterface extends Component {
   static propTypes = {
     dict: PropTypes.object,  // 瀛楀吀椤�
     trigger: PropTypes.func
@@ -422,20 +423,14 @@
                 _LongParam = ''
               }
             }
-            let fields = []
 
             if (_LongParam && _LongParam.type === 'Modal') {
-              if (_LongParam.groups.length > 0) {
-                _LongParam.groups.forEach(group => {
-                  fields = [...fields, ...group.sublist]
-                })
-              } else {
-                fields = _LongParam.fields
-              }
+              _LongParam = updateForm(_LongParam)
             }
 
-            if (fields && fields.length > 0) {
-              formlist = fields.map(cell => {
+            if (_LongParam && _LongParam.fields.length > 0) {
+              _LongParam.fields.forEach(cell => {
+                if (!cell.field) return 
                 let _fieldlen = cell.fieldlength || 50
 
                 if (cell.type === 'textarea' || cell.type === 'fileupload' || cell.type === 'multiselect') {
@@ -462,6 +457,8 @@
                   _fieldtype = 'datetime'
                 } else if (_field.type === 'number') {
                   _fieldtype = `decimal(18,${_fieldlen})`
+                } else if (_field.type === 'rate') {
+                  _fieldtype = `decimal(18,2)`
                 }
 
                 _field.fieldtype = _fieldtype
@@ -471,7 +468,7 @@
                   _field.value = ''
                 }
 
-                return _field
+                formlist.push(_field)
               })
             }
             resolve(true)
@@ -668,6 +665,8 @@
           _type = 'datetime'
         } else if (form.type === 'number') {
           _type = `decimal(18,${form.fieldlen})`
+        } else if (form.type === 'rate') {
+          _type = `decimal(18,2)`
         }
 
         _declarefields.push(`@${_key} ${_type}`)
@@ -1015,6 +1014,9 @@
       if (!_arr.includes('modifyuserid')) {
         _form.push('modifyuserid=@userid@')
       }
+      if (!_arr.includes('modifyuser')) {
+        _form.push('modifyuser=@username')
+      }
       if (hasvoucher) {
         if (!_arr.includes('bvoucher')) {
           _arr.push('bvoucher')
@@ -1063,7 +1065,7 @@
     } else if (_actionType === 'LogicDelete') { // 閫昏緫鍒犻櫎
       _sql += `
         /* 榛樿sql */
-        update ${btn.sql} set deleted=1,modifydate=getdate(),modifyuserid=@userid@ where ${primaryKey}=@${primaryKey}@;`
+        update ${btn.sql} set deleted=1,modifydate=getdate(),modifyuser=@username,modifyuserid=@userid@ where ${primaryKey}=@${primaryKey}@;`
       
     } else if (_actionType === 'delete') {      // 鐗╃悊鍒犻櫎
       let _msg = ''
@@ -1110,11 +1112,11 @@
           onClick={this.props.trigger}
           loading={this.state.loading}
         >
-          {this.props.dict['header.menu.interface.create']}
+          鍒涘缓鎺ュ彛
         </Button>
         {/* 鎺ュ彛閫夐」 */}
         <Modal
-          title={this.props.dict['header.menu.interface.create']}
+          title="鍒涘缓鎺ュ彛"
           visible={this.state.visible}
           width={500}
           maskClosable={false}
@@ -1133,4 +1135,4 @@
   }
 }
 
-export default CreateFunc
+export default CreateInterface

--
Gitblit v1.8.0