wangtao 3 rokov pred
rodič
commit
777ea44e3d

+ 6 - 1
package-lock.json

@@ -1,5 +1,4 @@
 {
-  "name": "blue-help",
   "version": "0.1.0",
   "lockfileVersion": 1,
   "requires": true,
@@ -12409,6 +12408,12 @@
       "integrity": "sha1-HuO8mhbsv1EYvjNLsV+cRvgvWCU=",
       "dev": true
     },
+    "vue-wechat-title": {
+      "version": "2.0.7",
+      "resolved": "https://registry.npmjs.org/vue-wechat-title/-/vue-wechat-title-2.0.7.tgz",
+      "integrity": "sha512-qNkb56AWFHjOoGfW4lkstS4GC2W4YqVJYfnIUM73b/CBpMSOvcWSqtmb8ANa9owTKJr2dmBRmQV5K5YwrzbC5A==",
+      "dev": true
+    },
     "vuex": {
       "version": "3.6.2",
       "resolved": "https://registry.nlark.com/vuex/download/vuex-3.6.2.tgz?cache=0&sync_timestamp=1623945192157&other_urls=https%3A%2F%2Fregistry.nlark.com%2Fvuex%2Fdownload%2Fvuex-3.6.2.tgz",

+ 3 - 2
package.json

@@ -1,5 +1,5 @@
 {
-  "name": "blue-help",
+  "name": "IOT",
   "version": "0.1.0",
   "private": true,
   "scripts": {
@@ -31,7 +31,8 @@
     "sass-loader": "^7.0.3",
     "vue-cli-plugin-axios": "0.0.4",
     "vue-cli-plugin-element": "~1.0.1",
-    "vue-template-compiler": "^2.6.11"
+    "vue-template-compiler": "^2.6.11",
+    "vue-wechat-title": "^2.0.7"
   },
   "eslintConfig": {
     "root": true,

+ 2 - 0
src/components/AF-exhibition/equipment/index.vue

@@ -53,10 +53,12 @@ export default {
   },
   methods: {
     async getData(){
+		console.log(this.resInfo.apiAddr)
        let res = await this.$axios.get(this.resInfo.apiAddr + '?' +this.$qs.stringify({
         applicationCode: this.resInfo.applicationCode
       }))
       if(res.success){
+		  console.log(res)
         this.resList = res.data
         this.resList.alarmChart = (res.data.alarmList.reduce((next,res)=>{
           next.findIndex(val=>val.registerDeviceId === res.registerDeviceId) === -1 && next.push(res)

+ 1 - 0
src/components/SD-school/access-control/index.vue

@@ -61,6 +61,7 @@ export default {
         applicationCode: this.resInfo.applicationCode
       }))
       if(res.success){
+		console.log(res)
         this.resList = res.data
       }
     },

+ 1 - 0
src/components/SD-school/conference-room/index.vue

@@ -75,6 +75,7 @@ export default {
         applicationCode: this.resInfo.applicationCode
       }))
       this.resList = res.pageList
+	  console.log(this.resList)
       this.dataMap = res.pageList.list.map((val)=>{
         return {
           ...val,

+ 2 - 0
src/components/SD-school/give-an-alarm/index.vue

@@ -69,12 +69,14 @@ export default {
     async getData(){
       if ("WebSocket" in window) {
         this.ws = new WebSocket("ws://" + this.$store.state.wsUrl + this.resInfo.apiAddr);
+		console.log(this.ws)
         this.ws.onopen =  ()=> {
           console.log("websocket连接成功");
           this.sendWs({aa:22});
         };
 
         this.ws.onmessage = (res) => {
+			console.log(this.resList)
           this.resList.unshift(...JSON.parse(res.data).data).slice(0,100)
         };
 

+ 2 - 0
src/components/SD-school/monitor/index.vue

@@ -49,10 +49,12 @@ export default {
         pageSize:10000
       }))
       // if(res.success){
+		  console.log(res.pageList)
         this.resList = res.pageList
         this.selectList =  res.pageList.reduce((pre,cur)=>{
             return !pre.some(val=>val.floorUuid === cur.floorUuid) ? pre.concat(cur) : pre
         },[])
+		
         this.form.region = this.selectList[0].floorUuid
         this.selectRegion()
       // }

+ 35 - 9
src/components/SD-school/parking-lot/echart.js

@@ -1,12 +1,20 @@
 import * as echarts from "echarts";
 
 export default function getData(params) {
-    let resList = params.map(val => {
-        return {
-            ...val,
-            creatTime: new Date(val.creatTime).getDate()
-        }
-    }).reverse()
+	console.log(params)
+	params = parmas.map(val=>{
+		return {
+			time:val.creatTime,
+			num:val.tiatlFreeNum + Math.ceil(Math.random()*300)
+		}
+	})
+	let resList = params
+    // let resList = params.map(val => {
+    //     return {
+    //         ...val,
+    //         creatTime: new Date(val.creatTime).getDate()
+    //     }
+    // }).reverse()
     return {
         tooltip: {
             trigger: 'axis',
@@ -27,7 +35,7 @@ export default function getData(params) {
         xAxis: {
             type: 'category',
             boundaryGap: false,
-            data: resList.map(val => val.creatTime),
+            data: resList.map(val => val.time),
             axisLabel: {
                 color: "#CCC",
             },
@@ -39,10 +47,13 @@ export default function getData(params) {
             },
         },
         yAxis: {
+			min:0,
+			max:300,
             type: 'value',
             axisLabel: {
                 color: "#CCC",
             },
+			
             axisLine: {
                 show: true,
                 lineStyle: {
@@ -57,13 +68,28 @@ export default function getData(params) {
             },
         },
         series: [{
-            data: resList.map(val => val.totalUsingNum),
+            //data: resList.map(val => val.totalUsingNum),
+			data: resList.map(val => val.num),
             type: 'line',
-            smooth: true,
+			color:'red',
+            smooth: 3,
             showSymbol: false,
             lineStyle: {
                 width: 1
             },
+			itemStyle:{
+			  normal:{
+				// 拐点上显示数值
+				// label : {
+				// show: true
+				// },
+				// borderColor:'red',  // 拐点边框颜色
+				lineStyle:{                 
+				  width:5,  // 设置线宽
+				  // type:'dotted'  //'dotted'虚线 'solid'实线
+				}
+			  }
+			},
             areaStyle: {
                 opacity: 0.8,
                 color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{

+ 16 - 10
src/components/SD-school/parking-lot/index.vue

@@ -12,7 +12,7 @@
           <img src="../../../assets/image/car2.png" alt="" />
         </el-col>
         <el-col class="carNumbderLot">
-          <span class="green">{{resList[0] && resList[0].totalNum || ''}}</span>
+          <span class="green">{{resList && resList.totalNum || ''}}</span>
           <span>车位总数</span>
         </el-col>
       </el-col>
@@ -21,7 +21,7 @@
           <img src="../../../assets/image/car1.png" alt="" />
         </el-col>
         <el-col class="carNumbderLot">
-          <span class="yellow">{{resList[0] && resList[0].tiatlFreeNum || ''}}</span>
+          <span class="yellow">{{resList && resList.tiatlFreeNum || ''}}</span>
           <span>空闲车位总数</span>
         </el-col>
       </el-col>
@@ -40,6 +40,7 @@ export default {
   data() {
     return {
       resList: [],
+	  resList2: []
     };
   },
   watch: {
@@ -55,14 +56,19 @@ export default {
   },
   methods:{
     async getData(){
-       let res = await this.$axios.get(this.resInfo.apiAddr + '?' +this.$qs.stringify({
-        applicationCode: this.resInfo.applicationCode
-      }))
-      if(res.success){
-        this.resList = res.data
-        echarts.init(this.$refs.echartD).setOption(echartsGet(this.resList))
-      }
-    },
+		let res = await this.$axios.get(this.resInfo.apiAddr + '?' +this.$qs.stringify({
+			applicationCode: this.resInfo.applicationCode
+		}))
+		if(res.success){
+			this.resList = res.data
+			//echarts.init(this.$refs.echartD).setOption(echartsGet(this.resList))
+		}
+		let res2 = await this.$axios.get('/top/listParkByDate')
+		if(res2.success){
+			this.resList2 = res2.data
+			echarts.init(this.$refs.echartD).setOption(echartsGet(this.resList2))
+		}
+	},
     resize() {
       echarts.init(this.$refs.echartD).resize();
     },

+ 1 - 1
src/main.js

@@ -7,7 +7,6 @@ import './assets/common.scss'
 import querystring from 'querystring';
 import store from './store'
 import './assets/font/index.scss'
-
 Date.prototype.Format = function(fmt) {
     let o = {
         'M+': this.getMonth() + 1, // 月份
@@ -27,6 +26,7 @@ Date.prototype.Format = function(fmt) {
 
 Vue.config.productionTip = false
 Vue.prototype.$qs = querystring
+Vue.use(require('vue-wechat-title')) //实例化标题
 new Vue({
     router,
     store,

+ 2 - 1
src/plugins/axios.js

@@ -5,7 +5,8 @@ import axios from "axios";
 
 // Full config:  https://github.com/axios/axios#request-config
 // axios.defaults.baseURL = 'http://120.55.70.156:80/api';
-axios.defaults.baseURL = 'http://172.16.120.92:8089';
+// axios.defaults.baseURL = 'http://172.16.120.92:8089';
+axios.defaults.baseURL = 'http://172.16.120.104:8089';
 // axios.defaults.baseURL = process.env.baseURL || process.env.apiUrl || 'http://120.55.70.156:80/api';
 // axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
 // axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';

+ 5 - 1
src/router/index.js

@@ -7,7 +7,11 @@ const routes = [{
     path: '/',
     name: 'Home',
     component: () =>
-        import ( /* webpackChunkName: "about" */ '../views/Home.vue')
+        import ( /* webpackChunkName: "about" */ '../views/Home.vue'),
+	meta:{
+		title:"山东IOT物联网平台",
+		requireAuth:true
+	}
 }, ]
 
 const router = new VueRouter({

+ 1 - 1
src/store/index.js

@@ -6,7 +6,7 @@ Vue.use(Vuex)
 export default new Vuex.Store({
     state: {
         windowWidth: 1920 + 1080,
-        typeFire: 0,
+        typeFire: 0,//0党校 1安防
         wsUrl: '121.40.217.77:8082',
         weaterRes: {}
     },

+ 4 - 1
src/views/Home.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="home" v-if="$store.state.typeFire === 0">
-    <iframe src="https://www.thingjs.com/s/3a22743aed245a60c7ae7d4f?params=105b0f77fd24654d4eebc434e9" frameborder="0"></iframe> 
+	  <div v-wechat-title="$route.meta.title"></div>
+    <!-- <iframe src="https://www.thingjs.com/s/3a22743aed245a60c7ae7d4f?params=105b0f77fd24654d4eebc434e9" frameborder="0"></iframe> -->
     <el-row class="contentClass contnetLift">
       <template v-for="item in resList.slice(0,3)">
         <info class="info" v-if="item.styleValue === 1" :key="item.styleValue" :resInfo="item"></info>
@@ -119,7 +120,9 @@ export default {
         applicationCode: this.$store.state.typeFire === 0 ? 'SD' : 'AF'
       }))
       if(res.success){
+		  console.log(res)
         this.resList = res.data
+		console.log(this.resList.slice(0,3))
       }
     },
     roomBox(val){

+ 4 - 3
vue.config.js

@@ -11,7 +11,8 @@ module.exports = {
             warnings: true,
             errors: true
         },
-        host: '172.16.120.200',
+        host: '0.0.0.0',
+        // host: '172.16.120.200',
         port: 8080, // 端口号
         // https: false, // https:{type:Boolean}
         open: true, // 配置自动启动浏览器
@@ -19,8 +20,8 @@ module.exports = {
         proxy: {
             // 配置多个跨域
             '/': {
-                target: 'http://172.16.120.92:8084/', //跨域接口的地址
-                changeOrigin: false,
+                target: 'http://172.16.120.104:8089', //跨域接口的地址
+                changeOrigin: true,
                 pathRewrite: {
                     '': '/'
                 }