parameterManagement.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <!--参数管理-->
  2. <template>
  3. <div>
  4. <div v-show="!$route.path.includes('parameterDetail')">
  5. <search-layout :needBox="true">
  6. <template slot="searchItem1">
  7. <span class="label">账户名称</span>
  8. <el-input v-model="searchParams.userName" size="small" clearable placeholder="请输入" maxlength="60"
  9. @keyup.enter.native="doSearch(false)">
  10. </el-input>
  11. </template>
  12. <template slot="searchBtn1">
  13. <el-button type="primary" @click="doSearch(false)">查询</el-button>
  14. </template>
  15. <template slot="searchBtn2">
  16. <el-button type="primary" @click="doReset">重置</el-button>
  17. </template>
  18. </search-layout>
  19. <div class="myTabsBox myTabsBoxThreeTabs">
  20. <!--<el-button
  21. v-bind:class="{ addBtn: true}"
  22. icon="el-icon-circle-plus-outline"
  23. @click="addOne"
  24. type="primary"
  25. >新增参数配置</el-button
  26. >-->
  27. </div>
  28. <tableList ref="table" style="margin: 0 30px" :columns="columns" :getDataWay="getDataWay"
  29. :pagination="pagination" index>
  30. <el-table-column label="操作" slot="cgInfos" align="center">
  31. <template v-slot="scope">
  32. <i @click="editRow(scope.row)" class="el-icon-edit-outline elIcon" title="编辑"></i>
  33. <!--<i
  34. @click="delOne(scope.row)"
  35. class="el-icon-delete elIcon"
  36. title="删除"
  37. ></i>-->
  38. </template>
  39. </el-table-column>
  40. </tableList>
  41. </div>
  42. <router-view v-show="$route.path.includes('parameterDetail')"></router-view>
  43. </div>
  44. </template>
  45. <script>
  46. import searchLayout from "@/components/grid/searchLayout";
  47. import tableList from "@/components/grid/TableList";
  48. export default {
  49. name: "parameterManagement", // 参数管理
  50. components: { searchLayout, tableList },
  51. data() {
  52. return {
  53. searchParams: {
  54. //搜索参数
  55. userName: ''
  56. },
  57. getDataWay: {
  58. dataType: "url",
  59. type: "post",
  60. data: this.$api.systemManagement.getParameterList,
  61. param: {},
  62. },
  63. columns: [
  64. //表格列
  65. {
  66. label: "账户名称",
  67. prop: "userName",
  68. },
  69. {
  70. label: "可创建子账户数量",
  71. prop: "numCreateUser",
  72. },
  73. {
  74. label: "最多可创建场景测试包数量",
  75. prop: "numCreateScenePackage",
  76. },
  77. {
  78. label: "场景数量包的最大场景数",
  79. prop: "numScenePerPackage",
  80. },
  81. {
  82. label: "操作时间",
  83. prop: "createTime",
  84. formatter: (data) => {
  85. return this.$timeFormatter(data.createTime)
  86. }
  87. },
  88. {
  89. label: "操作",
  90. prop: "cgInfos",
  91. template: true
  92. }
  93. ],
  94. pagination: {
  95. //分页使用
  96. currentPage: 1,
  97. pageSize: 10,
  98. position: "right",
  99. pageSizes: [10, 30, 50, 100, 200],
  100. layout: "sizes, total, prev, pager, next, jumper",
  101. },
  102. };
  103. },
  104. watch: {
  105. $route(to, from) {
  106. if (to.name === "parameterManagement") {
  107. this.$nextTick(() => {
  108. this.doSearch(true);
  109. });
  110. }
  111. },
  112. },
  113. methods: {
  114. // isBack为解决从详情回退时列表在当前页刷新
  115. doSearch(isBack = false) {
  116. let pageMap = {
  117. ...this.searchParams,
  118. resetPageNum: !isBack ? false : (this.pagination.currentPage || 1),
  119. };
  120. if (!isBack) this.pagination.currentPage = 1;
  121. this.refreshList(pageMap);
  122. },
  123. refreshList(param) {
  124. param
  125. ? this.$refs["table"].loadData(param)
  126. : this.$refs["table"].loadData();
  127. },
  128. doReset() {
  129. this.searchParams = {
  130. userName: ''
  131. };
  132. this.doSearch();
  133. },
  134. addOne() {
  135. this.$router.push("/parameterDetail")
  136. },
  137. editRow(row) {
  138. this.$store.commit("getTabname", "parameterDetailTabName", row.userName);
  139. localStorage.setItem("parameterDetailTabName", row.userName);
  140. let query = { ...row }
  141. this.$router.push({
  142. path: 'parameterDetail',
  143. query
  144. })
  145. },
  146. delOne(row) {
  147. this.$confirm("确认是否删除?", "提示", {
  148. confirmButtonText: "确定",
  149. cancelButtonText: "取消",
  150. type: "warning",
  151. }).then(() => {
  152. });
  153. },
  154. },
  155. }
  156. </script>
  157. <style scoped lang="less">
  158. .tabsBox {
  159. position: relative;
  160. overflow: hidden;
  161. .el-button {
  162. position: absolute;
  163. right: 40px;
  164. top: 45px;
  165. }
  166. }
  167. .myTabsBox {
  168. min-height: 29px;
  169. }
  170. </style>