diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 51fc269..9282fa2 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -1594,7 +1594,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo $scope.highlightedBR.push({ 'bodyRegionId': bodyRegionId }); console.log('$scope.highlightedBR.length= ' + $scope.highlightedBR.length) if ($scope.highlightedBR.length == 9) { - debugger; + //debugger; if ($scope.isHighlightBodysystem == true || $rootScope.isListManagerSelected == true) $rootScope.isLoading = false; @@ -3878,6 +3878,29 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo console.log('listManagerEvent') if ($rootScope.islistManagerEventAlredayDispachted == true) { + + var systemList = $rootScope.CommonData.DACommonData.BodySystems.Item; + + //var systemListHtml = '' + + var $all = $('').appendTo('#bodySystems'); + $compile($all)($scope); + + angular.forEach(systemList, function (value, key) { + + var $elem = $('').appendTo('#bodySystems'); + $compile($elem)($scope); + // systemListHtml = systemListHtml + '<' + }) + + + // $('#bodySystems').append(systemListHtml); + + + var currentView = localStorage.getItem("currentViewTitle"); + var viewNmeHtml = '' + $('#viewName').append(viewNmeHtml); + var len = $rootScope.openModules.length; var openViewLen = $rootScope.openViews.length; @@ -3893,89 +3916,103 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo .select('_ActualTermNumber'); var TermTextList = []; - var path = '~/../content/data/json/da/vocab/english/cm_dat_vocabterm_1.json' + var TermTextList = []; + + $scope.loadListManger(); - $http({ method: 'GET', url: '~/../content/data/json/da/vocab/english/cm_dat_vocabterm_1.json' }).success(function (data) { - var VocabTermData = data; + }) + .error(function (data, status, headers, config) { - var vocabTermTxt = []; + console.log(data); - angular.forEach($scope.TermNumberData.TermData.Term, function (value1, key1) { + }); - angular.forEach(VocabTermData.VocabTerms.Term, function (value2, key2) { - if (value1._ActualTermNumber === value2._ActualTermNumber) { - vocabTermTxt.push( + $rootScope.islistManagerEventAlredayDispachted = false; + var jj; + } - { + } - "_ActualTermNumber": value2._ActualTermNumber, + - "_TermText": value2._TermText, + }); - "_cdId": value2._cdId - } + $scope.loadListManger = function () { - ); - } - }) + var path = '~/../content/data/json/da/vocab/english/cm_dat_vocabterm_1.json' + $http({ method: 'GET', url: '~/../content/data/json/da/vocab/english/cm_dat_vocabterm_1.json' }).success(function (data) { + var VocabTermData = data; - }) + var vocabTermTxt = []; + angular.forEach($scope.TermNumberData.TermData.Term, function (value1, key1) { + angular.forEach(VocabTermData.VocabTerms.Term, function (value2, key2) { - $scope.VocabTermTxt = new jinqJs() - .from(vocabTermTxt) + if (value1._ActualTermNumber === value2._ActualTermNumber) { + vocabTermTxt.push( - .distinct('_TermText', '_ActualTermNumber') + { - .orderBy([{ field: '_TermText', sort: 'asc' }]) + "_ActualTermNumber": value2._ActualTermNumber, - .select('_ActualTermNumber', '_TermText', '_cdId'); + "_TermText": value2._TermText, + "_cdId": value2._cdId - for (var j = 0; j < $scope.VocabTermTxt.length; j++) { - var $el = $('').appendTo('#termList') - $compile($el)($scope); - } + } - $rootScope.isLoading = false; - $('#spinner').css('visibility', 'hidden'); + ); - }) + } - .error(function (data, status, headers, config) { + }) - console.log(data); - }); + }) - }) - .error(function (data, status, headers, config) { - console.log(data); + $scope.VocabTermTxt = new jinqJs() - }); + .from(vocabTermTxt) + .distinct('_TermText', '_ActualTermNumber') + .orderBy([{ field: '_TermText', sort: 'asc' }]) - $rootScope.islistManagerEventAlredayDispachted = false; - var jj; + .select('_ActualTermNumber', '_TermText', '_cdId'); + + + for (var j = 0; j < $scope.VocabTermTxt.length; j++) { + var $el = $('').appendTo('#termList') + $compile($el)($scope); } - } + var termsTotal = '' + $scope.VocabTermTxt.length + ' Structures'; + $("#totalTerms").empty(); + $('#totalTerms').append(termsTotal); - }); + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); + + }) + + .error(function (data, status, headers, config) { + console.log(data); + + }); + } $scope.HighlightBodyOnListManagerSelection = function (event) { @@ -4217,6 +4254,115 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var iReturnValue = nValue * nNewZoom; return Math.round(iReturnValue/nExistingZoom); } + + $scope.refreshTermListOnSystemSelection = function (event) { + + $('#termList').empty(); + // $('#termList').innerHTML = ''; + + if (event.currentTarget.id == 0) { + $scope.loadListManger(); + } + else { + var bodySystemDataPath = '~/../content/data/json/da/body-views/' + localStorage.getItem("currentBodyViewId") + '/da_dat_body_system_term_' + localStorage.getItem("currentBodyViewId") + '.json'; + DataService.getJson(bodySystemDataPath) + .then( + function (result) { + + $rootScope.BodySystemData = result; + var systemMatchedTermList = new jinqJs() + .from($rootScope.BodySystemData.BodySystem.BodySystemTerm) + .where('_SystemNumber == ' + event.currentTarget.id) + .select(); + + $scope.refreshTerms(systemMatchedTermList); + }, + function (error) { + console.log(error.statusText) + } + ) + + } + } + + $scope.refreshTerms = function (termList) { + + var path = '~/../content/data/json/da/vocab/english/cm_dat_vocabterm_1.json' + + $http({ method: 'GET', url: '~/../content/data/json/da/vocab/english/cm_dat_vocabterm_1.json' }).success(function (data) { + + var VocabTermData = data; + + var vocabTermTxt = []; + + for(var i=0;i' + $scope.VocabTermTxt[j]._TermText + '').appendTo('#termList') + $compile($el)($scope); + } + + var termsTotal = '' + $scope.VocabTermTxt.length + ' Structures'; + $("#totalTerms").empty(); + //$('#totalTerms').innerHTML = ''; + + $('#totalTerms').append(termsTotal); + $rootScope.isLoading = false; + $('#spinner').css('visibility', 'hidden'); + + }) + + .error(function (data, status, headers, config) { + + console.log(data); + + }); + + + } }] diff --git a/400-SOURCECODE/AIAHTML5.Web/index.html b/400-SOURCECODE/AIAHTML5.Web/index.html index 28fd14f..0db8ac0 100644 --- a/400-SOURCECODE/AIAHTML5.Web/index.html +++ b/400-SOURCECODE/AIAHTML5.Web/index.html @@ -283,77 +283,97 @@ - + + + +
+ +
- - - -
-
-
2330 Structure
- -
-
- icon -
+
+ -
+
+ + + - + \ No newline at end of file