| | |
| | | _menu.supMenuList = this.props.supMenuList |
| | | _menu.fstMenuId = this.state.fstMenuId || '' |
| | | _menu.fstMenuList = this.state.fstMenuList || [] |
| | | _menu.open_edition = res.open_edition || '' |
| | | |
| | | // 检测模板是否存在 |
| | | let _Template = this.state.sysTemplates.filter(temp => temp.type === _menu.PageParam.Template) |
| | |
| | | this.loadmaindata() |
| | | }) |
| | | } else { |
| | | this.refs.mainTable.resetTable() |
| | | this.refs.mainTable && this.refs.mainTable.resetTable() |
| | | |
| | | this.setState({ |
| | | pageIndex: 1, |
| | |
| | | * @description 表格刷新 |
| | | */ |
| | | reloadtable = () => { |
| | | this.refs.mainTable.resetTable() |
| | | this.refs.mainTable && this.refs.mainTable.resetTable() |
| | | this.setState({ |
| | | pageIndex: 1 |
| | | }, () => { |
| | |
| | | */ |
| | | gettableselected = () => { |
| | | let data = [] |
| | | this.refs.mainTable.state.selectedRowKeys.forEach(item => { |
| | | this.refs.mainTable && this.refs.mainTable.state.selectedRowKeys.forEach(item => { |
| | | data.push(this.refs.mainTable.props.data[item]) |
| | | }) |
| | | return data |
| | |
| | | */ |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | if (this.state.config && this.props.Tab.supMenu && !is(fromJS(this.props.BID), fromJS(nextProps.BID))) { |
| | | this.refs.subTable.resetTable() |
| | | this.refs.subTable && this.refs.subTable.resetTable() |
| | | this.loadmaindata(nextProps.BID, 'refresh') |
| | | } else if (this.state.config && nextProps.refreshtabs && nextProps.refreshtabs.includes(this.props.Tab.uuid)) { |
| | | this.reloadtable() |
| | |
| | | |
| | | let regoptions = null |
| | | if (setting.queryType === 'statistics' || param.custom_script) { |
| | | let allSearch = Utils.getAllSearchOptions(search) |
| | | let allSearch = Utils.getAllSearchOptions(searches) |
| | | |
| | | regoptions = allSearch.map(item => { |
| | | return { |
| | |
| | | * 含有初始不加载的页面,修改设置 |
| | | */ |
| | | refreshbysearch = (searches) => { |
| | | this.refs.subTable.resetTable() |
| | | this.refs.subTable && this.refs.subTable.resetTable() |
| | | |
| | | this.setState({ |
| | | pageIndex: 1, |
| | |
| | | * @description 表格刷新 |
| | | */ |
| | | reloadtable = () => { |
| | | this.refs.subTable.resetTable() |
| | | this.refs.subTable && this.refs.subTable.resetTable() |
| | | this.setState({ |
| | | pageIndex: 1 |
| | | }, () => { |
| | |
| | | */ |
| | | gettableselected = () => { |
| | | let data = [] |
| | | this.refs.subTable.state.selectedRowKeys.forEach(item => { |
| | | this.refs.subTable && this.refs.subTable.state.selectedRowKeys.forEach(item => { |
| | | data.push(this.refs.subTable.props.data[item]) |
| | | }) |
| | | return data |
| | |
| | | * 含有初始不加载的页面,修改设置 |
| | | */ |
| | | refreshbysearch = (searches) => { |
| | | this.refs.subTable.resetTable() |
| | | this.refs.subTable && this.refs.subTable.resetTable() |
| | | |
| | | this.setState({ |
| | | pageIndex: 1, |
| | |
| | | * @description 表格刷新 |
| | | */ |
| | | reloadtable = () => { |
| | | this.refs.subTable.resetTable() |
| | | this.refs.subTable && this.refs.subTable.resetTable() |
| | | this.setState({ |
| | | pageIndex: 1 |
| | | }, () => { |
| | |
| | | */ |
| | | gettableselected = () => { |
| | | let data = [] |
| | | this.refs.subTable.state.selectedRowKeys.forEach(item => { |
| | | this.refs.subTable && this.refs.subTable.state.selectedRowKeys.forEach(item => { |
| | | data.push(this.refs.subTable.props.data[item]) |
| | | }) |
| | | return data |
| | |
| | | thawButtons: [], // 已选择要解冻的按钮 |
| | | activeKey: '0', // 默认展开基本信息 |
| | | chartview: null, // 当前视图 |
| | | pasteContent: null // 粘贴配置信息 |
| | | pasteContent: null, // 粘贴配置信息 |
| | | openEdition: '' // 编辑版本标记,防止多人操作 |
| | | } |
| | | |
| | | /** |
| | |
| | | this.setState({ |
| | | chartview: _config.charts[0].uuid, |
| | | config: _config, |
| | | openEdition: menu.open_edition || '', |
| | | activeKey: menu.activeKey || '0', |
| | | optionLibs: optionLibs, |
| | | originActions: _oriActions, |
| | |
| | | */ |
| | | submitConfig = () => { |
| | | const { menu } = this.props |
| | | const { originMenu, delActions, thawButtons } = this.state |
| | | const { originMenu, delActions, thawButtons, openEdition } = this.state |
| | | |
| | | let config = fromJS(this.state.config).toJS() |
| | | |
| | |
| | | if (resp === false) return |
| | | let localParam = fromJS(param).toJS() |
| | | |
| | | if (openEdition) { |
| | | param.open_edition = openEdition |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(response => { |
| | | if (response.status) { |
| | | let _FMenu = originMenu.fstMenuList.filter(fstM => fstM.MenuID === res.fstMenuId)[0] |
| | |
| | | |
| | | this.setState({ |
| | | config: _config, |
| | | openEdition: response.open_edition || '', |
| | | originMenu: { |
| | | ...originMenu, |
| | | LongParam: _config, |
| | |
| | | subConfig: '', |
| | | tabview: _view |
| | | } |
| | | |
| | | // 当子表使用主页搜索条件时,将主页搜索向下传递 |
| | | if (param.editTab && param.editTab.searchPass === 'true') { |
| | | param.editTab.mainsearch = fromJS(_config.search).toJS() |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: true |
| | |
| | | param.subConfig = _LongParam |
| | | } |
| | | |
| | | if (param.editTab) { |
| | | param.editTab.open_edition = res.open_edition || '' |
| | | } else if (param.editAction) { |
| | | param.editAction.open_edition = res.open_edition || '' |
| | | } else if (param.btnTab) { |
| | | param.btnTab.open_edition = res.open_edition || '' |
| | | } |
| | | |
| | | this.props.handleView(param) |
| | | } else { |
| | | this.setState({ |
| | |
| | | optionLibs: null, // 自定义下拉选项库 |
| | | activeKey: '0', // 默认展开基本信息 |
| | | pasteVisible: false, // 粘贴模态框 |
| | | sqlVerifing: false // sql验证 |
| | | sqlVerifing: false, // sql验证 |
| | | openEdition: '' // 编辑版本标记,防止多人操作 |
| | | } |
| | | |
| | | /** |
| | |
| | | this.setState({ |
| | | config: _config, |
| | | activeKey: btnTab.activeKey || '0', |
| | | openEdition: btnTab.open_edition || '', |
| | | optionLibs: optionLibs, |
| | | columns: columns, |
| | | originMenu: JSON.parse(JSON.stringify(_config)), |
| | |
| | | */ |
| | | submitConfig = () => { |
| | | const { menu, btnTab } = this.props |
| | | const { delActions } = this.state |
| | | const { delActions, openEdition } = this.state |
| | | |
| | | let config = JSON.parse(JSON.stringify(this.state.config)) |
| | | |
| | |
| | | LongParam: _LongParam |
| | | } |
| | | |
| | | if (openEdition) { |
| | | param.open_edition = openEdition |
| | | } |
| | | |
| | | // 有按钮或标签删除时,先进行删除操作 |
| | | // 删除成功后,保存页面配置 |
| | | new Promise(resolve => { |
| | |
| | | Api.getSystemConfig(param).then(response => { |
| | | if (response.status) { |
| | | this.setState({ |
| | | openEdition: response.open_edition || '', |
| | | config: _config, |
| | | originMenu: _config |
| | | }) |
| | |
| | | param.subConfig = _LongParam |
| | | } |
| | | |
| | | if (param.editTab) { |
| | | param.editTab.open_edition = res.open_edition || '' |
| | | } |
| | | |
| | | this.props.handleView(param) |
| | | } else { |
| | | this.setState({ |
| | |
| | | optionLibs: null, // 自定义下拉选项库 |
| | | sources: null, // 表单类型 |
| | | pasteVisible: null, // 表单粘贴 |
| | | sqlVerifing: false // sql验证 |
| | | sqlVerifing: false, // sql验证 |
| | | openEdition: '' // 编辑版本标记,防止多人操作 |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | this.setState({ |
| | | openEdition: editAction.open_edition || '', |
| | | menu: _menu, |
| | | source: _source, |
| | | optionLibs: optionLibs, |
| | |
| | | |
| | | submitConfig = () => { |
| | | const { editAction } = this.props |
| | | const { config, menu } = this.state |
| | | const { config, menu, openEdition } = this.state |
| | | |
| | | if ((!config.groups[0] && !config.fields[0]) || (config.fields[0] && config.fields[0].origin)) { |
| | | notification.warning({ |
| | |
| | | LongParam: _LongParam |
| | | } |
| | | |
| | | if (openEdition) { |
| | | param.open_edition = openEdition |
| | | } |
| | | |
| | | if (this.state.closeVisible) { |
| | | this.setState({ |
| | | closeloading: true |
| | |
| | | Api.getSystemConfig(param).then(response => { |
| | | if (response.status) { |
| | | this.setState({ |
| | | openEdition: response.open_edition || '', |
| | | menuloading: false, |
| | | closeloading: false, |
| | | closeVisible: false, |
| | |
| | | |
| | | state = { |
| | | formlist: null, |
| | | columns: null |
| | | columns: null, |
| | | actions: [] |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { card } = this.props |
| | | |
| | | let columns = this.props.formlist.filter(item => item.key === 'field')[0].options |
| | | let actions = [] |
| | | if (card.actions) { |
| | | actions = this.props.formlist.filter(item => item.key === 'actions')[0].options |
| | | } |
| | | |
| | | this.setState({ |
| | | columns: columns, |
| | | actions: actions, |
| | | formlist: this.props.formlist.map(item => { |
| | | if (item.key === 'content' && card.datatype === 'dynamic') { |
| | | item.hidden = true |
| | |
| | | const { getFieldDecorator } = this.props.form |
| | | const fields = [] |
| | | this.state.formlist.forEach((item, index) => { |
| | | if (item.hidden) return |
| | | if (item.hidden || item.forbid) return |
| | | |
| | | if (item.type === 'text') { // 文本搜索 |
| | | fields.push( |
| | |
| | | |
| | | |
| | | handleConfirm = () => { |
| | | const { columns } = this.state |
| | | const { columns, actions } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | values.uuid = this.props.card.uuid || '' |
| | | if (this.props.card.uuid) { |
| | | values.uuid = this.props.card.uuid |
| | | } |
| | | |
| | | if (values.field && !values.content) { |
| | | values.content = columns.filter(col => col.value === values.field)[0].text |
| | | } |
| | | if (values.actions) { |
| | | values.actions = values.actions.map(item => actions.filter(action => action.value === item)[0]) |
| | | } |
| | | |
| | | resolve(values) |
| | | } else { |
| | |
| | | |
| | | state = { |
| | | dict: (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS, |
| | | visible: false, |
| | | modaltype: '', |
| | | formlist: null, |
| | | cardcell: null // 卡片元素 |
| | | } |
| | |
| | | |
| | | this.setState({ |
| | | cardcell: _cell, |
| | | visible: true, |
| | | formlist: getCardDetailForm(_cell, _columns) |
| | | modaltype: 'detail', |
| | | formlist: getCardDetailForm(_cell, _columns, 'detail') |
| | | }) |
| | | } |
| | | |
| | | editHeader = () => { |
| | | const { config, card } = this.props |
| | | |
| | | let _columns = config.columns.filter(col => ['text', 'number'].includes(col.type)) |
| | | _columns = _columns.map(col => { |
| | | return { |
| | | uuid: col.uuid, |
| | | value: col.field, |
| | | text: col.label |
| | | } |
| | | }) |
| | | let _actions = config.action.filter(item => item.position === 'grid') |
| | | |
| | | _actions = _actions.map(item => { |
| | | return { |
| | | value: item.uuid, |
| | | icon: item.icon, |
| | | text: item.label |
| | | } |
| | | }) |
| | | |
| | | let _cell = fromJS(card.header).toJS() |
| | | if (_columns.filter(col => col.value === _cell.field).length === 0) { |
| | | _cell.field = '' |
| | | } |
| | | if (_cell.actions.length > 0) { |
| | | let actionIds = _actions.map(item => item.value) |
| | | _cell.actions = _cell.actions.filter(item => actionIds.includes(item.value)) |
| | | } |
| | | |
| | | this.setState({ |
| | | cardcell: _cell, |
| | | modaltype: 'header', |
| | | formlist: getCardDetailForm(_cell, _columns, 'header', _actions) |
| | | }) |
| | | } |
| | | |
| | | handleSubmit = () => { |
| | | const { card } = this.props |
| | | let _details = fromJS(card.details).toJS() |
| | | const { modaltype } = this.state |
| | | |
| | | this.detailFormRef.handleConfirm().then(res => { |
| | | if (!res.uuid) { |
| | | res.uuid = Utils.getuuid() |
| | | _details.push(res) |
| | | } else { |
| | | _details = _details.map(item => { |
| | | if (item.uuid === res.uuid) return res |
| | | return item |
| | | this.cardFormRef.handleConfirm().then(res => { |
| | | if (modaltype === 'detail') { |
| | | let _details = fromJS(this.props.card.details).toJS() |
| | | if (!res.uuid) { |
| | | res.uuid = Utils.getuuid() |
| | | _details.push(res) |
| | | } else { |
| | | _details = _details.map(item => { |
| | | if (item.uuid === res.uuid) return res |
| | | return item |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | cardcell: null, |
| | | modaltype: '', |
| | | formlist: null |
| | | }) |
| | | this.plotChange({details: _details}) |
| | | } else if (modaltype === 'header') { |
| | | let _header = fromJS(this.props.card.header).toJS() |
| | | _header.content = res.content |
| | | _header.datatype = res.datatype |
| | | _header.field = res.field |
| | | _header.actions = res.actions |
| | | |
| | | this.setState({ |
| | | cardcell: null, |
| | | modaltype: '', |
| | | formlist: null |
| | | }) |
| | | this.plotChange({header: _header}) |
| | | } |
| | | |
| | | this.setState({ |
| | | cardcell: null, |
| | | visible: false, |
| | | formlist: null |
| | | }) |
| | | this.plotChange({details: _details}) |
| | | }) |
| | | } |
| | | |
| | | editModalCancel = () => { |
| | | this.setState({ |
| | | cardcell: null, |
| | | visible: false, |
| | | modaltype: '', |
| | | formlist: null |
| | | }) |
| | | } |
| | |
| | | |
| | | render() { |
| | | const { card } = this.props |
| | | const { dict, visible, cardcell } = this.state |
| | | const { dict, modaltype, cardcell } = this.state |
| | | let _width = '100%' |
| | | if (card.actions.length > 0) { |
| | | _width = Math.floor((100 / card.actions.length) * 10000) / 10000 + '%' |
| | |
| | | <div className="ant-card-head"> |
| | | <Icon className="edit" title="Edit" type="edit" onClick={this.editHeader} /> |
| | | <div className="ant-card-head-wrapper"> |
| | | <div className="ant-card-head-title">{card.header.title.content}</div> |
| | | <div className="ant-card-head-title">{card.header.content}</div> |
| | | <div className="ant-card-extra"> |
| | | <span>Action</span> |
| | | </div> |
| | |
| | | {card.subelement.includes('actions') ? |
| | | <ul className="ant-card-actions"> |
| | | <Icon className="edit" title="Edit" type="edit" onClick={this.editAction} /> |
| | | {card.actions.map(item => (<li style={{width: _width}}> |
| | | {card.actions.map((item, i) => (<li key={i} style={{width: _width}}> |
| | | <span> |
| | | <Icon type={item.icon || 'dash'}/> |
| | | </span> |
| | |
| | | {/* 显示列编辑 */} |
| | | <Modal |
| | | title="编辑" |
| | | visible={visible} |
| | | visible={!!modaltype} |
| | | width={650} |
| | | maskClosable={false} |
| | | onOk={this.handleSubmit} |
| | |
| | | card={cardcell} |
| | | inputSubmit={this.handleSubmit} |
| | | formlist={this.state.formlist} |
| | | wrappedComponentRef={(inst) => this.detailFormRef = inst} |
| | | wrappedComponentRef={(inst) => this.cardFormRef = inst} |
| | | /> |
| | | </Modal> |
| | | </div> |
| | |
| | | font-weight: 500; |
| | | } |
| | | .ant-card-extra { |
| | | cursor: pointer; |
| | | color: #1890ff; |
| | | } |
| | | } |
| | | .ant-card-actions { |
| | | height: 48px; |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | .ant-card-meta-avatar { |
| | | position: absolute; |
| | | top: 0px; |
| | | left: 0px; |
| | | top: -15px; |
| | | left: -15px; |
| | | padding-top: 15px; |
| | | padding-left: 15px; |
| | | } |
| | | // .ant-card-meta-avatar + .ant-card-meta-detail { |
| | | // float: left; |
| | |
| | | margin-left: 0px; |
| | | margin-right: 0px; |
| | | } |
| | | |
| | | .ant-card.chart-card { |
| | | .ant-card-head { |
| | | .edit { |
| | | position: absolute; |
| | | left: 0; |
| | | top: 5px; |
| | | font-size: 13px; |
| | | color: #1890ff; |
| | | cursor: pointer; |
| | | display: none; |
| | | padding: 0 5px; |
| | | } |
| | | } |
| | | .ant-card-head:hover { |
| | | .edit { |
| | | display: inline-block; |
| | | } |
| | | } |
| | | |
| | | .ant-card-actions { |
| | | position: relative; |
| | | .edit { |
| | | position: absolute; |
| | | left: 0; |
| | | top: 3px; |
| | | font-size: 13px; |
| | | color: #1890ff; |
| | | cursor: pointer; |
| | | display: none; |
| | | padding: 0 5px; |
| | | } |
| | | } |
| | | .ant-card-actions:hover { |
| | | .edit { |
| | | display: inline-block; |
| | | } |
| | | } |
| | | |
| | | .ant-card-meta-avatar { |
| | | position: relative; |
| | | .edit { |
| | | position: absolute; |
| | | left: 0; |
| | | top: 3px; |
| | | font-size: 13px; |
| | | color: #1890ff; |
| | | cursor: pointer; |
| | | display: none; |
| | | padding: 0 5px; |
| | | z-index: 1; |
| | | } |
| | | } |
| | | .ant-card-meta-avatar:hover { |
| | | .edit { |
| | | display: inline-block; |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | {bold: 'true', uuid: 'cardtitle', content: 'Card title', datatype: 'static', align: 'left'}, |
| | | {bold: 'false', uuid: 'carddescription', content: 'Card content', datatype: 'static', align: 'left'} |
| | | ] |
| | | result.actions = [] |
| | | result.actions = [{icon: 'edit'}, {icon: 'plus'}] |
| | | result.header = { |
| | | title: {content: 'Card title', datatype: 'static'}, |
| | | content: 'Card title', |
| | | datatype: 'static', |
| | | actions: [] |
| | | } |
| | | result.avatar = {content: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png', datatype: 'static', width: 32, height: 32} |
| | |
| | | background: unset!important; |
| | | } |
| | | } |
| | | |
| | | .ant-form-item { |
| | | white-space: nowrap; |
| | | } |
| | | } |
| | |
| | | class SettingComponent extends Component { |
| | | static propTpyes = { |
| | | type: PropTypes.string, // 菜单类型 |
| | | mainsearch: PropTypes.any, // 主表的搜索条件,当子表设置接收主表条件时有效 |
| | | MenuID: PropTypes.string, // 菜单ID |
| | | config: PropTypes.object, // 菜单配置信息 |
| | | permFuncField: PropTypes.array, // 存储过程可用开头字段 |
| | |
| | | * @description 全局设置触发 |
| | | */ |
| | | changeSetting = () => { |
| | | const { menuformRef, MenuID, config, type, permFuncField } = this.props |
| | | const { menuformRef, MenuID, config, type, permFuncField, mainsearch } = this.props |
| | | |
| | | let menu = {MenuID: MenuID} |
| | | |
| | |
| | | |
| | | _columns.unshift({value: '', text: '未设置'}) |
| | | |
| | | let _config = fromJS(config).toJS() |
| | | |
| | | if (mainsearch) { // 综合主页搜索及子表搜索条件 |
| | | _config.search = [..._config.search, ...mainsearch] |
| | | } |
| | | |
| | | this.setState({ |
| | | visible: true, |
| | | formlist: getSettingForm(config.setting, permFuncField, MenuID, primaryKey, _columns, type), |
| | | menu: menu |
| | | menu: menu, |
| | | config: _config |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config, type } = this.props |
| | | const { dict, visible } = this.state |
| | | const { type } = this.props |
| | | const { dict, visible, config } = this.state |
| | | |
| | | return ( |
| | | <div className="model-menu-setting"> |
| | |
| | | <SettingForm |
| | | type={type} |
| | | dict={dict} |
| | | menu={this.state.menu} |
| | | config={config} |
| | | menu={this.state.menu} |
| | | inputSubmit={this.settingSave} |
| | | formlist={this.state.formlist} |
| | | wrappedComponentRef={(inst) => this.settingRef = inst} |
| | |
| | | |
| | | class CustomForm extends Component { |
| | | static propTpyes = { |
| | | type: PropTypes.string, // 菜单类型 |
| | | dict: PropTypes.object, // 字典项 |
| | | setting: PropTypes.object, // 设置 |
| | | searches: PropTypes.array, // 搜索条件 |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { systemScripts, setting } = this.props |
| | | const { systemScripts, setting, type } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { usefulFields } = this.state |
| | | const formItemLayout = { |
| | |
| | | </Col> |
| | | <Col span={24} className="sqlfield"> |
| | | <Form.Item label={'可用字段'}> |
| | | id, bid, loginuid, sessionuid, userid, appkey, orderBy{setting.laypage !== 'false' ? ', pageSize, pageIndex': ''}{usefulFields ? ', ' + usefulFields : ''} |
| | | id, bid, loginuid, sessionuid, userid, appkey, {type === 'main' ? 'out_id, ' : '' }time_id, orderBy{setting.laypage !== 'false' ? ', pageSize, pageIndex': ''}{usefulFields ? ', ' + usefulFields : ''} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { config, type } = this.props |
| | | const { formlist, view, setting, scriptsColumns, systemScripts } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | <div className="model-table-setting-form-box" id="model-table-setting-form-box"> |
| | | {view ==='custom' ? <div> |
| | | <CustomScript |
| | | dict={this.props.dict} |
| | | type={type} |
| | | setting={setting} |
| | | dict={this.props.dict} |
| | | customScripts={setting.scripts} |
| | | searches={config.search} |
| | | systemScripts={systemScripts} |
| | |
| | | thawButtons: [], // 已选择要解冻的按钮 |
| | | activeKey: '0', // 默认展开基本信息 |
| | | chartview: null, // 当前视图 |
| | | pasteContent: null // 粘贴内容 |
| | | pasteContent: null, // 粘贴内容 |
| | | openEdition: '' // 编辑版本标记,防止多人操作 |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | this.setState({ |
| | | openEdition: editSubTab ? (editSubTab.open_edition || '') : (editTab.open_edition || ''), |
| | | chartview: _config.charts[0].uuid, |
| | | originActions: _oriActions, |
| | | optionLibs: optionLibs, |
| | |
| | | * @description 标签页保存 |
| | | */ |
| | | submitConfig = () => { |
| | | const { delActions, thawButtons, originConfig } = this.state |
| | | const { delActions, thawButtons, originConfig, openEdition } = this.state |
| | | let config = JSON.parse(JSON.stringify(this.state.config)) |
| | | let copyreg = /\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}:\d{2}$/ig |
| | | |
| | |
| | | LongParam: _LongParam |
| | | } |
| | | |
| | | if (openEdition) { |
| | | param.open_edition = openEdition |
| | | } |
| | | |
| | | // 有按钮或标签删除时,先进行删除操作 |
| | | // 删除成功后,保存页面配置 |
| | | new Promise(resolve => { |
| | |
| | | Api.getSystemConfig(param).then(response => { |
| | | if (response.status) { |
| | | this.setState({ |
| | | openEdition: response.open_edition || '', |
| | | config: _config, |
| | | originConfig: _config |
| | | }, () => { |
| | |
| | | param.subConfig = _LongParam |
| | | } |
| | | |
| | | if (param.editAction) { |
| | | param.editAction.open_edition = res.open_edition || '' |
| | | } else if (param.editSubTab) { |
| | | param.editSubTab.open_edition = res.open_edition || '' |
| | | } |
| | | |
| | | this.props.handleView(param) |
| | | } else { |
| | | this.setState({ |
| | |
| | | <SettingComponent |
| | | type="subtable" |
| | | config={config} |
| | | mainsearch={!this.props.editSubTab && this.props.editTab.mainsearch ? this.props.editTab.mainsearch : ''} |
| | | MenuID={config.uuid} |
| | | menuformRef={this.menuformRef} |
| | | permFuncField={this.props.permFuncField} |
| | |
| | | * @description 获取卡片详情表单配置信息 |
| | | * @param {object} card // 标签配置信息 |
| | | */ |
| | | export function getCardDetailForm (card, _columns) { |
| | | export function getCardDetailForm (card, _columns, _type, _actions = []) { |
| | | return [ |
| | | { |
| | | type: 'radio', |
| | |
| | | label: '加粗', |
| | | initVal: card.bold || 'false', |
| | | required: true, |
| | | forbid: _type !== 'detail', |
| | | options: [{ |
| | | value: 'true', |
| | | text: '是' |
| | |
| | | label: '宽度', |
| | | initVal: card.width || '', |
| | | required: false, |
| | | forbid: _type !== 'detail', |
| | | options: [{ |
| | | value: '', |
| | | text: '100%' |
| | |
| | | label: '对齐', |
| | | initVal: card.align || '', |
| | | required: false, |
| | | forbid: _type !== 'detail', |
| | | options: [{ |
| | | value: '', |
| | | text: '左' |
| | |
| | | value: 'align-right', |
| | | text: '右' |
| | | }] |
| | | } |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'actions', |
| | | label: '按钮组', |
| | | tooltip: '', |
| | | initVal: card.actions || [], |
| | | required: false, |
| | | forbid: _type !== 'header', |
| | | options: _actions |
| | | }, |
| | | ] |
| | | } |