| | |
| | | } else if (this.record.type === 'close' || this.record.type === 'reset') { |
| | | shows = ['typeName', 'label'] |
| | | } else { |
| | | shows = ['typeName', 'label', 'intertype', 'Ot', 'execSuccess', 'syncComponent', 'anchors', 'linkmenu', 'output', 'reload', 'preButton'] // 选项列表 |
| | | shows = ['typeName', 'label', 'intertype', 'Ot', 'execSuccess', 'syncComponent', 'anchors', 'linkmenu', 'output', 'reload', 'preButton', 'resetForm'] // 选项列表 |
| | | |
| | | if (this.record.intertype === 'custom') { |
| | | shows.pop() |
| | |
| | | * @param {*} type 按钮类型,用于区分可选的打开方式 |
| | | */ |
| | | |
| | | export function getActionForm (card, functip, tableName, usefulFields, modules, anchors, uuid) { |
| | | export function getActionForm (card, functip, tableName, usefulFields, modules, anchors, uuid, fields) { |
| | | const appType = sessionStorage.getItem('appType') |
| | | let viewType = sessionStorage.getItem('editMenuType') // 弹窗 popview |
| | | let _type = '提交' |
| | |
| | | value: 'popclose', // 执行弹窗关闭时的刷新 |
| | | text: '刷新源组件' |
| | | }) |
| | | } |
| | | |
| | | let resets = [] |
| | | fields.forEach(item => { |
| | | if (item.hidden === 'true') return |
| | | if (item.type !== 'text' && item.type !== 'number') return |
| | | |
| | | resets.push({ |
| | | value: item.uuid, |
| | | text: item.label |
| | | }) |
| | | }) |
| | | |
| | | if (card.resetForm && resets.findIndex(item => item.value === card.resetForm) === -1) { |
| | | card.resetForm = '' |
| | | } |
| | | |
| | | return [ |
| | |
| | | options: linkButtons |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'resetForm', |
| | | label: '重置表单', |
| | | tooltip: '按钮执行成功后需要重置的表单,表单会恢复默认值并聚焦。', |
| | | initVal: card.resetForm || '', |
| | | required: false, |
| | | allowClear: true, |
| | | options: resets |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'reload', |
| | | label: '上一页', |
| | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | | formlist: getActionForm(card, functip, config.setting.tableName, usefulFields, modules, anchors, group.uuid) |
| | | formlist: getActionForm(card, functip, config.setting.tableName, usefulFields, modules, anchors, group.uuid, group.fields) |
| | | }) |
| | | } |
| | | |
| | |
| | | .normal-custom-table { |
| | | position: relative; |
| | | padding: 0px; |
| | | min-height: 40px; |
| | | --mk-table-border-color: #e8e8e8; |
| | | --mk-table-color: rgba(0, 0, 0, 0.65); |
| | | --mk-table-font-size: 14px; |
| | | --mk-table-font-weight: normal; |
| | | |
| | | .main-pickup { |
| | | position: absolute; |
| | | right: 5px; |
| | | top: -22px; |
| | | z-index: 2; |
| | | } |
| | | |
| | | .normal-table-footer { |
| | | padding: 10px 0px; |
| | | color: rgba(0, 0, 0, 0.65); |
| | |
| | | columns={config.columns} |
| | | selectedData={selectedData} |
| | | /> : <div style={{height: '25px'}}></div>} |
| | | <div className="main-table-box"> |
| | | <MainTable |
| | | data={data} |
| | | setting={setting} |
| | | columns={columns} |
| | | MenuID={config.uuid} |
| | | fields={config.columns} |
| | | total={this.state.total} |
| | | autoMatic={config.autoMatic} |
| | | lineMarks={config.lineMarks} |
| | | loading={this.state.loading} |
| | | refreshdata={this.refreshbytable} |
| | | statFValue={this.state.statFValue} |
| | | chgSelectData={(selects) => this.setState({selectedData: selects})} |
| | | /> |
| | | </div> |
| | | <MainTable |
| | | data={data} |
| | | setting={setting} |
| | | columns={columns} |
| | | MenuID={config.uuid} |
| | | fields={config.columns} |
| | | total={this.state.total} |
| | | autoMatic={config.autoMatic} |
| | | lineMarks={config.lineMarks} |
| | | loading={this.state.loading} |
| | | refreshdata={this.refreshbytable} |
| | | statFValue={this.state.statFValue} |
| | | chgSelectData={(selects) => this.setState({selectedData: selects})} |
| | | /> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | .button-list.toolbar-button { |
| | | padding-right: 60px; |
| | | } |
| | | .main-table-box { |
| | | position: relative; |
| | | min-height: 40px; |
| | | .main-pickup { |
| | | position: absolute; |
| | | right: 5px; |
| | | top: -22px; |
| | | z-index: 2; |
| | | } |
| | | >.async-spin { |
| | | line-height: 150px!important; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | let content = <> |
| | | {config.search && config.search.length ? |
| | | {config.search.length ? |
| | | <MainSearch BID={BID} config={config} refreshdata={this.refreshbysearch}/> : null |
| | | } |
| | | {actions.length > 0 ? <MainAction |
| | |
| | | BData={BData} |
| | | columns={config.columns} |
| | | selectedData={selectedData} |
| | | /> : <div className="mk-action-space" style={{height: '25px'}}></div>} |
| | | <div className={'main-table-box ' + (!actions || actions.length === 0 ? 'no-action' : '')}> |
| | | <MainTable |
| | | setting={setting} |
| | | columns={columns} |
| | | MenuID={config.uuid} |
| | | allSearch={allSearch} |
| | | data={this.state.data} |
| | | fields={config.columns} |
| | | total={this.state.total} |
| | | colsCtrls={config.colsCtrls} |
| | | lineMarks={config.lineMarks} |
| | | loading={this.state.loading} |
| | | refreshdata={this.refreshbytable} |
| | | statFValue={this.state.statFValue} |
| | | chgSelectData={(selects) => this.setState({selectedData: selects})} |
| | | /> |
| | | </div> |
| | | /> : (setting.tableType || config.search.length > 0 ? <div className="mk-action-space" style={{height: '25px'}}></div> : null)} |
| | | <MainTable |
| | | setting={setting} |
| | | columns={columns} |
| | | MenuID={config.uuid} |
| | | allSearch={allSearch} |
| | | data={this.state.data} |
| | | fields={config.columns} |
| | | total={this.state.total} |
| | | colsCtrls={config.colsCtrls} |
| | | lineMarks={config.lineMarks} |
| | | loading={this.state.loading} |
| | | refreshdata={this.refreshbytable} |
| | | statFValue={this.state.statFValue} |
| | | chgSelectData={(selects) => this.setState({selectedData: selects})} |
| | | /> |
| | | </> |
| | | |
| | | return ( |
| | |
| | | .button-list.toolbar-button { |
| | | padding-right: 60px; |
| | | } |
| | | .main-table-box { |
| | | position: relative; |
| | | min-height: 40px; |
| | | .main-pickup { |
| | | position: absolute; |
| | | right: 5px; |
| | | top: -22px; |
| | | z-index: 2; |
| | | } |
| | | >.async-spin { |
| | | line-height: 150px!important; |
| | | } |
| | | } |
| | | .ant-collapse { |
| | | background-color: transparent; |
| | | border-radius: 0px; |
| | |
| | | const { btn } = this.props |
| | | const { autoMatic } = this.state |
| | | |
| | | if (btn.resetForm) { |
| | | MKEmitter.emit('mkFC', 'reset', btn.resetForm) |
| | | } |
| | | |
| | | if (this.preCallback) { |
| | | this.setState({ |
| | | loading: false, |
| | |
| | | } else { |
| | | this.props.onChange(_val, true) |
| | | } |
| | | } else if (type === 'reset') { |
| | | let _val = this.props.config.initval |
| | | |
| | | if (this.state.encryption === 'true' && _val) { |
| | | try { |
| | | _val = window.decodeURIComponent(window.atob(_val)) |
| | | } catch (e) { |
| | | _val = this.props.config.initval |
| | | } |
| | | } |
| | | |
| | | this.setState({value: _val}, () => { |
| | | this.inputRef.current.select() |
| | | }) |
| | | |
| | | this.props.onChange(this.props.config.initval) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (type === 'focus') { |
| | | let node = document.getElementById(uuid) |
| | | node.select() |
| | | node && node.select() |
| | | } else if (type === 'input') { |
| | | this.setState({value}) |
| | | this.props.onChange(value, true) |
| | | } else if (type === 'reset') { |
| | | let _val = this.props.config.initval |
| | | |
| | | this.setState({value: _val}, () => { |
| | | let node = document.getElementById(this.props.config.uuid) |
| | | node && node.select() |
| | | }) |
| | | |
| | | this.props.onChange(_val) |
| | | } |
| | | } |
| | | |