AdminDubboService.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <el-container>
  3. <el-header height="220">
  4. <el-row style="margin-top: 10px">
  5. <el-select
  6. v-model="queryInfo.path"
  7. clearable
  8. placeholder="查询条件"
  9. style="margin-left: 5px"
  10. @change="onSelectChange"
  11. >
  12. <el-option v-for="(item, index) in tableList" :key="index" :label="item" :value="item" />
  13. </el-select>
  14. </el-row>
  15. <el-row style="margin-top: 10px">
  16. <el-tag v-for="(item, index) in tableList" :key="index" style="margin-left: 5px" :type="'warning'" disable-transitions>
  17. {{ item }}
  18. </el-tag>
  19. </el-row>
  20. </el-header>
  21. <el-main>
  22. <el-table
  23. :data="dataList"
  24. border
  25. style="width: 100%"
  26. >
  27. <el-table-column
  28. fixed="left"
  29. label="No"
  30. type="index"
  31. />
  32. <el-table-column
  33. prop="application"
  34. label="应用"
  35. />
  36. <el-table-column
  37. prop="total"
  38. label="节点数量"
  39. />
  40. <el-table-column
  41. prop="hostPorts"
  42. label="节点地址"
  43. />
  44. <el-table-column
  45. prop="role"
  46. label="角色"
  47. />
  48. <el-table-column
  49. fixed="right"
  50. label="操作"
  51. width="280"
  52. >
  53. <template slot-scope="scope">
  54. <el-button
  55. size="mini"
  56. @click="handleEdit(scope.$index, scope.row)"
  57. >编辑</el-button>
  58. <el-button
  59. size="mini"
  60. type="danger"
  61. @click="handleDelete(scope.$index, scope.row)"
  62. >删除</el-button>
  63. </template>
  64. </el-table-column>
  65. </el-table>
  66. </el-main>
  67. <!-- 修改视频可见范围对话框 -->
  68. <el-dialog
  69. append-to-body
  70. :visible.sync="showEditScopeDialog"
  71. width="30%"
  72. center
  73. >
  74. <el-card class="box-card">
  75. <div slot="header" class="clearfix">
  76. <span>修改视频可见范围</span>
  77. <el-button style="float: right; padding: 3px 0" type="text" @click="onUpdateScope">更新</el-button>
  78. </div>
  79. <div class="text item">
  80. <el-select v-model="form.scope" placeholder="选择可见范围">
  81. <el-option label="本人可见" value="1" />
  82. <el-option label="所有人可见" value="2" />
  83. <el-option label="VIP 可见" value="3" />
  84. <el-option label="验证码可见" value="4" />
  85. </el-select>
  86. </div>
  87. </el-card>
  88. </el-dialog>
  89. </el-container>
  90. </template>
  91. <script>
  92. import { getDubboList, getZkList, getZkService } from '@/api/tnb'
  93. export default {
  94. name: 'AdminDubboService',
  95. data() {
  96. return {
  97. queryInfo: {
  98. path: null
  99. },
  100. // 屏幕宽度, 为了控制分页条的大小
  101. screenWidth: document.body.clientWidth,
  102. currentPage: 1,
  103. pageSize: 12,
  104. totalSize: 0,
  105. dataList: [],
  106. nextId: 0,
  107. tableList: [],
  108. // **********************************************************************
  109. showEditScopeDialog: false,
  110. form: {
  111. videoId: null,
  112. scope: 1
  113. }
  114. }
  115. },
  116. created() {
  117. document.title = 'Dubbo 服务'
  118. this.getData()
  119. },
  120. methods: {
  121. getData() {
  122. this.dataList = []
  123. getZkList().then(resp => {
  124. if (resp.code === 0) {
  125. this.tableList = resp.data
  126. }
  127. })
  128. getDubboList().then(resp => {
  129. if (resp.code === 0) {
  130. this.dataList = resp.data
  131. }
  132. })
  133. },
  134. onRefresh() {
  135. this.getData()
  136. },
  137. handleCurrentChange(pageNumber) {
  138. this.currentPage = pageNumber
  139. this.getData()
  140. // 回到顶部
  141. scrollTo(0, 0)
  142. },
  143. handleEdit(index, row) {
  144. this.$message.info('handleEdit')
  145. },
  146. handleDelete(index, row) {
  147. this.$confirm('确定要删除 ' + row.title + '?', '提示', {
  148. confirmButtonText: '确定',
  149. cancelButtonText: '取消',
  150. type: 'warning'
  151. }).then(() => {
  152. this.$message.info('handleDelete')
  153. }).catch(() => {
  154. this.$message({
  155. type: 'info',
  156. message: '已取消'
  157. })
  158. })
  159. },
  160. onUpdateScope() {
  161. this.showEditScopeDialog = false
  162. },
  163. onSelectChange() {
  164. this.dataList = []
  165. getZkService(this.queryInfo).then(resp => {
  166. if (resp.code === 0) {
  167. this.dataList = resp.data
  168. }
  169. })
  170. },
  171. handleClose() {
  172. }
  173. }
  174. }
  175. </script>
  176. <style>
  177. </style>