76bfb59dc1a3af8ce6fed2472bbcc9b6f9ca2808.svn-base 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <!--<template>-->
  2. <!-- <a-card :bordered="false" style="height: 100%">-->
  3. <!-- <div style="padding-bottom: 2px">-->
  4. <!-- <a-alert type="warning" show-icon>-->
  5. <!-- <div slot="message" style="width: 100%">-->
  6. <!-- <span>路由配置请慎重</span>-->
  7. <!-- <span style="display:inline-block;float:right;padding-right: 5px">-->
  8. <!-- <a @click="clearRedis"><a-icon type="reload" />清除缓存</a>-->
  9. <!-- </span>-->
  10. <!-- </div>-->
  11. <!-- </a-alert>-->
  12. <!-- </div>-->
  13. <!-- <div :id="eleId" :style="{ height: editorHeight + 'px', width: '100%' }"></div>-->
  14. <!-- <div style="text-align: center;padding-top:10px">-->
  15. <!-- <a-button type="primary" @click="submitForm" style="width:160px">保存</a-button>-->
  16. <!-- </div>-->
  17. <!-- </a-card>-->
  18. <!--</template>-->
  19. <!--<script>-->
  20. <!-- import JsonEditor from 'jsoneditor'-->
  21. <!-- import 'jsoneditor/dist/jsoneditor.min.css'-->
  22. <!-- import { getAction, postAction } from '@/api/manage'-->
  23. <!-- export default {-->
  24. <!-- name: "SysGatewayRouteList",-->
  25. <!-- data () {-->
  26. <!-- return {-->
  27. <!-- eleId:'jsoneditor',-->
  28. <!-- description: 'gateway路由管理管理页面',-->
  29. <!-- editor: null,-->
  30. <!-- editorWidth:400,-->
  31. <!-- editorHeight:500,-->
  32. <!-- url:{-->
  33. <!-- list: '/sys/gatewayRoute/list',-->
  34. <!-- update: '/sys/gatewayRoute/updateAll',-->
  35. <!-- clear: '/sys/gatewayRoute/clearRedis'-->
  36. <!-- },-->
  37. <!-- }-->
  38. <!-- },-->
  39. <!-- created() {-->
  40. <!-- let winWidth = window.innerWidth;-->
  41. <!-- console.log("页面宽度",winWidth)-->
  42. <!-- this.editorWidth = winWidth-->
  43. <!-- },-->
  44. <!-- mounted(){-->
  45. <!-- this.initJsonEditor();-->
  46. <!-- },-->
  47. <!-- methods: {-->
  48. <!-- initJsonEditor() {-->
  49. <!-- let container = document.getElementById(this.eleId);-->
  50. <!-- let options = {-->
  51. <!-- modes: ['text', 'code', 'tree', 'form', 'view'],-->
  52. <!-- mode: 'tree',-->
  53. <!-- ace: ace,-->
  54. <!-- sortObjectKeys: 'code',-->
  55. <!-- mainMenuBar:['format']-->
  56. <!-- };-->
  57. <!-- this.editor = new JsonEditor(container, options);-->
  58. <!-- this.initRouteData();-->
  59. <!-- },-->
  60. <!-- initRouteData(){-->
  61. <!-- getAction(this.url.list).then(res=>{-->
  62. <!-- if(res.success){-->
  63. <!-- let array = res.result-->
  64. <!-- console.log('当前路由配置信息为', array)-->
  65. <!-- this.editor.set(array)-->
  66. <!-- }-->
  67. <!-- })-->
  68. <!-- },-->
  69. <!-- // 获取json-->
  70. <!-- submitForm() {-->
  71. <!-- let text = this.editor.getText()-->
  72. <!-- console.log("保存的json数据",text)-->
  73. <!-- if(!text || text.length<=0 || text=='{}' || text=='[]'){-->
  74. <!-- this.$message.warning('未录入任何信息')-->
  75. <!-- return ;-->
  76. <!-- }-->
  77. <!-- postAction(this.url.update,{-->
  78. <!-- routes:text-->
  79. <!-- }).then(res=>{-->
  80. <!-- if(res.success){-->
  81. <!-- this.$message.success(res.message)-->
  82. <!-- }else{-->
  83. <!-- this.$message.error(res.message)-->
  84. <!-- }-->
  85. <!-- })-->
  86. <!-- },-->
  87. <!-- clearRedis(){-->
  88. <!-- getAction(this.url.clear).then(res=>{-->
  89. <!-- if(res.success){-->
  90. <!-- this.$message.success(res.message)-->
  91. <!-- }-->
  92. <!-- })-->
  93. <!-- }-->
  94. <!-- }-->
  95. <!-- }-->
  96. <!--</script>-->