| | |
| | | } |
| | | }) |
| | | |
| | | if (config.gridBtn && config.gridBtn.display && _operations.length > 0) { |
| | | _columns.push({ |
| | | ...config.gridBtn, |
| | | operations: _operations |
| | | }) |
| | | } |
| | | |
| | | // 1、筛选字段集,2、过滤隐藏列及合并列中的字段uuid |
| | | config.columns.forEach(col => { |
| | | if (col.field) { |
| | |
| | | } |
| | | }) |
| | | |
| | | if (config.gridBtn && config.gridBtn.display && _operations.length > 0) { |
| | | _columns.push({ |
| | | ...config.gridBtn, |
| | | operations: _operations |
| | | }) |
| | | } |
| | | |
| | | let valid = true // 搜索条件必填验证 |
| | | config.search.forEach(field => { |
| | | if (field.required === 'true' && !field.initval) { |
| | |
| | | max-width: 100%; |
| | | } |
| | | } |
| | | .text { |
| | | .ant-btn > .anticon + span { |
| | | margin-left: 3px; |
| | | } |
| | | button { |
| | | border: 0; |
| | | background-color: transparent; |
| | | color: #1890ff; |
| | | box-shadow: none; |
| | | padding: 0 5px; |
| | | } |
| | | button + button { |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | | .button { |
| | | button + button { |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | | } |
| | | .ant-table-tbody > tr > td.ant-table-column-has-actions { |
| | | position: relative; |
| | |
| | | editModalCancel = () => { |
| | | const { config, card, modaltype } = this.state |
| | | |
| | | if (card.focus) { |
| | | if (card && card.focus) { |
| | | let _config = null |
| | | if (modaltype === 'search') { |
| | | let _search = config.search.filter(item => item.uuid !== card.uuid) |
| | |
| | | _card.iscopy = true |
| | | _card.focus = true |
| | | |
| | | // 复制到剪切板 |
| | | let oInput = document.createElement('input') |
| | | let val = JSON.parse(JSON.stringify(_card)) |
| | | val.copyType = 'form' |
| | | |
| | | delete val.originUuid |
| | | |
| | | oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | oInput.className = 'oInput' |
| | | oInput.style.display = 'none' |
| | | document.body.removeChild(oInput) |
| | | |
| | | handleMenu(_card) |
| | | } |
| | | |
| | |
| | | import { queryTableSql } from '@/utils/option.js' |
| | | |
| | | import ModalForm from '@/templates/zshare/modalform' |
| | | import PasteForm from '@/templates/zshare/pasteform' |
| | | import ActionForm from './actionform' |
| | | import SettingForm from './settingform' |
| | | import DragElement from './dragelement' |
| | |
| | | editgroup: null, // 当前编辑组 |
| | | groupVisible: false, // 编辑组模态框 |
| | | optionLibs: null, // 自定义下拉选项库 |
| | | activeKey: '0' // 默认展开基本信息 |
| | | activeKey: '0', // 默认展开基本信息 |
| | | pasteVisible: false // 粘贴模态框 |
| | | } |
| | | |
| | | /** |
| | |
| | | }) |
| | | } |
| | | |
| | | pasteSubmit = () => { |
| | | let _config = JSON.parse(JSON.stringify(this.state.config)) |
| | | |
| | | this.pasteFormRef.handleConfirm().then(res => { |
| | | if (res.copyType === 'form') { |
| | | let repeat = false |
| | | |
| | | _config.groups.forEach(group => { |
| | | let item = group.sublist.filter(cell => cell.field === res.field)[0] |
| | | if (item) { |
| | | repeat = true |
| | | } |
| | | |
| | | if (group.isDefault) { |
| | | group.sublist.push(res) |
| | | } |
| | | }) |
| | | |
| | | if (res.type === 'linkMain') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '不支持此表单类型!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } else if (repeat) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '此表单字段已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | | config: _config, |
| | | pasteVisible: null |
| | | }, () => { |
| | | this.handleSearch(res) |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '配置信息格式错误!', |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | | const { config, modaltype, activeKey } = this.state |
| | | let _length = config.groups.length |
| | |
| | | </div> |
| | | } style={{ width: '100%' }}> |
| | | <Icon type="setting" onClick={this.changeSetting} /> |
| | | <Icon type="snippets" title={this.state.dict['header.form.paste']} onClick={() => {this.setState({pasteVisible: true})}} /> |
| | | <Tooltip placement="bottomLeft" overlayClassName="middle" title="在左侧工具栏《搜索》中,选择对应搜索框拖至此处添加;或点击按钮《添加搜索条件》批量添加,选择批量添加时,需提前选择使用表。"> |
| | | <Icon type="question-circle" /> |
| | | </Tooltip> |
| | |
| | | wrappedComponentRef={(inst) => this.groupRef = inst} |
| | | /> |
| | | </Modal> |
| | | {/* 按钮配置信息粘贴复制 */} |
| | | <Modal |
| | | title={this.state.dict['header.form.paste']} |
| | | visible={this.state.pasteVisible} |
| | | width={600} |
| | | maskClosable={false} |
| | | onOk={this.pasteSubmit} |
| | | onCancel={() => {this.setState({pasteVisible: null})}} |
| | | destroyOnClose |
| | | > |
| | | <PasteForm |
| | | dict={this.state.dict} |
| | | wrappedComponentRef={(inst) => this.pasteFormRef = inst} |
| | | /> |
| | | </Modal> |
| | | {this.state.loading && <Spin size="large" />} |
| | | </div> |
| | | ) |
| | |
| | | left: 5px; |
| | | top: 20px; |
| | | } |
| | | |
| | | > .anticon-setting { |
| | | position: absolute; |
| | | font-size: 18px; |
| | | right: 7px; |
| | | top: 10px; |
| | | padding: 10px; |
| | | z-index: 1; |
| | | } |
| | | |
| | | > .anticon-snippets { |
| | | position: absolute; |
| | | font-size: 14px; |
| | | left: 22px; |
| | | top: 13px; |
| | | padding: 10px; |
| | | z-index: 1; |
| | | } |
| | | |
| | | >.ant-collapse { |
| | | border-radius: 0; |
| | | border: 0; |
| | |
| | | .ant-tabs-nav-container-scrolling { |
| | | margin-right: 50px; |
| | | } |
| | | } |
| | | > .anticon-setting { |
| | | position: absolute; |
| | | font-size: 18px; |
| | | right: 7px; |
| | | top: 10px; |
| | | padding: 10px; |
| | | z-index: 1; |
| | | } |
| | | } |
| | | .anticon-question-circle { |
| | |
| | | import { queryTableSql } from '@/utils/option.js' |
| | | |
| | | import ModalForm from '@/templates/zshare/modalform' |
| | | import PasteForm from '@/templates/zshare/pasteform' |
| | | import DragElement from './dragelement' |
| | | import SourceElement from './dragelement/source' |
| | | import SettingForm from './settingform' |
| | |
| | | groupVisible: false, // 全局配置模态框 |
| | | curgroup: null, // 当前组,新建或编辑 |
| | | optionLibs: null, // 自定义下拉选项库 |
| | | sources: null // 表单类型 |
| | | sources: null, // 表单类型 |
| | | pasteVisible: null // 表单粘贴 |
| | | } |
| | | |
| | | /** |
| | |
| | | card.originUuid = card.uuid |
| | | card.uuid = Utils.getuuid() |
| | | card.focus = true |
| | | |
| | | // 复制到剪切板 |
| | | let oInput = document.createElement('input') |
| | | let val = JSON.parse(JSON.stringify(card)) |
| | | val.copyType = 'form' |
| | | |
| | | delete val.originUuid |
| | | |
| | | oInput.value = window.btoa(window.encodeURIComponent(JSON.stringify(val))) |
| | | document.body.appendChild(oInput) |
| | | oInput.select() |
| | | document.execCommand('Copy') |
| | | oInput.className = 'oInput' |
| | | oInput.style.display = 'none' |
| | | document.body.removeChild(oInput) |
| | | } |
| | | |
| | | const { config } = this.state |
| | |
| | | } |
| | | } |
| | | |
| | | pasteSubmit = () => { |
| | | let _config = JSON.parse(JSON.stringify(this.state.config)) |
| | | |
| | | this.pasteFormRef.handleConfirm().then(res => { |
| | | if (res.copyType === 'form') { |
| | | let repeat = false |
| | | if (_config.groups.length > 0) { |
| | | _config.groups.forEach(group => { |
| | | let item = group.sublist.filter(cell => cell.field === res.field)[0] |
| | | if (item) { |
| | | repeat = true |
| | | } |
| | | |
| | | if (group.default) { |
| | | group.sublist.push(res) |
| | | } |
| | | }) |
| | | } else { |
| | | let item = _config.fields.filter(cell => cell.field === res.field)[0] |
| | | if (item) { |
| | | repeat = true |
| | | } |
| | | _config.fields.push(res) |
| | | } |
| | | |
| | | if (!this.props.editTab && res.type === 'linkMain') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '不支持此表单类型!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } else if (repeat) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '此表单字段已存在!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | | config: _config, |
| | | pasteVisible: null |
| | | }, () => { |
| | | this.handleForm(res, 'edit') |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '配置信息格式错误!', |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | | const { config, source } = this.state |
| | | |
| | |
| | | </div> |
| | | } style={{ width: '100%' }}> |
| | | <Icon type="setting" onClick={this.changeSetting} /> |
| | | <Icon type="snippets" title={this.state.dict['header.form.paste']} onClick={() => {this.setState({pasteVisible: true})}} /> |
| | | <div className="ant-modal-content" style={{width: config.setting.width + '%'}}> |
| | | <button type="button" className="ant-modal-close"> |
| | | <span className="ant-modal-close-x"><Icon type="close"/></span> |
| | |
| | | wrappedComponentRef={(inst) => this.groupRef = inst} |
| | | /> |
| | | </Modal> |
| | | {/* 按钮配置信息粘贴复制 */} |
| | | <Modal |
| | | title={this.state.dict['header.form.paste']} |
| | | visible={this.state.pasteVisible} |
| | | width={600} |
| | | maskClosable={false} |
| | | onOk={this.pasteSubmit} |
| | | onCancel={() => {this.setState({pasteVisible: null})}} |
| | | destroyOnClose |
| | | > |
| | | <PasteForm |
| | | dict={this.state.dict} |
| | | wrappedComponentRef={(inst) => this.pasteFormRef = inst} |
| | | /> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | right: 15px; |
| | | top: 10px; |
| | | } |
| | | > .anticon-snippets { |
| | | position: absolute; |
| | | font-size: 16px; |
| | | right: 15px; |
| | | top: 40px; |
| | | } |
| | | } |
| | | } |
| | | .setting:hover { |
| | |
| | | const { openType } = this.state |
| | | let value = e.target.value |
| | | if (key === 'resourceType') { |
| | | let _options = ['label', 'field', 'initval', 'type', 'resourceType', 'readonly', 'required', 'hidden', 'readin', 'blacklist'] |
| | | let _options = ['label', 'field', 'initval', 'type', 'resourceType', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'supField'] |
| | | if (value === '0') { |
| | | _options = [..._options, 'options', 'quick'] |
| | | } else if (value === '1') { |