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