| | |
| | | sessionStorage.setItem('appType', 'mob') // 应用类型 |
| | | document.body.className = '' |
| | | window.GLOB.UserComponentMap = new Map() // 缓存用户自定义组件 |
| | | window.GLOB.TabsMap = new Map() // 缓存用户操作的标签页 |
| | | window.GLOB.CacheIndependent = new Map() |
| | | window.GLOB.urlFields = [] // url变量 |
| | | window.GLOB.customMenu = null // 保存菜单信息 |
| | |
| | | menuloading: false, |
| | | oriConfig: null, |
| | | config: null, |
| | | visible: false, |
| | | customComponents: [], |
| | | direction: 'vertical', |
| | | settingshow: true, |
| | |
| | | sessionStorage.setItem('lang', param.lang || 'zh-CN') |
| | | sessionStorage.setItem('kei_no', param.kei_no || '') |
| | | sessionStorage.setItem('role_type', param.role_type || 'true') |
| | | sessionStorage.setItem('login_types', param.login_types || 'true') |
| | | sessionStorage.setItem('login_types', param.login_types || 'false') |
| | | sessionStorage.setItem('typename', param.typename || 'mob') |
| | | |
| | | this.setState({ |
| | |
| | | this.getMenuParam(param) |
| | | }) |
| | | } |
| | | } catch { |
| | | } catch (e) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单信息解析错误!', |
| | |
| | | return |
| | | } |
| | | MKEmitter.addListener('changeEditMenu', this.changeEditMenu) |
| | | MKEmitter.addListener('triggerMenuSave', this.submitConfig) |
| | | MKEmitter.addListener('submitComponentStyle', this.updateComponentStyle) |
| | | MKEmitter.addListener('updateCustomComponent', this.updateCustomComponent) |
| | | setTimeout(() => { |
| | |
| | | return |
| | | } |
| | | MKEmitter.removeListener('changeEditMenu', this.changeEditMenu) |
| | | MKEmitter.removeListener('triggerMenuSave', this.submitConfig) |
| | | MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle) |
| | | MKEmitter.removeListener('updateCustomComponent', this.updateCustomComponent) |
| | | } |
| | |
| | | }) |
| | | } else { |
| | | sessionStorage.setItem('appViewList', JSON.stringify(appViewList)) |
| | | sessionStorage.setItem('appHomeId', homeId) |
| | | this.props.history.replace('/mobdesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({MenuID: homeId, type: 'view'})))) |
| | | } |
| | | }) |
| | | } else { |
| | | sessionStorage.setItem('appViewList', JSON.stringify(appViewList)) |
| | | sessionStorage.setItem('appHomeId', homeId) |
| | | this.props.history.replace('/mobdesign/' + window.btoa(window.encodeURIComponent(JSON.stringify({MenuID: homeId, type: 'view'})))) |
| | | } |
| | | }) |
| | |
| | | }).then(res => { |
| | | if (res.status) { |
| | | sessionStorage.setItem('app_videos', JSON.stringify(res.data || [])) |
| | | } |
| | | }) |
| | | Api.getSystemConfig({ |
| | | func: 's_url_db_adduptdel', |
| | | PageIndex: 0, // 0 代表全部 |
| | | PageSize: 0, // 0 代表全部 |
| | | typecharone: 'color', |
| | | type: 'search' |
| | | }).then(res => { |
| | | if (res.status) { |
| | | sessionStorage.setItem('app_colors', JSON.stringify(res.data || [])) |
| | | } |
| | | }) |
| | | }) |
| | |
| | | appIndeList = appIndeList.map(item => (item.keys_type !== 'index' ? item.keys_id : '')).join(',') |
| | | |
| | | let menus = res.menus.filter(item => appIndeList.indexOf(item.MenuID) === -1) |
| | | menus = menus.map(item => { |
| | | item.value = item.MenuID |
| | | item.label = item.MenuName |
| | | return item |
| | | }) |
| | | sessionStorage.setItem('appMenus', JSON.stringify(menus)) |
| | | }) |
| | | } |
| | |
| | | title: item.name, |
| | | children: [] |
| | | } |
| | | if (item.type === 'tabs') { |
| | | |
| | | if (item.type === 'topbar' || item.type === 'login') { |
| | | return null |
| | | } else if (item.type === 'tabs') { |
| | | let tabs = [] |
| | | item.subtabs.forEach(tab => { |
| | | let s = traversal(tab.components) |
| | |
| | | title: menu.setting.name |
| | | } |
| | | }) |
| | | } else if (item.type === 'form') { |
| | | m.children = item.subcards.map(m => { |
| | | return { |
| | | key: m.uuid, |
| | | title: m.setting.title |
| | | } |
| | | }) |
| | | } else if (item.type === 'table' && item.subtype === 'normaltable') { |
| | | item.action && item.action.forEach(btn => { |
| | | this.checkBtn(btn) |
| | |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | if (m.children.length === 0) return null |
| | | |
| | | return m |
| | | }) |
| | |
| | | config.enabled = false |
| | | } |
| | | |
| | | let parMenuId = sessionStorage.getItem('kei_no') + 'pc' + sessionStorage.getItem('lang') |
| | | let roleParam = {type: 'view', key: config.uuid, title: config.MenuName, children: []} |
| | | roleParam.children = this.getMenuMessage() |
| | | |
| | | let param = { |
| | | func: 'sPC_TrdMenu_AddUpt', |
| | | FstID: parMenuId, |
| | | SndID: parMenuId, |
| | | ParentID: parMenuId, |
| | | FstID: 'mk_app', |
| | | SndID: 'mk_app', |
| | | ParentID: 'mk_app', |
| | | MenuID: config.uuid, |
| | | MenuNo: config.MenuNo || '', |
| | | EasyCode: '', |
| | |
| | | MenuName: config.MenuName || '', |
| | | PageParam: JSON.stringify({Template: 'webPage'}), |
| | | open_edition: config.open_edition, |
| | | menus_rolelist: window.btoa(window.encodeURIComponent(JSON.stringify(roleParam))), |
| | | LText: '', |
| | | LTexttb: '' |
| | | } |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | let roleParam = {key: config.uuid, title: config.MenuName, children: []} |
| | | roleParam.children = this.getMenuMessage() |
| | | console.log(roleParam) |
| | | |
| | | new Promise(resolve => { |
| | | let _config = fromJS(config).toJS() |
| | |
| | | return |
| | | } |
| | | |
| | | let _param = { |
| | | func: 'sPC_TrdMenu_AddUpt', |
| | | FstID: parMenuId, |
| | | SndID: parMenuId, |
| | | ParentID: parMenuId, |
| | | MenuID: item.uuid, |
| | | MenuNo: item.wrap.MenuNo || Utils.getuuid(), |
| | | EasyCode: '', |
| | | Template: item.type, |
| | | TypeCharOne: sessionStorage.getItem('kei_no'), |
| | | Typename: sessionStorage.getItem('typename'), |
| | | MenuName: item.name || '', |
| | | PageParam: JSON.stringify({Template: item.type}), |
| | | open_edition: item.open_edition || '', |
| | | LText: '', |
| | | LTexttb: '' |
| | | } |
| | | |
| | | _param.LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(item))) |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | _param.secretkey = Utils.encrypt('', _param.timestamp) |
| | | |
| | | let roles = { |
| | | type: 'navbar', |
| | | key: item.uuid, |
| | | title: item.name, |
| | | children: [] |
| | |
| | | title: menu.name |
| | | } |
| | | }) |
| | | console.log(roles) |
| | | |
| | | let _param = { |
| | | func: 'sPC_TrdMenu_AddUpt', |
| | | FstID: 'mk_app', |
| | | SndID: 'mk_app', |
| | | ParentID: 'mk_app', |
| | | MenuID: item.uuid, |
| | | MenuNo: item.wrap.MenuNo || Utils.getuuid(), |
| | | EasyCode: '', |
| | | Template: item.type, |
| | | TypeCharOne: sessionStorage.getItem('kei_no'), |
| | | Typename: sessionStorage.getItem('typename'), |
| | | MenuName: item.name || '', |
| | | PageParam: JSON.stringify({Template: item.type}), |
| | | open_edition: item.open_edition || '', |
| | | menus_rolelist: window.btoa(window.encodeURIComponent(JSON.stringify(roles))), |
| | | LText: '', |
| | | LTexttb: '' |
| | | } |
| | | |
| | | _param.LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(item))) |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | _param.secretkey = Utils.encrypt('', _param.timestamp) |
| | | |
| | | Api.getSystemConfig(_param).then(res => { |
| | | if (!res.status) { |
| | |
| | | this.setState({ |
| | | config, |
| | | oriConfig: fromJS(config).toJS(), |
| | | menuloading: false, |
| | | comloading: true |
| | | }, () => { |
| | | this.setState({ |
| | | comloading: false |
| | | }) |
| | | menuloading: false |
| | | }) |
| | | |
| | | notification.success({ |
| | |
| | | menuloading: false |
| | | }) |
| | | } |
| | | MKEmitter.emit('completeSave') |
| | | }) |
| | | }, 300) |
| | | } |
| | |
| | | error = `导航栏《${item.name}》未设置菜单参数!` |
| | | } |
| | | |
| | | if (['propcard', 'brafteditor', 'sandbox', 'tabbar', 'stepform'].includes(item.subtype) && item.wrap.datatype === 'static') return |
| | | if (['propcard', 'brafteditor', 'sandbox', 'tabbar', 'stepform', 'tabform'].includes(item.subtype) && item.wrap.datatype === 'static') return |
| | | if (['balcony'].includes(item.type) && item.wrap.datatype === 'static') return |
| | | |
| | | if (item.setting) { |
| | |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | | sessionStorage.setItem('appHomeId', config.MenuID) |
| | | sessionStorage.setItem('appViewList', JSON.stringify(appViewList)) |
| | | } |
| | | }) |
| | |
| | | {controlshow ? <Icon onClick={() => {this.setState({controlshow: false})}} type="double-right" /> : null} |
| | | {!controlshow ? <Icon onClick={() => {this.setState({controlshow: true})}} type="double-left" /> : null} |
| | | </div> |
| | | <Button type="primary" onClick={this.submitConfig} loading={menuloading}>{dict['mob.save']}</Button> |
| | | <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config && config.enabled} onChange={this.onEnabledChange} /> |
| | | <CreateView resetmenu={this.getAppMenus} /> |
| | | <PasteController type="menu" Tab={null} insert={this.insert} /> |
| | | <StyleCombControlButton menu={config} /> |
| | | <SysInterface config={config} updateConfig={this.updateConfig}/> |
| | | <PictureController/> |
| | | <Quotecomponent config={config} updateConfig={this.updateConfig}/> |
| | | <Button className="mk-border-green" icon="home" onClick={this.setHomeView}>设为首页</Button> |
| | | <Button className="mk-border-danger" icon="redo" onClick={this.refreshView}>强制刷新</Button> |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <Transfer MenuID={MenuId} /> |
| | | <Button type="default" onClick={this.closeView}>关闭</Button> |
| | | <div className="wrap"> |
| | | <Button type="primary" onClick={this.submitConfig} loading={menuloading}>{dict['mob.save']}</Button> |
| | | <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config && config.enabled} onChange={this.onEnabledChange} /> |
| | | <CreateView resetmenu={this.getAppMenus} /> |
| | | <PasteController type="menu" Tab={null} insert={this.insert} /> |
| | | <StyleCombControlButton menu={config} /> |
| | | <SysInterface config={config} updateConfig={this.updateConfig}/> |
| | | <PictureController/> |
| | | <Quotecomponent config={config} updateConfig={this.updateConfig}/> |
| | | <Button className="mk-border-green" icon="home" onClick={this.setHomeView}>设为首页</Button> |
| | | <Button className="mk-border-danger" icon="redo" onClick={this.refreshView}>强制刷新</Button> |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <Transfer MenuID={MenuId} /> |
| | | <Button type="default" onClick={this.closeView}>关闭</Button> |
| | | </div> |
| | | </div> |
| | | <div className={'menu-body menu-view' + (menuloading ? 'saving' : '')}> |
| | | {config && !comloading ? <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}> |