Browse Source

完成所有接口,等待其他接口

程志平 4 years ago
parent
commit
29de578c77
4 changed files with 961 additions and 240 deletions
  1. 108 0
      src/api/serveAC.js
  2. 6 6
      src/views/404.vue
  3. 4 0
      src/views/accountMgr/index.vue
  4. 843 234
      src/views/serveAC/index.vue

+ 108 - 0
src/api/serveAC.js

@@ -0,0 +1,108 @@
+import request from '@/utils/request'
+
+// 获取楼栋信息
+export function getBuildingData() {
+	return request({
+		url: '/airManage/buildqueryDom.action',
+		method: 'post'
+	})
+}
+
+// 获取房间空调
+export function getRoomAirs(forData) {
+	let data = new FormData()
+	data.append('school', forData.school)
+	data.append('build', forData.build)
+	data.append('floors', forData.floors)
+	data.append('dom', forData.dom)
+
+	return request({
+		url: '/airManage/buildairqueryAirMes.action',
+		method: 'post',
+		data
+	})
+}
+
+// 添加楼栋
+export function addBuild(forData) {
+	let data = {
+		school: forData.school,
+		build: forData.building
+	}
+
+	return request({
+		url: '/airManage/buildinsertB.action',
+		method: 'post',
+		data
+	})
+}
+
+// 添加楼层
+export function addFloors(forData) {
+	let data = {
+		school: forData.school,
+		build: forData.building,
+		floors: forData.floor
+	}
+
+	return request({
+		url: '/airManage/buildinsertF.action',
+		method: 'post',
+		data
+	})
+}
+
+// 添加楼层
+export function addRooms(forData) {
+	let data = {
+		school: forData.school,
+		build: forData.building,
+		floors: forData.floor,
+		dom: forData.room
+	}
+
+	return request({
+		url: '/airManage/buildinsertD.action',
+		method: 'post',
+		data
+	})
+}
+
+// 添加绑定空调
+export function addAirs(forData) {
+	let data = {
+		air_name: forData.deviceName,
+		school: forData.school,
+		build: forData.build,
+		floors: forData.floors,
+		dom: forData.room,
+		air_ip: forData.deviceIp,
+		air_config: forData.checkedDevice[0]
+		// duration_use: 0.01, // 使用时长
+		// is_normal: "1", // 是否正常
+		// is_on: "0", // 是否开启
+		// cao: "张三" // 操作员
+	}
+
+	return request({
+		url: '/airManage/buildairinsertAir.action',
+		method: 'post',
+		data
+	})
+}
+
+// 删除空调
+export function deleteAirs(forData) {
+	let data = new FormData()
+	data.append('school', forData.school)
+	data.append('build', forData.build)
+	data.append('floors', forData.floors)
+	data.append('dom', forData.dom)
+	data.append('air_ip', forData.air_ip)
+
+	return request({
+		url: '/airManage/buildairdel.action',
+		method: 'post',
+		data
+	})
+}

+ 6 - 6
src/views/404.vue

@@ -8,13 +8,13 @@
         <img class="pic-404__child right" src="@/assets/404_images/404_cloud.png" alt="404">
       </div>
       <div class="bullshit">
-        <div class="bullshit__oops">OOPS!</div>
-        <div class="bullshit__info">All rights reserved
-          <a style="color:#20a0ff" href="https://wallstreetcn.com" target="_blank">wallstreetcn</a>
+        <div class="bullshit__oops">哎呀!</div>
+        <div class="bullshit__info">版权所有
+          <a style="color:#20a0ff" href="#" target="_blank">新闻</a>
         </div>
         <div class="bullshit__headline">{{ message }}</div>
-        <div class="bullshit__info">Please check that the URL you entered is correct, or click the button below to return to the homepage.</div>
-        <a href="" class="bullshit__return-home">Back to home</a>
+        <div class="bullshit__info">请检查您输入的网址是否正确,或点击下面的按钮返回主页。</div>
+        <a href="" class="bullshit__return-home">返回主页</a>
       </div>
     </div>
   </div>
@@ -26,7 +26,7 @@ export default {
   name: 'Page404',
   computed: {
     message() {
-      return 'The webmaster said that you can not enter this page...'
+      return '网站管理员说你不能进入这个页面...'
     }
   }
 }

+ 4 - 0
src/views/accountMgr/index.vue

@@ -322,6 +322,10 @@
 				// console.log(data);
 				getTableData(data).then((res) => {
 					// console.log(res);
+					if (typeof res.code == 'undefined' || res.code == '') {
+						this.$message.error('返回数据格式问题,code未获取到!')
+						return
+					}
 					if (typeof res.rows !== 'undefined' && res.rows !== '') {
 						this.pagination.total = res.total
 						this.tableData = []

File diff suppressed because it is too large
+ 843 - 234
src/views/serveAC/index.vue