|
@ -5,7 +5,7 @@ |
|
|
<el-input |
|
|
<el-input |
|
|
v-model="queryParams.deviceUuid" |
|
|
v-model="queryParams.deviceUuid" |
|
|
placeholder="请输入中台设备UUID" |
|
|
placeholder="请输入中台设备UUID" |
|
|
clearable |
|
|
disabled |
|
|
@keyup.enter="handleQuery" |
|
|
@keyup.enter="handleQuery" |
|
|
/> |
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
@ -25,6 +25,8 @@ |
|
|
@keyup.enter="handleQuery" |
|
|
@keyup.enter="handleQuery" |
|
|
/> |
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
|
|
|
<el-collapse-transition> |
|
|
|
|
|
<div v-show="collapseVisible"> |
|
|
<el-form-item label="数据类型" prop="paramType"> |
|
|
<el-form-item label="数据类型" prop="paramType"> |
|
|
<el-select v-model="queryParams.paramType" placeholder="请选择数据类型" clearable> |
|
|
<el-select v-model="queryParams.paramType" placeholder="请选择数据类型" clearable> |
|
|
<el-option |
|
|
<el-option |
|
@ -110,9 +112,12 @@ |
|
|
<el-option label="请选择字典生成" value="" /> |
|
|
<el-option label="请选择字典生成" value="" /> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<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="primary" icon="Search" @click="handleQuery">搜索</el-button> |
|
|
<el-button type="info" plain icon="Refresh" @click="resetQuery">重置</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-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
|
|
|
|
|
@ -124,13 +129,13 @@ |
|
|
@click="handleAdd" |
|
|
@click="handleAdd" |
|
|
>新增</el-button> |
|
|
>新增</el-button> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="1.5"> |
|
|
<!-- <el-col :span="1.5"> |
|
|
<el-button |
|
|
<el-button |
|
|
type="success" |
|
|
type="success" |
|
|
icon="Edit" |
|
|
icon="Edit" |
|
|
@click="handleUpdate" |
|
|
@click="handleUpdate" |
|
|
>修改</el-button> |
|
|
>修改</el-button> |
|
|
</el-col> |
|
|
</el-col> --> |
|
|
<el-col :span="1.5"> |
|
|
<el-col :span="1.5"> |
|
|
<el-button |
|
|
<el-button |
|
|
type="success" |
|
|
type="success" |
|
@ -149,44 +154,44 @@ |
|
|
</el-row> |
|
|
</el-row> |
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="paramsList" @selection-change="handleSelectionChange"> |
|
|
<el-table v-loading="loading" :data="paramsList" @selection-change="handleSelectionChange"> |
|
|
<el-table-column type="selection" width="55" align="center" /> |
|
|
<el-table-column type="selection" width="55" align="center" fixed="left"/> |
|
|
<el-table-column label="主键" align="center" prop="id" /> |
|
|
<el-table-column label="主键" align="center" prop="id" /> |
|
|
<el-table-column label="中台设备UUID" align="center" prop="deviceUuid" /> |
|
|
<el-table-column label="中台设备UUID" align="center" prop="deviceUuid" :width="120"/> |
|
|
<el-table-column label="参数名称" align="center" prop="paramName" /> |
|
|
<el-table-column label="参数名称" align="center" prop="paramName" :width="120"/> |
|
|
<el-table-column label="参数编码" align="center" prop="paramCode" /> |
|
|
<el-table-column label="参数编码" align="center" prop="paramCode" :width="120"/> |
|
|
<el-table-column label="数据类型" align="center" prop="paramType"> |
|
|
<el-table-column label="数据类型" align="center" prop="paramType" :width="120"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<dict-tag :options="dc_param_value_type" :value="scope.row.paramType"/> |
|
|
<dict-tag :options="dc_param_value_type" :value="scope.row.paramType"/> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="是否可控" align="center" prop="contrlFlag"> |
|
|
<el-table-column label="是否可控" align="center" prop="contrlFlag" :width="120"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<dict-tag :options="contrlFlag" :value="scope.row.contrlFlag"/> |
|
|
<dict-tag :options="contrlFlagTable" :value="scope.row.contrlFlag"/> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="参数单位" align="center" prop="contrlType"> |
|
|
<el-table-column label="参数单位" align="center" prop="contrlType" :width="120"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<dict-tag :options="dc_param_uint_type" :value="scope.row.contrlType"/> |
|
|
<dict-tag :options="dc_param_uint_type" :value="scope.row.contrlType"/> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="是否有效" align="center" prop="enabled"> |
|
|
<el-table-column label="是否有效" align="center" prop="enabled" :width="120"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<dict-tag :options="enabled" :value="scope.row.enabled"/> |
|
|
<dict-tag :options="enabledTable" :value="scope.row.enabled"/> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="设置值" align="center" prop="setDefautvalue" /> |
|
|
<el-table-column label="设置值" align="center" prop="setDefautvalue" :width="120"/> |
|
|
<el-table-column label="偏移量" align="center" prop="setAdjustvalue" /> |
|
|
<el-table-column label="偏移量" align="center" prop="setAdjustvalue" :width="120"/> |
|
|
<el-table-column label="验证范围" align="center" prop="validateScope" /> |
|
|
<el-table-column label="验证范围" align="center" prop="validateScope" :width="120"/> |
|
|
<el-table-column label="全局统一编码" align="center" prop="globalCode" /> |
|
|
<el-table-column label="全局统一编码" align="center" prop="globalCode" :width="120"/> |
|
|
<el-table-column label="参数模版" align="center" prop="paramModelId" > |
|
|
<el-table-column label="参数模版" align="center" prop="paramModelId" :width="120"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<span>{{ getParamModelName(scope.row.paramModelId) }}</span> |
|
|
<span>{{ getParamModelName(scope.row.paramModelId) }}</span> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column label="分区(字典)" align="center" prop="partion" /> |
|
|
<el-table-column label="分区(字典)" align="center" prop="partion" :width="120"/> |
|
|
<el-table-column label="plc地址" align="center" prop="plcAdr" /> |
|
|
<el-table-column label="plc地址" align="center" prop="plcAdr" :width="120"/> |
|
|
<el-table-column label="是/否可控制" align="center" prop="controllab" /> |
|
|
<el-table-column label="是/否可控制" align="center" prop="controllab" :width="120"/> |
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" :width="200" fixed="right"> |
|
|
<template #default="scope"> |
|
|
<template #default="scope"> |
|
|
<el-button |
|
|
<el-button |
|
|
type="text" |
|
|
type="text" |
|
@ -211,13 +216,13 @@ |
|
|
/> |
|
|
/> |
|
|
|
|
|
|
|
|
<!-- 添加或修改设备参数明细对话框 --> |
|
|
<!-- 添加或修改设备参数明细对话框 --> |
|
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body> |
|
|
<el-dialog :title="title" v-model="open" width="800px" append-to-body> |
|
|
<el-form ref="paramsRef" :model="form" :rules="rules" label-width="80px"> |
|
|
<el-form ref="paramsRef" :model="form" :rules="rules" label-width="120px"> |
|
|
|
|
|
|
|
|
<el-row> |
|
|
<el-row> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="中台设备UUID" prop="deviceUuid"> |
|
|
<el-form-item label="中台设备UUID" prop="deviceUuid"> |
|
|
<el-input v-model="form.deviceUuid" placeholder="请输入中台设备UUID" /> |
|
|
<el-input v-model="form.deviceUuid" placeholder="请输入中台设备UUID" disabled/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
@ -238,7 +243,7 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="参数编码" prop="paramCode"> |
|
|
<el-form-item label="参数编码" prop="paramCode"> |
|
|
<el-input v-model="form.paramCode" placeholder="请输入参数编码" /> |
|
|
<el-input v-model="form.paramCode" placeholder="请输入参数编码" disabled/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
@ -283,7 +288,7 @@ |
|
|
<el-option |
|
|
<el-option |
|
|
v-for="dict in enabled" |
|
|
v-for="dict in enabled" |
|
|
:label="dict.label" |
|
|
:label="dict.label" |
|
|
:value=dict.value> |
|
|
:value="dict.value"> |
|
|
</el-option> |
|
|
</el-option> |
|
|
</el-select> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
@ -305,7 +310,7 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="全局统一编码" prop="globalCode"> |
|
|
<el-form-item label="全局统一编码" prop="globalCode"> |
|
|
<el-input v-model="form.globalCode" placeholder="请输入全局统一编码" /> |
|
|
<el-input v-model="form.globalCode" placeholder="请输入全局统一编码" disabled/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
@ -348,7 +353,9 @@ |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
|
|
|
<style lang="scss" > |
|
|
|
|
|
@import "@/assets/styles/self-defined.scss"; |
|
|
|
|
|
</style> |
|
|
<script setup name="Params"> |
|
|
<script setup name="Params"> |
|
|
import { listParams, getParams, delParams, addParams, updateParams } from "@/api/model/params"; |
|
|
import { listParams, getParams, delParams, addParams, updateParams } from "@/api/model/params"; |
|
|
import { listParamclass } from "@/api/model/paramclass"; |
|
|
import { listParamclass } from "@/api/model/paramclass"; |
|
@ -366,6 +373,8 @@ const multiple = ref(true); |
|
|
const total = ref(0); |
|
|
const total = ref(0); |
|
|
const title = ref(""); |
|
|
const title = ref(""); |
|
|
const paramClassList = ref([]); |
|
|
const paramClassList = ref([]); |
|
|
|
|
|
const collapseVisible = ref(false); |
|
|
|
|
|
const editName = ref("更多筛选项"); |
|
|
const deviceUuid = router.currentRoute._value.query.deviceUuid; |
|
|
const deviceUuid = router.currentRoute._value.query.deviceUuid; |
|
|
const deviceCode = router.currentRoute._value.query.deviceCode; |
|
|
const deviceCode = router.currentRoute._value.query.deviceCode; |
|
|
const contrlFlag = ref([ |
|
|
const contrlFlag = ref([ |
|
@ -376,6 +385,14 @@ const enabled = ref([ |
|
|
{label: '有效', value: true, elTagType: 'default', elTagClass: null}, |
|
|
{label: '有效', value: true, elTagType: 'default', elTagClass: null}, |
|
|
{label: '无效', value: false, 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({ |
|
|
const data = reactive({ |
|
|
form: { |
|
|
form: { |
|
|
contrlFlag:contrlFlag, |
|
|
contrlFlag:contrlFlag, |
|
@ -486,6 +503,7 @@ function handleSelectionChange(selection) { |
|
|
/** 新增按钮操作 */ |
|
|
/** 新增按钮操作 */ |
|
|
function handleAdd() { |
|
|
function handleAdd() { |
|
|
reset(); |
|
|
reset(); |
|
|
|
|
|
form.value.deviceUuid = deviceUuid; |
|
|
open.value = true; |
|
|
open.value = true; |
|
|
title.value = "添加设备参数明细"; |
|
|
title.value = "添加设备参数明细"; |
|
|
} |
|
|
} |
|
@ -542,9 +560,6 @@ function handleExport() { |
|
|
|
|
|
|
|
|
function getParamModel() { |
|
|
function getParamModel() { |
|
|
listParamclass({}).then(response => { |
|
|
listParamclass({}).then(response => { |
|
|
console.log("response"); |
|
|
|
|
|
console.log(response); |
|
|
|
|
|
console.log(response.rows); |
|
|
|
|
|
paramClassList.value = response.rows; |
|
|
paramClassList.value = response.rows; |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
@ -558,18 +573,23 @@ function getParamModelName(id){ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function checkedParamModel(val){ |
|
|
function checkedParamModel(val){ |
|
|
console.log("val"); |
|
|
|
|
|
console.log(val); |
|
|
|
|
|
let paramClassCodeSeleted = ""; |
|
|
let paramClassCodeSeleted = ""; |
|
|
paramClassList.value.forEach(item=>{ |
|
|
paramClassList.value.forEach(item=>{ |
|
|
console.log("item"); |
|
|
|
|
|
console.log(item); |
|
|
|
|
|
console.log(item.id == val); |
|
|
|
|
|
if(item.id == val){ |
|
|
if(item.id == val){ |
|
|
paramClassCodeSeleted = item.paramClassCode; |
|
|
paramClassCodeSeleted = item.paramClassCode; |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
form.value.paramCode = deviceCode+paramClassCodeSeleted; |
|
|
form.value.paramCode = deviceCode+"-"+paramClassCodeSeleted; |
|
|
|
|
|
form.value.globalCode = deviceUuid +"-"+ deviceCode +"-"+paramClassCodeSeleted; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function toggleCollapse() { |
|
|
|
|
|
collapseVisible.value = !collapseVisible.value; |
|
|
|
|
|
if(collapseVisible.value){ |
|
|
|
|
|
editName.value = "折叠筛选项"; |
|
|
|
|
|
}else{ |
|
|
|
|
|
editName.value = "更多筛选项" |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
getList(); |
|
|
getList(); |
|
|