sysQueryFieldController.js 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. var sysQueryFieldApp = angular.module('sysQueryFieldApp', [ 'baseServices','DataRightsApp','sysQuerySqlFieldServiceApp','sysQuerySqlServiceApp']);
  2. sysQueryFieldApp.controller('sysQueryMetaFieldCtrl',['$scope','dataRightsService','sysQuerySqlFieldService','sysQuerySqlService',function($scope,dataRightsService,sysQuerySqlFieldService,sysQuerySqlService){
  3. var service = sysQuerySqlFieldService;
  4. $scope.service = service;
  5. var conf = frameElement.dialog.get('conf');
  6. $scope.type = conf.type;
  7. $scope.util = sysQuerySqlService;
  8. $scope.close = function(){
  9. frameElement.dialog.close();
  10. }
  11. }])
  12. .controller('sysQueryMetaFieldCtrlTypeCtrl',['$scope',function($scope){
  13. $scope.save = function(){
  14. $scope.sysQueryField.controlContent = $scope.service.getCtrCon($scope.sysQueryField.controlType);
  15. frameElement.dialog.get('sucCall')($scope.sysQueryField);
  16. frameElement.dialog.close();
  17. }
  18. $scope.changeDialog = function (){
  19. $scope.currentDialog=$scope.getCurrentDialog();
  20. $scope.sysQueryField.ctrlCon.resultField = $scope.currentDialog.resultfield[0].field;
  21. }
  22. $scope.getCurrentDialog = function(){
  23. for(var i = 0 ; i < $scope.dialogList.length ; i++){
  24. if($scope.dialogList[i].alias == $scope.sysQueryField.ctrlCon.dialog){
  25. return $scope.dialogList[i];
  26. }
  27. }
  28. return $scope.dialogList[0];
  29. }
  30. $scope.service.initCtrlTypeSetting($scope);
  31. $scope.sysQueryField.controlType=$scope.sysQueryField.controlType+"";
  32. }])
  33. .controller('sysQueryMetaFieldVirtualCtrl',['$scope',function($scope){
  34. $scope.save = function(){
  35. frameElement.dialog.get('sucCall')($scope.sysQueryField);
  36. frameElement.dialog.close();
  37. }
  38. $scope.service.initVirtual($scope);
  39. }])
  40. .controller('sysQueryMetaFieldAlarmCtrl',['$scope',function($scope){
  41. $scope.save = function() {
  42. $scope.sysQueryField.alarmSetting = $scope.alarmSetting;
  43. frameElement.dialog.get('sucCall')($scope.sysQueryField);
  44. frameElement.dialog.close();
  45. }
  46. $scope.addCondition = function (list){
  47. list.push({op:">",val:""});
  48. }
  49. $scope.addAlarmSetting = function (){
  50. $scope.alarmSetting.push({
  51. condition:[{
  52. op:">",
  53. val:""
  54. }],
  55. color:"red"
  56. });
  57. }
  58. $scope.service.initAlarm($scope);
  59. }])
  60. .controller('sysQueryMetaFieldVirtualCtrl',['$scope',function($scope){
  61. $scope.save = function(){
  62. frameElement.dialog.get('sucCall')($scope.sysQueryField);
  63. frameElement.dialog.close();
  64. }
  65. $scope.service.initVirtual($scope);
  66. }])
  67. .controller('sysQueryMetaSqlSettingCtrl',['$scope',function($scope){
  68. var conf = frameElement.dialog.get('conf');
  69. $scope.sysQueryField = conf.field;
  70. $scope.save = function() {
  71. frameElement.dialog.get('sucCall')($scope.sysQueryField);
  72. frameElement.dialog.close();
  73. }
  74. }])