Commit f2f32013 authored by sherlock's avatar sherlock

key in chinese bugs

parent 24a25c0a
...@@ -515,8 +515,9 @@ ...@@ -515,8 +515,9 @@
if(_.isString(data.keyinData) && data.keyinData.length > 0 && isNaN(Number(data.keyinData))){ if(_.isString(data.keyinData) && data.keyinData.length > 0 && isNaN(Number(data.keyinData))){
sheet.setValue(data.rowIndex, data.columnIndex, data.keyinData); sheet.setValue(data.rowIndex, data.columnIndex, data.keyinData);
ifShowParseFloat = false; // 非数值字符串,单元格设置为字符串 ifShowParseFloat = false; // 非数值字符串,单元格设置为字符串
data.value = data.keyinData;
} }
else if (_.isString(data.value) && data.value.length > 0 && isNaN(Number(data.value))) { if (_.isString(data.value) && data.value.length > 0 && isNaN(Number(data.value))) {
sheet.setValue(data.rowIndex, data.columnIndex, data.value); sheet.setValue(data.rowIndex, data.columnIndex, data.value);
ifShowParseFloat = false; // 非数值字符串,单元格设置为字符串 ifShowParseFloat = false; // 非数值字符串,单元格设置为字符串
} }
...@@ -558,7 +559,7 @@ ...@@ -558,7 +559,7 @@
sheet.setValue(data.rowIndex, data.columnIndex, data.value); // 只有数值,设置为数值 sheet.setValue(data.rowIndex, data.columnIndex, data.value); // 只有数值,设置为数值
} }
} }
// sheet.setValue(data.rowIndex, data.columnIndex, '妈的有毒');
sheet.setTag(data.rowIndex, data.columnIndex, JSON.stringify(data)); sheet.setTag(data.rowIndex, data.columnIndex, JSON.stringify(data));
//设置 tooltip 和 图标信息 //设置 tooltip 和 图标信息
spreadJsTipService.setCellTipByCellData(sheet.getCell(data.rowIndex, data.columnIndex), data); spreadJsTipService.setCellTipByCellData(sheet.getCell(data.rowIndex, data.columnIndex), data);
...@@ -602,6 +603,10 @@ ...@@ -602,6 +603,10 @@
newVal = newVal.toFixed(4); newVal = newVal.toFixed(4);
} }
if(x.keyinData){
sheet.setValue(x.rowIndex, x.columnIndex, x.keyinData);
}
var oldVal = x.value; var oldVal = x.value;
oldVal = PWC.tryParseStringToNum(oldVal); oldVal = PWC.tryParseStringToNum(oldVal);
if (_.isBoolean(oldVal)) { if (_.isBoolean(oldVal)) {
...@@ -627,7 +632,8 @@ ...@@ -627,7 +632,8 @@
sheet.setTag(x.rowIndex, x.columnIndex, JSON.stringify(x)); sheet.setTag(x.rowIndex, x.columnIndex, JSON.stringify(x));
} }
}); });
spreadJsTipService.paintSheet(sheet);
loadSheet(scope.templateId);
return cells; return cells;
}; };
......
...@@ -465,7 +465,13 @@ ...@@ -465,7 +465,13 @@
} }
} }
var value = jsonTagInfo.value; var value ;
if(isNaN(parseFloat(tmpValue))){
value = jsonTagInfo.keyinData;
} else {
value = jsonTagInfo.value;
}
// 保证无论jsonTagInfo.value是数字或是字符串都能执行以下操作 // 保证无论jsonTagInfo.value是数字或是字符串都能执行以下操作
if (jsonTagInfo.value || (jsonTagInfo.value + '').indexOf('0') > -1) { if (jsonTagInfo.value || (jsonTagInfo.value + '').indexOf('0') > -1) {
if (jsonTagInfo.dataType === enums.cellDataType.Integer) { if (jsonTagInfo.dataType === enums.cellDataType.Integer) {
...@@ -488,7 +494,8 @@ ...@@ -488,7 +494,8 @@
money: jsonTagInfo.value, money: jsonTagInfo.value,
value: value, value: value,
modelIdList: jsonTagInfo.cellTemplateConfig.modelIDs, modelIdList: jsonTagInfo.cellTemplateConfig.modelIDs,
modifiedReportCell: jsonTagInfo.modifiedReportCell modifiedReportCell: jsonTagInfo.modifiedReportCell,
keinData:value
}, },
dataType: jsonTagInfo.dataType, dataType: jsonTagInfo.dataType,
reportTemplateId: jsonTagInfo.reportTemplateID, reportTemplateId: jsonTagInfo.reportTemplateID,
...@@ -497,6 +504,7 @@ ...@@ -497,6 +504,7 @@
cellTemplateId: jsonTagInfo.cellTemplateID, cellTemplateId: jsonTagInfo.cellTemplateID,
inputValue: '', inputValue: '',
inputMemo: '', inputMemo: '',
keyinData:value,
allowAddDatasource: false, allowAddDatasource: false,
showFormulaSummary: true showFormulaSummary: true
}; };
...@@ -585,7 +593,8 @@ ...@@ -585,7 +593,8 @@
var parseItem = { var parseItem = {
index: row.index, index: row.index,
name: row.name, name: row.name,
amount: row.value amount: row.value,
keyinData:row.keyinData
}; };
modelItem.dataSource.push(parseItem); modelItem.dataSource.push(parseItem);
}); });
...@@ -595,6 +604,7 @@ ...@@ -595,6 +604,7 @@
var parseItem = { var parseItem = {
index: row.index, index: row.index,
name: row.name, name: row.name,
keyinData:row.keyinData,
amount: row.amount amount: row.amount
}; };
modelItem.dataSource.push(parseItem); modelItem.dataSource.push(parseItem);
...@@ -1175,12 +1185,8 @@ ...@@ -1175,12 +1185,8 @@
for (var j = 0; j < reportD.dataSourceList.length; j++) { for (var j = 0; j < reportD.dataSourceList.length; j++) {
if (reportD.dataSourceList[j].rowIndex === cellData.rowIndex if (reportD.dataSourceList[j].rowIndex === cellData.rowIndex
&& reportD.dataSourceList[j].columnIndex === cellData.columnIndex) { && reportD.dataSourceList[j].columnIndex === cellData.columnIndex) {
if(manualData.keyinData){
reportD.keyinData = manualData.keyinData;
reportD.dataSourceList[j].keyinData = manualData.keyinData; reportD.dataSourceList[j].keyinData = manualData.keyinData;
} else {
reportD.dataSourceList[j].amount = manualData.amount; reportD.dataSourceList[j].amount = manualData.amount;
}
} }
} }
} }
...@@ -1280,6 +1286,7 @@ ...@@ -1280,6 +1286,7 @@
// 刷新spreadsheet,获取操作数据源后最新的计算结果,并拿来与当前所有单元格value比较,得到value修改前后的值对比 // 刷新spreadsheet,获取操作数据源后最新的计算结果,并拿来与当前所有单元格value比较,得到value修改前后的值对比
var updatedCells = $scope.reportApi.refreshReport(); var updatedCells = $scope.reportApi.refreshReport();
loadCellData(getActualPeriod());
}; };
$scope.updateCellBySourceDetailDelete = function (dataSource, detailId, opType) { $scope.updateCellBySourceDetailDelete = function (dataSource, detailId, opType) {
...@@ -1550,9 +1557,6 @@ ...@@ -1550,9 +1557,6 @@
}; };
$scope.saveReportCache = function () { $scope.saveReportCache = function () {
if (!$scope.reportData) { if (!$scope.reportData) {
return $q.reject(); return $q.reject();
......
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