|
|
@@ -11,7 +11,7 @@ const billsGuidance = (function () {
|
|
|
function _isDef(v) {
|
|
|
return typeof v !== 'undefined' && v !== null;
|
|
|
}
|
|
|
-
|
|
|
+ let moduleName = 'stdBillsGuidance';
|
|
|
//自执行函数全局变量定义
|
|
|
const libID = getQueryString('libID');
|
|
|
//总工作内容数据
|
|
|
@@ -889,7 +889,7 @@ const billsGuidance = (function () {
|
|
|
let syncDatas = [];
|
|
|
for(let cell of cells){
|
|
|
let text = sheet.getValue(cell.row, cell.col);
|
|
|
- text = text ? text : '';
|
|
|
+ text = text ? text.toString() : '';
|
|
|
text = text.replace(deESC, '');
|
|
|
sheet.setValue(cell.row, cell.col, text);
|
|
|
let node = bills.tree.selected.guidance.tree.items[cell.row];
|
|
|
@@ -973,22 +973,42 @@ const billsGuidance = (function () {
|
|
|
function del(){
|
|
|
$.bootstrapLoading.start();
|
|
|
let controller = bills.tree.selected.guidance.controller;
|
|
|
- let selected = bills.tree.selected.guidance.tree.selected;
|
|
|
+ let selNodes = [];
|
|
|
+ let sheet = guideItem.workBook.getSheet(0);
|
|
|
+ let sel = sheet.getSelections()[0];
|
|
|
+ if(sel){
|
|
|
+ sel.row = sel.row === -1 ? 0 : sel.row;
|
|
|
+ for(let i = 0; i < sel.rowCount; i++){
|
|
|
+ if(bills.tree.selected.guidance.tree.items[sel.row + i]){
|
|
|
+ selNodes.push(bills.tree.selected.guidance.tree.items[sel.row + i]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //选中的块节点
|
|
|
+ let blockNodes = getBlockNodes(selNodes);
|
|
|
let updateDatas = [];
|
|
|
- function getDelDatas(node){
|
|
|
- updateDatas.push({updateType: updateType.del, findData: {ID: node.getID()}, updateData: {deleted: true}});
|
|
|
- if(node.children.length > 0){
|
|
|
- for(let c of node.children){
|
|
|
- getDelDatas(c);
|
|
|
+ function getDelDatas(nodes){
|
|
|
+ for (let node of nodes) {
|
|
|
+ updateDatas.push({updateType: updateType.del, findData: {ID: node.getID()}});
|
|
|
+ if (node.children.length > 0) {
|
|
|
+ getDelDatas(node.children);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- getDelDatas(selected);
|
|
|
- if(selected.preSibling) {
|
|
|
- updateDatas.push({updateType: updateType.update, findData: {ID: selected.preSibling.getID()}, updateData: {NextSiblingID: selected.getNextSiblingID()}});
|
|
|
+ getDelDatas(blockNodes);
|
|
|
+ //更新相关的前节点
|
|
|
+ for (let node of blockNodes) {
|
|
|
+ if (node.preSibling && !blockNodes.includes(node.preSibling)) {
|
|
|
+ let next = node;
|
|
|
+ while (next.nextSibling && blockNodes.includes(next.nextSibling)) {
|
|
|
+ next = next.nextSibling;
|
|
|
+ }
|
|
|
+ updateDatas.push({updateType: updateType.update, findData: {ID: node.preSibling.getID()}, updateData: {NextSiblingID: next.getNextSiblingID()}});
|
|
|
+ }
|
|
|
}
|
|
|
updateGuideItems(updateDatas, function () {
|
|
|
- controller.delete();
|
|
|
+ controller.m_delete(blockNodes);
|
|
|
+ guideItemInitSel(sheet.getActiveRowIndex());
|
|
|
refreshBtn(bills.tree.selected.guidance.tree.selected);
|
|
|
setNodesColor(guideItem.workBook.getActiveSheet(), bills.tree.selected.guidance.tree.items);
|
|
|
$.bootstrapLoading.end();
|
|
|
@@ -1292,8 +1312,6 @@ const billsGuidance = (function () {
|
|
|
delete data._id;
|
|
|
updateDatas.push({updateType: updateType.create, updateData: data});
|
|
|
}
|
|
|
- console.log(`node`);
|
|
|
- console.log(node);
|
|
|
console.log(`pasteDatas`);
|
|
|
console.log(pasteDatas);
|
|
|
//更新粘贴到的节点的NextSiblingID
|
|
|
@@ -1739,6 +1757,45 @@ const billsGuidance = (function () {
|
|
|
ration.workBook.refresh();
|
|
|
}
|
|
|
});
|
|
|
+ //左右拖动
|
|
|
+ //清单表与项目指引表
|
|
|
+ let leftElesObj = {};
|
|
|
+ leftElesObj.resize = $('#slideResizeLeft');
|
|
|
+ leftElesObj.parent = $('#dataRow');
|
|
|
+ leftElesObj.left = $('#leftContent');
|
|
|
+ leftElesObj.right = $('#midContent');
|
|
|
+ horizontalSlide(moduleName, leftElesObj, {min: 200, max: `$('#dataRow').width() - $('#rightContent').width() - 200`}, function () {
|
|
|
+ refreshALlWorkBook();
|
|
|
+ });
|
|
|
+ //人材机表与人材机组成物表
|
|
|
+ let rightElesObj = {};
|
|
|
+ rightElesObj.resize = $('#slideResizeRight');
|
|
|
+ rightElesObj.parent = $('#dataRow');
|
|
|
+ rightElesObj.left = $('#midContent');
|
|
|
+ rightElesObj.right = $('#rightContent');
|
|
|
+ horizontalSlide(moduleName, rightElesObj, {min: 200, max: `$('#dataRow').width() - $('#leftContent').width() - 200`}, function () {
|
|
|
+ refreshALlWorkBook();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //刷新全部工作簿
|
|
|
+ //@return {void}
|
|
|
+ function refreshALlWorkBook() {
|
|
|
+ if (bills.workBook) {
|
|
|
+ bills.workBook.refresh();
|
|
|
+ }
|
|
|
+ if (guideItem.workBook) {
|
|
|
+ guideItem.workBook.refresh();
|
|
|
+ }
|
|
|
+ if (section.workBook) {
|
|
|
+ section.workBook.refresh();
|
|
|
+ }
|
|
|
+ if (ration.workBook) {
|
|
|
+ ration.workBook.refresh();
|
|
|
+ }
|
|
|
+ $('.main-side-bottom').find('textarea').height($('.main-side-bottom').height() - 20);
|
|
|
+ $('.main-side-bottom').find('textarea').width($('.main-side-bottom').width() - 25);
|
|
|
+ $('.main-bottom-content').find('textarea').height($('.main-bottom-content').height() - 20);
|
|
|
+ $('.main-bottom-content').find('textarea').width($('.main-bottom-content').width() - 25);
|
|
|
}
|
|
|
//初始化视图
|
|
|
//@param {void} @return {void}
|
|
|
@@ -1756,6 +1813,9 @@ const billsGuidance = (function () {
|
|
|
ration.workBook.refresh();
|
|
|
}
|
|
|
});
|
|
|
+ loadHorizonWidth(moduleName, [$('#leftContent'), $('#midContent'), $('#rightContent')], function () {
|
|
|
+ refreshALlWorkBook();
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1764,7 +1824,4 @@ const billsGuidance = (function () {
|
|
|
|
|
|
$(document).ready(function () {
|
|
|
billsGuidance.initViews();
|
|
|
- CommonAjax.post('/billsGuidance/api/testItems', {libID: getQueryString('libID')}, function (rstData) {
|
|
|
- console.log(rstData);
|
|
|
- });
|
|
|
});
|