zhanghua
2024-03-12 a3b4eb017a0f948348ef7732267c7ed0d4bca8c0
src/views/operate/images/index.vue
@@ -21,6 +21,13 @@
            >
          </div>
        </div>
        <div class="addBtn">
          <el-button
            type="primary"
            @click="handleUpdateImageResource(null, 'create')"
            >新增</el-button
          >
        </div>
      </div>
    </header>
    <main>
@@ -37,11 +44,11 @@
        </div>
        <!-- 数据展示 -->
        <el-table
          border
          stripe
          ref="multipleTable"
          :header-cell-style="{
            background: '#06122c',
            'font-size': '12px',
            color: '#4b9bb7',
            background: '#F5F5F5',
            'font-weight': '650',
            'line-height': '45px',
          }"
@@ -50,7 +57,12 @@
          :row-class-name="tableRowClassName"
          @selection-change="tableChange"
        >
          <el-table-column type="selection" min-width="5"> </el-table-column>
          <el-table-column
            type="selection"
            min-width="5"
            :selectable="selectable"
          >
          </el-table-column>
          <el-table-column prop="code" label="所属事件编号" min-width="18">
          </el-table-column>
          <el-table-column prop="category" label="问题类别" min-width="8">
@@ -78,12 +90,16 @@
                <span @click="handleUpdateImageResource(scope.row, 'view')"
                  >查看</span
                >
                <span v-if="mystatus === 2" class="line">|</span>
                <span v-if="mystatus === 2" @click="handleUpdateImageResource(scope.row, 'update')"
                <span v-if="mystatus === 3" class="line">|</span>
                <span
                  v-if="mystatus === 3"
                  @click="handleUdeletepdateImageResource(scope.row, 'update')"
                  >修改</span
                >
                <span v-if="mystatus === 2"  class="line">|</span>
                <span v-if="mystatus === 2"  @click="handleDelete(scope.row)">删除</span>
                <span v-if="mystatus === 3" class="line">|</span>
                <span v-if="mystatus === 3" @click="handleDelete(scope.row)"
                  >删除</span
                >
              </div>
            </template>
          </el-table-column>
@@ -104,7 +120,7 @@
        </el-dialog>
        <div class="tools">
          <div class="funs">
            <div class="funsItem funs-sp">
            <div class="funsItem funs-sp funs-first">
              <el-checkbox v-model="all" @change="selectAll()"
                >全选</el-checkbox
              >
@@ -115,18 +131,14 @@
              >
            </div>
            <div class="funsItem">
              <el-select
                v-model="myIdx"
                placeholder="批量操作"
                @change="selectChange"
                disabled
              >
              <el-select v-model="myIdx" placeholder="批量操作">
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                  :disabled="item.disabled"
                  @click.native="selectChange"
                >
                </el-option>
              </el-select>
@@ -199,14 +211,14 @@
          label: "批量操作",
          disabled: true,
        },
        {
          value: 1,
          label: "批量启用",
        },
        {
          value: 2,
          label: "批量禁用",
        },
        // {
        //   value: 1,
        //   label: "批量启用",
        // },
        // {
        //   value: 2,
        //   label: "批量禁用",
        // },
        {
          value: 3,
          label: "批量删除",
@@ -215,13 +227,13 @@
      tempList: [],
      typeList: [
        {
          name: "摄像头推送",
          value: "01",
          name: "本地推送",
          value: "05",
          checked: true,
        },
        {
          name: "单兵推送",
          value: "03",
          name: "100路推送",
          value: "04",
          checked: false,
        },
      ],
@@ -246,21 +258,35 @@
    // 批量删除
    mulDelete(idArr) {
      imageManagement
        .deleteImageResources({ ids: idArr })
        .then(() => {
          this.$message.success("操作成功");
          this.getImageResourceList();
      this.$confirm("您确定要批量删除图片吗?")
        .then((_) => {
          this.$axios({
            method: "delete",
            url: "/sccg/image_resources/deletion_batch?ids=" + idArr,
          }).then((res) => {
            if (res.code === 200) {
              this.$message({
                type: "success",
                message: "批量删除图片成功",
              });
              this.getImageResourceList();
            } else {
              this.$message({
                type: "error",
                message: res.message,
              });
            }
          });
        })
        .catch((err) => this.$message.error(`${err}`));
        .catch((err) => {
          console.log(err);
        });
    },
    // 执行下拉框操作
    selectChange(list) {
      if (this.tempList.length !== 0) {
        if (list === 3) {
          this.preMyIdx = list;
          this.mulDelete(this.tempList);
        }
        this.preMyIdx = list;
        this.mulDelete(this.tempList);
      } else {
        this.myIdx = this.preMyIdx;
        this.$message({
@@ -273,7 +299,7 @@
    tableChange(list) {
      this.tempList = [];
      list.forEach((item) => {
        this.tempList.push(item.code);
        this.tempList.push(item.id);
      });
      this.all = list.length === this.tableData.length;
    },
@@ -294,6 +320,7 @@
          .deleteImageResource({ id: id })
          .then(() => {
            this.$message.success("操作成功");
            this.getImageResourceList();
          })
          .catch((err) => this.$message.error(`${err}`));
      });
@@ -320,10 +347,10 @@
    },
    // 更改违规/违建
    changeTypeChecked(data) {
      this.typeList.forEach(item => {
      this.typeList.forEach((item) => {
        item.checked = data.name === item.name;
      })
      const checkedType = this.typeList.find(item => item.checked);
      });
      const checkedType = this.typeList.find((item) => item.checked);
      this.mystatus = +checkedType.value;
      this.size = checkedType.value;
      this.getImageResourceList();
@@ -359,20 +386,27 @@
    getEventSource(value) {
      return EVENT_SOURCE.find((item) => item.value === value);
    },
    selectable(row, index) {
      if (this.mystatus == "1") {
        return false; //禁用状态
      } else {
        return true; //非禁用状态
      }
    },
  },
};
</script>
<style lang="scss" scoped>
.userList {
  text-align: left;
  margin: 10px 20px;
  color: #4b9bb7;
  padding: 10px 20px;
  // color: #4b9bb7;
  border: 1px solid #ccc;
  header {
    background-color: #09152f;
    background-color: white;
    .headerContent {
      padding: 0 40px;
      padding: 0;
      display: flex;
      line-height: 100px;
      justify-content: space-between;
@@ -391,8 +425,8 @@
          color: #1d3f57;
          &::v-deep .el-input__inner {
            background-color: #09152f;
            border: 1px solid #17324c;
            // background-color: #09152f;
            //border: 1px solid #17324c;
          }
        }
      }
@@ -406,29 +440,31 @@
        .el-button {
          padding: 12px 25px;
          border-radius: 20px;
          //border-radius: 20px;
        }
      }
      .addBtn {
        background-color: #eb5d01;
        // background-color: #eb5d01;
        border: none;
        border-radius: 20px;
        //border-radius: 20px;
        padding: 12px 30px;
      }
    }
  }
  &::v-deep .el-input__inner {
    background-color: #09152f;
    border: 1px solid #17324c;
    // background-color: #09152f;
    //border: 1px solid #17324c;
  }
  main {
    background-color: #09152f;
    // background-color: #09152f;
    margin-top: 20px;
    padding-bottom: 50px;
    &::v-deep .el-dialog__body{
      overflow: auto;
    }
    .btn span:hover {
      cursor: pointer;
    }
@@ -436,7 +472,7 @@
    .type-nav {
      display: flex;
      line-height: 40px;
      margin-left: 30px;
      //margin-left: 30px;
      padding-top: 10px;
      margin-bottom: 10px;
@@ -451,9 +487,10 @@
      }
      .is-active {
        background-color: #070f22;
        // background-color: #070f22;
        border-radius: 4px;
        color: #fff;
        color: red;
        font-weight: 700;
      }
    }
@@ -461,10 +498,12 @@
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0 20px;
      padding: 0;
      .funs-first {
        margin-left: 0 !important;
      }
      .funs-sp {
        border: 1px solid #17324c;
        border: 1px solid #dcdfe6;
      }
      .funs {
@@ -507,7 +546,7 @@
          &::v-deep li,
          &::v-deep .btn-prev,
          &::v-deep .btn-next {
            background-color: #071f39;
            // background-color: #071f39;
            color: #4b9bb7;
          }
@@ -520,8 +559,8 @@
    }
    .el-table {
      color: #4b9bb7;
      font-size: 10px;
      // color: #4b9bb7;
      // font-size: 10px;
      &::v-deep .cell {
        text-overflow: ellipsis;
@@ -531,7 +570,7 @@
      .operation {
        display: flex;
        color: var(--operation-color);
        .line {
          padding: 0 5px;
        }
@@ -548,7 +587,7 @@
  }
  :deep(.el-range-input) {
    background-color: #09152f;
    // background-color: #09152f;
  }
}
</style>
</style>