123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- 'use strict';
- var app = angular.module('app', [
- 'angularUtils.directives.dirPagination',
- ]);
- app.controller("indexCtrl", ["$scope", "$http", "$interval", "$timeout", "$sce", function ($scope, $http, $interval, $timeout, $sce) {
- var self = this;
- self.userId = $.cookie("GlWorkPlatform-userid");
- self.userName = $.cookie("GlWorkPlatform-username");
- self.userChineseName = $.cookie("GlWorkPlatform-chineseName")
- self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken");
- var postCfg = {
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + self.get_AccessToken
- }
- };
- self.getZRBM = function () {
- var data = {
- ckey: "CODE_ZRBM",
- routeinfoid: self.routeinfoid
- }
- $http.post(apiurljs.login + "g2app/abase/queryDataCode", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.ZRBM = res.data.CODE_ZRBM;
- self.getData(1)
- })
- }
- self.getZRBM()
- self.loading = false;
- self.noDataTip = 1;//没有数据时赋变量为0,先默认为1
- self.pageno = 1;
- self.total_count = 0;
- self.itemsPerPage = 10;
- self.pageOptions = [10, 20, 30, 40];
- self.getData = function (pageno) {
- self.list = [];
- self.loading = false;
- self.pageno = pageno;
- $scope.__default__currentPage = self.pageno; //设置页面样式在第几页
- var data = {
- tablename: "WJFB_CB",
- pagesize: self.itemsPerPage,
- pageno: self.pageno,
- colums: "ID,FBZT,LX,WJBT,FBBM,FBRQ",
- order: "SORTID ASC,FBRQ desc",
- sqlwhere: { LX: sp.getUrlName('val'), FBZT: "1" },
- sqlorwhere: "",
- sqlinwhere: "",
- sqllikewhere: ""
- };
- $http.post(apiurljs.login + "g2app/dataabase/queryDataByColWithPage", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg)
- .success(function (obj) {
- var res = strToJson(s4.decryptData_CBC(obj.data));
- self.loading = false;
- console.log(res)
- if (res.data == null || res.data == undefined || res.data == "") {
- self.noDataTip = 0;
- } else {
- self.noDataTip = 1;
- self.list = res.data;
- self.total_count = res.totalCount;
- self.list.forEach(function (item) {
- self.ZRBM.forEach(function (item1) {
- if (item.FBBM == item1.CODE) {
- item.FBBM1 = item1.CNAME;
- }
- })
- })
- }
- })
- }
- self.goUrl = function (item) {
- sp.openNewWindow("detail1.html?id=" + item.ID + "&code=" + sp.getUrlName('val')+ "&lastReturnPageno=" + self.pageno, item.WJBT)
- }
- }])
|