|
@@ -557,9 +557,9 @@ var projectObj = {
|
|
projectObj.mainSpread.repaint();
|
|
projectObj.mainSpread.repaint();
|
|
},
|
|
},
|
|
mainSpreadEditEnded: function (sender, info) {
|
|
mainSpreadEditEnded: function (sender, info) {
|
|
|
|
+ console.log('enterEDEnd');
|
|
let project = projectObj.project;
|
|
let project = projectObj.project;
|
|
let node = project.mainTree.items[info.row];
|
|
let node = project.mainTree.items[info.row];
|
|
- console.log( project.withinBillsLocked(node));
|
|
|
|
project.withinBillsLocked(node);
|
|
project.withinBillsLocked(node);
|
|
let colSetting = projectObj.mainController.setting.cols[info.col];
|
|
let colSetting = projectObj.mainController.setting.cols[info.col];
|
|
let fieldName = projectObj.mainController.setting.cols[info.col].data.field;
|
|
let fieldName = projectObj.mainController.setting.cols[info.col].data.field;
|
|
@@ -701,8 +701,9 @@ var projectObj = {
|
|
that.mainController.bind(TREE_SHEET_CONTROLLER.eventName.beforeTreeSelectedChange, that.beforeMainTreeSelectedChange);
|
|
that.mainController.bind(TREE_SHEET_CONTROLLER.eventName.beforeTreeSelectedChange, that.beforeMainTreeSelectedChange);
|
|
that.mainController.bind(TREE_SHEET_CONTROLLER.eventName.treeSelectedChanged, that.treeSelectedChanged);
|
|
that.mainController.bind(TREE_SHEET_CONTROLLER.eventName.treeSelectedChanged, that.treeSelectedChanged);
|
|
if(!projectReadOnly){
|
|
if(!projectReadOnly){
|
|
- that.bindEnterKey(that.mainSpread, 'mainEnterKey', that.mainSpreadEnterKey);
|
|
|
|
|
|
+ sheetCommonObj.bindEnterKey(that.mainSpread, that.mainSpreadEnterKey);
|
|
}
|
|
}
|
|
|
|
+ sheetCommonObj.bindEscKey(that.mainSpread, that.mainSpreadEditStarting, that.mainSpreadEditEnded);
|
|
setTimeout(function () {
|
|
setTimeout(function () {
|
|
that.mainSpread.getActiveSheet().startEdit();//这两句需要挺多时间,而又需要在editend 事件前触发,而这些又不影响计算,所以这里用异步的方法
|
|
that.mainSpread.getActiveSheet().startEdit();//这两句需要挺多时间,而又需要在editend 事件前触发,而这些又不影响计算,所以这里用异步的方法
|
|
that.mainSpread.getActiveSheet().endEdit();
|
|
that.mainSpread.getActiveSheet().endEdit();
|
|
@@ -740,7 +741,6 @@ var projectObj = {
|
|
if(projectReadOnly){
|
|
if(projectReadOnly){
|
|
disableSpread(that.mainSpread);
|
|
disableSpread(that.mainSpread);
|
|
}
|
|
}
|
|
- console.log(decimalObj.decimal());
|
|
|
|
$.bootstrapLoading.end();
|
|
$.bootstrapLoading.end();
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
@@ -848,8 +848,6 @@ var projectObj = {
|
|
newCol = quantityCol;
|
|
newCol = quantityCol;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
}
|
|
}
|
|
//设置焦点
|
|
//设置焦点
|
|
sheet.setActiveCell(newRow, newCol);
|
|
sheet.setActiveCell(newRow, newCol);
|
|
@@ -859,40 +857,6 @@ var projectObj = {
|
|
me.mainSpreadEnterCell({type: 'EnterCell'}, {sheet: sheet, sheetName: sheet.name(), cancel: false, row: newRow, col: newCol});
|
|
me.mainSpreadEnterCell({type: 'EnterCell'}, {sheet: sheet, sheetName: sheet.name(), cancel: false, row: newRow, col: newCol});
|
|
|
|
|
|
},
|
|
},
|
|
- //注册自定义回车键事件
|
|
|
|
- bindEnterKey: function (workBook, registerName, operation) {
|
|
|
|
- let me = this;
|
|
|
|
- let sheet = workBook.getActiveSheet();
|
|
|
|
- workBook.commandManager().register(registerName, operation);
|
|
|
|
- /* workBook.commandManager().register(registerName, function(){
|
|
|
|
- operation();
|
|
|
|
- /!* let orgRow = sheet.getActiveRowIndex();
|
|
|
|
- let orgCol = sheet.getActiveColumnIndex();
|
|
|
|
- if(sheet.isEditing()){
|
|
|
|
- sheet.endEdit();
|
|
|
|
- }
|
|
|
|
- let code = sheet.getValue(orgRow, 0);
|
|
|
|
- let newRow, newCol;
|
|
|
|
- if(!me.currentCache[orgRow] && code !== undefined && code !== null && orgCol !== me.setting.header.length - 1){
|
|
|
|
- newRow = orgRow;
|
|
|
|
- newCol = orgCol + 1;
|
|
|
|
- sheet.setActiveCell(newRow, newCol);
|
|
|
|
- }
|
|
|
|
- else{
|
|
|
|
- newRow = orgRow + 1;
|
|
|
|
- newCol = me.currentCache[orgRow + 1] ? orgCol : 0;
|
|
|
|
- sheet.setActiveCell(newRow, newCol);
|
|
|
|
- }*!/
|
|
|
|
- //触发事件
|
|
|
|
- /!*me.onLeaveCell({type: 'LeaveCell'}, {sheet: sheet, sheetName: sheet.name(), cancel: false, row: orgRow, col: orgCol});
|
|
|
|
- me.onEnterCell({type: 'EnterCell'}, {sheet: sheet, sheetName: sheet.name(), cancel: false, row: newRow, col: newCol});
|
|
|
|
- let newSels = [{row: newRow, rowCount: 1, col: newCol, colCount: 1}];
|
|
|
|
- let oldSels = [{row: orgRow, rowCount: 1, col: orgRow, colCount: 1}];
|
|
|
|
- me.onSelectionChanged({type: 'SelectionChanged'}, {sheet: sheet, sheetName: sheet.name(), newSelections: newSels, oldSelections: oldSels});*!/
|
|
|
|
- });*/
|
|
|
|
- workBook.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.enter, false, false, false, false);
|
|
|
|
- workBook.commandManager().setShortcutKey(registerName, GC.Spread.Commands.Key.enter, false, false, false, false);
|
|
|
|
- },
|
|
|
|
loadMainSpreadContextMenu: function () {
|
|
loadMainSpreadContextMenu: function () {
|
|
var project = this.project, spread = this.mainSpread, controller = this.mainController;
|
|
var project = this.project, spread = this.mainSpread, controller = this.mainController;
|
|
$.contextMenu({
|
|
$.contextMenu({
|
|
@@ -2254,12 +2218,10 @@ $('#customFile').change(function () {
|
|
if(file.files.length > 0){
|
|
if(file.files.length > 0){
|
|
$('.custom-file-label').text(`${file.files[0].name}`);
|
|
$('.custom-file-label').text(`${file.files[0].name}`);
|
|
$('#uploadAlert').hide();
|
|
$('#uploadAlert').hide();
|
|
- console.log(file.files);
|
|
|
|
//读取各个表及表名
|
|
//读取各个表及表名
|
|
$.bootstrapLoading.start();
|
|
$.bootstrapLoading.start();
|
|
let fileReader = new FileReader();
|
|
let fileReader = new FileReader();
|
|
fileReader.onload = function(ev) {
|
|
fileReader.onload = function(ev) {
|
|
- console.log('enter');
|
|
|
|
try {
|
|
try {
|
|
let data = ev.target.result;
|
|
let data = ev.target.result;
|
|
// 以二进制流方式读取得到整份excel表格对象
|
|
// 以二进制流方式读取得到整份excel表格对象
|
|
@@ -2312,6 +2274,7 @@ $('#uploadConfirm').click(function () {
|
|
//要去匹配的清单库(第一个)
|
|
//要去匹配的清单库(第一个)
|
|
let matchBillLibId = projectInfoObj.projectInfo.engineeringInfo.bill_lib.length > 0 ? projectInfoObj.projectInfo.engineeringInfo.bill_lib[0].id : null;
|
|
let matchBillLibId = projectInfoObj.projectInfo.engineeringInfo.bill_lib.length > 0 ? projectInfoObj.projectInfo.engineeringInfo.bill_lib[0].id : null;
|
|
formData.append('billsLibId', matchBillLibId);
|
|
formData.append('billsLibId', matchBillLibId);
|
|
|
|
+ let uploadS = +new Date();
|
|
$.ajax({
|
|
$.ajax({
|
|
url: '/bills/upload',
|
|
url: '/bills/upload',
|
|
type: 'POST',
|
|
type: 'POST',
|
|
@@ -2328,6 +2291,8 @@ $('#uploadConfirm').click(function () {
|
|
if (message !== '') {
|
|
if (message !== '') {
|
|
alert(message);
|
|
alert(message);
|
|
}
|
|
}
|
|
|
|
+ let uploadE = +new Date();
|
|
|
|
+ console.log(`导入时间:${uploadE-uploadS}`);
|
|
// 成功则关闭窗体
|
|
// 成功则关闭窗体
|
|
$('#import').modal("hide");
|
|
$('#import').modal("hide");
|
|
//更新前端
|
|
//更新前端
|