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. 47
      hx-ai-intelligent/src/view/equipmentControl/airConditionControlSystem/tabs2.vue
  6. 17
      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. 97
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue
  10. 56
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue
  11. 34
      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. 119
      hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanControl.vue
  15. 33
      hx-ai-intelligent/src/view/equipmentControl/ventilationSystem/components/fanLog.vue
  16. 48
      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 { 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 { 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 { export enum planManage {
/** /**
@ -10,4 +10,6 @@ export enum planManage {
getTableData = prefix + '/deviceCtrlPlan/getActivatedPlanList', getTableData = prefix + '/deviceCtrlPlan/getActivatedPlanList',
// 提交计划状态修改 // 提交计划状态修改
submitTransData = prefix + '/deviceCtrlPlan/activePlanByIdList', 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 { export enum ventilating {
// 排风扇相关 ============================================= // 排风扇相关 =============================================

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

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

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

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

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

@ -56,14 +56,15 @@
ref="tabs1Ref" ref="tabs1Ref"
@reset="reset" @reset="reset"
@reload="reload" @reload="reload"
@changeArea="changeArea" @reset-all="resetDrawer"
@change-area="changeArea"
:treeData="treeData" /> :treeData="treeData" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="计划列表" force-render> <a-tab-pane key="2" tab="计划列表" force-render>
<tabs2 /> <tabs2 ref="tabs2Ref" @reset-all="resetDrawer" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="3" tab="日志"> <a-tab-pane key="3" tab="日志">
<tabs3 /> <tabs3 ref="tabs3Ref" @reset-all="resetDrawer" />
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-drawer> </a-drawer>
@ -269,8 +270,29 @@
const toggleDrawer = () => { const toggleDrawer = () => {
visible.value = !visible.value; 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 // tab1
const tabs1Ref = ref(); const tabs1Ref = ref();
// tab2
const tabs2Ref = ref();
// tab3
const tabs3Ref = ref();
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@import './index.less'; @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="" /> <img src="/asset/image//bulbLogo/21962.png" alt="" />
<span class="tag-text">{{ blub.regionName + ' > ' + blub.deviceGroupName }}</span></div <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>
<div class="light-tag-box"> <div class="light-tag-box">
<div class="tag-box-item"> <div class="tag-box-item">
@ -36,25 +38,25 @@
<div class="icon-box" :style="props.blub.styleText"> <div class="icon-box" :style="props.blub.styleText">
<!-- 正常=0 --> <!-- 正常=0 -->
<img <img
v-if="record.runStatus.value == 0" v-if="record?.runStatus?.value == 0"
class="icon-item" class="icon-item"
src="/asset/image/bulbLogo/on.png" src="/asset/image/bulbLogo/on.png"
alt="" /> alt="" />
<!-- 故障=1 --> <!-- 故障=1 -->
<img <img
v-if="record.runStatus.value == 1" v-if="record?.runStatus?.value == 1"
class="icon-item" class="icon-item"
src="/asset/image/bulbLogo/off.png" src="/asset/image/bulbLogo/off.png"
alt="" /> alt="" />
<!-- 维修=2 --> <!-- 维修=2 -->
<img <img
v-if="record.runStatus.value == 2" v-if="record?.runStatus?.value == 2"
class="icon-item" class="icon-item"
src="/asset/image/bulbLogo/repair.png" src="/asset/image/bulbLogo/repair.png"
alt="" /> alt="" />
<!-- 警告=3 --> <!-- 警告=3 -->
<img <img
v-if="record.runStatus.value == 3" v-if="record?.runStatus?.value == 3"
class="icon-item" class="icon-item"
src="/asset/image/bulbLogo/alarm.png" src="/asset/image/bulbLogo/alarm.png"
alt="" /> alt="" />

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

@ -265,12 +265,13 @@
</template> </template>
<script setup lang="ts"> <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 { 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 { http } from '/nerv-lib/util/http';
import { lightingManage } from '/@/api/IlluminationInfo'; import { lightingManage } from '/@/api/IlluminationInfo';
import { planManage } from '/@/api/planManage';
// //
import { items } from '/@/store/item'; import { items } from '/@/store/item';
@ -299,12 +300,24 @@
}, },
}, },
}); });
watch(
() => props.treeData,
(newValue) => {
//
buttons2.value = newValue[0].childList;
},
{
deep: true,
},
);
/** /**
* @method changeArea 用于控制俯视图的选中状态 * @method changeArea 用于控制俯视图的选中状态
* @method reset 用于重置按钮区 * @method reset 用于重置按钮区
* @method reload 用于刷新一次页面 * @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) => { changeList.value.forEach((item: any) => {
resetChangeList(item); resetChangeList(item);
}); });
}
changeList.value = [];
if (!reload) {
lockList.value.forEach((item: any) => { lockList.value.forEach((item: any) => {
resetLockList(item); resetLockList(item);
}); });
//
let data = props.treeData[0];
//
data.selected = true;
// 1-1
buttons2.value = data.childList;
resetMode();
} }
changeList.value = [];
lockList.value = []; lockList.value = [];
//
let data = props.treeData[0];
//
data.selected = true;
// 1-1
buttons2.value = data.childList;
resetMode();
}; };
// / // /
const resetLockList = (item: any) => { const resetLockList = (item: any) => {
props.treeData.find((v: any) => { props.treeData.find((v: any) => {
@ -730,6 +742,55 @@
return message.info('未产生任何修改'); return message.info('未产生任何修改');
} }
http 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, { .post(lightingManage.getChangeList, {
sceneList: changeList.value, sceneList: changeList.value,
lockList: lockList.value, lockList: lockList.value,
@ -737,11 +798,11 @@
siteId: state.siteId, siteId: state.siteId,
}) })
.then((res) => { .then((res) => {
if (res.msg === 'success') { if (res.retcode == 0) {
diffList.value = res.data; diffList.value = res.data;
executeVisible.value = true; executeVisible.value = true;
} else { } else {
message.warning('获取修改内容失败'); message.error('获取修改内容失败');
} }
}) })
.catch(() => {}); .catch(() => {});
@ -792,7 +853,7 @@
.then((res) => { .then((res) => {
let data = res.data; let data = res.data;
// //
if (data.retcode != 0) { if (res.retcode != 0) {
// //
return message.warning(data.msg); return message.warning(data.msg);
} }
@ -803,8 +864,8 @@
} else { } else {
message.info(`${data.successList.length}条修改成功,${data.failList.length}条修改失败`); message.info(`${data.successList.length}条修改成功,${data.failList.length}条修改失败`);
} }
emit('reload');
refresh(true); refresh(true);
emit('resetAll');
}) })
.catch(() => {}); .catch(() => {});
}; };
@ -829,8 +890,6 @@
changeLine, changeLine,
// //
refresh, refresh,
resetLockList,
resetChangeList,
}); });
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

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

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

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

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

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

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

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

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

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

@ -137,6 +137,7 @@
title="此操作将会撤销修改" title="此操作将会撤销修改"
ok-text="确定" ok-text="确定"
cancel-text="取消" cancel-text="取消"
placement="bottomRight"
@confirm="delBtn(item)" @confirm="delBtn(item)"
@cancel="changeCancel"> @cancel="changeCancel">
<button class="cxbtn">撤销</button> <button class="cxbtn">撤销</button>
@ -146,9 +147,9 @@
<div class="btn-item"> <div class="btn-item">
<div class="left">控制模式</div> <div class="left">控制模式</div>
<div class="right"> <div class="right">
<span>手动</span> <span>{{ item.stateBefore.autoStatus.label.replace('模式', '') }}</span>
<img src="/asset/image/bulbLogo/22406.png" alt="" /> <img src="/asset/image/bulbLogo/22406.png" alt="" />
<span>自动</span></div <span>{{ item.stateAfter.autoStatus.label.replace('模式', '') }}</span></div
> >
</div> </div>
<div class="btn-item"> <div class="btn-item">
@ -230,12 +231,13 @@
</template> </template>
<script setup lang="ts"> <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 { 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 { http } from '/nerv-lib/util/http';
import { ventilating } from '/@/api/ventilatingSystem'; import { ventilating } from '/@/api/ventilatingSystem';
import { planManage } from '/@/api/planManage';
// //
import { items } from '/@/store/item'; import { items } from '/@/store/item';
@ -247,12 +249,15 @@
if (props.type == '排风扇') { if (props.type == '排风扇') {
url.getList = ventilating.getChangeList1; url.getList = ventilating.getChangeList1;
url.sendList = ventilating.sendChangeList1; url.sendList = ventilating.sendChangeList1;
url.deviceType = 3;
} else if (props.type == '风幕机') { } else if (props.type == '风幕机') {
url.getList = ventilating.getChangeList2; url.getList = ventilating.getChangeList2;
url.sendList = ventilating.sendChangeList2; url.sendList = ventilating.sendChangeList2;
url.deviceType = 4;
} else { } else {
url.getList = ventilating.getChangeList3; url.getList = ventilating.getChangeList3;
url.sendList = ventilating.sendChangeList3; url.sendList = ventilating.sendChangeList3;
url.deviceType = 5;
} }
}); });
// 1-1 // 1-1
@ -266,6 +271,7 @@
const url = { const url = {
getList: '', getList: '',
sendList: '', sendList: '',
deviceType: 0,
}; };
// =================================================================== // ===================================================================
@ -282,12 +288,24 @@
type: String, type: String,
}, },
}); });
watch(
() => props.treeData,
(newValue) => {
//
buttons2.value = newValue[0].childList;
},
{
deep: true,
},
);
/** /**
* @method changeArea 用于控制俯视图的选中状态 * @method changeArea 用于控制俯视图的选中状态
* @method reset 用于重置按钮区 * @method reset 用于重置按钮区
* @method reload 用于刷新一次页面 * @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) => { changeList.value.forEach((item: any) => {
resetChangeList(item); resetChangeList(item);
}); });
}
changeList.value = [];
if (!reload) {
lockList.value.forEach((item: any) => { lockList.value.forEach((item: any) => {
resetLockList(item); resetLockList(item);
}); });
//
let data = props.treeData[0];
//
data.selected = true;
// 1-1
buttons2.value = data.childList;
console.log(buttons2.value, '222222222222222222222222');
resetMode();
} }
changeList.value = [];
lockList.value = []; lockList.value = [];
//
let data = props.treeData[0];
//
data.selected = true;
// 1-1
buttons2.value = data.childList;
resetMode();
}; };
// / // /
const resetLockList = (item: any) => { const resetLockList = (item: any) => {
@ -677,6 +694,55 @@
return message.info('未产生任何修改'); return message.info('未产生任何修改');
} }
http 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, { .post(url.getList, {
sceneList: changeList.value, sceneList: changeList.value,
lockList: lockList.value, lockList: lockList.value,
@ -684,11 +750,11 @@
siteId: state.siteId, siteId: state.siteId,
}) })
.then((res) => { .then((res) => {
if (res.msg === 'success') { if (res.retcode == 0) {
diffList.value = res.data; diffList.value = res.data;
executeVisible.value = true; executeVisible.value = true;
} else { } else {
message.warning('获取修改内容失败'); message.error('获取修改内容失败');
} }
}) })
.catch(() => {}); .catch(() => {});
@ -736,9 +802,22 @@
projectId: state.projectId, projectId: state.projectId,
siteId: state.siteId, siteId: state.siteId,
}) })
.then(() => { .then((res) => {
emit('reload'); 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); refresh(true);
emit('resetAll');
}) })
.catch(() => {}); .catch(() => {});
}; };
@ -759,6 +838,8 @@
defineExpose({ defineExpose({
// //
changeLine, changeLine,
//
refresh,
}); });
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>

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

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

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

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

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

@ -137,13 +137,17 @@
</div> </div>
<a-tabs v-model:activeKey="activeKey"> <a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="控制面板"> <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>
<a-tab-pane key="2" tab="计划列表" force-render> <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>
<a-tab-pane key="3" tab="日志"> <a-tab-pane key="3" tab="日志">
<fanLog :type="3" /> <fanLog ref="tabs3Ref" @reset-all="resetDrawer" :type="3" />
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-drawer> </a-drawer>
@ -194,13 +198,17 @@
</div> </div>
<a-tabs v-model:activeKey="activeKey"> <a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="控制面板"> <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>
<a-tab-pane key="2" tab="计划列表" force-render> <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>
<a-tab-pane key="3" tab="日志"> <a-tab-pane key="3" tab="日志">
<fanLog :type="4" /> <fanLog ref="tabs3Ref" @reset-all="resetDrawer" :type="4" />
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-drawer> </a-drawer>
@ -250,13 +258,17 @@
</div> </div>
<a-tabs v-model:activeKey="activeKey"> <a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="控制面板"> <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>
<a-tab-pane key="2" tab="计划列表" force-render> <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>
<a-tab-pane key="3" tab="日志"> <a-tab-pane key="3" tab="日志">
<fanLog :type="5" /> <fanLog ref="tabs3Ref" @reset-all="resetDrawer" :type="5" />
</a-tab-pane> </a-tab-pane>
</a-tabs> </a-tabs>
</a-drawer> </a-drawer>
@ -351,6 +363,15 @@
const toggleDrawer = () => { const toggleDrawer = () => {
visible.value = !visible.value; 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 - ================================================================= // tab1 - =================================================================
@ -359,7 +380,6 @@
const getTree = async (type: number, index: number) => { const getTree = async (type: number, index: number) => {
// tab1 // tab1
activeKey.value = '1'; activeKey.value = '1';
let url;
if (type == 1) { if (type == 1) {
url = ventilating.getTree1; url = ventilating.getTree1;
} else if (type == 2) { } else if (type == 2) {
@ -489,93 +509,33 @@
}, },
]); ]);
// //
const fanData = ref([ 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 airCurtainData = 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 windowData = ref([ const windowData = ref([]);
// {
// title: '1', // tabtab
// styleText: { left: '32%', bottom: '28%' }, const resetDrawer = () => {
// type: 'window', // tab1
// }, reload();
// { tabs1Ref.value.refresh();
// title: '2', // tab2 tab3
// styleText: { left: '33.5%', bottom: '42.8%' }, try {
// type: 'window', // tab2
// }, tabs2Ref.value.reset();
// { } catch {}
// title: '3', try {
// styleText: { left: '35%', bottom: '57.8%' }, // tab3
// type: 'window', tabs3Ref.value.reset();
// }, } catch {}
// { };
// title: '4', // tab1
// styleText: { left: '36.5%', bottom: '72.8%' }, const tabs1Ref = ref();
// type: 'window', // tab2
// }, const tabs2Ref = ref();
// { // tab3
// title: '5', const tabs3Ref = ref();
// 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',
// },
]);
onMounted(() => { onMounted(() => {
// //
getStateEnum(); getStateEnum();

Loading…
Cancel
Save