| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { notification, Spin, Row, Col, Modal } from 'antd' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | |
| | | window.GLOB.CacheData.set(MenuID, urlparam) |
| | | |
| | | if (window.backend && config.allSqls) { |
| | | let keys = Object.keys(urlparam) |
| | | config.allSqls.forEach(item => { |
| | | item.id = md5(window.GLOB.appkey + item.v_id) |
| | | if (item.type === 'datasource' || item.type === 'excelOut') { |
| | | item.urlkeys = keys |
| | | item.urlparam = urlparam |
| | | if (config.flow_code) { |
| | | item.works_flow_code = config.flow_code |
| | | } |
| | | } |
| | | window.GLOB.CacheData.set('sql_' + item.uuid, item) |
| | | }) |
| | | } |
| | | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | |
| | |
| | | } |
| | | }) |
| | | |
| | | config.components = this.formatSetting(config.components, params, inherit, config.interfaces, balMap, tbMap) |
| | | config.components = this.formatSetting(config.components, params, inherit, config.interfaces, balMap, tbMap, BID) |
| | | |
| | | if (initInters.length > 0) { |
| | | this.stepInter = { |
| | |
| | | |
| | | if (item.hasExtend) { |
| | | item.setting.hasExtend = true |
| | | item.setting.sync = 'false' |
| | | item.setting.tableMode = 'compatible' |
| | | item.setting.extendTime = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | item.colsCtrls = null |
| | |
| | | } |
| | | } |
| | | } else if (item.type === 'card' || item.type === 'carousel' || item.type === 'timeline') { |
| | | if (item.wrap.datatype === 'public') { |
| | | balMap.set(item.wrap.publicId + 'public', true) |
| | | } |
| | | item.subcards && item.subcards.forEach(card => { |
| | | if (card.style.boxShadow) { |
| | | delete card.style.hShadow |
| | |
| | | |
| | | if (item.setting.sync === 'true') { |
| | | // pageable 是否分页,组件属性,不分页的组件才可以统一查询 |
| | | if ((!item.pageable || (item.pageable && !item.setting.laypage)) && item.setting.onload === 'true') { |
| | | if ((!item.pageable || (item.pageable && !item.setting.laypage)) && item.setting.onload === 'true' && !_tailScript) { |
| | | |
| | | } else { |
| | | item.setting.sync = 'false' |
| | |
| | | } |
| | | |
| | | // 格式化默认设置 |
| | | formatSetting = (components, params, inherit, interfaces, balMap, tbMap) => { |
| | | formatSetting = (components, params, inherit, interfaces, balMap, tbMap, BID) => { |
| | | let delay = 20 |
| | | return components.map(component => { |
| | | if (component.type === 'tabs') { |
| | | component.subtabs = component.subtabs.map(tab => { |
| | | tab.components = this.formatSetting(tab.components, null, inherit, interfaces, balMap, tbMap) |
| | | tab.components = this.formatSetting(tab.components, null, inherit, interfaces, balMap, tbMap, BID) |
| | | tab = {...tab, ...inherit} |
| | | return tab |
| | | }) |
| | | return component |
| | | } else if (component.type === 'group') { |
| | | component.components = this.formatSetting(component.components, params, null, interfaces, balMap, tbMap) |
| | | component.components = this.formatSetting(component.components, params, null, interfaces, balMap, tbMap, BID) |
| | | return component |
| | | } |
| | | |
| | |
| | | |
| | | if (component.setting.interType !== 'system') return component |
| | | |
| | | component.setting.uuid = component.uuid |
| | | |
| | | // dataName 系统生成的数据源名称 |
| | | if (component.setting.sync === 'true') { |
| | | component.dataName = 'mk' + component.uuid.slice(-18) |
| | |
| | | component.setting.sync = 'false' |
| | | component.setting.onload = 'false' |
| | | } else { |
| | | params.push(getStructDefaultParam(component, searchlist, params.length === 0)) |
| | | let backend = false |
| | | if (window.backend && params.length === 0 && window.GLOB.CacheData.has('sql_' + component.uuid)) { |
| | | backend = true |
| | | } else if (window.backend && params[0] && params[0].exps) { |
| | | backend = true |
| | | } |
| | | if (backend && !window.GLOB.CacheData.has('sql_' + component.uuid)) { |
| | | component.setting.sync = 'false' |
| | | } else { |
| | | params.push(getStructDefaultParam(component, searchlist, params.length === 0, BID)) |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | inter.setting.arr_field = inter.columns.map(col => col.field).join(',') |
| | | |
| | | if (inter.setting.interType !== 'system') return inter |
| | | |
| | | inter.setting.uuid = inter.uuid |
| | | |
| | | let _customScript = '' |
| | | let _tailScript = '' |
| | |
| | | this.setState({loading: true, loadingview: false}) |
| | | |
| | | if (config.$cache && config.$time) { |
| | | Api.getLCacheConfig(params[0].uuid, config.$time, BID).then(res => { |
| | | Api.getLCacheConfig(params[0].uuid || params[0].id, config.$time, BID).then(res => { |
| | | if (!res.valid) { |
| | | this.getMainData(param, params, config.MenuID) |
| | | } else { |
| | |
| | | } |
| | | |
| | | params.forEach((item) => { |
| | | let _data = result[item.name] || '' |
| | | let _data = result[item.dataName] || '' |
| | | if (_data && !Array.isArray(_data)) { |
| | | _data = [_data] |
| | | } |
| | | window.GLOB.SyncData.set(item.name, _data) |
| | | window.GLOB.SyncData.set(item.dataName, _data) |
| | | }) |
| | | |
| | | MKEmitter.emit('transferSyncData', MenuID) |