|
|
@ -64,12 +64,15 @@ |
|
|
|
/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="所属组织名称" prop="orgName"> |
|
|
|
<el-input |
|
|
|
<!-- <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"/> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="位置编码" prop="locationCode"> |
|
|
|
<el-input |
|
|
@ -271,7 +274,7 @@ |
|
|
|
|
|
|
|
<!-- 添加或修改设备信息对话框 --> |
|
|
|
<el-dialog :title="title" v-model="open" width="800px" append-to-body> |
|
|
|
<el-form ref="deviceRef" :model="form" :rules="rules" label-width="120px"> |
|
|
|
<el-form ref="deviceRef" :model="form" :rules="rules" label-width="125px"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="中台设备编码" prop="centerDeviceCode"> |
|
|
@ -318,13 +321,15 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="所属组织编码" prop="orgCode"> |
|
|
|
<el-input v-model="form.orgCode" placeholder="请输入所属组织编码" /> |
|
|
|
<el-form-item label="所属组织名称" prop="orgName"> |
|
|
|
<el-tree-select v-model="form.orgName" :data="deptOptions" |
|
|
|
:props="{ value: 'label', label: 'label', children: 'children' }" value-key="id" placeholder="请选择" |
|
|
|
check-strictly :default-expand-all="true" @node-click="selectDept"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
|
<el-form-item label="所属组织名称" prop="orgName"> |
|
|
|
<el-input v-model="form.orgName" placeholder="请输入所属组织名称" /> |
|
|
|
<el-form-item label="所属组织编码" prop="orgCode"> |
|
|
|
<el-input v-model="form.orgCode" placeholder="请选择组织名称" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12"> |
|
|
@ -414,7 +419,7 @@ |
|
|
|
</style> |
|
|
|
<script setup name="Device"> |
|
|
|
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 router = useRouter(); |
|
|
@ -430,6 +435,7 @@ const total = ref(0); |
|
|
|
const title = ref(""); |
|
|
|
const collapseVisible = ref(false); |
|
|
|
const editName = ref("更多筛选项"); |
|
|
|
const deptOptions = ref([]); |
|
|
|
const enabledFlag = ref([ |
|
|
|
{label: '可用', value: true, elTagType: 'default', elTagClass: null}, |
|
|
|
{label: '不可用', value: false, elTagType: 'default', elTagClass: null} |
|
|
@ -475,6 +481,27 @@ const data = reactive({ |
|
|
|
deviceGroupId: null |
|
|
|
}, |
|
|
|
rules: { |
|
|
|
deviceName: [ |
|
|
|
{ required: true, message: "设备名称不能为空", trigger: "change" } |
|
|
|
], |
|
|
|
orgCode: [ |
|
|
|
{ required: true, message: "设备编号不能为空", trigger: "change" } |
|
|
|
], |
|
|
|
deviceSource: [ |
|
|
|
{ required: true, message: "通信来源类型不能为空", trigger: "change" } |
|
|
|
], |
|
|
|
deviceSourceId: [ |
|
|
|
{ required: true, message: "通讯来源设备ID不能为空", trigger: "change" } |
|
|
|
], |
|
|
|
deviceType: [ |
|
|
|
{ required: true, message: "设备类型不能为空", trigger: "change" } |
|
|
|
], |
|
|
|
orgName: [ |
|
|
|
{ required: true, message: "所属组织名称", trigger: "change" } |
|
|
|
], |
|
|
|
orgCode: [ |
|
|
|
{ required: true, message: "所属组织编码", trigger: "change" } |
|
|
|
], |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
@ -558,6 +585,7 @@ function handleAdd() { |
|
|
|
loading.value = true; |
|
|
|
getUuid().then(response=>{ |
|
|
|
form.value.centerDeviceCode = response.msg; |
|
|
|
form.value.enabledFlag = true; |
|
|
|
loading.value = false; |
|
|
|
}); |
|
|
|
reset(); |
|
|
@ -645,5 +673,18 @@ function toggleCollapse() { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function getDeptTree() { |
|
|
|
deptTreeSelect().then(response => { |
|
|
|
deptOptions.value = response.data; |
|
|
|
console.log("deptOptions"); |
|
|
|
console.log(deptOptions.value); |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
function selectDept(val){ |
|
|
|
form.value.orgCode=val.id; |
|
|
|
} |
|
|
|
|
|
|
|
getDeptTree(); |
|
|
|
getList(); |
|
|
|
</script> |
|
|
|