| | |
| | | param.SessionUid = sessionStorage.getItem('SessionUid') || '' |
| | | param.LoginUID = sessionStorage.getItem('LoginUID') || '' |
| | | |
| | | if (param.func === 'RolesAdd') { // 角色添加时,传appkey |
| | | param.appkey = window.GLOB.appkey || '' |
| | | } |
| | | // if (param.func === 'RolesAdd') { // 角色添加时,传appkey(外部接口统一添加) |
| | | // param.appkey = window.GLOB.appkey || '' |
| | | // } |
| | | |
| | | param.nonc = Utils.getuuid() |
| | | |
| | |
| | | |
| | | if (process.env.NODE_ENV === 'production') { |
| | | let service = window.GLOB.service ? (/\/$/.test(window.GLOB.service) ? window.GLOB.service : window.GLOB.service + '/') : '' |
| | | window.GLOB.subSystemApi = document.location.origin + '/' + service + 'webapi/dostar' |
| | | window.GLOB.subSystemApi = document.location.origin + '/' + service + 'webapi/dostars' |
| | | } else { |
| | | window.GLOB.subSystemApi = 'http://qingqiumarket.cn/mkwms/webapi/dostar' |
| | | window.GLOB.subSystemApi = 'http://qingqiumarket.cn/mkwms/webapi/dostars' |
| | | } |
| | | |
| | | |
| | |
| | | if (setting.interType === 'inner') { |
| | | param.func = setting.innerFunc |
| | | } else { |
| | | param.rduri = setting.interface |
| | | if (setting.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | } else { |
| | | param.rduri = setting.interface |
| | | } |
| | | |
| | | param.appkey = window.GLOB.appkey || '' // 调用外部接口增加appkey |
| | | |
| | | if (setting.outerFunc) { |
| | | param.func = setting.outerFunc |
| | | } |
| | |
| | | if (setting.interType === 'inner') { |
| | | param.func = setting.innerFunc |
| | | } else { |
| | | param.rduri = setting.interface |
| | | if (setting.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | } else { |
| | | param.rduri = setting.interface |
| | | } |
| | | |
| | | param.appkey = window.GLOB.appkey || '' // 调用外部接口增加appkey |
| | | |
| | | if (setting.outerFunc) { |
| | | param.func = setting.outerFunc |
| | | } |
| | |
| | | if (setting.interType === 'inner') { |
| | | param.func = setting.innerFunc |
| | | } else { |
| | | param.rduri = setting.interface |
| | | if (setting.sysInterface === 'true') { |
| | | param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | } else { |
| | | param.rduri = setting.interface |
| | | } |
| | | |
| | | param.appkey = window.GLOB.appkey || '' // 调用外部接口增加appkey |
| | | |
| | | if (setting.outerFunc) { |
| | | param.func = setting.outerFunc |
| | | } |
| | |
| | | if (!res) return |
| | | // 外部请求 |
| | | _outParam = JSON.parse(JSON.stringify(res)) |
| | | |
| | | res.appkey = window.GLOB.appkey || '' // 外部请求时,统一添加appkey |
| | | |
| | | return Api.genericInterface(res) |
| | | }).then(response => { |
| | | if (!response) return |
| | |
| | | interType: this.props.data.interType || 'inner', |
| | | columns: this.props.columns.filter(item => item.field && item.type !== 'colspan'), |
| | | currentTabs: null, |
| | | selectTabs: [] |
| | | selectTabs: [], |
| | | interReadonly: false |
| | | } |
| | | |
| | | UNSAFE_componentWillMount() { |
| | |
| | | |
| | | this.setState({ |
| | | currentTabs: _tabs, |
| | | selectTabs: _select |
| | | selectTabs: _select, |
| | | interReadonly: data.sysInterface === 'true' |
| | | }) |
| | | } |
| | | |
| | |
| | | onChange = (e) => { |
| | | this.setState({ |
| | | interType: e.target.value |
| | | }, () => { |
| | | if (e.target.value === 'inner') return |
| | | |
| | | let _type = this.props.form.getFieldValue('sysInterface') |
| | | if (_type === 'true') { |
| | | this.props.form.setFieldsValue({ |
| | | interface: window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | }) |
| | | this.setState({ |
| | | interReadonly: true |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | interReadonly: false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | onSysChange = (e) => { |
| | | if (e.target.value === 'true') { |
| | | this.props.form.setFieldsValue({ |
| | | interface: window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | }) |
| | | this.setState({ |
| | | interReadonly: true |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | interReadonly: false |
| | | }) |
| | | } |
| | | } |
| | | |
| | | selectChange = (val) => { |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | {interType === 'outer' ? <Col span={12}> |
| | | <Form.Item label={dict['header.form.sysInterface']}> |
| | | {getFieldDecorator('sysInterface', { |
| | | initialValue: data.sysInterface || 'false' |
| | | })( |
| | | <Radio.Group onChange={this.onSysChange}> |
| | | <Radio value="true">{dict['header.form.true']}</Radio> |
| | | <Radio value="false">{dict['header.form.false']}</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {interType === 'outer' ? <Col span={12}> |
| | | <Form.Item label={dict['header.form.interface']}> |
| | | {getFieldDecorator('interface', { |
| | | initialValue: data.interface || '', |
| | | initialValue: data.sysInterface === 'true' ? (window.GLOB.mainSystemApi || window.GLOB.subSystemApi) : (data.interface || ''), |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | { |
| | | max: formRule.input.max, |
| | | message: formRule.input.message |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" disabled={this.state.interReadonly} />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {interType === 'outer' ? <Col span={12}> |
| | | <Form.Item label={dict['header.form.outerFunc']}> |
| | | {getFieldDecorator('outerFunc', { |
| | | initialValue: data.outerFunc || '', |
| | | rules: [ |
| | | { |
| | | pattern: formRule.func.pattern, |
| | | message: formRule.func.message |
| | | }, { |
| | | max: formRule.func.max, |
| | | message: formRule.func.maxMessage |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" />)} |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {interType === 'outer' ? <Col span={12}> |
| | | <Form.Item label={dict['header.form.outerFunc']}> |
| | | {getFieldDecorator('outerFunc', { |
| | | initialValue: data.outerFunc || '', |
| | | rules: [ |
| | | { |
| | | pattern: formRule.func.pattern, |
| | | message: formRule.func.message |
| | | }, { |
| | | max: formRule.func.max, |
| | | message: formRule.func.maxMessage |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | |
| | | <Col span={12}> |
| | | <Form.Item label="固定表头"> |
| | | {getFieldDecorator('columnfixed', { |
| | |
| | | order: '', |
| | | dataresource: '', |
| | | interType: 'inner', |
| | | sysInterface: 'false', |
| | | innerFunc: '', |
| | | interface: '', |
| | | outerFunc: '', |
| | |
| | | } |
| | | |
| | | if (type === 'select') { |
| | | _options = [..._options, 'setAll', 'linkSubField'] |
| | | _options = [..._options, 'setAll'] |
| | | if (resourceType === '1') { |
| | | _options.push('linkSubField') |
| | | } |
| | | } else if (type === 'link') { // 关联类型、增加关联字段 |
| | | _options = [..._options, 'setAll', 'linkField'] |
| | | } else if (type === 'funcvar') { // 设置为函数变量时,不需要其他信息 |
| | |
| | | } |
| | | |
| | | if (value === 'select') { |
| | | _options = [..._options, 'setAll', 'linkSubField'] |
| | | _options = [..._options, 'setAll'] |
| | | if (this.state.resourceType === '1') { |
| | | _options.push('linkSubField') |
| | | } |
| | | } else if (value === 'link') { |
| | | _options = [..._options, 'setAll', 'linkField'] |
| | | } else if (value === 'funcvar') { |
| | |
| | | } |
| | | |
| | | if (openType === 'select') { |
| | | _options = [..._options, 'setAll', 'linkSubField'] |
| | | _options = [..._options, 'setAll'] |
| | | if (value === '1') { |
| | | _options.push('linkSubField') |
| | | } |
| | | } else if (openType === 'link') { |
| | | _options = [..._options, 'setAll', 'linkField'] |
| | | } |
| | |
| | | |
| | | state = { |
| | | interType: this.props.data.interType || 'inner', |
| | | columns: this.props.columns.filter(item => item.field && item.type !== 'colspan') |
| | | columns: this.props.columns.filter(item => item.field && item.type !== 'colspan'), |
| | | interReadonly: this.props.data.sysInterface === 'true' |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 切换接口类型 |
| | | */ |
| | | onChange = (e) => { |
| | | this.setState({ |
| | | interType: e.target.value |
| | | }, () => { |
| | | if (e.target.value === 'inner') return |
| | | |
| | | let _type = this.props.form.getFieldValue('sysInterface') |
| | | if (_type === 'true') { |
| | | this.props.form.setFieldsValue({ |
| | | interface: window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | }) |
| | | this.setState({ |
| | | interReadonly: true |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | interReadonly: false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | onSysChange = (e) => { |
| | | if (e.target.value === 'true') { |
| | | this.props.form.setFieldsValue({ |
| | | interface: window.GLOB.mainSystemApi || window.GLOB.subSystemApi |
| | | }) |
| | | this.setState({ |
| | | interReadonly: true |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | interReadonly: false |
| | | }) |
| | | } |
| | | } |
| | | |
| | | selectChange = (val) => { |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | {interType === 'outer' ? <Col span={12}> |
| | | <Form.Item label={dict['header.form.sysInterface']}> |
| | | {getFieldDecorator('sysInterface', { |
| | | initialValue: data.sysInterface || 'false' |
| | | })( |
| | | <Radio.Group onChange={this.onSysChange}> |
| | | <Radio value="true">{dict['header.form.true']}</Radio> |
| | | <Radio value="false">{dict['header.form.false']}</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {interType === 'outer' ? <Col span={12}> |
| | | <Form.Item label={dict['header.form.interface']}> |
| | | {getFieldDecorator('interface', { |
| | | initialValue: data.interface || '', |
| | | initialValue: data.sysInterface === 'true' ? (window.GLOB.mainSystemApi || window.GLOB.subSystemApi) : (data.interface || ''), |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | { |
| | | max: formRule.input.max, |
| | | message: formRule.input.message |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" disabled={this.state.interReadonly} />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {interType === 'outer' ? <Col span={12}> |
| | | <Form.Item label={dict['header.form.outerFunc']}> |
| | | {getFieldDecorator('outerFunc', { |
| | | initialValue: data.outerFunc || '', |
| | | rules: [ |
| | | { |
| | | pattern: formRule.func.pattern, |
| | | message: formRule.func.message |
| | | }, { |
| | | max: formRule.func.max, |
| | | message: formRule.func.maxMessage |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" />)} |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {interType === 'outer' ? <Col span={12}> |
| | | <Form.Item label={dict['header.form.outerFunc']}> |
| | | {getFieldDecorator('outerFunc', { |
| | | initialValue: data.outerFunc || '', |
| | | rules: [ |
| | | { |
| | | pattern: formRule.func.pattern, |
| | | message: formRule.func.message |
| | | }, { |
| | | max: formRule.func.max, |
| | | message: formRule.func.maxMessage |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={12}> |
| | | <Form.Item label="默认排序"> |
| | | {getFieldDecorator('order', { |
| | |
| | | } |
| | | |
| | | if (type === 'select') { |
| | | _options = [..._options, 'setAll', 'linkSubField'] |
| | | _options = [..._options, 'setAll'] |
| | | if (resourceType === '1') { |
| | | _options.push('linkSubField') |
| | | } |
| | | } else if (type === 'link') { // 关联类型、增加关联字段 |
| | | _options = [..._options, 'setAll', 'linkField'] |
| | | } else if (type === 'funcvar') { // 设置为函数变量时,不需要其他信息 |
| | |
| | | } |
| | | |
| | | if (value === 'select') { |
| | | _options = [..._options, 'setAll', 'linkSubField'] |
| | | _options = [..._options, 'setAll'] |
| | | if (this.state.resourceType === '1') { |
| | | _options.push('linkSubField') |
| | | } |
| | | } else if (value === 'link') { |
| | | _options = [..._options, 'setAll', 'linkField'] |
| | | } else if (value === 'funcvar') { |
| | |
| | | const { openType } = this.state |
| | | let value = e.target.value |
| | | if (key === 'resourceType') { |
| | | let _options = ['label', 'field', 'initval', 'type', 'resourceType', 'readonly', 'required'] |
| | | let _options = ['label', 'field', 'initval', 'type', 'resourceType', 'readonly', 'required', 'hidden'] |
| | | if (value === '0') { |
| | | _options = [..._options, 'options'] |
| | | } else if (value === '1') { |
| | |
| | | } |
| | | |
| | | if (openType === 'select') { |
| | | _options = [..._options, 'setAll', 'linkSubField'] |
| | | _options = [..._options, 'setAll'] |
| | | if (value === '1') { |
| | | _options.push('linkSubField') |
| | | } |
| | | } else if (openType === 'link') { |
| | | _options = [..._options, 'setAll', 'linkField'] |
| | | } |