{"TYPE":"Single","MTX_MODULE_INFO":[{"MODULE_CODE":"MOD52756C5CDD646C6B4A6C82208957A0EC","MODULE_SUBJECT":"[Grid] 라벨 기반 단계별 조건부 서식","USE_AUTHORITY":"0","EDIT_AUTHORITY":"-1","MODULE_DESCRIPTION":"","SCRIPT_TEXT":"var dgSel\t\t\t= Matrix.getObject(arguments[0]); // 화면에서 데이터를 받아올 그리드\nvar fldStep         = arguments[1]; // 현재 단계를 받아올 필드명\n\nvar LB_TASK1\t\t= Matrix.getObject(arguments[2]); // 1단계\nvar LB_TASK2\t\t= Matrix.getObject(arguments[3]); // 2단계\nvar LB_TASK3\t\t= Matrix.getObject(arguments[4]); // 3단계\nvar LB_TASK4\t\t= Matrix.getObject(arguments[5]); // 4단계\nvar LB_TASK5\t\t= Matrix.getObject(arguments[6]); // 4단계\nvar LB_TASK_ARR\t\t= [LB_TASK1, LB_TASK2, LB_TASK3, LB_TASK4, LB_TASK5];\n\nvar COLOR_P\t\t\t= arguments[7]; // 완료\nvar COLOR_C\t\t\t= arguments[8]; // 진행중\nvar COLOR_F\t\t\t= arguments[9]; // 예정\n\n/*****예정작업에 따흔 Label 색 변경*****/ \n var Label_color_set = function(){\n \tvar currentVal = Matrix.GetVariable(\"VS_STEP\");\n\t\n\tvar steps = [];\n\tfor(var j=0;j<LB_TASK_ARR.length;j++){\n\t\tsteps.push(LB_TASK_ARR[j].Description);\n\t}\n\t\n    var currentIndex = steps.indexOf(currentVal);\n\t\n\tif (currentIndex === -1) {\n        for (var k = 0; k < 5; k++) {\n            LB_TASK_ARR[k].Style.Background.Color.SetColor(COLOR_F);\n            LB_TASK_ARR[k].Update();\n        }\n        return;\n    }\n\t\n\tfor (var i = 0; i < LB_TASK_ARR.length; i++) {\n        var label = LB_TASK_ARR[i];\n\n        if (i < currentIndex) {\n            // 지나온 단계: 완료 (COLOR_P)\n            label.Style.Background.Color.SetColor(COLOR_P);\n        } else if (i === currentIndex) {\n            // 현재 진행 중인 단계: 진행중 (COLOR_C)\n            label.Style.Background.Color.SetColor(COLOR_C);\n        } else {\n            // 아직 오지 않은 단계: 예정 (COLOR_F)\n            label.Style.Background.Color.SetColor(COLOR_F);\n        }\n        // 화면 갱신\n        label.Update();\n    }\n };\n\n dgSel.OnDataBindEnd = function(s, e){\n   \tvar select_next\t= dgSel.getRowValue(0, fldStep);\n   \n   \tMatrix.SetVariable(\"VS_STEP\" ,select_next);\n   \n   \tLabel_color_set();\n };\n\n dgSel.OnCellClick = function(s, e){\n    var select_next\t= e.Row.GetValue(fldStep);\n\n    Matrix.SetVariable(\"VS_STEP\" ,select_next);\n\n    Label_color_set();\n };","MODULE_TYPE":"","RESULT_TYPE":"","ORIGINAL_MODULE_CODE":"","CREATE_USER":"matrix","MODIFY_USER":"sckim1397","MODULE_SEQ":"12","WF_YN":"","EVENT_YN":"N","ATTR1":"","ATTR2":"","ATTR3":"", "MTX_MODULE_PARAMS":[{"MODULE_CODE":"MOD52756C5CDD646C6B4A6C82208957A0EC","PARAM_SEQ":"1","PARAM_TYPE":"INP003","NULLABLE":"N","PARAM_DESCRIPTION":"화면에서 선택할 데이터그리드","DEFAULT_VALUE":"","ATTR1":"","ATTR2":"","ATTR3":""},{"MODULE_CODE":"MOD52756C5CDD646C6B4A6C82208957A0EC","PARAM_SEQ":"2","PARAM_TYPE":"INP001","NULLABLE":"N","PARAM_DESCRIPTION":"그리드에서 현재 단계를 받아올 필드명 입력","DEFAULT_VALUE":"","ATTR1":"","ATTR2":"","ATTR3":""},{"MODULE_CODE":"MOD52756C5CDD646C6B4A6C82208957A0EC","PARAM_SEQ":"3","PARAM_TYPE":"INP004","NULLABLE":"N","PARAM_DESCRIPTION":"1단계 라벨 선택\n* 라벨의 Description에 단계명 입력 필수","DEFAULT_VALUE":"","ATTR1":"","ATTR2":"","ATTR3":""},{"MODULE_CODE":"MOD52756C5CDD646C6B4A6C82208957A0EC","PARAM_SEQ":"4","PARAM_TYPE":"INP004","NULLABLE":"N","PARAM_DESCRIPTION":"2단계 라벨 선택\n* 라벨의 Description에 단계명 입력 필수","DEFAULT_VALUE":"","ATTR1":"","ATTR2":"","ATTR3":""},{"MODULE_CODE":"MOD52756C5CDD646C6B4A6C82208957A0EC","PARAM_SEQ":"5","PARAM_TYPE":"INP004","NULLABLE":"N","PARAM_DESCRIPTION":"3단계 라벨 선택\n* 라벨의 Description에 단계명 입력 필수","DEFAULT_VALUE":"","ATTR1":"","ATTR2":"","ATTR3":""},{"MODULE_CODE":"MOD52756C5CDD646C6B4A6C82208957A0EC","PARAM_SEQ":"6","PARAM_TYPE":"INP004","NULLABLE":"N","PARAM_DESCRIPTION":"4단계 라벨 선택\n* 라벨의 Description에 단계명 입력 필수","DEFAULT_VALUE":"","ATTR1":"","ATTR2":"","ATTR3":""},{"MODULE_CODE":"MOD52756C5CDD646C6B4A6C82208957A0EC","PARAM_SEQ":"7","PARAM_TYPE":"INP004","NULLABLE":"N","PARAM_DESCRIPTION":"5단계 라벨 선택\n* 라벨의 Description에 단계명 입력 필수","DEFAULT_VALUE":"","ATTR1":"","ATTR2":"","ATTR3":""},{"MODULE_CODE":"MOD52756C5CDD646C6B4A6C82208957A0EC","PARAM_SEQ":"8","PARAM_TYPE":"INP001","NULLABLE":"N","PARAM_DESCRIPTION":"완료 상태 색상 코드 입력","DEFAULT_VALUE":"#d9ead3","ATTR1":"","ATTR2":"","ATTR3":""},{"MODULE_CODE":"MOD52756C5CDD646C6B4A6C82208957A0EC","PARAM_SEQ":"9","PARAM_TYPE":"INP001","NULLABLE":"N","PARAM_DESCRIPTION":"진행중 상태 색상 코드 입력","DEFAULT_VALUE":"#fff2cc","ATTR1":"","ATTR2":"","ATTR3":""},{"MODULE_CODE":"MOD52756C5CDD646C6B4A6C82208957A0EC","PARAM_SEQ":"10","PARAM_TYPE":"INP001","NULLABLE":"N","PARAM_DESCRIPTION":"예정 상태 색상 코드 입력","DEFAULT_VALUE":"#f4cccc","ATTR1":"","ATTR2":"","ATTR3":""}]}]}