Knowledge7.vue 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <template>
  2. <div class="knowledge-7">
  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-select
  9. v-model="level"
  10. placeholder="请选择"
  11. popper-class="select"
  12. >
  13. <el-option
  14. v-for="item in levels"
  15. :key="item"
  16. :label="item"
  17. :value="item"
  18. >
  19. </el-option>
  20. </el-select>
  21. </div>
  22. </div>
  23. <div class="query-item">
  24. <div class="lable">报警类型:</div>
  25. <div class="search-input">
  26. <el-select
  27. v-model="warning"
  28. placeholder="请选择"
  29. popper-class="select"
  30. >
  31. <el-option
  32. v-for="item in warnings"
  33. :key="item"
  34. :label="item"
  35. :value="item"
  36. >
  37. </el-option>
  38. </el-select>
  39. </div>
  40. </div>
  41. <div class="query-item">
  42. <div class="lable">查询内容:</div>
  43. <div class="search-input">
  44. <el-input v-model="content" placeholder="请输入查询内容"></el-input>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="query-actions">
  49. <button class="btn green" @click="onClickSearch">搜索</button>
  50. </div>
  51. </div>
  52. <div>
  53. <ComTable :data="tableData" height="85vh"></ComTable>
  54. </div>
  55. </div>
  56. </template>
  57. <script>
  58. import ComTable from "@com/coms/table/table.vue";
  59. import api from "@api/maintenance/expertKnowledge/index.js";
  60. export default {
  61. components: { ComTable },
  62. data() {
  63. const that = this
  64. return {
  65. level: "",
  66. levels: ["5级","4级","3级","2级","1级"],
  67. warning: "",
  68. warnings: ["1类","2类","3类","4类","5类"],
  69. content: '',
  70. tableData: {
  71. column: [
  72. {
  73. name: "编码",
  74. field: "id",
  75. is_num: true,
  76. is_light: false,
  77. },
  78. {
  79. name: "名称",
  80. field: "name",
  81. is_num: false,
  82. is_light: false,
  83. },
  84. {
  85. name: "表达式",
  86. field: "expression",
  87. is_num: false,
  88. is_light: false,
  89. },
  90. {
  91. name: "级别",
  92. field: "rank",
  93. is_num: false,
  94. is_light: false,
  95. },
  96. {
  97. name: "报警类型",
  98. field: "category",
  99. is_num: false,
  100. is_light: false,
  101. },
  102. {
  103. name: "描述",
  104. field: "description",
  105. is_num: false,
  106. is_light: false,
  107. },
  108. {
  109. name: "范围",
  110. field: "modelid",
  111. is_num: false,
  112. is_light: false,
  113. },
  114. // {
  115. // name: "操作",
  116. // field: "",
  117. // is_num: false,
  118. // is_light: false,
  119. // template() {
  120. // return "<el-button type='text' style='cursor: pointer;'>查看</el-button>";
  121. // },
  122. // click(e, row) {
  123. // that.getInformation(row);
  124. // },
  125. // },
  126. ],
  127. data: [],
  128. },
  129. };
  130. },
  131. created() {
  132. this.level = this.levels[0];
  133. this.warning = this.warnings[0];
  134. this.requestWarnList();
  135. },
  136. methods: {
  137. // 搜索按钮
  138. onClickSearch() {
  139. this.requestWarnList();
  140. },
  141. // 查看详情
  142. getInformation(item){
  143. },
  144. requestWarnList() {
  145. api
  146. .earlyKnowledge({
  147. gzjb: this.level.substring(0,1),
  148. bjlx: this.warning.substring(0,1),
  149. cxnr: this.content,
  150. pageNum: 1,
  151. pageSize: 1000,
  152. })
  153. .then((res) => {
  154. if (res.code == 200) {
  155. this.tableData.data = res.data;
  156. }
  157. });
  158. // let that = this;
  159. // this.API.requestData({
  160. // method: "GET",
  161. // baseURL: "http://10.155.32.4:8034/",
  162. // subUrl: "/experienceBase/yjzs",
  163. // data: {
  164. // gzjb: that.level.substring(0,1),
  165. // bjlx: that.warning.substring(0,1),
  166. // cxnr: that.content,
  167. // pageNum: 1,
  168. // pageSize: 1000,
  169. // }, // 请求所携带参数,默认为空,可缺省
  170. // success(res) {
  171. // if (res.code == 200) {
  172. // that.tableData.data = res.data;
  173. // }
  174. // },
  175. // });
  176. },
  177. },
  178. };
  179. </script>
  180. <style lang="less" scope>
  181. @titleGray: #9ca5a8;
  182. @rowGray: #606769;
  183. @darkBack: #536268;
  184. .knowledge-7 {
  185. .query-item {
  186. width: 250px;
  187. }
  188. }
  189. </style>