From 7044ff5fdc8f41dff0c2d4b880fe91d907ff53ff Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 22 十二月 2022 11:37:50 +0800 Subject: [PATCH] 2022-12-22 --- src/menu/components/card/cardcellcomponent/dragaction/card.jsx | 13 ++++++ src/menu/components/card/cardcellcomponent/formconfig.jsx | 1 src/tabviews/custom/components/card/cardcellList/index.jsx | 47 +++++++++++++++++++++++ src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx | 2 src/menu/components/share/actioncomponent/actionform/index.jsx | 3 + src/menu/components/card/cardcellcomponent/index.jsx | 2 + src/tabviews/custom/components/card/cardcellList/index.scss | 3 + src/menu/components/share/actioncomponent/formconfig.jsx | 2 + src/menu/components/card/cardcellcomponent/elementform/index.jsx | 3 + src/menu/modulecell/index.jsx | 1 src/tabviews/zshare/actionList/printbutton/index.jsx | 38 ++++--------------- 11 files changed, 82 insertions(+), 33 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx index 66b04b5..1167580 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/card.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/card.jsx @@ -180,6 +180,19 @@ {val} </div> ) + } else if (card.eleType === 'color') { + _style.overflow = 'hidden' + let _bgstyle = {backgroundColor: card.value || '#1890ff'} + + if (PicRadio[card.lenWidRadio]) { + _bgstyle.paddingTop = PicRadio[card.lenWidRadio] + } else { + _bgstyle.paddingTop = '100%' + } + + return ( + <div style={_bgstyle}></div> + ) } } diff --git a/src/menu/components/card/cardcellcomponent/elementform/index.jsx b/src/menu/components/card/cardcellcomponent/elementform/index.jsx index 93e0b43..cb4f601 100644 --- a/src/menu/components/card/cardcellcomponent/elementform/index.jsx +++ b/src/menu/components/card/cardcellcomponent/elementform/index.jsx @@ -26,6 +26,7 @@ qrcode: ['eleType', 'datatype', 'width', 'qrWidth', 'color', 'url', 'noValue'], currentDate: ['eleType', 'width', 'dateFormat', 'prefix', 'postfix', 'fixStyle'], formula: ['eleType', 'width', 'height', 'prefix', 'postfix', 'eval', 'formula', 'noValue', 'fixStyle'], + color: ['eleType', 'datatype', 'width', 'lenWidRadio', 'noValue', 'copyable'], } class MainSearch extends Component { @@ -104,7 +105,7 @@ getOptions = (eleType, datatype, link, showType, showInfo, fixStyle, posterType) => { let _options = fromJS(cardTypeOptions[eleType]).toJS() // 閫夐」鍒楄〃 - if (['text', 'number', 'picture', 'slider', 'barcode', 'qrcode', 'video'].includes(eleType)) { + if (['text', 'number', 'picture', 'slider', 'barcode', 'qrcode', 'video', 'color'].includes(eleType)) { if (datatype === 'dynamic') { _options.push('field') if (eleType === 'number') { diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx index 35cb31d..c63b76f 100644 --- a/src/menu/components/card/cardcellcomponent/formconfig.jsx +++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx @@ -18,6 +18,7 @@ { value: 'qrcode', text: '浜岀淮鐮�'}, { value: 'currentDate', text: '褰撳墠鏃堕棿'}, { value: 'formula', text: '鍏紡'}, + { value: 'color', text: '棰滆壊'}, ] let anchors = [] diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index 96f02a0..a71506f 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -155,6 +155,8 @@ } } else if (element.eleType === 'picture') { options = ['border', 'margin'] + } else if (element.eleType === 'color') { + options = ['border', 'margin', 'padding'] } else if (element.eleType === 'text') { options[0] = 'font2' options.push('display') diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx index 8cbf7ca..56a2345 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.jsx +++ b/src/menu/components/share/actioncomponent/actionform/index.jsx @@ -420,6 +420,9 @@ if (this.record.execSuccess === 'grid' || this.record.execError === 'grid') { shows.push('resetPageIndex') } + if (this.record.execMode === 'pop' || this.record.execMode === 'prompt') { + shows.push('position') + } } else if (_funcType === 'mkBinding' || _funcType === 'mkUnBinding') { shows.push('execSuccess', 'execError') } else if (_funcType === 'closetab') { diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index 4e2ec05..bdefbdb 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -128,6 +128,7 @@ if (appType === 'mob') { opentypes = opentypes.filter(item => ['pop', 'prompt', 'exec', 'excelOut', 'innerpage', 'funcbutton'].includes(item.value)) funTypes = [ + { value: 'print', text: '鏍囩鎵撳嵃' }, { value: 'scan', text: '鎵爜' }, { value: 'pay', text: '鏀粯' }, { value: 'refund', text: '閫�娆�' }, @@ -147,6 +148,7 @@ } else if (appType === 'pc') { opentypes = opentypes.filter(item => item.value !== 'tab') funTypes = [ + { value: 'print', text: '鏍囩鎵撳嵃' }, { value: 'changeuser', text: '鍒囨崲鐢ㄦ埛' }, ] pageTemps = [ diff --git a/src/menu/modulecell/index.jsx b/src/menu/modulecell/index.jsx index 5bc7ea3..279ab51 100644 --- a/src/menu/modulecell/index.jsx +++ b/src/menu/modulecell/index.jsx @@ -22,6 +22,7 @@ { value: 'qrcode', text: '浜岀淮鐮�', type: 'action', class: 'element', $init: true}, { value: 'currentDate', text: '褰撳墠鏃堕棿', type: 'action', class: 'element', $init: true}, { value: 'formula', text: '鍏紡', type: 'action', class: 'element', $init: true}, + { value: 'color', text: '棰滆壊', type: 'action', class: 'element', $init: true}, { value: 'sequence', text: '搴忓彿', type: 'action', class: 'element', $init: true } ] }, diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index 4be6caa..acf17c2 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Col, Tooltip, notification, Typography } from 'antd' +import { Col, Tooltip, notification, Typography, message } from 'antd' import moment from 'moment' // import Api from '@/api' @@ -768,6 +768,51 @@ </div> </Col> ) + } else if (card.eleType === 'color') { + let color = '' + + if (card.datatype === 'static') { + color = card.value + } else { + color = data[card.field] || '' + } + + if (color === '' && card.noValue === 'hide') { // 绌哄�奸殣钘� + return null + } + + let _bgstyle = {backgroundColor: color} + + if (PicRadio[card.lenWidRadio]) { + _bgstyle.paddingTop = PicRadio[card.lenWidRadio] + } else { + _bgstyle.paddingTop = '100%' + } + + if (card.copyable === 'true') { + _bgstyle.cursor = 'pointer' + } + + contents.push( + <Col key={card.uuid} style={_style_} span={card.width}> + <div className="ant-mk-color" style={card.style}> + <div style={_bgstyle} onClick={(e) => { + if (card.copyable === 'true') { + e.stopPropagation() + + let oInput = document.createElement('input') + oInput.value = color + document.body.appendChild(oInput) + oInput.select() + document.execCommand('Copy') + document.body.removeChild(oInput) + + message.success('澶嶅埗鎴愬姛銆�') + } + }}></div> + </div> + </Col> + ) } else if (card.eleType === 'button') { let _disabled = data.$disabled if (card.control === 'hidden') { diff --git a/src/tabviews/custom/components/card/cardcellList/index.scss b/src/tabviews/custom/components/card/cardcellList/index.scss index 587b487..501a91f 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.scss +++ b/src/tabviews/custom/components/card/cardcellList/index.scss @@ -158,6 +158,9 @@ vertical-align: top; line-height: inherit; } + .ant-mk-color { + overflow: hidden; + } .ant-switch-large { min-width: 60px; height: 30px; diff --git a/src/tabviews/zshare/actionList/printbutton/index.jsx b/src/tabviews/zshare/actionList/printbutton/index.jsx index a3c01ee..1f9b31a 100644 --- a/src/tabviews/zshare/actionList/printbutton/index.jsx +++ b/src/tabviews/zshare/actionList/printbutton/index.jsx @@ -330,6 +330,13 @@ // 绯荤粺鎵撳嵃鏁版嵁锛屾牎楠宒ata瀛楁 if (!cell.data || cell.data.length === 0) return + Object.keys(cell).forEach(key => { + let _key = key.toLowerCase() + if (['templateid', 'printtype', 'printcount'].includes(_key)) { + cell[_key] = cell[key] + } + }) + cell.data.forEach(item => { let _item = {...formdata} @@ -923,16 +930,7 @@ } }) if (!errorMsg) { - resolve({next: true, list: result.map(res => { - Object.keys(res).forEach(key => { - let _key = key.toLowerCase() - if (['templateid', 'printtype', 'printcount'].includes(_key)) { - res[_key] = res[key] - } - }) - - return res - })}) + resolve({next: true, list: result}) } else { this.execError(errorMsg) resolve({next: false, list: []}) @@ -1270,13 +1268,6 @@ return Api.genericInterface(_callbackparam) } else if (response.status) { - Object.keys(response).forEach(key => { - let _key = key.toLowerCase() - if (['templateid', 'printtype', 'printcount'].includes(_key)) { - response[_key] = response[key] - } - }) - _list.push(response) // 涓�娆¤姹傛垚鍔燂紝杩涜涓嬩竴椤硅姹� @@ -1293,13 +1284,6 @@ if (!response) return if (response.status) { - Object.keys(response).forEach(key => { - let _key = key.toLowerCase() - if (['templateid', 'printtype', 'printcount'].includes(_key)) { - response[_key] = response[key] - } - }) - _list.push(response) // 涓�娆¤姹傛垚鍔燂紝杩涜涓嬩竴椤硅姹� @@ -1323,12 +1307,6 @@ Api.genericInterface(param).then(res => { if (res.status) { - Object.keys(res).forEach(key => { - let _key = key.toLowerCase() - if (['templateid', 'printtype', 'printcount'].includes(_key)) { - res[_key] = res[key] - } - }) _list.push(res) if (params.length === 0) { diff --git a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx index 06aca79..b7d47e3 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx @@ -892,7 +892,7 @@ 瀛楁闆� {verify.columns.length ? <span className="count-tip">{verify.columns.length}</span> : null} </span> - } key="columns"> + } disabled={dataType !== 'custom'} key="columns"> <ColForm columnChange={this.columnChange}/> <FieldsComponent config={verify} -- Gitblit v1.8.0