|
@@ -22,6 +22,8 @@
|
|
:data="tableData"
|
|
:data="tableData"
|
|
:header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
|
|
:header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
|
|
style="width: 100%"
|
|
style="width: 100%"
|
|
|
|
+ @row-click="showNoticeDetail"
|
|
|
|
+ :row-style="{cursor:'pointer'}"
|
|
height="calc(100%)"
|
|
height="calc(100%)"
|
|
>
|
|
>
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -31,24 +33,26 @@
|
|
width="auto"
|
|
width="auto"
|
|
min-width="200"
|
|
min-width="200"
|
|
>
|
|
>
|
|
- <template slot-scope="scope">
|
|
|
|
- <span v-html="scope.row.title"></span>
|
|
|
|
- </template>
|
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <span v-html="scope.row.title"></span>
|
|
|
|
+ </template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column label="状态 " width="150" align="center">
|
|
<el-table-column label="状态 " width="150" align="center">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
- <span>{{status[scope.row.status]}}</span>
|
|
|
|
- </template>
|
|
|
|
|
|
+ <span class="status" :class="`status_${scope.row.status}`">{{
|
|
|
|
+ status[scope.row.status]
|
|
|
|
+ }}</span>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column prop="type" label="类型 " width="150" align="center">
|
|
</el-table-column>
|
|
</el-table-column>
|
|
<el-table-column
|
|
<el-table-column
|
|
- prop="type"
|
|
|
|
- label="类型 "
|
|
|
|
- width="150"
|
|
|
|
|
|
+ prop="create_at"
|
|
|
|
+ label="时间 "
|
|
|
|
+ width="250"
|
|
align="center"
|
|
align="center"
|
|
>
|
|
>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="create_at" label="时间 " width="250" align="center">
|
|
|
|
- </el-table-column>
|
|
|
|
<el-table-column
|
|
<el-table-column
|
|
prop="publisherName"
|
|
prop="publisherName"
|
|
label="发布者 "
|
|
label="发布者 "
|
|
@@ -56,7 +60,12 @@
|
|
align="center"
|
|
align="center"
|
|
>
|
|
>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
- <el-table-column prop="source" label="发布来源" width="200" align="center">
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
+ prop="source"
|
|
|
|
+ label="发布来源"
|
|
|
|
+ width="200"
|
|
|
|
+ align="center"
|
|
|
|
+ >
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
</div>
|
|
</div>
|
|
@@ -72,21 +81,26 @@
|
|
>
|
|
>
|
|
</el-pagination>
|
|
</el-pagination>
|
|
</div>
|
|
</div>
|
|
|
|
+ <noticeDetailDialog ref="noticeDetailDialogRef"/>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
|
+import noticeDetailDialog from '../dialog/noticeDetailDialog.vue';
|
|
export default {
|
|
export default {
|
|
|
|
+ components: {
|
|
|
|
+ noticeDetailDialog
|
|
|
|
+ },
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
userId: this.$route.query.userid,
|
|
userId: this.$route.query.userid,
|
|
org: this.$route.query.org,
|
|
org: this.$route.query.org,
|
|
oid: this.$route.query.oid,
|
|
oid: this.$route.query.oid,
|
|
tableLoading: false,
|
|
tableLoading: false,
|
|
- status:["未读","已读"],
|
|
|
|
|
|
+ status: ["未读", "已读"],
|
|
searchValue: "",
|
|
searchValue: "",
|
|
tableData: [],
|
|
tableData: [],
|
|
- copyData:[],
|
|
|
|
|
|
+ copyData: [],
|
|
pageData: {
|
|
pageData: {
|
|
nowPage: 1,
|
|
nowPage: 1,
|
|
total: 0,
|
|
total: 0,
|
|
@@ -106,39 +120,50 @@ export default {
|
|
getData() {
|
|
getData() {
|
|
if (this.tableLoading) return;
|
|
if (this.tableLoading) return;
|
|
this.tableLoading = true;
|
|
this.tableLoading = true;
|
|
- let params = [{
|
|
|
|
- uid: this.userId,
|
|
|
|
- status:"",
|
|
|
|
- type:"",
|
|
|
|
- source:"",
|
|
|
|
- pUid:"",
|
|
|
|
- searchValue:this.searchValue,
|
|
|
|
- pageNum:this.pageData.nowPage,
|
|
|
|
- pageSize:this.pageData.size,
|
|
|
|
- }]
|
|
|
|
-
|
|
|
|
- this.ajax.post(this.$store.state.api+"select_noticeCenter",params).then(res=>{
|
|
|
|
- let _resData = res.data[0];
|
|
|
|
- if(_resData.length>0){
|
|
|
|
- this.copyData = _resData;
|
|
|
|
- this.tableData = _resData;
|
|
|
|
- this.pageData.total = res.data[1][0].total;
|
|
|
|
- }else{
|
|
|
|
- this.copyData = [];
|
|
|
|
- this.pageData.total = 0;
|
|
|
|
- this.pageData.nowPage = 1;
|
|
|
|
|
|
+ let params = [
|
|
|
|
+ {
|
|
|
|
+ uid: this.userId,
|
|
|
|
+ status: "",
|
|
|
|
+ type: "",
|
|
|
|
+ source: "",
|
|
|
|
+ pUid: "",
|
|
|
|
+ searchValue: this.searchValue,
|
|
|
|
+ pageNum: this.pageData.nowPage,
|
|
|
|
+ pageSize: this.pageData.size
|
|
}
|
|
}
|
|
- this.tableLoading = false;
|
|
|
|
- // this.tableData = res.data.list
|
|
|
|
- // this.pageData.total = res.data.total
|
|
|
|
- }).catch(e=>{
|
|
|
|
- console.log(e);
|
|
|
|
- this.$message.error("获取通知失败")
|
|
|
|
- this.tableLoading = false;
|
|
|
|
- })
|
|
|
|
|
|
+ ];
|
|
|
|
+
|
|
|
|
+ this.ajax
|
|
|
|
+ .post(this.$store.state.api + "select_noticeCenter", params)
|
|
|
|
+ .then(res => {
|
|
|
|
+ let _resData = res.data[0];
|
|
|
|
+ if (_resData.length > 0) {
|
|
|
|
+ _resData.forEach(item => {
|
|
|
|
+ item.content = JSON.parse(item.content);
|
|
|
|
+ })
|
|
|
|
+ this.copyData = _resData;
|
|
|
|
+ this.tableData = _resData;
|
|
|
|
+ this.pageData.total = res.data[1][0].total;
|
|
|
|
+ } else {
|
|
|
|
+ this.copyData = [];
|
|
|
|
+ this.pageData.total = 0;
|
|
|
|
+ this.pageData.nowPage = 1;
|
|
|
|
+ }
|
|
|
|
+ this.tableLoading = false;
|
|
|
|
+ // this.tableData = res.data.list
|
|
|
|
+ // this.pageData.total = res.data.total
|
|
|
|
+ })
|
|
|
|
+ .catch(e => {
|
|
|
|
+ console.log(e);
|
|
|
|
+ this.$message.error("获取通知失败");
|
|
|
|
+ this.tableLoading = false;
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ showNoticeDetail(row){
|
|
|
|
+ this.$refs.noticeDetailDialogRef.open(row)
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- mounted(){
|
|
|
|
|
|
+ mounted() {
|
|
this.getData();
|
|
this.getData();
|
|
}
|
|
}
|
|
};
|
|
};
|
|
@@ -196,6 +221,29 @@ export default {
|
|
border-top: solid 1px #dfdfe0;
|
|
border-top: solid 1px #dfdfe0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+.status {
|
|
|
|
+ padding: 0px 10px;
|
|
|
|
+ border-radius: 4px;
|
|
|
|
+ height: 30px;
|
|
|
|
+ width: fit-content;
|
|
|
|
+ display: flex;
|
|
|
|
+ align-items: center;
|
|
|
|
+ justify-content: center;
|
|
|
|
+ margin: 0 auto;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.status_0 {
|
|
|
|
+ background: #f3f4f6;
|
|
|
|
+ color: #4d5765;
|
|
|
|
+ border: solid 1px #d4d8dd;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.status_1 {
|
|
|
|
+ background: #ecfdf5;
|
|
|
|
+ color: #10664e;
|
|
|
|
+ border: solid 1px #abf4d3;
|
|
|
|
+}
|
|
|
|
+
|
|
.r_bottom {
|
|
.r_bottom {
|
|
width: 100%;
|
|
width: 100%;
|
|
height: 40px;
|
|
height: 40px;
|