| | |
| | | <Icon type={this.props.collapse ? 'menu-unfold' : 'menu-fold'} /> |
| | | </div> |
| | | {/* 正常菜单 */} |
| | | {this.props.editLevel !== 'level1' && this.state.menulist && |
| | | {this.props.editLevel !== 'level1' && this.state.menulist ? |
| | | <ul className={'header-menu ' + this.props.editLevel}>{ |
| | | this.state.menulist.map(item => { |
| | | return ( |
| | |
| | | <span>HS</span> |
| | | </li> : null |
| | | } |
| | | </ul>} |
| | | </ul> : null |
| | | } |
| | | {this.props.editLevel === 'level4' ? <Button className="level4-close" type="primary" onClick={this.exitManage}>退出</Button> : null} |
| | | {/* 进入编辑按钮 */} |
| | | {this.props.editState && !this.props.editLevel && <Icon onClick={this.enterEdit} className="edit-check" type="edit" />} |
| | | {this.props.editState && !this.props.editLevel ? <Icon onClick={this.enterEdit} className="edit-check" type="edit" /> : null} |
| | | {/* 编辑菜单 */} |
| | | {this.props.editLevel === 'level1' && <EditMenu menulist={this.state.menulist} reload={this.reload} exitEdit={this.exitEdit}/>} |
| | | {this.props.editLevel === 'level1' ? <EditMenu menulist={this.state.menulist} reload={this.reload} exitEdit={this.exitEdit}/> : null} |
| | | {/* 头像、用户名 */} |
| | | <Dropdown className="header-setting" overlay={menu}> |
| | | <div> |
| | |
| | | 'header.menu.search': 'Search', |
| | | 'header.menu.search.add': 'Add searches', |
| | | 'header.menu.action': 'Button', |
| | | 'header.menu.action.configurable': 'Configurable Button', |
| | | 'header.menu.tab.configurable': 'Configurable Tab', |
| | | 'header.menu.action.configurable': 'Button Configurable', |
| | | 'header.menu.tab.configurable': 'Tab Configurable', |
| | | 'header.menu.column': 'Column', |
| | | 'header.menu.column.add': 'Add columns', |
| | | 'header.menu.page.configurable': 'Configuration Page', |
| | |
| | | 'header.menu.maintable': '主表', |
| | | 'header.menu.query': '查询', |
| | | 'header.menu.printTemplate': '打印模板', |
| | | 'header.menu.thawmenu.source': '已冻结', |
| | | 'header.menu.thawmenu.target': '解除冻结', |
| | | 'header.menu.thawmenu.itemUnit': '项', |
| | | 'header.menu.thawmenu.itemsUnit': '项', |
| | | 'header.form.tabType': '标签类型', |
| | | 'header.form.search.placeholder': 'Please add search criteria', |
| | | 'header.form.modal.placeholder': 'Please add the form', |
| | |
| | | 'header.form.func.changeuser': '切换用户', |
| | | 'header.form.func.print': '打印', |
| | | 'header.form.execMode': '执行方式', |
| | | 'header.form.thawbutton': '解冻按钮', |
| | | 'header.modal.form.edit': '表单-编辑', |
| | | 'header.modal.search.edit': '搜索条件-编辑', |
| | | 'header.modal.action.edit': '按钮-编辑', |
| | |
| | | 'header.menu.search': '搜索', |
| | | 'header.menu.search.add': '添加搜索条件', |
| | | 'header.menu.action': '按钮', |
| | | 'header.menu.action.configurable': '可配置按钮', |
| | | 'header.menu.tab.configurable': '可配置标签', |
| | | 'header.menu.action.configurable': '按钮配置', |
| | | 'header.menu.tab.configurable': '标签配置', |
| | | 'header.menu.column': '显示列', |
| | | 'header.menu.column.add': '添加显示列', |
| | | 'header.menu.page.configurable': '页面配置', |
| | |
| | | 'header.menu.maintable': '主表', |
| | | 'header.menu.query': '查询', |
| | | 'header.menu.printTemplate': '打印模板', |
| | | 'header.menu.thawmenu.source': '已冻结', |
| | | 'header.menu.thawmenu.target': '解除冻结', |
| | | 'header.menu.thawmenu.itemUnit': '项', |
| | | 'header.menu.thawmenu.itemsUnit': '项', |
| | | 'header.form.tabType': '标签类型', |
| | | 'header.form.search.placeholder': '请添加搜索条件', |
| | | 'header.form.modal.placeholder': '请添加表单', |
| | |
| | | 'header.form.func.changeuser': '切换用户', |
| | | 'header.form.func.print': '打印', |
| | | 'header.form.execMode': '执行方式', |
| | | 'header.form.thawbutton': '解冻按钮', |
| | | 'header.modal.form.edit': '表单-编辑', |
| | | 'header.modal.search.edit': '搜索条件-编辑', |
| | | 'header.modal.action.edit': '按钮-编辑', |
| | |
| | | primaryId: this.props.param.primaryId || '', |
| | | data: this.props.param.data || null, |
| | | BIDs: { |
| | | mainTable: config.setting.onload === 'true' ? (this.props.param.primaryId || '') : '', |
| | | mainTabledata: config.setting.onload === 'true' ? (config.setting.datatype === 'query' ? '' : this.props.param.data) : '' |
| | | mainTable: config.setting.onload !== 'false' ? (this.props.param.primaryId || '') : '', |
| | | mainTabledata: config.setting.onload !== 'false' ? (config.setting.datatype === 'query' ? '' : this.props.param.data) : '' |
| | | } |
| | | }, () => { |
| | | this.improveSelectOption(config.groups) |
| | | |
| | | if (config.setting.datatype === 'query' && config.setting.onload === 'true') { |
| | | if (config.setting.datatype === 'query' && config.setting.onload !== 'false') { |
| | | if (!this.props.param.primaryId) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | func: 'sPC_Get_TableData', |
| | | obj_name: 'data', |
| | | arr_field: arr_field, |
| | | appkey: window.GLOB.appkey || '' |
| | | appkey: window.GLOB.appkey || '', |
| | | ID: primaryId |
| | | } |
| | | |
| | | let _dataresource = setting.dataresource |
| | |
| | | _dataresource = '(' + _dataresource + ') tb' |
| | | } |
| | | |
| | | let LText = `select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() from ${_dataresource}) tmptable where ${setting.primaryKey}=${primaryId}` |
| | | if (!/@ID@/ig.test(_dataresource)) { |
| | | _dataresource = `${_dataresource} where ${setting.primaryKey}='${primaryId}'` |
| | | } |
| | | |
| | | let LText = `select ${arr_field} from ${_dataresource}` |
| | | |
| | | param.LText = Utils.formatOptions(LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | |
| | | arr_field: _option.field |
| | | } |
| | | |
| | | if (this.props.BID) { |
| | | param.BID = this.props.BID |
| | | } |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | |
| | | arr_field: _option.field |
| | | } |
| | | |
| | | if (this.props.BID) { |
| | | param.BID = this.props.BID |
| | | } |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | |
| | | arr_field: _option.field |
| | | } |
| | | |
| | | if (this.props.BID) { |
| | | param.BID = this.props.BID |
| | | } |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | |
| | | // </Col> |
| | | // ) |
| | | } else if (item.type === 'textarea') { |
| | | let _max = item.fieldlength || 512 |
| | | let _labelcol = cols !== 3 ? 8 / cols : 3 |
| | | let _wrapcol = cols !== 3 ? 16 + (cols - 1) * 4 : 21 |
| | | let _style = {} |
| | |
| | | message: this.props.dict['form.required.input'] + item.label + '!' |
| | | }, |
| | | { |
| | | max: formRule.textarea.max, |
| | | message: formRule.textarea.message |
| | | max: _max, |
| | | message: formRule.input.formMessage.replace('@max', _max) |
| | | } |
| | | ] |
| | | })(<TextArea autosize={{ minRows: 2, maxRows: 6 }} disabled={item.readonly === 'true'} />)} |
| | |
| | | import VerifyCardPrint from '@/templates/tableshare/verifycardprint' |
| | | import MenuForm from '@/templates/tableshare/menuform' |
| | | import TabDragElement from '@/templates/tableshare/tabdragelement' |
| | | import TransferForm from '@/components/transferform' |
| | | import SourceElement from '@/templates/tableshare/dragelement/source' |
| | | import Source from './source' |
| | | import './index.scss' |
| | |
| | | showColumnName: false, // 显示列字段名控制 |
| | | tabviews: [], // 所有标签页 |
| | | profileVisible: false, // 验证信息模态框 |
| | | optionLibs: null // 自定义下拉选项库 |
| | | optionLibs: null, // 自定义下拉选项库 |
| | | thawBtnVisible: false, // 解冻按钮弹窗 |
| | | thawbtnlist: null, // 解冻按钮列表 |
| | | thawButtons: [] // 已选择要解冻的按钮 |
| | | } |
| | | |
| | | /** |
| | |
| | | _config.action = _config.action.map(item => { |
| | | let uuid = Utils.getuuid() |
| | | |
| | | if (item.linkTab) { |
| | | item.linkTab = '' |
| | | } |
| | | |
| | | if (item.OpenType === 'pop') { // 含有子配置项的按钮(表单) |
| | | _oriActions.push({ |
| | | prebtn: JSON.parse(JSON.stringify(item)), |
| | |
| | | _config.tabgroups.forEach(group => { |
| | | _config[group] = _config[group].map(tab => { |
| | | tab.uuid = Utils.getuuid() |
| | | |
| | | if (tab.linkTab) { |
| | | tab.linkTab = '' |
| | | } |
| | | |
| | | return tab |
| | | }) |
| | |
| | | } |
| | | |
| | | deleteElement = (element) => { |
| | | const { config } = this.state |
| | | const { config, thawButtons } = this.state |
| | | let _this = this |
| | | |
| | | confirm({ |
| | |
| | | // 删除按钮元素 |
| | | let _delActions = _this.state.delActions |
| | | if (element.type === 'action' || element.type === 'tabs') { |
| | | _delActions.push(element.card.uuid) |
| | | _delActions.push(element) |
| | | } |
| | | |
| | | _this.setState({ |
| | | config: _config, |
| | | delActions: _delActions |
| | | delActions: _delActions, |
| | | thawButtons: thawButtons.filter(key => key !== element.card.uuid) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | */ |
| | | submitConfig = () => { |
| | | const { menu } = this.props |
| | | const { originMenu, delActions } = this.state |
| | | const { originMenu, delActions, thawButtons } = this.state |
| | | |
| | | let config = JSON.parse(JSON.stringify(this.state.config)) |
| | | |
| | |
| | | let deffers = delActions.map(item => { |
| | | let _param = { |
| | | func: 'sPC_MainMenu_Del', |
| | | MenuID: item |
| | | MenuID: item.card.uuid |
| | | } |
| | | |
| | | if (item.type === 'action') { |
| | | let _ParentParam = null |
| | | |
| | | try { |
| | | _ParentParam = window.btoa(window.encodeURIComponent(JSON.stringify(item.card))) |
| | | } catch (e) { |
| | | _ParentParam = null |
| | | } |
| | | |
| | | if (_ParentParam) { |
| | | _param.ParentParam = _ParentParam |
| | | } |
| | | } |
| | | |
| | | return new Promise(resolve => { |
| | | Api.getSystemConfig(_param).then(response => { |
| | | resolve(response) |
| | |
| | | }) |
| | | } else if (delActions.length === 0) { |
| | | resolve(true) |
| | | } |
| | | }).then(resp => { |
| | | if (resp === false) return |
| | | |
| | | if (thawButtons.length > 0) { |
| | | let defers = thawButtons.map(item => { |
| | | return new Promise((resolve) => { |
| | | Api.getSystemConfig({ |
| | | func: 'sPC_MainMenu_ReDel', |
| | | MenuID: item |
| | | }).then(res => { |
| | | if (res.status) { |
| | | resolve('') |
| | | } else { |
| | | resolve(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | }) |
| | | |
| | | return Promise.all(defers) |
| | | } else { |
| | | return true |
| | | } |
| | | }).then(res => { |
| | | if (res === true || res === false) return res |
| | | |
| | | let msg = res.filter(Boolean)[0] |
| | | if (msg) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: msg, |
| | | duration: 10 |
| | | }) |
| | | return false |
| | | } else { |
| | | this.setState({ |
| | | thawButtons: [] |
| | | }) |
| | | return true |
| | | } |
| | | }).then(resp => { |
| | | if (resp === false) return |
| | |
| | | _subconfig[_groupId] = _subconfig[_groupId].map(_tab => { |
| | | _tab.uuid = Utils.getuuid() |
| | | |
| | | if (_tab.linkTab) { |
| | | _tab.linkTab = '' |
| | | } |
| | | |
| | | return _tab |
| | | }) |
| | | }) |
| | |
| | | } catch { |
| | | _subconfig = '' |
| | | } |
| | | } |
| | | |
| | | _LongParam = _subconfig |
| | | } else if (_subconfig) { |
| | | _LongParam = result.LongParam |
| | | } |
| | | } |
| | | |
| | | if (_LongParam) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description 解冻按钮 |
| | | */ |
| | | handleThaw = () => { |
| | | const { menu } = this.props |
| | | |
| | | this.setState({ |
| | | thawBtnVisible: true |
| | | }) |
| | | |
| | | Api.getSystemConfig({ |
| | | func: 'sPC_Get_FrozenMenu', |
| | | ParentID: menu.MenuID, |
| | | TYPE: 40 |
| | | }).then(res => { |
| | | if (res.status) { |
| | | let _list = [] |
| | | |
| | | res.data.forEach(menu => { |
| | | let _conf = '' |
| | | |
| | | if (menu.ParentParam) { |
| | | try { |
| | | _conf = JSON.parse(window.decodeURIComponent(window.atob(menu.ParentParam))) |
| | | } catch (e) { |
| | | _conf = '' |
| | | } |
| | | } |
| | | |
| | | if (_conf) { |
| | | _list.push({ |
| | | key: menu.MenuID, |
| | | title: menu.MenuName, |
| | | btnParam: _conf |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | this.setState({ |
| | | thawbtnlist: _list |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 解冻按钮提交 |
| | | */ |
| | | thawBtnSubmit = () => { |
| | | const { thawButtons, config, thawbtnlist } = this.state |
| | | // 三级菜单解除冻结 |
| | | if (this.refs.trawmenu.state.targetKeys.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: this.state.dict['form.required.select'] + this.state.dict['header.form.thawbutton'], |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | |
| | | thawbtnlist.forEach(item => { |
| | | if (this.refs.trawmenu.state.targetKeys.includes(item.key)) { |
| | | config.action.push(item.btnParam) |
| | | } |
| | | }) |
| | | |
| | | this.setState({ |
| | | thawButtons: [...thawButtons, ...this.refs.trawmenu.state.targetKeys], |
| | | config: config, |
| | | thawBtnVisible: false |
| | | }) |
| | | } |
| | | } |
| | | |
| | | handleGroup = (index, type) => { |
| | | let config = JSON.parse(JSON.stringify(this.state.config)) |
| | | |
| | | if (type === 'up') { |
| | | config.tabgroups.splice(index, 0, config.tabgroups.splice(index - 1, 1)[0]) |
| | | } else { |
| | | config.tabgroups.splice(index, 0, config.tabgroups.splice(index + 1, 1)[0]) |
| | | } |
| | | |
| | | this.setState({ |
| | | config: config |
| | | }) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '调整成功', |
| | | duration: 2 |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 选择不保存时,如有复制按钮,则删除 |
| | | */ |
| | | notsave = () => { |
| | |
| | | return (<SourceElement key={index} content={item}/>) |
| | | })} |
| | | </div> |
| | | <div className="config-btn"> |
| | | {configAction.length > 0 ? |
| | | <p className="config-btn-title"> |
| | | <Tooltip placement="topLeft" title="点击按钮,可完成或查看按钮配置信息。"> |
| | |
| | | {this.state.dict['header.menu.action.configurable']} |
| | | </p> : null |
| | | } |
| | | <div className="thawbutton" title={this.state.dict['header.form.thawbutton']} onClick={this.handleThaw}> |
| | | <Icon type="unlock" /> |
| | | </div> |
| | | </div> |
| | | {configAction.map((item, index) => { |
| | | return ( |
| | | <div key={index}> |
| | |
| | | <Tooltip placement="bottomLeft" overlayClassName="middle" title="在左侧工具栏《按钮》中,选择对应类型的按钮拖至此处添加,如选择按钮类型为表单、新标签页等含有配置页面的按钮,可在左侧工具栏-按钮-可配置按钮处,点击按钮完成相关配置。注:当设置按钮显示位置为表格时,显示列会增加操作列。"> |
| | | <Icon type="question-circle" /> |
| | | </Tooltip> |
| | | {/* <div className="thawbutton" title={this.state.dict['header.form.thawbutton']} onClick={this.handleThaw}> |
| | | <Icon type="unlock" /> |
| | | </div> */} |
| | | <DragElement |
| | | type="action" |
| | | list={this.state.config.action} |
| | |
| | | {index === 0 ? <Tooltip placement="bottomLeft" overlayClassName="middle" title="在左侧工具栏《标签页》中,选择对应类型的标签页拖至此处添加。"> |
| | | <Icon type="question-circle" /> |
| | | </Tooltip> : null} |
| | | {index !== (this.state.config.tabgroups.length - 1) ? |
| | | <Icon type="arrow-down" onClick={() => {this.handleGroup(index, 'down')}} /> : null |
| | | } |
| | | {index !== 0 ? <Icon type="arrow-up" onClick={() => {this.handleGroup(index, 'up')}} /> : null} |
| | | {index === 0 ? <Icon type="plus" onClick={this.addTabGroup} /> : null} |
| | | {index !== 0 ? <Icon type="delete" onClick={() => {this.delTabGroup(groupId)}} /> : null} |
| | | <TabDragElement |
| | |
| | | > |
| | | {this.state.dict['header.menu.config.placeholder']} |
| | | </Modal> |
| | | {/* 解冻按钮模态框 */} |
| | | <Modal |
| | | title={this.state.dict['header.form.thawbutton']} |
| | | okText={this.state.dict['header.confirm']} |
| | | cancelText={this.state.dict['header.cancel']} |
| | | visible={this.state.thawBtnVisible} |
| | | onOk={this.thawBtnSubmit} |
| | | onCancel={() => {this.setState({thawBtnVisible: false, thawbtnlist: null})}} |
| | | destroyOnClose |
| | | > |
| | | {!this.state.thawbtnlist && <Spin style={{marginLeft: 'calc(50% - 22px)', marginTop: '70px', marginBottom: '70px'}} size="large" />} |
| | | {this.state.thawbtnlist && <TransferForm ref="trawmenu" dict={this.state.dict} menulist={this.state.thawbtnlist}/>} |
| | | </Modal> |
| | | {this.state.loading && <Spin size="large" />} |
| | | </div> |
| | | ) |
| | |
| | | } |
| | | } |
| | | } |
| | | .config-btn { |
| | | position: relative; |
| | | |
| | | .config-btn-title { |
| | | margin-top: 20px; |
| | | margin-bottom: 10px; |
| | | color: #1890ff; |
| | | border-bottom: 1px solid #e8e8e8; |
| | | } |
| | | .thawbutton { |
| | | position: absolute; |
| | | right: 10px; |
| | | top: 0px; |
| | | padding: 0px; |
| | | cursor: pointer; |
| | | i { |
| | | font-size: 16px; |
| | | color: #1890ff; |
| | | } |
| | | } |
| | | } |
| | | .tables { |
| | | .ant-select-selection-selected-value { |
| | |
| | | } |
| | | } |
| | | .action-list { |
| | | position: relative; |
| | | padding: 0px 20px 15px; |
| | | min-height: 82px; |
| | | > .ant-row { |
| | |
| | | .page-card:hover { |
| | | .edit { |
| | | display: inline-block; |
| | | } |
| | | } |
| | | .thawbutton { |
| | | position: absolute; |
| | | right: 10px; |
| | | top: 5px; |
| | | padding: 5px; |
| | | cursor: pointer; |
| | | i { |
| | | font-size: 18px; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | > .anticon-plus { |
| | | position: absolute; |
| | | font-size: 24px; |
| | | font-size: 18px; |
| | | right: 25px; |
| | | top: 50px; |
| | | z-index: 1; |
| | | color: #26C281; |
| | | cursor: pointer; |
| | | } |
| | | > .anticon-delete { |
| | | position: absolute; |
| | | font-size: 24px; |
| | | font-size: 19px; |
| | | right: 25px; |
| | | top: 50px; |
| | | z-index: 1; |
| | | color: #ff4d4f; |
| | | cursor: pointer; |
| | | } |
| | | > .anticon-arrow-up { |
| | | position: absolute; |
| | | right: 55px; |
| | | font-size: 19px; |
| | | z-index: 1; |
| | | top: 50px; |
| | | color: #1890ff; |
| | | cursor: pointer; |
| | | } |
| | | > .anticon-arrow-down { |
| | | position: absolute; |
| | | right: 55px; |
| | | font-size: 19px; |
| | | z-index: 1; |
| | | top: 50px; |
| | | color: purple; |
| | | cursor: pointer; |
| | | } |
| | | > .anticon-arrow-down + .anticon-arrow-up { |
| | | right: 85px; |
| | | } |
| | | .ant-tabs-nav-container-scrolling { |
| | | margin-right: 50px; |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | handleTabGroup = (index, type) => { |
| | | let config = JSON.parse(JSON.stringify(this.state.config)) |
| | | |
| | | if (type === 'up') { |
| | | config.tabgroups.splice(index, 0, config.tabgroups.splice(index - 1, 1)[0]) |
| | | } else { |
| | | config.tabgroups.splice(index, 0, config.tabgroups.splice(index + 1, 1)[0]) |
| | | } |
| | | |
| | | this.setState({ |
| | | config: config |
| | | }) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '调整成功', |
| | | duration: 2 |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | | const { config, modaltype } = this.state |
| | | let _length = config.groups.length |
| | |
| | | {index === 0 ? <Tooltip placement="bottomLeft" overlayClassName="middle" title="在左侧工具栏《标签页》中,选择对应类型的标签页拖至此处添加。"> |
| | | <Icon type="question-circle" /> |
| | | </Tooltip> : null} |
| | | {index !== (this.state.config.tabgroups.length - 1) ? |
| | | <Icon type="arrow-down" onClick={() => {this.handleTabGroup(index, 'down')}} /> : null |
| | | } |
| | | {index !== 0 ? <Icon type="arrow-up" onClick={() => {this.handleTabGroup(index, 'up')}} /> : null} |
| | | {index === 0 ? <Icon type="plus" onClick={this.addTabGroup} /> : null} |
| | | {index !== 0 ? <Icon type="delete" onClick={() => {this.delTabGroup(groupId)}} /> : null} |
| | | <TabDragElement |
| | |
| | | } |
| | | > .anticon-plus { |
| | | position: absolute; |
| | | font-size: 24px; |
| | | font-size: 18px; |
| | | right: 25px; |
| | | top: 50px; |
| | | z-index: 1; |
| | | color: #26C281; |
| | | cursor: pointer; |
| | | } |
| | | > .anticon-delete { |
| | | position: absolute; |
| | | font-size: 24px; |
| | | font-size: 19px; |
| | | right: 25px; |
| | | top: 50px; |
| | | z-index: 1; |
| | | color: #ff4d4f; |
| | | cursor: pointer; |
| | | } |
| | | > .anticon-arrow-up { |
| | | position: absolute; |
| | | right: 55px; |
| | | font-size: 19px; |
| | | z-index: 1; |
| | | top: 50px; |
| | | color: #1890ff; |
| | | cursor: pointer; |
| | | } |
| | | > .anticon-arrow-down { |
| | | position: absolute; |
| | | right: 55px; |
| | | font-size: 19px; |
| | | z-index: 1; |
| | | top: 50px; |
| | | color: purple; |
| | | cursor: pointer; |
| | | } |
| | | > .anticon-arrow-down + .anticon-arrow-up { |
| | | right: 85px; |
| | | } |
| | | .ant-tabs-nav-container-scrolling { |
| | | margin-right: 50px; |
| | | } |
| | |
| | | <Col span={12}> |
| | | <Form.Item label="初始化"> |
| | | {getFieldDecorator('onload', { |
| | | initialValue: setting.onload || 'false' |
| | | initialValue: setting.onload || 'true' |
| | | })( |
| | | <Select> |
| | | <Select.Option value="true">加载数据</Select.Option> |
| | |
| | | {<div className="ant-row ant-form-item"> |
| | | <div className={'ant-col ant-form-item-label ant-col-xs-24 ' + labelCol}> |
| | | <label title={card.label}>{card.label}</label> |
| | | <Icon className="edit" type="edit" onClick={edit} /> |
| | | <Icon className="edit close" type="close" onClick={close} /> |
| | | <Icon className="edit copy" type="copy" onClick={copy} /> |
| | | </div> |
| | | <div className={'ant-col ant-form-item-control-wrapper ant-col-xs-24 ' + wrapCol}> |
| | | {card.type === 'text' && |
| | |
| | | </div> |
| | | </div>} |
| | | </div> |
| | | <Icon className="edit" type="edit" onClick={edit} /> |
| | | {/* <Icon className="edit" type="edit" onClick={edit} /> |
| | | <Icon className="edit close" type="close" onClick={close} /> |
| | | <Icon className="edit copy" type="copy" onClick={copy} /> |
| | | <Icon className="edit copy" type="copy" onClick={copy} /> */} |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | card={this.state.card} |
| | | formlist={this.state.formlist} |
| | | optionLibs={this.state.optionLibs} |
| | | inputSubmit={this.handleSubmit} |
| | | wrappedComponentRef={(inst) => this.formRef = inst} |
| | | />} |
| | | </Modal> |
| | |
| | | display: flex; |
| | | margin-bottom: 0px; |
| | | .ant-form-item-label { |
| | | overflow: visible; |
| | | position: relative; |
| | | height: 40px; |
| | | label { |
| | | width: 100%; |
| | |
| | | display: inline-block; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | } |
| | | .edit { |
| | | position: absolute; |
| | | right: 100px; |
| | | top: -5px; |
| | | color: #1890ff; |
| | | cursor: pointer; |
| | | display: none; |
| | | } |
| | | .edit.close { |
| | | right: 60px; |
| | | color: #ff4d4f; |
| | | } |
| | | .edit.copy { |
| | | right: 80px; |
| | | color: #26C281; |
| | | } |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | |
| | | width: 89.5%; |
| | | } |
| | | } |
| | | .edit { |
| | | position: absolute; |
| | | left: calc(33% - 100px); |
| | | top: 0px; |
| | | color: #1890ff; |
| | | cursor: pointer; |
| | | display: none; |
| | | } |
| | | .edit.close { |
| | | left: calc(33% - 60px); |
| | | color: #ff4d4f; |
| | | } |
| | | .edit.copy { |
| | | left: calc(33% - 80px); |
| | | color: #26C281; |
| | | } |
| | | } |
| | | .ant-col.textarea2 { |
| | | padding-left: 7px; |
| | | .page-card { |
| | | .edit { |
| | | left: calc(17% - 70px); |
| | | } |
| | | .edit.close { |
| | | left: calc(17% - 45px); |
| | | } |
| | | } |
| | | } |
| | | .ant-col.textarea3 .page-card { |
| | | .edit { |
| | | left: calc(11% - 70px); |
| | | } |
| | | .edit.close { |
| | | left: calc(11% - 45px); |
| | | } |
| | | } |
| | | .page-card:hover { |
| | | .ant-form-item { |
| | | .ant-form-item-label { |
| | | .edit { |
| | | display: inline-block; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .ant-calendar-picker { |
| | | min-width: 100px!important; |
| | | } |
| | |
| | | import VerifyCardExcelIn from '@/templates/tableshare/verifycardexcelin' |
| | | import VerifyCardExcelOut from '@/templates/tableshare/verifycardexcelout' |
| | | import MenuForm from '@/templates/tableshare/menuform' |
| | | import TransferForm from '@/components/transferform' |
| | | import SourceElement from '@/templates/tableshare/dragelement/source' |
| | | import Source from './source' |
| | | import './index.scss' |
| | |
| | | showColumnName: false, // 显示列字段名控制 |
| | | tabviews: [], // 所有标签页 |
| | | profileVisible: false, // 验证信息模态框 |
| | | optionLibs: null // 自定义下拉选项库 |
| | | optionLibs: null, // 自定义下拉选项库 |
| | | thawBtnVisible: false, // 解冻按钮弹窗 |
| | | thawbtnlist: null, // 解冻按钮列表 |
| | | thawButtons: [] // 已选择要解冻的按钮 |
| | | } |
| | | |
| | | /** |
| | |
| | | return item |
| | | }) |
| | | } |
| | | |
| | | // _config.uuid = Utils.getuuid() |
| | | // _config.action = _config.action.map(item => { |
| | | // let uuid = Utils.getuuid() |
| | | // if (item.OpenType === 'pop') { // 含有子配置项的按钮 |
| | | // _oriActions.push({ |
| | | // prebtn: JSON.parse(JSON.stringify(item)), |
| | | // curuuid: uuid, |
| | | // Template: 'Modal' |
| | | // }) |
| | | // } |
| | | |
| | | // item.uuid = uuid |
| | | // return item |
| | | // }) |
| | | |
| | | this.setState({ |
| | | originActions: _oriActions, |
| | |
| | | } |
| | | |
| | | deleteElement = (element) => { |
| | | const { thawButtons } = this.state |
| | | |
| | | let _this = this |
| | | confirm({ |
| | | content: `确定删除<<${element.card.label}>>吗?`, |
| | |
| | | // 删除按钮元素 |
| | | let _delActions = _this.state.delActions |
| | | if (element.type === 'action') { |
| | | _delActions.push(element.card.uuid) |
| | | _delActions.push(element) |
| | | } |
| | | |
| | | _this.setState({ |
| | | config: _config, |
| | | delActions: _delActions |
| | | delActions: _delActions, |
| | | thawButtons: thawButtons.filter(key => key !== element.card.uuid) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | |
| | | * @description 标签页保存 |
| | | */ |
| | | submitConfig = () => { |
| | | const { delActions, originConfig } = this.state |
| | | const { delActions, thawButtons, originConfig } = this.state |
| | | let config = JSON.parse(JSON.stringify(this.state.config)) |
| | | |
| | | this.menuformRef.handleConfirm().then(res => { |
| | |
| | | let deffers = delActions.map(item => { |
| | | let _param = { |
| | | func: 'sPC_MainMenu_Del', |
| | | MenuID: item |
| | | MenuID: item.card.uuid |
| | | } |
| | | |
| | | let _ParentParam = null |
| | | |
| | | try { |
| | | _ParentParam = window.btoa(window.encodeURIComponent(JSON.stringify(item.card))) |
| | | } catch (e) { |
| | | _ParentParam = null |
| | | } |
| | | |
| | | if (_ParentParam) { |
| | | _param.ParentParam = _ParentParam |
| | | } |
| | | |
| | | return new Promise(resolve => { |
| | | Api.getSystemConfig(_param).then(response => { |
| | | resolve(response) |
| | |
| | | }) |
| | | } else if (delActions.length === 0) { |
| | | resolve(true) |
| | | } |
| | | }).then(resp => { |
| | | if (resp === false) return |
| | | |
| | | if (thawButtons.length > 0) { |
| | | let defers = thawButtons.map(item => { |
| | | return new Promise((resolve) => { |
| | | Api.getSystemConfig({ |
| | | func: 'sPC_MainMenu_ReDel', |
| | | MenuID: item |
| | | }).then(res => { |
| | | if (res.status) { |
| | | resolve('') |
| | | } else { |
| | | resolve(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | }) |
| | | |
| | | return Promise.all(defers) |
| | | } else { |
| | | return true |
| | | } |
| | | }).then(res => { |
| | | if (res === true || res === false) return res |
| | | |
| | | let msg = res.filter(Boolean)[0] |
| | | if (msg) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: msg, |
| | | duration: 10 |
| | | }) |
| | | return false |
| | | } else { |
| | | this.setState({ |
| | | thawButtons: [] |
| | | }) |
| | | return true |
| | | } |
| | | }).then(resp => { |
| | | if (resp === false) return |
| | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 解冻按钮 |
| | | */ |
| | | handleThaw = () => { |
| | | const { config } = this.state |
| | | |
| | | this.setState({ |
| | | thawBtnVisible: true |
| | | }) |
| | | |
| | | Api.getSystemConfig({ |
| | | func: 'sPC_Get_FrozenMenu', |
| | | ParentID: config.uuid, |
| | | TYPE: 40 |
| | | }).then(res => { |
| | | if (res.status) { |
| | | let _list = [] |
| | | |
| | | res.data.forEach(menu => { |
| | | let _conf = '' |
| | | |
| | | if (menu.ParentParam) { |
| | | try { |
| | | _conf = JSON.parse(window.decodeURIComponent(window.atob(menu.ParentParam))) |
| | | } catch (e) { |
| | | _conf = '' |
| | | } |
| | | } |
| | | |
| | | if (_conf) { |
| | | _list.push({ |
| | | key: menu.MenuID, |
| | | title: menu.MenuName, |
| | | btnParam: _conf |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | this.setState({ |
| | | thawbtnlist: _list |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 解冻按钮提交 |
| | | */ |
| | | thawBtnSubmit = () => { |
| | | const { thawButtons, config, thawbtnlist } = this.state |
| | | // 三级菜单解除冻结 |
| | | if (this.refs.trawmenu.state.targetKeys.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: this.state.dict['form.required.select'] + this.state.dict['header.form.thawbutton'], |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | |
| | | thawbtnlist.forEach(item => { |
| | | if (this.refs.trawmenu.state.targetKeys.includes(item.key)) { |
| | | config.action.push(item.btnParam) |
| | | } |
| | | }) |
| | | |
| | | this.setState({ |
| | | thawButtons: [...thawButtons, ...this.refs.trawmenu.state.targetKeys], |
| | | config: config, |
| | | thawBtnVisible: false |
| | | }) |
| | | } |
| | | } |
| | | |
| | | render () { |
| | | const { modaltype } = this.state |
| | | const configAction = this.state.config.action.filter(_action => |
| | |
| | | {Source.actionItems.map((item, index) => { |
| | | return (<SourceElement key={index} content={item}/>) |
| | | })} |
| | | </div> |
| | | <div className="config-btn"> |
| | | {configAction.length > 0 ? |
| | | <p className="config-btn-title"> |
| | | <Tooltip placement="topLeft" title="点击按钮,可完成或查看按钮配置信息。"> |
| | | <Icon type="question-circle" /> |
| | | </Tooltip> |
| | | {this.state.dict['header.menu.action.configurable']} |
| | | </p> : null |
| | | } |
| | | <div className="thawbutton" title={this.state.dict['header.form.thawbutton']} onClick={this.handleThaw}> |
| | | <Icon type="unlock" /> |
| | | </div> |
| | | </div> |
| | | {configAction.length > 0 ? |
| | | <p className="config-btn-title"> |
| | |
| | | > |
| | | {this.state.dict['header.menu.config.placeholder']} |
| | | </Modal> |
| | | {/* 解冻按钮模态框 */} |
| | | <Modal |
| | | title={this.state.dict['header.form.thawbutton']} |
| | | okText={this.state.dict['header.confirm']} |
| | | cancelText={this.state.dict['header.cancel']} |
| | | visible={this.state.thawBtnVisible} |
| | | onOk={this.thawBtnSubmit} |
| | | onCancel={() => {this.setState({thawBtnVisible: false, thawbtnlist: null})}} |
| | | destroyOnClose |
| | | > |
| | | {!this.state.thawbtnlist && <Spin style={{marginLeft: 'calc(50% - 22px)', marginTop: '70px', marginBottom: '70px'}} size="large" />} |
| | | {this.state.thawbtnlist && <TransferForm ref="trawmenu" dict={this.state.dict} menulist={this.state.thawbtnlist}/>} |
| | | </Modal> |
| | | {this.state.loading && <Spin size="large" />} |
| | | </div> |
| | | ) |
| | |
| | | } |
| | | } |
| | | } |
| | | .config-btn { |
| | | position: relative; |
| | | |
| | | .config-btn-title { |
| | | margin-top: 20px; |
| | | margin-bottom: 10px; |
| | | color: #1890ff; |
| | | border-bottom: 1px solid #e8e8e8; |
| | | } |
| | | .thawbutton { |
| | | position: absolute; |
| | | right: 10px; |
| | | top: 0px; |
| | | padding: 0px; |
| | | cursor: pointer; |
| | | i { |
| | | font-size: 16px; |
| | | color: #1890ff; |
| | | } |
| | | } |
| | | } |
| | | .tables { |
| | | .ant-select-selection-selected-value { |
| | | opacity: 0.4!important; |
| | |
| | | dict: PropTypes.object, // 字典项 |
| | | optionLibs: PropTypes.any, // 自定义下拉集 |
| | | formlist: PropTypes.any, |
| | | card: PropTypes.object |
| | | card: PropTypes.object, |
| | | inputSubmit: PropTypes.any |
| | | } |
| | | |
| | | state = { |
| | |
| | | } |
| | | } |
| | | |
| | | handleSubmit = (e) => { |
| | | e.preventDefault() |
| | | |
| | | if (this.props.inputSubmit) { |
| | | this.props.inputSubmit() |
| | | } |
| | | } |
| | | |
| | | getFields() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const fields = [] |
| | |
| | | }, |
| | | ...rules |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" disabled={item.readonly} />)} |
| | | })(<Input placeholder="" autoComplete="off" disabled={item.readonly} onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | |
| | | message: this.props.dict['form.required.input'] + item.label + '!' |
| | | } |
| | | ] |
| | | })(<InputNumber min={0} max={18} precision={0} />)} |
| | | })(<InputNumber min={0} max={18} precision={0} onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | |
| | | message: this.props.dict['form.required.input'] + item.label + '!' |
| | | } |
| | | ] |
| | | })(<InputNumber min={1} precision={0} />)} |
| | | })(<InputNumber min={1} precision={0} onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | |
| | | message: this.props.dict['form.required.input'] + item.label + '!' |
| | | } |
| | | ] |
| | | })(<InputNumber />)} |
| | | })(<InputNumber onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | |
| | | import './index.scss' |
| | | |
| | | class PrintTemplate extends Component { |
| | | state = { |
| | | ID: null |
| | | } |
| | | |
| | | componentDidMount () { |
| | | let _param = window.atob(this.props.match.params.param) |
| | | let _params = {} |
| | | _param.split('&').forEach(cell => { |
| | | let _cell = cell.split('=') |
| | | _params[_cell[0]] = _cell[1] |
| | | }) |
| | | |
| | | this.setState({ |
| | | ID: _params.ID |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | | return ( |
| | | <div className="print-template"> |