<template>
|
<div class="home-container">
|
<div style="height: 100%">
|
<el-row class="homeCard">
|
<el-col :span="6" style="display:flex;align-items: center">
|
<span style="white-space: nowrap">作业证编号:</span>
|
<div class="grid-content topInfo">
|
<el-input v-model="searchWord"></el-input>
|
</div>
|
</el-col>
|
<el-col :span="6" style="display:flex;align-items: center">
|
<span style="white-space: nowrap">作业类型:</span>
|
<div class="grid-content topInfo">
|
<el-select v-model="searchType" placeholder="请选择作业类型">
|
<el-option
|
v-for="item in workTypeList"
|
:key="item.id"
|
:label="item.name"
|
:value="item.id"
|
/>
|
</el-select>
|
</div>
|
</el-col>
|
<el-col :span="6" style="display:flex;align-items: center">
|
<span style="white-space: nowrap">预警类型:</span>
|
<div class="grid-content topInfo">
|
<el-select v-model="warningType" placeholder="请选择预警类型">
|
<el-option
|
v-for="item in alertTypeList"
|
:key="item.id"
|
:label="item.name"
|
:value="item.id"
|
/>
|
</el-select>
|
</div>
|
</el-col>
|
<el-button type="primary" @click="searchRecord">查询</el-button>
|
<el-button plain @click="clearSearch">重置</el-button>
|
</el-row>
|
<div class="homeCard">
|
<div class="main-card">
|
<!-- <el-row class="cardTop">-->
|
<!-- <el-col :span="12" class="mainCardBtn">-->
|
<!-- <el-button type="primary" :icon="Plus" size="default" @click="dialogAddRecord = true">新增</el-button>-->
|
<!-- </el-col>-->
|
<!-- <el-button type="primary" :icon="Refresh" size="default" @click="reLoadData"/>-->
|
<!-- </el-row>-->
|
<el-table
|
ref="multipleTableRef"
|
:data="tableData"
|
style="width: 100%"
|
height="calc(100% - 48px)"
|
:header-cell-style="{background: '#fafafa'}"
|
>
|
<el-table-column type="index" label="序号" width="80"/>
|
<el-table-column property="workPermitNo" label="作业证编号"/>
|
<el-table-column property="workTypeDesc" label="作业类型"/>
|
<el-table-column property="warningContent" show-overflow-tooltip label="预警信息"/>
|
<el-table-column property="warningTypeDesc" label="预警类型"/>
|
<el-table-column property="warningInfo" show-overflow-tooltip label="描述" width="200"/>
|
<el-table-column property="operatorUname" label="上报人"/>
|
<el-table-column property="operationTime" label="上报时间" width="180"/>
|
<el-table-column fixed="right" label="操作" align="center" width="250">
|
<template #default="scope">
|
<el-button link type="primary" size="small" :icon="View" @click="viewRecord(scope.row)">查看</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<div class="pageBtn">
|
<el-pagination
|
v-model:currentPage="currentPage"
|
v-model:page-size="pageSize"
|
:page-sizes="[10, 15]"
|
small=false
|
background
|
layout="total, sizes, prev, pager, next, jumper"
|
:total="totalSize"
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
/>
|
</div>
|
</div>
|
</div>
|
</div>
|
<el-dialog v-model="dialogDetails" title="作业预警记录">
|
<el-form :model="details" label-width="120px">
|
<el-form-item label="作业证编号">
|
<el-input v-model="details.workPermitNo" readonly/>
|
</el-form-item>
|
<el-form-item label="作业类型">
|
<el-input v-model="details.workTypeDesc" readonly/>
|
</el-form-item>
|
<el-form-item label="预警信息">
|
<el-input v-model="details.warningContent" readonly/>
|
</el-form-item>
|
<el-form-item label="预警类型">
|
<el-input v-model="details.warningTypeDesc" readonly/>
|
</el-form-item>
|
<el-form-item label="图片" v-if="details.imagePaths && details.imagePaths.length>0">
|
<el-image v-for="item in details.imagePaths" :preview-src-list="details.imagePaths" style="width: 150px; height: 150px;margin-right: 50px;margin-bottom: 20px" :src="item" fit="cover" />
|
</el-form-item>
|
<el-form-item label="描述">
|
<el-input v-model="details.warningInfo" type="textarea" readonly/>
|
</el-form-item>
|
<el-form-item label="上报人">
|
<el-input v-model="details.operatorUname" readonly/>
|
</el-form-item>
|
<el-form-item label="上报时间">
|
<el-input v-model="details.operationTime" readonly/>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" @click="dialogDetails = false" size="default">确认</el-button>
|
</el-form-item>
|
</el-form>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script lang="ts">
|
import { toRefs, reactive, ref, onMounted } from 'vue';
|
import { storeToRefs } from 'pinia';
|
import { initBackEndControlRoutes } from '/@/router/backEnd';
|
import { useUserInfo } from '/@/stores/userInfo';
|
import { Session } from '/@/utils/storage';
|
import { Edit, View, Plus, Delete, Refresh, Search, Download } from '@element-plus/icons-vue';
|
import { ElTable } from 'element-plus';
|
import { FormInstance, FormRules, ElMessage } from 'element-plus';
|
import { workProcessApi } from '/@/api/specialWorkSystem/workProcess';
|
|
// 定义接口来定义对象的类型
|
interface stateType {
|
tableData: Array<any>;
|
departmentList: Array<any>;
|
department:string;
|
workerList: Array<string>;
|
multipleSelection: Array<any>;
|
deleteArr: Array<any>;
|
dialogDetails: boolean;
|
dialogAddRecord: boolean;
|
deleteDialog: boolean;
|
deleteSetDialog: boolean;
|
pageIndex: number;
|
pageSize: number;
|
chosenIndex: null | number;
|
deleteId: null | number;
|
searchWord: string;
|
searchType: string;
|
warningType: string;
|
totalSize: number;
|
details: {
|
|
};
|
workTypeList: Array<any>;
|
alertTypeList: Array<any>
|
}
|
|
export default {
|
name: 'alerts',
|
components: {},
|
setup() {
|
const userInfo = useUserInfo();
|
const { userInfos } = storeToRefs(userInfo);
|
|
const state = reactive<stateType>({
|
pageIndex: 1,
|
pageSize: 10,
|
totalSize: 0,
|
chosenIndex: null,
|
searchWord: '',
|
searchType: '',
|
warningType: '',
|
tableData: [],
|
departmentList: [],
|
department: '',
|
workerList: [],
|
multipleSelection: [],
|
dialogDetails: false,
|
dialogAddRecord: false,
|
deleteDialog: false,
|
deleteSetDialog: false,
|
details: {},
|
deleteId: null,
|
deleteArr: [],
|
workTypeList: [
|
{ id: '1', name: '动火作业' },
|
{ id: '2', name: '受限空间作业' },
|
{ id: '3', name: '吊装作业' },
|
{ id: '4', name: '动土作业' },
|
{ id: '5', name: '断路作业' },
|
{ id: '6', name: '高处作业' },
|
{ id: '7', name: '临时用电作业' },
|
{ id: '8', name: '盲板抽堵作业' }
|
],
|
alertTypeList: [
|
{ id: '1', name: '检查' },
|
{ id: '2', name: '检测' }
|
]
|
});
|
|
// 页面载入时执行方法
|
onMounted(() => {
|
getListByPage();
|
});
|
|
// 分页获取班组管理列表
|
const getListByPage = async () => {
|
const data = { pageSize: state.pageSize, pageIndex: state.pageIndex, searchParams: { workType: state.searchType, workPermitNo: state.searchWord,warningType: state.warningType } };
|
let res = await workProcessApi().postAlertList(data);
|
if (res.data.code === '200') {
|
state.tableData = JSON.parse(JSON.stringify(res.data.data))
|
state.totalSize = res.data.total;
|
} else {
|
ElMessage({
|
type: 'warning',
|
message: res.data.msg
|
});
|
}
|
};
|
|
// 关键词查询记录
|
const searchRecord = () => {
|
if (state.searchWord == ''&& state.searchType == ''&& state.warningType == '') {
|
ElMessage({
|
type: 'warning',
|
message: '请输入查询关键词'
|
});
|
} else {
|
getListByPage();
|
}
|
};
|
|
const clearSearch = () => {
|
state.searchWord = ''
|
state.searchType = ''
|
state.warningType = ''
|
getListByPage()
|
};
|
|
const handleSizeChange = (val: number) => {
|
state.pageSize = val;
|
getListByPage();
|
};
|
|
const handleCurrentChange = (val: number) => {
|
state.pageIndex = val;
|
getListByPage();
|
};
|
|
// 查看记录
|
const viewRecord = (row) => {
|
state.details = JSON.parse(JSON.stringify(row));
|
state.dialogDetails = true;
|
};
|
|
// 刷新
|
const reLoadData = async () => {
|
getListByPage();
|
};
|
|
// 折线图
|
const renderMenu = async (value: string) => {
|
Session.set('projectId', value);
|
userInfos.value.projectId = value;
|
await initBackEndControlRoutes();
|
};
|
|
return {
|
View,
|
Edit,
|
Delete,
|
Refresh,
|
Plus,
|
searchRecord,
|
clearSearch,
|
viewRecord,
|
getListByPage,
|
reLoadData,
|
handleSizeChange,
|
handleCurrentChange,
|
...toRefs(state)
|
};
|
}
|
};
|
</script>
|
|
<style scoped lang="scss">
|
$homeNavLengh: 8;
|
.home-container {
|
height: calc(100vh - 144px);
|
box-sizing: border-box;
|
overflow: hidden;
|
.homeCard {
|
width: 100%;
|
padding: 20px;
|
box-sizing: border-box;
|
background: #fff;
|
border-radius: 4px;
|
|
.main-card {
|
width: 100%;
|
height: 100%;
|
.cardTop {
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
margin-bottom: 20px;
|
.mainCardBtn {
|
margin: 0;
|
}
|
}
|
.pageBtn {
|
height: 60px;
|
display: flex;
|
align-items: center;
|
justify-content: right;
|
|
.demo-pagination-block + .demo-pagination-block {
|
margin-top: 10px;
|
}
|
.demo-pagination-block .demonstration {
|
margin-bottom: 16px;
|
}
|
}
|
}
|
&:last-of-type {
|
height: calc(100% - 100px);
|
}
|
}
|
.el-row {
|
display: flex;
|
align-items: center;
|
margin-bottom: 20px;
|
&:last-child {
|
margin-bottom: 0;
|
}
|
.grid-content {
|
align-items: center;
|
min-height: 36px;
|
}
|
|
.topInfo {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
font-size: 16px;
|
font-weight: bold;
|
|
& > div {
|
white-space: nowrap;
|
margin-right: 20px;
|
}
|
}
|
}
|
}
|
.el-input{
|
width: 100% !important;
|
}
|
.el-date-editor::v-deep{
|
width: 100%;
|
}
|
.el-select{
|
width: 100%;
|
}
|
</style>
|