From f8a9d0f85017537fc2ac5d1cdb7a9a90f22c556e Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期二, 06 十二月 2022 14:48:53 +0800
Subject: [PATCH] 2022-12-06

---
 src/menu/components/table/normal-table/columns/editColumn/index.jsx |   44 +++++++++++++++++++++++++-------------------
 1 files changed, 25 insertions(+), 19 deletions(-)

diff --git a/src/menu/components/table/normal-table/columns/editColumn/index.jsx b/src/menu/components/table/normal-table/columns/editColumn/index.jsx
index b360aaa..19aa359 100644
--- a/src/menu/components/table/normal-table/columns/editColumn/index.jsx
+++ b/src/menu/components/table/normal-table/columns/editColumn/index.jsx
@@ -14,7 +14,8 @@
   number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'perspective', 'sum', 'rowspan'],
   link: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'blacklist', 'nameField'],
   textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'blacklist'],
-  picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio', 'picSort'],
+  picture: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'blacklist', 'scale', 'lenWidRadio', 'backgroundSize', 'span'],
+  video: ['label', 'field', 'type', 'Align', 'Hide', 'startTime', 'Width', 'blacklist', 'aspectRatio'],
   colspan: ['label', 'type', 'Align', 'Hide', 'blacklist'],
   custom: ['label', 'type', 'Align', 'Hide', 'Width', 'blacklist'],
   action: ['label', 'type', 'Align', 'Width'],
@@ -24,7 +25,6 @@
 
 class NormalTableColumn extends Component {
   static propTpyes = {
-    dict: PropTypes.object,     // 瀛楀吀椤�
     visible: PropTypes.bool,
     column: PropTypes.object,
     fields: PropTypes.array,
@@ -44,7 +44,12 @@
   }
 
   editColumn = (column) => {
-    let formlist = getColumnForm(column, this.props.fields)
+    let fields = fromJS(this.props.fields).toJS().map(item => {
+      item.text = `${item.field}锛�${item.label}锛塦
+      return item
+    })
+    
+    let formlist = getColumnForm(column, fields)
     let _options = fromJS(columnTypeOptions[column.type]).toJS()
     if (column.type === 'text' || column.type === 'number') {
       if (column.perspective === 'linkmenu') {
@@ -62,16 +67,17 @@
 
         return item
       })
-    }, () => {
-      if (column.focus) {
+    })
+    if (column.focus) {
+      setTimeout(() => {
         try {
           let _form = document.getElementById('label')
           _form && _form.select()
         } catch (e) {
           console.warn('琛ㄥ崟focus澶辫触锛�')
         }
-      }
-    })
+      }, 200)
+    }
   }
 
   typeChange = (key, value, option) => {
@@ -95,7 +101,7 @@
         }
       })
     } else if (key === 'field') {
-      let values = {label: option.props.children}
+      let values = {label: option.props.label || option.props.children}
       if (/Decimal|int/ig.test(option.props.datatype)) {
         let decimal = 0
         if (/Decimal/ig.test(option.props.datatype)) {
@@ -157,9 +163,9 @@
     if (!formlist) return null
 
     formlist.forEach((item, index) => {
-      if (item.hidden || item.forbidden) return
+      if (item.hidden || item.forbid) return
 
-      if (item.type === 'text') { // 鏂囨湰鎼滅储
+      if (item.type === 'text') {
         let rules = []
         if (item.key !== 'linkurl') {
           rules = [{
@@ -180,7 +186,7 @@
                 rules: [
                   {
                     required: !!item.required,
-                    message: this.props.dict['form.required.input'] + item.label + '!'
+                    message: '璇疯緭鍏�' + item.label + '!'
                   },
                   ...rules
                 ]
@@ -202,7 +208,7 @@
                 rules: [
                   {
                     required: !!item.required,
-                    message: this.props.dict['form.required.input'] + item.label + '!'
+                    message: '璇疯緭鍏�' + item.label + '!'
                   }
                 ]
               })(item.unlimit ? <InputNumber onPressEnter={this.handleSubmit}/> :
@@ -219,7 +225,7 @@
                 rules: [
                   {
                     required: !!item.required,
-                    message: this.props.dict['form.required.select'] + item.label + '!'
+                    message: '璇烽�夋嫨' + item.label + '!'
                   }
                 ]
               })(
@@ -230,7 +236,7 @@
                   getPopupContainer={() => document.getElementById('columnwinter')}
                 >
                   {item.options.map((option, index) =>
-                    <Select.Option key={index} datatype={option.datatype || ''} value={(option.value || option.field || option.MenuID)}>
+                    <Select.Option key={index} datatype={option.datatype || ''} label={option.label || ''} value={(option.value || option.field || option.MenuID)}>
                       {(option.text || option.label || option.MenuName)}
                     </Select.Option>
                   )}
@@ -253,7 +259,7 @@
                 rules: [
                   {
                     required: !!item.required,
-                    message: this.props.dict['form.required.select'] + item.label + '!'
+                    message: '璇烽�夋嫨' + item.label + '!'
                   }
                 ]
               })(
@@ -299,7 +305,7 @@
                 rules: [
                   {
                     required: !!item.required,
-                    message: this.props.dict['form.required.select'] + item.label + '!'
+                    message: '璇烽�夋嫨' + item.label + '!'
                   }
                 ]
               })(
@@ -312,7 +318,7 @@
             </Form.Item>
           </Col>
         )
-      } else if (item.type === 'textarea') { // 鏂囨湰鎼滅储
+      } else if (item.type === 'textarea') {
         fields.push(
           <Col span={24} key={index} className="textarea">
             <Form.Item label={item.tooltip ?
@@ -326,7 +332,7 @@
                 rules: [
                   {
                     required: !!item.required,
-                    message: this.props.dict['form.required.input'] + item.label + '!'
+                    message: '璇疯緭鍏�' + item.label + '!'
                   }
                 ]
               })(<TextArea rows={2} disabled={item.readonly} placeholder={item.placeholder || ''}/>)}
@@ -372,7 +378,7 @@
         <Modal
           title="鏄剧ず鍒楃紪杈�"
           visible={visible}
-          width={800}
+          width={850}
           maskClosable={false}
           onOk={this.handleSubmit}
           onCancel={this.editModalCancel}

--
Gitblit v1.8.0