From 1fa9bbd032749dc07f98d21b7403b041053d0bed Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 25 三月 2024 10:29:19 +0800 Subject: [PATCH] 2024-03-25 --- src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx | 44 +++++- src/menu/stylecontroller/index.jsx | 61 +++++---- src/tabviews/zshare/topSearch/index.jsx | 48 ++++++- src/menu/components/card/cardcellcomponent/index.scss | 4 src/menu/components/card/cardcellcomponent/elementform/index.jsx | 68 ++++++++--- src/menu/components/search/main-search/dragsearch/card.jsx | 4 src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx | 4 src/menu/components/search/main-search/index.jsx | 4 src/menu/components/share/searchcomponent/dragsearch/card.jsx | 14 + src/menu/components/card/cardcellcomponent/formconfig.jsx | 6 src/tabviews/custom/index.jsx | 22 +++ src/tabviews/zshare/topSearch/index.scss | 3 src/tabviews/custom/components/card/cardcellList/index.scss | 4 src/tabviews/zshare/topSearch/mkDatePicker/index.jsx | 15 ++ src/tabviews/zshare/topSearch/advanceform/index.scss | 3 src/menu/components/search/main-search/options.jsx | 15 ++ src/utils/utils.js | 29 +++- 17 files changed, 256 insertions(+), 92 deletions(-) diff --git a/src/menu/components/card/cardcellcomponent/elementform/index.jsx b/src/menu/components/card/cardcellcomponent/elementform/index.jsx index dee9a31..f4f8214 100644 --- a/src/menu/components/card/cardcellcomponent/elementform/index.jsx +++ b/src/menu/components/card/cardcellcomponent/elementform/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { fromJS } from 'immutable' -import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, Popover } from 'antd' +import { Form, Row, Col, Input, Select, Radio, Tooltip, InputNumber, Cascader, Popover, message } from 'antd' import { QuestionCircleOutlined } from '@ant-design/icons' import { formRule } from '@/utils/option.js' @@ -421,24 +421,45 @@ </Col> ) } else if (item.type === 'number') { - fields.push( - <Col span={12} key={index}> - <Form.Item help={item.help || null} label={item.tooltip ? - <Tooltip placement="topLeft" title={item.tooltip}> - <QuestionCircleOutlined className="mk-form-tip" /> - {item.label} - </Tooltip> : item.label - }> - {getFieldDecorator(item.key, { - initialValue: item.initVal, - rules: [{ - required: item.readonly ? false : !!item.required, - message: '璇疯緭鍏�' + item.label + '!' - }] - })(<InputNumber min={item.min || 0} max={item.max || 10000} precision={item.precision || 0} onPressEnter={this.handleSubmit} />)} - </Form.Item> - </Col> - ) + if (item.help) { + fields.push( + <Col span={12} key={index}> + <Form.Item help={item.help} label={item.tooltip ? + <Tooltip placement="topLeft" title={item.tooltip}> + <QuestionCircleOutlined className="mk-form-tip" /> + {item.label} + </Tooltip> : item.label + }> + {getFieldDecorator(item.key, { + initialValue: item.initVal, + rules: [{ + required: item.readonly ? false : !!item.required, + message: '璇疯緭鍏�' + item.label + '!' + }] + })(<InputNumber min={item.min || 0} max={item.max || 10000} precision={item.precision || 0} onPressEnter={this.handleSubmit} />)} + </Form.Item> + </Col> + ) + } else { + fields.push( + <Col span={12} key={index}> + <Form.Item label={item.tooltip ? + <Tooltip placement="topLeft" title={item.tooltip}> + <QuestionCircleOutlined className="mk-form-tip" /> + {item.label} + </Tooltip> : item.label + }> + {getFieldDecorator(item.key, { + initialValue: item.initVal, + rules: [{ + required: item.readonly ? false : !!item.required, + message: '璇疯緭鍏�' + item.label + '!' + }] + })(<InputNumber min={item.min || 0} max={item.max || 10000} precision={item.precision || 0} onPressEnter={this.handleSubmit} />)} + </Form.Item> + </Col> + ) + } } else if (item.type === 'select') { // 涓嬫媺鎼滅储 fields.push( <Col span={12} key={index}> @@ -649,6 +670,15 @@ }) } + if (values.width === 0) { + let utype = {picture: '鍥剧墖', video: '瑙嗛', slider: '杩涘害鏉�', splitline: '鍒嗗壊绾�', barcode: '鏉″舰鐮�', qrcode: '浜岀淮鐮�'} + + if (utype[values.eleType]) { + message.warning(utype[values.eleType] + '鍏冪礌瀹藉害涓嶅彲涓�0锛�') + return + } + } + resolve(values) } else { reject(err) diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx index 41265db..c9ca638 100644 --- a/src/menu/components/card/cardcellcomponent/formconfig.jsx +++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx @@ -52,7 +52,7 @@ _options = [{ value: 'text', text: '鏂囨湰'}] } - let width = card.width || 12 + let width = card.width === undefined ? 12 : card.width if (/x/.test(card.width)) { width = +width.replace(/x/, '.5') } @@ -441,12 +441,12 @@ { type: 'number', key: 'width', - min: 0.5, + min: 0, max: 24, precision: 1, label: '鍏冪礌瀹藉害', initVal: width, - tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒楋紝鍙缃崐鍒楀嵆.5銆�', + tooltip: '鏍呮牸甯冨眬锛屾瘡琛岀瓑鍒嗕负24鍒楋紝鍙缃崐鍒楀嵆.5銆傛敞锛氫负0鏃跺搴︿緷鎹唴瀹硅嚜閫傚簲锛堟枃鏈�佹暟鍊笺�佹彁绀猴紙鍥炬爣锛夈�佸綋鍓嶆椂闂淬�佸叕寮忥級銆�', required: true }, { diff --git a/src/menu/components/card/cardcellcomponent/index.scss b/src/menu/components/card/cardcellcomponent/index.scss index f4c9f9e..7006456 100644 --- a/src/menu/components/card/cardcellcomponent/index.scss +++ b/src/menu/components/card/cardcellcomponent/index.scss @@ -41,6 +41,10 @@ border-radius: 15px; } } + .card-cell.ant-col-0 { + display: block; + float: left; + } .card-cell:hover, .card-button-cell:hover { box-shadow: 0px 0px 2px #1890ff; } diff --git a/src/menu/components/search/main-search/dragsearch/card.jsx b/src/menu/components/search/main-search/dragsearch/card.jsx index e09f49c..6e153b6 100644 --- a/src/menu/components/search/main-search/dragsearch/card.jsx +++ b/src/menu/components/search/main-search/dragsearch/card.jsx @@ -118,11 +118,11 @@ if (options.length === 0) { options = [{Value: '1', Text: '閫夐」1'}, {Value: '2', Text: '閫夐」2'}] } - formItem = (<Radio.Group value={card.initval} style={{lineHeight: '36px'}}> + formItem = (<Radio.Group value={card.initval} style={{lineHeight: '40px', whiteSpace: 'nowrap'}}> {options.map((item, i) => (<Radio key={i} value={item.Value}> {item.Text} </Radio>))} </Radio.Group>) } else if (card.type === 'check') { - formItem = <Checkbox style={{lineHeight: '36px'}} checked={card.initval === card.openVal}>{card.checkTip || ''}</Checkbox> + formItem = <Checkbox style={{lineHeight: '36px', whiteSpace: 'nowrap'}} checked={card.initval === card.openVal}>{card.checkTip || ''}</Checkbox> } else if (card.type === 'range') { let vals = card.initval.split(',') formItem = (<> diff --git a/src/menu/components/search/main-search/index.jsx b/src/menu/components/search/main-search/index.jsx index 1f3669c..57643d2 100644 --- a/src/menu/components/search/main-search/index.jsx +++ b/src/menu/components/search/main-search/index.jsx @@ -354,9 +354,9 @@ } getWrapForms = () => { - const { wrap, action } = this.state.card + const { card } = this.state - return getWrapForm(wrap, action) + return getWrapForm(card.wrap, card.uuid) } updateWrap = (res) => { diff --git a/src/menu/components/search/main-search/options.jsx b/src/menu/components/search/main-search/options.jsx index 8228b2b..2ed6c06 100644 --- a/src/menu/components/search/main-search/options.jsx +++ b/src/menu/components/search/main-search/options.jsx @@ -1,7 +1,8 @@ +import MenuUtils from '@/utils/utils-custom.js' /** * @description Wrap琛ㄥ崟閰嶇疆淇℃伅 */ -export default function (wrap, action = []) { +export default function (wrap, uuid) { let roleList = sessionStorage.getItem('sysRoles') let appType = sessionStorage.getItem('appType') @@ -14,6 +15,9 @@ } else { roleList = [] } + + let menu = window.GLOB.customMenu + let modules = MenuUtils.getSupModules(menu.components, uuid, menu.interfaces) const wrapForm = [ { @@ -168,6 +172,15 @@ forbid: !!appType }, { + type: 'cascader', + field: 'supModule', + label: '涓婄骇缁勪欢', + initval: wrap.supModule || [], + required: false, + options: modules, + forbid: sessionStorage.getItem('editMenuType') === 'popview' + }, + { type: 'multiselect', field: 'blacklist', label: '榛戝悕鍗�', diff --git a/src/menu/components/share/searchcomponent/dragsearch/card.jsx b/src/menu/components/share/searchcomponent/dragsearch/card.jsx index 6061187..f13b469 100644 --- a/src/menu/components/share/searchcomponent/dragsearch/card.jsx +++ b/src/menu/components/share/searchcomponent/dragsearch/card.jsx @@ -1,6 +1,6 @@ import React from 'react' import { useDrag, useDrop } from 'react-dnd' -import { Select, DatePicker, Input, Popover, Form, Switch, Checkbox } from 'antd' +import { Select, DatePicker, Input, Popover, Form, Switch, Checkbox, Radio } from 'antd' import { EditOutlined, CopyOutlined, CloseOutlined } from '@ant-design/icons' import moment from 'moment' @@ -105,15 +105,23 @@ format={format} className="data-range" placeholder={['BeginTime', 'EndTime']} - renderExtraFooter={() => 'extra footer'} + renderExtraFooter={() => 'extra footer'} value={_defaultValue} /> } else if (card.type === 'group') { formItem = <DateGroup card={card} /> } else if (card.type === 'switch') { formItem = (<Switch checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''} style={{marginTop: '8px'}} checked={card.initval === card.openVal}/>) + } else if (card.type === 'radio') { + let options = card.options + if (options.length === 0) { + options = [{Value: '1', Text: '閫夐」1'}, {Value: '2', Text: '閫夐」2'}] + } + formItem = (<Radio.Group value={card.initval} style={{lineHeight: '40px', whiteSpace: 'nowrap'}}> + {options.map((item, i) => (<Radio key={i} value={item.Value}> {item.Text} </Radio>))} + </Radio.Group>) } else if (card.type === 'check') { - formItem = <Checkbox style={{lineHeight: '36px'}} checked={card.initval === card.openVal}>{card.checkTip || ''}</Checkbox> + formItem = <Checkbox style={{lineHeight: '36px', whiteSpace: 'nowrap'}} checked={card.initval === card.openVal}>{card.checkTip || ''}</Checkbox> } else if (card.type === 'range') { type = 'range-wrap' let vals = card.initval.split(',') diff --git a/src/menu/stylecontroller/index.jsx b/src/menu/stylecontroller/index.jsx index 6fb2319..04fb753 100644 --- a/src/menu/stylecontroller/index.jsx +++ b/src/menu/stylecontroller/index.jsx @@ -130,30 +130,37 @@ onCloseDrawer = () => { let card = fromJS(this.state.card).toJS() - let check = false - if (card.borderWidth === '0px') { + if (card.borderWidth === '0px' || !card.borderWidth) { delete card.borderWidth delete card.borderColor - check = true - } else if (card.borderLeftWidth === '0px') { - delete card.borderLeftWidth - delete card.borderLeftColor - check = true - } else if (card.borderRightWidth === '0px') { - delete card.borderRightWidth - delete card.borderRightColor - check = true - } else if (card.borderTopWidth === '0px') { - delete card.borderTopWidth - delete card.borderTopColor - check = true - } else if (card.borderBottomWidth === '0px') { - delete card.borderBottomWidth - delete card.borderBottomColor - check = true } - if (check) { + if (card.borderLeftWidth === '0px' || !card.borderLeftWidth) { + delete card.borderLeftWidth + delete card.borderLeftColor + } + if (card.borderRightWidth === '0px' || !card.borderRightWidth) { + delete card.borderRightWidth + delete card.borderRightColor + } + if (card.borderTopWidth === '0px' || !card.borderTopWidth) { + delete card.borderTopWidth + delete card.borderTopColor + } + if (card.borderBottomWidth === '0px' || !card.borderBottomWidth) { + delete card.borderBottomWidth + delete card.borderBottomColor + } + + if (/0px 0px 0px | transparent/.test(card.boxShadow)) { + delete card.hShadow + delete card.vShadow + delete card.shadowBlur + delete card.shadowColor + delete card.boxShadow + } + + if (!is(fromJS(this.state.card), fromJS(card))) { this.callback && this.callback(card) } @@ -285,7 +292,7 @@ changeShadowColor = (val) => { const { card } = this.state - let boxShadow = `${card.hShadow || '0px'} ${card.vShadow || '0px'} ${card.shadowBlur || '0px'} ${val}` + let boxShadow = `${card.hShadow || '0px'} ${card.vShadow || '0px'} ${card.shadowBlur || '0px'} ${val || 'transparent'}` this.updateStyle({shadowColor: val, boxShadow}) } @@ -865,11 +872,11 @@ label={<ColumnWidthOutlined title="杈规瀹藉害"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - {borposition === 'outer' ? <StyleInput defaultValue={card.borderWidth || '0px'} options={['px']} onChange={this.changeBorderWidth}/> : null} - {borposition === 'left' ? <StyleInput defaultValue={card.borderLeftWidth || '0px'} options={['px']} onChange={this.changeBorderWidth}/> : null} - {borposition === 'right' ? <StyleInput defaultValue={card.borderRightWidth || '0px'} options={['px']} onChange={this.changeBorderWidth}/> : null} - {borposition === 'top' ? <StyleInput defaultValue={card.borderTopWidth || '0px'} options={['px']} onChange={this.changeBorderWidth}/> : null} - {borposition === 'bottom' ? <StyleInput defaultValue={card.borderBottomWidth || '0px'} options={['px']} onChange={this.changeBorderWidth}/> : null} + {borposition === 'outer' ? <StyleInput defaultValue={card.borderWidth || ''} options={['px']} onChange={this.changeBorderWidth}/> : null} + {borposition === 'left' ? <StyleInput defaultValue={card.borderLeftWidth || ''} options={['px']} onChange={this.changeBorderWidth}/> : null} + {borposition === 'right' ? <StyleInput defaultValue={card.borderRightWidth || ''} options={['px']} onChange={this.changeBorderWidth}/> : null} + {borposition === 'top' ? <StyleInput defaultValue={card.borderTopWidth || ''} options={['px']} onChange={this.changeBorderWidth}/> : null} + {borposition === 'bottom' ? <StyleInput defaultValue={card.borderBottomWidth || ''} options={['px']} onChange={this.changeBorderWidth}/> : null} </Form.Item> </Col> <Col span={24}> @@ -909,7 +916,7 @@ label={<BgColorsOutlined title="闃村奖棰滆壊"/>} labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } > - <ColorSketch value={card.shadowColor || ''} onChange={this.changeShadowColor} /> + <ColorSketch allowClear={true} value={card.shadowColor || ''} onChange={this.changeShadowColor} /> </Form.Item> <Form.Item colon={false} diff --git a/src/tabviews/custom/components/card/cardcellList/index.scss b/src/tabviews/custom/components/card/cardcellList/index.scss index 4c82d80..12e5781 100644 --- a/src/tabviews/custom/components/card/cardcellList/index.scss +++ b/src/tabviews/custom/components/card/cardcellList/index.scss @@ -3,6 +3,10 @@ position: relative; line-height: 1.5; + .ant-col-0:not(.mk-cell-btn) { + display: block; + float: left; + } .ant-btn { padding: 0; } diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 22fa821..400b562 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -574,6 +574,10 @@ } else { item.setting.supModule = '' } + } else if (item.type === 'search') { + if (item.wrap.supModule) { + item.wrap.supModule = item.wrap.supModule.pop() + } } // 鎼滅储鏉′欢鍒濆鍖� @@ -581,6 +585,14 @@ Utils.initSearchVal(item) item.$searches = Utils.initMainSearch(item.search) + + if (item.type === 'search' && item.wrap.supModule) { + if (!item.checkBid) { + item.wrap.supModule = '' + } else { + window.GLOB.SearchBox.set(item.$searchId + 'checkBid', true) + } + } } let pass = skip @@ -1082,8 +1094,14 @@ if (component.setting.useMSearch) { if (!window.GLOB.SearchBox.has(component.$searchId)) { component.setting.useMSearch = false - } else if (window.GLOB.SearchBox.has(component.$searchId + 'required')) { - component.$s_req = true + } else { + if (window.GLOB.SearchBox.has(component.$searchId + 'required')) { + component.$s_req = true + } + if (window.GLOB.SearchBox.has(component.$searchId + 'checkBid')) { + component.checkBid = true + component.setting.checkBid = true + } } } diff --git a/src/tabviews/zshare/topSearch/advanceform/index.scss b/src/tabviews/zshare/topSearch/advanceform/index.scss index c98efac..2312e65 100644 --- a/src/tabviews/zshare/topSearch/advanceform/index.scss +++ b/src/tabviews/zshare/topSearch/advanceform/index.scss @@ -36,6 +36,9 @@ .ant-select-dropdown { z-index: 10 !important; } + .ant-radio-group { + white-space: nowrap; + } .ant-calendar-picker-container { z-index: 10 !important; } diff --git a/src/tabviews/zshare/topSearch/index.jsx b/src/tabviews/zshare/topSearch/index.jsx index 8a3fb52..355e75a 100644 --- a/src/tabviews/zshare/topSearch/index.jsx +++ b/src/tabviews/zshare/topSearch/index.jsx @@ -42,7 +42,7 @@ sign = '' UNSAFE_componentWillMount () { - const { config, BID } = this.props + const { config } = this.props let _searchlist = [] let fieldMap = new Map() @@ -54,6 +54,7 @@ let record = {} let forbid = false // header涓笉璁剧疆楂樼骇鎼滅储 let _setting = {showAdv: false, show: false, style: null} + let BID = this.props.BID if (config.wrap) { _setting.show = config.wrap.show !== 'false' @@ -69,6 +70,11 @@ if (config.wrap.searchBtn === 'show') { _setting.showBtn = true + } + + if (config.wrap.supModule) { + let BData = window.GLOB.CacheData.get(config.wrap.supModule) + BID = BData ? (BData.$BID || '') : '' } } @@ -282,19 +288,42 @@ searchlist: _list }, () => { if (!window.GLOB.mkHS && window.GLOB.sysType === 'local' && window.GLOB.systemType !== 'production') { - this.improveSimpleSearch(deForms, false) + this.improveSimpleSearch(deForms, false, null, BID) } else if (mainItems.length > 0 || localItems.length > 0) { - this.improveSearch(mainItems, localItems) + this.improveSearch(mainItems, localItems, BID) } }) + } + + componentDidMount () { + const { config } = this.props + + if (config.type === 'search' && config.wrap.supModule) { + MKEmitter.addListener('resetSelectLine', this.resetParentParam) + } + } + + componentWillUnmount () { + this.setState = () => { + return + } + MKEmitter.removeListener('resetSelectLine', this.resetParentParam) } UNSAFE_componentWillReceiveProps(nextProps) { const { config, BID } = this.props - if (config.checkBid && nextProps.BID !== BID) { + if (config.checkBid && config.type !== 'search' && nextProps.BID !== BID) { this.resetOptions(nextProps.BID) } + } + + resetParentParam = (MenuID, id) => { + const { config } = this.props + + if (config.wrap.supModule !== MenuID) return + + this.resetOptions(id) } resetOptions = (BID) => { @@ -350,7 +379,7 @@ }) if (deForms.length > 0) { - this.improveSimpleSearch(deForms, true, searchlist) + this.improveSimpleSearch(deForms, true, searchlist, BID) } else { this.setState({ searchlist: searchlist @@ -395,8 +424,7 @@ } // 鏌ヨ涓嬫媺鑿滃崟 - improveSearch = (mainItems, localItems) => { - const { BID } = this.props + improveSearch = (mainItems, localItems, BID) => { let deffers = [] // 鏈湴璇锋眰 @@ -499,7 +527,7 @@ } // 娴嬭瘯绯荤粺鍗曚釜璇锋眰涓嬫媺閫夐」 - improveSimpleSearch = (deForms, trigger, searchlist) => { + improveSimpleSearch = (deForms, trigger, searchlist, BID) => { if (deForms.length === 0) return let deffers = deForms.map((item, index) => { @@ -510,8 +538,8 @@ arr_field: item.arr_field } - if (this.props.BID) { - param.BID = this.props.BID + if (BID) { + param.BID = BID } if (window.GLOB.execType === 'x') { diff --git a/src/tabviews/zshare/topSearch/index.scss b/src/tabviews/zshare/topSearch/index.scss index 7a15721..91eabfd 100644 --- a/src/tabviews/zshare/topSearch/index.scss +++ b/src/tabviews/zshare/topSearch/index.scss @@ -36,6 +36,9 @@ .ant-select-dropdown { z-index: 10 !important; } + .ant-radio-group { + white-space: nowrap; + } .ant-calendar-picker-container { z-index: 10 !important; } diff --git a/src/tabviews/zshare/topSearch/mkDatePicker/index.jsx b/src/tabviews/zshare/topSearch/mkDatePicker/index.jsx index fc67c7d..3ec9b43 100644 --- a/src/tabviews/zshare/topSearch/mkDatePicker/index.jsx +++ b/src/tabviews/zshare/topSearch/mkDatePicker/index.jsx @@ -54,10 +54,21 @@ const { config } = this.props if (config.checkShift && nextProps.config.initval && nextProps.config.initval !== config.initval) { - let val = nextProps.config.initval.split(',') + let value = nextProps.config.initval || null + + if (this.state.mode === 'daterange') { + if (value) { + let val = value.split(',') + value = [moment(val[0], this.state.format), moment(val[1], this.state.format)] + } else { + value = [null, null] + } + } else if (value) { + value = moment(value, this.state.format) + } this.setState({ - value: [moment(val[0], config.format), moment(val[1], config.format)] + value: value }) this.props.onChange(nextProps.config.initval, true) diff --git a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx index ccad7dd..bbad3ad 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyprint/index.jsx @@ -97,12 +97,12 @@ dataIndex: 'operation', render: (text, record) => (<div style={{textAlign: 'center'}}> - <span className="operation-btn" title="缂栬緫" onClick={() => this.handleEdit(record, 'scripts')} style={{color: '#1890ff'}}><EditOutlined /></span> - <span className="operation-btn" title="鐘舵�佸垏鎹�" onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> + <span className="operation-btn" title="缂栬緫" onClick={() => this.handleEdit(record)} style={{color: '#1890ff'}}><EditOutlined /></span> + <span className="operation-btn" title="鐘舵�佸垏鎹�" onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><SwapOutlined /></span> <Popconfirm overlayClassName="popover-confirm" title="纭畾鍒犻櫎鍚�?" - onConfirm={() => this.handleDelete(record, 'scripts') + onConfirm={() => this.handleDelete(record) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> </Popconfirm> @@ -333,14 +333,9 @@ }) } - handleEdit = (record, type) => { - let node = null - - if (type === 'scripts') { - this.scriptsForm.edit(record) - node = document.getElementById('mk-exout-script') - } - + handleEdit = (record) => { + this.scriptsForm.edit(record) + let node = document.getElementById('mk-exout-script') if (node && node.scrollTop) { let inter = Math.ceil(node.scrollTop / 10) @@ -356,6 +351,33 @@ } } + handleStatus = (record) => { + let verify = fromJS(this.state.verify).toJS() + record.status = record.status === 'false' ? 'true' : 'false' + + verify.scripts = verify.scripts.map(item => { + if (item.uuid === record.uuid) { + return record + } else { + return item + } + }) + + this.setState({ + verify: verify + }) + } + + handleDelete = (record) => { + let verify = fromJS(this.state.verify).toJS() + + verify.scripts = verify.scripts.filter(item => item.uuid !== record.uuid) + + this.setState({ verify: verify }) + + this.scriptsForm.check(record) + } + showError = (errorType) => { if (errorType === 'S') { notification.success({ diff --git a/src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx b/src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx index db83147..0f771e9 100644 --- a/src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx +++ b/src/templates/sharecomponent/searchcomponent/dragsearch/card.jsx @@ -120,11 +120,11 @@ if (options.length === 0) { options = [{Value: '1', Text: '閫夐」1'}, {Value: '2', Text: '閫夐」2'}] } - formItem = (<Radio.Group value={card.initval} style={{lineHeight: '36px'}}> + formItem = (<Radio.Group value={card.initval} style={{lineHeight: '36px', whiteSpace: 'nowrap'}}> {options.map((item, i) => (<Radio key={i} value={item.Value}> {item.Text} </Radio>))} </Radio.Group>) } else if (card.type === 'check') { - formItem = <Checkbox style={{lineHeight: '36px'}} checked={card.initval === card.openVal}>{card.checkTip || ''}</Checkbox> + formItem = <Checkbox style={{lineHeight: '36px', whiteSpace: 'nowrap'}} checked={card.initval === card.openVal}>{card.checkTip || ''}</Checkbox> } else if (card.type === 'range') { type = 'range-wrap' let vals = card.initval.split(',') diff --git a/src/utils/utils.js b/src/utils/utils.js index a904374..8e92379 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -204,6 +204,13 @@ values = window.GLOB.SearchBox.get(config.$searchId + 'cache') } + let supModule = '' + if (config.setting && config.setting.supModule) { + supModule = config.setting.supModule + } else if (config.wrap && config.wrap.supModule) { + supModule = config.wrap.supModule + } + config.search = config.search.map(item => { item.hidden = item.Hide === 'true' item.required = !item.hidden && item.required === 'true' @@ -234,12 +241,14 @@ } else { item.$initval = item.initval item.$supId = config.$pageId - if (config.setting && config.setting.supModule) { - item.$supId = config.setting.supModule + if (supModule) { + item.$supId = supModule config.checkBid = true - config.setting.checkBid = true item.checkShift = true + if (config.setting) { + config.setting.checkBid = true + } } item.initval = '' @@ -296,12 +305,14 @@ } else { item.$initval = item.initval item.$supId = config.$pageId - if (config.setting && config.setting.supModule) { - item.$supId = config.setting.supModule + if (supModule) { + item.$supId = supModule config.checkBid = true - config.setting.checkBid = true item.checkShift = true + if (config.setting) { + config.setting.checkBid = true + } } item.initval = '' @@ -393,10 +404,12 @@ item.initType = '' } } else if ((item.type === 'select' || item.type === 'link') && item.resourceType === '1') { - if (/@BID@/ig.test(item.dataSource) && config.setting && config.setting.supModule) { + if (/@BID@/ig.test(item.dataSource) && supModule) { config.checkBid = true - config.setting.checkBid = true item.checkBid = true + if (config.setting) { + config.setting.checkBid = true + } } if (item.initval === '$first') { item.initval = '' -- Gitblit v1.8.0