From c0e1a2f76bb28ab71e54d30ac2dda945fa1e4a7e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 02 七月 2024 11:51:35 +0800
Subject: [PATCH] 2024-07-02

---
 src/components/normalform/modalform/index.jsx          |   15 +++++++++++++--
 src/menu/components/carousel/prop-card/index.jsx       |    1 -
 src/components/normalform/modalform/mkSelect/index.jsx |    6 +++---
 3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/src/components/normalform/modalform/index.jsx b/src/components/normalform/modalform/index.jsx
index e30a12a..59a1ea6 100644
--- a/src/components/normalform/modalform/index.jsx
+++ b/src/components/normalform/modalform/index.jsx
@@ -32,6 +32,7 @@
 
   state = {
     formlist: [],    // 琛ㄥ崟椤�
+    formId: ''
   }
 
   record = {}
@@ -40,6 +41,15 @@
     let record = {}
     let controlFields = {}
     let fieldMap = new Map()
+    let formId = (() => {
+      let uuid = []
+      let _options = '0123456789abcdefghigklmnopqrstuv'
+      for (let i = 0; i < 19; i++) {
+        uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1))
+      }
+      uuid = uuid.join('')
+      return uuid
+    })()
 
     let formlist = this.props.formlist.filter(item => {
       if (item.controlFields) { // 澶氬眰琛ㄥ崟鎺у埗
@@ -56,6 +66,7 @@
       if (item.options) {
         item.oriOptions = fromJS(item.options).toJS()
       }
+      item.$formId = formId
 
       if (item.type === 'text') {
         let _rules = [{
@@ -162,7 +173,7 @@
 
     this.record = record
 
-    this.setState({ formlist })
+    this.setState({ formlist, formId })
   }
 
   checkNumber = (rule, value, callback, item) => {
@@ -385,7 +396,7 @@
     }
 
     return (
-      <Form {...formItemLayout} className="normal-form-field" id="normal-form-field">
+      <Form {...formItemLayout} className="normal-form-field" id={this.state.formId}>
         <Row gutter={24}>{this.getFields()}</Row>
       </Form>
     )
diff --git a/src/components/normalform/modalform/mkSelect/index.jsx b/src/components/normalform/modalform/mkSelect/index.jsx
index 4b8ee1a..7c7d8ed 100644
--- a/src/components/normalform/modalform/mkSelect/index.jsx
+++ b/src/components/normalform/modalform/mkSelect/index.jsx
@@ -125,7 +125,7 @@
             filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
             onSelect={this.selectChange}
             onChange={(val) => val === undefined && this.selectChange('')}
-            getPopupContainer={() => document.getElementById('normal-form-field')}
+            getPopupContainer={() => config.$formId ? document.getElementById(config.$formId) : document.body}
           >
             {options.map((option, i) =>
               <Select.Option key={i} disabled={option.disabled} value={option.field || ''}>{`${option.label}锛�${option.field}锛塦}</Select.Option>
@@ -142,7 +142,7 @@
           filterOption={(input, option) => (option.props.children + option.props.extend).toLowerCase().indexOf(input.toLowerCase()) >= 0}
           onSelect={this.selectChange}
           onChange={(val) => val === undefined && this.selectChange('')}
-          getPopupContainer={() => document.getElementById('normal-form-field')}
+          getPopupContainer={() => config.$formId ? document.getElementById(config.$formId) : document.body}
         >
           {options.map((option, i) =>
             <Select.Option key={i} disabled={option.disabled} title={option.label || option.text} extend={config.extendName ? (option[config.extendName] || '') : ''} value={option.value || option.field || ''}>{option.label || option.text}</Select.Option>
@@ -156,7 +156,7 @@
         defaultValue={value}
         filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}
         onChange={this.mutilselectChange}
-        getPopupContainer={() => document.getElementById('normal-form-field')}
+        getPopupContainer={() => config.$formId ? document.getElementById(config.$formId) : document.body}
       >
         {options.map((option, i) =>
           <Select.Option key={i} disabled={option.disabled} value={option.value || option.field}>{option.label || option.text}</Select.Option>
diff --git a/src/menu/components/carousel/prop-card/index.jsx b/src/menu/components/carousel/prop-card/index.jsx
index ab40408..b1719c7 100644
--- a/src/menu/components/carousel/prop-card/index.jsx
+++ b/src/menu/components/carousel/prop-card/index.jsx
@@ -255,7 +255,6 @@
             <CopyComponent type="carpropcard" card={card}/>
             <PasteComponent config={card} options={['cardcell']} updateConfig={this.updateComponent} />
             <FontColorsOutlined className="style" title="璋冩暣鏍峰紡" onClick={this.changeStyle}/>
-            <ClockComponent config={card} updateConfig={this.updateComponent}/>
             {card.wrap.datatype === 'dynamic' ? <ClockComponent config={card} updateConfig={this.updateComponent}/> : <ClockCircleOutlined style={{color: '#eeeeee', cursor: 'not-allowed'}}/>}
             <DeleteOutlined className="close" title="鍒犻櫎缁勪欢" onClick={() => this.props.deletecomponent(card.uuid)} />
             {card.wrap.datatype === 'dynamic' ? <SettingComponent config={card} updateConfig={this.updateComponent} /> : <SettingOutlined style={{color: '#eeeeee', cursor: 'not-allowed'}}/>}

--
Gitblit v1.8.0