巴林闲侠 2 years ago
parent
commit
938577c146
  1. 4
      api/app/lib/models/alarm_push_config.js
  2. 2
      script/0.10/schema/1.alter_alarm_push_config.sql
  3. 2
      script/0.11/schema/1.alter_alarm_push_config.sql
  4. 31
      web/client/src/sections/service/components/pushModal.jsx

4
api/app/lib/models/alarm_push_config.js

@ -46,7 +46,7 @@ module.exports = dc => {
type: DataTypes.JSONB,
allowNull: true,
defaultValue: null,
comment: "监听的告警类型",
comment: "监听的告警类型的子类id的关联",
primaryKey: false,
field: "alarm_sub_type",
autoIncrement: false
@ -55,7 +55,7 @@ module.exports = dc => {
type: DataTypes.JSONB,
allowNull: true,
defaultValue: null,
comment: "监听的告警类型",
comment: "结构物与监测项id的关联",
primaryKey: false,
field: "poms_struc_factor_id",
autoIncrement: false

2
script/0.10/schema/1.alter_alarm_push_config.sql

@ -1,5 +1,5 @@
alter table alarm_push_config
add alarm_sub_type jsonb
add alarm_sub_type jsonb;
comment on column alarm_push_config.alarm_sub_type is '存对应监听模块(alarm_type)的子类(
alarms.AlarmGroupUnit,

2
script/0.11/schema/1.alter_alarm_push_config.sql

@ -1,4 +1,4 @@
alter table alarm_push_config
add poms_struc_factor_id jsonb;
comment on column alarm_push_config.poms_project_factor_id is '结构物对应监测项 id';
comment on column alarm_push_config.poms_struc_factor_id is '结构物对应监测项 id';

31
web/client/src/sections/service/components/pushModal.jsx

@ -205,20 +205,29 @@ function pushModal (props) {
}
}
if (key == 'pomsProjectId') {
getProjectStructureList(values.pomsProjectId)//
for (let i = 0; i < projectPoms.length; i++) {
if (values.pomsProjectId == projectPoms[i].id) {
if (projectPoms[i].pepProjectId) {
getProjectStatusList()//
}
else {
setProjectStatus([{ construction_status: 'POMS', id: 'POMS' }])
form.current.setValue('timeType', ['POMS'])
form.current.validate()
if (values.pomsProjectId.length > 0) {
getProjectStructureList(values.pomsProjectId)//
let pepProjectId = []
let projectData = values.pomsProjectId?.map(v => {
let data = projectPoms?.filter(u => u.id == v) || []
if (data.length) {
pepProjectId.push(data[0].pepProjectId || 'POMS')
}
})
if (pepProjectId.length == 1 && pepProjectId.includes('POMS')) {
setProjectStatus([{ construction_status: 'POMS', id: 'POMS' }])
form.current.setValue('timeType', ['POMS'])
form.current.validate()
} else {
getProjectStatusList()//
}
} else {
setProjectStructure([])
form.current.setValue('strucId', [])
setProjectStatus([])
form.current.setValue('timeType', [])
}
}
if (key == 'alarmType') {
setSubType(field['alarmType'])

Loading…
Cancel
Save