| | |
| | | tabParam: null, // 表单标签参数 |
| | | refreshtabs: null, // 需要刷新的标签集 |
| | | confirmLoading: false,// 自定义设置模态框加载中 |
| | | revertLoading: false, // 恢复默认设置 |
| | | settingVisible: false,// 自定义设置模态框 |
| | | triggerBtn: null, // 点击表格中或快捷键触发的按钮 |
| | | tabActive: null // 标签页展开控制 |
| | |
| | | * @description 获取页面配置信息 |
| | | */ |
| | | async loadconfig () { |
| | | const { permAction, param } = this.props |
| | | const { permAction, permMenus, param } = this.props |
| | | |
| | | let _param = { |
| | | func: 'sPC_Get_LongParam', |
| | |
| | | }) |
| | | |
| | | // 生成显示列,处理合并列中的字段 |
| | | config.columns.forEach(col => { |
| | | config.columns.forEach((col, index) => { |
| | | if (_hideCol.includes(col.uuid)) return |
| | | |
| | | // if (col.linkThdMenu && !permAction[col.linkThdMenu.MenuID]) { |
| | | // col.linkThdMenu = '' |
| | | // } |
| | | if (col.linkThdMenu && !permMenus[col.linkThdMenu.MenuID]) { |
| | | col.linkThdMenu = '' |
| | | } |
| | | |
| | | col.sort = index |
| | | |
| | | if (col.type === 'colspan' && col.sublist) { |
| | | let _col = JSON.parse(JSON.stringify(col)) |
| | |
| | | }) |
| | | } |
| | | |
| | | let valid = true // 搜索条件必填验证 |
| | | config.search.forEach(item => { |
| | | if (item.type === 'text' && param && param.searchkey === item.field) { |
| | | item.initval = param.searchval |
| | | let valid = true // 搜索条件必填验证, 初始搜索条件 |
| | | let initSearch = config.search.map(item => { |
| | | let _item = JSON.parse(JSON.stringify(item)) |
| | | if (_item.type === 'text' && param && param.searchkey === _item.field) { |
| | | _item.initval = param.searchval |
| | | } |
| | | |
| | | if (item.required === 'true' && !item.initval) { |
| | | if (_item.required === 'true' && !_item.initval) { |
| | | valid = false |
| | | } |
| | | return _item |
| | | }) |
| | | |
| | | if (_curUserConfig) { |
| | |
| | | columns: _columns, |
| | | logcolumns: _logcolumns, |
| | | arr_field: _arrField.join(','), |
| | | search: Utils.initMainSearch(config.search) // 搜索条件初始化(含有时间格式,需要转化) |
| | | search: Utils.initMainSearch(initSearch) // 搜索条件初始化(含有时间格式,需要转化) |
| | | }, () => { |
| | | this.improveSearch() |
| | | if (config.setting.onload !== 'false' && valid) { // 初始化可加载 |
| | |
| | | controlCustomSetting = () => { |
| | | this.setState({ |
| | | settingVisible: true, |
| | | confirmLoading: false |
| | | confirmLoading: false, |
| | | revertLoading: false |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | this.props.modifyTabview(tabs) |
| | | } |
| | | |
| | | settingRevert = () => { |
| | | let param = { |
| | | func: 's_TrdMenu_UserParam_del', |
| | | MenuID: this.props.MenuID |
| | | } |
| | | this.setState({ |
| | | revertLoading: true |
| | | }) |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | if (!result.status) { |
| | | this.setState({ |
| | | revertLoading: false |
| | | }) |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | this.setState({ |
| | | settingVisible: false, |
| | | revertLoading: false |
| | | }, () => { |
| | | window.GLOB.CacheMap = new Map() |
| | | this.reloadview() |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | settingSubmit = () => { |
| | |
| | | maskClosable={false} |
| | | width={950} |
| | | visible={this.state.settingVisible} |
| | | onOk={this.settingSubmit} |
| | | onCancel={() => { this.setState({ settingVisible: false }) }} |
| | | confirmLoading={this.state.confirmLoading} |
| | | footer={[ |
| | | <Button key="revert" type="danger" loading={this.state.revertLoading} onClick={this.settingRevert}>{this.state.dict['main.revert.default']}</Button>, |
| | | <Button key="cancel" onClick={() => { this.setState({ settingVisible: false }) }}>{this.state.dict['main.cancel']}</Button>, |
| | | <Button key="confirm" type="primary" loading={this.state.confirmLoading} onClick={this.settingSubmit}>{this.state.dict['main.confirm']}</Button> |
| | | ]} |
| | | destroyOnClose |
| | | > |
| | | {this.state.settingVisible ? |
| | |
| | | tabviews: state.tabviews, |
| | | refreshTab: state.refreshTab, |
| | | permAction: state.permAction, |
| | | permMenus: state.permMenus, |
| | | permRoles: state.permRoles |
| | | } |
| | | } |