yhdata_lxXIerx6
显示全部楼层
发表于 2023-6-14 19:38:30
本帖最后由 yhdata_lxXIerx6 于 2023-6-14 19:41 编辑
引用2个方法:
function setHeadTabLoc (tabTitle, hiddenTabName, orgCodeList) {
var Lists = {
'指标标题': { 'x': 28, 'y': 0 , width: 320, height: 88},
'时间选择': { 'x': 346, 'y': 29 , width: 250, height: 32},
'开始日期': { 'x': 614, 'y': 29, width: 200, height: 32 }, '年季度_年': { 'x': 614, 'y': 29, width: 200, height: 32 },'年份': { 'x': 614, 'y': 29, width: 200, height: 32 },
'结束日期': { 'x': 832, 'y': 29, width: 200, height: 32 }, '季度': { 'x': 832, 'y': 29, width: 200, height: 32 }, '月份': { 'x': 832, 'y': 29, width: 200, height: 32 },
'机构名称': { 'x': 1050, 'y': 29, width: 280, height: 32 }
};
var addX = isNull(orgCodeList) || orgCodeList.length <= 1 ? Lists[hiddenTabName]['width'] : 0;
var nameList = Object.keys(Lists);
for (var i = 0; i < tabTitle.length; i++) {
if (nameList == '机构名称') tabTitle['visible'] = true;
if (hiddenTabName == nameList) {
tabTitle['visible'] = false;
} else if (!isNull(nameList)) {
// tabTitle['visible'] = true;
tabTitle['x'] = Lists[nameList]['x'] + ('指标标题' == nameList ? 0 : addX);
tabTitle['y'] = Lists[nameList]['y'];
tabTitle['width'] = Lists[nameList]['width'];
tabTitle['height'] = Lists[nameList]['height'];
}
}
}
function setScreeDefaultValue (param, topScreeNames, topScreeTitleNames) {
topScreeNames[0].title = topScreeTitleNames[0];
// 时间选择.setObjects(['自定义', '年季度', '年月份'], STRING);
topScreeNames[0].setObjects(['自定义', '年季度'], STRING);
topScreeNames[0].setSelectedIndex(0);
var newsDate = now();
var curreYear = year(newsDate);
var yearList = getYearList(curreYear, 2018);
var quarterList = getQuarterList(curreYear);
var monthList = getMonthList(curreYear);
topScreeNames[1].title = topScreeTitleNames[1];
topScreeNames[1].value = curreYear + '-01-01' ;
topScreeNames[2].title = topScreeTitleNames[2];
topScreeNames[2].value = param['_LAST_FULL_DAY_'];
topScreeNames[3].title = topScreeTitleNames[3];
topScreeNames[3].setObjects(yearList);
topScreeNames[3].setSelectedObjects([curreYear], STRING);
topScreeNames[4].title = topScreeTitleNames[4];
topScreeNames[4].setObjects(yearList);
topScreeNames[4].setSelectedObjects([curreYear], STRING);
topScreeNames[5].title = topScreeTitleNames[5];
topScreeNames[5].setObjects(quarterList);
topScreeNames[5].pageSelection= false;
topScreeNames[5].setSelectedObjects(quarterList, STRING);
topScreeNames[6].title = topScreeTitleNames[6];
topScreeNames[6].setObjects(monthList);
topScreeNames[6].pageSelection= false;
topScreeNames[6].setSelectedObjects(monthList, INTEGER);
param['prentSelectYearName'] = curreYear;
topScreeNames[3].visible = false;
topScreeNames[4].visible = false;
topScreeNames[5].visible = false;
topScreeNames[6].visible = false;
// 设置图表展示4年值
param['endYear'] = year(newsDate);
param['beginYear']= year(newsDate)-3;
// 设置全局变量,用于过滤条件
param['beginTime']=parseDate(topScreeNames[1].value,"yyyy-MM-dd");
param['endTime']=parseDate(topScreeNames[2].value,"yyyy-MM-dd");
// 前一年同期时间
param['beginTime_1']=dateAdd(parseDate(topScreeNames[1].value,"yyyy-MM-dd"), 'year', -1);
param['endTime_1']=dateAdd(parseDate(topScreeNames[2].value,"yyyy-MM-dd"), 'year', -1);
}
|
|