Commit e47fb2bc36ad4fd7b7a13f0e7f4b011aa3515e21
1 parent
497e575d
地磁故障api
Showing
4 changed files
with
23 additions
and
31 deletions
src/components/geomagnetism.vue
1 | <template> | 1 | <template> |
2 | <div class=""> | 2 | <div class=""> |
3 | <ul class="dici-wrap"> | 3 | <ul class="dici-wrap"> |
4 | - <li> | ||
5 | - <p class="parkName">赤峰市万达A区停车场</p> | ||
6 | - <ul class="diciList"> | 4 | + <li v-for="(item, index) in queryGeoFaultList" :key="index"> |
5 | + <p class="parkName">{{item.plName}}</p> | ||
6 | + <ul class="diciList" v-for="(list, i) in item.eqpDTOs" :key="i"> | ||
7 | <li> | 7 | <li> |
8 | - 编号 :B8888B8888 | 8 | + 编号 :{{list.eqpNo}} |
9 | </li> | 9 | </li> |
10 | <li> | 10 | <li> |
11 | - 故障时间 :2019-01-91 15:31:00 | ||
12 | - </li> | ||
13 | - </ul> | ||
14 | - <ul class="diciList"> | ||
15 | - <li> | ||
16 | - 编号 :B8888B8888 | ||
17 | - </li> | ||
18 | - <li> | ||
19 | - 故障时间 :2019-01-91 15:31:00 | ||
20 | - </li> | ||
21 | - </ul> | ||
22 | - </li> | ||
23 | - <li> | ||
24 | - <p class="parkName">赤峰市万达A区停车场</p> | ||
25 | - <ul class="diciList"> | ||
26 | - <li> | ||
27 | - 编号 :B8888B8888 | ||
28 | - </li> | ||
29 | - <li> | ||
30 | - 故障时间 :2019-01-91 15:31:00 | 11 | + 故障时间 :{{list.modifyTime | dataFilter}} |
31 | </li> | 12 | </li> |
32 | </ul> | 13 | </ul> |
14 | + | ||
33 | </li> | 15 | </li> |
16 | + | ||
34 | </ul> | 17 | </ul> |
35 | </div> | 18 | </div> |
36 | </template> | 19 | </template> |
@@ -40,18 +23,24 @@ import { diciAddress } from '../utils/api' | @@ -40,18 +23,24 @@ import { diciAddress } from '../utils/api' | ||
40 | export default { | 23 | export default { |
41 | name: 'geomagnetism', | 24 | name: 'geomagnetism', |
42 | data() { | 25 | data() { |
43 | - return {} | 26 | + return { |
27 | + modifyTimeBegin: new Date('2019-04-01 00:00:00'), | ||
28 | + modifyTimeEnd: new Date('2019-04-04 00:00:00'), | ||
29 | + queryGeoFaultList: [] | ||
30 | + } | ||
44 | }, | 31 | }, |
45 | created() { | 32 | created() { |
46 | document.title = '地磁故障' | 33 | document.title = '地磁故障' |
47 | diciAddress({ | 34 | diciAddress({ |
48 | - modifyTimeBegin: new Date('2019-04-01 00:00:00'), | ||
49 | - modifyTimeEnd: new Date('2019-04-04 00:00:00'), | 35 | + modifyTimeBegin:this.modifyTimeBegin, |
36 | + modifyTimeEnd: this.modifyTimeEnd, | ||
50 | orgId: 10003, | 37 | orgId: 10003, |
51 | sysCode:'1001', | 38 | sysCode:'1001', |
52 | }) | 39 | }) |
53 | .then((res) => { | 40 | .then((res) => { |
54 | - console.log(res) | 41 | + console.log(res.data.data) |
42 | + const queryGeoFaultList = res.data.data | ||
43 | + this.queryGeoFaultList = queryGeoFaultList | ||
55 | }) | 44 | }) |
56 | .catch((res) => { | 45 | .catch((res) => { |
57 | console.log(res) | 46 | console.log(res) |
src/main.js
@@ -7,11 +7,14 @@ require ('./assets/style/reset.css') | @@ -7,11 +7,14 @@ require ('./assets/style/reset.css') | ||
7 | Vue.filter('dataFilter',function () { | 7 | Vue.filter('dataFilter',function () { |
8 | let date = new Date() | 8 | let date = new Date() |
9 | let str = '' | 9 | let str = '' |
10 | + let year = date.getFullYear() | ||
11 | + let month = date.getMonth()+1<10? "0"+ (date.getMonth()+1) : date.getMonth()+1 | ||
12 | + let day = date.getDate()<10 ? "0"+date.getDate() : date.getDate() | ||
10 | let hours = date.getHours()<10? "0"+date.getHours() : date.getHours() | 13 | let hours = date.getHours()<10? "0"+date.getHours() : date.getHours() |
11 | let minutes=date.getMinutes()<10 ? "0"+date.getMinutes() : date.getMinutes(); | 14 | let minutes=date.getMinutes()<10 ? "0"+date.getMinutes() : date.getMinutes(); |
12 | let seconds=date.getSeconds()<10 ? "0"+date.getSeconds() : date.getSeconds(); | 15 | let seconds=date.getSeconds()<10 ? "0"+date.getSeconds() : date.getSeconds(); |
13 | 16 | ||
14 | - str = hours+":"+minutes+":"+seconds | 17 | + str = year+'-'+month+'-'+day+' '+hours+":"+minutes+":"+seconds |
15 | return str | 18 | return str |
16 | }) | 19 | }) |
17 | 20 |
src/utils/api.js
src/utils/request.js
@@ -76,7 +76,7 @@ axios.interceptors.response.use(response => { | @@ -76,7 +76,7 @@ axios.interceptors.response.use(response => { | ||
76 | //axios.defaults.baseURL = '/api' | 76 | //axios.defaults.baseURL = '/api' |
77 | 77 | ||
78 | // axios.defaults.baseURL = 'http://39.98.54.240:8093/'; | 78 | // axios.defaults.baseURL = 'http://39.98.54.240:8093/'; |
79 | -axios.defaults.baseURL = 'http://test.renniting.cn/bcp/wxcpMsgCenter/queryGeoFaultList';//测试地址 | 79 | +axios.defaults.baseURL = 'http://test.renniting.cn/bcp/wxcpMsgCenter/';//测试地址 |
80 | //设置默认请求头 | 80 | //设置默认请求头 |
81 | // axios.defaults.withCredentials=true;//让ajax携带cookie | 81 | // axios.defaults.withCredentials=true;//让ajax携带cookie |
82 | 82 |