From 129170bfe699cfaf7f6143ffba93c33f317fd558 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 01 十二月 2023 11:00:39 +0800 Subject: [PATCH] 2023-12-01 --- src/tabviews/custom/components/card/cardcellList/index.jsx | 52 +++++++++++++------------ src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx | 10 ++-- src/components/normalform/modalform/index.jsx | 4 +- 3 files changed, 34 insertions(+), 32 deletions(-) diff --git a/src/components/normalform/modalform/index.jsx b/src/components/normalform/modalform/index.jsx index 33b243c..a277d8a 100644 --- a/src/components/normalform/modalform/index.jsx +++ b/src/components/normalform/modalform/index.jsx @@ -72,7 +72,7 @@ required: item.required, message: item.label + '涓嶅彲涓虹┖!' }, { - validator: (rule, value, callback) => this.handleConfirmPassword(rule, value, callback, item) + validator: (rule, value, callback) => this.checkNumber(rule, value, callback, item) }] } else if (item.type === 'textarea') { item.rules = [ @@ -164,7 +164,7 @@ this.setState({ formlist }) } - handleConfirmPassword = (rule, value, callback, item) => { + checkNumber = (rule, value, callback, item) => { let val = parseFloat(value) if (!isNaN(val)) { diff --git a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx index e5e7e1f..8e8f520 100644 --- a/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx +++ b/src/menu/components/chart/antv-bar/chartcompile/formconfig.jsx @@ -67,7 +67,7 @@ tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', min: 1, max: 24, - decimal: 0, + precision: 0, required: true }, { @@ -558,8 +558,8 @@ label: '鏌卞舰瀹藉害', tooltip: '绌哄�兼椂锛屽搴﹁嚜閫傚簲銆�', min: 5, - max: 100, - decimal: 0, + max: 200, + precision: 0, initval: card.barSize, forbid: !['bar'].includes(card.chartType), required: false @@ -570,7 +570,7 @@ tooltip: '鏌卞舰鍥句笂绔渾瑙掋��', min: 0, max: 200, - decimal: 0, + precision: 0, initval: card.barRadius || 0, forbid: !['bar'].includes(card.chartType), required: false @@ -619,7 +619,7 @@ tooltip: '鍧愭爣杞存爣娉ㄦ枃鏈殑鏃嬭浆瑙掑害銆�', min: 0, max: 360, - decimal: 0, + precision: 0, initval: card.rotate, forbid: appType !== 'mob', required: false diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index c1e0fc5..2cecc45 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -199,9 +199,10 @@ // } if (/^http.+(.txt|.doc|.docx|.pdf|.xlsx|.xls|.zip|.rar|.ppt)$/i.test(url)) { + let name = url.replace(/.+\//g, '').replace(/\.{1}[^.]*$/g, '') let d = document.createElement('a') d.href = url - d.setAttribute('download', 'download') + d.setAttribute('download', name) d.setAttribute('target', '_blank') document.body.appendChild(d) d.click() @@ -394,6 +395,31 @@ if (val !== '') { let orival = val + + if (card.linkType === 'download') { + let url = '' + + if (card.link === 'static') { + url = card.linkurl + } else { + url = data[card.linkurl] + } + + if (/^http.+(.txt|.doc|.docx|.pdf|.xlsx|.xls|.zip|.rar)$/i.test(url)) { + if (/pdf$/i.test(url)) { + val = <><img src="./media/pdf.png" className="file-image" alt=""/> {val}</> + } else if (/(.doc|.docx)$/i.test(url)) { + val = <><img src="./media/word.png" className="file-image" alt=""/> {val}</> + } else if (/(.xlsx|.xls)$/i.test(url)) { + val = <><img src="./media/excel.png" className="file-image" alt=""/> {val}</> + } else if (/(.zip|.rar)$/i.test(url)) { + val = <><img src="./media/rar.png" className="file-image" alt=""/> {val}</> + } else { + val = <><img src="./media/txt.png" className="file-image" alt=""/> {val}</> + } + } + } + if (card.format === 'encryption') { val = <Encrypts value={val} /> } @@ -444,30 +470,6 @@ } } className = mark.signType - } - - if (card.linkType === 'download') { - let url = '' - - if (card.link === 'static') { - url = card.linkurl - } else { - url = data[card.linkurl] - } - - if (/^http.+(.txt|.doc|.docx|.pdf|.xlsx|.xls|.zip|.rar)$/i.test(url)) { - if (/pdf$/i.test(url)) { - val = <><img src="/media/pdf.png" className="file-image" alt=""/> {val}</> - } else if (/(.doc|.docx)$/i.test(url)) { - val = <><img src="/media/word.png" className="file-image" alt=""/> {val}</> - } else if (/(.xlsx|.xls)$/i.test(url)) { - val = <><img src="/media/excel.png" className="file-image" alt=""/> {val}</> - } else if (/(.zip|.rar)$/i.test(url)) { - val = <><img src="/media/rar.png" className="file-image" alt=""/> {val}</> - } else { - val = <><img src="/media/txt.png" className="file-image" alt=""/> {val}</> - } - } } if (card.link || (card.anchors && card.anchors.length > 0)) { -- Gitblit v1.8.0