Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
205ee8b56f
@ -55,9 +55,6 @@ public class SysMenusController {
|
||||
if(!hasPermission){
|
||||
return R.fail("没有系统管理权限");
|
||||
}
|
||||
if (StringUtils.isAllEnglishLetters(sysMenuDto.getMenuName())){
|
||||
return R.fail("菜单名称,必须为英文");
|
||||
}
|
||||
sysMenuService.updateMenu(sysMenuDto);
|
||||
return R.success();
|
||||
}
|
||||
|
@ -62,6 +62,23 @@ public class SysEnumController {
|
||||
}
|
||||
|
||||
|
||||
/** 更新枚举值 */
|
||||
@PostMapping("/updateEnumValues")
|
||||
public R<SysEnumValuesVo> updateEnumValues(@RequestBody SysEnumValuesDto sysEnumValuesDto) {
|
||||
//判断是否有权限
|
||||
boolean hasPermission = StpUtil.hasPermission(SysAuthorityIds.SYS_AUTHORITY_ID_DEVICE_MGR.toString());
|
||||
if(!hasPermission){
|
||||
return R.fail("没有设备管理权限");
|
||||
}
|
||||
if (sysEnumValuesDto.getEnumTypeId() ==null && StringUtils.isBlank(sysEnumValuesDto.getValue())
|
||||
|| sysEnumValuesDto.getOrderNumber() == null || sysEnumValuesDto.getIsActive() ==null ||
|
||||
sysEnumValuesDto.getId() ==null) {
|
||||
throw new ServiceException("参数缺失");
|
||||
}
|
||||
SysEnumValuesVo sysEnumValuesVo = sysEnumService.updateEnumValues(sysEnumValuesDto);
|
||||
return R.success(sysEnumValuesVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询枚举类型列表
|
||||
*
|
||||
|
@ -1,9 +1,13 @@
|
||||
package com.das.modules.equipment.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.das.modules.equipment.domain.dto.SysEnumTypesDto;
|
||||
import com.das.modules.equipment.entity.SysEnumTypes;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface SysEnumTypesMapper extends BaseMapper<SysEnumTypes> {
|
||||
|
||||
Long queryEnumTypesByName(@Param("sysDto") SysEnumTypesDto sysDto);
|
||||
}
|
||||
|
@ -14,6 +14,8 @@ public interface SysEnumService {
|
||||
|
||||
SysEnumValuesVo addEnumValues(SysEnumValuesDto sysEnumValuesDto);
|
||||
|
||||
SysEnumValuesVo updateEnumValues(SysEnumValuesDto sysEnumValuesDto);
|
||||
|
||||
List<SysEnumTypesVo> queryEnumTypesList();
|
||||
|
||||
PageDataInfo<SysEnumValuesVo> queryEnumValuesList(SysEnumValuesDto sysEnumValuesDto);
|
||||
|
@ -1,8 +1,10 @@
|
||||
package com.das.modules.equipment.service.impl;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.das.common.config.SessionUtil;
|
||||
import com.das.common.exceptions.ServiceException;
|
||||
import com.das.common.utils.BeanCopyUtils;
|
||||
import com.das.common.utils.PageDataInfo;
|
||||
import com.das.common.utils.PageQuery;
|
||||
@ -35,13 +37,18 @@ public class SysEnumServiceImpl implements SysEnumService {
|
||||
/** 新增枚举类型 */
|
||||
@Override
|
||||
public SysEnumTypesVo addEnumTypes(SysEnumTypesDto sysEnumTypesDto) {
|
||||
//判断枚举类型,是否重复
|
||||
Long count = sysEnumTypesMapper.queryEnumTypesByName(sysEnumTypesDto);
|
||||
if (count >0){
|
||||
throw new ServiceException("枚举类型,不可重复!");
|
||||
}
|
||||
SysEnumTypes sysEnumTypes = new SysEnumTypes();
|
||||
BeanCopyUtils.copy(sysEnumTypesDto, sysEnumTypes);
|
||||
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
|
||||
sysEnumTypes.setCreatedTime(new Date());
|
||||
sysEnumTypes.setUpdatedTime(new Date());
|
||||
sysEnumTypes.setCreatedBy(sysUserVo.getAccount());
|
||||
sysEnumTypes.setUpdatedBy(sysUserVo.getAccount());
|
||||
sysEnumTypes.setCreatedTime(new Date());
|
||||
sysEnumTypes.setUpdatedTime(new Date());
|
||||
sysEnumTypes.setRevision(1);
|
||||
sysEnumTypesMapper.insert(sysEnumTypes);
|
||||
SysEnumTypesVo sysEnumTypesVo = new SysEnumTypesVo();
|
||||
@ -54,11 +61,18 @@ public class SysEnumServiceImpl implements SysEnumService {
|
||||
public SysEnumValuesVo addEnumValues(SysEnumValuesDto sysEnumValuesDto) {
|
||||
SysEnumValues sysEnumValues = new SysEnumValues();
|
||||
BeanCopyUtils.copy(sysEnumValuesDto,sysEnumValues);
|
||||
QueryWrapper<SysEnumValues> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("enum_type_id",sysEnumValuesDto.getEnumTypeId());
|
||||
queryWrapper.eq("description",sysEnumValuesDto.getDescription());
|
||||
Long count = sysEnumValuesMapper.selectCount(queryWrapper);
|
||||
if (count >0){
|
||||
throw new ServiceException("枚举值描述,不可重复!");
|
||||
}
|
||||
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
|
||||
sysEnumValues.setCreatedTime(new Date());
|
||||
sysEnumValues.setUpdatedTime(new Date());
|
||||
sysEnumValues.setCreatedBy(sysUserVo.getAccount());
|
||||
sysEnumValues.setUpdatedBy(sysUserVo.getAccount());
|
||||
sysEnumValues.setCreatedTime(new Date());
|
||||
sysEnumValues.setUpdatedTime(new Date());
|
||||
sysEnumValues.setRevision(1);
|
||||
sysEnumValuesMapper.insert(sysEnumValues);
|
||||
SysEnumValuesVo sysEnumValuesVo = new SysEnumValuesVo();
|
||||
@ -66,6 +80,26 @@ public class SysEnumServiceImpl implements SysEnumService {
|
||||
return sysEnumValuesVo;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SysEnumValuesVo updateEnumValues(SysEnumValuesDto sysEnumValuesDto) {
|
||||
SysEnumValues sysEnumValues = new SysEnumValues();
|
||||
BeanCopyUtils.copy(sysEnumValuesDto,sysEnumValues);
|
||||
QueryWrapper<SysEnumValues> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("enum_type_id",sysEnumValuesDto.getEnumTypeId());
|
||||
queryWrapper.eq("description",sysEnumValuesDto.getDescription());
|
||||
Long count = sysEnumValuesMapper.selectCount(queryWrapper);
|
||||
if (count >0){
|
||||
throw new ServiceException("枚举值描述,不可重复!");
|
||||
}
|
||||
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
|
||||
sysEnumValues.setUpdatedBy(sysUserVo.getAccount());
|
||||
sysEnumValues.setUpdatedTime(new Date());
|
||||
sysEnumValuesMapper.updateById(sysEnumValues);
|
||||
SysEnumValuesVo sysEnumValuesVo = new SysEnumValuesVo();
|
||||
BeanCopyUtils.copy(sysEnumValues, sysEnumValuesVo);
|
||||
return sysEnumValuesVo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询枚举类型列表
|
||||
* @return
|
||||
|
@ -60,6 +60,8 @@ public class SysEquipmentServiceImpl implements SysEquipmentService {
|
||||
|
||||
@Override
|
||||
public SysEquipmentVo creatSysEquipment(SysEquipmentDto sysEquipmentDto) {
|
||||
//去除空格
|
||||
sysEquipmentDto.setCode(sysEquipmentDto.getCode().replaceAll(" ", ""));
|
||||
SysEquipment sysEquipment = new SysEquipment();
|
||||
BeanCopyUtils.copy(sysEquipmentDto, sysEquipment);
|
||||
|
||||
@ -81,6 +83,8 @@ public class SysEquipmentServiceImpl implements SysEquipmentService {
|
||||
|
||||
@Override
|
||||
public SysEquipmentVo updateSysEquipment(SysEquipmentDto sysEquipmentDto) {
|
||||
//去除空格
|
||||
sysEquipmentDto.setCode(sysEquipmentDto.getCode().replaceAll(" ", ""));
|
||||
SysEquipment sysEquipment = new SysEquipment();
|
||||
BeanCopyUtils.copy(sysEquipmentDto, sysEquipment);
|
||||
SysUserVo sysUserVo = (SysUserVo) StpUtil.getTokenSession().get(SessionUtil.SESSION_USER_KEY);
|
||||
|
19
das/src/main/resources/mapper/SysEnumTypesMapper.xml
Normal file
19
das/src/main/resources/mapper/SysEnumTypesMapper.xml
Normal file
@ -0,0 +1,19 @@
|
||||
<?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.das.modules.equipment.mapper.SysEnumTypesMapper">
|
||||
|
||||
|
||||
|
||||
<select id="queryEnumTypesByName" resultType="long">
|
||||
select
|
||||
count(*)
|
||||
from
|
||||
public.sys_enum_types
|
||||
where
|
||||
"name" = #{sysDto.name}
|
||||
or description = #{sysDto.description}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
@ -22,6 +22,7 @@
|
||||
<if test="sysEnumValuesDto.isActive != null and sysEnumValuesDto.isActive != ''">
|
||||
and e.is_active =#{sysEnumValuesDto.isActive}
|
||||
</if>
|
||||
order by e.order_number asc
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
9
ui/dasadmin/src/api/backend/control/request.ts
Normal file
9
ui/dasadmin/src/api/backend/control/request.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import createAxios from '/@/utils/axios'
|
||||
|
||||
export const sendValueReq = (data: any) => {
|
||||
return createAxios({
|
||||
url: '/api/node/link/deviceControl',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
}
|
@ -70,6 +70,11 @@ const staticRoutes: Array<RouteRecordRaw> = [
|
||||
name: 'univer',
|
||||
component: () => import('/@/views/backend/node/univer.vue'),
|
||||
},
|
||||
{
|
||||
path: adminBaseRoutePath +'/airBlower',
|
||||
name: 'airBlower',
|
||||
component: () => import('/@/views/backend/equipment/airBlower/index.vue'),
|
||||
}
|
||||
]
|
||||
|
||||
const staticFiles: Record<string, Record<string, RouteRecordRaw>> = import.meta.glob('./static/*.ts', { eager: true })
|
||||
|
@ -960,7 +960,7 @@ const downLoadModel = () => {
|
||||
}
|
||||
|
||||
const currentPage = ref(1)
|
||||
const currentPageSize = ref(10)
|
||||
const currentPageSize = ref(20)
|
||||
const pageTotal = ref(0)
|
||||
const pagePagination = ref([10, 20, 30])
|
||||
const getcurrentPage = () => {
|
||||
|
@ -379,9 +379,9 @@ const getInstitutionList = (data: getDataType = { name: null }) => {
|
||||
})
|
||||
}
|
||||
|
||||
const pagePagination = [5, 10, 20, 30]
|
||||
const pagePagination = [ 10, 20, 30]
|
||||
const currentPage = ref(1)
|
||||
const currentPageSize = ref(pagePagination[0])
|
||||
const currentPageSize = ref(pagePagination[1])
|
||||
const pageTotal = ref(0)
|
||||
const originData = ref<getTreeDataReturnType[]>()
|
||||
const tableData = computed(() => {
|
||||
|
@ -203,9 +203,9 @@ const tableData = computed(() => {
|
||||
return originData.value?.slice(start, end)
|
||||
})
|
||||
|
||||
const pagePagination = [5, 10, 20, 30]
|
||||
const pagePagination = [10, 20, 30]
|
||||
const currentPage = ref(1)
|
||||
const currentPageSize = ref(pagePagination[0])
|
||||
const currentPageSize = ref(pagePagination[1])
|
||||
const pageTotal = ref(0)
|
||||
const originData = ref<tableDataType<authorityDataListType>[]>()
|
||||
const addClick = () => {
|
||||
|
@ -546,9 +546,9 @@ const selectUpdataName = (data: string) => {
|
||||
formUserUpData.profilePicture = data
|
||||
}
|
||||
// 分页
|
||||
const pagePagination = [5, 10, 20, 30]
|
||||
const pagePagination = [ 10, 20, 30]
|
||||
const currentPage = ref(1)
|
||||
const currentPageSize = ref(pagePagination[0])
|
||||
const currentPageSize = ref(pagePagination[1])
|
||||
const handleSizeChange = (val: number) => {
|
||||
formQuery.pageSize = val
|
||||
RyUserQuery(formQuery)
|
||||
|
@ -0,0 +1,274 @@
|
||||
<template>
|
||||
<div class="controlPage" v-loading="loading" element-loading-text="提交中...">
|
||||
<h1 class="pageName">设备服务调试</h1>
|
||||
<div class="control">
|
||||
<el-form :model="serviceType147Form" :rules="validData(147)" ref="serviceType147Ref">
|
||||
<el-row>
|
||||
<el-col :span="1" :offset="2">
|
||||
<div class="title">遥控</div>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="1">
|
||||
<div class="center">
|
||||
<el-form-item label="服务名" prop="serviceName">
|
||||
<el-select v-model="serviceType147Form.serviceName" placeholder="请选择服务名">
|
||||
<el-option
|
||||
v-for="item in deviceServiceType147List"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="1">
|
||||
<el-form-item label="设定值" prop="opValue">
|
||||
<el-select v-model="serviceType147Form.opValue" placeholder="请选择设定值">
|
||||
<el-option :value="0"></el-option>
|
||||
<el-option :value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button type="primary" @click="submit(147)">提交</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<br />
|
||||
<el-form :model="serviceType146Form" :rules="validData(146)" ref="serviceType146Ref">
|
||||
<el-row>
|
||||
<el-col :span="1" :offset="2">
|
||||
<div class="title">遥调</div>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="1">
|
||||
<div class="center">
|
||||
<el-form-item label="服务名" prop="serviceName">
|
||||
<el-select v-model="serviceType146Form.serviceName" placeholder="请选择服务名">
|
||||
<el-option
|
||||
v-for="item in deviceServiceType146List"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="6" :offset="1">
|
||||
<el-form-item label="设定值" prop="opValue">
|
||||
<el-input v-model="serviceType146Form.opValue" placeholder="请输入设定值"> </el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="4" :offset="1">
|
||||
<el-button type="primary" @click="submit(146)">提交</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</div>
|
||||
<div style="height: 20px"></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, watch } from 'vue'
|
||||
import { sendValueReq } from '/@/api/backend/control/request'
|
||||
import { ElMessage, FormInstance } from 'element-plus'
|
||||
import { getModelServiceListReq } from '/@/api/backend/deviceModel/request'
|
||||
|
||||
const props = defineProps({
|
||||
iotModelId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
deviceId: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
})
|
||||
|
||||
const loading = ref(false)
|
||||
|
||||
const serviceType147Ref = ref<FormInstance>()
|
||||
const serviceType146Ref = ref<FormInstance>()
|
||||
const serviceType147Form = ref({
|
||||
//节点ID
|
||||
nodeId: '1',
|
||||
//服务名
|
||||
serviceName: '',
|
||||
//操作值
|
||||
opValue: null,
|
||||
})
|
||||
|
||||
const serviceType146Form = ref({
|
||||
//节点ID
|
||||
nodeId: '1',
|
||||
//服务名
|
||||
serviceName: '',
|
||||
//操作值
|
||||
opValue: null,
|
||||
})
|
||||
|
||||
const deviceServiceType147List = ref<any[]>([])
|
||||
const deviceServiceType146List = ref<any[]>([])
|
||||
|
||||
const init = () => {
|
||||
getModelServiceListReq({ iotModelId: props.iotModelId, pageNum: 1, pageSize: 100000 }).then((res) => {
|
||||
const type147: { label: string; value: string }[] = []
|
||||
const type146: { label: string; value: string }[] = []
|
||||
res.rows.forEach((item) => {
|
||||
if (item.serviceType === 147) {
|
||||
type147.push({ label: item.serviceName, value: item.serviceCode })
|
||||
} else if (item.serviceType === 146) {
|
||||
type146.push({ label: item.serviceName, value: item.serviceCode })
|
||||
}
|
||||
})
|
||||
deviceServiceType147List.value = type147
|
||||
deviceServiceType146List.value = type146
|
||||
})
|
||||
}
|
||||
|
||||
const validData = (type: number) => {
|
||||
if (type === 147) {
|
||||
return {
|
||||
serviceName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入服务名',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
opValue: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择操作值',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
}
|
||||
} else if (type === 146) {
|
||||
return {
|
||||
serviceName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入服务名',
|
||||
trigger: 'change',
|
||||
},
|
||||
],
|
||||
opValue: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入操作值',
|
||||
trigger: 'blur',
|
||||
},
|
||||
{
|
||||
pattern: /^[0-9]+$/,
|
||||
message: '请输入数字',
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
}
|
||||
}
|
||||
}
|
||||
const submit = (type: number) => {
|
||||
if (type === 147) {
|
||||
serviceType147Ref.value?.validate((valid) => {
|
||||
if (valid) {
|
||||
loading.value = true
|
||||
sendValue(serviceType147Form.value)
|
||||
}
|
||||
})
|
||||
} else if (type === 146) {
|
||||
serviceType146Ref.value?.validate((valid) => {
|
||||
if (valid) {
|
||||
loading.value = true
|
||||
sendValue(serviceType146Form.value)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
const sendValue = (data: any) => {
|
||||
const val = JSON.parse(JSON.stringify(data))
|
||||
val.deviceId = props.deviceId
|
||||
sendValueReq(val)
|
||||
.then((res) => {
|
||||
console.log(res)
|
||||
ElMessage.success('发送成功!')
|
||||
})
|
||||
.catch((err) => {
|
||||
ElMessage.error('发送失败!')
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
|
||||
watch(
|
||||
() => props.deviceId,
|
||||
() => {
|
||||
if (props.iotModelId) {
|
||||
init()
|
||||
} else {
|
||||
deviceServiceType147List.value = []
|
||||
deviceServiceType146List.value = []
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
)
|
||||
watch(
|
||||
() => props.show,
|
||||
(newVal) => {
|
||||
if (newVal) {
|
||||
serviceType147Form.value = {
|
||||
nodeId: '1',
|
||||
serviceName: '',
|
||||
opValue: null,
|
||||
}
|
||||
serviceType146Form.value = {
|
||||
nodeId: '1',
|
||||
serviceName: '',
|
||||
opValue: null,
|
||||
}
|
||||
serviceType147Ref.value?.resetFields()
|
||||
serviceType146Ref.value?.resetFields()
|
||||
}
|
||||
}
|
||||
)
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.controlPage {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
// justify-content: center;
|
||||
font-size: 18px;
|
||||
.pageName {
|
||||
margin: 20px auto;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
.control {
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
.title {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.el-form-item {
|
||||
margin: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -49,6 +49,8 @@
|
||||
<el-table-column property="model" label="规格型号" />
|
||||
<el-table-column property="address" label="操作">
|
||||
<template #default="scope">
|
||||
<span style="color: #0064aa; cursor: pointer" @click="openControl(scope)">调控 </span>
|
||||
<span style="color: #0064aa"> | </span>
|
||||
<span style="color: #0064aa; cursor: pointer" @click="viewDeviceDetails(scope)">查看 </span>
|
||||
<span style="color: #0064aa"> | </span>
|
||||
<span style="color: #0064aa; cursor: pointer" @click="deviceDeletion(scope)"> 删除 </span>
|
||||
@ -418,6 +420,11 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
</el-container>
|
||||
<el-dialog v-model="showControlPage">
|
||||
<div class="controlSlot">
|
||||
<ControlPage :deviceId="contorlData.deviceId" :iotModelId="contorlData.iotModelId" :show="showControlPage"></ControlPage>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -437,9 +444,9 @@ import {
|
||||
equipDetailsOrg,
|
||||
} from '/@/api/backend'
|
||||
import { ElTable, ElMessage, ElMessageBox } from 'element-plus'
|
||||
import type Node from 'element-plus/es/components/tree/src/model/node'
|
||||
import { useAdminInfo } from '/@/stores/adminInfo'
|
||||
import { encrypt_aes, generateRandomNumber } from '/@/utils/crypto'
|
||||
import ControlPage from './control.vue'
|
||||
|
||||
const adminInfo = useAdminInfo()
|
||||
interface Tree {
|
||||
@ -615,9 +622,9 @@ const deviceTypeQuery = () => {
|
||||
}
|
||||
|
||||
// 分页
|
||||
const pagePagination = [5, 10, 20, 30]
|
||||
const pagePagination = [10, 20, 30]
|
||||
const currentPage = ref(1)
|
||||
const currentPageSize = ref(pagePagination[0])
|
||||
const currentPageSize = ref(pagePagination[1])
|
||||
const handleSizeChange = (val: number) => {
|
||||
formQuery.pageSize = val
|
||||
deviceQuery(formQuery)
|
||||
@ -939,6 +946,21 @@ const Export = () => {
|
||||
document.body.removeChild(a)
|
||||
})
|
||||
}
|
||||
|
||||
const showControlPage = ref(false)
|
||||
const contorlData = reactive({
|
||||
deviceId: '',
|
||||
iotModelId: '',
|
||||
})
|
||||
const openControl = (data: any) => {
|
||||
contorlData.deviceId = data.row.id
|
||||
contorlData.iotModelId = data.row.iotModelId
|
||||
if(contorlData.iotModelId){
|
||||
showControlPage.value = true
|
||||
}else{
|
||||
ElMessage.warning('该设备没有绑定物模型!')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
@ -484,7 +484,7 @@ const submitLinkForm = () => {
|
||||
|
||||
const paginationOptions = reactive({
|
||||
current: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 20,
|
||||
total: 0,
|
||||
pageSizes: [10, 20, 30],
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user