<template>
|
<div class="page-container page-safety colorfff page-safety-dispatch-report">
|
<div class="nav">
|
<img
|
class="nav-icon"
|
:src="require('@/assets/safety/location.png')"
|
alt=""
|
/>
|
<div class="nav-content">
|
<span>安全管理 </span>
|
<i class="el-icon el-icon-arrow-right"></i>
|
<span> 查看全部</span>
|
</div>
|
</div>
|
<div class="content">
|
<div class="filter-section">
|
<el-form
|
:inline="true"
|
:model="filterForm"
|
ref="filterForm"
|
style="flex: 1; text-align: right"
|
class="g-table-filter"
|
>
|
<el-form-item label="标题">
|
<el-input
|
style="width: 154px"
|
v-model="filterForm.title"
|
></el-input>
|
</el-form-item>
|
<el-form-item label="信息类型">
|
<el-select
|
style="width: 154px"
|
v-model="filterForm.type"
|
popper-class="safety-report-filter"
|
@change="handleChange"
|
>
|
<el-option
|
v-for="item in typeOptions"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
|
<el-form-item label="创建人">
|
<el-input
|
style="width: 154px"
|
v-model="filterForm.creatorName"
|
></el-input>
|
</el-form-item>
|
</el-form>
|
|
<div class="action-bar">
|
<div class="action-item orange pointer" @click="getList">筛选</div>
|
</div>
|
</div>
|
<div class="g-table">
|
<el-table
|
stripe
|
style="width: 100%"
|
header-row-class-name="table-header"
|
:height="'calc(100vh - 400px)'"
|
:data="articleList"
|
highlight-current-row
|
class="bs"
|
>
|
<el-table-column
|
align="center"
|
prop="type"
|
label="信息类型"
|
>
|
<template slot-scope="scope">{{typeMap[scope.row.type]}}</template>
|
</el-table-column>
|
<el-table-column
|
align="center"
|
prop="title"
|
label="标题"
|
></el-table-column>
|
<el-table-column
|
align="center"
|
prop="infoSources"
|
label="信息来源"
|
></el-table-column>
|
<el-table-column
|
align="center"
|
prop="creatorName"
|
label="创建人"
|
></el-table-column>
|
<el-table-column
|
align="center"
|
prop="publishScope"
|
label="发布范围"
|
>
|
<template slot-scope="scope">{{scope.row.publishScope == '1' ? '集团' : '分公司'}}</template>
|
</el-table-column>
|
<el-table-column
|
align="center"
|
prop="sumVisitor"
|
label="访问次数"
|
>
|
<template slot-scope="scope">
|
<el-button type="text" @click="$router.push('/articleVisit?id=' + scope.row.id)">{{scope.row.sumVisitor}}</el-button
|
>
|
</template>
|
</el-table-column>
|
<el-table-column
|
align="center"
|
prop="createDate"
|
label="创建时间"
|
></el-table-column>
|
<el-table-column align="center" label="操作" width="220">
|
<template slot-scope="scope">
|
<el-button type="text" @click="$to('/safetyArticleDetail?id=' + scope.row.id)"
|
>查看</el-button
|
>
|
<el-button type="text" @click="$to('/safetyArticleEdit?id=' + scope.row.id)">编辑</el-button
|
>
|
<el-button type="text" @click="deleteArticle(scope.row.id)">删除</el-button
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
<div class="g-pagination">
|
<el-pagination
|
layout="prev, pager, next"
|
:total="total"
|
background
|
:current-page="filterForm.pageNum"
|
:page-size="filterForm.pageSize"
|
@current-change="pageChange"
|
></el-pagination>
|
</div>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
export default {
|
name: "safetyAccidentReport",
|
data() {
|
return {
|
filterForm: {
|
title: '',
|
type: '',
|
creatorName: '',
|
pageSize: 20,
|
pageNum: 1,
|
},
|
total: 0,
|
articleList: [],
|
statusOptions: [
|
{ value: "", label: "全部" },
|
{ value: "1", label: "未审核" },
|
{ value: "2", label: "已忽略"},
|
{ value: "3", label: "已审核" },
|
],
|
orderFieldOptions: [
|
{ label: "事件时间", value: "accidentTime" },
|
{ label: "分公司", value: "conpanyId" },
|
],
|
typeOptions: [
|
{ label: "全部", value: ""},
|
{ label: "服务月报", value: "1" },
|
{ label: "安全月报", value: "2" },
|
{ label: "安全学习", value: "3" },
|
{ label: "规章制度", value: "4" },
|
{ label: "公告通知", value: "5" },
|
{ label: "疫情防控", value: "6" },
|
],
|
typeMap: {
|
"1": '服务月报',
|
"2": '安全月报',
|
"3": '安全学习',
|
"4": '规章制度',
|
"5": '公告通知',
|
"6": '疫情防控'
|
},
|
defaultProps: {
|
children: "children",
|
label: "label",
|
},
|
};
|
},
|
created() {
|
},
|
activated() {
|
if (this.$route.query.type) {
|
this.filterForm.type = this.$route.query.type;
|
} else {
|
this.filterForm.type = "";
|
}
|
this.getList();
|
},
|
methods: {
|
getList() {
|
const params = {};
|
if (this.filterForm.type) params.type = this.filterForm.type;
|
if (this.filterForm.title)
|
params.title = this.filterForm.title;
|
if (this.filterForm.creatorName) params.creatorName = this.filterForm.creatorName;
|
|
this.$axios
|
.get(this.$Interface.safetyArticle.list, {
|
params: {
|
limit: this.filterForm.pageSize,
|
page: this.filterForm.pageNum,
|
...params,
|
},
|
})
|
.then((res) => {
|
this.articleList = res.data.records;
|
this.total = Number(res.data.total);
|
});
|
},
|
pageChange(page) {
|
this.filterForm.pageNum = page;
|
this.getList();
|
},
|
handleChange() {
|
this.filterForm.pageNum = 1;
|
this.articleList = [];
|
this.getList();
|
},
|
deleteArticle(id){
|
this.$confirm('此操作将删除所选文章,是否继续?', '操作确认', {
|
type: 'warning'
|
}).then(res => {
|
this.$axios.delete(this.$exportBase + 'v3/safety', {
|
data: [id]
|
}).then(res => {
|
this.$message({
|
message: '删除成功!',
|
type: 'success'
|
});
|
this.getList();
|
})
|
}).catch(cancel => {
|
|
})
|
}
|
},
|
};
|
</script>
|
|
<style lang="less" scoped>
|
@import url("../../assets/css/common.css");
|
@orange: #1cd1d3;
|
@blue: #3e89d3;
|
.page-container {
|
padding: 20px 30px;
|
padding-bottom: 0;
|
.nav {
|
display: flex;
|
font-size: 14px;
|
width: 100%;
|
height: 20px;
|
align-items: center;
|
.nav-icon {
|
width: 18px;
|
margin-left: 11px;
|
flex-shrink: 0;
|
margin-right: 11px;
|
}
|
.nav-content {
|
flex: 1;
|
}
|
}
|
.content {
|
margin-top: 16px;
|
.filter-section {
|
text-align: center;
|
display: flex;
|
}
|
}
|
.dialog {
|
width: 690px;
|
height: 768px;
|
opacity: 1;
|
background: linear-gradient(180deg, #06203f, #08141c);
|
border: 2px solid #2a488a;
|
margin: auto;
|
position: fixed;
|
top: 100px;
|
left: 0;
|
right: 0;
|
.title {
|
.title-icon {
|
margin: 17px 20px;
|
margin-right: 8px;
|
width: 20px;
|
}
|
}
|
.icon-close {
|
position: absolute;
|
top: 0;
|
right: -3px;
|
width: 42px;
|
cursor: pointer;
|
}
|
|
.tree-wrap {
|
margin: 62px 92px;
|
margin-bottom: 0;
|
/deep/.el-icon-caret-right:before {
|
content: "" !important;
|
}
|
}
|
}
|
}
|
.action-bar {
|
display: flex;
|
justify-content: center;
|
align-items: center;
|
color: #fff;
|
font-size: 14px;
|
margin-left: 50px;
|
padding-top: 5px;
|
height: 37px;
|
.action-item {
|
padding: 8px 30px;
|
border-left: 2px solid;
|
border-right: 2px solid;
|
opacity: 0.8;
|
}
|
.orange {
|
border-color: @orange;
|
background-color: rgba(28, 209, 211, 0.1);
|
}
|
.blue {
|
border-color: @blue;
|
background-color: rgba(62, 137, 211, 0.1);
|
}
|
}
|
</style>
|