|
@ -15,13 +15,6 @@ |
|
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="90px" |
|
|
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="90px" |
|
|
class="my-custom-form"> |
|
|
class="my-custom-form"> |
|
|
<el-row> |
|
|
<el-row> |
|
|
<!-- <el-col :span="4"> |
|
|
|
|
|
<el-form-item label="机构编号" prop="orgCode"> |
|
|
|
|
|
<el-tree-select v-model="queryParams.orgCode" :data="deptOptions" |
|
|
|
|
|
:props="{ value: 'id', 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="8"> |
|
|
<el-col :span="8"> |
|
|
<el-form-item label="排除设备" prop="excludeDevices"> |
|
|
<el-form-item label="排除设备" prop="excludeDevices"> |
|
|
<el-select v-model="queryParams.excludeDevices" placeholder="请选择排除设备" clearable multiple> |
|
|
<el-select v-model="queryParams.excludeDevices" placeholder="请选择排除设备" clearable multiple> |
|
@ -54,7 +47,7 @@ |
|
|
</el-form> |
|
|
</el-form> |
|
|
<el-row :gutter="10" class="mb8"> |
|
|
<el-row :gutter="10" class="mb8"> |
|
|
<el-col :span="1.5"> |
|
|
<el-col :span="1.5"> |
|
|
<el-button type="success" icon="Plus" @click="handleAdd">新增</el-button> |
|
|
<el-button type="success" icon="Plus" @click="handleAdd" :disabled="disabled">新增</el-button> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<!-- <el-col :span="1.5"> |
|
|
<!-- <el-col :span="1.5"> |
|
|
<el-button type="success" icon="Edit" @click="handleUpdate">修改</el-button> |
|
|
<el-button type="success" icon="Edit" @click="handleUpdate">修改</el-button> |
|
@ -120,9 +113,19 @@ |
|
|
<el-row> |
|
|
<el-row> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
|
<el-form-item label="所属公司" prop="orgCode"> |
|
|
<el-form-item label="所属公司" prop="orgCode"> |
|
|
<el-tree-select v-model="form.orgCode" :data="deptOptions" |
|
|
<el-tree-select |
|
|
:props="{ value: 'id', label: 'label', children: 'children' }" value-key="id" placeholder="请选择" |
|
|
:disabled = "editable" |
|
|
check-strictly :default-expand-all="true" @node-click="selectDept" filterable style="width:100%" /> |
|
|
v-model="form.orgCode" |
|
|
|
|
|
:data="deptOptions" |
|
|
|
|
|
:props="{ value: 'id', label: 'label', children: 'children' }" |
|
|
|
|
|
value-key="id" |
|
|
|
|
|
placeholder="请选择" |
|
|
|
|
|
check-strictly |
|
|
|
|
|
:default-expand-all="true" |
|
|
|
|
|
@node-click="selectDept" |
|
|
|
|
|
filterable |
|
|
|
|
|
style="width:100%" |
|
|
|
|
|
/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="12"> |
|
|
<el-col :span="12"> |
|
@ -131,7 +134,7 @@ |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="24"> |
|
|
<el-col :span="24"> |
|
|
<el-form-item label="发送地址" prop="sendIp"> |
|
|
<el-form-item label="发送地址" prop="sendIp" v-hasPermi="['model:heatapiconf:edit']"> |
|
|
<el-input v-model="form.sendIp" placeholder="请输入发送地址" /> |
|
|
<el-input v-model="form.sendIp" placeholder="请输入发送地址" /> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
@ -187,6 +190,9 @@ const listDevices = ref([]); |
|
|
const orgCode = ref(null); |
|
|
const orgCode = ref(null); |
|
|
const listDeviceAll = ref([]); |
|
|
const listDeviceAll = ref([]); |
|
|
const param = ref({}); |
|
|
const param = ref({}); |
|
|
|
|
|
const disabled = ref(false); |
|
|
|
|
|
const editable = ref(false); |
|
|
|
|
|
const treeSelected = ref(null); |
|
|
const data = reactive({ |
|
|
const data = reactive({ |
|
|
form: {}, |
|
|
form: {}, |
|
|
queryParams: { |
|
|
queryParams: { |
|
@ -219,6 +225,7 @@ function cancel() { |
|
|
open.value = false; |
|
|
open.value = false; |
|
|
form.value.standard = null; |
|
|
form.value.standard = null; |
|
|
loading.value = false; |
|
|
loading.value = false; |
|
|
|
|
|
editable.value = false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 表单重置 |
|
|
// 表单重置 |
|
@ -253,6 +260,7 @@ function resetQuery() { |
|
|
queryParams.value.standard = null; |
|
|
queryParams.value.standard = null; |
|
|
queryParams.value.sendIp = null; |
|
|
queryParams.value.sendIp = null; |
|
|
queryParams.value.excludeDevices = []; |
|
|
queryParams.value.excludeDevices = []; |
|
|
|
|
|
treeSelected.value = null; |
|
|
handleQuery(); |
|
|
handleQuery(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -274,6 +282,12 @@ function handleAdd() { |
|
|
title.value = "添加供热办推送接口配置"; |
|
|
title.value = "添加供热办推送接口配置"; |
|
|
form.value.excludeDevices = null; |
|
|
form.value.excludeDevices = null; |
|
|
getListDevice(); |
|
|
getListDevice(); |
|
|
|
|
|
if(treeSelected.value != null && treeSelected.value != ''){ |
|
|
|
|
|
editable.value = true; |
|
|
|
|
|
}else{ |
|
|
|
|
|
editable.value = false; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 修改按钮操作 */ |
|
|
/** 修改按钮操作 */ |
|
@ -296,10 +310,16 @@ function handleUpdate(row) { |
|
|
getListDevice(row.orgCode); |
|
|
getListDevice(row.orgCode); |
|
|
getHeatapiconf(_id).then(response => { |
|
|
getHeatapiconf(_id).then(response => { |
|
|
form.value = response.data; |
|
|
form.value = response.data; |
|
|
form.value.excludeDevices = form.value.excludeDevices?.split(","); |
|
|
if(form.value.excludeDevices != null && form.value.excludeDevices?.trim() != ""){ |
|
|
|
|
|
form.value.excludeDevices = form.value.excludeDevices.split(","); |
|
|
|
|
|
}else{ |
|
|
|
|
|
form.value.excludeDevices = null; |
|
|
|
|
|
} // 将机构名称赋值给form对象的orgName属性 |
|
|
open.value = true; |
|
|
open.value = true; |
|
|
title.value = "修改供热办推送接口配置"; |
|
|
title.value = "修改供热办推送接口配置"; |
|
|
}); |
|
|
}); |
|
|
|
|
|
editable.value = true; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** 提交按钮 */ |
|
|
/** 提交按钮 */ |
|
@ -364,6 +384,8 @@ function handleNodeClick(data) { |
|
|
queryParams.value.orgCode = data.id; |
|
|
queryParams.value.orgCode = data.id; |
|
|
form.value.orgCode = data.id; |
|
|
form.value.orgCode = data.id; |
|
|
form.value.orgName = data.label; |
|
|
form.value.orgName = data.label; |
|
|
|
|
|
disabled.value = data.isLeaf |
|
|
|
|
|
treeSelected.value = data.id; |
|
|
handleQuery(); |
|
|
handleQuery(); |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
@ -411,27 +433,26 @@ const calculateTableHeight = () => { |
|
|
tableHeight.value = remainingHeight + 'px'; |
|
|
tableHeight.value = remainingHeight + 'px'; |
|
|
}); |
|
|
}); |
|
|
}; |
|
|
}; |
|
|
|
|
|
function getDeptTreeNew(data) { |
|
|
function getDeptTreeNew(data, level = 0) { |
|
|
|
|
|
const result = []; |
|
|
const result = []; |
|
|
if (level === 0) { |
|
|
data.forEach(item => { |
|
|
data.forEach(item => { |
|
|
if (item.orgType === '2') { |
|
|
if (item.children) { |
|
|
const newItem = { ...item }; // 使用深拷贝创建新的部门对象 |
|
|
result.push(...getDeptTreeNew(item.children, level + 1)); |
|
|
newItem.children = []; // 将叶节点的 children 属性设置为空数组,不包含子节点 |
|
|
} |
|
|
newItem.isLeaf = false; |
|
|
}); |
|
|
newItem.id = String(item.id); |
|
|
} else { |
|
|
result.push(newItem); |
|
|
data.forEach(item => { |
|
|
} else if (item.children) { |
|
|
if (level < 2) { |
|
|
const children = getDeptTreeNew(item.children); // 递归调用处理子节点 |
|
|
const newItem = { ...item }; |
|
|
if (children.length > 0) { |
|
|
newItem.id = String(item.id); // 格式化id为字符串 |
|
|
const newItem = { ...item }; // 使用深拷贝创建新的部门对象 |
|
|
if (item.children) { |
|
|
newItem.children = children; |
|
|
newItem.children = getDeptTreeNew(item.children, level + 1); |
|
|
newItem.isLeaf = true; |
|
|
} |
|
|
newItem.id = String(item.id); |
|
|
result.push(newItem); |
|
|
result.push(newItem); |
|
|
} |
|
|
} |
|
|
}); |
|
|
} |
|
|
} |
|
|
}); |
|
|
return result; |
|
|
return result; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|