Compare commits

..

2 Commits

Author SHA1 Message Date
a0049873 3b4a6278cb Merge branch 'hi-ucs-dev' of http://192.168.124.50:3000/wuhongjian/hi-ucs into hi-ucs-dev
# Conflicts:
#	front/src/views/home/videoSurveillance/index.vue
2022-11-21 13:52:50 +08:00
a0049873 1d02b59509 查询修改 2022-11-21 13:48:57 +08:00
1 changed files with 58 additions and 6 deletions

View File

@ -35,14 +35,26 @@
<el-option label="兴趣点" value="1" />
<el-option label="点位" value="2" />
</el-select>
<el-input
<el-autocomplete
v-if="addressType==1"
v-model="address"
:fetch-suggestions="querySearch"
clearable
class="input-with-select"
placeholder="请输入关键词"
@select="
(addressItem) => {
selectedAddress(addressItem, i)
}
"
/>
<!-- <el-input
v-model="address"
placeholder="请输入关键词"
class="input-with-select"
@keyup.enter="handleEnter"
>
</el-input>
</el-input> -->
<el-autocomplete
v-else-if="addressType==2"
v-model="address"
@ -108,7 +120,7 @@ import { ElMessage } from 'element-plus'
selectByLabelName,
selectByChannelName,
} from '@/api/videoSurveillance'
import { getCameraByCondition,getListForPOIm,CameraConditionPlaceType } from '@/api/file'
import { getCameraByCondition,getListForPOI,CameraConditionPlaceType } from '@/api/file'
import mybus from '@/myplugins/mybus'
import * as turf from '@turf/turf';
@ -149,6 +161,7 @@ import { ElMessage } from 'element-plus'
type: 0, //012
},
pointAllData:[],
restaurants:[],
}
},
components: {
@ -208,10 +221,10 @@ import { ElMessage } from 'element-plus'
mybus.off('CameraConditionPlaceType')
mybus.on('CameraConditionPlaceType', (data) => {
this.queryCameraConditionPlace(data)
})
},
methods: { //
methods: {
//
queryCameraConditionPlace(data) {
let params = {
@ -223,7 +236,44 @@ import { ElMessage } from 'element-plus'
this.addResourceTomap('videoMap', res.data.data)
})
},
handleEnter(){
//
querySearch (queryString, cb) {
console.log('querySearch',queryString, cb,this.restaurants)
if(queryString){
getListForPOI({keywords:queryString}).then(res => {
if(res.data.data.rows[0]){
res.data.data.rows.map( val =>{
let arr = val.location.split(',')
val.location = {y:arr[1],x:arr[0]}
val.value = val.name
})
const results =res.data.data.rows
cb(results)
}else{
ElMessage({
showClose: true,
message: '未查询到兴趣点!',
type: 'warning',
})
}
})
}else{
cb([])
}
// const results = queryString
// ? this.restaurants.filter(createFilter(queryString))
// : this.restaurants
// call callback function to return suggestions
},
createFilter (queryString) {
return (restaurant) => {
return (
restaurant.toLowerCase().indexOf(queryString.toLowerCase()) === 0
)
}
},
//
handleEnter(queryString, cb){
console.log('查询',this.address,this.addressType)
if(this.address){
getListForPOI({keywords:this.address}).then(res => {
@ -461,6 +511,7 @@ import { ElMessage } from 'element-plus'
},
//
async searchAddressByKeyWord(queryString, cb, indexX) {
console.log('queryString, cb, indexX',queryString, cb, indexX)
this.disasterPointIndex = indexX
/* const res = await bdPlaceSearch({ searchKey: queryString });
if (res.data) {
@ -573,6 +624,7 @@ import { ElMessage } from 'element-plus'
}
},
handleSelect(item) {
console.log('1111',item)
this.hiMapFun.clearAllLayers()
//
let arr = item.detail.location.split(',')