Browse Source

fix:还原工作组件

deploy-dev
zhaohy 5 months ago
parent
commit
77052ae284
  1. 2
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue
  2. 78
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue
  3. 2
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue
  4. 13
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue
  5. 2
      hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/configureDeviceAlarms.ts
  6. 15
      lib/component/table/table.vue

2
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/configureDeviceAlarms.vue

@ -135,7 +135,7 @@
name: 'FeedBackDetail', name: 'FeedBackDetail',
dynamicParams: ['uuid', 'appealType'], dynamicParams: ['uuid', 'appealType'],
handle: (data: any) => { handle: (data: any) => {
console.log(data, 'xxxxxxx'); editConfigureDeviceAlarms.value.toggle(data);
}, },
}, },
{ {

78
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editConfigureDeviceAlarm.vue

@ -2,11 +2,11 @@
<ns-drawer <ns-drawer
v-model:visible="visible" v-model:visible="visible"
width="520" width="520"
:title="infoObject?.id ? '编辑' : '新增'" :title="infoObject?.id ? '编辑告警规则' : '新增告警规则'"
:ok="btnClick" :ok="btnClick"
:cancel="handleClose" :cancel="handleClose"
placement="right"> placement="right">
<div style="padding: 18px"> <div style="padding: 18px; width: 100%; overflow: hidden">
<a-form ref="formRef" :model="infoObject" :rules="rules"> <a-form ref="formRef" :model="infoObject" :rules="rules">
<a-form-item ref="name" label="站点" name="name"> <a-form-item ref="name" label="站点" name="name">
<a-tree-select <a-tree-select
@ -72,12 +72,6 @@
:filter-option="filterOption" :filter-option="filterOption"
@change="handleQzChange" /> @change="handleQzChange" />
</a-form-item> </a-form-item>
<a-form-item label="规则类型" name="resource">
<a-radio-group v-model:value="infoObject.resource">
<a-radio value="1">(and)</a-radio>
<a-radio value="2">(or)</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="异常描述" name="desc"> <a-form-item label="异常描述" name="desc">
<a-textarea <a-textarea
v-model:value="infoObject.desc" v-model:value="infoObject.desc"
@ -86,17 +80,44 @@
show-count show-count
:maxlength="30" /> :maxlength="30" />
</a-form-item> </a-form-item>
<template v-for="index in infoObject.alarmList?.length" :key="index"> <a-form-item label="规则类型" name="resource">
<a-form-item :label="`逻辑${index}`" name="alarm"> <a-radio-group v-model:value="infoObject.resource">
<a-input style="width: 60px" v-model:value="infoObject.alarmList[index - 1].alarm" /> <a-radio value="1"> (and) </a-radio>
<a-radio value="2"> (or) </a-radio>
</a-radio-group>
</a-form-item> </a-form-item>
<a-form-item :label="`数值${index}`" name="number"> <template v-for="index in infoObject.alarmList?.length" :key="index">
<div
style="
width: 100%;
display: flex;
margin-left: 42px;
padding: 12px;
border-color: #ff4d4f !important;
">
<span style="line-height: 32px">{{ `逻辑${index}:` }}</span>
<a-select
v-model:value="infoObject.alarmList[index - 1].alarm"
style="width: 70px; margin-left: 12px"
:options="ljOptions"
@change="handleQzChange" />
<span style="line-height: 32px; margin-left: 32px">{{ `数值${index}:` }}</span>
<a-input <a-input
style="width: 60px" style="width: 65px; margin-left: 6px"
type="number" type="number"
v-model:value="infoObject.alarmList[index - 1].number" /> v-model:value="infoObject.alarmList[index - 1].number" />
</a-form-item> <div
style="width: 70px; align-items: center; cursor: pointer"
@click="deleteAlarmList(index - 1)">
<img
style="width: 14px; margin: 0 12px"
src="https://files.axshare.com/gsc/4T0UQR/5a/e6/81/5ae6813d499c422383c7a15dd956523f/images/设备规则/u72.svg?pageId=cbce6e61-bc6a-4283-802d-993fce6151c0" />
</div>
</div>
</template> </template>
<div style="width: 100%; margin-top: 12px; display: flex; justify-content: flex-end">
<a-button type="primary" @click="addAlarmList"> 新增</a-button>
</div>
</a-form> </a-form>
</div> </div>
</ns-drawer> </ns-drawer>
@ -120,6 +141,8 @@
delivery: null, delivery: null,
alarmList: [{ alarm: null, number: null }], alarmList: [{ alarm: null, number: null }],
}); });
//
const delAlarmList = ref([]);
const formRef = ref(); const formRef = ref();
// //
const zdTreeData = ref<TreeSelectProps['treeData']>([ const zdTreeData = ref<TreeSelectProps['treeData']>([
@ -193,6 +216,14 @@
{ value: '实时值', label: '实时值', code: '1' }, { value: '实时值', label: '实时值', code: '1' },
{ value: '平均值', label: '平均值', code: '2' }, { value: '平均值', label: '平均值', code: '2' },
]); ]);
//
const ljOptions = ref<SelectProps['options']>([
{ value: '1', label: '≥' },
{ value: '2', label: '>' },
{ value: '3', label: '≤' },
{ value: '4', label: '<' },
{ value: '5', label: '=' },
]);
// //
const filterOption = (input: string, option: any) => { const filterOption = (input: string, option: any) => {
console.log('搜索', option.value); console.log('搜索', option.value);
@ -264,6 +295,7 @@
// //
formRef.value.validate().then(() => { formRef.value.validate().then(() => {
console.log('values', infoObject, toRaw(infoObject)); console.log('values', infoObject, toRaw(infoObject));
delAlarmList.value = [];
}); });
// //
// http // http
@ -293,8 +325,24 @@
alarmList: [{ alarm: null, number: null }], alarmList: [{ alarm: null, number: null }],
}; };
visible.value = false; visible.value = false;
delAlarmList.value = [];
NsMessage.success('操作成功'); NsMessage.success('操作成功');
}; };
//
const addAlarmList = () => {
if (infoObject.value.alarmList) {
infoObject.value.alarmList.push({ alarm: null, number: null });
} else {
infoObject.value.alarmList = [{ alarm: null, number: null }];
}
};
//
const deleteAlarmList = (index: number) => {
if (infoObject.value.alarmList[index]?.id) {
delAlarmList.value.push(infoObject.value.alarmList[index]);
}
infoObject.value.alarmList.splice(index, 1);
};
defineExpose({ defineExpose({
toggle, toggle,
handleClose, handleClose,
@ -334,6 +382,6 @@
/deep/ .ant-form-item-label { /deep/ .ant-form-item-label {
z-index: 20; z-index: 20;
text-align: right; text-align: right;
width: 20%; width: 23%;
} }
</style> </style>

2
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/equipmentAlarm/editeEquipmentAlarm.vue

@ -2,7 +2,7 @@
<ns-drawer <ns-drawer
v-model:visible="visible" v-model:visible="visible"
width="520" width="520"
:title="infoObject?.id ? '编辑' : '新增'" :title="infoObject?.id ? '修改告警功能' : '新增告警'"
:ok="btnClick" :ok="btnClick"
:cancel="handleClose" :cancel="handleClose"
placement="right"> placement="right">

13
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/index.vue

@ -2,7 +2,7 @@
<div class="box"> <div class="box">
<a-tabs default-active-key="1" @change="callback"> <a-tabs default-active-key="1" @change="callback">
<a-tab-pane key="1" tab="通知管理"> <a-tab-pane key="1" tab="通知管理">
<ns-view-list-table v-bind="notificationConfig" ref="mainRef" @switch="changeUse" /> <ns-view-list-table v-bind="notificationConfig" ref="mainRef" />
</a-tab-pane> </a-tab-pane>
<a-tab-pane key="2" tab="设备告警" force-render> <a-tab-pane key="2" tab="设备告警" force-render>
<ns-view-list-table v-show="equipmentAlarm" class="table" v-bind="equipmentAlarmConfig" /> <ns-view-list-table v-show="equipmentAlarm" class="table" v-bind="equipmentAlarmConfig" />
@ -54,11 +54,11 @@
equipmentAlarm.value = !equipmentAlarm.value; equipmentAlarm.value = !equipmentAlarm.value;
configureDeviceAlarms.value.show = false; configureDeviceAlarms.value.show = false;
}; };
const changeUse = () => { // const changeUse = () => {
console.log(mainRef.value); // console.log(mainRef.value);
mainRef.value?.nsTableRef.reload(); // mainRef.value?.nsTableRef.reload();
// console.log(newList.value.formFinish, ''); // // console.log(newList.value.formFinish, '');
}; // };
// //
const editObject = () => { const editObject = () => {
console.log('添加成功 刷新列表'); console.log('添加成功 刷新列表');
@ -69,7 +69,6 @@
callback, callback,
notificationConfig, notificationConfig,
equipmentAlarmConfig, equipmentAlarmConfig,
changeUse,
editObject, editObject,
editEquipmentAlarm, editEquipmentAlarm,
configureDeviceAlarms, configureDeviceAlarms,

2
hx-ai-intelligent/src/view/alarmManagement/alarmSettings/ts/configureDeviceAlarms.ts

@ -16,7 +16,7 @@ const tableKeyMap = [
dataIndex: 'id', dataIndex: 'id',
}, },
{ {
title: '设备信', title: '设备信',
dataIndex: 'deviceCode', dataIndex: 'deviceCode',
}, },
{ {

15
lib/component/table/table.vue

@ -141,16 +141,6 @@
<span class="text-ellipsis" v-else> - </span> <span class="text-ellipsis" v-else> - </span>
</span> </span>
</template> </template>
<!-- 添加关闭按钮 -->
<template v-if="data.column.dataIndex === 'isUse'">
<a-switch
v-model:checked="data.record.isUse"
:class="{
'blue-background': data.record.isUse,
'grey-background': !data.record.isUse,
}"
@click="clickSwitch({ isUse: data.record.isUse, record: data.record })" />
</template>
<template v-if="data.column.dataIndex === 'tableAction'"> <template v-if="data.column.dataIndex === 'tableAction'">
<ns-table-action <ns-table-action
:data="data.record" :data="data.record"
@ -360,10 +350,6 @@
page: 1, page: 1,
}); });
}, 300); }, 300);
/* 点击开关按钮 */
const clickSwitch = (data: object) => {
emit('switch', data);
};
function setLoading(loading: boolean) { function setLoading(loading: boolean) {
tableState.loading = loading; tableState.loading = loading;
@ -647,7 +633,6 @@
tableState, tableState,
isEmpty, isEmpty,
formFinish, formFinish,
clickSwitch,
tableChangeEvent, tableChangeEvent,
treeSelect, treeSelect,
getTreeBindValue, getTreeBindValue,

Loading…
Cancel
Save