From 33751ea3b295b313edc08ada35941f2fccf023fe Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期三, 21 六月 2023 10:41:21 +0800 Subject: [PATCH] 2023-06-21 --- src/templates/zshare/modalform/index.jsx | 2 +- src/tabviews/zshare/mutilform/mkCheckCard/index.scss | 8 ++++++++ src/tabviews/zshare/mutilform/mkCheckCard/index.jsx | 26 +++++++++++++++++++++++++- src/tabviews/subtable/index.jsx | 2 +- src/tabviews/subtabtable/index.jsx | 2 +- src/templates/zshare/formconfig.jsx | 16 ++++++++++++++++ src/tabviews/commontable/index.jsx | 2 +- 7 files changed, 53 insertions(+), 5 deletions(-) diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index f9887fb..d8e90c6 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -1010,7 +1010,7 @@ return ( <div className="commontable" id={this.state.ContainerId}> {loadingview ? <Spin size="large" /> : null} - {config.search && config.search.length ? + {config && config.search && config.search.length ? <MainSearch BID={BID} config={config} refreshdata={this.refreshbysearch}/> : null } {setting && config.charts ? <Row className="chart-view" gutter={16}> diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index cb9aefe..8cf8ac8 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -852,7 +852,7 @@ return ( <div className="subtable" id={'subtable' + this.props.MenuID}> {loadingview && <Spin />} - {config.search && config.search.length ? + {config && config.search && config.search.length ? <SubSearch BID={BID} config={config} refreshdata={this.refreshbysearch}/> : null } {config && config.charts ? <Row className="chart-view" gutter={16}> diff --git a/src/tabviews/subtabtable/index.jsx b/src/tabviews/subtabtable/index.jsx index 3388d62..24b4808 100644 --- a/src/tabviews/subtabtable/index.jsx +++ b/src/tabviews/subtabtable/index.jsx @@ -702,7 +702,7 @@ return ( <div className="subtabtable" id={'subtabtable' + this.props.MenuID}> {loadingview && <Spin />} - {config.search && config.search.length ? + {config && config.search && config.search.length ? <SubSearch BID={this.props.BID} config={config} refreshdata={this.refreshbysearch}/> : null } {config ? <div style={{minHeight: '25px'}}> diff --git a/src/tabviews/zshare/mutilform/mkCheckCard/index.jsx b/src/tabviews/zshare/mutilform/mkCheckCard/index.jsx index 9d9cb2c..a7dc070 100644 --- a/src/tabviews/zshare/mutilform/mkCheckCard/index.jsx +++ b/src/tabviews/zshare/mutilform/mkCheckCard/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Col, Row } from 'antd' +import { Col, Row, Switch } from 'antd' import { CheckOutlined } from '@ant-design/icons' import MKEmitter from '@/utils/events.js' @@ -281,6 +281,29 @@ } } + onChange = (val) => { + if (val) { + let keys = [] + this.state.options.forEach(item => { + if (item.$disabled) return + + keys.push(item.$value) + }) + + this.setState({ + selectKeys: keys + }, () => { + this.props.onChange(keys.join(',')) + }) + } else { + this.setState({ + selectKeys: [] + }, () => { + this.props.onChange('') + }) + } + } + render() { const { config, options } = this.state @@ -295,6 +318,7 @@ return ( <div className={'check-card-form-box ' + extend}> + {config.checkAll === 'show' && options.length > 3 ? <Switch size="small" onChange={this.onChange}/> : null} <Row gutter={12}>{this.getCards()}</Row> </div> ) diff --git a/src/tabviews/zshare/mutilform/mkCheckCard/index.scss b/src/tabviews/zshare/mutilform/mkCheckCard/index.scss index b97b1d8..7bb1021 100644 --- a/src/tabviews/zshare/mutilform/mkCheckCard/index.scss +++ b/src/tabviews/zshare/mutilform/mkCheckCard/index.scss @@ -1,5 +1,6 @@ .check-card-form-box { margin-top: 5px; + position: relative; .card-cell { position: relative; border: 1px solid #bcbcbc; @@ -135,6 +136,13 @@ } } + .ant-switch { + position: absolute; + top: -22px; + right: 0px; + opacity: 0.7; + } + .card-cell.disabled { cursor: not-allowed; } diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 0984554..71145dd 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -3476,6 +3476,22 @@ }, { type: 'radio', + key: 'checkAll', + label: '鍏ㄩ��', + initVal: card.checkAll || 'hide', + tooltip: '鍙閫夌殑閫夐」鍗℃槸鍚︽樉绀哄叏閫夊紑鍏筹紝娉細褰撻�夐」澶т簬3涓椂鏈夋晥銆�', + required: false, + forbid: appType !== '', + options: [{ + value: 'hide', + text: '闅愯棌' + }, { + value: 'show', + text: '鏄剧ず' + }] + }, + { + type: 'radio', key: 'selectStyle', label: '閫変腑鏁堟灉', tooltip: '鑳屾櫙鍙婃枃瀛楀彉鍖栨椂浼氫娇鐢ㄧ郴缁熻壊銆�', diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index 27260e3..ac5c8a7 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -221,7 +221,7 @@ shows.push('decimal') } } else { - shows.push('fieldlength') + shows.push('fieldlength', 'checkAll') reTooltip.initval = '娣诲姞澶氫釜鍒濆鍊艰浣跨敤閫楀彿鍒嗛殧銆�' } -- Gitblit v1.8.0