junggilpark 1 年之前
父節點
當前提交
a49bc53a4c

+ 22 - 15
src/main/resources/static/application/op/00.main/main-header.js

@@ -676,11 +676,18 @@ const _menuDataAll = [
                         icon: "/images/op/menu/z15.png",
                     },
                     {
-                        id: "1",
+                        id: "3",
                         name : "기하구조정보 관리",
                         page: "/application/op/09.cros/02.manager/03.geometry/geometry.html",
                         option: "width = 1750, height = 850, top = 75, left = 100, resizable=yes, scrollbars=no",
-                        icon: "/images/op/menu/z15.png",
+                        icon: "/images/op/menu/060900.png",
+                    },
+                    {
+                        id: "4",
+                        name : "차종별 차량 크기 & 환산 계수 정보 관리",
+                        page: "/application/op/09.cros/02.manager/04.vhcl-type-size-mngr/vhcl-type-size-mngr.html",
+                        option: "width = 850, height = 850, top = 75, left = 550, resizable=yes, scrollbars=no",
+                        icon: "/images/op/menu/z19.png",
                     },
                 ]
             },
@@ -688,28 +695,28 @@ const _menuDataAll = [
                 beginGroup : true,
                 id    : '2',
                 name  : '모니터링',
-                icon  : "/images/op/menu/020400.png",
+                icon  : "/images/op/menu/050400.png",
                 items : [
                     {
                         id: "1",
                         name: "카메라상태 모니터링",
                         page: "/application/op/09.cros/01.system/01.camera-stts-monitoring/camera-stts-monitoring.html",
                         option: "width = 1050, height = 700, top = 150, left = 450, resizable=yes, scrollbars=no",
-                        icon: "/images/op/menu/061800.png",
+                        icon: "/images/op/menu/z15.png",
                     },
                     {
                         id: "2",
                         name: "영상 모니터링",
                         page: "/application/op/09.cros/01.system/02.camera-monitoring/camera-monitoring.html",
                         option: "width = 1650, height = 850, top = 75, left = 150, resizable=yes, scrollbars=no",
-                        icon: "/images/op/menu/061800.png",
+                        icon: "/images/op/menu/050400.png",
                     },
                     {
                         id: "3",
                         name: "분석 교통량 모니터링",
                         page: "/application/op/09.cros/01.system/03.analysis-monitoring/analysis-monitoring.html",
                         option: "width = 1650, height = 850, top = 75, left = 150, resizable=yes, scrollbars=no",
-                        icon: "/images/op/menu/061800.png",
+                        icon: "/images/op/menu/041000.png",
                     },
                 ]
             },
@@ -726,14 +733,14 @@ const _menuDataAll = [
                         name: "방향별-차로별 통계",
                         page: "/application/op/09.cros/03.statistics/01.drct-statistics/drct-statistics.html",
                         option: "width = 1650, height = 850, top = 75, left = 150, resizable=yes, scrollbars=no",
-                        icon: "/images/op/menu/z43.png",
+                        icon: "/images/op/menu/010200.png",
                     },
                     {
                         id: "2",
                         name: "교통량 통계",
                         page: "/application/op/09.cros/03.statistics/02.traf-hs/traf-hs.html",
                         option: "width = 1650, height = 850, top = 75, left = 150, resizable=yes, scrollbars=no",
-                        icon: "/images/op/menu/z43.png",
+                        icon: "/images/op/menu/040000.png",
                     },
                 ]
             },
@@ -770,28 +777,28 @@ const _menuDataAll = [
                 beginGroup : true,
                 id    : '6',
                 name  : '신호 정보 연계',
-                icon: "/images/op/menu/010200.png",
+                icon: "/images/op/menu/z31.png",
                 items : [
                     {
                         id: "1",
                         name : "신호 교차로 현시 정보",
                         page: "/application/op/09.cros/06.signal/01.info/info.html",
                         option: "width = 1650, height = 850, top = 75, left = 150, resizable=yes, scrollbars=no",
-                        icon: "/images/op/menu/z15.png",
+                        icon: "/images/op/menu/z31.png",
                     },
                     {
                         id: "2",
                         name : "신호 교차로 그룹정보",
                         page: "/application/op/09.cros/06.signal/02.group/group.html",
                         option: "width = 1650, height = 850, top = 75, left = 150, resizable=yes, scrollbars=no",
-                        icon: "/images/op/menu/z15.png",
+                        icon: "/images/op/menu/z31.png",
                     },
                     {
                         id: "3",
                         name : "신호 운영 이력 정보",
                         page: "/application/op/09.cros/06.signal/03.oper-hs/oper-hs.html",
                         option: "width = 1650, height = 850, top = 75, left = 150, resizable=yes, scrollbars=no",
-                        icon: "/images/op/menu/z15.png",
+                        icon: "/images/op/menu/z31.png",
                     }
                 ],
             },
@@ -801,7 +808,7 @@ const _menuDataAll = [
                 name  : '서비스 수준 정보',
                 page: "/application/op/09.cros/07.ptrn-hs/ptrn-hs.html",
                 option: "width = 1650, height = 850, top = 100, left = 150, resizable=yes, scrollbars=no",
-                icon: "/images/op/menu/010200.png",
+                icon: "/images/op/menu/z4.png",
             },
             // {
             //     beginGroup : true,
@@ -817,7 +824,7 @@ const _menuDataAll = [
                 name       : '교차로 데이터 다운로드',
                 page       : "/application/op/09.cros/08.ixr-download/ixr-download.html",
                 option     : "width = 970, height = 750, top = 150, left = 490, resizable=yes, scrollbars=no",
-                icon       : "/images/op/menu/010200.png",
+                icon       : "/images/op/menu/080000.png",
             },
         ],
     },
@@ -1381,7 +1388,7 @@ $(() => {
     _dxMenu = $("#menu")
         .dxMenu({
             dataSource: [],
-            //dataSource: _menuDataAll,
+            // dataSource: _menuDataAll,
             hideSubmenuOnMouseLeave: true,
             showFirstSubmenuMode: {
                 name: "onHover",

+ 41 - 0
src/main/resources/static/application/op/09.cros/02.manager/04.vhcl-type-size-mngr/vhcl-type-size-mngr.css

@@ -0,0 +1,41 @@
+*{
+    padding: 0;
+    margin: 0;
+}
+
+html{
+    width: 100%;
+    height: 100%;
+}
+
+body{
+    padding: 10px;
+    width: calc(100% - 20px);
+    height: calc(100% - 20px);
+    min-width: 800px;
+    min-height: 750px;
+}
+
+.save-box {
+    width: calc(100% - 10px);
+    height: 40px;
+    display: flex;
+    align-items: center;
+    justify-content: right;
+    padding-right: 10px;
+}
+.table-box {
+    width: calc(100% - 4px);
+    height: calc(100% - 250px);
+    padding: 2px;
+}
+.vhcl-size-box {
+    width: calc(100% - 4px);
+    height: 66px;
+    padding: 2px;
+}
+
+.list-box{
+    width: 100%;
+    height: 100%;
+}

+ 51 - 0
src/main/resources/static/application/op/09.cros/02.manager/04.vhcl-type-size-mngr/vhcl-type-size-mngr.html

@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <script src="/libs/include-common.js"></script>
+    <script src="./vhcl-type-size-mngr.js"></script>
+    <link rel="stylesheet" href="./vhcl-type-size-mngr.css">
+    <title>차종별 차량 크기 & 환산 계수 정보 관리</title>
+</head>
+<body class="dx-viewport">
+    <div class="container b0 dx-theme-border-color">
+        <div class="title-box b2 dx-theme-border-color">
+            <div>차종별 차량 크기 & 환산 계수 정보 관리</div>
+            <div>
+                <div class="search-button"></div>
+            </div>
+            <div>
+                <div class="close-button"></div>
+            </div>
+        </div>
+        <div class="serve-title dx-nav-item b2 dx-theme-border-color">
+            차종별 차량 크기 정보 설정
+        </div>
+        <div class="table-box b2 dx-theme-border-color">
+            <div class="list-box">
+                <div class="list"></div>
+            </div>
+        </div>
+        <div class="save-box b2 dx-theme-border-color">
+            <div>
+                <div class="save_btn"></div>
+            </div>
+        </div>
+        <div class="serve-title dx-nav-item b2 dx-theme-border-color">
+            차량크기별 승용차 환산계수 설정
+        </div>
+        <div class="vhcl-size-box b2 dx-theme-border-color">
+            <div class="list-box">
+                <div class="size-pce-list"></div>
+            </div>
+        </div>
+        <div class="save-box dx-theme-border-color">
+            <div>
+                <div class="pce_save_btn"></div>
+            </div>
+        </div>
+    </div>
+</body>
+</html>

+ 257 - 0
src/main/resources/static/application/op/09.cros/02.manager/04.vhcl-type-size-mngr/vhcl-type-size-mngr.js

@@ -0,0 +1,257 @@
+let vhclSize, list, saveBtn, pceSaveBtn, sizePceList, sizePceData;
+const _apiUri = "/api/scrs/vhcl";
+$(()=>{
+    //닫기 버튼
+    const coloseBtn = new dxBtn($(".close-button"), '닫기', 'close', 'outlined', 80, 30, false, true);
+    coloseBtn.onClick(()=>window.close());
+
+    //조회 버튼
+    const searchBtn = new dxBtn($(".search-button"), '조회', 'refresh', 'outlined', 80, 30, false, true);
+    searchBtn.onClick(refreshData);
+
+    //차량크기 수정 버튼
+    saveBtn = new dxBtn($('.save_btn'), '수정', 'save', 'outlined', 80, 30, false, true);
+    saveBtn.onClick(sizeEditEvent);
+
+    //차량 크기별 환산계수 수정 버튼
+    pceSaveBtn = new dxBtn($('.pce_save_btn'), '수정', 'save', 'outlined', 80, 30, false, true);
+    pceSaveBtn.onClick(pceEditEvent);
+
+    //차종별 차량 크기 리스트 컬럼
+    const columns = [
+        {
+            dataField : 'vhcl_type',
+            caption   : '차종',
+            alignment : 'center',
+            visible   : false,
+        },
+        {
+            dataField : 'vhcl_type_desc',
+            caption   : '차종 종별',
+            alignment : 'center',
+            allowEditing: false,
+            cellTemplate(c,e){
+                return alignTemplate(c, e, 'left');
+            }
+        },
+        {
+            dataField : 'vhcl_type_rmrk',
+            caption   : '차종 분류기준',
+            alignment : 'center',
+            allowEditing: false,
+            cellTemplate(c,e){
+                return alignTemplate(c, e, 'left');
+            }
+        },
+        {
+            dataField : 'vhcl_type_exam',
+            caption   : '차종 예시차량',
+            alignment : 'center',
+            visible   : false,
+        },
+        {
+            dataField : 'vhcl_size',
+            caption   : '차량 크기 설정',
+            alignment : 'center',
+            lookup    : {
+                dataSource : [],
+                valueExpr : 'vhcl_size',
+                displayExpr : 'vhcl_desc',
+            }
+        },
+    ];
+
+    //차종별 차량 크리 리스트
+    list = initializedGrid($('.list'), '100%', '100%', columns, [], 'single', 'standard',
+        null, false, false, false, '', false, false,
+        false, '', false, {editing: {allowUpdating : true, mode: "batch"}, sorting: 'none'}, null).dxDataGrid('instance');
+
+    //차량 크기별 승용차 환산계수 리스트
+    sizePceList = initializedGrid($('.size-pce-list'), '100%', '100%', [], [], 'none', 'standard',
+        null, false, false, false, '', false, false,
+        false, '', false, {editing: {allowUpdating : true, mode: "batch"}, sorting: 'none'}, null).dxDataGrid('instance');
+
+    //데이터 가져오기
+    fetchBaseData();
+})
+
+/**
+ * 리스트 데이터 호출
+ */
+function fetchBaseData() {
+    getDataAsync(_apiUri + "/type_size_mngm", initTypSizeData, null, null, false);
+    getDataAsync(_apiUri + '/size_pce_mngm', initSizePceData, null, null, false);
+}
+
+/**
+ * 차종별 차량 크기 리스트 데이터 세팅
+ * @param jsonData 수신 데이터
+ */
+function initTypSizeData(jsonData) {
+    if (jsonData) {
+        list.option('dataSource', jsonData);
+    }
+}
+
+/**
+ * 차량 크기별 환산계수 리스트 데이터 및 컬럼 룩업 데이터 세팅
+ * @param jsonData 수신 데이터
+ */
+function initSizePceData(jsonData) {
+    sizePceData = jsonData;
+    if (jsonData) {
+        list.option('columns[4].lookup.dataSource', jsonData);
+        if (jsonData.length > 0 ) {
+            let column = [
+                {
+                    dataField : 'section',
+                    caption   : '구분',
+                    alignment : 'center',
+                    allowEditing: false,
+                }
+            ];
+
+            let data = {section: '차량크기별 승용차 환산계수'};
+
+            jsonData.forEach((obj)=>{
+                column.push({
+                    dataField : 'pce_' + obj.vhcl_size,
+                    caption   : obj.vhcl_desc + '형',
+                    alignment : 'center',
+                    format    : '##0.0'
+                });
+
+                data['pce_' + obj.vhcl_size] = obj.pce;
+            });
+
+            sizePceList.option('columns', column);
+            sizePceList.option('dataSource', [data]);
+        }
+    }
+}
+
+/**
+ * 치종별 사이즈 변경 이벤트
+ * @returns {boolean|*}
+ */
+function sizeEditEvent() {
+    const isEdit = list.hasEditData();
+
+    if (!isEdit) return alertWarning('변경된 데이터가 없습니다.');
+    const updateData = [...list.option('dataSource')];
+    confirmMessage("차종별 차량 크기 정보를 수정하시겠습니까?").done((yes)=>{
+        if (yes) {
+            const editOption = list.option('editing.changes');
+            if (editOption && editOption.length > 0){
+                for (let option of editOption) {
+                    const optionKey = option.key;
+                    const optionData = option.data;
+                    if (optionKey) {
+                        for (let obj of updateData) {
+                            if (obj.vhcl_size === optionKey.vhcl_size &&
+                                obj.vhcl_type === optionKey.vhcl_type) {
+                                obj.vhcl_size = optionData.vhcl_size;
+                            }
+                        }
+                    }
+                }
+
+                const result = postInsertUpdate(_apiUri + '/type_size_mngm', updateData);
+
+                if (result && result > -1) {
+                    alertConfirm("차종별 차량 크기 정보를 수정하였습니다.");
+                    list.saveEditData();
+                    getDataAsync(_apiUri + '/type_size_mngm', updateListData, null, null, false);
+                }
+            }
+        }
+    })
+}
+
+/**
+ * 차량 크기별 환산계수 변경 이벤트
+ * @returns {boolean|*}
+ */
+function pceEditEvent() {
+    const isEdit = sizePceList.hasEditData();
+    let updateData = [];
+    if (sizePceData && sizePceData.length > 0) {
+        updateData = [...sizePceData];
+    }
+
+    if (!isEdit) return alertWarning('변경된 데이터가 없습니다.');
+
+    confirmMessage("차량 크기별 환산계수 정보를 수정하시겠습니까?").done((yes)=>{
+        if (yes) {
+            const editOption = sizePceList.option('editing.changes');
+            if (editOption && editOption[0] && editOption[0].data){
+                for (let key in editOption[0].data) {
+                    const vhclSize = key.replace('pce_', "");
+                    const pce = Number(editOption[0].data[key]);
+                    const pceStr = pce.toString();
+
+                    if (!pceStr) return alertWarning("환산 계수를 입력해주세요");
+
+                    if (isNaN(pce)) return alertWarning("환산 계수는 숫자로만 입력해주세요");
+
+                    let array = pceStr.split('.');
+
+                    if (array[0] && array[0].length > 3) return alertWarning("환산 계수의 소수점 앞자리는 3자리까지만 입력이 가능합니다.");
+
+                    for (let obj of updateData) {
+                        if (obj.vhcl_size === Number(vhclSize)) {
+                            obj.pce = pce;
+                        }
+                    }
+                }
+
+                const result = postInsertUpdate(_apiUri + '/size_pce_mngm', updateData);
+
+                if (result && result > -1) {
+                    alertConfirm("차량크기별 승용차 환산계수 정보를 수정하였습니다.");
+                    sizePceList.saveEditData();
+                    getDataAsync(_apiUri + '/size_pce_mngm', updatePceData, null, null, false);
+                }
+            }
+        }
+    })
+}
+
+/**
+ * 차량 크기별 환산계수 리스트 데이터 업데이트
+ * @param jsonData 수신데이터
+ */
+function updatePceData(jsonData) {
+    sizePceData = jsonData;
+    let data = {
+        section: '차량크기별 승용차 환산계수'
+    };
+
+    if (jsonData && jsonData.length > 0 ) {
+        jsonData.forEach((obj)=>{
+            data['pce_' + obj.vhcl_size] = obj.pce;
+        });
+    }
+
+    sizePceList.option('dataSource', [data]);
+    sizePceList.cancelEditData();
+    sizePceList.refresh();
+}
+
+/**
+ * 차종별 차량 크기 데이터 업데이트
+ * @param jsonData 수신데이터
+ */
+function updateListData(jsonData) {
+    list.option('dataSource', jsonData);
+    list.cancelEditData();
+    list.refresh();
+}
+
+/**
+ * 조회버튼 클릭 이벤트
+ */
+function refreshData() {
+    getDataAsync(_apiUri + '/type_size_mngm', updateListData, null, null);
+    getDataAsync(_apiUri + '/size_pce_mngm', updatePceData, null, null);
+}

+ 10 - 8
src/main/resources/static/application/op/09.cros/03.statistics/01.drct-statistics/drct-statistics.js

@@ -366,14 +366,16 @@ function getFormatData(obj, columns){
         let rght_tfvl = 0;
         let go_tfvl   = 0;
         for (let key in item) {
-            if (key.indexOf('left') > -1 && key !== 'left_tfvl' ) {
-                left_tfvl += item[key];
-            }
-            else if(key.indexOf('rght') > -1 && key !== 'rght_tfvl' ) {
-                rght_tfvl += item[key];
-            }
-            else if (key.indexOf('go') > -1 && key !== 'go_tfvl' ) {
-                go_tfvl += item[key];
+            if (key.indexOf("pce_") === -1 ) {
+                if (key.indexOf('left') > -1 && key !== 'left_tfvl' ) {
+                    left_tfvl += item[key];
+                }
+                else if(key.indexOf('rght') > -1 && key !== 'rght_tfvl' ) {
+                    rght_tfvl += item[key];
+                }
+                else if (key.indexOf('go') > -1 && key !== 'go_tfvl' ) {
+                    go_tfvl += item[key];
+                }
             }
         }
         data['go_tfvl' + item.drct_dvsn_cd]   = go_tfvl;

+ 11 - 9
src/main/resources/static/application/op/09.cros/03.statistics/02.traf-hs/traf-hs.js

@@ -609,15 +609,17 @@ function drawTableAndChart(jsonData, unitVal){
             item.left_tfvl = 0;
             item.rght_tfvl = 0;
             for (let key in item) {
-               if ( key.indexOf('go') > -1 && key !== 'go_tfvl' ) {
-                    item.go_tfvl += item[key];
-               }
-               if ( key.indexOf('left') > -1 && key !== 'left_tfvl' ) {
-                    item.left_tfvl += item[key];
-               }
-               if ( key.indexOf('rght') > -1 && key !== 'rght_tfvl') {
-                    item.rght_tfvl += item[key];
-               }
+                if (key.indexOf("pce_") === -1 ) {
+                   if ( key.indexOf('go') > -1 && key !== 'go_tfvl' ) {
+                        item.go_tfvl += item[key];
+                   }
+                   if ( key.indexOf('left') > -1 && key !== 'left_tfvl' ) {
+                        item.left_tfvl += item[key];
+                   }
+                   if ( key.indexOf('rght') > -1 && key !== 'rght_tfvl') {
+                        item.rght_tfvl += item[key];
+                   }
+                }
             }
             item.tot_tfvl  = item.go_tfvl + item.left_tfvl + item.rght_tfvl;
             totGo   += item.go_tfvl;

+ 1 - 1
src/main/resources/static/js/constant/constant.js

@@ -5,7 +5,7 @@ const _apiUrl = "";
 
 // map-config.js
 const _mapHostUrl = "";
-//const _mapHostUrl = "http://192.168.20.15:8080";
+// const _mapHostUrl = "http://192.168.20.15:8080";
 const _normalUrl = _mapHostUrl + "/MAPDATA/PTATMS/VWorld/Base/{z}/{x}/{y}.png";
 const _satelliteUrl = _mapHostUrl + "/MAPDATA/PTATMS/VWorld/Satellite/{z}/{x}/{y}.jpeg";
 const _hybridUrl = _mapHostUrl + "/MAPDATA/PTATMS/VWorld/Hybrid/{z}/{x}/{y}.png";