devops.js 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. var vm = new Vue({
  2. el: '#app',
  3. data: {
  4. password1enabled: true,
  5. password1: "",
  6. password2enabled: false,
  7. password2: "",
  8. },
  9. mounted() {
  10. this.getPasswords();
  11. },
  12. methods: {
  13. getPasswords() {
  14. let _this = this
  15. axios
  16. .get('/DevOps/GetCimPasswords')
  17. .then(function (response) {
  18. for (var i = 0; i < response.data.length; i++) {
  19. if (response.data[i].no === 1) {
  20. _this.password1enabled = response.data[i].enabled;
  21. _this.password1 = response.data[i].password;
  22. } else if (response.data[i].no === 2) {
  23. _this.password2enabled = response.data[i].enabled;
  24. _this.password2 = response.data[i].password;
  25. }
  26. }
  27. })
  28. .catch(function (error) {
  29. console.log(error)
  30. });
  31. },
  32. savePassword1() {
  33. let _this = this
  34. axios
  35. .post('/DevOps/SetCimPassword', {
  36. No: 1,
  37. Password: _this.password1,
  38. Enabled: _this.password1enabled
  39. })
  40. .then(function (response) {
  41. result = response.data;
  42. if (result.code === 0) {
  43. alert("保存成功!");
  44. } else if (result.code === 1) {
  45. alert("执行失败:" + result.message);
  46. }
  47. })
  48. .catch(function (error) {
  49. console.log(error)
  50. });
  51. },
  52. savePassword2() {
  53. let _this = this
  54. axios
  55. .post('/DevOps/SetCimPassword', {
  56. No: 2,
  57. Password: _this.password2,
  58. Enabled: _this.password2enabled
  59. })
  60. .then(function (response) {
  61. result = response.data;
  62. if (result.code === 0) {
  63. alert("保存成功!");
  64. } else if (result.code === 1) {
  65. alert("执行失败:" + result.message);
  66. }
  67. })
  68. .catch(function (error) {
  69. console.log(error)
  70. });
  71. },
  72. clearElectricEnergyCache() {
  73. axios
  74. .post('/EnergyConsumptionMeterCheck/ClearElectricEnergyCache', )
  75. .then(function (response) {
  76. result = response.data;
  77. if (result.code === 0) {
  78. alert("执行成功!");
  79. } else if (result.code === 1) {
  80. alert("执行失败:" + result.message);
  81. }
  82. })
  83. .catch(function (error) {
  84. console.log(error)
  85. });
  86. },
  87. initElectricEnergyList() {
  88. axios
  89. .post('/EnergyConsumptionMeterCheck/InitMeters',)
  90. .then(function (response) {
  91. result = response.data;
  92. if (result.code === 0) {
  93. alert("执行成功!");
  94. } else if (result.code === 1) {
  95. alert("执行失败:" + result.message);
  96. }
  97. })
  98. .catch(function (error) {
  99. console.log(error)
  100. });
  101. },
  102. exampleInputFile() {
  103. }
  104. }
  105. })