Browse Source

解决冲突

develop
ljlong_2630 10 months ago
parent
commit
e8ab3dda9d
  1. 10
      src/api/model/tbserverinfo.js
  2. 87
      src/views/model/device/index.vue
  3. 17
      src/views/model/devicemodel/editModel.vue
  4. 115
      src/views/model/paramclass/index.vue
  5. 2
      src/views/model/tbserverinfo/index.vue

10
src/api/model/tbserverinfo.js

@ -59,3 +59,13 @@ export function queryTbserverinfoList() {
method: 'get'
})
}
// 查询TB服务信息列表
export function listserverinfoNoPage(query) {
return request({
url: '/model/dcBusiServerinfo/listNoPage',
method: 'get',
params: query
})
}

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

@ -227,7 +227,7 @@
</el-col>
</el-row>
<!-- 添加或修改设备信息对话框 -->
<el-dialog :title="title" v-model="open" width="800px" append-to-body draggable>
<el-dialog ref="deviceDialog" custom-class="deviceDialogClass" :title="title" v-model="open" width="800px" append-to-body draggable>
<el-form ref="deviceRef" :model="form" :rules="rules" label-width="125px">
<el-row>
<el-col :span="12">
@ -267,6 +267,20 @@
<el-input v-model="form.issGroupName" placeholder="请输入通讯来源设备ID" />
</el-form-item>
</el-col>
<el-col :span="12" v-show="thingsboardShow">
<el-form-item label="thingsboard服务" prop="thingsboardServer">
<el-select v-model="form.thingsboardServer" placeholder="请选择thingsboard服务">
<el-option v-for="dict in tbServerList" :key="dict.id" :label="dict.seviceName" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12" v-show="thingsboardShow">
<el-form-item label="是否同步设备到tb服务" prop="synchroDevice">
<el-select v-model="form.synchroDevice" placeholder="请选择是否同步设备到tb服务">
<el-option v-for="dict in synchro_device" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否可用" prop="enabledFlag">
<el-select v-model="form.enabledFlag" placeholder="请选择是否可用">
@ -282,16 +296,16 @@
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-col :span="12" v-show="false" >
<el-form-item label="所属组织名称" prop="orgName">
<el-tree-select v-model="form.orgName" :data="deptOptions"
:props="{ value: 'label', label: 'label', children: 'children' }" value-key="id" placeholder="请选择"
check-strictly :default-expand-all="true" @node-click="selectDept" />
<el-input v-model="form.orgName" placeholder="请选择组织名称" disabled />
</el-form-item>
</el-col>
<el-col :span="12" v-show="false">
<el-form-item label="所属组织编码" prop="orgCode">
<el-input v-model="form.orgCode" placeholder="请选择组织名称" disabled />
<el-col :span="12">
<el-form-item label="所属组织" prop="orgCode">
<el-tree-select v-model="form.orgCode" :data="deptOptions"
:props="{value: 'id', label: 'label', children: 'children' }" value-key="id" placeholder="请选择"
check-strictly :default-expand-all="true" @node-click="selectDept" />
</el-form-item>
</el-col>
<el-col :span="12">
@ -410,14 +424,27 @@
margin-right: 0 !important;
width: 96%;
}
.loading-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(255, 255, 255, 0.7);
display: flex;
justify-content: center;
align-items: center;
}
</style>
<script setup name="Device">
import { getUuid, getDevice, delDevice, addDevice, updateDevice, listWithFilterColumn, selectDcBaseDeviceinfoMaxSort, cleanRedisCache, addAndSyncParamMap } from "@/api/model/device";
import { listDevicemodel, } from "@/api/model/devicemodel";
import { deptTreeSelect } from "@/api/system/user";
import { listserverinfoNoPage, } from "@/api/model/tbserverinfo";
import lock from "@/assets/icons/svg/lock.svg";
import { ref, onMounted, onUnmounted } from "vue";
import { ElMessageBox } from 'element-plus';
import { ElMessageBox,ElLoading } from 'element-plus';
const { proxy } = getCurrentInstance();
const { dc_img_configuration, dc_device_type, dc_device_source } = proxy.useDict('dc_img_configuration', 'dc_device_type', 'dc_device_source');
const router = useRouter();
@ -444,6 +471,8 @@ const sortProps = ref([]);
const deptName = ref(null);
const devicemodelOptions = ref([]);
const ioserverShow = ref(false);
const thingsboardShow = ref(false);
const tbServerList = ref([]);
const enabledFlag = ref([
{ label: '可用', value: true, elTagType: 'default', elTagClass: null },
{ label: '不可用', value: false, elTagType: 'default', elTagClass: null }
@ -460,6 +489,10 @@ const alertEnabledTable = ref([
{ label: '告警', value: 'true', elTagType: 'default', elTagClass: null },
{ label: '不告警', value: 'false', elTagType: 'default', elTagClass: null }
]);
const synchro_device = ref([
{ label: '同步', value: 'true', elTagType: 'default', elTagClass: null },
{ label: '不同步', value: 'false', elTagType: 'default', elTagClass: null }
])
const data = reactive({
form: {},
params: {
@ -517,6 +550,12 @@ const data = reactive({
orgCode: [
{ required: true, message: "所属组织编码", trigger: "change" }
],
thingsboardServer: [
{ required: thingsboardShow, message: "thingsboard服务", trigger: "change" }
],
synchroDevice: [
{ required: thingsboardShow, message: "是否同步设备到tb服务", trigger: "change" }
],
}
});
@ -655,16 +694,22 @@ function handleUpdate(row) {
/** 提交按钮 */
function submitForm() {
let dialogLoading = null;
proxy.$refs["deviceRef"].validate(valid => {
if (valid) {
dialogLoading = ElLoading.service({
// target: '.deviceDialogClass', // el-dialog
text: 'Loading...', // Loading
background: 'rgba(0,0,0,0.7)', //
})
if (form.value.id != null) {
updateDevice(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
dialogLoading.close();
});
} else {
loading.value = true;
let param = {
"obj": { "centerDeviceCode": form.value.centerDeviceCode },
"params": new Object(),
@ -679,6 +724,7 @@ function submitForm() {
confirmButtonText: '确定',
center: true,
})
dialogLoading.close();
return;
} else {
let param = {
@ -695,6 +741,7 @@ function submitForm() {
confirmButtonText: '确定',
center: true,
})
dialogLoading.close();
return;
} else {
addAndSyncParamMap(form.value).then(response => {
@ -707,12 +754,11 @@ function submitForm() {
} else {
proxy.$modal.msgError(response.data?.msg);
}
dialogLoading.close();
});
}
});
}
loading.value = false;
});
}
}
@ -777,7 +823,7 @@ function getDeptTree() {
};
function selectDept(val) {
form.value.orgCode = val.id;
form.value.orgName = val.label;
}
function deviceSourceChange(val) {
@ -787,8 +833,11 @@ function deviceSourceChange(val) {
}
if (val == '002') {
ioserverShow.value = true;
} else {
thingsboardShow.value = false;
} else if (val == '001') {
getThServerList();
ioserverShow.value = false;
thingsboardShow.value = true;
}
})
}
@ -1019,6 +1068,16 @@ function modelChange(val) {
}
function getThServerList() {
let param = {
"seviceType": "tb",
"enabled": true,
}
listserverinfoNoPage(param).then(response => {
tbServerList.value = response.data;
});
}
getTreeselect();
getDeptTree();
getList();

17
src/views/model/devicemodel/editModel.vue

@ -98,7 +98,7 @@
<el-option v-for="dict in dc_device_partion" :value="dict.value" :label="dict.label" :key="dict.key" />
</el-select>
<el-table ref="dialogTable" v-show="paramClassTableShow" :data="paramModelListShow" key="newTable"
style="width: 100%" :style="{ maxHeight: tableHeightNew }">
style="width: 100%" :style="{ maxHeight: tableHeightNew ,overflow:'auto'}" class="table_over_flow">
<el-table-column type="selection" width="55" :selectable="ifselectable" />
<el-table-column label="参数名称" align="center" prop="paramClassName" />
<el-table-column label="参数编码" align="center" prop="paramClassCode" />
@ -128,6 +128,10 @@
ul {
display: none !important;
}
.table_over_flow{
overflow: auto !important;;
}
}
.customCarousel .vxeTableStyle button {
@ -307,7 +311,7 @@ const columns = ref([
editRender: { name: "$select", options: dc_class_type, attrs: { placeholder: "请输入角色内共享" } },
},
{
field: "devicePartion",
field: "partion",
title: "分区",
width: 'auto',
minWidth: 120,
@ -378,7 +382,7 @@ const config = ref({
custom: true, //
},
editRules: {
devicePartion: [
partion: [
{ required: true, message: '分区不能为空' },
],
}
@ -576,7 +580,7 @@ function partionChange(val) {
paramClassTableShow.value = true;
paramClassTableShowByPartion.value = paramModelList.value;
selectedModelListByPartion.value = selectedModelList.value?.filter(element => {
return element.devicePartion == val;
return element.partion == val;
});
paramModelListShow.value = paramClassTableShowByPartion.value?.filter(element => {
@ -586,9 +590,10 @@ function partionChange(val) {
item.paramClassId = item.paramClassCode;
item.modelId = form.value.modelCode;
item.controllab = false;
item.devicePartion = val;
item.partion = val;
item.id = "ABCDEFXYZ" + form.value.modelCode + item.paramClassCode;
});
debugger
}
@ -695,7 +700,7 @@ function pageChange(currentPage, pageSize) {
function beforeChangeParamClass(envent, row, column) {
if (envent !== undefined && envent) {
let thePartionModelList = selectedModelList.value.filter(item => {
return row.devicePartion === item.devicePartion;
return row.partion === item.partion;
})
paramModelListVxetable.value = paramModelList.value.filter(element => {
return !thePartionModelList.some(item => {

115
src/views/model/paramclass/index.vue

@ -4,45 +4,32 @@
<el-row>
<el-col :span="4">
<el-form-item label="参数名称" prop="paramClassName" label-width="auto">
<el-input
v-model="queryParams.paramClassName"
placeholder="请输入参数名称"
clearable
@keyup.enter="handleQuery"
/>
<el-input v-model="queryParams.paramClassName" placeholder="请输入参数名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="参数编码" prop="paramClassCode" label-width="auto">
<el-input
v-model="queryParams.paramClassCode"
placeholder="请输入参数编码"
clearable
@keyup.enter="handleQuery"
/>
<el-input v-model="queryParams.paramClassCode" placeholder="请输入参数编码" clearable @keyup.enter="handleQuery" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="类别" prop="classType" label-width="auto">
<el-select v-model="queryParams.classType" placeholder="请选择类别" clearable>
<el-option
v-for="dict in dc_class_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
<el-option v-for="dict in dc_class_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="单位" prop="paramUnit" label-width="auto">
<el-select v-model="queryParams.paramUnit" placeholder="请选择单位" clearable>
<el-option
v-for="dict in dc_param_uint_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
<el-option v-for="dict in dc_param_uint_type" :key="dict.value" :label="dict.label" :value="dict.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<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-col>
@ -57,33 +44,27 @@
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="success"
icon="Plus"
@click="handleAdd"
>新增</el-button>
<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-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-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="paramclassList" @selection-change="handleSelectionChange" :max-height="tableHeight" :border="true" :column-width-draggable="true">
<el-table v-loading="loading" :data="paramclassList" @selection-change="handleSelectionChange"
:max-height="tableHeight" :border="true" :column-width-draggable="true">
<el-table-column type="selection" width="55" align="center" fixed="left" />
<el-table-column label="参数名称" align="center" prop="paramClassName" />
<el-table-column label="参数编码" align="center" prop="paramClassCode" />
<el-table-column label="数据类型" align="center" prop="paramType">
<template #default="scope">
<dict-tag :options="dc_param_value_type" :value="scope.row.paramType" />
</template>
</el-table-column>
<el-table-column label="类别" align="center" prop="classType">
<template #default="scope">
<dict-tag :options="dc_class_type" :value="scope.row.classType" />
@ -96,35 +77,23 @@
</el-table-column>
<el-table-column label="备注" align="center" prop="note" />
<!-- <el-table-column label="主键" align="center" prop="id" /> -->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" :width="200" :fixed="fixedColumns?'right':false">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" :width="200"
:fixed="fixedColumns ? 'right' : false">
<template #header>
<div class="fixed-column-header" style="text-align: center;display: block;" @dblclick="toggleFixedColumns">
<span style="text-align: center;display: block;">操作<img style="width:10px;margin-left:5px" v-show="fixedColumns" :src="lock" alt="Image"/></span>
<span style="text-align: center;display: block;">操作<img style="width:10px;margin-left:5px"
v-show="fixedColumns" :src="lock" alt="Image" /></span>
</div>
</template>
<template #default="scope">
<el-button
type="text"
icon="Edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
type="text"
icon="Delete"
@click="handleDelete(scope.row)"
>删除</el-button>
<el-button type="text" icon="Edit" @click="handleUpdate(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"
class="paddingBothLeftRight"
/>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
@pagination="getList" class="paddingBothLeftRight" />
<!-- 添加或修改参数模型信息对话框 -->
<el-dialog :title="title" v-model="open" width="500px" append-to-body draggable>
@ -141,13 +110,19 @@
<el-input v-model="form.paramClassCode" placeholder="请输入参数编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="数据类型" prop="paramType">
<el-select v-model="form.paramType" placeholder="请选择数据类型">
<el-option v-for="dict in dc_param_value_type" :key="dict.value" :label="dict.label"
:value="dict.value">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="类别" prop="classType">
<el-select v-model="form.classType" placeholder="请选择类别">
<el-option
v-for="dict in dc_class_type"
:key="dict.value"
:label="dict.label"
<el-option v-for="dict in dc_class_type" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
@ -155,10 +130,7 @@
<el-col :span="12">
<el-form-item label="单位" prop="paramUnit">
<el-select v-model="form.paramUnit" placeholder="请选择单位">
<el-option
v-for="dict in dc_param_uint_type"
:key="dict.value"
:label="dict.label"
<el-option v-for="dict in dc_param_uint_type" :key="dict.value" :label="dict.label"
:value="dict.value"></el-option>
</el-select>
</el-form-item>
@ -180,15 +152,14 @@
</el-dialog>
</div>
</template>
<style lang="scss" >
@import "@/assets/styles/self-defined.scss";
<style lang="scss" > @import "@/assets/styles/self-defined.scss";
</style>
<script setup name="Paramclass">
import { listParamclass, getParamclass, delParamclass, addParamclass, updateParamclass, listParamclassForRepetition } from "@/api/model/paramclass";
import lock from "@/assets/icons/svg/lock.svg";
import { ElMessageBox } from 'element-plus';
const { proxy } = getCurrentInstance();
const { dc_class_type, dc_param_uint_type } = proxy.useDict('dc_class_type', 'dc_param_uint_type');
const { dc_class_type, dc_param_uint_type, dc_param_value_type } = proxy.useDict('dc_class_type', 'dc_param_uint_type', 'dc_param_value_type');
const paramclassList = ref([]);
const open = ref(false);
const loading = ref(true);
@ -227,7 +198,7 @@ const data = reactive({
{ required: true, message: "参数类型不能为空", trigger: "blur" }
],
paramUnit: [
{ required: true, message: "单位不能为空", trigger: "blur" }
{ required: false, message: "单位不能为空", trigger: "blur" }
],
}
});

2
src/views/model/tbserverinfo/index.vue

@ -101,7 +101,7 @@
@pagination="getList" />
<!-- 添加或修改TB服务信息对话框 -->
<el-dialog :title="title" v-model="open" width="800px" append-to-body>
<el-dialog :title="title" v-model="open" width="800px" append-to-body draggable>
<el-form ref="tbserverinfoRef" :model="form" :rules="rules" class="my-custom-form">
<el-row>

Loading…
Cancel
Save