From 8881f69f5d7127a4090184b3ea7c9cbf9574100e Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 18 三月 2024 18:01:51 +0800 Subject: [PATCH] 2024-03-18 --- src/tabviews/zshare/actionList/popupbutton/index.jsx | 7 src/tabviews/zshare/topSearch/index.jsx | 14 + src/tabviews/zshare/normalTable/index.jsx | 7 src/menu/components/share/searchcomponent/index.jsx | 10 + src/templates/sharecomponent/searchcomponent/index.jsx | 5 src/menu/components/card/cardsimplecomponent/options.jsx | 8 src/tabviews/custom/popview/index.jsx | 12 - src/tabviews/basetable/index.jsx | 2 src/tabviews/custom/components/share/normalTable/index.jsx | 7 src/tabviews/zshare/actionList/newpagebutton/index.jsx | 84 +++++++- src/tabviews/zshare/topSearch/index.scss | 1 src/tabviews/commontable/index.jsx | 2 src/tabviews/zshare/actionList/normalbutton/index.jsx | 7 src/tabviews/custom/components/card/data-card/index.scss | 7 src/tabviews/custom/components/card/data-card/index.jsx | 4 src/tabviews/custom/components/card/table-card/index.scss | 19 +- src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 30 ++ src/menu/components/card/table-card/index.scss | 1 src/tabviews/custom/components/card/table-card/index.jsx | 62 ++++-- src/tabviews/custom/components/card/cardcellList/index.jsx | 10 + src/tabviews/zshare/actionList/tabbutton/index.jsx | 7 src/menu/components/card/cardcellcomponent/index.jsx | 14 + src/menu/components/card/data-card/options.jsx | 13 + src/menu/stylecontroller/index.jsx | 10 src/menu/components/share/actioncomponent/actionform/index.scss | 11 + src/menu/components/share/actioncomponent/formconfig.jsx | 87 +++++++++ src/menu/components/card/cardcellcomponent/formconfig.jsx | 2 src/menu/components/share/actioncomponent/actionform/index.jsx | 69 +++++-- src/tabviews/custom/index.jsx | 2 src/tabviews/zshare/topSearch/advanceform/index.scss | 4 30 files changed, 399 insertions(+), 119 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx index 2ce967c..3371a1a 100644 --- a/src/menu/components/card/cardcellcomponent/formconfig.jsx +++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx @@ -592,7 +592,7 @@ key: 'link', label: '閾炬帴', initVal: card.link || '', - tooltip: '鍔ㄦ�佸湴鍧�涓虹粦瀹氬瓧娈靛�笺��', + tooltip: '鍔ㄦ�佸湴鍧�涓虹粦瀹氬瓧娈靛�笺�備娇鐢� 鍔ㄦ��-鍏宠仈鑿滃崟 鏃讹紝璇峰湪鈥滈摼鎺ュ湴鍧�鈥濆瓧娈佃繑鍥炶彍鍗旾D銆�', required: false, options: [ { value: '', text: '鏃�' }, diff --git a/src/menu/components/card/cardcellcomponent/index.jsx b/src/menu/components/card/cardcellcomponent/index.jsx index b58ca78..de0ed1c 100644 --- a/src/menu/components/card/cardcellcomponent/index.jsx +++ b/src/menu/components/card/cardcellcomponent/index.jsx @@ -322,7 +322,7 @@ this.setState({ actvisible: true, card: card, - formlist: getBaseTableActionForm(card, functip, cards, usefulFields, modules) + formlist: getBaseTableActionForm(card, functip, cards, usefulFields, modules, 'line') }) } else { let anchors = MenuUtils.getAnchors(menu.components, cards.uuid) || [] @@ -330,7 +330,7 @@ this.setState({ actvisible: true, card: card, - formlist: getActionForm(card, functip, cards, usefulFields, modules, anchors, side) + formlist: getActionForm(card, functip, cards, usefulFields, modules, anchors, side, 'line') }) } } @@ -447,6 +447,13 @@ let color = { primary: '#1890ff', yellow: '#c49f47', orange: 'orange', danger: '#ff4d4f', green: '#26C281', dgreen: '#32c5d2', purple: '#8E44AD', cyan: '#13c2c2', gray: '#666666', default: 'rgba(0, 0, 0, 0.65)' } this.actionFormRef.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.eleType = cell.eleType || null @@ -457,7 +464,8 @@ if (cell.OpenType !== 'form') { res.style = {} } - } else if (res.class !== cell.class || res.show !== cell.show || !res.style) { + // } else if (res.class !== cell.class || res.show !== cell.show || !res.style) { + } else if (res.class !== cell.class || !res.style) { if (res.class) { let cl = res.class.replace('border-', '') let style = {} diff --git a/src/menu/components/card/cardsimplecomponent/options.jsx b/src/menu/components/card/cardsimplecomponent/options.jsx index f6ca23b..9e177e7 100644 --- a/src/menu/components/card/cardsimplecomponent/options.jsx +++ b/src/menu/components/card/cardsimplecomponent/options.jsx @@ -38,16 +38,18 @@ field: 'condition', label: '鏄剧ず鏉′欢', initval: setting.condition || 'false', - tooltip: '褰撻�夋嫨鈥滄湁鈥濇椂锛屽彧鏈夌鍚堟潯浠剁殑鏁版嵁鎵嶄細灞曠ず銆�', + tooltip: '褰撻�夋嫨鈥滆嚜瀹氫箟鈥濇椂锛屽彧鏈夌鍚堟潯浠剁殑鏁版嵁鎵嶄細灞曠ず銆傚綋閫夋嫨鈥滄爣棰樷�濇椂锛屽彧鏈夐琛屾墠浼氬睍绀�', required: false, options: [ - {value: 'true', label: '鏈�'}, - {value: 'false', label: '鏃�'}, + {value: 'false', label: '濮嬬粓鏄剧ず'}, + {value: 'true', label: '鑷畾涔�'}, + {value: 'title', label: '鏍囬'}, ], controlFields: [ {field: 'controlField', values: ['true']}, {field: 'controlType', values: ['true']}, {field: 'controlValue', values: ['true']}, + {field: 'click', values: ['true', 'false']}, ] }, { diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx index 22cd055..b6f7f3c 100644 --- a/src/menu/components/card/data-card/options.jsx +++ b/src/menu/components/card/data-card/options.jsx @@ -610,6 +610,19 @@ }, { type: 'radio', + field: 'searchBtn', + label: '鎼滅储鎸夐挳', + initval: wrap.searchBtn || 'hidden', + // tooltip: '鍚敤鎼滅储鏉′欢缂撳瓨鍚庯紝鍦ㄨ彍鍗曞埛鏂版椂鎼滅储鏉′欢涓嶅彉銆�', + required: false, + options: [ + {value: 'hidden', label: '闅愯棌'}, + {value: 'show', label: '鏄剧ず'}, + ], + forbid: appType === 'mob' || isprint, + }, + { + type: 'radio', field: 'shifting', label: '鎸夐挳鍋忕Щ', initval: wrap.shifting || 'false', diff --git a/src/menu/components/card/table-card/index.scss b/src/menu/components/card/table-card/index.scss index aef713c..c8abd8b 100644 --- a/src/menu/components/card/table-card/index.scss +++ b/src/menu/components/card/table-card/index.scss @@ -63,6 +63,7 @@ } .ant-pagination { text-align: right; + margin-top: 10px; } .mk-more { text-align: center; diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx index 72c1ce9..75aa1cd 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.jsx +++ b/src/menu/components/share/actioncomponent/actionform/index.jsx @@ -12,6 +12,7 @@ const { TextArea } = Input const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) +const CodeMirror = asyncComponent(() => import('@/templates/zshare/codemirror')) const MKTable = asyncComponent(() => import('@/components/normalform/modalform/mkTable')) const acTyOptions = { pop: ['label', 'OpenType', 'intertype', 'Ot', 'show', 'swipe', 'icon', 'class', 'color', 'execSuccess', 'execError', 'syncComponent', 'switchTab', 'anchors', 'width', 'openmenu', 'refreshTab', 'position', 'tipTitle', 'hoverTitle', 'hidden', 'preButton', 'formCache'], @@ -160,7 +161,7 @@ let reRequired = {} let reReadonly = {} - if (openType === 'pop' || openType === 'prompt' || openType === 'exec') { + if (['pop', 'prompt', 'exec'].includes(openType)) { let intertype = this.record.intertype reOptions.intertype = this.state.interTypeOptions @@ -425,7 +426,10 @@ reRequired.linkmenu = true reTooltip.linkmenu = '' } else if (this.record.pageTemplate === 'billprint') { - shows.push('printTemp') + shows.push('printTemp', 'preHandle') + if (this.record.preHandle === 'true') { + shows.push('pre_func') + } reOptions.Ot = requireOptions } else if (this.record.pageTemplate === 'pay') { reOptions.Ot = requireOptions.filter(op => op.value === 'requiredSgl') @@ -563,6 +567,9 @@ reRequired.icon = true } else { reRequired.icon = false + if (['pop', 'prompt', 'exec', 'popview', 'tab', 'innerpage'].includes(openType)) { + shows.push('showName') + } } return { @@ -784,7 +791,7 @@ let className = '' let content = null let initVal = item.initVal || '' - let help = item.help || '' + let help = item.help || null if (item.type === 'splitLine') { fields.push( @@ -951,27 +958,53 @@ ] content = <KeyInterface type={item.key === 'exInterface' ? 'develop' : 'product'}/> + } else if (item.type === 'codemirror') { + span = 24 + className = 'codemirror' + rules = [ + { required: item.readonly ? false : item.required, message: '璇疯緭鍏�' + item.label + '!' } + ] + + content = <CodeMirror mode="text/javascript" theme="cobalt"/> } if (help && typeof(help) === 'function') { help = help(this.record) } - fields.push( - <Col span={span} key={index}> - <Form.Item className={className} help={help} label={item.tooltip ? - <Tooltip placement="topLeft" overlayStyle={{maxWidth: item.tooltip.length > 25 ? 350 : 250 }} title={<span onClick={(e) => e.stopPropagation()}>{item.tooltip}</span>}> - <QuestionCircleOutlined className="mk-form-tip" /> - {item.label} - </Tooltip> : item.label - }> - {getFieldDecorator(item.key, { - initialValue: initVal, - rules: rules - })(content)} - </Form.Item> - </Col> - ) + if (help) { + fields.push( + <Col span={span} key={index}> + <Form.Item className={className} help={help} label={item.tooltip ? + <Tooltip placement="topLeft" overlayStyle={{maxWidth: item.tooltip.length > 25 ? 350 : 250 }} title={<span onClick={(e) => e.stopPropagation()}>{item.tooltip}</span>}> + <QuestionCircleOutlined className="mk-form-tip" /> + {item.label} + </Tooltip> : item.label + }> + {getFieldDecorator(item.key, { + initialValue: initVal, + rules: rules + })(content)} + </Form.Item> + </Col> + ) + } else { + fields.push( + <Col span={span} key={index}> + <Form.Item className={className} label={item.tooltip ? + <Tooltip placement="topLeft" overlayStyle={{maxWidth: item.tooltip.length > 25 ? 350 : 250 }} title={<span onClick={(e) => e.stopPropagation()}>{item.tooltip}</span>}> + <QuestionCircleOutlined className="mk-form-tip" /> + {item.label} + </Tooltip> : item.label + }> + {getFieldDecorator(item.key, { + initialValue: initVal, + rules: rules + })(content)} + </Form.Item> + </Col> + ) + } }) return fields diff --git a/src/menu/components/share/actioncomponent/actionform/index.scss b/src/menu/components/share/actioncomponent/actionform/index.scss index a056976..6f639c4 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.scss +++ b/src/menu/components/share/actioncomponent/actionform/index.scss @@ -17,6 +17,17 @@ width: 86%; } } + .codemirror { + .ant-col-sm-7 { + width: 14%; + } + .ant-col-sm-17 { + width: 86%; + } + .ant-form-item-label { + opacity: 0; + } + } .ant-radio-group { white-space: nowrap; .ant-radio-wrapper { diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index 8c39bc9..ca241a6 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -8,7 +8,7 @@ * @param {*} setting 缁勪欢閰嶇疆 * @param {*} usefulFields 瀛樺偍杩囩▼鍙敤鐨勫紑濮嬪瓧娈� */ -export function getActionForm (card, functip, config, usefulFields, modules = [], anchors = [], side) { +export function getActionForm (card, functip, config, usefulFields, modules = [], anchors = [], side, position) { let appType = sessionStorage.getItem('appType') let viewType = sessionStorage.getItem('editMenuType') // 寮圭獥 popview let setting = config.setting || {} @@ -311,6 +311,11 @@ }] } else if (card.formType === 'scan') { card.formType = 'switch' + } + + let width = card.width || (card.width === 0 ? 0 : 12) + if (/x/.test(card.width)) { + width = +width.replace(/x/, '.5') } let forms = [ @@ -809,10 +814,10 @@ key: 'width', min: 0, max: 24, - precision: 0, + precision: 1, label: '瀹藉害', - initVal: card.width || (card.width === 0 ? 0 : 12), - tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼�備负 0 鏃跺搴﹁嚜閫傚簲銆�', + initVal: width, + tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒椼�備负 0 鏃跺搴﹁嚜閫傚簲銆傚彲璁剧疆鍗婂垪鍗�.5銆�', forbid: type !== 'card', required: true }, @@ -1047,6 +1052,20 @@ tooltip: '榧犳爣鎮诞鍦ㄦ寜閽笂鏂规椂鐨勬彁绀轰俊鎭��', forbid: appType === 'mob', required: false + }, + { + type: 'select', + key: 'showName', + label: '鏄剧ず鍐呭', + initVal: card.showName || '', + tooltip: '琛岀骇鎸夐挳鍙�氳繃琛屼俊鎭帶鍒舵寜閽樉绀哄唴瀹广��', + required: false, + allowClear: true, + forbid: position !== 'line', + options: columns.map(item => ({ + value: item.field, + text: `${item.label}锛�${item.field}锛塦 + })) }, { type: 'radio', @@ -1457,6 +1476,28 @@ options: modules } ] + }, + { + type: 'radio', + key: 'preHandle', + label: '鑷畾涔夎剼鏈�', + initVal: card.preHandle || 'false', + // tooltip: '闅愯棌鍚庢寜閽湪椤甸潰涓笉鏄剧ず锛屼笖涓嶅弬涓庢潈闄愬垎閰嶃��', + required: false, + options: [{ + value: 'false', + text: '绂佺敤' + }, { + value: 'true', + text: '鍚敤' + }] + }, + { + type: 'codemirror', + key: 'pre_func', + label: '鑷畾涔夎剼鏈�', + initVal: card.pre_func || '', + required: true, } ] @@ -1470,7 +1511,7 @@ * @param {*} setting 缁勪欢閰嶇疆 * @param {*} usefulFields 瀛樺偍杩囩▼鍙敤鐨勫紑濮嬪瓧娈� */ -export function getBaseTableActionForm (card, functip, config, usefulFields, modules) { +export function getBaseTableActionForm (card, functip, config, usefulFields, modules, position) { let viewType = sessionStorage.getItem('editMenuType') // 寮圭獥 popview let setting = config.setting || {} let columns = config.columns || [] @@ -2185,6 +2226,20 @@ required: false }, { + type: 'select', + key: 'showName', + label: '鏄剧ず鍐呭', + initVal: card.showName || '', + tooltip: '琛岀骇鎸夐挳鍙�氳繃琛屼俊鎭帶鍒舵寜閽樉绀哄唴瀹广��', + required: false, + allowClear: true, + forbid: position !== 'line', + options: columns.map(item => ({ + value: item.field, + text: `${item.label}锛�${item.field}锛塦 + })) + }, + { type: 'radio', key: 'openTab', label: '鎵撳紑鏂瑰紡', @@ -2420,6 +2475,28 @@ options: modules } ] + }, + { + type: 'radio', + key: 'preHandle', + label: '鑷畾涔夎剼鏈�', + initVal: card.preHandle || 'false', + // tooltip: '闅愯棌鍚庢寜閽湪椤甸潰涓笉鏄剧ず锛屼笖涓嶅弬涓庢潈闄愬垎閰嶃��', + required: false, + options: [{ + value: 'false', + text: '绂佺敤' + }, { + value: 'true', + text: '鍚敤' + }] + }, + { + type: 'codemirror', + key: 'pre_func', + label: '鑷畾涔夎剼鏈�', + initVal: card.pre_func || '', + required: true, } ] diff --git a/src/menu/components/share/searchcomponent/index.jsx b/src/menu/components/share/searchcomponent/index.jsx index 6752638..5aecd30 100644 --- a/src/menu/components/share/searchcomponent/index.jsx +++ b/src/menu/components/share/searchcomponent/index.jsx @@ -93,6 +93,7 @@ * @description 鎼滅储鏉′欢缂栬緫锛岃幏鍙栨悳绱㈡潯浠惰〃鍗曚俊鎭� */ handleSearch = (card) => { + const { config } = this.props const { searchlist } = this.state let linkableFields = [] @@ -107,10 +108,17 @@ }) }) + let columns = null + if (config.columns && config.columns.length) { + columns = config.columns.map(item => { + return {key: item.uuid, text: item.field, value: item.field, label: item.label} + }) + } + this.setState({ visible: true, card: card, - formlist: getSearchForm(card, linkableFields, [], 'header') + formlist: getSearchForm(card, linkableFields, columns, 'header') }) } diff --git a/src/menu/stylecontroller/index.jsx b/src/menu/stylecontroller/index.jsx index 89f5ca9..308c5f3 100644 --- a/src/menu/stylecontroller/index.jsx +++ b/src/menu/stylecontroller/index.jsx @@ -878,11 +878,11 @@ label={<BgColorsOutlined title="杈规棰滆壊"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - {borposition === 'outer' ? <ColorSketch value={card.borderColor || ''} onChange={this.changeBorderColor} /> : null} - {borposition === 'left' ? <ColorSketch value={card.borderLeftColor || ''} onChange={this.changeBorderColor} /> : null} - {borposition === 'right' ? <ColorSketch value={card.borderRightColor || ''} onChange={this.changeBorderColor} /> : null} - {borposition === 'top' ? <ColorSketch value={card.borderTopColor || ''} onChange={this.changeBorderColor} /> : null} - {borposition === 'bottom' ? <ColorSketch value={card.borderBottomColor || ''} onChange={this.changeBorderColor} /> : null} + {borposition === 'outer' ? <ColorSketch allowClear={true} value={card.borderColor || ''} onChange={this.changeBorderColor} /> : null} + {borposition === 'left' ? <ColorSketch allowClear={true} value={card.borderLeftColor || ''} onChange={this.changeBorderColor} /> : null} + {borposition === 'right' ? <ColorSketch allowClear={true} value={card.borderRightColor || ''} onChange={this.changeBorderColor} /> : null} + {borposition === 'top' ? <ColorSketch allowClear={true} value={card.borderTopColor || ''} onChange={this.changeBorderColor} /> : null} + {borposition === 'bottom' ? <ColorSketch allowClear={true} value={card.borderBottomColor || ''} onChange={this.changeBorderColor} /> : null} </Form.Item> <Form.Item colon={false} diff --git a/src/tabviews/basetable/index.jsx b/src/tabviews/basetable/index.jsx index 0ca4327..d91a6c5 100644 --- a/src/tabviews/basetable/index.jsx +++ b/src/tabviews/basetable/index.jsx @@ -215,7 +215,7 @@ if (param.$searchkey) { component.search = component.search.map(item => { - if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param.$searchkey === item.field) { + if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param.$searchkey === item.field.toLowerCase()) { item.initval = param.$searchval } diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 78fd480..880eb49 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -209,7 +209,7 @@ // 瀛楁閫忚鍙婂繀濉爣蹇� config.search = config.search.map(item => { - if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param && param.$searchkey === item.field) { + if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param && param.$searchkey === item.field.toLowerCase()) { item.initval = param.$searchval } return item diff --git a/src/tabviews/custom/components/card/cardcellList/index.jsx b/src/tabviews/custom/components/card/cardcellList/index.jsx index d551b2b..d009aa8 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.jsx +++ b/src/tabviews/custom/components/card/cardcellList/index.jsx @@ -110,7 +110,7 @@ } if (card.field) { - __param.$searchkey = card.field + __param.$searchkey = card.field.toLowerCase() __param.$searchval = data[card.field] || '' } @@ -1051,6 +1051,10 @@ } else if (data.$$empty) { _data = [] } + let name = '' + if (card.showName) { + name = data[card.showName] || ' ' + } _style_ = _style_ || {} if (card.wrapStyle) { @@ -1062,6 +1066,7 @@ if (['exec', 'prompt', 'pop', 'form'].includes(card.OpenType)) { MkButton = <NormalButton btn={card} + name={name} BID={data.$$BID} BData={data.$$BData || ''} disabled={_disabled} @@ -1090,6 +1095,7 @@ } else if (card.OpenType === 'popview') { MkButton = <PopupButton btn={card} + name={name} BID={data.$$BID} BData={data.$$BData || ''} disabled={_disabled} @@ -1099,6 +1105,7 @@ } else if (card.OpenType === 'tab') { MkButton = <TabButton btn={card} + name={name} BID={data.$$BID} BData={data.$$BData || ''} disabled={_disabled} @@ -1107,6 +1114,7 @@ } else if (card.OpenType === 'innerpage') { MkButton = <NewPageButton btn={card} + name={name} BID={data.$$BID} BData={data.$$BData || ''} disabled={_disabled} diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index de3f1a8..5c3df0b 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -1251,7 +1251,9 @@ let className = 'mk-card ' if (config.wrap.parity === 'true') { if (index % 2 === 1) { - className += 'mk-parity-bg ' + className += 'mk-even-line ' + } else { + className += 'mk-odd-line ' } } if (item.$disabled) { diff --git a/src/tabviews/custom/components/card/data-card/index.scss b/src/tabviews/custom/components/card/data-card/index.scss index b2def5d..b8a0bbd 100644 --- a/src/tabviews/custom/components/card/data-card/index.scss +++ b/src/tabviews/custom/components/card/data-card/index.scss @@ -38,11 +38,16 @@ } } } - .mk-parity-bg { + .mk-even-line { .card-item-box { background-color: var(--mk-sys-color1); } } + .mk-even-line:hover, .mk-odd-line:hover { + .card-item-box { + background-color: var(--mk-sys-color2); + } + } } .data-zoom.scale { .card-row-list { diff --git a/src/tabviews/custom/components/card/table-card/index.jsx b/src/tabviews/custom/components/card/table-card/index.jsx index d09cbd1..837dc07 100644 --- a/src/tabviews/custom/components/card/table-card/index.jsx +++ b/src/tabviews/custom/components/card/table-card/index.jsx @@ -21,13 +21,14 @@ } state = { - BID: '', // 涓婄骇ID - config: null, // 鍥捐〃閰嶇疆淇℃伅 - loading: false, // 鏁版嵁鍔犺浇鐘舵�� - search: null, // 鎼滅储鏉′欢 - pageIndex: 1, // 椤电爜 - total: 0, // 鎬绘暟 - data: null, // 鏁版嵁 + BID: '', + config: null, + loading: false, + search: null, + pageIndex: 1, + total: 0, + data: null, + precards: [], BData: '' } @@ -95,12 +96,22 @@ } } + let precards = [] + _config.subcards = _config.subcards.filter(item => { + if (item.setting.condition === 'title') { + precards.push(item) + return false + } + return true + }) + this.setState({ BID: BID || '', BData: BData || '', data: _data, config: _config, - search: _config.$searches + search: _config.$searches, + precards }) } @@ -508,14 +519,14 @@ } } - getLines = (data) => { + getLines = (data, lindex) => { const { config } = this.state let line = [] config.subcards.forEach((item, index) => { let display = item.setting.condition !== 'true' - let type = '' + let className = '' if (!display && item.setting.controlField) { let val = data[item.setting.controlField] @@ -534,13 +545,21 @@ display = true } - type = 'mk_tb_' + val + className = 'mk_line_' + val } if (!display) return + if (config.wrap.parity === 'true') { + if (lindex % 2 === 1) { + className += ' mk-even-line' + } else { + className += ' mk-odd-line' + } + } + line.push( - <Col key={index} className={type} span={24}> + <Col key={index} className={className} span={24}> <div className="card-item-box" style={item.style} onClick={() => {this.openView(item, data)}}> <CardCellComponent data={data} cards={config} cardCell={item} elements={item.elements}/> </div> @@ -575,7 +594,7 @@ } render() { - const { config, loading, data, BID, pageIndex, total, BData } = this.state + const { config, loading, data, BID, pageIndex, total, BData, precards } = this.state if (config.wrap.empty === 'hidden' && (!data || data.length === 0)) return null @@ -598,12 +617,17 @@ selectedData={[]} /> : null } - {data && data.length > 0 ? <Row className={'card-row-list' + (config.wrap.parity === 'true' ? ' mk-parity' : '')} style={{height: config.wrap.contentHeight}}> - {data.map(item => this.getLines(item))} - </Row> : null} - {data && data.length === 0 ? <div className="card-row-list" style={{height: config.wrap.contentHeight}}> - <Empty description={false}/> - </div> : null} + <Row className="card-row-list" style={{height: config.wrap.contentHeight}}> + {precards.map((item, index) => ( + <Col key={index} className="extend-card" span={24}> + <div className="card-item-box" style={item.style}> + <CardCellComponent data={data && data[0] ? data[0] : {}} cards={config} cardCell={item} elements={item.elements}/> + </div> + </Col> + ))} + {data && data.length > 0 ? data.map((item, index) => this.getLines(item, index)) : null} + {data && data.length === 0 ? <Empty description={false}/> : null} + </Row> {config.wrap.pagestyle === 'page' ? <Pagination size="small" current={pageIndex} total={total} onChange={this.changePageIndex} /> : null} {config.wrap.pagestyle === 'more' && data && data.length > 0 ? <div className={'mk-more' + (config.setting.pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>鏌ョ湅鏇村<DownOutlined/></div> : null} </div> diff --git a/src/tabviews/custom/components/card/table-card/index.scss b/src/tabviews/custom/components/card/table-card/index.scss index 088083a..7a4481b 100644 --- a/src/tabviews/custom/components/card/table-card/index.scss +++ b/src/tabviews/custom/components/card/table-card/index.scss @@ -33,13 +33,6 @@ clear: both; } - .mk-parity { - >.ant-col:nth-child(even) { - .card-item-box { - background-color: var(--mk-sys-color1); - } - } - } .card-row-list { overflow-y: auto; .card-item-box { @@ -47,9 +40,15 @@ background-color: #ffffff; transition: all 0.3s; } - >.active >.card-item-box { - border-color: #1890ff!important; - box-shadow: 0 0 3px #1890ff; + .mk-even-line { + .card-item-box { + background-color: var(--mk-sys-color1); + } + } + .mk-even-line:hover, .mk-odd-line:hover { + .card-item-box { + background-color: var(--mk-sys-color2); + } } } .card-row-list::-webkit-scrollbar { diff --git a/src/tabviews/custom/components/share/normalTable/index.jsx b/src/tabviews/custom/components/share/normalTable/index.jsx index 3ab8096..4493e5c 100644 --- a/src/tabviews/custom/components/share/normalTable/index.jsx +++ b/src/tabviews/custom/components/share/normalTable/index.jsx @@ -27,10 +27,13 @@ if (item.linkThdMenu) { let __param = { - $searchkey: item.field, - $searchval: record[item.field] || '', $BID: record.$$uuid } + + if (item.field) { + __param.$searchkey = item.field.toLowerCase() + __param.$searchval = record[item.field] || '' + } if (item.linkThdMenu.urlFields) { let lower = {} diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index a2870b1..22fa821 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -268,7 +268,7 @@ if (param.$searchkey) { component.search = component.search.map(item => { - if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param.$searchkey === item.field) { + if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param.$searchkey === item.field.toLowerCase()) { item.initval = param.$searchval } diff --git a/src/tabviews/custom/popview/index.jsx b/src/tabviews/custom/popview/index.jsx index 7166489..a75db00 100644 --- a/src/tabviews/custom/popview/index.jsx +++ b/src/tabviews/custom/popview/index.jsx @@ -135,18 +135,6 @@ config.components.forEach(component => { if (component.type !== 'search') return - if (param.$searchkey) { - component.search = component.search.map(item => { - if (['text', 'select', 'link', 'checkcard'].includes(item.type) && param.$searchkey === item.field) { - item.initval = param.$searchval - } - - return item - }) - - component.$searches = Utils.initMainSearch(component.search) - } - window.GLOB.SearchBox.set(Tab.uuid, component.$searches) if (component.$s_req) { diff --git a/src/tabviews/zshare/actionList/newpagebutton/index.jsx b/src/tabviews/zshare/actionList/newpagebutton/index.jsx index 01d678e..7748e24 100644 --- a/src/tabviews/zshare/actionList/newpagebutton/index.jsx +++ b/src/tabviews/zshare/actionList/newpagebutton/index.jsx @@ -16,6 +16,7 @@ btn: PropTypes.object, // 鎸夐挳 selectedData: PropTypes.any, // 瀛愯〃涓�夋嫨鏁版嵁 disabled: PropTypes.any, // 琛屾寜閽鐢� + name: PropTypes.any } state = { @@ -159,18 +160,75 @@ if (btn.pageTemplate === 'billprint') { _name = '鍗曟嵁鎵撳嵃' - if (btn.Ot === 'required') { - data.forEach(item => { - let _id = item.$$uuid || '' - let url = '#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: _id, tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') }))) - window.open(url) - }) - } else if (btn.Ot === 'requiredOnce') { - Id = data.map(item => item.$$uuid).filter(Boolean).join(',') + if (btn.preHandle === 'true' && btn.pre_func) { + MKEmitter.emit('queryModuleParam', btn.$menuId, (res) => { + let searches = {} + res.search && res.search.forEach(item => { + searches[item.key] = item.value + }) - window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: Id, tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') })))) + if (btn.Ot === 'requiredOnce') { + Id = data.map(item => item.$$uuid).filter(Boolean).join(',') + } + + if (btn.Ot === 'required') { + data.forEach(item => { + let _param = { id: item.$$uuid || '', tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM')} + try { + // eslint-disable-next-line + let func = new Function('btn', 'searches', 'data', 'param', 'systemType', btn.pre_func) + _param = func(btn, searches, [item], _param, window.GLOB.systemType) + } catch (e) { + console.warn(e) + } + + if (!_param) { + notification.warning({ + top: 92, + message: '鏈幏鍙栧埌鎵撳嵃鍙傛暟锛岃嚜瀹氫箟鑴氭湰閿欒锛�', + duration: 5 + }) + return + } + + window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify(_param)))) + }) + } else { + let _param = { id: Id, tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM')} + try { + // eslint-disable-next-line + let func = new Function('btn', 'searches', 'data', 'param', 'systemType', btn.pre_func) + _param = func(btn, searches, data, _param, window.GLOB.systemType) + } catch (e) { + console.warn(e) + } + + if (!_param) { + notification.warning({ + top: 92, + message: '鏈幏鍙栧埌鎵撳嵃鍙傛暟锛岃嚜瀹氫箟鑴氭湰閿欒锛�', + duration: 5 + }) + return + } + + window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify(_param)))) + } + }) } else { - window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: Id, tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') })))) + if (btn.Ot === 'required') { + data.forEach(item => { + let _id = item.$$uuid || '' + let url = '#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: _id, tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') }))) + window.open(url) + }) + } else if (btn.Ot === 'requiredOnce') { + Id = data.map(item => item.$$uuid).filter(Boolean).join(',') + + window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: Id, tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') })))) + } else { + window.open('#/billprint/' + window.btoa(window.encodeURIComponent(JSON.stringify({ id: Id, tempId: btn.printTemp, pageId: btn.$MenuID || '', dataM: sessionStorage.getItem('dataM') })))) + } } } else if (btn.pageTemplate === 'billprintTemp') { let src = '#/menudesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({ MenuType: 'billPrint', MenuId: Id, MenuNo: MenuNo, MenuName: name || '鎵撳嵃', Remark: Remark }))) @@ -250,7 +308,7 @@ } render() { - const { btn } = this.props + const { btn, name } = this.props const { disabled, hidden } = this.state if (hidden) return null @@ -261,10 +319,10 @@ let className = '' if (btn.show === 'button') { - label = btn.label + label = name || btn.label icon = btn.icon || '' } else if (btn.show === 'link') { - label = <span>{btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> + label = <span>{name || btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> icon = '' } else if (btn.show === 'icon') { icon = btn.icon || '' diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index f58f2fe..4f97b7d 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -28,6 +28,7 @@ columns: PropTypes.any, // 瀛楁鍒� setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 disabled: PropTypes.any, // 琛屾寜閽鐢� + name: PropTypes.any } state = { @@ -3494,7 +3495,7 @@ } render() { - const { btn } = this.props + const { btn, name } = this.props const { loadingNumber, loadingTotal, loading, disabled, hidden, check, count } = this.state if (hidden) return null @@ -3518,10 +3519,10 @@ let className = '' if (btn.show === 'button') { - label = btn.label + label = name || btn.label icon = btn.icon || '' } else if (btn.show === 'link') { - label = <span>{btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> + label = <span>{name || btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> icon = '' } else if (btn.show === 'icon') { icon = btn.icon || '' diff --git a/src/tabviews/zshare/actionList/popupbutton/index.jsx b/src/tabviews/zshare/actionList/popupbutton/index.jsx index 7c34a66..0488978 100644 --- a/src/tabviews/zshare/actionList/popupbutton/index.jsx +++ b/src/tabviews/zshare/actionList/popupbutton/index.jsx @@ -20,6 +20,7 @@ btn: PropTypes.object, // 鎸夐挳 setting: PropTypes.any, // 椤甸潰閫氱敤璁剧疆 disabled: PropTypes.any, // 琛屾寜閽鐢� + name: PropTypes.any } state = { @@ -303,7 +304,7 @@ } render() { - const { btn } = this.props + const { btn, name } = this.props const { loading, disabled, hidden } = this.state if (hidden) return null @@ -314,10 +315,10 @@ let className = '' if (btn.show === 'button') { - label = btn.label + label = name || btn.label icon = btn.icon || '' } else if (btn.show === 'link') { - label = <span>{btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> + label = <span>{name || btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> icon = '' } else if (btn.show === 'icon') { icon = btn.icon || '' diff --git a/src/tabviews/zshare/actionList/tabbutton/index.jsx b/src/tabviews/zshare/actionList/tabbutton/index.jsx index af1a136..c053caf 100644 --- a/src/tabviews/zshare/actionList/tabbutton/index.jsx +++ b/src/tabviews/zshare/actionList/tabbutton/index.jsx @@ -15,6 +15,7 @@ btn: PropTypes.object, // 鎸夐挳 selectedData: PropTypes.any, // 瀛愯〃涓�夋嫨鏁版嵁 disabled: PropTypes.any, // 琛屾寜閽鐢� + name: PropTypes.any } state = { @@ -197,7 +198,7 @@ } render() { - const { btn } = this.props + const { btn, name } = this.props const { disabled, hidden } = this.state if (hidden) return null @@ -208,10 +209,10 @@ let className = '' if (btn.show === 'button') { - label = btn.label + label = name || btn.label icon = btn.icon || '' } else if (btn.show === 'link') { - label = <span>{btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> + label = <span>{name || btn.label}{btn.icon ? <MkIcon style={{marginLeft: '8px'}} type={btn.icon}/> : ''}</span> icon = '' } else if (btn.show === 'icon') { icon = btn.icon || '' diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx index 44d6ab9..f9187b3 100644 --- a/src/tabviews/zshare/normalTable/index.jsx +++ b/src/tabviews/zshare/normalTable/index.jsx @@ -344,11 +344,14 @@ e.stopPropagation() let __param = { - $searchkey: item.field, - $searchval: record[item.field] || '', $BID: record.$$uuid } + if (item.field) { + __param.$searchkey = item.field.toLowerCase() + __param.$searchval = record[item.field] || '' + } + if (item.linkfields && item.linkfields.length > 0) { item.linkfields.forEach(field => { __param[field] = record[field] || '' diff --git a/src/tabviews/zshare/topSearch/advanceform/index.scss b/src/tabviews/zshare/topSearch/advanceform/index.scss index fa9af70..c98efac 100644 --- a/src/tabviews/zshare/topSearch/advanceform/index.scss +++ b/src/tabviews/zshare/topSearch/advanceform/index.scss @@ -7,6 +7,10 @@ float: none; vertical-align: top; } + .ant-checkbox-wrapper { + color: rgba(0, 0, 0, 0.85); + white-space: nowrap; + } .ant-form-item { display: flex; margin-bottom: 0px; diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx index 4e6d329..8a3fb52 100644 --- a/src/tabviews/zshare/topSearch/index.jsx +++ b/src/tabviews/zshare/topSearch/index.jsx @@ -66,6 +66,10 @@ _setting.wrapperCol = {style: {width: (100 - _setting.labelwidth) + '%'}} _setting.borderRadius = config.wrap.borderRadius _setting.resetContrl = config.wrap.resetContrl || 'init' + + if (config.wrap.searchBtn === 'show') { + _setting.showBtn = true + } } if (config.type === 'search') { @@ -761,6 +765,16 @@ </Form.Item> </Col> ) + } else if (setting.showBtn) { + fields.push( + <Col className="mk-search-col search-button" key="actions"> + <Form.Item> + <Button type="primary" onClick={this.handleSubmit}> + 鎼滅储 + </Button> + </Form.Item> + </Col> + ) } return fields diff --git a/src/tabviews/zshare/topSearch/index.scss b/src/tabviews/zshare/topSearch/index.scss index 142697e..7a15721 100644 --- a/src/tabviews/zshare/topSearch/index.scss +++ b/src/tabviews/zshare/topSearch/index.scss @@ -9,6 +9,7 @@ } .ant-checkbox-wrapper { color: rgba(0, 0, 0, 0.85); + white-space: nowrap; } .ant-form-item { display: flex; diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index d1f3338..7362e15 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -593,7 +593,7 @@ loading: false }) reject() - }, verify.scripts) + }, verify.scripts, 'submit') }) }) } else if (activeKey === 'columns') { @@ -612,7 +612,7 @@ loading: false }) reject() - }, verify.scripts) + }, verify.scripts, 'submit') } } else if (activeKey === 'scripts') { this.setState({loading: true}) @@ -626,7 +626,7 @@ loading: false }) reject() - }, verify.scripts) + }, verify.scripts, 'submit') } else { resolve(verify) } @@ -923,7 +923,7 @@ } } - sqlverify = (_resolve, _reject, scripts) => { + sqlverify = (_resolve, _reject, scripts, type) => { const { searches, verify, debugId } = this.state if (verify.dataType !== 'custom') { @@ -945,10 +945,24 @@ this.setState({debugId: _debugId}) _resolve() } else { - _reject() - Modal.error({ - title: result.message - }) + if (type === 'submit') { + Modal.confirm({ + title: result.message, + okText: '鐭ラ亾浜�', + cancelText: '寮哄埗淇濆瓨', + onOk: () => { + _reject() + }, + onCancel() { + _resolve() + } + }) + } else { + _reject() + Modal.error({ + title: result.message + }) + } } }) } diff --git a/src/templates/sharecomponent/searchcomponent/index.jsx b/src/templates/sharecomponent/searchcomponent/index.jsx index 9d4b8f3..ab95ce6 100644 --- a/src/templates/sharecomponent/searchcomponent/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/index.jsx @@ -93,6 +93,7 @@ * @description 鎼滅储鏉′欢缂栬緫锛岃幏鍙栨悳绱㈡潯浠惰〃鍗曚俊鎭� */ handleSearch = (card) => { + const { config } = this.props const { searchlist } = this.state let linkableFields = [] @@ -108,8 +109,8 @@ }) let columns = null - if (this.props.config.type === 'table') { - columns = this.props.config.columns.map(item => { + if (config.columns && config.columns.length) { + columns = config.columns.map(item => { return {key: item.uuid, text: item.field, value: item.field, label: item.label} }) } -- Gitblit v1.8.0