diagnose.vue 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <div>
  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 v-model="station" placeholder="请选择" popper-class="select" @change="stationChange">
  9. <el-option v-for="item in stations" :key="item.id" :value="item.id" :label="item.name">
  10. </el-option>
  11. </el-select>
  12. </div>
  13. </div>
  14. <div class="query-item">
  15. <div class="lable">风机型号:</div>
  16. <div class="search-input">
  17. <el-select v-model="model" multiple collapse-tags clearable placeholder="请选择"
  18. popper-class="select">
  19. <el-option v-for="item in fjxh" :key="item.value" :value="item.value" :label="item.label">
  20. </el-option>
  21. </el-select>
  22. </div>
  23. </div>
  24. <div class="query-item">
  25. <div class="lable">风机:</div>
  26. <div class="search-input">
  27. <el-select v-model="fj" collapse-tags placeholder="请选择" popper-class="select">
  28. <el-option v-for="item in fjArr" :key="item.id" :value="item.id" :label="item.name">
  29. </el-option>
  30. </el-select>
  31. </div>
  32. </div>
  33. <div class="query-actions">
  34. <button class="btn" @click="query">查询</button>
  35. </div>
  36. </div>
  37. </div>
  38. <el-row type="flex">
  39. <el-col :span="12">
  40. <el-row type="flex">
  41. <el-col :span="12">
  42. <div style="height: 60vh; overflow-y: auto; margin-top: 30px">
  43. <div class="body" v-for="(item, index) in ccS" :key="index" @click="chooses(index)" >
  44. <div class="left">
  45. <div :class="index === current ? 'round_on' : 'round'"></div>
  46. <div class="line"></div>
  47. </div>
  48. <div class="right">
  49. <div>{{ item.showTime }}</div>
  50. <div class="content">
  51. <div class="names">
  52. {{ item.showName || item.ducumentName }}
  53. </div>
  54. <button class="btn" @click="deleteDate(item.name)">
  55. 删除
  56. </button>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </el-col>
  62. <el-col :span="12">
  63. </el-col>
  64. </el-row>
  65. </el-col>
  66. </el-row>
  67. </div>
  68. </template>
  69. <script>
  70. export default {
  71. components: {
  72. },
  73. created() {
  74. this.startAjax();
  75. },
  76. data() {
  77. return {
  78. stations: [],
  79. station: '',
  80. model: [],
  81. fjxh: [],
  82. fjxhArr: [],
  83. fjArr: [], //风机
  84. fj: ''
  85. };
  86. },
  87. methods: {
  88. stationChange() {
  89. let fjxh = [];
  90. this.fjxhArr.forEach(ele => {
  91. if (ele.id == this.station) {
  92. ele.value.forEach(ele2 => {
  93. fjxh.push({
  94. label: ele2,
  95. value: ele2
  96. })
  97. })
  98. this.model = ele.value;
  99. }
  100. })
  101. this.fjxh = fjxh;
  102. },
  103. async startAjax() {
  104. var that = this;
  105. await that.API.requestData({
  106. method: "GET",
  107. baseURL: "http://192.168.1.18:9002/",
  108. subUrl: "basic/station/all",
  109. success(res) {
  110. that.stations = res.data;
  111. that.station = res.data[1].id;
  112. let fjxhArr = [];
  113. let model = [],
  114. fjxh = [];
  115. res.data.forEach(ele => {
  116. fjxhArr.push({
  117. id: ele.id,
  118. value: ele.model.split("/")
  119. })
  120. if (ele.id == "NSS_FDC") {
  121. model = ["UP82"];
  122. fjxh.push({
  123. label: "UP82",
  124. value: "UP82"
  125. })
  126. }
  127. })
  128. that.fjxhArr = fjxhArr;
  129. that.model = model;
  130. that.fjxh = fjxh;
  131. },
  132. });
  133. // that.list()
  134. },
  135. },
  136. watch: {
  137. station(e) {
  138. let that = this;
  139. that.API.requestData({
  140. method: "GET",
  141. baseURL: "http://10.155.32.4:9001/",
  142. subUrl: "benchmarking/wtList",
  143. data: {
  144. wpid: e,
  145. },
  146. success(res) {
  147. that.fjArr = res.data;
  148. that.fj = res.data[0].id;
  149. },
  150. });
  151. }
  152. }
  153. };
  154. </script>
  155. <style lang="less" scoped>
  156. .body {
  157. display: flex;
  158. flex-direction: row;
  159. height: 75px;
  160. width: 100%;
  161. .left {
  162. display: flex;
  163. flex-direction: column;
  164. justify-content: center;
  165. align-items: center;
  166. width: 30px;
  167. margin-left: 30px;
  168. .round_on {
  169. width: 20px;
  170. height: 27px;
  171. border-radius: 50%;
  172. background-color: rgb(30, 209, 45);
  173. }
  174. .round {
  175. width: 20px;
  176. height: 27px;
  177. border-radius: 50%;
  178. background-color: crimson;
  179. }
  180. .line {
  181. width: 2px;
  182. height: 100%;
  183. background-color: #ffffff;
  184. }
  185. }
  186. .right {
  187. width: 100%;
  188. margin-left: 20px;
  189. .content {
  190. display: flex;
  191. flex-direction: row;
  192. justify-content: space-between;
  193. align-items: center;
  194. margin-top: 10px;
  195. .btn {
  196. margin-right: 20px;
  197. }
  198. }
  199. }
  200. }
  201. </style>