add:设备告警修改流程对接
This commit is contained in:
@@ -2,4 +2,5 @@ export enum equipmentAlarmApi {
|
||||
getTableList = '/carbon-smart/api/AlarmEquipmentLog/selectAlarmEquipmentLog', //设备告警 列表
|
||||
getCodeList = '/carbon-smart/api/AlarmEquipmentLog/selectErrorCodeList', //设备告警 列表
|
||||
getSelectAlarmEquipmentLogStatusProcess = '/carbon-smart/api/AlarmEquipmentLogStatusProcess/selectAlarmEquipmentLogStatusProcess', //设备告警 状态 没有创建工单log接口
|
||||
noCreatOrUpdateLog = '/carbon-smart/api/AlarmEquipmentLogStatusProcess/creatOrUpdate', //设备告警 状态 没有创建工单 添加 修改状态log
|
||||
}
|
||||
|
@@ -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
|
||||
}
|
||||
]
|
||||
|
||||
}
|
@@ -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 { ref } from 'vue';
|
||||
|
||||
const tableKeyMap = [
|
||||
{
|
||||
|
@@ -16,7 +16,7 @@
|
||||
<!-- 详情页面 -->
|
||||
<Look ref="look" />
|
||||
<!-- 状态页面 -->
|
||||
<Status ref="status" />
|
||||
<Status ref="status" @logAdd="logAdd" />
|
||||
</template>
|
||||
<script lang="ts">
|
||||
import { notificationtableConfig } from './ts/config';
|
||||
@@ -31,11 +31,17 @@
|
||||
setup() {
|
||||
const look = ref(null);
|
||||
const status = ref(null);
|
||||
const mainRef = ref(null);
|
||||
const config = notificationtableConfig(look, status);
|
||||
const logAdd = () => {
|
||||
mainRef.value?.nsTableRef.reload();
|
||||
};
|
||||
return {
|
||||
config,
|
||||
look,
|
||||
status,
|
||||
mainRef,
|
||||
logAdd,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
@@ -72,6 +72,9 @@
|
||||
const visible = ref(false);
|
||||
const handleClose = () => {
|
||||
visible.value = false;
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose();
|
||||
}
|
||||
infoObject.value = {
|
||||
priority: null,
|
||||
alarmCode: null,
|
||||
|
@@ -11,25 +11,24 @@
|
||||
<a-tabs>
|
||||
<a-tab-pane key="1" tab="更新状态">
|
||||
<div style="width: 100%; padding: 24px">
|
||||
<a-form ref="formRef" :model="infoObject" :rules="rules">
|
||||
<a-form-item ref="state" label="当前状态" createName="state">
|
||||
<a-form ref="formRef" :model="infoObject">
|
||||
<a-form-item ref="state" label="当前状态" name="state">
|
||||
<a-select
|
||||
v-model:value="infoObject.state"
|
||||
show-search
|
||||
placeholder="请选择设备点位"
|
||||
placeholder="请选择当前状态"
|
||||
style="width: 85%"
|
||||
:options="stateOptions"
|
||||
:disabled="showEdit"
|
||||
:filter-option="filterDevicePoint" />
|
||||
:disabled="showEdit" />
|
||||
<ns-icon
|
||||
size="20"
|
||||
@click="changeShowEdit"
|
||||
style="margin-left: 20px"
|
||||
:createName="showEdit ? 'bianji' : 'baocun'" />
|
||||
:name="showEdit ? 'bianji' : 'baocun'" />
|
||||
</a-form-item>
|
||||
<a-form-item label="备注" createName="desc">
|
||||
<a-form-item label="备注" name="remarks">
|
||||
<a-textarea
|
||||
v-model:value="infoObject.desc"
|
||||
v-model:value="infoObject.remarks"
|
||||
placeholder="请输入异常描述"
|
||||
:disabled="showEdit"
|
||||
style="width: 85%"
|
||||
@@ -61,49 +60,49 @@
|
||||
export default defineComponent({
|
||||
components: { NsSteps },
|
||||
|
||||
setup() {
|
||||
setup(props, { emit }) {
|
||||
const visible = ref(false);
|
||||
const showEdit = ref(true);
|
||||
const infoObject = ref({});
|
||||
const equipmentAlarm = ref({});
|
||||
const stateOptions = 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 logList = ref([]);
|
||||
const config = ref({
|
||||
size: logList.value.length,
|
||||
dataSource: logList.value,
|
||||
});
|
||||
const handleClose = () => {
|
||||
equipmentAlarm.value = P;
|
||||
showEdit.value = true;
|
||||
equipmentAlarm.value = {};
|
||||
infoObject.value = {};
|
||||
visible.value = false;
|
||||
};
|
||||
const btnClick = () => {
|
||||
NsMessage.success('操作成功');
|
||||
delete infoObject.value.createTime;
|
||||
console.log(infoObject.value, equipmentAlarm.value, '操作');
|
||||
console.log('btnClick');
|
||||
infoObject.value.alarmEquipmentLogId = equipmentAlarm.value.id;
|
||||
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 = () => {
|
||||
if (equipmentAlarm.value.createWorkOrder === 1) {
|
||||
// 未生成工单
|
||||
if (equipmentAlarm.value.createWorkOrder === 0) {
|
||||
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);
|
||||
});
|
||||
visible.value = true;
|
||||
if (equipmentAlarm.value.createWorkOrder === 1) {
|
||||
stateOptions.value = [
|
||||
{ value: 1, label: '待处理' },
|
||||
@@ -120,26 +119,31 @@
|
||||
{ value: 5, label: '已关闭' },
|
||||
];
|
||||
}
|
||||
let statusMap = {
|
||||
1: '待处理',
|
||||
2: '处理中',
|
||||
3: '已完成',
|
||||
4: '超时',
|
||||
5: '已关闭',
|
||||
};
|
||||
let colorMap = {
|
||||
1: '#ff7602',
|
||||
2: '#00a1e6',
|
||||
3: '#04d919',
|
||||
4: '#d9001b',
|
||||
5: '#a6a6a6',
|
||||
};
|
||||
logList.value.forEach((item) => {
|
||||
item.stateName = statusMap[item.state];
|
||||
item.color = colorMap[item.state];
|
||||
item.src = 'state-' + item.state;
|
||||
});
|
||||
visible.value = true;
|
||||
console.log(data, 'data');
|
||||
await http
|
||||
.post(equipmentAlarmApi.getSelectAlarmEquipmentLogStatusProcess, {
|
||||
alarmEquipmentLogId: data.id,
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.msg === 'success') {
|
||||
logList.value = res.data;
|
||||
infoObject.value = { ...logList.value[0] };
|
||||
infoObject.value.state = infoObject.value.state.value;
|
||||
let colorMap = {
|
||||
1: '#ff7602',
|
||||
2: '#00a1e6',
|
||||
3: '#04d919',
|
||||
4: '#d9001b',
|
||||
5: '#a6a6a6',
|
||||
};
|
||||
logList.value.forEach((item) => {
|
||||
item.stateName = item.state.label;
|
||||
item.color = colorMap[item.state.value];
|
||||
item.src = 'state-' + item.state.value;
|
||||
});
|
||||
config.value.dataSource = logList.value;
|
||||
}
|
||||
});
|
||||
};
|
||||
return {
|
||||
infoObject,
|
||||
|
@@ -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 { ref } from 'vue';
|
||||
const tableKeyMap = [
|
||||
{
|
||||
title: '序号',
|
||||
@@ -46,12 +42,10 @@ const tableKeyMap = [
|
||||
dataIndex: 'alarmRepetitions',
|
||||
},
|
||||
];
|
||||
const mockData = ref(data.listData);
|
||||
export const notificationtableConfig = (look: any, status: any) => {
|
||||
return {
|
||||
title: '告警记录',
|
||||
api: equipmentAlarmApi.getTableList,
|
||||
value: mockData.value,
|
||||
headerActions: [{}],
|
||||
scroll: { x: 2000 },
|
||||
columns: tableKeyMap,
|
||||
@@ -86,6 +80,7 @@ export const notificationtableConfig = (look: any, status: any) => {
|
||||
component: 'NsSelect',
|
||||
componentProps: {
|
||||
placeholder: '请选择告警优先级',
|
||||
allowClear: true,
|
||||
options: [
|
||||
{
|
||||
label: '紧急',
|
||||
@@ -108,6 +103,7 @@ export const notificationtableConfig = (look: any, status: any) => {
|
||||
component: 'NsSelect',
|
||||
componentProps: {
|
||||
placeholder: '请选择状态',
|
||||
allowClear: true,
|
||||
options: [
|
||||
{
|
||||
label: '待处理',
|
||||
@@ -137,6 +133,7 @@ export const notificationtableConfig = (look: any, status: any) => {
|
||||
label: '错误码',
|
||||
component: 'NsSelectApi',
|
||||
componentProps: {
|
||||
allowClear: true,
|
||||
placeholder: '请选择错误码',
|
||||
autoSelectFirst: false,
|
||||
api: equipmentAlarmApi.getCodeList,
|
||||
@@ -149,7 +146,8 @@ export const notificationtableConfig = (look: any, status: any) => {
|
||||
field: 'createTime',
|
||||
label: '数据日期',
|
||||
component: 'NsRangePicker',
|
||||
fieldMap: ['manufactureBeginDate', 'manufactureEndDate'],
|
||||
allowClear: true,
|
||||
fieldMap: ['startTime', 'endTime'],
|
||||
componentProps: {
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
placeholder: ['开始日期', '结束日期'],
|
||||
|
@@ -12,13 +12,13 @@
|
||||
<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="当前状态" name="state">
|
||||
<a-select
|
||||
v-model:value="infoObject.status"
|
||||
v-model:value="infoObject.state"
|
||||
show-search
|
||||
placeholder="请选择设备点位"
|
||||
style="width: 85%"
|
||||
:options="statusOptions"
|
||||
:options="stateOptions"
|
||||
:disabled="true"
|
||||
:filter-option="filterDevicePoint" />
|
||||
</a-form-item>
|
||||
@@ -45,10 +45,8 @@
|
||||
</template>
|
||||
<script>
|
||||
import { defineComponent } from 'vue';
|
||||
import { ref, createVNode } from 'vue';
|
||||
import { ref } from '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({
|
||||
components: { NsSteps },
|
||||
@@ -56,19 +54,19 @@
|
||||
setup() {
|
||||
const visible = ref(false);
|
||||
const infoObject = ref({});
|
||||
const statusOptions = ref([
|
||||
{ value: '1', label: '待处理' },
|
||||
{ value: '2', label: '处理中' },
|
||||
{ value: '3', label: '已完成' },
|
||||
{ value: '4', label: '超时' },
|
||||
{ value: '5', label: '已关闭' },
|
||||
const stateOptions = ref([
|
||||
{ value: 1, label: '待处理' },
|
||||
{ value: 2, label: '处理中' },
|
||||
{ value: 3, label: '已完成' },
|
||||
{ value: 4, label: '超时' },
|
||||
{ value: 5, label: '已关闭' },
|
||||
]);
|
||||
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, time: '2024-03-10 10:00:00', desc: '完成' },
|
||||
{ createName: '王五', state: 5, time: '2024-03-10 10:00:00' },
|
||||
{ createName: '王五', state: 4, time: '2024-03-10 10:00:00' },
|
||||
{ createName: '王五', state: 2, time: '2024-03-10 10:00:00', desc: '创建工单' },
|
||||
{ createName: '赵六', state: 1, time: '2024-03-10 10:00:00' },
|
||||
]);
|
||||
const config = ref({
|
||||
size: logList.value.length,
|
||||
@@ -82,7 +80,7 @@
|
||||
};
|
||||
const toggle = (data) => {
|
||||
infoObject.value = { ...logList.value[0] };
|
||||
let statusMap = {
|
||||
let stateMap = {
|
||||
1: '待处理',
|
||||
2: '处理中',
|
||||
3: '已完成',
|
||||
@@ -97,15 +95,15 @@
|
||||
5: '#a6a6a6',
|
||||
};
|
||||
logList.value.forEach((item) => {
|
||||
item.statusName = statusMap[item.status];
|
||||
item.color = colorMap[item.status];
|
||||
item.src = 'status-' + item.status;
|
||||
item.stateName = stateMap[item.state];
|
||||
item.color = colorMap[item.state];
|
||||
item.src = 'state-' + item.state;
|
||||
});
|
||||
visible.value = true;
|
||||
};
|
||||
return {
|
||||
infoObject,
|
||||
statusOptions,
|
||||
stateOptions,
|
||||
btnClick,
|
||||
visible,
|
||||
logList,
|
||||
|
Reference in New Issue
Block a user