task.js 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. var app = new Vue({
  2. el:'#outer',
  3. data:{
  4. domainParams : [
  5. {
  6. DomainName : '',
  7. RegistrantProfileId : '',
  8. }
  9. ],
  10. searchParam : {
  11. domain : '',
  12. status : '',
  13. },
  14. pagination:{
  15. page_total: 1,
  16. page_rows:20,
  17. p:1,
  18. nowPage:1,
  19. },
  20. tableData : [],//表格数据
  21. result : '',
  22. modelTitle : '',
  23. modelValue : '',
  24. appList : [],
  25. checkboxChecked : [],
  26. isBatch : true,//是否批量解析域名
  27. status : ['部分失败','全部失败','提交中','成功']//-2 部分失败, -1 全部失败, 0 提交中, 1 成功
  28. },
  29. created: function(){
  30. },
  31. components:{
  32. 'Selectd': componentSelect,
  33. 'Options': componentOption,
  34. 'Pagination': componentPage,
  35. },
  36. methods: {
  37. init: function(){
  38. showLoading();
  39. var _this = this;
  40. var data = {
  41. domain : this.searchParam.domain,
  42. status : this.searchParam.status,
  43. page : this.pagination.p,
  44. }
  45. getAjax(data, 'post', ' /api/taskList', function(result){
  46. _this.result = result;
  47. _this.tableData = result.data;
  48. _this.pagination.page_total = result.page.Count * 1
  49. hideLoading();
  50. });
  51. },
  52. // 分页
  53. nowPage:function(page, page_rows){
  54. this.pagination.p = page;
  55. this.pagination.page_rows = page_rows;
  56. this.init();
  57. },
  58. /**
  59. * 重启
  60. * @param {[json]} item [任务相关信息]
  61. * @return {[type]} [description]
  62. */
  63. restart(item){
  64. var _this = this;
  65. var task_no = item.RegisterTask.task_no
  66. getAjax({task_no:task_no}, 'post', '/api/registerDomain', function(result){
  67. weile.F.alert('重启成功');
  68. $('#_global_modal_alert').on('hide.bs.modal', function () {
  69. _this.init();
  70. })
  71. });
  72. },
  73. /**
  74. * 刷新
  75. * @param {[json]} item [任务相关信息]
  76. */
  77. refresh(item){
  78. var _this = this;
  79. var task_no = item.RegisterTask.task_no
  80. getAjax({taskno:task_no}, 'post', '/api/queryTaskDetailList', function(result){
  81. weile.F.alert('刷新成功');
  82. $('#_global_modal_alert').on('hide.bs.modal', function () {
  83. _this.init();
  84. })
  85. });
  86. },
  87. },
  88. mounted: function(){
  89. this.init();
  90. },
  91. })