| | |
| | | config.MenuID = this.props.MenuID |
| | | config.MenuName = MenuName |
| | | config.setting.MenuName = MenuName |
| | | config.setting.$name = MenuName |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | config = '' |
| | |
| | | } |
| | | let chartId = config.charts[0] ? config.charts[0].uuid : '' |
| | | |
| | | // 字段权限黑名单 |
| | | config.search = Utils.initSearchVal(config.search) |
| | | |
| | | // 字段透视及必填标志 |
| | | let hasReqFields = false |
| | | config.search = config.search.map(item => { |
| | | item.oriInitval = item.initval |
| | | if (['text', 'select', 'link'].includes(item.type) && param && param.$searchkey === item.field) { |
| | | item.initval = param.$searchval |
| | | } |
| | | |
| | | if (!item.blacklist || item.blacklist.length === 0) return item |
| | | if (item.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { |
| | | item.Hide = 'true' |
| | | if (item.required) { |
| | | hasReqFields = true |
| | | } |
| | | |
| | | return item |
| | |
| | | config.setting.dataresource = config.setting.dataresource.replace(/@\$|\$@/ig, '') |
| | | config.setting.customScript = config.setting.customScript.replace(/@\$|\$@/ig, '') |
| | | } |
| | | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | let city = sessionStorage.getItem('city') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | let regs = [ |
| | | { reg: /@userName@/ig, value: `'${userName}'` }, |
| | | { reg: /@fullName@/ig, value: `'${fullName}'` }, |
| | | { reg: /@login_city@/ig, value: `'${city}'` } |
| | | ] |
| | | |
| | | regs.forEach(cell => { |
| | | config.setting.dataresource = config.setting.dataresource.replace(cell.reg, cell.value) |
| | | config.setting.customScript = config.setting.customScript.replace(cell.reg, cell.value) |
| | | }) |
| | | |
| | | if (config.urlFields) { |
| | | let _param = param || {} |
| | | config.urlFields.forEach(field => { |
| | |
| | | _columns.push(config.gridBtn) |
| | | } |
| | | |
| | | let valid = true // 搜索条件必填验证, 初始搜索条件, 如通过上级透视,写入搜索条件 |
| | | let hasReqFields = false |
| | | config.search.forEach(item => { |
| | | if (item.required !== 'true') return |
| | | if (!item.initval) { |
| | | valid = false |
| | | } |
| | | hasReqFields = true |
| | | }) |
| | | |
| | | this.setState({ |
| | | loadingview: false, |
| | | absFields, |
| | |
| | | columns: _columns, |
| | | arr_field: _arrField.join(','), |
| | | BID: param && param.$BID ? param.$BID : '', |
| | | search: Utils.initMainSearch(config.search), // 搜索条件初始化(含有时间格式,需要转化) |
| | | search: Utils.initMainSearch(config.search), |
| | | hasReqFields |
| | | }, () => { |
| | | if (config.setting.onload !== 'false' && valid) { // 初始化可加载 |
| | | if (config.setting.onload !== 'false') { // 初始化可加载 |
| | | this.loadData() |
| | | } |
| | | this.setShortcut() |
| | |
| | | |
| | | loadData = () => { |
| | | const { setting, search, BIDs, loadCustomApi, hasReqFields } = this.state |
| | | let requireFields = [] |
| | | |
| | | if (hasReqFields) { |
| | | requireFields = search.filter(item => item.required && (!item.value || item.value.length === 0)) |
| | | } |
| | | |
| | | this.setState({ |
| | | selectedData: [], |
| | |
| | | } |
| | | }) |
| | | |
| | | if (requireFields.length > 0) { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | return |
| | | } else if (window.GLOB.systemType === 'production' && setting.interType === 'custom' && !setting.proInterface) { |
| | | if (hasReqFields) { |
| | | let requireFields = search.filter(item => item.required && item.value === '') |
| | | |
| | | if (requireFields.length > 0) { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | |
| | | if (window.GLOB.systemType === 'production' && setting.interType === 'custom' && !setting.proInterface) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未设置正式系统地址!', |
| | |
| | | |
| | | let mkey = result.mk_api_key || '' |
| | | |
| | | delete result.mk_ex_invoke |
| | | delete result.mk_ex_invoke // 是否继续执行 |
| | | delete result.status |
| | | delete result.message |
| | | delete result.ErrCode |
| | | delete result.ErrMesg |
| | | delete result.mk_api_key |
| | | delete result.mk_api_key // 当前请求的key值,用于回调 |
| | | |
| | | let param = {} |
| | | |
| | |
| | | }) |
| | | |
| | | Api.directRequest(url, setting.method, param, setting.cross).then(res => { |
| | | if (typeof(res) !== 'object' || Array.isArray(res)) { |
| | | if (typeof(res) !== 'object') { |
| | | let error = '未知的返回结果!' |
| | | |
| | | if (typeof(res) === 'string') { |
| | |
| | | |
| | | this.customCallbackRequest(_result) |
| | | } else { |
| | | if (Array.isArray(res)) { |
| | | res = { data: res } |
| | | } |
| | | res.mk_api_key = mkey |
| | | this.customCallbackRequest(res) |
| | | } |
| | |
| | | let _orderBy = orderBy || setting.order |
| | | let param = UtilsDM.getQueryDataParams(setting, arr_field, search, _orderBy, pageIndex, pageSize, BID, this.props.menuType) |
| | | |
| | | if (param.func === 'sPC_Get_TableData') { |
| | | param.menuname = this.props.MenuName || '' |
| | | } |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | |
| | | this.getStatFieldsValue() |
| | |
| | | item.key = index |
| | | item.$$uuid = item[setting.primaryKey] || '' |
| | | item.$$BID = BID || '' |
| | | item.$Index = start + index |
| | | item.$Index = start + index + '' |
| | | |
| | | return item |
| | | }), |
| | |
| | | |
| | | let _orderBy = orderBy || setting.order |
| | | let param = UtilsDM.getQueryDataParams(setting, arr_field, search, _orderBy, pageIndex, pageSize, BID, this.props.menuType, id) |
| | | |
| | | if (param.func === 'sPC_Get_TableData') { |
| | | param.menuname = this.props.MenuName || '' |
| | | } |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | if (result.status) { |
| | |
| | | } |
| | | return item |
| | | }) |
| | | } catch { |
| | | } catch (e) { |
| | | console.warn('数据查询错误') |
| | | } |
| | | } |
| | |
| | | |
| | | let _orderBy = orderBy || setting.order |
| | | let param = UtilsDM.getStatQueryDataParams(setting, statFields, search, _orderBy, BID, this.props.menuType) |
| | | |
| | | if (param.func === 'sPC_Get_TableData') { |
| | | param.menuname = this.props.MenuName || '' |
| | | } |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | |
| | | } |
| | | } |
| | | |
| | | reloadMenuView = (menuId) => { |
| | | reloadMenuView = (menuId, position) => { |
| | | const { MenuID } = this.props |
| | | |
| | | if (MenuID !== menuId) return |
| | | |
| | | this.reloadview() |
| | | if (position === 'table') { |
| | | this.reloadtable() |
| | | } else { |
| | | this.reloadview() |
| | | } |
| | | } |
| | | |
| | | resetActiveMenu = (menuId) => { |