|
|
@@ -42,6 +42,29 @@ let locateObject={
|
|
|
}
|
|
|
},
|
|
|
datas:[],
|
|
|
+ bookMarkSetting:{
|
|
|
+ header:[
|
|
|
+ {headerName: "编码", headerWidth: 120, dataCode: "code", dataType: "String"},
|
|
|
+ {headerName: "书签名称", headerWidth: 200, dataCode: "name", dataType: "String"},
|
|
|
+ ],
|
|
|
+ view: {
|
|
|
+ lockColumns: [0,1],
|
|
|
+ colHeaderHeight:30
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //为了兼容旧项目,这里给个默认值
|
|
|
+ bookmarkPropertySetting:{
|
|
|
+ settingList :[
|
|
|
+ {background:"E2F2C5",describe:""},
|
|
|
+ {background:"F9E2CF",describe:""},
|
|
|
+ {background:"F2EFD9",describe:"hehe"},
|
|
|
+ {background:"F5D1DA",describe:""},
|
|
|
+ {background:"E3E3E3",describe:""},
|
|
|
+ {background:"B6F3F2",describe:""},
|
|
|
+ {background:"ECE0F5",describe:""}
|
|
|
+ ],
|
|
|
+ selected:"E2F2C5"
|
|
|
+ },
|
|
|
initMainSpread:function(){
|
|
|
if(!this.mainSpread){
|
|
|
this.mainSpread = SheetDataHelper.createNewSpread($("#locate_result")[0],3);
|
|
|
@@ -74,26 +97,54 @@ let locateObject={
|
|
|
this.subSpread.refresh();
|
|
|
}
|
|
|
},
|
|
|
- refreshWorkBook: function () {
|
|
|
- if (this.mainSpread) {
|
|
|
- this.mainSpread.refresh();
|
|
|
- }
|
|
|
- if (this.subSpread) {
|
|
|
- this.subSpread.refresh();
|
|
|
+ initBookmarkSpread:function(){
|
|
|
+ if(!this.bookmarkSpread){
|
|
|
+ this.bookmarkSpread = SheetDataHelper.createNewSpread($("#bookmarkSpread")[0]);
|
|
|
+ sheetCommonObj.spreadDefaultStyle(this.bookmarkSpread);
|
|
|
+ this.initBookmarkSheet();
|
|
|
+ // this.subSpread.bind(GC.Spread.Sheets.Events.CellDoubleClick,this.onSheetDoubleClick);
|
|
|
+ }else {
|
|
|
+ this.bookmarkSpread.refresh();
|
|
|
}
|
|
|
},
|
|
|
+ refreshWorkBook: function () {
|
|
|
+ if (this.mainSpread) this.mainSpread.refresh();
|
|
|
+ if (this.subSpread) this.subSpread.refresh();
|
|
|
+ if (this.bookmarkSpread) this.bookmarkSpread.refresh();
|
|
|
+
|
|
|
+ },
|
|
|
initSubSheet:function () {
|
|
|
this.subSheet = this.subSpread .getSheet(0);
|
|
|
sheetCommonObj.initSheet( this.subSheet, this.ration_setting);
|
|
|
this.subSheet.setRowCount(0);
|
|
|
this.subSheet.name('locate_sub');
|
|
|
},
|
|
|
+ initBookmarkSheet:function () {
|
|
|
+ this.bookmarkSheet = this.bookmarkSpread .getSheet(0);
|
|
|
+ sheetCommonObj.initSheet( this.bookmarkSheet, this.bookMarkSetting);
|
|
|
+ this.bookmarkSheet.setRowCount(0);
|
|
|
+ this.bookmarkSheet.name('bookmark');
|
|
|
+ },
|
|
|
initOutstanding:function () {
|
|
|
if(!projectObj.project.property.locateSetting) return;
|
|
|
let outstd = projectObj.project.property.locateSetting;
|
|
|
$("#outstanding").prop("checked",outstd.outstanding);
|
|
|
$("#outInp").val(parseFloat(outstd.outInp));
|
|
|
},
|
|
|
+ initBookmarkSetting:function () {
|
|
|
+ $("#bookmarkSettingList").empty();
|
|
|
+ let setting = projectObj.project.property.bookmarkSetting?projectObj.project.property.bookmarkSetting:this.bookmarkPropertySetting;
|
|
|
+ for(let s of setting.settingList){
|
|
|
+ let b = `<div class="input-group input-group-sm mb-2" style="width:200px">
|
|
|
+ <div class="input-group-prepend">
|
|
|
+ <span class="input-group-text " style="background: #${s.background}"> </span>
|
|
|
+ </div>
|
|
|
+ <input type="text" class="form-control" id="${s.background}" placeholder="描述" value="${s.describe}">
|
|
|
+ </div>`;
|
|
|
+ $("#bookmarkSettingList").append(b);
|
|
|
+ $("#"+s.background).bind('focus', bookmarkSelected);
|
|
|
+ }
|
|
|
+ },
|
|
|
showMainData:function (datas,setting) {
|
|
|
sheetCommonObj.showData(this.mainSpread.getActiveSheet(),setting,datas);
|
|
|
this.mainSpread.getActiveSheet().setRowCount(datas.length);
|
|
|
@@ -123,16 +174,26 @@ let locateObject={
|
|
|
let me = this;
|
|
|
let mainHeight = $(window).height()-$(".header").height()-$(".toolsbar").height()-$("#searchPanel").height();
|
|
|
let subHeight = 0;
|
|
|
- $('#locateTopDiv').height(mainHeight);
|
|
|
- $('#locate_result').height(mainHeight);
|
|
|
- $('#locateBottomDiv').height(subHeight);
|
|
|
- $('#locate_sub').height(subHeight - 7);
|
|
|
- if(options == "ration_glj"){
|
|
|
- let locateLibResize = getLocateLibResize();
|
|
|
- SlideResize.loadVerticalHeight(locateLibResize.eleObj.module, locateLibResize.eleObj, locateLibResize.limit, function () {
|
|
|
+ if(options == "bookmark"){
|
|
|
+ let bookMarkLibResize = getBookmarkResize();
|
|
|
+ loadHeight(bookMarkLibResize);
|
|
|
+ }else {
|
|
|
+ $('#locateTopDiv').height(mainHeight);
|
|
|
+ $('#locate_result').height(mainHeight);
|
|
|
+ $('#locateBottomDiv').height(subHeight);
|
|
|
+ $('#locate_sub').height(subHeight - 7);
|
|
|
+ if(options == "ration_glj"){
|
|
|
+ let locateLibResize = getLocateLibResize();
|
|
|
+ loadHeight(locateLibResize);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function loadHeight(libResize) {
|
|
|
+ SlideResize.loadVerticalHeight(libResize.eleObj.module, libResize.eleObj, libResize.limit, function () {
|
|
|
locateObject.refreshWorkBook();
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
if (refreshWorkBook) {
|
|
|
me.refreshWorkBook();
|
|
|
}
|
|
|
@@ -144,10 +205,20 @@ let locateObject={
|
|
|
me.refreshView(options, false);
|
|
|
me.initMainSpread();
|
|
|
me.initSubSpread();
|
|
|
+ me.initBookmarkSpread();
|
|
|
};
|
|
|
- if(options == "bills") me.initOutstanding();
|
|
|
- options == "bills"?$("#outstandingOptions").show(0,callback):$("#outstandingOptions").hide(0,callback);
|
|
|
-
|
|
|
+ if(options == 'bookmark'){
|
|
|
+ $("#aboutLocateDiv").hide();
|
|
|
+ $("#outstandingOptions").hide();
|
|
|
+ me.initBookmarkSetting();
|
|
|
+ $("#aboutBookmarkDiv").show(0,callback);
|
|
|
+ }else {
|
|
|
+ $("#aboutBookmarkDiv").hide();
|
|
|
+ $("#aboutLocateDiv").show(0,function () {
|
|
|
+ if(options == "bills") me.initOutstanding();
|
|
|
+ options == "bills"?$("#outstandingOptions").show(0,callback):$("#outstandingOptions").hide(0,callback);
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
findRecodes:function () {
|
|
|
let options = $("input[name='content_type']:checked").val();
|
|
|
@@ -367,3 +438,13 @@ $('#outstanding').change(function(){
|
|
|
let outStd = $("#outstanding").prop("checked");
|
|
|
me.updateOutStanding(outStd,scMathUtil.roundForObj(outInp,getDecimal('process')));
|
|
|
});
|
|
|
+
|
|
|
+$('#bookmarkSettingDropdown').on('shown.bs.dropdown', function showDropdown() {
|
|
|
+ let setting = projectObj.project.property.bookmarkSetting?projectObj.project.property.bookmarkSetting:locateObject.bookmarkPropertySetting;
|
|
|
+ $("#"+setting.selected).focus();
|
|
|
+});
|
|
|
+
|
|
|
+function bookmarkSelected() {
|
|
|
+ console.log("hehe");
|
|
|
+ $("#bookmarkSelected").val($(this)[0].id);
|
|
|
+}
|