修复 RangeError: Invalid array length

This commit is contained in:
hym 2024-09-29 14:55:53 +08:00
parent b97f5c597f
commit 54c0b11ab2
2 changed files with 121 additions and 136 deletions

View File

@ -5,28 +5,12 @@
<div class="left1">
<div class="xiala">
<el-select v-model="searchTypeValue" placeholder="">
<el-option
v-for="(item, index) in searchType"
:key="index"
:label="item"
:value="item"
/>
<el-option v-for="(item, index) in searchType" :key="index" :label="item" :value="item" />
</el-select>
</div>
<el-input v-model="searchValue" placeholder="" />
<el-button
class="sousuo"
type="primary"
icon="el-icon-search"
@click="getSearch"
/>
<el-button
v-if="menuShow"
class="caidan"
type="default"
icon="el-icon-s-operation"
@click="openDialog"
/>
<el-button class="sousuo" type="primary" icon="el-icon-search" @click="getSearch" />
<el-button v-if="menuShow" class="caidan" type="default" icon="el-icon-s-operation" @click="openDialog" />
</div>
<div class="left3">
<el-radio-group v-model="radio">
@ -35,19 +19,15 @@
</el-radio-group>
</div>
<div class="left4" v-if="radio == '数据样品集'">
<div v-for="(item,index) in dataList" :key="index" class="left4_1" @click="openList(item)">
<div v-for="(item, index) in dataList" :key="index" class="left4_1" @click="openList(item)">
<div class="left4_top">
<p>{{ item.dataset_name }} <span class="mileage">{{item.file_total}}</span></p>
<p>{{ item.dataset_name }} <span class="mileage">{{ item.file_total }}</span></p>
<span class="org">{{ item.create_time }}</span>
</div>
<ul v-if="currenId == item.tsy_id && fold">
<li
:class="sample.tsy_id == currenSample ? 'bg-color' : ''"
class="sample"
v-for="(sample, i) in item.sampleArray"
:key="i"
@click.stop="onSample(sample)"
>{{sample.sample_name}}</li>
<li :class="sample.tsy_id == currenSample ? 'bg-color' : ''" class="sample"
v-for="(sample, i) in item.sampleArray" :key="i" @click.stop="onSample(sample)">{{ sample.sample_name }}
</li>
</ul>
<div class="left4_list">
<div class="list1">
@ -88,9 +68,9 @@
</div>
</div>
<div class="left4" v-if="radio == '航次'">
<div v-for="(item,index) in dataList" :key="index" class="left4_1" @click="turnDeatilPage(item)">
<div v-for="(item, index) in dataList" :key="index" class="left4_1" @click="turnDeatilPage(item)">
<div class="left4_top">
<p>{{ item.voyage_name }} <span class="mileage">{{item.voyage_mileage}}海里</span></p>
<p>{{ item.voyage_name }} <span class="mileage">{{ item.voyage_mileage }}海里</span></p>
<span class="org">{{ item.funding_org }}</span>
</div>
<div class="left4_list">
@ -105,12 +85,12 @@
<div class="list1">
<p>离港日期</p>
<span>{{ item.voyage_start_date.slice(0,10) }}</span>
<span>{{ item.voyage_start_date.slice(0, 10) }}</span>
</div>
<div class="list1">
<p>返港日期</p>
<span>{{ item.voyage_end_date.slice(0,10) }}</span>
<span>{{ item.voyage_end_date.slice(0, 10) }}</span>
</div>
<div class="list1">
@ -139,24 +119,22 @@
</div>
</div>
<!-- 航次名称弹窗-->
<el-dialog
title="请选择航次"
:visible.sync="dialog1"
width="1000px"
:before-close="handleClose1">
<el-table ref="tableData1" stripe border :data="tableData1" @selection-change="handleSelectionChange" :header-cell-style="{ background: '#dddfe6',color: '#555960',textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
<el-table-column type="index" label="#" width="50"/>
<el-dialog title="请选择航次" :visible.sync="dialog1" width="1000px" :before-close="handleClose1">
<el-table ref="tableData1" stripe border :data="tableData1" @selection-change="handleSelectionChange"
:header-cell-style="{ background: '#dddfe6', color: '#555960', textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }">
<el-table-column type="index" label="#" width="50" />
<el-table-column type="selection" width="50" align="center" />
<el-table-column prop="voyage_name" label="航次名称" />
<el-table-column prop="ship_name" label="科考船舶" />
<el-table-column prop="voyage_start_date" label="离岗日期">
<template slot-scope="scope">
<span>{{ scope.row.voyage_start_date.slice(0,10) }}</span>
<span>{{ scope.row.voyage_start_date.slice(0, 10) }}</span>
</template>
</el-table-column>
<el-table-column prop="voyage_end_date" label="返岗日期">
<template slot-scope="scope">
<span>{{ scope.row.voyage_end_date.slice(0,10) }}</span>
<span>{{ scope.row.voyage_end_date.slice(0, 10) }}</span>
</template>
</el-table-column>
<el-table-column prop="voyage_officer" label="首席" />
@ -165,26 +143,17 @@
<el-table-column prop="funding_code" label="资助编号" />
</el-table>
<div class="pagination-box">
<el-pagination
background
:page-sizes="[10, 20, 30]"
:page-size="params1.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total1"
:current-page="pageNum1"
@size-change="handleSizeChange1"
@current-change="handleCurrentChange1"
/>
<el-pagination background :page-sizes="[10, 20, 30]" :page-size="params1.limit"
layout="total, sizes, prev, pager, next, jumper" :total="total1" :current-page="pageNum1"
@size-change="handleSizeChange1" @current-change="handleCurrentChange1" />
</div>
</el-dialog>
<!-- 平台类型弹窗-->
<el-dialog
title="请选择平台"
:visible.sync="dialog2"
width="1200px"
:before-close="handleClose2">
<el-table ref="tableData2" stripe border :data="tableData2" @selection-change="handleSelectionChange" :header-cell-style="{ background: '#dddfe6',color: '#555960',textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
<el-table-column type="index" label="#" width="50"/>
<el-dialog title="请选择平台" :visible.sync="dialog2" width="1200px" :before-close="handleClose2">
<el-table ref="tableData2" stripe border :data="tableData2" @selection-change="handleSelectionChange"
:header-cell-style="{ background: '#dddfe6', color: '#555960', textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }">
<el-table-column type="index" label="#" width="50" />
<el-table-column type="selection" width="50" align="center" />
<el-table-column prop="platform_name" label="平台类型名称" />
<el-table-column prop="platform_eng" label="英文类型名称" />
@ -194,26 +163,17 @@
<el-table-column prop="create_time" label="创建时间" />
</el-table>
<div class="pagination-box">
<el-pagination
background
:page-sizes="[10, 20, 30]"
:page-size="params2.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total2"
:current-page="pageNum2"
@size-change="handleSizeChange2"
@current-change="handleCurrentChange2"
/>
<el-pagination background :page-sizes="[10, 20, 30]" :page-size="params2.limit"
layout="total, sizes, prev, pager, next, jumper" :total="total2" :current-page="pageNum2"
@size-change="handleSizeChange2" @current-change="handleCurrentChange2" />
</div>
</el-dialog>
<!-- 设备类型弹窗-->
<el-dialog
title="请选择设备"
:visible.sync="dialog3"
width="1200px"
:before-close="handleClose3">
<el-table ref="tableData3" stripe border :data="tableData3" @selection-change="handleSelectionChange" :header-cell-style="{ background: '#dddfe6',color: '#555960',textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
<el-table-column type="index" label="#" width="50"/>
<el-dialog title="请选择设备" :visible.sync="dialog3" width="1200px" :before-close="handleClose3">
<el-table ref="tableData3" stripe border :data="tableData3" @selection-change="handleSelectionChange"
:header-cell-style="{ background: '#dddfe6', color: '#555960', textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }">
<el-table-column type="index" label="#" width="50" />
<el-table-column type="selection" width="50" align="center" />
<el-table-column prop="equipment_name" label="设备类型名称" width="300" />
<el-table-column prop="equipment_eng" label="英文名称" width="350" />
@ -223,26 +183,17 @@
<el-table-column prop="create_time" label="创建时间" width="160" />
</el-table>
<div class="pagination-box">
<el-pagination
background
:page-sizes="[10, 20, 30]"
:page-size="params3.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total3"
:current-page="pageNum3"
@size-change="handleSizeChange3"
@current-change="handleCurrentChange3"
/>
<el-pagination background :page-sizes="[10, 20, 30]" :page-size="params3.limit"
layout="total, sizes, prev, pager, next, jumper" :total="total3" :current-page="pageNum3"
@size-change="handleSizeChange3" @current-change="handleCurrentChange3" />
</div>
</el-dialog>
<!-- 数据样品类型弹窗-->
<el-dialog
title="请选择数据样品类型"
:visible.sync="dialog4"
width="1200px"
:before-close="handleClose4">
<el-table ref="tableData4" stripe border :data="tableData4" @selection-change="handleSelectionChange" :header-cell-style="{ background: '#dddfe6',color: '#555960',textAlign: 'center' }" :cell-style="{ textAlign: 'center' }">
<el-table-column type="index" label="#" width="50"/>
<el-dialog title="请选择数据样品类型" :visible.sync="dialog4" width="1200px" :before-close="handleClose4">
<el-table ref="tableData4" stripe border :data="tableData4" @selection-change="handleSelectionChange"
:header-cell-style="{ background: '#dddfe6', color: '#555960', textAlign: 'center' }"
:cell-style="{ textAlign: 'center' }">
<el-table-column type="index" label="#" width="50" />
<el-table-column type="selection" width="50" align="center" />
<el-table-column prop="data_name" label="数据样品类型类型名称" width="300" />
<el-table-column prop="data_eng" label="英文名称" width="350" />
@ -252,16 +203,9 @@
<el-table-column prop="create_time" label="创建时间" width="160" />
</el-table>
<div class="pagination-box">
<el-pagination
background
:page-sizes="[10, 20, 30]"
:page-size="params4.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total4"
:current-page="pageNum4"
@size-change="handleSizeChange4"
@current-change="handleCurrentChange4"
/>
<el-pagination background :page-sizes="[10, 20, 30]" :page-size="params4.limit"
layout="total, sizes, prev, pager, next, jumper" :total="total4" :current-page="pageNum4"
@size-change="handleSizeChange4" @current-change="handleCurrentChange4" />
</div>
</el-dialog>
</div>
@ -554,9 +498,11 @@ export default {
zIndex: 1000,
width: 2,
// 线
material: Cesium.Color.fromRandom({alpha: 0.5})
material: Cesium.Color.fromRandom({ alpha: 0.5 })
}
})
// RangeError: Invalid array length
if (degreeArr.length > 1)
this.viewer.camera.setView({
//
destination: Cesium.Cartesian3.fromDegrees(degreeArr[0], degreeArr[1])
@ -588,7 +534,7 @@ export default {
this.viewer.entities.removeAll()
},
//
autoZoom(){
autoZoom() {
this.viewer.zoomTo(this.viewer.entities)
},
turnDeatilPage(item) {
@ -796,7 +742,7 @@ export default {
}
},
goHome() {
this.$router.push({name: 'home'})
this.$router.push({ name: 'home' })
}
}
}
@ -806,12 +752,14 @@ export default {
.shuju {
width: 100%;
height: 100%;
.shuju_con {
width: 100%;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
.left {
position: relative;
width: 570px;
@ -821,16 +769,19 @@ export default {
padding: 50px 30px;
display: flex;
flex-direction: column;
.left1 {
width: 100%;
height: 40px;
display: flex;
align-items: center;
.xiala {
width: 80%;
height: 40px;
margin-right: 15px;
}
.el-button {
width: 12%;
font-size: 20px;
@ -840,19 +791,24 @@ export default {
align-items: center;
justify-content: center;
}
.sousuo {
margin-right: 1%;
}
.caidan {
color: #999;
}
}
.left2 {
margin-top: 20px;
.el-tag {
margin-right: 10px;
}
}
.left3 {
padding: 10px 0;
width: 100%;
@ -862,52 +818,64 @@ export default {
justify-content: center;
border-bottom: 1px solid #e5e5e5;
}
.left4{
.left4 {
width: 100%;
height: 700px;
overflow-y: scroll;
&::-webkit-scrollbar {
width: 5px; /* 保持一个最小的宽度 */
background-color: transparent; /* 透明背景 */
width: 5px;
/* 保持一个最小的宽度 */
background-color: transparent;
/* 透明背景 */
}
&::-webkit-scrollbar-thumb {
background-color: transparent; /* 滚动条滑块也设置为透明 */
background-color: transparent;
/* 滚动条滑块也设置为透明 */
}
.left4_1{
padding:20px 0;
.left4_1 {
padding: 20px 0;
width: 100%;
height: auto;
border-bottom: 1px solid #e5e5e5;
cursor: pointer;
&:hover{
.left4_top{
p{
&:hover {
.left4_top {
p {
color: #409eff;
}
}
}
.left4_top{
.left4_top {
display: flex;
flex-direction: column;
width: 100%;
margin-bottom: 10px;
p{
p {
font-size: 16px;
color: #212121;
font-weight: bold;
display: flex;
justify-content: space-between;
.mileage {
font-size: 12px;
color: #909fa7;
}
}
.org {
font-size: 12px;
color: #999999;
}
}
.sample {
padding: 6px 12px;
box-sizing: border-box;
@ -915,6 +883,7 @@ export default {
font-size: 14px;
color: #555555;
position: relative;
&::before {
content: "";
display: block;
@ -926,28 +895,34 @@ export default {
top: 12px;
border-radius: 50%;
}
//&:hover {
// background-color: rgb(248,249,250);
//}
}
.bg-color {
background-color: rgb(93,156,236);
background-color: rgb(93, 156, 236);
}
.left4_list{
.left4_list {
width: 100%;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.list1{
.list1 {
width: 50%;
display: flex;
align-items: center;
margin-bottom: 10px;
p{
p {
font-size: 14px;
color: #999;
}
span{
span {
font-size: 14px;
color: #212121;
}
@ -955,7 +930,8 @@ export default {
}
}
}
.arrow{
.arrow {
position: absolute;
right: 0;
top: 40%;
@ -963,13 +939,15 @@ export default {
cursor: pointer;
}
}
.arrow_r{
.arrow_r {
position: absolute;
top: 40%;
left: 0;
z-index: 888;
cursor: pointer;
}
.right {
width: 100%;
height: 100%;
@ -991,21 +969,24 @@ export default {
.left3_1 .el-radio {
margin-right: 15px;
}
.left3_1 .el-radio__label {
font-size: 15px;
}
.el-input__inner::-webkit-input-placeholder {
color: #333;
}
.left3_2 .el-input__inner {
padding-left: 0;
border: none;
font-size: 15px;
}
.BMapLabel{
.BMapLabel {
border: none !important;
color: #fff;
background: none !important;
}
</style>

View File

@ -78,7 +78,9 @@
</li>
</ul>
</div>
<div id="cesiumContainer" ref="cesiumContainer" onmouseleave="document.getElementById('mouseWheelTip').style.display = 'none'" style="height: 100%;width:100%;">
<div id="cesiumContainer" ref="cesiumContainer"
onmouseleave="document.getElementById('mouseWheelTip').style.display = 'none'"
style="height: 100%;width:100%;">
<div class="son" style="display: none;">弹框插槽</div>
<div id="mouseWheelTip" style="display: none;">地图缩放按下 Ctrl + 鼠标滚轮</div>
</div>
@ -434,6 +436,8 @@ export default {
material: Cesium.Color.fromRandom({ alpha: 0.5 })
}
})
// RangeError: Invalid array length
if (degreeArr.length > 1)
this.viewer.camera.setView({
//
destination: Cesium.Cartesian3.fromDegrees(degreeArr[0], degreeArr[1])
@ -1259,7 +1263,7 @@ export default {
z-index: 1000;
}
#mouseWheelTip{
#mouseWheelTip {
position: absolute;
left: 5px;
bottom: 5px;