Browse Source

no message

xiaoxin 2 years ago
parent
commit
901e5e5b21

+ 1 - 1
components/listView.vue

@@ -22,7 +22,7 @@ onLoad(() => {})
 
 // 点击每一个学生回调
 const goPage = (item) => {
-	console.log(item)
+	// console.log(item)
 
 	if (props.appType == '学生轨迹') {
 		uni.navigateTo({

+ 2 - 2
pages/statistics/statistics.vue

@@ -10,8 +10,8 @@
 
 		<!-- 状态选择区域 -->
 		<div class="type">
-			<div class="type_box" :class="{ active: currentType === 1 }" @click="changeType(1)">异常({{ info?.abnormal?.count }})</div>
-			<div class="type_box" :class="{ active: currentType === 2 }" @click="changeType(2)">正常({{ info?.normal?.count }})</div>
+			<div class="type_box" :class="{ active: currentType === 1 }" @click="changeType(1)">未监听({{ info?.abnormal?.count }})</div>
+			<div class="type_box" :class="{ active: currentType === 2 }" @click="changeType(2)">监听({{ info?.normal?.count }})</div>
 			<div class="type_box" :class="{ active: currentType === 3 }" @click="changeType(3)">请假({{ info?.ack?.count }})</div>
 		</div>
 

+ 13 - 43
pages/track/track.vue

@@ -2,9 +2,7 @@
 	<view class="container">
 		<!-- 顶部筛选区域 -->
 		<view class="search">
-			<view class="search_box" :class="{ active: item.value === activeIndex }" v-for="item in searchList" :key="item.value" @click="changeIndex(item.value)">
-				{{ item.text }}
-			</view>
+			<uni-datetime-picker v-model="datetimerangeValue" type="datetimerange" rangeSeparator="至" :clear-icon="false" @change="changeTime" />
 		</view>
 
 		<!-- 地图区域 -->
@@ -48,32 +46,18 @@ import NoData from '@/components/noData.vue'
 import { myRequest } from '@/utils/api.js'
 import { previewImage } from '@/utils/previewImage.js'
 import { decryptDes } from '@/utils/des.js'
+import dayjs from 'dayjs'
 
 onLoad((options) => {
 	currentId.value = options.id
+
+	datetimerangeValue.value = [dayjs(Date.now() - 24 * 3600 * 1000).format('YYYY-MM-DD hh:mm:ss'), dayjs(Date.now()).format('YYYY-MM-DD hh:mm:ss')]
 	getData()
 })
 
 const currentId = ref()
 
-// 筛选区域当前索引
-const activeIndex = ref(0)
-
-// 筛选区域数组
-const searchList = ref([
-	{
-		value: 0,
-		text: '今天'
-	},
-	{
-		value: 1,
-		text: '昨天'
-	},
-	{
-		value: 2,
-		text: '前天'
-	}
-])
+const datetimerangeValue = ref()
 
 // 学生轨迹数组
 const list = ref([])
@@ -88,7 +72,8 @@ const getData = async () => {
 		url: '/wanzai/api/smartFaceDiscern/track',
 		data: {
 			id: currentId.value,
-			dateTime: activeIndex.value
+			startTime: datetimerangeValue.value[0],
+			endTime: datetimerangeValue.value[1]
 		}
 	})
 	// console.log(res)
@@ -99,10 +84,11 @@ const getData = async () => {
 	}
 }
 
-// 切换筛选时间时的函数
-const changeIndex = (v) => {
-	activeIndex.value = v
-	getData()
+const changeTime = (e) => {
+	// console.log(e)
+	if (e.length) {
+		getData()
+	}
 }
 </script>
 
@@ -117,25 +103,9 @@ const changeIndex = (v) => {
 	.search {
 		display: flex;
 		justify-content: space-evenly;
+		padding: 0 30rpx;
 		margin: 30rpx 0;
 		height: 65rpx;
-
-		.search_box {
-			display: flex;
-			justify-content: center;
-			align-items: center;
-			box-sizing: border-box;
-			width: 195rpx;
-			height: 65rpx;
-			font-size: 28rpx;
-			border-radius: 72rpx;
-			background-color: #fff;
-		}
-
-		.active {
-			color: #1e7dfb;
-			border: 1rpx solid #1e7dfb;
-		}
 	}
 	// 地图区域样式
 	.map {

+ 19 - 19
pagesWarning/home/home.vue

@@ -10,15 +10,10 @@
 					</view>
 				</view>
 			</picker>
+		</view>
 
-			<picker style="width: 50%" mode="date" :value="date" @change="bindDateChange">
-				<view class="search-right">
-					{{ date }}
-					<view class="search-img">
-						<img class="img" src="@/static/images/bottom2.png" />
-					</view>
-				</view>
-			</picker>
+		<view class="search">
+			<uni-datetime-picker v-model="datetimerangeValue" type="datetimerange" rangeSeparator="至" :clear-icon="false" @change="bindDateChange" />
 		</view>
 
 		<!-- 每一个预警信息 -->
@@ -65,11 +60,12 @@
 import { ref } from 'vue'
 import { onLoad, onPullDownRefresh, onReachBottom } from '@dcloudio/uni-app'
 // 导入时间相关函数
-import { time_format, getNowDate } from '@/utils/formatTime.js'
+import { time_format } from '@/utils/formatTime.js'
 import { myRequest } from '@/utils/api.js'
 import NoData from '@/components/noData.vue'
 import { previewImage } from '@/utils/previewImage.js'
 import { decryptDes } from '@/utils/des.js'
+import dayjs from 'dayjs'
 
 // 状态筛选框数组当前索引
 const typeIndex = ref(0)
@@ -85,15 +81,13 @@ const bindTypeChange = (e) => {
 	getData()
 }
 
-// 日期筛选框绑定日期
-const date = ref(getNowDate())
-
 // 日期筛选框改变数据时的回调
 const bindDateChange = (e) => {
-	date.value = e.detail.value
-	listData.value = []
-	currentPage.value = 1
-	getData()
+	if (e.length) {
+		listData.value = []
+		currentPage.value = 1
+		getData()
+	}
 }
 
 // 当前页
@@ -105,7 +99,10 @@ const total = ref(null)
 // 预警列表数据
 const listData = ref([])
 
+const datetimerangeValue = ref()
+
 onLoad(() => {
+	datetimerangeValue.value = [dayjs(Date.now() - 24 * 3600 * 1000).format('YYYY-MM-DD hh:mm:ss'), dayjs(Date.now()).format('YYYY-MM-DD hh:mm:ss')]
 	getTypeList()
 	getData()
 })
@@ -130,6 +127,7 @@ const getTypeList = async () => {
 	})
 	// console.log(res)
 	const result = JSON.parse(decryptDes(res.data))
+	// console.log(result)
 	typeList.value = result.reverse()
 }
 
@@ -141,7 +139,8 @@ const getData = async () => {
 			currentPage: currentPage.value,
 			pageCount: 6,
 			type: typeList.value[typeIndex.value] || '全部',
-			dateTime: date.value
+			startTime: datetimerangeValue.value[0],
+			endTime: datetimerangeValue.value[1]
 		}
 	})
 	// console.log(res)
@@ -209,16 +208,17 @@ const handleOperation = async (id, remark) => {
 	background-color: #f2f2f2;
 
 	.search {
-		margin-bottom: 20rpx;
+		// margin-bottom: 20rpx;
 		display: flex;
 		align-items: center;
 		height: 100rpx;
+		// border-bottom: 2rpx solid #ccc;
 		background-color: #fff;
 
 		.search-left {
 			display: flex;
 			justify-content: center;
-			border-right: 1rpx solid #ccc;
+			// border-right: 1rpx solid #ccc;
 
 			.search-img {
 				margin-left: 27rpx;

+ 0 - 1
unpackage/dist/dev/mp-weixin/components/listView.js

@@ -15,7 +15,6 @@ const _sfc_main = {
     common_vendor.onLoad(() => {
     });
     const goPage = (item) => {
-      console.log(item);
       if (props.appType == "学生轨迹") {
         common_vendor.index.navigateTo({
           url: `/pages/track/track?id=${item.id}`

+ 24 - 33
unpackage/dist/dev/mp-weixin/pages/track/track.js

@@ -4,14 +4,16 @@ const utils_api = require("../../utils/api.js");
 const utils_previewImage = require("../../utils/previewImage.js");
 const utils_des = require("../../utils/des.js");
 if (!Array) {
+  const _easycom_uni_datetime_picker2 = common_vendor.resolveComponent("uni-datetime-picker");
   const _easycom_uv_steps_item2 = common_vendor.resolveComponent("uv-steps-item");
   const _easycom_uv_steps2 = common_vendor.resolveComponent("uv-steps");
-  (_easycom_uv_steps_item2 + _easycom_uv_steps2)();
+  (_easycom_uni_datetime_picker2 + _easycom_uv_steps_item2 + _easycom_uv_steps2)();
 }
+const _easycom_uni_datetime_picker = () => "../../uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.js";
 const _easycom_uv_steps_item = () => "../../uni_modules/uv-steps/components/uv-steps-item/uv-steps-item.js";
 const _easycom_uv_steps = () => "../../uni_modules/uv-steps/components/uv-steps/uv-steps.js";
 if (!Math) {
-  (MapContainer + _easycom_uv_steps_item + _easycom_uv_steps + NoData)();
+  (_easycom_uni_datetime_picker + MapContainer + _easycom_uv_steps_item + _easycom_uv_steps + NoData)();
 }
 const MapContainer = () => "../../components/MapContainer.js";
 const NoData = () => "../../components/noData.js";
@@ -20,24 +22,11 @@ const _sfc_main = {
   setup(__props) {
     common_vendor.onLoad((options) => {
       currentId.value = options.id;
+      datetimerangeValue.value = [common_vendor.dayjs(Date.now() - 24 * 3600 * 1e3).format("YYYY-MM-DD hh:mm:ss"), common_vendor.dayjs(Date.now()).format("YYYY-MM-DD hh:mm:ss")];
       getData();
     });
     const currentId = common_vendor.ref();
-    const activeIndex = common_vendor.ref(0);
-    const searchList = common_vendor.ref([
-      {
-        value: 0,
-        text: "今天"
-      },
-      {
-        value: 1,
-        text: "昨天"
-      },
-      {
-        value: 2,
-        text: "前天"
-      }
-    ]);
+    const datetimerangeValue = common_vendor.ref();
     const list = common_vendor.ref([]);
     const customStyle = {
       marginBottom: "30rpx"
@@ -47,7 +36,8 @@ const _sfc_main = {
         url: "/wanzai/api/smartFaceDiscern/track",
         data: {
           id: currentId.value,
-          dateTime: activeIndex.value
+          startTime: datetimerangeValue.value[0],
+          endTime: datetimerangeValue.value[1]
         }
       });
       if (res.code == 200) {
@@ -55,23 +45,24 @@ const _sfc_main = {
         list.value = result;
       }
     };
-    const changeIndex = (v) => {
-      activeIndex.value = v;
-      getData();
+    const changeTime = (e) => {
+      if (e.length) {
+        getData();
+      }
     };
     return (_ctx, _cache) => {
       return common_vendor.e({
-        a: common_vendor.f(searchList.value, (item, k0, i0) => {
-          return {
-            a: common_vendor.t(item.text),
-            b: item.value === activeIndex.value ? 1 : "",
-            c: item.value,
-            d: common_vendor.o(($event) => changeIndex(item.value), item.value)
-          };
+        a: common_vendor.o(changeTime),
+        b: common_vendor.o(($event) => datetimerangeValue.value = $event),
+        c: common_vendor.p({
+          type: "datetimerange",
+          rangeSeparator: "至",
+          ["clear-icon"]: false,
+          modelValue: datetimerangeValue.value
         }),
-        b: list.value.length
+        d: list.value.length
       }, list.value.length ? {
-        c: common_vendor.f(list.value, (item, k0, i0) => {
+        e: common_vendor.f(list.value, (item, k0, i0) => {
           return common_vendor.e({
             a: common_vendor.t(item.type),
             b: common_vendor.t(item.location),
@@ -82,13 +73,13 @@ const _sfc_main = {
             f: common_vendor.o(($event) => common_vendor.unref(utils_previewImage.previewImage)(item.image), item.id)
           } : {}, {
             g: item.id,
-            h: "132a14af-2-" + i0 + ",132a14af-1"
+            h: "132a14af-3-" + i0 + ",132a14af-2"
           });
         }),
-        d: common_vendor.p({
+        f: common_vendor.p({
           customStyle
         }),
-        e: common_vendor.p({
+        g: common_vendor.p({
           activeColor: "#1E7DFB",
           direction: "column",
           dot: true,

+ 1 - 0
unpackage/dist/dev/mp-weixin/pages/track/track.json

@@ -2,6 +2,7 @@
   "navigationBarTitleText": "学生轨迹",
   "enablePullDownRefresh": false,
   "usingComponents": {
+    "uni-datetime-picker": "../../uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker",
     "uv-steps-item": "../../uni_modules/uv-steps/components/uv-steps-item/uv-steps-item",
     "uv-steps": "../../uni_modules/uv-steps/components/uv-steps/uv-steps",
     "map-container": "../../components/MapContainer",

File diff suppressed because it is too large
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/track/track.wxml


+ 1 - 15
unpackage/dist/dev/mp-weixin/pages/track/track.wxss

@@ -9,24 +9,10 @@
 .container .search.data-v-132a14af {
   display: flex;
   justify-content: space-evenly;
+  padding: 0 30rpx;
   margin: 30rpx 0;
   height: 65rpx;
 }
-.container .search .search_box.data-v-132a14af {
-  display: flex;
-  justify-content: center;
-  align-items: center;
-  box-sizing: border-box;
-  width: 195rpx;
-  height: 65rpx;
-  font-size: 28rpx;
-  border-radius: 72rpx;
-  background-color: #fff;
-}
-.container .search .active.data-v-132a14af {
-  color: #1e7dfb;
-  border: 1rpx solid #1e7dfb;
-}
 .container .map.data-v-132a14af {
   width: 750rpx;
   height: 469rpx;