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

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

@ -1,5 +1,5 @@
alter table alarm_push_config 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)的子类( comment on column alarm_push_config.alarm_sub_type is '存对应监听模块(alarm_type)的子类(
alarms.AlarmGroupUnit, alarms.AlarmGroupUnit,

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

@ -1,4 +1,4 @@
alter table alarm_push_config alter table alarm_push_config
add poms_struc_factor_id jsonb; 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';

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

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

Loading…
Cancel
Save