From 0a54982dfa88d09f08d6d77d52316ff7e5b381f8 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期五, 16 八月 2024 10:00:05 +0800
Subject: [PATCH] 平台管理添加优化
---
src/views/system/platform/index.vue | 38 ++++++++++++++++++++++----------------
1 files changed, 22 insertions(+), 16 deletions(-)
diff --git a/src/views/system/platform/index.vue b/src/views/system/platform/index.vue
index 79a3a40..c15a226 100644
--- a/src/views/system/platform/index.vue
+++ b/src/views/system/platform/index.vue
@@ -40,15 +40,15 @@
border
style="width: 100%; margin-top: 20px">
<el-table-column
- prop="platform"
+ prop="platformName"
label="骞冲彴鍚嶇О">
</el-table-column>
<el-table-column
- prop="amount1"
+ prop="area"
label="琛屾斂鍖哄煙">
</el-table-column>
<el-table-column
- prop="IP"
+ prop="platformIP"
label="骞冲彴IP">
</el-table-column>
<el-table-column
@@ -189,12 +189,8 @@
},
checkDeployList() {
if (this.addForm.deployList) {
- return
- } else {
this.addForm.deployList = this.addForm.deployList.filter(item => {
- if (item.platformName && item.platformIp && item.remark && item.area) {
- return true
- }
+ return item.platformName || item.platformIp || item.remark || item.area;
})
}
},
@@ -203,13 +199,11 @@
if (valid) {
this.checkDeployList()
if (this.addForm.deployList) {
- console.log(this.addForm.deployList[0])
- this.addForm.deployList.forEach(item => {
- if (!item.platformName || !item.platformIp || !item.area) {
- this.$message.error("璇锋鏌ュ钩鍙伴儴缃蹭俊鎭槸鍚﹀~鍐欏畬鏁�")
- return
- }
- })
+ console.log(this.addForm.deployList)
+ if (this.addForm.deployList.some(item => !item.platformName || !item.platformIP || !item.area)) {
+ this.$message.error("璇锋鏌ュ钩鍙伴儴缃蹭俊鎭槸鍚﹀~鍐欏畬鏁�");
+ return; // 閫�鍑� validate 鍥炶皟
+ }
}
addPlatform(this.addForm).then(res => {
this.$message.success("娣诲姞鎴愬姛")
@@ -248,7 +242,19 @@
this.getList()
},
spanMethod({ row, column, rowIndex, columnIndex }) {
-
+ if (columnIndex === 0) {
+ if (rowIndex % 2 === 0) {
+ return {
+ rowspan: 2,
+ colspan: 1
+ };
+ } else {
+ return {
+ rowspan: 0,
+ colspan: 0
+ };
+ }
+ }
}
}
}
--
Gitblit v1.8.0