Browse Source

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

pull/1/head
lxg 1 year ago
parent
commit
57c24838e3
  1. 3
      src/views/model/device/index.vue
  2. 102
      src/views/model/params/index.vue

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

@ -609,7 +609,8 @@ function handleParams(row){
router.push({ router.push({
path: path, path: path,
query: { query: {
deviceUuid: row.uuid deviceUuid: row.uuid,
deviceCode: row.centerDeviceCode
} }
}); });
} }

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

@ -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,7 +214,7 @@
<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" />
@ -221,6 +225,17 @@
<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-form-item label="参数模版" prop="paramModelId">
<el-select v-model="form.paramModelId" placeholder="请选择参数模版ID" @change="checkedParamModel">
<el-option
v-for="dict in paramClassList"
:label="dict.paramClassName"
:value=dict.id>
</el-option>
</el-select>
</el-form-item>
</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="请输入参数编码" />
@ -241,7 +256,12 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="是否可控" prop="contrlFlag"> <el-form-item label="是否可控" prop="contrlFlag">
<el-select v-model="form.contrlFlag" placeholder="请选择是否可控"> <el-select v-model="form.contrlFlag" placeholder="请选择是否可控">
<el-option label="请选择字典生成" value="" /> <el-option
v-for="dict in contrlFlag"
:key="dict.value"
:label="dict.label"
:value="dict.value">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -288,17 +308,15 @@
<el-input v-model="form.globalCode" placeholder="请输入全局统一编码" /> <el-input v-model="form.globalCode" placeholder="请输入全局统一编码" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="参数模版ID" prop="paramModelId">
<el-select v-model="form.paramModelId" placeholder="请选择参数模版ID">
<el-option label="请选择字典生成" value="" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="分区(字典)" prop="partion"> <el-form-item label="分区(字典)" prop="partion">
<el-select v-model="form.partion" placeholder="请选择分区(字典)"> <el-select v-model="form.partion" placeholder="请选择分区(字典)">
<el-option label="请选择字典生成" value="" /> <el-option
v-for="dict in dc_device_partion"
:key="dict.value"
:label="dict.label"
:value="dict.value">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -310,11 +328,15 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="是/否可控制" prop="controllab"> <el-form-item label="是/否可控制" prop="controllab">
<el-select v-model="form.controllab" placeholder="请选择是/否可控制"> <el-select v-model="form.controllab" placeholder="请选择是/否可控制">
<el-option label="请选择字典生成" value="" /> <el-option
v-for="dict in controllab"
:key="dict.value"
:label="dict.label"
:value="dict.value">
</el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </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>

Loading…
Cancel
Save