+
@@ -691,6 +698,8 @@
import { Form } from 'ant-design-vue'
import moment from 'moment'
import { useStore } from 'vuex'
+ import debounce from 'lodash/debounce'
+ import { stubFalse } from 'lodash'
const store = useStore()
const username = store.getters['user/username']
const props = defineProps({
@@ -698,6 +707,7 @@
searchValue: { type: String, default: '' },
searchType: { type: String, default: '' },
})
+ const spinningHome = ref(false)
const current = ref(1)
const videoTotal = ref(0)
const router = useRouter()
@@ -1971,22 +1981,76 @@
const wrjFlag = ref(false)
// 西海岸-视频资源loading
const loadingCamera = ref(false)
- const getCamera = (flag, str) => {
- loadingCamera.value = true
- if (flag) {
- mapSearchParam.value.cameraName = str
- }
- console.log('初始化调用', flag)
- console.log(
- '不选左侧树的时候不调用接口',
- mapSearchParam.value,
- selectType.value
- )
- if (!whoShow1.value.itShowXiHaiAn) {
- if (selectType.value == '视频资源') {
- getCameraByParentId(mapSearchParam.value)
+ const getCamera = debounce(
+ function (flag, str) {
+ loadingCamera.value = true
+ if (flag) {
+ mapSearchParam.value.cameraName = str
+ }
+ console.log('初始化调用', flag)
+ console.log(
+ '不选左侧树的时候不调用接口',
+ mapSearchParam.value,
+ selectType.value
+ )
+ if (!whoShow1.value.itShowXiHaiAn) {
+ if (selectType.value == '视频资源') {
+ getCameraByParentId(mapSearchParam.value)
+ .then((res) => {
+ console.log('res--查询摄像头---------->', res)
+ loadingCamera.value = false
+ dataSource.value = res.data.data
+ pagination.value.total = res.data.count
+ })
+ .catch((err) => {
+ loadingCamera.value = false
+ message.error(err)
+ })
+ } else {
+ loadingCamera.value = false
+ }
+ } else {
+ let params = {
+ regionId:
+ mapSearchParam.value.parentId || '70be8c5b664f4bcf869d82f2e8335051',
+ // pageNum: mapSearchParam.value.pageNum,
+ // pageSize: mapSearchParam.value.pageSize,
+ longitude: mapSearchParam.value.gpsX || '',
+ latitude: mapSearchParam.value.gpsY || '',
+ radius: mapSearchParam.value.radius || '',
+ name: mapSearchParam.value.cameraName,
+ type: mapSearchParam.value.type,
+ borderPolygonList: mapSearchParam.value.borderPolygonList || [],
+ }
+ // todo-临时放开
+ // if (
+ // params.regionId === '70be8c5b664f4bcf869d82f2e8335051' &&
+ // !params.name &&
+ // !params.longitude
+ // ) {
+ // params.status = ''
+ // }
+ let paramsFather = ''
+ let i = 1
+ for (var key in params) {
+ if (params[key] === '') {
+ delete params[key]
+ } else {
+ if (i != 1) {
+ paramsFather += `&${key}=` + params[key]
+ i += 1
+ } else if (i == 1) {
+ paramsFather += `${key}=` + params[key]
+ i += 1
+ }
+ }
+ }
+ console.log('位置1')
+ spinningHome.value = true
+ getCameraByCondition(params)
.then((res) => {
console.log('res--查询摄像头---------->', res)
+ spinningHome.value = false
loadingCamera.value = false
dataSource.value = res.data.data
pagination.value.total = res.data.count
@@ -1995,58 +2059,11 @@
loadingCamera.value = false
message.error(err)
})
- } else {
- loadingCamera.value = false
}
- } else {
- let params = {
- regionId:
- mapSearchParam.value.parentId || '70be8c5b664f4bcf869d82f2e8335051',
- // pageNum: mapSearchParam.value.pageNum,
- // pageSize: mapSearchParam.value.pageSize,
- longitude: mapSearchParam.value.gpsX || '',
- latitude: mapSearchParam.value.gpsY || '',
- radius: mapSearchParam.value.radius || '',
- name: mapSearchParam.value.cameraName,
- type: mapSearchParam.value.type,
- borderPolygonList: mapSearchParam.value.borderPolygonList || [],
- }
- // todo-临时放开
- // if (
- // params.regionId === '70be8c5b664f4bcf869d82f2e8335051' &&
- // !params.name &&
- // !params.longitude
- // ) {
- // params.status = ''
- // }
- let paramsFather = ''
- let i = 1
- for (var key in params) {
- if (params[key] === '') {
- delete params[key]
- } else {
- if (i != 1) {
- paramsFather += `&${key}=` + params[key]
- i += 1
- } else if (i == 1) {
- paramsFather += `${key}=` + params[key]
- i += 1
- }
- }
- }
- getCameraByCondition(params)
- .then((res) => {
- console.log('res--查询摄像头---------->', res)
- loadingCamera.value = false
- dataSource.value = res.data.data
- pagination.value.total = res.data.count
- })
- .catch((err) => {
- loadingCamera.value = false
- message.error(err)
- })
- }
- }
+ },
+ 1000,
+ { leading: true, trailing: false }
+ )
defineExpose({
getCamera,
reSetSearch,
diff --git a/front/src/views/home/videoSurveillance/index.vue b/front/src/views/home/videoSurveillance/index.vue
index bda8d767..53f90439 100644
--- a/front/src/views/home/videoSurveillance/index.vue
+++ b/front/src/views/home/videoSurveillance/index.vue
@@ -1,10 +1,19 @@
-
-
+
+
+
+
@@ -41,6 +50,7 @@
:fetch-suggestions="querySearch"
clearable
class="input-with-select"
+ @change = "changeComplete"
placeholder="请输入关键字"
@select="
(addressItem) => {
@@ -92,7 +102,7 @@
data-spm-anchor-id="a313x.7781069.0.i0"
>
-
+