Knowledge2.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <div class="knowledge-2">
  3. <div class="query mg-b-8">
  4. <div class="query-items">
  5. <div class="query-item">
  6. <div class="lable">查询内容:</div>
  7. <div class="search-input">
  8. <el-input v-model="content" placeholder="请输入查询内容"></el-input>
  9. </div>
  10. </div>
  11. </div>
  12. <div class="query-actions" style="margin-right: 1500px">
  13. <button class="btn green" @click="onClickSearch">搜索</button>
  14. </div>
  15. </div>
  16. <div>
  17. <ComTable :data="tableData"></ComTable>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import ComTable from "@com/coms/table/table.vue";
  23. export default {
  24. components: { ComTable },
  25. data() {
  26. return {
  27. content: "",
  28. tableData: {
  29. column: [
  30. {
  31. name: "序号",
  32. field: "id",
  33. is_num: true,
  34. is_light: false,
  35. },
  36. {
  37. name: "按错内容",
  38. field: "safecontent",
  39. is_num: false,
  40. is_light: false,
  41. },
  42. {
  43. name: "故障按错内容描述",
  44. field: "describe",
  45. is_num: false,
  46. is_light: false,
  47. },
  48. {
  49. name: "负责人",
  50. field: "principal",
  51. is_num: false,
  52. is_light: false,
  53. },
  54. {
  55. name: "添加时间",
  56. field: "addtime",
  57. is_num: false,
  58. is_light: false,
  59. },
  60. {
  61. name: "类型",
  62. field: "type",
  63. is_num: false,
  64. is_light: false,
  65. },
  66. {
  67. name: "其他",
  68. field: "other",
  69. is_num: false,
  70. is_light: false,
  71. },
  72. ],
  73. data: [],
  74. },
  75. };
  76. },
  77. created() {
  78. this.requestSafeList();
  79. },
  80. methods: {
  81. // 搜索按钮
  82. onClickSearch() {
  83. this.requestSafeList();
  84. },
  85. // 获取按错内容
  86. requestSafeList() {
  87. let that = this;
  88. this.API.requestData({
  89. method: "GET",
  90. baseURL: "http://10.155.32.4:8034/",
  91. subUrl: "/experienceBase/aqcszs",
  92. data: {
  93. name: that.content,
  94. pageNum: 1,
  95. pageSize: 1000,
  96. }, // 请求所携带参数,默认为空,可缺省
  97. success(res) {
  98. if (res.code == 200) {
  99. that.tableData.data = [];
  100. let data = res.data;
  101. for (var i = 0; i < data.length; i++) {
  102. let obj = {
  103. id: i + 1,
  104. safecontent: data[i].safecontent,
  105. describe: data[i].describe,
  106. principal: data[i].principal,
  107. addtime: new Date(data[i].addtime).formatDate("yyyy-MM-dd"),
  108. type: data[i].type,
  109. other: data[i].other,
  110. };
  111. that.tableData.data.push(obj);
  112. }
  113. }
  114. },
  115. });
  116. },
  117. },
  118. };
  119. </script>
  120. <style lang="less" scope>
  121. @titleGray: #9ca5a8;
  122. @rowGray: #606769;
  123. @darkBack: #536268;
  124. .knowledge-2 {
  125. .el-select {
  126. width: 200px;
  127. }
  128. .el-input {
  129. width: 200px;
  130. }
  131. }
  132. </style>