Index: arms/js/reqAdd.js =================================================================== diff -u -r8587e75bd2e69ae8928a3b3b5ca8981f7840d3c8 -re4d6fa28f794a3d6e0610bc30100be541ab99866 --- arms/js/reqAdd.js (.../reqAdd.js) (revision 8587e75bd2e69ae8928a3b3b5ca8981f7840d3c8) +++ arms/js/reqAdd.js (.../reqAdd.js) (revision e4d6fa28f794a3d6e0610bc30100be541ab99866) @@ -1763,7 +1763,7 @@ } }); }, - onUpdate: function (id, params) { + onUpdate: function (id, params) { // 요구사항 제목 $.ajax({ url: `/auth-user/api/arms/reqAdd/T_ARMS_REQADD_${id}/updateNode.do`, type: "POST", @@ -1774,7 +1774,19 @@ } } }); - } + }, + onDBUpdate: function (id ,params) { // 상태, 우선순위, 난이도, 시작일, 종료일 + $.ajax({ + url: `/auth-user/api/arms/reqAdd/T_ARMS_REQADD_${id}/updateDataBase.do`, + type: "POST", + data: params, + statusCode: { + 200: function () { + jSuccess(" 요구사항이 변경되었습니다."); + } + } + }); + } }); } Index: arms/js/reqAddTable.js =================================================================== diff -u -r9afc3043896634a5921bcdab6f75f76b5c773a6e -re4d6fa28f794a3d6e0610bc30100be541ab99866 --- arms/js/reqAddTable.js (.../reqAddTable.js) (revision 9afc3043896634a5921bcdab6f75f76b5c773a6e) +++ arms/js/reqAddTable.js (.../reqAddTable.js) (revision e4d6fa28f794a3d6e0610bc30100be541ab99866) @@ -3,13 +3,13 @@ pivotTableData, tableOptions, TableInstance, - pivotType = "normal"; + pivotType = "normal", + editContents = {}; const ContentType = { normal: { version: "Version", category: "구분", - id: "TASK NO", - writer: "TASK OWNER", + writer: "요구사항 작성자", status: "Status", depth1: "Depth 1", depth2: "Depth 2", @@ -19,12 +19,11 @@ difficulty: "난이도", createDate: "생성일", startDate: "시작일", - endDate: "종료일", - progress: "진행률" + endDate: "종료일" }, version: { version: "Version", - writer: "TASK OWNER", + writer: "요구사항 작성자", depth1: "Depth 1", content: "요구사항 제목", open: "열림", @@ -34,7 +33,7 @@ statusTotal: "총계" }, owner: { - writer: "TASK OWNER", + writer: "요구사항 작성자", version: "Version", depth1: "Depth 1", content: "요구사항 제목", @@ -69,6 +68,13 @@ 닫힘: 13 }; +const ReqStatusEnglish = { + open: 10, + investigation: 11, + resolved: 12, + closeStatus: 13 +}; + const getReqWriterName = (writerId) =>{ let writer = writerId.match(/\[(.*?)\]/); return writer[1]; @@ -459,10 +465,7 @@ if (btn.classList.contains("active")) { this.insertElement(this.getElement(e.target, "TR"), rows); } else { - console.log("##### delete", data); - //this.removeElment(`[data-${data.root}="${data[`_${[data.root]}`]}"]`); this.removeElement(data); - } }); @@ -561,7 +564,7 @@ task[key] = value; tableOptions.onUpdate(tableOptions.id, { - c_id: task.id, + c_id: task.id, c_title: task.content, c_req_pdservice_versionset_link: task.origin.c_req_pdservice_versionset_link, c_req_priority_link: task._priority ?? null, // 5 - 중간 @@ -580,6 +583,20 @@ }); } + updatePivotData(reqId,editContents){ + if(editContents.statusId !== null) {// DB 까지만 변경이 필요한 경우 + tableOptions.onDBUpdate(tableOptions.id,{ + c_id: reqId, + c_req_state_link: editContents.statusId ?? null + }); + }else{ // ALM 까지 데이터 변경이 필요할 시 + tableOptions.onUpdate(tableOptions.id, { + c_id: reqId, + c_title: editContents.content ?? null + }); + } + } + addInput(node, updateKey, type = text) { const uuid = createUUID(); const text = node.textContent; @@ -659,27 +676,41 @@ const $content = this.getElement(e.target, "TD", "content"); const $progress = this.getElement(e.target, "TD", "progress"); const $endDate = this.getElement(e.target, "TD", "endDate"); - -// if ($writer) { -// this.addInput($writer, "writer"); + const tdElement = e.target.closest("td"); + const trElement = e.target.closest("tr"); + console.log($content); + if ($content) { + this.addInput($content, "content"); + return; + } +// if ($progress) { +// this.addInput($progress, "progress", "number"); // return; // } +// +// if ($endDate) { +// this.addInput($endDate, "endDate", "date"); +// return; +// } - if ($content) { - this.addInput($content, "content"); - return; - } + if (pivotType !== "normal"){ // 피벗 테이블의 경우 이름을 변경할 때 + if ($content) { + editContents.content = $content; + this.updatePivotData(trElement.dataset.id,editContents); + return; + } + }else{ + if ($content) { + this.addInput($content, "content"); + return; + } + } - if ($progress) { - this.addInput($progress, "progress", "number"); - return; - } + if (e.target.type === "radio") { + editContents.statusId =ReqStatusEnglish[tdElement.className]; + this.updatePivotData(trElement.dataset.id,editContents); + } - if ($endDate) { - this.addInput($endDate, "endDate", "date"); - return; - } - // select if (["A", "I"].includes(tagName)) { classList.contains("dropdown-toggle") && this.addSelect(e.target);