|
@@ -67,6 +67,11 @@ let locateObject={
|
|
|
],
|
|
],
|
|
|
selected:"E2F2C5"
|
|
selected:"E2F2C5"
|
|
|
},
|
|
},
|
|
|
|
|
+ getDescribeByColor: function (color) {
|
|
|
|
|
+ const setting = projectObj.project.property.bookmarkSetting ? projectObj.project.property.bookmarkSetting : locateObject.bookmarkPropertySetting;
|
|
|
|
|
+ const item = setting.settingList.find(item => item.background === color);
|
|
|
|
|
+ return item && item.describe ? item.describe : '描述';
|
|
|
|
|
+ },
|
|
|
initMainSpread:function(){
|
|
initMainSpread:function(){
|
|
|
if(!this.mainSpread){
|
|
if(!this.mainSpread){
|
|
|
this.mainSpread = SheetDataHelper.createNewSpread($("#locate_result")[0],3);
|
|
this.mainSpread = SheetDataHelper.createNewSpread($("#locate_result")[0],3);
|
|
@@ -174,10 +179,11 @@ let locateObject={
|
|
|
focus = true;
|
|
focus = true;
|
|
|
}
|
|
}
|
|
|
sel.row = selectedID?_.findIndex(this.bookmarkDatas,{'ID':selectedID}):0;
|
|
sel.row = selectedID?_.findIndex(this.bookmarkDatas,{'ID':selectedID}):0;
|
|
|
- sheet.setSelection(sel.row==-1?0:sel.row,sel.col,sel.rowCount,sel.colCount);
|
|
|
|
|
|
|
+ const locatedRow = sel.row === -1 ? 0 : sel.row;
|
|
|
|
|
+ sheet.setSelection(locatedRow,sel.col,sel.rowCount,sel.colCount);
|
|
|
sheet.setRowCount(this.bookmarkDatas.length);
|
|
sheet.setRowCount(this.bookmarkDatas.length);
|
|
|
- if(sel.row!=-1) sheet.showRow(sel.row, GC.Spread.Sheets.VerticalPosition.bottom);
|
|
|
|
|
- this.showAnnotation(sel.row,focus);
|
|
|
|
|
|
|
+ sheet.showRow(locatedRow, GC.Spread.Sheets.VerticalPosition.bottom)
|
|
|
|
|
+ this.showAnnotation(locatedRow,focus);
|
|
|
},
|
|
},
|
|
|
getBookmarkDatas:function(){
|
|
getBookmarkDatas:function(){
|
|
|
let datas = [];
|
|
let datas = [];
|
|
@@ -435,6 +441,8 @@ let locateObject={
|
|
|
$("#bookmarkNodeID").val(recode.ID);
|
|
$("#bookmarkNodeID").val(recode.ID);
|
|
|
$("#bookmarkNodeType").val(recode.type);
|
|
$("#bookmarkNodeType").val(recode.type);
|
|
|
if(focus) $("#annotationTextarea").focus();
|
|
if(focus) $("#annotationTextarea").focus();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $('#annotationTextarea').val('');
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
locateNode:function (ID) {
|
|
locateNode:function (ID) {
|
|
@@ -462,13 +470,13 @@ let locateObject={
|
|
|
setting.selected = $("#bookmarkSelected").val();
|
|
setting.selected = $("#bookmarkSelected").val();
|
|
|
this.updateProjectProperty("bookmarkSetting",setting);
|
|
this.updateProjectProperty("bookmarkSetting",setting);
|
|
|
},
|
|
},
|
|
|
- setOrCancelBookmark:function(node){
|
|
|
|
|
|
|
+ // background为null则为取消书签批注
|
|
|
|
|
+ setOrCancelBookmark:function(node, background){
|
|
|
$("#bookmark").prop("checked", true);
|
|
$("#bookmark").prop("checked", true);
|
|
|
- let setting = projectObj.project.property.bookmarkSetting?projectObj.project.property.bookmarkSetting:locateObject.bookmarkPropertySetting;
|
|
|
|
|
- let background = null;
|
|
|
|
|
- if(_.isEmpty(node.data.bookmarkBackground)) background = setting.selected;
|
|
|
|
|
- let updateData = {type:node.sourceType,data:{'ID' : node.data.ID,bookmarkBackground:background}};
|
|
|
|
|
- if(background == null) updateData.data.bookmarkAnnotation = null;
|
|
|
|
|
|
|
+ const updateData = {type: node.sourceType, data: {ID: node.data.ID, bookmarkBackground: background}};
|
|
|
|
|
+ if(!background) {
|
|
|
|
|
+ updateData.data.bookmarkAnnotation = null;
|
|
|
|
|
+ }
|
|
|
$.bootstrapLoading.start();
|
|
$.bootstrapLoading.start();
|
|
|
projectObj.project.updateNodes([updateData],function () {
|
|
projectObj.project.updateNodes([updateData],function () {
|
|
|
$.bootstrapLoading.end();
|
|
$.bootstrapLoading.end();
|