Index: arms/js/common.js
===================================================================
diff -u -rd6df6e2a028c237766295835838d25eb42c1523c -r2001ceb51fdaaec65c945ee67326d0ce2292854f
--- arms/js/common.js (.../common.js) (revision d6df6e2a028c237766295835838d25eb42c1523c)
+++ arms/js/common.js (.../common.js) (revision 2001ceb51fdaaec65c945ee67326d0ce2292854f)
@@ -15,6 +15,7 @@
let permissions;
let userEmail;
let scrollPos = 0;
+let stateCategory;
////////////////////////////////////////////////////////////////////////////////////////
//Document Ready
@@ -608,6 +609,8 @@
console.log("common :: jsTreeBuild : ( hostname ) → " + $(location).attr("hostname"));
console.log("common :: jsTreeBuild : ( port ) → " + $(location).attr("port"));
+ getStateCategory();
+
$(jQueryElementID)
.bind("before.jstree", function (e, data) {
$("#alog").append(data.func + "
");
@@ -743,7 +746,7 @@
let type = item.attr.rel;
if(type !== "folder"){
if (item.reqStateEntity && item.reqStateEntity.c_title) {
- let state = item.reqStateEntity.c_title;
+ let state = item.reqStateEntity.reqStateCategoryEntity.c_id;
item.data = mappingStateIcon(state) +" "+item.data;
}
}
@@ -993,19 +996,31 @@
});
function mappingStateIcon(key) {
- if (key === "열림") {
- return '';
- } else if (key === "진행중") {
- return '';
- } else if (key === "해결됨") {
- return '';
- } else if (key === "닫힘") {
- return '';
+ let stateIcon = stateCategory.find(item => item.c_id === key);
+ if (stateIcon) {
+ return stateIcon.c_category_icon.replace('class="', 'class="status-icon ');
+ } else {
+ return '';
}
- return ''; // 기본적으로 빈 문자열 반환
}
}
+function getStateCategory(){
+ $.ajax({
+ url:"/auth-user/api/arms/reqStateCategory/getNodesWithoutRoot.do",
+ type:"GET",
+ dataType:"json",
+ progress: true,
+ statusCode:{
+ 200: function(data){
+ console.log("[ common :: getStateCategory] :: ARMS에 등록된 상태 카테고리 정보");
+ stateCategory = data.result;
+ console.log(stateCategory);
+ }
+ }
+ });
+}
+
////////////////////////////////////////////////////////////////////////////////////////
// UTIL : 널 체크
////////////////////////////////////////////////////////////////////////////////////////