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 @@ ...@@ -174,33 +174,33 @@
sheet.bind(GC.Spread.Sheets.Events.CellClick, function (sender, args) { sheet.bind(GC.Spread.Sheets.Events.CellClick, function (sender, args) {
scope.$apply(function () { scope.$apply(function () {
if (window.event.ctrlKey) { if (window.event.ctrlKey) {
var data = JSON.parse(args.sheet.getTag(args.row, args.col)); // var data = JSON.parse(args.sheet.getTag(args.row, args.col));
if (!_.isEmpty(data) && !_.isEmpty(data.dataSourceList)) { // if (!_.isEmpty(data) && !_.isEmpty(data.dataSourceList)) {
var reports = _.chain(data.dataSourceList) // var reports = _.chain(data.dataSourceList)
.where({type: enums.formulaDataSourceType.Report}) // .where({type: enums.formulaDataSourceType.Report})
.map(function (x) { // .map(function (x) {
return { // return {
reportCode: x.reportCode, // reportCode: x.reportCode,
year: x.year, // year: x.year,
period: x.period // period: x.period
}; // };
}).uniq(function (x) { // }).uniq(function (x) {
return x.reportCode + ',' + x.year + ',' + x.period; // return x.reportCode + ',' + x.year + ',' + x.period;
}).value(); // }).value();
if (reports.length === 1) { // if (reports.length === 1) {
var drillDownArgs = _.findWhere(data.dataSourceList, {type: enums.formulaDataSourceType.Report}); // var drillDownArgs = _.findWhere(data.dataSourceList, {type: enums.formulaDataSourceType.Report});
if (drillDownArgs.period === scope.projectPeriod && drillDownArgs.year === scope.projectYear) { // if (drillDownArgs.period === scope.projectPeriod && drillDownArgs.year === scope.projectYear) {
drillDownArgs = { // drillDownArgs = {
reportID: drillDownArgs.reportID, // reportID: drillDownArgs.reportID,
reportTemplateID: drillDownArgs.reportTemplateID, // reportTemplateID: drillDownArgs.reportTemplateID,
reportName: drillDownArgs.reportName, // reportName: drillDownArgs.reportName,
reportCode: drillDownArgs.reportCode, // reportCode: drillDownArgs.reportCode,
cellName: PWC.numToExcelChar(drillDownArgs.rowIndex, drillDownArgs.columnIndex) // cellName: PWC.numToExcelChar(drillDownArgs.rowIndex, drillDownArgs.columnIndex)
}; // };
scope.$emit(enums.vatEvent.reportDrillDown, drillDownArgs); // scope.$emit(enums.vatEvent.reportDrillDown, drillDownArgs);
} // }
} // }
} // }
} }
else if (_.isFunction(scope.internalApi.onCellClick) && args.sheet.getTag(args.row, args.col)) { else if (_.isFunction(scope.internalApi.onCellClick) && args.sheet.getTag(args.row, args.col)) {
scope.internalApi.onCellClick({ scope.internalApi.onCellClick({
......
...@@ -173,33 +173,33 @@ ...@@ -173,33 +173,33 @@
sheet.bind(GC.Spread.Sheets.Events.CellClick, function (sender, args) { sheet.bind(GC.Spread.Sheets.Events.CellClick, function (sender, args) {
scope.$apply(function () { scope.$apply(function () {
if (window.event.ctrlKey) { if (window.event.ctrlKey) {
var data = JSON.parse(args.sheet.getTag(args.row, args.col)); // var data = JSON.parse(args.sheet.getTag(args.row, args.col));
if (!_.isEmpty(data) && !_.isEmpty(data.dataSourceList)) { // if (!_.isEmpty(data) && !_.isEmpty(data.dataSourceList)) {
var reports = _.chain(data.dataSourceList) // var reports = _.chain(data.dataSourceList)
.where({type: enums.formulaDataSourceType.Report}) // .where({type: enums.formulaDataSourceType.Report})
.map(function (x) { // .map(function (x) {
return { // return {
reportCode: x.reportCode, // reportCode: x.reportCode,
year: x.year, // year: x.year,
period: x.period // period: x.period
}; // };
}).uniq(function (x) { // }).uniq(function (x) {
return x.reportCode + ',' + x.year + ',' + x.period; // return x.reportCode + ',' + x.year + ',' + x.period;
}).value(); // }).value();
if (reports.length === 1) { // if (reports.length === 1) {
var drillDownArgs = _.findWhere(data.dataSourceList, {type: enums.formulaDataSourceType.Report}); // var drillDownArgs = _.findWhere(data.dataSourceList, {type: enums.formulaDataSourceType.Report});
if (drillDownArgs.period === scope.projectPeriod && drillDownArgs.year === scope.projectYear) { // if (drillDownArgs.period === scope.projectPeriod && drillDownArgs.year === scope.projectYear) {
drillDownArgs = { // drillDownArgs = {
reportID: drillDownArgs.reportID, // reportID: drillDownArgs.reportID,
reportTemplateID: drillDownArgs.reportTemplateID, // reportTemplateID: drillDownArgs.reportTemplateID,
reportName: drillDownArgs.reportName, // reportName: drillDownArgs.reportName,
reportCode: drillDownArgs.reportCode, // reportCode: drillDownArgs.reportCode,
cellName: PWC.numToExcelChar(drillDownArgs.rowIndex, drillDownArgs.columnIndex) // cellName: PWC.numToExcelChar(drillDownArgs.rowIndex, drillDownArgs.columnIndex)
}; // };
scope.$emit(enums.vatEvent.reportDrillDown, drillDownArgs); // scope.$emit(enums.vatEvent.reportDrillDown, drillDownArgs);
} // }
} // }
} // }
} }
else if (_.isFunction(scope.internalApi.onCellClick) && args.sheet.getTag(args.row, args.col)) { else if (_.isFunction(scope.internalApi.onCellClick) && args.sheet.getTag(args.row, args.col)) {
scope.internalApi.onCellClick({ 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