Browse Source

Merge branch 'ctw' of http://124.70.32.114:3100/woka/cesium-map-object into lbj

# Conflicts:
#	ruoyi-ui/src/views/cesiumMap/index.vue
lbj
sd 2 months ago
parent
commit
7fbc03db1d
  1. 64
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/RoomPlatformIconController.java
  2. 2
      ruoyi-admin/src/main/resources/application-druid.yml
  3. 2
      ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java
  4. 57
      ruoyi-system/src/main/java/com/ruoyi/system/domain/RoomPlatformIcon.java
  5. 50
      ruoyi-system/src/main/java/com/ruoyi/system/domain/RouteWaypoints.java
  6. 22
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/RoomPlatformIconMapper.java
  7. 20
      ruoyi-system/src/main/java/com/ruoyi/system/service/IRoomPlatformIconService.java
  8. 50
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RoomPlatformIconServiceImpl.java
  9. 8
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RouteWaypointsServiceImpl.java
  10. 95
      ruoyi-system/src/main/resources/mapper/system/RoomPlatformIconMapper.xml
  11. 20
      ruoyi-system/src/main/resources/mapper/system/RouteWaypointsMapper.xml
  12. 2
      ruoyi-ui/.env.development
  13. 36
      ruoyi-ui/src/api/system/roomPlatformIcon.js
  14. 1
      ruoyi-ui/src/assets/icons/svg/screenshot.svg
  15. 1
      ruoyi-ui/src/lang/en.js
  16. 1
      ruoyi-ui/src/lang/zh.js
  17. 31
      ruoyi-ui/src/permission.js
  18. 2
      ruoyi-ui/src/router/index.js
  19. 14
      ruoyi-ui/src/store/modules/permission.js
  20. 45
      ruoyi-ui/src/views/cesiumMap/ContextMenu.vue
  21. 1666
      ruoyi-ui/src/views/cesiumMap/index.vue
  22. 58
      ruoyi-ui/src/views/childRoom/RightPanel.vue
  23. 25
      ruoyi-ui/src/views/childRoom/TopHeader.vue
  24. 719
      ruoyi-ui/src/views/childRoom/index.vue
  25. 5
      ruoyi-ui/src/views/dialogs/RouteEditDialog.vue
  26. 113
      ruoyi-ui/src/views/dialogs/WaypointEditDialog.vue
  27. 7
      ruoyi-ui/src/views/login.vue
  28. 34
      ruoyi-ui/src/views/selectRoom/index.vue
  29. 2
      ruoyi-ui/vue.config.js

64
ruoyi-admin/src/main/java/com/ruoyi/web/controller/RoomPlatformIconController.java

@ -0,0 +1,64 @@
package com.ruoyi.web.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.RoomPlatformIcon;
import com.ruoyi.system.service.IRoomPlatformIconService;
/**
* 房间地图平台图标Controller
*/
@RestController
@RequestMapping("/system/roomPlatformIcon")
public class RoomPlatformIconController extends BaseController {
@Autowired
private IRoomPlatformIconService roomPlatformIconService;
/**
* 按房间ID查询该房间下所有地图平台图标不分页
*/
@PreAuthorize("@ss.hasPermi('system:roomPlatformIcon:list')")
@GetMapping("/list")
public AjaxResult list(@RequestParam Long roomId) {
List<RoomPlatformIcon> list = roomPlatformIconService.selectListByRoomId(roomId);
return success(list);
}
/**
* 新增
*/
@PreAuthorize("@ss.hasPermi('system:roomPlatformIcon:add')")
@Log(title = "房间地图平台图标", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody RoomPlatformIcon roomPlatformIcon) {
int rows = roomPlatformIconService.insert(roomPlatformIcon);
return rows > 0 ? success(roomPlatformIcon) : error("新增失败");
}
/**
* 修改位置/朝向/缩放
*/
@PreAuthorize("@ss.hasPermi('system:roomPlatformIcon:edit')")
@Log(title = "房间地图平台图标", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody RoomPlatformIcon roomPlatformIcon) {
return toAjax(roomPlatformIconService.update(roomPlatformIcon));
}
/**
* 删除
*/
@PreAuthorize("@ss.hasPermi('system:roomPlatformIcon:remove')")
@Log(title = "房间地图平台图标", businessType = BusinessType.DELETE)
@DeleteMapping("/{id}")
public AjaxResult remove(@PathVariable Long id) {
return toAjax(roomPlatformIconService.deleteById(id));
}
}

2
ruoyi-admin/src/main/resources/application-druid.yml

@ -8,7 +8,7 @@ spring:
master:
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: 123456
password: A20040303ctw!
# 从库数据源
slave:
# 从数据源开关/默认关闭

2
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysRegisterService.java

@ -96,7 +96,7 @@ public class SysRegisterService
String level = registerBody.getUserLevel();
if ("1".equals(level)) {
roleIds[0] = 1L; // 管理员角色ID
roleIds[0] = 101L; // 管理员角色ID
} else if ("2".equals(level)) {
roleIds[0] = 100L; // 主持人角色ID
} else {

57
ruoyi-system/src/main/java/com/ruoyi/system/domain/RoomPlatformIcon.java

@ -0,0 +1,57 @@
package com.ruoyi.system.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 房间地图平台图标对象 room_platform_icon
*/
public class RoomPlatformIcon extends BaseEntity {
private static final long serialVersionUID = 1L;
@Excel(name = "主键")
private Long id;
@Excel(name = "房间ID")
private Long roomId;
@Excel(name = "平台库ID")
private Long platformId;
@Excel(name = "平台名称快照")
private String platformName;
@Excel(name = "平台类型快照")
private String platformType;
@Excel(name = "图标URL快照")
private String iconUrl;
@Excel(name = "经度")
private Double lng;
@Excel(name = "纬度")
private Double lat;
@Excel(name = "朝向(度)")
private Double heading;
@Excel(name = "图标缩放")
private Double iconScale;
@Excel(name = "排序")
private Integer sortOrder;
public void setId(Long id) { this.id = id; }
public Long getId() { return id; }
public void setRoomId(Long roomId) { this.roomId = roomId; }
public Long getRoomId() { return roomId; }
public void setPlatformId(Long platformId) { this.platformId = platformId; }
public Long getPlatformId() { return platformId; }
public void setPlatformName(String platformName) { this.platformName = platformName; }
public String getPlatformName() { return platformName; }
public void setPlatformType(String platformType) { this.platformType = platformType; }
public String getPlatformType() { return platformType; }
public void setIconUrl(String iconUrl) { this.iconUrl = iconUrl; }
public String getIconUrl() { return iconUrl; }
public void setLng(Double lng) { this.lng = lng; }
public Double getLng() { return lng; }
public void setLat(Double lat) { this.lat = lat; }
public Double getLat() { return lat; }
public void setHeading(Double heading) { this.heading = heading; }
public Double getHeading() { return heading; }
public void setIconScale(Double iconScale) { this.iconScale = iconScale; }
public Double getIconScale() { return iconScale; }
public void setSortOrder(Integer sortOrder) { this.sortOrder = sortOrder; }
public Integer getSortOrder() { return sortOrder; }
}

50
ruoyi-system/src/main/java/com/ruoyi/system/domain/RouteWaypoints.java

@ -55,6 +55,20 @@ public class RouteWaypoints extends BaseEntity
@Excel(name = "转弯角度 (用于计算转弯半径)")
private Double turnAngle;
/** 航点类型: normal-普通, hold_circle-圆形盘旋, hold_ellipse-椭圆盘旋 */
@Excel(name = "航点类型")
private String pointType;
/** 盘旋参数JSON: 圆(radius,clockwise) 椭圆(semiMajor,semiMinor,headingDeg,clockwise) */
@Excel(name = "盘旋参数")
private String holdParams;
/** 航点标签文字大小(px),用于地图显示 */
private Integer labelFontSize;
/** 航点标签文字颜色(如 #333333),用于地图显示 */
private String labelColor;
public void setId(Long id)
{
this.id = id;
@ -155,6 +169,38 @@ public class RouteWaypoints extends BaseEntity
return turnAngle;
}
public void setPointType(String pointType) {
this.pointType = pointType;
}
public String getPointType() {
return pointType;
}
public void setHoldParams(String holdParams) {
this.holdParams = holdParams;
}
public String getHoldParams() {
return holdParams;
}
public void setLabelFontSize(Integer labelFontSize) {
this.labelFontSize = labelFontSize;
}
public Integer getLabelFontSize() {
return labelFontSize;
}
public void setLabelColor(String labelColor) {
this.labelColor = labelColor;
}
public String getLabelColor() {
return labelColor;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -168,6 +214,10 @@ public class RouteWaypoints extends BaseEntity
.append("speed", getSpeed())
.append("startTime", getStartTime())
.append("turnAngle", getTurnAngle())
.append("pointType", getPointType())
.append("holdParams", getHoldParams())
.append("labelFontSize", getLabelFontSize())
.append("labelColor", getLabelColor())
.toString();
}

22
ruoyi-system/src/main/java/com/ruoyi/system/mapper/RoomPlatformIconMapper.java

@ -0,0 +1,22 @@
package com.ruoyi.system.mapper;
import java.util.List;
import com.ruoyi.system.domain.RoomPlatformIcon;
/**
* 房间地图平台图标Mapper接口
*/
public interface RoomPlatformIconMapper {
RoomPlatformIcon selectRoomPlatformIconById(Long id);
List<RoomPlatformIcon> selectRoomPlatformIconList(RoomPlatformIcon roomPlatformIcon);
int insertRoomPlatformIcon(RoomPlatformIcon roomPlatformIcon);
int updateRoomPlatformIcon(RoomPlatformIcon roomPlatformIcon);
int deleteRoomPlatformIconById(Long id);
int deleteRoomPlatformIconByRoomId(Long roomId);
}

20
ruoyi-system/src/main/java/com/ruoyi/system/service/IRoomPlatformIconService.java

@ -0,0 +1,20 @@
package com.ruoyi.system.service;
import java.util.List;
import com.ruoyi.system.domain.RoomPlatformIcon;
/**
* 房间地图平台图标Service接口
*/
public interface IRoomPlatformIconService {
List<RoomPlatformIcon> selectListByRoomId(Long roomId);
RoomPlatformIcon selectById(Long id);
int insert(RoomPlatformIcon roomPlatformIcon);
int update(RoomPlatformIcon roomPlatformIcon);
int deleteById(Long id);
}

50
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RoomPlatformIconServiceImpl.java

@ -0,0 +1,50 @@
package com.ruoyi.system.service.impl;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.RoomPlatformIconMapper;
import com.ruoyi.system.domain.RoomPlatformIcon;
import com.ruoyi.system.service.IRoomPlatformIconService;
/**
* 房间地图平台图标Service业务层
*/
@Service
public class RoomPlatformIconServiceImpl implements IRoomPlatformIconService {
@Autowired
private RoomPlatformIconMapper roomPlatformIconMapper;
@Override
public List<RoomPlatformIcon> selectListByRoomId(Long roomId) {
RoomPlatformIcon query = new RoomPlatformIcon();
query.setRoomId(roomId);
return roomPlatformIconMapper.selectRoomPlatformIconList(query);
}
@Override
public RoomPlatformIcon selectById(Long id) {
return roomPlatformIconMapper.selectRoomPlatformIconById(id);
}
@Override
public int insert(RoomPlatformIcon roomPlatformIcon) {
Date now = new Date();
roomPlatformIcon.setCreateTime(now);
roomPlatformIcon.setUpdateTime(now);
return roomPlatformIconMapper.insertRoomPlatformIcon(roomPlatformIcon);
}
@Override
public int update(RoomPlatformIcon roomPlatformIcon) {
roomPlatformIcon.setUpdateTime(new Date());
return roomPlatformIconMapper.updateRoomPlatformIcon(roomPlatformIcon);
}
@Override
public int deleteById(Long id) {
return roomPlatformIconMapper.deleteRoomPlatformIconById(id);
}
}

8
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RouteWaypointsServiceImpl.java

@ -62,6 +62,14 @@ public class RouteWaypointsServiceImpl implements IRouteWaypointsService
routeWaypoints.setSeq((long) (maxSeq + 1));
}
// 2.5 地图标签默认值:字号 14、颜色 #333333(微软雅黑、不加粗)
if (routeWaypoints.getLabelFontSize() == null) {
routeWaypoints.setLabelFontSize(14);
}
if (routeWaypoints.getLabelColor() == null || routeWaypoints.getLabelColor().isEmpty()) {
routeWaypoints.setLabelColor("#333333");
}
// 3. 执行若依生成的原始插入方法
return routeWaypointsMapper.insertRouteWaypoints(routeWaypoints);
}

95
ruoyi-system/src/main/resources/mapper/system/RoomPlatformIconMapper.xml

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.RoomPlatformIconMapper">
<resultMap type="com.ruoyi.system.domain.RoomPlatformIcon" id="RoomPlatformIconResult">
<result property="id" column="id" />
<result property="roomId" column="room_id" />
<result property="platformId" column="platform_id" />
<result property="platformName" column="platform_name"/>
<result property="platformType" column="platform_type"/>
<result property="iconUrl" column="icon_url" />
<result property="lng" column="lng" />
<result property="lat" column="lat" />
<result property="heading" column="heading" />
<result property="iconScale" column="icon_scale" />
<result property="sortOrder" column="sort_order" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectRoomPlatformIconVo">
select id, room_id, platform_id, platform_name, platform_type, icon_url,
lng, lat, heading, icon_scale, sort_order, create_time, update_time
from room_platform_icon
</sql>
<select id="selectRoomPlatformIconList" resultMap="RoomPlatformIconResult">
<include refid="selectRoomPlatformIconVo"/>
<where>
<if test="roomId != null"> and room_id = #{roomId}</if>
<if test="platformId != null"> and platform_id = #{platformId}</if>
</where>
order by sort_order asc, id asc
</select>
<select id="selectRoomPlatformIconById" resultMap="RoomPlatformIconResult">
<include refid="selectRoomPlatformIconVo"/>
where id = #{id}
</select>
<insert id="insertRoomPlatformIcon" parameterType="com.ruoyi.system.domain.RoomPlatformIcon" useGeneratedKeys="true" keyProperty="id">
insert into room_platform_icon
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="roomId != null">room_id,</if>
<if test="platformId != null">platform_id,</if>
<if test="platformName != null">platform_name,</if>
<if test="platformType != null">platform_type,</if>
<if test="iconUrl != null">icon_url,</if>
<if test="lng != null">lng,</if>
<if test="lat != null">lat,</if>
<if test="heading != null">heading,</if>
<if test="iconScale != null">icon_scale,</if>
<if test="sortOrder != null">sort_order,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="roomId != null">#{roomId},</if>
<if test="platformId != null">#{platformId},</if>
<if test="platformName != null">#{platformName},</if>
<if test="platformType != null">#{platformType},</if>
<if test="iconUrl != null">#{iconUrl},</if>
<if test="lng != null">#{lng},</if>
<if test="lat != null">#{lat},</if>
<if test="heading != null">#{heading},</if>
<if test="iconScale != null">#{iconScale},</if>
<if test="sortOrder != null">#{sortOrder},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateRoomPlatformIcon" parameterType="com.ruoyi.system.domain.RoomPlatformIcon">
update room_platform_icon
<trim prefix="SET" suffixOverrides=",">
<if test="lng != null">lng = #{lng},</if>
<if test="lat != null">lat = #{lat},</if>
<if test="heading != null">heading = #{heading},</if>
<if test="iconScale != null">icon_scale = #{iconScale},</if>
<if test="sortOrder != null">sort_order = #{sortOrder},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteRoomPlatformIconById" parameterType="Long">
delete from room_platform_icon where id = #{id}
</delete>
<delete id="deleteRoomPlatformIconByRoomId" parameterType="Long">
delete from room_platform_icon where room_id = #{roomId}
</delete>
</mapper>

20
ruoyi-system/src/main/resources/mapper/system/RouteWaypointsMapper.xml

@ -15,10 +15,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="speed" column="speed" />
<result property="startTime" column="start_time" />
<result property="turnAngle" column="turn_angle" />
<result property="pointType" column="point_type" />
<result property="holdParams" column="hold_params" />
<result property="labelFontSize" column="label_font_size" />
<result property="labelColor" column="label_color" />
</resultMap>
<sql id="selectRouteWaypointsVo">
select id, route_id, name, seq, lat, lng, alt, speed, start_time, turn_angle from route_waypoints
select id, route_id, name, seq, lat, lng, alt, speed, start_time, turn_angle, point_type, hold_params, label_font_size, label_color from route_waypoints
</sql>
<select id="selectRouteWaypointsList" parameterType="RouteWaypoints" resultMap="RouteWaypointsResult">
@ -33,6 +37,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="speed != null "> and speed = #{speed}</if>
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
<if test="turnAngle != null "> and turn_angle = #{turnAngle}</if>
<if test="pointType != null and pointType != ''"> and point_type = #{pointType}</if>
<if test="holdParams != null and holdParams != ''"> and hold_params = #{holdParams}</if>
</where>
</select>
@ -57,6 +63,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="speed != null">speed,</if>
<if test="startTime != null and startTime != ''">start_time,</if>
<if test="turnAngle != null">turn_angle,</if>
<if test="pointType != null and pointType != ''">point_type,</if>
<if test="holdParams != null">hold_params,</if>
<if test="labelFontSize != null">label_font_size,</if>
<if test="labelColor != null">label_color,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="routeId != null">#{routeId},</if>
@ -68,6 +78,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="speed != null">#{speed},</if>
<if test="startTime != null and startTime != ''">#{startTime},</if>
<if test="turnAngle != null">#{turnAngle},</if>
<if test="pointType != null and pointType != ''">#{pointType},</if>
<if test="holdParams != null">#{holdParams},</if>
<if test="labelFontSize != null">#{labelFontSize},</if>
<if test="labelColor != null">#{labelColor},</if>
</trim>
</insert>
@ -83,6 +97,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="speed != null">speed = #{speed},</if>
<if test="startTime != null and startTime != ''">start_time = #{startTime},</if>
<if test="turnAngle != null">turn_angle = #{turnAngle},</if>
<if test="pointType != null">point_type = #{pointType},</if>
<if test="holdParams != null">hold_params = #{holdParams},</if>
<if test="labelFontSize != null">label_font_size = #{labelFontSize},</if>
<if test="labelColor != null">label_color = #{labelColor},</if>
</trim>
where id = #{id}
</update>

2
ruoyi-ui/.env.development

@ -8,7 +8,7 @@ ENV = 'development'
VUE_APP_BASE_API = '/dev-api'
# 访问地址(绕过 /dev-api 代理,用于解决静态资源/图片访问 401 认证问题)
VUE_APP_BACKEND_URL = 'http://localhost:8080'
VUE_APP_BACKEND_URL = 'http://127.0.0.1:8080'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

36
ruoyi-ui/src/api/system/roomPlatformIcon.js

@ -0,0 +1,36 @@
import request from '@/utils/request'
/** 按房间ID查询该房间下所有地图平台图标 */
export function listByRoomId(roomId) {
return request({
url: '/system/roomPlatformIcon/list',
method: 'get',
params: { roomId }
})
}
/** 新增房间地图平台图标 */
export function addRoomPlatformIcon(data) {
return request({
url: '/system/roomPlatformIcon',
method: 'post',
data
})
}
/** 修改房间地图平台图标(位置/朝向/缩放) */
export function updateRoomPlatformIcon(data) {
return request({
url: '/system/roomPlatformIcon',
method: 'put',
data
})
}
/** 删除房间地图平台图标 */
export function delRoomPlatformIcon(id) {
return request({
url: '/system/roomPlatformIcon/' + id,
method: 'delete'
})
}

1
ruoyi-ui/src/assets/icons/svg/screenshot.svg

@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1770597640836" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4973" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M835.3 250.9v522.3H188.7V250.9h646.6m49.8-49.8H138.9v621.8H885V201.1h0.1z" p-id="4974"></path><path d="M138.9 101.6v99.5H64.3v49.8H188.7V101.6zM885.1 922.4v-99.5h74.6v-49.8H835.3v149.3zM511 705.4H297.5c-7.8 0-20.4-2.9-23.3-7.8-2.9-4.9 1.9-16.5 5.8-23.3 26.2-39.8 53.4-79.6 79.6-119.4 8.7-12.6 17.5-13.6 31.1-7.8 44.6 21.4 90.3 42.7 135.9 64.1 12.6 5.8 28.1 1.9 35.9-9.7 24.3-37.9 49.5-74.7 75.7-111.6 4.9-6.8 13.6-17.5 20.4-17.5 7.8 0 13.6 12.6 16.5 20.4 24.3 60.2 47.6 121.3 70.9 181.5 9.7 25.2 5.8 31.1-23.3 31.1H511z m-78.6-298c0 29.1-25.2 52.4-54.4 51.4-29.1-1-51.4-23.3-51.4-51.4 0-29.1 24.3-52.4 54.4-51.4 27.1 0.9 51.4 24.2 51.4 51.4z" p-id="4975"></path></svg>

After

Width:  |  Height:  |  Size: 1001 B

1
ruoyi-ui/src/lang/en.js

@ -77,6 +77,7 @@ export default {
},
info: {
roomCode: 'Room Code',
roomName: 'Room Name',
onlineCount: 'Online Count',
combatTime: 'Combat Time',
astroTime: 'Astro Time',

1
ruoyi-ui/src/lang/zh.js

@ -77,6 +77,7 @@ export default {
},
info: {
roomCode: '房间编号',
roomName: '房间名称',
onlineCount: '在线人数',
combatTime: '作战时间',
astroTime: '天文时间',

31
ruoyi-ui/src/permission.js

@ -28,20 +28,37 @@ router.beforeEach((to, from, next) => {
} else {
if (store.getters.roles.length === 0) {
isRelogin.show = true
// 超时保护:若 getInfo/getRouters 长时间不返回则关闭加载条并提示,避免页面一直白屏
const timeoutMs = 15000
const timeoutId = setTimeout(() => {
if (store.getters.roles.length === 0) {
isRelogin.show = false
NProgress.done()
Message.error('获取用户信息超时,请确认后端服务已启动(默认 8080 端口)')
store.dispatch('LogOut').then(() => {
next(`/login?redirect=${encodeURIComponent(to.fullPath)}`)
})
}
}, timeoutMs)
const clearTimeoutAndNext = () => {
clearTimeout(timeoutId)
}
// 判断当前用户是否已拉取完user_info信息
store.dispatch('GetInfo').then(() => {
clearTimeoutAndNext()
isRelogin.show = false
store.dispatch('GenerateRoutes').then(accessRoutes => {
// 根据roles权限生成可访问的路由表
router.addRoutes(accessRoutes) // 动态添加可访问路由表
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
router.addRoutes(accessRoutes)
next({ ...to, replace: true })
})
}).catch(err => {
store.dispatch('LogOut').then(() => {
Message.error(err)
next({ path: '/' })
})
clearTimeoutAndNext()
isRelogin.show = false
store.dispatch('LogOut').then(() => {
Message.error(err || '获取用户信息失败')
next({ path: '/' })
})
})
} else {
next()
}

2
ruoyi-ui/src/router/index.js

@ -87,7 +87,7 @@ export const constantRoutes = [
{
path: '',
component: Layout,
redirect: 'index',
redirect: '/selectRoom',
children: [
{
path: 'index',

14
ruoyi-ui/src/store/modules/permission.js

@ -52,9 +52,18 @@ const permission = {
}
}
// 确保路由必有 path,避免 [vue-router] "path" is required 报错(后端菜单 path 为空时)
function ensureRoutePath(route, fallback) {
const id = route.menuId || route.id || route.name || ('menu-' + Math.random().toString(36).slice(2, 9))
if (route.path === undefined || route.path === null || (typeof route.path === 'string' && route.path.trim() === '')) {
route.path = fallback || ('/hidden-' + id)
}
}
// 遍历后台传来的路由字符串,转换为组件对象
function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
return asyncRouterMap.filter(route => {
ensureRoutePath(route)
if (type && route.children) {
route.children = filterChildren(route.children)
}
@ -82,8 +91,9 @@ function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) {
function filterChildren(childrenMap, lastRouter = false) {
var children = []
childrenMap.forEach(el => {
el.path = lastRouter ? lastRouter.path + '/' + el.path : el.path
childrenMap.forEach((el, idx) => {
ensureRoutePath(el, 'item-' + idx)
el.path = lastRouter ? (lastRouter.path + '/' + el.path).replace(/\/+/g, '/') : el.path
if (el.children && el.children.length && el.component === 'ParentView') {
children = children.concat(filterChildren(el.children, el))
} else {

45
ruoyi-ui/src/views/cesiumMap/ContextMenu.vue

@ -1,12 +1,21 @@
<template>
<div class="context-menu" v-if="visible" :style="positionStyle">
<div class="menu-section">
<div class="menu-section" v-if="!entityData || entityData.type !== 'routePlatform'">
<div class="menu-item" @click="handleDelete">
<span class="menu-icon">🗑</span>
<span>删除</span>
</div>
</div>
<!-- 航线上飞机显示/隐藏标牌 -->
<div class="menu-section" v-if="entityData && entityData.type === 'routePlatform'">
<div class="menu-title">飞机标牌</div>
<div class="menu-item" @click="handleToggleRouteLabel">
<span class="menu-icon">🏷</span>
<span>{{ entityData.labelVisible ? '隐藏标牌' : '显示标牌' }}</span>
</div>
</div>
<!-- 线段特有选项 -->
<div class="menu-section" v-if="entityData.type === 'line' && !entityData.routeId">
<div class="menu-title">线段属性</div>
@ -272,6 +281,24 @@
</div>
</div>
</div>
<!-- 平台图标拖拽到地图的图标特有选项 -->
<div class="menu-section" v-if="entityData.type === 'platformIcon'">
<div class="menu-title">平台图标</div>
<div class="menu-item" @click.stop="handleShowTransformBox">
<span class="menu-icon">📐</span>
<span>显示伸缩框</span>
</div>
<div class="menu-item" @click="handleEditPlatformPosition">
<span class="menu-icon">📍</span>
<span>修改位置</span>
</div>
<div class="menu-item" @click="handleEditPlatformHeading">
<span class="menu-icon">🧭</span>
<span>修改朝向</span>
<span class="menu-value">{{ entityData.heading != null ? entityData.heading + '°' : '0°' }}</span>
</div>
</div>
</div>
</template>
@ -324,6 +351,22 @@ export default {
this.$emit('delete')
},
handleShowTransformBox() {
this.$emit('show-transform-box')
},
handleEditPlatformPosition() {
this.$emit('edit-platform-position')
},
handleEditPlatformHeading() {
this.$emit('edit-platform-heading')
},
handleToggleRouteLabel() {
this.$emit('toggle-route-label')
},
toggleColorPicker(property) {
if (this.showColorPickerFor === property) {
this.showColorPickerFor = null

1666
ruoyi-ui/src/views/cesiumMap/index.vue

File diff suppressed because it is too large

58
ruoyi-ui/src/views/childRoom/RightPanel.vue

@ -164,8 +164,10 @@
<div
v-for="platform in airPlatforms"
:key="platform.id"
class="platform-item"
@click="handleOpenPlatformDialog(platform)"
class="platform-item platform-item-draggable"
draggable="true"
@click="handlePlatformItemClick(platform, $event)"
@dragstart="onPlatformDragStart($event, platform)"
>
<div class="platform-icon" :style="{ color: platform.color }">
<img v-if="isImg(platform.imageUrl)"
@ -195,8 +197,10 @@
<div
v-for="platform in seaPlatforms"
:key="platform.id"
class="platform-item"
@click="handleOpenPlatformDialog(platform)"
class="platform-item platform-item-draggable"
draggable="true"
@click="handlePlatformItemClick(platform, $event)"
@dragstart="onPlatformDragStart($event, platform)"
>
<div class="platform-icon" :style="{ color: platform.color }">
<img v-if="isImg(platform.imageUrl)"
@ -221,8 +225,10 @@
<div
v-for="platform in groundPlatforms"
:key="platform.id"
class="platform-item"
@click="handleOpenPlatformDialog(platform)"
class="platform-item platform-item-draggable"
draggable="true"
@click="handlePlatformItemClick(platform, $event)"
@dragstart="onPlatformDragStart($event, platform)"
>
<div class="platform-icon" :style="{ color: platform.color }">
<img v-if="isImg(platform.imageUrl)"
@ -313,7 +319,8 @@ export default {
return {
activePlatformTab: 'air',
expandedPlans: [], //
expandedRoutes: [] // 线
expandedRoutes: [], // 线
platformJustDragged: false //
}
},
watch: {
@ -504,6 +511,35 @@ export default {
handleOpenPlatformDialog(platform) {
this.$emit('open-platform-dialog', platform)
},
/** 平台项点击:若刚拖拽过则不打开弹窗,避免误触 */
handlePlatformItemClick(platform, ev) {
if (this.platformJustDragged) {
this.platformJustDragged = false
return
}
this.handleOpenPlatformDialog(platform)
},
/** 拖拽平台图标到地图时传递平台数据 */
onPlatformDragStart(ev, platform) {
this.platformJustDragged = true
setTimeout(() => { this.platformJustDragged = false }, 300)
try {
ev.dataTransfer.setData('application/json', JSON.stringify({
id: platform.id,
name: platform.name,
type: platform.type,
imageUrl: platform.imageUrl,
iconUrl: platform.iconUrl,
icon: platform.icon,
color: platform.color
}))
ev.dataTransfer.effectAllowed = 'copy'
} catch (e) {
console.warn('Platform drag start failed', e)
}
}
}
}
@ -829,6 +865,14 @@ export default {
box-shadow: 0 2px 8px rgba(0, 138, 255, 0.15);
}
.platform-item-draggable {
cursor: grab;
}
.platform-item-draggable:active {
cursor: grabbing;
}
.platform-icon {
width: 40px;
height: 40px;

25
ruoyi-ui/src/views/childRoom/TopHeader.vue

@ -217,11 +217,14 @@
<div class="header-right">
<!-- 作战信息区域 -->
<div class="combat-info-group">
<div class="info-box">
<div
class="info-box room-name-box clickable"
@click="handleBackToSelectRoom"
>
<i class="el-icon-office-building info-icon"></i>
<div class="info-content">
<div class="info-label">{{ $t('topHeader.info.roomCode') }}</div>
<div class="info-value">{{ roomCode }}</div>
<div class="info-label">{{ $t('topHeader.info.roomName') }}</div>
<div class="info-value">{{ roomDisplayName }}</div>
</div>
</div>
@ -363,6 +366,11 @@ export default {
}
},
computed: {
/** 显示数据库房间名,无则回退为房间编号 */
roomDisplayName() {
if (this.roomDetail && this.roomDetail.name) return this.roomDetail.name;
return this.roomCode;
},
topNavItems() {
return [
{ id: 'file', name: this.$t('topHeader.nav.file'), icon: 'el-icon-document' },
@ -387,6 +395,17 @@ export default {
}
},
methods: {
/** 点击房间名称:弹窗确认是否回到选择房间页面 */
handleBackToSelectRoom() {
this.$confirm('是否返回选择房间页面?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'info'
}).then(() => {
this.$router.push({ path: '/selectRoom' }).catch(() => {})
}).catch(() => {})
},
selectTopNav(item) {
this.$emit('select-nav', item)
},

719
ruoyi-ui/src/views/childRoom/index.vue

File diff suppressed because it is too large

5
ruoyi-ui/src/views/dialogs/RouteEditDialog.vue

@ -221,13 +221,14 @@ export default {
id: '',
name: ''
},
// 线线线3 attributes 退
defaultStyle: {
waypoint: { pixelSize: 7, color: '#ffffff', outlineColor: '#0078FF', outlineWidth: 2 },
line: { style: 'dash', width: 4, color: '#ffffff', gapColor: '#000000', dashLength: 20 }
line: { style: 'solid', width: 3, color: '#800080', gapColor: '#000000', dashLength: 20 }
},
styleForm: {
waypoint: { pixelSize: 7, color: '#ffffff', outlineColor: '#0078FF', outlineWidth: 2 },
line: { style: 'dash', width: 4, color: '#ffffff', gapColor: '#000000', dashLength: 20 }
line: { style: 'solid', width: 3, color: '#800080', gapColor: '#000000', dashLength: 20 }
},
presetColors: [
'#ffffff', '#000000', '#0078FF', '#409EFF', '#67C23A', '#E6A23C', '#F56C6C',

113
ruoyi-ui/src/views/dialogs/WaypointEditDialog.vue

@ -14,6 +14,22 @@
<el-input v-model="formData.name" placeholder="请输入航点名称"></el-input>
</el-form-item>
<el-form-item label="地图文字大小" prop="labelFontSize">
<el-input-number
v-model="formData.labelFontSize"
:min="10"
:max="28"
controls-position="right"
placeholder="字号(px)"
style="width: 100%;"
/>
<div class="form-tip">航点名称在地图上的显示字号微软雅黑字体</div>
</el-form-item>
<el-form-item label="地图文字颜色" prop="labelColor">
<el-color-picker v-model="formData.labelColor" size="small" />
<span class="color-value">{{ formData.labelColor }}</span>
</el-form-item>
<el-form-item label="高度" prop="alt">
<el-input-number
v-model="formData.alt"
@ -34,7 +50,7 @@
></el-input-number>
</el-form-item>
<el-form-item label="转弯坡度" prop="turnAngle">
<el-form-item v-if="!isHoldWaypoint" label="转弯坡度" prop="turnAngle">
<el-input-number
v-model="formData.turnAngle"
controls-position="right"
@ -46,6 +62,34 @@
首尾航点坡度已锁定为 0不可编辑
</div>
</el-form-item>
<template v-if="isHoldWaypoint">
<el-form-item label="盘旋类型">
<el-radio-group v-model="formData.pointType">
<el-radio label="hold_circle">圆形</el-radio>
<el-radio label="hold_ellipse">椭圆</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item v-if="formData.pointType === 'hold_circle'" label="半径(米)">
<el-input-number v-model="formData.holdRadius" :min="100" :max="50000" style="width:100%" />
</el-form-item>
<template v-if="formData.pointType === 'hold_ellipse'">
<el-form-item label="长半轴(米)">
<el-input-number v-model="formData.holdSemiMajor" :min="100" :max="50000" style="width:100%" />
</el-form-item>
<el-form-item label="短半轴(米)">
<el-input-number v-model="formData.holdSemiMinor" :min="50" :max="50000" style="width:100%" />
</el-form-item>
<el-form-item label="长轴方位(度)">
<el-input-number v-model="formData.holdHeadingDeg" :min="-180" :max="180" style="width:100%" />
</el-form-item>
</template>
<el-form-item label="盘旋方向">
<el-radio-group v-model="formData.holdClockwise">
<el-radio :label="true">顺时针</el-radio>
<el-radio :label="false">逆时针</el-radio>
</el-radio-group>
</el-form-item>
</template>
<el-form-item label="相对 K 时(分钟)" prop="minutesFromK">
<el-input-number
@ -103,7 +147,15 @@ export default {
minutesFromK: 0,
currentIndex: -1,
totalPoints: 0,
isBankDisabled: false
isBankDisabled: false,
pointType: 'normal',
holdRadius: 500,
holdSemiMajor: 500,
holdSemiMinor: 300,
holdHeadingDeg: 0,
holdClockwise: true,
labelFontSize: 14,
labelColor: '#333333'
},
rules: {
name: [
@ -124,6 +176,12 @@ export default {
}
};
},
computed: {
isHoldWaypoint() {
const t = (this.waypoint && (this.waypoint.pointType || this.waypoint.point_type)) || (this.formData && this.formData.pointType) || 'normal';
return t === 'hold_circle' || t === 'hold_ellipse';
}
},
watch: {
value(newVal) {
if (newVal && this.waypoint) {
@ -142,6 +200,21 @@ export default {
const total = this.waypoint.totalPoints || 0;
const locked = (index === 0) || (total > 0 && index === total - 1);
const pt = (this.waypoint.pointType || this.waypoint.point_type) || 'normal';
let holdRadius = 500, holdSemiMajor = 500, holdSemiMinor = 300, holdHeadingDeg = 0, holdClockwise = true;
try {
const raw = this.waypoint.holdParams || this.waypoint.hold_params;
if (raw) {
const p = typeof raw === 'string' ? JSON.parse(raw) : raw;
holdRadius = p.radius != null ? p.radius : 500;
holdSemiMajor = p.semiMajor ?? p.semiMajorAxis ?? 500;
holdSemiMinor = p.semiMinor ?? p.semiMinorAxis ?? 300;
holdHeadingDeg = p.headingDeg ?? 0;
holdClockwise = p.clockwise !== false;
}
} catch (e) {}
const labelFontSize = this.waypoint.labelFontSize != null ? Number(this.waypoint.labelFontSize) : 14;
const labelColor = this.waypoint.labelColor || '#333333';
this.formData = {
name: this.waypoint.name || '',
alt: this.waypoint.alt !== undefined && this.waypoint.alt !== null ? Number(this.waypoint.alt) : 0,
@ -150,7 +223,15 @@ export default {
currentIndex: index,
totalPoints: total,
isBankDisabled: locked,
turnAngle: locked ? 0 : (Number(this.waypoint.turnAngle) || 0)
turnAngle: locked ? 0 : (Number(this.waypoint.turnAngle) || 0),
pointType: pt,
holdRadius,
holdSemiMajor,
holdSemiMinor,
holdHeadingDeg,
holdClockwise,
labelFontSize: Math.min(28, Math.max(10, labelFontSize)),
labelColor
};
this.$nextTick(() => {
@ -167,11 +248,25 @@ export default {
if (valid) {
const { minutesFromK, ...rest } = this.formData;
const startTimeStr = this.minutesToStartTime(minutesFromK);
this.$emit('save', {
const payload = {
...this.waypoint,
...rest,
startTime: startTimeStr
});
startTime: startTimeStr,
labelFontSize: this.formData.labelFontSize,
labelColor: this.formData.labelColor
};
if (this.formData.pointType && this.formData.pointType !== 'normal') {
payload.pointType = this.formData.pointType;
payload.holdParams = this.formData.pointType === 'hold_circle'
? JSON.stringify({ radius: this.formData.holdRadius, clockwise: this.formData.holdClockwise })
: JSON.stringify({
semiMajor: this.formData.holdSemiMajor,
semiMinor: this.formData.holdSemiMinor,
headingDeg: this.formData.holdHeadingDeg,
clockwise: this.formData.holdClockwise
});
}
this.$emit('save', payload);
this.closeDialog();
}
});
@ -295,4 +390,10 @@ export default {
margin-top: 4px;
line-height: 1.4;
}
.color-value {
margin-left: 8px;
font-size: 12px;
color: #606266;
}
</style>

7
ruoyi-ui/src/views/login.vue

@ -154,9 +154,9 @@
v-model="form.role"
class="form-select"
>
<option value="user">普通用户</option>
<option value="manager">管理员</option>
<option value="host">主持人</option>
<option value="admin">管理员</option>
<option value="user">普通用户</option>
</select>
</div>
@ -252,7 +252,8 @@ export default {
// 2.
const roleMap = {
'admin': '1',
'manager': '1',
'admin':'1',
'host': '2',
'user': '3'
};

34
ruoyi-ui/src/views/selectRoom/index.vue

@ -5,6 +5,9 @@
<div class="main-content">
<div class="room-panel">
<div class="panel-header">
<a href="javascript:;" class="back-login" @click="backToLogin">
<i class="el-icon-back"></i> 返回登录
</a>
<h2>房间选择</h2>
<p>选择或创建您要加入的协作房间</p>
</div>
@ -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 {

2
ruoyi-ui/vue.config.js

@ -15,7 +15,7 @@ const CompressionPlugin = require('compression-webpack-plugin')
const CopyWebpackPlugin = require('copy-webpack-plugin')
const name = process.env.VUE_APP_TITLE || '若依管理系统' // 网页标题
const baseUrl = 'http://localhost:8080' // 后端接口
const baseUrl = 'http://127.0.0.1:8080' // 后端接口
const port = process.env.port || process.env.npm_config_port || 80 // 端口
// 定义 Cesium 源码路径

Loading…
Cancel
Save