更新首页+异常告警接口对接和仓库首页跳转问题
This commit is contained in:
@@ -34,6 +34,12 @@
|
||||
import Navbar from './components/Navbar';
|
||||
import moment from 'moment';
|
||||
import tableHeightMixin from '@/mixins/tableHeightMixin';
|
||||
import { listData } from '@/api/system/dict/data';
|
||||
import alarmGrade from './alarmGrade.vue'
|
||||
import {
|
||||
getHomeAlarmList
|
||||
} from '@/api/home';
|
||||
|
||||
export default {
|
||||
name: 'AbnormalWarning',
|
||||
mixins: [tableHeightMixin],
|
||||
@@ -45,25 +51,28 @@ export default {
|
||||
type: 'input',
|
||||
label: '报警来源',
|
||||
placeholder: '报警来源',
|
||||
param: 'content',
|
||||
param: 'alarmSource',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
type: 'datePicker',
|
||||
label: '时间段',
|
||||
selectOptions: [],
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
param: 'typeId',
|
||||
filterable: true,
|
||||
dateType: 'daterange',
|
||||
format: 'yyyy-MM-dd',
|
||||
valueFormat: 'timestamp',
|
||||
rangeSeparator: '-',
|
||||
startPlaceholder: '开始时间',
|
||||
endPlaceholder: '结束时间',
|
||||
param: 'alarmTime',
|
||||
},
|
||||
{
|
||||
type: 'select',
|
||||
label: '报警级别',
|
||||
selectOptions: [],
|
||||
labelField: 'name',
|
||||
valueField: 'id',
|
||||
param: 'typeId',
|
||||
param: 'alarmGrade',
|
||||
defaultSelect: '',
|
||||
filterable: true,
|
||||
labelField: 'label',
|
||||
valueField: 'value',
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
@@ -75,60 +84,79 @@ export default {
|
||||
heightNum: 280,
|
||||
tableProps: [
|
||||
{
|
||||
prop: 'createTime',
|
||||
prop: 'alarmTime',
|
||||
label: '报警时间',
|
||||
width: 180,
|
||||
filter: (val) => moment(val).format('yyyy-MM-DD HH:mm:ss'),
|
||||
},
|
||||
{
|
||||
prop: 'productionLineName1',
|
||||
prop: 'alarmSource',
|
||||
label: '报警来源',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'productionLineName2',
|
||||
prop: 'alarmType',
|
||||
label: '报警类型',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'productionLineName3',
|
||||
prop: 'alarmGrade',
|
||||
label: '报警级别',
|
||||
showOverflowtooltip: true,
|
||||
subcomponent: alarmGrade
|
||||
},
|
||||
{
|
||||
prop: 'productionLineName4',
|
||||
prop: 'alarmReason',
|
||||
label: '报警原因',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
{
|
||||
prop: 'sectionName5',
|
||||
prop: 'alarmContent',
|
||||
label: '报警详情',
|
||||
showOverflowtooltip: true,
|
||||
},
|
||||
],
|
||||
list: [
|
||||
{ productionLineName: 1 },
|
||||
{ productionLineName: 1 },
|
||||
{ productionLineName: 1 },
|
||||
{ productionLineName: 1 },
|
||||
{ productionLineName: 1 },
|
||||
{ productionLineName: 1 },
|
||||
{ productionLineName: 1 },
|
||||
{ productionLineName: 1 },
|
||||
{ productionLineName: 1 },
|
||||
{ productionLineName: 1 },
|
||||
{ productionLineName: 1 },
|
||||
{ productionLineName: 1 },
|
||||
{ productionLineName: 1 },
|
||||
{ productionLineName: 1 },
|
||||
{ productionLineName: 1 },
|
||||
{ productionLineName: 1 },
|
||||
],
|
||||
list: [],
|
||||
listQuery: {
|
||||
alarmSource: undefined,
|
||||
alarmTime: undefined,
|
||||
alarmGrade: undefined,
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
created() {
|
||||
const queryParams = {
|
||||
pageNo: 1,
|
||||
pageSize: 99,
|
||||
dictType: 'equ_alarm_level',
|
||||
};
|
||||
listData(queryParams).then((response) => {
|
||||
this.formConfig[2].selectOptions = response.data.list;
|
||||
});
|
||||
this.getDataList()
|
||||
},
|
||||
methods: {
|
||||
buttonClick(val) {},
|
||||
buttonClick(val) {
|
||||
switch (val.btnName) {
|
||||
case 'search':
|
||||
this.listQuery.alarmSource = val.alarmSource;
|
||||
this.listQuery.alarmGrade = val.alarmGrade;
|
||||
this.listQuery.alarmTime = val.alarmTime ? val.alarmTime : null;
|
||||
this.getDataList();
|
||||
break;
|
||||
default:
|
||||
console.log(val);
|
||||
}
|
||||
},
|
||||
getDataList(){
|
||||
getHomeAlarmList(this.listQuery).then(response => {
|
||||
if(response.hasOwnProperty('data')){
|
||||
this.list = response.data;
|
||||
}else{
|
||||
this.list = []
|
||||
}
|
||||
});
|
||||
},
|
||||
toHome() {
|
||||
this.$router.push({ path: '/' });
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user