From d8fe678fca6a017ff39ce0ceadec81c754b05ea1 Mon Sep 17 00:00:00 2001
From: fanluyan <754122931@qq.com>
Date: Wed, 20 Dec 2023 11:57:01 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BF=90=E7=BB=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/activityList/index.vue | 4 +-
src/views/homePage/components/tableMain.vue | 259 ++++++++++----------
src/views/homePage/index.vue | 8 +-
3 files changed, 139 insertions(+), 132 deletions(-)
diff --git a/src/views/activityList/index.vue b/src/views/activityList/index.vue
index a10ea9a..4702d77 100644
--- a/src/views/activityList/index.vue
+++ b/src/views/activityList/index.vue
@@ -211,8 +211,6 @@ export default {
},
//上传活动列表
submitUpload() {
- // let arrList = "";
- // arrList = [...this.activityForm.cmdidArr.trim().split("\n")];
if (this.activityForm.title == "") {
this.titleFlag = true;
return;
@@ -232,6 +230,8 @@ export default {
.then((res) => {
console.log(res);
this.getactivityList();
+ this.activityForm.title = "";
+ this.activityForm.cmdidArr = "";
})
.catch((err) => {});
},
diff --git a/src/views/homePage/components/tableMain.vue b/src/views/homePage/components/tableMain.vue
index a3ecf91..2ced4f9 100644
--- a/src/views/homePage/components/tableMain.vue
+++ b/src/views/homePage/components/tableMain.vue
@@ -57,6 +57,7 @@
- 运维
+
+
+ 运维
+
- 快心跳
+
+
+ 快心跳
+
-
-
{
// this.getNumber();
// });
@@ -999,11 +979,27 @@ export default {
this.ywNumber = this.tableData.filter(
(item) => item.in_maintain == 1
).length;
-
this.kxtNumber = this.tableData.filter(
(item) => item.quick_hb == 1
).length;
+ console.log("我这里是运维和快心跳的数据");
console.log(this.ywNumber, this.kxtNumber);
+ if (
+ this.ywNumber == this.tableData.length &&
+ this.tableData.length !== 0
+ ) {
+ this.checkAllYW = true;
+ } else {
+ this.checkAllYW = false;
+ }
+ if (
+ this.kxtNumber == this.tableData.length &&
+ this.tableData.length !== 0
+ ) {
+ this.checkAllKXT = true;
+ } else {
+ this.checkAllKXT = false;
+ }
},
//导出表格
handleExport() {
@@ -1029,53 +1025,51 @@ export default {
this.$refs.rowMsgDialogref.display(val);
},
handlecheckAllYW(val) {
- let totalCount = this.tableData.length;
- let someStatusCount = 0;
console.log(val);
if (val) {
- console.log("选中");
- this.tableData.forEach((item) => {
- item.in_maintain = 1;
-
- console.log(item);
- getdoActionApi({
- act: "mntn",
- termId: item.id,
- mntn: 1,
+ console.log("我全选了了运维了");
+ console.log(this.tableData);
+ this.termidsArray = [];
+ for (let i = 0; i < this.tableData.length; i++) {
+ this.termidsArray.push(this.tableData[i].id);
+ }
+ this.termidsArray = [...new Set(this.termidsArray)];
+ console.log(this.termidsArray);
+ getdoActionApi({
+ act: "mntn",
+ termIds: this.termidsArray.join("-"),
+ mntn: 1,
+ })
+ .then((res) => {
+ console.log(res);
+ this.$parent.onSubmit();
})
- .then((res) => {
- console.log(res);
- })
- .catch((err) => {});
- });
+ .catch((err) => {});
} else {
- console.log("取消选中");
- this.tableData.forEach((item) => {
- item.in_maintain = 0;
- someStatusCount = 0;
- console.log(item);
- getdoActionApi({
- act: "mntn",
- termId: item.id,
- mntn: 0,
+ console.log("我取消了运维全选了");
+ console.log(this.tableData);
+ this.termidsArray = [];
+ for (let i = 0; i < this.tableData.length; i++) {
+ this.termidsArray.push(this.tableData[i].id);
+ }
+ this.termidsArray = [...new Set(this.termidsArray)];
+ console.log(this.termidsArray);
+ getdoActionApi({
+ act: "mntn",
+ termIds: this.termidsArray.join("-"),
+ mntn: 0,
+ })
+ .then((res) => {
+ console.log(res);
+ this.$parent.onSubmit();
})
- .then((res) => {
- console.log(res);
- })
- .catch((err) => {});
- });
+ .catch((err) => {});
}
-
- localStorage.setItem("checkAllYW", this.checkAllYW);
- this.checkAllYW = totalCount == this.ywNumber ? true : false;
- console.log(this.checkAllYW);
- this.isIndeterminate = this.ywNumber > 0 && this.ywNumber < totalCount;
-
- // this.isIndeterminate = false;
},
//运维
UpdateMaintainMode(val, row) {
console.log("运维");
+ console.log(val, row);
getdoActionApi({
act: "mntn",
termId: row.id,
@@ -1088,48 +1082,46 @@ export default {
},
//快心跳
handlecheckAllKXT(val) {
- let totalCount = this.tableData.length;
- let someStatusCount = 0;
console.log(val);
if (val) {
- console.log("选中");
- this.tableData.forEach((item) => {
- item.quick_hb = 1;
- someStatusCount++;
- console.log(item);
- getdoActionApi({
- act: "quickhb",
- termId: item.id,
- quickhb: 1,
+ console.log("我全选了快心跳了");
+ console.log(this.tableData);
+ this.termidsArray = [];
+ for (let i = 0; i < this.tableData.length; i++) {
+ this.termidsArray.push(this.tableData[i].id);
+ }
+ this.termidsArray = [...new Set(this.termidsArray)];
+ console.log(this.termidsArray);
+ getdoActionApi({
+ act: "quickhb",
+ termIds: this.termidsArray.join("-"),
+ quickhb: 1,
+ })
+ .then((res) => {
+ console.log(res);
+ this.$parent.onSubmit();
})
- .then((res) => {
- console.log(res);
- })
- .catch((err) => {});
- });
+ .catch((err) => {});
} else {
- console.log("取消选中");
- this.tableData.forEach((item) => {
- item.quick_hb = 0;
- someStatusCount = 0;
- console.log(item);
- getdoActionApi({
- act: "quickhb",
- termId: item.id,
- quickhb: 0,
+ console.log("我取消了运维全选了");
+ console.log(this.tableData);
+ this.termidsArray = [];
+ for (let i = 0; i < this.tableData.length; i++) {
+ this.termidsArray.push(this.tableData[i].id);
+ }
+ this.termidsArray = [...new Set(this.termidsArray)];
+ console.log(this.termidsArray);
+ getdoActionApi({
+ act: "quickhb",
+ termIds: this.termidsArray.join("-"),
+ quickhb: 0,
+ })
+ .then((res) => {
+ console.log(res);
+ this.$parent.onSubmit();
})
- .then((res) => {
- console.log(res);
- })
- .catch((err) => {});
- });
+ .catch((err) => {});
}
-
- localStorage.setItem("checkAllKXT", this.checkAllKXT);
- this.checkAllKXT = totalCount === this.kxtNumber ? true : false;
- this.isIndeterminate = this.kxtNumber > 0 && this.kxtNumber < totalCount;
-
- // this.isIndeterminate = false;
},
//快心跳
UpdateQuickHbMode(val, row) {
@@ -1565,7 +1557,7 @@ export default {
.el-table .caret-wrapper {
height: 24px;
width: 10px;
- margin-left: 8px;
+ margin-left: 4px;
}
.el-table .sort-caret.ascending {
@@ -1584,7 +1576,22 @@ export default {
.el-table .descending .sort-caret.descending {
border-top-color: #169e8c;
}
-
+ //半选
+ .is-indeterminate .el-checkbox__input .el-checkbox__inner {
+ background-color: #169e8c;
+ border-color: #169e8c;
+ }
+ .is-indeterminate .el-checkbox__input .el-checkbox__inner:before {
+ content: "";
+ position: absolute;
+ display: block;
+ background-color: #fff;
+ height: 2px;
+ transform: scale(0.5);
+ left: 0;
+ right: 0;
+ top: 5px;
+ }
.drawerBox {
.el-drawer {
width: 240px !important;
diff --git a/src/views/homePage/index.vue b/src/views/homePage/index.vue
index 79a31fa..1561b84 100644
--- a/src/views/homePage/index.vue
+++ b/src/views/homePage/index.vue
@@ -190,7 +190,7 @@
:onlineNum="onlineNum"
:offlineNum="offlineNum"
:noPicNum="noPicNum"
- v-loading="tableLoaidng"
+ :tableLoaidng="tableLoaidng"
>
@@ -244,9 +244,9 @@ export default {
], //是否运维
dataList: [],
tableLoaidng: true,
- onlineNum: "", //在线数量
- offlineNum: "", //离线数量
- noPicNum: "", //未上传图片数量
+ onlineNum: 0, //在线数量
+ offlineNum: 0, //离线数量
+ noPicNum: 0, //未上传图片数量
intervalId: null, // 用于存储定时器的ID
};
},