| | |
| | | initialValue: _initval, |
| | | rules: [ |
| | | { |
| | | required: item.required === 'true', |
| | | required: true, |
| | | message: this.props.dict['form.required.input'] + item.label + '!' |
| | | } |
| | | ] |
| | |
| | | let keys = groups.map(group => group.uuid) |
| | | |
| | | return ( |
| | | <Form {...formItemLayout}> |
| | | <Form {...formItemLayout} className="form-tab-form-field"> |
| | | <Collapse |
| | | defaultActiveKey={keys} |
| | | expandIconPosition='right' |
| | |
| | | .ant-advanced-search-form.main-form-field { |
| | | .form-tab-form-field { |
| | | position: relative; |
| | | padding: 0px 24px 20px; |
| | | padding: 0px; |
| | | .ant-form-item { |
| | | display: flex; |
| | | } |
| | |
| | | |
| | | let _arrField = [config.setting.primaryKey] // 字段集 , 默认添加主键 |
| | | |
| | | // if (this.props.param && this.props.param.arr_field) { // 使用显示列字段查询 |
| | | // _arrField = this.props.param.arr_field |
| | | // } else { |
| | | config.groups.forEach(group => { |
| | | group.sublist.forEach(item => { |
| | | if (!item.field) return |
| | |
| | | }) |
| | | }) |
| | | _arrField = _arrField.join(',') |
| | | // } |
| | | |
| | | // 权限过滤 |
| | | if (this.props.menuType !== 'HS') { |
| | |
| | | actions: config.action, |
| | | arr_field: _arrField, |
| | | primaryId: this.props.param.primaryId || '', |
| | | data: config.setting.datatype === 'query' ? null : this.props.param.data, |
| | | data: this.props.param.data || null, |
| | | BIDs: { |
| | | mainTable: this.props.param.primaryId || '', |
| | | mainTabledata: config.setting.datatype === 'query' ? '' : this.props.param.data |
| | | mainTable: config.setting.onload === 'true' ? (this.props.param.primaryId || '') : '', |
| | | mainTabledata: config.setting.onload === 'true' ? (config.setting.datatype === 'query' ? '' : this.props.param.data) : '' |
| | | } |
| | | }, () => { |
| | | this.improveSelectOption(config.groups) |
| | | |
| | | if (config.setting.datatype === 'query' && this.props.param.primaryId) { |
| | | this.loadmaindata() |
| | | if (config.setting.datatype === 'query' && config.setting.onload === 'true') { |
| | | if (!this.props.param.primaryId) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到主键ID!', |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | this.loadmaindata() |
| | | } |
| | | } else if (config.setting.datatype !== 'query' && (!this.props.param.primaryId || !this.props.param.data)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到主表数据!', |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | |
| | | * @description 主表数据加载 |
| | | */ |
| | | async loadmaindata () { |
| | | const { setting, BIDs } = this.state |
| | | const { setting, BIDs, config } = this.state |
| | | |
| | | if (setting.datatype !== 'query') { |
| | | notification.warning({ |
| | |
| | | |
| | | if (_data) { |
| | | _primaryId = _data[setting.primaryKey] || '' |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未查询到数据信息!', |
| | | duration: 10 |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | mainTabledata: _data |
| | | } |
| | | }) |
| | | |
| | | if (_data && (setting.interType !== 'inner' || (setting.interType === 'inner' && setting.innerFunc))) { |
| | | let keys = Object.keys(_data) |
| | | let emptys = [] |
| | | |
| | | if (!keys.includes(config.setting.primaryKey)) { |
| | | emptys.push(config.setting.primaryKey) |
| | | } |
| | | |
| | | config.groups.forEach(group => { |
| | | group.sublist.forEach(item => { |
| | | if (!keys.includes(item.field)) { |
| | | emptys.push(item.field + '(' + item.label + ')') |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | if (emptys.length > 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未查询到' + emptys.join(', ') + '字段信息!', |
| | | duration: 10 |
| | | }) |
| | | } |
| | | } |
| | | } else { |
| | | notification.error({ |
| | | top: 92, |
| | |
| | | item.resourceType === '0' && |
| | | item.options && item.options.length > 0 |
| | | ) { |
| | | optionLibs.set(item.uuid, { |
| | | uuid: item.uuid, |
| | | optionLibs.set(menu.MenuID + item.uuid, { |
| | | uuid: menu.MenuID + item.uuid, |
| | | label: item.label, |
| | | parname: menu.MenuName, |
| | | type: 'search', |
| | |
| | | res.resourceType === '0' && |
| | | res.options && res.options.length > 0 |
| | | ) { |
| | | optionLibs.set(res.uuid, { |
| | | uuid: res.uuid, |
| | | optionLibs.set(menu.MenuID + res.uuid, { |
| | | uuid: menu.MenuID + res.uuid, |
| | | label: res.label, |
| | | parname: menu.MenuName, |
| | | type: 'search', |
| | |
| | | <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" title="编辑" type="edit" onClick={edit} /> |
| | | <Icon className="edit close" title="删除" type="close" onClick={del} /> |
| | | </div> |
| | | <div className={'ant-col ant-form-item-control-wrapper ant-col-xs-24 ' + wrapCol}> |
| | | {card.type === 'text' ? |
| | |
| | | </Button> : null |
| | | } |
| | | </div> |
| | | <Icon className="edit" title="编辑" type="edit" onClick={edit} /> |
| | | {type === 'action' ? <Icon className="edit" title="编辑" type="edit" onClick={edit} /> : null} |
| | | {type === 'action' && card.btnType === 'confirm' && card.intertype === 'inner' && !card.innerFunc ? |
| | | <Icon className="edit profile" title="校验规则" type="profile" onClick={profile} /> : null |
| | | } |
| | | {card.btnType !== 'confirm' && card.btnType !== 'cancel' && <Icon className="edit close" title="删除" type="close" onClick={del} />} |
| | | {type === 'action' && card.btnType !== 'confirm' && card.btnType !== 'cancel' && <Icon className="edit close" title="删除" type="close" onClick={del} />} |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | item.resourceType === '0' && |
| | | item.options && item.options.length > 0 |
| | | ) { |
| | | optionLibs.set(item.uuid, { |
| | | uuid: item.uuid, |
| | | optionLibs.set(btnTab.uuid + item.uuid, { |
| | | uuid: btnTab.uuid + item.uuid, |
| | | label: item.label, |
| | | parname: btnTab.label, |
| | | type: 'Modal', |
| | |
| | | res.resourceType === '0' && |
| | | res.options && res.options.length > 0 |
| | | ) { |
| | | optionLibs.set(res.uuid, { |
| | | uuid: res.uuid, |
| | | optionLibs.set(btnTab.uuid + res.uuid, { |
| | | uuid: btnTab.uuid + res.uuid, |
| | | label: res.label, |
| | | parname: btnTab.label, |
| | | type: 'Modal', |
| | |
| | | let btnParam = { // 添加菜单按钮 |
| | | func: 'sPC_Button_AddUpt', |
| | | Type: 60, // 添加按钮表单页下的按钮 |
| | | ParentID: menu.MenuID, |
| | | ParentID: btnTab.uuid, |
| | | MenuNo: menu.MenuNo, |
| | | Template: menu.PageParam.Template || '', |
| | | PageParam: '', |
| | |
| | | setting={config.setting} |
| | | handleMenu={this.handleSearch} |
| | | deleteMenu={this.deleteElement} |
| | | placeholder={this.state.dict['header.form.search.placeholder']} |
| | | placeholder={this.state.dict['header.form.modal.placeholder']} |
| | | /> |
| | | </Panel> |
| | | ))} |
| | |
| | | display: flex; |
| | | margin-bottom: 0px; |
| | | .ant-form-item-label { |
| | | overflow: visible; |
| | | label { |
| | | width: 100%; |
| | | cursor: move; |
| | |
| | | } |
| | | .edit { |
| | | position: absolute; |
| | | left: calc(34% - 100px); |
| | | top: 5px; |
| | | // left: calc(34% - 100px); |
| | | right: 100px; |
| | | top: -5px; |
| | | color: #1890ff; |
| | | cursor: pointer; |
| | | display: none; |
| | | } |
| | | .edit.close { |
| | | left: calc(34% - 80px); |
| | | // left: calc(34% - 80px); |
| | | right: 80px; |
| | | color: #ff4d4f; |
| | | } |
| | | } |
| | |
| | | })(<InputNumber min={10} max={100} precision={0} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label="初始化"> |
| | | {getFieldDecorator('onload', { |
| | | initialValue: setting.onload || 'false' |
| | | })( |
| | | <Select> |
| | | <Select.Option value="true">加载数据</Select.Option> |
| | | <Select.Option value="false">不加载数据</Select.Option> |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | ) |
| | |
| | | item.resourceType === '0' && |
| | | item.options && item.options.length > 0 |
| | | ) { |
| | | optionLibs.set(item.uuid, { |
| | | uuid: item.uuid, |
| | | optionLibs.set(editAction.uuid + item.uuid, { |
| | | uuid: editAction.uuid + item.uuid, |
| | | label: item.label, |
| | | parname: editAction.label, |
| | | type: 'Modal', |
| | |
| | | item.resourceType === '0' && |
| | | item.options && item.options.length > 0 |
| | | ) { |
| | | optionLibs.set(item.uuid, { |
| | | uuid: item.uuid, |
| | | optionLibs.set(editAction.uuid + item.uuid, { |
| | | uuid: editAction.uuid + item.uuid, |
| | | label: item.label, |
| | | parname: editAction.label, |
| | | type: 'Modal', |
| | |
| | | res.resourceType === '0' && |
| | | res.options && res.options.length > 0 |
| | | ) { |
| | | optionLibs.set(res.uuid, { |
| | | uuid: res.uuid, |
| | | optionLibs.set(editAction.uuid + res.uuid, { |
| | | uuid: editAction.uuid + res.uuid, |
| | | label: res.label, |
| | | parname: editAction.label, |
| | | type: 'Modal', |
| | |
| | | item.resourceType === '0' && |
| | | item.options && item.options.length > 0 |
| | | ) { |
| | | optionLibs.set(item.uuid, { |
| | | uuid: item.uuid, |
| | | optionLibs.set(_config.uuid + item.uuid, { |
| | | uuid: _config.uuid + item.uuid, |
| | | label: item.label, |
| | | parname: _config.tabName, |
| | | type: 'search', |
| | |
| | | res.resourceType === '0' && |
| | | res.options && res.options.length > 0 |
| | | ) { |
| | | optionLibs.set(res.uuid, { |
| | | uuid: res.uuid, |
| | | optionLibs.set(config.uuid + res.uuid, { |
| | | uuid: config.uuid + res.uuid, |
| | | label: res.label, |
| | | parname: config.tabName, |
| | | type: 'search', |
| | |
| | | form.options = matchReg.daterange |
| | | } |
| | | } else if (form.key === 'quick') { |
| | | form.options = [...optionLibs.values()].filter(cell => cell.uuid !== this.props.card.uuid) |
| | | form.options = form.options.map(cell => { |
| | | form.options = [...optionLibs.values()].map(cell => { |
| | | return { |
| | | value: cell.uuid, |
| | | text: cell.label + '(' + cell.parname + ')' |
| | |
| | | form.initVal = form.initVal || 0 |
| | | form.required = true |
| | | } else if (form.key === 'quick') { |
| | | form.options = [...optionLibs.values()].filter(cell => cell.uuid !== this.props.card.uuid) |
| | | form.options = form.options.map(cell => { |
| | | form.options = [...optionLibs.values()].map(cell => { |
| | | return { |
| | | value: cell.uuid, |
| | | text: cell.label + '(' + cell.parname + ')' |