<template>
|
<div class="list">
|
<header>
|
<div class="header-content">
|
<div class="search">
|
<span>筛选条件:</span>
|
<el-input placeholder="请输入内容" v-model="context"></el-input>
|
<div class="findBtn">
|
<el-button type="primary" @click="setTableData">查询</el-button>
|
</div>
|
</div>
|
</div>
|
</header>
|
<main>
|
<div class="main-content">
|
<!-- 数据展示 -->
|
<el-table
|
border
|
stripe
|
ref="multipleTable"
|
:header-cell-style="{
|
'background':'#F5F5F5',
|
'font-weight': '650',
|
'line-height': '45px',
|
}"
|
:row-class-name="tableRowClassName"
|
:data="list"
|
style="width: 100%"
|
>
|
<el-table-column type="selection" min-width="5"> </el-table-column>
|
<el-table-column prop="id" label="ID" min-width="6">
|
</el-table-column>
|
<el-table-column prop="name" label="模板" min-width="20">
|
</el-table-column>
|
<el-table-column prop="createTime" label="创建时间" min-width="10">
|
</el-table-column>
|
|
<el-table-column prop="operation" label="操作" min-width="20">
|
<template slot-scope="scope">
|
<div class="operation">
|
<span @click="handleView(scope.row)">查看</span>
|
</div>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
|
<!-- tools -->
|
<div class="tools">
|
<div class="funs"></div>
|
<div class="pagination">
|
<el-pagination
|
background
|
:current-page="currentPage"
|
layout="prev, pager, next"
|
:total="totalNum"
|
:page-size="pageSize"
|
@current-change="changeCurrentPage"
|
@prev-click="handlePrev"
|
@next-click="handleNext"
|
>
|
</el-pagination>
|
</div>
|
</div>
|
</main>
|
<footer>
|
<!-- 查看模板 -->
|
<el-dialog
|
title="查看模板"
|
:visible.sync="dialogCreate"
|
v-if="dialogCreate"
|
width="60%"
|
>
|
<component :is="componentName"></component>
|
</el-dialog>
|
</footer>
|
</div>
|
</template>
|
<script>
|
import { createNamespacedHelpers } from "vuex";
|
const { mapActions } = createNamespacedHelpers("writ");
|
|
import InquestRecord from "../components/inquest_record/view.vue";
|
import Notification from "../components/instruct_notification/view.vue";
|
|
export default {
|
components: {
|
InquestRecord,
|
Notification,
|
},
|
data() {
|
return {
|
dialogCreate: false,
|
context: null,
|
list: [],
|
totalNum: 0,
|
pageSize: 10,
|
currentPage: 1,
|
renderFlag: false,
|
};
|
},
|
created() {
|
this.setTableData();
|
},
|
methods: {
|
...mapActions(["getWritTemplateList"]),
|
|
handleView(row) {
|
switch (row.code) {
|
case "inquest_record":
|
this.componentName = InquestRecord;
|
break;
|
case "instruct_to_correct_notification":
|
this.componentName = Notification;
|
break;
|
}
|
this.dialogCreate = true;
|
},
|
|
// 设置表格斑马纹
|
tableRowClassName({ row, rowIndex }) {
|
if ((rowIndex + 1) % 2 == 0) {
|
return "warning-row";
|
} else {
|
return "success-row";
|
}
|
return "";
|
},
|
// 设置tableData
|
setTableData() {
|
const { currentPage, pageSize, context } = this;
|
this.getWritTemplateList({
|
currentPage,
|
pageSize,
|
name: context,
|
}).then((res) => {
|
this.list = res.records;
|
this.totalNum = res.total;
|
});
|
},
|
|
// 当前页改变触发事件
|
changeCurrentPage(page) {
|
this.currentPage = page;
|
this.setTableData();
|
},
|
// 上一页点击事件
|
handlePrev(page) {
|
this.currentPage = page;
|
this.setTableData();
|
},
|
// 下一页点击事件
|
handleNext(page) {
|
this.currentPage = page;
|
this.setTableData();
|
},
|
},
|
};
|
</script>
|
<style lang="scss" scoped>
|
.list {
|
text-align: left;
|
padding: 10px 20px;
|
color: #4b9bb7;
|
border: 1px solid #ccc;
|
header {
|
background-color: white;
|
|
.header-content {
|
padding: 0;
|
display: flex;
|
line-height: 100px;
|
justify-content: space-between;
|
align-items: center;
|
|
.search {
|
display: flex;
|
justify-content: flex-start;
|
|
span {
|
flex: 1;
|
}
|
|
.el-input {
|
flex: 2;
|
color: #1d3f57;
|
|
&::v-deep .el-input__inner {
|
// background-color: #09152f;
|
//border: 1px solid #17324c;
|
}
|
}
|
}
|
}
|
}
|
|
main {
|
background-color: #fff;
|
margin-top: 20px;
|
padding-bottom: 50px;
|
|
.main-title {
|
line-height: 60px;
|
padding: 10px 20px;
|
}
|
|
.tools {
|
display: flex;
|
justify-content: space-between;
|
align-items: center;
|
padding: 0 20px;
|
|
.funs {
|
display: flex;
|
|
.funsItem {
|
line-height: 28px;
|
display: flex;
|
align-items: center;
|
//border: 1px solid #17324c;
|
border-radius: 4px;
|
font-size: 12px;
|
margin-left: 10px;
|
|
.el-checkbox {
|
width: 80px;
|
padding: 0 10px;
|
}
|
|
.el-select {
|
width: 120px;
|
}
|
|
&::v-deep .el-input__inner {
|
border: none;
|
// background-color: #09152f;
|
}
|
|
&:hover {
|
border: 1px solid #4b9bb7;
|
}
|
|
&:hover .el-checkbox {
|
color: #4b9bb7;
|
}
|
}
|
}
|
|
.pagination {
|
margin-top: 50px;
|
display: flex;
|
line-height: 50px;
|
justify-content: center;
|
|
.el-pagination {
|
&::v-deep li,
|
&::v-deep .btn-prev,
|
&::v-deep .btn-next {
|
// background-color: #071f39;
|
color: #4b9bb7;
|
}
|
|
&::v-deep .active {
|
background-color: #409eff;
|
color: #fff;
|
}
|
}
|
}
|
}
|
// &::v-deep .warning-row {
|
// background-color: #06122c;
|
// }
|
|
// &::v-deep .success-row {
|
// background-color: #071f39;
|
// }
|
|
.operationBox {
|
display: flex;
|
}
|
|
.el-divider {
|
background-color: #4b9bb7;
|
}
|
.el-table {
|
// color: #4b9bb7;
|
// font-size: 10px;
|
.operation {
|
display: flex;
|
|
.line {
|
padding: 0 5px;
|
}
|
color: var(--operation-color);
|
span:hover {
|
cursor: pointer;
|
}
|
}
|
}
|
}
|
.findBtn {
|
line-height: 100px;
|
margin-left: 15px;
|
display: flex;
|
align-items: center;
|
margin-top: -2px;
|
|
.el-button {
|
padding: 12px 25px;
|
//border-radius: 20px;
|
}
|
}
|
}
|
|
// 设置dialog样式
|
::v-deep .el-dialog__body {
|
background-color: #fff;
|
color: #000;
|
}
|
|
::v-deep .el-dialog__header {
|
background-color: #06122c !important;
|
color: #fff;
|
}
|
</style>
|