|
@@ -1,55 +1,77 @@
|
|
|
<template>
|
|
|
<u-sticky class="shadow-default" bgColor="#fff" style="top: 0">
|
|
|
- <u-tabs :list="list" :current="current" @click="tabsClick" lineColor="#333" :activeStyle="{ color: '#333' }" :inactiveStyle="{ color: '#909399' }"></u-tabs>
|
|
|
+ <u-tabs :list="list" :current="state.current" @click="tabsClick" lineColor="#333" :activeStyle="{ color: '#333' }" :inactiveStyle="{ color: '#909399' }"></u-tabs>
|
|
|
</u-sticky>
|
|
|
|
|
|
- <scroll-view class="bg-white scroll-height" :scroll-y="true" :data-theme="'theme-' + proxy.$settingStore.themeColor.name" style="padding-bottom: 44px">
|
|
|
- <oa-touch class="informationSelect" @change="touchChange">
|
|
|
- <template #content>
|
|
|
- <uni-swipe-action>
|
|
|
- <uni-swipe-action-item>
|
|
|
- <!-- 各类查询 start -->
|
|
|
- <view class="tableType3">
|
|
|
- <u-input class="block mb10" v-model="dataInput" :placeholder="placeholderText" @blur="blur" shape="circle" prefixIcon="search" prefixIconStyle="color: #0c7bf9"> </u-input>
|
|
|
- <u-empty v-if="!dataRes" text="暂无数据" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"> </u-empty>
|
|
|
- <view class="con" v-if="current == 8">
|
|
|
- <view class="time">{{ newTime }}</view>
|
|
|
- <video src="http://file.usky.cn/statics/video/20230203.mp4" autoplay :controls="false" :show-center-play-btn="false" :loop="true" style="width: 100%"></video>
|
|
|
+ <oa-scroll
|
|
|
+ customClass="bg-white scroll-height"
|
|
|
+ :isSticky="true"
|
|
|
+ :refresherLoad="false"
|
|
|
+ :refresherLoadTitle="false"
|
|
|
+ :refresherEnabled="false"
|
|
|
+ :refresherEnabledTitle="false"
|
|
|
+ :refresherDefaultStyle="'none'"
|
|
|
+ :refresherThreshold="44"
|
|
|
+ :refresherBackground="'#f5f6f7'"
|
|
|
+ :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
|
|
|
+ >
|
|
|
+ <template #default>
|
|
|
+ <oa-touch class="informationSelect" @change="touchChange">
|
|
|
+ <template #content>
|
|
|
+ <uni-swipe-action>
|
|
|
+ <uni-swipe-action-item>
|
|
|
+ <!-- 各类查询 start -->
|
|
|
+ <view class="tableType3">
|
|
|
+ <u-input class="block mb10" v-model="state.dataInput" :placeholder="state.placeholderText" @blur="blur" shape="circle" prefixIcon="search" prefixIconStyle="color: #0c7bf9"> </u-input>
|
|
|
+ <u-empty v-if="state.classifyData == undefined" text="暂无数据" mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png"> </u-empty>
|
|
|
+ <view class="con" v-if="state.current == 8">
|
|
|
+ <view class="time">{{ state.operateDate }}</view>
|
|
|
+ <video src="http://file.usky.cn/statics/video/20230203.mp4" autoplay :controls="false" :show-center-play-btn="false" :loop="true" style="width: 100%"></video>
|
|
|
+ </view>
|
|
|
+ <u-row v-for="po in state.classifyData" :key="po" v-else>
|
|
|
+ <u-col span="4">
|
|
|
+ <view style="text-align: right; padding: 0px 5px 0px 5px">{{ po.title }}</view>
|
|
|
+ </u-col>
|
|
|
+ <u-col span="8">
|
|
|
+ <view style="text-align: left; padding: 0px 5px 0px 5px">{{ po.value }}</view>
|
|
|
+ </u-col>
|
|
|
+ </u-row>
|
|
|
</view>
|
|
|
- <u-row v-for="po in classifyData" :key="po" v-else>
|
|
|
- <u-col span="4">
|
|
|
- <view style="text-align: right; padding: 0px 5px 0px 5px">{{ po.title }}</view>
|
|
|
- </u-col>
|
|
|
- <u-col span="8">
|
|
|
- <view style="text-align: left; padding: 0px 5px 0px 5px">{{ po.value }}</view>
|
|
|
- </u-col>
|
|
|
- </u-row>
|
|
|
- </view>
|
|
|
- <!-- 各类查询 end -->
|
|
|
- </uni-swipe-action-item>
|
|
|
- </uni-swipe-action>
|
|
|
- </template>
|
|
|
- </oa-touch>
|
|
|
- </scroll-view>
|
|
|
+ <!-- 各类查询 end -->
|
|
|
+ </uni-swipe-action-item>
|
|
|
+ </uni-swipe-action>
|
|
|
+ </template>
|
|
|
+ </oa-touch>
|
|
|
+ </template>
|
|
|
+ </oa-scroll>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { onReady, onLoad, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
|
|
|
+/*----------------------------------依赖引入-----------------------------------*/
|
|
|
+import { onReady, onLoad, onUnload, onShow, onNavigationBarButtonTap } from "@dcloudio/uni-app";
|
|
|
import { ref, onMounted, inject, shallowRef, reactive, watchEffect, getCurrentInstance } from "vue";
|
|
|
-import { useStores, commonStores } from "@/store/modules/index";
|
|
|
-
|
|
|
+/*----------------------------------接口引入-----------------------------------*/
|
|
|
import { dataList } from "@/api/business/mhxf/informationSelect";
|
|
|
-
|
|
|
+/*----------------------------------组件引入-----------------------------------*/
|
|
|
+/*----------------------------------store引入-----------------------------------*/
|
|
|
+import { useStores, commonStores } from "@/store/modules/index";
|
|
|
+/*----------------------------------公共方法引入-----------------------------------*/
|
|
|
+/*----------------------------------公共变量-----------------------------------*/
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
-
|
|
|
const commonStore = commonStores(); //全局公共Store
|
|
|
+/*----------------------------------变量声明-----------------------------------*/
|
|
|
+const state = reactive({
|
|
|
+ dataInput: "",
|
|
|
+ current: 0,
|
|
|
+ classifyUrl: "",
|
|
|
+ placeholderText: "",
|
|
|
+ classifyData: undefined, //警情查询数据存储
|
|
|
+ operateDate: proxy.$common.formatterDateTime(new Date()), //操作时间
|
|
|
+});
|
|
|
|
|
|
-const dataInput = ref("");
|
|
|
-const current = ref(0);
|
|
|
-const classifyUrl = ref("");
|
|
|
-const placeholderText = ref("");
|
|
|
-const dataRes = ref(1);
|
|
|
-const classifyData = ref([]); //警情查询数据存储
|
|
|
+const inter = reactive({
|
|
|
+ interOperateDate: null,
|
|
|
+});
|
|
|
|
|
|
const list = ref([
|
|
|
{ id: 1, name: "警情查询" },
|
|
@@ -68,22 +90,22 @@ const list = ref([
|
|
|
*/
|
|
|
function touchChange(e) {
|
|
|
if (e == "右滑") {
|
|
|
- if (current.value >= 1) {
|
|
|
- current.value--;
|
|
|
+ if (state.current >= 1) {
|
|
|
+ state.current--;
|
|
|
} else {
|
|
|
- current.value = list.value.length - 1;
|
|
|
+ state.current = list.value.length - 1;
|
|
|
}
|
|
|
} else if (e == "左滑") {
|
|
|
- if (current.value < list.value.length - 1) {
|
|
|
- current.value++;
|
|
|
+ if (state.current < list.value.length - 1) {
|
|
|
+ state.current++;
|
|
|
} else {
|
|
|
- current.value = 0;
|
|
|
+ state.current = 0;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function blur(e) {
|
|
|
- if (dataInput.value) {
|
|
|
+ if (state.dataInput) {
|
|
|
goSearch();
|
|
|
}
|
|
|
}
|
|
@@ -92,75 +114,73 @@ function blur(e) {
|
|
|
* @tabs点击事件
|
|
|
*/
|
|
|
function tabsClick(e) {
|
|
|
- current.value = e.index;
|
|
|
- console.log(current.value);
|
|
|
- dataInput.value = "";
|
|
|
- dataRes.value = 1;
|
|
|
+ state.current = e.index;
|
|
|
+ state.dataInput = "";
|
|
|
}
|
|
|
|
|
|
function goSearch() {
|
|
|
- if (current.value == 0) {
|
|
|
+ if (state.current == 0) {
|
|
|
//警情查询
|
|
|
- classifyUrl.value = "/service-fire/demPoliceInfo/page";
|
|
|
- placeholderText.value = "请输入案件编号";
|
|
|
- classifySearch(classifyUrl.value, {
|
|
|
- caseCode: dataInput.value,
|
|
|
+ state.classifyUrl = "/service-fire/demPoliceInfo/page";
|
|
|
+ state.placeholderText = "请输入案件编号";
|
|
|
+ classifySearch(state.classifyUrl, {
|
|
|
+ caseCode: state.dataInput,
|
|
|
});
|
|
|
- } else if (current.value == 1) {
|
|
|
+ } else if (state.current == 1) {
|
|
|
//火灾查询
|
|
|
- placeholderText.value = "请输入火灾地址";
|
|
|
- classifyUrl.value = "/service-fire/demFireStatisticsAttach/page";
|
|
|
- classifySearch(classifyUrl.value, {
|
|
|
- address: dataInput.value,
|
|
|
+ state.placeholderText = "请输入火灾地址";
|
|
|
+ state.classifyUrl = "/service-fire/demFireStatisticsAttach/page";
|
|
|
+ classifySearch(state.classifyUrl, {
|
|
|
+ address: state.dataInput,
|
|
|
});
|
|
|
- } else if (current.value == 2) {
|
|
|
+ } else if (state.current == 2) {
|
|
|
//人员查询
|
|
|
- placeholderText.value = "请输入值班人员名称";
|
|
|
- classifyUrl.value = "/service-fire/unitBeOnDuty/list";
|
|
|
- classifySearch(classifyUrl.value, {
|
|
|
- name: dataInput.value,
|
|
|
+ state.placeholderText = "请输入值班人员名称";
|
|
|
+ state.classifyUrl = "/service-fire/unitBeOnDuty/list";
|
|
|
+ classifySearch(state.classifyUrl, {
|
|
|
+ name: state.dataInput,
|
|
|
});
|
|
|
- } else if (current.value == 3) {
|
|
|
+ } else if (state.current == 3) {
|
|
|
//车辆信息
|
|
|
- placeholderText.value = "请输入车牌号";
|
|
|
- classifyUrl.value = "/service-fire/unitBeOnDuty/vehiclelist";
|
|
|
- classifySearch(classifyUrl.value, {
|
|
|
- licensePlate: dataInput.value,
|
|
|
+ state.placeholderText = "请输入车牌号";
|
|
|
+ state.classifyUrl = "/service-fire/unitBeOnDuty/vehiclelist";
|
|
|
+ classifySearch(state.classifyUrl, {
|
|
|
+ licensePlate: state.dataInput,
|
|
|
});
|
|
|
- } else if (current.value == 4) {
|
|
|
+ } else if (state.current == 4) {
|
|
|
//站点查询
|
|
|
- placeholderText.value = "请输入站点名称";
|
|
|
- classifyUrl.value = "/service-fire/unitBeOnDuty/page";
|
|
|
- classifySearch(classifyUrl.value, {
|
|
|
- stationName: dataInput.value,
|
|
|
+ state.placeholderText = "请输入站点名称";
|
|
|
+ state.classifyUrl = "/service-fire/unitBeOnDuty/page";
|
|
|
+ classifySearch(state.classifyUrl, {
|
|
|
+ stationName: state.dataInput,
|
|
|
});
|
|
|
- } else if (current.value == 5) {
|
|
|
+ } else if (state.current == 5) {
|
|
|
//消火栓
|
|
|
- placeholderText.value = "请输入水源名称";
|
|
|
- classifyUrl.value = "/service-fire/demWaterSource/waterSourceList";
|
|
|
- classifySearch(classifyUrl.value, {
|
|
|
- waterName: dataInput.value,
|
|
|
+ state.placeholderText = "请输入水源名称";
|
|
|
+ state.classifyUrl = "/service-fire/demWaterSource/waterSourceList";
|
|
|
+ classifySearch(state.classifyUrl, {
|
|
|
+ waterName: state.dataInput,
|
|
|
});
|
|
|
- } else if (current.value == 6) {
|
|
|
+ } else if (state.current == 6) {
|
|
|
//重点单位
|
|
|
- placeholderText.value = "请输入单位名称";
|
|
|
- classifyUrl.value = "/service-fire/baseCompany/companyList";
|
|
|
- classifySearch(classifyUrl.value, {
|
|
|
- companyName: dataInput.value,
|
|
|
+ state.placeholderText = "请输入单位名称";
|
|
|
+ state.classifyUrl = "/service-fire/baseCompany/companyList";
|
|
|
+ classifySearch(state.classifyUrl, {
|
|
|
+ companyName: state.dataInput,
|
|
|
});
|
|
|
- } else if (current.value == 7) {
|
|
|
+ } else if (state.current == 7) {
|
|
|
//消防检查信息
|
|
|
- placeholderText.value = "请输入单位ID";
|
|
|
- classifyUrl.value = "/service-fire/demFireInspect/fireInspectList";
|
|
|
- classifySearch(classifyUrl.value, {
|
|
|
- companyId: dataInput.value,
|
|
|
+ state.placeholderText = "请输入单位ID";
|
|
|
+ state.classifyUrl = "/service-fire/demFireInspect/fireInspectList";
|
|
|
+ classifySearch(state.classifyUrl, {
|
|
|
+ companyId: state.dataInput,
|
|
|
});
|
|
|
- } else if (current.value == 8) {
|
|
|
+ } else if (state.current == 8) {
|
|
|
//消防检查信息
|
|
|
- placeholderText.value = "";
|
|
|
- // classifyUrl.value = "/service-fire/demFireInspect/fireInspectList";
|
|
|
- // classifySearch(classifyUrl.value, {
|
|
|
- // companyId: dataInput.value,
|
|
|
+ state.placeholderText = "";
|
|
|
+ // state.classifyUrl = "/service-fire/demFireInspect/fireInspectList";
|
|
|
+ // classifySearch(state.classifyUrl, {
|
|
|
+ // companyId: state.dataInput,
|
|
|
// });
|
|
|
}
|
|
|
}
|
|
@@ -168,35 +188,23 @@ function goSearch() {
|
|
|
//分类信息查询 start
|
|
|
async function classifySearch(URL, params) {
|
|
|
proxy.$modal.loading("加载中");
|
|
|
- classifyData.value = [];
|
|
|
+ state.classifyData = [];
|
|
|
dataList(URL, params).then((res) => {
|
|
|
proxy.$modal.closeLoading();
|
|
|
if (res.status == "SUCCESS") {
|
|
|
- if (current.value == 2) {
|
|
|
- if (res.data.length) {
|
|
|
- dataRes.value = 1;
|
|
|
- } else {
|
|
|
- dataRes.value = 0;
|
|
|
- }
|
|
|
+ if (state.current == 2) {
|
|
|
var records = res.data[0][0];
|
|
|
- } else if (current.value == 3) {
|
|
|
- if (res.data.length) {
|
|
|
- dataRes.value = 1;
|
|
|
- } else {
|
|
|
- dataRes.value = 0;
|
|
|
- }
|
|
|
-
|
|
|
+ } else if (state.current == 3) {
|
|
|
var records = res.data[0];
|
|
|
} else {
|
|
|
- if (res.data.total) {
|
|
|
- dataRes.value = 1;
|
|
|
- } else {
|
|
|
- dataRes.value = 0;
|
|
|
- }
|
|
|
var records = res.data.records[0];
|
|
|
}
|
|
|
|
|
|
- switch (current.value) {
|
|
|
+ if (JSON.stringify(records) === "{}") {
|
|
|
+ state.classifyData = undefined;
|
|
|
+ }
|
|
|
+
|
|
|
+ switch (state.current) {
|
|
|
case 0: //警情查询
|
|
|
var classifyTitle = [
|
|
|
"案件编号",
|
|
@@ -481,7 +489,7 @@ async function classifySearch(URL, params) {
|
|
|
var obj = {};
|
|
|
obj.title = classifyTitle[i];
|
|
|
obj.value = classifyValue[i];
|
|
|
- classifyData.value.push(obj);
|
|
|
+ state.classifyData.push(obj);
|
|
|
}
|
|
|
} else {
|
|
|
}
|
|
@@ -493,36 +501,14 @@ watchEffect(() => {
|
|
|
goSearch();
|
|
|
});
|
|
|
|
|
|
-// start
|
|
|
-
|
|
|
-const newTime = ref("");
|
|
|
-function getNowTime() {
|
|
|
- var date = new Date();
|
|
|
- var time =
|
|
|
- addZero(date.getFullYear()) +
|
|
|
- "-" +
|
|
|
- addZero(date.getMonth() + 1) +
|
|
|
- "-" +
|
|
|
- addZero(date.getDate()) +
|
|
|
- " " +
|
|
|
- addZero(date.getHours()) +
|
|
|
- ":" +
|
|
|
- addZero(date.getMinutes()) +
|
|
|
- ":" +
|
|
|
- addZero(date.getSeconds());
|
|
|
- newTime.value = time;
|
|
|
-}
|
|
|
-//根据自己的需求,看要不要在时间不大于10的时候在前面补0,如果需要直接addZero(date.getMinutes()),其它与之相同,如果不需要删掉addZero()方法即可。
|
|
|
-//小于10的拼接上0字符串
|
|
|
-function addZero(s) {
|
|
|
- return s < 10 ? "0" + s : s;
|
|
|
-}
|
|
|
-
|
|
|
-// end
|
|
|
-
|
|
|
onLoad((options) => {
|
|
|
- clearInterval(myTimeDisplay); //销毁之前定时器
|
|
|
- var myTimeDisplay = setInterval(getNowTime(), 1000); //每秒更新一次时间
|
|
|
+ inter.interOperateDate = setInterval(() => {
|
|
|
+ state.operateDate = proxy.$common.formatterDateTime(new Date());
|
|
|
+ }, 1000);
|
|
|
+});
|
|
|
+
|
|
|
+onUnload(() => {
|
|
|
+ clearInterval(inter.interOperateDate); //销毁之前定时器
|
|
|
});
|
|
|
|
|
|
onShow(() => {
|