| | |
| | | window.GLOB = { |
| | | service: 'mkwms', |
| | | appId: '201912040924165801464FF1788654BC5AC73', |
| | | appkey: '20191106103859640976D6E924E464D029CF0', |
| | | mainSystemApi: 'http://qingqiumarket.cn/mkwms/webapi/dostar', |
| | | mainSystemApi: 'http://cloud.mk9h.cn/webapi/dostar', |
| | | title: '', |
| | | platName: '', |
| | | logo: '', |
| | |
| | | }) |
| | | |
| | | 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() |
| | |
| | | |
| | | if (isCloud && options.cloudLoginApi) { |
| | | param.rduri = options.cloudLoginApi |
| | | } else if (window.GLOB.mainSystemApi) { |
| | | param.rduri = window.GLOB.mainSystemApi.replace(/\/webapi(.*)/, '/webapi/dologon') |
| | | } |
| | | |
| | | return axios({ |
| | |
| | | |
| | | async loadmenu () { |
| | | // 获取主菜单 |
| | | let result = await Api.getSystemConfig({func: 'sPC_Get_MainMenu'}) |
| | | let _param = {func: 'sPC_Get_MainMenu'} |
| | | if (sessionStorage.getItem('isEditState') === 'true') { // 编辑状态时,获取一级菜单,增加参数debug |
| | | _param.debug = 'Y' |
| | | } |
| | | |
| | | let result = await Api.getSystemConfig(_param) |
| | | if (result.status) { |
| | | if (result.debug === 'true') { // 是否为debug模式,即可复制菜单参数 |
| | | this.props.resetDebug() |
| | |
| | | } |
| | | |
| | | async getRolesMenu () { |
| | | // 获取主菜单 |
| | | // 获取角色权限 |
| | | let result = await Api.getSystemConfig({func: 'sPC_Get_RolesMenu'}) |
| | | if (result.status) { |
| | | let _permAction = {} |
| | |
| | | editMenu: null, // 编辑菜单 |
| | | editAction: null, // 编辑按钮 |
| | | editTab: null, // 编辑标签 |
| | | editSubTab: null, // 编辑子标签(标签中的标签) |
| | | subConfig: null // 子配置信息 |
| | | } |
| | | |
| | |
| | | <SubTable |
| | | menu={this.state.editMenu} |
| | | editTab={this.state.editTab} |
| | | editSubTab={this.state.editSubTab} |
| | | config={this.state.subConfig} |
| | | handleView={this.handleView} |
| | | /> |
| | |
| | | return |
| | | } |
| | | |
| | | let result = await Api.getSystemConfig({func: 'sPC_Get_FunMenu', ParentID: menu.MenuID}) |
| | | let _param = {func: 'sPC_Get_FunMenu', ParentID: menu.MenuID} |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { // 编辑状态时,获取菜单,增加参数debug |
| | | _param.debug = 'Y' |
| | | } |
| | | |
| | | let result = await Api.getSystemConfig(_param) |
| | | if (result.status) { |
| | | if (result.data.length === 0) { // 查询菜单为空 |
| | | this.setState({ |
| | |
| | | e.stopPropagation() |
| | | this.props.resetEditLevel('level2') |
| | | // 获取一级菜单列表 |
| | | Api.getSystemConfig({func: 'sPC_Get_MainMenu'}).then(res => { |
| | | Api.getSystemConfig({func: 'sPC_Get_MainMenu', debug: 'Y'}).then(res => { |
| | | this.setState({ |
| | | mainMenuList: res.data.map(item => { |
| | | return { |
| | |
| | | 'header.form.openType': '打开方式', |
| | | 'header.form.pop': '弹窗', |
| | | 'header.form.popform': '弹窗(表单)', |
| | | 'header.form.popview': '弹窗(页面)', |
| | | 'header.form.popview': '弹窗(标签)', |
| | | 'header.form.tab': '标签页', |
| | | 'header.form.linkTab': '关联标签', |
| | | 'header.form.subTab': '下级标签', |
| | |
| | | 'header.form.openType': '打开方式', |
| | | 'header.form.pop': '弹窗', |
| | | 'header.form.popform': '弹窗(表单)', |
| | | 'header.form.popview': '弹窗(页面)', |
| | | 'header.form.popview': '弹窗(标签)', |
| | | 'header.form.tab': '标签页', |
| | | 'header.form.linkTab': '关联标签', |
| | | 'header.form.subTab': '下级标签', |
| | |
| | | // 系统配置 |
| | | export default { |
| | | systemType: 'Cloud', // 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', |
| | | // 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', |
| | | localDatabase: 'mysql' |
| | | } |
| | |
| | | } else if (res && res.ErrCode === '-1') { // 完成后不提示 |
| | | |
| | | } else if (res.Relogin === 'true') { // 切换用户功能 |
| | | sessionStorage.setItem('avatar', res.icon || '') |
| | | sessionStorage.setItem('UserID', res.UserID) |
| | | sessionStorage.setItem('SessionUid', Utils.getuuid()) |
| | | sessionStorage.setItem('LoginUID', res.LoginUID) |
| | |
| | | }) |
| | | return |
| | | } |
| | | console.log(item) |
| | | |
| | | // 菜单信息验证通过后,跳转子配置页面 |
| | | let _view = '' |
| | | let uuid = item.uuid |
| | |
| | | return |
| | | } |
| | | |
| | | if (config.setting.display === 'prompt') { |
| | | let _fields = [] |
| | | if (config.groups.length > 0) { |
| | | config.groups.forEach(group => { |
| | | _fields = [..._fields, ...group.sublist] |
| | | }) |
| | | } else { |
| | | _fields = config.fields |
| | | } |
| | | // if (config.setting.display === 'prompt') { // 有需要置空的场景 |
| | | // let _fields = [] |
| | | // if (config.groups.length > 0) { |
| | | // config.groups.forEach(group => { |
| | | // _fields = [..._fields, ...group.sublist] |
| | | // }) |
| | | // } else { |
| | | // _fields = config.fields |
| | | // } |
| | | |
| | | let readfields = _fields.filter(item => item.initval || item.initval === 0) |
| | | if (readfields.length < _fields.length) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '以《是否框》显示的弹框,所有表单必须含有默认值!', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | // let readfields = _fields.filter(item => item.initval || item.initval === 0) |
| | | // if (readfields.length < _fields.length) { |
| | | // notification.warning({ |
| | | // top: 92, |
| | | // message: '以《是否框》显示的弹框,所有表单必须含有默认值!', |
| | | // duration: 10 |
| | | // }) |
| | | // return |
| | | // } |
| | | // } |
| | | |
| | | let _LongParam = '' |
| | | let _config = {...config, tables: this.state.selectedTables} |
| | |
| | | static propTpyes = { |
| | | menu: PropTypes.any, |
| | | editTab: PropTypes.any, |
| | | editSubTab: PropTypes.any, |
| | | config: PropTypes.any, |
| | | handleSubConfig: PropTypes.func, |
| | | supMenuList: PropTypes.array |
| | | handleView: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | |
| | | * @description 设置可配置按钮 |
| | | */ |
| | | setSubConfig = (btn) => { |
| | | const { menu } = this.props |
| | | const { config, originConfig } = this.state |
| | | |
| | | let isAdd = false |
| | | |
| | | if ( |
| | | (config.search[0] && config.search[0].origin) || |
| | | (config.action[0] && config.action[0].origin) || |
| | | (config.columns[0] && config.columns[0].origin) |
| | | ) { |
| | | isAdd = true |
| | | } |
| | | |
| | | if (isAdd) { |
| | | if (originConfig.isAdd) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单尚未保存,请保存菜单配置!', |
| | |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | |
| | | // 子菜单信息验证通过后,跳转子按钮配置页面 |
| | | let _view = '' |
| | | |
| | | if (btn.OpenType === 'pop') { |
| | | _view = 'Modal' // 表单页面 |
| | | } else if (btn.OpenType === 'popview') { |
| | | _view = btn.tabType // 新弹窗标签模板 |
| | | } |
| | | |
| | | let param = { |
| | | editMenu: menu, |
| | | editTab: originConfig, |
| | | editSubTab: '', |
| | | editAction: btn, |
| | | subConfig: '', |
| | | tabview: _view |
| | | } |
| | | |
| | | Api.getSystemConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: btn.OpenType === 'popview' ? btn.linkTab : btn.uuid |
| | |
| | | } |
| | | } |
| | | |
| | | this.props.handleSubConfig(btn, config, _LongParam, 'tabButton') |
| | | if (_LongParam && param.tabview === 'Modal' && _LongParam.type === 'Modal') { |
| | | param.subConfig = _LongParam |
| | | } else if (_LongParam && param.tabview === 'SubTable' && _LongParam.Template === 'SubTable') { |
| | | param.subConfig = _LongParam |
| | | } |
| | | |
| | | this.props.handleView(param) |
| | | } else { |
| | | this.setState({ |
| | | loading: false |
| | |
| | | ROLLBACK TRAN |
| | | |
| | | END` |
| | | |
| | | console.log(Ltext) |
| | | Ltext = Ltext.replace(/\n\s{4}/ig, 'mchr13k') |
| | | |
| | | return Ltext |
| | |
| | | |
| | | componentDidMount () { |
| | | let timeStamp = new Date().getTime() |
| | | let str = md5('MK19' + options.AppId + timeStamp) |
| | | Api.systemauth(options.AppId, timeStamp).then(res => { |
| | | let _appId = window.GLOB.appId |
| | | |
| | | if (options.systemType === 'Cloud') { // 云端使用系统配置appid |
| | | _appId = options.AppId |
| | | } |
| | | |
| | | let str = md5('MK19' + _appId + timeStamp) |
| | | Api.systemauth(_appId, timeStamp).then(res => { |
| | | if (res.status && res.EPC === str) { |
| | | let box = [] |
| | | for (let i = 0; i < 15; i++) { |