Browse Source

Merge branch 'develop' of https://gitee.com/lmlz_0/dc-ui into develop

pull/1/head
lxg 1 year ago
parent
commit
6bab5e2c97
  1. 89
      src/api/model/alert.js
  2. 24
      src/assets/styles/self-defined.scss
  3. 258
      src/views/model/alert/addalertconfig.vue
  4. 590
      src/views/model/alert/index.vue
  5. 273
      src/views/model/alert/noalertdevices.vue
  6. 297
      src/views/model/alert/noalertparams.vue
  7. 87
      src/views/model/device/index.vue
  8. 1
      src/views/model/devicemodel/index.vue
  9. 71
      src/views/model/params/index.vue
  10. 94
      src/views/transerver/kingcodetransform/index.vue
  11. 4
      src/views/transerver/viewConfig/index.vue

89
src/api/model/alert.js

@ -0,0 +1,89 @@
import request from '@/utils/request'
// 查询设备告警列表
export function listAlert(query) {
return request({
url: '/model/dcBusiAlertDevcie/list',
method: 'get',
params: query
})
}
// 查询设备告警详细
export function getAlert(id) {
return request({
url: '/model/dcBusiAlertDevcie/' + id,
method: 'get'
})
}
// 新增设备告警
export function addAlert(data) {
return request({
url: '/model/dcBusiAlertDevcie',
method: 'post',
data: data
})
}
// 修改设备告警
export function updateAlert(data) {
return request({
url: '/model/dcBusiAlertDevcie',
method: 'put',
data: data
})
}
// 删除设备告警
export function delAlert(id) {
return request({
url: '/model/dcBusiAlertDevcie/' + id,
method: 'delete'
})
}
// 导出设备告警
export function exportAlert(query) {
return request({
url: '/${baseUrl}/export',
method: 'get',
params: query
})
}
// 查询警告列表
export function getAlertTableInfo(query) {
return request({
url: '/model/dcBusiAlertDevcie/alertDeviceInfo',
method: 'post',
params: query
})
}
// 查询未添加警告设备列表
export function getNoAlertDevice(query) {
return request({
url: '/model/dcBusiAlertDevcie/noAlertDevice',
method: 'post',
params: query
})
}
// 查询警告设备列表
export function getParamsAlert(query) {
return request({
url: '/model/dcBusiAlertDevcie/alertDeviceParam',
method: 'post',
params: query
})
}
// 查询未添加警告设备列表
export function getParamsNoAlert(query) {
return request({
url: '/model/dcBusiAlertDevcie/noAlertDeviceParam',
method: 'post',
params: query
})
}

24
src/assets/styles/self-defined.scss

@ -91,6 +91,8 @@
}
}
.marginbottom{
margin-bottom: 0 !important;
}
@ -145,4 +147,26 @@
text-align: center!important;
}
}
.width80percent{
width: 80%;
}
.displayinlineblock{
display: inline-block;
}
.margintop20{
margin-top:20px;
}
.marginleft0{
margin-left:0px;
}
.sundivright10percent{
>div{
right:10%!important;
}
}

258
src/views/model/alert/addalertconfig.vue

@ -0,0 +1,258 @@
<template>
<div class="app-container"
v-loading="loading">
<!-- 添加或修改设备模型信息对话框 -->
<div class="marginbottom50px">
<el-steps :active="currentStep">
<el-step title="选择设备" description="告警设备" />
<el-step title="选择参数" description="该设备告警参数选择" />
<el-step title="选择策略" description="参数告警的策略配置" />
<el-step title="选择通知方式" description="告警的提醒方式配置" />
</el-steps>
</div>
<div class="overflowscroll">
<el-form ref="devicemodelRef" :model="form" :rules="rules" label-width="100px" class="textaligncenter">
<el-carousel ref="carousel" :autoplay="false" :arrow="never" pause-on-hover="false" class="customCarousel" :style="{ height: windowHeight + 'px' }">
<el-carousel-item :key="1" name="1" class="textaligncenter overflowscroll height300">
<div class="width80percent textaligncenter displayinlineblock">
<noalertdevices ref="devicealert"/>
</div>
</el-carousel-item>
<el-carousel-item :key="2" name="2" class="textaligncenter overflowscroll height300">
<div class="width80percent textaligncenter displayinlineblock">
<noalertparams ref="paramalert"/>
</div>
</el-carousel-item>
<el-carousel-item :key="3" name="3" class="textaligncenter overflowscroll height300">
<div class="width80percent textaligncenter">
</div>
</el-carousel-item>
<el-carousel-item :key="4" name="4" class="textaligncenter overflowscroll height300">
<div class="width80percent textaligncenter">
</div>
</el-carousel-item>
</el-carousel>
<el-form-item class="displayinlineblock divsonmarginleft0 margintop20">
<el-button type="primary" v-if="prevStepButtonShow" @click="prevStep" style="display: inline-block !important" >上一步</el-button>
<el-button type="primary" v-if="submitButtonShow" @click="submitForm" style="display: inline-block !important">提交</el-button>
<el-button @click="cancel" style="display: inline-block !important"> </el-button>
<el-button type="primary" v-if="nextStepButtonShow" @click="nextStep" style="display: inline-block !important">下一步</el-button>
</el-form-item>
</el-form>
<el-dialog :title="title" v-model="addParamModelShow" width="800px" append-to-body :dc_device_partion="dc_device_partion" :dc_class_type="dc_class_type">
</el-dialog>
</div>
</div>
</template>
<style lang="scss">
@import "@/assets/styles/self-defined.scss";
.customCarousel {
>div{
>button {
display: none !important;
}
}
ul{
display: none !important;
}
}
</style>
<script setup name="addalert">
import { required } from "@vee-validate/rules";
import noalertdevices from "./noalertdevices";
import noalertparams from "./noalertparams";
import { onMounted } from "vue";
import { ElMessage, ElMessageBox } from 'element-plus'
const { proxy } = getCurrentInstance();
const {dc_class_type, dc_device_partion, dc_model_type} = proxy.useDict('dc_class_type', 'dc_device_partion','dc_model_type');
const router = useRouter();
const open = ref(false);
const loading = ref(false);
const currentStep = ref(1);
const nextStepButtonShow = ref(true);
const prevStepButtonShow = ref(false);
const submitButtonShow = ref(false);
const addParamModelShow = ref(false);
const navber = ref(0);
const tagsViewContainer = ref(0);
const marginbottom50px = ref(0);
const windowHeight = ref(0);
const selectDeviceId = ref("");
const data = reactive({
form: {
},
queryParams: {
modelName: null,
modelCode: null,
sort: null,
modelTypeId: null,
pid: null,
note: null
},
rules: {
},
validations: {
inputValue: { required }
}
});
const { queryParams, form, rules } = toRefs(data);
//
function cancel() {
open.value = false;
reset();
}
//
function reset() {
form.value = {
tentantId: null,
version: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
deptId: null,
userId: null,
deleteBy: null,
deleteTime: null,
id: null,
modelName: null,
modelCode: null,
sort: null,
modelTypeId: null,
pid: null,
note: null
};
proxy.resetForm("devicemodelRef");
}
/** 提交按钮 */
function submitForm() {
}
function nextStep(){
this.$nextTick(() => {
if(currentStep.value==1){
const selectDevice = proxy.$refs["devicealert"].$refs.addAlertTable.getSelectionRows();
debugger
if(!valideToAddDevice(selectDevice)){
return;
}else{
debugger
proxy.$refs["paramalert"].deviceUuid = selectDevice.uuid;
proxy.$refs["paramalert"].getParamsNoAlertData();
}
currentStep.value = currentStep.value + 1;
proxy.$refs.carousel.next();
submitButtonShow.value = true;
nextStepButtonShow.value = true;
prevStepButtonShow.value = true;
}else if(currentStep.value == 2){
currentStep.value = currentStep.value + 1;
proxy.$refs.carousel.next();
submitButtonShow.value = true;
nextStepButtonShow.value = true;
prevStepButtonShow.value = true;
}else{
currentStep.value = currentStep.value + 1;
proxy.$refs.carousel.next();
submitButtonShow.value = true;
nextStepButtonShow.value = false;
prevStepButtonShow.value = true;
}
});
}
function prevStep(){
if(currentStep.value==4){
currentStep.value = currentStep.value - 1;
proxy.$refs.carousel.prev();
submitButtonShow.value = true;
nextStepButtonShow.value = true;
prevStepButtonShow.value = true;
}else if(currentStep.value == 3){
currentStep.value = currentStep.value - 1;
proxy.$refs.carousel.prev();
submitButtonShow.value = true;
nextStepButtonShow.value = true;
prevStepButtonShow.value = true;
}else if(currentStep.value == 2){
currentStep.value = currentStep.value - 1;
proxy.$refs.carousel.prev();
submitButtonShow.value = false;
nextStepButtonShow.value = true;
prevStepButtonShow.value = false;
}
}
function submit(){
}
function updateWindowHeight(){
navber.value=document.querySelector('.navbar').clientHeight;
tagsViewContainer.value=document.querySelector('.tags-view-container').clientHeight;
marginbottom50px.value=document.querySelector('.marginbottom50px').clientHeight;
windowHeight.value = window.innerHeight - navber.value - tagsViewContainer.value - marginbottom50px.value - 160;
};
onMounted(() => {
updateWindowHeight();
window.addEventListener('resize', updateWindowHeight);
});
onUnmounted(() => {
window.removeEventListener('resize', updateWindowHeight);
});
function valideToAddDevice(selectDevice){
console.log("---------------");
if(selectDevice.length==1){
selectDeviceId.value = selectDevice.uuid;
return true;
}else if(selectDevice.length > 1){
ElMessageBox.alert('请确保只选择一条设备', '提示', {
confirmButtonText: '确定',
center: true,
})
return false;
}else if(selectDevice.length < 1){
ElMessageBox.alert('请选择设备', '提示', {
confirmButtonText: '确定',
})
return false;
}
}
function valideToAddParams(){
console.log("---------------");
// let selectDevice = proxy.$refs["paramalert"].$refs.addAlertTable.getSelectionRows();
// if(selectDevice.length==1){
// selectDeviceId.value = selectDevice.uuid;
// return true;
// }else if(selectDevice.length > 1){
// ElMessageBox.alert('', '', {
// confirmButtonText: '',
// center: true,
// })
// return false;
// }else if(selectDevice.length < 1){
// ElMessageBox.alert('', '', {
// confirmButtonText: '',
// })
// return false;
// }
}
</script>

590
src/views/model/alert/index.vue

@ -0,0 +1,590 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="中台设备编码" prop="centerDeviceCode">
<el-input
v-model="queryParams.centerDeviceCode"
placeholder="请输入中台设备编码"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="queryParams.deviceName"
placeholder="请输入设备名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="通讯来源类型" prop="deviceSource">
<el-select v-model="queryParams.deviceSource" placeholder="请选择是否可用" clearable>
<el-option
v-for="dict in dc_device_source"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@change="deviceSourceChange"
/>
</el-select>
</el-form-item>
<el-collapse-transition>
<div v-show="collapseVisible">
<el-form-item label="是否可用" prop="enabledFlag">
<el-select v-model="queryParams.enabledFlag" placeholder="请选择是否可用" clearable>
<el-option
v-for="dict in enabledFlag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" clearable>
<el-option
v-for="dict in dc_device_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="所属组织名称" prop="orgName">
<el-tree-select v-model="queryParams.orgName" :data="deptOptions"
:props="{ value: 'label', label: 'label', children: 'children' }" value-key="id" placeholder="请选择组织名称"
check-strictly :default-expand-all="true"/>
</el-form-item>
</div>
</el-collapse-transition>
<el-form-item class="childTextAlignCenter">
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="info" plain icon="Refresh" @click="resetQuery">重置</el-button>
<el-button @click="toggleCollapse">{{editName}}</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="success"
icon="Plus"
@click="handleAdd"
>新增</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="success"
icon="Delete"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
icon="Download"
@click="handleExport"
>导出</el-button>
</el-col> -->
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList">
</right-toolbar>
</el-row>
<el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" fixed="left"/>
<el-table-column label="中台设备编码" align="center" prop="centerDeviceCode" :width="120"/>
<el-table-column label="设备名称" align="center" prop="deviceName" :width="120"/>
<el-table-column label="通讯来源类型" align="center" prop="deviceSource" :width="120"/>
<el-table-column label="是否可用" align="center" prop="enabledFlag" :width="120">
<template #default="scope">
<dict-tag :options="enabledFlagTable" :value="scope.row.enabledFlag"/>
</template>
</el-table-column>
<el-table-column label="设备类型" align="center" prop="deviceType" :width="120">
<template #default="scope">
<dict-tag :options="dc_device_type" :value="scope.row.deviceType"/>
</template>
</el-table-column>
<el-table-column label="所属组织名称" align="center" prop="orgName" :width="120" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" :width="300">
<template #default="scope">
<el-button
type="text"
icon="Edit"
@click="handleParams(scope.row)"
>维护告警参数</el-button>
<el-button
type="text"
icon="Delete"
@click="handleDelete(scope.row)"
>删除告警配置</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改设备信息对话框 -->
<el-dialog :title="title" v-model="open" width="800px" append-to-body>
<el-form :model="queryParamsIn" ref="queryRefForm" :inline="true" v-show="showAddSearch" label-width="120px">
<el-form-item label="中台设备编码" prop="centerDeviceCode">
<el-input
v-model="queryParamsIn.centerDeviceCode"
placeholder="请输入中台设备编码"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="queryParamsIn.deviceName"
placeholder="请输入设备名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-collapse-transition>
<div v-show="collapseVisibleDialog">
<el-form-item label="通讯来源类型" prop="deviceSource">
<el-select v-model="queryParamsIn.deviceSource" placeholder="请选择是否可用" clearable>
<el-option
v-for="dict in dc_device_source"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@change="deviceSourceChange"
/>
</el-select>
</el-form-item>
<el-form-item label="是否可用" prop="enabledFlag">
<el-select v-model="queryParamsIn.enabledFlag" placeholder="请选择是否可用" clearable>
<el-option
v-for="dict in enabledFlag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryParamsIn.deviceType" placeholder="请选择设备类型" clearable>
<el-option
v-for="dict in dc_device_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="所属组织名称" prop="orgName">
<el-tree-select v-model="queryParamsIn.orgName" :data="deptOptions"
:props="{ value: 'label', label: 'label', children: 'children' }" value-key="id" placeholder="请选择组织名称"
check-strictly :default-expand-all="true"/>
</el-form-item>
<el-form-item label="位置编码" prop="locationCode">
<el-input
v-model="queryParamsIn.locationCode"
placeholder="请输入位置编码"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="位置名称" prop="locationName">
<el-input
v-model="queryParamsIn.locationName"
placeholder="请输入位置名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="设备应用范围" prop="deviceClass">
<el-input
v-model="queryParamsIn.deviceClass"
placeholder="请输入设备应用范围"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="接口名称" prop="apiName">
<el-input
v-model="queryParamsIn.apiName"
placeholder="请输入接口名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="服务器地址" prop="serverIp">
<el-input
v-model="queryParamsIn.serverIp"
placeholder="请输入服务器地址"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="从属网关ID" prop="gatewayId">
<el-input
v-model="queryParamsIn.gatewayId"
placeholder="请输入从属网关ID"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="纬度" prop="latValue">
<el-input
v-model="queryParamsIn.latValue"
placeholder="请输入纬度"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="经度" prop="lagValue">
<el-input
v-model="queryParamsIn.lagValue"
placeholder="请输入经度"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="设备模型" prop="deviceModelId">
<el-select v-model="queryParamsIn.deviceModelId" placeholder="请选择设备模型id" clearable>
<el-option label="请选择设备模型" value="deviceModelId" />
</el-select>
</el-form-item>
<el-form-item label="租户号" prop="tentantId">
<el-input
v-model="queryParamsIn.tentantId"
placeholder="请输入租户号"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="设备分组" prop="deviceGroupId">
<el-select v-model="queryParamsIn.deviceGroupId" placeholder="请选择设备分组ID" clearable>
<el-option label="请添加设备分组" value="" />
</el-select>
</el-form-item>
</div>
</el-collapse-transition>
<el-form-item class="childTextAlignCenter">
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="info" plain icon="Refresh" @click="resetQuery">重置</el-button>
<el-button @click="toggleCollapseDialog">{{editNameDialog}}</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" @click="handleSubmit">提交</el-button>
</el-col>
<right-toolbar v-model:showSearch="showAddSearch" @queryTable="getNoAlertDeviceList">
</right-toolbar>
</el-row>
<el-table ref="addAlertTable" v-loading="loading" :data="noAlertDeviceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" fixed="left"/>
<el-table-column label="中台设备编码" align="center" prop="centerDeviceCode" :width="120"/>
<el-table-column label="设备名称" align="center" prop="deviceName" :width="120"/>
<el-table-column label="通讯来源类型" align="center" prop="deviceSource" :width="120"/>
<el-table-column label="是否可用" align="center" prop="enabledFlag" :width="120">
<template #default="scope">
<dict-tag :options="enabledFlagTable" :value="scope.row.enabledFlag"/>
</template>
</el-table-column>
<el-table-column label="设备类型" align="center" prop="deviceType" :width="120">
<template #default="scope">
<dict-tag :options="dc_device_type" :value="scope.row.deviceType"/>
</template>
</el-table-column>
<el-table-column label="所属组织名称" align="center" prop="orgName" :width="120" />
<el-table-column label="位置编码" align="center" prop="locationCode" :width="120"/>
<el-table-column label="位置名称" align="center" prop="locationName" :width="120"/>
<el-table-column label="设备应用范围" align="center" prop="deviceClass" :width="120"/>
<el-table-column label="接口名称" align="center" prop="apiName" :width="120"/>
<el-table-column label="服务器地址" align="center" prop="serverIp" :width="120"/>
<el-table-column label="从属网关ID" align="center" prop="gatewayId" :width="120"/>
<el-table-column label="纬度" align="center" prop="latValue" :width="120"/>
<el-table-column label="经度" align="center" prop="lagValue" :width="120"/>
<el-table-column label="设备模型" align="center" prop="deviceModelId" :width="120">
</el-table-column>
<el-table-column label="租户号" align="center" prop="tentantId" :width="120"/>
<el-table-column label="设备分组" align="center" prop="deviceGroupId" :width="120"/>
</el-table>
<pagination
v-show="noAlertTotal>0"
:total="noAlertTotal"
v-model:page="queryParamsIn.pageNum"
v-model:limit="queryParamsIn.pageSize"
@pagination="getNoAlertDeviceList"
/>
</el-dialog>
</div>
</template>
<style lang="scss" >
@import "@/assets/styles/self-defined.scss";
</style>
<script setup name="Device">
import { getNoAlertDevice, getAlertTableInfo, listAlert, getAlert, delAlert, addAlert, updateAlert } from "@/api/model/alert";
import { deptTreeSelect } from "@/api/system/user";
const { proxy } = getCurrentInstance();
const { dc_device_type, dc_device_source } = proxy.useDict('dc_device_type','dc_device_source');
const router = useRouter();
const deviceList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const showAddSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const collapseVisible = ref(false);
const collapseVisibleDialog = ref(false);
const editName = ref("更多筛选项");
const editNameDialog = ref("更多筛选项");
const deptOptions = ref([]);
const noAlertDeviceList = ref([]);
const noAlertTotal = ref(0);
const enabledFlag = ref([
{label: '可用', value: true, elTagType: 'default', elTagClass: null},
{label: '不可用', value: false, elTagType: 'default', elTagClass: null}
]);
// const alertEnabled = ref([
// {label: '', value: true, elTagType: 'default', elTagClass: null},
// {label: '', value: false, elTagType: 'default', elTagClass: null}
// ]);
const enabledFlagTable = ref([
{label: '可用', value: 'true', elTagType: 'default', elTagClass: null},
{label: '不可用', value: 'false', elTagType: 'default', elTagClass: null}
]);
// const alertEnabledTable = ref([
// {label: '', value: 'true', elTagType: 'default', elTagClass: null},
// {label: '', value: 'false', elTagType: 'default', elTagClass: null}
// ]);
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
centerDeviceCode: null,
deviceName: null,
deviceSource: null,
deviceSourceId: null,
enabledFlag: null,
deviceType: null,
orgCode: null,
orgName: null,
locationCode: null,
locationName: null,
deviceClass: null,
apiName: null,
serverIp: null,
gatewayId: null,
latValue: null,
lagValue: null,
uuid: null,
alertEnabled: null,
deviceModelId: null,
tentantId: null,
deviceGroupId: null
},
queryParamsIn: {
pageNum: 1,
pageSize: 10,
centerDeviceCode: null,
deviceName: null,
deviceSource: null,
deviceSourceId: null,
enabledFlag: null,
deviceType: null,
orgCode: null,
orgName: null,
locationCode: null,
locationName: null,
deviceClass: null,
apiName: null,
serverIp: null,
gatewayId: null,
latValue: null,
lagValue: null,
uuid: null,
alertEnabled: null,
deviceModelId: null,
tentantId: null,
deviceGroupId: null
},
rules: {
}
});
const { queryParams, queryParamsIn, form, rules } = toRefs(data);
/** 查询设备信息列表 */
function getList() {
loading.value = true;
getAlertTableInfo(queryParams.value).then(response => {
deviceList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
//
function cancel() {
open.value = false;
reset();
}
//
function reset() {
form.value = {
centerDeviceCode: null,
deviceName: null,
deviceSource: null,
deviceSourceId: null,
enabledFlag: null,
deviceType: null,
orgCode: null,
orgName: null,
locationCode: null,
locationName: null,
deviceClass: null,
apiName: null,
serverIp: null,
gatewayId: null,
latValue: null,
lagValue: null,
uuid: null,
alertEnabled: null,
deviceModelId: null,
tentantId: null,
version: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
deptId: null,
userId: null,
deleteBy: null,
deleteTime: null,
id: null,
deviceGroupId: null
};
proxy.resetForm("deviceRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParamsIn.value.pageNum = 1;
getNoAlertDeviceList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
//
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
// loading.value = true;
// getNoAlertDevice().then(response=>{
// noAlertDeviceList.value = response.rows;
// loading.value = false;
// });
// reset();
// open.value = true;
router.push({
path:"addalert"
})
title.value = "添加设备参数告警配置";
}
/** 提交按钮 */
function handleSubmit() {
const rows = proxy.$refs.addAlertTable.getSelectionRows();
rows.forEach(item=>{
const paramAlertAdd = {
deviceUuid: item.uuid
}
addAlert(paramAlertAdd);
})
open.value=false;
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal.confirm('是否确认删除设备信息编号为"' + _ids + '"的数据项?').then(function() {
return delAlert(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
function handleParams(row){
router.push({
path: "paramalert",
query: {
deviceUuid: row.uuid,
deviceCode: row.centerDeviceCode,
uuidDisabled: false,
}
});
}
function toggleCollapse() {
collapseVisible.value = !collapseVisible.value;
if(collapseVisible.value){
editName.value = "折叠筛选项";
}else{
editName.value = "更多筛选项"
}
}
function toggleCollapseDialog() {
collapseVisibleDialog.value = !collapseVisibleDialog.value;
if(collapseVisibleDialog.value){
editNameDialog.value = "折叠筛选项";
}else{
editNameDialog.value = "更多筛选项"
}
}
function getDeptTree() {
deptTreeSelect().then(response => {
deptOptions.value = response.data;
});
};
function deviceSourceChange(val){
form.value.deviceSourceId=val.deviceSourceId;
}
function getNoAlertDeviceList(){
loading.value = true;
getNoAlertDevice(queryParams.value).then(response => {
noAlertDeviceList.value = response.rows;
noAlertTotal.value = response.total;
loading.value = false;
});
}
getDeptTree();
getList();
</script>

273
src/views/model/alert/noalertdevices.vue

@ -0,0 +1,273 @@
<template>
<div>
<el-form :model="queryParams" ref="queryRefForm" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="中台设备编码" prop="centerDeviceCode">
<el-input
v-model="queryParams.centerDeviceCode"
placeholder="请输入中台设备编码"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="queryParams.deviceName"
placeholder="请输入设备名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-collapse-transition>
<div v-show="collapseVisibleDialog">
<el-form-item label="是否可用" prop="enabledFlag">
<el-select v-model="queryParams.enabledFlag" placeholder="请选择是否可用" clearable>
<el-option
v-for="dict in enabledFlag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="通讯来源类型" prop="deviceSource">
<el-select v-model="queryParams.deviceSource" placeholder="请选择是否可用" clearable>
<el-option
v-for="dict in dc_device_source"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@change="deviceSourceChange"
/>
</el-select>
</el-form-item>
<el-form-item label="设备类型" prop="deviceType">
<el-select v-model="queryParams.deviceType" placeholder="请选择设备类型" clearable>
<el-option
v-for="dict in dc_device_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="所属组织名称" prop="orgName">
<el-tree-select v-model="queryParams.orgName" :data="deptOptions"
:props="{ value: 'label', label: 'label', children: 'children' }" value-key="id" placeholder="请选择组织名称"
check-strictly :default-expand-all="true"/>
</el-form-item>
<el-form-item label="位置编码" prop="locationCode">
<el-input
v-model="queryParams.locationCode"
placeholder="请输入位置编码"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="位置名称" prop="locationName">
<el-input
v-model="queryParams.locationName"
placeholder="请输入位置名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="设备应用范围" prop="deviceClass">
<el-input
v-model="queryParams.deviceClass"
placeholder="请输入设备应用范围"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="接口名称" prop="apiName">
<el-input
v-model="queryParams.apiName"
placeholder="请输入接口名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="服务器地址" prop="serverIp">
<el-input
v-model="queryParams.serverIp"
placeholder="请输入服务器地址"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="从属网关ID" prop="gatewayId">
<el-input
v-model="queryParams.gatewayId"
placeholder="请输入从属网关ID"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="纬度" prop="latValue">
<el-input
v-model="queryParams.latValue"
placeholder="请输入纬度"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="经度" prop="lagValue">
<el-input
v-model="queryParams.lagValue"
placeholder="请输入经度"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="设备模型" prop="deviceModelId">
<el-select v-model="queryParams.deviceModelId" placeholder="请选择设备模型id" clearable>
<el-option label="请选择设备模型" value="deviceModelId" />
</el-select>
</el-form-item>
<el-form-item label="租户号" prop="tentantId">
<el-input
v-model="queryParams.tentantId"
placeholder="请输入租户号"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="设备分组" prop="deviceGroupId">
<el-select v-model="queryParams.deviceGroupId" placeholder="请选择设备分组ID" clearable>
<el-option label="请添加设备分组" value="" />
</el-select>
</el-form-item>
</div>
</el-collapse-transition>
<el-form-item class="childTextAlignCenter">
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="info" plain icon="Refresh" @click="resetQuery">重置</el-button>
<el-button @click="toggleCollapseDialog">{{editNameDialog}}</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList">
</right-toolbar>
</el-row>
<el-table ref="addAlertTable" v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" fixed="left"/>
<el-table-column label="中台设备编码" align="center" prop="centerDeviceCode" :width="120"/>
<el-table-column label="设备名称" align="center" prop="deviceName" :width="120"/>
<el-table-column label="通讯来源类型" align="center" prop="deviceSource" :width="120"/>
<el-table-column label="是否可用" align="center" prop="enabledFlag" :width="120">
<template #default="scope">
<dict-tag :options="enabledFlagTable" :value="scope.row.enabledFlag"/>
</template>
</el-table-column>
<el-table-column label="设备类型" align="center" prop="deviceType" :width="120">
<template #default="scope">
<dict-tag :options="dc_device_type" :value="scope.row.deviceType"/>
</template>
</el-table-column>
<el-table-column label="所属组织名称" align="center" prop="orgName" :width="120" />
<el-table-column label="位置编码" align="center" prop="locationCode" :width="120"/>
<el-table-column label="位置名称" align="center" prop="locationName" :width="120"/>
<el-table-column label="设备应用范围" align="center" prop="deviceClass" :width="120"/>
<el-table-column label="接口名称" align="center" prop="apiName" :width="120"/>
<el-table-column label="服务器地址" align="center" prop="serverIp" :width="120"/>
<el-table-column label="从属网关ID" align="center" prop="gatewayId" :width="120"/>
<el-table-column label="纬度" align="center" prop="latValue" :width="120"/>
<el-table-column label="经度" align="center" prop="lagValue" :width="120"/>
<el-table-column label="设备模型" align="center" prop="deviceModelId" :width="120">
</el-table-column>
<el-table-column label="租户号" align="center" prop="tentantId" :width="120"/>
<el-table-column label="设备分组" align="center" prop="deviceGroupId" :width="120"/>
</el-table>
<pagination
class="sundivright10percent"
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<style lang="scss" >
@import "@/assets/styles/self-defined.scss";
</style>
<script setup name="devicealert">
import { listParamclass } from "@/api/model/paramclass";
import { getNoAlertDevice } from "@/api/model/alert";
const { proxy } = getCurrentInstance();
const router = useRouter();
const { dc_param_uint_type, dc_param_value_type, dc_device_partion } = proxy.useDict('dc_param_uint_type', 'dc_param_value_type', 'dc_device_partion');
const showSearch = ref(true);
const editNameDialog = ref("更多筛选项");
const collapseVisibleDialog = ref(false);
const deviceList = ref([]);
const total = ref(0);
const loading = ref(false);
let devicealert = ref(null);
const data = reactive({
form: {
},
queryParams: {
pageNum: 1,
pageSize: 10,
centerDeviceCode: null,
deviceName: null,
deviceSource: null,
deviceSourceId: null,
enabledFlag: null,
deviceType: null,
orgCode: null,
orgName: null,
locationCode: null,
locationName: null,
deviceClass: null,
apiName: null,
serverIp: null,
gatewayId: null,
latValue: null,
lagValue: null,
uuid: null,
alertEnabled: null,
deviceModelId: null,
tentantId: null,
deviceGroupId: null
},
rules: {
},
});
const { queryParams, form, rules } = toRefs(data);
function toggleCollapseDialog() {
collapseVisibleDialog.value = !collapseVisibleDialog.value;
if(collapseVisibleDialog.value){
editNameDialog.value = "折叠筛选项";
}else{
editNameDialog.value = "更多筛选项"
}
}
/** 搜索按钮操作 */
function handleQuery() {
loading.value = true;
queryParams.value.pageNum = 1;
getNoAlertDevice(queryParams.value).then(response=>{
deviceList.value=response.rows;
total.value=response.total;
loading.value = false;
});
}
function getList() {
loading.value = true;
getNoAlertDevice(queryParams.value).then(response=>{
deviceList.value=response.rows;
total.value=response.total;
loading.value = false;
});
}
getList();
</script>

297
src/views/model/alert/noalertparams.vue

@ -0,0 +1,297 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="中台设备编码" prop="deviceUuid">
<el-input
v-model="queryParams.deviceUuid"
placeholder="请输入中台设备编码"
:disabled="uuidDisabled"
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="参数名称" prop="paramName">
<el-input
v-model="queryParams.paramName"
placeholder="请输入参数名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="参数编码" prop="paramCode">
<el-input
v-model="queryParams.paramCode"
placeholder="请输入参数编码"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="数据类型" prop="paramType">
<el-select v-model="queryParams.paramType" placeholder="请选择数据类型" clearable>
<el-option
v-for="dict in dc_param_value_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-collapse-transition>
<div v-show="collapseVisible">
<el-form-item label="是否可控" prop="contrlFlag">
<el-select v-model="queryParams.contrlFlag" placeholder="请选择是否可控" clearable>
<el-option
v-for="dict in contrlFlag"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</div>
</el-collapse-transition>
<el-form-item class="childTextAlignCenter">
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button type="info" plain icon="Refresh" @click="resetQuery">重置</el-button>
<el-button @click="toggleCollapse">{{editName}}</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList">
</right-toolbar>
</el-row>
<el-table ref="addAlertTable" v-loading="loading" :data="paramsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" fixed="left"/>
<el-table-column label="中台设备ID" align="center" prop="deviceUuid" :width="120"/>
<el-table-column label="中台设备" align="center" prop="deviceName" :width="120"/>
<el-table-column label="参数名称" align="center" prop="paramName" :width="120"/>
<el-table-column label="参数编码" align="center" prop="paramCode" :width="120"/>
<el-table-column label="参数模版" align="center" prop="paramModelId" :width="120">
<template #default="scope">
<span>{{ getParamModelName(scope.row.paramModelId) }}</span>
</template>
</el-table-column>
<el-table-column label="分区(字典)" align="center" prop="partion" :width="120">
<template #default="scope">
<dict-tag :options="dc_device_partion" :value="scope.row.partion"/>
</template>
</el-table-column>
<el-table-column label="plc地址" align="center" prop="plcAdr" :width="120"/>
</el-table>
<pagination
class="sundivright10percent"
v-show="total>0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改设备参数明细对话框 -->
<el-dialog :title="title" v-model="open" width="800px" append-to-body>
</el-dialog>
</div>
</template>
<style lang="scss" >
@import "@/assets/styles/self-defined.scss";
</style>
<script setup name="paramalert">
import { getParamsAlert, getParamsNoAlert, listAlert, getAlert, delAlert, addAlert, updateAlert } from "@/api/model/alert";
import { listParamclass } from "@/api/model/paramclass";
const { proxy } = getCurrentInstance();
const router = useRouter();
const { dc_param_uint_type, dc_param_value_type, dc_device_partion } = proxy.useDict('dc_param_uint_type', 'dc_param_value_type', 'dc_device_partion');
const paramsList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const noAlertTotal = ref(0);
const title = ref("");
const paramClassList = ref([]);
const collapseVisible = ref(false);
const uuidDisabled = ref(false);
const deviceUuid = ref("");
const editName = ref("更多筛选项");
let paramalert = ref(null);
const contrlFlag = ref([
{label: '可控', value: true, elTagType: 'default', elTagClass: null},
{label: '不可控', value: false, elTagType: 'default', elTagClass: null}
]);
const enabled = ref([
{label: '有效', value: true, elTagType: 'default', elTagClass: null},
{label: '无效', value: false, elTagType: 'default', elTagClass: null}
]);
const contrlFlagTable = ref([
{label: '可控', value: 'true', elTagType: 'default', elTagClass: null},
{label: '不可控', value: 'false', elTagType: 'default', elTagClass: null}
]);
const enabledTable = ref([
{label: '有效', value: 'true', elTagType: 'default', elTagClass: null},
{label: '无效', value: 'false', elTagType: 'default', elTagClass: null}
]);
const data = reactive({
form: {
contrlFlag:contrlFlag,
enabled:enabled,
},
queryParams: {
pageNum: 1,
pageSize: 10,
deviceUuid: null,
paramName: null,
paramCode: null,
paramType: null,
contrlFlag: null,
contrlType: null,
enabled: null,
setDefautvalue: null,
setAdjustvalue: null,
validateScope: null,
globalCode: null,
paramModelId: null,
partion: null,
plcAdr: null,
controllab: null
},
rules: {
},
});
const { queryParams, form, rules } = toRefs(data);
/** 查询告警设备参数列表 */
function getList() {
loading.value = true;
if(deviceUuid != null && deviceUuid != undefined && deviceUuid != ""){
queryParams.value.deviceUuid = deviceUuid;
getParamsAlert(queryParams.value).then(response => {
paramsList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}else{
getParamsAlert(queryParams.value).then(response => {
paramsList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
}
//
function reset() {
form.value = {
tentantId: null,
version: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
deptId: null,
userId: null,
deleteBy: null,
deleteTime: null,
id: null,
deviceUuid: null,
paramName: null,
paramCode: null,
paramType: null,
contrlFlag: null,
contrlType: null,
enabled: null,
setDefautvalue: null,
setAdjustvalue: null,
validateScope: null,
globalCode: null,
paramModelId: null,
partion: null,
plcAdr: null,
controllab: null
};
proxy.resetForm("paramsRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
//
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 删除按钮操作 */
function handleDelete(row) {
const _ids = row.id || ids.value;
proxy.$modal.confirm('是否确认删除设备参数明细编号为"' + _ids + '"的数据项?').then(function() {
return delParams(_ids);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
function getParamModel() {
listParamclass({}).then(response => {
paramClassList.value = response.rows;
});
}
function toggleCollapse() {
collapseVisible.value = !collapseVisible.value;
if(collapseVisible.value){
editName.value = "折叠筛选项";
}else{
editName.value = "更多筛选项"
}
}
function getParamModelName(id){
paramClassList.value.forEach(item=>{
if(item.id == id){
return item.getParamModelName;
}
})
}
const getParamsNoAlertData = function getParamsNoAlertList() {
loading.value = true;
if(deviceUuid != null && deviceUuid != undefined && deviceUuid != ""){
queryParams.value.deviceUuid = deviceUuid;
getParamsNoAlert(queryParams.value).then(response => {
paramsList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}else{
getParamsNoAlert(queryParams.value).then(response => {
paramsList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
}
getParamModel();
</script>

87
src/views/model/device/index.vue

@ -18,23 +18,18 @@
/>
</el-form-item>
<el-form-item label="通讯来源类型" prop="deviceSource">
<el-input
v-model="queryParams.deviceSource"
placeholder="请输入通讯来源类型"
clearable
@keyup.enter="handleQuery"
/>
<el-select v-model="queryParams.deviceSource" placeholder="请选择是否可用" clearable>
<el-option
v-for="dict in dc_device_source"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@change="deviceSourceChange"
/>
</el-select>
</el-form-item>
<el-collapse-transition>
<div v-show="collapseVisible">
<el-form-item label="通讯来源设备ID" prop="deviceSourceId">
<el-input
v-model="queryParams.deviceSourceId"
placeholder="请输入通讯来源设备ID"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="是否可用" prop="enabledFlag">
<el-select v-model="queryParams.enabledFlag" placeholder="请选择是否可用" clearable>
<el-option
@ -55,21 +50,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="所属组织编码" prop="orgCode">
<el-input
v-model="queryParams.orgCode"
placeholder="请输入所属组织编码"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="所属组织名称" prop="orgName">
<!-- <el-input
v-model="queryParams.orgName"
placeholder="请输入所属组织名称"
clearable
@keyup.enter="handleQuery"
/> -->
<el-tree-select v-model="queryParams.orgName" :data="deptOptions"
:props="{ value: 'label', label: 'label', children: 'children' }" value-key="id" placeholder="请选择组织名称"
check-strictly :default-expand-all="true"/>
@ -213,7 +194,6 @@
<el-table-column label="中台设备编码" align="center" prop="centerDeviceCode" :width="120"/>
<el-table-column label="设备名称" align="center" prop="deviceName" :width="120"/>
<el-table-column label="通讯来源类型" align="center" prop="deviceSource" :width="120"/>
<el-table-column label="通讯来源设备ID" align="center" prop="deviceSourceId" :width="120"/>
<el-table-column label="是否可用" align="center" prop="enabledFlag" :width="120">
<template #default="scope">
<dict-tag :options="enabledFlagTable" :value="scope.row.enabledFlag"/>
@ -224,7 +204,6 @@
<dict-tag :options="dc_device_type" :value="scope.row.deviceType"/>
</template>
</el-table-column>
<el-table-column label="所属组织编码" align="center" prop="orgCode" :width="120"/>
<el-table-column label="所属组织名称" align="center" prop="orgName" :width="120" />
<el-table-column label="位置编码" align="center" prop="locationCode" :width="120"/>
<el-table-column label="位置名称" align="center" prop="locationName" :width="120"/>
@ -278,7 +257,12 @@
<el-row>
<el-col :span="12">
<el-form-item label="中台设备编码" prop="centerDeviceCode">
<el-input disabled v-model="form.centerDeviceCode" placeholder="请输入中台设备编码" />
<el-input :disabled="disabled" v-model="form.centerDeviceCode" placeholder="请输入中台设备编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="主键" prop="uuid">
<el-input disabled v-model="form.uuid" placeholder="请输入主键" />
</el-form-item>
</el-col>
<el-col :span="12">
@ -288,7 +272,14 @@
</el-col>
<el-col :span="12">
<el-form-item label="通讯来源类型" prop="deviceSource">
<el-input v-model="form.deviceSource" placeholder="请输入通讯来源类型;ThingsDB/KingIO/Tk" />
<el-select v-model="form.deviceSource" placeholder="请选择是否可用" @change="deviceSourceChange">
<el-option
v-for="dict in dc_device_source"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
@ -421,7 +412,7 @@
import { getUuid, listDevice, getDevice, delDevice, addDevice, updateDevice } from "@/api/model/device";
import { deptTreeSelect } from "@/api/system/user";
const { proxy } = getCurrentInstance();
const { dc_device_type } = proxy.useDict('dc_device_type');
const { dc_device_type, dc_device_source } = proxy.useDict('dc_device_type','dc_device_source');
const router = useRouter();
const deviceList = ref([]);
@ -436,6 +427,7 @@ const title = ref("");
const collapseVisible = ref(false);
const editName = ref("更多筛选项");
const deptOptions = ref([]);
const disabled = ref(false);
const enabledFlag = ref([
{label: '可用', value: true, elTagType: 'default', elTagClass: null},
{label: '不可用', value: false, elTagType: 'default', elTagClass: null}
@ -585,6 +577,7 @@ function handleAdd() {
loading.value = true;
getUuid().then(response=>{
form.value.centerDeviceCode = response.msg;
form.value.uuid = response.msg;
form.value.enabledFlag = true;
loading.value = false;
});
@ -644,22 +637,22 @@ function handleExport() {
}, `device_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
// debugger
console.log("-------------"+queryParams.deviceType);
queryParams.deviceType = queryParams.deviceType;
//
//
// form.value.pid=tempPid;
});
// onMounted(() => {
// // debugger
// // console.log("-------------"+queryParams.deviceType);
// // queryParams.deviceType = queryParams.deviceType;
// //
// //
// // form.value.pid=tempPid;
// });
function handleParams(row){
const path = "params";
router.push({
path: path,
path: "params",
query: {
deviceUuid: row.uuid,
deviceCode: row.centerDeviceCode
deviceCode: row.centerDeviceCode,
uuidDisabled: false,
}
});
}
@ -676,8 +669,6 @@ function toggleCollapse() {
function getDeptTree() {
deptTreeSelect().then(response => {
deptOptions.value = response.data;
console.log("deptOptions");
console.log(deptOptions.value);
});
};
@ -685,6 +676,10 @@ function selectDept(val){
form.value.orgCode=val.id;
}
function deviceSourceChange(val){
form.value.deviceSourceId=val;
}
getDeptTree();
getList();
</script>

1
src/views/model/devicemodel/index.vue

@ -239,7 +239,6 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询设备模型信息列表 */
function getList() {
debugger
loading.value = true;
listDevicemodel(queryParams.value).then(response => {
devicemodelList.value = proxy.handleTree(response.data, "id", "pid");

71
src/views/model/params/index.vue

@ -5,7 +5,7 @@
<el-input
v-model="queryParams.deviceUuid"
placeholder="请输入中台设备UUID"
disabled
:disabled="uuidDisabled"
@keyup.enter="handleQuery"
/>
</el-form-item>
@ -150,8 +150,8 @@
<el-table v-loading="loading" :data="paramsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" fixed="left"/>
<el-table-column label="主键" align="center" prop="id" />
<el-table-column label="中台设备UUID" align="center" prop="deviceUuid" :width="120"/>
<!-- <el-table-column label="主键" align="center" prop="id" />
<el-table-column label="中台设备UUID" align="center" prop="deviceUuid" :width="120"/> -->
<el-table-column label="参数名称" align="center" prop="paramName" :width="120"/>
<el-table-column label="参数编码" align="center" prop="paramCode" :width="120"/>
<el-table-column label="数据类型" align="center" prop="paramType" :width="120">
@ -183,7 +183,11 @@
<span>{{ getParamModelName(scope.row.paramModelId) }}</span>
</template>
</el-table-column>
<el-table-column label="分区(字典)" align="center" prop="partion" :width="120"/>
<el-table-column label="分区(字典)" align="center" prop="partion" :width="120">
<template #default="scope">
<dict-tag :options="dc_device_partion" :value="scope.row.partion"/>
</template>
</el-table-column>
<el-table-column label="plc地址" align="center" prop="plcAdr" :width="120"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" :width="200" fixed="right">
<template #default="scope">
@ -215,8 +219,8 @@
<el-row>
<el-col :span="12">
<el-form-item label="中台设备UUID" prop="deviceUuid">
<el-input v-model="form.deviceUuid" placeholder="请输入中台设备UUID" disabled/>
<el-form-item label="中台设备ID" prop="deviceUuid">
<el-input v-model="form.deviceUuid" placeholder="请输入中台设备ID" :disabled="deviceUuidDisabled"/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -226,7 +230,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="参数模版" prop="paramModelId">
<el-select v-model="form.paramModelId" placeholder="请选择参数模版ID" @change="checkedParamModel">
<el-select :disabled="paramModelDisabled" v-model="form.paramModelId" placeholder="请选择参数模版ID" @change="checkedParamModel">
<el-option
v-for="dict in paramClassList"
:label="dict.paramClassName"
@ -237,7 +241,7 @@
</el-col>
<el-col :span="12">
<el-form-item label="参数编码" prop="paramCode">
<el-input v-model="form.paramCode" placeholder="请输入参数编码" disabled/>
<el-input v-model="form.paramCode" :placeholder="hintMessage" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
@ -304,12 +308,12 @@
</el-col>
<el-col :span="12">
<el-form-item label="全局统一编码" prop="globalCode">
<el-input v-model="form.globalCode" placeholder="请输入全局统一编码" disabled/>
<el-input v-model="form.globalCode" :placeholder="hintMessage" disabled/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="分区(字典)" prop="partion">
<el-select v-model="form.partion" placeholder="请选择分区(字典)">
<el-select :disabled="partionDisabled" v-model="form.partion" placeholder="请选择分区(字典)" @change="partionChange">
<el-option
v-for="dict in dc_device_partion"
:key="dict.value"
@ -356,9 +360,15 @@ const total = ref(0);
const title = ref("");
const paramClassList = ref([]);
const collapseVisible = ref(false);
const uuidDisabled = (router.currentRoute._value.query.deviceUuid !== undefined&&router.currentRoute._value.query.deviceUuid !== null&&router.currentRoute._value.query.deviceUuid !=="")?router.currentRoute._value.query.deviceUuid:false;
const editName = ref("更多筛选项");
const hintMessage = ref("请先选择参数模版");
const paramModelDisabled = ref(false);
const partionDisabled = ref(false);
const paramClassCodeSeleted = ref("");
const deviceUuid = router.currentRoute._value.query.deviceUuid;
const deviceCode = router.currentRoute._value.query.deviceCode;
const deviceUuidDisabled = ref(true);
const contrlFlag = ref([
{label: '可控', value: true, elTagType: 'default', elTagClass: null},
{label: '不可控', value: false, elTagType: 'default', elTagClass: null}
@ -421,15 +431,6 @@ const data = reactive({
enabled: [
{ required: true, message: "是否有效不能为空", trigger: "change" }
],
// setDefautvalue: [
// { required: true, message: "", trigger: "blur" }
// ],
// setAdjustvalue: [
// { required: true, message: "", trigger: "blur" }
// ],
// validateScope: [
// { required: true, message: ";0.0-100.00", trigger: "blur" }
// ],
globalCode: [
{ required: true, message: "全局统一编码不能为空", trigger: "blur" }
],
@ -528,6 +529,7 @@ function handleSelectionChange(selection) {
function handleAdd() {
reset();
form.value.deviceUuid = deviceUuid;
paramClassCodeSeleted.value = "";
open.value = true;
title.value = "添加设备参数明细";
}
@ -538,6 +540,8 @@ function handleUpdate(row) {
const _id = row.id || ids.value
getParams(_id).then(response => {
form.value = response.data;
paramModelDisabled.value = true;
partionDisabled.value = true;
open.value = true;
title.value = "修改设备参数明细";
});
@ -597,14 +601,18 @@ function getParamModelName(id){
}
function checkedParamModel(val){
let paramClassCodeSeleted = "";
paramClassList.value.forEach(item=>{
if(item.id == val){
paramClassCodeSeleted = item.paramClassCode;
paramClassCodeSeleted.value = item.paramClassCode;
if(form.value.partion !== undefined && form.value.partion !== null && form.value.partion !== ""){
form.value.paramCode = form.value.partion+form.value.deviceUuid+paramClassCodeSeleted.value;
form.value.globalCode = form.value.deviceUuid + "-" + form.value.partion + form.value.deviceUuid + paramClassCodeSeleted.value;
}else{
hintMessage.value = "请选择分区";
}
return;
}
})
form.value.paramCode = deviceCode+"-"+paramClassCodeSeleted;
form.value.globalCode = deviceUuid +"-"+ deviceCode +"-"+paramClassCodeSeleted;
}
function toggleCollapse() {
@ -616,7 +624,22 @@ function toggleCollapse() {
}
}
function partionChange(val){
if(paramClassCodeSeleted.value !== ""){
form.value.paramCode = form.value.partion+form.value.deviceUuid+paramClassCodeSeleted.value;
form.value.globalCode = form.value.deviceUuid + "-" + form.value.partion + form.value.deviceUuid + paramClassCodeSeleted.value;
}else{
hintMessage.value = "请选择参数模版";
}
}
function avilileEdit(){
if( deviceUuid === undefined || deviceUuid === null){
deviceUuidDisabled.value = false;
}
}
getList();
getParamModel();
avilileEdit();
</script>

94
src/views/transerver/kingcodetransform/index.vue

@ -1,61 +1,40 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="auto">
<el-form-item label="ISS变量名称" prop="issVarName">
<el-form-item label="变量名称" prop="issVarName">
<el-input
v-model="queryParams.issVarName"
placeholder="请输入ISS变量名称"
placeholder="请输入变量名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="ISS工程名称" prop="issPrjName">
<el-form-item label="工程名称" prop="issPrjName">
<el-input
v-model="queryParams.issPrjName"
placeholder="请输入ISS工程名称"
placeholder="请输入工程名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="ISS组名称" prop="issGroupName">
<el-input
v-model="queryParams.issGroupName"
placeholder="请输入ISS组名称"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="中台设备UUID" prop="centerDeviceuuid">
<el-form-item label="中台设备号" prop="centerDeviceuuid">
<el-input
v-model="queryParams.centerDeviceuuid"
placeholder="请输入中台设备UUID"
placeholder="请输入中台设备号"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="中台参数码" prop="centerParamcode">
<el-form-item label="中台参数码" prop="centerParamcode">
<el-input
v-model="queryParams.centerParamcode"
placeholder="请输入中台参数码"
placeholder="请输入中台参数码"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="ISSRest地址" prop="issResturl">
<el-input
v-model="queryParams.issResturl"
placeholder="请输入ISSRest地址"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="ISSRest端口号" prop="issRestport">
<el-input
v-model="queryParams.issRestport"
placeholder="请输入ISSRest端口号"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
@ -98,14 +77,14 @@
<el-table v-loading="loading" :data="kingcodetransformList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" />
<el-table-column label="ISS工程名称" align="center" prop="issPrjName" />
<el-table-column label="ISSRest地址" align="center" prop="issResturl" />
<el-table-column label="ISSRest端口号" align="center" prop="issRestport" />
<el-table-column label="ISS组名称" align="center" prop="issGroupName" />
<el-table-column label="ISS变量名称" align="center" prop="issVarName" />
<el-table-column label="ISS变量类型" align="center" prop="issVarType" />
<el-table-column label="中台设备UUID" align="center" prop="centerDeviceuuid" />
<el-table-column label="中台参数编码" align="center" prop="centerParamcode" />
<el-table-column label="工程名称" align="center" prop="issPrjName" />
<el-table-column label="服务地址" align="center" prop="issResturl" />
<el-table-column label="端口号" align="center" prop="issRestport" />
<el-table-column label="组名称" align="center" prop="issGroupName" />
<el-table-column label="变量名称" align="center" prop="issVarName" />
<el-table-column label="变量类型" align="center" prop="issVarType" />
<el-table-column label="中台设备" align="center" prop="centerDeviceuuid" />
<el-table-column label="中台参数" align="center" prop="centerParamcode" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button
@ -136,23 +115,28 @@
<el-row>
<el-col :span="24">
<el-form-item label="ISS变量名称" prop="issVarName">
<el-input v-model="form.issVarName" placeholder="请输入ISS变量名称" />
<el-form-item label="工程名称" width="150" prop="issPrjName">
<el-input v-model="form.issPrjName" placeholder="请输入工程名称" required="true"/>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="ISS工程名称" width="150" prop="issPrjName">
<el-input v-model="form.issPrjName" placeholder="请输入ISS工程名称" />
<el-form-item label="服务地址" prop="issResturl">
<el-input v-model="form.issResturl" placeholder="请输入服务地址" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="ISS组名称" prop="issGroupName">
<el-input v-model="form.issGroupName" placeholder="请输入ISS组名称" />
<el-form-item label="服务端口号" prop="issRestport">
<el-input v-model="form.issRestport" placeholder="请输入服务端口号" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="ISS变量类型" prop="issVarType">
<el-select v-model="form.issVarType" placeholder="请选择ISS变量类型">
<el-form-item label="变量名称" prop="issVarName">
<el-input v-model="form.issVarName" placeholder="请输入变量名称" required="true" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="变量类型" prop="issVarType">
<el-select v-model="form.issVarType" placeholder="请选择变量类型">
<el-option v-for="dict in dc_param_value_type"
:key="dict.value"
:label="dict.label" />
@ -161,25 +145,21 @@
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="中台设备UUID" prop="centerDeviceuuid">
<el-input v-model="form.centerDeviceuuid" placeholder="请输入中台设备UUID" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="中台参数编码" prop="centerParamcode">
<el-input v-model="form.centerParamcode" placeholder="请输入中台参数编码" />
<el-form-item label="组名称" prop="issGroupName">
<el-input v-model="form.issGroupName" placeholder="请输入组名称" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="ISSRest地址" prop="issResturl">
<el-input v-model="form.issResturl" placeholder="请输入ISSRest地址" />
<el-form-item label="中台设备号" prop="centerDeviceuuid">
<el-input v-model="form.centerDeviceuuid" placeholder="请输入中台设备号" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="ISSRest端口号" prop="issRestport">
<el-input v-model="form.issRestport" placeholder="请输入ISSRest端口号" />
<el-form-item label="中台参数码" prop="centerParamcode">
<el-input v-model="form.centerParamcode" placeholder="请输入中台参数码" />
</el-form-item>
</el-col>
</el-row>
</el-form>

4
src/views/transerver/viewConfig/index.vue

@ -256,7 +256,7 @@
<el-radio
v-for="dict in sys_yes_no"
:key="dict.value"
:label="dict.value"
:label="dict.label"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
@ -267,7 +267,7 @@
<el-radio
v-for="dict in sys_yes_no"
:key="dict.value"
:label="dict.value"
:label="dict.label"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>

Loading…
Cancel
Save