OWL ITS + 탐지시스템(인터넷 진흥원)
jhjang
2021-10-14 b74776268dd3eb2bc57744928d6f7150ffcd4ec2
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
'use strict';
 
define(['app'],
    function (app) {
 
        app.directive('fileUploadProgress', ["$log", "$rootScope",
            function ($log, $rootScope) {
                return {
                    restrict : 'AE',
                    templateUrl : "custom_components/file-upload-progress/file-upload-progress.html",
                    link : function ($scope, $element, $attrs) {
 
                        /*$scope.vm = {
                            display : false,    //  표시 여부
                            displayType : "client",
                            fileName : "",  //  파일 명
                            process : "0%", //  진행률
                            totalFileCount : 0, //  전체 업로드 개수
                            uploadFileCount : 0 //  진행중인 업로드 파일 개수
                        };*/
                        //  파입 업로드 진행률 표시
                        $scope.$on("displayFileUpload", function (event, args) {
                            if ($rootScope.isDefined(args.clientFileCount)) {
                                $("#client-file-upload").show();
                                $("#client-toast-progress").text(args.clientProgress);
                                $("#client-file-title").text(args.clientFileCount);
                            }
                            else {
                                $("#client-toast-progress").text("0%");
                                $("#client-file-title").text("");
 
                                $("#client-file-upload").hide();
                            }
 
                            if ($rootScope.isDefined(args.serverFileName)) {
                                $("#server-file-upload").show();
                                $("#server-toast-progress").text(args.serverProgress);
                                $("#server-file-name").text(args.serverFileName);
                                $("#uploadFileCount").text(args.uploadFileCount);
                                $("#totalFileCount").text(args.totalFileCount);
                            }
                            else {
                                $("#server-toast-progress").text("0%");
                                $("#server-file-name").text("");
                                $("#uploadFileCount").text(0);
                                $("#totalFileCount").text(0);
                                $("#server-file-upload").hide();
                            }
 
 
                            if (args.display) {
                                $(".file-upload-process").show();
                            }
                            else {
                                $(".file-upload-process").hide();
                            }
                        })
                    }
                }
            }])
    });