wranDataSet.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. <!-- 预警设置 -->
  2. <template>
  3. <div class="innerMargin">
  4. <div class="box-card">
  5. <div class="seaarchBox">
  6. <div class="searchLeft">
  7. <el-input size="small" placeholder="请输入内容" v-model="input3" class="input-with-select">
  8. <el-button size="small" slot="append" icon="el-icon-search"></el-button>
  9. </el-input>
  10. <span class="title">设备类型:</span>
  11. <el-select size="small" v-model="input3" placeholder="请选择设备类型">
  12. <el-option
  13. v-for="item in options"
  14. :key="item.value"
  15. :label="item.label"
  16. :value="item.value">
  17. </el-option>
  18. </el-select>
  19. <span class="title">时间选择:</span>
  20. <el-date-picker
  21. size="small"
  22. v-model="value1"
  23. type="daterange"
  24. range-separator="至"
  25. start-placeholder="开始日期"
  26. end-placeholder="结束日期">
  27. </el-date-picker>
  28. </div>
  29. <div class="exportRight">
  30. <el-button size="small" class="darkblueBtn" type="primary">新增预警</el-button>
  31. <el-button size="small" class="blueBtn" type="primary">导 出</el-button>
  32. </div>
  33. </div>
  34. <template>
  35. <el-table :data="userList" stripe style="width: 100%">
  36. <el-table-column prop="order" label="任务名称"></el-table-column>
  37. <el-table-column prop="equipId" label="设备名称"></el-table-column>
  38. <el-table-column prop="sensor" label="传感器"></el-table-column>
  39. <el-table-column prop="upline" label="上线"></el-table-column>
  40. <el-table-column prop="offline" label="下线"></el-table-column>
  41. <el-table-column prop="date" label="时间"></el-table-column>
  42. <el-table-column prop="startTime" width="200px" label="操作">
  43. <template slot-scope="scope">
  44. <el-button type="blueInfo" size="mini" plain>修改</el-button>
  45. <el-button type="warning" size="mini" plain>停用</el-button>
  46. <el-button type="danger" size="mini" plain>删除</el-button>
  47. </template>
  48. </el-table-column>
  49. </el-table>
  50. </template>
  51. <el-pagination
  52. background
  53. :page-size="8"
  54. layout="prev, pager, next, jumper"
  55. :current-page="page"
  56. :total="totalNum"
  57. @current-change="changePage"
  58. ></el-pagination>
  59. </div>
  60. </div>
  61. </template>
  62. <script>
  63. //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
  64. //例如:import 《组件名称》 from '《组件路径》';
  65. export default {
  66. //import引入的组件需要注入到对象中才能使用
  67. data() {
  68. //这里存放数据
  69. return {
  70. activeName: 'first',
  71. searchVal:'',
  72. input3:'',
  73. options: [{
  74. value: '水泵',
  75. label: '水泵'
  76. },{
  77. value: '水肥机',
  78. label: '水肥机'
  79. },{
  80. value: '电磁阀',
  81. label: '电磁阀'
  82. }],
  83. //
  84. value1:"",
  85. role: "",
  86. username: "",
  87. txtInner:"筛选测试用户",
  88. userList: [],
  89. userGroupList: [],
  90. roleList: [],
  91. page: 1,
  92. totalNum: 0,
  93. };
  94. },
  95. //监听属性 类似于data概念
  96. computed: {
  97. //获取用户类型
  98. userType: function () {
  99. return window.sessionStorage.getItem('myuser_type')
  100. }
  101. },
  102. //监控data中的数据变化
  103. watch: {},
  104. //生命周期 - 创建完成(可以访问当前this实例)
  105. created() {
  106. },
  107. //生命周期 - 挂载完成(可以访问DOM元素)
  108. mounted() {
  109. this.getList();
  110. },
  111. //方法集合
  112. methods: {
  113. //获取用户列表
  114. getList() {
  115. this.userList = [
  116. {
  117. equipId:'水泵145234324234',
  118. order:'水泵任务',
  119. sensor:'用水量(t)',
  120. date:'2021-3-21 12:30:25',
  121. upline:'20',
  122. offline:'20',
  123. startTime:'已读',
  124. },
  125. {
  126. equipId:'水泵145234324234',
  127. order:'水泵任务',
  128. sensor:'用水量(t)',
  129. date:'2021-3-21 12:30:25',
  130. upline:'20',
  131. offline:'20',
  132. startTime:'已读',
  133. },{
  134. equipId:'水泵145234324234',
  135. order:'水泵任务',
  136. sensor:'用水量(t)',
  137. date:'2021-3-21 12:30:25',
  138. upline:'20',
  139. offline:'20',
  140. startTime:'已读',
  141. },{
  142. equipId:'水泵145234324234',
  143. order:'水泵任务',
  144. sensor:'用水量(t)',
  145. date:'2021-3-21 12:30:25',
  146. upline:'20',
  147. offline:'20',
  148. startTime:'已读',
  149. },{
  150. equipId:'水泵145234324234',
  151. order:'水泵任务',
  152. sensor:'用水量(t)',
  153. date:'2021-3-21 12:30:25',
  154. upline:'20',
  155. offline:'20',
  156. startTime:'已读',
  157. },{
  158. equipId:'水泵145234324234',
  159. order:'水泵任务',
  160. sensor:'用水量(t)',
  161. date:'2021-3-21 12:30:25',
  162. upline:'20',
  163. offline:'20',
  164. startTime:'已读',
  165. },{
  166. equipId:'水泵145234324234',
  167. order:'水泵任务',
  168. sensor:'用水量(t)',
  169. date:'2021-3-21 12:30:25',
  170. upline:'20',
  171. offline:'20',
  172. startTime:'已读',
  173. },{
  174. equipId:'水泵145234324234',
  175. order:'水泵任务',
  176. sensor:'用水量(t)',
  177. date:'2021-3-21 12:30:25',
  178. upline:'20',
  179. offline:'20',
  180. startTime:'已读',
  181. },{
  182. equipId:'水泵145234324234',
  183. order:'水泵任务',
  184. sensor:'用水量(t)',
  185. date:'2021-3-21 12:30:25',
  186. upline:'20',
  187. offline:'20',
  188. startTime:'已读',
  189. },{
  190. equipId:'水泵145234324234',
  191. order:'水泵任务',
  192. sensor:'用水量(t)',
  193. date:'2021-3-21 12:30:25',
  194. upline:'20',
  195. offline:'20',
  196. startTime:'已读',
  197. },{
  198. equipId:'水泵145234324234',
  199. order:'水泵任务',
  200. sensor:'用水量(t)',
  201. date:'2021-3-21 12:30:25',
  202. upline:'20',
  203. offline:'20',
  204. startTime:'已读',
  205. },
  206. ];
  207. this.totalNum = 33;
  208. },
  209. handleClick(tab, event) {
  210. console.log(tab, event);
  211. },
  212. changePage(value) {
  213. this.page = value
  214. },
  215. },
  216. beforeCreate() {}, //生命周期 - 创建之前
  217. beforeMount() {}, //生命周期 - 挂载之前
  218. beforeUpdate() {}, //生命周期 - 更新之前
  219. updated() {}, //生命周期 - 更新之后
  220. beforeDestroy() {}, //生命周期 - 销毁之前
  221. destroyed() {}, //生命周期 - 销毁完成
  222. activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
  223. };
  224. </script>
  225. <style lang='less' scoped>
  226. .seaarchBox{
  227. margin-bottom: 10px;
  228. display: flex;
  229. justify-content: space-between;
  230. .searchLeft{
  231. display: flex;
  232. justify-content: space-between;
  233. align-items: center;
  234. .el-input{
  235. width: 250px;
  236. }
  237. /deep/.el-input-group__append{
  238. border-color: #43cdf6;
  239. }
  240. .title{
  241. margin: 0 5px 0 15px;
  242. }
  243. .el-button{
  244. background: #43cdf6;
  245. color: #fff;
  246. border-color: #43cdf6;
  247. }
  248. }
  249. .exportRight{
  250. .renBtn{
  251. background: #ff6262;
  252. border-color: #ff6262;
  253. }
  254. .darkblueBtn{
  255. background: #3762ff;
  256. border-color: #3762ff;
  257. }
  258. .blueBtn{
  259. background: #43cdf6;
  260. border-color: #43cdf6;
  261. }
  262. }
  263. }
  264. .search-box {
  265. text-align: right;
  266. .el-input {
  267. width: 200px;
  268. vertical-align: middle;
  269. }
  270. .el-select {
  271. vertical-align: middle;
  272. }
  273. }
  274. /deep/.el-table th, /deep/.el-table td{
  275. text-align: center;
  276. }
  277. /deep/.el-table th{
  278. background-color: #43cdf6;
  279. }
  280. /deep/.el-table thead{
  281. color: #fff;
  282. }
  283. /deep/.el-table__body tr.hover-row > td,/deep/.el-table--enable-row-hover .el-table__body tr:hover > td{
  284. background-color: rgba(67,205,246,.22);
  285. }
  286. // 分页为蓝色调
  287. /deep/.el-pagination .el-pager li.active{
  288. background-color: #0295ff!important;
  289. }
  290. /deep/.el-pagination.is-background .el-pager li:not(.disabled):hover{
  291. color: #0295ff;
  292. }
  293. /deep/.el-input__inner:focus{
  294. outline: none;
  295. border-color: #0295ff;
  296. }
  297. // table复选框
  298. /deep/.el-checkbox__input.is-checked .el-checkbox__inner{
  299. background-color: #3762ff;
  300. border-color: #3762ff;
  301. }
  302. </style>