fks-xuxinyue 2 months ago
parent
commit
ccec1ee763
  1. 1
      hx-ai-intelligent/src/api/alarmManagement/equipmentAlarm.ts
  2. 28
      hx-ai-intelligent/src/api/index.ts
  3. 8
      hx-ai-intelligent/src/components/ns-steps.vue
  4. 0
      hx-ai-intelligent/src/icon/state-1.svg
  5. 0
      hx-ai-intelligent/src/icon/state-2.svg
  6. 0
      hx-ai-intelligent/src/icon/state-3.svg
  7. 0
      hx-ai-intelligent/src/icon/state-4.svg
  8. 0
      hx-ai-intelligent/src/icon/state-5.svg
  9. 60
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue
  10. 1
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts
  11. 8
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/indexs.vue
  12. 61
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs1.vue
  13. 10
      hx-ai-intelligent/src/view/equipmentControl/lightingManage/tabs2.vue

1
hx-ai-intelligent/src/api/alarmManagement/equipmentAlarm.ts

@ -1,4 +1,5 @@
export enum equipmentAlarmApi {
getTableList = '/carbon-smart/api/AlarmEquipmentLog/selectAlarmEquipmentLog', //设备告警 列表
getCodeList = '/carbon-smart/api/AlarmEquipmentLog/selectErrorCodeList', //设备告警 列表
getSelectAlarmEquipmentLogStatusProcess = '/carbon-smart/api/AlarmEquipmentLogStatusProcess/selectAlarmEquipmentLogStatusProcess', //设备告警 状态 没有创建工单log接口
}

28
hx-ai-intelligent/src/api/index.ts

@ -45,19 +45,9 @@ export const dict = async ({
export const getAllEnum = async ({
api = `${BASE_URL}/operation/enum/getAllEnum`,
params = {},
keyField = 'dicKey',
transform = (res: any) => res,
}: dictHttpConfig) => {
const dictMap = JSON.parse(sessionStorage.getItem('dictMap') || '{}') as Object;
const key = get(params, keyField) as keyof typeof dictMap;
if (!dictMap.hasOwnProperty(key)) {
const res = await http.post(api, params);
const options = get(transform(res), `data.${key}`);
dictMap[key] = options;
sessionStorage.setItem('dictMap', JSON.stringify(dictMap));
}
return Promise.resolve({ data: { data: get(dictMap, key) } });
const res = await http.post(api, params);
return Promise.resolve(res);
};
@ -67,17 +57,7 @@ export const getAllEnum = async ({
export const getEnum = async ({
api = `${BASE_URL}/operation/enum/getEnum`,
params = {},
keyField = 'dicKey',
transform = (res: any) => res,
}: dictHttpConfig) => {
const dictMap = JSON.parse(sessionStorage.getItem('dictMap') || '{}') as Object;
const key = get(params, keyField) as keyof typeof dictMap;
if (!dictMap.hasOwnProperty(key)) {
const res = await http.post(api, params);
const options = get(transform(res), `data.${key}`);
dictMap[key] = options;
sessionStorage.setItem('dictMap', JSON.stringify(dictMap));
}
return Promise.resolve({ data: { data: get(dictMap, key) } });
const res = await http.post(api, params);
return Promise.resolve(res);
};

8
hx-ai-intelligent/src/components/ns-steps.vue

@ -8,12 +8,12 @@
<template #description>
<div class="card">
<div class="card-title">
<a-tag class="card-title-tag" :color="item.color">{{ item.statusName }}</a-tag>
<div class="name">{{ item.name }}</div>
<div class="time">{{ item.time }}</div>
<a-tag class="card-title-tag" :color="item.color">{{ item.stateName }}</a-tag>
<div class="name">{{ item.createName }}</div>
<div class="time">{{ item.createTime }}</div>
</div>
<div style="width: 100%; color: #3a3a3a; height: 25px; overflow: auto">
{{ item.desc }}</div
{{ item.remarks }}</div
>
</div>
</template>

0
hx-ai-intelligent/src/icon/status-1.svg → hx-ai-intelligent/src/icon/state-1.svg

0
hx-ai-intelligent/src/icon/status-2.svg → hx-ai-intelligent/src/icon/state-2.svg

0
hx-ai-intelligent/src/icon/status-3.svg → hx-ai-intelligent/src/icon/state-3.svg

0
hx-ai-intelligent/src/icon/status-4.svg → hx-ai-intelligent/src/icon/state-4.svg

0
hx-ai-intelligent/src/icon/status-5.svg → hx-ai-intelligent/src/icon/state-5.svg

60
hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue

@ -12,22 +12,22 @@
<a-tab-pane key="1" tab="更新状态">
<div style="width: 100%; padding: 24px">
<a-form ref="formRef" :model="infoObject" :rules="rules">
<a-form-item ref="status" label="当前状态" name="status">
<a-form-item ref="state" label="当前状态" createName="state">
<a-select
v-model:value="infoObject.status"
v-model:value="infoObject.state"
show-search
placeholder="请选择设备点位"
style="width: 85%"
:options="statusOptions"
:options="stateOptions"
:disabled="showEdit"
:filter-option="filterDevicePoint" />
<ns-icon
size="20"
@click="() => (showEdit = !showEdit)"
@click="changeShowEdit"
style="margin-left: 20px"
:name="showEdit ? 'bianji' : 'baocun'" />
:createName="showEdit ? 'bianji' : 'baocun'" />
</a-form-item>
<a-form-item label="备注" name="desc">
<a-form-item label="备注" createName="desc">
<a-textarea
v-model:value="infoObject.desc"
placeholder="请输入异常描述"
@ -55,6 +55,8 @@
import { ref } from 'vue';
import NsSteps from '/@/components/ns-steps.vue';
import { NsMessage } from '/nerv-lib/component';
import { http } from '/nerv-lib/util';
import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm';
export default defineComponent({
components: { NsSteps },
@ -64,33 +66,46 @@
const showEdit = ref(true);
const infoObject = ref({});
const equipmentAlarm = ref({});
const statusOptions = ref();
const stateOptions = ref();
const logList = ref([
{ name: '李四', status: 3, time: '2024-03-10 10:00:00', desc: '完成' },
{ name: '王五', status: 5, time: '2024-03-10 10:00:00' },
{ name: '王五', status: 4, time: '2024-03-10 10:00:00' },
{ name: '王五', status: 2, time: '2024-03-10 10:00:00', desc: '创建工单' },
{ name: '赵六', status: 1, time: '2024-03-10 10:00:00' },
{ createName: '李四', state: 3, createTime: '2024-03-10 10:00:00', desc: '完成' },
{ createName: '王五', state: 5, createTime: '2024-03-10 10:00:00' },
{ createName: '王五', state: 4, createTime: '2024-03-10 10:00:00' },
{ createName: '王五', state: 2, createTime: '2024-03-10 10:00:00', desc: '创建工单' },
{ createName: '赵六', state: 1, createTime: '2024-03-10 10:00:00' },
]);
const config = ref({
size: logList.value.length,
dataSource: logList.value,
});
const handleClose = () => {
equipmentAlarm.value = P;
visible.value = false;
};
const btnClick = () => {
NsMessage.success('操作成功');
delete infoObject.value.time;
delete infoObject.value.createTime;
console.log(infoObject.value, equipmentAlarm.value, '操作');
console.log('btnClick');
};
const toggle = (data) => {
console.log(data, '数据');
equipmentAlarm.value = data;
//
const changeShowEdit = () => {
if (equipmentAlarm.value.createWorkOrder === 1) {
showEdit.value = !showEdit.value;
}
};
const toggle = async (data) => {
equipmentAlarm.value = { ...data };
infoObject.value = { ...logList.value[0] };
await http
.post(equipmentAlarmApi.getSelectAlarmEquipmentLogStatusProcess, {
id: data.id,
})
.then((res) => {
console.log(res);
});
if (equipmentAlarm.value.createWorkOrder === 1) {
statusOptions.value = [
stateOptions.value = [
{ value: 1, label: '待处理' },
{ value: 2, label: '处理中' },
{ value: 3, label: '已完成' },
@ -98,7 +113,7 @@
{ value: 5, label: '已关闭' },
];
} else {
statusOptions.value = [
stateOptions.value = [
{ value: 1, label: '待处理' },
{ value: 2, label: '处理中' },
{ value: 3, label: '已完成' },
@ -120,17 +135,18 @@
5: '#a6a6a6',
};
logList.value.forEach((item) => {
item.statusName = statusMap[item.status];
item.color = colorMap[item.status];
item.src = 'status-' + item.status;
item.stateName = statusMap[item.state];
item.color = colorMap[item.state];
item.src = 'state-' + item.state;
});
visible.value = true;
};
return {
infoObject,
changeShowEdit,
showEdit,
equipmentAlarm,
statusOptions,
stateOptions,
btnClick,
visible,
logList,

1
hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts

@ -8,6 +8,7 @@ const tableKeyMap = [
{
title: '序号',
dataIndex: 'address',
width: 80,
customRender: (text: any) => {
return text.index + 1;
},

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

@ -49,7 +49,12 @@
:maskStyle="{ 'background-color': 'rgba(0, 0, 0, 0)' }">
<a-tabs v-model:activeKey="activeKey">
<a-tab-pane key="1" tab="控制面板">
<tabs1 @changeArea="changeArea" @reset="reset" :treeData="treeData" :nowArea="nowArea"></tabs1>
<tabs1
@changeArea="changeArea"
@reset="reset"
:treeData="treeData"
:nowArea="nowArea"
></tabs1>
</a-tab-pane>
<a-tab-pane key="2" tab="计划列表" force-render>
<tabs2></tabs2>
@ -83,6 +88,7 @@ import {
// =======================================================
onMounted(() => {
// 线
http.get(lightingManage.getArea, { projectId: 'HLlmTZp8' }).then(res => {
const data = res.data
floorData.value = data

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

@ -81,9 +81,10 @@
</div>
<!-- 控制模式按钮部分 -->
<div class="control-mode-btn-area" v-show="showControlMode">
<button v-for="(button3, index) in controlType" :key="index"
:class="{ btn: true, selected: button3.type == thisButton.type }" @click="selectButton3(button3)">
{{ button3.name }}
<button v-for="(button3, index) in controlMode" :key="index"
class="btn"
:class="{ selected: thisButton.mode.value == button3.value }" @click="selectButton3(button3)">
{{ button3.label }}
</button>
</div>
</div>
@ -212,7 +213,6 @@
<script setup lang="ts">
import { ref, computed, onMounted, watch } from 'vue';
import { controlType } from './treeData'
import {
DownOutlined,
UpOutlined,
@ -222,11 +222,15 @@ import { message } from 'ant-design-vue';
//
import { http } from '/nerv-lib/util/http';
import { lightingManage } from '/@/api/IlluminationInfo';
import { getAllEnum } from '/@/api/index'
// =========================================================================
onMounted(() => {
//
setArea()
//
getEnum(['IlluminationMode', 'IlluminationScene'])
})
// 线
const setArea = () => {
@ -402,8 +406,13 @@ const toggleSelection = (button: any) => {
} else {
//
showControlMode.value = false
thisButton.value = { type: '0' }
thisButton.value = {
mode: {
value: '0'
}
}
}
console.log(thisButton,'button')
};
//
@ -417,16 +426,31 @@ const limitedButtons2 = computed(() => buttons2.value.slice(0, 8));
//
const showControlMode = ref(false);
const thisButton = ref({ type: 0 })
const thisButton = ref({
mode: {
value: '0'
}
})
// -
const selectButton3 = (button3) => {
thisButton.value.type = button3.type
showControlScene.value = button3.name === '手动';
let checked = thisButton.value.mode.value
console.log(button3.value,'---', checked)
//
if (checked === button3.value) {
return
}
checked = button3.value
//
showControlScene.value = button3.label === '手动模式';
selectedButton4.value = null; //
};
// =====================================================================
//
const controlMode = ref([])
//
const controlScene = ref([])
//
const showControlScene = ref(false);
// -
@ -458,6 +482,8 @@ const handleRowClick = (index: any) => {
// ========================================================================
//
const submitArray = ref([])
const cxList = ref([
{
id: '1',
@ -498,7 +524,7 @@ const cxList = ref([
]);
//
const delBtn = (id: any) => {
cxList.value.pop(id);
cxList.value.pop();
console.log(cxList.value.length);
if (cxList.value.length === 0) {
@ -514,14 +540,6 @@ const isLoading = ref(false)
const initMenu = (tier: number) => {
// 1 = -
if (tier == 1) {
//
// buttons2.value.forEach(item => {
// item.selected = false
// })
// //
// props.treeData.forEach(item => {
// item.selected = false
// })
emit('reset')
//
showControlMode.value = false;
@ -568,6 +586,15 @@ const changeConfirm = () => {
const changeCancel = () => {
}
//
const getEnum = (arr: any) => {
getAllEnum({ params: arr }).then(res => {
const data = res.data
controlMode.value = data.IlluminationMode
controlScene.value = data.IlluminationScene
})
console.log(controlMode, controlScene, '001')
}
</script>
<style lang="less" scoped>

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

@ -41,7 +41,14 @@
</td>
<td>
<div class="tabReboot" @click="restartPlan(row.id)">重启</div>
<div class="tabDelete" @click="deletePlan(row.id)">删除</div>
<a-popconfirm
title="此操作将永久删除该条数据"
ok-text="确定"
cancel-text="取消"
@confirm="deletePlan(row.id)"
>
<div class="tabDelete">删除</div>
</a-popconfirm>
</td>
</tr>
</tbody>
@ -121,6 +128,7 @@ const addModal = () => {
addVisible.value = true;
};
// 穿 =======================================================
// 穿

Loading…
Cancel
Save