Merge pull request 'lukeyan' (#38) from lukeyan into master

Reviewed-on: #38
pull/39/head
lukeyan 1 year ago
commit af0a2f24a8

@ -23,4 +23,20 @@ export function getIndexTable(params) {
method: 'post',
params
})
}
// 获取预警数据
export function getWarnTable(params) {
return request({
url: '/safety/system/tbSafeCompanyAlarmRule/getAlarmRules',
method: 'post',
params
})
}
// 修改预警数据
export function saveWarnTable(data) {
return request({
url: '/safety/system/tbSafeCompanyAlarmRule/batchUpdateOrInsert',
method: 'post',
data
})
}

@ -11,401 +11,423 @@
<tr class="table_body">
<td rowspan="5" @click="click_onelevel('3')"></td>
<td @click="click_twolevel('4')"></td>
<td @click="click_threelevel('5')"></td>
<td @click="click_threelevel('5', '1')">疫苗接种</td>
</tr>
<tr class="table_body">
<td @click="click_twolevel('7')"></td>
<td @click="click_threelevel('8')"></td>
<td @click="click_threelevel('8', '1')">核算检测</td>
</tr>
<tr class="table_body">
<td @click="click_twolevel('9')"></td>
<td @click="click_threelevel('10')"></td>
<td @click="click_threelevel('10', '1')">场所码异常</td>
</tr>
<tr class="table_body">
<td @click="click_twolevel('11')" rowspan="2">中高风险返企数</td>
<td @click="click_threelevel('12')"></td>
<td @click="click_threelevel('12', '1')">境外人</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('13')"></td>
<td @click="click_threelevel('13', '1')">境内人</td>
</tr>
<!-- 人员安全 -->
<tr class="table_body">
<td rowspan="14" @click="click_onelevel('14')"></td>
<td rowspan="4" @click="click_twolevel('15')"></td>
<td @click="click_threelevel('16')"></td>
<td @click="click_threelevel('16', '1')">未登记人</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('17')"></td>
<td @click="click_threelevel('17', '1')">未注销人</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('18')"></td>
<td @click="click_threelevel('18', '1')">未变更人</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('19')"></td>
<td @click="click_threelevel('19', '1')">高危人</td>
</tr>
<tr class="table_body">
<td rowspan="7" @click="click_twolevel('20')"></td>
<td @click="click_threelevel('21')"></td>
<td @click="click_threelevel('21', '1')">重性精神病</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('22')">访</td>
<td @click="click_threelevel('22', '1')">非访人</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('23')">退</td>
<td @click="click_threelevel('23', '1')">退役重点人</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('24')"></td>
<td @click="click_threelevel('24', '1')">个人极端人</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('25')"></td>
<td @click="click_threelevel('25', '1')">前科人</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('26')"></td>
<td @click="click_threelevel('26', '1')">家暴人</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('27')"></td>
<td @click="click_threelevel('27', '1')">酗酒人</td>
</tr>
<tr class="table_body">
<td rowspan="2" @click="click_twolevel('28')"></td>
<td @click="click_threelevel('29')">使</td>
<td @click="click_threelevel('29', '1')">危险品领用保管使用人</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('30')"></td>
<td @click="click_threelevel('30', '1')">危险品技术资质人</td>
</tr>
<tr class="table_body">
<td @click="click_twolevel('31')"></td>
<td @click="click_threelevel('32')"></td>
<td @click="click_threelevel('32', '1')">
领域内有较高专业知识技术的专家人才
</td>
</tr>
<!-- 消防安全 -->
<tr class="table_body">
<td rowspan="13" @click="click_onelevel('33')"></td>
<td rowspan="3" @click="click_twolevel('34')"></td>
<td @click="click_threelevel('35')"></td>
<td @click="click_threelevel('35', '1')">设备录入</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('36')"></td>
<td @click="click_threelevel('36', '2')">配置合理</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('37')"></td>
<td @click="click_threelevel('37', '1')">日常保养及时</td>
</tr>
<tr class="table_body">
<td rowspan="3" @click="click_twolevel('38')"></td>
<td @click="click_threelevel('39')"></td>
<td @click="click_threelevel('39', '2')">必要资</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('40')"></td>
<td @click="click_threelevel('40', '2')">验收许可或建设许</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('41')"></td>
<td @click="click_threelevel('41', '2')">日常检查</td>
</tr>
<tr class="table_body">
<td rowspan="3" @click="click_twolevel('42')"></td>
<td @click="click_threelevel('43')"></td>
<td @click="click_threelevel('43', '1')">人员培训</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('44')"></td>
<td @click="click_threelevel('44', '2')">演习举办情</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('45')"></td>
<td @click="click_threelevel('45', '2')">管理层专业知晓程</td>
</tr>
<tr class="table_body">
<td rowspan="4" @click="click_twolevel('46')"></td>
<td @click="click_threelevel('47')"></td>
<td @click="click_threelevel('47', '1')">火灾事</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('48')"></td>
<td @click="click_threelevel('48', '1')">其他事</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('49')"></td>
<td @click="click_threelevel('49', '1')">消防违</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('50')"></td>
<td @click="click_threelevel('50', '1')">协助扑</td>
</tr>
<!-- 危化运输安全 -->
<tr class="table_body">
<td rowspan="15" @click="click_onelevel('51')"></td>
<td rowspan="2" @click="click_twolevel('52')"></td>
<td @click="click_threelevel('53')"></td>
<td @click="click_threelevel('53', '1')">区内企业评</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('54')"></td>
<td @click="click_threelevel('54', '1')">区外企业评</td>
</tr>
<tr class="table_body">
<td rowspan="5" @click="click_twolevel('55')"></td>
<td @click="click_threelevel('56')"></td>
<td @click="click_threelevel('56', '1')"></td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('57')"></td>
<td @click="click_threelevel('57', '1')"></td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('58')"></td>
<td @click="click_threelevel('58', '1')"></td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('59')"></td>
<td @click="click_threelevel('59', '1')">疲劳驾</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('60')"></td>
<td @click="click_threelevel('60', '1')">未按车道行</td>
</tr>
<tr class="table_body">
<td rowspan="3" @click="click_twolevel('61')"></td>
<td @click="click_threelevel('62')"></td>
<td @click="click_threelevel('62', '1')">经损事</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('63')"></td>
<td @click="click_threelevel('63', '1')">伤亡事</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('64')"></td>
<td @click="click_threelevel('64', '1')">泄漏事</td>
</tr>
<tr class="table_body">
<td @click="click_twolevel('65')">/</td>
<td @click="click_threelevel('66')"></td>
<td @click="click_threelevel('66', '2')">有无拘留</td>
</tr>
<tr class="table_body">
<td rowspan="2" @click="click_twolevel('67')"></td>
<td @click="click_threelevel('68')"></td>
<td @click="click_threelevel('68', '1')">反馈整改完</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('69')"></td>
<td @click="click_threelevel('69', '1')">整改反馈未完</td>
</tr>
<tr class="table_body">
<td rowspan="2" @click="click_twolevel('70')"></td>
<td @click="click_threelevel('71')"></td>
<td @click="click_threelevel('71', '1')">企业演</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('72')"></td>
<td @click="click_threelevel('72', '1')">集中培训学</td>
</tr>
<!-- 列管物品安全 -->
<tr class="table_body">
<td rowspan="10" @click="click_onelevel('73')"></td>
<td rowspan="2" @click="click_twolevel('74')"></td>
<td @click="click_threelevel('75')">使</td>
<td @click="click_threelevel('75', '1')">
易制爆物品生产购买销售储存使用
</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('76')">使</td>
<td @click="click_threelevel('76', '1')">
剧毒物品生产购买销售储存使用
</td>
</tr>
<tr class="table_body">
<td rowspan="3" @click="click_twolevel('77')"></td>
<td @click="click_threelevel('78')"></td>
<td @click="click_threelevel('78', '1')">放射源储</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('79')"></td>
<td @click="click_threelevel('79', '1')">放射源运</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('80')">使</td>
<td @click="click_threelevel('80', '1')">放射源使</td>
</tr>
<tr class="table_body">
<td rowspan="2" @click="click_twolevel('81')"></td>
<td @click="click_threelevel('82')"></td>
<td @click="click_threelevel('82', '1')">烟花爆竹运输销售</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('83')">使</td>
<td @click="click_threelevel('83', '1')">炸药雷管保管运输使</td>
</tr>
<tr class="table_body">
<td rowspan="3" @click="click_twolevel('84')"></td>
<td @click="click_threelevel('85')"></td>
<td @click="click_threelevel('85', '1')"></td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('86')"></td>
<td @click="click_threelevel('86', '1')">竞技体育用</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('87')"></td>
<td @click="click_threelevel('87', '1')">商业射击馆枪</td>
</tr>
<!-- 内部治安安全 -->
<tr class="table_body">
<td rowspan="15" @click="click_onelevel('88')"></td>
<td rowspan="4" @click="click_twolevel('89')"></td>
<td @click="click_threelevel('90')"></td>
<td @click="click_threelevel('90', '2')">企业保卫人员名</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('91')"></td>
<td @click="click_threelevel('91', '2')">企业物防设施清</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('92')">()</td>
<td @click="click_threelevel('92', '2')">
企业技防前端感知(人脸车脸重要部位视频监控)建设
</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('93')"></td>
<td @click="click_threelevel('93', '1')">企业技防设施连入平台情</td>
</tr>
<tr class="table_body">
<td rowspan="3" @click="click_twolevel('94')">
企业各类规章制度应急预案应急演练
</td>
<td @click="click_threelevel('95')"></td>
<td @click="click_threelevel('95', '2')">规章制</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('96')"></td>
<td @click="click_threelevel('96', '2')">应急预</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('97')"></td>
<td @click="click_threelevel('97', '2')">应急演</td>
</tr>
<tr class="table_body">
<td rowspan="3" @click="click_twolevel('98')"></td>
<td @click="click_threelevel('99')"></td>
<td @click="click_threelevel('99', '2')">部门检查合格进行评</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('100')"></td>
<td @click="click_threelevel('100', '2')">
部门检查不合格及有缺陷的要求企业整改
</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('101')">()</td>
<td @click="click_threelevel('101', '2')">
应系统研判(设施过期及设施故障)
</td>
</tr>
<tr class="table_body">
<td rowspan="2" @click="click_twolevel('102')"></td>
<td @click="click_threelevel('103')"></td>
<td @click="click_threelevel('103', '1')">企业反馈整改完</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('104')"></td>
<td @click="click_threelevel('104', '1')">企业反馈整改未完</td>
</tr>
<tr class="table_body">
<td rowspan="3" @click="click_twolevel('105')">
企业发生的案件及企业员工涉及的案件
</td>
<td @click="click_threelevel('106')"></td>
<td @click="click_threelevel('106', '1')">
企业发生被盗被骗等各类案件
</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('107')"></td>
<td @click="click_threelevel('107', '1')">企业员工涉及的各类案</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('108')">访</td>
<td @click="click_threelevel('108', '1')">企业员工涉及的信访等案</td>
</tr>
<!-- 道路安全 -->
<tr class="table_body">
<td rowspan="13" @click="click_onelevel('109')"></td>
<td rowspan="2" @click="click_twolevel('110')"></td>
<td @click="click_threelevel('111')"></td>
<td @click="click_threelevel('111', '1')">区内企业评</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('112')"></td>
<td @click="click_threelevel('112', '1')">区外企业评</td>
</tr>
<tr class="table_body">
<td rowspan="5" @click="click_twolevel('113')"></td>
<td @click="click_threelevel('114')"></td>
<td @click="click_threelevel('114', '1')"></td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('115')"></td>
<td @click="click_threelevel('115', '1')"></td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('116')"></td>
<td @click="click_threelevel('116', '1')"></td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('117')"></td>
<td @click="click_threelevel('117', '1')">未按车道行</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('118')"></td>
<td @click="click_threelevel('118', '1')">闯红</td>
</tr>
<tr class="table_body">
<td rowspan="2" @click="click_twolevel('119')"></td>
<td @click="click_threelevel('120')"></td>
<td @click="click_threelevel('120', '1')">经损事</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('121')"></td>
<td @click="click_threelevel('121', '1')">伤亡事</td>
</tr>
<tr class="table_body">
<td rowspan="2" @click="click_twolevel('122')"></td>
<td @click="click_threelevel('123')"></td>
<td @click="click_threelevel('123', '1')">反馈整改完</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('124')"></td>
<td @click="click_threelevel('124', '1')">反馈整改未完</td>
</tr>
<tr class="table_body">
<td rowspan="2" @click="click_twolevel('125')"></td>
<td @click="click_threelevel('126')"></td>
<td @click="click_threelevel('126', '1')">设施完</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('127')"></td>
<td @click="click_threelevel('127', '1')">设施缺</td>
</tr>
<!-- 防攻击安全 -->
<tr class="table_body">
<td rowspan="16" @click="click_onelevel('128')"></td>
<td rowspan="6" @click="click_twolevel('129')"></td>
<td @click="click_threelevel('130')"></td>
<td @click="click_threelevel('130', '2')">
重要岗位人员是否进行安全背景调查
</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('131')"></td>
<td @click="click_threelevel('131', '2')">应急力量是否配</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('132')">24</td>
<td @click="click_threelevel('132', '2')">是否安排人员24小时值</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('133')"></td>
<td @click="click_threelevel('133', '2')">是否安排巡逻防控力</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('134')"></td>
<td @click="click_threelevel('134', '2')">是否建立联防联动联治机</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('135')"></td>
<td @click="click_threelevel('135', '2')">是否定期开展实战演</td>
</tr>
<tr class="table_body">
<td rowspan="3" @click="click_twolevel('136')"></td>
<td @click="click_threelevel('137')"></td>
<td @click="click_threelevel('137', '2')">是否有实体防护设</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('138')"></td>
<td @click="click_threelevel('138', '2')">是否配备必要的防爆器</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('139')"></td>
<td @click="click_threelevel('139', '2')">
车辆进出口是否安装车辆冲撞设施
</td>
</tr>
<tr class="table_body">
<td rowspan="3" @click="click_twolevel('140')"></td>
<td @click="click_threelevel('141')"></td>
<td @click="click_threelevel('141', '2')">
是否全方位安装视频监控系统
</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('142')">访</td>
<td @click="click_threelevel('142', '2')">是否安装访客登记系</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('143')"></td>
<td @click="click_threelevel('143', '2')">
是否安装入侵和紧急报警系统
</td>
</tr>
<tr class="table_body">
<td rowspan="2" @click="click_twolevel('144')"></td>
<td @click="click_threelevel('145')"></td>
<td @click="click_threelevel('145', '1')">企业反馈完成整</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('146')"></td>
<td @click="click_threelevel('146', '1')">企业反馈未完成整</td>
</tr>
<tr class="table_body">
<td rowspan="2" @click="click_twolevel('147')">
企业定期开展反恐实战演练培训
</td>
<td @click="click_threelevel('148')"></td>
<td @click="click_threelevel('148', '2')">是否定期开展反恐实战演</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('149')"></td>
<td @click="click_threelevel('149', '2')">是否定期开展反恐培</td>
</tr>
<!-- 网络安全 -->
<tr class="table_body">
<td rowspan="10" @click="click_onelevel('150')"></td>
<td rowspan="2" @click="click_twolevel('151')"></td>
<td @click="click_threelevel('152')"></td>
<td @click="click_threelevel('152', '1')">反馈整改完</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('153')"></td>
<td @click="click_threelevel('153', '1')">反馈整改未完</td>
</tr>
<tr class="table_body">
<td @click="click_twolevel('154')"></td>
<td @click="click_threelevel('155')"></td>
<td @click="click_threelevel('155', '2')">是否有过行政处</td>
</tr>
<tr class="table_body">
<td @click="click_twolevel('156')"></td>
<td @click="click_threelevel('157')"></td>
<td @click="click_threelevel('157', '2')">是否发生</td>
</tr>
<tr class="table_body">
<td rowspan="3" @click="click_twolevel('158')"></td>
<td @click="click_threelevel('159')"></td>
<td @click="click_threelevel('159', '2')">网站备</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('160')"></td>
<td @click="click_threelevel('160', '2')">应用备</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('161')"></td>
<td @click="click_threelevel('161', '2')">应用评</td>
</tr>
<tr class="table_body">
<td @click="click_twolevel('162')"></td>
<td @click="click_threelevel('163')">/</td>
<td @click="click_threelevel('163', '2')">等保定级评审完成/未完</td>
</tr>
<tr class="table_body">
<td rowspan="2" @click="click_twolevel('164')"></td>
<td @click="click_threelevel('165')"></td>
<td @click="click_threelevel('165', '2')">应急演</td>
</tr>
<tr class="table_body">
<td @click="click_threelevel('166')"></td>
<td @click="click_threelevel('166', '2')">集中培训学</td>
</tr>
</table>
</div>
@ -463,10 +485,11 @@ export default {
bus.$emit("send", massage); //
},
//
click_threelevel(id) {
const massage = {
click_threelevel(id, num) {
const massage = {
safeRuleId: id,
level: "3",
table_num: num,
};
this.$emit("back", massage);
bus.$emit("send_three", massage); //

@ -1,7 +1,7 @@
<!-- 一级指标详细信息展示 -->
<template>
<div class="massage_body">
<div class="massage_form">
<div class="massage_body_one">
<div class="massage_form_one">
<div class="form_title">
<div class="title_text">{{ this.form_data.sumTitle }}</div>
</div>
@ -75,9 +75,9 @@ export default {
created() {
//
this.params = {
safeRuleId: 3,
levelIndex: 1
};
safeRuleId: 3,
levelIndex: 1,
};
safeCalculation(this.params).then((res) => {
this.form_data = res.data.ruleDetail;
this.form.rate_one = this.form_data.calculation[0].rate;
@ -110,6 +110,24 @@ export default {
});
},
methods: {
// 穿
// penetrate(level, id) {
// this.params = {
// safeRuleId: id,
// levelIndex: level,
// };
// safeCalculation(this.params).then((res) => {
// this.form_data = res.data.ruleDetail;
// this.form.rate_one = this.form_data.calculation[0].rate;
// this.sumTitle = res.data.ruleDetail.sumTitle;
// this.id = res.data.id;
// this.safeRuleId = res.data.safeRuleId;
// this.first_index = this.form_data.calculation[0].indexName;
// this.form.form_data_for = res.data.ruleDetail.calculation.filter(
// (element, index) => index > 0
// );
// });
// },
//
change_form() {
this.btn_flag = false;
@ -227,12 +245,12 @@ export default {
}
}
}
.massage_body {
.massage_body_one {
margin-top: 2vh;
width: 52.5vw;
height: 52vh;
border: 0.1px solid #4d8f89;
.massage_form {
.massage_form_one {
display: flex;
margin-top: 1vh;
margin-left: 0.6vw;
@ -244,7 +262,7 @@ export default {
.form_title {
width: 7vw;
height: 22vh;
// line-height: 7.5vh;
// line-height: 7.5vh;
font-size: 18px;
text-align: right;
.title_text {

@ -1,30 +1,185 @@
<!-- 三级指标详细信息展示 -->
<template>
<div class="massage_body">
<div class="note_text">{{ this.note.titleNote }}</div>
<div :title="massage_title" class="note_text">
{{ this.note.titleNote }}
</div>
<div class="three_table">
<div class="three_table_top">
<div class="title_btn">
<div class="title">指数归一化设置:</div>
<el-button icon="el-icon-plus">增加数量分级</el-button>
<div class="btn">
<el-button @click="save_data"></el-button>
<el-button v-if="is_flag" icon="el-icon-plus" @click="add_data"
>增加数量分级</el-button
>
</div>
</div>
<el-table
v-if="is_flag"
max-height="310"
:header-cell-style="table_header"
:data="tableData_all"
:cell-style="{ background: 'revert', 'text-align': 'center' }"
>
<el-table-column prop="level" :label="label">
<template slot-scope="scope">
<div class="table_cell">
<el-input
class="table_input"
type="number"
v-model="scope.row.scoreLowerLimit"
></el-input>
<div class="input_text">~</div>
<el-input
class="table_input"
type="number"
v-model="scope.row.scoreUpperLimit"
></el-input>
</div>
</template>
</el-table-column>
<el-table-column prop="score" label="分值设置" width="360">
<template slot-scope="scope">
<div class="table_cell">
<el-input
class="table_input"
type="number"
v-model="scope.row.score"
></el-input>
<div class="input_text"></div>
</div>
</template>
</el-table-column>
<el-table-column prop="operation" label="操作" width="250">
<template slot-scope="scope">
<el-button
size="small"
class="operation"
icon="el-icon-delete"
@click="delete_data(scope.$index, scope.row)"
>
</el-button>
</template>
</el-table-column>
</el-table>
<el-table
v-else
max-height="310"
:header-cell-style="table_header"
:data="tableData_all"
:cell-style="{ background: 'revert', 'text-align': 'center' }"
>
<el-table-column prop="scoreLowerLimit" label="分值设置" width="360">
</el-table-column>
<el-table-column prop="score" label="分值设置">
<template slot-scope="scope">
<el-input
class="table_input"
type="number"
v-model="scope.row.score"
></el-input>
</template>
</el-table-column
></el-table>
<!-- 预警 -->
<div class="title_btn">
<div class="title">指数预警化设置:</div>
<div class="btn">
<el-button @click="save_data_warn"></el-button>
<el-button
icon="el-icon-plus"
@click="add_data_warn"
:disabled="add_warn_disabled"
>增加预警分级</el-button
>
</div>
</div>
<el-table></el-table>
<el-table
height="310"
:header-cell-style="table_header"
:data="tableData_warn"
:cell-style="{ background: 'revert', 'text-align': 'center' }"
>
<el-table-column prop="level" label="预警等级">
<template slot-scope="scope">
<div class="table_cell">
<div class="logo">
<div
:style="{ background: styleChange(scope.row.color) }"
class="logo_cell"
></div>
</div>
<el-input
placeholder="请填入预警等级"
class="table_input_warn_level"
v-model="scope.row.alarmLevel"
></el-input>
</div>
</template>
</el-table-column>
<el-table-column prop="change_num" label="预警分值" width="360">
<template slot-scope="scope">
<div class="table_cell">
<el-input
class="table_input"
type="number"
v-model="scope.row.scoreLowerLimit"
></el-input>
<div class="input_text">~</div>
<el-input
class="table_input"
type="number"
v-model="scope.row.scoreUpperLimit"
></el-input>
</div>
</template>
</el-table-column>
<el-table-column prop="operation" label="操作" width="250">
<template slot-scope="scope">
<el-button
size="small"
class="operation"
icon="el-icon-delete"
@click="delete_data_warn(scope.$index, scope.row)"
>
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</template>
<script>
import bus from "@/assets/js/eventBus.js";
import { getIndexTable } from "@/api/systemManagement/safeIndex";
import {
safeCalculation,
getIndexTable,
saveSafeCalculation,
getWarnTable,
saveWarnTable,
} from "@/api/systemManagement/safeIndex";
export default {
name: "indexmassageThree",
data() {
return {
is_flag: true, //
table_num: "", // 1 2
massage_title: "", //
note_arr: [], // id
two_level_arr: [], //
three_level_arr: [], //
three_level_id: "",
note: "", //
tableData_all: [],
label: "", //
tableData_warn: [],
safeRuleId: "",
id: "",
color: "", //
sortValue: "",
add_warn_disabled: false, //
};
},
created() {
@ -34,11 +189,38 @@ export default {
bus.$on("send_three", (data) => {
console.log("data", data);
this.three_level_id = data.safeRuleId; // id
this.table_num = data.table_num; // 12
const new_arr = this.three_level_arr.filter(
(item) => item.id == this.three_level_id
);
console.log("new_arr", new_arr);
this.note = JSON.parse(new_arr[0].note);
this.massage_title = this.note.titleNote;
this.label = `${new_arr[0].levelIndexThree}数量分级(人)`;
safeCalculation({ safeRuleId: this.three_level_id, levelIndex: 3 }).then(
(res) => {
console.log("3res", res);
// if
if (this.table_num === "1") {
this.is_flag = true;
} else if (this.table_num === "2") {
this.is_flag = false;
}
this.tableData_all = []; //
this.tableData_warn = []
this.tableData_all = JSON.parse(res.data.calculationRule).calculation;
console.log("this.tableData_all", this.tableData_all);
this.safeRuleId = res.data.safeRuleId; // safeRuleIdsafeRuleIdsafeRuleId
this.id = res.data.id;
console.log("this.safeRuleId", JSON.stringify(this.safeRuleId));
//
getWarnTable({ safeRuleId: this.safeRuleId }).then((res) => {
console.log("reswarn", res);
this.tableData_warn = res.data;
this.tableData_warn[0].color = "red";
});
}
);
});
},
methods: {
@ -48,7 +230,6 @@ export default {
console.log("res", res.data);
this.note_arr = res.data;
for (let i = 0; i < this.note_arr.length; i++) {
console.log("1", this.note_arr[i].tbSafeRuleTwoVoList);
//
this.two_level_arr = this.two_level_arr.concat(
this.note_arr[i].tbSafeRuleTwoVoList
@ -63,6 +244,134 @@ export default {
console.log("this.three_level_arr", this.three_level_arr);
});
},
//
table_header({ row, rowIndex }) {
console.log(row);
console.log(rowIndex);
return {
"text-align": "center", //
color: "#fff",
};
},
//
add_data() {
this.tableData_all.push({
scoreLowerLimit: "0",
scoreUpperLimit: "0",
score: "0",
});
},
//
//
add_data_warn() {
if (this.tableData_warn.length === 0) {
this.color = "red";
this.sortValue = "1";
} else if (this.tableData_warn.length === 1) {
this.color = "yellow";
this.sortValue = "2";
} else if (this.tableData_warn.length === 2) {
this.color = "blue";
this.sortValue = "3";
} else if (this.tableData_warn.length === 3) {
this.color = "green";
this.sortValue = "4";
this.add_warn_disabled = true;
this.$message.warning("至多四条预警数据");
}
this.tableData_warn.push({
alarmLevel: "",
scoreLowerLimit: "0",
scoreUpperLimit: "0",
color: this.color,
sortValue: this.sortValue,
});
},
//
delete_data(index, row) {
console.log("index", index);
console.log("row", row);
this.tableData_all.splice(index, 1);
},
//
delete_data_warn(index, row) {
console.log("indexw", index + 1);
if (this.tableData_warn.length === index + 1) {
//
this.tableData_warn.splice(index, 1);
if (this.tableData_warn.length != 4) {
this.add_warn_disabled = false; // 4
}
} else {
this.$message.warning("请按倒数顺序删除预警数据");
}
console.log("roww", row);
},
//
save_data() {
console.log("this.tableData_all", this.tableData_all);
const obj = {
calculation: [],
};
obj.calculation = this.tableData_all.map((item) => ({
scoreLowerLimit: item.scoreLowerLimit,
scoreUpperLimit: item.scoreUpperLimit,
score: item.score,
}));
const params = {
calculationRule: JSON.stringify(obj),
id: this.id,
safeRuleId: this.safeRuleId,
};
console.log("params123", params);
saveSafeCalculation(params)
.then((res) => {
console.log("ressave", res);
this.$message.success("保存成功");
})
.catch((err) => {
console.log("errsave", err);
this.$message.warning('保存失败')
});
},
//
save_data_warn() {
const obj = {
calculation: [],
};
obj.calculation = this.tableData_warn.map((item) => ({
id: item.id,
safeRuleId: item.safeRuleId,
alarmLevel: item.alarmLevel,
scoreUpperLimit: item.scoreUpperLimit,
scoreLowerLimit: item.scoreLowerLimit,
color: item.color,
sortValue: item.sortValue,
}));
const params = {
alarmRule: JSON.stringify(obj),
};
saveWarnTable(params).then((res) => {
console.log(res);
this.$message.success('保存成功')
}).catch(err=>{
console.log(err);
this.$message.warning('保存失败')
})
},
//
styleChange(color) {
switch (color) {
case "red":
return "#FF5656";
case "yellow":
return "#FDA722";
case "blue":
return "#22C0FD";
case "green":
return "#2BE08B";
}
},
},
};
</script>
@ -77,6 +386,9 @@ export default {
margin-left: 0.4vw;
width: 51.5vw;
height: 4.5vh;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
border-bottom: 0.1px solid #4d8f89;
color: #fff;
font-size: 20px;
@ -89,16 +401,14 @@ export default {
width: 51.5vw;
height: 44.5vh;
overflow-y: auto;
border: 0.1px solid #4d8f89;
.three_table_top {
margin-left: 0.2vw;
margin-top: 0.5vh;
width: 51vw;
border: 0.1px solid #4d8f89;
width: 50.5vw;
.title_btn {
margin-left: 0.5vw;
margin-top: 0.5vh;
width: 50vw;
width: 49.5vw;
height: 4vh;
display: flex;
justify-content: space-between;
@ -123,6 +433,109 @@ export default {
}
}
}
.el-table {
margin-top: 1vh;
margin-bottom: 1vh;
margin-left: 0.5vw;
width: 49.5vw;
color: #fff;
.table_cell {
display: flex;
justify-content: center;
.table_input.el-input {
width: 6vw !important;
}
.table_input_warn_level.el-input {
width: 10vw !important;
/deep/.el-input__inner {
width: 9vw !important;
}
}
.input_text {
text-align: left;
height: 100%;
line-height: 280%;
width: 0.5vw;
color: #fff;
}
.logo {
width: 16px;
display: flex;
flex-direction: column;
justify-content: center;
.logo_cell {
width: 16px;
height: 16px;
border-radius: 50%;
}
}
}
}
/deep/.el-table__body-wrapper.is-scrolling-none {
background: #233438 !important;
}
/deep/.el-table__body-wrapper.is-scrolling-none::-webkit-scrollbar {
width: 6px;
background-color: #5e666a;
border-radius: 4px;
}
/deep/.el-table__body-wrapper.is-scrolling-none::-webkit-scrollbar-thumb {
width: 5px;
background-color: #3c4b4a;
border-radius: 4px;
}
.el-button.operation.el-button--default.el-button--small {
background: #233b38;
border: 0px;
color: #fff;
font-size: 18px;
}
.el-button.operation.el-button--default.el-button--small:focus,
.el-button.operation.el-button--default.el-button--small:hover {
color: #f55050;
}
/deep/.el-table::-webkit-scrollbar {
width: 6px;
background-color: #5e666a;
border-radius: 4px;
}
/deep/.el-table::-webkit-scrollbar-thumb {
width: 5px;
background-color: #3c4b4a;
border-radius: 4px;
}
/deep/.el-table {
thead {
color: #fff;
font-weight: 500;
background: linear-gradient(
to right,
#284f49,
#2f6363,
#233b38
) !important;
& th {
background-color: transparent;
}
& tr {
background-color: transparent;
}
}
tr {
background: #233438;
}
}
/deep/.el-input__inner {
width: 5vw;
border-radius: 0px;
font-size: 16px;
background: #3c4b4a;
color: #fff;
}
.three_table::-webkit-scrollbar {
width: 6px;
background-color: #5e666a;

Loading…
Cancel
Save