Knowledge4.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <div class="knowledge-4">
  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">
  13. <button class="btn green" @click="onClickSearch">搜索</button>
  14. </div>
  15. </div>
  16. <div>
  17. <ComTable :data="tableData" height="85vh"></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: "station",
  33. is_num: true,
  34. is_light: false,
  35. },
  36. {
  37. name: "位置",
  38. field: "location",
  39. is_num: false,
  40. is_light: false,
  41. },
  42. {
  43. name: "工作内容",
  44. field: "content",
  45. is_num: false,
  46. is_light: false,
  47. },
  48. {
  49. name: "描述",
  50. field: "describe",
  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: "state",
  63. is_num: false,
  64. is_light: false,
  65. },
  66. ],
  67. data: [],
  68. },
  69. };
  70. },
  71. created() {
  72. this.requestSafeList();
  73. },
  74. methods: {
  75. // 搜索按钮
  76. onClickSearch() {
  77. this.requestSafeList();
  78. },
  79. requestSafeList() {
  80. let that = this;
  81. this.API.requestData({
  82. method: "GET",
  83. baseURL: "http://10.155.32.4:8034/",
  84. subUrl: "/experienceBase/zyzdzs",
  85. data: {
  86. name: that.content,
  87. pageNum: 1,
  88. pageSize: 1000,
  89. }, // 请求所携带参数,默认为空,可缺省
  90. success(res) {
  91. if (res.code == 200) {
  92. that.tableData.data = [];
  93. res.data.forEach((item) => {
  94. item.addtime = new Date(item.addtime).formatDate("yyyy-MM-dd hh:mm:ss")
  95. that.tableData.data.push(item);
  96. });
  97. }
  98. },
  99. });
  100. },
  101. },
  102. };
  103. </script>
  104. <style lang="less" scope>
  105. @titleGray: #9ca5a8;
  106. @rowGray: #606769;
  107. @darkBack: #536268;
  108. .knowledge-4 {
  109. .el-select {
  110. width: 200px;
  111. }
  112. .el-input {
  113. width: 200px;
  114. }
  115. }
  116. </style>