var app = angular.module('app', ["angularUtils.directives.dirPagination"]); app.controller("formlistCtrl", ["$scope", "$http", "$compile", "$timeout", function ($scope, $http, $compile, $timeout) { var self = this; var s4 = new SM4Util(); self.userId = $.cookie("GlWorkPlatform-userid"); self.userName = $.cookie("GlWorkPlatform-username"); self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken"); self.get_leftActive = sp.getUrlName("leftActive"); self.get_leftActiveType = sp.getUrlName("leftActiveType"); $("#contentBox").height($("body").height() - 75); self.loading = false; self.btnGoBack = function () { ///返回上一级 window.location.href = "formlist.html?leftActive=" + self.get_leftActive + "&leftActiveType=" + self.get_leftActiveType; }; var postCfg = { headers: { 'Content-Type': 'application/json', 'Authorization': "Bearer " + self.get_AccessToken } }; self.Eliminate = function () { self.loading = true; var time1 = sp.getLocalDate1(); var data = { tablename: "SYS_FORM", sqlwhere: { CTYPE: "NORMAL" }, sqlorwhere: {}, sqlinwhere: {}, sqllikewhere: {}, colums: "*", order: "SORTID" }; $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg) .success(function (obj) { self.loading = false; var res = strToJson(s4.decryptData_CBC(obj.data)); self.eliminateList = res.data; self.EliminateAllChecked = false; self.eliminateList.forEach(function (item) { item.checked = false; }) }) } self.Eliminate() self.changeEliminate1 = function () { //self.EliminateAllChecked = !self.EliminateAllChecked; $.each(self.eliminateList, function (index, item) { item.checked = self.EliminateAllChecked }) } self.changeEliminate2 = function (item) { item.checked = !item.checked; } self.btnEliminateTrue = function () { var ckeys = []; self.eliminateList.forEach(function (item) { if (item.checked == true) { ckeys.push(item.CKEY) } }) if (ckeys.length == 0) { sp.dialog("请勾选需要清除的表单!"); return; } var dialogHead = "温馨提示×"; var dialogBody = "