Commit 11b32392 authored by weizhikai's avatar weizhikai

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_wzk

parents 2f2499fe 32ff80aa
......@@ -174,33 +174,33 @@
sheet.bind(GC.Spread.Sheets.Events.CellClick, function (sender, args) {
scope.$apply(function () {
if (window.event.ctrlKey) {
var data = JSON.parse(args.sheet.getTag(args.row, args.col));
if (!_.isEmpty(data) && !_.isEmpty(data.dataSourceList)) {
var reports = _.chain(data.dataSourceList)
.where({type: enums.formulaDataSourceType.Report})
.map(function (x) {
return {
reportCode: x.reportCode,
year: x.year,
period: x.period
};
}).uniq(function (x) {
return x.reportCode + ',' + x.year + ',' + x.period;
}).value();
if (reports.length === 1) {
var drillDownArgs = _.findWhere(data.dataSourceList, {type: enums.formulaDataSourceType.Report});
if (drillDownArgs.period === scope.projectPeriod && drillDownArgs.year === scope.projectYear) {
drillDownArgs = {
reportID: drillDownArgs.reportID,
reportTemplateID: drillDownArgs.reportTemplateID,
reportName: drillDownArgs.reportName,
reportCode: drillDownArgs.reportCode,
cellName: PWC.numToExcelChar(drillDownArgs.rowIndex, drillDownArgs.columnIndex)
};
scope.$emit(enums.vatEvent.reportDrillDown, drillDownArgs);
}
}
}
// var data = JSON.parse(args.sheet.getTag(args.row, args.col));
// if (!_.isEmpty(data) && !_.isEmpty(data.dataSourceList)) {
// var reports = _.chain(data.dataSourceList)
// .where({type: enums.formulaDataSourceType.Report})
// .map(function (x) {
// return {
// reportCode: x.reportCode,
// year: x.year,
// period: x.period
// };
// }).uniq(function (x) {
// return x.reportCode + ',' + x.year + ',' + x.period;
// }).value();
// if (reports.length === 1) {
// var drillDownArgs = _.findWhere(data.dataSourceList, {type: enums.formulaDataSourceType.Report});
// if (drillDownArgs.period === scope.projectPeriod && drillDownArgs.year === scope.projectYear) {
// drillDownArgs = {
// reportID: drillDownArgs.reportID,
// reportTemplateID: drillDownArgs.reportTemplateID,
// reportName: drillDownArgs.reportName,
// reportCode: drillDownArgs.reportCode,
// cellName: PWC.numToExcelChar(drillDownArgs.rowIndex, drillDownArgs.columnIndex)
// };
// scope.$emit(enums.vatEvent.reportDrillDown, drillDownArgs);
// }
// }
// }
}
else if (_.isFunction(scope.internalApi.onCellClick) && args.sheet.getTag(args.row, args.col)) {
scope.internalApi.onCellClick({
......
......@@ -173,33 +173,33 @@
sheet.bind(GC.Spread.Sheets.Events.CellClick, function (sender, args) {
scope.$apply(function () {
if (window.event.ctrlKey) {
var data = JSON.parse(args.sheet.getTag(args.row, args.col));
if (!_.isEmpty(data) && !_.isEmpty(data.dataSourceList)) {
var reports = _.chain(data.dataSourceList)
.where({type: enums.formulaDataSourceType.Report})
.map(function (x) {
return {
reportCode: x.reportCode,
year: x.year,
period: x.period
};
}).uniq(function (x) {
return x.reportCode + ',' + x.year + ',' + x.period;
}).value();
if (reports.length === 1) {
var drillDownArgs = _.findWhere(data.dataSourceList, {type: enums.formulaDataSourceType.Report});
if (drillDownArgs.period === scope.projectPeriod && drillDownArgs.year === scope.projectYear) {
drillDownArgs = {
reportID: drillDownArgs.reportID,
reportTemplateID: drillDownArgs.reportTemplateID,
reportName: drillDownArgs.reportName,
reportCode: drillDownArgs.reportCode,
cellName: PWC.numToExcelChar(drillDownArgs.rowIndex, drillDownArgs.columnIndex)
};
scope.$emit(enums.vatEvent.reportDrillDown, drillDownArgs);
}
}
}
// var data = JSON.parse(args.sheet.getTag(args.row, args.col));
// if (!_.isEmpty(data) && !_.isEmpty(data.dataSourceList)) {
// var reports = _.chain(data.dataSourceList)
// .where({type: enums.formulaDataSourceType.Report})
// .map(function (x) {
// return {
// reportCode: x.reportCode,
// year: x.year,
// period: x.period
// };
// }).uniq(function (x) {
// return x.reportCode + ',' + x.year + ',' + x.period;
// }).value();
// if (reports.length === 1) {
// var drillDownArgs = _.findWhere(data.dataSourceList, {type: enums.formulaDataSourceType.Report});
// if (drillDownArgs.period === scope.projectPeriod && drillDownArgs.year === scope.projectYear) {
// drillDownArgs = {
// reportID: drillDownArgs.reportID,
// reportTemplateID: drillDownArgs.reportTemplateID,
// reportName: drillDownArgs.reportName,
// reportCode: drillDownArgs.reportCode,
// cellName: PWC.numToExcelChar(drillDownArgs.rowIndex, drillDownArgs.columnIndex)
// };
// scope.$emit(enums.vatEvent.reportDrillDown, drillDownArgs);
// }
// }
// }
}
else if (_.isFunction(scope.internalApi.onCellClick) && args.sheet.getTag(args.row, args.col)) {
scope.internalApi.onCellClick({
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment