ledger.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <basic-container class="list">
  3. <div class="flex">
  4. <el-select
  5. v-model="searchForm.projectId"
  6. filterable
  7. style="width: 300px"
  8. placeholder="请选择项目"
  9. clearable
  10. @change="listpage"
  11. >
  12. <el-option
  13. v-for="item in options"
  14. :key="item.id"
  15. :label="item.projectName"
  16. :value="item.id"
  17. >
  18. </el-option>
  19. </el-select>
  20. <el-select
  21. v-model="searchForm.range"
  22. filterable
  23. style="width: 200px;margin-left: 10px;margin-right: 10px"
  24. placeholder="同步范围"
  25. clearable
  26. @change="listpage"
  27. >
  28. <el-option
  29. v-for="item in rangeOptions"
  30. :key="item.id"
  31. :label="item.dictValue"
  32. :value="item.dictKey"
  33. ></el-option>
  34. </el-select>
  35. <el-select
  36. v-model="searchForm.type"
  37. filterable
  38. style="width: 200px;margin-right: 10px"
  39. placeholder="同步类型"
  40. clearable
  41. @change="listpage"
  42. >
  43. <el-option
  44. v-for="item in typeOptions"
  45. :key="item.id"
  46. :label="item.dictValue"
  47. :value="item.dictKey"
  48. >
  49. </el-option>
  50. </el-select>
  51. <el-button type="info" class="el-icon-close" @click="reSearchClick"
  52. >重置</el-button
  53. >
  54. </div>
  55. <el-table
  56. class="martop20 tableList"
  57. :data="tableData"
  58. header-color="red"
  59. style="width: 100%"
  60. >
  61. <el-table-column type="index" label="序号" width="180"> </el-table-column>
  62. <el-table-column prop="projectName" label="项目">
  63. </el-table-column>
  64. <el-table-column prop="rangeName" label="同步范围">
  65. </el-table-column>
  66. <el-table-column prop="templateName" label="同步源">
  67. </el-table-column>
  68. <el-table-column prop="typeName" label="同步类型">
  69. </el-table-column>
  70. <el-table-column prop="nodeName" label="同步节点">
  71. </el-table-column>
  72. <el-table-column prop="createUser" label="同步人">
  73. </el-table-column>
  74. <el-table-column prop="createTime" label="同步时间">
  75. </el-table-column>
  76. </el-table>
  77. <el-pagination
  78. style="float:right"
  79. background
  80. class="martop10 marbottom10"
  81. layout="total, prev, pager, next"
  82. :total="total"
  83. @size-change="handleSizeChange"
  84. @current-change="handleCurrentChange"
  85. :current-page.sync="pageindex"
  86. :page-size="pagesize"
  87. :page-sizes="[10, 20, 30, 40]"
  88. >
  89. </el-pagination>
  90. </basic-container>
  91. </template>
  92. <script>
  93. import { getDictionary } from "@/api/system/dict";
  94. import { getProjectList } from "@/api/manager/projectinfo";
  95. import { page } from "@/api/manager/ledger";
  96. export default {
  97. data() {
  98. return {
  99. searchForm: {
  100. projectId: "",
  101. range: "",
  102. type: "",
  103. },
  104. options: [],
  105. rangeOptions: [],
  106. typeOptions: [],
  107. tableData: [],
  108. total: 0,
  109. pageindex: 1,
  110. pagesize: 20,
  111. };
  112. },
  113. methods: {
  114. getRangeOptions(){
  115. getDictionary({
  116. code: "wbs_snyc_range",
  117. }).then((res) => {
  118. this.rangeOptions = res.data.data;
  119. });
  120. },
  121. getTypeOptions(){
  122. getDictionary({
  123. code: "wbs_sync_type",
  124. }).then((res) => {
  125. this.typeOptions = res.data.data;
  126. });
  127. },
  128. handleSizeChange(val) {
  129. this.pagesize = val;
  130. this.listpage();
  131. },
  132. handleCurrentChange(val) {
  133. this.pageindex = val;
  134. this.listpage();
  135. },
  136. typeChange() {
  137. this.listpage();
  138. },
  139. projectChange() {
  140. this.listpage();
  141. },
  142. async queryProjectList() {
  143. //获取所有项目
  144. const { data: res } = await getProjectList();
  145. if (res.code == 200) {
  146. this.options = res.data.records;
  147. }
  148. },
  149. async listpage() {
  150. //分页获取证书列表数据
  151. const { data: res } = await page({
  152. current: this.pageindex,
  153. size: this.pagesize,
  154. ...this.searchForm,
  155. });
  156. if (res.code == 200) {
  157. this.tableData = res.data.records;
  158. this.total = res.data.total;
  159. }
  160. },
  161. reSearchClick() {
  162. this.searchForm = {
  163. projectId: "",
  164. range: "",
  165. type: "",
  166. };
  167. this.listpage();
  168. },
  169. //#endregion
  170. },
  171. created() {
  172. this.queryProjectList();
  173. this.getRangeOptions();
  174. this.getTypeOptions()
  175. this.listpage();
  176. },
  177. };
  178. </script>
  179. <style lang="scss" scoped>
  180. .tableList {
  181. ::v-deep th.el-table__cell {
  182. font-size: 16px !important;
  183. }
  184. }
  185. .header-box-center {
  186. margin-left: 40px;
  187. }
  188. </style>