'use strict'; var app = angular.module('app', []); app.controller("listCtrl", ["$scope", "$http", "$timeout", function ($scope, $http, $timeout) { var self = this; var s4 = new SM4Util(); self.userId = $.cookie("GlWorkPlatform-userid"); self.userName = $.cookie("GlWorkPlatform-chineseName"); self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken"); self.get_lastReturnPageno = sp.getUrlName("lastReturnPageno"); var postCfg = { headers: { 'Content-Type': 'application/json', 'Authorization': "Bearer " + self.get_AccessToken } } self.search = { FLOWNAME: "" } self.getData = function () { self.list = []; var data = { tablename: "DANGANFLOWMANAGE", colums: "*", order: "ID", sqlwhere:"", sqlorwhere: "", sqlinwhere: "", sqllikewhere: { FLOWNAME: self.search.FLOWNAME, } }; $http.post(apiurljs.login + "g2app/dataabase/queryDataByCol", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg) .success(function (obj) { var res = strToJson(s4.decryptData_CBC(obj.data)); self.list = res.data; }) } self.getData() self.Edit = function (item) { self.edit = item; sp.layer("#Edit") } self.btnSave = function () { var data = { id: self.edit.ID, tablename: "DANGANFLOWMANAGE", data: { MOBANNAME: self.edit.MOBANNAME, PRINTTYPE: self.edit.PRINTTYPE } } $http.post(apiurljs.login + "g2app/DangJian/upFormData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg) .success(function (obj) { var res = strToJson(s4.decryptData_CBC(obj.data)); sp.layerhide() if (res.success) { self.getData() sp.dialog("保存成功!"); $timeout(function () { sp.dialoghide() },1500) } else { sp.dialog(res.message) } }); } self.Del = function (item) { var dialogHead = "温馨提示×"; var dialogBody = "