瀏覽代碼

首次代码提交

13219261128 3 年之前
父節點
當前提交
a96abfaa98
共有 65 個文件被更改,包括 5863 次插入2234 次删除
  1. 2 2
      .env
  2. 5 0
      package-lock.json
  3. 1 0
      package.json
  4. 7 2
      src/App.vue
  5. 72 0
      src/api/modules/equipmentManage.api.js
  6. 74 0
      src/api/modules/productManage.api.js
  7. 二進制
      src/assets/images/believe-bj.png
  8. 二進制
      src/assets/images/believe-icon.png
  9. 二進制
      src/assets/images/bg.jpg
  10. 0 0
      src/assets/images/bg1.png
  11. 二進制
      src/assets/images/bj.png
  12. 二進制
      src/assets/images/bjtj.png
  13. 二進制
      src/assets/images/cpu-bj.png
  14. 二進制
      src/assets/images/cpu-icon.png
  15. 二進制
      src/assets/images/dcl.png
  16. 二進制
      src/assets/images/dengluk.png
  17. 二進制
      src/assets/images/nav-bg.png
  18. 二進制
      src/assets/images/nav-bg1.png
  19. 二進制
      src/assets/images/online-bj.png
  20. 二進制
      src/assets/images/online-icon.png
  21. 二進制
      src/assets/images/product-bj.png
  22. 二進制
      src/assets/images/product-icon.png
  23. 二進制
      src/assets/images/shebei-bj.png
  24. 二進制
      src/assets/images/shebei-icon.png
  25. 二進制
      src/assets/images/warning-bj.png
  26. 二進制
      src/assets/images/warning-icon.png
  27. 108 61
      src/assets/style/public-class.scss
  28. 1 1
      src/assets/style/public.scss
  29. 1 1
      src/assets/style/theme/chester/setting.scss
  30. 2 2
      src/assets/style/theme/d2/setting.scss
  31. 1 1
      src/assets/style/theme/theme-base.scss
  32. 1 1
      src/assets/style/unit/color.scss
  33. 3 3
      src/assets/svg-icons/icons/d2-admin-text.svg
  34. 2 2
      src/assets/svg-icons/icons/d2-admin.svg
  35. 375 0
      src/components/base-table/baseTable.vue
  36. 190 0
      src/components/detailTable/index.vue
  37. 1 1
      src/layout/header-aside/components/footer/index.vue
  38. 16 8
      src/layout/header-aside/layout.vue
  39. 19 0
      src/menu/index.js
  40. 70 2
      src/router/routes.js
  41. 2 2
      src/views/demo/alarmRecord/index copy.vue
  42. 164 47
      src/views/demo/alarmRecord/index.vue
  43. 207 0
      src/views/demo/equipmentManage/compontents/addDialog.vue
  44. 118 0
      src/views/demo/equipmentManage/compontents/addDialogC.vue
  45. 471 0
      src/views/demo/equipmentManage/equipment/index.vue
  46. 712 0
      src/views/demo/equipmentManage/equipmentInfo/index.vue
  47. 315 0
      src/views/demo/equipmentManage/equipmentTag/index.vue
  48. 416 120
      src/views/demo/parameManagement/alarmParame/index.vue
  49. 5 8
      src/views/demo/parameManagement/dataDictionary/index.vue
  50. 630 0
      src/views/demo/parameManagement/setTimeOut/index.vue
  51. 234 0
      src/views/demo/productManage/compontents/addDialog.vue
  52. 176 0
      src/views/demo/productManage/compontents/addDialogC.vue
  53. 351 0
      src/views/demo/productManage/product/index.vue
  54. 321 0
      src/views/demo/productManage/productClassify/index.vue
  55. 423 0
      src/views/demo/productManage/productInfo/index.vue
  56. 5 6
      src/views/demo/system/operationLog/index.vue
  57. 31 23
      src/views/demo/system/organization/index.vue
  58. 15 12
      src/views/demo/system/roleManagement/index.vue
  59. 30 32
      src/views/demo/system/userManagement/index.vue
  60. 1 1
      src/views/system/index/page copy 2.vue
  61. 272 1892
      src/views/system/index/page.vue
  62. 二進制
      src/views/system/login/image/bg.jpg
  63. 二進制
      src/views/system/login/image/dengluk.png
  64. 12 3
      src/views/system/login/page.vue
  65. 1 1
      vue.config.js

+ 2 - 2
.env

@@ -5,7 +5,7 @@ VUE_APP_TITLE=数量监测智能眼系统
5 5
 
6 6
 # 网络请求公用地址
7 7
 VUE_APP_API=/api/
8
-; VUE_APP_API=http://101.36.160.140:21023/
8
+; VUE_APP_API=http://101.36.160.140:31005/
9 9
 
10 10
 # 仓库地址
11 11
 VUE_APP_REPO=https://github.com/d2-projects/d2-admin-start-kit
@@ -15,4 +15,4 @@ VUE_APP_I18N_LOCALE=zh-chs
15 15
 VUE_APP_I18N_FALLBACK_LOCALE=en
16 16
 
17 17
 # element 颜色
18
-VUE_APP_ELEMENT_COLOR=#409EFF
18
+VUE_APP_ELEMENT_COLOR=#008775

+ 5 - 0
package-lock.json

@@ -10373,6 +10373,11 @@
10373 10373
         "minimist": "^1.2.5"
10374 10374
       }
10375 10375
     },
10376
+    "moment": {
10377
+      "version": "2.29.3",
10378
+      "resolved": "https://registry.npmmirror.com/moment/-/moment-2.29.3.tgz",
10379
+      "integrity": "sha512-c6YRvhEo//6T2Jz/vVtYzqBzwvPT95JBQ+smCytzf7c50oMZRsR/a4w88aD34I+/QVSfnoAnSBFPJHItlOMJVw=="
10380
+    },
10376 10381
     "move-concurrently": {
10377 10382
       "version": "1.0.1",
10378 10383
       "resolved": "https://registry.npm.taobao.org/move-concurrently/download/move-concurrently-1.0.1.tgz",

+ 1 - 0
package.json

@@ -26,6 +26,7 @@
26 26
     "js-cookie": "^2.2.1",
27 27
     "lodash": "^4.17.19",
28 28
     "lowdb": "^1.0.0",
29
+    "moment": "^2.29.3",
29 30
     "nprogress": "^0.2.0",
30 31
     "screenfull": "^5.0.2",
31 32
     "sortablejs": "^1.10.1",

+ 7 - 2
src/App.vue

@@ -25,7 +25,12 @@ export default {
25 25
 
26 26
 <style lang="scss">
27 27
 @import '~@/assets/style/public-class.scss';
28
+@import '~@/components/d2-icon/font-awesome-4.7.0/css/font-awesome.min.css';
28 29
 
29
-
30
-
30
+              .d2-container-full {
31
+                background-image: url("./assets/images/bj.png");
32
+                background-repeat: no-repeat;
33
+                background-size: 100% 100%;
34
+               
35
+              }
31 36
 </style>

+ 72 - 0
src/api/modules/equipmentManage.api.js

@@ -0,0 +1,72 @@
1
+export default ({
2
+    request
3
+  }) => ({
4
+    /**
5
+     * @description 设备管理
6
+     * @param {Object} data 
7
+     */
8
+    //设备列表接口
9
+    equipmentList(data) {
10
+      return request({
11
+        url: '/device-info/getPageList',
12
+        method: 'post',
13
+        data
14
+      })
15
+    },
16
+    //设备保存/更新
17
+    equipmentSu(data) {
18
+      return request({
19
+        url: '/device-info/saveOrUpdate',
20
+        method: 'post',
21
+        data
22
+      })
23
+    },
24
+    //设备查看
25
+    equipmentDetail( id ) {
26
+      return request({
27
+        url: `/device-info/getById/${id}`,
28
+        method: 'get',
29
+      })
30
+    },
31
+    //设备删除
32
+    equipmentDel( id ) {
33
+      return request({
34
+        url: `/device-info/deleteById/${id}`,
35
+        method: 'get',
36
+      })
37
+    },
38
+    //设备标签列表接口
39
+    equipmentTagList(data) {
40
+        return request({
41
+          url: '/device-label/getPageList',
42
+          method: 'post',
43
+          data
44
+        })
45
+      },
46
+      //设备标签保存/更新
47
+      equipmentTagSu(data) {
48
+        return request({
49
+          url: '/device-label/saveOrUpdate',
50
+          method: 'post',
51
+          data
52
+        })
53
+      },
54
+      //设备标签查看
55
+      equipmentTagDetail( id ) {
56
+        return request({
57
+          url: `/device-label/getById/${id}`,
58
+          method: 'get',
59
+        })
60
+      },
61
+      //设备标签删除
62
+      equipmentTagDel( id ) {
63
+        return request({
64
+          url: `/device-label/deleteById/${id}`,
65
+          method: 'get',
66
+        })
67
+      },
68
+  
69
+  
70
+  
71
+  })
72
+  

+ 74 - 0
src/api/modules/productManage.api.js

@@ -0,0 +1,74 @@
1
+export default ({
2
+    request
3
+  }) => ({
4
+    /**
5
+     * @description 产品管理
6
+     * @param {Object} data 
7
+     */
8
+    //产品列表接口
9
+    productList(data) {
10
+      return request({
11
+        url: '/productInfo/getListPage',
12
+        method: 'post',
13
+        data
14
+      })
15
+    },
16
+    //产品-保存
17
+    productSave(data) {
18
+        return request({
19
+          url: '/productInfo/save',
20
+          method: 'post',
21
+          data
22
+        })
23
+      },
24
+    //产品-修改
25
+    productUpdate(data) {
26
+      return request({
27
+        url: '/productInfo/update',
28
+        method: 'post',
29
+        data
30
+      })
31
+    },
32
+    //产品-详情
33
+    productDetail( id ) {
34
+      return request({
35
+        url: `/productInfo/getById/${id}`,
36
+        method: 'get',
37
+      })
38
+    },
39
+
40
+    //产品分类列表接口
41
+    productCategoryList(data) {
42
+      return request({
43
+        url: '/productCategory/getTreeList',
44
+        method: 'post',
45
+        data
46
+      })
47
+    },
48
+    //产品分类-保存
49
+    productCategorySave(data) {
50
+        return request({
51
+          url: '/productCategory/save',
52
+          method: 'post',
53
+          data
54
+        })
55
+      },
56
+    //产品分类-修改
57
+    productCategoryUpdate(data) {
58
+      return request({
59
+        url: '/productCategory/update',
60
+        method: 'post',
61
+        data
62
+      })
63
+    },
64
+    //产品分类-删除
65
+    productCategoryDel( id ) {
66
+      return request({
67
+        url: `/productCategory/deleteById/${id}`,
68
+        method: 'get',
69
+      })
70
+    },
71
+
72
+
73
+  })
74
+  

二進制
src/assets/images/believe-bj.png


二進制
src/assets/images/believe-icon.png


二進制
src/assets/images/bg.jpg


src/assets/images/bg.png → src/assets/images/bg1.png


二進制
src/assets/images/bj.png


二進制
src/assets/images/bjtj.png


二進制
src/assets/images/cpu-bj.png


二進制
src/assets/images/cpu-icon.png


二進制
src/assets/images/dcl.png


二進制
src/assets/images/dengluk.png


二進制
src/assets/images/nav-bg.png


二進制
src/assets/images/nav-bg1.png


二進制
src/assets/images/online-bj.png


二進制
src/assets/images/online-icon.png


二進制
src/assets/images/product-bj.png


二進制
src/assets/images/product-icon.png


二進制
src/assets/images/shebei-bj.png


二進制
src/assets/images/shebei-icon.png


二進制
src/assets/images/warning-bj.png


二進制
src/assets/images/warning-icon.png


+ 108 - 61
src/assets/style/public-class.scss

@@ -74,20 +74,20 @@ $sizes: (0, 5, 10, 15, 20);
74 74
     height: calc(100vh - 110px);
75 75
 
76 76
     overflow-y: auto;
77
-    background: #163d79;
77
+    background: #fff;
78 78
   }
79 79
 }
80 80
 
81 81
 .el-tree-node{
82
-  background: #163d79;
83
-  color:#fff;
82
+  // background: #163d79;
83
+  // color:#fff;
84 84
   font-size:12px;
85 85
 }
86 86
 
87 87
 //鼠标移到每行时的背景色
88
-.el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{
89
-  background:hsl(204, 66%, 23%) !important;
90
-}
88
+// .el-table--enable-row-hover .el-table__body tr:hover>td.el-table__cell{
89
+//   background:hsl(204, 66%, 23%) !important;
90
+// }
91 91
 // //头部导航一级菜单的样式
92 92
 .theme-d2 .d2-theme-header .el-menu .el-menu-item{
93 93
   // border-right:linear-gradient(#193a6d, #487B98 20%,#193a6d 80%) !important;
@@ -105,14 +105,14 @@ $sizes: (0, 5, 10, 15, 20);
105 105
 }
106 106
 //头部导航二级菜单选中后整体的背景色
107 107
 .el-menu--horizontal .el-menu .el-menu-item{
108
-  background:#244e88 !important;
109
-  border:1px solid #346ebd;
108
+  background:#fff !important;
109
+  // border:1px solid #346ebd;
110 110
   text-align: center;
111 111
 }
112 112
 //头部导航二级菜单选中后每个的背景色
113 113
 .theme-d2 .el-menu--horizontal .el-menu-item:not(.is-disabled):hover{
114
-  background:#346ebd !important;
115
-  color: #fff !important;
114
+  // background:rgb(23, 105, 66) !important;
115
+  // color: #fff !important;
116 116
 }
117 117
 .el-menu--horizontal .el-menu--collapse .el-menu .el-submenu, .el-menu--popup {
118 118
   min-width: 142px !important;
@@ -127,9 +127,10 @@ $sizes: (0, 5, 10, 15, 20);
127 127
   color: #fff !important;
128 128
 }
129 129
 .el-menu--horizontal .el-menu .el-menu-item.is-active, .el-menu--horizontal .el-menu .el-submenu.is-active {
130
-  background-color:#346ebd !important  ;
130
+  background-color:rgb(23, 105, 66)   ;
131 131
 }
132 132
 
133
+
133 134
 //头部导航仓房展示icon的大小
134 135
 .fa-university{
135 136
   font-size:13px !important;
@@ -141,15 +142,17 @@ $sizes: (0, 5, 10, 15, 20);
141 142
 
142 143
 //主体内容样式
143 144
 .right_main {
144
-  border: 1px solid #67a7df;
145
-  background: #112f5d;
146
-
147
-  margin-top: 10px;
145
+  // border: 1px solid #67a7df;
146
+  background: #fff;
147
+  border-top-left-radius: 6px;
148
+  border-top-right-radius: 6px;
149
+  // margin-top: 10px;
148 150
   .right_title {
149
-    color: #fff;
150
-    border-bottom: 1px solid #67a7df;
151
+    // color: #fff;
152
+    // border-bottom: 1px solid #67a7df;
151 153
     padding: 10px;
152 154
     font-size: 14px;
155
+    margin-bottom: 10px;
153 156
   }
154 157
   .right_table {
155 158
     padding: 20px;
@@ -161,71 +164,86 @@ $sizes: (0, 5, 10, 15, 20);
161 164
   display: flex;
162 165
   justify-content: flex-end;
163 166
 }
164
-//分页总共几页样式
165
-.el-pagination__total {
166
-  color: #fff !important;
167
-}
168
-//label样式
169
-#formLabel .el-form-item__label {
170
-  color: #fff;
171
-}
172
-// 分页跳转颜色
173
-.el-pagination .el-pagination__jump {
174
-  color: #fff;
167
+.el-pagination .el-icon-arrow-right:before{
168
+  color:#303133
175 169
 }
176
-// 弹窗关闭icon颜色
177
-.el-dialog .el-dialog__headerbtn .el-dialog__close {
178
-color: #fff;
170
+.el-pagination button:disabled>.el-icon-arrow-right:before{
171
+  color:#C0C4CC
179 172
 }
173
+//分页总共几页样式
174
+// .el-pagination__total {
175
+//   color: #fff !important;
176
+// }
177
+// //label样式
178
+// #formLabel .el-form-item__label {
179
+//   color: #fff;
180
+// }
181
+// // 分页跳转颜色
182
+// .el-pagination .el-pagination__jump {
183
+//   color: #fff;
184
+// }
185
+// // 弹窗关闭icon颜色
186
+// .el-dialog .el-dialog__headerbtn .el-dialog__close {
187
+// color: #fff;
188
+// }
180 189
 //树形节点选中后的颜色
181 190
 .el-tree-node:focus > .el-tree-node__content {
182
-  background-color: #0064b9 !important;
183
-  border-radius: 20px;
191
+  // background-color: #0064b9 !important;
192
+  // border-radius: 20px;
184 193
 }
185 194
 //树形节点鼠标移上去的颜色
186 195
 .el-tree-node__content:hover {
187 196
   background-color: #91a8bc !important;
188 197
 }
189 198
 .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content{
190
-  background-color: #0064b9 !important;
191
-  border-radius: 20px;
199
+  // background-color: #0064b9 !important;
200
+  // border-radius: 20px;
192 201
 }
193 202
 //table border
194 203
 
195
-.el-table td,
196
-.el-table th.is-leaf,
197
-.el-table-border,
198
-.el-table--group {
199
-  border-color: #67a7df !important;
200
-}
201
-.el-table th.el-table_cell.is-leaf {
202
-  border: #67a7df !important;
203
-}
204
-.el-table tr {
205
-  background: #00375e !important;
206
-}
204
+// .el-table td,
205
+// .el-table th.is-leaf,
206
+// .el-table-border,
207
+// .el-table--group {
208
+//   border-color: #67a7df !important;
209
+// }
210
+// .el-table th.el-table_cell.is-leaf {
211
+//   border: #67a7df !important;
212
+// }
213
+// .el-table tr {
214
+//   background: #00375e !important;
215
+// }
207 216
 
208
-.el-table--border {
209
-  border-color: #67a7df !important;
217
+// .el-table--border {
218
+//   border-color: #67a7df ;
210 219
   
211
-}
220
+// }
212 221
 //鼠标移到每行时的背景色
213
-.el-table__body tr.hover-row.current-row>td.el-table__cell,
214
-.el-table__body tr.hover-row.el-table__row--striped.current-row>td.el-table__cell,
215
-.el-table__body tr.hover-row.el-table__row--striped>td.el-table__cell,
216
-.el-table__body tr.hover-row>td.el-table__cell{
217
-  background:hsl(204, 66%, 23%) !important;
218
-}
222
+// .el-table__body tr.hover-row.current-row>td.el-table__cell,
223
+// .el-table__body tr.hover-row.el-table__row--striped.current-row>td.el-table__cell,
224
+// .el-table__body tr.hover-row.el-table__row--striped>td.el-table__cell,
225
+// .el-table__body tr.hover-row>td.el-table__cell{
226
+//   background:hsl(204, 66%, 23%) !important;
227
+// }
219 228
 //弹框样式
220 229
 #dialogStyle .el-dialog{
221
-  background: #092a51;
230
+  // background: #092a51;
222 231
 }
223 232
 #dialogStyle .el-dialog__header{
224
-  background:#3a8ee6;
233
+  background:rgba(233, 244, 243, 0.5);
234
+  padding: 10px;
235
+  .el-dialog__title{
236
+    color: #008775;
237
+    font-size: 16px ;
238
+    font-weight: bold;
239
+  }
240
+  .el-dialog__headerbtn{
241
+    top: 15px;
242
+  }
225 243
 }
226 244
 #dialogStyle .el-dialog__title,#dialogStyle .el-form-item__label{
227 245
   // color:#9bbbe3;
228
-  color:#fff;
246
+  // color:#fff;
229 247
 }
230 248
 // #dialogStyle .el-input__inner{
231 249
 //   background:#1d3b6b;
@@ -270,7 +288,7 @@ color: #fff;
270 288
 // }
271 289
 
272 290
 .el-button--text {
273
-  color: #fff !important;
291
+  // color: #fff !important;
274 292
 }
275 293
 // 编辑按钮
276 294
 .main #formLabel .editBtn {
@@ -314,13 +332,42 @@ button.el-button.el-button--delebtn.el-button--mini{
314 332
 }
315 333
 // table  表格展开图标颜色
316 334
 .el-icon-arrow-right {
317
-  color: #fff;
335
+  // color: #fff;
336
+}
337
+.d2-theme-header-menu{
338
+
339
+  .is-opened{
340
+    .el-menu-item:hover{
341
+      background-color: red !important;
342
+    }
343
+  }
318 344
 }
319 345
 //主体内容
320 346
 // .ztnr{
321 347
 //   padding-left: 10px;
322 348
 // }
349
+.el-button--primary{
350
+  background-color: #008775 !important;
351
+  border-color: #008775 !important;
352
+}
353
+.el-button--primary.is-plain{
354
+  color: #008775 !important;
355
+  background: rgba(7, 115, 94, 0.07) !important;
356
+  border: 1px solid #008775;
357
+  border-radius: 4px;
358
+}
359
+.el-button--primary.is-plain:focus, .el-button--primary.is-plain:hover{
360
+  color: #fff !important;
361
+  background-color: #008775 !important;
323 362
 
363
+}
364
+.el-checkbox__input.is-checked .el-checkbox__inner, .el-checkbox__input.is-indeterminate .el-checkbox__inner{
365
+  background-color: #008775 !important;
366
+  border-color: #008775 !important;
367
+}
368
+.main .zt_right{
369
+  background-color: #fff;
370
+}
324 371
 
325 372
 
326 373
 

+ 1 - 1
src/assets/style/public.scss

@@ -43,5 +43,5 @@ $prefix: d2;
43 43
   position: relative;
44 44
 }
45 45
 .el-table {
46
-  color: #fff;
46
+  // color: #fff;
47 47
 }

+ 1 - 1
src/assets/style/theme/chester/setting.scss

@@ -27,7 +27,7 @@ $theme-multiple-page-control-background-color-active: #FFFFFF;
27 27
 
28 28
 // 顶栏和侧边栏中展开的菜单 hover 状态下
29 29
 $theme-menu-item-color-hover: #CCCCCC;
30
-$theme-menu-item-background-color-hover: #2A2D2E;
30
+$theme-menu-item-background-color-hover: rgba(0, 255, 132, 1);
31 31
 
32 32
 // 顶栏上的文字颜色
33 33
 $theme-header-item-color: #CCCCCC;

+ 2 - 2
src/assets/style/theme/d2/setting.scss

@@ -36,9 +36,9 @@ $theme-header-item-background-color: transparent;
36 36
 $theme-header-item-color-hover: #2f74ff;
37 37
 $theme-header-item-color-hover: #fff; // 顶栏上的项目在 hover 字体颜色
38 38
 $theme-header-item-background-color-hover: rgba(#FFF, .5);
39
-$theme-header-item-background-color-hover: #346ebd ;  // 顶栏上的项目在 hover  背景色
39
+$theme-header-item-background-color-hover: rgba(0, 255, 132, 0.3) ;  // 顶栏上的项目在 hover  背景色
40 40
 // 顶栏上的项目在 focus 时
41
-$theme-header-item-color-focus: #2f74ff;
41
+$theme-header-item-color-focus: #fff;
42 42
 $theme-header-item-background-color-focus: rgba(#FFF, .5);
43 43
 // 顶栏上的项目在 active 时
44 44
 $theme-header-item-color-active: #2f74ff;

+ 1 - 1
src/assets/style/theme/theme-base.scss

@@ -308,7 +308,7 @@
308 308
                 overflow: auto;
309 309
                 // overflow-x: hidden;
310 310
                 position: relative;
311
-                background-color: #09163a;
311
+                background: none;
312 312
                
313 313
               }
314 314
               .d2-container-full__footer {

+ 1 - 1
src/assets/style/unit/color.scss

@@ -1,5 +1,5 @@
1 1
 // 主色
2
-$color-primary: #409EFF;
2
+$color-primary: #008775;
3 3
 
4 4
 // 辅助色
5 5
 $color-info: #909399;

文件差異過大導致無法顯示
+ 3 - 3
src/assets/svg-icons/icons/d2-admin-text.svg


文件差異過大導致無法顯示
+ 2 - 2
src/assets/svg-icons/icons/d2-admin.svg


+ 375 - 0
src/components/base-table/baseTable.vue

@@ -0,0 +1,375 @@
1
+/** * create by xinli ON 2022/03/29 * 公共表格 * */
2
+<template>
3
+  <div class="base-table-container">
4
+    <el-table
5
+      ref="baseTable"
6
+      :height="tableHeight"
7
+      :highlight-current-row="tableData.highlight"
8
+      :data="fontPagination ? fontPaginationTable : tableData.datas"
9
+      tooltip-effect="dark"
10
+      style="width: 100%"
11
+      @cell-click="cellClick"
12
+      @row-click="rowClick"
13
+      @sort-change="sortChange"
14
+      @filter-change="filterChange"
15
+      @selection-change="selectionChange"
16
+      :border="tableData.tableBorder"
17
+      :header-row-class-name="tableRowClassName"
18
+    >
19
+      <el-table-column
20
+        v-if="tableData.selection"
21
+        type="selection"
22
+        width="55"
23
+      ></el-table-column>
24
+      <el-table-column
25
+        v-if="tableData.index&&tableData.indexLeft"
26
+        :label="tableData.indexLable"
27
+        :align="tableData.indexAlign || 'center'"
28
+        fixed="left"
29
+        type="index"
30
+        width="65"
31
+        :index="indexMethod"
32
+      >
33
+        <template slot-scope="scope">
34
+          <span>{{ scope.row.simpleName=='合计'?'':scope.$index+=1 }}</span>
35
+        </template>
36
+      </el-table-column>
37
+      <el-table-column
38
+        v-if="tableData.index&&tableData.indexLeft==undefined"
39
+        :label="tableData.indexLable"
40
+        :align="tableData.indexAlign || 'center'"
41
+        type="index"
42
+        width="65"
43
+      >
44
+        <template slot-scope="scope">
45
+          <span>{{ scope.row.simpleName=='合计'?'':scope.$index+=1 }}</span>
46
+        </template>
47
+      </el-table-column>
48
+      <el-table-column
49
+        :prop="column.prop"
50
+        :label="column.label"
51
+        :width="column.width"
52
+        :align="column.align || 'center'"
53
+        :fixed="column.fixed"
54
+        :filters="column.filters"
55
+        :filter-multiple="false"
56
+        :sortable="
57
+          column.columns ? false : column.sortable === false ? false : 'custom'
58
+        "
59
+        :column-key="column.columnKey"
60
+        :class-name="column.className"
61
+        :show-overflow-tooltip="column.overflowTooltip"
62
+        v-for="(column, index) in tableData.columns"
63
+        :key="index"
64
+        :min-width="column.minWidth ? column.minWidth : 120"
65
+      >
66
+        <!-- <template slot="header" v-if="column.renderHeader">
67
+          <el-tooltip
68
+            class="item"
69
+            effect="dark"
70
+            :content="column.label"
71
+            placement="top-start"
72
+            :offset="100"
73
+          >
74
+            <span>{{ column.label }}</span>
75
+          </el-tooltip>
76
+        </template> -->
77
+
78
+        <template slot-scope="scope">
79
+          <slot
80
+            v-if="column.slotName"
81
+            :name="column.slotName"
82
+            :data="scope"
83
+          ></slot>
84
+          <span v-else>{{ scope.row[column.prop] }}</span>
85
+        </template>
86
+        <template v-if="column.columns">
87
+          <el-table-column
88
+            :prop="col.prop"
89
+            :label="col.label"
90
+            :width="col.width"
91
+            :align="col.align || 'center'"
92
+            :fixed="col.fixed"
93
+            :filters="col.filters"
94
+            :filter-multiple="false"
95
+            :sortable="col.sortable != false && 'custom'"
96
+            :column-key="col.columnKey"
97
+            :class-name="col.className"
98
+            :show-overflow-tooltip="col.overflowTooltip"
99
+            v-for="(col, idx) in column.columns"
100
+            :key="idx"
101
+            :min-width="col.minWidth ? col.minWidth : 100"
102
+          >
103
+            <!-- <template slot="header" v-if="col.renderHeader">
104
+              <el-tooltip
105
+                class="item"
106
+                effect="dark"
107
+                :content="col.label"
108
+                placement="top-start"
109
+                :offset="100"
110
+              >
111
+                <span>{{ col.label }}</span>
112
+              </el-tooltip>
113
+            </template> -->
114
+            <template slot-scope="scope">
115
+              <slot
116
+                v-if="col.slotName"
117
+                :name="col.slotName"
118
+                :data="scope"
119
+              ></slot>
120
+              <span v-else>{{ scope.row[col.prop] }}</span>
121
+            </template>
122
+          </el-table-column>
123
+        </template>
124
+      </el-table-column>
125
+      <slot></slot>
126
+    </el-table>
127
+    <div
128
+      class="table-pagination"
129
+      v-if="paginationConfig.paginationShow && tableData.total > 0"
130
+    >
131
+      <el-pagination
132
+        background
133
+        @size-change="handleSizeChange"
134
+        @current-change="handleCurrentChange"
135
+        :current-page="paginationConfig.currentPage"
136
+        :page-sizes="paginationConfig.pageSizes"
137
+        :page-size="paginationConfig.pageSize"
138
+        :layout="paginationConfig.layout"
139
+        :total="tableData.total"
140
+      >
141
+      </el-pagination>
142
+    </div>
143
+  </div>
144
+</template>
145
+
146
+<script>
147
+import moment from 'moment';
148
+
149
+export default {
150
+ props: {
151
+  tableData: {
152
+   type: Object,
153
+   default: () => {}
154
+  },
155
+  paginationConfig: {
156
+   type: Object,
157
+   default: () => {}
158
+  },
159
+  fontPagination: {
160
+   type: Boolean,
161
+   default: false
162
+  }
163
+ },
164
+ data() {
165
+  return {
166
+   tableHeight: '',
167
+   datas: this.tableData.datas
168
+  };
169
+ },
170
+ created() {
171
+  this.getTableHeight();
172
+ },
173
+ mounted() {
174
+  const _this = this;
175
+  window.onresize = () => {
176
+   if (_this.resizeFlag) {
177
+    clearTimeout(_this.resizeFlag);
178
+   }
179
+   _this.resizeFlag = setTimeout(() => {
180
+    _this.getTableHeight();
181
+    _this.resizeFlag = null;
182
+   }, 100);
183
+  };
184
+ },
185
+ methods: {
186
+    //表格序号
187
+    indexMethod(index) {
188
+      return (
189
+        (this.paginationConfig.currentPage - 1) * this.paginationConfig.pageSize + index + 1
190
+      );
191
+    },
192
+  // 计算table高度(动态设置table高度)
193
+  getTableHeight() {
194
+   const tableH = 230; // 距离页面下方的高度
195
+   const tableHeightDetil = window.innerHeight - tableH;
196
+   if (tableHeightDetil <= 300) {
197
+    this.tableHeight = 300;
198
+   } else {
199
+    this.tableHeight = window.innerHeight - tableH;
200
+   }
201
+  },
202
+  handleSizeChange(pageSize) {
203
+   this.paginationConfig.pageSize = pageSize;
204
+   this.$emit('sizeChange', pageSize);
205
+  },
206
+  handleCurrentChange(currentPage) {
207
+   this.paginationConfig.currentPage = currentPage;
208
+   this.$emit('currentChange', currentPage);
209
+  },
210
+  selectionChange(val) {
211
+   this.$emit('selectionChange', val);
212
+  },
213
+  cellClick(row, column, cell, event) {},
214
+  rowClick(row, column, event) {},
215
+  sortChange(column, prop, order) {
216
+   const fieldName = column.prop;
217
+   this.sortingType = column.order;
218
+   let sumData = {}; // 放置合计一行数据
219
+   this.tableData.datas.forEach((item) => {
220
+    if (item.simpleName == '合计') {
221
+     sumData = item;
222
+    }
223
+   });
224
+   if (this.sortingType == 'ascending') {
225
+    if (fieldName == 'submitDate' || fieldName == 'informationSystemConstructionBuildTime' || fieldName == 'orgBasisTime' || fieldName == 'issuingTime' || fieldName == 'studyDate' || fieldName == 'fileDate' || fieldName == 'reviewTime' || fieldName == 'meetingTime' || fieldName == 'conveningTime') {
226
+     this.tableData.datas.forEach((item1) => {
227
+      if (item1[fieldName]) {
228
+       item1[fieldName] = moment(item1[fieldName]).valueOf();
229
+      }
230
+     });
231
+    }
232
+    // 正序
233
+    this.tableData.datas = this.tableData.datas.sort((a, b) => {
234
+     return a[fieldName] - b[fieldName];
235
+    });
236
+    if (fieldName == 'submitDate' || fieldName == 'orgBasisTime' || fieldName == 'issuingTime' || fieldName == 'studyDate' || fieldName == 'fileDate' || fieldName == 'reviewTime' || fieldName == 'meetingTime' || fieldName == 'conveningTime') {
237
+     this.tableData.datas.forEach((item2) => {
238
+      if (item2[fieldName]) {
239
+       item2[fieldName] = moment(item2[fieldName]).format('YYYY-MM-DD');
240
+      }
241
+     });
242
+    } else if (fieldName == 'informationSystemConstructionBuildTime') {
243
+     this.tableData.datas.forEach((item2) => {
244
+      if (item2[fieldName]) {
245
+       item2[fieldName] = moment(item2[fieldName]).format('YYYY-MM');
246
+      }
247
+     });
248
+    }
249
+    // 删除table中的合计
250
+    this.tableData.datas.forEach((item, index) => {
251
+     if (item.simpleName == '合计') {
252
+      this.tableData.datas.splice(index, 1);
253
+     }
254
+     return item;
255
+    });
256
+    if (sumData.simpleName == '合计') {
257
+     this.tableData.datas.push(sumData);
258
+    }
259
+    // this.tableData.datas=[{simpleName:'1'},{simpleName:'2'},{simpleName:'3'},{simpleName:'合计'}]
260
+    console.log(this.tableData.datas);
261
+   } else if (this.sortingType == 'descending') {
262
+    if (fieldName == 'submitDate' || fieldName == 'informationSystemConstructionBuildTime' || fieldName == 'orgBasisTime' || fieldName == 'issuingTime' || fieldName == 'studyDate' || fieldName == 'fileDate' || fieldName == 'reviewTime' || fieldName == 'meetingTime' || fieldName == 'conveningTime') {
263
+     this.tableData.datas.forEach((item1) => {
264
+      if (item1[fieldName]) {
265
+       item1[fieldName] = moment(item1[fieldName]).valueOf();
266
+      }
267
+     });
268
+    }
269
+
270
+    // 倒序
271
+    this.tableData.datas = this.tableData.datas.sort((a, b) => {
272
+     return b[fieldName] - a[fieldName];
273
+    });
274
+    if (fieldName == 'submitDate' || fieldName == 'orgBasisTime' || fieldName == 'issuingTime' || fieldName == 'studyDate' || fieldName == 'fileDate' || fieldName == 'reviewTime' || fieldName == 'meetingTime' || fieldName == 'conveningTime') {
275
+     this.tableData.datas.forEach((item2) => {
276
+      if (item2[fieldName]) {
277
+       item2[fieldName] = moment(item2[fieldName]).format('YYYY-MM-DD');
278
+      }
279
+     });
280
+    } else if (fieldName == 'informationSystemConstructionBuildTime') {
281
+     this.tableData.datas.forEach((item2) => {
282
+      if (item2[fieldName]) {
283
+       item2[fieldName] = moment(item2[fieldName]).format('YYYY-MM');
284
+      }
285
+     });
286
+    }
287
+    this.tableData.datas.forEach((item, index) => {
288
+     if (item.simpleName == '合计') {
289
+      this.tableData.datas.splice(index, 1);
290
+     }
291
+     return item;
292
+    });
293
+    if (sumData.simpleName == '合计') {
294
+     this.tableData.datas.push(sumData);
295
+    }
296
+   }
297
+   this.$emit('sortChange', column);
298
+  },
299
+  filterChange(filters) {
300
+   let selectKey = '';
301
+   for (const key in filters) {
302
+    if (filters[key][0]) {
303
+     selectKey = filters[key][0];
304
+    } else {
305
+     selectKey = '全部';
306
+    }
307
+    // selectKey = filters[key][0] ? filters[key][0] : '全部';
308
+   }
309
+   // console.log(selectKey);
310
+   this.$emit('filterChange', selectKey);
311
+  },
312
+  tableRowClassName({ row, rowIndex }) {
313
+   return 'header-class';
314
+  },
315
+  renderHeader(h, { column }) {
316
+   console.log(column);
317
+
318
+   return h('div', {}, [
319
+    h(
320
+     'div',
321
+     {
322
+      class: 'cell'
323
+     },
324
+     [
325
+      column.label,
326
+      h(
327
+       'el-tooltip',
328
+       {
329
+        props: {
330
+         effect: 'dark',
331
+         content: '这是一个提示',
332
+         placement: 'top'
333
+        }
334
+       },
335
+       [
336
+        h('i', {
337
+         class: 'el-icon-question',
338
+         style: 'color:#333;margin-left:5px;cursor:pointer;'
339
+        })
340
+       ]
341
+      )
342
+     ]
343
+    )
344
+   ]);
345
+  }
346
+ },
347
+ computed: {
348
+  fontPaginationTable() {
349
+   let table = [];
350
+   const curPage = this.paginationConfig.currentPage;
351
+   const { pageSize } = this.paginationConfig;
352
+   table = this.datas.slice(pageSize * (curPage - 1), pageSize * curPage);
353
+   return table;
354
+  }
355
+ }
356
+};
357
+</script>
358
+
359
+<style lang="scss" scoped>
360
+::v-deep.base-table-container {
361
+  box-sizing: border-box;
362
+  .table-pagination {
363
+    text-align: right;
364
+    margin-top: 24px;
365
+    padding: 16px 0;
366
+  }
367
+  // .header-class {
368
+  //   th {
369
+  //     .cell {
370
+  //       white-space: nowrap;
371
+  //     }
372
+  //   }
373
+  // }
374
+}
375
+</style>

+ 190 - 0
src/components/detailTable/index.vue

@@ -0,0 +1,190 @@
1
+/**
2
+* Create by: fenghaoyang
3
+* Time: 2021/07/27
4
+*  详情表格
5
+* */
6
+<template>
7
+  <div class="panel-height-add">
8
+
9
+    <div style="padding: 2px">
10
+      <div class="detBox">
11
+        <div
12
+          v-for="(item, i) in detailTable"
13
+          :key="i"
14
+          class="divF"
15
+          :style="{
16
+            'line-height':
17
+              (item.val.length == 0 ? 1 : item.val.length) * 48 + 'px',
18
+            height: (item.val.length == 0 ? 1 : item.val.length) * 48 + 'px',
19
+          }"
20
+        >
21
+          <div>
22
+            <el-tooltip
23
+              effect="dark"
24
+              :content="item.name"
25
+              :disabled="(item.name+'').length<13"
26
+              placement="top"
27
+            >
28
+              <div>{{ item.name }}</div>
29
+            </el-tooltip>
30
+          </div>
31
+          <div :class="item.name1==undefined?'long':''">
32
+            <el-tooltip
33
+              v-for="(data, len) in item.val"
34
+              :key="len"
35
+              effect="dark"
36
+              :content="data"
37
+              :disabled="(data+'').length<20"
38
+              placement="top"
39
+              
40
+            >
41
+              <div>{{ data==null?'':data }}</div>
42
+            </el-tooltip>
43
+          </div>
44
+          <div v-if="item.name1!=undefined">
45
+            <el-tooltip
46
+              effect="dark"
47
+              :content="item.name1"
48
+              :disabled="(item.name1+'').length<13"
49
+              placement="top"
50
+            >
51
+              <div>{{ item.name1 }}</div>
52
+            </el-tooltip>
53
+          </div>
54
+          <div v-if="item.name1!=undefined">
55
+            <el-tooltip
56
+              v-for="(data, index) in item.val1"
57
+              :key="index"
58
+              effect="dark"
59
+              :content="data"
60
+              :disabled="(data+'').length<22"
61
+              placement="top"
62
+            >
63
+              <div>{{ data==null?'':data }}</div>
64
+            </el-tooltip>
65
+          </div>
66
+        </div>
67
+      </div>
68
+    </div>
69
+  </div>
70
+</template>
71
+
72
+<script>
73
+export default {
74
+ name: 'DetailTable',
75
+ props: {
76
+  detailTable: {
77
+   type: Array,
78
+   default: () => {
79
+    return []
80
+   }
81
+  },
82
+  title: {
83
+   type: String,
84
+   default: ''
85
+  }
86
+ },
87
+ data() {
88
+  return {}
89
+ },
90
+ watch: {},
91
+ created() {},
92
+ methods: {}
93
+}
94
+</script>
95
+
96
+<style lang="scss" scoped>
97
+.panel-height-add {
98
+//   overflow: auto;
99
+  background-color: #ffffff;
100
+//   box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.3);
101
+  margin-bottom: 20px;
102
+
103
+  .infoTitle {
104
+    width: 100%;
105
+    // border-bottom: 1px solid #e6e6e6;
106
+    display: flex;
107
+    align-items: center;
108
+    justify-content: space-between;
109
+
110
+    h5 {
111
+      margin: 0;
112
+      padding-left:20px;
113
+    }
114
+    i{
115
+        color: #008775;
116
+        padding-right: 20px;
117
+        padding-top: 10px;
118
+        font-size: 14px;
119
+        cursor: pointer;
120
+    }
121
+  }
122
+
123
+  .detBox {
124
+    width: 100%;
125
+    border-left: 1px solid #e6e6e6;
126
+    border-top: 1px solid #e6e6e6;
127
+    margin-bottom: 30px;
128
+    .one {
129
+      line-height: 48px;
130
+    }
131
+    .two {
132
+      line-height: 96px;
133
+    }
134
+    .divF {
135
+      width: 100%;
136
+
137
+      display: flex;
138
+      //   align-items: center;
139
+      border-bottom: 1px solid #e6e6e6;
140
+
141
+      > div {
142
+        > div:last-child {
143
+          border-bottom: none !important;
144
+        }
145
+
146
+        div {
147
+          line-height: 48px;
148
+          height: 48px;
149
+          border-bottom: 1px solid #e6e6e6;
150
+          // padding-left: 10px;
151
+        }
152
+      }
153
+    }
154
+
155
+    .divF > div > div:last-child {
156
+      border: none;
157
+    }
158
+
159
+    .divF > div:nth-child(odd) {
160
+      width: 15%;
161
+      text-align: center;
162
+      background: #fafafa;
163
+      font-size: 14px;
164
+      div {
165
+        width: 100%;
166
+        overflow: hidden; /*超出部分隐藏*/
167
+        white-space: nowrap; /*不换行*/
168
+        text-overflow: ellipsis; /*超出部分文字以...显示*/
169
+      }
170
+    }
171
+
172
+    .divF > div:nth-child(even) {
173
+      width: 35%;
174
+      border-right: 1px solid #e6e6e6;
175
+      border-left: 1px solid #e6e6e6;
176
+      text-align: center;
177
+      font-size: 14px;
178
+      div {
179
+        width: 100%;
180
+        overflow: hidden; /*超出部分隐藏*/
181
+        white-space: nowrap; /*不换行*/
182
+        text-overflow: ellipsis; /*超出部分文字以...显示*/
183
+      }
184
+    }
185
+    .long{
186
+        width: 85% !important;
187
+    }
188
+  }
189
+}
190
+</style>

+ 1 - 1
src/layout/header-aside/components/footer/index.vue

@@ -14,7 +14,7 @@ export default {
14 14
         line-height:30px;
15 15
         text-align:center;
16 16
         // z-index: 999;
17
-        background:#002049;
17
+        background:#008775 !important;
18 18
         font-size:14px;
19 19
         color:#fff;
20 20
     }

+ 16 - 8
src/layout/header-aside/layout.vue

@@ -183,20 +183,21 @@ export default {
183 183
 }
184 184
 //头部导航一级菜单选中后的样式
185 185
 .theme-d2 .d2-theme-header .el-menu .el-menu-item.is-active {
186
-  // background: #0068a0 !important;
186
+  background:  rgba(0, 255, 132, 0.3) ; 
187 187
   color: #fff !important;
188
-  background-image: url(../../assets/images/selected.png);
189
-  background-position: 50% 86%;
188
+  // background-image: url(../../assets/images/selected.png);
189
+  // background-position: 50% 86%;
190 190
 }
191 191
 //头部导航二级菜单选中后的样式
192 192
 .theme-d2 .d2-theme-header .el-menu .el-submenu.is-active .el-submenu__title {
193 193
   color: #fff !important;
194
-  background-image: url(../../assets/images/selected.png);
195
-  background-position: 50% 86%;
194
+  background:  rgba(0, 255, 132, 0.3) ;
195
+  // background-image: url(../../assets/images/selected.png);
196
+  // background-position: 50% 86%;
196 197
 }
197 198
 //整体内容背景色
198 199
 .d2-layout-header-aside-group {
199
-  background-image: url(../../assets/images/bg.png);
200
+  // background-image: url(../../assets/images/bg.jpg);
200 201
 }
201 202
 .imgFather {
202 203
   display: flex;
@@ -217,10 +218,17 @@ export default {
217 218
   background-color: none;
218 219
 }
219 220
 .el-menu--horizontal .el-menu .el-submenu__title:hover {
220
-
221
+  // color: #008775 !important;
221 222
 }
222 223
 // 导航菜单二级菜单字体颜色
223 224
 .el-menu--horizontal .el-menu .el-menu-item, .el-menu--horizontal .el-menu .el-submenu__title {
224
-  color: #f7fdfe;
225
+  color: #333;
226
+}
227
+.el-menu--horizontal .el-menu .el-menu-item.is-active{
228
+  color: #008775 !important;
229
+}
230
+.el-menu--horizontal .el-menu .el-menu-item:hover{
231
+  color: #008775 !important;
232
+  background: #F4F9F9 !important;
225 233
 }
226 234
 </style>

+ 19 - 0
src/menu/index.js

@@ -28,6 +28,24 @@ export const menuHeader = supplementPath([
28 28
      
29 29
     ]
30 30
   },
31
+  {
32
+    title: '产品管理',
33
+    icon: 'product-hunt',
34
+    children: [
35
+      { path: '/product', title: '产品' },
36
+      { path: '/productClassify', title: '产品分类' },
37
+     
38
+    ]
39
+  },
40
+  {
41
+    title: '设备管理',
42
+    icon: 'university',
43
+    children: [
44
+      { path: '/equipment', title: '设备' },
45
+      { path: '/equipmentTag', title: '设备标签' },
46
+     
47
+    ]
48
+  },
31 49
   { path: '/alarmRecord', title: '报警记录', icon: 'file-text' },
32 50
   { path: '/dataQuery', title: '数据查询', icon: 'pie-chart' },
33 51
   {
@@ -50,6 +68,7 @@ export const menuHeader = supplementPath([
50 68
       { path: '/scanParame', title: '扫描参数' },
51 69
       { path: '/alarmParame', title: '报警参数' },
52 70
       { path: '/dataDictionary', title: '数据字典' },
71
+      { path: '/setTimeOut', title: '定时任务设置' },
53 72
     
54 73
      
55 74
     ]

+ 70 - 2
src/router/routes.js

@@ -61,7 +61,66 @@ const frameIn = [
61 61
           },
62 62
           component: _import('demo/warehouseShow/warehouseInfo/warehouseInfo-check.vue')
63 63
         },
64
-
64
+        //  产品管理/产品
65
+        {
66
+          path: 'product',
67
+          name: 'product',
68
+          meta: {
69
+            title: '产品',
70
+            auth: true
71
+          },
72
+          component: _import('demo/productManage/product')
73
+        },
74
+        //  产品管理/产品详情
75
+        {
76
+          path: 'productInfo',
77
+          name: 'productInfo',
78
+          meta: {
79
+            title: '产品详情',
80
+            auth: true
81
+          },
82
+          component: _import('demo/productManage/productInfo')
83
+        },
84
+        //  产品管理/产品
85
+        {
86
+          path: 'productClassify',
87
+          name: 'productClassify',
88
+          meta: {
89
+            title: '产品分类',
90
+            auth: true
91
+          },
92
+          component: _import('demo/productManage/productClassify')
93
+        },
94
+        //  设备管理/设备
95
+        {
96
+          path: 'equipment',
97
+          name: 'equipment',
98
+          meta: {
99
+            title: '设备',
100
+            auth: true
101
+          },
102
+          component: _import('demo/equipmentManage/equipment')
103
+        },
104
+        //  设备管理/设备标签
105
+        {
106
+          path: 'equipmentTag',
107
+          name: 'equipmentTag',
108
+          meta: {
109
+            title: '设备标签',
110
+            auth: true
111
+          },
112
+          component: _import('demo/equipmentManage/equipmentTag')
113
+        },
114
+        //  设备管理/设备详情
115
+        {
116
+          path: 'equipmentInfo',
117
+          name: 'equipmentInfo',
118
+          meta: {
119
+            title: '产品详情',
120
+            auth: true
121
+          },
122
+          component: _import('demo/equipmentManage/equipmentInfo')
123
+        },
65 124
         //报警记录
66 125
         {
67 126
           path: 'alarmRecord',
@@ -170,7 +229,16 @@ const frameIn = [
170 229
               },
171 230
               component: _import('demo/parameManagement/dataDictionary')
172 231
             },
173
-
232
+            // 参数设置/定时任务设置
233
+            {
234
+              path: 'setTimeOut',
235
+              name: 'setTimeOut',
236
+              meta: {
237
+                title: '数据字典',
238
+                auth: true
239
+              },
240
+              component: _import('demo/parameManagement/setTimeOut')
241
+            },
174 242
       // 系统 前端日志
175 243
       {
176 244
         path: 'log',

+ 2 - 2
src/views/demo/alarmRecord/index copy.vue

@@ -1024,7 +1024,7 @@ export default {
1024 1024
 }
1025 1025
 
1026 1026
 .uploadFile .el-icon-delete:hover {
1027
-  color: #409eff;
1027
+  color: #008775;
1028 1028
 }
1029 1029
 
1030 1030
 .uploadFile .el-icon-zoom-in {
@@ -1034,7 +1034,7 @@ export default {
1034 1034
 }
1035 1035
 
1036 1036
 .uploadFile .el-icon-zoom-in:hover {
1037
-  color: #409eff;
1037
+  color: #008775;
1038 1038
 }
1039 1039
 
1040 1040
 .checkUploadFile {

+ 164 - 47
src/views/demo/alarmRecord/index.vue

@@ -7,10 +7,10 @@
7 7
           <!-- <template slot="header">首页/数据查询</template> -->
8 8
           <div class="nav">当前所在位置:首页>报警记录</div>
9 9
           <div class="right_main">
10
-            <div class="right_title">
10
+            <!-- <div class="right_title">
11 11
               <i class="fa fa-file-text" aria-hidden="true" style="padding-right: 5px"></i>
12 12
               报警记录
13
-            </div>
13
+            </div> -->
14 14
             <div class="right_table">
15 15
               <el-form
16 16
           :inline="true"
@@ -18,30 +18,65 @@
18 18
           class="demo-form-inline"
19 19
           id="formLabel"
20 20
         >
21
-          <el-form-item label="报警时间:">
22
-            <el-date-picker
23
-              v-model="formInline.scanTime"
24
-              type="daterange"
25
-              align="right"
26
-              unlink-panels
27
-              range-separator="至"
28
-              start-placeholder="开始日期"
29
-              end-placeholder="结束日期"
30
-              :picker-options="pickerOptions"
31
-            >
32
-            </el-date-picker>
33
-          </el-form-item>
34
-          <el-form-item label="反馈状态:">
35
-            <el-select v-model="formInline.zskName" placeholder="请选择">
21
+                  <el-form-item label="组织名称:">
22
+                    <el-select
23
+                      v-model="formInline.house"
24
+                      
25
+                      placeholder="请选择"
26
+                       size="mini"
27
+                    >
28
+                      <el-option label="1号仓" value="first"></el-option>
29
+                      <el-option label="2号仓" value="second"></el-option>
30
+                      <el-option label="3号仓" value="third"></el-option>
31
+                    </el-select>
32
+                  </el-form-item>
33
+                  <el-form-item label="产品名称:">
34
+                    <el-select
35
+                      v-model="formInline.houseName"
36
+                      
37
+                      placeholder="请选择"
38
+                       size="mini"
39
+                    >
40
+                      <el-option label="1号仓" value="first"></el-option>
41
+                      <el-option label="2号仓" value="second"></el-option>
42
+                      <el-option label="3号仓" value="third"></el-option>
43
+                    </el-select>
44
+                  </el-form-item>
45
+                  <el-form-item label="设备名称:">
46
+                    <el-select
47
+                      v-model="formInline.houseNa"
48
+                      
49
+                      placeholder="请选择"
50
+                       size="mini"
51
+                    >
52
+                      <el-option label="1号仓" value="first"></el-option>
53
+                      <el-option label="2号仓" value="second"></el-option>
54
+                      <el-option label="3号仓" value="third"></el-option>
55
+                    </el-select>
56
+                  </el-form-item>
57
+                  <el-form-item label="设备标签:">
58
+                    <el-select
59
+                      v-model="formInline.houseN"
60
+                      
61
+                      placeholder="请选择"
62
+                       size="mini"
63
+                    >
64
+                      <el-option label="1号仓" value="first"></el-option>
65
+                      <el-option label="2号仓" value="second"></el-option>
66
+                      <el-option label="3号仓" value="third"></el-option>
67
+                    </el-select>
68
+                  </el-form-item>        
69
+          <el-form-item label="报警类型:">
70
+            <el-select v-model="formInline.zskName" size="mini" placeholder="请选择">
36 71
               <el-option label="全部" value="shanghai"></el-option>
37 72
               <el-option label="已反馈" value="beijing"></el-option>
38 73
               <el-option label="未反馈" value="beijing1"></el-option>
39 74
             </el-select>
40 75
           </el-form-item>
41
-          <el-form-item label="仓房名称:">
76
+          <el-form-item label="处理状态:">
42 77
             <el-select
43 78
               v-model="formInline.houseName"
44
-              multiple
79
+              size="mini"
45 80
               placeholder="请选择"
46 81
             >
47 82
               <el-option label="1号仓" value="first"></el-option>
@@ -58,13 +93,13 @@
58 93
           </el-form-item> -->
59 94
 
60 95
           <el-form-item>
61
-            <el-button type="primary" icon="el-icon-search" @click="search"
96
+            <el-button type="primary" size="mini" icon="el-icon-search" @click="search"
62 97
               >查询</el-button
63 98
             >
64 99
           </el-form-item>
65 100
 
66 101
           <el-form-item>
67
-            <el-button type="primary" icon="el-icon-refresh-left" @click="reset"
102
+            <el-button type="primary" size="mini" icon="el-icon-refresh-left" @click="reset"
68 103
               >重置</el-button
69 104
             >
70 105
           </el-form-item>
@@ -74,7 +109,6 @@
74 109
           :data="alarmRecord"
75 110
           border
76 111
           style="width: 100%"
77
-          :header-cell-style="{ background: '#0064b9', color: '#c9f5fa' }"
78 112
         >
79 113
           <el-table-column
80 114
             align="center"
@@ -90,48 +124,48 @@
90 124
             align="center"
91 125
           > 
92 126
           </el-table-column>-->
93
-          <el-table-column prop="zskName" label="企业名称" align="center">
127
+          <el-table-column prop="policType" label="报警类型" align="center">
128
+            <template slot-scope="scope">
129
+              <div v-if="scope.row.policType === '1'">设备断开链接</div>
130
+              <div v-if="scope.row.policType === '2'">数量异动报警</div>
131
+            </template>
132
+          </el-table-column>
133
+          <el-table-column prop="zskName" label="报警设备ID" align="center">
94 134
           </el-table-column>
95 135
           <!-- <el-table-column prop="subTreasury" label="仓库名称" align="center">
96 136
           </el-table-column> -->
97
-          <el-table-column prop="houseName" label="仓房名称" align="center">
137
+          <el-table-column prop="houseName" label="报警设备名称" align="center">
98 138
           </el-table-column>
99
-          <el-table-column prop="operName" label="保管员" align="center">
139
+          <el-table-column prop="operName" label="所属产品名称" align="center">
100 140
           </el-table-column>
101
-          <el-table-column prop="phoneO" label="联系方式" align="center">
141
+          <el-table-column prop="phoneO" label="所属组织名称" align="center">
102 142
           </el-table-column>
103 143
 
104
-          <el-table-column prop="scanNum" label="扫描点数" align="center">
144
+          <el-table-column prop="scanNum" label="设备标签" align="center">
105 145
           </el-table-column>
106 146
 
107
-          <el-table-column prop="excNum" label="异常点数" align="center">
108
-          </el-table-column>
109 147
           <el-table-column prop="policTime" label="报警时间" align="center">
110 148
           </el-table-column>
111
-          <el-table-column prop="policType" label="报警类型" align="center">
112
-            <template slot-scope="scope">
113
-              <div v-if="scope.row.policType === '1'">设备断开链接</div>
114
-              <div v-if="scope.row.policType === '2'">数量异动报警</div>
115
-            </template>
149
+
150
+          <el-table-column prop="excNum" label="处理状态" align="center">
116 151
           </el-table-column>
117
-     <!-- <el-table-column align="center" label="处理" width="180">
152
+     <el-table-column align="center" label="操作" width="100">
118 153
             <template slot-scope="scope">
119
-              <el-button
154
+              <!-- <el-button
120 155
                 @click="handleCheck(scope.row)"
121 156
                 type="detailbtn"
122 157
                 class="fa fa-info-circle"
123 158
                 size="mini"
124 159
                 >查看</el-button
125
-              >
160
+              > -->
126 161
               <el-button
127
-                type="editbtn"
128
-                class="fa fa-edit"
162
+                type="text"
129 163
                 size="mini"
130
-                @click="fanKui(scope.row)"
131
-                >反馈</el-button
164
+                @click="chuli(scope.row)"
165
+                >处理</el-button
132 166
               >
133 167
             </template>
134
-          </el-table-column>  -->
168
+          </el-table-column> 
135 169
         </el-table>
136 170
         <el-pagination
137 171
           @size-change="handleSizeChange"
@@ -338,8 +372,85 @@
338 372
         </div>
339 373
       </el-dialog>
340 374
 
341
-      <el-dialog title="查看图片" :visible.sync="dialogVisible">
342
-        <img width="100%" :src="dialogImageUrl" alt />
375
+      <el-dialog :title="dialogTitle" :visible.sync="dialogVisible">
376
+        <el-form
377
+          :model="infoForm"
378
+          :rules="rules"
379
+          ref="infoForm"
380
+          label-width="120px"
381
+        >
382
+          <el-form-item label-width="0" v-if="dialogTitle=='处理报警结果'">
383
+            <el-input style="width:90%" v-model="infoForm.descrip" type="textarea" :rows="5"  placeholder="请输入处理结果"></el-input>
384
+          </el-form-item>
385
+
386
+        <div v-else>
387
+          <el-form-item label="报警类型:" prop="name">
388
+            <el-input style="width: 220px" v-model="infoForm.name"></el-input>
389
+            <!-- <el-select v-model="infoForm.name" placeholder="请选择">
390
+              <el-option label="区域一" value="shanghai"></el-option>
391
+              <el-option label="区域二" value="beijing"></el-option>
392
+            </el-select> -->
393
+          </el-form-item>
394
+          <el-form-item label="报警设备ID:" prop="name">
395
+            <el-input style="width: 220px" v-model="infoForm.name"></el-input>
396
+            <!-- <el-select v-model="infoForm.name" placeholder="请选择">
397
+              <el-option label="区域一" value="shanghai"></el-option>
398
+              <el-option label="区域二" value="beijing"></el-option>
399
+            </el-select> -->
400
+          </el-form-item>
401
+          <el-form-item label="报警设备名称:" prop="name">
402
+            <el-input style="width: 220px" v-model="infoForm.name"></el-input>
403
+            <!-- <el-select v-model="infoForm.name" placeholder="请选择">
404
+              <el-option label="区域一" value="shanghai"></el-option>
405
+              <el-option label="区域二" value="beijing"></el-option>
406
+            </el-select> -->
407
+          </el-form-item>
408
+          <el-form-item label="设备标签:" prop="name">
409
+            <el-input style="width: 220px" v-model="infoForm.name"></el-input>
410
+            <!-- <el-select v-model="infoForm.name" placeholder="请选择">
411
+              <el-option label="区域一" value="shanghai"></el-option>
412
+              <el-option label="区域二" value="beijing"></el-option>
413
+            </el-select> -->
414
+          </el-form-item>
415
+          <el-form-item label="报警状态:" prop="name">
416
+            <el-input style="width: 220px" v-model="infoForm.name"></el-input>
417
+            <!-- <el-select v-model="infoForm.name" placeholder="请选择">
418
+              <el-option label="区域一" value="shanghai"></el-option>
419
+              <el-option label="区域二" value="beijing"></el-option>
420
+            </el-select> -->
421
+          </el-form-item>
422
+          <el-form-item label="报警时间:" prop="name">
423
+              <el-date-picker
424
+                v-model="infoForm.time"
425
+                type="date"
426
+                format="yyyy-MM-dd HH:mm:ss"
427
+                value-format="yyyy-MM-dd HH:mm:ss"
428
+              />
429
+          </el-form-item>
430
+          <el-form-item label="处理结果:">
431
+            <el-input
432
+              style="width: 80%"
433
+              type="textarea"
434
+              v-model.trim="infoForm.descrip"
435
+              placeholder="请输入"
436
+            ></el-input>
437
+          </el-form-item>
438
+          <el-form-item label="处理时间:" prop="name">
439
+              <el-date-picker
440
+                v-model="infoForm.time"
441
+                type="date"
442
+                format="yyyy-MM-dd HH:mm:ss"
443
+                value-format="yyyy-MM-dd HH:mm:ss"
444
+              />
445
+          </el-form-item>
446
+
447
+
448
+        </div>
449
+        </el-form>
450
+        <div slot="footer" class="dialog-footer">
451
+          <el-button @click="dialogVisible = false">取 消</el-button>
452
+          <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
453
+        </div>
343 454
       </el-dialog>
344 455
     </d2-container>
345 456
   </div>
@@ -352,6 +463,7 @@ export default {
352 463
 
353 464
   data() {
354 465
     return {
466
+      infoForm:{},
355 467
       dialogTitle: "",
356 468
       //头部查询条件
357 469
       formInline: {
@@ -367,7 +479,7 @@ export default {
367 479
       },
368 480
       dialogBreakFeedback: false,
369 481
       //表格字段
370
-      alarmRecord: [],
482
+      alarmRecord: [{}],
371 483
       //分页
372 484
       pagination: {
373 485
         // 每页显示的条数
@@ -439,6 +551,11 @@ export default {
439 551
     };
440 552
   },
441 553
   methods: {
554
+    chuli(row){
555
+      // this.dialogTitle='处理报警结果'
556
+      this.dialogTitle='报警详情'
557
+      this.dialogVisible=true
558
+    },
442 559
     search() {},
443 560
     reset() {},
444 561
     canvasDataURL(path, obj, callback) {
@@ -911,11 +1028,11 @@ export default {
911 1028
     // width: calc(100% - 250px);
912 1029
     .nav {
913 1030
       padding: 10px 0 10px 10px;
914
-      color: #fff;
1031
+      // color: #fff;
915 1032
 
916 1033
       font-size: 14px;
917 1034
 
918
-      background: #004a93;
1035
+      background: #fff;
919 1036
     }
920 1037
     // .right_main {
921 1038
     //   border: 1px solid #67a7df;

+ 207 - 0
src/views/demo/equipmentManage/compontents/addDialog.vue

@@ -0,0 +1,207 @@
1
+<template>
2
+  <div>
3
+
4
+      <el-dialog :title="dialogTitle"  :visible.sync="dialogFormVisible" id="dialogStyle">
5
+        <el-form
6
+          :model="addForm"
7
+          :rules="rules"
8
+          ref="addForm"
9
+          label-width="120px"
10
+          :disabled="dialogTitle=='查看设备'"
11
+        >
12
+
13
+          <el-form-item label="设备ID:">
14
+            <el-input
15
+              style="width: 220px"
16
+              v-model.trim="addForm.id"
17
+              placeholder="请输入"
18
+            ></el-input>
19
+          </el-form-item>
20
+          <el-form-item label="设备名称:" prop="eqName">
21
+            <!-- <el-select v-model="addForm.name" placeholder="请选择">
22
+              <el-option label="区域一" value="shanghai"></el-option>
23
+              <el-option label="区域二" value="beijing"></el-option>
24
+            </el-select> -->
25
+            <el-input v-model="addForm.eqName" placeholder="请输入" style="width:220px"></el-input>
26
+          </el-form-item>
27
+          <el-form-item label="设备标签:">
28
+            <el-select v-model="addForm.labelName" placeholder="请选择" >
29
+              <el-option v-for="item in tagLists" :key="item.id" :label="item.labelName" :value="item.labelName">
30
+              </el-option>
31
+            </el-select>
32
+          </el-form-item>
33
+          <el-form-item label="所属产品:" prop="proName">
34
+          <el-select v-model="addForm.proName" placeholder="请选择" ref="selectTree">
35
+            <el-option
36
+              :key="addForm.proName"
37
+              :value="addForm.proName"
38
+              :label="addForm.label"
39
+              hidden
40
+            />
41
+            <el-tree
42
+              :data="typeLists"
43
+              :props="defaultProps"
44
+              node-key="id"
45
+              accordion
46
+              highlight-current
47
+              @node-click="handleNodeClick"
48
+            />
49
+          </el-select>
50
+          </el-form-item>
51
+          <el-form-item label="所属组织机构:">
52
+            <el-select v-model="addForm.orgName" placeholder="请选择" >
53
+              <el-option v-for="item in ckLists" :key="item.id" :label="item.orgName" :value="item.orgName">
54
+              </el-option>
55
+            </el-select>
56
+          </el-form-item>
57
+          <el-form-item label="描述:">
58
+            <el-input
59
+              style="width: 80%"
60
+              type="textarea"
61
+              v-model.trim="addForm.eqRemark"
62
+              placeholder="请输入"
63
+            ></el-input>
64
+          </el-form-item>
65
+        </el-form>
66
+        <div slot="footer" class="dialog-footer">
67
+          <el-button @click="dialogFormVisible = false">取 消</el-button>
68
+          <el-button type="primary" @click="submitForm('addForm')"
69
+            >确 定</el-button
70
+          >
71
+        </div>
72
+      </el-dialog>
73
+  </div>
74
+</template>
75
+<script>
76
+import api from "@/api";
77
+
78
+export default {
79
+    props:{
80
+        dialogTitle:''
81
+    },
82
+  data() {
83
+    return {
84
+      defaultProps: {
85
+        children: "children",
86
+        label: "productCategoryName",
87
+      },
88
+      addForm: {},
89
+      ckLists:[],
90
+      typeLists:[],
91
+      dialogFormVisible: false,
92
+      rules: {
93
+        id: [{ required: true, message: "请输入产品ID", trigger: "blur" }],
94
+        eqName: [{ required: true, message: "请选择设备名称", trigger: "blur" }],
95
+        name1: [{ required: true, message: "请选择设备标签", trigger: "blur" }],
96
+        proName: [
97
+          { required: true, message: "请选择所属产品", trigger: "blur" },
98
+        ],
99
+      },
100
+    };
101
+  },
102
+  created(){
103
+    // this.ckList()
104
+  },
105
+  methods: {
106
+    getInfo(row) {
107
+      this.addForm = row;
108
+    },
109
+    //获取编辑数据
110
+    getEditRow(row){
111
+      this.addForm=JSON.parse(JSON.stringify(row))
112
+    },
113
+    handleNodeClick(data) {
114
+      console.log(data);
115
+      this.$set(this.addForm,'proName',data.productCategoryName)
116
+      this.$set(this.addForm,'label',data.productCategoryName)
117
+      console.log(this.addForm);
118
+      // 使 input 失去焦点,并隐藏下拉框
119
+      this.$refs.selectTree.blur();
120
+    },
121
+    ckList() {
122
+      console.log(this.$parent.$parent.$parent);
123
+      this.ckLists=this.$parent.$parent.$parent.ckLists
124
+      this.typeLists=this.$parent.$parent.$parent.typeLists
125
+      this.tagLists=this.$parent.$parent.$parent.tagLists
126
+      // var data = {
127
+      //   storeTypeCode: 300002,
128
+      // };
129
+
130
+      // api
131
+      //   .ckList(data)
132
+      //   .then((res) => {
133
+      //     if (res.code == 200) {
134
+      //       this.ckLists = res.data;
135
+      //     }
136
+      //   })
137
+      //   .catch((err) => {
138
+      //     console.log(err);
139
+      //   });
140
+
141
+      // api
142
+      //   .productCategoryList()
143
+      //   .then((res) => {
144
+      //     if (res.code == 200) {
145
+      //       this.typeLists = res.data;
146
+      //     }
147
+      //   })
148
+      //   .catch((err) => {
149
+      //     console.log(err);
150
+      //   });
151
+    },
152
+    //新建产品提交
153
+    submitForm(formName) {
154
+      this.$refs[formName].validate((valid) => {
155
+        if (valid) {
156
+          if(this.dialogTitle=='新建设备'){
157
+            this.addForm.id=""
158
+            api.equipmentSu(this.addForm).then(res=>{
159
+              if (res.code == 200) {
160
+                this.$message.success("新建成功");
161
+                this.$parent.$parent.$parent.getList()
162
+                this.dialogFormVisible=false;
163
+              }
164
+            })
165
+          }else{
166
+            api.equipmentSu(this.addForm).then(res=>{
167
+              if (res.code == 200) {
168
+                this.$message.success("编辑成功");
169
+                this.dialogFormVisible=false;
170
+                this.$parent.$parent.$parent.getList()
171
+              }
172
+            })
173
+          }
174
+        } else {
175
+          console.log("error submit!!");
176
+          return false;
177
+        }
178
+      });
179
+    },
180
+  }
181
+};
182
+</script>
183
+<style lang="scss" scoped>
184
+::v-deep .avatar-uploader .el-upload {
185
+  border: 1px dashed #d9d9d9;
186
+  border-radius: 6px;
187
+  cursor: pointer;
188
+  position: relative;
189
+  overflow: hidden;
190
+}
191
+.avatar-uploader .el-upload:hover {
192
+  border-color: #008775;
193
+}
194
+.avatar-uploader-icon {
195
+  font-size: 28px;
196
+  color: #8c939d;
197
+  width: 100px;
198
+  height: 100px;
199
+  line-height: 100px;
200
+  text-align: center;
201
+}
202
+.avatar {
203
+  width: 178px;
204
+  height: 178px;
205
+  display: block;
206
+}
207
+</style>

+ 118 - 0
src/views/demo/equipmentManage/compontents/addDialogC.vue

@@ -0,0 +1,118 @@
1
+<template>
2
+  <div>
3
+
4
+      <el-dialog @close="addForm={}" :title="dialogTitle"  :visible.sync="dialogFormVisible" id="dialogStyle">
5
+        <el-form
6
+          :model="addForm"
7
+          :rules="rules"
8
+          ref="addForm"
9
+          label-width="120px"
10
+          :disabled="dialogTitle=='查看设备标签'"
11
+        >
12
+          <el-form-item label="标签名称:" prop="labelName" >
13
+            <!-- <el-select v-model="addForm.name" placeholder="请选择" >
14
+              <el-option label="区域一" value="shanghai"></el-option>
15
+              <el-option label="区域二" value="beijing"></el-option>
16
+            </el-select> -->
17
+            <el-input
18
+            style="width:220px"
19
+           
20
+              v-model.trim="addForm.labelName"
21
+              placeholder="请输入"
22
+            ></el-input>
23
+          </el-form-item>
24
+          <el-form-item label="备注:">
25
+            <el-input
26
+              style="width: 80%"
27
+              type="textarea"
28
+              v-model.trim="addForm.labelRemark"
29
+              placeholder="请输入"
30
+            ></el-input>
31
+          </el-form-item>
32
+        </el-form>
33
+        <div slot="footer" class="dialog-footer">
34
+          <el-button @click="dialogFormVisible = false">取 消</el-button>
35
+          <el-button type="primary" v-if="dialogTitle!='查看设备标签'" @click="submitForm('addForm')"
36
+            >确 定</el-button
37
+          >
38
+        </div>
39
+      </el-dialog>
40
+  </div>
41
+</template>
42
+<script>
43
+import api from "@/api";
44
+
45
+export default {
46
+    props:{
47
+        dialogTitle:'',
48
+        row:{}
49
+    },
50
+  data() {
51
+    return {
52
+      addForm: {},
53
+      dialogFormVisible: false,
54
+      rules: {
55
+        labelName: [{ required: true, message: "请输入标签名称", trigger: "blur" }],
56
+      },
57
+    };
58
+  },
59
+  methods: {
60
+    //获取编辑数据
61
+    getEditRow(row){
62
+      this.addForm=JSON.parse(JSON.stringify(row))
63
+    },
64
+    //新建产品提交
65
+    submitForm(formName) {
66
+      this.$refs[formName].validate((valid) => {
67
+        if (valid) {
68
+          if(this.dialogTitle=='新建设备标签'){
69
+            api.equipmentTagSu(this.addForm).then(res=>{
70
+              if (res.code == 200) {
71
+                this.$message.success("新建成功");
72
+                this.$parent.$parent.$parent.getList()
73
+                this.dialogFormVisible=false;
74
+              }
75
+            })
76
+          }else{
77
+            api.equipmentTagSu(this.addForm).then(res=>{
78
+              if (res.code == 200) {
79
+                this.$message.success("编辑成功");
80
+                this.dialogFormVisible=false;
81
+                this.$parent.$parent.$parent.getList()
82
+              }
83
+            })
84
+          }
85
+        } else {
86
+          console.log("error submit!!");
87
+          return false;
88
+        }
89
+      });
90
+    },
91
+  }
92
+};
93
+</script>
94
+<style lang="scss" scoped>
95
+::v-deep .avatar-uploader .el-upload {
96
+  border: 1px dashed #d9d9d9;
97
+  border-radius: 6px;
98
+  cursor: pointer;
99
+  position: relative;
100
+  overflow: hidden;
101
+}
102
+.avatar-uploader .el-upload:hover {
103
+  border-color: #008775;
104
+}
105
+.avatar-uploader-icon {
106
+  font-size: 28px;
107
+  color: #8c939d;
108
+  width: 100px;
109
+  height: 100px;
110
+  line-height: 100px;
111
+  text-align: center;
112
+}
113
+.avatar {
114
+  width: 178px;
115
+  height: 178px;
116
+  display: block;
117
+}
118
+</style>

+ 471 - 0
src/views/demo/equipmentManage/equipment/index.vue

@@ -0,0 +1,471 @@
1
+<template>
2
+  <div>
3
+    <d2-container>
4
+          <div class="nav">当前所在位置:首页>设备管理>设备</div>
5
+
6
+      <!-- <template slot="header">首页/数据查询</template> -->
7
+      <div class="main">
8
+        <div class="zt_right">
9
+          <!-- <template slot="header">首页/数据查询</template> -->
10
+          <div class="right_main">
11
+            <!-- <div class="right_title">
12
+              <i
13
+                class="fa fa-file-text"
14
+                aria-hidden="true"
15
+                style="padding-right: 5px"
16
+              ></i>
17
+              产品
18
+            </div> -->
19
+            <div class="right_title">
20
+              <span>设备</span> 
21
+            </div>
22
+            <div class="right_table">
23
+              <div class="flex-between">
24
+                <el-form
25
+                  :inline="true"
26
+                  :model="formInline"
27
+                  class="demo-form-inline"
28
+                  id="formLabel"
29
+                >
30
+                  <el-form-item label="组织名称:">
31
+                    <el-select size="mini" v-model="formInline.orgName" placeholder="请选择" >
32
+                      <el-option v-for="item in ckLists" :key="item.id" :label="item.orgName" :value="item.orgName">
33
+                      </el-option>
34
+                    </el-select>
35
+                  </el-form-item>
36
+                  <el-form-item label="产品名称:">
37
+          <el-select size="mini" v-model="formInline.proCategory" placeholder="请选择" ref="selectTree">
38
+            <el-option
39
+              :key="addForm.proCategory"
40
+              :value="addForm.proCategory"
41
+              :label="addForm.label"
42
+              hidden
43
+            />
44
+            <el-tree
45
+              :data="typeLists"
46
+              :props="defaultProps"
47
+              node-key="id"
48
+              accordion
49
+              highlight-current
50
+              @node-click="handleNodeClick"
51
+            />
52
+          </el-select>
53
+                  </el-form-item>
54
+                  <el-form-item label="设备名称:">
55
+                    <!-- <el-select
56
+                      v-model="formInline.houseNa"
57
+                      multiple
58
+                      placeholder="请选择"
59
+                     
60
+                    >
61
+                      <el-option label="1号仓" value="first"></el-option>
62
+                      <el-option label="2号仓" value="second"></el-option>
63
+                      <el-option label="3号仓" value="third"></el-option>
64
+                    </el-select> -->
65
+                    <el-input size="mini" v-model="formInline.eqName" placeholder="请输入"></el-input>
66
+                  </el-form-item>
67
+                  <el-form-item label="设备标签:">
68
+                    <el-select size="mini" v-model="formInline.labelName" placeholder="请选择" >
69
+                      <el-option v-for="item in tagLists" :key="item.id" :label="item.labelName" :value="item.labelName">
70
+                      </el-option>
71
+                    </el-select>
72
+                  </el-form-item>
73
+                  <el-form-item>
74
+                    <el-button
75
+                   size="mini"
76
+                      type="primary"
77
+                      icon="el-icon-search"
78
+                      @click="search"
79
+                      >查询</el-button
80
+                    >
81
+                  </el-form-item>
82
+
83
+                  <el-form-item>
84
+                    <el-button
85
+                 size="mini"
86
+                      type="primary"
87
+                      icon="el-icon-refresh-left"
88
+                      @click="reset"
89
+                      >重置</el-button
90
+                    >
91
+                  </el-form-item>
92
+                </el-form>
93
+                <div style="margin-top:-10px;margin-bottom:10px">
94
+                  <el-button type="primary" @click="goTag" size="mini"
95
+                    >设备标签</el-button
96
+                  >
97
+                  <el-button
98
+                 size="mini"
99
+                    type="primary"
100
+                    icon="el-icon-plus"
101
+                    @click="dialogTitle='新建设备';$refs.addDialog.dialogFormVisible = true;$refs.addDialog.ckList()"
102
+                    >新建设备</el-button
103
+                  >
104
+                </div>
105
+              </div>
106
+              <el-table
107
+                :data="tableData"
108
+                border
109
+                style="width: 100%"
110
+              >
111
+                <el-table-column
112
+                  align="center"
113
+                  label="序号"
114
+                  type="index"
115
+                  width="100px"
116
+                  :index="indexMethod"
117
+                  show-overflow-tooltip
118
+                ></el-table-column>
119
+                <el-table-column
120
+                  prop="id"
121
+                  label="设备ID"
122
+                  align="center"
123
+                >
124
+                </el-table-column>
125
+                <el-table-column
126
+                  prop="eqName"
127
+                  label="设备名称"
128
+                  align="center"
129
+                >
130
+                </el-table-column>
131
+                <el-table-column
132
+                  prop="proName"
133
+                  label="所属产品名称"
134
+                  align="center"
135
+                >
136
+                </el-table-column>
137
+                <el-table-column prop="phoneO" label="设备数量" align="center">
138
+                </el-table-column>
139
+
140
+                <el-table-column
141
+                  prop="orgName"
142
+                  label="所属组织名称"
143
+                  align="center"
144
+                >
145
+                </el-table-column>
146
+
147
+                <el-table-column
148
+                  prop="labelName"
149
+                  label="设备标签"
150
+                  align="center"
151
+                >
152
+                </el-table-column>
153
+                <el-table-column
154
+                  prop="eqStatus"
155
+                  label="状态"
156
+                  align="center"
157
+                >
158
+                </el-table-column>
159
+
160
+                <el-table-column
161
+                  prop="registerTime"
162
+                  label="注册时间"
163
+                  align="center"
164
+                >
165
+                </el-table-column>
166
+                <el-table-column
167
+                  prop="lastOnlineTime"
168
+                  label="最后上线时间"
169
+                  align="center"
170
+                >
171
+                </el-table-column>
172
+
173
+                <el-table-column label="操作" width="240" align="center">
174
+                  <template slot-scope="scope">
175
+                    <el-button
176
+                      type="primary"
177
+                      size="mini"
178
+                      plain
179
+                      @click="goDetail(scope.row)"
180
+                      >查看</el-button
181
+                    >
182
+                    <el-button type="warning" plain size="mini" @click="edit(scope.row)"
183
+                      >编辑</el-button
184
+                    >
185
+                    <el-button type="danger" plain size="mini" @click="del(scope.row)"
186
+                      >删除</el-button
187
+                    >
188
+                    <!-- <el-button @click="delecheck( scope.$index, scope.row)" type="detailbtn" class="fa fa-info-circle" size="mini">查看</el-button> -->
189
+                  </template>
190
+                </el-table-column>
191
+              </el-table>
192
+              <el-pagination
193
+                @size-change="handleSizeChange"
194
+                @current-change="handleCurrentChange"
195
+                :current-page="1"
196
+                :page-sizes="[10, 20, 30, 40]"
197
+                :page-size="pagination.pageSize"
198
+                layout="total, sizes, prev, pager, next, jumper"
199
+                :total="pagination.total"
200
+              >
201
+              </el-pagination>
202
+            </div>
203
+          </div>
204
+        </div>
205
+      </div>
206
+      <addDialog :dialogTitle="dialogTitle" ref="addDialog"/>
207
+    </d2-container>
208
+  </div>
209
+</template>
210
+<script>
211
+import addDialog from "../compontents/addDialog.vue";
212
+
213
+import api from "@/api";
214
+// 1  异常点   2  断开
215
+export default {
216
+  name: "product",
217
+  components: { addDialog },
218
+  data() {
219
+    return {
220
+            defaultProps: {
221
+        children: "children",
222
+        label: "productCategoryName",
223
+      },
224
+            ckLists:[],
225
+      typeLists:[],
226
+      tagLists:[],
227
+      addForm: {},
228
+      dialogFormVisible: false,
229
+      dialogTitle: "",
230
+      //头部查询条件
231
+      formInline: {
232
+      },
233
+
234
+      //表格字段
235
+      tableData: [{}],
236
+      //分页
237
+      pagination: {
238
+        // 每页显示的条数
239
+        pageSize: 10,
240
+        // 当前页
241
+        curPage: 1,
242
+        // 总数
243
+        total: 20,
244
+      },
245
+      rules: {
246
+        id: [{ required: true, message: "请输入产品ID", trigger: "blur" }],
247
+        name: [{ required: true, message: "请选择产品名称", trigger: "blur" }],
248
+        region: [
249
+          { required: true, message: "请选择产品分类", trigger: "blur" },
250
+        ],
251
+      },
252
+    };
253
+  },
254
+    created(){
255
+    this.ckList()
256
+  },
257
+  methods: {
258
+    //编辑
259
+    edit(row) {
260
+      this.$refs.addDialog.dialogFormVisible = true;
261
+      this.dialogTitle = "编辑设备";
262
+      this.editRow = row;
263
+      this.$refs.addDialog.getEditRow(row);
264
+    },
265
+    ckList() {
266
+      var data = {
267
+        storeTypeCode: 300002,
268
+      };
269
+
270
+      api
271
+        .ckList(data)
272
+        .then((res) => {
273
+          if (res.code == 200) {
274
+            this.ckLists = res.data;
275
+          }
276
+        })
277
+        .catch((err) => {
278
+          console.log(err);
279
+        });
280
+
281
+      api
282
+        .productCategoryList()
283
+        .then((res) => {
284
+          if (res.code == 200) {
285
+            this.typeLists = res.data;
286
+          }
287
+        })
288
+        .catch((err) => {
289
+          console.log(err);
290
+        });
291
+
292
+      api
293
+        .equipmentTagList({curPage:1,pageSize:99999})
294
+        .then((res) => {
295
+          if (res.code == 200) {
296
+            this.tagLists = res.data.records;
297
+          }
298
+        })
299
+        .catch((err) => {
300
+          console.log(err);
301
+        });
302
+    },
303
+    handleNodeClick(data) {
304
+      console.log(data);
305
+      this.$set(this.formInline,'proCategory',data.productCategoryName)
306
+      this.$set(this.formInline,'label',data.productCategoryName)
307
+      console.log(this.formInline);
308
+      // 使 input 失去焦点,并隐藏下拉框
309
+      this.$refs.selectTree.blur();
310
+    },
311
+    //删除
312
+    del(row){
313
+        this.$confirm('确认进行删除操作吗?', '删除提示', {
314
+          confirmButtonText: '确定',
315
+          cancelButtonText: '取消',
316
+          type: 'warning'
317
+        }).then(() => {
318
+          this.$message({
319
+            type: 'success',
320
+            message: '删除成功'
321
+          });
322
+        })
323
+    },
324
+    //查看
325
+    goDetail(row) {
326
+      this.$router.push({ path: "equipmentInfo",query:{id:row.id} });
327
+    },
328
+    //跳转产品分类
329
+    goTag() {
330
+      this.$router.push({ path: "equipmentTag" });
331
+    },
332
+    //图标上传
333
+    handleAvatarSuccess(res, file) {
334
+      this.imageUrl = URL.createObjectURL(file.raw);
335
+    },
336
+    // beforeAvatarUpload(file) {
337
+    //   const isJPG = file.type === 'image/jpeg';
338
+    //   const isLt2M = file.size / 1024 / 1024 < 2;
339
+
340
+    //   if (!isJPG) {
341
+    //     this.$message.error('上传头像图片只能是 JPG 格式!');
342
+    //   }
343
+    //   if (!isLt2M) {
344
+    //     this.$message.error('上传头像图片大小不能超过 2MB!');
345
+    //   }
346
+    //   return isJPG && isLt2M;
347
+    // },
348
+    //新建产品提交
349
+    submitForm(formName) {
350
+      this.$refs[formName].validate((valid) => {
351
+        if (valid) {
352
+          alert("submit!");
353
+        } else {
354
+          console.log("error submit!!");
355
+          return false;
356
+        }
357
+      });
358
+    },
359
+    search() {
360
+      this.getList()
361
+
362
+    },
363
+    reset() {
364
+      this.pagination.curPage=1;
365
+      this.pagination.pageSize=10;
366
+      this.formInline={}
367
+      this.getList()
368
+    },
369
+
370
+    //获取列表数据
371
+    getList() {
372
+      var condition = this.formInline;
373
+      condition = JSON.stringify(condition);
374
+      var data = {
375
+        pageIndex: this.pagination.curPage,
376
+        pageSize: this.pagination.pageSize,
377
+        condition: condition,
378
+      };
379
+      api.equipmentList(data)
380
+        .then((res) => {
381
+          if (res.code == 200) {
382
+            this.tableData = res.data.records;
383
+            this.pagination.pageSize = res.data.size;
384
+            this.pagination.total = res.data.total;
385
+          }
386
+        })
387
+        .catch((err) => {
388
+          console.log(err);
389
+        });
390
+    },
391
+
392
+    //表格序号
393
+    indexMethod(index) {
394
+      return (
395
+        (this.pagination.curPage - 1) * this.pagination.pageSize + index + 1
396
+      );
397
+    },
398
+    // 每页条数改变
399
+    handleSizeChange(val) {
400
+      this.pagination.pageSize = val;
401
+      this.getList();
402
+    },
403
+    // 当前页改变
404
+    handleCurrentChange(val) {
405
+      this.pagination.curPage = val;
406
+      this.getList();
407
+    },
408
+  },
409
+  mounted() {
410
+    this.getList();
411
+  },
412
+};
413
+</script>
414
+<style lang="scss" scoped>
415
+.main {
416
+  height: 100%;
417
+  display: flex;
418
+
419
+  .zt_right {
420
+    width: 100%;
421
+border: 1px solid #DEDEDE;
422
+border-radius: 6px;
423
+    // margin-left: 20px;
424
+    // width: calc(100% - 250px);
425
+    .right_title{
426
+      font-weight: bold;
427
+      font-size: 16px;
428
+      border-bottom:1px solid #ebeef5;
429
+      background-color: rgba(233, 244, 243, 0.5);
430
+      border-top-left-radius: 6px;
431
+      border-top-right-radius: 6px;
432
+      color: #008775;
433
+      border-bottom: 1px solid rgba(1, 164, 143, 0.3);
434
+      padding-left: 0;
435
+      span{
436
+        padding: 10px;
437
+        padding-bottom: 9px;
438
+        border-bottom: 2px solid #01a48f;
439
+
440
+      }
441
+    }
442
+
443
+  }
444
+}
445
+     .nav {
446
+      padding: 10px 0 10px 10px;
447
+      margin-bottom: 20px;
448
+      // color: #fff;
449
+
450
+      font-size: 14px;
451
+
452
+      background: #FFFFFF;
453
+      border: 1px solid #DEDEDE;
454
+    }
455
+.float-left {
456
+  float: left;
457
+}
458
+.float-right {
459
+  float: right;
460
+}
461
+#dialogStyle .el-select {
462
+  width: 100%;
463
+}
464
+.flex-between {
465
+  display: flex;
466
+  align-items: center;
467
+  justify-content: space-between;
468
+  flex-wrap: wrap;
469
+}
470
+
471
+</style>

+ 712 - 0
src/views/demo/equipmentManage/equipmentInfo/index.vue

@@ -0,0 +1,712 @@
1
+<template>
2
+  <div>
3
+    <d2-container>
4
+      <div class="main">
5
+        <div class="zt_right">
6
+          <!-- <template slot="header">首页/数据查询</template> -->
7
+          <div class="nav">当前所在位置:首页>设备管理>设备>设备详情</div>
8
+          <div class="">
9
+            <div class="nameTitle">
10
+              <i @click="goBack" class="el-icon-back"></i>
11
+              <span class="name">
12
+                产品名称:{{ info.proName }}</span
13
+              >
14
+              <!-- <span style="font-size:14px;margin-left:40px">设备数:<span style="color:#008775">30</span>
15
+              </span> -->
16
+            </div>
17
+            <el-tabs v-model="activeName" @tab-click="tabsClick">
18
+              <el-tab-pane label="基本信息" name="first">
19
+                <div class="infoTitle">
20
+                  <h5>设备信息</h5>
21
+                  <el-button
22
+                    icon="fa fa-edit"
23
+                    size="mini"
24
+                    type="primary"
25
+                    @click="$refs.addDialog.dialogFormVisible = true;$refs.addDialog.getInfo(this.info)"
26
+                    >编辑</el-button
27
+                  >
28
+                </div>
29
+                <detailTable
30
+                  ref="detailTable"
31
+                  :detail-table="basicInfo"
32
+                  :title="''"
33
+                />
34
+              </el-tab-pane>
35
+              <el-tab-pane label="运行数据" name="second">
36
+                <div class="topType">
37
+                  <span>测温湿度设备(原粮、原油)数据如下:</span>
38
+                  <span>测温湿度设备(成品原油)数据如下:</span>
39
+                  <span>空调设备参数如下:</span>
40
+                  <span>流量称设备参数如下:</span>
41
+                </div>
42
+                <div class="infoTitle">
43
+                  <h5>定时任务</h5>
44
+                  <el-button type="primary" size="mini">修改定时任务</el-button>
45
+                </div>
46
+                <div>任务一:</div>
47
+                <div>任务二:</div>
48
+                <h5 style="margin: 20px 0">运行数据</h5>
49
+                <div class="flex-between">
50
+                  <el-form
51
+                    :inline="true"
52
+                    :model="formTime"
53
+                    class="demo-form-inline"
54
+                    id="formLabel"
55
+                  >
56
+                    <el-form-item label="时间:">
57
+                      <el-select
58
+                        v-model="formTime.time"
59
+                        multiple
60
+                        placeholder="请选择"
61
+                        size="mini"
62
+                      >
63
+                        <el-option label="1号仓" value="first"></el-option>
64
+                        <el-option label="2号仓" value="second"></el-option>
65
+                        <el-option label="3号仓" value="third"></el-option>
66
+                      </el-select>
67
+                    </el-form-item>
68
+                    <el-form-item>
69
+                      <el-button
70
+                        size="mini"
71
+                        type="primary"
72
+                        icon="el-icon-search"
73
+                        >查询</el-button
74
+                      >
75
+                    </el-form-item>
76
+
77
+                    <el-form-item>
78
+                      <el-button
79
+                        size="mini"
80
+                        type="primary"
81
+                        icon="el-icon-refresh-left"
82
+                        @click="formTime.time = ''"
83
+                        >重置</el-button
84
+                      >
85
+                    </el-form-item>
86
+                  </el-form>
87
+                  <div style="line-height: 40px">
88
+                    <el-button size="mini" type="primary" @click="checkStart()"
89
+                      >开始检测</el-button
90
+                    >
91
+                  </div>
92
+                </div>
93
+                <el-table
94
+                  :data="tableData"
95
+                  border
96
+                  style="width: 100%"
97
+                  height="500px"
98
+                >
99
+                  <el-table-column
100
+                    align="center"
101
+                    label="序号"
102
+                    type="index"
103
+                    width="100px"
104
+                    :index="indexMethod"
105
+                    show-overflow-tooltip
106
+                  ></el-table-column>
107
+                  <el-table-column prop="zskName" label="产品ID" align="center">
108
+                  </el-table-column>
109
+                  <el-table-column
110
+                    prop="houseName"
111
+                    label="检测时间"
112
+                    align="center"
113
+                  >
114
+                  </el-table-column>
115
+                  <el-table-column
116
+                    prop="houseName"
117
+                    label="设备标签"
118
+                    align="center"
119
+                  >
120
+                  </el-table-column>
121
+                  <el-table-column
122
+                    prop="operName"
123
+                    label="所属仓房编码"
124
+                    align="center"
125
+                  >
126
+                  </el-table-column>
127
+                  <el-table-column
128
+                    prop="phoneO"
129
+                    label="设备数量"
130
+                    align="center"
131
+                  >
132
+                  </el-table-column>
133
+
134
+                  <el-table-column prop="scanNum" label="最高温" align="center">
135
+                  </el-table-column>
136
+
137
+                  <el-table-column prop="scanNum" label="最低温" align="center">
138
+                  </el-table-column>
139
+                  <el-table-column prop="scanNum" label="平均温" align="center">
140
+                  </el-table-column>
141
+                  <el-table-column label="操作" width="140" align="center">
142
+                    <template slot-scope="scope">
143
+                      <el-button
144
+                        type="text"
145
+                        size="mini"
146
+                        @click="checkDetail(scope.row)"
147
+                        >查看</el-button
148
+                      >
149
+                    </template>
150
+                  </el-table-column>
151
+                </el-table>
152
+              </el-tab-pane>
153
+              <el-tab-pane label="报警记录" name="fourth"></el-tab-pane>
154
+            </el-tabs>
155
+          </div>
156
+        </div>
157
+      </div>
158
+
159
+      <el-dialog
160
+        title="添加关联设备"
161
+        width="800px"
162
+        :visible.sync="dialogTableVisible"
163
+      >
164
+        <el-form
165
+          :inline="true"
166
+          :model="formInline"
167
+          class="demo-form-inline"
168
+          id="formLabel"
169
+        >
170
+          <el-form-item label="设备ID:">
171
+            <el-input
172
+              size="mini"
173
+              v-model="formInline.scanTime"
174
+              placeholder="请输入"
175
+            ></el-input>
176
+          </el-form-item>
177
+          <el-form-item label="设备名称:">
178
+            <el-select
179
+              size="mini"
180
+              v-model="formInline.houseName"
181
+              multiple
182
+              placeholder="请选择"
183
+            >
184
+              <el-option label="1号仓" value="first"></el-option>
185
+              <el-option label="2号仓" value="second"></el-option>
186
+              <el-option label="3号仓" value="third"></el-option>
187
+            </el-select>
188
+          </el-form-item>
189
+
190
+          <el-form-item>
191
+            <el-button
192
+              size="mini"
193
+              type="primary"
194
+              icon="el-icon-search"
195
+              @click="search"
196
+              >查询</el-button
197
+            >
198
+          </el-form-item>
199
+
200
+          <el-form-item>
201
+            <el-button
202
+              type="primary"
203
+              size="mini"
204
+              icon="el-icon-refresh-left"
205
+              @click="reset"
206
+              >重置</el-button
207
+            >
208
+          </el-form-item>
209
+        </el-form>
210
+
211
+        <el-table :data="alarmRecord" border style="width: 100%">
212
+          <el-table-column type="selection" align="center" width="55">
213
+          </el-table-column>
214
+          <el-table-column prop="zskName" label="设备ID"> </el-table-column>
215
+          <el-table-column prop="houseName" label="设备名称" align="center">
216
+          </el-table-column>
217
+          <el-table-column prop="operName" label="产品名称" align="center">
218
+          </el-table-column>
219
+          <el-table-column prop="phoneO" label="设备标识" align="center">
220
+          </el-table-column>
221
+        </el-table>
222
+        <el-pagination
223
+          @size-change="handleSizeChange1"
224
+          @current-change="handleCurrentChange1"
225
+          :current-page="1"
226
+          :page-sizes="[10, 20, 30, 40]"
227
+          :page-size="pagination1.pageSize"
228
+          layout="total, sizes, prev, pager, next, jumper"
229
+          :total="pagination1.total"
230
+        >
231
+        </el-pagination>
232
+        <div slot="footer" class="dialog-footer">
233
+          <el-button @click="dialogTableVisible = false">取 消</el-button>
234
+          <el-button type="primary" @click="sure">确 定</el-button>
235
+        </div>
236
+      </el-dialog>
237
+      <addDialog :dialogTitle="'设备基本信息'" ref="addDialog" />
238
+      <el-dialog title="检测详情" width="800px" :visible.sync="checkDialog">
239
+        <!-- <detailTable ref="detailTable" :detail-table="checkInfo" :title="''" /> -->
240
+        <div class="panel-height-add">
241
+          <div style="padding: 2px">
242
+            <div class="detBox">
243
+              <div
244
+                v-for="(item, i) in checkInfo"
245
+                :key="i"
246
+                class="divF"
247
+                :style="{
248
+                  'line-height':
249
+                    (item.val.length == 0 ? 1 : item.val.length) * 48 + 'px',
250
+                  height:
251
+                    (item.val.length == 0 ? 1 : item.val.length) * 48 + 'px',
252
+                }"
253
+              >
254
+                <div>
255
+                  <div>{{ item.name }}</div>
256
+                </div>
257
+                <div :class="item.name1 == undefined ? 'long' : ''">
258
+                  <el-tooltip
259
+                    v-for="(data, len) in item.val"
260
+                    :key="len"
261
+                    effect="dark"
262
+                    :content="data"
263
+                    :disabled="(data + '').length < 20"
264
+                    placement="top"
265
+                  >
266
+                    <div>{{ data == null ? "" : data }}</div>
267
+                  </el-tooltip>
268
+                </div>
269
+                <div v-if="item.name1 != undefined">
270
+                  <el-tooltip
271
+                    effect="dark"
272
+                    :content="item.name1"
273
+                    :disabled="(item.name1 + '').length < 13"
274
+                    placement="top"
275
+                  >
276
+                    <div>{{ item.name1 }}</div>
277
+                  </el-tooltip>
278
+                </div>
279
+                <div v-if="item.name1 != undefined">
280
+                  <el-tooltip
281
+                    v-for="(data, index) in item.val1"
282
+                    :key="index"
283
+                    effect="dark"
284
+                    :content="data"
285
+                    :disabled="(data + '').length < 22"
286
+                    placement="top"
287
+                  >
288
+                    <div>{{ data == null ? "" : data }}</div>
289
+                  </el-tooltip>
290
+                </div>
291
+                <div v-if="item.name1 != undefined">
292
+                  <el-tooltip
293
+                    effect="dark"
294
+                    :content="item.name2"
295
+                    :disabled="(item.name2 + '').length < 13"
296
+                    placement="top"
297
+                  >
298
+                    <div>{{ item.name2 }}</div>
299
+                  </el-tooltip>
300
+                </div>
301
+                <div v-if="item.name1 != undefined">
302
+                  <el-tooltip
303
+                    v-for="(data, index) in item.val2"
304
+                    :key="index"
305
+                    effect="dark"
306
+                    :content="data"
307
+                    :disabled="(data + '').length < 22"
308
+                    placement="top"
309
+                  >
310
+                    <div>{{ data == null ? "" : data }}</div>
311
+                  </el-tooltip>
312
+                </div>
313
+              </div>
314
+            </div>
315
+          </div>
316
+        </div>
317
+        <el-table :data="alarmRecord" border style="width: 100%">
318
+          <el-table-column prop="zskName" label="设备ID"> </el-table-column>
319
+          <el-table-column prop="houseName" label="设备名称" align="center">
320
+          </el-table-column>
321
+          <el-table-column prop="operName" label="产品名称" align="center">
322
+          </el-table-column>
323
+          <el-table-column prop="phoneO" label="设备标识" align="center">
324
+          </el-table-column>
325
+        </el-table>
326
+      </el-dialog>
327
+    </d2-container>
328
+  </div>
329
+</template>
330
+<script>
331
+import addDialog from "../compontents/addDialog.vue";
332
+import api from "@/api";
333
+
334
+import detailTable from "@/components/detailTable/index.vue";
335
+export default {
336
+  name: "productInfo",
337
+  components: { detailTable, addDialog },
338
+  data() {
339
+    return {
340
+      info:{},
341
+      checkDialog: false,
342
+      dialogTableVisible: false,
343
+      formInline: {},
344
+      formTime: {},
345
+      tableData: [{}],
346
+      productData: [{}],
347
+      activeName: "first",
348
+      basicInfo: [
349
+        {
350
+          name: "设备ID",
351
+          val: [""],
352
+          name1: "设备名称",
353
+          val1: [""],
354
+        },
355
+        {
356
+          name: "产品名称",
357
+          val: [""],
358
+          name1: "产品分类",
359
+          val1: [""],
360
+        },
361
+        {
362
+          name: "所属组织机构",
363
+          val: [""],
364
+          name1: "设备状态",
365
+          val1: [""],
366
+        },
367
+        {
368
+          name: "最后上线时间",
369
+          val: [""],
370
+          name1: "设备标签",
371
+          val1: [""],
372
+        },
373
+        {
374
+          name: "最后上线时间",
375
+          val: [""],
376
+          name1: "创建时间",
377
+          val1: [""],
378
+        },
379
+        {
380
+          name: "描述",
381
+          val: [""],
382
+        },
383
+      ],
384
+      checkInfo: [
385
+        {
386
+          name: "检测时间",
387
+          val: [""],
388
+        },
389
+        {
390
+          name: "最高温",
391
+          val: [""],
392
+          name1: "最低温",
393
+          val1: [""],
394
+          name2: "平均温",
395
+          val2: [""],
396
+        },
397
+        {
398
+          name: "1层均温",
399
+          val: [""],
400
+          name1: "2层均温",
401
+          val1: [""],
402
+          name2: "3层均温",
403
+          val2: [""],
404
+        },
405
+      ],
406
+      //分页
407
+      pagination: {
408
+        // 每页显示的条数
409
+        pageSize: 10,
410
+        // 当前页
411
+        curPage: 1,
412
+        // 总数
413
+        total: 20,
414
+      },
415
+      //弹框分页
416
+      pagination1: {
417
+        // 每页显示的条数
418
+        pageSize: 10,
419
+        // 当前页
420
+        curPage: 1,
421
+        // 总数
422
+        total: 20,
423
+      },
424
+    };
425
+  },
426
+  created(){
427
+    this.getBasic()
428
+  },
429
+  methods: {
430
+    getBasic(){
431
+            api.equipmentDetail(this.$route.query.id).then(res=>{
432
+          if(res.code==200){
433
+            this.info=res.data
434
+            this.basicInfo=[
435
+        {
436
+          name: "设备ID",
437
+          val: [this.info.id],
438
+          name1: "设备名称",
439
+          val1: [this.info.eqName],
440
+        },
441
+        {
442
+          name: "产品名称",
443
+          val: [this.info.proName],
444
+          name1: "产品分类",
445
+          val1: [this.info.proCategory],
446
+        },
447
+        {
448
+          name: "所属组织机构",
449
+          val: [this.info.orgName],
450
+          name1: "设备状态",
451
+          val1: [this.info.eqStatus],
452
+        },
453
+        {
454
+          name: "最后上线时间",
455
+          val: [this.info.lastOnlineTime],
456
+          name1: "设备标签",
457
+          val1: [this.info.labelName],
458
+        },
459
+        {
460
+          name: "最后上线时间",
461
+          val: [this.info.lastOnlineTime],
462
+          name1: "创建时间",
463
+          val1: [this.info.registerTime],
464
+        },
465
+        {
466
+          name: "描述",
467
+          val: [this.info.eqRemark],
468
+        },
469
+      ]
470
+          }
471
+        })
472
+    },
473
+    // 查看检测信息
474
+    checkDetail(row) {
475
+      this.checkDialog = true;
476
+    },
477
+    //检测开始
478
+    checkStart() {
479
+      this.$confirm("确认发送温湿度检测请求?", "检测操作提示", {
480
+        confirmButtonText: "确定",
481
+        cancelButtonText: "取消",
482
+        type: "warning",
483
+      }).then(() => {
484
+        this.$message({
485
+          type: "success",
486
+          message: "发送成功",
487
+        });
488
+      });
489
+    },
490
+    //取消关联
491
+    cancelMatch(row) {
492
+      this.$confirm("确认进行取消关联操作吗?", "取消关联提示", {
493
+        confirmButtonText: "确定",
494
+        cancelButtonText: "取消",
495
+        type: "warning",
496
+      }).then(() => {
497
+        this.$message({
498
+          type: "success",
499
+          message: "取消关联成功",
500
+        });
501
+      });
502
+    },
503
+    // 返回
504
+    goBack() {
505
+      this.$router.go(-1);
506
+    },
507
+    tabsClick() {},
508
+
509
+    //表格序号
510
+    indexMethod(index) {
511
+      return (
512
+        (this.pagination.curPage - 1) * this.pagination.pageSize + index + 1
513
+      );
514
+    },
515
+    // 每页条数改变
516
+    handleSizeChange(val) {
517
+      this.pagination.pageSize = val;
518
+      this.getList();
519
+    },
520
+    // 当前页改变
521
+    handleCurrentChange(val) {
522
+      this.pagination.curPage = val;
523
+      this.getList();
524
+    },
525
+    // 每页条数改变
526
+    handleSizeChange1(val) {
527
+      this.pagination1.pageSize = val;
528
+      this.getList();
529
+    },
530
+    // 当前页改变
531
+    handleCurrentChange1(val) {
532
+      this.pagination1.curPage = val;
533
+      this.getList();
534
+    },
535
+  },
536
+  mounted() {},
537
+};
538
+</script>
539
+<style lang="scss" scoped>
540
+.main {
541
+  height: 100%;
542
+  display: flex;
543
+
544
+  .zt_right {
545
+    width: 100%;
546
+    // margin-left: 20px;
547
+    // width: calc(100% - 250px);
548
+    .nav {
549
+      padding: 10px 0 10px 10px;
550
+
551
+      font-size: 14px;
552
+
553
+      background: #fff;
554
+    }
555
+    .nameTitle {
556
+      // width: 100%;
557
+      font-size: 14px;
558
+      background: #fff;
559
+      padding: 20px 0 30px 20px;
560
+      margin-top: 10px;
561
+      i {
562
+        font-weight: bold;
563
+        font-size: 16px;
564
+        cursor: pointer;
565
+      }
566
+      .name {
567
+        font-weight: bold;
568
+        border-bottom: 2px solid #008775;
569
+        color: #008775;
570
+      }
571
+    }
572
+  }
573
+}
574
+::v-deep .el-tabs {
575
+  background: #fff;
576
+  padding: 0 20px;
577
+}
578
+::v-deep .el-table--border {
579
+  border-color: none !important ;
580
+}
581
+
582
+.infoTitle {
583
+  width: 100%;
584
+  // border-bottom: 1px solid #e6e6e6;
585
+  display: flex;
586
+  align-items: center;
587
+  justify-content: space-between;
588
+  padding-bottom: 10px;
589
+  h5 {
590
+    margin: 0;
591
+    // padding-left:20px;
592
+  }
593
+  i {
594
+    color: #008775;
595
+    padding-right: 20px;
596
+    padding-top: 10px;
597
+    font-size: 14px;
598
+    cursor: pointer;
599
+  }
600
+}
601
+.topType {
602
+  color: #f56c6c;
603
+  margin-bottom: 20px;
604
+  span {
605
+    margin-right: 30px;
606
+    display: inline-block;
607
+    padding-right: 50px;
608
+    background-color: #fbc4c4;
609
+    cursor: pointer;
610
+  }
611
+}
612
+.flex-between {
613
+  display: flex;
614
+  // align-items: center;
615
+  justify-content: space-between;
616
+  margin-bottom: -10px;
617
+}
618
+
619
+.panel-height-add {
620
+  //   overflow: auto;
621
+  background-color: #ffffff;
622
+  //   box-shadow: 0px 4px 12px 0px rgba(0, 0, 0, 0.3);
623
+  margin-bottom: 20px;
624
+
625
+  .infoTitle {
626
+    width: 100%;
627
+    // border-bottom: 1px solid #e6e6e6;
628
+    display: flex;
629
+    align-items: center;
630
+    justify-content: space-between;
631
+
632
+    h5 {
633
+      margin: 0;
634
+      padding-left: 20px;
635
+    }
636
+    i {
637
+      color: #008775;
638
+      padding-right: 20px;
639
+      padding-top: 10px;
640
+      font-size: 14px;
641
+      cursor: pointer;
642
+    }
643
+  }
644
+
645
+  .detBox {
646
+    width: 100%;
647
+    border-left: 1px solid #e6e6e6;
648
+    border-top: 1px solid #e6e6e6;
649
+    margin-bottom: 30px;
650
+    .one {
651
+      line-height: 48px;
652
+    }
653
+    .two {
654
+      line-height: 96px;
655
+    }
656
+    .divF {
657
+      width: 100%;
658
+
659
+      display: flex;
660
+      //   align-items: center;
661
+      border-bottom: 1px solid #e6e6e6;
662
+
663
+      > div {
664
+        > div:last-child {
665
+          border-bottom: none !important;
666
+        }
667
+
668
+        div {
669
+          line-height: 48px;
670
+          height: 48px;
671
+          border-bottom: 1px solid #e6e6e6;
672
+          // padding-left: 10px;
673
+        }
674
+      }
675
+    }
676
+
677
+    .divF > div > div:last-child {
678
+      border: none;
679
+    }
680
+
681
+    .divF > div:nth-child(odd) {
682
+      width: 15%;
683
+      text-align: center;
684
+      background: #fafafa;
685
+      font-size: 14px;
686
+      div {
687
+        width: 100%;
688
+        overflow: hidden; /*超出部分隐藏*/
689
+        white-space: nowrap; /*不换行*/
690
+        text-overflow: ellipsis; /*超出部分文字以...显示*/
691
+      }
692
+    }
693
+
694
+    .divF > div:nth-child(even) {
695
+      width: 35%;
696
+      border-right: 1px solid #e6e6e6;
697
+      border-left: 1px solid #e6e6e6;
698
+      text-align: center;
699
+      font-size: 14px;
700
+      div {
701
+        width: 100%;
702
+        overflow: hidden; /*超出部分隐藏*/
703
+        white-space: nowrap; /*不换行*/
704
+        text-overflow: ellipsis; /*超出部分文字以...显示*/
705
+      }
706
+    }
707
+    .long {
708
+      width: 136% !important;
709
+    }
710
+  }
711
+}
712
+</style>

+ 315 - 0
src/views/demo/equipmentManage/equipmentTag/index.vue

@@ -0,0 +1,315 @@
1
+<template>
2
+  <div>
3
+    <d2-container>
4
+      <!-- <template slot="header">首页/数据查询</template> -->
5
+          <div class="nav">当前所在位置:首页>设备管理>设备标签</div>
6
+
7
+      <div class="main">
8
+        <div class="zt_right">
9
+          <!-- <template slot="header">首页/数据查询</template> -->
10
+          <div class="right_main">
11
+            <!-- <div class="right_title">
12
+              <i
13
+                class="fa fa-file-text"
14
+                aria-hidden="true"
15
+                style="padding-right: 5px"
16
+              ></i>
17
+              产品
18
+            </div> -->
19
+            <div class="right_title">
20
+              <span>设备标签</span> 
21
+            </div>
22
+            <div class="right_table">
23
+              <div class="flex-between">
24
+                <el-form></el-form>
25
+                <div style="margin-bottom: 20px">
26
+                  <el-button
27
+                    type="primary"
28
+                    icon="el-icon-plus"
29
+                    @click="
30
+                      $refs.addDialogC.dialogFormVisible = true;
31
+                      dialogTitle = '新建设备标签';
32
+                    "
33
+                    >新建设备标签</el-button
34
+                  >
35
+                </div>
36
+              </div>
37
+              <el-table
38
+                :data="tableData"
39
+                style="width: 100%"
40
+                row-key="id"
41
+                border
42
+                default-expand-all
43
+                :tree-props="{
44
+                  children: 'children',
45
+                  hasChildren: 'hasChildren',
46
+                }"
47
+              >
48
+                <el-table-column
49
+                  align="center"
50
+                  label="序号"
51
+                  type="index"
52
+                  width="100px"
53
+                  :index="indexMethod"
54
+                  show-overflow-tooltip
55
+                ></el-table-column>
56
+                <el-table-column prop="labelName" label="标签名称" align="center">
57
+                </el-table-column>
58
+
59
+                <el-table-column
60
+                  prop="labelRemark"
61
+                  label="备注"
62
+                  align="center"
63
+                  show-overflow-tooltip
64
+                >
65
+                </el-table-column>
66
+                <el-table-column label="操作" width="240" align="center">
67
+                  <template slot-scope="scope">
68
+                    <el-button
69
+                      type="primary"
70
+                      size="mini"
71
+                      plain
72
+                      @click="seeTag(scope.row)"
73
+                      >查看</el-button
74
+                    >
75
+                    <el-button type="warning" plain size="mini" @click="edit(scope.row)"
76
+                      >编辑</el-button
77
+                    >
78
+                    <el-button type="danger" plain size="mini" @click="del(scope.row)"
79
+                      >删除</el-button
80
+                    >
81
+                    <!-- <el-button @click="delecheck( scope.$index, scope.row)" type="detailbtn" class="fa fa-info-circle" size="mini">查看</el-button> -->
82
+                  </template>
83
+                </el-table-column>
84
+              </el-table>
85
+              <el-pagination
86
+                @size-change="handleSizeChange"
87
+                @current-change="handleCurrentChange"
88
+                :current-page="1"
89
+                :page-sizes="[10, 20, 30, 40]"
90
+                :page-size="pagination.pageSize"
91
+                layout="total, sizes, prev, pager, next, jumper"
92
+                :total="pagination.total"
93
+              >
94
+              </el-pagination>
95
+            </div>
96
+          </div>
97
+        </div>
98
+      </div>
99
+      <addDialogC :row="editRow" :dialogTitle="dialogTitle" ref="addDialogC" />
100
+    </d2-container>
101
+  </div>
102
+</template>
103
+<script>
104
+import addDialogC from "../compontents/addDialogC.vue";
105
+
106
+import api from "@/api";
107
+// 1  异常点   2  断开
108
+export default {
109
+  name: "product",
110
+  components: { addDialogC },
111
+  data() {
112
+    return {
113
+      editRow: {},
114
+      addForm: {},
115
+      dialogFormVisible: false,
116
+      dialogTitle: "",
117
+      //头部查询条件
118
+      formInline: {
119
+        cfName: "",
120
+        scanTime: "",
121
+      },
122
+
123
+      //表格字段
124
+      tableData: [{}],
125
+      //分页
126
+      pagination: {
127
+        // 每页显示的条数
128
+        pageSize: 10,
129
+        // 当前页
130
+        curPage: 1,
131
+        // 总数
132
+        total: 20,
133
+      },
134
+      rules: {
135
+        id: [{ required: true, message: "请输入产品ID", trigger: "blur" }],
136
+        name: [{ required: true, message: "请选择产品名称", trigger: "blur" }],
137
+        region: [
138
+          { required: true, message: "请选择产品分类", trigger: "blur" },
139
+        ],
140
+      },
141
+    };
142
+  },
143
+  methods: {
144
+    //编辑
145
+    edit(row) {
146
+      this.$refs.addDialogC.dialogFormVisible = true;
147
+      this.dialogTitle = "编辑设备标签";
148
+      this.editRow = row;
149
+      this.$refs.addDialogC.getEditRow(row);
150
+    },
151
+    //删除
152
+    del(row) {
153
+      this.$confirm("确认进行删除操作吗?", "删除提示", {
154
+        confirmButtonText: "确定",
155
+        cancelButtonText: "取消",
156
+        type: "warning",
157
+      }).then(() => {
158
+        api.equipmentTagDel(row.id).then(res=>{
159
+          if(res.code==200){
160
+            this.$message({
161
+              type: "success",
162
+              message: "删除成功",
163
+            });
164
+            this.getList()
165
+          }else{
166
+            this.$message({
167
+              type: "error",
168
+              message: res.msg,
169
+            });
170
+          }
171
+        })
172
+      });
173
+    },
174
+    //查看
175
+    seeTag(row) {
176
+      this.$refs.addDialogC.dialogFormVisible = true;
177
+      this.dialogTitle = '查看设备标签';
178
+      this.editRow = row;
179
+      this.$refs.addDialogC.getEditRow(row);
180
+    },
181
+    //跳转产品分类
182
+    goClassify() {
183
+      this.$router.push({ path: "productClassify" });
184
+    },
185
+    //图标上传
186
+    handleAvatarSuccess(res, file) {
187
+      this.imageUrl = URL.createObjectURL(file.raw);
188
+    },
189
+    // beforeAvatarUpload(file) {
190
+    //   const isJPG = file.type === 'image/jpeg';
191
+    //   const isLt2M = file.size / 1024 / 1024 < 2;
192
+
193
+    //   if (!isJPG) {
194
+    //     this.$message.error('上传头像图片只能是 JPG 格式!');
195
+    //   }
196
+    //   if (!isLt2M) {
197
+    //     this.$message.error('上传头像图片大小不能超过 2MB!');
198
+    //   }
199
+    //   return isJPG && isLt2M;
200
+    // },
201
+    //新建产品提交
202
+    submitForm(formName) {
203
+      this.$refs[formName].validate((valid) => {
204
+        if (valid) {
205
+          alert("submit!");
206
+        } else {
207
+          console.log("error submit!!");
208
+          return false;
209
+        }
210
+      });
211
+    },
212
+    search() {},
213
+    reset() {},
214
+
215
+    //获取列表数据
216
+    getList() {
217
+      var condition = {};
218
+      condition = JSON.stringify(condition);
219
+      var data = {
220
+        pageIndex: this.pagination.curPage,
221
+        pageSize: this.pagination.pageSize,
222
+        condition: condition,
223
+      };
224
+      api
225
+        .equipmentTagList(data)
226
+        .then((res) => {
227
+          if (res.code == 200) {
228
+            this.tableData = res.data.records;
229
+            this.pagination.pageSize = res.data.size;
230
+            this.pagination.total = res.data.total;
231
+          }
232
+        })
233
+        .catch((err) => {
234
+          console.log(err);
235
+        });
236
+    },
237
+
238
+    //表格序号
239
+    indexMethod(index) {
240
+      return (
241
+        (this.pagination.curPage - 1) * this.pagination.pageSize + index + 1
242
+      );
243
+    },
244
+    // 每页条数改变
245
+    handleSizeChange(val) {
246
+      this.pagination.pageSize = val;
247
+      this.getList();
248
+    },
249
+    // 当前页改变
250
+    handleCurrentChange(val) {
251
+      this.pagination.curPage = val;
252
+      this.getList();
253
+    },
254
+  },
255
+  mounted() {
256
+    this.getList();
257
+  },
258
+};
259
+</script>
260
+<style lang="scss" scoped>
261
+.main {
262
+  height: 100%;
263
+  display: flex;
264
+
265
+  .zt_right {
266
+    width: 100%;
267
+border: 1px solid #DEDEDE;
268
+border-radius: 6px;
269
+    // margin-left: 20px;
270
+    // width: calc(100% - 250px);
271
+    .right_title{
272
+      font-weight: bold;
273
+      font-size: 16px;
274
+      border-bottom:1px solid #ebeef5;
275
+      background-color: rgba(233, 244, 243, 0.5);
276
+      border-top-left-radius: 6px;
277
+      border-top-right-radius: 6px;
278
+      color: #008775;
279
+      border-bottom: 1px solid rgba(1, 164, 143, 0.3);
280
+      padding-left: 0;
281
+      span{
282
+        padding: 10px;
283
+        padding-bottom: 9px;
284
+        border-bottom: 2px solid #01a48f;
285
+
286
+      }
287
+    }
288
+
289
+  }
290
+}
291
+     .nav {
292
+      padding: 10px 0 10px 10px;
293
+      margin-bottom: 20px;
294
+      // color: #fff;
295
+
296
+      font-size: 14px;
297
+
298
+      background: #FFFFFF;
299
+      border: 1px solid #DEDEDE;
300
+    }
301
+.float-left {
302
+  float: left;
303
+}
304
+.float-right {
305
+  float: right;
306
+}
307
+#dialogStyle .el-select {
308
+  width: 100%;
309
+}
310
+.flex-between {
311
+  display: flex;
312
+  // align-items: center;
313
+  justify-content: space-between;
314
+}
315
+</style>

+ 416 - 120
src/views/demo/parameManagement/alarmParame/index.vue

@@ -2,12 +2,14 @@
2 2
   <div>
3 3
     <d2-container>
4 4
       <!-- <template slot="header">首页/报警参数</template> -->
5
+      <div class="nav">当前所在位置:首页>参数管理>报警参数</div>
6
+
5 7
       <div class="main">
6 8
         <div class="left">
7 9
           <!-- <el-input placeholder="输入关键字进行过滤" v-model="filterText">
8 10
           </el-input> -->
9
-
10
-        <el-tree
11
+          <div class="leftTitle">组织机构</div>
12
+          <el-tree
11 13
             class="filter-tree"
12 14
             :filter-node-method="filterNode"
13 15
             v-loading="loading"
@@ -22,94 +24,309 @@
22 24
             ref="tree"
23 25
           >
24 26
             <span class="custom-tree-node" slot-scope="{ node, data }">
25
-              <span v-if="node.level==1"> <i :class="node.icon"></i>{{ node.label }} </span>
26
-               <span v-if="node.level==2"> <i :class="node.icon"></i>{{ node.label }} </span>
27
-                <span v-if="node.level==3"> <i :class="node.icon"></i>{{ node.label }} </span>
28
-                 <span v-if="node.level==4"> <i></i>{{ node.label }} </span>
27
+              <span v-if="node.level == 1">
28
+                <i :class="node.icon"></i>{{ node.label }}
29
+              </span>
30
+              <span v-if="node.level == 2">
31
+                <i :class="node.icon"></i>{{ node.label }}
32
+              </span>
33
+              <span v-if="node.level == 3">
34
+                <i :class="node.icon"></i>{{ node.label }}
35
+              </span>
36
+              <span v-if="node.level == 4"> <i></i>{{ node.label }} </span>
29 37
             </span>
30 38
           </el-tree>
31 39
         </div>
32 40
         <div class="right">
33
-           <div class="nav">当前所在位置:首页>报警参数</div>
34 41
           <div class="right_main">
35
-            <div class="right_title"><i class="fa fa-lightbulb-o" aria-hidden="true" style="padding-right:5px"></i>报警参数</div>
42
+            <div class="right_title">
43
+              <span>报警配置参数列表</span>
44
+            </div>
36 45
             <div class="right_table">
37
-          <div class="addBtn">
38
-            <el-button type="primary" icon="el-icon-plus" @click="addTantou"
39
-              >修改新增报警规则</el-button
40
-            >
41
-          </div>
42
-          <el-form :model="formData" ref="formData" id="formLabel">
43
-            <el-row style="margin-top: 10px">
44
-              <el-col :span="12" :offset="2">
45
-                <el-form-item label="报警启用状态:">
46
-                  <el-radio-group v-model="formData.status">
47
-                    <el-radio :label="1" :disabled="disabled">开</el-radio>
48
-                    <el-radio :label="0" :disabled="disabled">关</el-radio>
49
-                  </el-radio-group>
50
-                </el-form-item>
51
-              </el-col>
52
-            </el-row>
53
-            <el-row :gutter="10">
54
-              <el-col :span="10" :offset="2">
55
-                <h4>电话通知:</h4>
56
-                <p>
57
-                  电话1:
58
-                  <span>{{ formData.telephoneNumber1 }}</span>
59
-                </p>
60
-                <p>
61
-                  电话2:
62
-                  <span>{{ formData.telephoneNumber2 }}</span>
63
-                </p>
64
-              </el-col>
65
-              <el-col :span="10" :offset="2">
66
-                <h4>短信通知:</h4>
67
-                <p>
68
-                  电话1:
69
-                  <span>{{ formData.smsNumber1 }}</span>
70
-                </p>
71
-                <p>
72
-                  电话2:
73
-                  <span>{{ formData.smsNumber2 }}</span>
74
-                </p>
75
-              </el-col>
76
-            </el-row>
77
-          </el-form>
78
-          </div>
46
+              <div class="addBtn">
47
+                <el-button type="primary" icon="el-icon-plus" @click="addTantou"
48
+                  >新建温度报警装置</el-button
49
+                >
50
+              </div>
51
+              <el-table :data="alarmRecord" border style="width: 100%">
52
+                <el-table-column
53
+                  align="center"
54
+                  label="序号"
55
+                  type="index"
56
+                  width="100px"
57
+                  :index="indexMethod"
58
+                ></el-table-column>
59
+                <el-table-column prop="zskName" label="产品ID" align="center">
60
+                </el-table-column>
61
+                <el-table-column
62
+                  prop="houseName"
63
+                  label="预警名称"
64
+                  align="center"
65
+                >
66
+                </el-table-column>
67
+                <el-table-column
68
+                  prop="operName"
69
+                  label="是否开启"
70
+                  align="center"
71
+                >
72
+                </el-table-column>
73
+                <el-table-column prop="phoneO" label="设备数量" align="center">
74
+                </el-table-column>
75
+
76
+                <el-table-column prop="scanNum" label="预警阈值" align="center">
77
+                </el-table-column>
78
+                <el-table-column label="操作" width="140" align="center">
79
+                  <template slot-scope="scope">
80
+                    <el-button
81
+                      type="text"
82
+                      size="mini"
83
+                      @click="goDetail(scope.row)"
84
+                      >查看</el-button
85
+                    >
86
+                    <el-button type="text" size="mini">关闭</el-button>
87
+                    <el-button type="text" size="mini" @click="del(scope.row)"
88
+                      >删除</el-button
89
+                    >
90
+                    <!-- <el-button @click="delecheck( scope.$index, scope.row)" type="detailbtn" class="fa fa-info-circle" size="mini">查看</el-button> -->
91
+                  </template>
92
+                </el-table-column>
93
+              </el-table>
94
+              <el-pagination
95
+                @size-change="handleSizeChange"
96
+                @current-change="handleCurrentChange"
97
+                :current-page="1"
98
+                :page-sizes="[10, 20, 30, 40]"
99
+                :page-size="pagination.pageSize"
100
+                layout="total, sizes, prev, pager, next, jumper"
101
+                :total="pagination.total"
102
+              >
103
+              </el-pagination>
104
+            </div>
79 105
           </div>
80 106
         </div>
81 107
       </div>
82 108
     </d2-container>
83 109
 
84 110
     <!-- //弹框 -->
85
-    <el-dialog title="新增修改报警规则" :visible.sync="dialogAlarm" id="dialogStyle">
86
-      <el-form :model="dialog">
87
-        <el-form-item label="报警启用状态:" :label-width="formLabelWidth">
88
-          <el-radio-group v-model="dialog.name">
89
-            <el-radio label="开"></el-radio>
90
-            <el-radio label="关"></el-radio>
91
-          </el-radio-group>
111
+    <el-dialog
112
+      title="新建温度报警配置信息"
113
+      :visible.sync="dialogAlarm"
114
+      id="dialogStyle"
115
+    >
116
+      <el-form :model="addForm" label-width="110px" :inline="true" :rules="rules"
117
+          ref="addForm">
118
+        <el-form-item
119
+          style="position: absolute; right: 48px; top: 2px"
120
+          label="温度预警阈值:"
121
+          
122
+          prop="wdyj"
123
+        >
124
+          <el-input
125
+            style="width: 100px"
126
+            size="mini"
127
+            v-model="dialog.name"
128
+            autocomplete="off"
129
+          ></el-input>
92 130
         </el-form-item>
93
-        <h4>电话通知:</h4>
94
-        <el-form-item label="电话1:" :label-width="formLabelWidth">
95
-          <el-input v-model="dialog.name" autocomplete="off"></el-input>
131
+        <el-form-item
132
+          style="position: absolute; right: 268px; top: 2px"
133
+          label="湿度预警阈值:"
134
+          
135
+          prop="sdyj"
136
+        >
137
+          <el-input
138
+            style="width: 100px"
139
+            size="mini"
140
+            v-model="dialog.name"
141
+            autocomplete="off"
142
+          ></el-input>
96 143
         </el-form-item>
97
-        <el-form-item label="电话2:" :label-width="formLabelWidth">
98
-          <el-input v-model="dialog.name" autocomplete="off"></el-input>
144
+        <el-form-item label="报警类型:" prop="bjlx">
145
+          <el-select
146
+            v-model="addForm.houseName"
147
+            placeholder="请选择"
148
+          >
149
+            <el-option label="1号仓" value="first"></el-option>
150
+            <el-option label="2号仓" value="second"></el-option>
151
+            <el-option label="3号仓" value="third"></el-option>
152
+          </el-select>
99 153
         </el-form-item>
100
-         <h4>短信通知:</h4>
101
-        <el-form-item label="电话1:" :label-width="formLabelWidth">
102
-          <el-input v-model="dialog.name" autocomplete="off"></el-input>
154
+        <el-form-item
155
+          label="温度预警阈值:"
156
+          
157
+          prop="wdyj"
158
+        >
159
+          <el-input
160
+          style="width:220px"
161
+            v-model="dialog.name"
162
+            autocomplete="off"
163
+          ></el-input>
103 164
         </el-form-item>
104
-        <el-form-item label="电话2:" :label-width="formLabelWidth">
105
-          <el-input v-model="dialog.name" autocomplete="off"></el-input>
165
+        <el-form-item label="是否开启:"  prop="sfkq">
166
+          <el-select
167
+            v-model="addForm.sfkq"
168
+            placeholder="请选择"
169
+          >
170
+            <el-option label="1号仓" value="first"></el-option>
171
+            <el-option label="2号仓" value="second"></el-option>
172
+            <el-option label="3号仓" value="third"></el-option>
173
+          </el-select>
106 174
         </el-form-item>
175
+        <div style="display:flex;justify-content: space-between">
176
+          <el-form-item label="预警设备:"  prop="sfkq">
177
+            <el-button type="primary" icon="el-icon-plus" @click="addSbDialog=true">选择设备</el-button>
178
+          </el-form-item>
179
+          <div style="line-height:40px">已选择<span style="color:#008775;padding-top:13px">12</span>个</div>
180
+        </div>
107 181
       </el-form>
182
+      <el-table
183
+        :data="tableData"
184
+        style="width: 100%">
185
+        <el-table-column
186
+          prop="date"
187
+           align="center"
188
+          label="设备ID">
189
+        </el-table-column>
190
+        <el-table-column
191
+          prop="name"
192
+           align="center"
193
+          label="设备名称">
194
+        </el-table-column>
195
+        <el-table-column
196
+          prop="address"
197
+           align="center"
198
+           show-overflow-tooltip
199
+          min-width="100"
200
+          label="所属产品名称">
201
+        </el-table-column>
202
+        <el-table-column
203
+          prop="address"
204
+           align="center"
205
+          label="设备标签">
206
+        </el-table-column>
207
+        <el-table-column
208
+          prop="address"
209
+          min-width="100"
210
+
211
+           align="center"
212
+          label="所属仓房编码">
213
+        </el-table-column>
214
+        <el-table-column
215
+          prop="address"
216
+           align="center"
217
+          label="状态">
218
+        </el-table-column>
219
+                <el-table-column label="操作" width="80" align="center">
220
+                  <template slot-scope="scope">
221
+                    <el-button type="danger" plain size="mini" @click="del(scope.row)"
222
+                      >删除</el-button
223
+                    >
224
+                    <!-- <el-button @click="delecheck( scope.$index, scope.row)" type="detailbtn" class="fa fa-info-circle" size="mini">查看</el-button> -->
225
+                  </template>
226
+                </el-table-column>  
227
+      </el-table>
108 228
       <div slot="footer" class="dialog-footer">
109 229
         <el-button @click="dialogAlarm = false">取 消</el-button>
110 230
         <el-button type="primary" @click="determine()">确 定</el-button>
111 231
       </div>
112 232
     </el-dialog>
233
+      <el-dialog
234
+        title="添加设备"
235
+        width="1100px"
236
+        :visible.sync="addSbDialog"
237
+        id="dialogStyle"
238
+      >
239
+        <el-form
240
+          :inline="true"
241
+          :model="addSbForm"
242
+          class="demo-form-inline"
243
+          id="formLabel"
244
+        >
245
+          <el-form-item label="产品名称:">
246
+            <el-select
247
+              size="mini"
248
+              v-model="addSbForm.houseName"
249
+              multiple
250
+              placeholder="请选择"
251
+            >
252
+              <el-option label="1号仓" value="first"></el-option>
253
+              <el-option label="2号仓" value="second"></el-option>
254
+              <el-option label="3号仓" value="third"></el-option>
255
+            </el-select>
256
+          </el-form-item>
257
+          <el-form-item label="设备名称:">
258
+            <el-select
259
+              size="mini"
260
+              v-model="addSbForm.houseName"
261
+              multiple
262
+              placeholder="请选择"
263
+            >
264
+              <el-option label="1号仓" value="first"></el-option>
265
+              <el-option label="2号仓" value="second"></el-option>
266
+              <el-option label="3号仓" value="third"></el-option>
267
+            </el-select>
268
+          </el-form-item>
269
+          <el-form-item label="设备标签:">
270
+            <el-select
271
+              size="mini"
272
+              v-model="addSbForm.houseName"
273
+              multiple
274
+              placeholder="请选择"
275
+            >
276
+              <el-option label="1号仓" value="first"></el-option>
277
+              <el-option label="2号仓" value="second"></el-option>
278
+              <el-option label="3号仓" value="third"></el-option>
279
+            </el-select>
280
+          </el-form-item>
281
+          <el-form-item>
282
+            <el-button
283
+              size="mini"
284
+              type="primary"
285
+              icon="el-icon-search"
286
+              @click="search"
287
+              >查询</el-button
288
+            >
289
+          </el-form-item>
290
+
291
+          <el-form-item>
292
+            <el-button
293
+              type="primary"
294
+              size="mini"
295
+              icon="el-icon-refresh-left"
296
+              @click="reset"
297
+              >重置</el-button
298
+            >
299
+          </el-form-item>
300
+        </el-form>
301
+
302
+        <el-table :data="alarmRecord" border style="width: 100%">
303
+          <el-table-column type="selection"  align="center" width="55">
304
+          </el-table-column>
305
+          <el-table-column prop="zskName" align="center" label="设备ID"> </el-table-column>
306
+          <el-table-column prop="houseName" label="设备名称" align="center">
307
+          </el-table-column>
308
+          <el-table-column prop="operName" label="产品名称" align="center">
309
+          </el-table-column>
310
+          <el-table-column prop="phoneO" label="设备标识" align="center">
311
+          </el-table-column>
312
+          <el-table-column prop="phoneO" label="所属仓房编码" align="center">
313
+          </el-table-column>
314
+        </el-table>
315
+        <el-pagination
316
+          @size-change="handleSizeChange1"
317
+          @current-change="handleCurrentChange1"
318
+          :current-page="1"
319
+          :page-sizes="[10, 20, 30, 40]"
320
+          :page-size="pagination1.pageSize"
321
+          layout="total, sizes, prev, pager, next, jumper"
322
+          :total="pagination1.total"
323
+        >
324
+        </el-pagination>
325
+        <div slot="footer" class="dialog-footer">
326
+          <el-button @click="addSbDialog = false">取 消</el-button>
327
+          <el-button type="primary" @click="sure">确 定</el-button>
328
+        </div>
329
+      </el-dialog>
113 330
   </div>
114 331
 </template>
115 332
 <script>
@@ -118,7 +335,41 @@ export default {
118 335
   name: "hardwareParame",
119 336
   data() {
120 337
     return {
121
-      disabled:false,
338
+      addSbForm:{},
339
+      addSbDialog:false,
340
+      tableData:[{}],
341
+      addForm:{},
342
+      rules: {
343
+        wdyj: [{ required: true, message: "请输入温度预警阈值", trigger: "blur" }],
344
+        sdyj: [{ required: true, message: "请输入湿度预警阈值", trigger: "blur" }],
345
+        bjlx: [
346
+          { required: true, message: "请选择报警类型", trigger: "blur" },
347
+        ],
348
+        sfkq: [
349
+          { required: true, message: "请选择是否开启", trigger: "blur" },
350
+        ],
351
+      },
352
+      //表格字段
353
+      alarmRecord: [{}],
354
+      //分页
355
+      pagination: {
356
+        // 每页显示的条数
357
+        pageSize: 10,
358
+        // 当前页
359
+        curPage: 1,
360
+        // 总数
361
+        total: 20,
362
+      },
363
+      //弹框分页
364
+      pagination1: {
365
+        // 每页显示的条数
366
+        pageSize: 10,
367
+        // 当前页
368
+        curPage: 1,
369
+        // 总数
370
+        total: 20,
371
+      },
372
+      disabled: false,
122 373
       // label宽度
123 374
       formLabelWidth: "120px",
124 375
       // 弹框默认关闭
@@ -129,18 +380,16 @@ export default {
129 380
         children: "children",
130 381
         label: "orgName",
131 382
       },
132
-       loading: false,
383
+      loading: false,
133 384
       //默认展开的节点
134 385
       defaultExpanded: [],
135 386
       cfbh: "",
136 387
       //左侧树数据
137
-      leftList: [
138
-        
139
-      ],
388
+      leftList: [],
140 389
       // 日期插件
141 390
       //
142 391
 
143
-      formInline: {
392
+      addForm: {
144 393
         sbNames: "",
145 394
       },
146 395
       formData: {
@@ -166,11 +415,29 @@ export default {
166 415
   //   },
167 416
   // },
168 417
   methods: {
418
+    // 每页条数改变
419
+    handleSizeChange1(val) {
420
+      this.pagination1.pageSize = val;
421
+    },
422
+    // 当前页改变
423
+    handleCurrentChange1(val) {
424
+      this.pagination1.curPage = val;
425
+    },
426
+    // 每页条数改变
427
+    handleSizeChange(val) {
428
+      this.pagination.pageSize = val;
429
+      this.getList();
430
+    },
431
+    // 当前页改变
432
+    handleCurrentChange(val) {
433
+      this.pagination.curPage = val;
434
+      this.getList();
435
+    },
169 436
     //获取左侧树
170 437
     getLeftTree() {
171 438
       this.loading = true;
172 439
       let params = {
173
-        orgName:this.orgName,
440
+        orgName: this.orgName,
174 441
       };
175 442
 
176 443
       api
@@ -181,7 +448,6 @@ export default {
181 448
             this.leftList = [];
182 449
             if (res.data) {
183 450
               this.leftList = res.data;
184
-           
185 451
 
186 452
               // if (res.data[0].id) {
187 453
               //   this.defaultExpanded.push(res.data[0].id);
@@ -192,7 +458,7 @@ export default {
192 458
 
193 459
               //     this.cfbh =
194 460
               //       res.data[0].children[0].children[0].children[0].id;
195
-                 
461
+
196 462
               //     setTimeout(() => {
197 463
               //          document.getElementsByClassName("el-tree-node__content")[0].style.display="none"
198 464
               //       document.getElementsByClassName("el-tree-node__content")[1].style.display="none"
@@ -203,19 +469,18 @@ export default {
203 469
               //       this.getList();
204 470
               //   }
205 471
               // }
206
-               var lastLevel=res.data;
207
-              if(lastLevel.length>0){
208
-                lastLevel=res.data[0]
209
-                while(lastLevel.children&&lastLevel.children.length>0){
210
-                  lastLevel=lastLevel.children[0];
472
+              var lastLevel = res.data;
473
+              if (lastLevel.length > 0) {
474
+                lastLevel = res.data[0];
475
+                while (lastLevel.children && lastLevel.children.length > 0) {
476
+                  lastLevel = lastLevel.children[0];
211 477
                 }
212
-           
478
+
213 479
                 this.defaultExpanded.push(lastLevel.id);
214
-                this.cfbh=lastLevel.id
215
-                setTimeout(()=>{
216
-                    this.$refs.tree.setCurrentKey(this.cfbh);
217
-                
218
-                },200)
480
+                this.cfbh = lastLevel.id;
481
+                setTimeout(() => {
482
+                  this.$refs.tree.setCurrentKey(this.cfbh);
483
+                }, 200);
219 484
                 this.getList();
220 485
               }
221 486
             }
@@ -232,21 +497,20 @@ export default {
232 497
           console.log(error);
233 498
         });
234 499
     },
235
-     //点击左侧树节点
236
-    handleNodeClick(data,node) {
237
-    
238
-    // if(node.level ===4){
239
-    //  this.cfbh=data.id;
240
-    //  console.log(  this.cfbh,";;;")
241
-    // }
242
-    // this.getList();
243
-      if(node.childNodes.length===0){
244
-            this.cfbh = data.id;
500
+    //点击左侧树节点
501
+    handleNodeClick(data, node) {
502
+      // if(node.level ===4){
503
+      //  this.cfbh=data.id;
504
+      //  console.log(  this.cfbh,";;;")
505
+      // }
506
+      // this.getList();
507
+      if (node.childNodes.length === 0) {
508
+        this.cfbh = data.id;
245 509
         console.log(this.cfbh, ";;;");
246 510
         this.getList();
247 511
       }
248 512
     },
249
-     filterNode(value, data) {
513
+    filterNode(value, data) {
250 514
       if (!value) return true;
251 515
       return data.orgName.indexOf(value) !== -1;
252 516
     },
@@ -254,16 +518,15 @@ export default {
254 518
     //   if (!value) return true;
255 519
     //   return data.label.indexOf(value) !== -1;
256 520
     // },
257
-     //获取列表数据
521
+    //获取列表数据
258 522
     getList() {
259
-     
260
-     var houseId=this.cfbh
261
-    
523
+      var houseId = this.cfbh;
524
+
262 525
       api
263 526
         .alarmParams(houseId)
264 527
         .then((res) => {
265 528
           if (res.code == 200) {
266
-            console.log(res,"报警参数")
529
+            console.log(res, "报警参数");
267 530
           }
268 531
         })
269 532
         .catch((err) => {
@@ -285,49 +548,82 @@ export default {
285 548
     //弹框确定按钮
286 549
     determine() {},
287 550
   },
288
-  mounted(){
551
+  mounted() {
289 552
     this.getLeftTree();
290
-  }
553
+  },
291 554
 };
292 555
 </script>
293 556
 <style lang="scss" scoped>
294 557
 .main {
295 558
   height: 100%;
296 559
   display: flex;
297
-  .left{
298
-    height:calc(100vh - 144px)
560
+  .left {
561
+    height: calc(100vh - 131px);
562
+    .leftTitle {
563
+      background: linear-gradient(0deg, #008574 0%, #01a48f 100%);
564
+      border-top-left-radius: 6px;
565
+      border-top-right-radius: 6px;
566
+      padding: 10px;
567
+      font-size: 16px;
568
+      color: #fff;
569
+      font-weight: bold;
570
+    }
299 571
   }
300 572
   .right {
301 573
     margin-left: 20px;
302 574
     width: calc(100% - 280px);
303
-    .nav {
304
-      padding: 10px 0 10px 10px;
305
-      color: #fff;
306 575
 
307
-      font-size: 14px;
308
-
309
-      background: #004a93;
576
+    border: 1px solid #dedede;
577
+    background-color: #fff;
578
+    border-radius: 6px;
579
+    .right_main {
580
+      border-top-left-radius: 6px;
581
+      border-top-right-radius: 6px;
582
+    }
583
+    .right_title {
584
+      font-weight: bold;
585
+      font-size: 16px;
586
+      border-bottom: 1px solid #ebeef5;
587
+      background-color: rgba(233, 244, 243, 0.5);
588
+      border-top-left-radius: 6px;
589
+      border-top-right-radius: 6px;
590
+      color: #008775;
591
+      border-bottom: 1px solid rgba(1, 164, 143, 0.3);
592
+      padding-left: 0;
593
+      span {
594
+        padding: 10px;
595
+        padding-bottom: 9px;
596
+        border-bottom: 2px solid #01a48f;
597
+      }
310 598
     }
311 599
   }
312 600
   .addBtn {
313
-    margin-bottom: 20px;
601
+    margin-bottom: 10px;
602
+    margin-top: -10px;
603
+    text-align: right;
314 604
   }
315
-   h4 {
605
+  h4 {
316 606
     font-size: 16px;
317 607
     font-weight: 700;
318 608
     line-height: 40px;
319
-    color:#fff;
609
+    // color:#fff;
320 610
   }
321 611
   p {
322
-    color: #525357;
612
+    // color: #525357;
323 613
     font-size: 14px;
324 614
     line-height: 40px;
325 615
     position: relative;
326
-    color:#fff;
616
+    color: #fff;
327 617
   }
328 618
 }
329
- 
330
- 
619
+.nav {
620
+  padding: 10px 0 10px 10px;
621
+  margin-bottom: 20px;
622
+  // color: #fff;
331 623
 
624
+  font-size: 14px;
332 625
 
626
+  background: #ffffff;
627
+  border: 1px solid #dedede;
628
+}
333 629
 </style>

+ 5 - 8
src/views/demo/parameManagement/dataDictionary/index.vue

@@ -8,14 +8,14 @@
8 8
       <div class="zt_right">
9 9
         <div class="nav">当前所在位置:首页>数据字典</div>
10 10
         <div class="right_main">
11
-          <div class="right_title">
11
+          <!-- <div class="right_title">
12 12
             <i
13 13
               class="fa fa-book"
14 14
               aria-hidden="true"
15 15
               style="padding-right: 5px"
16 16
             ></i
17 17
             >数据字典
18
-          </div>
18
+          </div> -->
19 19
           <div class="right_table">
20 20
             <el-form
21 21
               :inline="true"
@@ -68,10 +68,7 @@
68 68
               border
69 69
               style="width: 100%"
70 70
               row-key="id"
71
-             
72
-              
73 71
               :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
74
-              :header-cell-style="{ background: '#0064b9', color: '#c9f5fa' }"
75 72
             >
76 73
               <el-table-column
77 74
                 prop='enumName'
@@ -359,7 +356,7 @@ export default {
359 356
        this.title = "新增字典";
360 357
       this.dicDialog = true;
361 358
       this.parentId=0;
362
-      
359
+      this.btnType=1
363 360
       
364 361
     },
365 362
     //新建子项
@@ -424,11 +421,11 @@ export default {
424 421
     // width: calc(100% - 250px);
425 422
     .nav {
426 423
       padding: 10px 0 10px 10px;
427
-      color: #fff;
424
+      // color: #fff;
428 425
 
429 426
       font-size: 14px;
430 427
 
431
-      background: #004a93;
428
+      background: #fff;
432 429
     }
433 430
     // .right_main {
434 431
     //   border: 1px solid #67a7df;

+ 630 - 0
src/views/demo/parameManagement/setTimeOut/index.vue

@@ -0,0 +1,630 @@
1
+<template>
2
+  <div>
3
+    <d2-container>
4
+      <!-- <template slot="header">首页/报警参数</template> -->
5
+      <div class="nav">当前所在位置:首页>参数管理>定时任务设置</div>
6
+
7
+      <div class="main">
8
+        <div class="left">
9
+          <!-- <el-input placeholder="输入关键字进行过滤" v-model="filterText">
10
+          </el-input> -->
11
+          <div class="leftTitle">组织机构</div>
12
+          <el-tree
13
+            class="filter-tree"
14
+            :filter-node-method="filterNode"
15
+            v-loading="loading"
16
+            :data="leftList"
17
+            node-key="id"
18
+            :props="defaultProps"
19
+            :expand-on-click-node="false"
20
+            @node-click="handleNodeClick"
21
+            default-expand-all
22
+            highlight-current
23
+            :default-expanded-keys="this.defaultExpanded"
24
+            ref="tree"
25
+          >
26
+            <span class="custom-tree-node" slot-scope="{ node, data }">
27
+              <span v-if="node.level == 1">
28
+                <i :class="node.icon"></i>{{ node.label }}
29
+              </span>
30
+              <span v-if="node.level == 2">
31
+                <i :class="node.icon"></i>{{ node.label }}
32
+              </span>
33
+              <span v-if="node.level == 3">
34
+                <i :class="node.icon"></i>{{ node.label }}
35
+              </span>
36
+              <span v-if="node.level == 4"> <i></i>{{ node.label }} </span>
37
+            </span>
38
+          </el-tree>
39
+        </div>
40
+        <div class="right">
41
+          <div class="right_main">
42
+            <div class="right_title">
43
+              <span>定时任务列表</span>
44
+            </div>
45
+            <div class="right_table">
46
+              <div class="addBtn">
47
+                <el-button type="primary" icon="el-icon-plus" @click="addTantou"
48
+                  >新建定时任务</el-button
49
+                >
50
+              </div>
51
+              <el-table :data="alarmRecord" border style="width: 100%">
52
+                <el-table-column
53
+                  align="center"
54
+                  label="序号"
55
+                  type="index"
56
+                  width="100px"
57
+                  :index="indexMethod"
58
+                ></el-table-column>
59
+                <el-table-column prop="zskName" label="任务名称" align="center">
60
+                </el-table-column>
61
+                <el-table-column
62
+                  prop="houseName"
63
+                  label="计划检测时间"
64
+                  align="center"
65
+                >
66
+                </el-table-column>
67
+                <el-table-column
68
+                  prop="operName"
69
+                  label="设备数量"
70
+                  align="center"
71
+                >
72
+                </el-table-column>
73
+                <el-table-column prop="phoneO" label="创建时间" align="center">
74
+                </el-table-column>
75
+
76
+                <el-table-column prop="scanNum" label="是否开启" align="center">
77
+                </el-table-column>
78
+                <el-table-column label="操作" width="140" align="center">
79
+                  <template slot-scope="scope">
80
+                    <el-button
81
+                      type="text"
82
+                      size="mini"
83
+                      @click="goDetail(scope.row)"
84
+                      >查看</el-button
85
+                    >
86
+                    <el-button type="text" size="mini">编辑</el-button>
87
+                    <el-button type="text" size="mini" @click="del(scope.row)"
88
+                      >删除</el-button
89
+                    >
90
+                    <!-- <el-button @click="delecheck( scope.$index, scope.row)" type="detailbtn" class="fa fa-info-circle" size="mini">查看</el-button> -->
91
+                  </template>
92
+                </el-table-column>
93
+              </el-table>
94
+              <el-pagination
95
+                @size-change="handleSizeChange"
96
+                @current-change="handleCurrentChange"
97
+                :current-page="1"
98
+                :page-sizes="[10, 20, 30, 40]"
99
+                :page-size="pagination.pageSize"
100
+                layout="total, sizes, prev, pager, next, jumper"
101
+                :total="pagination.total"
102
+              >
103
+              </el-pagination>
104
+            </div>
105
+          </div>
106
+        </div>
107
+      </div>
108
+    </d2-container>
109
+
110
+    <!-- //弹框 -->
111
+    <el-dialog
112
+      title="定时任务设置"
113
+      :visible.sync="dialogAlarm"
114
+      id="dialogStyle"
115
+    >
116
+      <el-form :model="addForm" label-width="110px" :inline="true" :rules="rules"
117
+          ref="addForm">
118
+        <!-- <el-form-item
119
+          style="position: absolute; right: 48px; top: 2px"
120
+          label="温度预警阈值:"
121
+          
122
+          prop="wdyj"
123
+        >
124
+          <el-input
125
+            style="width: 100px"
126
+            size="mini"
127
+            v-model="dialog.name"
128
+            autocomplete="off"
129
+          ></el-input>
130
+        </el-form-item>
131
+        <el-form-item
132
+          style="position: absolute; right: 268px; top: 2px"
133
+          label="湿度预警阈值:"
134
+          
135
+          prop="sdyj"
136
+        >
137
+          <el-input
138
+            style="width: 100px"
139
+            size="mini"
140
+            v-model="dialog.name"
141
+            autocomplete="off"
142
+          ></el-input>
143
+        </el-form-item> -->
144
+        
145
+        <el-form-item
146
+          label="任务名称:"
147
+          prop="taskName"
148
+        >
149
+          <el-input
150
+          style="width:220px"
151
+          placeholder="请输入"
152
+            v-model="addForm.taskName"
153
+            autocomplete="off"
154
+          ></el-input>
155
+        </el-form-item>
156
+        <el-form-item label="是否开启:"  prop="sfkq">
157
+          <el-select
158
+            v-model="addForm.sfkq"
159
+            placeholder="请选择"
160
+          >
161
+            <el-option label="1号仓" value="first"></el-option>
162
+            <el-option label="2号仓" value="second"></el-option>
163
+            <el-option label="3号仓" value="third"></el-option>
164
+          </el-select>
165
+        </el-form-item>
166
+        <el-form-item label="任务触发时间:"  prop="sfkq">
167
+          <el-select
168
+            v-model="addForm.sfkq1"
169
+            placeholder="请选择"
170
+          >
171
+            <el-option label="每小时" value="first"></el-option>
172
+            <el-option label="2号仓" value="second"></el-option>
173
+            <el-option label="3号仓" value="third"></el-option>
174
+          </el-select>
175
+        </el-form-item>
176
+        <div style="display:flex;justify-content: space-between">
177
+          <el-form-item label="任务设备:"  prop="sfkq">
178
+            <el-button type="primary" icon="el-icon-plus" @click="addSbDialog=true">选择设备</el-button>
179
+          </el-form-item>
180
+          <div style="line-height:40px">已选择<span style="color:#008775;padding-top:13px">12</span>个</div>
181
+        </div>
182
+      </el-form>
183
+      <el-table
184
+        :data="tableData"
185
+        style="width: 100%">
186
+        <el-table-column
187
+          prop="date"
188
+           align="center"
189
+          label="设备ID">
190
+        </el-table-column>
191
+        <el-table-column
192
+          prop="name"
193
+           align="center"
194
+          label="设备名称">
195
+        </el-table-column>
196
+        <el-table-column
197
+          prop="address"
198
+           align="center"
199
+           show-overflow-tooltip
200
+          min-width="100"
201
+          label="所属产品名称">
202
+        </el-table-column>
203
+        <el-table-column
204
+          prop="address"
205
+           align="center"
206
+          label="设备标签">
207
+        </el-table-column>
208
+        <el-table-column
209
+          prop="address"
210
+          min-width="100"
211
+
212
+           align="center"
213
+          label="所属仓房编码">
214
+        </el-table-column>
215
+        <el-table-column
216
+          prop="address"
217
+           align="center"
218
+          label="状态">
219
+        </el-table-column>
220
+                <el-table-column label="操作" width="80" align="center">
221
+                  <template slot-scope="scope">
222
+                    <el-button type="danger" plain size="mini" @click="del(scope.row)"
223
+                      >删除</el-button
224
+                    >
225
+                    <!-- <el-button @click="delecheck( scope.$index, scope.row)" type="detailbtn" class="fa fa-info-circle" size="mini">查看</el-button> -->
226
+                  </template>
227
+                </el-table-column>  
228
+      </el-table>
229
+      <div slot="footer" class="dialog-footer">
230
+        <el-button @click="dialogAlarm = false">取 消</el-button>
231
+        <el-button type="primary" @click="determine()">确 定</el-button>
232
+      </div>
233
+    </el-dialog>
234
+      <el-dialog
235
+        title="添加设备"
236
+        width="1100px"
237
+        :visible.sync="addSbDialog"
238
+        id="dialogStyle"
239
+      >
240
+        <el-form
241
+          :inline="true"
242
+          :model="addSbForm"
243
+          class="demo-form-inline"
244
+          id="formLabel"
245
+        >
246
+          <el-form-item label="产品名称:">
247
+            <el-select
248
+              size="mini"
249
+              v-model="addSbForm.houseName"
250
+              multiple
251
+              placeholder="请选择"
252
+            >
253
+              <el-option label="1号仓" value="first"></el-option>
254
+              <el-option label="2号仓" value="second"></el-option>
255
+              <el-option label="3号仓" value="third"></el-option>
256
+            </el-select>
257
+          </el-form-item>
258
+          <el-form-item label="设备名称:">
259
+            <el-select
260
+              size="mini"
261
+              v-model="addSbForm.houseName"
262
+              multiple
263
+              placeholder="请选择"
264
+            >
265
+              <el-option label="1号仓" value="first"></el-option>
266
+              <el-option label="2号仓" value="second"></el-option>
267
+              <el-option label="3号仓" value="third"></el-option>
268
+            </el-select>
269
+          </el-form-item>
270
+          <el-form-item label="设备标签:">
271
+            <el-select
272
+              size="mini"
273
+              v-model="addSbForm.houseName"
274
+              multiple
275
+              placeholder="请选择"
276
+            >
277
+              <el-option label="1号仓" value="first"></el-option>
278
+              <el-option label="2号仓" value="second"></el-option>
279
+              <el-option label="3号仓" value="third"></el-option>
280
+            </el-select>
281
+          </el-form-item>
282
+          <el-form-item>
283
+            <el-button
284
+              size="mini"
285
+              type="primary"
286
+              icon="el-icon-search"
287
+              @click="search"
288
+              >查询</el-button
289
+            >
290
+          </el-form-item>
291
+
292
+          <el-form-item>
293
+            <el-button
294
+              type="primary"
295
+              size="mini"
296
+              icon="el-icon-refresh-left"
297
+              @click="reset"
298
+              >重置</el-button
299
+            >
300
+          </el-form-item>
301
+        </el-form>
302
+
303
+        <el-table :data="alarmRecord" border style="width: 100%">
304
+          <el-table-column type="selection"  align="center" width="55">
305
+          </el-table-column>
306
+          <el-table-column prop="zskName" align="center" label="设备ID"> </el-table-column>
307
+          <el-table-column prop="houseName" label="设备名称" align="center">
308
+          </el-table-column>
309
+          <el-table-column prop="operName" label="产品名称" align="center">
310
+          </el-table-column>
311
+          <el-table-column prop="phoneO" label="设备标识" align="center">
312
+          </el-table-column>
313
+          <el-table-column prop="phoneO" label="所属仓房编码" align="center">
314
+          </el-table-column>
315
+        </el-table>
316
+        <el-pagination
317
+          @size-change="handleSizeChange1"
318
+          @current-change="handleCurrentChange1"
319
+          :current-page="1"
320
+          :page-sizes="[10, 20, 30, 40]"
321
+          :page-size="pagination1.pageSize"
322
+          layout="total, sizes, prev, pager, next, jumper"
323
+          :total="pagination1.total"
324
+        >
325
+        </el-pagination>
326
+        <div slot="footer" class="dialog-footer">
327
+          <el-button @click="addSbDialog = false">取 消</el-button>
328
+          <el-button type="primary" @click="sure">确 定</el-button>
329
+        </div>
330
+      </el-dialog>
331
+  </div>
332
+</template>
333
+<script>
334
+import api from "@/api";
335
+export default {
336
+  name: "setTimeOut",
337
+  data() {
338
+    return {
339
+      addSbForm:{},
340
+      addSbDialog:false,
341
+      tableData:[{}],
342
+      addForm:{},
343
+      rules: {
344
+        taskName: [{ required: true, message: "请输入任务名称", trigger: "blur" }],
345
+        sdyj: [{ required: true, message: "请输入湿度预警阈值", trigger: "blur" }],
346
+        bjlx: [
347
+          { required: true, message: "请选择报警类型", trigger: "blur" },
348
+        ],
349
+        sfkq: [
350
+          { required: true, message: "请选择是否开启", trigger: "blur" },
351
+        ],
352
+      },
353
+      //表格字段
354
+      alarmRecord: [{}],
355
+      //分页
356
+      pagination: {
357
+        // 每页显示的条数
358
+        pageSize: 10,
359
+        // 当前页
360
+        curPage: 1,
361
+        // 总数
362
+        total: 20,
363
+      },
364
+      //弹框分页
365
+      pagination1: {
366
+        // 每页显示的条数
367
+        pageSize: 10,
368
+        // 当前页
369
+        curPage: 1,
370
+        // 总数
371
+        total: 20,
372
+      },
373
+      disabled: false,
374
+      // label宽度
375
+      formLabelWidth: "120px",
376
+      // 弹框默认关闭
377
+      dialogAlarm: false,
378
+      filterText: "",
379
+      //默认展开的节点
380
+      defaultProps: {
381
+        children: "children",
382
+        label: "orgName",
383
+      },
384
+      loading: false,
385
+      //默认展开的节点
386
+      defaultExpanded: [],
387
+      cfbh: "",
388
+      //左侧树数据
389
+      leftList: [],
390
+      // 日期插件
391
+      //
392
+
393
+      addForm: {
394
+        sbNames: "",
395
+      },
396
+      formData: {
397
+        status: 0,
398
+        totalStatus: 0,
399
+        totalThreshold: "",
400
+        timeThreshold: "",
401
+        telephoneNumber1: "",
402
+        telephoneNumber2: "",
403
+        smsNumber1: "",
404
+        smsNumber2: "",
405
+        id: "",
406
+      },
407
+      //弹框字段
408
+      dialog: {
409
+        name: "",
410
+      },
411
+    };
412
+  },
413
+  // watch: {
414
+  //   filterTest(val) {
415
+  //     this.$refs.tree.filter(val);
416
+  //   },
417
+  // },
418
+  methods: {
419
+    // 每页条数改变
420
+    handleSizeChange1(val) {
421
+      this.pagination1.pageSize = val;
422
+    },
423
+    // 当前页改变
424
+    handleCurrentChange1(val) {
425
+      this.pagination1.curPage = val;
426
+    },
427
+    // 每页条数改变
428
+    handleSizeChange(val) {
429
+      this.pagination.pageSize = val;
430
+      this.getList();
431
+    },
432
+    // 当前页改变
433
+    handleCurrentChange(val) {
434
+      this.pagination.curPage = val;
435
+      this.getList();
436
+    },
437
+    //获取左侧树
438
+    getLeftTree() {
439
+      this.loading = true;
440
+      let params = {
441
+        orgName: this.orgName,
442
+      };
443
+
444
+      api
445
+        .leftTree(params)
446
+        .then((res) => {
447
+          if (res.code == 200) {
448
+            console.log(res);
449
+            this.leftList = [];
450
+            if (res.data) {
451
+              this.leftList = res.data;
452
+
453
+              // if (res.data[0].id) {
454
+              //   this.defaultExpanded.push(res.data[0].id);
455
+              //   if (res.data[0].children) {
456
+              //     this.defaultExpanded.push(
457
+              //       res.data[0].children[0].children[0].id
458
+              //     );
459
+
460
+              //     this.cfbh =
461
+              //       res.data[0].children[0].children[0].children[0].id;
462
+
463
+              //     setTimeout(() => {
464
+              //          document.getElementsByClassName("el-tree-node__content")[0].style.display="none"
465
+              //       document.getElementsByClassName("el-tree-node__content")[1].style.display="none"
466
+              //       this.$refs.tree.setCurrentKey(this.cfbh);
467
+              //       this.$refs.tree.setCurrentKey(this.cfbh);
468
+              //     }, 100);
469
+              //     console.log(this.leftList);
470
+              //       this.getList();
471
+              //   }
472
+              // }
473
+              var lastLevel = res.data;
474
+              if (lastLevel.length > 0) {
475
+                lastLevel = res.data[0];
476
+                while (lastLevel.children && lastLevel.children.length > 0) {
477
+                  lastLevel = lastLevel.children[0];
478
+                }
479
+
480
+                this.defaultExpanded.push(lastLevel.id);
481
+                this.cfbh = lastLevel.id;
482
+                setTimeout(() => {
483
+                  this.$refs.tree.setCurrentKey(this.cfbh);
484
+                }, 200);
485
+                this.getList();
486
+              }
487
+            }
488
+          } else {
489
+            this.$message({
490
+              type: "error",
491
+              message: res.msg,
492
+            });
493
+          }
494
+          this.loading = false;
495
+        })
496
+        .catch((error) => {
497
+          this.loading = false;
498
+          console.log(error);
499
+        });
500
+    },
501
+    //点击左侧树节点
502
+    handleNodeClick(data, node) {
503
+      // if(node.level ===4){
504
+      //  this.cfbh=data.id;
505
+      //  console.log(  this.cfbh,";;;")
506
+      // }
507
+      // this.getList();
508
+      if (node.childNodes.length === 0) {
509
+        this.cfbh = data.id;
510
+        console.log(this.cfbh, ";;;");
511
+        this.getList();
512
+      }
513
+    },
514
+    filterNode(value, data) {
515
+      if (!value) return true;
516
+      return data.orgName.indexOf(value) !== -1;
517
+    },
518
+    // filterNode(value, data) {
519
+    //   if (!value) return true;
520
+    //   return data.label.indexOf(value) !== -1;
521
+    // },
522
+    //获取列表数据
523
+    getList() {
524
+      var houseId = this.cfbh;
525
+
526
+      api
527
+        .alarmParams(houseId)
528
+        .then((res) => {
529
+          if (res.code == 200) {
530
+            console.log(res, "报警参数");
531
+          }
532
+        })
533
+        .catch((err) => {
534
+          console.log(err);
535
+        });
536
+    },
537
+    search() {},
538
+    reset() {},
539
+    //新增
540
+    addTantou() {
541
+      this.dialogAlarm = true;
542
+    },
543
+    //表格序号
544
+    indexMethod(index) {
545
+      // return (
546
+      //   (this.pagination.curPage - 1) * this.pagination.pageSize + index + 1
547
+      // );
548
+    },
549
+    //弹框确定按钮
550
+    determine() {},
551
+  },
552
+  mounted() {
553
+    this.getLeftTree();
554
+  },
555
+};
556
+</script>
557
+<style lang="scss" scoped>
558
+.main {
559
+  height: 100%;
560
+  display: flex;
561
+  .left {
562
+    height: calc(100vh - 131px);
563
+    .leftTitle {
564
+      background: linear-gradient(0deg, #008574 0%, #01a48f 100%);
565
+      border-top-left-radius: 6px;
566
+      border-top-right-radius: 6px;
567
+      padding: 10px;
568
+      font-size: 16px;
569
+      color: #fff;
570
+      font-weight: bold;
571
+    }
572
+  }
573
+  .right {
574
+    margin-left: 20px;
575
+    width: calc(100% - 280px);
576
+
577
+    border: 1px solid #dedede;
578
+    background-color: #fff;
579
+    border-radius: 6px;
580
+    .right_main {
581
+      border-top-left-radius: 6px;
582
+      border-top-right-radius: 6px;
583
+    }
584
+    .right_title {
585
+      font-weight: bold;
586
+      font-size: 16px;
587
+      border-bottom: 1px solid #ebeef5;
588
+      background-color: rgba(233, 244, 243, 0.5);
589
+      border-top-left-radius: 6px;
590
+      border-top-right-radius: 6px;
591
+      color: #008775;
592
+      border-bottom: 1px solid rgba(1, 164, 143, 0.3);
593
+      padding-left: 0;
594
+      span {
595
+        padding: 10px;
596
+        padding-bottom: 9px;
597
+        border-bottom: 2px solid #01a48f;
598
+      }
599
+    }
600
+  }
601
+  .addBtn {
602
+    margin-bottom: 10px;
603
+    margin-top: -10px;
604
+    text-align: right;
605
+  }
606
+  h4 {
607
+    font-size: 16px;
608
+    font-weight: 700;
609
+    line-height: 40px;
610
+    // color:#fff;
611
+  }
612
+  p {
613
+    // color: #525357;
614
+    font-size: 14px;
615
+    line-height: 40px;
616
+    position: relative;
617
+    color: #fff;
618
+  }
619
+}
620
+.nav {
621
+  padding: 10px 0 10px 10px;
622
+  margin-bottom: 20px;
623
+  // color: #fff;
624
+
625
+  font-size: 14px;
626
+
627
+  background: #ffffff;
628
+  border: 1px solid #dedede;
629
+}
630
+</style>

+ 234 - 0
src/views/demo/productManage/compontents/addDialog.vue

@@ -0,0 +1,234 @@
1
+<template>
2
+  <div>
3
+    <el-dialog
4
+      :title="dialogTitle"
5
+      @close="addForm = {}"
6
+      :visible.sync="dialogFormVisible"
7
+      id="dialogStyle"
8
+    >
9
+      <el-form
10
+        :model="addForm"
11
+        :rules="rules"
12
+        ref="addForm"
13
+        label-width="120px"
14
+      >
15
+        <el-form-item label="产品图标:" prop="proIcons">
16
+          <el-upload
17
+            class="avatar-uploader"
18
+            action="api/minio/testupload"
19
+            :show-file-list="false"
20
+            :on-success="handleAvatarSuccess"
21
+            :before-upload="beforeAvatarUpload"
22
+          >
23
+            <img
24
+              v-if="addForm.proIcons"
25
+              :src="addForm.proIcons"
26
+              class="avatar"
27
+            />
28
+            <i v-else class="el-icon-plus avatar-uploader-icon"></i>
29
+          </el-upload>
30
+        </el-form-item>
31
+        <el-form-item label="产品ID:" prop="proCode">
32
+          <el-input
33
+            style="width: 220px"
34
+            v-model.trim="addForm.proCode"
35
+            placeholder="请输入"
36
+          ></el-input>
37
+        </el-form-item>
38
+        <el-form-item label="产品名称:" prop="proName">
39
+          <el-input
40
+            style="width: 220px"
41
+            v-model.trim="addForm.proName"
42
+            placeholder="请输入"
43
+          ></el-input>
44
+        </el-form-item>
45
+
46
+        <el-form-item label="产品分类:" prop="proCategory">
47
+          <el-select
48
+            v-model="addForm.proCategory"
49
+            placeholder="请选择"
50
+            ref="selectTree"
51
+          >
52
+            <el-option
53
+              :key="addForm.proCategory"
54
+              :value="addForm.proCategory"
55
+              :label="addForm.label"
56
+              hidden
57
+            />
58
+            <el-tree
59
+              :data="typeLists"
60
+              :props="defaultProps"
61
+              node-key="id"
62
+              accordion
63
+              highlight-current
64
+              @node-click="handleNodeClick"
65
+            />
66
+          </el-select>
67
+        </el-form-item>
68
+        <el-form-item label="所属组织机构:">
69
+          <el-select v-model="addForm.orgName" placeholder="请选择">
70
+            <el-option
71
+              v-for="item in ckLists"
72
+              :key="item.id"
73
+              :label="item.orgName"
74
+              :value="item.orgName"
75
+            >
76
+            </el-option>
77
+          </el-select>
78
+        </el-form-item>
79
+        <el-form-item label="产品描述:">
80
+          <el-input
81
+            style="width: 80%"
82
+            type="textarea"
83
+            v-model.trim="addForm.proDescription"
84
+            placeholder="请输入"
85
+          ></el-input>
86
+        </el-form-item>
87
+      </el-form>
88
+      <div slot="footer" class="dialog-footer">
89
+        <el-button @click="dialogFormVisible = false">取 消</el-button>
90
+        <el-button type="primary" @click="submitForm('addForm')"
91
+          >确 定</el-button
92
+        >
93
+      </div>
94
+    </el-dialog>
95
+  </div>
96
+</template>
97
+<script>
98
+import api from "@/api";
99
+import log from "@/libs/util.log";
100
+export default {
101
+  props: {
102
+    dialogTitle: "",
103
+  },
104
+  data() {
105
+    return {
106
+      defaultProps: {
107
+        children: "children",
108
+        label: "productCategoryName",
109
+      },
110
+      ckLists: [],
111
+      typeLists: [],
112
+      addForm: {},
113
+      dialogFormVisible: false,
114
+      rules: {
115
+        proCode: [{ required: true, message: "请输入产品ID", trigger: "blur" }],
116
+        proName: [
117
+          { required: true, message: "请输入产品名称", trigger: "blur" },
118
+        ],
119
+        proCategory: [
120
+          { required: true, message: "请选择产品分类", trigger: "blur" },
121
+        ],
122
+      },
123
+    };
124
+  },
125
+  created() {
126
+    this.ckList();
127
+  },
128
+  methods: {
129
+    handleAvatarSuccess(res, file) {
130
+      this.$set(this.addForm,'proIcons',"http://101.36.160.140:31005/smart-grp-basic/minio/preViewPicture/" + res.data)
131
+      // this.addForm.proIcons =
132
+      //   "http://101.36.160.140:31005/smart-grp-basic/minio/preViewPicture/" + res.data;
133
+      //   console.log(this.addForm.proIcons);
134
+    },
135
+    getInfo(row) {
136
+      this.addForm = row;
137
+    },
138
+    handleNodeClick(data) {
139
+      console.log(data);
140
+      this.$set(this.addForm, "proCategory", data.productCategoryName);
141
+      this.$set(this.addForm, "label", data.productCategoryName);
142
+      console.log(this.addForm);
143
+      // 使 input 失去焦点,并隐藏下拉框
144
+      this.$refs.selectTree.blur();
145
+    },
146
+    //新增或编辑时仓房/仓库下拉选
147
+    ckList() {
148
+      var data = {
149
+        storeTypeCode: 300002,
150
+      };
151
+
152
+      api
153
+        .ckList(data)
154
+        .then((res) => {
155
+          if (res.code == 200) {
156
+            this.ckLists = res.data;
157
+          }
158
+        })
159
+        .catch((err) => {
160
+          console.log(err);
161
+        });
162
+
163
+      api
164
+        .productCategoryList()
165
+        .then((res) => {
166
+          if (res.code == 200) {
167
+            this.typeLists = res.data;
168
+          }
169
+        })
170
+        .catch((err) => {
171
+          console.log(err);
172
+        });
173
+    },
174
+
175
+    //新建产品提交
176
+    submitForm(formName) {
177
+      this.$refs[formName].validate((valid) => {
178
+        console.log(this.addForm);
179
+        if (valid) {
180
+          let params = JSON.parse(JSON.stringify(this.addForm));
181
+          params.label = undefined;
182
+
183
+          if (this.dialogTitle == "新建产品") {
184
+            params.id = "";
185
+            api.productSave(params).then((res) => {
186
+              if (res.code == 200) {
187
+                this.$message.success("新建成功");
188
+                this.$parent.$parent.$parent.getList();
189
+                this.dialogFormVisible = false;
190
+              }
191
+            });
192
+          } else {
193
+            api.productUpdate(params).then((res) => {
194
+              if (res.code == 200) {
195
+                this.$message.success("编辑成功");
196
+                this.dialogFormVisible = false;
197
+                this.$parent.$parent.$parent.getBasic();
198
+              }
199
+            });
200
+          }
201
+        } else {
202
+          console.log("error submit!!");
203
+          return false;
204
+        }
205
+      });
206
+    },
207
+  },
208
+};
209
+</script>
210
+<style lang="scss" scoped>
211
+::v-deep .avatar-uploader .el-upload {
212
+  border: 1px dashed #d9d9d9;
213
+  border-radius: 6px;
214
+  cursor: pointer;
215
+  position: relative;
216
+  overflow: hidden;
217
+}
218
+.avatar-uploader .el-upload:hover {
219
+  border-color: #008775;
220
+}
221
+.avatar-uploader-icon {
222
+  font-size: 28px;
223
+  color: #8c939d;
224
+  width: 100px;
225
+  height: 100px;
226
+  line-height: 100px;
227
+  text-align: center;
228
+}
229
+.avatar {
230
+  width: 100px;
231
+  height: 100px;
232
+  display: block;
233
+}
234
+</style>

+ 176 - 0
src/views/demo/productManage/compontents/addDialogC.vue

@@ -0,0 +1,176 @@
1
+<template>
2
+  <div>
3
+    <el-dialog
4
+      :title="dialogTitle"
5
+      :visible.sync="dialogFormVisible"
6
+      id="dialogStyle"
7
+      @close="addForm={}"
8
+    >
9
+      <el-form
10
+        :model="addForm"
11
+        :rules="rules"
12
+        ref="addForm"
13
+        label-width="120px"
14
+      >
15
+        <el-form-item label="产品分类名称:">
16
+          <el-input
17
+            style="width: 220px"
18
+            v-model.trim="addForm.productCategoryName"
19
+            placeholder="请输入"
20
+          ></el-input>
21
+        </el-form-item>
22
+        <el-form-item label="上级产品分类:">
23
+          <el-select clearable @clear="remove()" v-model="addForm.parentId" placeholder="请选择" ref="selectTree">
24
+            <el-option
25
+              :key="addForm.parentId"
26
+              :value="addForm.parentId"
27
+              :label="addForm.parentId==0?'无':addForm.label"
28
+              hidden
29
+            />
30
+            <el-tree
31
+              :data="data"
32
+              :props="defaultProps"
33
+              node-key="id"
34
+              accordion
35
+              highlight-current
36
+              @node-click="handleNodeClick"
37
+            />
38
+          </el-select>
39
+        </el-form-item>
40
+        <el-form-item label="备注:">
41
+          <el-input
42
+            style="width: 80%"
43
+            type="textarea"
44
+            v-model.trim="addForm.proRemark"
45
+            placeholder="请输入"
46
+          ></el-input>
47
+        </el-form-item>
48
+      </el-form>
49
+      <div slot="footer" class="dialog-footer">
50
+        <el-button @click="dialogFormVisible = false">取 消</el-button>
51
+        <el-button type="primary" @click="submitForm('addForm')"
52
+          >确 定</el-button
53
+        >
54
+      </div>
55
+    </el-dialog>
56
+  </div>
57
+</template>
58
+<script>
59
+import api from "@/api";
60
+
61
+export default {
62
+  props: {
63
+    dialogTitle: {
64
+      type: String,
65
+      default: () => ("")
66
+    },
67
+    row: {
68
+      type: Object,
69
+      default: () => ({})
70
+    },
71
+    data: {
72
+      type: Array,
73
+      default: () => ([])
74
+    }
75
+  },
76
+  data() {
77
+    return {
78
+      defaultProps: {
79
+        children: "children",
80
+        label: "productCategoryName",
81
+      },
82
+      addForm: {
83
+        parentId:'',
84
+        proRemark:'',
85
+        productCategoryName:'',
86
+      },
87
+      dialogFormVisible: false,
88
+      rules: {
89
+        id: [{ required: true, message: "请输入产品ID", trigger: "blur" }],
90
+        name: [{ required: true, message: "请选择产品名称", trigger: "blur" }],
91
+        region: [
92
+          { required: true, message: "请选择产品分类", trigger: "blur" },
93
+        ],
94
+      },
95
+    };
96
+  },
97
+  methods: {
98
+    remove(){
99
+      this.$set(this.addForm,'label',undefined)
100
+      // this.$set(this.addForm,'parentId',0)
101
+    },
102
+    handleNodeClick(data) {
103
+      console.log(data);
104
+      this.$set(this.addForm,'parentId',data.id)
105
+      this.$set(this.addForm,'label',data.productCategoryName)
106
+      // 使 input 失去焦点,并隐藏下拉框
107
+      this.$refs.selectTree.blur();
108
+    },
109
+    //获取编辑数据
110
+    getEditRow(row) {
111
+      this.addForm.proRemark=row.proRemark
112
+      this.addForm.id=row.id
113
+      this.addForm.parentId=row.parentId
114
+      this.$set(this.addForm,'parentId',row.parentId)
115
+      this.addForm.productCategoryName=row.productCategoryName
116
+      this.addForm.productCategoryCode=row.productCategoryCode
117
+       console.log(123,this.addForm,this.data);
118
+    },
119
+    //新建产品提交
120
+    submitForm(formName) {
121
+      this.$refs[formName].validate((valid) => {
122
+        if (valid) {
123
+            let params=JSON.parse(JSON.stringify(this.addForm))
124
+            params.label=undefined
125
+          if(this.dialogTitle=='新建产品分类'){
126
+            params.productCategoryCode=""
127
+            api.productCategorySave(params).then(res=>{
128
+              if (res.code == 200) {
129
+                this.$message.success("新建成功");
130
+                this.$parent.$parent.$parent.getList()
131
+                this.dialogFormVisible=false;
132
+              }
133
+            })
134
+          }else{
135
+            api.productCategoryUpdate(params).then(res=>{
136
+              if (res.code == 200) {
137
+                this.$message.success("编辑成功");
138
+                this.dialogFormVisible=false;
139
+                this.$parent.$parent.$parent.getList()
140
+              }
141
+            })
142
+          }
143
+        } else {
144
+          console.log("error submit!!");
145
+          return false;
146
+        }
147
+      });
148
+    },
149
+  },
150
+};
151
+</script>
152
+<style lang="scss" scoped>
153
+::v-deep .avatar-uploader .el-upload {
154
+  border: 1px dashed #d9d9d9;
155
+  border-radius: 6px;
156
+  cursor: pointer;
157
+  position: relative;
158
+  overflow: hidden;
159
+}
160
+.avatar-uploader .el-upload:hover {
161
+  border-color: #008775;
162
+}
163
+.avatar-uploader-icon {
164
+  font-size: 28px;
165
+  color: #8c939d;
166
+  width: 100px;
167
+  height: 100px;
168
+  line-height: 100px;
169
+  text-align: center;
170
+}
171
+.avatar {
172
+  width: 178px;
173
+  height: 178px;
174
+  display: block;
175
+}
176
+</style>

+ 351 - 0
src/views/demo/productManage/product/index.vue

@@ -0,0 +1,351 @@
1
+<template>
2
+  <div>
3
+    <d2-container>
4
+          <div class="nav">当前所在位置:首页>产品管理>产品</div>
5
+
6
+      <!-- <template slot="header">首页/数据查询</template> -->
7
+      <div class="main">
8
+        <div class="zt_right">
9
+          <!-- <template slot="header">首页/数据查询</template> -->
10
+          <div class="right_main">
11
+            <!-- <div class="right_title">
12
+              <i
13
+                class="fa fa-file-text"
14
+                aria-hidden="true"
15
+                style="padding-right: 5px"
16
+              ></i>
17
+              产品
18
+            </div> -->
19
+            <div class="right_title">
20
+              <span>产品管理</span> 
21
+            </div>
22
+            <div class="right_table">
23
+              <div class="flex-between">
24
+                <el-form
25
+                  :inline="true"
26
+                  :model="formInline"
27
+                  class="demo-form-inline"
28
+                  id="formLabel"
29
+                >
30
+                  <el-form-item label="产品ID:">
31
+                    <el-input v-model="formInline.pro_code" placeholder="请输入"></el-input>
32
+                  </el-form-item>
33
+                  <el-form-item label="产品名称:">
34
+                    <el-input v-model="formInline.pro_name" placeholder="请输入"></el-input>
35
+<!-- 
36
+                    <el-select
37
+                      v-model="formInline.pro_name"
38
+                      placeholder="请选择"
39
+                    >
40
+                      <el-option label="1号仓" value="first"></el-option>
41
+                      <el-option label="2号仓" value="second"></el-option>
42
+                      <el-option label="3号仓" value="third"></el-option>
43
+                    </el-select> -->
44
+                  </el-form-item>
45
+                
46
+                  <el-form-item>
47
+                    <el-button
48
+                      type="primary"
49
+                      icon="el-icon-search"
50
+                      @click="search"
51
+                      >查询</el-button
52
+                    >
53
+                  </el-form-item>
54
+
55
+                  <el-form-item>
56
+                    <el-button
57
+                      type="primary"
58
+                      icon="el-icon-refresh-left"
59
+                      @click="reset"
60
+                      >重置</el-button
61
+                    >
62
+                  </el-form-item>
63
+                </el-form>
64
+                <div>
65
+                  <el-button type="primary" @click="goClassify"
66
+                    >产品分类</el-button
67
+                  >
68
+                  <el-button
69
+                    type="primary"
70
+                    icon="el-icon-plus"
71
+                    @click="$refs.addDialog.dialogFormVisible = true"
72
+                    >新建产品</el-button
73
+                  >
74
+                </div>
75
+              </div>
76
+              <el-table
77
+                :data="alarmRecord"
78
+                border
79
+                style="width: 100%"
80
+              >
81
+                <el-table-column
82
+                  align="center"
83
+                  label="序号"
84
+                  type="index"
85
+                  width="100px"
86
+                  :index="indexMethod"
87
+                  show-overflow-tooltip
88
+                ></el-table-column>
89
+                <el-table-column prop="zskName" label="产品ID" align="center">
90
+                </el-table-column>
91
+                <el-table-column
92
+                  prop="proName"
93
+                  label="产品名称"
94
+                  align="center"
95
+                >
96
+                </el-table-column>
97
+                <el-table-column
98
+                  prop="proCategory"
99
+                  label="产品分类"
100
+                  align="center"
101
+                >
102
+                </el-table-column>
103
+                <el-table-column prop="eqTotal" label="设备数量" align="center">
104
+                </el-table-column>
105
+
106
+                <el-table-column
107
+                  prop="orgName"
108
+                  label="所属组织机构"
109
+                  align="center"
110
+                >
111
+                </el-table-column>
112
+                <el-table-column label="操作" width="160" align="center">
113
+                  <template slot-scope="scope">
114
+                    <el-button type="primary" plain size="mini" @click="goDetail(scope.row)"
115
+                      >查看</el-button
116
+                    >
117
+                    <el-button type="danger" plain size="mini" @click="del(scope.row)"
118
+                      >删除</el-button
119
+                    >
120
+                    <!-- <el-button @click="delecheck( scope.$index, scope.row)" type="detailbtn" class="fa fa-info-circle" size="mini">查看</el-button> -->
121
+                  </template>
122
+                </el-table-column>
123
+              </el-table>
124
+              <el-pagination
125
+                @size-change="handleSizeChange"
126
+                @current-change="handleCurrentChange"
127
+                :current-page="1"
128
+                :page-sizes="[10, 20, 30, 40]"
129
+                :page-size="pagination.pageSize"
130
+                layout="total, sizes, prev, pager, next, jumper"
131
+                :total="pagination.total"
132
+              >
133
+              </el-pagination>
134
+            </div>
135
+          </div>
136
+        </div>
137
+      </div>
138
+      <addDialog :dialogTitle="'新建产品'" ref="addDialog"/>
139
+    </d2-container>
140
+  </div>
141
+</template>
142
+<script>
143
+import addDialog from "../compontents/addDialog.vue";
144
+
145
+import api from "@/api";
146
+// 1  异常点   2  断开
147
+export default {
148
+  name: "product",
149
+  components: { addDialog },
150
+  data() {
151
+    return {
152
+      addForm: {},
153
+      dialogFormVisible: false,
154
+      dialogTitle: "",
155
+      //头部查询条件
156
+      formInline: {
157
+        pro_name: "",
158
+        pro_code: "",
159
+      },
160
+
161
+      //表格字段
162
+      alarmRecord: [{}],
163
+      //分页
164
+      pagination: {
165
+        // 每页显示的条数
166
+        pageSize: 10,
167
+        // 当前页
168
+        curPage: 1,
169
+        // 总数
170
+        total: 20,
171
+      },
172
+      rules: {
173
+        id: [{ required: true, message: "请输入产品ID", trigger: "blur" }],
174
+        name: [{ required: true, message: "请选择产品名称", trigger: "blur" }],
175
+        region: [
176
+          { required: true, message: "请选择产品分类", trigger: "blur" },
177
+        ],
178
+      },
179
+    };
180
+  },
181
+  methods: {
182
+
183
+    //删除
184
+    del(row){
185
+        this.$confirm('确认进行删除操作吗?', '删除提示', {
186
+          confirmButtonText: '确定',
187
+          cancelButtonText: '取消',
188
+          type: 'warning'
189
+        }).then(() => {
190
+        api.productDetail(row.id).then(res=>{
191
+          if(res.code==200){
192
+            this.$message({
193
+              type: "success",
194
+              message: "删除成功",
195
+            });
196
+            this.getList()
197
+          }
198
+        })
199
+        })
200
+    },
201
+    //查看
202
+    goDetail(row) {
203
+      this.$router.push({ path: "productInfo",query:{id:row.id} });
204
+    },
205
+    //跳转产品分类
206
+    goClassify() {
207
+      this.$router.push({ path: "productClassify" });
208
+    },
209
+    //图标上传
210
+    handleAvatarSuccess(res, file) {
211
+      api.preViewPicture(res.data).then(res=>{})
212
+      this.imageUrl = URL.createObjectURL(file.raw);
213
+    },
214
+    // beforeAvatarUpload(file) {
215
+    //   const isJPG = file.type === 'image/jpeg';
216
+    //   const isLt2M = file.size / 1024 / 1024 < 2;
217
+
218
+    //   if (!isJPG) {
219
+    //     this.$message.error('上传头像图片只能是 JPG 格式!');
220
+    //   }
221
+    //   if (!isLt2M) {
222
+    //     this.$message.error('上传头像图片大小不能超过 2MB!');
223
+    //   }
224
+    //   return isJPG && isLt2M;
225
+    // },
226
+    //新建产品提交
227
+    submitForm(formName) {
228
+      this.$refs[formName].validate((valid) => {
229
+        if (valid) {
230
+          alert("submit!");
231
+        } else {
232
+          console.log("error submit!!");
233
+          return false;
234
+        }
235
+      });
236
+    },
237
+    search() {
238
+      this.getList()
239
+    },
240
+    reset() {
241
+      this.pagination.curPage=1;
242
+      this.pagination.pageSize=10;
243
+      this.formInline={
244
+        pro_name: "",
245
+        pro_code: "",
246
+      }
247
+      this.getList()
248
+    },
249
+
250
+    //获取列表数据
251
+    getList() {
252
+      var condition = {pro_name:this.formInline.pro_name,pro_code:this.formInline.pro_code};
253
+      condition = JSON.stringify(condition);
254
+      var data = {
255
+        pageIndex: this.pagination.curPage,
256
+        pageSize: this.pagination.pageSize,
257
+        condition: condition,
258
+      };
259
+      api
260
+        .productList(data)
261
+        .then((res) => {
262
+          if (res.code == 200) {
263
+            this.alarmRecord = res.data.records;
264
+            this.pagination.pageSize = res.data.size;
265
+            this.pagination.total = res.data.total;
266
+          }
267
+        })
268
+        .catch((err) => {
269
+          console.log(err);
270
+        });
271
+    },
272
+
273
+    //表格序号
274
+    indexMethod(index) {
275
+      return (
276
+        (this.pagination.curPage - 1) * this.pagination.pageSize + index + 1
277
+      );
278
+    },
279
+    // 每页条数改变
280
+    handleSizeChange(val) {
281
+      this.pagination.pageSize = val;
282
+      this.getList();
283
+    },
284
+    // 当前页改变
285
+    handleCurrentChange(val) {
286
+      this.pagination.curPage = val;
287
+      this.getList();
288
+    },
289
+  },
290
+  mounted() {
291
+    this.getList();
292
+  },
293
+};
294
+</script>
295
+<style lang="scss" scoped>
296
+.main {
297
+  height: 100%;
298
+  display: flex;
299
+
300
+  .zt_right {
301
+    width: 100%;
302
+border: 1px solid #DEDEDE;
303
+border-radius: 6px;
304
+    // margin-left: 20px;
305
+    // width: calc(100% - 250px);
306
+    .right_title{
307
+      font-weight: bold;
308
+      font-size: 16px;
309
+      border-bottom:1px solid #ebeef5;
310
+      background-color: rgba(233, 244, 243, 0.5);
311
+      border-top-left-radius: 6px;
312
+      border-top-right-radius: 6px;
313
+      color: #008775;
314
+      border-bottom: 1px solid rgba(1, 164, 143, 0.3);
315
+      padding-left: 0;
316
+      span{
317
+        padding: 10px;
318
+        padding-bottom: 9px;
319
+        border-bottom: 2px solid #01a48f;
320
+
321
+      }
322
+    }
323
+
324
+  }
325
+}
326
+     .nav {
327
+      padding: 10px 0 10px 10px;
328
+      margin-bottom: 20px;
329
+      // color: #fff;
330
+
331
+      font-size: 14px;
332
+
333
+      background: #FFFFFF;
334
+      border: 1px solid #DEDEDE;
335
+    }
336
+.float-left {
337
+  float: left;
338
+}
339
+.float-right {
340
+  float: right;
341
+}
342
+#dialogStyle .el-select {
343
+  width: 100%;
344
+}
345
+.flex-between {
346
+  display: flex;
347
+  // align-items: center;
348
+  justify-content: space-between;
349
+}
350
+
351
+</style>

+ 321 - 0
src/views/demo/productManage/productClassify/index.vue

@@ -0,0 +1,321 @@
1
+<template>
2
+  <div>
3
+    <d2-container>
4
+          <div class="nav">当前所在位置:首页>产品管理>产品分类</div>
5
+
6
+      <!-- <template slot="header">首页/数据查询</template> -->
7
+      <div class="main">
8
+        <div class="zt_right">
9
+          <!-- <template slot="header">首页/数据查询</template> -->
10
+          <div class="right_main">
11
+            <!-- <div class="right_title">
12
+              <i
13
+                class="fa fa-file-text"
14
+                aria-hidden="true"
15
+                style="padding-right: 5px"
16
+              ></i>
17
+              产品
18
+            </div> -->
19
+            <div class="right_title">
20
+              <span>产品管理</span> 
21
+            </div>
22
+            <div class="right_table">
23
+              <div class="flex-between">
24
+                <el-form></el-form>
25
+                <div style="margin-bottom: 20px">
26
+                  <el-button
27
+                    type="primary"
28
+                    icon="el-icon-plus"
29
+                    @click="
30
+                      $refs.addDialogC.dialogFormVisible = true;
31
+                      dialogTitle = '新建产品分类';
32
+                      $refs.addDialogC.addForm={
33
+                        parentId:undefined,
34
+                        proRemark:'',
35
+                        productCategoryName:'',
36
+                      }
37
+                    "
38
+                    >新建产品分类</el-button
39
+                  >
40
+                </div>
41
+              </div>
42
+              <el-table
43
+                :data="tableData"
44
+                style="width: 100%"
45
+                row-key="id"
46
+                border
47
+                default-expand-all
48
+                :tree-props="{
49
+                  children: 'children',
50
+                  hasChildren: 'hasChildren',
51
+                }"
52
+              >
53
+                <el-table-column
54
+                  align="center"
55
+                  label="序号"
56
+                  type="index"
57
+                  width="100px"
58
+                  :index="indexMethod"
59
+                  show-overflow-tooltip
60
+                ></el-table-column>
61
+                <el-table-column
62
+                  prop="productCategoryName"
63
+                  label="产品分类"
64
+                  align="center"
65
+                >
66
+                </el-table-column>
67
+                <el-table-column prop="createTime" label="创建时间" align="center">
68
+                </el-table-column>
69
+
70
+                <el-table-column
71
+                  prop="proRemark"
72
+                  label="备注"
73
+                  align="center"
74
+                >
75
+                </el-table-column>
76
+                <el-table-column label="操作" width="160" align="center">
77
+                  <template slot-scope="scope">
78
+                    <!-- <el-button
79
+                      type="text"
80
+                      size="mini"
81
+                      @click="goDetail(scope.row)"
82
+                      >查看</el-button
83
+                    > -->
84
+                    <el-button type="primary" plain size="mini" @click="edit(scope.row)"
85
+                      >编辑</el-button
86
+                    >
87
+                    <el-button type="danger" plain size="mini" @click="del(scope.row)"
88
+                      >删除</el-button
89
+                    >
90
+                    <!-- <el-button @click="delecheck( scope.$index, scope.row)" type="detailbtn" class="fa fa-info-circle" size="mini">查看</el-button> -->
91
+                  </template>
92
+                </el-table-column>
93
+              </el-table>
94
+              <!-- <el-pagination
95
+                @size-change="handleSizeChange"
96
+                @current-change="handleCurrentChange"
97
+                :current-page="1"
98
+                :page-sizes="[10, 20, 30, 40]"
99
+                :page-size="pagination.pageSize"
100
+                layout="total, sizes, prev, pager, next, jumper"
101
+                :total="pagination.total"
102
+              >
103
+              </el-pagination> -->
104
+            </div>
105
+          </div>
106
+        </div>
107
+      </div>
108
+      <addDialogC :row="editRow" :data="tableData1" :dialogTitle="dialogTitle" ref="addDialogC" />
109
+    </d2-container>
110
+  </div>
111
+</template>
112
+<script>
113
+import addDialogC from "../compontents/addDialogC.vue";
114
+
115
+import api from "@/api";
116
+import log from '@/store/modules/d2admin/modules/log';
117
+// 1  异常点   2  断开
118
+export default {
119
+  name: "product",
120
+  components: { addDialogC },
121
+  data() {
122
+    return {
123
+      editRow: {},
124
+      addForm: {},
125
+      dialogFormVisible: false,
126
+      dialogTitle: "",
127
+      //头部查询条件
128
+      formInline: {
129
+        cfName: "",
130
+        scanTime: "",
131
+      },
132
+
133
+      //表格字段
134
+      tableData: [{}],
135
+      tableData1: [],
136
+      //分页
137
+      pagination: {
138
+        // 每页显示的条数
139
+        pageSize: 10,
140
+        // 当前页
141
+        curPage: 1,
142
+        // 总数
143
+        total: 20,
144
+      },
145
+      rules: {
146
+        id: [{ required: true, message: "请输入产品ID", trigger: "blur" }],
147
+        name: [{ required: true, message: "请选择产品名称", trigger: "blur" }],
148
+        region: [
149
+          { required: true, message: "请选择产品分类", trigger: "blur" },
150
+        ],
151
+      },
152
+    };
153
+  },
154
+  methods: {
155
+    //编辑
156
+    edit(row) {
157
+      this.$refs.addDialogC.dialogFormVisible = true;
158
+      this.dialogTitle = "编辑产品分类";
159
+      this.editRow = row;
160
+      this.$refs.addDialogC.getEditRow(row);
161
+    },
162
+    //删除
163
+    del(row) {
164
+      this.$confirm("确认进行删除操作吗?", "删除提示", {
165
+        confirmButtonText: "确定",
166
+        cancelButtonText: "取消",
167
+        type: "warning",
168
+      }).then(() => {
169
+        api.productCategoryDel(row.id).then(res=>{
170
+          if(res.code==200){
171
+            this.$message({
172
+              type: "success",
173
+              message: "删除成功",
174
+            });
175
+            this.getList()
176
+          }
177
+        })
178
+
179
+      });
180
+    },
181
+    //查看
182
+    goDetail(row) {
183
+      this.$router.push({ path: "productInfo", query: { productName: "" } });
184
+    },
185
+    //跳转产品分类
186
+    goClassify() {
187
+      this.$router.push({ path: "productClassify" });
188
+    },
189
+    //图标上传
190
+    handleAvatarSuccess(res, file) {
191
+      this.imageUrl = URL.createObjectURL(file.raw);
192
+    },
193
+    // beforeAvatarUpload(file) {
194
+    //   const isJPG = file.type === 'image/jpeg';
195
+    //   const isLt2M = file.size / 1024 / 1024 < 2;
196
+
197
+    //   if (!isJPG) {
198
+    //     this.$message.error('上传头像图片只能是 JPG 格式!');
199
+    //   }
200
+    //   if (!isLt2M) {
201
+    //     this.$message.error('上传头像图片大小不能超过 2MB!');
202
+    //   }
203
+    //   return isJPG && isLt2M;
204
+    // },
205
+    //新建产品提交
206
+    submitForm(formName) {
207
+      this.$refs[formName].validate((valid) => {
208
+        if (valid) {
209
+          alert("submit!");
210
+        } else {
211
+          console.log("error submit!!");
212
+          return false;
213
+        }
214
+      });
215
+    },
216
+    search() {},
217
+    reset() {},
218
+
219
+    //获取列表数据
220
+    getList() {
221
+      var condition = {};
222
+      condition = JSON.stringify(condition);
223
+      var data = {
224
+        pageIndex: this.pagination.curPage,
225
+        pageSize: this.pagination.pageSize,
226
+        condition: condition,
227
+      };
228
+      api
229
+        .productCategoryList()
230
+        .then((res) => {
231
+          if (res.code == 200) {
232
+            this.tableData = res.data;
233
+            // this.tableData1 = [].concat(res.data);
234
+          let arr=[{productCategoryName:'无',parentId:0,id:0}]
235
+            this.tableData1 = [...arr,...res.data];
236
+       // this.pagination.pageSize = res.data.size;
237
+            // this.pagination.total = res.data.total;
238
+          }
239
+        })
240
+        .catch((err) => {
241
+          console.log(err);
242
+        });
243
+    },
244
+
245
+    //表格序号
246
+    indexMethod(index) {
247
+      return (
248
+        (this.pagination.curPage - 1) * this.pagination.pageSize + index + 1
249
+      );
250
+    },
251
+    // 每页条数改变
252
+    handleSizeChange(val) {
253
+      this.pagination.pageSize = val;
254
+      this.getList();
255
+    },
256
+    // 当前页改变
257
+    handleCurrentChange(val) {
258
+      this.pagination.curPage = val;
259
+      this.getList();
260
+    },
261
+  },
262
+  mounted() {
263
+    this.getList();
264
+  },
265
+};
266
+</script>
267
+<style lang="scss" scoped>
268
+.main {
269
+  height: 100%;
270
+  display: flex;
271
+
272
+  .zt_right {
273
+    width: 100%;
274
+border: 1px solid #DEDEDE;
275
+border-radius: 6px;
276
+    // margin-left: 20px;
277
+    // width: calc(100% - 250px);
278
+    .right_title{
279
+      font-weight: bold;
280
+      font-size: 16px;
281
+      border-bottom:1px solid #ebeef5;
282
+      background-color: rgba(233, 244, 243, 0.5);
283
+      border-top-left-radius: 6px;
284
+      border-top-right-radius: 6px;
285
+      color: #008775;
286
+      border-bottom: 1px solid rgba(1, 164, 143, 0.3);
287
+      padding-left: 0;
288
+      span{
289
+        padding: 10px;
290
+        padding-bottom: 9px;
291
+        border-bottom: 2px solid #01a48f;
292
+
293
+      }
294
+    }
295
+  }
296
+}
297
+     .nav {
298
+      padding: 10px 0 10px 10px;
299
+      margin-bottom: 20px;
300
+      // color: #fff;
301
+
302
+      font-size: 14px;
303
+
304
+      background: #FFFFFF;
305
+      border: 1px solid #DEDEDE;
306
+    }
307
+.float-left {
308
+  float: left;
309
+}
310
+.float-right {
311
+  float: right;
312
+}
313
+#dialogStyle .el-select {
314
+  width: 100%;
315
+}
316
+.flex-between {
317
+  display: flex;
318
+  // align-items: center;
319
+  justify-content: space-between;
320
+}
321
+</style>

+ 423 - 0
src/views/demo/productManage/productInfo/index.vue

@@ -0,0 +1,423 @@
1
+<template>
2
+  <div>
3
+    <d2-container>
4
+      <div class="main">
5
+        <div class="zt_right">
6
+          <!-- <template slot="header">首页/数据查询</template> -->
7
+          <div class="nav">当前所在位置:首页>产品管理>产品>产品详情</div>
8
+          <div class="">
9
+            <div class="nameTitle">
10
+              <i @click="goBack" class="el-icon-back"></i> <span class="name"> 产品名称:{{$route.query.productName}}</span><span style="font-size:14px;margin-left:40px">设备数:<span style="color:#008775">30</span></span>
11
+            </div>
12
+            <el-tabs v-model="activeName" @tab-click="tabsClick">
13
+              <el-tab-pane label="基本信息" name="first">
14
+    <div class="infoTitle">
15
+      <h5>{{ title }}</h5>
16
+      <el-button icon="fa fa-edit" type="primary" size="mini" @click="edit">编辑</el-button>
17
+    </div>
18
+                <detailTable
19
+                  ref="detailTable"
20
+                  :detail-table="basicInfo"
21
+                  :title="''"
22
+                />
23
+              </el-tab-pane>
24
+              <el-tab-pane label="物模型" name="second"></el-tab-pane>
25
+              <el-tab-pane label="设备信息" name="third">
26
+                <div style="padding-bottom:20px">
27
+                    <div style="text-align:right;padding-bottom:20px">
28
+                        <el-button type="primary" size="mini" icon="el-icon-plus" @click="dialogTableVisible = true">添加关联设备</el-button>
29
+                    </div>
30
+                  <el-table
31
+                    :data="productData"
32
+                    border
33
+                    style="width: 100%"
34
+   
35
+                  >
36
+                    <el-table-column
37
+                      align="center"
38
+                      label="序号"
39
+                      type="index"
40
+                      width="100px"
41
+                      :index="indexMethod"
42
+                      show-overflow-tooltip
43
+                    ></el-table-column>
44
+                    <el-table-column
45
+                      prop="zskName"
46
+                      label="设备ID"
47
+                      align="center"
48
+                    >
49
+                    </el-table-column>
50
+                    <el-table-column
51
+                      prop="houseName"
52
+                      label="设备名称"
53
+                      align="center"
54
+                    >
55
+                    </el-table-column>
56
+                    <el-table-column
57
+                      prop="operName"
58
+                      label="所属产品名称"
59
+                      align="center"
60
+                    >
61
+                    </el-table-column>
62
+                    <el-table-column
63
+                      prop="phoneO"
64
+                      label="所属组织机构"
65
+                      align="center"
66
+                    >
67
+                    </el-table-column>
68
+
69
+                    <el-table-column
70
+                      prop="scanNum"
71
+                      label="设备标签"
72
+                      align="center"
73
+                    >
74
+                    </el-table-column>
75
+
76
+                    <el-table-column
77
+                      prop="scanNum"
78
+                      label="状态"
79
+                      align="center"
80
+                    >
81
+                    </el-table-column>
82
+
83
+                    <el-table-column
84
+                      prop="scanNum"
85
+                      label="注册时间"
86
+                      align="center"
87
+                    >
88
+                    </el-table-column>
89
+
90
+                    <el-table-column
91
+                      prop="scanNum"
92
+                      label="最后联系时间"
93
+                      align="center"
94
+                    >
95
+                    </el-table-column>
96
+                    <el-table-column label="操作" width="120" align="center">
97
+                      <template slot-scope="scope">
98
+                        <el-button
99
+                          type="text"
100
+                          size="mini"
101
+                          >查看</el-button
102
+                        >
103
+                        <el-button type="text" size="mini" @click="cancelMatch(scope.row)"
104
+                          >取消关联</el-button
105
+                        >
106
+                      </template>
107
+                    </el-table-column>
108
+                  </el-table>
109
+                  <el-pagination
110
+                    @size-change="handleSizeChange"
111
+                    @current-change="handleCurrentChange"
112
+                    :current-page="1"
113
+                    :page-sizes="[10, 20, 30, 40]"
114
+                    :page-size="pagination.pageSize"
115
+                    layout="total, sizes, prev, pager, next, jumper"
116
+                    :total="pagination.total"
117
+                  >
118
+                  </el-pagination>
119
+                </div>
120
+              </el-tab-pane>
121
+              <el-tab-pane label="报警记录" name="fourth"></el-tab-pane>
122
+            </el-tabs>
123
+          </div>
124
+        </div>
125
+      </div>
126
+
127
+      <el-dialog title="添加关联设备" width="800px" :visible.sync="dialogTableVisible">
128
+                <el-form
129
+                  :inline="true"
130
+                  :model="formInline"
131
+                  class="demo-form-inline"
132
+                  id="formLabel"
133
+                >
134
+                  <el-form-item label="设备ID:">
135
+                    <el-input size="mini" v-model="formInline.scanTime" placeholder="请输入"></el-input>
136
+                  </el-form-item>
137
+                  <el-form-item label="设备名称:">
138
+                    <el-select 
139
+                      size="mini"
140
+                      v-model="formInline.houseName"
141
+                      multiple
142
+                      placeholder="请选择"
143
+                    >
144
+                      <el-option label="1号仓" value="first"></el-option>
145
+                      <el-option label="2号仓" value="second"></el-option>
146
+                      <el-option label="3号仓" value="third"></el-option>
147
+                    </el-select>
148
+                  </el-form-item>
149
+                
150
+                  <el-form-item>
151
+                    <el-button size="mini"
152
+                      type="primary"
153
+                      icon="el-icon-search"
154
+                      @click="search"
155
+                      >查询</el-button
156
+                    >
157
+                  </el-form-item>
158
+
159
+                  <el-form-item>
160
+                    <el-button
161
+                      type="primary" size="mini"
162
+                      icon="el-icon-refresh-left"
163
+                      @click="reset"
164
+                      >重置</el-button
165
+                    >
166
+                  </el-form-item>
167
+                </el-form>
168
+            
169
+              <el-table
170
+                :data="alarmRecord"
171
+                border
172
+                style="width: 100%"
173
+              >
174
+    <el-table-column
175
+      type="selection" 
176
+      align="center"
177
+      width="55">
178
+    </el-table-column>
179
+                <el-table-column prop="zskName" label="设备ID">
180
+                </el-table-column>
181
+                <el-table-column
182
+                  prop="houseName"
183
+                  label="设备名称"
184
+                  align="center"
185
+                >
186
+                </el-table-column>
187
+                <el-table-column
188
+                  prop="operName"
189
+                  label="产品名称"
190
+                  align="center"
191
+                >
192
+                </el-table-column>
193
+                <el-table-column prop="phoneO" label="设备标识" align="center">
194
+                </el-table-column>
195
+
196
+               
197
+              </el-table>
198
+              <el-pagination
199
+                @size-change="handleSizeChange1"
200
+                @current-change="handleCurrentChange1"
201
+                :current-page="1"
202
+                :page-sizes="[10, 20, 30, 40]"
203
+                :page-size="pagination1.pageSize"
204
+                layout="total, sizes, prev, pager, next, jumper"
205
+                :total="pagination1.total"
206
+              >
207
+              </el-pagination>
208
+        <div slot="footer" class="dialog-footer">
209
+          <el-button @click="dialogTableVisible = false">取 消</el-button>
210
+          <el-button type="primary" @click="sure"
211
+            >确 定</el-button
212
+          >
213
+        </div>
214
+      </el-dialog>
215
+      <addDialog :dialogTitle="'产品基本信息'" ref="addDialog"/>
216
+    </d2-container>
217
+  </div>
218
+</template>
219
+<script>
220
+import addDialog from "../compontents/addDialog.vue";
221
+import api from "@/api";
222
+
223
+import detailTable from "@/components/detailTable/index.vue";
224
+export default {
225
+  name: "productInfo",
226
+  components: { detailTable ,addDialog},
227
+  data() {
228
+    return {
229
+      info:{},
230
+        dialogTableVisible:false,
231
+        formInline:{},
232
+      productData:[{}],
233
+      activeName: "first",
234
+      basicInfo: [
235
+        {
236
+          name: "产品ID",
237
+          val: [""],
238
+          name1: "产品名称",
239
+          val1: [""],
240
+        },
241
+        {
242
+          name: "产品分类",
243
+          val: [""],
244
+          name1: "所属组织机构",
245
+          val1: [""],
246
+        },
247
+        {
248
+          name: "创建时间",
249
+          val: [""],
250
+          name1: "产品描述",
251
+          val1: [""],
252
+        },
253
+      ],
254
+      //分页
255
+      pagination: {
256
+        // 每页显示的条数
257
+        pageSize: 10,
258
+        // 当前页
259
+        curPage: 1,
260
+        // 总数
261
+        total: 20,
262
+      },
263
+      //弹框分页
264
+      pagination1: {
265
+        // 每页显示的条数
266
+        pageSize: 10,
267
+        // 当前页
268
+        curPage: 1,
269
+        // 总数
270
+        total: 20,
271
+      },
272
+    };
273
+  },
274
+  created(){
275
+    this.getBasic()
276
+
277
+  },
278
+  methods: {
279
+    edit(){
280
+      this.$refs.addDialog.dialogFormVisible=true
281
+            this.$refs.addDialog.getInfo(this.info)
282
+
283
+    },
284
+    getBasic(){
285
+            api.productDetail(this.$route.query.id).then(res=>{
286
+          if(res.code==200){
287
+            this.info=res.data
288
+            this.basicInfo=[
289
+        {
290
+          name: "产品ID",
291
+          val: [res.data.proCode],
292
+          name1: "产品名称",
293
+          val1: [res.data.proName],
294
+        },
295
+        {
296
+          name: "产品分类",
297
+          val: [res.data.proCategory],
298
+          name1: "所属组织机构",
299
+          val1: [res.data.orgName],
300
+        },
301
+        {
302
+          name: "创建时间",
303
+          val: [res.data.createTime],
304
+          name1: "产品描述",
305
+          val1: [res.data.proDescription],
306
+        },
307
+      ]
308
+          }
309
+        })
310
+    },
311
+    //取消关联
312
+    cancelMatch(row){
313
+        this.$confirm('确认进行取消关联操作吗?', '取消关联提示', {
314
+          confirmButtonText: '确定',
315
+          cancelButtonText: '取消',
316
+          type: 'warning'
317
+        }).then(() => {
318
+          this.$message({
319
+            type: 'success',
320
+            message: '取消关联成功'
321
+          });
322
+        })
323
+    },
324
+    // 返回
325
+    goBack() {
326
+      this.$router.go(-1);
327
+    },
328
+    tabsClick() {},
329
+
330
+    //表格序号
331
+    indexMethod(index) {
332
+      return (
333
+        (this.pagination.curPage - 1) * this.pagination.pageSize + index + 1
334
+      );
335
+    },
336
+    // 每页条数改变
337
+    handleSizeChange(val) {
338
+      this.pagination.pageSize = val;
339
+      this.getList();
340
+    },
341
+    // 当前页改变
342
+    handleCurrentChange(val) {
343
+      this.pagination.curPage = val;
344
+      this.getList();
345
+    },
346
+    // 每页条数改变
347
+    handleSizeChange1(val) {
348
+      this.pagination.pageSize = val;
349
+      this.getList();
350
+    },
351
+    // 当前页改变
352
+    handleCurrentChange1(val) {
353
+      this.pagination.curPage = val;
354
+      this.getList();
355
+    },
356
+  },
357
+  mounted() {},
358
+};
359
+</script>
360
+<style lang="scss" scoped>
361
+.main {
362
+  height: 100%;
363
+  display: flex;
364
+
365
+  .zt_right {
366
+    width: 100%;
367
+    // margin-left: 20px;
368
+    // width: calc(100% - 250px);
369
+    .nav {
370
+      padding: 10px 0 10px 10px;
371
+
372
+      font-size: 14px;
373
+
374
+      background: #fff;
375
+    }
376
+    .nameTitle {
377
+      // width: 100%;
378
+      font-size: 14px;
379
+      background: #fff;
380
+      padding: 20px 0 30px 20px;
381
+      margin-top: 10px;
382
+      i {
383
+        font-weight: bold;
384
+        font-size: 16px;
385
+        cursor: pointer;
386
+      }
387
+      .name{
388
+      font-weight: bold;
389
+      border-bottom: 2px solid #008775;
390
+      color: #008775;
391
+
392
+      }
393
+    }
394
+  }
395
+}
396
+::v-deep .el-tabs {
397
+  background: #fff;
398
+  padding: 0 20px;
399
+}
400
+::v-deep .el-table--border{
401
+    border-color: none !important ;
402
+}
403
+
404
+  .infoTitle {
405
+    width: 100%;
406
+    // border-bottom: 1px solid #e6e6e6;
407
+    display: flex;
408
+    align-items: center;
409
+    justify-content: space-between;
410
+    padding-bottom: 10px;
411
+    h5 {
412
+      margin: 0;
413
+      padding-left:20px;
414
+    }
415
+    i{
416
+        color: #008775;
417
+        padding-right: 20px;
418
+        padding-top: 10px;
419
+        font-size: 14px;
420
+        cursor: pointer;
421
+    }
422
+  }
423
+</style>

+ 5 - 6
src/views/demo/system/operationLog/index.vue

@@ -7,14 +7,14 @@
7 7
           <!-- <template slot="header">首页/数据查询</template> -->
8 8
           <div class="nav">当前所在位置:首页>操作日志</div>
9 9
           <div class="right_main">
10
-            <div class="right_title">
10
+            <!-- <div class="right_title">
11 11
               <i
12 12
                 class="fa fa-bar-chart"
13 13
                 aria-hidden="true"
14 14
                 style="padding-right: 5px"
15 15
               ></i>
16 16
               操作日志
17
-            </div>
17
+            </div> -->
18 18
             <div class="right_table">
19 19
               <el-form
20 20
                 :inline="true"
@@ -51,7 +51,6 @@
51 51
                 :data="operaLogList"
52 52
              
53 53
                 style="width: 100%"
54
-                :header-cell-style="{ background: '#0064b9', color: '#c9f5fa' }"
55 54
                 row-key="id"
56 55
                 border
57 56
                
@@ -65,7 +64,7 @@
65 64
                   show-overflow-tooltip
66 65
                 ></el-table-column>
67 66
                 <el-table-column
68
-                  prop="userId"
67
+                  prop="userName"
69 68
                   label="用户ID"
70 69
                   align="center"
71 70
                 >
@@ -381,11 +380,11 @@ export default {
381 380
     // width: calc(100% - 250px);
382 381
     .nav {
383 382
       padding: 10px 0 10px 10px;
384
-      color: #fff;
383
+      // color: #fff;
385 384
 
386 385
       font-size: 14px;
387 386
 
388
-      background: #004a93;
387
+      background: #fff;
389 388
     }
390 389
     // .right_main {
391 390
     //   border: 1px solid #67a7df;

+ 31 - 23
src/views/demo/system/organization/index.vue

@@ -8,10 +8,10 @@
8 8
           <div class="nav">当前所在位置:首页>组织机构</div>
9 9
           <div class="ztnr">
10 10
           <div class="right_main">
11
-            <div class="right_title">
11
+            <!-- <div class="right_title">
12 12
               <i class="fa fa-bar-chart" aria-hidden="true" style="padding-right: 5px"></i>
13 13
               组织机构
14
-            </div>
14
+            </div> -->
15 15
             <div class="right_table">
16 16
               <el-form :inline="true" :model="formInline" class="demo-form-inline" id="formLabel">
17 17
                 <div class="float-left">
@@ -48,11 +48,11 @@
48 48
                   </el-form-item>
49 49
                 </div>
50 50
               </el-form>
51
-              <el-table :data="tableData1" ref='dataTreeList' style="width: 100%" :header-cell-style="{ background: '#0064b9', color: '#c9f5fa' }" row-key="id" border default-expand-all :tree-props="{children: 'children',hasChildren: 'hasChildren',}">
51
+              <el-table :data="tableData1" ref='dataTreeList' style="width: 100%" row-key="id" border default-expand-all :tree-props="{children: 'children',hasChildren: 'hasChildren',}">
52 52
                 <el-table-column prop="orgName" label="组织机构名称" width="350">
53 53
                 </el-table-column>
54
-                <el-table-column prop="storeTypeName" label="机构类型" align="center">
55
-                </el-table-column>
54
+                <!-- <el-table-column prop="storeTypeName" label="机构类型" align="center">
55
+                </el-table-column> -->
56 56
 
57 57
                 <el-table-column prop="orgState" label="机构状态" align="center">
58 58
                   <template slot-scope="scope">
@@ -64,13 +64,13 @@
64 64
                     </div>
65 65
                   </template>
66 66
                 </el-table-column>
67
-                </el-table-column>
67
+
68 68
                 <el-table-column prop="buildTime" label="创建时间" align="center">
69 69
                 </el-table-column>
70
-                <el-table-column label="操作" width='150'>
70
+                <el-table-column label="操作" width='180' align="center">
71 71
                   <template slot-scope="scope">
72
-                    <el-button @click="handleCheck(1, scope.$index, scope.row)" type="editbtn" class="fa fa-edit" size="mini">编辑</el-button>
73
-                    <el-button @click="delecheck( scope.$index, scope.row)" type="delebtn" class="fa fa-remove" size="mini">删除</el-button>
72
+                    <el-button @click="handleCheck(1, scope.$index, scope.row)"  class="fa fa-edit" size="mini">编辑</el-button>
73
+                    <el-button @click="delecheck( scope.$index, scope.row)"  class="fa fa-remove" size="mini">删除</el-button>
74 74
                     <!-- <el-button @click="delecheck( scope.$index, scope.row)" type="detailbtn" class="fa fa-info-circle" size="mini">查看</el-button> -->
75 75
                   </template>
76 76
                 </el-table-column>
@@ -95,14 +95,14 @@
95 95
               </el-option>
96 96
             </el-select>
97 97
           </el-form-item>
98
-          <el-form-item label="机构类型" prop="storeTypeName" :label-width="formLabelWidth">
98
+          <!-- <el-form-item label="机构类型" prop="storeTypeName" :label-width="formLabelWidth">
99 99
             <el-select v-model="addOrgForm.storeTypeCode" placeholder="请选择">
100 100
               <el-option v-for="item in orgTypes" :key="item.index" :label="item.label" :value="item.value">
101 101
                 <span style="float: left">{{ item.label }}</span>
102 102
                 <span style="float: right; color: #8492a6; font-size: 13px">{{ item.value }}</span>
103 103
               </el-option>
104 104
             </el-select>
105
-          </el-form-item>
105
+          </el-form-item> -->
106 106
           <el-form-item label="机构状态" prop="orgState" :label-width="formLabelWidth">
107 107
             <el-radio-group v-model="addOrgForm.orgState" size="small">
108 108
               <el-radio label="1" border>启用</el-radio>
@@ -127,14 +127,14 @@
127 127
               </el-option>
128 128
             </el-select>
129 129
           </el-form-item> -->
130
-          <el-form-item label="机构类型" prop="storeTypeName" :label-width="formLabelWidth">
130
+          <!-- <el-form-item label="机构类型" prop="storeTypeName" :label-width="formLabelWidth">
131 131
             <el-select v-model="editOrgForm.storeTypeCode" placeholder="请选择">
132 132
               <el-option v-for="item in orgTypes" :key="item.index" :label="item.label" :value="item.value">
133 133
                 <span style="float: left">{{ item.label }}</span>
134 134
                 <span style="float: right; color: #8492a6; font-size: 13px">{{ item.value }}</span>
135 135
               </el-option>
136 136
             </el-select>
137
-          </el-form-item>
137
+          </el-form-item> -->
138 138
           <el-form-item label="机构状态" prop="orgState" :label-width="formLabelWidth">
139 139
             <el-radio-group v-model="editOrgForm.orgState" size="small">
140 140
               <el-radio label="1" border>启用</el-radio>
@@ -401,7 +401,7 @@ export default {
401 401
     // 删除
402 402
     delecheck(index, row) {
403 403
       let id = row.id;
404
-      this.$confirm("确定删除该项记录?", "提示", {
404
+      this.$confirm("确定删除该组织机构?", "提示", {
405 405
         confirmButtonText: "确定",
406 406
         cancelButtonText: "取消",
407 407
         type: "warning",
@@ -560,10 +560,15 @@ export default {
560 560
             api
561 561
               .addOrganization(data)
562 562
               .then((res) => {
563
-                // console.log(res, '新增机构成功')
564
-                this.getPageInfo();
565
-                // 新增成功关闭弹窗
566
-                this.dialogFormVisible = false;
563
+                if(res.code==200){
564
+                  // console.log(res, '新增机构成功')
565
+                  this.$message.success('新增机构成功');
566
+                  this.getPageInfo();
567
+                  // 新增成功关闭弹窗
568
+                  this.dialogFormVisible = false;
569
+                }else{
570
+                  this.$message.error(res.msg);
571
+                }
567 572
               })
568 573
               .catch((err) => {
569 574
                 console.log(err, "新增机构err");
@@ -596,6 +601,9 @@ export default {
596 601
                 if (res.code == 200) {
597 602
                   this.getPageInfo();
598 603
                   this.dialogFormVisible1 = false;
604
+                  this.$message.success("修改机构成功");
605
+                }else{
606
+                  this.$message.error(res.msg);
599 607
                 }
600 608
               })
601 609
               .catch((err) => {
@@ -671,20 +679,20 @@ export default {
671 679
     // width: calc(100% - 250px);
672 680
     .nav {
673 681
       padding: 10px 0 10px 10px;
674
-      color: #fff;
682
+      // color: #fff;
675 683
 
676 684
       font-size: 14px;
677 685
 
678
-      background: #004a93;
686
+      background: #fff;
679 687
     }
680 688
     .right_main {
681
-      border: 1px solid #67a7df;
682
-      background: #112f5d;
689
+      // border: 1px solid #67a7df;
690
+      // background: #112f5d;
683 691
 
684 692
       margin-top: 10px;
685 693
       .right_title {
686 694
         color: #fff;
687
-        border-bottom: 1px solid #67a7df;
695
+        // border-bottom: 1px solid #67a7df;
688 696
         padding: 10px;
689 697
         font-size: 14px;
690 698
       }

+ 15 - 12
src/views/demo/system/roleManagement/index.vue

@@ -7,10 +7,10 @@
7 7
           <!-- <template slot="header">首页/数据查询</template> -->
8 8
           <div class="nav">当前所在位置:首页>角色管理</div>
9 9
           <div class="right_main">
10
-            <div class="right_title">
10
+            <!-- <div class="right_title">
11 11
               <i class="fa fa-bar-chart" aria-hidden="true" style="padding-right: 5px"></i>
12 12
               角色管理
13
-            </div>
13
+            </div> -->
14 14
             <div class="right_table">
15 15
               <el-form :inline="true" :model="formInline" class="demo-form-inline" id="formLabel">
16 16
                 <div class="float-left">
@@ -30,7 +30,7 @@
30 30
                   </el-form-item>
31 31
                 </div>
32 32
               </el-form>
33
-              <el-table :data="tableData" ref='dataTreeList' style="width: 100%" :header-cell-style="{ background: '#0064b9', color: '#c9f5fa' }" row-key="id" border>
33
+              <el-table :data="tableData" ref='dataTreeList' style="width: 100%" row-key="id" border>
34 34
                 <el-table-column prop="roleName" label="角色名称" align="center">
35 35
                 </el-table-column>
36 36
                 <el-table-column prop="roleState" label="角色状态" align="center">
@@ -57,11 +57,11 @@
57 57
                 </el-table-column>
58 58
                 <el-table-column fixed="right" label="操作" width="300" align="center">
59 59
                   <template slot-scope="scope">
60
-                    <el-button @click="handleEdit(1, scope.$index, scope.row)" type="editbtn" class="fa fa-edit" size="mini">编辑</el-button>
61
-                    <el-button @click="delecheck( scope.$index, scope.row)" type="delebtn" class="fa fa-remove" size="mini">删除</el-button>
62
-                    <el-button @click="handleCheck(scope.$index, scope.row)" type="detailbtn" class="fa fa-info-circle" size="mini">查看</el-button>
60
+                    <el-button @click="handleEdit(1, scope.$index, scope.row)" class="fa fa-edit" size="mini">编辑</el-button>
61
+                    <el-button @click="delecheck( scope.$index, scope.row)" class="fa fa-remove" size="mini">删除</el-button>
62
+                    <el-button @click="handleCheck(scope.$index, scope.row)" class="fa fa-info-circle" size="mini">查看</el-button>
63 63
                     <!-- <el-switch v-model="value" on-text='启用' off-text='禁用' active-value='启用' inactive-value='禁用' active-color="#13ce66" inactive-color="#ff4949"> -->
64
-                    </el-switch>
64
+                    <!-- </el-switch> -->
65 65
                   </template>
66 66
                 </el-table-column>
67 67
               </el-table>
@@ -252,7 +252,10 @@ export default {
252 252
       console.log(this.formInline, 'this.formInline')
253 253
       this.getList()
254 254
     },
255
-    reset () { },
255
+    reset () {
256
+      this.formInline.roleName=""
257
+      this.getList()
258
+    },
256 259
     // 重置表单
257 260
     resetForm () {
258 261
       this.addRoleForm.roleCode = '',
@@ -466,15 +469,15 @@ export default {
466 469
     // width: calc(100% - 250px);
467 470
     .nav {
468 471
       padding: 10px 0 10px 10px;
469
-      color: #fff;
472
+      // color: #fff;
470 473
 
471 474
       font-size: 14px;
472 475
 
473
-      background: #004a93;
476
+      background: #fff;
474 477
     }
475 478
     .right_main {
476
-      border: 1px solid #67a7df;
477
-      background: #112f5d;
479
+      // border: 1px solid #67a7df;
480
+      // background: #112f5d;
478 481
 
479 482
       margin-top: 10px;
480 483
       .right_title {

+ 30 - 32
src/views/demo/system/userManagement/index.vue

@@ -7,15 +7,15 @@
7 7
           <!-- <template slot="header">首页/数据查询</template> -->
8 8
           <div class="nav">当前所在位置:首页>用户管理</div>
9 9
           <div class="right_main">
10
-            <div class="right_title">
10
+            <!-- <div class="right_title">
11 11
               <i class="fa fa-bar-chart" aria-hidden="true" style="padding-right: 5px"></i>
12 12
               用户管理
13
-            </div>
13
+            </div> -->
14 14
             <div class="right_table">
15 15
               <el-form :inline="true" :model="formInline" class="demo-form-inline" id="formLabel">
16 16
                 <div class="float-left">
17 17
                   <!-- <el-form-item label="直属库名称">
18
-                    <el-select v-model="formInline.orgId" placeholder="请选择">
18
+                    <el-select v-model="formInline.orgCode" placeholder="请选择">
19 19
                       <el-option v-for="item in ckLists" :key="item.id" :label="item.orgName" :value="item.id">
20 20
                       </el-option>
21 21
                     </el-select>
@@ -54,25 +54,22 @@
54 54
                   </el-form-item>
55 55
                 </div>
56 56
               </el-form>
57
-              <el-table :data="userList" ref="dataTreeList" style="width: 100%" :header-cell-style="{ background: '#0064b9', color: '#c9f5fa' }" row-key="id" border :tree-props="{
57
+              <el-table :data="userList" ref="dataTreeList" style="width: 100%" row-key="id" border :tree-props="{
58 58
                   children: 'children',
59 59
                   hasChildren: 'hasChildren',
60 60
                 }">
61
-                <el-table-column align="center" label="序号" type="index" width="100px" :index="indexMethod" show-overflow-tooltip></el-table-column>
62
-                <el-table-column prop="userId" label="用户ID" align="center">
61
+                <el-table-column align="center" label="序号" type="index" width="100px" :index="indexMethod"></el-table-column>
62
+                <el-table-column prop="id" label="用户ID" align="center">
63 63
                 </el-table-column>
64 64
                 <el-table-column prop="userName" label="姓名" align="center">
65 65
                 </el-table-column>
66 66
 
67 67
                 <el-table-column prop="userRoleName" label="角色" align="center">
68 68
                 </el-table-column>
69
-                <el-table-column prop="orgName" label="所属仓库" align="center">
70
-                </el-table-column>
71
-                <el-table-column prop="manageStoreName" label="管理仓房" align="center">
69
+                <el-table-column prop="orgName" label="所属组织" align="center">
72 70
                 </el-table-column>
73 71
                 <el-table-column prop="userPhone" label="联系方式" align="center">
74 72
                 </el-table-column>
75
-                </el-table-column>
76 73
                 <el-table-column prop="userState" label="用户状态" align="center">
77 74
                   <template slot-scope="scope">
78 75
                     <div v-if="scope.row.userState=='1'">
@@ -86,13 +83,13 @@
86 83
                     </div>
87 84
                   </template>
88 85
                 </el-table-column>
89
-                </el-table-column>
86
+
90 87
                 <!-- <el-table-column prop="buildTime" label="创建时间" align="center" width="180px;">
91 88
                 </el-table-column> -->
92 89
                 <el-table-column fixed="right" label="操作" width="300" align="center">
93 90
                   <template slot-scope="scope">
94
-                    <el-button @click="edit(scope.row,2)" type="editbtn" class="fa fa-edit" size="mini">编辑</el-button>
95
-                    <el-button @click="deleted(scope.row)" type="delebtn" class="fa fa-remove" size="mini">删除</el-button>
91
+                    <el-button @click="edit(scope.row,2)" class="fa fa-edit" size="mini">编辑</el-button>
92
+                    <el-button @click="deleted(scope.row)" class="fa fa-remove" size="mini">删除</el-button>
96 93
 
97 94
                     <!-- <el-switch
98 95
                     id="switchBtn"
@@ -129,19 +126,19 @@
129 126
               </el-option>
130 127
             </el-select>
131 128
           </el-form-item>
132
-          <el-form-item label="所属仓库" :label-width="formLabelWidth" prop="orgId">
133
-            <el-select v-model="form.orgId" placeholder="请选择" @change="ckChange">
129
+          <el-form-item label="所属组织" :label-width="formLabelWidth" prop="orgCode">
130
+            <el-select v-model="form.orgCode" placeholder="请选择" @change="ckChange">
134 131
               <el-option v-for="item in ckLists" :key="item.id" :label="item.orgName" :value="item.id">
135 132
               </el-option>
136 133
             </el-select>
137 134
           </el-form-item>
138 135
 
139
-          <el-form-item label="管理仓房" :label-width="formLabelWidth" prop="manageStore">
136
+          <!-- <el-form-item label="管理仓房" :label-width="formLabelWidth" prop="manageStore">
140 137
             <el-select v-model="form.manageStore" placeholder="请选择">
141 138
               <el-option v-for="item in cfLists" :key="item.id" :label="item.orgName" :value="item.id">
142 139
               </el-option>
143 140
             </el-select>
144
-          </el-form-item>
141
+          </el-form-item> -->
145 142
           <el-form-item label="联系方式" :label-width="formLabelWidth" prop="userPhone">
146 143
             <el-input v-model="form.userPhone" autocomplete="off"></el-input>
147 144
           </el-form-item>
@@ -198,7 +195,7 @@ export default {
198 195
         userRole: [
199 196
           { required: true, message: "请选择用户角色", trigger: "blur" },
200 197
         ],
201
-        orgId: [
198
+        orgCode: [
202 199
           { required: true, message: "请选择所属仓库", trigger: "blur" },
203 200
         ],
204 201
         manageStore: [
@@ -221,7 +218,7 @@ export default {
221 218
         userId: "",
222 219
         userName: "",
223 220
         userRole: "",
224
-        orgId: "",
221
+        orgCode: "",
225 222
         manageStore: "",
226 223
         userPhone: "",
227 224
         userState: true,
@@ -230,7 +227,7 @@ export default {
230 227
 
231 228
       //查询条件
232 229
       formInline: {
233
-        orgId: "",
230
+        orgCode: "",
234 231
         userRole: "",
235 232
         userName: "",
236 233
       },
@@ -271,7 +268,7 @@ export default {
271 268
     getList() {
272 269
       console.log("....");
273 270
       var condition = {
274
-        orgId: this.formInline.orgId,
271
+        orgCode: this.formInline.orgCode,
275 272
         userRole: this.formInline.userRole,
276 273
         userName: this.formInline.userName,
277 274
       };
@@ -346,7 +343,7 @@ export default {
346 343
     },
347 344
     cfList() {
348 345
       var data = {
349
-        parentId: this.form.orgId,
346
+        parentId: this.form.orgCode,
350 347
       };
351 348
       api
352 349
         .ckList(data)
@@ -355,7 +352,7 @@ export default {
355 352
             this.cfLists = res.data;
356 353
             res.data.forEach((item) => {
357 354
               var obj = {};
358
-              if (item.storeTypeCode === this.this.form.orgId) {
355
+              if (item.storeTypeCode === this.this.form.orgCode) {
359 356
                 console.log(item, "item...");
360 357
                 (obj.orgName = item.orgName), (obj.id = item.id);
361 358
                 this.cfLists.push(obj);
@@ -390,7 +387,7 @@ export default {
390 387
         }
391 388
       });
392 389
       this.ckLists.forEach((item) => {
393
-        if (item.id === this.form.orgId) {
390
+        if (item.id === this.form.orgCode) {
394 391
           this.orgName = item.orgName;
395 392
         }
396 393
       });
@@ -407,7 +404,7 @@ export default {
407 404
         userName: this.form.userName,
408 405
         userPassword: this.form.userPassword,
409 406
         userRole: this.form.userRole,
410
-        orgId: String(this.form.orgId),
407
+        orgCode: String(this.form.orgCode),
411 408
         manageStore: String(this.form.manageStore),
412 409
         userPhone: this.form.userPhone,
413 410
         userState: this.form.userState === true ? "1" : "0",
@@ -437,7 +434,7 @@ export default {
437 434
         }
438 435
       });
439 436
       this.ckLists.forEach((item) => {
440
-        if (item.id === this.form.orgId) {
437
+        if (item.id === this.form.orgCode) {
441 438
           this.orgName = item.orgName;
442 439
         }
443 440
       });
@@ -456,7 +453,7 @@ export default {
456 453
         userName: this.form.userName,
457 454
         userPassword: this.form.userPassword,
458 455
         userRole: this.form.userRole,
459
-        orgId: String(this.form.orgId),
456
+        orgCode: String(this.form.orgCode),
460 457
         manageStore: String(this.form.manageStore),
461 458
         userPhone: this.form.userPhone,
462 459
         userState: this.form.userState === true ? "1" : "0",
@@ -513,7 +510,7 @@ export default {
513 510
        this.$set(this.form,"userName",null)
514 511
         this.$set(this.form,"userRole",null)
515 512
         this.$set(this.form,"userId",null)
516
-        this.$set(this.form,"orgId",null)
513
+        this.$set(this.form,"orgCode",null)
517 514
         this.$set(this.form,"manageStore",null)
518 515
         this.$set(this.form,"userPhone",null)
519 516
          this.$set(this.form,"userState",true)
@@ -526,6 +523,7 @@ export default {
526 523
     },
527 524
     //编辑用户
528 525
     edit(row, type) {
526
+      console.log(row,44);
529 527
       this.btnType = type;
530 528
       this.userDialog = true;
531 529
       this.title = "修改用户";
@@ -536,7 +534,7 @@ export default {
536 534
        this.$set(this.form,"userName",row.userName)
537 535
         this.$set(this.form,"userRole",row.userRole)
538 536
         this.$set(this.form,"userId",row.userId)
539
-        this.$set(this.form,"orgId",parseInt(row.orgId))
537
+        this.$set(this.form,"orgCode",parseInt(row.orgCode))
540 538
         this.$set(this.form,"manageStore",parseInt(row.manageStore))
541 539
         this.$set(this.form,"userPhone",row.userPhone)
542 540
          this.$set(this.form,"userState",row.userState==="1"?true:false)
@@ -551,7 +549,7 @@ export default {
551 549
       //   userName: row.userName,
552 550
       //   userRole: row.userRole,
553 551
       //   userId: row.userId,
554
-      //   orgId: parseInt(row.orgId),
552
+      //   orgCode: parseInt(row.orgCode),
555 553
       //   manageStore: parseInt(row.manageStore),
556 554
       //   userPhone: row.userPhone,
557 555
       //   userState: row.userState,
@@ -633,11 +631,11 @@ export default {
633 631
     // width: calc(100% - 250px);
634 632
     .nav {
635 633
       padding: 10px 0 10px 10px;
636
-      color: #fff;
634
+      // color: #fff;
637 635
 
638 636
       font-size: 14px;
639 637
 
640
-      background: #004a93;
638
+      background: #fff;
641 639
     }
642 640
     // .right_main {
643 641
     //   border: 1px solid #67a7df;

+ 1 - 1
src/views/system/index/page copy 2.vue

@@ -57,7 +57,7 @@
57 57
                 <div class="aa">
58 58
                   <div
59 59
                     class="numberBac"
60
-                    v-for="item in endVal.toString().split('')"
60
+                    v-for="(item,index) in endVal.toString().split('')"
61 61
                     :key="index"
62 62
                   ></div>
63 63
                 </div>

文件差異過大導致無法顯示
+ 272 - 1892
src/views/system/index/page.vue


二進制
src/views/system/login/image/bg.jpg


二進制
src/views/system/login/image/dengluk.png


+ 12 - 3
src/views/system/login/page.vue

@@ -27,6 +27,7 @@
27 27
                 :rules="rules"
28 28
                 :model="formLogin"
29 29
                 size="default">
30
+                <div style="font-size:30px;text-align:center;color:#fff;margin-bottom:30px">用户登录</div>
30 31
                 <el-form-item prop="username">
31 32
                   <el-input
32 33
                     type="text"
@@ -163,7 +164,7 @@ export default {
163 164
   
164 165
    loginBtn(){
165 166
      let data={
166
-       userId:this.formLogin.username,
167
+       userName:this.formLogin.username,
167 168
        userPassword:this.formLogin.password
168 169
      }
169 170
      api.login(data)
@@ -232,7 +233,7 @@ export default {
232 233
   $backgroundColor: #F0F2F5;
233 234
   // ---
234 235
   background-color: $backgroundColor;
235
-  background: url('./image/bg.png') center no-repeat ;
236
+  background: url('./image/bg.jpg') center no-repeat ;
236 237
   background-size:100% 100%;
237 238
   height: 100%;
238 239
   position: relative;
@@ -275,14 +276,22 @@ export default {
275 276
   }
276 277
   // 登录表单
277 278
   .page-login--form {
278
-    width: 280px;
279
+    width: 25em;
280
+    height: 23em;
281
+    background-image: url("./image/dengluk.png");
282
+    background-repeat: no-repeat;
283
+    background-size: 100% 100%;
279 284
     // 卡片
280 285
     .el-card {
281 286
       margin-bottom: 15px;
287
+      background: none !important;
288
+      border: none !important;
282 289
     }
283 290
     // 登录按钮
284 291
     .button-login {
285 292
       width: 100%;
293
+      background: linear-gradient(0deg, #01E9BD, #00D6B9);
294
+      border-radius: 6px;
286 295
     }
287 296
     // 输入框左边的图表区域缩窄
288 297
     .el-input-group__prepend {

+ 1 - 1
vue.config.js

@@ -42,7 +42,7 @@ module.exports = {
42 42
     disableHostCheck: process.env.NODE_ENV === 'development', // 关闭 host check,方便使用 ngrok 之类的内网转发工具
43 43
     proxy: {
44 44
       '/api': {
45
-        target: 'http://101.36.160.140:21023',
45
+        target: 'http://101.36.160.140:31005/smart-grp-basic',
46 46
         // target: 'http://112.51.248.191:7070',
47 47
           // target: '192.168.2.6:7070',
48 48