|
@ -178,7 +178,11 @@ |
|
|
<el-table-column label="偏移量" align="center" prop="setAdjustvalue" /> |
|
|
<el-table-column label="偏移量" align="center" prop="setAdjustvalue" /> |
|
|
<el-table-column label="验证范围" align="center" prop="validateScope" /> |
|
|
<el-table-column label="验证范围" align="center" prop="validateScope" /> |
|
|
<el-table-column label="全局统一编码" align="center" prop="globalCode" /> |
|
|
<el-table-column label="全局统一编码" align="center" prop="globalCode" /> |
|
|
<el-table-column label="参数模版ID" align="center" prop="paramModelId" /> |
|
|
<el-table-column label="参数模版" align="center" prop="paramModelId" > |
|
|
|
|
|
<template #default="scope"> |
|
|
|
|
|
<span>{{ getParamModelName(scope.row.paramModelId) }}</span> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
<el-table-column label="分区(字典)" align="center" prop="partion" /> |
|
|
<el-table-column label="分区(字典)" align="center" prop="partion" /> |
|
|
<el-table-column label="plc地址" align="center" prop="plcAdr" /> |
|
|
<el-table-column label="plc地址" align="center" prop="plcAdr" /> |
|
|
<el-table-column label="是/否可控制" align="center" prop="controllab" /> |
|
|
<el-table-column label="是/否可控制" align="center" prop="controllab" /> |
|
@ -210,111 +214,129 @@ |
|
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body> |
|
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body> |
|
|
<el-form ref="paramsRef" :model="form" :rules="rules" label-width="80px"> |
|
|
<el-form ref="paramsRef" :model="form" :rules="rules" label-width="80px"> |
|
|
|
|
|
|
|
|
<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" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="参数名称" prop="paramName"> |
|
|
<el-form-item label="参数名称" prop="paramName"> |
|
|
<el-input v-model="form.paramName" placeholder="请输入参数名称" /> |
|
|
<el-input v-model="form.paramName" placeholder="请输入参数名称" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="参数编码" prop="paramCode"> |
|
|
<el-form-item label="参数模版" prop="paramModelId"> |
|
|
<el-input v-model="form.paramCode" placeholder="请输入参数编码" /> |
|
|
<el-select v-model="form.paramModelId" placeholder="请选择参数模版ID" @change="checkedParamModel"> |
|
|
</el-form-item> |
|
|
<el-option |
|
|
</el-col> |
|
|
v-for="dict in paramClassList" |
|
|
<el-col :span="12"> |
|
|
:label="dict.paramClassName" |
|
|
<el-form-item label="数据类型" prop="paramType"> |
|
|
:value=dict.id> |
|
|
<el-select v-model="form.paramType" placeholder="请选择数据类型"> |
|
|
</el-option> |
|
|
<el-option |
|
|
</el-select> |
|
|
v-for="dict in dc_param_value_type" |
|
|
</el-form-item> |
|
|
:key="dict.value" |
|
|
</el-col> |
|
|
:label="dict.label" |
|
|
<el-col :span="12"> |
|
|
:value="dict.value"> |
|
|
<el-form-item label="参数编码" prop="paramCode"> |
|
|
</el-option> |
|
|
<el-input v-model="form.paramCode" placeholder="请输入参数编码" /> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="数据类型" prop="paramType"> |
|
|
<el-form-item label="是否可控" prop="contrlFlag"> |
|
|
<el-select v-model="form.paramType" placeholder="请选择数据类型"> |
|
|
<el-select v-model="form.contrlFlag" placeholder="请选择是否可控"> |
|
|
<el-option |
|
|
<el-option label="请选择字典生成" value="" /> |
|
|
v-for="dict in dc_param_value_type" |
|
|
</el-select> |
|
|
:key="dict.value" |
|
|
</el-form-item> |
|
|
:label="dict.label" |
|
|
</el-col> |
|
|
:value="dict.value"> |
|
|
<el-col :span="12"> |
|
|
</el-option> |
|
|
<el-form-item label="参数单位" prop="contrlType"> |
|
|
</el-select> |
|
|
<el-select v-model="form.contrlType" placeholder="请选择参数单位"> |
|
|
</el-form-item> |
|
|
<el-option |
|
|
</el-col> |
|
|
v-for="dict in dc_param_uint_type" |
|
|
<el-col :span="12"> |
|
|
:key="dict.value" |
|
|
<el-form-item label="是否可控" prop="contrlFlag"> |
|
|
:label="dict.label" |
|
|
<el-select v-model="form.contrlFlag" placeholder="请选择是否可控"> |
|
|
:value="dict.value"> |
|
|
<el-option |
|
|
</el-option> |
|
|
v-for="dict in contrlFlag" |
|
|
</el-select> |
|
|
:key="dict.value" |
|
|
</el-form-item> |
|
|
:label="dict.label" |
|
|
</el-col> |
|
|
:value="dict.value"> |
|
|
<el-col :span="12"> |
|
|
</el-option> |
|
|
<el-form-item label="是否有效" prop="enabled"> |
|
|
</el-select> |
|
|
<el-select v-model="form.enabled" placeholder="请选择是否有效"> |
|
|
</el-form-item> |
|
|
<el-option |
|
|
</el-col> |
|
|
v-for="dict in enabled" |
|
|
<el-col :span="12"> |
|
|
:label="dict.label" |
|
|
<el-form-item label="参数单位" prop="contrlType"> |
|
|
:value=dict.value> |
|
|
<el-select v-model="form.contrlType" placeholder="请选择参数单位"> |
|
|
</el-option> |
|
|
<el-option |
|
|
</el-select> |
|
|
v-for="dict in dc_param_uint_type" |
|
|
</el-form-item> |
|
|
:key="dict.value" |
|
|
</el-col> |
|
|
:label="dict.label" |
|
|
<el-col :span="12"> |
|
|
:value="dict.value"> |
|
|
<el-form-item label="设置值" prop="setDefautvalue"> |
|
|
</el-option> |
|
|
<el-input v-model="form.setDefautvalue" placeholder="请输入设置值" /> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="偏移量" prop="setAdjustvalue"> |
|
|
<el-form-item label="是否有效" prop="enabled"> |
|
|
<el-input v-model="form.setAdjustvalue" placeholder="请输入偏移量" /> |
|
|
<el-select v-model="form.enabled" placeholder="请选择是否有效"> |
|
|
</el-form-item> |
|
|
<el-option |
|
|
</el-col> |
|
|
v-for="dict in enabled" |
|
|
<el-col :span="12"> |
|
|
:label="dict.label" |
|
|
<el-form-item label="验证范围" prop="validateScope"> |
|
|
:value=dict.value> |
|
|
<el-input v-model="form.validateScope" placeholder="请输入验证范围" /> |
|
|
</el-option> |
|
|
</el-form-item> |
|
|
</el-select> |
|
|
</el-col> |
|
|
</el-form-item> |
|
|
<el-col :span="12"> |
|
|
</el-col> |
|
|
<el-form-item label="全局统一编码" prop="globalCode"> |
|
|
<el-col :span="12"> |
|
|
<el-input v-model="form.globalCode" placeholder="请输入全局统一编码" /> |
|
|
<el-form-item label="设置值" prop="setDefautvalue"> |
|
|
</el-form-item> |
|
|
<el-input v-model="form.setDefautvalue" placeholder="请输入设置值" /> |
|
|
</el-col> |
|
|
</el-form-item> |
|
|
<el-col :span="12"> |
|
|
</el-col> |
|
|
<el-form-item label="参数模版ID" prop="paramModelId"> |
|
|
<el-col :span="12"> |
|
|
<el-select v-model="form.paramModelId" placeholder="请选择参数模版ID"> |
|
|
<el-form-item label="偏移量" prop="setAdjustvalue"> |
|
|
<el-option label="请选择字典生成" value="" /> |
|
|
<el-input v-model="form.setAdjustvalue" placeholder="请输入偏移量" /> |
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="验证范围" prop="validateScope"> |
|
|
<el-form-item label="分区(字典)" prop="partion"> |
|
|
<el-input v-model="form.validateScope" placeholder="请输入验证范围" /> |
|
|
<el-select v-model="form.partion" placeholder="请选择分区(字典)"> |
|
|
</el-form-item> |
|
|
<el-option label="请选择字典生成" value="" /> |
|
|
</el-col> |
|
|
</el-select> |
|
|
<el-col :span="12"> |
|
|
</el-form-item> |
|
|
<el-form-item label="全局统一编码" prop="globalCode"> |
|
|
</el-col> |
|
|
<el-input v-model="form.globalCode" placeholder="请输入全局统一编码" /> |
|
|
<el-col :span="12"> |
|
|
</el-form-item> |
|
|
<el-form-item label="plc地址" prop="plcAdr"> |
|
|
</el-col> |
|
|
<el-input v-model="form.plcAdr" placeholder="请输入plc地址" /> |
|
|
<el-col :span="12"> |
|
|
</el-form-item> |
|
|
<el-form-item label="分区(字典)" prop="partion"> |
|
|
</el-col> |
|
|
<el-select v-model="form.partion" placeholder="请选择分区(字典)"> |
|
|
<el-col :span="12"> |
|
|
<el-option |
|
|
<el-form-item label="是/否可控制" prop="controllab"> |
|
|
v-for="dict in dc_device_partion" |
|
|
<el-select v-model="form.controllab" placeholder="请选择是/否可控制"> |
|
|
:key="dict.value" |
|
|
<el-option label="请选择字典生成" value="" /> |
|
|
:label="dict.label" |
|
|
</el-select> |
|
|
:value="dict.value"> |
|
|
</el-form-item> |
|
|
</el-option> |
|
|
</el-col> |
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-form-item label="plc地址" prop="plcAdr"> |
|
|
|
|
|
<el-input v-model="form.plcAdr" placeholder="请输入plc地址" /> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-form-item label="是/否可控制" prop="controllab"> |
|
|
|
|
|
<el-select v-model="form.controllab" placeholder="请选择是/否可控制"> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="dict in controllab" |
|
|
|
|
|
:key="dict.value" |
|
|
|
|
|
:label="dict.label" |
|
|
|
|
|
:value="dict.value"> |
|
|
|
|
|
</el-option> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
</el-row> |
|
|
</el-row> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<template #footer> |
|
|
<template #footer> |
|
@ -329,10 +351,10 @@ |
|
|
|
|
|
|
|
|
<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"; |
|
|
const { proxy } = getCurrentInstance(); |
|
|
const { proxy } = getCurrentInstance(); |
|
|
const router = useRouter(); |
|
|
const router = useRouter(); |
|
|
const { dc_param_uint_type, dc_param_value_type } = proxy.useDict('dc_param_uint_type', 'dc_param_value_type'); |
|
|
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 paramsList = ref([]); |
|
|
const open = ref(false); |
|
|
const open = ref(false); |
|
@ -343,17 +365,22 @@ const single = ref(true); |
|
|
const multiple = ref(true); |
|
|
const multiple = ref(true); |
|
|
const total = ref(0); |
|
|
const total = ref(0); |
|
|
const title = ref(""); |
|
|
const title = ref(""); |
|
|
|
|
|
const paramClassList = ref([]); |
|
|
const deviceUuid = router.currentRoute._value.query.deviceUuid; |
|
|
const deviceUuid = router.currentRoute._value.query.deviceUuid; |
|
|
|
|
|
const deviceCode = router.currentRoute._value.query.deviceCode; |
|
|
const contrlFlag = ref([ |
|
|
const contrlFlag = 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 enabled = ref([ |
|
|
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 data = reactive({ |
|
|
const data = reactive({ |
|
|
form: {}, |
|
|
form: { |
|
|
|
|
|
contrlFlag:contrlFlag, |
|
|
|
|
|
enabled:enabled, |
|
|
|
|
|
}, |
|
|
queryParams: { |
|
|
queryParams: { |
|
|
pageNum: 1, |
|
|
pageNum: 1, |
|
|
pageSize: 10, |
|
|
pageSize: 10, |
|
@ -382,7 +409,6 @@ const { queryParams, form, rules } = toRefs(data); |
|
|
/** 查询设备参数明细列表 */ |
|
|
/** 查询设备参数明细列表 */ |
|
|
function getList() { |
|
|
function getList() { |
|
|
loading.value = true; |
|
|
loading.value = true; |
|
|
debugger |
|
|
|
|
|
if(deviceUuid != null && deviceUuid != undefined && deviceUuid != ""){ |
|
|
if(deviceUuid != null && deviceUuid != undefined && deviceUuid != ""){ |
|
|
queryParams.value.deviceUuid = deviceUuid; |
|
|
queryParams.value.deviceUuid = deviceUuid; |
|
|
listParams(queryParams.value).then(response => { |
|
|
listParams(queryParams.value).then(response => { |
|
@ -514,5 +540,39 @@ function handleExport() { |
|
|
}, `params_${new Date().getTime()}.xlsx`) |
|
|
}, `params_${new Date().getTime()}.xlsx`) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function getParamModel() { |
|
|
|
|
|
listParamclass({}).then(response => { |
|
|
|
|
|
console.log("response"); |
|
|
|
|
|
console.log(response); |
|
|
|
|
|
console.log(response.rows); |
|
|
|
|
|
paramClassList.value = response.rows; |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function getParamModelName(id){ |
|
|
|
|
|
paramClassList.value.forEach(item=>{ |
|
|
|
|
|
if(item.id == id){ |
|
|
|
|
|
return item.getParamModelName; |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function checkedParamModel(val){ |
|
|
|
|
|
console.log("val"); |
|
|
|
|
|
console.log(val); |
|
|
|
|
|
let paramClassCodeSeleted = ""; |
|
|
|
|
|
paramClassList.value.forEach(item=>{ |
|
|
|
|
|
console.log("item"); |
|
|
|
|
|
console.log(item); |
|
|
|
|
|
console.log(item.id == val); |
|
|
|
|
|
if(item.id == val){ |
|
|
|
|
|
paramClassCodeSeleted = item.paramClassCode; |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
form.value.paramCode = deviceCode+paramClassCodeSeleted; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
getList(); |
|
|
getList(); |
|
|
|
|
|
getParamModel(); |
|
|
|
|
|
|
|
|
</script> |
|
|
</script> |
|
|