From 1d6729f347857b47e03eadc5989aff76fbd3c7ad Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期四, 06 四月 2023 10:25:35 +0800 Subject: [PATCH] Merge branch 'develop' --- src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx | 2 src/templates/zshare/editTable/index.jsx | 20 src/menu/components/card/doublecardcomponent/options.jsx | 11 src/tabviews/custom/components/card/double-data-card/index.scss | 19 src/menu/datasource/verifycard/index.scss | 28 + src/templates/zshare/codemirror/index.scss | 31 + src/templates/zshare/codemirror/replaceform/index.jsx | 82 +++ src/tabviews/custom/components/card/double-data-card/index.jsx | 116 ++-- src/menu/components/card/cardcellcomponent/index.scss | 227 ++++++++++ src/menu/components/card/cardcellcomponent/dragaction/index.jsx | 18 src/menu/components/card/cardcellcomponent/elementform/index.jsx | 6 src/menu/components/table/base-table/columns/editColumn/formconfig.jsx | 2 src/menu/transfer/index.jsx | 2 src/templates/zshare/codemirror/replaceform/index.scss | 0 public/options.json | 10 src/menu/components/share/actioncomponent/dragaction/index.jsx | 14 src/menu/datasource/index.jsx | 4 src/menu/components/card/cardsimplecomponent/options.jsx | 11 src/templates/sharecomponent/fieldscomponent/index.jsx | 2 src/menu/components/table/edit-table/columns/editColumn/index.jsx | 19 src/templates/zshare/codemirror/index.jsx | 94 +++- src/templates/zshare/editTable/index.scss | 3 src/menu/datasource/verifycard/index.jsx | 27 src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx | 2 src/tabviews/custom/components/card/cardcellList/index.jsx | 44 + src/menu/components/card/double-data-card/options.jsx | 11 src/mob/colorsketch/index.jsx | 64 ++ src/menu/components/card/cardcellcomponent/index.jsx | 17 src/templates/zshare/formconfig.jsx | 2 src/menu/components/share/actioncomponent/formconfig.jsx | 4 src/menu/components/card/double-data-card/index.jsx | 2 src/menu/components/share/actioncomponent/index.jsx | 65 ++ src/menu/components/card/cardcellcomponent/formconfig.jsx | 30 + src/menu/components/share/actioncomponent/actionform/index.jsx | 17 src/mob/colorsketch/index.scss | 17 src/tabviews/custom/components/card/cardcellList/index.scss | 224 ++++++++++ src/utils/option.js | 30 - src/menu/components/card/cardcomponent/options.jsx | 11 38 files changed, 1,086 insertions(+), 202 deletions(-) diff --git a/public/options.json b/public/options.json index 4e405d0..bedcbee 100644 --- a/public/options.json +++ b/public/options.json @@ -1,12 +1,12 @@ { - "appId": "201912040924165801464FF1788654BC5AC73", - "appkey": "20191106103859640976D6E924E464D029CF0", + "appId": "202108312122504607B107A83F55B40C98CCF", + "appkey": "20210831212235413F287EC3BF489424496C8", "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", "systemType": "", "externalDatabase": "", "lineColor": "", "filter": "false", - "defaultApp": "mk", + "defaultApp": "mkindustry", "defaultLang": "zh-CN", "WXAppID": "", "WXminiAppID": "", @@ -17,6 +17,6 @@ "transfer": "false", "keepPassword": "true", "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"], - "host": "http://qingqiumarket.cn", - "service": "MKWMS/" + "host": "http://demo.mk9h.cn", + "service": "erp_new/" } \ No newline at end of file diff --git a/src/menu/components/card/cardcellcomponent/dragaction/index.jsx b/src/menu/components/card/cardcellcomponent/dragaction/index.jsx index d2d89ac..41c2326 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/index.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/index.jsx @@ -1,6 +1,7 @@ import React, { useState } from 'react' import { useDrop } from 'react-dnd' import { is, fromJS } from 'immutable' +import { message } from 'antd' import update from 'immutability-helper' import Card from './card' @@ -53,7 +54,6 @@ } copycard.uuid = Utils.getuuid() - copycard.originCard = card try { delete _val.$srcId @@ -76,12 +76,18 @@ oInput.select() document.execCommand('Copy') document.body.removeChild(oInput) + + message.success('澶嶅埗鎴愬姛銆�') + } else { + message.warning('澶嶅埗澶辫触銆�') } - _cards.push(copycard) - - handleList(_cards) - handleMenu(copycard) + if (card.eleType !== 'button') { + _cards.push(copycard) + + handleList(_cards) + handleMenu(copycard) + } } const changeStyle = id => { @@ -149,7 +155,7 @@ if (newcard.OpenType === 'excelIn') { newcard.label = item.text - newcard.class = 'dgreen' + newcard.class = 'border-dgreen' newcard.Ot = 'notRequired' } else if (item.subType === 'excelOut') { newcard.label = item.text diff --git a/src/menu/components/card/cardcellcomponent/elementform/index.jsx b/src/menu/components/card/cardcellcomponent/elementform/index.jsx index 009826c..e21fc1f 100644 --- a/src/menu/components/card/cardcellcomponent/elementform/index.jsx +++ b/src/menu/components/card/cardcellcomponent/elementform/index.jsx @@ -15,8 +15,8 @@ const cardTypeOptions = { sequence: ['eleType', 'width'], - text: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix', 'link', 'anchors', 'noValue', 'bgImage', 'fixStyle', 'copyable'], - number: ['eleType', 'datatype', 'width', 'height', 'prefix', 'postfix', 'noValue', 'fixStyle'], + text: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix', 'link', 'anchors', 'noValue', 'bgImage', 'fixStyle', 'copyable', 'alignItems'], + number: ['eleType', 'datatype', 'width', 'height', 'prefix', 'postfix', 'noValue', 'fixStyle', 'alignItems'], picture: ['eleType', 'datatype', 'width', 'lenWidRadio', 'maxWidth', 'link', 'noValue'], video: ['eleType', 'datatype', 'width', 'aspectRatio', 'autoPlay', 'loop', 'startTime', 'noValue', 'posterType'], icon: ['eleType', 'datatype', 'width', 'tooltip'], @@ -25,7 +25,7 @@ barcode: ['eleType', 'datatype', 'width', 'barHeight', 'displayValue', 'interval', 'noValue'], 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'], + formula: ['eleType', 'width', 'height', 'prefix', 'postfix', 'eval', 'formula', 'noValue', 'fixStyle', 'alignItems'], color: ['eleType', 'datatype', 'width', 'lenWidRadio', 'noValue', 'copyable'], } diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx index 859dc58..76739c9 100644 --- a/src/menu/components/card/cardcellcomponent/formconfig.jsx +++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx @@ -43,6 +43,11 @@ tooltip = '鍦ㄦ墿灞曞崱鐗囦腑锛屽姩鎬佹暟鎹樉绀哄�间负鑾峰彇鍒扮殑绗竴琛屾暟鎹��' } + let width = card.width || 12 + if (/x/.test(card.width)) { + width = +width.replace(/x/, '.5') + } + let forms = [ { type: 'select', @@ -85,7 +90,7 @@ min: 0, label: '鍐呭', initVal: card.value || '', - tooltip: '鏂囨湰绫诲瀷锛屼細鏇挎崲鍐呭涓殑@username@銆丂fullName@銆丂mk_city@銆丂appname@銆丂bid@銆�', + tooltip: '鏂囨湰绫诲瀷锛屼細鏇挎崲鍐呭涓殑@username@銆丂fullName@銆丂mk_city@銆丂appname@銆丂bid@銆丂month@銆丂week@銆丂day@', required: true }, { @@ -328,12 +333,12 @@ { type: 'number', key: 'width', - min: 1, + min: 0.5, max: 24, - precision: 0, + precision: 1, label: '鍏冪礌瀹藉害', - initVal: card.width || 12, - tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼��', + initVal: width, + tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒楋紝鍙缃崐鍒楀嵆.5銆�', required: true }, { @@ -536,7 +541,7 @@ type: 'radio', key: 'eval', label: '瑙f瀽', - initVal: card.eval || 'true', + initVal: card.eval || 'false', tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��', required: false, options: [{ @@ -570,6 +575,19 @@ }, { type: 'radio', + key: 'alignItems', + label: '鍨傜洿瀵归綈', + initVal: card.alignItems || '', + tooltip: '鍨傜洿鏂瑰悜鐨勫榻愭柟寮忋��', + required: false, + options: [ + { value: '', text: '灞呬笂' }, + { value: 'center', text: '灞呬腑' }, + { value: 'end', text: '灞呬笅' } + ] + }, + { + type: 'radio', key: 'fixStyle', label: '鍓嶅悗缂�', initVal: card.fixStyle || '', diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index 109dc08..f752e5a 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -361,6 +361,13 @@ const { elements } = this.state this.elementFormRef.handleConfirm().then(res => { + if (res.width % 0.5) { + res.width = parseInt(res.width / 0.5) * 0.5 + } + if (res.width % 1) { + res.width = (res.width + '').replace(/.5/, 'x') + } + let _elements = elements.map(cell => { if (cell.uuid === res.uuid) { res.style = cell.style || {} @@ -458,6 +465,14 @@ if (res.show === 'link' || res.show === 'icon') { style.color = color[cl] style.backgroundColor = 'transparent' + } else if (res.class === 'default') { + style.color = 'rgba(0, 0, 0, 0.65)' + style.backgroundColor = '#fff' + style.borderColor = '#d9d9d9' + } else if (res.class.indexOf('border') > -1) { + style.color = color[cl] + style.backgroundColor = '#fff' + style.borderColor = color[cl] } else { style.color = '#ffffff' style.backgroundColor = color[cl] @@ -736,7 +751,7 @@ const { elements, visible, actvisible, profVisible, card, record } = this.state return ( - <div className="model-menu-card-cell-list"> + <div className={'model-menu-card-cell-list ' + (cardCell && cardCell.setting && cardCell.setting.layout === 'flex' ? 'mk-flex' : '') }> <DragElement list={elements} parent={cardCell} diff --git a/src/menu/components/card/cardcellcomponent/index.scss b/src/menu/components/card/cardcellcomponent/index.scss index bd6033c..c8d9688 100644 --- a/src/menu/components/card/cardcellcomponent/index.scss +++ b/src/menu/components/card/cardcellcomponent/index.scss @@ -43,4 +43,231 @@ .card-cell:hover, .card-button-cell:hover { box-shadow: 0px 0px 2px #1890ff; } + .card-detail-row { + .ant-col[class*="x"] { + float: left; + box-sizing: border-box; + } + >.ant-col-0x { + width: 2.08333333%; + } + >.ant-col-1x { + width: 6.25%; + } + >.ant-col-2x { + width: 10.41666667%; + } + >.ant-col-3x { + width: 14.58333333%; + } + >.ant-col-4x { + width: 18.75%; + } + >.ant-col-5x { + width: 22.91666667%; + } + >.ant-col-6x { + width: 27.08333333%; + } + >.ant-col-7x { + width: 31.25%; + } + >.ant-col-8x { + width: 35.41666667%; + } + >.ant-col-9x { + width: 39.58333333%; + } + >.ant-col-10x { + width: 43.75%; + } + >.ant-col-11x { + width: 47.91666667%; + } + >.ant-col-12x { + width: 52.08333333%; + } + >.ant-col-13x { + width: 56.25%; + } + >.ant-col-14x { + width: 60.41666667%; + } + >.ant-col-15x { + width: 64.58333333%; + } + >.ant-col-16x { + width: 68.75%; + } + >.ant-col-17x { + width: 72.91666667%; + } + >.ant-col-18x { + width: 77.08333333%; + } + >.ant-col-19x { + width: 81.25%; + } + >.ant-col-20x { + width: 85.41666667%; + } + >.ant-col-21x { + width: 89.58333333%; + } + >.ant-col-22x { + width: 93.75%; + } + >.ant-col-23x { + width: 97.91666667%; + } + } +} +.model-menu-card-cell-list.mk-flex { + >.card-detail-row { + display: flex; + >.ant-col-1 { + flex: 1; + } + >.ant-col-2 { + flex: 2; + } + >.ant-col-3 { + flex: 3; + } + >.ant-col-4 { + flex: 4; + } + >.ant-col-5 { + flex: 5; + } + >.ant-col-6 { + flex: 6; + } + >.ant-col-7 { + flex: 7; + } + >.ant-col-8 { + flex: 8; + } + >.ant-col-9 { + flex: 9; + } + >.ant-col-10 { + flex: 10; + } + >.ant-col-11 { + flex: 11; + } + >.ant-col-12 { + flex: 12; + } + >.ant-col-13 { + flex: 13; + } + >.ant-col-14 { + flex: 14; + } + >.ant-col-15 { + flex: 15; + } + >.ant-col-16 { + flex: 16; + } + >.ant-col-17 { + flex: 17; + } + >.ant-col-18 { + flex: 18; + } + >.ant-col-19 { + flex: 19; + } + >.ant-col-20 { + flex: 20; + } + >.ant-col-21 { + flex: 21; + } + >.ant-col-22 { + flex: 22; + } + >.ant-col-23 { + flex: 23; + } + >.ant-col-24 { + flex: 24; + } + >.ant-col-0x { + flex: 0.5; + } + >.ant-col-1x { + flex: 1.5; + } + >.ant-col-2x { + flex: 2.5; + } + >.ant-col-3x { + flex: 3.5; + } + >.ant-col-4x { + flex: 4.5; + } + >.ant-col-5x { + flex: 5.5; + } + >.ant-col-6x { + flex: 6.5; + } + >.ant-col-7x { + flex: 7.5; + } + >.ant-col-8x { + flex: 8.5; + } + >.ant-col-9x { + flex: 9.5; + } + >.ant-col-10x { + flex: 10.5; + } + >.ant-col-11x { + flex: 11.5; + } + >.ant-col-12x { + flex: 12.5; + } + >.ant-col-13x { + flex: 13.5; + } + >.ant-col-14x { + flex: 14.5; + } + >.ant-col-15x { + flex: 15.5; + } + >.ant-col-16x { + flex: 16.5; + } + >.ant-col-17x { + flex: 17.5; + } + >.ant-col-18x { + flex: 18.5; + } + >.ant-col-19x { + flex: 19.5; + } + >.ant-col-20x { + flex: 20.5; + } + >.ant-col-21x { + flex: 21.5; + } + >.ant-col-22x { + flex: 22.5; + } + >.ant-col-23x { + flex: 23.5; + } + } } \ No newline at end of file diff --git a/src/menu/components/card/cardcomponent/options.jsx b/src/menu/components/card/cardcomponent/options.jsx index 02d46f2..32a1632 100644 --- a/src/menu/components/card/cardcomponent/options.jsx +++ b/src/menu/components/card/cardcomponent/options.jsx @@ -214,6 +214,17 @@ }, { type: 'radio', + field: 'layout', + label: '鍏冪礌甯冨眬', + initval: setting.layout || 'grid', + required: false, + options: [ + {value: 'grid', label: '鏍呮牸甯冨眬'}, + {value: 'flex', label: '寮规�у竷灞�'}, + ] + }, + { + type: 'radio', field: 'clickType', label: '瑙﹀彂鏂瑰紡', initval: setting.clickType || 'normal', diff --git a/src/menu/components/card/cardsimplecomponent/options.jsx b/src/menu/components/card/cardsimplecomponent/options.jsx index 06b6740..f6ca23b 100644 --- a/src/menu/components/card/cardsimplecomponent/options.jsx +++ b/src/menu/components/card/cardsimplecomponent/options.jsx @@ -218,6 +218,17 @@ }, { type: 'radio', + field: 'layout', + label: '鍏冪礌甯冨眬', + initval: setting.layout || 'grid', + required: false, + options: [ + {value: 'grid', label: '鏍呮牸甯冨眬'}, + {value: 'flex', label: '寮规�у竷灞�'}, + ] + }, + { + type: 'radio', field: 'click', label: '鐐瑰嚮浜嬩欢', initval: setting.click || '', diff --git a/src/menu/components/card/double-data-card/index.jsx b/src/menu/components/card/double-data-card/index.jsx index 25728f6..30a4940 100644 --- a/src/menu/components/card/double-data-card/index.jsx +++ b/src/menu/components/card/double-data-card/index.jsx @@ -602,7 +602,7 @@ <PlusOutlined className="plus" title="娣诲姞鍗$墖" onClick={() => this.addCard()}/> {appType !== 'mob' ? <PlusCircleOutlined className="plus" title="娣诲姞鎼滅储" onClick={() => this.addSearch()}/> : null} <PlusSquareOutlined className="plus" title="娣诲姞鎸夐挳" onClick={() => this.addButton()}/> - <NormalForm title="鏁版嵁鍗¤缃�" width={800} update={this.updateWrap} getForms={this.getWrapForms}> + <NormalForm title="鍙岄噸鏁版嵁鍗¤缃�" width={800} update={this.updateWrap} getForms={this.getWrapForms}> <EditOutlined style={{color: '#1890ff'}} title="缂栬緫"/> </NormalForm> <CopyComponent type="datacard" card={card}/> diff --git a/src/menu/components/card/double-data-card/options.jsx b/src/menu/components/card/double-data-card/options.jsx index 704da63..235adfa 100644 --- a/src/menu/components/card/double-data-card/options.jsx +++ b/src/menu/components/card/double-data-card/options.jsx @@ -199,6 +199,17 @@ required: false }, { + type: 'number', + field: 'minWidth', + label: '鏈�灏忓搴�', + min: 0, + max: 5000, + precision: 0, + initval: wrap.minWidth, + tooltip: '璁剧疆鍗$墖鍖哄煙鐨勬渶灏忓搴︼紝鏄剧ず鍖哄煙灏忎簬姝ゅ�煎皢鍑虹幇妯悜婊氬姩銆�', + required: false + }, + { type: 'radio', field: 'permission', label: '鏉冮檺楠岃瘉', diff --git a/src/menu/components/card/doublecardcomponent/options.jsx b/src/menu/components/card/doublecardcomponent/options.jsx index 38a169d..dfdd703 100644 --- a/src/menu/components/card/doublecardcomponent/options.jsx +++ b/src/menu/components/card/doublecardcomponent/options.jsx @@ -165,6 +165,17 @@ }, { type: 'radio', + field: 'layout', + label: '鍏冪礌甯冨眬', + initval: setting.layout || 'grid', + required: false, + options: [ + {value: 'grid', label: '鏍呮牸甯冨眬'}, + {value: 'flex', label: '寮规�у竷灞�'}, + ] + }, + { + type: 'radio', field: 'clickType', label: '瑙﹀彂鏂瑰紡', initval: setting.clickType || 'normal', diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx index 30473b8..786d4e3 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.jsx +++ b/src/menu/components/share/actioncomponent/actionform/index.jsx @@ -552,7 +552,6 @@ this.record.pageTemplate = '' this.record.funcType = '' this.record.sqlType = '' - if (value === 'pop' || value === 'prompt' || value === 'exec') { _fieldval.intertype = 'system' _fieldval.sqlType = '' @@ -565,10 +564,10 @@ _fieldval.Ot = 'notRequired' _fieldval.execSuccess = 'grid' _fieldval.label = '瀵煎叆Excel' - _fieldval.class = 'dgreen' + _fieldval.class = 'border-dgreen' this.record.Ot = 'notRequired' this.record.label = '瀵煎叆Excel' - this.record.class = 'dgreen' + this.record.class = 'border-dgreen' this.record.execSuccess = 'grid' } else if (value === 'excelOut') { _fieldval.intertype = 'system' @@ -576,11 +575,12 @@ _fieldval.class = 'dgreen' _fieldval.execSuccess = 'never' _fieldval.Ot = 'requiredOnce' + _fieldval.control = '' this.record.Ot = 'requiredOnce' this.record.label = '瀵煎嚭Excel' this.record.class = 'dgreen' this.record.execSuccess = 'never' - + this.record.control = '' } else if (value === 'popview') { _fieldval.display = 'modal' _fieldval.Ot = 'requiredSgl' @@ -600,15 +600,6 @@ } else if (value === 'funcbutton') { // _fieldval.funcType = '' - } - if (value === 'excelIn') { - _fieldval.label = '瀵煎叆Excel' - _fieldval.class = 'dgreen' - } else if (value === 'excelOut') { - _fieldval.label = '瀵煎嚭Excel' - _fieldval.class = 'dgreen' - _fieldval.control = '' - this.record.control = '' } if (appType !== 'mob' && _fieldval.Ot === 'notRequired') { diff --git a/src/menu/components/share/actioncomponent/dragaction/index.jsx b/src/menu/components/share/actioncomponent/dragaction/index.jsx index e797df7..cab1425 100644 --- a/src/menu/components/share/actioncomponent/dragaction/index.jsx +++ b/src/menu/components/share/actioncomponent/dragaction/index.jsx @@ -1,6 +1,7 @@ import React, { useState } from 'react' import { useDrop } from 'react-dnd' import { is, fromJS } from 'immutable' +import { message } from 'antd' import update from 'immutability-helper' import Utils from '@/utils/utils.js' @@ -69,7 +70,6 @@ } copycard.uuid = Utils.getuuid() - copycard.originCard = card try { delete _val.$srcId @@ -92,13 +92,17 @@ oInput.select() document.execCommand('Copy') document.body.removeChild(oInput) + + message.success('澶嶅埗鎴愬姛銆�') + } else { + message.warning('澶嶅埗澶辫触銆�') } - const { index: overIndex } = findCard(id) + // const { index: overIndex } = findCard(id) - const _cards = update(cards, { $splice: [[overIndex + 1, 0, copycard]] }) + // const _cards = update(cards, { $splice: [[overIndex + 1, 0, copycard]] }) - handleList(_cards, copycard) + // handleList(_cards, copycard) } const [, drop] = useDrop({ @@ -122,7 +126,7 @@ if (newcard.OpenType === 'excelIn') { newcard.label = item.text - newcard.class = 'dgreen' + newcard.class = 'border-dgreen' newcard.Ot = 'notRequired' } else if (newcard.OpenType === 'excelOut') { newcard.label = item.text diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index ae74c29..91acca3 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -1,4 +1,4 @@ -import { btnCustomClasses, btnClasses } from '@/utils/option.js' +import { btnClasses } from '@/utils/option.js' /** @@ -677,7 +677,7 @@ tooltip: '姝ら鑹蹭负鎸夐挳鍒濆鍖栭鑹诧紝鍙湪鏍峰紡璋冩暣涓慨鏀广��', required: false, forbid: type === 'datacard' && appType === 'mob', // 绉诲姩绔紝婊戝姩鏄剧ず鐨勬寜閽笉璁剧疆閫氱敤棰滆壊 - options: btnCustomClasses + options: btnClasses }, { type: 'radio', diff --git a/src/menu/components/share/actioncomponent/index.jsx b/src/menu/components/share/actioncomponent/index.jsx index e4be98c..731e10c 100644 --- a/src/menu/components/share/actioncomponent/index.jsx +++ b/src/menu/components/share/actioncomponent/index.jsx @@ -266,6 +266,12 @@ if ((btn.OpenType === 'excelIn' || btn.OpenType === 'excelOut') && (!btn.verify || !btn.verify.columns) && (config.subtype === 'basetable' || config.subtype === 'normaltable')) { let columns = [] let maps = [] + let labels = {} + if (config.subtype === 'normaltable') { + config.columns.forEach(col => { + labels[col.field] = col.label + }) + } if (btn.OpenType === 'excelOut') { let pushcol = (item) => { @@ -289,16 +295,27 @@ } config.cols.forEach(item => { - if (item.type === 'colspan' && config.subtype === 'normaltable') { - item.subcols.forEach(cell => { - if (!cell.field || cell.Hide === 'true' || maps.includes(cell.field)) return - maps.push(cell.field) + if (item.Hide === 'true') return - pushcol(cell) - }) + if (config.subtype === 'normaltable') { + if (item.type === 'colspan') { + item.subcols.forEach(cell => { + if (!cell.field || cell.Hide === 'true' || maps.includes(cell.field)) return + maps.push(cell.field) + + pushcol(cell) + }) + } else if (item.type === 'custom') { + item.elements.forEach(cell => { + if (!cell.field || maps.includes(cell.field)) return + maps.push(cell.field) + + pushcol({...cell, label: labels[cell.field]}) + }) + } } - if (!item.field || item.Hide === 'true' || maps.includes(item.field)) return + if (!item.field || maps.includes(item.field)) return maps.push(item.field) pushcol(item) @@ -337,16 +354,27 @@ } config.cols.forEach(item => { - if (item.type === 'colspan' && config.subtype === 'normaltable') { - item.subcols.forEach(cell => { - if (!cell.field || cell.Hide === 'true' || maps.includes(cell.field)) return - maps.push(cell.field) + if (item.Hide === 'true') return - pushcol(cell) - }) + if (config.subtype === 'normaltable') { + if (item.type === 'colspan') { + item.subcols.forEach(cell => { + if (!cell.field || cell.Hide === 'true' || maps.includes(cell.field)) return + maps.push(cell.field) + + pushcol(cell) + }) + } else if (item.type === 'custom') { + item.elements.forEach(cell => { + if (!cell.field || maps.includes(cell.field)) return + maps.push(cell.field) + + pushcol({...cell, label: labels[cell.field]}) + }) + } } - if (!item.field || item.Hide === 'true' || maps.includes(item.field)) return + if (!item.field || maps.includes(item.field)) return maps.push(item.field) pushcol(item) @@ -379,6 +407,15 @@ if (btn.show === 'icon') { btn.style.color = color[btn.class] btn.style.backgroundColor = 'transparent' + } else if (btn.class === 'default') { + btn.style.color = 'rgba(0, 0, 0, 0.65)' + btn.style.backgroundColor = '#fff' + btn.style.borderColor = '#d9d9d9' + } else if (btn.class.indexOf('border') > -1) { + let _c = btn.class.replace('border-', '') + btn.style.color = color[_c] + btn.style.backgroundColor = '#fff' + btn.style.borderColor = color[_c] } else { btn.style.color = '#ffffff' btn.style.backgroundColor = color[btn.class] diff --git a/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx index 29bf27a..fb51dad 100644 --- a/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/base-table/columns/editColumn/formconfig.jsx @@ -395,7 +395,7 @@ type: 'radio', key: 'eval', label: '瑙f瀽', - initVal: card.eval || 'true', + initVal: card.eval || 'false', tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��', required: false, options: [ diff --git a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx index 6120716..4808dbf 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/formconfig.jsx @@ -475,7 +475,7 @@ type: 'radio', key: 'eval', label: '瑙f瀽', - initVal: card.eval || 'true', + initVal: card.eval || 'false', tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��', required: false, options: [ diff --git a/src/menu/components/table/edit-table/columns/editColumn/index.jsx b/src/menu/components/table/edit-table/columns/editColumn/index.jsx index e445b43..00c47c3 100644 --- a/src/menu/components/table/edit-table/columns/editColumn/index.jsx +++ b/src/menu/components/table/edit-table/columns/editColumn/index.jsx @@ -350,18 +350,19 @@ } handleSubmit = () => { - // const { columns } = this.props // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� this.props.form.validateFieldsAndScroll((err, values) => { if (!err) { - // if (values.field && columns.filter(col => col.field && col.uuid !== values.uuid && col.field === values.field).length > 0) { - // notification.warning({ - // top: 92, - // message: '瀛楁宸叉坊鍔狅紒', - // duration: 5 - // }) - // return - // } + if (values.type === 'number' && values.editable === 'true') { + if (typeof(values.max) === 'number' && typeof(values.min) === 'number' && values.max < values.min) { + notification.warning({ + top: 92, + message: '鏈�澶у�间笉鍙皬浜庢渶灏忓�硷紒', + duration: 5 + }) + return + } + } this.setState({visible: false, formlist: null}) this.props.submitCol(values) diff --git a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx index f1ff2b1..7bf4cd5 100644 --- a/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx +++ b/src/menu/components/table/normal-table/columns/editColumn/formconfig.jsx @@ -415,7 +415,7 @@ type: 'radio', key: 'eval', label: '瑙f瀽', - initVal: card.eval || 'true', + initVal: card.eval || 'false', tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��', required: false, options: [ diff --git a/src/menu/datasource/index.jsx b/src/menu/datasource/index.jsx index c40ff35..2de2760f 100644 --- a/src/menu/datasource/index.jsx +++ b/src/menu/datasource/index.jsx @@ -162,6 +162,8 @@ } return item }) + + res.columns.reverse() } let maxScript = 0 @@ -200,6 +202,8 @@ if (config.subtype !== 'dualdatacard') { delete res.subColumns + } else { + res.subColumns.reverse() } this.setState({loading: false, visible: false}) diff --git a/src/menu/datasource/verifycard/index.jsx b/src/menu/datasource/verifycard/index.jsx index dcb2c3d..814c6df 100644 --- a/src/menu/datasource/verifycard/index.jsx +++ b/src/menu/datasource/verifycard/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { fromJS } from 'immutable' -import { Form, Tabs, Popconfirm, notification, Modal, Typography, Spin, message, Button } from 'antd' +import { Form, Tabs, Popconfirm, notification, Modal, Typography, Spin, message, Button, Input } from 'antd' import { StopOutlined, CheckCircleOutlined, EditOutlined, SwapOutlined, DeleteOutlined, CopyOutlined, BorderOutlined, SnippetsOutlined } from '@ant-design/icons' import moment from 'moment' @@ -20,6 +20,7 @@ const { TabPane } = Tabs const { Paragraph } = Typography +const { Search } = Input const CodeMirror = asyncComponent(() => import('@/templates/zshare/codemirror')) const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent')) @@ -35,6 +36,7 @@ subColumns: [], activeKey: 'setting', loading: false, + searchKey: '', initsql: '', // sql楠岃瘉鏃跺彉閲忓0鏄庡強璧嬪�� usefulfields: '', defaultsql: '', // 榛樿Sql @@ -194,15 +196,21 @@ _search = _search.replace(/@\$@/ig, '') _search = _search ? 'where ' + _search : '' + let columns = config.columns ? fromJS(config.columns).toJS() : [] + let subColumns = config.subColumns ? fromJS(config.subColumns).toJS() : [] + + columns.reverse() + subColumns.reverse() this.setState({ scripts, - columns: config.columns ? fromJS(config.columns).toJS() : [], - subColumns: config.subColumns ? fromJS(config.subColumns).toJS() : [], + columns: columns, + subColumns: subColumns, setting: _setting, median: _setting, searches: search, - defaultSearch: _search + defaultSearch: _search, + searchKey: '' }) this.getsysScript() @@ -273,7 +281,7 @@ values.uuid = Utils.getuuid() - this.setState({ columns: [...columns, values] }) + this.setState({ columns: [values, ...columns] }) } subColumnChange = (values, resolve) => { @@ -293,7 +301,7 @@ values.uuid = Utils.getuuid() - this.setState({ subColumns: [...subColumns, values] }) + this.setState({ subColumns: [values, ...subColumns] }) } deleteScript = (record) => { @@ -931,7 +939,7 @@ render() { const { config } = this.props - const { columns, subColumns, median, setting, scripts, colColumns, scriptsColumns, activeKey, loading, searches, defaultsql, visible, pvisible, reload, script, scriptValue } = this.state + const { columns, subColumns, median, setting, scripts, colColumns, scriptsColumns, activeKey, loading, searches, defaultsql, visible, pvisible, reload, script, scriptValue, searchKey } = this.state return ( <div className="model-data-source-wrap"> @@ -965,7 +973,7 @@ type="fields" updatefield={this.updatefields} /> - <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} type="datasourcefield" wrappedComponentRef={(inst) => this.datasource = inst} data={columns} columns={colColumns} onChange={(columns) => this.setState({columns})}/> + <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} searchKey={searchKey} type="datasourcefield" wrappedComponentRef={(inst) => this.datasource = inst} data={columns} columns={colColumns} onChange={(columns) => this.setState({columns})}/> </TabPane> : null} {config.subtype === 'dualdatacard' ? <TabPane tab={ <span> @@ -979,7 +987,7 @@ type="fields" updatefield={this.updateSubfields} /> - <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} type="datasourcefield" wrappedComponentRef={(inst) => this.subdatasource = inst} data={subColumns} columns={colColumns} onChange={(subColumns) => this.setState({subColumns})}/> + <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} searchKey={searchKey} type="datasourcefield" wrappedComponentRef={(inst) => this.subdatasource = inst} data={subColumns} columns={colColumns} onChange={(subColumns) => this.setState({subColumns})}/> </TabPane> : null} <TabPane tab={ <span> @@ -989,6 +997,7 @@ {config.type !== 'interface' && activeKey === 'setting' ? <SnippetsOutlined title="瀵煎叆鏁版嵁婧�" className="mk-paste-datasource" onClick={(e) => {e.stopPropagation();this.setState({pvisible: true})}}/> : null} {activeKey === 'columns' ? <CopyOutlined title="浠ラ�楀彿鎷兼帴褰㈠紡澶嶅埗瀛楁" className="mk-copy-fields" onClick={(e) => {e.stopPropagation();this.copyColumns()}}/> : null} {activeKey === 'subcolumns' ? <CopyOutlined title="浠ラ�楀彿鎷兼帴褰㈠紡澶嶅埗瀛楁" className="mk-copy-fields" onClick={(e) => {e.stopPropagation();this.copySubColumns()}}/> : null} + {activeKey === 'subcolumns' || activeKey === 'columns' ? <span onClick={(e) => {e.stopPropagation()}}><Search className="mk-search-fields" defaultValue={searchKey} allowClear onSearch={(val, e) => {e.stopPropagation();this.setState({searchKey: val})}} /></span> : null} </span> } key="scripts" disabled={median.interType !== 'system'} id="mk-scripts-tabpane"> {scripts.length ? <BorderOutlined className="full-scripts" onClick={() => { diff --git a/src/menu/datasource/verifycard/index.scss b/src/menu/datasource/verifycard/index.scss index b9bc0fe..c8e00e8 100644 --- a/src/menu/datasource/verifycard/index.scss +++ b/src/menu/datasource/verifycard/index.scss @@ -45,6 +45,34 @@ .mk-copy-fields:hover, .mk-copy-datasource:hover, .mk-paste-datasource:hover { opacity: 1; } + .mk-search-fields { + position: absolute; + cursor: pointer; + width: 150px; + z-index: 1; + top: 10px; + right: -240px; + display: inline-block; + .ant-input { + border-radius: 40px; + height: 30px; + transition: opacity 0.2s; + } + .ant-input:not(:hover):not(:active):not(:focus) { + opacity: 0.6; + } + .ant-input:not(:hover):not(:active):not(:focus) + .ant-input-suffix { + opacity: 0.6; + } + } + .mk-search-fields:hover { + .ant-input { + opacity: 1; + } + .ant-input-suffix { + opacity: 1; + } + } .count-tip { position: absolute; top: 0px; diff --git a/src/menu/transfer/index.jsx b/src/menu/transfer/index.jsx index 15b6805..4456af7 100644 --- a/src/menu/transfer/index.jsx +++ b/src/menu/transfer/index.jsx @@ -83,6 +83,7 @@ } } }) + tab.components[0].cols = tab.components[0].cols.filter(col => !(col.field && col.Hide === 'true')) tab.components[0].cols.forEach(col => { if (col.type !== 'action') return col.elements.forEach(btn => { @@ -108,6 +109,7 @@ } } }) + item.cols = item.cols.filter(col => !(col.field && col.Hide === 'true')) item.cols.forEach(col => { if (col.type !== 'action') return col.elements.forEach(btn => { diff --git a/src/mob/colorsketch/index.jsx b/src/mob/colorsketch/index.jsx index 6f1ba7a..65c7df6 100644 --- a/src/mob/colorsketch/index.jsx +++ b/src/mob/colorsketch/index.jsx @@ -9,8 +9,9 @@ const presetColors = [ '#1890ff', '#f5222d', '#fa541c', '#fa8c16', '#faad14', '#fadb14', '#a0d911', '#52c41a', '#13c2c2', '#2f54eb', '#722ed1', '#eb2f96', '#aeb303', '#c32539', '#1d3661', '#ffd591', '#ffe58f', '#fffb8f', '#eaff8f', '#b7eb8f', '#87e8de', '#91d5ff', - '#adc6ff', '#d3adf7', '#EBE9E9', '#d9d9d9', '#434343', '#000000', '#ffffff', 'transparent' + '#adc6ff', '#EBE9E9', '#d9d9d9', 'rgba(0, 0, 0, 0.65)', 'rgba(0, 0, 0, 0.85)', '#000000', '#ffffff', 'transparent' ] +const _href = window.location.href.split('#')[0] class ColorSketch extends Component { static propTpyes = { @@ -20,6 +21,7 @@ } state = { color: '', + initVal: '', colors: [], allowClear: false } @@ -38,6 +40,21 @@ let _colors = sessionStorage.getItem('app_colors') let colors = JSON.parse(JSON.stringify(presetColors)) + let normal_colors = localStorage.getItem(_href + 'normal_colors') + + if (normal_colors) { + try { + normal_colors = JSON.parse(normal_colors) + } catch (e) { + normal_colors = [] + } + + normal_colors.forEach(item => { + colors.push({color: item, title: '甯哥敤鑹诧細' + item}) + }) + } else { + normal_colors = [] + } if (_colors) { try { @@ -47,13 +64,19 @@ } _colors.forEach(item => { - if (!colors.includes(item.linkurl)) { - colors.push(item.linkurl) - } + if (normal_colors.includes(item.linkurl)) return + + colors.push({color: item.linkurl, title: '绯荤粺鑹诧細' + item.linkurl}) }) } - this.setState({color: initVal, allowClear: allowClear === true, colors}) + if (colors.length < 40) { + for (let i = colors.length; i < 40; i++) { + colors.push({color: 'transparent', title: '' + i}) + } + } + + this.setState({color: initVal, initVal, allowClear: allowClear === true, colors}) } handleChange = (color) => { @@ -77,13 +100,42 @@ } } + onVisibleChange = (status) => { + const { initVal, color } = this.state + + if (!status && color && color !== initVal && color !== 'rgba(0, 0, 0, 0)' && color !== 'transparent' && !/rgba\(\d+,\s*\d+,\s*\d+,\s*0\)/.test(color)) { + let normal_colors = localStorage.getItem(_href + 'normal_colors') + + if (normal_colors) { + try { + normal_colors = JSON.parse(normal_colors) + } catch (e) { + normal_colors = [] + } + } else { + normal_colors = [] + } + + normal_colors.unshift(color) + normal_colors = Array.from(new Set(normal_colors)) + + if (normal_colors.length > 10) { + normal_colors.length = 10 + } + + localStorage.setItem(_href + 'normal_colors', JSON.stringify(normal_colors)) + } + } + + + render() { const { color, allowClear, colors } = this.state return ( <div className="color-sketch-block"> <Popover content={ <SketchPicker color={ color } presetColors={colors} onChange={ this.handleChange } /> - } overlayClassName="color-sketch-popover" placement="bottomRight" title="" trigger="click"> + } overlayClassName="color-sketch-popover" placement="bottomRight" title="" trigger="click" onVisibleChange={this.onVisibleChange}> <div className="color-sketch-block-box"> <div className="color-sketch-block-inner" style={ {background: color} }></div> </div> diff --git a/src/mob/colorsketch/index.scss b/src/mob/colorsketch/index.scss index 9aa1fc3..b08c92e 100644 --- a/src/mob/colorsketch/index.scss +++ b/src/mob/colorsketch/index.scss @@ -58,6 +58,23 @@ padding: 0; .sketch-picker { width: 250px!important; + + .flexbox-fix:last-child { + overflow: hidden; + >div:nth-child(30) { + position: relative; + margin-bottom: 20px!important; + } + >div:nth-child(30)::after { + content: ' '; + display: block; + border-bottom: 1px solid #d9d9d9; + position: absolute; + width: 300px; + bottom: -10px; + right: -20px; + } + } } } } \ No newline at end of file diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index 185042e..94c16f6 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -267,6 +267,19 @@ let city = sessionStorage.getItem('city') || '' let bid = data.$$BID || '' val = val.replace(/@username@/ig, userName).replace(/@fullName@/ig, fullName).replace(/@mk_city@/ig, city).replace(/@bid@/ig, bid) + } else if (/@month@/ig.test(val)) { + val = val.replace(/@month@/ig, new Date().toLocaleString('en-US', { month: 'long' })) + } else if (/@week@/ig.test(val)) { + val = val.replace(/@week@/ig, (() => { + let day = new Date().getDay() + let weeks = ['鏄熸湡鏃�', '鏄熸湡涓�', '鏄熸湡浜�', '鏄熸湡涓�', '鏄熸湡鍥�', '鏄熸湡浜�', '鏄熸湡鍏�'] + return weeks[day] + })()) + } else if (/@day@/ig.test(val)) { + val = val.replace(/@day@/ig, (() => { + let day = new Date().getDate() + return day < 10 ? '0' + day : day + })()) } } else if (data.hasOwnProperty(card.field)) { val = data[card.field] @@ -387,11 +400,18 @@ if (card.bgImage && data[card.bgImage]) { _style.backgroundImage = `url('${data[card.bgImage]}')` } + + let lineStyle = {height: card.innerHeight || 'auto'} + if (card.alignItems) { + lineStyle.display = 'flex' + lineStyle.alignItems = card.alignItems + lineStyle.justifyContent = _style.textAlign || 'left' + } contents.push( <Col key={card.uuid} style={_style_} span={card.width}> <div style={_style} onClick={(e) => {this.openNewView(e, card)}}> - <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight || 'auto'}}>{val}</div> + <div className={'ant-mk-text line' + (card.height || '') + className} style={lineStyle}>{val}</div> </div> </Col> ) @@ -457,11 +477,18 @@ } className = mark.signType } + + let lineStyle = {height: card.innerHeight || 'auto'} + if (card.alignItems) { + lineStyle.display = 'flex' + lineStyle.alignItems = card.alignItems + lineStyle.justifyContent = _style.textAlign || 'left' + } contents.push( <Col key={card.uuid} style={_style_} span={card.width}> <div style={_style}> - <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight || 'auto'}}>{val}</div> + <div className={'ant-mk-text line' + (card.height || '') + className} style={lineStyle}>{val}</div> </div> </Col> ) @@ -776,11 +803,18 @@ } className = mark.signType } + + let lineStyle = {height: card.innerHeight || 'auto'} + if (card.alignItems) { + lineStyle.display = 'flex' + lineStyle.alignItems = card.alignItems + lineStyle.justifyContent = _style.textAlign || 'left' + } contents.push( <Col key={card.uuid} style={_style_} span={card.width}> <div style={_style}> - <div className={'ant-mk-text line' + (card.height || '') + className} style={{height: card.innerHeight || 'auto'}}>{val}</div> + <div className={'ant-mk-text line' + (card.height || '') + className} style={lineStyle}>{val}</div> </div> </Col> ) @@ -983,8 +1017,10 @@ } render() { + const { cardCell } = this.props + return ( - <div className="card-cell-list"> + <div className={'card-cell-list ' + (cardCell && cardCell.setting && cardCell.setting.layout === 'flex' ? 'mk-flex' : '')}> {this.getContent()} </div> ) diff --git a/src/tabviews/custom/components/card/cardcellList/index.scss b/src/tabviews/custom/components/card/cardcellList/index.scss index 2ce260c..4fc1ddf 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.scss +++ b/src/tabviews/custom/components/card/cardcellList/index.scss @@ -193,9 +193,233 @@ width: 26px; height: 26px; } + + .ant-col[class*="x"] { + float: left; + box-sizing: border-box; + } + >.ant-col-0x { + width: 2.08333333%; + } + >.ant-col-1x { + width: 6.25%; + } + >.ant-col-2x { + width: 10.41666667%; + } + >.ant-col-3x { + width: 14.58333333%; + } + >.ant-col-4x { + width: 18.75%; + } + >.ant-col-5x { + width: 22.91666667%; + } + >.ant-col-6x { + width: 27.08333333%; + } + >.ant-col-7x { + width: 31.25%; + } + >.ant-col-8x { + width: 35.41666667%; + } + >.ant-col-9x { + width: 39.58333333%; + } + >.ant-col-10x { + width: 43.75%; + } + >.ant-col-11x { + width: 47.91666667%; + } + >.ant-col-12x { + width: 52.08333333%; + } + >.ant-col-13x { + width: 56.25%; + } + >.ant-col-14x { + width: 60.41666667%; + } + >.ant-col-15x { + width: 64.58333333%; + } + >.ant-col-16x { + width: 68.75%; + } + >.ant-col-17x { + width: 72.91666667%; + } + >.ant-col-18x { + width: 77.08333333%; + } + >.ant-col-19x { + width: 81.25%; + } + >.ant-col-20x { + width: 85.41666667%; + } + >.ant-col-21x { + width: 89.58333333%; + } + >.ant-col-22x { + width: 93.75%; + } + >.ant-col-23x { + width: 97.91666667%; + } } .card-cell-list::after { content: ' '; display: block; clear: both; +} +.card-cell-list.mk-flex { + display: flex; + >.ant-col-1 { + flex: 1; + } + >.ant-col-2 { + flex: 2; + } + >.ant-col-3 { + flex: 3; + } + >.ant-col-4 { + flex: 4; + } + >.ant-col-5 { + flex: 5; + } + >.ant-col-6 { + flex: 6; + } + >.ant-col-7 { + flex: 7; + } + >.ant-col-8 { + flex: 8; + } + >.ant-col-9 { + flex: 9; + } + >.ant-col-10 { + flex: 10; + } + >.ant-col-11 { + flex: 11; + } + >.ant-col-12 { + flex: 12; + } + >.ant-col-13 { + flex: 13; + } + >.ant-col-14 { + flex: 14; + } + >.ant-col-15 { + flex: 15; + } + >.ant-col-16 { + flex: 16; + } + >.ant-col-17 { + flex: 17; + } + >.ant-col-18 { + flex: 18; + } + >.ant-col-19 { + flex: 19; + } + >.ant-col-20 { + flex: 20; + } + >.ant-col-21 { + flex: 21; + } + >.ant-col-22 { + flex: 22; + } + >.ant-col-23 { + flex: 23; + } + >.ant-col-24 { + flex: 24; + } + >.ant-col-0x { + flex: 0.5; + } + >.ant-col-1x { + flex: 1.5; + } + >.ant-col-2x { + flex: 2.5; + } + >.ant-col-3x { + flex: 3.5; + } + >.ant-col-4x { + flex: 4.5; + } + >.ant-col-5x { + flex: 5.5; + } + >.ant-col-6x { + flex: 6.5; + } + >.ant-col-7x { + flex: 7.5; + } + >.ant-col-8x { + flex: 8.5; + } + >.ant-col-9x { + flex: 9.5; + } + >.ant-col-10x { + flex: 10.5; + } + >.ant-col-11x { + flex: 11.5; + } + >.ant-col-12x { + flex: 12.5; + } + >.ant-col-13x { + flex: 13.5; + } + >.ant-col-14x { + flex: 14.5; + } + >.ant-col-15x { + flex: 15.5; + } + >.ant-col-16x { + flex: 16.5; + } + >.ant-col-17x { + flex: 17.5; + } + >.ant-col-18x { + flex: 18.5; + } + >.ant-col-19x { + flex: 19.5; + } + >.ant-col-20x { + flex: 20.5; + } + >.ant-col-21x { + flex: 21.5; + } + >.ant-col-22x { + flex: 22.5; + } + >.ant-col-23x { + flex: 23.5; + } } \ No newline at end of file diff --git a/src/tabviews/custom/components/card/double-data-card/index.jsx b/src/tabviews/custom/components/card/double-data-card/index.jsx index e50b913..b06a81c 100644 --- a/src/tabviews/custom/components/card/double-data-card/index.jsx +++ b/src/tabviews/custom/components/card/double-data-card/index.jsx @@ -917,64 +917,66 @@ selectedData={selectedData} /> : null } - <div className={`data-zoom ${config.wrap.wrapClass}`}> - <Row className={'card-row-list '}> - {precards.map((item, index) => ( - <Col key={'pre' + index} className="extend-card" span={item.setting.width || 6}> - <CardItem card={item} cards={config} data={extendData}> - {item.setting.checkAll === 'show' ? <span onClick={this.checkAll} className={'circle-select' + checkAll}></span> : null} - </CardItem> - </Col> - ))} - {data && data.map((item, index) => { - let className = 'card-item-wrap mk-card ' + mainBox - let subClass = 'mk-unfold' - let unfold = true - - if (item.$disabled) { - className = 'mk-disabled ' + mainBox - } else if (activeKey === index) { - className += 'active' - } else if (selectKeys.indexOf(index) > -1) { - className += 'selected' - } - - if (card.setting.display !== 'default') { - if (item.children.length === 0) { - subClass = 'mk-disabled' - unfold = false - } else { - subClass = opens.indexOf(index) > -1 ? 'mk-unfold' : 'mk-collapse' - unfold = opens.indexOf(index) > -1 - } - } - - return ( - <Col key={index} span={card.setting.width}> - <div className={className} style={wrapStyle}> - <CardItem card={card} cards={config} data={item} onDoubleClick={() => this.onDoubleClick(index, subClass)} onClick={() => {this.changeCard(index, item, subClass)}}> - <span className="circle-select"></span> - {card.setting.controlIcon === 'left' ? (!unfold ? <PlusSquareOutlined className={subClass} onClick={(e) => this.changeUnfold(e, index, subClass)}/> : <MinusSquareOutlined className={subClass} onClick={(e) => this.changeUnfold(e, index, subClass)}/>) : null} - {card.setting.controlIcon === 'right' ? <UpOutlined className={subClass} onClick={(e) => this.changeUnfold(e, index, subClass)}/> : null} - </CardItem> - <div className={'sub-card-wrap ' + subClass + (config.wrap.parity === 'true' ? ' mk-parity-bg' : '')}> - {item.children.map((cell, index) => <Col key={'sub' + index} span={subcard.setting.width || 24}> - <CardItem card={subcard} cards={subconfig} data={cell} /> - </Col>)} - </div> - </div> + <div className={config.wrap.minWidth ? 'data-zoom-box' : ''}> + <div className={`data-zoom ${config.wrap.wrapClass}`} style={config.wrap.minWidth ? {minWidth: config.wrap.minWidth} : null}> + <Row className={'card-row-list '}> + {precards.map((item, index) => ( + <Col key={'pre' + index} className="extend-card" span={item.setting.width || 6}> + <CardItem card={item} cards={config} data={extendData}> + {item.setting.checkAll === 'show' ? <span onClick={this.checkAll} className={'circle-select' + checkAll}></span> : null} + </CardItem> </Col> - ) - })} - {nextcards.map((item, index) => ( - <Col key={'next' + index} className="extend-card" span={item.setting.width || 6}> - <CardItem card={item} cards={config} data={extendData}> - {item.setting.checkAll === 'show' ? <span onClick={this.checkAll} className={'circle-select' + checkAll}></span> : null} - </CardItem> - </Col> - ))} - </Row> - {precards.length === 0 && nextcards.length === 0 && (!data || data.length === 0) ? <Empty description={false}/> : null} + ))} + {data && data.map((item, index) => { + let className = 'card-item-wrap mk-card ' + mainBox + let subClass = 'mk-unfold' + let unfold = true + + if (item.$disabled) { + className = 'mk-disabled ' + mainBox + } else if (activeKey === index) { + className += 'active' + } else if (selectKeys.indexOf(index) > -1) { + className += 'selected' + } + + if (card.setting.display !== 'default') { + if (item.children.length === 0) { + subClass = 'mk-disabled' + unfold = false + } else { + subClass = opens.indexOf(index) > -1 ? 'mk-unfold' : 'mk-collapse' + unfold = opens.indexOf(index) > -1 + } + } + + return ( + <Col key={index} span={card.setting.width}> + <div className={className} style={wrapStyle}> + <CardItem card={card} cards={config} data={item} onDoubleClick={() => this.onDoubleClick(index, subClass)} onClick={() => {this.changeCard(index, item, subClass)}}> + <span className="circle-select"></span> + {card.setting.controlIcon === 'left' ? (!unfold ? <PlusSquareOutlined className={subClass} onClick={(e) => this.changeUnfold(e, index, subClass)}/> : <MinusSquareOutlined className={subClass} onClick={(e) => this.changeUnfold(e, index, subClass)}/>) : null} + {card.setting.controlIcon === 'right' ? <UpOutlined className={subClass} onClick={(e) => this.changeUnfold(e, index, subClass)}/> : null} + </CardItem> + <div className={'sub-card-wrap ' + subClass + (config.wrap.parity === 'true' ? ' mk-parity-bg' : '')}> + {item.children.map((cell, index) => <Col key={'sub' + index} span={subcard.setting.width || 24}> + <CardItem card={subcard} cards={subconfig} data={cell} /> + </Col>)} + </div> + </div> + </Col> + ) + })} + {nextcards.map((item, index) => ( + <Col key={'next' + index} className="extend-card" span={item.setting.width || 6}> + <CardItem card={item} cards={config} data={extendData}> + {item.setting.checkAll === 'show' ? <span onClick={this.checkAll} className={'circle-select' + checkAll}></span> : null} + </CardItem> + </Col> + ))} + </Row> + {precards.length === 0 && nextcards.length === 0 && (!data || data.length === 0) ? <Empty description={false}/> : null} + </div> </div> {config.wrap.pagestyle === 'page' && config.setting.laypage && data ? <Pagination size="small" total={total} showTotal={(t, range) => `${range[0]}-${range[1]} 鍏� ${total} 鏉} pageSize={pageSize} showSizeChanger={true} pageSizeOptions={this.state.pageOptions} onChange={this.changePageIndex} onShowSizeChange={this.pageSizeChange} current={pageIndex}/> : null} {config.wrap.pagestyle === 'more' && config.setting.laypage && data && data.length > 0 ? <div className={'mk-more' + (pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>鏌ョ湅鏇村<DownOutlined/></div> : null} diff --git a/src/tabviews/custom/components/card/double-data-card/index.scss b/src/tabviews/custom/components/card/double-data-card/index.scss index d19f2f3..9ca06c2 100644 --- a/src/tabviews/custom/components/card/double-data-card/index.scss +++ b/src/tabviews/custom/components/card/double-data-card/index.scss @@ -297,6 +297,25 @@ } } } + .data-zoom-box { + width: 100%; + overflow-x: auto; + padding-bottom: 10px; + } + .data-zoom-box::-webkit-scrollbar { + height: 7px; + } + .data-zoom-box::-webkit-scrollbar-thumb { + border-radius: 5px; + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); + background: rgba(0, 0, 0, 0.13); + } + .data-zoom-box::-webkit-scrollbar-track { + box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); + border-radius: 3px; + border: 1px solid rgba(0, 0, 0, 0.07); + background: rgba(0, 0, 0, 0); + } } .double-data-card-box::-webkit-scrollbar { width: 7px; diff --git a/src/templates/sharecomponent/fieldscomponent/index.jsx b/src/templates/sharecomponent/fieldscomponent/index.jsx index 3066fac..590e699 100644 --- a/src/templates/sharecomponent/fieldscomponent/index.jsx +++ b/src/templates/sharecomponent/fieldscomponent/index.jsx @@ -163,7 +163,7 @@ field: item.field, datatype: _t } - items.push(newcard) + items.unshift(newcard) keys.push(item.field.toLowerCase()) }) diff --git a/src/templates/zshare/codemirror/index.jsx b/src/templates/zshare/codemirror/index.jsx index aa4698f..60376cc 100644 --- a/src/templates/zshare/codemirror/index.jsx +++ b/src/templates/zshare/codemirror/index.jsx @@ -1,11 +1,12 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Dropdown, Menu } from 'antd' -import { FullscreenOutlined, FullscreenExitOutlined, FontSizeOutlined, FormatPainterOutlined } from '@ant-design/icons' +import { Dropdown, Menu, Modal, notification } from 'antd' +import { FullscreenOutlined, FullscreenExitOutlined, FontSizeOutlined, FormatPainterOutlined, SwapOutlined } from '@ant-design/icons' import {UnControlled as CodeMirror} from 'react-codemirror2' import sqlFormatter from '@/utils/sqlFormatter.js' +import ReplaceForm from './replaceform' import 'codemirror/mode/javascript/javascript' import 'codemirror/mode/sql/sql' import 'codemirror/mode/xml/xml' @@ -33,7 +34,8 @@ options: null, // mode : text/xml, text/css, text/javascript銆乼ext/x-mysql ; theme : cobalt - 榛戝簳 fullScreen: false, style: {fontSize: '18px', lineHeight: '32px'}, - display: true + display: true, + visible: false } editor = null @@ -149,9 +151,42 @@ this.props.onChange(_sql) } + submit = () => { + let _sql = this.state.value + + this.ReplaceRef.handleConfirm().then(res => { + let reg = new RegExp(res.origin, 'ig') + let times = _sql.match(reg) + + if (!times) { + notification.warning({ + top: 92, + message: '鏈煡璇㈠埌瀛楃銆�' + res.origin + '銆嬨��', + duration: 5 + }) + return + } + + _sql = _sql.replace(reg, res.value) + + this.setState({display: false, defaultVal: _sql}, () => { + this.setState({display: true}) + }) + + this.props.onChange(_sql) + + notification.success({ + top: 92, + message: `鍏辨浛鎹�${times.length}澶勫瓧绗︺��${res.origin}銆嬨�俙, + duration: 5 + }) + this.setState({ visible: false }) + }) + } + render() { const { mode, func } = this.props - const { defaultVal, options, fullScreen, style, display } = this.state + const { defaultVal, options, fullScreen, style, display, visible } = this.state const menu = ( <Menu> <Menu.Item @@ -194,24 +229,39 @@ ) return ( - <div className="code-mirror-wrap" style={fullScreen || func ? style : null}> - {!mode && !fullScreen ? <FormatPainterOutlined onClick={this.handleFormat}/> : null} - {!fullScreen ? <FullscreenOutlined onClick={this.fullScreenChange}/> : null} - {fullScreen ? <FullscreenExitOutlined onClick={this.fullScreenChange}/> : null} - {fullScreen || func ? <Dropdown overlayClassName="mk-mirror-font" overlay={menu} placement="bottomRight"> - <FontSizeOutlined /> - </Dropdown> : null} - {display ? <CodeMirror - className="code-mirror-area" - value={defaultVal} - options={options} - editorDidMount={editor => { this.editor = editor }} - onChange={(editor, data, value) => { - this.setState({value}) - this.props.onChange(value) - }} - /> : null} - </div> + <> + <div className={'code-mirror-wrap ' + (fullScreen ? 'mk-fullscreen' : '')} style={fullScreen || func ? style : null}> + {!mode ? <FormatPainterOutlined title="鏍煎紡鍖�" onClick={this.handleFormat}/> : null} + <FullscreenOutlined title="鏈�澶у寲" onClick={this.fullScreenChange}/> + <FullscreenExitOutlined title="鍚戜笅杩樺師" onClick={this.fullScreenChange}/> + {fullScreen || func ? <Dropdown overlayClassName="mk-mirror-font" overlay={menu} placement="bottomRight"> + <FontSizeOutlined /> + </Dropdown> : null} + <SwapOutlined title="瀛楃鏇挎崲" onClick={() => this.setState({visible: true})}/> + {display ? <CodeMirror + className="code-mirror-area" + value={defaultVal} + options={options} + editorDidMount={editor => { this.editor = editor }} + onChange={(editor, data, value) => { + this.setState({value}) + this.props.onChange(value) + }} + /> : null} + </div> + <Modal + title="瀛楃鏇挎崲" + visible={visible} + width={500} + maskClosable={false} + okText="鏇挎崲" + onOk={this.submit} + onCancel={() => {this.setState({ visible: false })}} + destroyOnClose + > + <ReplaceForm inputSubmit={this.submit} wrappedComponentRef={(inst) => this.ReplaceRef = inst}/> + </Modal> + </> ) } } diff --git a/src/templates/zshare/codemirror/index.scss b/src/templates/zshare/codemirror/index.scss index 2ee7018..737e334 100644 --- a/src/templates/zshare/codemirror/index.scss +++ b/src/templates/zshare/codemirror/index.scss @@ -37,6 +37,7 @@ color: #1890ff; cursor: pointer; transition: opacity 0.3s; + display: none; } .anticon-fullscreen-exit:hover { opacity: 1; @@ -45,7 +46,7 @@ position: fixed; z-index: 11; right: 10px; - top: 40px; + top: 65px; font-size: 20px; opacity: 0.7; color: #1890ff; @@ -87,6 +88,34 @@ background: #f5f5f5; } } + .anticon-swap { + position: absolute; + left: -25px; + top: 40px; + color: #13c2c2; + font-size: 16px; + } +} +.code-mirror-wrap.mk-fullscreen { + .anticon-format-painter { + position: fixed; + z-index: 11; + } + .anticon-fullscreen-exit { + display: inline-block; + } + .anticon-fullscreen { + display: none; + } + + .anticon-swap { + position: fixed; + z-index: 11; + left: auto; + right: 10px; + top: auto; + bottom: 20px; + } } .mk-mirror-font { z-index: 1200!important; diff --git a/src/templates/zshare/codemirror/replaceform/index.jsx b/src/templates/zshare/codemirror/replaceform/index.jsx new file mode 100644 index 0000000..41a9906 --- /dev/null +++ b/src/templates/zshare/codemirror/replaceform/index.jsx @@ -0,0 +1,82 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +import { Form, Row, Col, Input } from 'antd' +// import './index.scss' + +class ReplaceForm extends Component { + static propTpyes = { + inputSubmit: PropTypes.func // 鍥炶溅浜嬩欢 + } + + componentDidMount () { + try { + let _form = document.getElementById('origin') + if (_form && _form.select) { + _form.select() + } + } catch (e) { + console.warn('Form focusing error锛�') + } + } + + handleConfirm = () => { + // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� + return new Promise((resolve, reject) => { + this.props.form.validateFieldsAndScroll((err, values) => { + if (!err) { + resolve(values) + } + }) + }) + } + + enterPress = (e) => { + e.stopPropagation() + + setTimeout(() => { + this.props.inputSubmit() + }, 200) + } + + render() { + const { getFieldDecorator } = this.props.form + const formItemLayout = { + labelCol: { + xs: { span: 24 }, + sm: { span: 8 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 14 } + } + } + return ( + <Form {...formItemLayout}> + <Row gutter={24}> + <Col span={24}> + <Form.Item label="鍘熷瓧绗�"> + {getFieldDecorator('origin', { + initialValue: '', + rules: [ + { + required: true, + message: '璇疯緭鍏ュ師瀛楃!' + } + ] + })(<Input autoComplete="off" onPressEnter={this.enterPress}/>)} + </Form.Item> + </Col> + <Col span={24}> + <Form.Item label="鏇挎崲涓�"> + {getFieldDecorator('value', { + initialValue: '' + })(<Input autoComplete="off" onPressEnter={this.enterPress}/>)} + </Form.Item> + </Col> + </Row> + </Form> + ) + } +} + +export default Form.create()(ReplaceForm) \ No newline at end of file diff --git a/src/templates/zshare/codemirror/replaceform/index.scss b/src/templates/zshare/codemirror/replaceform/index.scss new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/templates/zshare/codemirror/replaceform/index.scss diff --git a/src/templates/zshare/editTable/index.jsx b/src/templates/zshare/editTable/index.jsx index ff2c97f..e4e7d67 100644 --- a/src/templates/zshare/editTable/index.jsx +++ b/src/templates/zshare/editTable/index.jsx @@ -163,6 +163,7 @@ class EditTable extends Component { static propTpyes = { actions: PropTypes.any, // 鎿嶄綔椤� + searchKey: PropTypes.any, // 鎼滅储鏉′欢 data: PropTypes.any, // 鏁版嵁鍒楄〃 columns: PropTypes.array, // 鏄剧ず鍒� onChange: PropTypes.func // 鏁版嵁鍙樺寲 @@ -585,7 +586,7 @@ } render() { - const { actions, indexShow } = this.props + const { actions, indexShow, searchKey } = this.props const { editLineId } = this.state let components = { @@ -595,7 +596,7 @@ } let moveprops = {} - if (actions.includes('move')) { + if (actions.includes('move') && !searchKey) { components.body.row = DragableBodyRow moveprops.moveAble = !this.state.editingKey moveprops.moveRow = this.moveRow @@ -641,6 +642,8 @@ return item }) + let reg = searchKey ? new RegExp(searchKey, 'ig') : null + return ( <EditableContext.Provider value={this.props.form}> <div className="modal-edit-table"> @@ -651,7 +654,18 @@ components={components} dataSource={data} columns={columns} - rowClassName={record => !editLineId || editLineId !== record.uuid ? 'editable-row' : 'editable-row active'} + rowClassName={record => { + let className = 'editable-row' + if (editLineId && editLineId === record.uuid) { + className += ' active' + } + if (searchKey) { + if (!reg.test(record.field) && !reg.test(record.label)) { + className += ' hidden' + } + } + return className + }} pagination={false} onRow={(record, index) => ({ index, diff --git a/src/templates/zshare/editTable/index.scss b/src/templates/zshare/editTable/index.scss index a2f12ad..cac8205 100644 --- a/src/templates/zshare/editTable/index.scss +++ b/src/templates/zshare/editTable/index.scss @@ -31,6 +31,9 @@ background-color: #bae7ff!important; } } + .editable-row.hidden { + display: none; + } .mk-index { text-align: center; white-space: nowrap; diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 786a6be..c79c9f0 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -3466,7 +3466,7 @@ type: 'radio', key: 'eval', label: '瑙f瀽', - initVal: card.eval || 'true', + initVal: card.eval || 'false', tooltip: '褰撳叕寮忓唴瀹规秹鍙婅绠楁椂璇烽�夋嫨鈥滄槸鈥濓紝褰撳叕寮忓唴瀹逛负瀛楁鎷兼帴鏃惰閫夋嫨鈥滃惁鈥濄��', required: false, options: [{ diff --git a/src/utils/option.js b/src/utils/option.js index ca6a857..7eb1b1d 100644 --- a/src/utils/option.js +++ b/src/utils/option.js @@ -391,36 +391,6 @@ text: '鐧藉簳绱' }] -// 鎸夐挳棰滆壊闆� -export const btnCustomClasses = [{ - value: 'primary', - text: '钃濊壊' -}, { - value: 'yellow', - text: '榛勮壊' -}, { - value: 'orange', - text: '姗欒壊' -}, { - value: 'danger', - text: '绾㈣壊' -}, { - value: 'green', - text: '缁胯壊' -}, { - value: 'dgreen', - text: '娣辩豢鑹�' -}, { - value: 'purple', - text: '绱壊' -}, { - value: 'cyan', - text: '闈掕壊' -}, { - value: 'gray', - text: '鐏拌壊' -}] - export const calendarColors = [ {name: 'red', value: '#d0021b'}, {name: 'orange', value: '#f5a623'}, -- Gitblit v1.8.0