From 08cce3334a2dc81d690b518136b0aaea64e48b0b Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期三, 14 六月 2023 09:55:50 +0800
Subject: [PATCH] 2023-06-14

---
 src/templates/modalconfig/index.jsx |   47 +++++++++++++++++++----------------------------
 1 files changed, 19 insertions(+), 28 deletions(-)

diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx
index 97c1bdd..5291743 100644
--- a/src/templates/modalconfig/index.jsx
+++ b/src/templates/modalconfig/index.jsx
@@ -126,6 +126,7 @@
   }
 
   componentDidMount() {
+    window.GLOB.formId = ''
     MKEmitter.addListener('submitStyle', this.getStyle)
     document.onkeydown = (event) => {
       let e = event || window.event
@@ -249,38 +250,28 @@
     let index = null
     uniq.set(card.field, true)
 
-    let _inputIndex = 1
-    let _tabIndex = 1
-    let _linkIndex = 1
     config.fields.forEach((item, i) => {
       if (card.uuid === item.uuid) {
         index = i
       }
 
-      let label = item.label || ''
-      if (item.field && item.field.toLowerCase() !== label.toLowerCase()) {
-        label = label + ' (' + item.field + ')'
-      }
-
       if (['text', 'number', 'textarea', 'color'].includes(item.type) && card.field !== item.field) {
         _inputfields.push({
           field: item.field,
-          label: _inputIndex + '銆�' + label
+          label: item.label
         })
-        _inputIndex++
       }
       if (card.field !== item.field && item.hidden !== 'true' && ['text', 'number', 'select', 'link'].includes(item.type)) {
         _tabfields.push({
           field: item.field,
-          label: _tabIndex + '銆�' + label
+          label: item.label
         })
-        _tabIndex++
       }
 
-      if (item.type === 'switch') {
+      if (item.type === 'switch' || item.type === 'check') {
         _linksupFields.push({
           field: item.field,
-          label: _linkIndex + '銆�' + label
+          label: item.label
         })
       }
 
@@ -291,17 +282,14 @@
 
         _linkableFields.push({
           field: item.field,
-          label: _linkIndex + '銆�' + item.label + ' (琛ㄥ崟)'
+          label: item.label + '-琛ㄥ崟'
         })
         _linksupFields.push({
           field: item.field,
-          label: _linkIndex + '銆�' + label
+          label: item.label
         })
-        _linkIndex++
       }
     })
-
-    _tabfields.unshift({field: '', label: '鍘熻〃鍗�'})
 
     if (index !== null) {
       if (index === 0) {
@@ -318,9 +306,8 @@
 
           _linkableFields.push({
             field: col.field,
-            label: _linkIndex + '銆�' + col.label + ' (鏄剧ず鍒�)'
+            label: col.label + '-鏄剧ず鍒�'
           })
-          _linkIndex++
         }
       })
     } else if (tabConfig) {
@@ -330,9 +317,8 @@
 
           _linkableFields.push({
             field: col.field,
-            label: _linkIndex + '銆�' + col.label + ' (鏄剧ず鍒�)'
+            label: col.label + '-鏄剧ず鍒�'
           })
-          _linkIndex++
         }
       })
     } else if (menu.LongParam) {
@@ -342,9 +328,8 @@
 
           _linkableFields.push({
             field: col.field,
-            label: _linkIndex + '銆�' + col.label + ' (鏄剧ず鍒�)'
+            label: col.label + '-鏄剧ず鍒�'
           })
-          _linkIndex++
         }
       })
     }
@@ -357,6 +342,9 @@
     if (!card.span && standardform && standardform.span) {
       card.span = standardform.span
       card.labelwidth = standardform.labelwidth
+    } else if (!card.span) {
+      card.span = 12
+      card.labelwidth = 33.3
     }
 
     this.setState({
@@ -404,6 +392,8 @@
 
       _config.fields = _config.fields.filter(item => !item.origin)
 
+      window.GLOB.formId = res.uuid
+
       if (['select', 'multiselect', 'link', 'checkbox', 'radio', 'checkcard'].includes(res.type) && res.resourceType === '1' && /\s/.test(res.dataSource)) {
         this.setState({
           sqlVerifing: true
@@ -412,11 +402,13 @@
         let param = {
           func: 's_debug_sql',
           exec_type: 'y',
-          LText: res.dataSource
+          LText: `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20)
+            ${res.dataSource}`
         }
 
         param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss')
         param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${param.timestamp}'`)
+        param.LText = param.LText.replace(/\n/g, ' ')
         
         param.LText = Utils.formatOptions(param.LText)
         param.secretkey = Utils.encrypt('', param.timestamp)
@@ -744,7 +736,6 @@
     })
   }
 
-
   render () {
     const { editAction } = this.props
     const { config, openEdition } = this.state
@@ -781,7 +772,7 @@
                 <Button type="danger" onClick={this.clearConfig}>娓呯┖</Button>
                 <Versions MenuId={editAction.uuid} open_edition={openEdition} updateConfig={this.refreshConfig}/>
                 <ReplaceField type="form" config={config} updateConfig={this.updateconfig}/>
-                <EditComponent options={['form']} config={this.state.config} plusFields={this.plusFields}/>
+                <EditComponent options={['form']} type="formboard" config={this.state.config} plusFields={this.plusFields}/>
                 <Button type="primary" id="save-config" onClick={this.submitConfig} loading={this.state.menuloading}>淇濆瓨</Button>
                 <Button onClick={this.cancelConfig}>杩斿洖</Button>
               </div>

--
Gitblit v1.8.0