|
@@ -741,14 +741,23 @@ let pageCCOprObj = {
|
|
|
};
|
|
|
CommonAjax.post(url, postData, function (rstData) {
|
|
|
//更新节点数据
|
|
|
- let selectedNode = projectObj.mainController.tree.selected;
|
|
|
- selectedNode.data[updateObj.field] = updateObj.updateArr;
|
|
|
- selectedNode.data[txtObj.field] = txtObj.text;
|
|
|
- me.showData(oprObj.workBook.getSheet(0), oprObj.setting, oprObj.currentCache);//刷新特征及内容Spread
|
|
|
if(updateCol){
|
|
|
- let activeCell = projectObj.mainSpread.getActiveSheet().getSelections()[0];
|
|
|
- projectObj.mainSpread.getActiveSheet().setValue(activeCell.row, updateCol, txtObj.text + ''); //刷新输出显示
|
|
|
- projectObj.mainSpread.getActiveSheet().autoFitRow(activeCell.row);
|
|
|
+ if (!oprObj.hasOwnProperty("getID")) {
|
|
|
+ // 已当前选中行更新数据
|
|
|
+ let selectedNode = projectObj.mainController.tree.selected;
|
|
|
+ selectedNode.data[updateObj.field] = updateObj.updateArr;
|
|
|
+ selectedNode.data[txtObj.field] = txtObj.text;
|
|
|
+ me.showData(oprObj.workBook.getSheet(0), oprObj.setting, oprObj.currentCache);//刷新特征及内容Spread
|
|
|
+
|
|
|
+ let activeCell = projectObj.mainSpread.getActiveSheet().getSelections()[0];
|
|
|
+ projectObj.mainSpread.getActiveSheet().setValue(activeCell.row, updateCol, txtObj.text + ''); //刷新输出显示
|
|
|
+ projectObj.mainSpread.getActiveSheet().autoFitRow(activeCell.row);
|
|
|
+ } else {
|
|
|
+ // 以节点更新数据
|
|
|
+ const row = oprObj.getID() - 1;
|
|
|
+ projectObj.mainSpread.getActiveSheet().setValue(row, updateCol, txtObj.text + ''); //刷新输出显示
|
|
|
+ projectObj.mainSpread.getActiveSheet().autoFitRow(row);
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -769,6 +778,8 @@ let pageCCOprObj = {
|
|
|
if (itemCharacter === undefined || itemCharacter.length <= 0 || itemJob === undefined || itemJob.length <= 0) {
|
|
|
return;
|
|
|
}
|
|
|
+ // 保存的条件数据
|
|
|
+ const findSet = { ID: node.data.ID, projectID: node.data.projectID };
|
|
|
|
|
|
let characterArray = [];
|
|
|
for (const tmp of itemCharacter) {
|
|
@@ -809,6 +820,7 @@ let pageCCOprObj = {
|
|
|
|
|
|
// 组合数据
|
|
|
let content = '';
|
|
|
+ let defaultContentInfo = {};
|
|
|
switch (setting.addContent) {
|
|
|
case "1":
|
|
|
// 项目特征+工作内容
|
|
@@ -837,6 +849,19 @@ let pageCCOprObj = {
|
|
|
const rationChapter = this.getRationChapter(node, setting);
|
|
|
contentArray.push.apply(contentArray, rationChapter);
|
|
|
break;
|
|
|
+ case "":
|
|
|
+ // 无
|
|
|
+ const jobContent = jobArray.join("\r\n");
|
|
|
+ const characterContent = characterArray.join("\r\n");
|
|
|
+ let nodeNameList = node.data.name.split("\n");
|
|
|
+ const nameContent = nodeNameList[0] !== undefined ? nodeNameList[0] : '';
|
|
|
+ // 存入对象,生成数据时用
|
|
|
+ defaultContentInfo = {
|
|
|
+ jobContent,
|
|
|
+ characterContent,
|
|
|
+ nameContent
|
|
|
+ };
|
|
|
+ break;
|
|
|
}
|
|
|
// 显示格式
|
|
|
switch (setting.displayFormat) {
|
|
@@ -857,27 +882,44 @@ let pageCCOprObj = {
|
|
|
let saveObj = {};
|
|
|
switch (setting.position) {
|
|
|
case "1":
|
|
|
- // 添加到项目特征列
|
|
|
saveObj = {field: 'itemCharacterText', text: content};
|
|
|
// 更新到数据库
|
|
|
- pageCCOprObj.updateCharacterContent(pageCCOprObj.currentFindSet,
|
|
|
- {field: 'itemCharacter', updateArr: itemCharacter}, saveObj, characterOprObj);
|
|
|
+ pageCCOprObj.updateCharacterContent(findSet, {field: 'itemCharacter', updateArr: itemCharacter},
|
|
|
+ saveObj, node);
|
|
|
break;
|
|
|
case "2":
|
|
|
// 添加到清单名称列
|
|
|
const column = this.mainActiveCell.col !== undefined ? this.mainActiveCell.col : -1;
|
|
|
let colSetting = projectObj.mainController.setting.cols[column];
|
|
|
if (colSetting !== undefined) {
|
|
|
+ content = node.data.name + "\r\n" + content;
|
|
|
projectObj.project.Bills.updateField(node.source, 'name', content, true);
|
|
|
- projectObj.mainController.refreshTreeNode([node]);
|
|
|
+ projectObj.mainController.refreshTreeNode([node], false);
|
|
|
}
|
|
|
break;
|
|
|
case "3":
|
|
|
// 添加到工作内容列
|
|
|
saveObj = {field: 'jobContentText', text: content};
|
|
|
// 更新到数据库
|
|
|
- pageCCOprObj.updateCharacterContent(pageCCOprObj.currentFindSet,
|
|
|
- {field: 'jobContent', updateArr: itemJob}, saveObj, contentOprObj);
|
|
|
+ pageCCOprObj.updateCharacterContent(findSet, {field: 'jobContent', updateArr: itemJob},
|
|
|
+ saveObj, node);
|
|
|
+ break;
|
|
|
+ case "4":
|
|
|
+ // 分别添加到对应列
|
|
|
+ if (Object.keys(defaultContentInfo).length <= 0) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ // 名称
|
|
|
+ projectObj.project.Bills.updateField(node.source, 'name', defaultContentInfo.nameContent, true);
|
|
|
+ projectObj.mainController.refreshTreeNode([node], false);
|
|
|
+ // 特征
|
|
|
+ saveObj = {field: 'itemCharacterText', text: defaultContentInfo.characterContent};
|
|
|
+ pageCCOprObj.updateCharacterContent(findSet, {field: 'itemCharacter', updateArr: itemCharacter},
|
|
|
+ saveObj, node);
|
|
|
+ // 内容
|
|
|
+ saveObj = {field: 'jobContentText', text: defaultContentInfo.jobContent};
|
|
|
+ pageCCOprObj.updateCharacterContent(findSet, {field: 'jobContent', updateArr: itemJob},
|
|
|
+ saveObj, node);
|
|
|
break;
|
|
|
}
|
|
|
|