告警:类型字段修改
链路:order显示
This commit is contained in:
parent
f8e047105d
commit
65338b5ec0
@ -30,15 +30,18 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, reactive, computed, watch, onMounted } from 'vue'
|
import { ref, reactive, computed, watch, onMounted } from 'vue'
|
||||||
|
|
||||||
const props = withDefaults(defineProps<{ visible: boolean; type: string; type138: any; type140: any }>(), {
|
const props = withDefaults(defineProps<{ visible: boolean; type: string; type138: any; type140: any; type199: any }>(), {
|
||||||
visible: false,
|
visible: false,
|
||||||
type: '138',
|
type: '138',
|
||||||
type138: [],
|
type138: [],
|
||||||
type140: [],
|
type140: [],
|
||||||
|
type199: [],
|
||||||
})
|
})
|
||||||
|
|
||||||
const showData = computed(() => {
|
const showData = computed(() => {
|
||||||
let data = props.type === '138' ? props.type138 : props.type140
|
console.log(props);
|
||||||
|
|
||||||
|
let data = props.type === '138' ? props.type138 : props.type === '140' ? props.type140 : props.type199
|
||||||
return data.slice((pageSetting.current - 1) * pageSetting.pageSize, pageSetting.current * pageSetting.pageSize)
|
return data.slice((pageSetting.current - 1) * pageSetting.pageSize, pageSetting.current * pageSetting.pageSize)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -40,11 +40,11 @@
|
|||||||
<el-table-column prop="eventTimeFormate" :label="AlarmsFieldsEnums['alarmTime']" align="center"> </el-table-column>
|
<el-table-column prop="eventTimeFormate" :label="AlarmsFieldsEnums['alarmTime']" align="center"> </el-table-column>
|
||||||
<el-table-column prop="deviceCode" :label="AlarmsFieldsEnums['airBlowerNumber']" align="center"> </el-table-column>
|
<el-table-column prop="deviceCode" :label="AlarmsFieldsEnums['airBlowerNumber']" align="center"> </el-table-column>
|
||||||
<el-table-column prop="eventText" :label="AlarmsFieldsEnums['faultDescription']" align="center"> </el-table-column>
|
<el-table-column prop="eventText" :label="AlarmsFieldsEnums['faultDescription']" align="center"> </el-table-column>
|
||||||
<el-table-column prop="eventType" :label="AlarmsFieldsEnums['alarmType']" align="center">
|
<el-table-column prop="eventLevel" :label="AlarmsFieldsEnums['alarmType']" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div class="tip" v-if="scope.row.eventType===0">提示</div>
|
<div class="tip" v-if="scope.row.eventType === 0">提示</div>
|
||||||
<div class="alarm" v-if="scope.row.eventType===1">告警</div>
|
<div class="alarm" v-if="scope.row.eventType === 1">告警</div>
|
||||||
<div class="fault" v-if="scope.row.eventType===2">故障</div>
|
<div class="fault" v-if="scope.row.eventType === 2">故障</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
@ -142,11 +142,11 @@ const getFormattedDate = (offset: number) => {
|
|||||||
const airBlowerNumberValue = ref('')
|
const airBlowerNumberValue = ref('')
|
||||||
const airBlowerList = ref([{ label: '', value: '' }])
|
const airBlowerList = ref([{ label: '', value: '' }])
|
||||||
// 类别
|
// 类别
|
||||||
const alarmTypeValue = ref('')
|
const alarmTypeValue = ref(2)
|
||||||
const alarmTypes = ref([
|
const alarmTypes = ref([
|
||||||
{ label: '提示', value: 0 },
|
|
||||||
{ label: '告警', value: 1 },
|
|
||||||
{ label: '故障', value: 2 },
|
{ label: '故障', value: 2 },
|
||||||
|
{ label: '告警', value: 1 },
|
||||||
|
{ label: '提示', value: 0 },
|
||||||
])
|
])
|
||||||
|
|
||||||
const searchalarms = (): GetAlarmsTableParam => {
|
const searchalarms = (): GetAlarmsTableParam => {
|
||||||
@ -345,7 +345,7 @@ $paginationHeight: 32px;
|
|||||||
}
|
}
|
||||||
.tablePart {
|
.tablePart {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
.tip{
|
.tip {
|
||||||
border: 1px solid #39baf4;
|
border: 1px solid #39baf4;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
|
@ -23,7 +23,7 @@ export type GetAlarmsTableParam = {
|
|||||||
startTime: string | number
|
startTime: string | number
|
||||||
endTime: string | number
|
endTime: string | number
|
||||||
deviceCode: any
|
deviceCode: any
|
||||||
eventLevel?: string | null
|
eventLevel?: string | number | null
|
||||||
pageNum?: Number
|
pageNum?: Number
|
||||||
pageSize?: Number
|
pageSize?: Number
|
||||||
}
|
}
|
||||||
|
@ -182,7 +182,7 @@ let univerAPI: any = null
|
|||||||
//#endregion
|
//#endregion
|
||||||
const init = async () => {
|
const init = async () => {
|
||||||
const reqSheetData = await getMappingList()
|
const reqSheetData = await getMappingList()
|
||||||
const sheetData = createSheetData(reqSheetData, 12)
|
const sheetData = createSheetData(reqSheetData, route.query.protocol as any)
|
||||||
const data = createWookbookData(route.query.protocol as any, route.query.id as string, sheetData)
|
const data = createWookbookData(route.query.protocol as any, route.query.id as string, sheetData)
|
||||||
initExcel(data)
|
initExcel(data)
|
||||||
getTreeDataType()
|
getTreeDataType()
|
||||||
@ -379,7 +379,6 @@ const tipsPos = reactive({
|
|||||||
const saveExcelData = () => {
|
const saveExcelData = () => {
|
||||||
const data = getData()
|
const data = getData()
|
||||||
const val = createUpLoadExcelData(data)
|
const val = createUpLoadExcelData(data)
|
||||||
console.log(val)
|
|
||||||
|
|
||||||
saveMappingList(val)
|
saveMappingList(val)
|
||||||
}
|
}
|
||||||
|
@ -1075,8 +1075,6 @@ const DEFAULT_WORKBOOK_DATA = {
|
|||||||
const createHeaderData = (protocol: string | number) => {
|
const createHeaderData = (protocol: string | number) => {
|
||||||
if (!protocol) return {}
|
if (!protocol) return {}
|
||||||
const headerData: any = {}
|
const headerData: any = {}
|
||||||
console.log(protocol);
|
|
||||||
console.log(excelDefaultConfig[protocol]);
|
|
||||||
|
|
||||||
Object.keys(excelDefaultConfig[protocol!]).forEach((item) => {
|
Object.keys(excelDefaultConfig[protocol!]).forEach((item) => {
|
||||||
const dynamicData: any = {}
|
const dynamicData: any = {}
|
||||||
@ -1238,7 +1236,9 @@ export const createUpLoadExcelData = (workbookData: any) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const createSheetData = (data: any, protocol: string | number) => {
|
export const createSheetData = (data: any, protocol: string | number) => {
|
||||||
|
console.log('createSheetData')
|
||||||
if (!protocol) return {}
|
if (!protocol) return {}
|
||||||
|
|
||||||
const excelCellDataMap: any = {}
|
const excelCellDataMap: any = {}
|
||||||
const headerData = createHeaderData(protocol)
|
const headerData = createHeaderData(protocol)
|
||||||
const resultData: any = {}
|
const resultData: any = {}
|
||||||
@ -1254,7 +1254,6 @@ export const createSheetData = (data: any, protocol: string | number) => {
|
|||||||
const row = index + 1
|
const row = index + 1
|
||||||
result[row] = {}
|
result[row] = {}
|
||||||
Object.keys(obj).forEach((field) => {
|
Object.keys(obj).forEach((field) => {
|
||||||
|
|
||||||
const col = excelCellDataMap[field]
|
const col = excelCellDataMap[field]
|
||||||
if (col) {
|
if (col) {
|
||||||
let custom: any
|
let custom: any
|
||||||
|
Loading…
Reference in New Issue
Block a user