|
@@ -972,7 +972,7 @@ $(document).ready(() => {
|
|
loadExprToInput(sheet) {
|
|
loadExprToInput(sheet) {
|
|
const sel = sheet.getSelections()[0];
|
|
const sel = sheet.getSelections()[0];
|
|
const col = sheet.zh_setting.cols[sel.col], cell = sheet.getCell(sel.row, sel.col);
|
|
const col = sheet.zh_setting.cols[sel.col], cell = sheet.getCell(sel.row, sel.col);
|
|
- if (col.type === 'Number') {
|
|
|
|
|
|
+ if (col && col.type === 'Number') {
|
|
const data = SpreadJsObj.getSelectObject(sheet);
|
|
const data = SpreadJsObj.getSelectObject(sheet);
|
|
if (data) {
|
|
if (data) {
|
|
$('#pos-expr').val(data[col.field]).attr('field', col.field).attr('org', data[col.field])
|
|
$('#pos-expr').val(data[col.field]).attr('field', col.field).attr('org', data[col.field])
|
|
@@ -1293,6 +1293,23 @@ $(document).ready(() => {
|
|
},
|
|
},
|
|
selectionChanged: function (e, info) {
|
|
selectionChanged: function (e, info) {
|
|
stagePosSpreadObj.loadExprToInput(info.sheet);
|
|
stagePosSpreadObj.loadExprToInput(info.sheet);
|
|
|
|
+ },
|
|
|
|
+ addPegs: function (pegs) {
|
|
|
|
+ if (!pegs || pegs.length <= 0) return;
|
|
|
|
+ const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
|
+ if (!node) return;
|
|
|
|
+
|
|
|
|
+ const sheet = spSpread.getActiveSheet();
|
|
|
|
+ const sortData = sheet.zh_data || [];
|
|
|
|
+ let order = sortData.length > 0 ? sortData[sortData.length - 1].porder + 1 : 1;
|
|
|
|
+ pegs.forEach(function (p) {p.porder = ++order; p.lid = node.id});
|
|
|
|
+
|
|
|
|
+ postData(window.location.pathname + '/update', {pos: {updateType: 'add', updateData: pegs} }, function (result) {
|
|
|
|
+ if (result.pos) {
|
|
|
|
+ stagePos.updateDatas(result.pos.pos);
|
|
|
|
+ }
|
|
|
|
+ stagePosSpreadObj.loadCurPosData();
|
|
|
|
+ });
|
|
}
|
|
}
|
|
};
|
|
};
|
|
// 加载上下窗口resizer
|
|
// 加载上下窗口resizer
|
|
@@ -1367,6 +1384,7 @@ $(document).ready(() => {
|
|
});
|
|
});
|
|
}
|
|
}
|
|
if (!checkTzMeasureType()) {
|
|
if (!checkTzMeasureType()) {
|
|
|
|
+ const mergePeg = NewMergePeg({ callback: stagePosSpreadObj.addPegs});
|
|
$.contextMenu({
|
|
$.contextMenu({
|
|
selector: '#stage-pos',
|
|
selector: '#stage-pos',
|
|
build: function ($trigger, e) {
|
|
build: function ($trigger, e) {
|
|
@@ -1406,17 +1424,21 @@ $(document).ready(() => {
|
|
callback: function (key, opt) {
|
|
callback: function (key, opt) {
|
|
stagePosSpreadObj.deletePos(spSpread.getActiveSheet());
|
|
stagePosSpreadObj.deletePos(spSpread.getActiveSheet());
|
|
}
|
|
}
|
|
|
|
+ },
|
|
|
|
+ 'merge-peg': {
|
|
|
|
+ name: '合并起讫桩号',
|
|
|
|
+ disabled: function (key, opt) {
|
|
|
|
+ const node = SpreadJsObj.getSelectObject(slSpread.getActiveSheet());
|
|
|
|
+ return _.isNil(node) || _.isNil(node.b_code) || node.b_code === '';
|
|
|
|
+ },
|
|
|
|
+ callback: function (key, opt) {
|
|
|
|
+ mergePeg.show();
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
- $.contextMenu({
|
|
|
|
- selector: '#stage-pos',
|
|
|
|
- build: function ($trigger, e) {
|
|
|
|
- const target = SpreadJsObj.safeRightClickSelection($trigger, e, spSpread);
|
|
|
|
- return target.hitTestType === spreadNS.SheetArea.viewport || target.hitTestType === spreadNS.SheetArea.rowHeader;
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
|
|
+ SpreadJsObj.forbiddenSpreadContextMenu('#stage-pos', spSpread);
|
|
}
|
|
}
|
|
$.subMenu({
|
|
$.subMenu({
|
|
menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
|
|
menu: '#sub-menu', miniMenu: '#sub-mini-menu', miniMenuList: '#mini-menu-list',
|