| | |
| | | }) |
| | | |
| | | const setCurrentUrl = () => { |
| | | // if (!!(window.history && window.history.pushState)) { |
| | | // window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') |
| | | // window.location.reload() |
| | | // } |
| | | if (!!(window.history && window.history.pushState)) { |
| | | window.history.replaceState(null, null, window.location.href.split('#')[0] + '#/login') |
| | | window.location.reload() |
| | | } |
| | | } |
| | | |
| | | let GlobMap = new Map() |
| | |
| | | param.LoginUID = sessionStorage.getItem('LoginUID') || '' |
| | | param.appkey = window.GLOB.appkey || '' |
| | | |
| | | let _rduri = '' |
| | | if (sessionStorage.getItem('isEditState') === 'true' && options.cloudServiceApi) { // 编辑状态,且存在云端地址 |
| | | param.rduri = options.cloudServiceApi |
| | | _rduri = options.cloudServiceApi |
| | | param.userid = sessionStorage.getItem('CloudUserID') |
| | | param.SessionUid = sessionStorage.getItem('CloudSessionUid') || '' |
| | | param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' |
| | | } else if (window.GLOB.mainSystemApi) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | _rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | | // param.nonc = Utils.getuuid() |
| | |
| | | // let keys = Object.keys(param).sort() |
| | | // let values = keys.map(key => key + param[key]).join('') |
| | | // param.sign = md5(values) |
| | | |
| | | if (_rduri) { |
| | | param.rduri = _rduri |
| | | } |
| | | |
| | | return axios({ |
| | | url: '/webapi/dostar', |
| | |
| | | param.LoginUID = sessionStorage.getItem('LoginUID') || '' |
| | | param.appkey = window.GLOB.appkey || '' |
| | | |
| | | // param.nonc = Utils.getuuid() |
| | | // param._ = new Date().getTime() |
| | | |
| | | // let keys = Object.keys(param).sort() |
| | | // let values = keys.map(key => key + param[key]).join('') |
| | | // param.sign = md5(values) |
| | | |
| | | return axios({ |
| | | url: '/webapi/dostar', |
| | | data: param |
| | |
| | | editMenu: null, // 编辑菜单 |
| | | editAction: null, // 编辑按钮 |
| | | editTab: null, // 编辑标签 |
| | | tabConfig: null, // 标签配置信息 |
| | | editSubTab: null, // 编辑子标签(标签中的标签) |
| | | subTabConfig: null, // 子标签配置信息 |
| | | subConfig: null // 子配置信息 |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | } else if (type === 'tabButton') { // 三级菜单下,标签下,按钮配置 |
| | | console.log(item) |
| | | |
| | | let pageParam = '' |
| | | if (item.OpenType === 'popview') { |
| | | if (config && config.Template === 'SubTable') { |
| | |
| | | <ModalConfig |
| | | menu={this.state.editMenu} |
| | | editTab={this.state.editTab} |
| | | tabConfig={this.state.tabConfig} |
| | | editSubTab={this.state.editSubTab} |
| | | subTabConfig={this.state.subTabConfig} |
| | | editAction={this.state.editAction} |
| | | subConfig={this.state.subConfig} |
| | | handleView={this.handleView} |
| | |
| | | menu={this.state.editMenu} |
| | | editTab={this.state.editTab} |
| | | editSubTab={this.state.editSubTab} |
| | | tabConfig={this.state.tabConfig} |
| | | config={this.state.subConfig} |
| | | handleView={this.handleView} |
| | | /> |
| | |
| | | // 系统配置 |
| | | export default { |
| | | systemType: 'Cloud', // Cloud 、 SSO 、 local, 云端使用系统配置appId |
| | | systemType: 'local', // Cloud 、 SSO 、 local, 云端使用系统配置appId |
| | | AppId: '201912040924165801464FF1788654BC5AC73', |
| | | // cloudServiceApi: 'http://qingqiumarket.cn/mkwms/webapi/dostar', |
| | | // cloudLoginApi: 'http://qingqiumarket.cn/mkwms/webapi/dologon', |
| | | cloudServiceApi: 'http://cloud.mk9h.cn/webapi/dostar', |
| | | cloudLoginApi: 'http://cloud.mk9h.cn/webapi/dologon', |
| | | cloudDatabase: 'sqlserver', |
| | |
| | | }) |
| | | } |
| | | |
| | | let _outParam = null |
| | | |
| | | new Promise(resolve => { |
| | | // 内部请求 |
| | | if (btn.innerFunc) { |
| | |
| | | }).then(res => { |
| | | if (!res) return |
| | | // 外部请求 |
| | | _outParam = res |
| | | return Api.genericInterface(res) |
| | | }).then(response => { |
| | | if (!response) return |
| | | // 回调请求 |
| | | if (response.status) { |
| | | if (btn.callbackFunc) { |
| | | // 存在回调函数时,调用 |
| | | delete response.ErrCode |
| | | delete response.ErrMesg |
| | | delete response.message |
| | | delete response.status |
| | | |
| | | response.func = btn.callbackFunc |
| | | return Api.genericInterface(response) |
| | | } else { |
| | | if (btn.callbackFunc) { |
| | | // 存在回调函数时,调用 |
| | | delete response.ErrMesg |
| | | delete response.message |
| | | delete response.status |
| | | |
| | | delete _outParam.rduri |
| | | |
| | | response.func = btn.callbackFunc |
| | | |
| | | let _callbackparam = {..._outParam, ...response} |
| | | return Api.genericInterface(_callbackparam) |
| | | } else { |
| | | if (response.status) { |
| | | this.execSuccess(btn, response) |
| | | _resolve() |
| | | } else { |
| | | this.execError(response, btn) |
| | | _resolve() |
| | | } |
| | | } else { |
| | | this.execError(response, btn) |
| | | _resolve() |
| | | } |
| | | }).then(res => { |
| | | if (!res) return |
| | |
| | | */ |
| | | UNSAFE_componentWillMount () { |
| | | const { menu } = this.props |
| | | console.log(menu) |
| | | |
| | | let _LongParam = menu.LongParam |
| | | let _config = '' |
| | | |
| | |
| | | let param = { |
| | | editMenu: _originMenu, |
| | | editTab: !isbutton ? item : '', |
| | | tabConfig: null, |
| | | editSubTab: null, |
| | | subTabConfig: null, |
| | | editAction: isbutton ? item : '', |
| | | subConfig: '', |
| | | tabview: _view |
| | |
| | | static propTpyes = { |
| | | menu: PropTypes.any, |
| | | editTab: PropTypes.any, |
| | | subConfig: PropTypes.any, |
| | | editSubTab: PropTypes.any, |
| | | tabConfig: PropTypes.any, |
| | | subTabConfig: PropTypes.any, |
| | | editAction: PropTypes.object, |
| | | subConfig: PropTypes.any, |
| | | handleView: PropTypes.func |
| | | } |
| | | |
| | |
| | | * 4、设置按钮基本信息 |
| | | */ |
| | | UNSAFE_componentWillMount () { |
| | | const {menu, editAction, editTab, subConfig} = this.props |
| | | const {menu, editAction, tabConfig, subTabConfig, subConfig} = this.props |
| | | |
| | | let _config = '' |
| | | let _tab = subTabConfig ? subTabConfig : tabConfig |
| | | |
| | | let _menu = { // 上级菜单是三级菜单或标签页 |
| | | type: editTab ? editTab.Template : menu.type, |
| | | tables: editTab ? editTab.tables : menu.LongParam.tables, |
| | | MenuID: editTab ? editTab.uuid : menu.MenuID, |
| | | MenuNo: editTab ? editTab.tabNo : menu.MenuNo, |
| | | MenuName: editTab ? editTab.tabName : menu.MenuName |
| | | type: _tab ? _tab.Template : menu.type, |
| | | tables: _tab ? _tab.tables : menu.LongParam.tables, |
| | | MenuID: _tab ? _tab.uuid : menu.MenuID, |
| | | MenuNo: _tab ? _tab.tabNo : menu.MenuNo, |
| | | MenuName: _tab ? _tab.tabName : menu.MenuName |
| | | } |
| | | |
| | | if (subConfig) { |
| | |
| | | |
| | | // 页面返回 |
| | | handleViewBack = () => { |
| | | const {menu, editTab} = this.props |
| | | const {menu, editTab, editSubTab, tabConfig, subTabConfig} = this.props |
| | | |
| | | let _view = (subTabConfig && subTabConfig.Template) || (tabConfig && tabConfig.Template) || menu.LongParam.Template |
| | | |
| | | let param = { |
| | | editMenu: menu, |
| | | editTab: editTab, |
| | | editAction: '', |
| | | subConfig: '', |
| | | tabview: editTab ? editTab.Template : menu.LongParam.Template |
| | | tabConfig: tabConfig, |
| | | editSubTab: editSubTab, |
| | | subTabConfig: subTabConfig, |
| | | editAction: null, |
| | | subConfig: subTabConfig || tabConfig || null, |
| | | tabview: _view |
| | | } |
| | | |
| | | this.props.handleView(param) |
| | |
| | | static propTpyes = { |
| | | menu: PropTypes.any, |
| | | editTab: PropTypes.any, |
| | | tabConfig: PropTypes.any, |
| | | editSubTab: PropTypes.any, |
| | | config: PropTypes.any, |
| | | handleView: PropTypes.func |
| | |
| | | * 2、设置操作类型、原始菜单信息(每次保存后重置)、已使用表及基本信息表单 |
| | | */ |
| | | UNSAFE_componentWillMount () { |
| | | const { config, editTab } = this.props |
| | | const { config, editTab, editSubTab } = this.props |
| | | |
| | | let _config = null |
| | | |
| | | if (!config) { |
| | | _config = JSON.parse(JSON.stringify(Source.baseConfig)) |
| | | _config.uuid = editTab.linkTab |
| | | _config.tabName = editTab.label |
| | | _config.uuid = editSubTab ? editSubTab.linkTab : editTab.linkTab |
| | | _config.tabName = editSubTab ? editSubTab.label : editTab.label |
| | | _config.isAdd = true |
| | | } else { |
| | | _config = JSON.parse(JSON.stringify(config)) |
| | |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | | componentWillUnmount () { |
| | | this.setState = (state, callback) => { |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | } |
| | | |
| | | // 页面返回 |
| | | handleViewBack = () => { |
| | | const {menu} = this.props |
| | | const {menu, editTab, tabConfig, editSubTab} = this.props |
| | | let _tabview = menu ? menu.LongParam.Template : '' |
| | | |
| | | if (editSubTab) { |
| | | if (editTab.hasOwnProperty('OpenType')) { |
| | | _tabview = editTab.tabType |
| | | } else { |
| | | _tabview = editTab.type |
| | | } |
| | | } |
| | | |
| | | let param = { |
| | | editMenu: menu, |
| | | editTab: '', |
| | | editAction: '', |
| | | subConfig: '', |
| | | tabview: menu ? menu.LongParam.Template : '' |
| | | editTab: editSubTab ? editTab : null, |
| | | tabConfig: null, |
| | | editSubTab: null, |
| | | subTabConfig: null, |
| | | editAction: null, |
| | | subConfig: tabConfig, |
| | | tabview: _tabview |
| | | } |
| | | |
| | | this.props.handleView(param) |
| | |
| | | * @description 设置可配置按钮 |
| | | */ |
| | | setSubConfig = (btn) => { |
| | | const { menu } = this.props |
| | | const {menu, editTab, tabConfig, editSubTab} = this.props |
| | | const { config, originConfig } = this.state |
| | | |
| | | if (originConfig.isAdd) { |
| | |
| | | |
| | | // 子菜单信息验证通过后,跳转子按钮配置页面 |
| | | let _view = '' |
| | | let _subtab = editSubTab |
| | | |
| | | if (btn.OpenType === 'pop') { |
| | | _view = 'Modal' // 表单页面 |
| | | } else if (btn.OpenType === 'popview') { |
| | | _view = btn.tabType // 新弹窗标签模板 |
| | | _subtab = btn |
| | | } |
| | | |
| | | let param = { |
| | | editMenu: menu, |
| | | editTab: originConfig, |
| | | editSubTab: '', |
| | | editTab: editTab, |
| | | tabConfig: editSubTab ? tabConfig : originConfig, |
| | | editSubTab: _subtab, |
| | | subTabConfig: editSubTab ? originConfig : null, |
| | | editAction: btn, |
| | | subConfig: '', |
| | | tabview: _view |
| | |
| | | onCancel={() => { this.setState({ profileVisible: false }) }} |
| | | destroyOnClose |
| | | > |
| | | <VerifyCard card={this.state.card} columns={this.state.config.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} dict={this.state.dict} /> |
| | | <VerifyCard floor="subtable" card={this.state.card} columns={this.state.config.columns} wrappedComponentRef={(inst) => this.verifyRef = inst} dict={this.state.dict} /> |
| | | </Modal> |
| | | {/* 设置全局配置及列表数据源 */} |
| | | <Modal |
| | |
| | | |
| | | class UniqueForm extends Component { |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | fields: PropTypes.array, // 表单 |
| | | columns: PropTypes.array, // 表单 |
| | | modular: PropTypes.array, // 表单 |
| | | modularDetail: PropTypes.array, // 表单 |
| | | orderChange: PropTypes.func // 表单 |
| | | floor: PropTypes.any, // 是否为子表 |
| | | dict: PropTypes.object, // 字典项 |
| | | fields: PropTypes.array, // 表单 |
| | | columns: PropTypes.array, // 表单 |
| | | modular: PropTypes.array, // 表单 |
| | | modularDetail: PropTypes.array, // 表单 |
| | | orderChange: PropTypes.func // 表单 |
| | | } |
| | | |
| | | state = { |
| | |
| | | } |
| | | }) |
| | | |
| | | if (this.props.floor === 'subtable') { |
| | | if (!fieldMap.has('BID')) { |
| | | _billFields.unshift({ |
| | | uuid: 'BID', |
| | | field: 'BID', |
| | | label: 'BID' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | modularDetail: _modularDetail, |
| | | funFields: this.props.fields.filter(field => field.type === 'funcvar'), |
| | |
| | | |
| | | class VerifyCard extends Component { |
| | | static propTpyes = { |
| | | floor: PropTypes.any, // 是否为子表 |
| | | dict: PropTypes.object, // 字典项 |
| | | card: PropTypes.object, |
| | | columns: PropTypes.array |
| | |
| | | </TabPane> |
| | | <TabPane tab="单号生成" key="4"> |
| | | <BillcodeForm |
| | | floor={this.props.floor} |
| | | fields={fields} |
| | | columns={this.props.columns} |
| | | dict={this.props.dict} |
| | |
| | | ROLLBACK TRAN |
| | | |
| | | END` |
| | | console.log(Ltext) |
| | | |
| | | Ltext = Ltext.replace(/\n\s{4}/ig, 'mchr13k') |
| | | |
| | | return Ltext |