Browse Source

add:照明系统/通风系统 交互改动

temp
chenpingsen 3 months ago
parent
commit
2d40e8d26d
  1. 2
      hx-ai-intelligent/src/api/IlluminationInfo.ts
  2. 2
      hx-ai-intelligent/src/api/airConditionControlSystem.ts
  3. 4
      hx-ai-intelligent/src/api/planManage.ts
  4. 2
      hx-ai-intelligent/src/api/ventilatingSystem.ts
  5. 37
      hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/tabs2.vue
  6. 13
      hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/tabs3.vue
  7. 28
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue
  8. 12
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/light.vue
  9. 89
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue
  10. 54
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue
  11. 30
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs3.vue
  12. 1
      hx-ai-intelligent/src/view/equipmentControl/style/color.less
  13. 1
      hx-ai-intelligent/src/view/equipmentControl/style/dialogStyle.less
  14. 109
      hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanControl.vue
  15. 29
      hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanLog.vue
  16. 42
      hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanPlant.vue
  17. 150
      hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/index.vue

2
hx-ai-intelligent/src/api/IlluminationInfo.ts

@ -1,4 +1,4 @@
const prefix = '/carbon-smart';
const prefix = '/carbon-smart/api';
// 照明系统及相关接口
export enum lightingManage {
// 主页 ========================================================

2
hx-ai-intelligent/src/api/airConditionControlSystem.ts

@ -1,4 +1,4 @@
const prefix = '/carbon-smart';
const prefix = '/carbon-smart/api';
// 空调系统及相关接口
export enum airConditionControl {
// 主页 ======================================================

4
hx-ai-intelligent/src/api/planManage.ts

@ -1,4 +1,4 @@
const prefix = '/carbon-smart';
const prefix = '/carbon-smart/api';
// 照明系统及相关接口
export enum planManage {
/**
@ -10,4 +10,6 @@ export enum planManage {
getTableData = prefix + '/deviceCtrlPlan/getActivatedPlanList',
// 提交计划状态修改
submitTransData = prefix + '/deviceCtrlPlan/activePlanByIdList',
// 用于确认当前是否有计划正在运行
getRunningPlan = prefix + '/deviceCtrlPlan/getRunningPlan',
}

2
hx-ai-intelligent/src/api/ventilatingSystem.ts

@ -1,5 +1,5 @@
// 前缀
const prefix = '/carbon-smart';
const prefix = '/carbon-smart/api';
// 通风系统相关接口
export enum ventilating {
// 排风扇相关 =============================================

37
hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/tabs2.vue

@ -1,7 +1,12 @@
<template>
<div class="div-add">
<button class="add" @click="addModal">添加</button>
<a-popconfirm title="是否提交以上修改?" ok-text="确定" cancel-text="取消" @confirm="sendTable">
<a-popconfirm
title="是否提交以上修改?"
placement="bottomLeft"
ok-text="确定"
cancel-text="取消"
@confirm="sendTable">
<button class="add" style="margin-left: 20px">执行</button>
</a-popconfirm>
</div>
@ -47,6 +52,7 @@
title="此操作将移除该数据"
ok-text="确定"
cancel-text="取消"
placement="topRight"
@confirm="deletePlan(row)">
<div class="tabDelete">删除</div>
</a-popconfirm>
@ -55,7 +61,7 @@
</tbody>
</table>
<div class="out-dialog" v-if="addVisible">
<div class="content" v-if="addVisible">
<div class="content">
<div class="div-operation"></div>
<span class="text-operation">计划库</span>
</div>
@ -132,7 +138,15 @@
// /
const togglePlan = (state: number) => {
dataSource.value.forEach((item: any) => {
//
if (state == 1) {
if (item.executeStatus.value != 2) {
item.executeStatus.value = state;
}
//
} else {
item.executeStatus.value = state;
}
});
};
@ -155,19 +169,32 @@
const deletePlan = (row: any) => {
row.executeStatus.value = 0;
};
// = 1
// = 1
const startPlan = (row: any) => {
if (row.executeStatus.value == 1) {
return message.info('该数据已是待执行状态,无需再次修改');
}
if (row.executeStatus.value == 2) {
return message.info('执行中的状态已被启用,无需修改');
}
row.executeStatus.value = 1;
};
//
const sendTable = () => {
http.post(airConditionControl.submitTableData, dataSource.value).then(() => {
http
.post(
airConditionControl.submitTableData +
`?projectId=${state.projectId}${state.siteId ? `&siteId=${state.siteId}` : ''}`,
dataSource.value,
)
.then((res) => {
if (res.retcode == 0) {
message.success('操作成功');
getTable();
getLeftPlan();
} else {
message.info(res.msg);
}
});
};
@ -225,7 +252,7 @@
getLeftPlan();
});
};
// 穿
const filterOption = (inputValue: string, option: any) => {
return option.description.indexOf(inputValue) > -1;
};

13
hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/tabs3.vue

@ -11,7 +11,7 @@
</thead>
<tbody>
<tr
:style="{ color: row.ctrlResult == 0 ? 'red' : 'white' }"
:style="{ color: row.ctrlResult == 1 ? 'red' : 'white' }"
v-for="(row, index) in dataSource"
:key="index"
@click="handleRowClick(row.id, index)"
@ -20,7 +20,7 @@
<td>{{ row.startTime }}</td>
<td>{{ row.operationContent }}</td>
<td>{{ row.createUser }}</td>
<td>{{ row.ctrlResult ? '成功' : '失败' }}</td>
<td>{{ row.ctrlResult ? '失败' : '成功' }}</td>
</tr>
</tbody>
</table>
@ -163,6 +163,8 @@
};
//
const reset = () => {
trIndex.value = -1;
logModalVisible.value = false;
pagination.value = {
pageSize: 10,
pageNum: 1,
@ -172,13 +174,8 @@
};
//
const handleRowClick = (id: any, index: any) => {
//
if (index === trIndex.value) {
return;
} else {
trIndex.value = index;
getLogDetail(id);
}
};
// ==================================================
@ -200,7 +197,7 @@
const cxList = ref([]);
</script>
<style lang="less" scoped>
@import './dialogStyle.less';
@import '../style/dialogStyle.less';
//
.div-add {

28
hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue

@ -56,14 +56,15 @@
ref="tabs1Ref"
@reset="reset"
@reload="reload"
@changeArea="changeArea"
@reset-all="resetDrawer"
@change-area="changeArea"
:treeData="treeData" />
</a-tab-pane>
<a-tab-pane key="2" tab="计划列表" force-render>
<tabs2 />
<tabs2 ref="tabs2Ref" @reset-all="resetDrawer" />
</a-tab-pane>
<a-tab-pane key="3" tab="日志">
<tabs3 />
<tabs3 ref="tabs3Ref" @reset-all="resetDrawer" />
</a-tab-pane>
</a-tabs>
</a-drawer>
@ -269,8 +270,29 @@
const toggleDrawer = () => {
visible.value = !visible.value;
};
// tabtab
const resetDrawer = () => {
//
getBulbs();
// tab1
reload();
tabs1Ref.value.refresh();
// tab2 tab3
try {
// tab2
tabs2Ref.value.reset();
} catch {}
try {
// tab3
tabs3Ref.value.reset();
} catch {}
};
// tab1
const tabs1Ref = ref();
// tab2
const tabs2Ref = ref();
// tab3
const tabs3Ref = ref();
</script>
<style lang="less" scoped>
@import './index.less';

12
hx-ai-intelligent/src/view/equipmentControl/lightingManage/light.vue

@ -7,7 +7,9 @@
<img src="/asset/image//bulbLogo/21962.png" alt="" />
<span class="tag-text">{{ blub.regionName + ' > ' + blub.deviceGroupName }}</span></div
>
<button class="right-button">{{ record.runStatus.label }}</button>
<button class="right-button">{{
record?.runStatus?.label ? record.runStatus.label : '--'
}}</button>
</div>
<div class="light-tag-box">
<div class="tag-box-item">
@ -36,25 +38,25 @@
<div class="icon-box" :style="props.blub.styleText">
<!-- 正常=0 -->
<img
v-if="record.runStatus.value == 0"
v-if="record?.runStatus?.value == 0"
class="icon-item"
src="/asset/image/bulbLogo/on.png"
alt="" />
<!-- 故障=1 -->
<img
v-if="record.runStatus.value == 1"
v-if="record?.runStatus?.value == 1"
class="icon-item"
src="/asset/image/bulbLogo/off.png"
alt="" />
<!-- 维修=2 -->
<img
v-if="record.runStatus.value == 2"
v-if="record?.runStatus?.value == 2"
class="icon-item"
src="/asset/image/bulbLogo/repair.png"
alt="" />
<!-- 警告=3 -->
<img
v-if="record.runStatus.value == 3"
v-if="record?.runStatus?.value == 3"
class="icon-item"
src="/asset/image/bulbLogo/alarm.png"
alt="" />

89
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue

@ -265,12 +265,13 @@
</template>
<script setup lang="ts">
import { ref, computed, onMounted } from 'vue';
import { ref, computed, onMounted, watch } from 'vue';
import { DownOutlined, UpOutlined, StopOutlined } from '@ant-design/icons-vue';
import { message } from 'ant-design-vue';
import { message, Modal } from 'ant-design-vue';
//
import { http } from '/nerv-lib/util/http';
import { lightingManage } from '/@/api/IlluminationInfo';
import { planManage } from '/@/api/planManage';
//
import { items } from '/@/store/item';
@ -299,12 +300,24 @@
},
},
});
watch(
() => props.treeData,
(newValue) => {
//
buttons2.value = newValue[0].childList;
},
{
deep: true,
},
);
/**
* @method changeArea 用于控制俯视图的选中状态
* @method reset 用于重置按钮区
* @method reload 用于刷新一次页面
* @method resetAll 刷新所有tab对计划进行修改时需刷新tab2与tab3
*/
const emit = defineEmits(['changeArea', 'reset', 'reload']);
const emit = defineEmits(['changeArea', 'reset', 'reload', 'resetAll']);
// =======================================================================
@ -666,22 +679,21 @@
changeList.value.forEach((item: any) => {
resetChangeList(item);
});
}
changeList.value = [];
if (!reload) {
lockList.value.forEach((item: any) => {
resetLockList(item);
});
}
lockList.value = [];
//
//
let data = props.treeData[0];
//
data.selected = true;
// 1-1
buttons2.value = data.childList;
resetMode();
}
changeList.value = [];
lockList.value = [];
};
// /
const resetLockList = (item: any) => {
props.treeData.find((v: any) => {
@ -730,6 +742,55 @@
return message.info('未产生任何修改');
}
http
.get(planManage.getRunningPlan, {
deviceType: 1,
projectId: state.projectId,
siteId: state.siteId,
})
.then((res) => {
//
if (res.data && res.data.length) {
// 使confirm
// Modal.confirm({
// title: '',
// content: '""',
// onOk() {
// return new Promise((resolve, reject) => {
// });
// },
// onCancel() { },
// });
let flag = window.confirm('有计划正在执行,点击"确定"将暂停当前计划');
if (flag) {
//
http
.post(lightingManage.submitChangeList, {
projectId: state.projectId,
siteId: state.siteId,
lockList: [],
sceneList: [],
})
.then((res) => {
console.log(res, '成功');
//
if (res.retcode == 0) {
sendChangeList();
//
} else {
message.error('关闭进行中的任务操作失败,请重新尝试');
}
});
}
//
} else {
sendChangeList();
}
});
};
// /
const sendChangeList = () => {
http
.post(lightingManage.getChangeList, {
sceneList: changeList.value,
lockList: lockList.value,
@ -737,11 +798,11 @@
siteId: state.siteId,
})
.then((res) => {
if (res.msg === 'success') {
if (res.retcode == 0) {
diffList.value = res.data;
executeVisible.value = true;
} else {
message.warning('获取修改内容失败');
message.error('获取修改内容失败');
}
})
.catch(() => {});
@ -792,7 +853,7 @@
.then((res) => {
let data = res.data;
//
if (data.retcode != 0) {
if (res.retcode != 0) {
//
return message.warning(data.msg);
}
@ -803,8 +864,8 @@
} else {
message.info(`${data.successList.length}条修改成功,${data.failList.length}条修改失败`);
}
emit('reload');
refresh(true);
emit('resetAll');
})
.catch(() => {});
};
@ -829,8 +890,6 @@
changeLine,
//
refresh,
resetLockList,
resetChangeList,
});
</script>
<style lang="less" scoped>

54
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue

@ -1,7 +1,12 @@
<template>
<div class="div-add">
<button class="add" @click="addModal">添加</button>
<a-popconfirm title="是否提交以上修改?" ok-text="确定" cancel-text="取消" @confirm="sendTable">
<a-popconfirm
title="是否提交以上修改?"
placement="bottomLeft"
ok-text="确定"
cancel-text="取消"
@confirm="sendTable">
<button class="add" style="margin-left: 20px">执行</button>
</a-popconfirm>
</div>
@ -47,6 +52,7 @@
title="此操作将移除该数据"
ok-text="确定"
cancel-text="取消"
placement="topRight"
@confirm="deletePlan(row)">
<div class="tabDelete">删除</div>
</a-popconfirm>
@ -55,7 +61,7 @@
</tbody>
</table>
<div class="out-dialog" v-if="addVisible">
<div class="content" v-if="addVisible">
<div class="content">
<div class="div-operation"></div>
<span class="text-operation">计划库</span>
</div>
@ -93,18 +99,22 @@
// ===========================================================
onMounted(() => {
//
getStateEnum();
//
getTable();
// 穿
getLeftPlan();
// 穿
reset();
});
//
const state = items();
//
const getStateEnum = async () => {
let enumData = await getEnum({ params: { enumType: 'PlanExecuteStatus' } });
stateList.value = enumData.data;
};
/**
* @method resetAll 刷新3个tab中的全部数据修改计划会影响tab1数据信息生成tab3日志
*/
const emit = defineEmits(['resetAll']);
// tab ========================================================
@ -132,7 +142,15 @@
// /
const togglePlan = (state: number) => {
dataSource.value.forEach((item: any) => {
//
if (state == 1) {
if (item.executeStatus.value != 2) {
item.executeStatus.value = state;
}
//
} else {
item.executeStatus.value = state;
}
});
};
@ -160,6 +178,9 @@
if (row.executeStatus.value == 1) {
return message.info('该数据已是待执行状态,无需再次修改');
}
if (row.executeStatus.value == 2) {
return message.info('执行中的状态已被启用,无需修改');
}
row.executeStatus.value = 1;
};
//
@ -173,14 +194,21 @@
.then((res) => {
if (res.retcode == 0) {
message.success('操作成功');
getTable();
getLeftPlan();
//
emit('resetAll');
} else {
message.info(res.msg);
}
});
};
const reset = () => {
//
getTable();
// 穿
getLeftPlan();
};
// tab ====================================================
//
@ -204,7 +232,7 @@
deviceType: 1,
})
.then((res) => {
let arr = [];
let arr: Array<Object> = [];
res.data.forEach((item: any) => {
arr.push({
key: item.id,
@ -231,14 +259,18 @@
http.post(planManage.submitTransData, targetKeys.value).then(() => {
message.success('添加成功');
//
getTable();
getLeftPlan();
reset();
});
};
const filterOption = (inputValue: string, option: any) => {
return option.description.indexOf(inputValue) > -1;
};
//
defineExpose({
reset,
});
</script>
<style lang="less" scoped>
@import '../style/dialogStyle.less';

30
hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs3.vue

@ -11,7 +11,7 @@
</thead>
<tbody>
<tr
:style="{ color: row.ctrlResult == 0 ? 'red' : 'white' }"
:style="{ color: row.ctrlResult == 1 ? 'red' : 'white' }"
v-for="(row, index) in dataSource"
:key="index"
@click="handleRowClick(row.id, index)"
@ -20,7 +20,7 @@
<td>{{ row.startTime }}</td>
<td>{{ row.operationContent }}</td>
<td>{{ row.createUser }}</td>
<td>{{ row.ctrlResult ? '成功' : '失败' }}</td>
<td>{{ row.ctrlResult ? '失败' : '成功' }}</td>
</tr>
</tbody>
</table>
@ -31,6 +31,7 @@
show-size-changer
:total="pagination.total"
@change="getTable(true)" />
<div style="width: 100%; height: 40px"></div>
<div class="out-dialog" :class="{ showDialog: logModalVisible }" v-if="logModalVisible">
<div class="content">
@ -54,9 +55,17 @@
<div class="btn-item">
<div class="left">控制模式</div>
<div class="right">
<span>手动</span>
<span>{{
item.autoStatusBefore.label.indexOf('模式') != -1
? item.autoStatusBefore.label.replace('模式', '')
: item.autoStatusBefore.label
}}</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>自动</span></div
<span>{{
item.autoStatusAfter.label.indexOf('模式') != -1
? item.autoStatusAfter.label.replace('模式', '')
: item.autoStatusAfter.label
}}</span></div
>
</div>
<div class="btn-item">
@ -163,6 +172,8 @@
};
//
const reset = () => {
trIndex.value = -1;
logModalVisible.value = false;
pagination.value = {
pageSize: 10,
pageNum: 1,
@ -172,13 +183,8 @@
};
//
const handleRowClick = (id: any, index: any) => {
//
if (index === trIndex.value) {
return;
} else {
trIndex.value = index;
getLogDetail(id);
}
};
// ==================================================
@ -197,7 +203,13 @@
}
});
};
//
const cxList = ref([]);
//
defineExpose({
reset,
});
</script>
<style lang="less" scoped>
@import '../style/dialogStyle.less';

1
hx-ai-intelligent/src/view/equipmentControl/style/color.less

@ -1,3 +1,4 @@
// 颜色变量
:root {
// 电梯
// 正常

1
hx-ai-intelligent/src/view/equipmentControl/style/dialogStyle.less

@ -1,3 +1,4 @@
// 设备群控 > 抽屉 > 控制面板 & 日志 的附加弹窗
.out-dialog {
position: fixed;
right: 496px;

109
hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanControl.vue

@ -137,6 +137,7 @@
title="此操作将会撤销修改"
ok-text="确定"
cancel-text="取消"
placement="bottomRight"
@confirm="delBtn(item)"
@cancel="changeCancel">
<button class="cxbtn">撤销</button>
@ -146,9 +147,9 @@
<div class="btn-item">
<div class="left">控制模式</div>
<div class="right">
<span>手动</span>
<span>{{ item.stateBefore.autoStatus.label.replace('模式', '') }}</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>自动</span></div
<span>{{ item.stateAfter.autoStatus.label.replace('模式', '') }}</span></div
>
</div>
<div class="btn-item">
@ -230,12 +231,13 @@
</template>
<script setup lang="ts">
import { ref, computed, onMounted } from 'vue';
import { ref, computed, onMounted, watch } from 'vue';
import { DownOutlined, UpOutlined, StopOutlined } from '@ant-design/icons-vue';
import { message } from 'ant-design-vue';
import { message, Modal } from 'ant-design-vue';
//
import { http } from '/nerv-lib/util/http';
import { ventilating } from '/@/api/ventilatingSystem';
import { planManage } from '/@/api/planManage';
//
import { items } from '/@/store/item';
@ -247,12 +249,15 @@
if (props.type == '排风扇') {
url.getList = ventilating.getChangeList1;
url.sendList = ventilating.sendChangeList1;
url.deviceType = 3;
} else if (props.type == '风幕机') {
url.getList = ventilating.getChangeList2;
url.sendList = ventilating.sendChangeList2;
url.deviceType = 4;
} else {
url.getList = ventilating.getChangeList3;
url.sendList = ventilating.sendChangeList3;
url.deviceType = 5;
}
});
// 1-1
@ -266,6 +271,7 @@
const url = {
getList: '',
sendList: '',
deviceType: 0,
};
// ===================================================================
@ -282,12 +288,24 @@
type: String,
},
});
watch(
() => props.treeData,
(newValue) => {
//
buttons2.value = newValue[0].childList;
},
{
deep: true,
},
);
/**
* @method changeArea 用于控制俯视图的选中状态
* @method reset 用于重置按钮区
* @method reload 用于刷新一次页面
* @method resetAll 刷新所有tab对计划进行修改时需刷新tab2与tab3
*/
const emit = defineEmits(['reset', 'reload']);
const emit = defineEmits(['reset', 'reload', 'resetAll']);
// ======================================================================
@ -613,21 +631,20 @@
changeList.value.forEach((item: any) => {
resetChangeList(item);
});
}
changeList.value = [];
if (!reload) {
lockList.value.forEach((item: any) => {
resetLockList(item);
});
}
lockList.value = [];
//
let data = props.treeData[0];
//
data.selected = true;
// 1-1
buttons2.value = data.childList;
console.log(buttons2.value, '222222222222222222222222');
resetMode();
}
changeList.value = [];
lockList.value = [];
};
// /
const resetLockList = (item: any) => {
@ -677,6 +694,55 @@
return message.info('未产生任何修改');
}
http
.get(planManage.getRunningPlan, {
deviceType: url.deviceType,
projectId: state.projectId,
siteId: state.siteId,
})
.then((res) => {
//
if (res.data && res.data.length) {
// 使confirm
// Modal.confirm({
// title: '',
// content: '""',
// onOk() {
// return new Promise((resolve, reject) => {
// });
// },
// onCancel() { },
// });
let flag = window.confirm('有计划正在执行,点击"确定"将暂停当前计划');
if (flag) {
//
http
.post(url.getList, {
projectId: state.projectId,
siteId: state.siteId,
lockList: [],
sceneList: [],
})
.then((res) => {
console.log(res, '成功');
//
if (res.retcode == 0) {
sendChangeList();
//
} else {
message.error('关闭进行中的任务操作失败,请重新尝试');
}
});
}
//
} else {
sendChangeList();
}
});
};
// /
const sendChangeList = () => {
http
.post(url.getList, {
sceneList: changeList.value,
lockList: lockList.value,
@ -684,11 +750,11 @@
siteId: state.siteId,
})
.then((res) => {
if (res.msg === 'success') {
if (res.retcode == 0) {
diffList.value = res.data;
executeVisible.value = true;
} else {
message.warning('获取修改内容失败');
message.error('获取修改内容失败');
}
})
.catch(() => {});
@ -736,9 +802,22 @@
projectId: state.projectId,
siteId: state.siteId,
})
.then(() => {
emit('reload');
.then((res) => {
let data = res.data;
//
if (res.retcode != 0) {
//
return message.warning(data.msg);
}
//
if (data.allSucceed) {
message.success('修改完成');
// allSucceedtrue
} else {
message.info(`${data.successList.length}条修改成功,${data.failList.length}条修改失败`);
}
refresh(true);
emit('resetAll');
})
.catch(() => {});
};
@ -759,6 +838,8 @@
defineExpose({
//
changeLine,
//
refresh,
});
</script>
<style lang="less" scoped>

29
hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanLog.vue

@ -11,7 +11,7 @@
</thead>
<tbody>
<tr
:style="{ color: row.ctrlResult == 0 ? 'red' : 'white' }"
:style="{ color: row.ctrlResult == 1 ? 'red' : 'white' }"
v-for="(row, index) in dataSource"
:key="index"
@click="handleRowClick(row.id, index)"
@ -20,7 +20,7 @@
<td>{{ row.startTime }}</td>
<td>{{ row.operationContent }}</td>
<td>{{ row.createUser }}</td>
<td>{{ row.ctrlResult ? '成功' : '失败' }}</td>
<td>{{ row.ctrlResult ? '失败' : '成功' }}</td>
</tr>
</tbody>
</table>
@ -31,6 +31,7 @@
show-size-changer
:total="pagination.total"
@change="getTable(true)" />
<div style="width: 100%; height: 40px"></div>
<div class="out-dialog" :class="{ showDialog: logModalVisible }" v-if="logModalVisible">
<div class="content">
@ -54,9 +55,17 @@
<div class="btn-item">
<div class="left">控制模式</div>
<div class="right">
<span>手动</span>
<span>{{
item.autoStatusBefore.label.indexOf('模式') != -1
? item.autoStatusBefore.label.replace('模式', '')
: item.autoStatusBefore.label
}}</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>自动</span></div
<span>{{
item.autoStatusAfter.label.indexOf('模式') != -1
? item.autoStatusAfter.label.replace('模式', '')
: item.autoStatusAfter.label
}}</span></div
>
</div>
<div class="btn-item">
@ -193,6 +202,8 @@
};
//
const reset = () => {
trIndex.value = -1;
logModalVisible.value = false;
// state.setLoading(true);
pagination.value = {
pageSize: 10,
@ -203,13 +214,8 @@
};
//
const handleRowClick = (id: any, index: any) => {
//
if (index === trIndex.value) {
return;
} else {
trIndex.value = index;
getLogDetail(id);
}
};
// ==================================================
@ -229,6 +235,11 @@
});
};
const cxList = ref([]);
//
defineExpose({
reset,
});
</script>
<style lang="less" scoped>
@import '../../style/dialogStyle.less';

42
hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanPlant.vue

@ -52,6 +52,7 @@
title="此操作将移除该数据"
ok-text="确定"
cancel-text="取消"
placement="topRight"
@confirm="deletePlan(row)">
<div class="tabDelete">删除</div>
</a-popconfirm>
@ -60,7 +61,7 @@
</tbody>
</table>
<div class="out-dialog" v-if="addVisible">
<div class="content" v-if="addVisible">
<div class="content">
<div class="div-operation"></div>
<span class="text-operation">计划库</span>
</div>
@ -126,6 +127,11 @@
}
});
/**
* @method resetAll 刷新3个tab中的全部数据修改计划会影响tab1数据信息生成tab3日志
*/
const emit = defineEmits(['resetAll']);
// tab ========================================================
//
@ -150,7 +156,15 @@
// /
const togglePlan = (state: number) => {
dataSource.value.forEach((item: any) => {
//
if (state == 1) {
if (item.executeStatus.value != 2) {
item.executeStatus.value = state;
}
//
} else {
item.executeStatus.value = state;
}
});
};
@ -178,6 +192,9 @@
if (row.executeStatus.value == 1) {
return message.info('该数据已是待执行状态,无需再次修改');
}
if (row.executeStatus.value == 2) {
return message.info('执行中的状态已被启用,无需修改');
}
row.executeStatus.value = 1;
};
//
@ -187,11 +204,22 @@
url + `?projectId=${state.projectId}${state.siteId ? `&siteId=${state.siteId}` : ''}`,
dataSource.value,
)
.then(() => {
.then((res) => {
if (res.retcode == 0) {
message.success('操作成功');
//
emit('resetAll');
} else {
message.info(res.msg);
}
});
};
const reset = () => {
//
getTable();
// 穿
getLeftPlan();
});
};
// tab ====================================================
@ -244,14 +272,18 @@
http.post(planManage.submitTransData, targetKeys.value).then(() => {
message.success('添加成功');
//
getTable();
getLeftPlan();
reset();
});
};
const filterOption = (inputValue: string, option: any) => {
return option.description.indexOf(inputValue) > -1;
};
//
defineExpose({
reset,
});
</script>
<style lang="less" scoped>
@import '../../style/dialogStyle.less';

150
hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/index.vue

@ -137,13 +137,17 @@
</div>
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="控制面板">
<fanControl :treeData="treeData" :type="`排风扇`" />
<fanControl
ref="tabs1Ref"
@reset-all="resetDrawer"
:treeData="treeData"
:type="`排风扇`" />
</a-tab-pane>
<a-tab-pane key="2" tab="计划列表" force-render>
<fanPlant :status="stateList" :type="3" />
<fanPlant ref="tabs2Ref" @reset-all="resetDrawer" :status="stateList" :type="3" />
</a-tab-pane>
<a-tab-pane key="3" tab="日志">
<fanLog :type="3" />
<fanLog ref="tabs3Ref" @reset-all="resetDrawer" :type="3" />
</a-tab-pane>
</a-tabs>
</a-drawer>
@ -194,13 +198,17 @@
</div>
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="控制面板">
<fanControl :treeData="treeData" :type="`风幕机`" />
<fanControl
ref="tabs1Ref"
@reset-all="resetDrawer"
:treeData="treeData"
:type="`风幕机`" />
</a-tab-pane>
<a-tab-pane key="2" tab="计划列表" force-render>
<fanPlant :status="stateList" :type="4" />
<fanPlant ref="tabs2Ref" @reset-all="resetDrawer" :status="stateList" :type="4" />
</a-tab-pane>
<a-tab-pane key="3" tab="日志">
<fanLog :type="4" />
<fanLog ref="tabs3Ref" @reset-all="resetDrawer" :type="4" />
</a-tab-pane>
</a-tabs>
</a-drawer>
@ -250,13 +258,17 @@
</div>
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="控制面板">
<fanControl :treeData="treeData" :type="`电动窗`" />
<fanControl
ref="tabs1Ref"
@reset-all="resetDrawer"
:treeData="treeData"
:type="`电动窗`" />
</a-tab-pane>
<a-tab-pane key="2" tab="计划列表" force-render>
<fanPlant :status="stateList" :type="5" />
<fanPlant ref="tabs2Ref" @reset-all="resetDrawer" :status="stateList" :type="5" />
</a-tab-pane>
<a-tab-pane key="3" tab="日志">
<fanLog :type="5" />
<fanLog ref="tabs3Ref" @reset-all="resetDrawer" :type="5" />
</a-tab-pane>
</a-tabs>
</a-drawer>
@ -351,6 +363,15 @@
const toggleDrawer = () => {
visible.value = !visible.value;
};
// URL
let url = '';
//
const reload = () => {
http.get(url, { projectId: state.projectId, siteId: state.siteId }).then((res) => {
const data = res.data;
treeData.value = data[0].childList;
});
};
// tab1 - =================================================================
@ -359,7 +380,6 @@
const getTree = async (type: number, index: number) => {
// tab1
activeKey.value = '1';
let url;
if (type == 1) {
url = ventilating.getTree1;
} else if (type == 2) {
@ -489,93 +509,33 @@
},
]);
//
const fanData = ref([
// {
// title: '',
// styleText: { left: '43.2%', bottom: '77.8%' },
// type: 'fan',
// lineType: '1',
// },
// {
// title: '',
// styleText: { left: '50%', bottom: '77.8%' },
// type: 'fan',
// lineType: '2',
// },
// {
// title: '',
// styleText: { left: '41.2%', bottom: '27.8%' },
// type: 'fan',
// lineType: '1',
// },
// {
// title: '',
// styleText: { left: '51.2%', bottom: '27.8%' },
// type: 'fan',
// lineType: '2',
// },
]);
const fanData = ref([]);
//
const airCurtainData = ref([
// {
// title: '',
// styleText: { left: '38%', bottom: '57.8%' },
// type: 'airCurtain',
// },
// {
// title: '',
// styleText: { left: '58.5%', bottom: '57.3%' },
// type: 'airCurtain',
// },
// {
// title: '',
// styleText: { left: '64.2%', bottom: '22.8%' },
// type: 'airCurtain',
// },
]);
const airCurtainData = ref([]);
//
const windowData = ref([
// {
// title: '1',
// styleText: { left: '32%', bottom: '28%' },
// type: 'window',
// },
// {
// title: '2',
// styleText: { left: '33.5%', bottom: '42.8%' },
// type: 'window',
// },
// {
// title: '3',
// styleText: { left: '35%', bottom: '57.8%' },
// type: 'window',
// },
// {
// title: '4',
// styleText: { left: '36.5%', bottom: '72.8%' },
// type: 'window',
// },
// {
// title: '5',
// styleText: { left: '66%', bottom: '28%' },
// type: 'window',
// },
// {
// title: '6',
// styleText: { left: '64%', bottom: '42.8%' },
// type: 'window',
// },
// {
// title: '7',
// styleText: { left: '62%', bottom: '57.8%' },
// type: 'window',
// },
// {
// title: '8',
// styleText: { left: '60%', bottom: '72.8%' },
// type: 'window',
// },
]);
const windowData = ref([]);
// tabtab
const resetDrawer = () => {
// tab1
reload();
tabs1Ref.value.refresh();
// tab2 tab3
try {
// tab2
tabs2Ref.value.reset();
} catch {}
try {
// tab3
tabs3Ref.value.reset();
} catch {}
};
// tab1
const tabs1Ref = ref();
// tab2
const tabs2Ref = ref();
// tab3
const tabs3Ref = ref();
onMounted(() => {
//
getStateEnum();

Loading…
Cancel
Save