liuQiang před 1 rokem
rodič
revize
f78bb4e0b4
3 změnil soubory, kde provedl 117 přidání a 11 odebrání
  1. 60 0
      api/statistics/index.js
  2. 2 1
      config.js
  3. 55 10
      pagesA/fire/data_statistics/index.vue

+ 60 - 0
api/statistics/index.js

@@ -0,0 +1,60 @@
+import request from '@/utils/request'
+// 查询设备覆盖率
+export function getDevcoverage(data) {
+	return request({
+		// 最新移动端
+		url: '/admin-api/s9/tongji/devcoverage', 
+		method: 'get',
+		params: data
+	})
+}
+// 查询日均扫码总数
+export function getScanbyday(data) {
+	return request({
+		// 最新移动端
+		url: '/admin-api/backend/tongji/avgbyday', 
+		method: 'post',
+		params: data
+	})
+}
+// 查询人均扫码总数
+export function getScanbyperson(data) {
+	return request({
+		// 最新移动端
+		url: '/admin-api/backend/tongji/avguser', 
+		method: 'post',
+		params: data
+	})
+}
+// 查询巡查扫码总数
+export function getScantotal(data) {
+	return request({
+		url: '/admin-api/backend/tongji/scantotal',
+		method: 'get',
+		params: data
+	})
+}
+// 查询设备类型覆盖率统计
+export function getDevtypecover(data) {
+	return request({
+		url: '/admin-api/backend/tongji/devtypecover',
+		method: 'post'
+	})
+}
+// 查询发现隐患数
+export function getFinddenger(data) {
+	return request({
+		url: '/admin-api/backend/tongji/finddenger',
+		method: 'post',
+		params: data
+	})
+}
+// 查询整改隐患数
+export function getFixdenger(data) {
+	return request({
+		url: '/admin-api/backend/tongji/fixdenger',
+		method: 'post',
+		params: data
+	})
+}
+

+ 2 - 1
config.js

@@ -2,7 +2,8 @@
 module.exports = {
 	// baseUrl: 'http://api-security.byants.com',
 	// baseUrlImg:'http://security.byants.com/static/appimg',
-	baseUrl: 'http://112.19.80.230',
+	// baseUrl: 'http://112.19.80.230',
+	baseUrl: 'http://8.142.173.95:48081',
 	baseUrlImg: 'https://byant.jujutong.cloud/static/appimg',
 	// baseUrl: 'http://192.168.1.24:48081', 
 	// baseUrl:'http://192.168.1.10:48081',

+ 55 - 10
pagesA/fire/data_statistics/index.vue

@@ -18,56 +18,101 @@
 
 <script>
 	import config from '@/config'
+	import {
+		getDevcoverage, //查询设备覆盖率
+		getScanbyday, //查询日均扫码总数
+		getScanbyperson,//查询人均扫码总数
+		getScantotal,//查询巡查扫码总数
+		getDevtypecover,//查询设备类型覆盖率统计
+		getFinddenger,//查询发现隐患数
+		getFixdenger//查询整改隐患数
+	} from '@/api/statistics';
+	import {
+		getOrgId
+	} from '@/api/fpdDetection/index.js';
 	const baseUrlImg = config.baseUrlImg
 	export default {
 		data() {
 			return {
+				query:{
+					orgIds:[''],
+					},
 				tableData: [{
 						name: '巡查扫码总数',
-						value: 786,
+						value:null,
 						img:`${baseUrlImg}/modal/shaoma.png`
 					},
 					{
 						name: '日均扫码数',
-						value: 30,
+						value:null,
 						img:`${baseUrlImg}/modal/shaoma.png`
 					},
 					{
 						name: '人均扫码数',
-						value: 14,
+						value:null,
 						img:`${baseUrlImg}/modal/shaoma.png`
 					},
 					{
 						name: '设备覆盖率',
-						value: 786,
+						value: null,
 						img:`${baseUrlImg}/modal/sheshi.png`
 					},
 					{
 						name: '设备类型覆盖率',
-						value: '86%',
+						value: null,
 						img:`${baseUrlImg}/modal/sheshi.png`
 					},
 					{
 						name: '发现隐患总数',
-						value: 786,
+						value: null,
 						img:`${baseUrlImg}/modal/jingao.png`
 					},
 					{
 						name: '整改隐患总数',
-						value: 786,
+						value: null,
 						img:`${baseUrlImg}/modal/jingao.png`
 					},
 					{
 						name: '整改隐患平均时间',
-						value: 786,
+						value: null,
 						img:`${baseUrlImg}/modal/jingao.png`
 					}
 				]
 			}
 		},
-		onShow() {},
+		onShow() {
+			getOrgId({
+				pageNo: this.pageNo,
+				pageSize: this.pageSize,
+				userId: this.$store.state.user.id
+			}).then(response => {
+				// console.log(response, 'response');
+				this.query.orgIds[0] =response.data[0].dwid
+				this.getData()
+			}).catch(err => {
+				this.loading = false
+				this.$modal.msg(err)
+			})
+		},
 		methods: {
-			getData() {}
+			async getData() {
+				// console.log('orgIds',this.query);
+				const res1 = await  getDevtypecover()
+				const res2 = await  getScanbyday()
+				const scantotal = await  getScantotal({userId: this.$store.state.user.id})
+				const scanbyperson = await  getScanbyperson()
+				const finddenger = await  getFinddenger()
+				const fixdenger = await  getFixdenger()
+				this.tableData[0].value = scantotal.data
+				this.tableData[1].value = res2.data
+				this.tableData[2].value = scanbyperson.data
+				this.tableData[3].value = (res1.data-0)*100+'%'
+				this.tableData[4].value = (res1.data-0)*100+'%'
+				this.tableData[5].value = finddenger.data
+				this.tableData[6].value = fixdenger.data
+				this.tableData[7].value = 2.5
+				// console.log('res1',res1);
+			}
 		}
 	}
 </script>