From e70553694d5ab6869a85a0db60bc14942a06bc15 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期五, 17 七月 2020 11:13:16 +0800
Subject: [PATCH] 2020-07-17

---
 src/store/options.js                                           |    2 
 src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx |    2 
 src/mob/components/login/mob-login-2/index.scss                |   26 ++++++
 src/mob/components/login/mob-login-2/index.jsx                 |   42 +++++++--
 src/locales/zh-CN/main.js                                      |    2 
 src/locales/en-US/main.js                                      |    2 
 src/templates/sharecomponent/columncomponent/index.scss        |    4 
 src/mob/mobshell/index.scss                                    |    2 
 src/utils/utils.js                                             |  106 +++++++++++++-------------
 9 files changed, 118 insertions(+), 70 deletions(-)

diff --git a/src/locales/en-US/main.js b/src/locales/en-US/main.js
index 64fa8d0..e05da11 100644
--- a/src/locales/en-US/main.js
+++ b/src/locales/en-US/main.js
@@ -45,6 +45,8 @@
   'main.excel.content.floaterror': '鍐呭搴斾负娴偣鏁�',
   'main.excel.content.floatIntover': '鏁存暟浣嶈秴鍑鸿寖鍥�',
   'main.excel.content.floatPointover': '灏忔暟浣嶈秴鍑鸿寖鍥�',
+  'main.excel.content.date.over': '鏃堕棿涓鸿礋鍊兼垨澶ぇ',
+  'main.excel.content.date.formatError': '鏃堕棿鏍煎紡閿欒',
   'main.excel.content.maxlimit': '鍐呭瓒呴暱',
   'main.excel.content.limitmin': '灏忎簬鏈�灏忓��',
   'main.excel.content.limitmax': '澶т簬鏈�澶у��',
diff --git a/src/locales/zh-CN/main.js b/src/locales/zh-CN/main.js
index d04855c..89a728c 100644
--- a/src/locales/zh-CN/main.js
+++ b/src/locales/zh-CN/main.js
@@ -46,6 +46,8 @@
   'main.excel.content.floaterror': '鍐呭搴斾负娴偣鏁�',
   'main.excel.content.floatIntover': '鏁存暟浣嶈秴鍑鸿寖鍥�',
   'main.excel.content.floatPointover': '灏忔暟浣嶈秴鍑鸿寖鍥�',
+  'main.excel.content.date.over': '鏃堕棿涓鸿礋鍊兼垨澶ぇ',
+  'main.excel.content.date.formatError': '鏃堕棿鏍煎紡閿欒',
   'main.excel.content.maxlimit': '鍐呭瓒呴暱',
   'main.excel.content.limitmin': '灏忎簬鏈�灏忓��',
   'main.excel.content.limitmax': '澶т簬鏈�澶у��',
diff --git a/src/mob/components/login/mob-login-2/index.jsx b/src/mob/components/login/mob-login-2/index.jsx
index 6a9e31f..1848e65 100644
--- a/src/mob/components/login/mob-login-2/index.jsx
+++ b/src/mob/components/login/mob-login-2/index.jsx
@@ -30,9 +30,10 @@
       user: { uuid: Utils.getuuid(), eleType: 'input', content: '閭/鎵嬫満', style: {}},
       password: { uuid: Utils.getuuid(), eleType: 'input', content: '瀵嗙爜', style: {}},
       login: { uuid: Utils.getuuid(), eleType: 'button', content: '鐧诲綍', style: {fontSize: '16px', color: '#ffffff', textAlign: 'center', lineHeight: 2.4, backgroundColor: '#44a8f2'}},
-      phone: { uuid: Utils.getuuid(), eleType: 'button', content: '鎵嬫満鐭俊鐧诲綍/娉ㄥ唽', style: {fontSize: '16px', color: '#44a8f2', textAlign: 'center', lineHeight: 2.4, border: '1px solid #44a8f2'}},
+      phone: { uuid: Utils.getuuid(), eleType: 'button', content: '鎵嬫満鐭俊鐧诲綍', style: {fontSize: '16px', color: '#44a8f2', textAlign: 'center', lineHeight: 2.4, border: '1px solid #44a8f2'}},
+      register: { uuid: Utils.getuuid(), eleType: 'text', content: '娉ㄥ唽', style: {fontSize: '12px', color: '#44a8f2', textAlign: 'left'}},
       lose: { uuid: Utils.getuuid(), eleType: 'text', content: '蹇樿瀵嗙爜锛�', style: {fontSize: '12px', color: '#44a8f2', textAlign: 'right', textDecoration: 'underline'}},
-      register: { uuid: Utils.getuuid(), eleType: 'text', subItems: [
+      auth: { uuid: Utils.getuuid(), eleType: 'text', subItems: [
         {type: 'qq', icon: 'qq', label: 'QQ'},
         {type: 'wechat', icon: 'wechat', label: '寰俊'},
       ], content: '鍏朵粬鐧诲綍鏂瑰紡', style: {fontSize: '14px', color: '#bcbcbc', textAlign: 'center', marginTop: '30px', marginBottom: '20px'}},
@@ -136,6 +137,18 @@
       ...fromJS(card.register.style).toJS(),
       componentId: card.uuid,
       uuid: card.register.uuid,
+      items: ['font'],
+    }
+    this.props.triggerEdit(element)
+  }
+
+  editAuth = (e) => {
+    const { card } = this.props
+    e.stopPropagation()
+    let element = {
+      ...fromJS(card.auth.style).toJS(),
+      componentId: card.uuid,
+      uuid: card.auth.uuid,
       items: ['font', 'margin'],
     }
     this.props.triggerEdit(element)
@@ -239,16 +252,23 @@
             <ContentUpdate element={card.phone} updateContent={(ele) => this.updateContent({...card, phone: ele})}/>
             {card.phone.content}
           </Button>
-          {card.lose ? <div className={'plat-name ' + (editId === card.lose.uuid ? 'editing' : '')} style={card.lose.style} onClick={this.editLose}>
-            <ContentUpdate element={card.lose} updateContent={(ele) => this.updateContent({...card, lose: ele})}/>
-            {card.lose.content}
+          <div className="row-box">
+            {card.register ? <div className={'col-item ' + (editId === card.register.uuid ? 'editing' : '')} style={card.register.style} onClick={this.editRegister}>
+              <ContentUpdate element={card.register} updateContent={(ele) => this.updateContent({...card, register: ele})}/>
+              {card.register.content}
+            </div> : null}
+            {card.lose ? <div className={'col-item right ' + (editId === card.lose.uuid ? 'editing' : '')} style={card.lose.style} onClick={this.editLose}>
+              <ContentUpdate element={card.lose} updateContent={(ele) => this.updateContent({...card, lose: ele})}/>
+              {card.lose.content}
+            </div> : null}
+            <div style={{clear: 'both'}}></div>
+          </div>
+          {card.auth ? <div className={'plat-name ' + (editId === card.auth.uuid ? 'editing' : '')} style={card.auth.style} onClick={this.editAuth}>
+            <ContentUpdate element={card.auth} updateContent={(ele) => this.updateContent({...card, auth: ele})}/>
+            {card.auth.content}
           </div> : null}
-          {card.register ? <div className={'plat-name ' + (editId === card.register.uuid ? 'editing' : '')} style={card.register.style} onClick={this.editRegister}>
-            <ContentUpdate element={card.register} updateContent={(ele) => this.updateContent({...card, register: ele})}/>
-            {card.register.content}
-          </div> : null}
-          {card.register ? <div className="other-register">
-            {card.register.subItems.map(cell => (
+          {card.auth ? <div className="other-auth">
+            {card.auth.subItems.map(cell => (
               <span key={cell.type}>
                 <Icon type={cell.icon} />
                 <p>{cell.label}</p>
diff --git a/src/mob/components/login/mob-login-2/index.scss b/src/mob/components/login/mob-login-2/index.scss
index 1256cf0..589674c 100644
--- a/src/mob/components/login/mob-login-2/index.scss
+++ b/src/mob/components/login/mob-login-2/index.scss
@@ -32,7 +32,31 @@
   .plat-name:not(.editing):hover {
     border-color: #535353;
   }
-  .other-register {
+  .row-box {
+    position: relative;
+    width: 280px;
+    margin: 0 auto;
+    line-height: 1.5;
+
+    .col-item {
+      position: relative;
+      display: inline-block;
+      width: 50%;
+      border: 1px dotted transparent;
+    }
+    .col-item.right {
+      float: right;
+    }
+
+    .col-item.editing {
+      border: 1px solid #1890ff;
+      box-shadow: 0px 0px 2px #1890ff;
+    }
+    .col-item:not(.editing):hover {
+      border-color: #535353;
+    }
+  }
+  .other-auth {
     text-align: center;
     font-size: 26px;
     color: rgb(68, 168, 242);
diff --git a/src/mob/mobshell/index.scss b/src/mob/mobshell/index.scss
index 58629e7..6eb35b2 100644
--- a/src/mob/mobshell/index.scss
+++ b/src/mob/mobshell/index.scss
@@ -19,6 +19,6 @@
     }
   }
   >.ant-empty {
-    padding-top: 40px;
+    padding-top: 150px;
   }
 }
\ No newline at end of file
diff --git a/src/store/options.js b/src/store/options.js
index c14a975..c219ad8 100644
--- a/src/store/options.js
+++ b/src/store/options.js
@@ -3,5 +3,5 @@
   sysType: 'bG9j$mkYWw=', // yun ( Y2xv$mkdWQ= ) 銆� dandian ( U1$mkNP ) 銆� yewu ( bG9j$mkYWw= )
   caId: 'MjAyMDAxMTYxMjMzMzU1MDd$mkGQzkyMzI1Rjk4MDY0QUNGQjQ2Mg==',
   cakey: 'MjAyMDAxMTYxMjQwMDQ2NDM$mk2N0QzODE2MjExNUI0MTc4OTVDMQ==',
-  cdomain: 'aHR0cDovL2Nsb3V$mkkLm1rOWguY24=' // window.btoa('')
+  cdomain: 'aHR0cDovL2Nsb3V$mkkLm1rOWguY24=' // window.btoa('') 鍩熷悕 涓嶅甫 /
 }
\ No newline at end of file
diff --git a/src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx b/src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx
index 70b0c70..7516ac9 100644
--- a/src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx
+++ b/src/tabviews/zshare/actionList/excelInbutton/excelin/index.jsx
@@ -89,7 +89,7 @@
         })
         notification.warning({
           top: 92,
-          message: '鏂囦欢瑙f瀽閿欒锛岃妫�鏌ユ枃浠舵牸寮忥紒',
+          message: '鏂囦欢瑙f瀽閿欒锛�',
           duration: 5
         })
         // 閿欒浼犻��
diff --git a/src/templates/sharecomponent/columncomponent/index.scss b/src/templates/sharecomponent/columncomponent/index.scss
index 42b7878..db7674d 100644
--- a/src/templates/sharecomponent/columncomponent/index.scss
+++ b/src/templates/sharecomponent/columncomponent/index.scss
@@ -27,6 +27,8 @@
     border: 1px solid #e8e8e8;
     .column-box {
       display: flex;
+      overflow: hidden;
+      text-overflow: ellipsis;
     }
     .column-box:not(:first-child) {
       border-top: 1px solid #e8e8e8;
@@ -41,7 +43,7 @@
         height: 100%;
         .ant-table-column-sorters {
           padding: 0px 8px 12px;
-          white-space: nowrap;
+          // white-space: nowrap;
         }
         .ant-table-column-fields {
           padding: 0px 8px 5px;
diff --git a/src/utils/utils.js b/src/utils/utils.js
index 715db52..c2cc84f 100644
--- a/src/utils/utils.js
+++ b/src/utils/utils.js
@@ -766,92 +766,73 @@
           val = val.replace(/(^\s*$)|\t*|\v*/ig, '')
 
           if (!val && col.required === 'true') { // 蹇呭~鏍¢獙
-            let _error =  _position + dict['main.excel.content.emptyerror']
-            errors.push(_error)
+            errors.push(_position + dict['main.excel.content.emptyerror'])
           } else if (val.length > col.limit) {    // 闀垮害鏍¢獙
-            let _error =  _position + dict['main.excel.content.maxlimit']
-            errors.push(_error)
+            errors.push(_position + dict['main.excel.content.maxlimit'])
           } else {                               // 鍏抽敭瀛楁牎楠�
             keys.forEach(key => {
               let _patten = new RegExp('(^' + key + '\\s+)|(\\s+' + key + '\\s+)', 'ig')
               if (_patten.test(val)) {
-                let _error = _position + dict['main.excel.includekey'] + key
-                errors.push(_error)
+                errors.push(_position + dict['main.excel.includekey'] + key)
               }
             })
           }
         } else if (/^int/ig.test(col.type)) {
           if (!val && val !== 0) {
-            let _error =  _position + dict['main.excel.content.emptyerror']
-            errors.push(_error)
+            errors.push(_position + dict['main.excel.content.emptyerror'])
           } else {
             let _val = val + ''
 
             if (!/^(([^0][0-9]+|0)$)|^(([1-9]+)$)/.test(_val)) {               // 妫�楠屾槸鍚︿负鏁存暟
-              let _error = _position + dict['main.excel.content.interror']
-              errors.push(_error)
+              errors.push(_position + dict['main.excel.content.interror'])
             } else if ((col.min || col.min === 0) && val < col.min) {          // 鏈�灏忓�兼楠�
-              let _error = _position + dict['main.excel.content.limitmin']
-              errors.push(_error)
+              errors.push(_position + dict['main.excel.content.limitmin'])
             } else if ((col.max || col.max === 0) && val > col.max) {          // 鏈�澶у�兼楠�
-              let _error = _position + dict['main.excel.content.limitmax']
-              errors.push(_error)
+              errors.push(_position + dict['main.excel.content.limitmax'])
             }
           }
         } else if (/^Decimal/ig.test(col.type)) {
           if (!val && val !== 0) {
-            let _error =  _position + dict['main.excel.content.emptyerror']
-            errors.push(_error)
+            errors.push(_position + dict['main.excel.content.emptyerror'])
           } else {
             let _val = val + ''
             let _vals = _val.split('.')
 
             if (!/^(([^0][0-9]+|0)\.([0-9]+)$)|^(([^0][0-9]+|0)$)|^(([1-9]+)\.([0-9]+)$)|^(([1-9]+)$)/.test(_val)) {                           // 妫�楠屾槸鍚︿负娴偣鏁�
-              let _error = _position + dict['main.excel.content.floaterror']
-              errors.push(_error)
-            } else if (_vals[0].length > 18) {                         // 妫�楠屾暣鏁颁綅
-              let _error = _position + dict['main.excel.content.floatIntover']
-              errors.push(_error)
+              errors.push(_position + dict['main.excel.content.floaterror'])
+            } else if (_vals[0].length > 18) {                          // 妫�楠屾暣鏁颁綅
+              errors.push(_position + dict['main.excel.content.floatIntover'])
             } else if (_vals[1] && _vals[1].length > col.limit) {       // 鏈�灏忓�兼楠�
-              let _error = _position + dict['main.excel.content.floatPointover']
-              errors.push(_error)
-            } else if ((col.min || col.min === 0) && val < col.min) { // 鏈�灏忓�兼楠�
-              let _error = _position + dict['main.excel.content.limitmin']
-              errors.push(_error)
-            } else if ((col.max || col.max === 0) && val > col.max) { // 鏈�澶у�兼楠�
-              let _error = _position + dict['main.excel.content.limitmax']
-              errors.push(_error)
+              errors.push(_position + dict['main.excel.content.floatPointover'])
+            } else if ((col.min || col.min === 0) && val < col.min) {   // 鏈�灏忓�兼楠�
+              errors.push(_position + dict['main.excel.content.limitmin'])
+            } else if ((col.max || col.max === 0) && val > col.max) {   // 鏈�澶у�兼楠�
+              errors.push(_position + dict['main.excel.content.limitmax'])
             }
           }
         } else if (col.type === 'date') {
-          val = val.replace(/(^\s*$)|\t*|\v*/ig, '')
-
-          if (!val && col.required === 'true') { // 蹇呭~鏍¢獙
-            let _error =  _position + dict['main.excel.content.emptyerror']
-            errors.push(_error)
-          } else {                               // 鍏抽敭瀛楁牎楠�
-            keys.forEach(key => {
-              let _patten = new RegExp('(^' + key + '\\s+)|(\\s+' + key + '\\s+)', 'ig')
-              if (_patten.test(val)) {
-                let _error = _position + dict['main.excel.includekey'] + key
-                errors.push(_error)
-              }
-            })
+          if (typeof(val) === 'number') {
+            if (val > 2958465 || val <= 0) {                 // 鏃堕棿杩囧ぇ鎴栧皬浜庣瓑浜�0
+              errors.push(_position + dict['main.excel.content.date.over'])
+            } else {                                         // 鏃堕棿鏍煎紡鍖�
+              val = this.formatExcelDate(val)
+            }
+          } else if (typeof(val) === 'string') {
+            val = val.replace(/(^\s*$)|\t*|\v*/ig, '')
+            if (!val && col.required === 'true') {           // 鏃堕棿蹇呭~鏍¢獙
+              errors.push(_position + dict['main.excel.content.emptyerror'])
+            } else if (val && !/^[1-9][0-9]{3}/.test(val)) { // 鏃堕棿姝e垯鏍¢獙
+              errors.push(_position + dict['main.excel.content.date.formatError'])
+            }
+          } else {                                           // 鏃堕棿鏍煎紡閿欒
+            errors.push(_position + dict['main.excel.content.date.formatError'])
           }
         }
 
-        if (col.type === 'date') {
-          vals.push(`case when '${val}'='' then '1900-01-01' else dateadd(day,cast('${val}' as int)-2,'1900-01-01') end`)
-        } else {
-          vals.push(`'${val}'`)
-        }
+        vals.push(`'${val}'`)
 
         if (lindex < 40) {
-          if (col.type === 'date') {
-            convals.push(`case when '${val}'='' then '1900-01-01' else dateadd(day,cast('${val}' as int)-2,'1900-01-01') end as ${col.Column}`)
-          } else {
-            convals.push(`'${val}' as ${col.Column}`)
-          }
+          convals.push(`'${val}' as ${col.Column}`)
         }
       })
 
@@ -997,6 +978,20 @@
       bottom: _sqlBottom,
       errors: errors.join('; ')
     }
+  }
+
+  /**
+   * @description 鏍煎紡鍖杄xcel涓殑date鍊�
+   * @param {Number} number 鏃堕棿鍊� 
+   */
+  static formatExcelDate(number) {
+    const time = new Date((number - 1) * 24 * 3600000 + 1)
+    time.setYear(time.getFullYear() - 70)
+    const year = time.getFullYear()
+    const month = time.getMonth() + 1
+    const date = time.getDate() - 1
+
+    return `${year}-${(month < 10 ? '0' + month : month)}-${(date < 10 ? '0' + date : date)}`
   }
 
   /**
@@ -1167,7 +1162,9 @@
     // 鍙橀噺璧嬪��
     _initfields = _initfields.join(',')
     if (_initfields) {
-      _sql += `select ${_initfields}
+      _sql += `
+        
+        select ${_initfields}
         `
     }
 
@@ -1568,7 +1565,8 @@
 
       _sql += `
         /* 榛樿sql */
-        insert into snote (remark,createuserid,CreateUser,CreateStaff) select left('鍒犻櫎琛�:${btn.sql} 鏁版嵁: ${_msg}${primaryKey}='+@ID@,200),@userid@,@username,@fullname delete ${btn.sql} where ${primaryKey}${_ID};`
+        insert into snote (remark,createuserid,CreateUser,CreateStaff) select left('鍒犻櫎琛�:${btn.sql} 鏁版嵁: ${_msg}${primaryKey}='+@ID@,200),@userid@,@username,@fullname
+        delete ${btn.sql} where ${primaryKey}${_ID};`
     } else if (_actionType === 'insertOrUpdate') {
       _sql += `
         /* 榛樿sql */

--
Gitblit v1.8.0