xiangpei
2024-08-16 0a54982dfa88d09f08d6d77d52316ff7e5b381f8
平台管理添加优化
1个文件已修改
38 ■■■■■ 已修改文件
src/views/system/platform/index.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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
          };
        }
      }
    }
  }
}