|
|
@ -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> |
|
|
|