From ed1cc4adc145f8685d04763e19fbd6b0bd80c136 Mon Sep 17 00:00:00 2001
From: king <18310653075@163.com>
Date: 星期四, 09 六月 2022 16:22:44 +0800
Subject: [PATCH] 2022-06-09

---
 src/menu/components/card/cardcellcomponent/dragaction/card.jsx |   45 +++++++++++++++++++++++++++++++++++++++------
 1 files changed, 39 insertions(+), 6 deletions(-)

diff --git a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx
index 9b75923..61b0c90 100644
--- a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx
+++ b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx
@@ -27,6 +27,7 @@
   '5:1': '20%', '6:1': '16.67%', '7:1': '14.29%', '8:1': '12.5%', '9:1': '11.11%',
   '10:1': '10%', '3:4': '133.33%', '2:3': '150%', '9:16': '177.78%'
 }
+const appType = sessionStorage.getItem('appType')
 
 const Card = ({ id, parent, fields, card, moveCard, findCard, editCard, delCard, copyCard, changeStyle, updateMarks }) => {
   const originalIndex = findCard(id).index
@@ -74,11 +75,26 @@
       )
     } else if (card.eleType === 'text' || card.eleType === 'number') {
       let val = `${card.prefix || ''}${card.datatype === 'static' ? (card.value || '') : (card.field || '')}${card.postfix || ''}`
+      if (card.fixStyle === 'alone') {
+        let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight}
+        val = <><span style={_s}>{card.prefix || ''}</span>{`${card.datatype === 'static' ? (card.value || '') : (card.field || '')}`}<span style={_s}>{card.postfix || ''}</span></>
+      }
       return (
         <div className={'ant-mk-text line' + (card.height || '')} style={{height: card.innerHeight || 'auto'}}>{val}</div>
       )
     } else if (card.eleType === 'icon') {
-      return (<MkIcon type={card.icon}/>)
+      let fontSize = 14
+      let lineHeight = 1.5
+
+      if (card.style.fontSize) {
+        fontSize = parseInt(card.style.fontSize)
+      }
+      if (card.style.lineHeight) {
+        lineHeight = parseFloat(card.style.lineHeight)
+      }
+
+      let innerHeight = fontSize * lineHeight
+      return (<MkIcon style={{height: innerHeight}} className="ant-mk-icon" type={card.icon}/>)
     } else if (card.eleType === 'slider') {
       let val = card.value ? (card.value / card.maxValue) * 100 : 30
       return <MkProgress value={val} config={card}/>
@@ -135,21 +151,32 @@
         </div>
       )
     } else if (card.eleType === 'video') {
+      _style.overflow = 'hidden'
       return (
-        <div>
-          <Video card={card} value={card.url || 'http://qingqiumarket.cn/mkwms/Content/images/upload/20210104/trailer.mp4'}/>
+        <div className="video-wrap">
+          <Video card={card} poster={card.posterUrl || ''} value={card.url || 'http://qingqiumarket.cn/mkwms/Content/images/upload/20210104/trailer.mp4'}/>
         </div>
       )
     } else if (card.eleType === 'currentDate') {
+      let val = `${card.prefix || ''}${moment().format(card.dateFormat)}${card.postfix || ''}`
+      if (card.fixStyle === 'alone') {
+        let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight}
+        val = <><span style={_s}>{card.prefix || ''}</span>{moment().format(card.dateFormat)}<span style={_s}>{card.postfix || ''}</span></>
+      }
       return (
         <div className="ant-mk-date">
-          {`${card.prefix || ''}${moment().format(card.dateFormat)}${card.postfix || ''}`}
+          {val}
         </div>
       )
     } else if (card.eleType === 'formula') {
+      let val = `${card.prefix || ''}${card.formula}${card.postfix || ''}`
+      if (card.fixStyle === 'alone') {
+        let _s = {fontSize: card.fixSize, color: card.fixColor, marginLeft: card.fixLeft, marginRight: card.fixRight}
+        val = <><span style={_s}>{card.prefix || ''}</span>{card.formula}<span style={_s}>{card.postfix || ''}</span></>
+      }
       return (
         <div className="ant-mk-date">
-          {`${card.prefix || ''}${card.formula}${card.postfix || ''}`}
+          {val}
         </div>
       )
     }
@@ -160,6 +187,12 @@
       e.stopPropagation()
       MKEmitter.emit('clickComponent', card, parent, 'cardcell')
     }
+  }
+
+  let able = true
+  if ((appType === 'mob' || appType === 'pc') && parent && (parent.setting.click === 'menu' || parent.setting.click === 'menus')) {
+  // if ((appType === 'mob' || appType === 'pc') && parent && parent.setting.click === 'menu') {
+    able = false
   }
 
   return (
@@ -173,7 +206,7 @@
       </div>
     } trigger="hover">
       <div ref={node => drag(drop(node))} className={'ant-col card-cell ant-col-' + card.width}>
-        <div style={_style} onClick={clickComponent} id={card.uuid}>
+        <div style={_style} onClick={clickComponent} onDoubleClick={() => able && editCard(id)} id={card.uuid}>
           {getContent()}
         </div>
       </div>

--
Gitblit v1.8.0