| | |
| | | { |
| | | "appId": "202108312122504607B107A83F55B40C98CCF", |
| | | "appkey": "20210831212235413F287EC3BF489424496C8", |
| | | "appId": "201912040924165801464FF1788654BC5AC73", |
| | | "appkey": "20191106103859640976D6E924E464D029CF0", |
| | | "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", |
| | | "systemType": "", |
| | | "externalDatabase": "false", |
| | | "lineColor": "", |
| | | "filter": "false", |
| | | "defaultApp": "mkindustry", |
| | | "defaultApp": "mk", |
| | | "defaultLang": "zh-CN", |
| | | "WXAppID": "", |
| | | "debugger": false, |
| | | "licenseKey": "7EFE13KIKKILIJ7C8CFC", |
| | | "probation": "2021-12-31", |
| | | "host": "http://demo.mk9h.cn", |
| | | "service": "erp_new/" |
| | | "licenseKey": "", |
| | | "probation": "", |
| | | "host": "http://qingqiumarket.cn", |
| | | "service": "MKWMS/" |
| | | } |
| | |
| | | if (_sync && data && data[config.dataName]) { |
| | | _data = data[config.dataName] |
| | | if (Array.isArray(_data)) { |
| | | _data = _data[0] || {} |
| | | _data = _data[0] || {$$empty: true} |
| | | } |
| | | _sync = false |
| | | } |
| | | } else { |
| | | _data = {} |
| | | _data = {$$empty: true} |
| | | } |
| | | |
| | | if (!config.wrap.groupLabel) { |
| | |
| | | const { sync, config, group } = this.state |
| | | |
| | | if (sync && !is(fromJS(this.props.data), fromJS(nextProps.data))) { |
| | | let _data = {} |
| | | let _data = {$$empty: true} |
| | | let _group = group |
| | | if (nextProps.data && nextProps.data[config.dataName]) { |
| | | _data = nextProps.data[config.dataName] |
| | | if (Array.isArray(_data)) { |
| | | _data = _data[0] || {} |
| | | _data = _data[0] || {$$empty: true} |
| | | } |
| | | } |
| | | if (config.wrap.statusControl && _data[config.wrap.statusControl]) { |
| | |
| | | |
| | | if (config.wrap.datatype === 'static' || (config.setting.supModule && !BID)) { |
| | | this.setState({ |
| | | data: {} |
| | | data: {$$empty: true} |
| | | }) |
| | | return |
| | | } |
| | |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | if (result.status) { |
| | | let _data = result.data && result.data[0] ? result.data[0] : {} |
| | | let _data = result.data && result.data[0] ? result.data[0] : {$$empty: true} |
| | | let _group = group |
| | | |
| | | if (type === 'refresh') { |
| | |
| | | this.setState({ |
| | | group: null, |
| | | step: _group.sort - 1, |
| | | data: _data || {}, |
| | | data: _data || {$$empty: true}, |
| | | loading: false |
| | | }, () => { |
| | | this.setState({group: _group}) |
| | |
| | | btn={group.subButton} |
| | | setting={config.setting} |
| | | columns={config.columns} |
| | | selectedData={[data]} |
| | | selectedData={data.$$empty ? [] : [data]} |
| | | /> |
| | | {group.nextButton.enable === 'true' && group.sort !== config.subcards.length ? <Button type="link" className="skip" onClick={this.nextStep} style={group.nextButton.style}>{group.nextButton.label}</Button> : null} |
| | | </div> : null} |
| | |
| | | if (_sync && data && data[config.dataName]) { |
| | | _data = data[config.dataName] |
| | | if (Array.isArray(_data)) { |
| | | _data = _data[0] || {} |
| | | _data = _data[0] || {$$empty: true} |
| | | } |
| | | _sync = false |
| | | } |
| | | } else { |
| | | _data = {} |
| | | _data = {$$empty: true} |
| | | } |
| | | |
| | | if (!config.wrap.groupLabel) { |
| | |
| | | const { sync, config, group } = this.state |
| | | |
| | | if (sync && !is(fromJS(this.props.data), fromJS(nextProps.data))) { |
| | | let _data = {} |
| | | let _data = {$$empty: true} |
| | | let _group = group |
| | | if (nextProps.data && nextProps.data[config.dataName]) { |
| | | _data = nextProps.data[config.dataName] |
| | | if (Array.isArray(_data)) { |
| | | _data = _data[0] || {} |
| | | _data = _data[0] || {$$empty: true} |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (config.wrap.datatype === 'static' || (config.setting.supModule && !BID)) { |
| | | this.setState({ |
| | | data: {} |
| | | data: {$$empty: true} |
| | | }) |
| | | return |
| | | } |
| | |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | if (result.status) { |
| | | let _data = result.data && result.data[0] ? result.data[0] : {} |
| | | let _data = result.data && result.data[0] ? result.data[0] : {$$empty: true} |
| | | |
| | | let _group = group |
| | | |
| | | this.setState({ |
| | | group: null, |
| | | data: _data || {}, |
| | | data: _data || {$$empty: true}, |
| | | loading: false |
| | | }, () => { |
| | | this.setState({group: _group}) |
| | |
| | | btn={group.subButton} |
| | | setting={config.setting} |
| | | columns={config.columns} |
| | | selectedData={[data]} |
| | | selectedData={data.$$empty ? [] : [data]} |
| | | /> |
| | | </div> : null} |
| | | </div> |
| | |
| | | } |
| | | |
| | | actionSubmit = (res) => { |
| | | const { btn } = this.props |
| | | const { btn, setting, BID } = this.props |
| | | const { selines } = this.state |
| | | |
| | | if (btn.uuid !== res.menuId) return |
| | | |
| | | let data = selines || [] |
| | | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '需要上级主键值!', |
| | | duration: 3 |
| | | }) |
| | | return |
| | | } else if (btn.Ot !== 'notRequired' && data.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择行!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (btn.Ot === 'requiredSgl' && data.length !== 1) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择单行数据!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.setState({ loading: true }) |
| | | |
| | | this.execSubmit(this.state.selines, () => {}, res.form) |
| | | this.execSubmit(data, () => {}, res.form) |
| | | } |
| | | |
| | | resetModuleParam = (menuId, btnId, param) => { |
| | |
| | | {i === 0 && column.length > 0 && setting.tableType === 'radio' ? |
| | | <div className="page-card" style={{flex: 60}}></div> : null |
| | | } |
| | | {i === 0 && gridBtn && gridBtn.display && gridBtn.position === 'left' ? |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <EditOutlined className="edit" onClick={handleGridBtn}/> |
| | | </div> |
| | | } trigger="hover"> |
| | | <div className="page-card" style={{flex: gridBtn.Width}}> |
| | | <div style={{cursor: 'default'}}> |
| | | <span className="ant-table-header-column"> |
| | | <div className="ant-table-column-sorters" title={gridBtn.label} style={{textAlign: gridBtn.Align}}> |
| | | <span className="ant-table-column-title">{gridBtn.label}</span> |
| | | </div> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | </Popover> : null |
| | | } |
| | | {column.map(card => ( |
| | | <Card |
| | | key={card.uuid} |
| | |
| | | findCard={findCard} |
| | | /> |
| | | ))} |
| | | {i === (columns.length - 1) && gridBtn && gridBtn.display ? |
| | | {i === (columns.length - 1) && gridBtn && gridBtn.display && gridBtn.position !== 'left' ? |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <EditOutlined className="edit" onClick={handleGridBtn}/> |
| | |
| | | initVal: this.props.card.position || 'right', |
| | | required: true, |
| | | options: [{ |
| | | MenuID: 'right', |
| | | text: '右侧' |
| | | }, { |
| | | MenuID: 'left', |
| | | text: '左侧' |
| | | }, { |
| | | MenuID: 'right', |
| | | text: '右侧' |
| | | }] |
| | | } |
| | | ] |
| | |
| | | editItem: record |
| | | }) |
| | | |
| | | this.props.form.setFieldsValue({ |
| | | sql: record.sql, |
| | | position: record.position || 'back' |
| | | }) |
| | | if (this.props.type) { |
| | | this.props.form.setFieldsValue({ |
| | | sql: record.sql |
| | | }) |
| | | } else { |
| | | this.props.form.setFieldsValue({ |
| | | sql: record.sql, |
| | | position: record.position || 'back' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | values.uuid = editItem ? editItem.uuid : '' |
| | | values.position = values.position || (editItem ? editItem.position : 'front') |
| | | |
| | | let _quot = values.sql.match(/'{1}/g) |
| | | let _lparen = values.sql.match(/\({1}/g) |
| | |
| | | this.props.customScripts.forEach(item => { |
| | | if (item.status === 'false' && values.uuid !== item.uuid) return |
| | | |
| | | if (item.position === 'init') { |
| | | let _item = values.uuid === item.uuid ? values : item |
| | | |
| | | if (_item.position === 'init') { |
| | | _initCustomScript += ` |
| | | /* 初始化脚本 */ |
| | | ${values.uuid === item.uuid ? values.sql : item.sql} |
| | | ${_item.sql} |
| | | ` |
| | | } else if (item.position === 'front') { |
| | | } else if (_item.position === 'front') { |
| | | _prevCustomScript += ` |
| | | /* 默认sql前脚本 */ |
| | | ${values.uuid === item.uuid ? values.sql : item.sql} |
| | | ${_item.sql} |
| | | ` |
| | | } else { |
| | | _backCustomScript += ` |
| | | /* 默认sql后脚本 */ |
| | | ${values.uuid === item.uuid ? values.sql : item.sql} |
| | | ${_item.sql} |
| | | ` |
| | | } |
| | | }) |
| | |
| | | {usefulfields} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | | {!_type ?<Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | | <Form.Item style={{marginBottom: 0}} label={ |
| | | <Tooltip placement="bottomLeft" title={'自定义脚本与默认sql位置关系。'}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={10}> |
| | | </Col> : null} |
| | | {!_type ?<Col span={10}> |
| | | <Form.Item label={'快捷添加'} style={{marginBottom: 0}}> |
| | | <Select |
| | | showSearch |
| | |
| | | )} |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : null} |
| | | <Col span={6} className="add"> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}> |
| | | 保存 |
| | |
| | | .model-custom-scripts-modal { |
| | | .ant-modal { |
| | | top: 30px; |
| | | .ant-modal-header { |
| | | padding: 10px 24px; |
| | | } |
| | | .ant-modal-footer { |
| | | display: none; |
| | | } |
| | |
| | | display: none; |
| | | } |
| | | .ant-modal-body { |
| | | height: calc(100vh - 110px); |
| | | overflow-y: auto; |
| | | padding: 0; |
| | | height: calc(100vh - 100px); |
| | | overflow: hidden; |
| | | display: flex; |
| | | |
| | | .script-table-wrap { |
| | | width: 220px; |
| | | width: 240px; |
| | | overflow-y: auto; |
| | | overflow-x: hidden; |
| | | height: calc(100vh - 100px); |
| | | |
| | | .operation-btn { |
| | | display: inline-block; |
| | |
| | | } |
| | | |
| | | .script-item { |
| | | border: 1px solid #eeeeee; |
| | | padding: 5px; |
| | | margin-bottom: 10px; |
| | | border-bottom: 1px solid #eeeeee; |
| | | padding: 15px 10px 5px; |
| | | } |
| | | .script-item.active { |
| | | border-color: #1890ff; |
| | | background-color: #bae7ff; |
| | | } |
| | | .ant-typography { |
| | | margin-bottom: 5px; |
| | | } |
| | | } |
| | | |
| | | .script-table-wrap::-webkit-scrollbar { |
| | | width: 7px; |
| | | } |
| | | .script-table-wrap::-webkit-scrollbar-thumb { |
| | | border-radius: 5px; |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); |
| | | background: rgba(0, 0, 0, 0.13); |
| | | } |
| | | .script-table-wrap::-webkit-scrollbar-track { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); |
| | | border-radius: 3px; |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | |
| | | .unfull-scripts { |
| | | position: absolute; |
| | | right: 20px; |
| | | z-index: 2; |
| | | top: 18px; |
| | | top: 10px; |
| | | color: #1890ff; |
| | | width: 26px; |
| | | cursor: pointer; |
| | |
| | | |
| | | .verify-form { |
| | | flex: 1; |
| | | >.ant-row { |
| | | margin: 0!important; |
| | | position: unset; |
| | | } |
| | | .sql { |
| | | .ant-col-sm-8 { |
| | | width: 10.5%; |
| | | padding: 0!important; |
| | | .ant-form-item-label { |
| | | display: none; |
| | | } |
| | | .ant-col-sm-16 { |
| | | width: 89.5%; |
| | | padding-top: 4px; |
| | | .ant-form-item-control-wrapper { |
| | | width: 100%; |
| | | } |
| | | .CodeMirror { |
| | | height: auto; |
| | | min-height: calc(100vh - 230px); |
| | | height: calc(100vh - 100px); |
| | | border-radius: 0; |
| | | } |
| | | .CodeMirror-scroll { |
| | | min-height: calc(100vh - 230px); |
| | | .code-mirror-area { |
| | | border-radius: 0; |
| | | } |
| | | } |
| | | .sqlfield { |
| | |
| | | } |
| | | } |
| | | .add { |
| | | padding-top: 4px; |
| | | position: absolute; |
| | | top: 10px; |
| | | z-index: 1; |
| | | .ant-btn { |
| | | height: 28px; |
| | | } |
| | | .mk-green { |
| | | margin-left: 0!important; |
| | | margin-right: 10px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar { |
| | | width: 7px; |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar-thumb { |
| | | border-radius: 5px; |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); |
| | | background: rgba(0, 0, 0, 0.13); |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar-track { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); |
| | | border-radius: 3px; |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | } |
| | | } |