Commit 9b541b4f0beaf7985f4174c71ef81eb70ab60307
1 parent
e5123879
list manager terms is now refreshed on selection of body system. Also the body s…
…ystem list is dymanic
Showing
2 changed files
with
271 additions
and
96 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -1594,7 +1594,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
1594 | 1594 | $scope.highlightedBR.push({ 'bodyRegionId': bodyRegionId }); |
1595 | 1595 | console.log('$scope.highlightedBR.length= ' + $scope.highlightedBR.length) |
1596 | 1596 | if ($scope.highlightedBR.length == 9) { |
1597 | - debugger; | |
1597 | + //debugger; | |
1598 | 1598 | if ($scope.isHighlightBodysystem == true || $rootScope.isListManagerSelected == true) |
1599 | 1599 | |
1600 | 1600 | $rootScope.isLoading = false; |
... | ... | @@ -3878,6 +3878,29 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3878 | 3878 | console.log('listManagerEvent') |
3879 | 3879 | if ($rootScope.islistManagerEventAlredayDispachted == true) { |
3880 | 3880 | |
3881 | + | |
3882 | + var systemList = $rootScope.CommonData.DACommonData.BodySystems.Item; | |
3883 | + | |
3884 | + //var systemListHtml = '<option value="0" selected="">All</option>' | |
3885 | + | |
3886 | + var $all = $('<option ng-click=refreshTermListOnSystemSelection($event) id="0" selected="">All</option>').appendTo('#bodySystems'); | |
3887 | + $compile($all)($scope); | |
3888 | + | |
3889 | + angular.forEach(systemList, function (value, key) { | |
3890 | + | |
3891 | + var $elem = $('<option ng-click=refreshTermListOnSystemSelection($event) id="' + value._BodySystemId + '" title="' + value._Name + '" >' + value._Name + '</option>').appendTo('#bodySystems'); | |
3892 | + $compile($elem)($scope); | |
3893 | + // systemListHtml = systemListHtml + '<<option id="' + value._BodySystemId + '" title="' + value._Name + '" ng-click=" $scope.refreshTermListOnSystemSelection(event)">' + value._Name + '</option>' | |
3894 | + }) | |
3895 | + | |
3896 | + | |
3897 | + // $('#bodySystems').append(systemListHtml); | |
3898 | + | |
3899 | + | |
3900 | + var currentView = localStorage.getItem("currentViewTitle"); | |
3901 | + var viewNmeHtml = '<option>'+currentView+'</option>' | |
3902 | + $('#viewName').append(viewNmeHtml); | |
3903 | + | |
3881 | 3904 | var len = $rootScope.openModules.length; |
3882 | 3905 | var openViewLen = $rootScope.openViews.length; |
3883 | 3906 | |
... | ... | @@ -3893,89 +3916,103 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
3893 | 3916 | .select('_ActualTermNumber'); |
3894 | 3917 | |
3895 | 3918 | var TermTextList = []; |
3896 | - var path = '~/../content/data/json/da/vocab/english/cm_dat_vocabterm_1.json' | |
3919 | + var TermTextList = []; | |
3920 | + | |
3921 | + $scope.loadListManger(); | |
3897 | 3922 | |
3898 | - $http({ method: 'GET', url: '~/../content/data/json/da/vocab/english/cm_dat_vocabterm_1.json' }).success(function (data) { | |
3899 | 3923 | |
3900 | - var VocabTermData = data; | |
3924 | + }) | |
3925 | + .error(function (data, status, headers, config) { | |
3901 | 3926 | |
3902 | - var vocabTermTxt = []; | |
3927 | + console.log(data); | |
3903 | 3928 | |
3904 | - angular.forEach($scope.TermNumberData.TermData.Term, function (value1, key1) { | |
3929 | + }); | |
3905 | 3930 | |
3906 | - angular.forEach(VocabTermData.VocabTerms.Term, function (value2, key2) { | |
3907 | 3931 | |
3908 | 3932 | |
3909 | - if (value1._ActualTermNumber === value2._ActualTermNumber) { | |
3910 | - vocabTermTxt.push( | |
3933 | + $rootScope.islistManagerEventAlredayDispachted = false; | |
3934 | + var jj; | |
3935 | + } | |
3911 | 3936 | |
3912 | - { | |
3937 | + } | |
3913 | 3938 | |
3914 | - "_ActualTermNumber": value2._ActualTermNumber, | |
3939 | + | |
3915 | 3940 | |
3916 | - "_TermText": value2._TermText, | |
3941 | + }); | |
3917 | 3942 | |
3918 | - "_cdId": value2._cdId | |
3919 | 3943 | |
3920 | - } | |
3944 | + $scope.loadListManger = function () { | |
3921 | 3945 | |
3922 | - ); | |
3923 | 3946 | |
3924 | - } | |
3925 | 3947 | |
3926 | - }) | |
3948 | + var path = '~/../content/data/json/da/vocab/english/cm_dat_vocabterm_1.json' | |
3927 | 3949 | |
3950 | + $http({ method: 'GET', url: '~/../content/data/json/da/vocab/english/cm_dat_vocabterm_1.json' }).success(function (data) { | |
3928 | 3951 | |
3952 | + var VocabTermData = data; | |
3929 | 3953 | |
3930 | - }) | |
3954 | + var vocabTermTxt = []; | |
3931 | 3955 | |
3956 | + angular.forEach($scope.TermNumberData.TermData.Term, function (value1, key1) { | |
3932 | 3957 | |
3958 | + angular.forEach(VocabTermData.VocabTerms.Term, function (value2, key2) { | |
3933 | 3959 | |
3934 | - $scope.VocabTermTxt = new jinqJs() | |
3935 | 3960 | |
3936 | - .from(vocabTermTxt) | |
3961 | + if (value1._ActualTermNumber === value2._ActualTermNumber) { | |
3962 | + vocabTermTxt.push( | |
3937 | 3963 | |
3938 | - .distinct('_TermText', '_ActualTermNumber') | |
3964 | + { | |
3939 | 3965 | |
3940 | - .orderBy([{ field: '_TermText', sort: 'asc' }]) | |
3966 | + "_ActualTermNumber": value2._ActualTermNumber, | |
3941 | 3967 | |
3942 | - .select('_ActualTermNumber', '_TermText', '_cdId'); | |
3968 | + "_TermText": value2._TermText, | |
3943 | 3969 | |
3970 | + "_cdId": value2._cdId | |
3944 | 3971 | |
3945 | - for (var j = 0; j < $scope.VocabTermTxt.length; j++) { | |
3946 | - var $el = $('<option ng-click=HighlightBodyOnListManagerSelection($event) id=' + $scope.VocabTermTxt[j]._ActualTermNumber + '>' + $scope.VocabTermTxt[j]._TermText + '</option>').appendTo('#termList') | |
3947 | - $compile($el)($scope); | |
3948 | - } | |
3972 | + } | |
3949 | 3973 | |
3950 | - $rootScope.isLoading = false; | |
3951 | - $('#spinner').css('visibility', 'hidden'); | |
3974 | + ); | |
3952 | 3975 | |
3953 | - }) | |
3976 | + } | |
3954 | 3977 | |
3955 | - .error(function (data, status, headers, config) { | |
3978 | + }) | |
3956 | 3979 | |
3957 | - console.log(data); | |
3958 | 3980 | |
3959 | - }); | |
3960 | 3981 | |
3982 | + }) | |
3961 | 3983 | |
3962 | 3984 | |
3963 | - }) | |
3964 | - .error(function (data, status, headers, config) { | |
3965 | 3985 | |
3966 | - console.log(data); | |
3986 | + $scope.VocabTermTxt = new jinqJs() | |
3967 | 3987 | |
3968 | - }); | |
3988 | + .from(vocabTermTxt) | |
3969 | 3989 | |
3990 | + .distinct('_TermText', '_ActualTermNumber') | |
3970 | 3991 | |
3992 | + .orderBy([{ field: '_TermText', sort: 'asc' }]) | |
3971 | 3993 | |
3972 | - $rootScope.islistManagerEventAlredayDispachted = false; | |
3973 | - var jj; | |
3994 | + .select('_ActualTermNumber', '_TermText', '_cdId'); | |
3995 | + | |
3996 | + | |
3997 | + for (var j = 0; j < $scope.VocabTermTxt.length; j++) { | |
3998 | + var $el = $('<option ng-click=HighlightBodyOnListManagerSelection($event) id=' + $scope.VocabTermTxt[j]._ActualTermNumber + '>' + $scope.VocabTermTxt[j]._TermText + '</option>').appendTo('#termList') | |
3999 | + $compile($el)($scope); | |
3974 | 4000 | } |
3975 | - } | |
4001 | + var termsTotal = '<span class="pull-left marginTop5">' + $scope.VocabTermTxt.length + ' Structures</span>'; | |
4002 | + $("#totalTerms").empty(); | |
4003 | + $('#totalTerms').append(termsTotal); | |
3976 | 4004 | |
3977 | - }); | |
4005 | + $rootScope.isLoading = false; | |
4006 | + $('#spinner').css('visibility', 'hidden'); | |
4007 | + | |
4008 | + }) | |
4009 | + | |
4010 | + .error(function (data, status, headers, config) { | |
3978 | 4011 | |
4012 | + console.log(data); | |
4013 | + | |
4014 | + }); | |
4015 | + } | |
3979 | 4016 | $scope.HighlightBodyOnListManagerSelection = function (event) { |
3980 | 4017 | |
3981 | 4018 | |
... | ... | @@ -4217,6 +4254,115 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
4217 | 4254 | var iReturnValue = nValue * nNewZoom; |
4218 | 4255 | return Math.round(iReturnValue/nExistingZoom); |
4219 | 4256 | } |
4257 | + | |
4258 | + $scope.refreshTermListOnSystemSelection = function (event) { | |
4259 | + | |
4260 | + $('#termList').empty(); | |
4261 | + // $('#termList').innerHTML = ''; | |
4262 | + | |
4263 | + if (event.currentTarget.id == 0) { | |
4264 | + $scope.loadListManger(); | |
4265 | + } | |
4266 | + else { | |
4267 | + var bodySystemDataPath = '~/../content/data/json/da/body-views/' + localStorage.getItem("currentBodyViewId") + '/da_dat_body_system_term_' + localStorage.getItem("currentBodyViewId") + '.json'; | |
4268 | + DataService.getJson(bodySystemDataPath) | |
4269 | + .then( | |
4270 | + function (result) { | |
4271 | + | |
4272 | + $rootScope.BodySystemData = result; | |
4273 | + var systemMatchedTermList = new jinqJs() | |
4274 | + .from($rootScope.BodySystemData.BodySystem.BodySystemTerm) | |
4275 | + .where('_SystemNumber == ' + event.currentTarget.id) | |
4276 | + .select(); | |
4277 | + | |
4278 | + $scope.refreshTerms(systemMatchedTermList); | |
4279 | + }, | |
4280 | + function (error) { | |
4281 | + console.log(error.statusText) | |
4282 | + } | |
4283 | + ) | |
4284 | + | |
4285 | + } | |
4286 | + } | |
4287 | + | |
4288 | + $scope.refreshTerms = function (termList) { | |
4289 | + | |
4290 | + var path = '~/../content/data/json/da/vocab/english/cm_dat_vocabterm_1.json' | |
4291 | + | |
4292 | + $http({ method: 'GET', url: '~/../content/data/json/da/vocab/english/cm_dat_vocabterm_1.json' }).success(function (data) { | |
4293 | + | |
4294 | + var VocabTermData = data; | |
4295 | + | |
4296 | + var vocabTermTxt = []; | |
4297 | + | |
4298 | + for(var i=0;i<termList.length;i++){ | |
4299 | + | |
4300 | + var actulaTermNumber =new jinqJs() | |
4301 | + .from($scope.TermNumberData.TermData.Term) | |
4302 | + .where('_TermNumber == ' + termList[i]._TermNumber ) | |
4303 | + .select('_ActualTermNumber'); | |
4304 | + angular.forEach(VocabTermData.VocabTerms.Term, function (value2, key2) { | |
4305 | + | |
4306 | + | |
4307 | + if (actulaTermNumber[0]._ActualTermNumber == value2._ActualTermNumber) { | |
4308 | + vocabTermTxt.push( | |
4309 | + | |
4310 | + { | |
4311 | + | |
4312 | + "_ActualTermNumber": value2._ActualTermNumber, | |
4313 | + | |
4314 | + "_TermText": value2._TermText, | |
4315 | + | |
4316 | + "_cdId": value2._cdId | |
4317 | + | |
4318 | + } | |
4319 | + | |
4320 | + ); | |
4321 | + | |
4322 | + } | |
4323 | + | |
4324 | + }) | |
4325 | + | |
4326 | + } | |
4327 | + | |
4328 | + | |
4329 | + | |
4330 | + | |
4331 | + | |
4332 | + $scope.VocabTermTxt = new jinqJs() | |
4333 | + | |
4334 | + .from(vocabTermTxt) | |
4335 | + | |
4336 | + .distinct('_TermText', '_ActualTermNumber') | |
4337 | + | |
4338 | + .orderBy([{ field: '_TermText', sort: 'asc' }]) | |
4339 | + | |
4340 | + .select('_ActualTermNumber', '_TermText', '_cdId'); | |
4341 | + | |
4342 | + | |
4343 | + for (var j = 0; j < $scope.VocabTermTxt.length; j++) { | |
4344 | + var $el = $('<option ng-click=HighlightBodyOnListManagerSelection($event) id=' + $scope.VocabTermTxt[j]._ActualTermNumber + '>' + $scope.VocabTermTxt[j]._TermText + '</option>').appendTo('#termList') | |
4345 | + $compile($el)($scope); | |
4346 | + } | |
4347 | + | |
4348 | + var termsTotal = '<span class="pull-left marginTop5">' + $scope.VocabTermTxt.length + ' Structures</span>'; | |
4349 | + $("#totalTerms").empty(); | |
4350 | + //$('#totalTerms').innerHTML = ''; | |
4351 | + | |
4352 | + $('#totalTerms').append(termsTotal); | |
4353 | + $rootScope.isLoading = false; | |
4354 | + $('#spinner').css('visibility', 'hidden'); | |
4355 | + | |
4356 | + }) | |
4357 | + | |
4358 | + .error(function (data, status, headers, config) { | |
4359 | + | |
4360 | + console.log(data); | |
4361 | + | |
4362 | + }); | |
4363 | + | |
4364 | + | |
4365 | + } | |
4220 | 4366 | }] |
4221 | 4367 | |
4222 | 4368 | ... | ... |
400-SOURCECODE/AIAHTML5.Web/index.html
... | ... | @@ -283,77 +283,97 @@ |
283 | 283 | <!--List manager--> |
284 | 284 | |
285 | 285 | <style> |
286 | - select[multiple], select[size] { | |
287 | - height: 100%; | |
288 | - } | |
286 | + | |
287 | + | |
288 | + | |
289 | + | |
290 | + #listManager { | |
291 | + background:#fff; border-radius:3px; border:1px solid #ededed; | |
292 | + -webkit-box-shadow: 0px 0px 2px 1px rgba(173,173,173,1); | |
293 | +-moz-box-shadow: 0px 0px 2px 1px rgba(173,173,173,1); | |
294 | +box-shadow: 0px 0px 2px 1px rgba(173,173,173,1); | |
295 | +width:350px; | |
296 | +position:absolute;top:170px;left:140px;display:none;z-index:1100; | |
297 | + | |
298 | +} | |
299 | +#listManager .annotation-modal-header{ background:#818f44; padding:2px 10px; } | |
300 | +#listManager .annotation-modal-header h4{ color:#fff; font-size:15px; line-height:20px;} | |
301 | +#listManager .modal-header .close{ color:#fff; margin:0; opacity:10; text-shadow:none;} | |
302 | +#listManager .modal-footer{ padding:5px 10px;} | |
289 | 303 | |
290 | - .container { | |
291 | - margin-left: auto; | |
292 | - margin-right: auto; | |
293 | - padding-left: 15px; | |
294 | - padding-right: 15px; | |
295 | - } | |
296 | 304 | </style> |
297 | - <div id="listManager" style="position:fixed;top:150px;left:130px;display:none;z-index:1100;"> | |
305 | + <div id="listManager" style=""> | |
298 | 306 | <div class="modal-header annotation-modal-header"> |
299 | 307 | <button type="button" class="close" aria-label="Close" ng-click="CloseListManager()"><span aria-hidden="true">×</span></button> |
300 | 308 | <h4 class="modal-title" id="myModalLabel">List Manager</h4> |
301 | 309 | </div> |
302 | - <div class="container" style="background:white;width:400px;height:500px;" ng-init="FillListManager()"> | |
303 | - <div class="form-group"> | |
304 | - <label for="sel1">Window</label> | |
305 | - <select class="form-control" id="sel1"> | |
306 | - <option>Male Lateral</option> | |
310 | + <div class="modal-body"> | |
311 | + <div class="row paddingTopBtm10"> | |
312 | + <div class="col-sm-12" ng-init="FillListManager()"> | |
307 | 313 | |
308 | - </select> | |
309 | - </div> | |
310 | - <div style=""> | |
311 | - <div onclick="mytoggle()"> | |
312 | - <span class="caret"></span> <span>Restrict List to</span> | |
313 | - </div> | |
314 | - <div id="divSection" style="display:none;"> | |
315 | - <div class="form-group form-inline"> | |
316 | - <label for=" email"> | |
317 | - System | |
318 | - </label> | |
319 | - <select class="form-control" id="sel1"> | |
320 | - <option>ALL</option> | |
321 | - <option>Male Lateral</option> | |
314 | + <div class="form-group"> | |
315 | + <label for="sel1">Window</label> | |
316 | + <select class="form-control" id="viewName" > | |
317 | + <!--<option>Male Lateral</option>--> | |
322 | 318 | |
323 | 319 | </select> |
324 | 320 | </div> |
325 | - <div class="form-group form-inline"> | |
326 | - <label for=" email"> | |
327 | - Area: | |
328 | - </label> | |
329 | - <select class="form-control" id="sel1"> | |
330 | - <option>Entire View</option> | |
331 | - <option>Entire View</option> | |
321 | + <div style=""> | |
322 | + <div class="form-group"> | |
323 | + <div onclick="mytoggle()" class="btn btn-success btn-block" style="padding:3px 12px;"> | |
324 | + <i class=" fa fa-caret-right"></i> <span>Restrict List to</span> | |
325 | + </div> | |
326 | + </div> | |
332 | 327 | |
333 | - </select> | |
334 | - </div> | |
335 | - </div> | |
336 | - <div style="background:white;width:100%;height:400px;"> | |
337 | - <select id="termList" class="form-control" multiple=""> | |
338 | - | |
328 | + <div id="divSection" style="display:none;"> | |
329 | + | |
330 | + | |
331 | + | |
332 | + <div class="well well-sm marginTopBtm10"> | |
333 | + <div class="form-horizontal"> | |
334 | + <div class="form-group"> | |
335 | + <label class="col-sm-4 control-label" for="System">System</label> | |
336 | + <div class="col-sm-8"> | |
337 | + <select id="bodySystems" class="form-control"> | |
338 | + | |
339 | + </select> | |
340 | + </div> | |
341 | + </div> | |
342 | + <div class="form-group"> | |
343 | + <label class="col-sm-4 control-label" for="inputPassword3">Area</label> | |
344 | + <div class="col-sm-8"> | |
345 | + <select class="form-control"> | |
346 | + <option value="1" selected="">Entire View</option> | |
347 | + </select> | |
348 | + </div> | |
349 | + </div> | |
350 | + </div> | |
351 | + </div> | |
352 | + | |
353 | + | |
354 | + </div> | |
355 | + | |
356 | + | |
357 | + | |
358 | + <div class="form-group"> | |
359 | + <select id="termList" class="form-control" multiple="" size="10"> | |
360 | + | |
361 | + </select> | |
362 | + </div> | |
339 | 363 | |
340 | - </select> | |
341 | - </div> | |
342 | - </div> | |
343 | - <div style="clear:both;"></div> | |
344 | - <div> | |
345 | - <div style="float:left;">2330 Structure</div> | |
346 | - | |
347 | - <div style="float:right;"> | |
348 | - <div> | |
349 | - icon | |
350 | - <span class="caret"></span> | |
351 | 364 | </div> |
365 | + <div style="clear:both;"></div> | |
366 | + | |
352 | 367 | |
353 | - </div> | |
354 | 368 | |
355 | 369 | |
370 | + </div> | |
356 | 371 | </div> |
372 | + | |
373 | + </div> | |
374 | + <div class="modal-footer" id="totalTerms"> | |
375 | + <!--<span class="pull-left marginTop5">424 Structures</span>--> | |
376 | + <button data-dismiss="modal" class="btn btn-primary" type="button"><i class="fa fa-arrow-circle-right"></i></button> | |
357 | 377 | </div> |
358 | 378 | </div> |
359 | 379 | <script> |
... | ... | @@ -436,11 +456,20 @@ |
436 | 456 | }); |
437 | 457 | })(jQuery); |
438 | 458 | </script> |
439 | - <script> | |
459 | + <!--<script> | |
440 | 460 | $(function () { |
441 | 461 | $(".modal").draggable(); |
442 | 462 | $(".annotationTollbar").draggable(); |
443 | 463 | }); |
464 | + </script>--> | |
465 | + | |
466 | + <script> | |
467 | + $('.modal').draggable({ | |
468 | + handle: '.modal-header'; | |
469 | + | |
470 | + | |
471 | +}) | |
444 | 472 | </script> |
473 | + | |
445 | 474 | </body> |
446 | 475 | </html> |
447 | 476 | \ No newline at end of file | ... | ... |