mynotice.js 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. (function ($app) {
  2. $app.module('ylmis').controller('mynoticeCtrl', function ($scope, $http, $filter, $modal, $ocLazyLoad, $alert, $loading, $state, AuthUser, $bsRouterState) {
  3. $scope.dataList = [];
  4. $state.params = $bsRouterState.$params($scope);
  5. $scope.beginDay = $filter('date')(new Date(), 'yyyy-MM') + "-01";
  6. //初始化查询参数
  7. $scope.selectparams = {
  8. title: '',
  9. pageIndex: 1,
  10. pageSize: 10,
  11. startDate:null,
  12. endDate: null,
  13. type: null
  14. };
  15. $scope.pageInfo = { ptotal: 0 };
  16. //查询
  17. $scope.search = function () {
  18. $scope.loadData();
  19. };
  20. //加载列表数据
  21. $scope.loadData = function () {
  22. $http
  23. ({
  24. method: 'post', url: '../../api/systemsetting/notice/GetList', data: $scope.selectparams
  25. }).then(function (result) {
  26. $scope.dataList = result.data.Data.rows;
  27. $scope.pageInfo.ptotal = result.data.Data.total;
  28. });
  29. };
  30. $scope.getPilotTypeList = function () {
  31. $http({
  32. method: 'post',
  33. url: '../../api/systemsetting/dictionary/GetDicList',
  34. data: {
  35. code: 'NoticeType'
  36. }
  37. }).then(function (result) {
  38. $scope.pilotTypeList = result.data.Data;
  39. }, function (resp) {
  40. });
  41. };
  42. var selectModal;
  43. $scope.showContent = function (it) {
  44. selectModal = $modal({
  45. resolve: {
  46. load: ['$ocLazyLoad', function ($ocLazyLoad) {
  47. }]
  48. },
  49. scope: $scope,
  50. controller: selectCtrl,
  51. templateUrl: 'tmpShow.html',
  52. show: false,
  53. animation: 'am-fade-and-slide-top'
  54. });
  55. selectModal.params = it;
  56. selectModal.$promise.then(selectModal.show);
  57. };
  58. var selectCtrl = function ($scope, $http, $filter, $loading) {
  59. $scope.params = selectModal.params;
  60. };
  61. selectCtrl.$inject = ['$scope', '$http', '$filter', '$loading'];
  62. $scope.loadData();
  63. $scope.getPilotTypeList();
  64. });
  65. })(angular);