From 68f28efd7c0c09b3ea8a2a1876c956c17d1a8d37 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期日, 19 一月 2020 15:13:39 +0800
Subject: [PATCH] 2020-01-19

---
 src/setupProxy.js                           |    2 +
 src/tabviews/tableshare/mutilform/index.jsx |    6 +-
 src/tabviews/subtable/subTable/index.jsx    |   67 ++++++++++++++++++++++-----------
 src/templates/modalconfig/source.jsx        |   15 -------
 src/tabviews/subtable/subTable/index.scss   |   22 +++++++---
 5 files changed, 65 insertions(+), 47 deletions(-)

diff --git a/src/setupProxy.js b/src/setupProxy.js
index e2434ee..4e1eb1e 100644
--- a/src/setupProxy.js
+++ b/src/setupProxy.js
@@ -1,6 +1,8 @@
 const proxy = require('http-proxy-middleware')
 const host = 'http://qingqiumarket.cn'
 const service = 'mkwms/'
+// const host = 'http://cloud.mk9h.cn'
+// const service = ''
 
 module.exports = function(app) {
   app.use(proxy('/webapi', { 
diff --git a/src/tabviews/subtable/subTable/index.jsx b/src/tabviews/subtable/subTable/index.jsx
index f860604..2352786 100644
--- a/src/tabviews/subtable/subTable/index.jsx
+++ b/src/tabviews/subtable/subTable/index.jsx
@@ -160,31 +160,51 @@
         </div>
       )
     } else if (item.type === 'colspan') {
-      let contents = ''
-      if (item.subColumn.length > 0) {
-        contents = item.subColumn.map(col => {
-          let content = ''
-          if (col.type === 'text' || col.type === 'textarea') {
-            if (col.field && record.hasOwnProperty(col.field)) {
-              content = `${record[col.field]}`
-            }
+      if (item.subColumn.length === 0) return ''
 
-            content = (col.prefix || '') + content + (col.postfix || '')
-          } else if (col.type === 'number') {
-            if (col.field && record.hasOwnProperty(col.field)) {
-              content = +record[col.field]
-            }
-            if (content && col.format === 'thdSeparator') {
-              content = `${content}`
-              content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
-            }
-            content = (col.prefix || '') + content + (col.postfix || '')
+      let contents = []
+      // if (item.order === 'leftPicRightText' || item.order === 'topPicBottomText') {
+      //   contents = {
+      //     picture: [],
+      //     texts: []
+      //   }
+      // }
+
+      item.subColumn.forEach(col => {
+        let content = ''
+        if (col.type === 'text' || col.type === 'textarea') {
+          if (col.field && record.hasOwnProperty(col.field)) {
+            content = `${record[col.field]}`
           }
-          return content
-        })
-      }
 
-      if (contents && item.order === 'vertical2') {
+          content = (col.prefix || '') + content + (col.postfix || '')
+        } else if (col.type === 'number') {
+          if (col.field && record.hasOwnProperty(col.field)) {
+            content = +record[col.field]
+          }
+          if (content && col.format === 'thdSeparator') {
+            content = `${content}`
+            content = content.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,')
+          }
+          content = (col.prefix || '') + content + (col.postfix || '')
+        } else if (col.type === 'picture') {
+          let photos = ''
+          if (col.field && record.hasOwnProperty(col.field)) {
+            photos = record[col.field].split(',')
+          } else {
+            photos = ''
+          }
+          content = <div className="picture-col">
+            {photos && photos.map((url, i) => {
+              return <img key={`${i}`} src={url} alt=""/>
+            })}
+          </div>
+        }
+
+        contents.push(content)
+      })
+
+      if (contents.length > 0 && item.order === 'vertical2') {
         let _contents = []
         for(let i = 0; i < contents.length; i += 2) {
           _contents.push(contents.slice(i, i + 2).join(' '))
@@ -204,6 +224,9 @@
             {contents && item.order === 'horizontal' && contents.map((content, index) => {
               return (<span key={index}>{content}</span>)
             })}
+            {contents && item.order === 'leftPicRightText' && contents.map((content, index) => {
+              return (<span key={index}>{content}</span>)
+            })}
           </div>
         </div>
       )
diff --git a/src/tabviews/subtable/subTable/index.scss b/src/tabviews/subtable/subTable/index.scss
index 42d854d..9b37d59 100644
--- a/src/tabviews/subtable/subTable/index.scss
+++ b/src/tabviews/subtable/subTable/index.scss
@@ -41,6 +41,20 @@
       .ant-table-tbody > tr > td:last-child {
         border-right: 0;
       }
+      .ant-table-tbody > tr > td {
+        vertical-align: top;
+        .content {
+          position: relative;
+          z-index: 1;
+          word-wrap: break-word;
+          word-break: break-word;
+        }
+        .picture-col {
+          img {
+            max-width: 100%;
+          }
+        }
+      }
       .ant-table-tbody > tr > td.ant-table-column-has-actions {
         position: relative;
         .background {
@@ -50,13 +64,7 @@
           right: 0px;
           bottom: 0px;
         }
-        
-        .content {
-          position: relative;
-          z-index: 1;
-          word-wrap: break-word;
-          word-break: break-word;
-        }
+
         .red {
           .content {
             color: red;
diff --git a/src/tabviews/tableshare/mutilform/index.jsx b/src/tabviews/tableshare/mutilform/index.jsx
index 8e141ae..d5c2616 100644
--- a/src/tabviews/tableshare/mutilform/index.jsx
+++ b/src/tabviews/tableshare/mutilform/index.jsx
@@ -117,7 +117,7 @@
         duration: 10
       })
     }
-
+    
     this.setState({
       readtype: readtype,
       datatype: datatype,
@@ -278,8 +278,8 @@
                 ]
               })(
                 precision === null ?
-                <InputNumber initialValue={_initval} min={min} max={max} disabled={item.readonly === 'true'} onPressEnter={this.handleSubmit} /> :
-                <InputNumber initialValue={_initval} min={min} max={max} precision={precision} disabled={item.readonly === 'true'} onPressEnter={this.handleSubmit} />
+                <InputNumber min={min} max={max} disabled={item.readonly === 'true'} onPressEnter={this.handleSubmit} /> :
+                <InputNumber min={min} max={max} precision={precision} disabled={item.readonly === 'true'} onPressEnter={this.handleSubmit} />
                 )}
             </Form.Item>
           </Col>
diff --git a/src/templates/modalconfig/source.jsx b/src/templates/modalconfig/source.jsx
index a3335c8..ff5f72b 100644
--- a/src/templates/modalconfig/source.jsx
+++ b/src/templates/modalconfig/source.jsx
@@ -30,11 +30,6 @@
         resourceType: '0',
         setAll: 'false',
         options: [],
-        dataSource: '',
-        linkField: '',
-        valueField: '',
-        valueText: '',
-        orderBy: '',
         orderType: 'asc',
         decimal: 0,
         min: '',
@@ -51,11 +46,6 @@
         resourceType: '0',
         setAll: 'false',
         options: [],
-        dataSource: '',
-        linkField: '',
-        valueField: '',
-        valueText: '',
-        orderBy: '',
         orderType: 'asc',
         decimal: 0,
         min: '',
@@ -72,11 +62,6 @@
         resourceType: '0',
         setAll: 'false',
         options: [],
-        dataSource: '',
-        linkField: '',
-        valueField: '',
-        valueText: '',
-        orderBy: '',
         orderType: 'asc',
         decimal: 0,
         min: '',

--
Gitblit v1.8.0