Commit f2f32013 authored by sherlock's avatar sherlock

key in chinese bugs

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