From d6a78806fe449f82c26855228fe6d022d14df88a Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期一, 17 八月 2020 19:06:33 +0800
Subject: [PATCH] 2020-08-17

---
 src/tabviews/zshare/actionList/tabbutton/index.jsx                |    5 ++
 src/tabviews/zshare/calendar/index.jsx                            |    6 ++-
 src/tabviews/subtabtable/index.jsx                                |    2 
 src/templates/zshare/formconfig.jsx                               |   27 +++++++++++--
 src/tabviews/commontable/index.jsx                                |    4 +
 src/tabviews/zshare/normalTable/index.jsx                         |   18 ++++++++-
 src/tabviews/zshare/calendar/index.scss                           |   10 +----
 src/tabviews/calendar/index.jsx                                   |    2 
 src/templates/sharecomponent/columncomponent/columnform/index.jsx |    2 
 9 files changed, 54 insertions(+), 22 deletions(-)

diff --git a/src/tabviews/calendar/index.jsx b/src/tabviews/calendar/index.jsx
index 6b289b6..6c7a7d7 100644
--- a/src/tabviews/calendar/index.jsx
+++ b/src/tabviews/calendar/index.jsx
@@ -612,7 +612,7 @@
             Tab={config.tab}
             SupMenuID={this.props.MenuID}
             MenuID={config.tab.linkTab}
-            refreshSupView={this.loadmaindata}
+            refreshSupView={() => this.loadmaindata()}
             closeModalView={this.closeTab}
           /> : null}
         </Modal>
diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx
index 2813a4b..4e62c47 100644
--- a/src/tabviews/commontable/index.jsx
+++ b/src/tabviews/commontable/index.jsx
@@ -225,8 +225,10 @@
         if (['text', 'select', 'link'].includes(item.type) && param) {
           if (param.searchkey === item.field) {
             item.initval = param.searchval
-          } else if (param.BID && item.field === 'BID') {
+          } else if (param.BID && item.field.toLowerCase() === 'bid') {
             item.initval = param.BID
+          } else if (param.data && param.data[item.field]) {
+            item.initval = param.data[item.field]
           }
         }
 
diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx
index 2478210..d94c371 100644
--- a/src/tabviews/subtabtable/index.jsx
+++ b/src/tabviews/subtabtable/index.jsx
@@ -621,7 +621,7 @@
     this.setState({
       triggerBtn: {
         uuid: new Date().getTime(),
-        parentId: this.props.MenuID,
+        parentId: this.props.SupMenuID,
         button: btn,
         data: record
       }
diff --git a/src/tabviews/zshare/actionList/tabbutton/index.jsx b/src/tabviews/zshare/actionList/tabbutton/index.jsx
index 8f4935b..ccd4e50 100644
--- a/src/tabviews/zshare/actionList/tabbutton/index.jsx
+++ b/src/tabviews/zshare/actionList/tabbutton/index.jsx
@@ -70,9 +70,11 @@
     }
 
     let primaryId = ''
+    let _data = null
 
     if (btn.Ot === 'requiredSgl') {
       primaryId = data[0][setting.primaryKey] || ''
+      _data = data[0]
     }
 
     let newtab = {}
@@ -108,7 +110,8 @@
         type: _type,
         selected: true,
         param: {
-          BID: primaryId
+          BID: primaryId,
+          data: _data
         }
       }
     }
diff --git a/src/tabviews/zshare/calendar/index.jsx b/src/tabviews/zshare/calendar/index.jsx
index 0ebf288..9dec047 100644
--- a/src/tabviews/zshare/calendar/index.jsx
+++ b/src/tabviews/zshare/calendar/index.jsx
@@ -104,6 +104,8 @@
       if (!endTime || !/^(1|2)\d{3}(-|\/)\d{2}(-|\/)\d{2}/.test(endTime)) return
       if (!item[calendar.remarkfield]) return
 
+      let equal = endTime.substr(0, 4) === startTime.substr(0, 4)
+
       datalist.push({
         color: colors[color] || '',
         level: color && levels[color] ? levels[color] : 100,
@@ -111,9 +113,9 @@
         startMonth: startTime.substr(0, 4) + startTime.substr(5, 2),
         endMonth: endTime.substr(0, 4) + endTime.substr(5, 2),
         start: startTime.substr(0, 4) + startTime.substr(5, 2) + startTime.substr(8, 2),
-        startTime: `${startTime.substr(5, 2)}-${startTime.substr(8, 2)}`,
+        startTime: equal ? `${startTime.substr(5, 2)}-${startTime.substr(8, 2)}` : `${startTime.substr(0, 4)}-${startTime.substr(5, 2)}-${startTime.substr(8, 2)}`,
         end: endTime.substr(0, 4) + endTime.substr(5, 2) + endTime.substr(8, 2),
-        endTime: `${endTime.substr(5, 2)}-${endTime.substr(8, 2)}`
+        endTime: equal ?  `${endTime.substr(5, 2)}-${endTime.substr(8, 2)}` : `${endTime.substr(0, 4)}-${endTime.substr(5, 2)}-${endTime.substr(8, 2)}`
       })
     })
 
diff --git a/src/tabviews/zshare/calendar/index.scss b/src/tabviews/zshare/calendar/index.scss
index 4a4e725..d458768 100644
--- a/src/tabviews/zshare/calendar/index.scss
+++ b/src/tabviews/zshare/calendar/index.scss
@@ -88,7 +88,7 @@
                 width: calc(100% - 2px);
                 transition: background 0.1s;
                 margin-bottom: 2px;
-                box-shadow: 0px 0px 1px #f7f7f7;
+                box-shadow: 0px 0px 3px #bae7ff;
                 .header {
                   text-align: center;
                   font-size: 16px;
@@ -102,9 +102,6 @@
                   right: 0;
                   .message {
                     width: 100%;
-                    // white-space: nowrap;
-                    // overflow: hidden;
-                    // text-overflow: ellipsis;
                     .ant-badge-status-text {
                       color: inherit;
                     }
@@ -138,7 +135,7 @@
         width: calc(100% - 2px);
         cursor: pointer;
         transition: background 0.1s;
-        box-shadow: 0px 0px 1px #f7f7f7;
+        box-shadow: 0px 0px 3px #bae7ff;
         .header {
           text-align: center;
           font-size: 16px;
@@ -185,10 +182,7 @@
       display: inline-block;
       min-width: 200px;
       max-width: 350px;
-      // white-space: nowrap;
       vertical-align: middle;
-      // overflow: hidden;
-      // text-overflow: ellipsis;
     }
   }
   .ant-popover-inner-content {
diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx
index 52f16c6..86ac880 100644
--- a/src/tabviews/zshare/normalTable/index.jsx
+++ b/src/tabviews/zshare/normalTable/index.jsx
@@ -299,9 +299,17 @@
       if (item.field && record.hasOwnProperty(item.field)) {
         content = `${record[item.field]}`
       }
-      
-      content = content ? (item.prefix || '') + content + (item.postfix || '') : ''
 
+      if (content !== '') {
+        if (item.format === 'YYYY-MM-DD' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1])/.test(content)) {
+          content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)}`
+        } else if (item.format === 'YYYY-MM-DD HH:mm:ss' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1]).([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]/.test(content)) {
+          content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)} ${content.substr(11, 2)}:${content.substr(14, 2)}:${content.substr(17, 2)}`
+        }
+  
+        content = (item.prefix || '') + content + (item.postfix || '')
+      }
+      
       if (item.marks) {
         let result = this.getMark(record, item.marks)
 
@@ -566,6 +574,12 @@
           let content = record[col.field]
 
           if (content !== '') {
+            if (col.format === 'YYYY-MM-DD' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1])/.test(content)) {
+              content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)}`
+            } else if (col.format === 'YYYY-MM-DD HH:mm:ss' && /^[1-9]\d{3}(-|\/)(0[1-9]|1[0-2])(-|\/)(0[1-9]|[1-2][0-9]|3[0-1]).([0-1][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]/.test(content)) {
+              content = `${content.substr(0, 4)}-${content.substr(5, 2)}-${content.substr(8, 2)} ${content.substr(11, 2)}:${content.substr(14, 2)}:${content.substr(17, 2)}`
+            }
+
             content = (col.prefix || '') + record[col.field] + (col.postfix || '')
           }
 
diff --git a/src/templates/sharecomponent/columncomponent/columnform/index.jsx b/src/templates/sharecomponent/columncomponent/columnform/index.jsx
index 2e59742..7affa3b 100644
--- a/src/templates/sharecomponent/columncomponent/columnform/index.jsx
+++ b/src/templates/sharecomponent/columncomponent/columnform/index.jsx
@@ -8,7 +8,7 @@
 import './index.scss'
 
 const columnTypeOptions = {
-  text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'fieldlength', 'blacklist', 'linkmenu'],
+  text: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'textFormat', 'fieldlength', 'blacklist', 'linkmenu'],
   number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'blacklist', 'linkmenu'],
   link: ['label', 'field', 'type', 'nameField', 'Align', 'Hide', 'IsSort', 'joint', 'Width', 'fieldlength', 'blacklist'],
   textarea: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'prefix', 'postfix', 'fieldlength', 'blacklist'],
diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx
index d695cae..000f39f 100644
--- a/src/templates/zshare/formconfig.jsx
+++ b/src/templates/zshare/formconfig.jsx
@@ -1490,6 +1490,13 @@
       required: true
     },
     {
+      type: 'number',
+      key: 'fieldlength',
+      label: Formdict['model.form.field'] + Formdict['model.length'],
+      initVal: card.fieldlength || (card.type === 'text' ? 50 : 512),
+      required: true
+    },
+    {
       type: 'select',
       key: 'format',
       label: Formdict['header.form.format'],
@@ -1507,11 +1514,21 @@
       required: false
     },
     {
-      type: 'number',
-      key: 'fieldlength',
-      label: Formdict['model.form.field'] + Formdict['model.length'],
-      initVal: card.fieldlength || (card.type === 'text' ? 50 : 512),
-      required: true
+      type: 'select',
+      key: 'textFormat',
+      label: Formdict['header.form.format'],
+      initVal: card.format || '',
+      options: [{
+        value: '',
+        text: Formdict['model.empty']
+      }, {
+        value: 'YYYY-MM-DD',
+        text: 'YYYY-MM-DD'
+      }, {
+        value: 'YYYY-MM-DD HH:mm:ss',
+        text: 'YYYY-MM-DD HH:mm:ss'
+      }],
+      required: false
     },
     {
       type: 'text',

--
Gitblit v1.8.0