OWL ITS + 탐지시스템(인터넷 진흥원)
jhjang
2021-10-14 3052936fed9166521b0557a36df83eb11a5e51ee
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/**
 * Created by maprex on 2021-03-25.
 */
'use strict';
 
define(['app'], function (app) {
    app.factory("Gantt", ['$http', '$log', '$upload', '$rootScope', function ($http, $log, $upload, $rootScope) {
 
        //  파일 업로드 진행율을 표시해준다.
        function fileUploadProgress(evt) {
            if (evt.config.file.length > 0) {
 
                var progress = parseInt(100.0 * evt.loaded / evt.total);
 
                var body = {
                    display : progress < 100,    //  표시 여부
                    clientFileCount : evt.config.file.length,  //  클라이언트 업로드 파일 개수
                    clientProgress: progress + "%", //  진행률
                    serverFileName : null,    //  서버 업로드 파일 명
                    serverProgress : null,
                    totalFileCount : null, //  전체 업로드 개수
                    uploadFileCount : null //  진행중인 업로드 파일 개수
                };
 
                $rootScope.$broadcast("displayFileUpload", body);
            }
        }
 
        return {
            find : function (conditions) {
                return $http.post("gantt/find", conditions).then(function (response) {
                    $log.debug("이슈 목록 데이터 : ", response);
                    return response;
                });
            },
            findProject : function (conditions) {
                return $http.post("gantt/findProject", conditions).then(function (response) {
                    $log.debug("프로젝트 이슈 목록 데이터 : ", response);
                    return response;
                });
            },
            add : function (conditions) {
                conditions.url = "gantt/add";
                return $upload.upload(conditions).progress(function (evt) {
                    //  파일 업로드 진행율을 표시해준다.
                    fileUploadProgress(evt);
 
                }).then(function (response) {
                    $log.debug("이슈 생성 결과 : ", response);
                    return response;
                });
            },
            modify : function (conditions) {
                conditions.url = "gantt/modify";
                return $upload.upload(conditions).progress(function (evt) {
                    //  파일 업로드 진행율을 표시해준다.
                    fileUploadProgress(evt);
 
                }).then(function (response) {
                    $log.debug("이슈 수정 결과 : ", response);
                    return response;
                });
            },
            detail : function (conditions) {
                return $http.post("gantt/detail", conditions).then(function (response) {
                    $log.debug("이슈 상세 데이터 : ", response);
                    return response;
                });
            },
            remove : function (conditions) {
                return $http.post("gantt/remove", conditions).then(function (response) {
                    $log.debug("이슈 삭제 결과 : ", response);
                    return response;
                });
            },
        }
    }
    ])
});