Index: arms/html/analysisResource/content-container.html =================================================================== diff -u -reeee2d87177a282933fd1ed32a2b566f4b665ab4 -r126fb276ada1d9ccefb28c45df952d00a787f98a --- arms/html/analysisResource/content-container.html (.../content-container.html) (revision eeee2d87177a282933fd1ed32a2b566f4b665ab4) +++ arms/html/analysisResource/content-container.html (.../content-container.html) (revision 126fb276ada1d9ccefb28c45df952d00a787f98a) @@ -152,10 +152,10 @@
-
총 작업자 수 : -
-
+
-->
투입 작업자 수 : -
@@ -348,11 +348,12 @@

- - - 세번째 박스 - + + + 담당자 별 업무 처리 현황 - YHS +

-
-
-
-
-
-

- - - 전체 어플리케이션 진행 현황 컬러표 - -

-
-
-
-
    -
    -
  • - - 전환전 -
  • -
  • - - 진행중 -
  • -
  • - - 전환완료 -
  • -
    -
    -
-
-
+
+ + - - -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SourceAmountChangeTarget
Direct713+53900
Refer562+84500
Social148-12180
Search653+23876
Internal976+101844
-
-
+
--> +
+
+ +
Index: arms/js/analysis/api/resourceApi.js =================================================================== diff -u --- arms/js/analysis/api/resourceApi.js (revision 0) +++ arms/js/analysis/api/resourceApi.js (revision 126fb276ada1d9ccefb28c45df952d00a787f98a) @@ -0,0 +1,105 @@ +var ResourceApi = (function () { + var selectedPdserviceId; + var selectedPdServiceversions = []; + + var fetchedResourceData = []; + var fetchedResourceDetailData = []; + + var setPdServiceId = function (pdServiceId) { selectedPdserviceId = pdServiceId; } + var getPdServiceId = function () { return selectedPdserviceId; } + + var setPdServiceVersionLinks = function (pdServiceVersionLinks) { + selectedPdServiceversions = pdServiceVersionLinks; } + var getPdServiceVersions = function () { return selectedPdServiceversions }; + + var fetchResourceData = function (pdservice_id, pdServiceVersionLinks) { + var deferred = $.Deferred(); + setPdServiceId(pdservice_id); + setPdServiceVersionLinks(pdServiceVersionLinks); + + $.ajax({ + url: "/auth-user/api/arms/analysis/resource/workerStatus/"+pdservice_id, + type: "GET", + data: { "서비스아이디" : pdservice_id, + //"메인그룹필드" : "assignee.assignee_displayName.keyword", + "메인그룹필드" : "assignee.assignee_emailAddress.keyword", + "하위그룹필드들": "isReq,status.status_name.keyword", + "컨텐츠보기여부" : true, + "크기" : 1000, + "하위크기": 1000, + "pdServiceVersionLinks" : pdServiceVersionLinks}, + contentType: "application/json;charset=UTF-8", + dataType: "json", + progress: true, + statusCode: { + 200: function (data) { + //console.log("=== === === 작업자 상태 집계 시작=== === ===") + console.log(data); + let search_name = data["검색결과"]["group_by_assignee.assignee_displayName.keyword"]; + let search_mail = data["검색결과"]["group_by_assignee.assignee_emailAddress.keyword"]; + //console.log("=== === === 작업자 상태 집계 종료=== === ===") + fetchedResourceData = search_mail; + deferred.resolve(fetchedResourceData); + }, + error: function (e) { + jError("Resource Status 조회에 실패했습니다. 나중에 다시 시도 바랍니다."); + } + } + }); + return deferred.promise(); + } + var getFetchedResourceData = function () { + return fetchedResourceData; + } + + var fetchResourceDetailInfo = function (assignee_email) { + var deferred = $.Deferred(); + let pdservice_id = getPdServiceId(); + let pdServiceVersionLinks = getPdServiceVersions(); + $.ajax({ + url: "/auth-user/api/arms/analysis/resource/workerStatus/"+pdservice_id, + type: "GET", + data: { "서비스아이디" : pdservice_id, + //"메인그룹필드" : "assignee.assignee_displayName.keyword", + "메인그룹필드" : "assignee.assignee_emailAddress.keyword", + "하위그룹필드들": "isReq,status.status_name.keyword", + "컨텐츠보기여부" : true, + "크기" : 1000, + "하위크기": 1000, + "pdServiceVersionLinks" : pdServiceVersionLinks}, + contentType: "application/json;charset=UTF-8", + dataType: "json", + progress: true, + statusCode: { + 200: function (data) { + console.log("=== === === 작업자 상태 집계 시작=== === ===") + console.log(data); + let search_keys1 = data["검색결과"]["group_by_assignee.assignee_displayName.keyword"]; + let search_keys2 = data["검색결과"]["group_by_assignee.assignee_emailAddress.keyword"]; + console.log(search_keys1); + console.log("=== === === 작업자 상태 집계 종료=== === ===") + + //fetchedResourceData = data["검색결과"]["group_by_assignee.assignee_displayName.keyword"]; + fetchedResourceDetailData = search_keys2; + deferred.resolve(fetchedResourceDetailData); + }, + error: function (e) { + jError("Resource Status 조회에 실패했습니다. 나중에 다시 시도 바랍니다."); + } + } + }); + + return deferred.promise(); + } + + var getFetchedResourceDetailData = function () { + return fetchedResourceDetailData; + } + + return { + setPdServiceId, getPdServiceId, + setPdServiceVersionLinks, getPdServiceVersions, + fetchResourceData, getFetchedResourceData, + fetchResourceDetailInfo, getFetchedResourceDetailData + } +})(); \ No newline at end of file Index: arms/js/analysis/table/workerDetailInfoTable.js =================================================================== diff -u --- arms/js/analysis/table/workerDetailInfoTable.js (revision 0) +++ arms/js/analysis/table/workerDetailInfoTable.js (revision 126fb276ada1d9ccefb28c45df952d00a787f98a) @@ -0,0 +1,179 @@ ++(function () { + "use strict"; + function getIdFromMail (param) { + var full_str = param; + var indexOfAt = full_str.indexOf('@'); + return full_str.substring(0,indexOfAt); + } + var WorkerDetailInfoTable = function (selector) { + $.fn.Table.call(this, selector); + this.columns = [ + { + name: "필드명", + title: "담당자 이름", + data: "필드명", + className: "dt-body-center", + defaultContent: "-", + visible: true, + render: function (data, type, row, meta) { + if (type === "display") { + return '"; + } + return data; + }, + }, + { + name: "필드명", + title: "담당자 메일", + data: "필드명", + className: "dt-body-center", + defaultContent: "-", + visible: true, + render: function (data, type, row, meta) { + if (type === "display") { + return '"; + } + return data; + }, + }, + { + name: "개수", + title: "요구사항 및 연결이슈 합계", + data: "개수", //확인필요 + className: "dt-body-right", + defaultContent: "-", + visible: true, + render: function (data, type, row, meta) { + if (type === "display") { + return '"; + } + return data; + }, + }, + { + name: "하위검색결과", + title: "요구사항 수", + data: "하위검색결과", + className: "dt-body-right", + defaultContent: "-", + visible: true, + render: function (data, type, row, meta) { + if (type === "display" && data["group_by_isReq"].length !== 0) { + if(data["group_by_isReq"][0]["필드명"] === "true") { + return '"; + } else { + return '"; + } + } + return data; + }, + }, + { + name: "하위검색결과", + title: "연결이슈 수", + data: "하위검색결과", + className: "dt-body-right", + defaultContent: "-", + visible: true, + render: function (data, type, row, meta) { + if (type === "display" && data["group_by_isReq"].length !== 0) { + if(data["group_by_isReq"][0]["필드명"] === "false") { // 연결이슈만 있음 + return '"; + } else if (data["group_by_isReq"].length === 2 && data["group_by_isReq"][1]["필드명"] === "false") { // 요구사항, 연결이슈 둘다 있음. + return '"; + } else { + return '"; + } + } + return data; + }, + }, + { + name: "하위검색결과", + title: "요구사항 상태", + data: "하위검색결과", + className: "dt-body-right", + defaultContent: "-", + visible: true, + render: function (data, type, row, meta) { + if (type === "display" && data["group_by_isReq"].length !== 0) { + if(data["group_by_isReq"][0]["필드명"] === "true") { // 연결이슈만 있음 + let status = data["group_by_isReq"][0]["하위검색결과"]["group_by_status.status_name.keyword"]; + let return_status = ""; + status.forEach((data, index) => { + return_status += data["필드명"] + " - " + data["개수"] + return_status += '
'; + }) + return '"; + } else { + return '"; + } + } + return data; + }, + }, + { + name: "하위검색결과", + title: "연결이슈 상태", + data: "하위검색결과", + className: "dt-body-right", + defaultContent: "-", + visible: true, + render: function (data, type, row, meta) { + if (type === "display" && data["group_by_isReq"].length !== 0) { + if(data["group_by_isReq"][0]["필드명"] === "false") { // 연결이슈만 있음 + let status = data["group_by_isReq"][0]["하위검색결과"]["group_by_status.status_name.keyword"]; + let return_status = ""; + status.forEach((data, index) => { + return_status += data["필드명"] + " - " + data["개수"] + return_status += '
'; + }) + return '"; + } else if (data["group_by_isReq"].length === 2 && data["group_by_isReq"][1]["필드명"] === "false") { // 요구사항, 연결이슈 둘다 있음. + let status = data["group_by_isReq"][1]["하위검색결과"]["group_by_status.status_name.keyword"]; + let return_status = ""; + status.forEach((data, index) => { + return_status += data["필드명"] + " - " + data["개수"] + return_status += '
'; + }) + return '"; + } else { + return '"; + } + } + return data; + }, + }, + { + name: "필드명", + title: "담당자 이름", + data: "필드명", + className: "dt-body-center", + defaultContent: "-", + visible: true, + render: function (data, type, row, meta) { + if (isEmpty(data) || data === "unknown") { + return "
N/A
"; + } else { + var _render = + '
' + data + + ''+ + "
"; + return _render; + } + return data; + }, + } + ]; + }; + + WorkerStatusTable.prototype = Object.create($.fn.Table.prototype); + WorkerStatusTable.prototype.constructor = WorkerStatusTable; + + $.fn.WorkerStatusTable = WorkerStatusTable; + +})(jQuery); \ No newline at end of file Index: arms/js/analysis/table/workerStatusTable.js =================================================================== diff -u --- arms/js/analysis/table/workerStatusTable.js (revision 0) +++ arms/js/analysis/table/workerStatusTable.js (revision 126fb276ada1d9ccefb28c45df952d00a787f98a) @@ -0,0 +1,176 @@ ++(function () { + "use strict"; + function getIdFromMail (param) { + var full_str = param; + var indexOfAt = full_str.indexOf('@'); + return full_str.substring(0,indexOfAt); + } + var WorkerStatusTable = function (selector) { + $.fn.Table.call(this, selector); + this.columns = [ + { + name: "필드명", + title: "담당자 이름", + data: "필드명", + className: "dt-body-center", + defaultContent: "-", + visible: true, + render: function (data, type, row, meta) { + if (type === "display") { + return '"; + } + return data; + }, + }, + { + name: "필드명", + title: "담당자 메일", + data: "필드명", + className: "dt-body-center", + defaultContent: "-", + visible: true, + render: function (data, type, row, meta) { + if (type === "display") { + return '"; + } + return data; + }, + }, + { + name: "개수", + title: "요구사항 및 연결이슈 합계", + data: "개수", //확인필요 + className: "dt-body-right", + defaultContent: "-", + visible: true, + render: function (data, type, row, meta) { + if (type === "display") { + return '"; + } + return data; + }, + }, + { + name: "하위검색결과", + title: "요구사항 수", + data: "하위검색결과", + className: "dt-body-right", + defaultContent: "-", + visible: true, + render: function (data, type, row, meta) { + if (type === "display" && data["group_by_isReq"].length !== 0) { + if(data["group_by_isReq"][0]["필드명"] === "true") { + return '"; + } else { + return '"; + } + } + return data; + }, + }, + { + name: "하위검색결과", + title: "연결이슈 수", + data: "하위검색결과", + className: "dt-body-right", + defaultContent: "-", + visible: true, + render: function (data, type, row, meta) { + if (type === "display" && data["group_by_isReq"].length !== 0) { + if(data["group_by_isReq"][0]["필드명"] === "false") { // 연결이슈만 있음 + return '"; + } else if (data["group_by_isReq"].length === 2 && data["group_by_isReq"][1]["필드명"] === "false") { // 요구사항, 연결이슈 둘다 있음. + return '"; + } else { + return '"; + } + } + return data; + }, + }, + { + name: "하위검색결과", + title: "요구사항 상태", + data: "하위검색결과", + className: "dt-body-right", + defaultContent: "-", + visible: true, + render: function (data, type, row, meta) { + if (type === "display" && data["group_by_isReq"].length !== 0) { + if(data["group_by_isReq"][0]["필드명"] === "true") { // 연결이슈만 있음 + let status = data["group_by_isReq"][0]["하위검색결과"]["group_by_status.status_name.keyword"]; + let return_status = ""; + status.forEach((data, index) => { + return_status += data["필드명"] + " - " + data["개수"] + return_status += '
'; + }) + return '"; + } else { + return '"; + } + } + return data; + }, + }, + { + name: "하위검색결과", + title: "연결이슈 상태", + data: "하위검색결과", + className: "dt-body-right", + defaultContent: "-", + visible: true, + render: function (data, type, row, meta) { + if (type === "display" && data["group_by_isReq"].length !== 0) { + if(data["group_by_isReq"][0]["필드명"] === "false") { // 연결이슈만 있음 + let status = data["group_by_isReq"][0]["하위검색결과"]["group_by_status.status_name.keyword"]; + let return_status = ""; + status.forEach((data, index) => { + return_status += data["필드명"] + " - " + data["개수"] + return_status += '
'; + }) + return '"; + } else if (data["group_by_isReq"].length === 2 && data["group_by_isReq"][1]["필드명"] === "false") { // 요구사항, 연결이슈 둘다 있음. + let status = data["group_by_isReq"][1]["하위검색결과"]["group_by_status.status_name.keyword"]; + let return_status = ""; + status.forEach((data, index) => { + return_status += data["필드명"] + " - " + data["개수"] + return_status += '
'; + }) + return '"; + } else { + return '"; + } + } + return data; + }, + }, + { + name: "필드명", + title: "상세보기", + data: "필드명", + className: "dt-body-center", + defaultContent: "-", + visible: true, + render: function (data, type, row, meta) { + if (isEmpty(data) || data === "unknown") { + return "
N/A
"; + } else { + var _render = + '
' + + '
'; + return _render; + } + return data; + }, + } + ]; + }; + + WorkerStatusTable.prototype = Object.create($.fn.Table.prototype); + WorkerStatusTable.prototype.constructor = WorkerStatusTable; + + $.fn.WorkerStatusTable = WorkerStatusTable; + +})(jQuery); \ No newline at end of file Index: arms/js/common/table.js =================================================================== diff -u --- arms/js/common/table.js (revision 0) +++ arms/js/common/table.js (revision 126fb276ada1d9ccefb28c45df952d00a787f98a) @@ -0,0 +1,252 @@ +(function ($) { + "use strict"; + + var Table = function (selector) { + this.$selector = $(selector); + this.selector = selector; + this.table; + this.selectedData; + this.onDataTableClick; + this.onInit; + }; + + Table.prototype.onToggleCheckAll = function (element) { + if (!element) return; + + var tr = this.table.rows().nodes(); + var isChecked = $(element).prop("checked"); + console.log(isChecked); + + if (isChecked) { + this.table.rows().select(); + } else { + this.table.rows().deselect(); + } + + $.each(tr, function () { + $(this).find('input[type="checkbox"]').prop("checked", isChecked); + }); + }; + + Table.prototype.onToggleCheckbox = function (element) { + var tr = $(element); + var checkbox = tr.find('input[type="checkbox"]'); + var isChecked = tr.hasClass("selected"); + + checkbox.prop("checked", isChecked); + }; + + Table.prototype.onRowClick = function (element, multi) { + var tr = $(element); + this.selectedData = this.table.row(tr).data(); + + if (tr.hasClass("selected")) { + tr.removeClass("selected"); + + if ($.isFunction(this.onDeselect)) { + this.onDeselect(this.selectedData, element); + } + + this.selectedData = null; + } else { + if (!multi) { + this.table.$("tr.selected").removeClass("selected"); + } + tr.addClass("selected"); + + if ($.isFunction(this.onDataTableClick)) { + this.onDataTableClick(this.selectedData, element); + } + } + }; + + Table.prototype.dataTableExtendBuild = function (params) { + var responsive = { + details: { + renderer: function (api, rowIdx, columns) { + var outer = ""; + + var data = $.map(columns, function (col, i) { + return col.hidden + ? `
+
+ ${col.title} +
+
+ ${col.data} +
` + : ``; + }).join(``); + outer += data; + outer += ""; + + return outer ? $("").append(outer) : false; + } + } + }; + var tableBuildParams = $.extend(true, {}, params, { responsive: responsive }); + + this.dataTableBuild(tableBuildParams); + }; + + Table.prototype.dataTableBuild = function (params) { + var self = this; + var defaults = { + data: [], + stateSave: true, + destroy: true, + processing: true, + serverSide: false, + scrollX: true, + responsive: false, + columns: this.columns, + rowsGroup: null, + columnDefs: [], + isAddCheckbox: false, + isDeleteUtil: false, + select: {}, + pagingType: "simple_numbers", + oLanguage: { + oPaginate: { + sNext: '', + sPrevious: '' + } + }, + order: [[0, "asc"]], + buttons: [ + "copy", + { + extend: "csv", + charset: "UTF-8", + bom: true + }, + "excel", + "print", + { + extend: "pdfHtml5", + orientation: "landscape", + pageSize: "LEGAL" + } + ], + language: { + processing: "", + loadingRecords: + ' 데이터를 처리 중입니다.' + } + }; + + var tableBuildParams = $.extend({}, defaults, params); + + tableBuildParams.initComplete = function () { + var dataTableLength = $(".dataTables_length").find("select:eq(0)"); + var tableWrapper = $(self.selector + "_wrapper"); + + dataTableLength.addClass("darkBack"); + dataTableLength.children().css("background", "#3B3D40"); + dataTableLength.css("border-radius", "5px"); + dataTableLength.css("min-height", "30px"); + tableWrapper.css("border-top", "1px solid rgba(51, 51, 51, 0.3)"); + tableWrapper.css("padding-top", "5px"); + + tableWrapper.find("input[type=search]").css("width", "80px"); + + if (tableBuildParams.isDeleteUtil) { + $(self.selector + "_length").remove(); + $(self.selector + "_filter").remove(); + $(self.selector + "_info").remove(); + $(self.selector + "_paginate").remove(); + } + + if ($.isFunction(self.onInit)) { + self.onInit(); + } + }; + + if (tableBuildParams.isAddCheckbox) { + tableBuildParams.columnDefs = [ + { + targets: 0, + orderable: false, + searchable: false, + data: null, + defaultContent: "", + className: "select-checkbox" + }, + { targets: 1, aDataSort: [1] } + ].concat(tableBuildParams.columnDefs); + + tableBuildParams.columns = [ + { + data: null, + title: '', + render: function () { + return ''; + }, + className: "dt-body-center" + } + ].concat(tableBuildParams.columns); + + tableBuildParams.select = { style: "multi" }; + } + + this.table = this.$selector.DataTable(tableBuildParams); + + $(this.selector + " tbody").on("click", "tr", function () { + self.onRowClick(this, tableBuildParams.isAddCheckbox); + + if (tableBuildParams.isAddCheckbox) { + self.onToggleCheckbox(this); + } + }); + + if (tableBuildParams.isAddCheckbox) { + $(this.selector + "_wrapper .dataTables_scrollHead thead").on("change", 'input[name="checkall"]', function () { + self.onToggleCheckAll(this); + }); + } + + $.fn.dataTable.ext.errMode = function () { + jError("Notification : Ajax Error, retry plz !"); + }; + }; + + Table.prototype.clear = function () { + this.table.clear(); + }; + + Table.prototype.addRows = function (rows) { + this.table.rows.add(rows).draw(false); + }; + + Table.prototype.reDraw = function (rows) { + this.selectedData = null; + this.clear(); + this.addRows(rows); + }; + + Table.prototype.empty = function () { + this.table.destroy(); + this.$selector.empty(); + }; + + Table.prototype.removeRows = function (callback) { + var selectedRows = this.table.rows({ selected: true }); + var selectedDatas = selectedRows.data().toArray(); + + selectedRows.remove().draw(); + + if ($.isFunction(callback)) { + callback(selectedDatas); + } + }; + + Table.prototype.getSelectedDataList = function () { + return this.table.rows({ selected: true }).data().toArray(); + }; + + Table.prototype.getDatas = function () { + return this.table.rows().data().toArray(); + }; + + $.fn.Table = Table; +})(jQuery);