xuziqiang 4 months ago
parent
commit
5e2f9cc966
  1. 1
      hx-ai-intelligent/src/api/alarmManagement/equipmentAlarm.ts
  2. 108
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagementMock.json
  3. 3
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/notificationManagementConfig.ts
  4. 8
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/index.vue
  5. 3
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue
  6. 102
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/status.vue
  7. 12
      hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/ts/config.ts
  8. 42
      hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/status.vue

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

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

108
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/notificationManagementMock.json

@ -1,108 +0,0 @@
{
"listData":[
{
"id": "d4",
"isDel": "0",
"officesId": "84",
"deviceCode": "37430200143",
"deviceName": "地听测试电表",
"category": "1",
"type": "1001",
"energyCount": "1",
"serialNumber": "69",
"pidCode": null,
"brand": "",
"types": "",
"manufacturer": "elit non in",
"contacts": "ad reprehenderit",
"phonenumber": "34",
"position": "in esse commodo1",
"activeState": "1",
"measurementDirection": "1",
"deviceMagnification": 62,
"deviceAccuracy": "89",
"frequency": "anim consequat irure",
"standardFrequency": "ut elit",
"deviceHead": "pariatur ex velit",
"constructor": "84566",
"voltageType": "cillum aliquip reprehenderit",
"pt": 61,
"ct": 64,
"communicationProtocol": "cupidatat nisi ea ad",
"ip": "",
"port": "",
"com": "",
"slaveAddress": "",
"dlt": "",
"conversionIdentifier": "48",
"multiplicationAdjustment": "1",
"accessMethod": "1",
"replacementFrequency": "0",
"dataDetail": "sit",
"insertTime": null,
"children": null,
"devicePointList": null,
"insertUser": null,
"priority": "1",
"alarmTitle": "电压异常告警",
"errorCode": "A001",
"monitorTime":"1",
"repetitions":"1",
"monitorTimeUnit": "分",
"enableRules": "1",
"isUse":true
} , {
"id": "d5",
"isDel": "0",
"officesId": "84",
"deviceCode": "37430200143",
"deviceName": "地听测试电表",
"category": "1",
"type": "1001",
"energyCount": "1",
"serialNumber": "69",
"pidCode": null,
"brand": "",
"types": "",
"manufacturer": "elit non in",
"contacts": "ad reprehenderit",
"phonenumber": "34",
"position": "in esse commodo2",
"activeState": "1",
"measurementDirection": "1",
"deviceMagnification": 62,
"deviceAccuracy": "89",
"frequency": "anim consequat irure",
"standardFrequency": "ut elit",
"deviceHead": "pariatur ex velit",
"constructor": "84566",
"voltageType": "cillum aliquip reprehenderit",
"pt": 61,
"ct": 64,
"communicationProtocol": "cupidatat nisi ea ad",
"ip": "",
"port": "",
"com": "",
"slaveAddress": "",
"dlt": "",
"conversionIdentifier": "48",
"multiplicationAdjustment": "1",
"accessMethod": "1",
"replacementFrequency": "0",
"dataDetail": "sit",
"insertTime": null,
"children": null,
"devicePointList": null,
"insertUser": null,
"priority": "1",
"alarmTitle": "电压异常告警",
"errorCode": "A001",
"monitorTime":"1",
"repetitions":"1",
"monitorTimeUnit": "分",
"enableRules": "0",
"isUse":true
}
]
}

3
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/notificationManagementConfig.ts

@ -1,7 +1,4 @@
import { dateUtil } from '/nerv-lib/util/date-util';
import { http } from '/nerv-lib/util';
import { notificationManagementApi } from '/@/api/alarmManagement/alarmSettings/notificationManagements'; import { notificationManagementApi } from '/@/api/alarmManagement/alarmSettings/notificationManagements';
import { ref } from 'vue';
const tableKeyMap = [ const tableKeyMap = [
{ {

8
hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/index.vue

@ -16,7 +16,7 @@
<!-- 详情页面 --> <!-- 详情页面 -->
<Look ref="look" /> <Look ref="look" />
<!-- 状态页面 --> <!-- 状态页面 -->
<Status ref="status" /> <Status ref="status" @logAdd="logAdd" />
</template> </template>
<script lang="ts"> <script lang="ts">
import { notificationtableConfig } from './ts/config'; import { notificationtableConfig } from './ts/config';
@ -31,11 +31,17 @@
setup() { setup() {
const look = ref(null); const look = ref(null);
const status = ref(null); const status = ref(null);
const mainRef = ref(null);
const config = notificationtableConfig(look, status); const config = notificationtableConfig(look, status);
const logAdd = () => {
mainRef.value?.nsTableRef.reload();
};
return { return {
config, config,
look, look,
status, status,
mainRef,
logAdd,
}; };
}, },
}; };

3
hx-ai-intelligent/src/view/alarmManagement/equipmentAlarm/look.vue

@ -72,6 +72,9 @@
const visible = ref(false); const visible = ref(false);
const handleClose = () => { const handleClose = () => {
visible.value = false; visible.value = false;
if (chartInstance) {
chartInstance.dispose();
}
infoObject.value = { infoObject.value = {
priority: null, priority: null,
alarmCode: null, alarmCode: null,

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

@ -11,25 +11,24 @@
<a-tabs> <a-tabs>
<a-tab-pane key="1" tab="更新状态"> <a-tab-pane key="1" tab="更新状态">
<div style="width: 100%; padding: 24px"> <div style="width: 100%; padding: 24px">
<a-form ref="formRef" :model="infoObject" :rules="rules"> <a-form ref="formRef" :model="infoObject">
<a-form-item ref="state" label="当前状态" createName="state"> <a-form-item ref="state" label="当前状态" name="state">
<a-select <a-select
v-model:value="infoObject.state" v-model:value="infoObject.state"
show-search show-search
placeholder="请选择设备点位" placeholder="请选择当前状态"
style="width: 85%" style="width: 85%"
:options="stateOptions" :options="stateOptions"
:disabled="showEdit" :disabled="showEdit" />
:filter-option="filterDevicePoint" />
<ns-icon <ns-icon
size="20" size="20"
@click="changeShowEdit" @click="changeShowEdit"
style="margin-left: 20px" style="margin-left: 20px"
:createName="showEdit ? 'bianji' : 'baocun'" /> :name="showEdit ? 'bianji' : 'baocun'" />
</a-form-item> </a-form-item>
<a-form-item label="备注" createName="desc"> <a-form-item label="备注" name="remarks">
<a-textarea <a-textarea
v-model:value="infoObject.desc" v-model:value="infoObject.remarks"
placeholder="请输入异常描述" placeholder="请输入异常描述"
:disabled="showEdit" :disabled="showEdit"
style="width: 85%" style="width: 85%"
@ -61,49 +60,49 @@
export default defineComponent({ export default defineComponent({
components: { NsSteps }, components: { NsSteps },
setup() { setup(props, { emit }) {
const visible = ref(false); const visible = ref(false);
const showEdit = ref(true); const showEdit = ref(true);
const infoObject = ref({}); const infoObject = ref({});
const equipmentAlarm = ref({}); const equipmentAlarm = ref({});
const stateOptions = ref(); const stateOptions = ref();
const logList = ref([ const logList = ref([]);
{ 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({ const config = ref({
size: logList.value.length, size: logList.value.length,
dataSource: logList.value, dataSource: logList.value,
}); });
const handleClose = () => { const handleClose = () => {
equipmentAlarm.value = P; showEdit.value = true;
equipmentAlarm.value = {};
infoObject.value = {};
visible.value = false; visible.value = false;
}; };
const btnClick = () => { const btnClick = () => {
NsMessage.success('操作成功');
delete infoObject.value.createTime; delete infoObject.value.createTime;
console.log(infoObject.value, equipmentAlarm.value, '操作'); infoObject.value.alarmEquipmentLogId = equipmentAlarm.value.id;
console.log('btnClick'); if (equipmentAlarm.value.createWorkOrder === 0) {
http.post(equipmentAlarmApi.noCreatOrUpdateLog, infoObject.value).then((res) => {
if (res.msg === 'success') {
NsMessage.success('操作成功');
showEdit.value = true;
equipmentAlarm.value = {};
infoObject.value = {};
visible.value = false;
emit('logAdd', null);
}
});
}
}; };
// //
const changeShowEdit = () => { const changeShowEdit = () => {
if (equipmentAlarm.value.createWorkOrder === 1) { //
if (equipmentAlarm.value.createWorkOrder === 0) {
showEdit.value = !showEdit.value; showEdit.value = !showEdit.value;
} }
}; };
const toggle = async (data) => { const toggle = async (data) => {
equipmentAlarm.value = { ...data }; equipmentAlarm.value = { ...data };
infoObject.value = { ...logList.value[0] }; visible.value = true;
await http
.post(equipmentAlarmApi.getSelectAlarmEquipmentLogStatusProcess, {
id: data.id,
})
.then((res) => {
console.log(res);
});
if (equipmentAlarm.value.createWorkOrder === 1) { if (equipmentAlarm.value.createWorkOrder === 1) {
stateOptions.value = [ stateOptions.value = [
{ value: 1, label: '待处理' }, { value: 1, label: '待处理' },
@ -120,26 +119,31 @@
{ value: 5, label: '已关闭' }, { value: 5, label: '已关闭' },
]; ];
} }
let statusMap = { console.log(data, 'data');
1: '待处理', await http
2: '处理中', .post(equipmentAlarmApi.getSelectAlarmEquipmentLogStatusProcess, {
3: '已完成', alarmEquipmentLogId: data.id,
4: '超时', })
5: '已关闭', .then((res) => {
}; if (res.msg === 'success') {
let colorMap = { logList.value = res.data;
1: '#ff7602', infoObject.value = { ...logList.value[0] };
2: '#00a1e6', infoObject.value.state = infoObject.value.state.value;
3: '#04d919', let colorMap = {
4: '#d9001b', 1: '#ff7602',
5: '#a6a6a6', 2: '#00a1e6',
}; 3: '#04d919',
logList.value.forEach((item) => { 4: '#d9001b',
item.stateName = statusMap[item.state]; 5: '#a6a6a6',
item.color = colorMap[item.state]; };
item.src = 'state-' + item.state; logList.value.forEach((item) => {
}); item.stateName = item.state.label;
visible.value = true; item.color = colorMap[item.state.value];
item.src = 'state-' + item.state.value;
});
config.value.dataSource = logList.value;
}
});
}; };
return { return {
infoObject, infoObject,

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

@ -1,9 +1,5 @@
import { dateUtil } from '/nerv-lib/util/date-util';
import data from '../notificationManagementMock.json';
import { http } from '/nerv-lib/util';
import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm'; import { equipmentAlarmApi } from '/@/api/alarmManagement/equipmentAlarm';
import { ref } from 'vue';
const tableKeyMap = [ const tableKeyMap = [
{ {
title: '序号', title: '序号',
@ -46,12 +42,10 @@ const tableKeyMap = [
dataIndex: 'alarmRepetitions', dataIndex: 'alarmRepetitions',
}, },
]; ];
const mockData = ref(data.listData);
export const notificationtableConfig = (look: any, status: any) => { export const notificationtableConfig = (look: any, status: any) => {
return { return {
title: '告警记录', title: '告警记录',
api: equipmentAlarmApi.getTableList, api: equipmentAlarmApi.getTableList,
value: mockData.value,
headerActions: [{}], headerActions: [{}],
scroll: { x: 2000 }, scroll: { x: 2000 },
columns: tableKeyMap, columns: tableKeyMap,
@ -86,6 +80,7 @@ export const notificationtableConfig = (look: any, status: any) => {
component: 'NsSelect', component: 'NsSelect',
componentProps: { componentProps: {
placeholder: '请选择告警优先级', placeholder: '请选择告警优先级',
allowClear: true,
options: [ options: [
{ {
label: '紧急', label: '紧急',
@ -108,6 +103,7 @@ export const notificationtableConfig = (look: any, status: any) => {
component: 'NsSelect', component: 'NsSelect',
componentProps: { componentProps: {
placeholder: '请选择状态', placeholder: '请选择状态',
allowClear: true,
options: [ options: [
{ {
label: '待处理', label: '待处理',
@ -137,6 +133,7 @@ export const notificationtableConfig = (look: any, status: any) => {
label: '错误码', label: '错误码',
component: 'NsSelectApi', component: 'NsSelectApi',
componentProps: { componentProps: {
allowClear: true,
placeholder: '请选择错误码', placeholder: '请选择错误码',
autoSelectFirst: false, autoSelectFirst: false,
api: equipmentAlarmApi.getCodeList, api: equipmentAlarmApi.getCodeList,
@ -149,7 +146,8 @@ export const notificationtableConfig = (look: any, status: any) => {
field: 'createTime', field: 'createTime',
label: '数据日期', label: '数据日期',
component: 'NsRangePicker', component: 'NsRangePicker',
fieldMap: ['manufactureBeginDate', 'manufactureEndDate'], allowClear: true,
fieldMap: ['startTime', 'endTime'],
componentProps: { componentProps: {
valueFormat: 'YYYY-MM-DD', valueFormat: 'YYYY-MM-DD',
placeholder: ['开始日期', '结束日期'], placeholder: ['开始日期', '结束日期'],

42
hx-ai-intelligent/src/view/alarmManagement/gatewayAlarm/status.vue

@ -12,13 +12,13 @@
<a-tab-pane key="1" tab="更新状态"> <a-tab-pane key="1" tab="更新状态">
<div style="width: 100%; padding: 24px"> <div style="width: 100%; padding: 24px">
<a-form ref="formRef" :model="infoObject" :rules="rules"> <a-form ref="formRef" :model="infoObject" :rules="rules">
<a-form-item ref="status" label="当前状态" name="status"> <a-form-item ref="state" label="当前状态" name="state">
<a-select <a-select
v-model:value="infoObject.status" v-model:value="infoObject.state"
show-search show-search
placeholder="请选择设备点位" placeholder="请选择设备点位"
style="width: 85%" style="width: 85%"
:options="statusOptions" :options="stateOptions"
:disabled="true" :disabled="true"
:filter-option="filterDevicePoint" /> :filter-option="filterDevicePoint" />
</a-form-item> </a-form-item>
@ -45,10 +45,8 @@
</template> </template>
<script> <script>
import { defineComponent } from 'vue'; import { defineComponent } from 'vue';
import { ref, createVNode } from 'vue'; import { ref } from 'vue';
import NsSteps from '/@/components/ns-steps.vue'; import NsSteps from '/@/components/ns-steps.vue';
import { NsMessage, NsModal } from '/nerv-lib/component';
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
export default defineComponent({ export default defineComponent({
components: { NsSteps }, components: { NsSteps },
@ -56,19 +54,19 @@
setup() { setup() {
const visible = ref(false); const visible = ref(false);
const infoObject = ref({}); const infoObject = ref({});
const statusOptions = ref([ const stateOptions = ref([
{ value: '1', label: '待处理' }, { value: 1, label: '待处理' },
{ value: '2', label: '处理中' }, { value: 2, label: '处理中' },
{ value: '3', label: '已完成' }, { value: 3, label: '已完成' },
{ value: '4', label: '超时' }, { value: 4, label: '超时' },
{ value: '5', label: '已关闭' }, { value: 5, label: '已关闭' },
]); ]);
const logList = ref([ const logList = ref([
{ name: '李四', status: '3', time: '2024-03-10 10:00:00', desc: '完成' }, { createName: '李四', state: 3, time: '2024-03-10 10:00:00', desc: '完成' },
{ name: '王五', status: '5', time: '2024-03-10 10:00:00' }, { createName: '王五', state: 5, time: '2024-03-10 10:00:00' },
{ name: '王五', status: '4', time: '2024-03-10 10:00:00' }, { createName: '王五', state: 4, time: '2024-03-10 10:00:00' },
{ name: '王五', status: '2', time: '2024-03-10 10:00:00', desc: '创建工单' }, { createName: '王五', state: 2, time: '2024-03-10 10:00:00', desc: '创建工单' },
{ name: '赵六', status: '1', time: '2024-03-10 10:00:00' }, { createName: '赵六', state: 1, time: '2024-03-10 10:00:00' },
]); ]);
const config = ref({ const config = ref({
size: logList.value.length, size: logList.value.length,
@ -82,7 +80,7 @@
}; };
const toggle = (data) => { const toggle = (data) => {
infoObject.value = { ...logList.value[0] }; infoObject.value = { ...logList.value[0] };
let statusMap = { let stateMap = {
1: '待处理', 1: '待处理',
2: '处理中', 2: '处理中',
3: '已完成', 3: '已完成',
@ -97,15 +95,15 @@
5: '#a6a6a6', 5: '#a6a6a6',
}; };
logList.value.forEach((item) => { logList.value.forEach((item) => {
item.statusName = statusMap[item.status]; item.stateName = stateMap[item.state];
item.color = colorMap[item.status]; item.color = colorMap[item.state];
item.src = 'status-' + item.status; item.src = 'state-' + item.state;
}); });
visible.value = true; visible.value = true;
}; };
return { return {
infoObject, infoObject,
statusOptions, stateOptions,
btnClick, btnClick,
visible, visible,
logList, logList,

Loading…
Cancel
Save