| | |
| | | } |
| | | } |
| | | .custom-data-card-box, .custom-prop-card-box { |
| | | .data-zoom.radio, .data-zoom.checkbox { |
| | | .card-row-list > .ant-col:not(.active):not(.backFont):not(.font):not(.selected):not(.extend-card):hover > .card-item-box { |
| | | .data-zoom.radio.active, .data-zoom.checkbox.active { |
| | | .mk-card:not(.active):not(.selected):hover { |
| | | > .card-item-box { |
| | | border-color: $color4 !important; |
| | | box-shadow: 0 0 4px $color4 !important; |
| | | } |
| | | } |
| | | .card-row-list.radio, .card-row-list.checkbox { |
| | | >.ant-col:not(.active):not(.backFont):not(.font):not(.selected):hover { |
| | | .mk-card.active { |
| | | > .card-item-box { |
| | | border-color: $color6!important; |
| | | box-shadow: 0 0 4px $color6!important; |
| | | } |
| | | } |
| | | .mk-card.selected { |
| | | >.card-item-box { |
| | | border-color: $color4!important; |
| | | box-shadow: 0 0 4px $color4!important; |
| | | } |
| | | } |
| | | } |
| | | .card-row-list { |
| | | >.active >.card-item-box { |
| | | border-color: $color6!important; |
| | | box-shadow: 0 0 4px $color6!important; |
| | | } |
| | | >.backFont >.card-item-box { |
| | | .data-zoom.radio.backFont, .data-zoom.checkbox.backFont { |
| | | .mk-card:hover, .mk-card.active, .mk-card.selected { |
| | | > .card-item-box { |
| | | border-color: $color6!important; |
| | | background-color: $color1!important; |
| | | .ant-mk-text { |
| | | .ant-mk-text, .ant-mk-date { |
| | | color: $color6; |
| | | } |
| | | } |
| | | >.font >.card-item-box { |
| | | } |
| | | } |
| | | .data-zoom.radio.font, .data-zoom.checkbox.font { |
| | | .mk-card:hover, .mk-card.active, .mk-card.selected { |
| | | > .card-item-box { |
| | | border-color: $color6!important; |
| | | .ant-mk-text { |
| | | .ant-mk-text, .ant-mk-date { |
| | | color: $color6; |
| | | } |
| | | } |
| | | >.selected >.card-item-box { |
| | | border-color: $color4!important; |
| | | box-shadow: 0 0 4px $color4!important; |
| | | } |
| | | } |
| | | } |
| | |
| | | if (vals.length === new Set(vals).size) { |
| | | cell.hidden = true |
| | | } |
| | | } else if (item.notNull) { |
| | | cell.hidden = !supItem.initval |
| | | } else if (!item.values.includes(supItem.initval)) { |
| | | cell.hidden = true |
| | | } |
| | |
| | | } else { |
| | | m.hidden = true |
| | | } |
| | | } else if (cell.notNull) { |
| | | m.hidden = !val |
| | | } else { |
| | | m.hidden = !cell.values.includes(val) |
| | | } |
| | |
| | | } else { |
| | | appmenulist = [] |
| | | } |
| | | if (appType === 'mob' && hasMenus) { // 数据卡可打开即时通信 |
| | | appmenulist.push({ |
| | | value: 'IM', label: '即时通信(系统页)' |
| | | }) |
| | | } |
| | | } else { |
| | | menulist = sessionStorage.getItem('fstMenuList') |
| | | if (menulist) { |
| | |
| | | getWrapForms = () => { |
| | | const { card } = this.state |
| | | |
| | | return getWrapForm(card.wrap, card.subtype) |
| | | return getWrapForm(card.wrap, card.subtype, card.columns) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap, subtype, columns, id) { |
| | | export default function (wrap, subtype, columns = [], id = '') { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let MenuType = '' |
| | | let menu = fromJS(window.GLOB.customMenu).toJS() |
| | |
| | | ] |
| | | }, |
| | | { |
| | | type: subtype === 'propcard' ? 'select' : 'radio', |
| | | type: 'select', |
| | | field: 'selStyle', |
| | | label: '选中风格', |
| | | initval: wrap.selStyle || 'active', |
| | | tooltip: '存在边框时,边框会使用系统色。', |
| | | required: false, |
| | | options: subtype === 'propcard' ? [ |
| | | options: [ |
| | | {value: 'none', label: '无'}, |
| | | {value: 'active', label: '外阴影'}, |
| | | {value: 'backFont', label: '背景+文字'}, |
| | | {value: 'font', label: '文字'}, |
| | | ] : [ |
| | | {value: 'none', label: '无'}, |
| | | {value: 'active', label: '外阴影'}, |
| | | ...(subtype === 'datacard' && appType === 'mob' ? [{value: 'check', label: '勾选'}] : []) |
| | | ] |
| | | // forbid: subtype !== 'propcard' |
| | | }, |
| | |
| | | forbid: subtype !== 'propcard' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'controlField', |
| | | label: '禁用字段', |
| | | initval: wrap.controlField || '', |
| | | tooltip: '用于控制行数据是否可选择。', |
| | | required: false, |
| | | allowClear: true, |
| | | options: columns, |
| | | controlFields: [ |
| | | {field: 'controlVal', notNull: true}, |
| | | ], |
| | | forbid: subtype !== 'datacard' |
| | | }, |
| | | { |
| | | type: 'text', |
| | | field: 'controlVal', |
| | | label: '控制值', |
| | | initval: wrap.controlVal || '', |
| | | tooltip: '当字段值与控制值相等时,行数据会禁用,多个值用逗号分隔。', |
| | | required: false, |
| | | forbid: subtype !== 'datacard' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | |
| | | } |
| | | |
| | | getWrapForms = () => { |
| | | const { wrap, action } = this.state.card |
| | | const { wrap, action, columns } = this.state.card |
| | | |
| | | return getWrapForm(wrap, action) |
| | | return getWrapForm(wrap, action, columns) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap, action = []) { |
| | | export default function (wrap, action = [], columns = []) { |
| | | let roleList = sessionStorage.getItem('sysRoles') |
| | | let appType = sessionStorage.getItem('appType') |
| | | |
| | |
| | | {value: 'true', label: '是'}, |
| | | {value: 'false', label: '否'}, |
| | | ], |
| | | forbid: appType === 'mob' |
| | | forbid: appType === 'mob' || appType === 'pc' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | forbid: appType === 'mob' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'controlField', |
| | | label: '禁用字段', |
| | | initval: wrap.controlField || '', |
| | | tooltip: '用于控制行数据是否可选择。', |
| | | required: false, |
| | | allowClear: true, |
| | | options: columns, |
| | | controlFields: [ |
| | | {field: 'controlVal', notNull: true}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'text', |
| | | field: 'controlVal', |
| | | label: '控制值', |
| | | initval: wrap.controlVal || '', |
| | | tooltip: '当字段值与控制值相等时,行数据会禁用,多个值用逗号分隔。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'empty', |
| | | label: '空值隐藏', |
| | | initval: wrap.empty || 'show', |
| | | tooltip: '当查询数据为空时,隐藏该组件。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'show', label: '否'}, |
| | | {value: 'hidden', label: '是'}, |
| | | ], |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'select', |
| | | type: 'radio', |
| | | field: 'type', |
| | | label: '菜单属性', |
| | | initval: setting.type || 'menu', |
| | |
| | | options: [ |
| | | {value: 'menu', label: '菜单'}, |
| | | {value: 'linkmenu', label: '关联菜单'}, |
| | | {value: 'sysmenu', label: '系统页'}, |
| | | {value: 'link', label: '链接'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'sysmenu', values: ['sysmenu']}, |
| | | {field: 'copyMenuId', values: ['menu']}, |
| | | {field: 'linkMenuId', values: ['linkmenu']}, |
| | | {field: 'linkurl', values: ['link']}, |
| | |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'sysmenu', |
| | | label: '系统页面', |
| | | initval: setting.sysmenu || '', |
| | | required: true, |
| | | options: [ |
| | | {value: 'AIService', label: '智能客服'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'copyMenuId', |
| | | label: '复制菜单', |
| | | initval: setting.copyMenuId || '', |
| | | tooltip: '复制菜单仅在当前菜单初始化时有效。', |
| | | tooltip: '复制菜单仅在当前菜单创建时有效。', |
| | | required: false, |
| | | options: menulist |
| | | }, |
| | |
| | | label: '关联菜单', |
| | | initval: setting.linkMenuId || '', |
| | | required: true, |
| | | options: menulist |
| | | options: [ |
| | | ...menulist, |
| | | // {value: 'IM', label: '即时通信(系统页)'}, |
| | | {value: 'AIService', label: '智能客服(系统页)'} |
| | | ] |
| | | }, |
| | | { |
| | | type: 'textarea', |
| | |
| | | <Radio.Group onChange={this.changeProperty} className="over"> |
| | | <Radio value="menu">菜单</Radio> |
| | | <Radio value="linkmenu">关联菜单</Radio> |
| | | <Radio value="sysmenu">系统页</Radio> |
| | | <Radio value="link">链接</Radio> |
| | | </Radio.Group> |
| | | )} |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {property === 'sysmenu' ? <Col span={12}> |
| | | <Form.Item label="系统页面"> |
| | | {getFieldDecorator('sysmenu', { |
| | | initialValue: menu.sysmenu || '', |
| | | rules: [{ |
| | | required: true, |
| | | message: '请选择系统页面!' |
| | | }] |
| | | })( |
| | | <Select> |
| | | <Select.Option value="AIService">智能客服</Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {property === 'link' ? <Col span={24}> |
| | | <Form.Item label="链接地址" className="textarea"> |
| | | {getFieldDecorator('link', { |
| | |
| | | })( |
| | | <Select> |
| | | {appMenus.map(item => (<Select.Option key={item.MenuID} value={item.MenuID}>{item.MenuName}</Select.Option>))} |
| | | {/* <Select.Option key="IM" value="IM">即时通信(系统页)</Select.Option> */} |
| | | <Select.Option key="AIService" value="AIService">智能客服(系统页)</Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | |
| | | }) |
| | | } |
| | | |
| | | if (config.setting.controlField) { |
| | | if (config.setting.controlVal) { |
| | | config.setting.controlVal = config.setting.controlVal.split(',') |
| | | } else { |
| | | config.setting.controlVal = [''] |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | pageSize: config.setting.pageSize || 10, |
| | | loadingview: false, |
| | |
| | | item.$$BID = BID || '' |
| | | item.$Index = start + index + '' |
| | | |
| | | if (setting.controlField) { |
| | | if (setting.controlVal.includes(item[setting.controlField])) { |
| | | item.$disabled = true |
| | | } |
| | | } |
| | | |
| | | return item |
| | | }), |
| | | total: result.total, |
| | |
| | | <NormalButton |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={data.$disabled} |
| | | btn={card} |
| | | show={card.show} |
| | | style={card.style} |
| | |
| | | <ExcelInButton |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={data.$disabled} |
| | | btn={card} |
| | | show={card.show} |
| | | style={card.style} |
| | |
| | | <ExcelOutButton |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={data.$disabled} |
| | | btn={card} |
| | | show={card.show} |
| | | style={card.style} |
| | |
| | | <PopupButton |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={data.$disabled} |
| | | btn={card} |
| | | show={card.show} |
| | | style={card.style} |
| | |
| | | <Col key={card.uuid} className="mk-cell-btn" span={card.width}> |
| | | <TabButton |
| | | BData={data.$$BData || ''} |
| | | disabled={data.$disabled} |
| | | btn={card} |
| | | show={card.show} |
| | | style={card.style} |
| | |
| | | <Col key={card.uuid} className="mk-cell-btn" span={card.width}> |
| | | <NewPageButton |
| | | BData={data.$$BData || ''} |
| | | disabled={data.$disabled} |
| | | btn={card} |
| | | show={card.show} |
| | | style={card.style} |
| | |
| | | <ChangeUserButton |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={data.$disabled} |
| | | btn={card} |
| | | show={card.show} |
| | | style={card.style} |
| | |
| | | <PrintButton |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={data.$disabled} |
| | | btn={card} |
| | | show={card.show} |
| | | style={card.style} |
| | |
| | | let precards = [] |
| | | let nextcards = [] |
| | | |
| | | if (_config.wrap.controlField) { |
| | | if (_config.wrap.controlVal) { |
| | | _config.wrap.controlVal = _config.wrap.controlVal.split(',') |
| | | } else { |
| | | _config.wrap.controlVal = [''] |
| | | } |
| | | } |
| | | |
| | | _config.subcards.forEach(item => { |
| | | if (item.setting.click === 'button' && !item.setting.linkbtn) { |
| | | item.elements.forEach(ele => { |
| | |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = index + 1 + '' |
| | | |
| | | if (_config.wrap.controlField) { |
| | | if (_config.wrap.controlVal.includes(item[_config.wrap.controlField])) { |
| | | item.$disabled = true |
| | | } |
| | | } |
| | | return item |
| | | }) |
| | | |
| | |
| | | if (_config.wrap.supType === 'multi') { |
| | | supComs = _config.supNodes.map(item => item.componentId) |
| | | } |
| | | |
| | | _config.wrap.selStyle = _config.wrap.selStyle || 'active' |
| | | _config.wrap.scale = _config.wrap.scale === 'true' ? 'scale' : '' |
| | | |
| | | _config.wrap.wrapClass = `${_config.wrap.selStyle} ${_config.wrap.cardType || ''} ${_config.wrap.scale}` |
| | | |
| | | this.setState({ |
| | | supComs, |
| | |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = index + 1 + '' |
| | | |
| | | if (config.wrap.controlField) { |
| | | if (config.wrap.controlVal.includes(item[config.wrap.controlField])) { |
| | | item.$disabled = true |
| | | } |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | |
| | |
| | | checkTopLine = () => { |
| | | const { config, data } = this.state |
| | | |
| | | if (!data || data.length === 0) { |
| | | if (!data || data.length === 0 || data[0].$disabled) { |
| | | this.setState({ |
| | | activeKey: '', |
| | | selectKeys: [], |
| | |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = index + start + '' |
| | | |
| | | if (config.wrap.controlField) { |
| | | if (config.wrap.controlVal.includes(item[config.wrap.controlField])) { |
| | | item.$disabled = true |
| | | } |
| | | } |
| | | |
| | | return item |
| | | }), |
| | | total: result.total, |
| | |
| | | const { config, selectKeys, selectedData, activeKey, data } = this.state |
| | | |
| | | if (!config.wrap.cardType) return |
| | | if (item.$disabled) return |
| | | |
| | | let _selectKeys = [] |
| | | let _selectedData = [] |
| | |
| | | selectedData={selectedData} |
| | | /> : null |
| | | } |
| | | <div className={`data-zoom ${config.wrap.selStyle !== 'none' ? (config.wrap.cardType || '') : ''} ${config.wrap.scale || ''}`}> |
| | | <div className={`data-zoom ${config.wrap.wrapClass}`}> |
| | | {switchable ? <div className={'prev-page ' + (pageIndex === 1 ? 'disabled' : '')} onClick={this.prevPage}><div><div><img src={preImg} alt=""/></div></div></div> : null} |
| | | <Row className="card-row-list"> |
| | | {offset ? <Col span={offset} style={{height: '10px'}}> </Col> : null} |
| | |
| | | <CardItem card={item} cards={config} data={{$$BID: BID, $$BData: BData, $$selectedData: selectedData, $$type: 'extendCard'}}/> |
| | | </Col> |
| | | ))} |
| | | {data && data.map((item, index) => ( |
| | | <Col className={(config.wrap.selStyle !== 'none' ? (activeKey === index ? ' active' : (selectKeys.indexOf(index) > -1 ? ' selected' : '')) : '') + (card.setting.click ? ' pointer' : '')} key={index} span={card.setting.width} onClick={() => {this.changeCard(index, item)}}> |
| | | {data && data.map((item, index) => { |
| | | let className = card.setting.click ? 'mk-card pointer ' : 'mk-card ' |
| | | if (item.$disabled) { |
| | | className = 'mk-disabled' |
| | | } else if (activeKey === index) { |
| | | className += 'active' |
| | | } else if (selectKeys.indexOf(index) > -1) { |
| | | className += 'selected' |
| | | } |
| | | |
| | | return ( |
| | | <Col className={className} key={index} span={card.setting.width} onClick={() => {this.changeCard(index, item)}}> |
| | | <CardItem card={card} cards={config} data={item}/> |
| | | </Col> |
| | | ))} |
| | | ) |
| | | })} |
| | | {nextcards.map((item, index) => ( |
| | | <Col key={'next' + index} className="extend-card" span={item.setting.width || 6}> |
| | | <CardItem card={item} cards={config} data={{$$BID: BID, $$BData: BData, $$selectedData: selectedData, $$type: 'extendCard'}}/> |
| | |
| | | .data-zoom { |
| | | display: flex; |
| | | position: relative; |
| | | } |
| | | .data-zoom.radio, .data-zoom.checkbox { |
| | | .card-row-list { |
| | | >.ant-col:not(.active):not(.selected):not(.extend-card):hover { |
| | | .mk-disabled { |
| | | >.card-item-box { |
| | | border-color: #69c0ff!important; |
| | | box-shadow: 0 0 4px #69c0ff!important; |
| | | cursor: not-allowed; |
| | | color: #bcbcbc; |
| | | .ant-mk-text, .ant-mk-date, .anticon { |
| | | color: #bcbcbc!important; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .data-zoom.true { |
| | | .data-zoom.scale { |
| | | .card-row-list { |
| | | >.ant-col:not(.extend-card):hover { |
| | | .mk-card:hover { |
| | | >.card-item-box { |
| | | z-index: 1; |
| | | transform: scale(1.05); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .card-row-list { |
| | | flex: 10; |
| | | .mk-card.pointer { |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | .card-item-box { |
| | | position: relative; |
| | | background-color: #ffffff; |
| | | transition: all 0.3s; |
| | | background-position: center center; |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | } |
| | | .prev-page { |
| | | width: 20px; |
| | |
| | | content: ' '; |
| | | display: block; |
| | | clear: both; |
| | | } |
| | | .card-row-list { |
| | | flex: 10; |
| | | |
| | | .card-item-box { |
| | | position: relative; |
| | | background-color: #ffffff; |
| | | transition: all 0.3s; |
| | | } |
| | | >.pointer { |
| | | cursor: pointer; |
| | | } |
| | | >.active >.card-item-box { |
| | | border-color: #1890ff!important; |
| | | box-shadow: 0 0 4px #1890ff; |
| | | } |
| | | >.selected >.card-item-box { |
| | | border-color: #69c0ff!important; |
| | | box-shadow: 0 0 4px #69c0ff; |
| | | } |
| | | } |
| | | .card-item-box { |
| | | background-position: center center; |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | | } |
| | | |
| | | .ant-empty { |
| | |
| | | _config.subcards[0].offset = offset |
| | | } |
| | | |
| | | let selected = _config.wrap.selected || 'false' |
| | | |
| | | _config.wrap.selStyle = _config.wrap.selStyle || 'active' |
| | | _config.wrap.priKeyType = _config.wrap.priKeyType || 'static' |
| | | let selected = _config.wrap.selected || 'false' |
| | | _config.wrap.scale = _config.wrap.scale === 'true' ? 'scale' : '' |
| | | |
| | | _config.wrap.wrapClass = `${_config.wrap.selStyle} ${_config.wrap.cardType || ''} ${_config.wrap.scale || ''}` |
| | | |
| | | this.setState({ |
| | | selected, |
| | |
| | | </div> : null |
| | | } |
| | | <NormalHeader config={config}/> |
| | | <Row className={`card-row-list ${config.wrap.cardType || ''} ${config.wrap.scale || ''}`}> |
| | | {config.subcards.map((item, index) => ( |
| | | <Col className={(activeKey === index ? config.wrap.selStyle : '') + (item.setting.click ? ' pointer' : '')} key={index} span={item.setting.width || 6} offset={item.offset || 0} onClick={() => {this.changeCard(index, item)}}> |
| | | <Row className={`card-row-list data-zoom ${config.wrap.wrapClass}`}> |
| | | {config.subcards.map((item, index) => { |
| | | let className = item.setting.click ? 'mk-card pointer ' : 'mk-card ' |
| | | if (activeKey === index) { |
| | | className += 'active' |
| | | } |
| | | |
| | | return ( |
| | | <Col className={className} key={index} span={item.setting.width || 6} offset={item.offset || 0} onClick={() => {this.changeCard(index, item)}}> |
| | | <CardItem card={item} cards={config} data={data}/> |
| | | </Col> |
| | | ))} |
| | | ) |
| | | })} |
| | | </Row> |
| | | </div> |
| | | ) |
| | |
| | | } |
| | | |
| | | .card-row-list { |
| | | .card-item-box { |
| | | background-color: #ffffff; |
| | | transition: all 0.3s; |
| | | } |
| | | >.pointer { |
| | | .mk-card.pointer { |
| | | cursor: pointer; |
| | | } |
| | | >.active >.card-item-box { |
| | | border-color: #1890ff!important; |
| | | box-shadow: 0 0 4px #1890ff; |
| | | } |
| | | } |
| | | .card-row-list.radio, .card-row-list.checkbox { |
| | | >.ant-col:not(.active):not(.selected):hover { |
| | | >.card-item-box { |
| | | border-color: #69c0ff!important; |
| | | box-shadow: 0 0 4px #69c0ff!important; |
| | | } |
| | | } |
| | | } |
| | | .card-row-list.true { |
| | | >.ant-col:hover { |
| | | .card-row-list.scale { |
| | | .mk-card:hover { |
| | | >.card-item-box { |
| | | z-index: 1; |
| | | transform: scale(1.05); |
| | |
| | | |
| | | .card-item-box { |
| | | position: relative; |
| | | background-color: #ffffff; |
| | | background-position: center center; |
| | | background-repeat: no-repeat; |
| | | background-size: cover; |
| | |
| | | let { lineMarks, onDoubleClick, data, className, ...resProps } = this.props |
| | | let style = {} |
| | | |
| | | if (data && data.$disabled) { |
| | | className = className + ' mk-disabled ' |
| | | } |
| | | |
| | | if (lineMarks && lineMarks.length > 0) { |
| | | lineMarks.some(mark => { |
| | | let originVal = data[mark.field[0]] + '' |
| | |
| | | if (mark.fontColor) { |
| | | style.color = mark.fontColor |
| | | } |
| | | className += className + ' background' |
| | | className = className + ' background' |
| | | } else if (mark.signType[0] === 'underline') { |
| | | style.textDecoration = 'underline' |
| | | style.color = mark.color |
| | |
| | | resProps.rowSpan = record['$$' + col.field] |
| | | } |
| | | |
| | | if (col.linkThdMenu || col.linkurl) { |
| | | if (!record.$disabled && (col.linkThdMenu || col.linkurl)) { |
| | | content = ( |
| | | <div> |
| | | <div className="link-menu" onDoubleClick={(e) => triggerLink(e, col, record)}></div> |
| | |
| | | resProps.rowSpan = record['$$' + col.field] |
| | | } |
| | | |
| | | if (col.linkThdMenu || col.linkurl) { |
| | | if (!record.$disabled && (col.linkThdMenu || col.linkurl)) { |
| | | content = ( |
| | | <div> |
| | | <div className="link-menu" onDoubleClick={(e) => triggerLink(e, col, record)}></div> |
| | |
| | | const { MenuID, data, setting } = this.props |
| | | |
| | | if (MenuID !== menuId || !data || data.length === 0) return |
| | | if (data[0].$disabled) return |
| | | |
| | | this.changedata(0) |
| | | this.setState({ selectedRowKeys: [0], activeIndex: 0 }) |
| | |
| | | |
| | | this.setState({ selectedRowKeys, activeIndex: _activeIndex }) |
| | | |
| | | let selects = this.props.data.filter((item, _index) => selectedRowKeys.includes(_index)) |
| | | let selects = this.props.data.filter((item, _index) => selectedRowKeys.includes(_index) && !item.$disabled) |
| | | |
| | | this.props.chgSelectData(selects) |
| | | if (setting.$hasSyncModule) { |
| | |
| | | const { setting, MenuID, data } = this.props |
| | | |
| | | if (!setting.tableType || this.state.pickup) return |
| | | if (record.$disabled) return |
| | | |
| | | let newkeys = fromJS(this.state.selectedRowKeys).toJS() |
| | | |
| | |
| | | this.setState({ selectedRowKeys: newkeys, activeIndex: _index !== '' ? _index : null }) |
| | | } |
| | | |
| | | let selects = this.props.data.filter((item, _index) => newkeys.includes(_index)) |
| | | let selects = this.props.data.filter((item, _index) => newkeys.includes(_index) && !item.$disabled) |
| | | |
| | | this.props.chgSelectData(selects) |
| | | |
| | |
| | | _id = data[index][setting.primaryKey] || '' |
| | | _data = data[index] || '' |
| | | } |
| | | |
| | | if (_data && _data.$disabled) return |
| | | |
| | | MKEmitter.emit('resetSelectLine', MenuID, _id, _data) |
| | | } |
| | |
| | | const { setting } = this.props |
| | | |
| | | if (!setting.doubleClick) return |
| | | if (record.$disabled) return |
| | | |
| | | MKEmitter.emit('triggerBtnId', setting.doubleClick, [record]) |
| | | } |
| | |
| | | font-size: inherit; |
| | | } |
| | | |
| | | .mk-disabled { |
| | | color: #bcbcbc; |
| | | cursor: not-allowed; |
| | | .ant-btn { |
| | | cursor: not-allowed; |
| | | } |
| | | .ant-table-selection-column { |
| | | > span::after { |
| | | content: ' '; |
| | | display: block; |
| | | position: absolute; |
| | | top: 0; |
| | | bottom: 0; |
| | | left: 0; |
| | | right: 0; |
| | | z-index: 1; |
| | | } |
| | | } |
| | | .ant-checkbox-checked .ant-checkbox-inner { |
| | | background-color: #fff!important; |
| | | border-color: #d9d9d9!important; |
| | | } |
| | | } |
| | | |
| | | table { |
| | | max-width: 100%; |
| | | width: 100%; |
| | |
| | | _copy.sorter = false |
| | | |
| | | if (item.editable === 'true') { |
| | | _copy.title = <span>{item.label}<EditOutlined className="system-color" style={{position: 'absolute', bottom: 0, right: 0}}/></span> |
| | | _copy.title = <span>{item.label}<EditOutlined className="system-color" style={{position: 'absolute', bottom: '2px', right: '5px'}}/></span> |
| | | } |
| | | edColumns.push(_copy) |
| | | } |
| | |
| | | let _cols = new Map() |
| | | let _data = null |
| | | let _sync = _config.setting.sync === 'true' |
| | | |
| | | if (_config.wrap.controlField) { |
| | | if (_config.wrap.controlVal) { |
| | | _config.wrap.controlVal = _config.wrap.controlVal.split(',') |
| | | } else { |
| | | _config.wrap.controlVal = [''] |
| | | } |
| | | } |
| | | |
| | | let setting = {..._config.setting, ..._config.wrap, style: {}} |
| | | |
| | | if (setting.selected !== 'always' && setting.selected !== 'init') { |
| | |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = index + 1 + '' |
| | | |
| | | if (setting.controlField) { |
| | | if (setting.controlVal.includes(item[setting.controlField])) { |
| | | item.$disabled = true |
| | | } |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | |
| | |
| | | if (_config.wrap.collapse === 'true') { |
| | | _config.wrap.title = _config.wrap.title || ' ' |
| | | } |
| | | |
| | | _config.style = _config.style || {} |
| | | |
| | | this.setState({ |
| | | pageSize: setting.pageSize || 10, |
| | |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = start + index + '' |
| | | |
| | | if (setting.controlField) { |
| | | if (setting.controlVal.includes(item[setting.controlField])) { |
| | | item.$disabled = true |
| | | } |
| | | } |
| | | |
| | | return item |
| | | }), |
| | | selectedData: [], |
| | |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = index + 1 + '' |
| | | |
| | | if (setting.controlField) { |
| | | if (setting.controlVal.includes(item[setting.controlField])) { |
| | | item.$disabled = true |
| | | } |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { BID, setting, searchlist, actions, config, columns, selectedData, BData } = this.state |
| | | const { BID, setting, searchlist, actions, config, columns, selectedData, BData, data } = this.state |
| | | |
| | | let style = {...config.style} |
| | | if (config.wrap.empty === 'hidden' && (!data || data.length === 0)) { |
| | | style.display = 'none' |
| | | } |
| | | |
| | | return ( |
| | | <div className="custom-normal-table" style={config.style}> |
| | | <div className="custom-normal-table" style={style}> |
| | | {config.wrap.collapse === 'true' ? <Collapse bordered={false} defaultActiveKey="1" expandIconPosition="right"> |
| | | <Panel forceRender={true} header={<NormalHeader config={config}/>} key="1"> |
| | | {searchlist && searchlist.length ? |
| | |
| | | setting={setting} |
| | | columns={columns} |
| | | MenuID={config.uuid} |
| | | data={this.state.data} |
| | | data={data} |
| | | fields={config.columns} |
| | | total={this.state.total} |
| | | lineMarks={config.lineMarks} |
| | |
| | | type: "Modal", |
| | | setting: { |
| | | "title":"添加", |
| | | "width":60, |
| | | "width": 80, |
| | | "focus":"func", |
| | | "cols":"2", |
| | | "finish":"close", |
| | |
| | | type: "Modal", |
| | | setting: { |
| | | "title":"修改", |
| | | "width":60, |
| | | "width": 80, |
| | | "focus":"func", |
| | | "cols":"2", |
| | | "finish":"close", |
| | |
| | | config.setting.selected = 'false' |
| | | } |
| | | |
| | | if (config.setting.controlField) { |
| | | if (config.setting.controlVal) { |
| | | config.setting.controlVal = config.setting.controlVal.split(',') |
| | | } else { |
| | | config.setting.controlVal = [''] |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | pageSize: config.setting.pageSize || 10, |
| | | BID: this.props.BID || '', |
| | |
| | | item.$$BID = BID || '' |
| | | item.$Index = start + index + '' |
| | | |
| | | if (setting.controlField) { |
| | | if (setting.controlVal.includes(item[setting.controlField])) { |
| | | item.$disabled = true |
| | | } |
| | | } |
| | | |
| | | return item |
| | | }), |
| | | total: result.total, |
| | |
| | | config.setting.selected = 'false' |
| | | } |
| | | |
| | | if (config.setting.controlField) { |
| | | if (config.setting.controlVal) { |
| | | config.setting.controlVal = config.setting.controlVal.split(',') |
| | | } else { |
| | | config.setting.controlVal = [''] |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | pageSize: config.setting.pageSize || 10, |
| | | loadingview: false, |
| | |
| | | item.$$BID = BID || '' |
| | | item.$Index = start + index + '' |
| | | |
| | | if (setting.controlField) { |
| | | if (setting.controlVal.includes(item[setting.controlField])) { |
| | | item.$disabled = true |
| | | } |
| | | } |
| | | |
| | | return item |
| | | }), |
| | | total: result.total, |
| | |
| | | btn: PropTypes.object, // 按钮 |
| | | selectedData: PropTypes.any, // 子表中选择数据 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | } |
| | | |
| | | state = { |
| | |
| | | disabled = true |
| | | } |
| | | }) |
| | | this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) |
| | | this.setState({hidden: disabled && btn.control === 'hidden'}) |
| | | } else if (btn.control === 'parent') { |
| | | if (!BData || !BData.hasOwnProperty(btn.controlField)) { |
| | | this.setState({hidden: true}) |
| | |
| | | this.setState({hidden: false}) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (this.props.disabled || disabled) { |
| | | this.setState({disabled: true}) |
| | | } |
| | | } |
| | | |
| | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { btn, selectedData, BData } = this.props |
| | | |
| | | if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { |
| | | let disabled = false |
| | | |
| | | if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { |
| | | if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 表格中按钮隐藏控制 |
| | | nextProps.selectedData.forEach(item => { |
| | | let s = item[btn.controlField] + '' |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (nextProps.disabled || disabled) { |
| | | this.setState({disabled: true}) |
| | | } else { |
| | | this.setState({disabled: false}) |
| | | } |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | |
| | | Tab: PropTypes.any, // 如果当前元素为标签时,tab为标签信息 |
| | | btn: PropTypes.object, // 按钮 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | } |
| | | |
| | | state = { |
| | |
| | | disabled = true |
| | | } |
| | | }) |
| | | this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) |
| | | this.setState({hidden: disabled && btn.control === 'hidden'}) |
| | | } else if (btn.control === 'parent') { |
| | | if (!BData || !BData.hasOwnProperty(btn.controlField)) { |
| | | this.setState({hidden: true}) |
| | |
| | | this.setState({hidden: false}) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (this.props.disabled || disabled) { |
| | | this.setState({disabled: true}) |
| | | } |
| | | } |
| | | |
| | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { btn, selectedData, BData } = this.props |
| | | |
| | | if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { |
| | | let disabled = false |
| | | |
| | | if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { |
| | | if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 表格中按钮隐藏控制 |
| | | nextProps.selectedData.forEach(item => { |
| | | let s = item[btn.controlField] + '' |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (nextProps.disabled || disabled) { |
| | | this.setState({disabled: true}) |
| | | } else { |
| | | this.setState({disabled: false}) |
| | | } |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | |
| | | btn: PropTypes.object, // 按钮 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | updateStatus: PropTypes.func, // 按钮状态更新 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | } |
| | | |
| | | state = { |
| | |
| | | excelName: '', // 文件名 |
| | | search: '', // 搜索条件 |
| | | loading: false, // 导出中 |
| | | hidden: false |
| | | hidden: false, |
| | | disabled: false |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { btn, BData } = this.props |
| | | const { btn, BData, disabled } = this.props |
| | | |
| | | if (btn.control === 'parent') { |
| | | if (!BData || !BData.hasOwnProperty(btn.controlField)) { |
| | |
| | | this.setState({hidden: false}) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (disabled) { |
| | | this.setState({disabled: true}) |
| | | } |
| | | } |
| | | |
| | |
| | | this.setState({hidden: false}) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (nextProps.disabled) { |
| | | this.setState({disabled: true}) |
| | | } else { |
| | | this.setState({disabled: false}) |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | actionTrigger = (triggerId) => { |
| | | const { setting, Tab, BID, btn } = this.props |
| | | const { loading } = this.state |
| | | const { loading, disabled } = this.state |
| | | |
| | | if ((triggerId && btn.uuid !== triggerId) || loading) return |
| | | if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return |
| | | |
| | | if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { |
| | | notification.warning({ |
| | |
| | | |
| | | render() { |
| | | const { btn, show } = this.props |
| | | const { loading, hidden } = this.state |
| | | const { loading, hidden, disabled } = this.state |
| | | |
| | | if (hidden) return null |
| | | |
| | |
| | | <Button |
| | | className={'mk-btn mk-' + btn.class} |
| | | icon={btn.icon} |
| | | disabled={disabled} |
| | | onClick={(e) => {e.stopPropagation(); this.actionTrigger()}} |
| | | loading={loading} |
| | | >{btn.label}</Button> |
| | |
| | | type="link" |
| | | title={show === 'icon' ? btn.label : ''} |
| | | loading={loading} |
| | | disabled={disabled} |
| | | style={btn.style} |
| | | icon={icon} |
| | | onClick={(e) => {e.stopPropagation(); this.actionTrigger()}} |
| | |
| | | btn: PropTypes.object, // 按钮 |
| | | selectedData: PropTypes.any, // 子表中选择数据 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | } |
| | | |
| | | state = { |
| | |
| | | disabled = true |
| | | } |
| | | }) |
| | | this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) |
| | | this.setState({hidden: disabled && btn.control === 'hidden'}) |
| | | } else if (btn.control === 'parent') { |
| | | if (!BData || !BData.hasOwnProperty(btn.controlField)) { |
| | | this.setState({hidden: true}) |
| | |
| | | this.setState({hidden: false}) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (this.props.disabled || disabled) { |
| | | this.setState({disabled: true}) |
| | | } |
| | | } |
| | | |
| | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { btn, selectedData, BData } = this.props |
| | | |
| | | if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { |
| | | let disabled = false |
| | | |
| | | if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { |
| | | if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 表格中按钮隐藏控制 |
| | | nextProps.selectedData.forEach(item => { |
| | | let s = item[btn.controlField] + '' |
| | |
| | | } |
| | | }) |
| | | } |
| | | this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) |
| | | this.setState({hidden: disabled && btn.control === 'hidden'}) |
| | | } else if (btn.control === 'parent' && !is(fromJS(nextProps.BData || {}), fromJS(BData || {}))) { |
| | | if (!nextProps.BData || !nextProps.BData.hasOwnProperty(btn.controlField)) { |
| | | this.setState({hidden: true}) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (nextProps.disabled || disabled) { |
| | | this.setState({disabled: true}) |
| | | } else { |
| | | this.setState({disabled: false}) |
| | | } |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | |
| | | columns: PropTypes.any, // 字段列 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | ContainerId: PropTypes.any, // tab页面ID,用于弹窗控制 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | } |
| | | |
| | | state = { |
| | |
| | | disabled = true |
| | | } |
| | | }) |
| | | this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) |
| | | this.setState({hidden: disabled && btn.control === 'hidden'}) |
| | | } else if (btn.control === 'parent') { |
| | | if (!BData || !BData.hasOwnProperty(btn.controlField)) { |
| | | this.setState({hidden: true}) |
| | |
| | | this.setState({hidden: false}) |
| | | } |
| | | } |
| | | } |
| | | if (this.props.disabled || disabled) { |
| | | this.setState({disabled: true}) |
| | | } |
| | | } |
| | | |
| | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { btn, selectedData, BData } = this.props |
| | | |
| | | if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { |
| | | let disabled = false |
| | | |
| | | if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { |
| | | if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 表格中按钮隐藏控制 |
| | | nextProps.selectedData.forEach(item => { |
| | | let s = item[btn.controlField] + '' |
| | |
| | | } |
| | | }) |
| | | } |
| | | this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) |
| | | this.setState({hidden: disabled && btn.control === 'hidden'}) |
| | | } else if (btn.control === 'parent' && !is(fromJS(nextProps.BData || {}), fromJS(BData || {}))) { |
| | | if (!nextProps.BData || !nextProps.BData.hasOwnProperty(btn.controlField)) { |
| | | this.setState({hidden: true}) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (nextProps.disabled || disabled) { |
| | | this.setState({disabled: true}) |
| | | } else { |
| | | this.setState({disabled: false}) |
| | | } |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | |
| | | MenuID: PropTypes.string, // 菜单ID |
| | | btn: PropTypes.object, // 按钮 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | } |
| | | |
| | | state = { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (this.props.disabled || disabled) { |
| | | this.setState({disabled: true}) |
| | | } |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { btn, selectedData, BData } = this.props |
| | | |
| | | if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { |
| | | let disabled = false |
| | | |
| | | if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { |
| | | if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 表格中按钮隐藏控制 |
| | | nextProps.selectedData.forEach(item => { |
| | | let s = item[btn.controlField] + '' |
| | |
| | | } |
| | | }) |
| | | } |
| | | this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) |
| | | this.setState({hidden: disabled && btn.control === 'hidden'}) |
| | | } else if (btn.control === 'parent' && !is(fromJS(nextProps.BData || {}), fromJS(BData || {}))) { |
| | | if (!nextProps.BData || !nextProps.BData.hasOwnProperty(btn.controlField)) { |
| | | this.setState({hidden: true}) |
| | |
| | | this.setState({hidden: false}) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (nextProps.disabled || disabled) { |
| | | this.setState({disabled: true}) |
| | | } else { |
| | | this.setState({disabled: false}) |
| | | } |
| | | } |
| | | |
| | |
| | | return ( |
| | | <Drawer |
| | | title={btn.label} |
| | | className={btn.$view === 'CustomPage' ? 'custom-drawer-popview' : ''} |
| | | className={btn.$view === 'CustomPage' ? 'custom-drawer-popview' : 'table-drawer-popview'} |
| | | width={width} |
| | | height={height} |
| | | maskClosable={btn.clickouter === 'close'} |
| | |
| | | } |
| | | } |
| | | } |
| | | .table-drawer-popview { |
| | | .close-drawer { |
| | | position: absolute; |
| | | z-index: 3; |
| | | right: 0; |
| | | bottom: 0; |
| | | width: 100%; |
| | | padding: 8px 16px; |
| | | background: #fff; |
| | | text-align: right; |
| | | box-shadow: 0 0 3px #cbcbcb; |
| | | } |
| | | } |
| | | .custom-drawer-popview { |
| | | .ant-drawer-content { |
| | | .ant-drawer-header { |
| | |
| | | btn: PropTypes.object, // 按钮 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | ContainerId: PropTypes.any, // tab页面ID,用于弹窗控制 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | } |
| | | |
| | | state = { |
| | |
| | | disabled = true |
| | | } |
| | | }) |
| | | this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) |
| | | this.setState({hidden: disabled && btn.control === 'hidden'}) |
| | | } else if (btn.control === 'parent') { |
| | | if (!BData || !BData.hasOwnProperty(btn.controlField)) { |
| | | this.setState({hidden: true}) |
| | |
| | | this.setState({hidden: false}) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (this.props.disabled || disabled) { |
| | | this.setState({disabled: true}) |
| | | } |
| | | } |
| | | |
| | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { btn, selectedData, BData } = this.props |
| | | |
| | | if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { |
| | | let disabled = false |
| | | |
| | | if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { |
| | | if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 表格中按钮隐藏控制 |
| | | nextProps.selectedData.forEach(item => { |
| | | let s = item[btn.controlField] + '' |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (nextProps.disabled || disabled) { |
| | | this.setState({disabled: true}) |
| | | } else { |
| | | this.setState({disabled: false}) |
| | | } |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | |
| | | btn: PropTypes.object, // 按钮 |
| | | selectedData: PropTypes.any, // 子表中选择数据 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | } |
| | | |
| | | state = { |
| | |
| | | disabled = true |
| | | } |
| | | }) |
| | | this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) |
| | | this.setState({hidden: disabled && btn.control === 'hidden'}) |
| | | } else if (btn.control === 'parent') { |
| | | if (!BData || !BData.hasOwnProperty(btn.controlField)) { |
| | | this.setState({hidden: true}) |
| | |
| | | this.setState({hidden: false}) |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (this.props.disabled || disabled) { |
| | | this.setState({disabled: true}) |
| | | } |
| | | } |
| | | |
| | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { btn, selectedData, BData } = this.props |
| | | |
| | | if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { |
| | | let disabled = false |
| | | |
| | | if (btn.controlField && !is(fromJS(nextProps.selectedData || []), fromJS(selectedData || []))) { |
| | | if (nextProps.selectedData && nextProps.selectedData.length > 0) { // 表格中按钮隐藏控制 |
| | | nextProps.selectedData.forEach(item => { |
| | | let s = item[btn.controlField] + '' |
| | |
| | | } |
| | | }) |
| | | } |
| | | this.setState({disabled, hidden: disabled && btn.control === 'hidden'}) |
| | | this.setState({hidden: disabled && btn.control === 'hidden'}) |
| | | } else if (btn.control === 'parent' && !is(fromJS(nextProps.BData || {}), fromJS(BData || {}))) { |
| | | if (!nextProps.BData || !nextProps.BData.hasOwnProperty(btn.controlField)) { |
| | | this.setState({hidden: true}) |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (nextProps.disabled || disabled) { |
| | | this.setState({disabled: true}) |
| | | } else { |
| | | this.setState({disabled: false}) |
| | | } |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | |
| | | |
| | | if (!this.state.running || MenuID !== config.MenuID) return |
| | | |
| | | if (data.$disabled) { |
| | | this.setState({line: this.state.line + 1}, () => { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('autoQueryData', config.MenuID, this.state.line) |
| | | }, 100) |
| | | }) |
| | | return |
| | | } |
| | | |
| | | setTimeout(() => { |
| | | MKEmitter.emit('triggerBtnId', autoMatic.action, [data], 'autoMatic') |
| | | if (['prompt', 'pop'].includes(autoMatic.OpenType)) { |
| | |
| | | if (id !== this.props.MenuID) return |
| | | |
| | | if (this.props.data.length > 0) { |
| | | this.changeRow(null, 0) |
| | | this.changeRow(this.props.data[0], 0) |
| | | } |
| | | } |
| | | |
| | |
| | | let i = index - (pageIndex - 1) * pageSize - 1 |
| | | |
| | | if (this.props.data[i]) { |
| | | this.changeRow(null, i) |
| | | this.changeRow(this.props.data[i], i) |
| | | MKEmitter.emit('autoTransSelectData', this.props.MenuID, this.props.data[i]) |
| | | } else { |
| | | MKEmitter.emit('autoMaticOver', this.props.MenuID) |
| | |
| | | content = md5(content) |
| | | } |
| | | |
| | | if (item.linkThdMenu || item.linkurl) { |
| | | if (!record.$disabled && (item.linkThdMenu || item.linkurl)) { |
| | | if (item.rowspan === 'true') { |
| | | return { |
| | | children: ( |
| | |
| | | content = md5(content) |
| | | } |
| | | |
| | | if (item.linkThdMenu || item.linkurl) { |
| | | if (!record.$disabled && (item.linkThdMenu || item.linkurl)) { |
| | | if (item.rowspan === 'true') { |
| | | return { |
| | | children: ( |
| | |
| | | key={btn.uuid} |
| | | btn={btn} |
| | | BID={record.$$BID} |
| | | disabled={record.$disabled} |
| | | selectedData={[record]} |
| | | BData={this.props.BData} |
| | | setting={this.props.setting} |
| | |
| | | key={btn.uuid} |
| | | btn={btn} |
| | | BID={record.$$BID} |
| | | disabled={record.$disabled} |
| | | selectedData={[record]} |
| | | BData={this.props.BData} |
| | | setting={this.props.setting} |
| | |
| | | <TabButton |
| | | key={btn.uuid} |
| | | btn={btn} |
| | | disabled={record.$disabled} |
| | | selectedData={[record]} |
| | | BData={this.props.BData} |
| | | MenuID={this.props.MenuID} |
| | |
| | | <NewPageButton |
| | | key={btn.uuid} |
| | | btn={btn} |
| | | disabled={record.$disabled} |
| | | selectedData={[record]} |
| | | BData={this.props.BData} |
| | | setting={this.props.setting} |
| | |
| | | |
| | | this.setState({ selectedRowKeys, activeIndex: _activeIndex }) |
| | | |
| | | let selects = this.props.data.filter((item, _index) => selectedRowKeys.includes(_index)) |
| | | let selects = this.props.data.filter((item, _index) => selectedRowKeys.includes(_index) && !item.$disabled) |
| | | |
| | | this.props.chgSelectData(selects) |
| | | } |
| | |
| | | */ |
| | | changeRow = (record, index) => { |
| | | if (!this.props.setting.tableType || this.props.pickup) return |
| | | if (record.$disabled) return |
| | | |
| | | let newkeys = fromJS(this.state.selectedRowKeys).toJS() |
| | | |
| | |
| | | const { setting } = this.props |
| | | |
| | | if (!setting.doubleClick) return |
| | | if (record.$disabled) return |
| | | |
| | | MKEmitter.emit('triggerBtnId', setting.doubleClick, [record]) |
| | | } |
| | |
| | | dataSource={_data} |
| | | rowClassName={(record) => { |
| | | let className = '' |
| | | if ((setting.tableType === 'checkbox' || setting.tableType === 'radio') && record.key === activeIndex) { |
| | | if (record.$disabled) { |
| | | className = 'mk-disabled ' |
| | | } else if ((setting.tableType === 'checkbox' || setting.tableType === 'radio') && record.key === activeIndex) { |
| | | className = 'mk-row-active ' |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | .mk-disabled { |
| | | color: #bcbcbc; |
| | | cursor: not-allowed; |
| | | .ant-btn { |
| | | cursor: not-allowed; |
| | | } |
| | | .ant-table-selection-column { |
| | | > span::after { |
| | | content: ' '; |
| | | display: block; |
| | | position: absolute; |
| | | top: 0; |
| | | bottom: 0; |
| | | left: 0; |
| | | right: 0; |
| | | z-index: 1; |
| | | } |
| | | } |
| | | .ant-checkbox-checked .ant-checkbox-inner { |
| | | background-color: #fff!important; |
| | | border-color: #d9d9d9!important; |
| | | } |
| | | } |
| | | |
| | | table { |
| | | max-width: 100%; |
| | | width: 100%; |
| | |
| | | }) |
| | | } |
| | | |
| | | // 按钮不存在时,去掉绑定的双击按钮 |
| | | if (_config.setting.doubleClick && _config.action.findIndex((item) => item.uuid === _config.setting.doubleClick) === -1) { |
| | | _config.setting.doubleClick = '' |
| | | } |
| | | |
| | | // 未设置数据源或标签不合法时,启用状态为false |
| | | let vresult = this.verifyconfig(_config) |
| | | if (vresult !== true) { |
| | |
| | | interType: 'system', |
| | | procMode: 'script', |
| | | requestMode: 'system', |
| | | controlField: '', |
| | | tableType: '', |
| | | funcTooltip: '', |
| | | funcRules: [] |
| | |
| | | interType: setting.interType || 'system', |
| | | procMode: setting.procMode || 'script', |
| | | requestMode: setting.requestMode || 'system', |
| | | controlField: setting.controlField || '', |
| | | tableType: setting.tableType, |
| | | funcTooltip: tooltip, |
| | | funcRules: rules |
| | |
| | | render() { |
| | | const { setting, dict, menu, config, columns } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { interType, funcRules, funcTooltip, procMode, requestMode, tableType } = this.state |
| | | const { interType, funcRules, funcTooltip, procMode, requestMode, tableType, controlField } = this.state |
| | | |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | })(<InputNumber min={12} max={50} precision={0}/>)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="用于控制行数据是否可选择。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 禁用字段 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('controlField', { |
| | | initialValue: setting.controlField || '' |
| | | })( |
| | | <Select allowClear onChange={(val) => this.setState({controlField: val})}> |
| | | {columns.map((option, i) => |
| | | <Select.Option key={i} value={option.value}> |
| | | {option.text} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {controlField ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="当字段值与控制值相等时,行数据会禁用,多个值用逗号分隔。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 控制值 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('controlVal', { |
| | | initialValue: setting.controlVal || '' |
| | | })(<Input autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | </Row> |
| | | </Form> |
| | | </div> |
| | |
| | | } |
| | | } |
| | | |
| | | if (_config.setting.doubleClick && _config.action.findIndex((item) => item.uuid === _config.setting.doubleClick) === -1) { |
| | | _config.setting.doubleClick = '' |
| | | } |
| | | |
| | | // 未设置数据源或主键时,启用状态为false |
| | | let result = this.verifyconfig(_config) |
| | | |
| | |
| | | error = `组件《${item.name}》坐标轴尚未设置!` |
| | | } else if (item.type === 'tree' && (!item.wrap.valueField || !item.wrap.labelField || !item.wrap.parentField)) { |
| | | error = `组件《${item.name}》基本信息尚未设置!` |
| | | } else if (item.type === 'table' && item.wrap.doubleClick) { |
| | | if (item.action.findIndex((m) => m.uuid === item.wrap.doubleClick) === -1) { |
| | | error = `组件《${item.name}》绑定的双击按钮已删除!` |
| | | } |
| | | } |
| | | }) |
| | | } |
| | |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (['AIService'].includes(menu.MenuID)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '系统页面不可编辑!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let param = { |
| | |
| | | error = `组件《${item.name}》坐标轴尚未设置!` |
| | | } else if (item.type === 'tree' && (!item.wrap.valueField || !item.wrap.labelField || !item.wrap.parentField)) { |
| | | error = `组件《${item.name}》基本信息尚未设置!` |
| | | } else if (item.type === 'table' && item.wrap.doubleClick) { |
| | | if (item.action.findIndex((m) => m.uuid === item.wrap.doubleClick) === -1) { |
| | | error = `组件《${item.name}》绑定的双击按钮已删除!` |
| | | } |
| | | } |
| | | }) |
| | | } |