var sysQuerySqlFieldServiceApp = angular.module('sysQuerySqlFieldServiceApp', []); sysQuerySqlFieldServiceApp.service('sysQuerySqlFieldService', ['$http', 'dataRightsService', function($http, dataRightsService) { var service = { initCtrlTypeSetting:function(scope){ this.scope = scope; scope.dialog = frameElement.dialog; var conf =scope.dialog.get('conf'); scope.sysQueryField = conf.field; scope.globalTypes = conf.dicList; scope.selectList = []; scope.sysQueryField.ctrlCon = {}; if(scope.sysQueryField.controlType == 11){ scope.selectList = parseToJson(scope.sysQueryField.controlContent); }else if(scope.sysQueryField.controlType == 3){ scope.sysQueryField.dicType = scope.sysQueryField.controlContent; }else if(scope.sysQueryField.controlType == 12){ scope.sysQueryField.ctrlCon = parseToJson(scope.sysQueryField.controlContent); } var url = __ctx + '/platform/form/bpmFormDialog/getAllDialogs.ht'; $.ajax({ type:"get", async:false, url:url, success:function(data){ for(var i = 0 ; i < data.length ; i++){ data[i].resultfield = parseToJson(data[i].resultfield); } scope.dialogList = data; scope.currentDialog=scope.getCurrentDialog(); if(!scope.sysQueryField.ctrlCon.dialog){ scope.sysQueryField.ctrlCon.dialog = data[0].alias; scope.sysQueryField.ctrlCon.resultField = data[0].resultfield[0].field; } scope.$$phase?"":scope.$digest(); } }); }, initVirtual:function(scope){ this.scope = scope; scope.dialog = frameElement.dialog; var conf =scope.dialog.get('conf'); scope.sysQueryField = conf.field; scope.sysQueryFields = conf.sysQueryFields; scope.globalTypes = conf.dicList; scope.selectList = []; }, initAlarm:function(scope){ this.scope = scope; this.util = dataRightsService; scope.dialog = frameElement.dialog; var conf =scope.dialog.get('conf'); scope.sysQueryField = conf.field; scope.alarmSetting = scope.sysQueryField.alarmSetting; if(scope.alarmSetting){ if(typeof scope.alarmSetting =="string") scope.alarmSetting = parseToJson(scope.sysQueryField.alarmSetting) }else{ scope.alarmSetting = [{condition:[{op:">",val:""}],color:"red"}]; } }, getVirtualFromType : function(type){ var list = {1:"数据字典",2:"sql",3:"下拉框"}; return list[type]; }, getCtrCon:function(ctrlType){ if(ctrlType == 3) return this.scope.sysQueryField.dicType; else if(ctrlType == 11) return dataRightsService.listToString(this.scope.selectList); else if(ctrlType == 12 ) return dataRightsService.listToString(this.scope.sysQueryField.ctrlCon); } }; return service; }]) // .directive('selectTable', function($compile) { return { restrict : 'E', replace : true, scope:{ list:"=" }, template : ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ ''+ '
'+ '添加'+ '
'+ '
'+ ''+ ''+ '
'+ '
'+ '
'+ ''+ '
'+ '
' }; })