| | |
| | | ] |
| | | ] |
| | | }, |
| | | "homepage": ".", |
| | | "homepage": "./build", |
| | | "devDependencies": { |
| | | "typescript": "^4.0.2" |
| | | } |
| | |
| | | |
| | | // 测试系统文件置于admin中 |
| | | |
| | | fetch('/options.json') |
| | | fetch('./options.json') |
| | | .then(response => response.json()) |
| | | .catch(() => { |
| | | document.getElementById('root').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">系统配置信息获取失败,请联系管理员!</div>' |
| | |
| | | const { card } = this.state |
| | | let btn = fromJS(item).toJS() |
| | | |
| | | if (btn.OpenType === 'pop') { |
| | | if (btn.OpenType === 'pop' || btn.execMode === 'pop') { |
| | | if (!btn.modal) { |
| | | btn.modal = { |
| | | setting: { title: btn.label, width: 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' }, |
| | |
| | | btnDoubleClick = (element) => { |
| | | if (sessionStorage.getItem('style-control') && sessionStorage.getItem('style-control') !== 'false') return |
| | | |
| | | if (element.OpenType === 'pop' || element.OpenType === 'popview') { |
| | | if (element.OpenType === 'pop' || element.OpenType === 'popview' || element.execMode === 'pop') { |
| | | this.props.setSubConfig(element) |
| | | } else { |
| | | notification.warning({ |
| | |
| | | const { card } = this.state |
| | | let btn = fromJS(item).toJS() |
| | | |
| | | if (btn.OpenType === 'pop') { |
| | | if (btn.OpenType === 'pop' || btn.execMode === 'pop') { |
| | | if (!btn.modal) { |
| | | btn.modal = { |
| | | setting: { title: btn.label, width: 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' }, |
| | |
| | | const { card } = this.state |
| | | let btn = fromJS(item).toJS() |
| | | |
| | | if (btn.OpenType === 'pop') { |
| | | if (btn.OpenType === 'pop' || btn.execMode === 'pop') { |
| | | if (!btn.modal) { |
| | | btn.modal = { |
| | | setting: { title: btn.label, width: 60, cols: '2', container: 'view', focus: '', finish: 'close', clickouter: 'unclose', display: 'modal' }, |
| | |
| | | item.linkTab = '' |
| | | } |
| | | |
| | | if (item.OpenType === 'pop') { // 含有子配置项的按钮(表单) |
| | | if (item.OpenType === 'pop' || item.execMode === 'pop') { // 含有子配置项的按钮(表单) |
| | | _oriActions.push({ |
| | | prebtn: fromJS(item).toJS(), |
| | | curuuid: uuid, |
| | | Template: 'Modal' |
| | | }) |
| | | } else if (item.OpenType === 'tab' || item.OpenType === 'blank') { // 含有子配置项的按钮(标签后当前页打开) |
| | | } else if (item.OpenType === 'tab' && item.tabTemplate === 'FormTab') { // 含有子配置项的按钮(标签页打开) |
| | | _oriActions.push({ |
| | | prebtn: fromJS(item).toJS(), |
| | | curuuid: uuid, |
| | | Template: item.tabTemplate |
| | | Template: 'FormTab' |
| | | }) |
| | | } |
| | | |
| | |
| | | let curBtn = config.action.filter(cell => item.curuuid === cell.uuid)[0] // 查看初始化按钮是否存在 |
| | | if (!curBtn) return |
| | | if (curBtn.OpenType !== item.prebtn.OpenType) return |
| | | if (curBtn.OpenType === 'tab' && curBtn.tabTemplate !== 'FormTab') return |
| | | if (curBtn.OpenType === 'funcbutton' && curBtn.execMode !== 'pop') return |
| | | |
| | | oriActions.push({ |
| | | prebtn: item.prebtn, |
| | |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | | // 基本信息验证 |
| | | if (!config.fstMenuId || !config.ParentId || !config.MenuName || !config.MenuNo) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: this.state.dict['model.menu.basemsg'], |
| | | duration: 5 |
| | | }) |
| | | this.setState({activeKey: '0'}) |
| | | return |
| | | } |
| | | if (!is(fromJS(originMenu), fromJS(config))) { // 菜单信息变化时,提示保存 |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | return |
| | | } |
| | | |
| | | let submenu = menu.fstMenuList.filter(item => item.MenuID === config.fstMenuId)[0] |
| | | let submenu = menu.fstMenuList.filter(_menu => _menu.MenuID === config.fstMenuId)[0] |
| | | |
| | | let _Menu = { |
| | | ...menu, |
| | |
| | | let isbutton = true |
| | | let _btnTab = null |
| | | |
| | | if (type === 'button' && item.OpenType === 'pop') { |
| | | _view = 'Modal' // 表单页面 |
| | | } else if (type === 'button' && (item.OpenType === 'tab' || item.OpenType === 'blank')) { |
| | | _view = item.tabTemplate // 新标签页模板 |
| | | if (type === 'button' && (item.OpenType === 'pop' || item.execMode === 'pop')) { |
| | | _view = 'Modal' // 表单页面 |
| | | } else if (type === 'button' && item.OpenType === 'tab') { |
| | | _view = 'FormTab' // 表单标签页模板 |
| | | _btnTab = item |
| | | } else if (type === 'button' && item.OpenType === 'popview') { |
| | | _view = item.tabType || 'SubTable' // 新弹窗标签模板 tabType 属性已去除 |
| | | _view = 'SubTable' // 新弹窗标签模板 tabType 属性已去除 |
| | | uuid = item.linkTab |
| | | isbutton = false |
| | | } else if (type === 'tab') { |
| | | _view = item.type // 标签模板 |
| | | _view = 'SubTable' // 标签模板 |
| | | uuid = item.linkTab |
| | | isbutton = false |
| | | } |
| | |
| | | const { menu } = this.props |
| | | const { activeKey, config, chartview } = this.state |
| | | |
| | | const confActions = config.action.filter(_action => !_action.origin && (['pop', 'popview', 'blank'].includes(_action.OpenType) || (_action.OpenType === 'tab' && _action.tabTemplate === 'FormTab'))) |
| | | const confActions = config.action.filter(_action => !_action.origin && (['pop', 'popview'].includes(_action.OpenType) || (_action.OpenType === 'tab' && _action.tabTemplate === 'FormTab') || (_action.OpenType === 'funcbutton' && _action.execMode === 'pop'))) |
| | | |
| | | let configTabs = [] |
| | | config.tabgroups.forEach(group => { |
| | |
| | | values.Ot = 'notRequired' |
| | | } else if (values.OpenType === 'popview' && !values.linkTab) { // 没有关联标签(新建时),创建新标签Id |
| | | values.linkTab = Utils.getuuid() |
| | | values.createTab = true // 用于标记按钮复制时,是否复制原有标签 |
| | | } else if (values.OpenType === 'funcbutton') { // 转换打印时打开方式 |
| | | values.position = 'toolbar' |
| | | } else if (['pop', 'prompt', 'exec'].includes(values.OpenType) && values.verify) { |
| | |
| | | new Promise(resolve => { |
| | | if ( |
| | | !card.originCard || |
| | | (btn.OpenType === 'pop' && card.originCard.OpenType !== 'pop') || |
| | | (['tab', 'blank'].includes(btn.OpenType) && !['tab', 'blank'].includes(card.originCard.OpenType)) || |
| | | (btn.OpenType === 'popview' && (!btn.createTab || card.originCard.OpenType !== 'popview' || !card.originCard.linkTab)) |
| | | (btn.OpenType !== card.originCard.OpenType) || |
| | | (btn.OpenType === 'tab' && btn.tabTemplate !== 'FormTab') || |
| | | (btn.OpenType === 'funcbutton' && btn.execMode !== 'pop') |
| | | ) { // 按钮不是复制,或按钮前后类型不一致时,直接保存 |
| | | resolve('save') |
| | | } else if (btn.OpenType === 'pop' || btn.OpenType === 'tab' || btn.OpenType === 'blank') { |
| | | } else if (btn.OpenType === 'pop' || btn.OpenType === 'tab' || btn.execMode === 'pop') { |
| | | resolve('subconf') |
| | | } else if (btn.OpenType === 'popview') { |
| | | resolve('subtab') |
| | |
| | | } |
| | | } |
| | | |
| | | if (!_LongParam) return 'save' |
| | | |
| | | let _temp = '' // 配置信息类型 |
| | | |
| | | // 修改模态框标题名称 |
| | | if (btn.OpenType === 'pop' && _LongParam && _LongParam.type === 'Modal') { |
| | | if ((btn.OpenType === 'pop' || btn.execMode === 'pop') && _LongParam.type === 'Modal') { |
| | | try { |
| | | _LongParam.setting.title = btn.label |
| | | _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_LongParam))) |
| | | _temp = 'Modal' |
| | | } catch { |
| | | console.warn('Stringify Failure') |
| | | _LongParam = '' |
| | | _temp = '' |
| | | } |
| | | } else if (['tab', 'blank'].includes(btn.OpenType) && _LongParam && _LongParam.type === 'FormTab') { |
| | | } else if (btn.OpenType === 'tab' && _LongParam.type === 'FormTab') { |
| | | try { |
| | | _LongParam.action = _LongParam.action.map(_btn => { |
| | | _btn.uuid = Utils.getuuid() |
| | |
| | | _temp = 'FormTab' |
| | | } catch { |
| | | console.warn('Stringify Failure') |
| | | _LongParam = '' |
| | | _temp = '' |
| | | } |
| | | } |
| | |
| | | _tab.action = _tab.action.map((item, index) => { |
| | | let uuid = Utils.getuuid() |
| | | |
| | | if (item.OpenType === 'pop') { |
| | | if (item.OpenType === 'pop' || item.execMode === 'pop') { |
| | | _oriActions.push({ |
| | | prebtn: JSON.parse(JSON.stringify(item)), |
| | | curuuid: uuid, |
| | |
| | | /** |
| | | * @description 按钮双击触发子配置 |
| | | */ |
| | | btnDoubleClick = (element) => { |
| | | if (!element.origin && (element.OpenType === 'pop' || element.OpenType === 'popview' || element.OpenType === 'blank' || (element.OpenType === 'tab' && element.tabTemplate === 'FormTab'))) { |
| | | this.props.setSubConfig(element) |
| | | btnDoubleClick = (el) => { |
| | | // execMode === 'pop' 为 OpenType === 'funcbutton' |
| | | if (!el.origin && (el.OpenType === 'pop' || el.execMode === 'pop' || el.OpenType === 'popview' || (el.OpenType === 'tab' && el.tabTemplate === 'FormTab'))) { |
| | | this.props.setSubConfig(el) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | if (_config.type === 'user') { |
| | | _config.action = _config.action.map(item => { |
| | | let uuid = Utils.getuuid() |
| | | |
| | | if (item.linkTab) { |
| | | item.linkTab = '' |
| | | } |
| | | |
| | | if (item.OpenType === 'pop') { // 含有子配置项的按钮 |
| | | _oriActions.push({ |
| | | prebtn: fromJS(item).toJS(), |
| | |
| | | let curBtn = config.action.filter(cell => item.curuuid === cell.uuid)[0] // 查看初始化按钮是否存在 |
| | | if (!curBtn) return |
| | | if (curBtn.OpenType !== item.prebtn.OpenType) return |
| | | if (curBtn.OpenType === 'funcbutton' && curBtn.execMode !== 'pop') return |
| | | |
| | | oriActions.push({ |
| | | prebtn: item.prebtn, |
| | |
| | | let _view = '' |
| | | let _subtab = editSubTab |
| | | |
| | | if (btn.OpenType === 'pop') { |
| | | _view = 'Modal' // 表单页面 |
| | | if (btn.OpenType === 'pop' || btn.execMode === 'pop') { |
| | | _view = 'Modal' // 表单页面 |
| | | } else if (btn.OpenType === 'popview') { |
| | | _view = btn.tabType || 'SubTable' // 新弹窗标签模板 tabType 属性已去除 |
| | | _view = 'SubTable' // 新弹窗标签模板 tabType 属性已去除 |
| | | _subtab = btn |
| | | |
| | | if (editSubTab) { |
| | |
| | | render () { |
| | | const { activeKey, config, chartview } = this.state |
| | | |
| | | const confActions = config.action.filter(_action => !_action.origin && ['pop', 'popview', 'blank'].includes(_action.OpenType)) |
| | | const confActions = config.action.filter(_action => !_action.origin && (['pop', 'popview'].includes(_action.OpenType) || (_action.OpenType === 'funcbutton' && _action.execMode === 'pop'))) |
| | | |
| | | return ( |
| | | <div className="model-subtable-board"> |
| | |
| | | config.action = config.action.map(item => { |
| | | if (item.execMode) { |
| | | item.OpenType = 'funcbutton' |
| | | } else if (item.OpenType === 'blank') { |
| | | item.OpenType = 'tab' |
| | | } |
| | | return item |
| | | }) |
| | |
| | | config.action = config.action.map(item => { |
| | | if (item.execMode) { |
| | | item.OpenType = 'funcbutton' |
| | | } else if (item.OpenType === 'blank') { |
| | | item.OpenType = 'tab' |
| | | } |
| | | return item |
| | | }) |