From 3c23ce2d0214a1246664e61fd51466033e25481e Mon Sep 17 00:00:00 2001 From: Surpriseplus <845948745@qq.com> Date: 星期五, 07 七月 2023 11:25:16 +0800 Subject: [PATCH] cimSDk 替换 --- src/views/search/search.vue | 103 +++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 87 insertions(+), 16 deletions(-) diff --git a/src/views/search/search.vue b/src/views/search/search.vue index 2c8aae5..7ef5fb1 100644 --- a/src/views/search/search.vue +++ b/src/views/search/search.vue @@ -45,6 +45,7 @@ size="small" text :icon="DArrowLeft" + @click="setPageChange(1)" class="pagingBtn" /> <el-button @@ -52,21 +53,25 @@ text :icon="ArrowLeft" class="pagingBtn1" + @click="setPageChange(2)" /> <el-input class="numInput" - v-model="listData.pageIndex" + v-model.number="listData.pageIndex" + @change="setInputCahgne" /> <el-button size="small" text :icon="ArrowRight" class="pagingBtn1" + @click="setPageChange(3)" /> <el-button size="small" text :icon="DArrowRight" + @click="setPageChange(4)" class="pagingBtn" /> </div> @@ -80,21 +85,12 @@ <div class="table_tr" v-for='(item,flag) in tableData' + @click="setPointLocal(item)" > <div class="table_th_x">{{ flag +1}}</div> <div class="table_th">{{ item.enName }}</div> </div> - <!-- <div class="table_tr"> - - </div> - <div class="table_tr"> - <div class="table_th_x"></div> - <div class="table_th"></div> - </div> - <div class="table_tr"> - <div class="table_th_x"></div> - <div class="table_th"></div> - </div> --> + </div> </div> </el-collapse-item> @@ -112,6 +108,13 @@ defineProps, defineEmits, } from "vue"; +import { + DArrowLeft, + ArrowLeft, + ArrowRight, + DArrowRight, +} from "@element-plus/icons-vue"; + import { dataQuery_selectByPage } from "@/api/api.js"; import { ElMessage } from "element-plus"; let searchValue = ref(""); @@ -124,17 +127,75 @@ pageIndex: 1, pageSize: 10, }); - +const imageLabel = null; const NumhandleChange = (value: number) => { console.log(value); }; const handleChange = (val: string[]) => { console.log(val); }; +const setPoitCannel = () => { + imageLabel.deleteObject(); + imageLabel = null; +}; +const setPointLocal = (res) => { + if (imageLabel) { + setPoitCannel(); + } + var position = { X: res.lon, Y: res.lat, Altitude: 10 }; + imageLabel = window.sgworld.Creator.CreateImageLabel( + position, + "http://183.162.245.49:82/05sdkdemo/src/static/image/mark.png", + {}, + 0, + "鏍囩鐐�" + ); + var id = imageLabel.item.id; + window.sgworld.Navigate.flyToObj(imageLabel.item); + // window.earthCtrl.camera.flyTo(res.log, res.lat, 300, 9.5, -45, 0.0, 5); +}; +const setInputCahgne = () => { + if ( + listData.value.pageIndex >= 1 && + listData.value.pageIndex <= listData.value.page + ) { + } else { + return ElMessage("杈撳嚭閿欒,鏃犳硶鏌ヨ"); + } + setSearchClick(); +}; +const setPageChange = (res) => { + switch (res) { + case 1: //鏌ヨ绗竴椤� + listData.value.pageIndex = 1; + break; + case 2: //鍓嶄竴椤� + if (listData.value.pageIndex > 1) { + listData.value.pageIndex -= 1; + } else { + return; + } + break; + case 3: //鍚庝竴椤� + if (listData.value.pageIndex < listData.value.page) { + listData.value.pageIndex += 1; + } else { + return; + } + break; + case 4: //鏌ヨ鏈�鍚庝竴椤� + listData.value.pageIndex = listData.value.page; + + break; + } + setSearchClick(); +}; + const setSearchClose = () => { searchFLag.value = false; searchValue.value = ""; + setPoitCannel(); }; const setSearchClick = async () => { if (!searchValue) return; @@ -151,6 +212,8 @@ return ElMessage(data.msg); } tableData.value = data.result; + listData.value.count = data.count; + listData.value.page = Math.ceil(data.count / 10); searchFLag.value = true; }; @@ -161,7 +224,7 @@ margin-left: 34px; } .searchInput { - width: 222px; + width: 243px; height: 35px; /deep/.el-input__icon { color: #d6e4ff; @@ -169,7 +232,7 @@ } .search_content { margin-top: 8px; - width: 222px; + width: 243px; // background: rgba(7, 8, 14, 0.8); border-radius: 4px; .el-collapse, @@ -198,7 +261,7 @@ color: #d6e4ff; } .numInput { - width: 49px; + width: 70px; height: 23px; padding: 0 5px; } @@ -265,6 +328,14 @@ display: flex; background: #000000; } + .table_tr:hover { + .table_th { + color: #409eff; + } + .table_th_x { + color: #409eff; + } + } .table_tr:nth-child(2n) { background: #0e151f; } -- Gitblit v1.9.3