Browse Source

临时设备和参数功能问题修复

pull/1/head
ljlong_2630 1 year ago
parent
commit
8c71ba67d2
  1. 88
      src/views/model/device/index.vue
  2. 1
      src/views/model/devicemodel/index.vue
  3. 13
      src/views/model/params/index.vue

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

@ -18,23 +18,18 @@
/>
</el-form-item>
<el-form-item label="通讯来源类型" prop="deviceSource">
<el-input
v-model="queryParams.deviceSource"
placeholder="请输入通讯来源类型"
clearable
@keyup.enter="handleQuery"
/>
<el-select v-model="queryParams.deviceSource" placeholder="请选择是否可用" clearable>
<el-option
v-for="dict in dc_device_source"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@change="deviceSourceChange"
/>
</el-select>
</el-form-item>
<el-collapse-transition>
<div v-show="collapseVisible">
<el-form-item label="通讯来源设备ID" prop="deviceSourceId">
<el-input
v-model="queryParams.deviceSourceId"
placeholder="请输入通讯来源设备ID"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="是否可用" prop="enabledFlag">
<el-select v-model="queryParams.enabledFlag" placeholder="请选择是否可用" clearable>
<el-option
@ -55,21 +50,7 @@
/>
</el-select>
</el-form-item>
<el-form-item label="所属组织编码" prop="orgCode">
<el-input
v-model="queryParams.orgCode"
placeholder="请输入所属组织编码"
clearable
@keyup.enter="handleQuery"
/>
</el-form-item>
<el-form-item label="所属组织名称" prop="orgName">
<!-- <el-input
v-model="queryParams.orgName"
placeholder="请输入所属组织名称"
clearable
@keyup.enter="handleQuery"
/> -->
<el-tree-select v-model="queryParams.orgName" :data="deptOptions"
:props="{ value: 'label', label: 'label', children: 'children' }" value-key="id" placeholder="请选择组织名称"
check-strictly :default-expand-all="true"/>
@ -213,7 +194,6 @@
<el-table-column label="中台设备编码" align="center" prop="centerDeviceCode" :width="120"/>
<el-table-column label="设备名称" align="center" prop="deviceName" :width="120"/>
<el-table-column label="通讯来源类型" align="center" prop="deviceSource" :width="120"/>
<el-table-column label="通讯来源设备ID" align="center" prop="deviceSourceId" :width="120"/>
<el-table-column label="是否可用" align="center" prop="enabledFlag" :width="120">
<template #default="scope">
<dict-tag :options="enabledFlagTable" :value="scope.row.enabledFlag"/>
@ -224,7 +204,6 @@
<dict-tag :options="dc_device_type" :value="scope.row.deviceType"/>
</template>
</el-table-column>
<el-table-column label="所属组织编码" align="center" prop="orgCode" :width="120"/>
<el-table-column label="所属组织名称" align="center" prop="orgName" :width="120" />
<el-table-column label="位置编码" align="center" prop="locationCode" :width="120"/>
<el-table-column label="位置名称" align="center" prop="locationName" :width="120"/>
@ -278,7 +257,12 @@
<el-row>
<el-col :span="12">
<el-form-item label="中台设备编码" prop="centerDeviceCode">
<el-input disabled v-model="form.centerDeviceCode" placeholder="请输入中台设备编码" />
<el-input :disabled="disabled" v-model="form.centerDeviceCode" placeholder="请输入中台设备编码" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="主键" prop="uuid">
<el-input disabled v-model="form.uuid" placeholder="请输入主键" />
</el-form-item>
</el-col>
<el-col :span="12">
@ -288,7 +272,15 @@
</el-col>
<el-col :span="12">
<el-form-item label="通讯来源类型" prop="deviceSource">
<el-input v-model="form.deviceSource" placeholder="请输入通讯来源类型;ThingsDB/KingIO/Tk" />
<el-select v-model="form.deviceSource" placeholder="请选择是否可用">
<el-option
v-for="dict in dc_device_source"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@change="deviceSourceChange"
/>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
@ -421,7 +413,7 @@
import { getUuid, listDevice, getDevice, delDevice, addDevice, updateDevice } from "@/api/model/device";
import { deptTreeSelect } from "@/api/system/user";
const { proxy } = getCurrentInstance();
const { dc_device_type } = proxy.useDict('dc_device_type');
const { dc_device_type, dc_device_source } = proxy.useDict('dc_device_type','dc_device_source');
const router = useRouter();
const deviceList = ref([]);
@ -436,6 +428,7 @@ const title = ref("");
const collapseVisible = ref(false);
const editName = ref("更多筛选项");
const deptOptions = ref([]);
const disabled = ref(false);
const enabledFlag = ref([
{label: '可用', value: true, elTagType: 'default', elTagClass: null},
{label: '不可用', value: false, elTagType: 'default', elTagClass: null}
@ -585,6 +578,7 @@ function handleAdd() {
loading.value = true;
getUuid().then(response=>{
form.value.centerDeviceCode = response.msg;
form.value.uuid = response.msg;
form.value.enabledFlag = true;
loading.value = false;
});
@ -644,22 +638,22 @@ function handleExport() {
}, `device_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
// debugger
console.log("-------------"+queryParams.deviceType);
queryParams.deviceType = queryParams.deviceType;
//
//
// form.value.pid=tempPid;
});
// onMounted(() => {
// // debugger
// // console.log("-------------"+queryParams.deviceType);
// // queryParams.deviceType = queryParams.deviceType;
// //
// //
// // form.value.pid=tempPid;
// });
function handleParams(row){
const path = "params";
router.push({
path: path,
path: "params",
query: {
deviceUuid: row.uuid,
deviceCode: row.centerDeviceCode
deviceCode: row.centerDeviceCode,
uuidDisabled: false,
}
});
}
@ -676,8 +670,6 @@ function toggleCollapse() {
function getDeptTree() {
deptTreeSelect().then(response => {
deptOptions.value = response.data;
console.log("deptOptions");
console.log(deptOptions.value);
});
};
@ -685,6 +677,10 @@ function selectDept(val){
form.value.orgCode=val.id;
}
function deviceSourceChange(val){
form.value.deviceSourceId=val.deviceSourceId;
}
getDeptTree();
getList();
</script>

1
src/views/model/devicemodel/index.vue

@ -237,7 +237,6 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询设备模型信息列表 */
function getList() {
debugger
loading.value = true;
listDevicemodel(queryParams.value).then(response => {
devicemodelList.value = proxy.handleTree(response.data, "id", "pid");

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

@ -5,7 +5,7 @@
<el-input
v-model="queryParams.deviceUuid"
placeholder="请输入中台设备UUID"
disabled
:disabled="uuidDisabled"
@keyup.enter="handleQuery"
/>
</el-form-item>
@ -150,8 +150,8 @@
<el-table v-loading="loading" :data="paramsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" fixed="left"/>
<el-table-column label="主键" align="center" prop="id" />
<el-table-column label="中台设备UUID" align="center" prop="deviceUuid" :width="120"/>
<!-- <el-table-column label="主键" align="center" prop="id" />
<el-table-column label="中台设备UUID" align="center" prop="deviceUuid" :width="120"/> -->
<el-table-column label="参数名称" align="center" prop="paramName" :width="120"/>
<el-table-column label="参数编码" align="center" prop="paramCode" :width="120"/>
<el-table-column label="数据类型" align="center" prop="paramType" :width="120">
@ -183,7 +183,11 @@
<span>{{ getParamModelName(scope.row.paramModelId) }}</span>
</template>
</el-table-column>
<el-table-column label="分区(字典)" align="center" prop="partion" :width="120"/>
<el-table-column label="分区(字典)" align="center" prop="partion" :width="120">
<template #default="scope">
<dict-tag :options="dc_device_partion" :value="scope.row.partion"/>
</template>
</el-table-column>
<el-table-column label="plc地址" align="center" prop="plcAdr" :width="120"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" :width="200" fixed="right">
<template #default="scope">
@ -356,6 +360,7 @@ const total = ref(0);
const title = ref("");
const paramClassList = ref([]);
const collapseVisible = ref(false);
const uuidDisabled = (router.currentRoute._value.query.deviceUuid !== undefined&&router.currentRoute._value.query.deviceUuid !== null&&router.currentRoute._value.query.deviceUuid !=="")?router.currentRoute._value.query.deviceUuid:false;
const editName = ref("更多筛选项");
const deviceUuid = router.currentRoute._value.query.deviceUuid;
const deviceCode = router.currentRoute._value.query.deviceCode;

Loading…
Cancel
Save