+

房间选择

选择或创建您要加入的协作房间

@@ -169,6 +172,18 @@ export default { } }, methods: { + /** 返回登录页:登出并跳转到登录界面 */ + backToLogin() { + this.$confirm('确定退出当前账号并返回登录页吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + this.$store.dispatch('LogOut').then(() => { + this.$router.push({ path: '/login' }).catch(() => {}) + }).catch(() => {}) + }).catch(() => {}) + }, getList() { listRooms().then(response => { this.rooms = response.rows || response; @@ -309,6 +324,25 @@ export default { padding: 20px 24px 16px; border-bottom: 1px solid #e2e8f0; text-align: center; + position: relative; +} + +.back-login { + position: absolute; + left: 24px; + top: 50%; + transform: translateY(-50%); + font-size: 14px; + color: #64748b; + text-decoration: none; + display: inline-flex; + align-items: center; + gap: 4px; + transition: color 0.2s; +} + +.back-login:hover { + color: #165DFF; } .panel-header h2 { diff --git a/ruoyi-ui/src/views/system/waypoints/index.vue b/ruoyi-ui/src/views/system/waypoints/index.vue index 73c53fd..c5010f8 100644 --- a/ruoyi-ui/src/views/system/waypoints/index.vue +++ b/ruoyi-ui/src/views/system/waypoints/index.vue @@ -131,8 +131,16 @@ - - + + + + + + @@ -178,10 +186,10 @@ - + - + @@ -278,6 +286,27 @@ export default { this.getList() }, methods: { + degreesToDMS(decimalDegrees) { + if (!decimalDegrees) return '' + const degrees = Math.floor(decimalDegrees) + const minutesDecimal = (decimalDegrees - degrees) * 60 + const minutes = Math.floor(minutesDecimal) + const seconds = ((minutesDecimal - minutes) * 60).toFixed(2) + return `${degrees}°${minutes}'${seconds}"` + }, + dmsToDegrees(dms) { + if (!dms) return null + const match = dms.match(/^(-?\d+)°(\d+)'([\d.]+)"$/) + if (!match) { + const num = parseFloat(dms) + return isNaN(num) ? null : num + } + const degrees = parseFloat(match[1]) + const minutes = parseFloat(match[2]) + const seconds = parseFloat(match[3]) + const sign = degrees < 0 ? -1 : 1 + return sign * (Math.abs(degrees) + minutes / 60 + seconds / 3600) + }, /** 查询航线具体航点明细列表 */ getList() { this.loading = true @@ -336,6 +365,8 @@ export default { const id = row.id || this.ids getWaypoints(id).then(response => { this.form = response.data + this.form.lat = this.degreesToDMS(this.form.lat) + this.form.lng = this.degreesToDMS(this.form.lng) this.open = true this.title = "修改航线具体航点明细" }) @@ -344,14 +375,23 @@ export default { submitForm() { this.$refs["form"].validate(valid => { if (valid) { - if (this.form.id != null) { - updateWaypoints(this.form).then(response => { + const formData = { ...this.form } + formData.lat = this.dmsToDegrees(formData.lat) + formData.lng = this.dmsToDegrees(formData.lng) + + if (formData.lat === null || formData.lng === null) { + this.$modal.msgError("请输入有效的度分秒格式!格式:39°54'33.48\"") + return + } + + if (formData.id != null) { + updateWaypoints(formData).then(response => { this.$modal.msgSuccess("修改成功") this.open = false this.getList() }) } else { - addWaypoints(this.form).then(response => { + addWaypoints(formData).then(response => { this.$modal.msgSuccess("新增成功") this.open = false this.getList() diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index 462f379..5632e77 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -22,7 +22,6 @@ const port = process.env.port || process.env.npm_config_port || 80 // 端口 const cesiumSource = 'node_modules/cesium/Build/Cesium' module.exports = { - // 部署生产环境和开发环境下的URL。 publicPath: process.env.NODE_ENV === "production" ? "/" : "/", outputDir: 'dist',