| | |
| | | 'header.form.initval': 'Initial Value', |
| | | 'header.form.decimal': '小数位', |
| | | 'header.form.format': '格式化', |
| | | 'header.form.thdSeparator': '千分位', |
| | | 'header.form.prefix': '前缀', |
| | | 'header.form.postfix': '后缀', |
| | | 'header.form.isRequired': '行设置', |
| | |
| | | 'header.form.initval': '初始值', |
| | | 'header.form.decimal': '小数位', |
| | | 'header.form.format': '格式化', |
| | | 'header.form.thdSeparator': '千分位', |
| | | 'header.form.prefix': '前缀', |
| | | 'header.form.postfix': '后缀', |
| | | 'header.form.isRequired': '行设置', |
| | |
| | | |
| | | let btnElement = null |
| | | let _style = resetStyle(card.style) |
| | | |
| | | if (card.OpenType === 'form') { |
| | | if (card.formType === 'switch') { |
| | | btnElement = (<Switch style={_style} size={card.size} checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''}/>) |
| | |
| | | </div> |
| | | } trigger="hover"> |
| | | <div ref={node => drag(drop(node))} className={'ant-col card-button-cell ant-col-' + card.width} onDoubleClick={(e) => {e.stopPropagation(); doubleClickCard(id)}}> |
| | | <div style={{opacity: isDragging ? 0 : 1}}> |
| | | <div style={{opacity: isDragging ? 0 : 1, ...card.wrapStyle}}> |
| | | {btnElement} |
| | | </div> |
| | | </div> |
| | |
| | | item.label = '值' |
| | | } else if (item.key === 'format') { |
| | | if (card.eleType === 'text') { |
| | | item.options = item.oriOptions.filter(op => op.value !== 'percent' && op.value !== 'thdSeparator') |
| | | item.options = item.oriOptions.filter(op => !['percent', 'thdSeparator', 'abs'].includes(op.value)) |
| | | } else if (card.eleType === 'number') { |
| | | item.options = item.oriOptions.filter(op => !op.value || op.value === 'percent' || op.value === 'thdSeparator') |
| | | item.options = item.oriOptions.filter(op => !op.value || ['percent', 'thdSeparator', 'abs'].includes(op.value)) |
| | | } |
| | | } else if (item.key === 'url') { |
| | | item.required = card.eleType !== 'qrcode' |
| | |
| | | } |
| | | } else if (item.key === 'format') { |
| | | if (value === 'text') { |
| | | item.options = item.oriOptions.filter(op => op.value !== 'percent' && op.value !== 'thdSeparator') |
| | | item.options = item.oriOptions.filter(op => !['percent', 'thdSeparator', 'abs'].includes(op.value)) |
| | | } else if (value === 'number') { |
| | | item.options = item.oriOptions.filter(op => !op.value || op.value === 'percent' || op.value === 'thdSeparator') |
| | | item.options = item.oriOptions.filter(op => !op.value || ['percent', 'thdSeparator', 'abs'].includes(op.value)) |
| | | } |
| | | } else if (item.key === 'url') { |
| | | item.required = value !== 'qrcode' |
| | |
| | | { value: '', text: '无' }, |
| | | { value: 'percent', text: '百分数' }, |
| | | { value: 'thdSeparator', text: '千分位' }, |
| | | { value: 'abs', text: '绝对值' }, |
| | | { value: 'YYYY-MM-DD', text: 'YYYY-MM-DD' }, |
| | | { value: 'MM月DD日', text: 'MM月DD日' }, |
| | | { value: 'YYYY年MM月DD日', text: 'YYYY年MM月DD日' }, |
| | |
| | | } else { |
| | | options.push('width', 'float') |
| | | } |
| | | if (element.wrapStyle) { |
| | | _style.float = element.wrapStyle.textAlign || 'left' |
| | | } |
| | | } else if (element.eleType === 'picture') { |
| | | options = ['border', 'margin'] |
| | | } else if (element.eleType === 'slider') { |
| | |
| | | |
| | | _card.innerHeight = _card.barHeight + (_card.displayValue === 'true' ? fontSize + 2 : 0) |
| | | } else if (_card.eleType === 'button') { // 拆分style |
| | | _card.style = style |
| | | _card.style = fromJS(style).toJS() |
| | | |
| | | if (style.float) { |
| | | _card.wrapStyle = {textAlign: style.float} |
| | | delete _card.style.float |
| | | } |
| | | } else { |
| | | _card.style = style |
| | | } |
| | |
| | | } |
| | | } |
| | | .card-cell:hover, .card-button-cell:hover { |
| | | box-shadow: 0px 0px 1px #1890ff; |
| | | box-shadow: 0px 0px 2px #1890ff; |
| | | } |
| | | } |
| | |
| | | text: Formdict['model.empty'] |
| | | }, { |
| | | value: 'thdSeparator', |
| | | text: Formdict['header.form.thdSeparator'] |
| | | text: '千分位' |
| | | }, { |
| | | value: 'percent', |
| | | text: '百分比' |
| | | }, { |
| | | value: 'abs', |
| | | text: '绝对值' |
| | | }], |
| | | required: false |
| | | }, |
| | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('submitStyle', this.getStyle) |
| | | MKEmitter.addListener('submitModal', this.handleSave) |
| | | MKEmitter.addListener('completeSave', this.completeSave) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | } |
| | | MKEmitter.removeListener('submitStyle', this.getStyle) |
| | | MKEmitter.removeListener('submitModal', this.handleSave) |
| | | MKEmitter.removeListener('completeSave', this.completeSave) |
| | | } |
| | | |
| | | completeSave = () => { |
| | | const { card } = this.state |
| | | |
| | | if (card.isNew) { |
| | | let item = fromJS(card).toJS() |
| | | item.cols = item.cols.filter(a => !a.origin) |
| | | |
| | | delete item.isNew |
| | | |
| | | this.setState({card: item}) |
| | | } |
| | | } |
| | | |
| | | filterOrigin = (component) => { |
| | |
| | | text: Formdict['model.empty'] |
| | | }, { |
| | | value: 'thdSeparator', |
| | | text: Formdict['header.form.thdSeparator'] |
| | | text: '千分位' |
| | | }, { |
| | | value: 'percent', |
| | | text: '百分比' |
| | | }, { |
| | | value: 'abs', |
| | | text: '绝对值' |
| | | }], |
| | | required: false |
| | | }, |
| | |
| | | MKEmitter.addListener('submitStyle', this.getStyle) |
| | | MKEmitter.addListener('submitModal', this.handleSave) |
| | | MKEmitter.addListener('logButton', this.logButton) |
| | | MKEmitter.addListener('completeSave', this.completeSave) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | MKEmitter.removeListener('submitStyle', this.getStyle) |
| | | MKEmitter.removeListener('submitModal', this.handleSave) |
| | | MKEmitter.removeListener('logButton', this.logButton) |
| | | MKEmitter.removeListener('completeSave', this.completeSave) |
| | | } |
| | | |
| | | completeSave = () => { |
| | | const { card } = this.state |
| | | |
| | | if (card.isNew) { |
| | | let item = fromJS(card).toJS() |
| | | item.search = item.search.filter(a => !a.origin) |
| | | item.action = item.action.filter(a => !a.origin) |
| | | item.cols = item.cols.filter(a => !a.origin) |
| | | |
| | | delete item.isNew |
| | | |
| | | this.setState({card: item}, () => { MKEmitter.emit('revert') }) |
| | | } |
| | | } |
| | | |
| | | loopCol = (col) => { |
| | |
| | | } |
| | | |
| | | getWrapForms = () => { |
| | | const { wrap, action, columns } = this.state.card |
| | | const { wrap, action, columns, cols } = this.state.card |
| | | |
| | | return getWrapForm(wrap, action, columns) |
| | | let _actions = [...action] |
| | | |
| | | cols.forEach(col => { |
| | | if (col.type !== 'action') return |
| | | _actions.push(...col.elements) |
| | | }) |
| | | |
| | | return getWrapForm(wrap, _actions, columns) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | |
| | | ArrowDownOutlined, |
| | | ArrowLeftOutlined, |
| | | ArrowRightOutlined, |
| | | SwapOutlined, |
| | | } from '@ant-design/icons' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <StyleInput defaultValue={''} options={['px', 'vh', 'vw']} onChange={(val) => this.changeNormalStyle(val, 'paddingRight')}/> |
| | | </Form.Item> |
| | | </Col> |
| | | </Panel> : null} |
| | | {options.includes('float') ? <Panel header="浮动" key="float"> |
| | | <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<SwapOutlined title="浮动"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <Radio.Group defaultValue={''} onChange={(e) => this.changeNormalStyle(e.target.value, 'float')}> |
| | | <Radio value="left">左浮动</Radio> |
| | | <Radio value="right">右浮动</Radio> |
| | | <Radio value="none">不浮动</Radio> |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> |
| | | </Panel> : null} |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | </Panel> : null} |
| | | {options.includes('float') ? <Panel header="浮动" key="float"> |
| | | {options.includes('float') ? <Panel header="对齐方式" key="float"> |
| | | <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<SwapOutlined title="浮动"/>} |
| | | label={<SwapOutlined title="对齐"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} defaultValue={card.float || 'left'} onChange={(e) => this.changeNormalStyle(e.target.value, 'float')}> |
| | | <Radio value="left">左浮动</Radio> |
| | | <Radio value="right">右浮动</Radio> |
| | | <Radio value="none">不浮动</Radio> |
| | | <Radio value="left">左</Radio> |
| | | <Radio value="center">居中</Radio> |
| | | <Radio value="right">右</Radio> |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | |
| | | item.key = index |
| | | item.$$uuid = item[setting.primaryKey] || '' |
| | | item.$$key = '' + item.key + item.$$uuid |
| | | item.$$BID = BID || '' |
| | | item.$Index = start + index + '' |
| | | |
| | |
| | | data = data.map(item => { |
| | | if (item.$$uuid === _data.$$uuid) { |
| | | _data.key = item.key |
| | | _data.$$key = '' + item.key + item.$$uuid |
| | | _data.$Index = item.$Index |
| | | return _data |
| | | } else { |
| | |
| | | val = data[card.field] |
| | | } |
| | | |
| | | if (val !== '' && typeof(val) === 'number') { |
| | | if (typeof(val) === 'number') { |
| | | if (card.format === 'percent') { |
| | | val = val * 100 |
| | | } else if (card.format === 'abs') { |
| | | val = Math.abs(val) |
| | | } |
| | | |
| | | if (card.col && card.col.type === 'number') { |
| | |
| | | |
| | | if (['exec', 'prompt', 'pop', 'form'].includes(card.OpenType)) { |
| | | return ( |
| | | <Col key={card.uuid} className="mk-cell-btn" span={card.width}> |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <NormalButton |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={data.$disabled} |
| | | lineId={data.$$key || ''} |
| | | btn={card} |
| | | show={card.show} |
| | | style={card.style} |
| | |
| | | ) |
| | | } else if (card.OpenType === 'excelIn') { |
| | | return ( |
| | | <Col key={card.uuid} className="mk-cell-btn" span={card.width}> |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <ExcelInButton |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={data.$disabled} |
| | | lineId={data.$$key || ''} |
| | | btn={card} |
| | | show={card.show} |
| | | style={card.style} |
| | |
| | | ) |
| | | } else if (card.OpenType === 'excelOut') { |
| | | return ( |
| | | <Col key={card.uuid} className="mk-cell-btn" span={card.width}> |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <ExcelOutButton |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | lineId={data.$$key || ''} |
| | | disabled={data.$disabled} |
| | | btn={card} |
| | | show={card.show} |
| | |
| | | ) |
| | | } else if (card.OpenType === 'popview') { |
| | | return ( |
| | | <Col key={card.uuid} className="mk-cell-btn" span={card.width}> |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <PopupButton |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={data.$disabled} |
| | | lineId={data.$$key || ''} |
| | | btn={card} |
| | | show={card.show} |
| | | style={card.style} |
| | |
| | | ) |
| | | } else if (card.OpenType === 'tab') { |
| | | return ( |
| | | <Col key={card.uuid} className="mk-cell-btn" span={card.width}> |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <TabButton |
| | | BData={data.$$BData || ''} |
| | | disabled={data.$disabled} |
| | | lineId={data.$$key || ''} |
| | | btn={card} |
| | | show={card.show} |
| | | style={card.style} |
| | |
| | | ) |
| | | } else if (card.OpenType === 'innerpage') { |
| | | return ( |
| | | <Col key={card.uuid} className="mk-cell-btn" span={card.width}> |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <NewPageButton |
| | | BData={data.$$BData || ''} |
| | | disabled={data.$disabled} |
| | | lineId={data.$$key || ''} |
| | | btn={card} |
| | | show={card.show} |
| | | style={card.style} |
| | |
| | | } else if (card.OpenType === 'funcbutton') { |
| | | if (card.funcType === 'changeuser' || card.funcType === 'closetab') { |
| | | return ( |
| | | <Col key={card.uuid} className="mk-cell-btn" span={card.width}> |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <ChangeUserButton |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={data.$disabled} |
| | | lineId={data.$$key || ''} |
| | | btn={card} |
| | | show={card.show} |
| | | style={card.style} |
| | |
| | | ) |
| | | } else if (card.funcType === 'print') { |
| | | return ( |
| | | <Col key={card.uuid} className="mk-cell-btn" span={card.width}> |
| | | <Col key={card.uuid} className="mk-cell-btn" style={card.wrapStyle} span={card.width}> |
| | | <PrintButton |
| | | BID={data.$$BID} |
| | | BData={data.$$BData || ''} |
| | | disabled={data.$disabled} |
| | | lineId={data.$$key || ''} |
| | | btn={card} |
| | | show={card.show} |
| | | style={card.style} |
| | |
| | | if (col.format === 'percent') { |
| | | content = content * 100 |
| | | decimal = decimal > 2 ? decimal - 2 : 0 |
| | | } else if (col.format === 'abs') { |
| | | content = Math.abs(content) |
| | | } |
| | | |
| | | content = content.toFixed(decimal) |
| | |
| | | if (col.format === 'percent') { |
| | | content = content * 100 |
| | | decimal = decimal > 2 ? decimal - 2 : 0 |
| | | } else if (col.format === 'abs') { |
| | | content = Math.abs(content) |
| | | } |
| | | |
| | | content = content.toFixed(decimal) |
| | |
| | | _data = _data.map((item, index) => { |
| | | item.key = index |
| | | item.$$uuid = item[_config.setting.primaryKey] || '' |
| | | item.$$key = '' + item.key + item.$$uuid |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = index + 1 + '' |
| | |
| | | data: result.data.map((item, index) => { |
| | | item.key = index |
| | | item.$$uuid = item[setting.primaryKey] || '' |
| | | item.$$key = '' + item.key + item.$$uuid |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = start + index + '' |
| | |
| | | data = data.map(item => { |
| | | if (item.$$uuid === _data.$$uuid) { |
| | | _data.key = item.key |
| | | _data.$$key = '' + item.key + item.$$uuid |
| | | _data.$Index = item.$Index |
| | | return _data |
| | | } else { |
| | |
| | | _data = _data.map((item, index) => { |
| | | item.key = index |
| | | item.$$uuid = item[config.setting.primaryKey] || '' |
| | | item.$$key = '' + item.key + item.$$uuid |
| | | item.$$BID = BID || '' |
| | | item.$$BData = BData || '' |
| | | item.$Index = index + 1 + '' |
| | |
| | | treeNodes: null, // 列表数据集 |
| | | expandedKeys: [], // 展开的树节点 |
| | | selectedKeys: [], // 选中的树节点 |
| | | selected: false // 选中首行 |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | _config.wrap.contentHeight = config.wrap.title || config.wrap.searchable === 'true' ? 'calc(100% - 45px)' : '100%' |
| | | |
| | | this.setState({ |
| | | selected: _config.wrap.selected === 'true', |
| | | config: _config, |
| | | data: _data, |
| | | BID: BID || '', |
| | |
| | | sync: _sync |
| | | }, () => { |
| | | if (config.setting.sync !== 'true' && config.setting.onload === 'true') { |
| | | this.loadData(null, 'init') |
| | | this.loadData(null) |
| | | } else if (config.setting.sync === 'true' && _data) { |
| | | this.handleData('init') |
| | | this.handleData() |
| | | } |
| | | }) |
| | | } |
| | |
| | | } |
| | | |
| | | this.setState({sync: false, data: _data}, () => { |
| | | this.handleData('init') |
| | | this.handleData() |
| | | }) |
| | | } else if (config.setting.syncRefresh && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | |
| | | /** |
| | | * @description 数据加载 |
| | | */ |
| | | async loadData (hastimer, type) { |
| | | async loadData (hastimer) { |
| | | const { mainSearch, menuType } = this.props |
| | | const { config, arr_field, BID } = this.state |
| | | |
| | |
| | | data: result.data, |
| | | loading: false |
| | | }, () => { |
| | | this.handleData(type) |
| | | this.handleData() |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | |
| | | } |
| | | } |
| | | |
| | | handleData = (type) => { |
| | | const { data, searchkey, config } = this.state |
| | | handleData = () => { |
| | | const { data, searchkey, config, selectedKeys, selected } = this.state |
| | | if (!data || data.length === 0) { |
| | | this.setState({ |
| | | selectedKeys: [], |
| | | expandedKeys: [], |
| | | treedata: [], |
| | | treeNodes: [], |
| | | }) |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, '', '') |
| | | return |
| | | } |
| | | let parentNodes = [] |
| | | let _options = [] |
| | | let logMap = new Map() |
| | | let selectKey = selectedKeys[0] || '' |
| | | let selectData = '' |
| | | let hasSelectKey = false |
| | | |
| | | data.forEach(item => { |
| | | let pval = item[config.wrap.parentField] |
| | | let val = item[config.wrap.valueField] |
| | | |
| | | if (!val || logMap.has(val)) return |
| | | |
| | | if (selectKey && selectKey === val) { |
| | | hasSelectKey = true |
| | | selectData = { |
| | | ...item, |
| | | $title: item[config.wrap.labelField] || '', |
| | | $key: val, |
| | | $parentId: '' |
| | | } |
| | | } |
| | | |
| | | logMap.set(val, true) |
| | | if (pval === config.wrap.mark) { |
| | |
| | | treeNodes: _treeNodes, |
| | | }) |
| | | |
| | | if (type === 'init' && _treeNodes[0] && config.wrap.selected === 'true') { |
| | | if (selected && !hasSelectKey && _treeNodes[0]) { |
| | | this.setState({ |
| | | selectedKeys: [_treeNodes[0].$key] |
| | | }) |
| | |
| | | setTimeout(() => { |
| | | MKEmitter.emit('resetSelectLine', config.uuid, _treeNodes[0].$key, _treeNodes[0]) |
| | | }, 200) |
| | | } else if (!hasSelectKey && selectKey) { |
| | | this.setState({ |
| | | selectedKeys: [] |
| | | }) |
| | | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, '', '') |
| | | } else if (hasSelectKey) { |
| | | MKEmitter.emit('resetSelectLine', config.uuid, selectKey, selectData) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | if (item.wrap && item.wrap.doubleClick) { |
| | | let index = item.action.findIndex((btn) => btn.uuid === item.wrap.doubleClick) |
| | | if (index === -1) { |
| | | item.wrap.doubleClick = '' |
| | | } |
| | | } |
| | | // if (item.wrap && item.wrap.doubleClick) { |
| | | // let index = item.action.findIndex((btn) => btn.uuid === item.wrap.doubleClick) |
| | | // if (index === -1) { |
| | | // item.wrap.doubleClick = '' |
| | | // } |
| | | // } |
| | | |
| | | return true |
| | | }) |
| | |
| | | } |
| | | item.key = index |
| | | item.$$uuid = item[setting.primaryKey] || '' |
| | | item.$$key = '' + item.key + item.$$uuid |
| | | item.$$BID = BID || '' |
| | | item.$Index = start + index + '' |
| | | |
| | |
| | | data = data.map(item => { |
| | | if (item.$$uuid === _data.$$uuid) { |
| | | _data.key = item.key |
| | | _data.$$key = '' + item.key + item.$$uuid |
| | | _data.$Index = item.$Index |
| | | return _data |
| | | } else { |
| | |
| | | } |
| | | item.key = index |
| | | item.$$uuid = item[setting.primaryKey] || '' |
| | | item.$$key = '' + item.key + item.$$uuid |
| | | item.$$BID = BID || '' |
| | | item.$Index = start + index + '' |
| | | |
| | |
| | | data = data.map(item => { |
| | | if (item.$$uuid === _data.$$uuid) { |
| | | _data.key = item.key |
| | | _data.$$key = '' + item.key + item.$$uuid |
| | | _data.$Index = item.$Index |
| | | return _data |
| | | } else { |
| | |
| | | selectedData: PropTypes.any, // 子表中选择数据 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | lineId: PropTypes.any, // 行索引+主键值,用于行按钮双击 |
| | | } |
| | | |
| | | state = { |
| | |
| | | const { setting, selectedData, btn, MenuID } = this.props |
| | | const { loading, disabled } = this.state |
| | | |
| | | if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return |
| | | if (loading || disabled) return |
| | | if (triggerId) { |
| | | if (btn.uuid !== triggerId) return |
| | | if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { |
| | | return |
| | | } |
| | | } |
| | | |
| | | if (btn.funcType === 'closetab') { |
| | | MKEmitter.emit('closeTabView', MenuID || btn.$MenuID) |
| | |
| | | btn: PropTypes.object, // 按钮 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | lineId: PropTypes.any, // 行索引+主键值,用于行按钮双击 |
| | | } |
| | | |
| | | state = { |
| | |
| | | const { setting, Tab, BID, btn, selectedData } = this.props |
| | | const { loading, disabled } = this.state |
| | | |
| | | if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return |
| | | if (loading || disabled) return |
| | | if (triggerId) { |
| | | if (btn.uuid !== triggerId) return |
| | | if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { |
| | | return |
| | | } |
| | | } |
| | | |
| | | if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { |
| | | notification.warning({ |
| | |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | updateStatus: PropTypes.func, // 按钮状态更新 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | lineId: PropTypes.any, // 行索引+主键值,用于行按钮双击 |
| | | } |
| | | |
| | | state = { |
| | |
| | | /** |
| | | * @description 触发按钮操作 |
| | | */ |
| | | actionTrigger = (triggerId) => { |
| | | actionTrigger = (triggerId, record) => { |
| | | const { setting, Tab, BID, btn } = this.props |
| | | const { loading, disabled } = this.state |
| | | |
| | | if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return |
| | | if (loading || disabled) return |
| | | if (triggerId) { |
| | | if (btn.uuid !== triggerId) return |
| | | if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { |
| | | return |
| | | } |
| | | } |
| | | |
| | | if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { |
| | | notification.warning({ |
| | |
| | | selectedData: PropTypes.any, // 子表中选择数据 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | lineId: PropTypes.any, // 行索引+主键值,用于行按钮双击 |
| | | } |
| | | |
| | | state = { |
| | |
| | | const { setting, btn, selectedData } = this.props |
| | | const { disabled } = this.state |
| | | |
| | | if ((triggerId && btn.uuid !== triggerId) || disabled) return |
| | | if (disabled) return |
| | | if (triggerId) { |
| | | if (btn.uuid !== triggerId) return |
| | | if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { |
| | | return |
| | | } |
| | | } |
| | | |
| | | if (type === 'linkbtn' && selectedData && selectedData.length === 1) { |
| | | if (record[0].$Index !== selectedData[0].$Index) { |
| | |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | ContainerId: PropTypes.any, // tab页面ID,用于弹窗控制 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | lineId: PropTypes.any, // 行索引+主键值,用于行按钮双击 |
| | | } |
| | | |
| | | state = { |
| | |
| | | const { Tab, BID, btn, selectedData, setting } = this.props |
| | | const { loading, disabled } = this.state |
| | | |
| | | if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return |
| | | if (loading || disabled) return |
| | | if (triggerId) { |
| | | if (btn.uuid !== triggerId) return |
| | | if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { |
| | | return |
| | | } |
| | | } |
| | | |
| | | if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { |
| | | notification.warning({ |
| | |
| | | btn: PropTypes.object, // 按钮 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | lineId: PropTypes.any, // 行索引+主键值,用于行按钮双击 |
| | | } |
| | | |
| | | state = { |
| | |
| | | const { setting, Tab, BID, btn, selectedData } = this.props |
| | | const { loading, disabled } = this.state |
| | | |
| | | if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return |
| | | if (loading || disabled) return |
| | | if (triggerId) { |
| | | if (btn.uuid !== triggerId) return |
| | | if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { |
| | | return |
| | | } |
| | | } |
| | | |
| | | if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { |
| | | notification.warning({ |
| | |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | ContainerId: PropTypes.any, // tab页面ID,用于弹窗控制 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | lineId: PropTypes.any, // 行索引+主键值,用于行按钮双击 |
| | | } |
| | | |
| | | state = { |
| | |
| | | const { Tab, BID, btn, selectedData, setting } = this.props |
| | | const { loading, disabled } = this.state |
| | | |
| | | if ((triggerId && btn.uuid !== triggerId) || loading || disabled) return |
| | | if (loading || disabled) return |
| | | if (triggerId) { |
| | | if (btn.uuid !== triggerId) return |
| | | if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { |
| | | return |
| | | } |
| | | } |
| | | |
| | | if (((Tab && Tab.supMenu) || setting.supModule) && !BID) { |
| | | notification.warning({ |
| | |
| | | selectedData: PropTypes.any, // 子表中选择数据 |
| | | setting: PropTypes.any, // 页面通用设置 |
| | | disabled: PropTypes.any, // 行按钮禁用 |
| | | lineId: PropTypes.any, // 行索引+主键值,用于行按钮双击 |
| | | } |
| | | |
| | | state = { |
| | |
| | | const { setting, btn, selectedData } = this.props |
| | | const { disabled } = this.state |
| | | |
| | | if ((triggerId && btn.uuid !== triggerId) || disabled) return |
| | | if (disabled) return |
| | | if (triggerId) { |
| | | if (btn.uuid !== triggerId) return |
| | | if (this.props.lineId && record && record[0] && this.props.lineId !== record[0].$$key) { |
| | | return |
| | | } |
| | | } |
| | | |
| | | if (type === 'linkbtn' && selectedData && selectedData.length === 1) { |
| | | if (record[0].$Index !== selectedData[0].$Index) { |
| | |
| | | btn={btn} |
| | | BID={record.$$BID} |
| | | disabled={record.$disabled} |
| | | lineId={record.$$key || ''} |
| | | selectedData={[record]} |
| | | BData={this.props.BData} |
| | | setting={this.props.setting} |
| | |
| | | btn={btn} |
| | | BID={record.$$BID} |
| | | disabled={record.$disabled} |
| | | lineId={record.$$key || ''} |
| | | selectedData={[record]} |
| | | BData={this.props.BData} |
| | | setting={this.props.setting} |
| | |
| | | key={btn.uuid} |
| | | btn={btn} |
| | | disabled={record.$disabled} |
| | | lineId={record.$$key || ''} |
| | | selectedData={[record]} |
| | | BData={this.props.BData} |
| | | MenuID={this.props.MenuID} |
| | |
| | | key={btn.uuid} |
| | | btn={btn} |
| | | disabled={record.$disabled} |
| | | lineId={record.$$key || ''} |
| | | selectedData={[record]} |
| | | BData={this.props.BData} |
| | | setting={this.props.setting} |
| | |
| | | _columns = _columns.map(col => { |
| | | col.required = col.required || 'true' |
| | | col.type = col.type || 'Nvarchar(50)' |
| | | col.import = col.import || 'true' |
| | | col.required = col.required || 'true' |
| | | |
| | | if (/^Nvarchar/ig.test(col.type)) { |
| | | col.limit = col.type.match(/\d+/)[0] |
| | |
| | | text: Formdict['model.empty'] |
| | | }, { |
| | | value: 'thdSeparator', |
| | | text: Formdict['header.form.thdSeparator'] |
| | | text: '千分位' |
| | | }, { |
| | | value: 'percent', |
| | | text: '百分比' |
| | |
| | | } 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) { |
| | | let _actions = [...item.action] |
| | | item.cols.forEach(col => { |
| | | if (col.type !== 'action') return |
| | | _actions.push(...col.elements) |
| | | }) |
| | | if (_actions.findIndex((m) => m.uuid === item.wrap.doubleClick) === -1) { |
| | | 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) { |
| | | let _actions = [...item.action] |
| | | item.cols.forEach(col => { |
| | | if (col.type !== 'action') return |
| | | _actions.push(...col.elements) |
| | | }) |
| | | if (_actions.findIndex((m) => m.uuid === item.wrap.doubleClick) === -1) { |
| | | error = `组件《${item.name}》绑定的双击按钮已删除!` |
| | | } |
| | | } |