|
@@ -135,7 +135,7 @@ export default {
|
|
|
className: ["active", "", ""],
|
|
className: ["active", "", ""],
|
|
|
inquireValue: "",
|
|
inquireValue: "",
|
|
|
data: [], // 当前页面显示的数据
|
|
data: [], // 当前页面显示的数据
|
|
|
- Data: [], // 分页器显示的总数据
|
|
|
|
|
|
|
+ Data: [], // 显示的总数据
|
|
|
tableData: [], // 请求的总数据
|
|
tableData: [], // 请求的总数据
|
|
|
currentPage: 1,
|
|
currentPage: 1,
|
|
|
infoShow: false,
|
|
infoShow: false,
|
|
@@ -153,27 +153,29 @@ export default {
|
|
|
this.dataList();
|
|
this.dataList();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
- dataList() {
|
|
|
|
|
- this.API.systemnotice.systemnoticeList().then((res) => {
|
|
|
|
|
- console.log(res);
|
|
|
|
|
- this.tableData = res.data.list;
|
|
|
|
|
- let number = 0;
|
|
|
|
|
- this.tableData.forEach((item) => {
|
|
|
|
|
- if (item.readFlag == 0) {
|
|
|
|
|
- number += 1;
|
|
|
|
|
- this.$store.dispatch("inform/setreadFlag", number);
|
|
|
|
|
- } else {
|
|
|
|
|
|
|
+ dataList(currentPage) {
|
|
|
|
|
+ this.API.systemnotice
|
|
|
|
|
+ .systemnoticeList({ pageSize: 100, order: "desc" })
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ console.log(res);
|
|
|
|
|
+ this.tableData = res.data.list;
|
|
|
|
|
+ let number = 0;
|
|
|
|
|
+ this.tableData.forEach((item) => {
|
|
|
|
|
+ if (item.readFlag == 0) {
|
|
|
|
|
+ number += 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ item.createTime = item.createTime.replace("T", " ");
|
|
|
|
|
+ });
|
|
|
|
|
+ this.$store.dispatch("inform/setreadFlag", number);
|
|
|
|
|
+ if (number == 0) {
|
|
|
this.$store.dispatch("inform/setreadFlag", "");
|
|
this.$store.dispatch("inform/setreadFlag", "");
|
|
|
}
|
|
}
|
|
|
- item.createTime = item.createTime.replace("T", " ");
|
|
|
|
|
|
|
+ this.Data = this.tableData;
|
|
|
|
|
+ this.handleCurrentChange(currentPage ? currentPage : 1);
|
|
|
});
|
|
});
|
|
|
- this.Data = this.tableData;
|
|
|
|
|
- this.handleCurrentChange(1);
|
|
|
|
|
- });
|
|
|
|
|
},
|
|
},
|
|
|
// 查询
|
|
// 查询
|
|
|
inquire() {
|
|
inquire() {
|
|
|
- console.log(111);
|
|
|
|
|
this.Data = this.tableData.filter((item, index) => {
|
|
this.Data = this.tableData.filter((item, index) => {
|
|
|
return item.createTime.includes(this.inquireValue);
|
|
return item.createTime.includes(this.inquireValue);
|
|
|
});
|
|
});
|
|
@@ -183,7 +185,6 @@ export default {
|
|
|
read($event, index) {
|
|
read($event, index) {
|
|
|
this.className = this.className.map((item) => (item = ""));
|
|
this.className = this.className.map((item) => (item = ""));
|
|
|
this.className[index] = "active";
|
|
this.className[index] = "active";
|
|
|
-
|
|
|
|
|
if ($event.target.innerText == "全部") {
|
|
if ($event.target.innerText == "全部") {
|
|
|
this.Data = this.tableData;
|
|
this.Data = this.tableData;
|
|
|
} else if ($event.target.innerText == "已读") {
|
|
} else if ($event.target.innerText == "已读") {
|
|
@@ -208,7 +209,7 @@ export default {
|
|
|
if (row.readFlag == 0) {
|
|
if (row.readFlag == 0) {
|
|
|
this.API.systemnotice.systemnoticeRead([row.id]).then((res) => {
|
|
this.API.systemnotice.systemnoticeRead([row.id]).then((res) => {
|
|
|
console.log(res);
|
|
console.log(res);
|
|
|
- this.dataList();
|
|
|
|
|
|
|
+ this.dataList(this.currentPage);
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
this.infoShow = true;
|
|
this.infoShow = true;
|
|
@@ -222,7 +223,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
console.log(ids);
|
|
console.log(ids);
|
|
|
- if (ids) {
|
|
|
|
|
|
|
+ if (ids.length) {
|
|
|
this.API.systemnotice.systemnoticeRead(ids).then((res) => {
|
|
this.API.systemnotice.systemnoticeRead(ids).then((res) => {
|
|
|
console.log(res);
|
|
console.log(res);
|
|
|
this.dataList();
|
|
this.dataList();
|
|
@@ -236,6 +237,7 @@ export default {
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
handleCurrentChange(val) {
|
|
handleCurrentChange(val) {
|
|
|
|
|
+ console.log(this.Data);
|
|
|
this.currentPage = this.val;
|
|
this.currentPage = this.val;
|
|
|
this.data = this.Data.slice((val - 1) * 8, val * 8);
|
|
this.data = this.Data.slice((val - 1) * 8, val * 8);
|
|
|
// console.log(`当前页: ${val}`);
|
|
// console.log(`当前页: ${val}`);
|