|
|
@@ -70,7 +70,7 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 设备选择树形下拉框 -->
|
|
|
- <div class="filter-select" style="margin-top: 15px;">
|
|
|
+ <div class="filter-select" style="margin-top: 15px;margin-bottom: 10px;">
|
|
|
<el-popover
|
|
|
placement="bottom-start"
|
|
|
:width="250"
|
|
|
@@ -130,7 +130,7 @@
|
|
|
</div>
|
|
|
<div id="dimension-content" class="filter-content" :class="{'hidden': !dimensionExpanded}">
|
|
|
<!-- 地点纬度 - 树状选择 -->
|
|
|
- <div class="tree-select">
|
|
|
+ <!-- <div class="tree-select">
|
|
|
<div class="tree-header" data-target="location-content" @click="toggleTree('location')">
|
|
|
<span class="font-medium">归属地</span>
|
|
|
<i class="fa fa-chevron-left text-neutral-400 transition-transform duration-300" :class="{'rotate-90': treeExpanded.location}"></i>
|
|
|
@@ -143,10 +143,10 @@
|
|
|
<el-checkbox v-model="dimensionFilters.location.station" label="场站" />
|
|
|
</label>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
|
|
|
<!-- 风机纬度 - 树状选择 -->
|
|
|
- <div class="tree-select">
|
|
|
+ <!-- <div class="tree-select">
|
|
|
<div class="tree-header" data-target="fan-content" @click="toggleTree('fan')">
|
|
|
<span class="font-medium">风机相关</span>
|
|
|
<i class="fa fa-chevron-left text-neutral-400 transition-transform duration-300" :class="{'rotate-90': treeExpanded.fan}"></i>
|
|
|
@@ -165,7 +165,7 @@
|
|
|
<el-checkbox v-model="dimensionFilters.fan.system" label="风机系统" disabled />
|
|
|
</label>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
|
|
|
<!-- 类型维度 - 树状选择 -->
|
|
|
<div class="tree-select">
|
|
|
@@ -976,41 +976,6 @@ export default {
|
|
|
this.equipmentOptions = Object.values(centers);
|
|
|
},
|
|
|
|
|
|
- // 处理设备级联选择器变化
|
|
|
- handleEquipmentCascaderChange(val) {
|
|
|
- console.log('选中的设备节点值:', val);
|
|
|
- // 这里可以添加处理选中设备的逻辑
|
|
|
- // 例如:将选中的设备编号存储到查询参数中
|
|
|
- if (val && val.length > 0) {
|
|
|
- // 由于是多选且支持级联选择,val是一个数组,每个元素是一个路径数组
|
|
|
- // 提取所有选中的设备ID
|
|
|
- const selectedEquipmentIds = [];
|
|
|
-
|
|
|
- val.forEach(path => {
|
|
|
- if (Array.isArray(path)) {
|
|
|
- // 获取路径中的最后一个节点
|
|
|
- const lastNode = path[path.length - 1];
|
|
|
- // 保存设备ID(现在值就是equipmentId)
|
|
|
- if (lastNode) {
|
|
|
- // 如果lastNode是一个对象,取其value或equipmentId属性
|
|
|
- if (typeof lastNode === 'object') {
|
|
|
- selectedEquipmentIds.push(lastNode.value || lastNode.equipmentId || lastNode);
|
|
|
- } else {
|
|
|
- // 如果是字符串或其他基本类型,直接使用
|
|
|
- selectedEquipmentIds.push(lastNode);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- // 将设备ID用逗号拼接成字符串存储到this.queryParams.devices
|
|
|
- this.queryParams.devices = selectedEquipmentIds.join(',');
|
|
|
- } else {
|
|
|
- // 清空设备编号
|
|
|
- this.queryParams.devices = null;
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
// 获取显示标签,只显示第一个选中项,其余用省略号表示
|
|
|
getDisplayLabel(nodes) {
|
|
|
if (!nodes || nodes.length === 0) {
|
|
|
@@ -1195,6 +1160,11 @@ export default {
|
|
|
this.queryParams.center = this.dimensionFilters.location.center;
|
|
|
this.queryParams.pcs = this.dimensionFilters.location.station;
|
|
|
this.queryParams.code = this.dimensionFilters.fan.number;
|
|
|
+ if(this.queryParams.devices && this.queryParams.devices!=null && this.queryParams.devices!='') {
|
|
|
+ this.queryParams.code = true;
|
|
|
+ }else{
|
|
|
+ this.queryParams.code = false;
|
|
|
+ }
|
|
|
this.queryParams.brand = this.dimensionFilters.fan.brand;
|
|
|
this.queryParams.model = this.dimensionFilters.fan.model;
|
|
|
this.queryParams.system = this.dimensionFilters.fan.system;
|
|
|
@@ -1224,6 +1194,7 @@ export default {
|
|
|
}else{
|
|
|
this.queryParams.score = null;
|
|
|
}
|
|
|
+ console.log(this.queryParams);
|
|
|
|
|
|
getHomePageOrderListData(this.queryParams).then(response => {
|
|
|
if (response.code === 200) {
|
|
|
@@ -1233,7 +1204,6 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
handleQuery() {
|
|
|
- console.log(this.queryParams.devices);
|
|
|
this.queryParams.pageNum = 1;
|
|
|
this.applyFilter();
|
|
|
},
|
|
|
@@ -1439,21 +1409,26 @@ export default {
|
|
|
handleEquipmentTreeCheck(data, checkedInfo) {
|
|
|
// 保存选中的节点信息
|
|
|
this.selectedEquipmentNodes = checkedInfo.checkedNodes;
|
|
|
+ // 同时更新selectedEquipment数组以保持与原逻辑兼容
|
|
|
+ this.selectedEquipment = checkedInfo.checkedKeys;
|
|
|
+
|
|
|
+ // 自动更新查询参数中的设备ID
|
|
|
+ this.updateEquipmentQueryParams();
|
|
|
},
|
|
|
|
|
|
- // 确认设备选择
|
|
|
- confirmEquipmentSelection() {
|
|
|
+ // 更新设备查询参数
|
|
|
+ updateEquipmentQueryParams() {
|
|
|
// 提取选中节点的值(设备ID)
|
|
|
const selectedIds = this.selectedEquipmentNodes.map(node => node.value);
|
|
|
|
|
|
- // 更新selectedEquipment以保持与原逻辑兼容
|
|
|
- this.selectedEquipment = selectedIds;
|
|
|
-
|
|
|
// 将设备ID用逗号拼接成字符串存储到this.queryParams.devices
|
|
|
this.queryParams.devices = selectedIds.length > 0 ? selectedIds.join(',') : null;
|
|
|
-
|
|
|
- // 关闭弹出框(如果需要)
|
|
|
- // 注意:这里可能需要通过ref控制popover的显示/隐藏
|
|
|
+ },
|
|
|
+
|
|
|
+ // 确认设备选择(保持向后兼容)
|
|
|
+ confirmEquipmentSelection() {
|
|
|
+ // 这个方法现在主要用于向后兼容,实际选择已经自动更新了
|
|
|
+ this.updateEquipmentQueryParams();
|
|
|
},
|
|
|
|
|
|
resetEquipmentFilter() {
|