This commit is contained in:
2025-08-27 17:57:33 +08:00
parent 886f1fd41d
commit 98495e2521
5 changed files with 36 additions and 14 deletions

View File

@@ -16,14 +16,14 @@
:title="$t('SetUpStation')"
:visible.sync="dialogVisible"
width="55%">
<el-form :model="dataForm" ref="dataForm" :label-width="$i18n.locale === 'en-us' ? '' : '1.1rem'" size="mini">
<el-form :model="dataForm" ref="dataForm" :rules="dataRule" :label-width="$i18n.locale === 'en-us' ? '' : '1.1rem'" size="mini">
<el-form-item :label="$t('StationName')" prop="stationName">
<el-input v-model="dataForm.stationName" id="stationName"></el-input>
</el-form-item>
</el-form>
<el-row type="flex" justify="space-around" style="margin-top: .3rem">
<el-col :span="7"><button class="button_control button_control_disabled" @click="dialogVisible = false"><p>{{$t('Cancel')}}</p></button></el-col>
<el-col :span="7"><button class="button_control" @click="_setStation"><p>{{$t('Save')}}</p></button></el-col>
<el-col :span="7"><button class="button_control" @click="stationConfirm"><p>{{$t('Save')}}</p></button></el-col>
</el-row>
</el-dialog>
<transition name="custom-message" >
@@ -97,6 +97,13 @@ export default {
}
},
data () {
const validateStationName = (rule, value, callback) => {
if (value && value.includes(',')) {
callback(new Error(this.$t('stationnotcommas')));
} else {
callback();
}
}
return {
driver: null,
driverActive: true,
@@ -107,6 +114,12 @@ export default {
stationCode: '',
stationName: ''
},
dataRule: {
stationName: [
{ validator: validateStationName, trigger: 'blur' }
]
},
submitSuccess: false,
keyPoints: [],
disabled: false,
message: '', // 用于显示消息
@@ -241,6 +254,19 @@ export default {
this.dataForm.stationName = `${na}${this.keyPoints.length + 1}`
},
// 打点->保存
stationConfirm () {
this.$refs.dataForm.validate((valid) => {
if (valid) {
this.submitSuccess = true
this._setStation()
setTimeout(() => {
this.submitSuccess = false
}, 3000)
} else {
return false
}
})
},
async _setStation () {
this.disabled = true
try {

View File

@@ -416,9 +416,6 @@ export default {
this.calculateCarSize()
},
// 核心修改:移除响应式调整逻辑,不再处理窗口大小变化
// handleResize() { ... },
startAnimationLoop() {
const animate = () => {
this.animationId = requestAnimationFrame(animate)
@@ -482,9 +479,6 @@ export default {
this.carTexture = null
}
// 移除窗口大小变化监听
window.removeEventListener('resize', this.handleResize)
this.camera = null
this.carMesh = null
this.pointCloudMesh = null