Browse Source

参数里参数单位换成控制类型

develop
ljlong_2630 12 months ago
parent
commit
b138efcab3
  1. 39
      src/views/model/params/index.vue

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

@ -57,10 +57,10 @@
</el-form-item>
</el-col>
<el-col :span="4" v-show="collapseVisible">
<el-form-item label="参数单位" prop="contrlType" label-width="auto">
<el-select v-model="queryParams.contrlType" placeholder="请选择参数单位" clearable>
<el-form-item label="控制类型" prop="contrlType" label-width="auto">
<el-select v-model="queryParams.contrlType" placeholder="请选择控制类型" clearable>
<el-option
v-for="dict in dc_param_uint_type"
v-for="dict in dc_param_control_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@ -197,11 +197,11 @@
<dict-tag :options="enabledTable" :value="scope.row.enabled"/>
</template>
</el-table-column>
<el-table-column label="参数单位" align="center" prop="contrlType" column-key="contrlType" filter-placement="bottom-end"
<el-table-column label="控制类型" align="center" prop="contrlType" column-key="contrlType" filter-placement="bottom-end"
:filters="getfilterNameItem('contrlType')" :filter-method="filterMethod" :width="120" sortable
>
<template #default="scope">
<dict-tag :options="dc_param_uint_type" :value="scope.row.contrlType" :default-value="'Unknown'"/>
<dict-tag :options="dc_param_control_type" :value="scope.row.contrlType" :default-value="'Unknown'"/>
</template>
</el-table-column>
<el-table-column label="设置值" align="center" prop="setDefautvalue" :width="120" sortable/>
@ -294,10 +294,10 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="参数单位" prop="contrlType">
<el-select v-model="form.contrlType" placeholder="请选择参数单位">
<el-form-item label="控制类型" prop="contrlType">
<el-select v-model="form.contrlType" placeholder="请选择控制类型">
<el-option
v-for="dict in dc_param_uint_type"
v-for="dict in dc_param_control_type"
:key="dict.value"
:label="dict.label"
:value="dict.value">
@ -392,7 +392,7 @@ import lock from "@/assets/icons/svg/lock.svg";
import { ElMessageBox } from 'element-plus';
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 { dc_param_control_type, dc_param_value_type, dc_device_partion } = proxy.useDict('dc_param_control_type', 'dc_param_value_type', 'dc_device_partion');
const paramsList = ref([]);
const open = ref(false);
const loading = ref(true);
@ -834,7 +834,7 @@ function getfilterNameItem(value){
});
}
}else if(value==='contrlFlag'){
if(sortItemMap.value[value]?.length>0 && sortItemMap.value[value].value != undefined && sortItemMap.value[value].value != null){
if(sortItemMap.value[value]?.length>0){
result = sortItemMap.value[value].map(element=>{
contrlFlag.value.forEach(item=>{
if(item.value===element.text){
@ -862,10 +862,11 @@ function getfilterNameItem(value){
});
}
}else if(value==='paramModelId'){
if(sortItemMap.value[value]?.length>0 && sortItemMap.value[value].value != undefined && sortItemMap.value[value].value != null){
if(sortItemMap.value[value]?.length>0){
result = sortItemMap.value[value].map(element=>{
let textValue = getParamModelName(element.value);
return {
text: getParamModelName(element.value),
text: textValue,
value: element.value,
};
});
@ -883,6 +884,20 @@ function getfilterNameItem(value){
value: element.value,
};
});
}
}else if(value==='contrlType'){
if(sortItemMap.value[value]?.length>0){
result = sortItemMap.value[value].map(element=>{
dc_param_control_type.value.forEach(item=>{
if(item.value===String(element.text)){
resultItem = item.label;
}
});
return {
text: resultItem,
value: element.value,
};
});
}
}else{
result = sortItemMap.value[value];

Loading…
Cancel
Save