index.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <template>
  2. <div class="rules">
  3. <on-line v-if="type == 'onLine' || !type" :dataList="dataList" />
  4. <off-line v-if="type == 'offLine' || !type" :dataList="dataList" />
  5. <vip-off-line v-if="type == 'vipOffLine' || !type" :dataList="dataList" />
  6. </div>
  7. </template>
  8. <script>
  9. import { sysTenantConfig } from './api'
  10. import setLoading from '@/utils/loading'
  11. import OnLine from './components/onLine'
  12. import OffLine from './components/offLine'
  13. import vipOffLine from './components/vipOffLine'
  14. export default {
  15. components: { OnLine, OffLine, vipOffLine },
  16. data() {
  17. let query = this.$route.query
  18. return {
  19. type: query.type || null,
  20. dataList: {}
  21. }
  22. },
  23. mounted() {
  24. let params = this.$route.query
  25. if(params.Authorization) {
  26. localStorage.setItem('Authorization', decodeURI(params.Authorization))
  27. localStorage.setItem('userInfo', decodeURI(params.Authorization))
  28. }
  29. document.title = '规则'
  30. this.__init()
  31. },
  32. methods: {
  33. async __init() {
  34. try {
  35. let offRes = await await sysTenantConfig({ group: "OFFLINE" })
  36. const offData = offRes.data || []
  37. offData.forEach(off => {
  38. this.dataList[off.paramName] = off.paranValue
  39. });
  40. let onRes = await await sysTenantConfig({ group: "ONLINE" })
  41. const forwardRes = await sysTenantConfig({ group: "DAYA_BASIC" });
  42. const onData = onRes.data || []
  43. onData.forEach(on => {
  44. this.dataList[on.paramName] = on.paranValue
  45. })
  46. const forwardData = forwardRes.data || []
  47. forwardData.forEach(forward => {
  48. this.dataList[forward.paramName] = forward.paranValue
  49. })
  50. } catch(e) {}
  51. }
  52. }
  53. }
  54. </script>
  55. <style lang="less" scoped>
  56. .rules {
  57. background: #ffffff;
  58. }
  59. table {
  60. border: 0;
  61. font-size: 12px;
  62. border-color: #cccccc;
  63. th {
  64. text-align: center;
  65. }
  66. th, td {
  67. padding: 5px;
  68. }
  69. tr:nth-child(even) {
  70. background-color: #f1f1f1;
  71. }
  72. }
  73. table + table {
  74. margin-top: .15rem;
  75. }
  76. .r {
  77. color: red;
  78. }
  79. </style>