Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
bc3c65fa68
@ -339,4 +339,12 @@ public class StringUtils extends org.apache.commons.lang3.StringUtils {
|
||||
return c;
|
||||
}
|
||||
|
||||
public static boolean isAllEnglishLetters(String str) {
|
||||
if (str == null || str.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
// 正则表达式 [a-zA-Z] 匹配英文字母
|
||||
return str.matches("[a-zA-Z]+");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ import com.das.common.config.SessionUtil;
|
||||
import com.das.common.constant.SysAuthorityIds;
|
||||
import com.das.common.result.R;
|
||||
import com.das.common.utils.PageDataInfo;
|
||||
import com.das.common.utils.StringUtils;
|
||||
import com.das.modules.auth.domain.dto.DeleteDto;
|
||||
import com.das.modules.auth.domain.dto.SysMenuDto;
|
||||
import com.das.modules.auth.domain.dto.SysMenuQueryDto;
|
||||
@ -35,12 +36,14 @@ public class SysMenusController {
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public R<?> createMenu(@RequestBody SysMenuDto sysMenuDto) {
|
||||
|
||||
//判断是否有权限
|
||||
boolean hasPermission = StpUtil.hasPermission(SysAuthorityIds.SYS_AUTHORITY_ID_ADMIN.toString());
|
||||
if(!hasPermission){
|
||||
return R.fail("没有系统管理权限");
|
||||
}
|
||||
if (StringUtils.isAllEnglishLetters(sysMenuDto.getMenuName())){
|
||||
return R.fail("菜单名称,必须为英文");
|
||||
}
|
||||
return R.success(sysMenuService.createMenu(sysMenuDto));
|
||||
}
|
||||
|
||||
@ -55,7 +58,9 @@ public class SysMenusController {
|
||||
if(!hasPermission){
|
||||
return R.fail("没有系统管理权限");
|
||||
}
|
||||
|
||||
if (StringUtils.isAllEnglishLetters(sysMenuDto.getMenuName())){
|
||||
return R.fail("菜单名称,必须为英文");
|
||||
}
|
||||
sysMenuService.updateMenu(sysMenuDto);
|
||||
return R.success();
|
||||
}
|
||||
|
@ -14,6 +14,8 @@ public class SysMenuDto implements Serializable {
|
||||
private Long id ;
|
||||
/** 菜单名称 */
|
||||
private String menuName ;
|
||||
/** 菜单名称中文描述 */
|
||||
private String menuDesc ;
|
||||
/** 菜单排列顺序 */
|
||||
private Integer menuOrder ;
|
||||
/** 菜单图标名称 */
|
||||
|
@ -12,8 +12,11 @@ public class SysMenuQueryDto implements Serializable {
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id ;
|
||||
|
||||
/** 菜单名称 */
|
||||
/** 菜单英文名称 */
|
||||
private String menuName ;
|
||||
/** 菜单中文名称 */
|
||||
private String menuDesc ;
|
||||
|
||||
/** 上级菜单ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long parentMenuId ;
|
||||
|
@ -19,6 +19,8 @@ public class SysMenuVo implements Serializable {
|
||||
private Long id ;
|
||||
/** 菜单名称 */
|
||||
private String menuName ;
|
||||
/** 菜单中文名称 */
|
||||
private String menuDesc ;
|
||||
/** 菜单排列顺序 */
|
||||
private Integer menuOrder ;
|
||||
/** 菜单图标名称 */
|
||||
|
@ -40,6 +40,10 @@ public class SysMenu extends BaseEntity {
|
||||
@TableField("menu_name")
|
||||
private String menuName ;
|
||||
|
||||
/** 菜单名称,中文描述 */
|
||||
@TableField("menu_desc")
|
||||
private String menuDesc ;
|
||||
|
||||
/** 菜单排列顺序 */
|
||||
@TableField("menu_order")
|
||||
private Integer menuOrder ;
|
||||
|
@ -95,4 +95,16 @@ public class SysEquipmentDto {
|
||||
* 当前页数
|
||||
*/
|
||||
private Integer pageNum;
|
||||
|
||||
/**
|
||||
* 所属线路
|
||||
*/
|
||||
private String belongLine;
|
||||
|
||||
/**
|
||||
* 是否为标杆机组
|
||||
*/
|
||||
private Integer standard;
|
||||
|
||||
|
||||
}
|
||||
|
@ -102,4 +102,15 @@ public class SysEquipmentVo{
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private List<SysEquipment> equipChildren;
|
||||
|
||||
/**
|
||||
* 所属线路
|
||||
*/
|
||||
private String belongLine;
|
||||
|
||||
/**
|
||||
* 是否为标杆机组
|
||||
*/
|
||||
private Integer standard;
|
||||
|
||||
}
|
||||
|
@ -119,4 +119,16 @@ public class SysEquipment extends BaseEntity {
|
||||
@TableField(value = "iot_model_id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long iotModelId;
|
||||
|
||||
/**
|
||||
* 所属线路
|
||||
*/
|
||||
@TableField(value = "belong_line")
|
||||
private String belongLine;
|
||||
|
||||
/**
|
||||
* 是否为标杆机组
|
||||
*/
|
||||
@TableField(value = "standard")
|
||||
private Integer standard;
|
||||
}
|
||||
|
@ -17,6 +17,8 @@
|
||||
<result property="latitude" column="latitude" jdbcType="DOUBLE"/>
|
||||
<result property="longitude" column="longitude" jdbcType="DOUBLE"/>
|
||||
<result property="iotModelId" column="iot_model_id" jdbcType="BIGINT"/>
|
||||
<result property="belongLine" column="belong_line" jdbcType="VARCHAR"/>
|
||||
<result property="standard" column="standard" jdbcType="INTEGER"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="com.das.modules.equipment.domain.vo.SysEquipmentVo" id="SysEquipmentListMap">
|
||||
|
@ -5,6 +5,7 @@
|
||||
<resultMap type="com.das.modules.auth.entity.SysMenu" id="SysMenuMap">
|
||||
<result property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="menuName" column="menu_name" jdbcType="VARCHAR"/>
|
||||
<result property="menuDesc" column="menu_desc" jdbcType="VARCHAR"/>
|
||||
<result property="menuOrder" column="menu_order" jdbcType="INTEGER"/>
|
||||
<result property="menuIcon" column="menu_icon" jdbcType="VARCHAR"/>
|
||||
<result property="funType" column="fun_type" jdbcType="INTEGER"/>
|
||||
@ -22,6 +23,7 @@
|
||||
<resultMap id="SysMenuChildMap" type="com.das.modules.auth.domain.vo.SysMenuVo">
|
||||
<result property="id" column="id" jdbcType="BIGINT"/>
|
||||
<result property="menuName" column="menu_name" jdbcType="VARCHAR"/>
|
||||
<result property="menuDesc" column="menu_desc" jdbcType="VARCHAR"/>
|
||||
<result property="menuOrder" column="menu_order" jdbcType="INTEGER"/>
|
||||
<result property="menuIcon" column="menu_icon" jdbcType="VARCHAR"/>
|
||||
<result property="funType" column="fun_type" jdbcType="INTEGER"/>
|
||||
@ -48,6 +50,9 @@
|
||||
<if test="sysMenu.menuName != null and sysMenu.menuName != ''">
|
||||
and menu_name like concat('%',#{sysMenu.menuName},'%')
|
||||
</if>
|
||||
<if test="sysMenu.menuDesc != null and sysMenu.menuDesc != ''">
|
||||
and menu_desc like concat('%',#{sysMenu.menuDesc},'%')
|
||||
</if>
|
||||
</where>
|
||||
order by menu_order
|
||||
</select>
|
||||
|
@ -147,12 +147,12 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属线路:">
|
||||
<el-input placeholder="请输入所属线路" v-model="editDeviceData.belongingLine" style="width: 200px" />
|
||||
<el-input placeholder="请输入所属线路" v-model="editDeviceData.belongLine" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="标杆机组:">
|
||||
<el-switch v-model="editDeviceData.isbenchMarkUnit" />
|
||||
<el-switch @change="edithandleSwitchChange" :active-value="1" :inactive-value="0" v-model="editDeviceData.standard" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -302,12 +302,17 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="所属线路:">
|
||||
<el-input placeholder="请输入所属线路" v-model="editAddDeviceData.belongingLine" style="width: 200px" />
|
||||
<el-input placeholder="请输入所属线路" v-model="editAddDeviceData.belongLine" style="width: 200px" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="标杆机组:">
|
||||
<el-switch v-model="editAddDeviceData.isbenchMarkUnit" />
|
||||
<el-switch
|
||||
@change="addhandleSwitchChange"
|
||||
:active-value="1"
|
||||
:inactive-value="0"
|
||||
v-model="editAddDeviceData.standard"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -536,6 +541,7 @@ const handleNodeClick = (data: any) => {
|
||||
formQuery.objectType = data.equipmentTypeId
|
||||
equipQuery(formQuery).then((res) => {
|
||||
deviceList.value = res.rows
|
||||
|
||||
pageTotal.value = res.total
|
||||
})
|
||||
equipModeList({
|
||||
@ -626,8 +632,8 @@ const addDeviceList = () => {
|
||||
editAddDeviceData.orgId = ''
|
||||
editAddDeviceData.parentEquipmentId = ''
|
||||
editAddDeviceData.iotModelId = ''
|
||||
editAddDeviceData.belongingLine = ''
|
||||
editAddDeviceData.isbenchMarkUnit = false
|
||||
editAddDeviceData.belongLine = ''
|
||||
editAddDeviceData.standard = 0
|
||||
}
|
||||
|
||||
// 查看设备详情
|
||||
@ -648,8 +654,8 @@ const editDeviceData = reactive({
|
||||
parentEquipmentId: '',
|
||||
iotModelId: '',
|
||||
id: '',
|
||||
belongingLine: '',
|
||||
isbenchMarkUnit: false,
|
||||
belongLine: '',
|
||||
standard: 0,
|
||||
})
|
||||
|
||||
const size = ref<'default' | 'large' | 'small'>('default')
|
||||
@ -677,8 +683,8 @@ const viewDeviceDetails = (data: any) => {
|
||||
editDeviceData.orgId = data.row.orgId
|
||||
editDeviceData.parentEquipmentId = data.row.parentEquipmentId
|
||||
editDeviceData.iotModelId = data.row.iotModelId
|
||||
editDeviceData.belongingLine = data.row.belongingLine
|
||||
editDeviceData.isbenchMarkUnit = data.row.isbenchMarkUnit
|
||||
editDeviceData.belongLine = data.row.belongLine
|
||||
editDeviceData.standard = data.row.standard || 0
|
||||
}
|
||||
|
||||
// 设备删除
|
||||
@ -798,9 +804,15 @@ const editAddDeviceData = reactive({
|
||||
orgId: '',
|
||||
parentEquipmentId: '',
|
||||
iotModelId: '',
|
||||
belongingLine: '',
|
||||
isbenchMarkUnit: false,
|
||||
belongLine: '',
|
||||
standard: 0,
|
||||
})
|
||||
const addhandleSwitchChange = (value: any) => {
|
||||
editAddDeviceData.standard = value ? 1 : 0
|
||||
}
|
||||
const edithandleSwitchChange = (value: any) => {
|
||||
editDeviceData.standard = value ? 1 : 0
|
||||
}
|
||||
|
||||
// 设备新增字段校验
|
||||
const editAddDeviceRules = reactive({
|
||||
@ -832,7 +844,6 @@ const saveAddData = () => {
|
||||
editAddDeviceData.objectType = ele.equipmentTypeId
|
||||
}
|
||||
})
|
||||
|
||||
equipAdd(editAddDeviceData).then((res) => {
|
||||
if (res.code == 200) {
|
||||
ElMessage({
|
||||
|
Loading…
Reference in New Issue
Block a user