ZZJ
2022-06-23 feaf0a9778879ef211c5587a513ba4cbdabb52d0
src/pages/datapush/index/LeftList.vue
@@ -1,26 +1,34 @@
<template>
  <div class="out-div">
    <div class="flex-center left-list">
      <el-input placeholder="请输入内容" v-model="eventName" size="mini" style="width: 280px">
      <el-input
        @change="findAll"
        placeholder="请输入内容"
        v-model="eventName"
        size="mini"
        style="width: 280px"
      >
        <i slot="suffix" class="el-input__icon el-icon-search"></i>
      </el-input>
      <div class="icon-btn" @click="add" style="margin-left:10px">
      <div class="icon-btn" @click="add" style="margin-left: 10px">
        <i class="el-icon-circle-plus-outline"></i>
        <span>&nbsp;新增</span>
      </div>
    </div>
    <div class="max-height" style="overflow-y:auto;overflow-x:hidden">
    <div class="max-height" style="overflow-y: auto; overflow-x: hidden">
      <el-row
        class="cursor-pointer"
        v-for="(item, index) in eventList"
        :key="item.id"
        @click.native="clickCategory(index, item)"
        :class="{activeRow:categoryIndex==index}"
        :class="{ activeRow: categoryIndex == index }"
      >
        <div class="event-name">
          <b>{{item.name}}</b>
          <p style="margin-top:8px; color:#9e9e9e">{{item.time_start}} ~ {{item.time_end}}</p>
          <b>{{ item.name }}</b>
          <p style="margin-top: 8px; color: #9e9e9e">
            {{ item.time_start }} ~ {{ item.time_end }}
          </p>
        </div>
        <div class="event-btn">
@@ -29,11 +37,11 @@
            @change="enabled(item)"
            :inactive-value="false"
            :active-value="true"
            style="margin-top:-5px"
            style="margin-top: -5px"
          ></el-switch>
          <span
            class="iconfont iconshanchu iconStyle1"
            style="color:#E74C3C"
            style="color: #e74c3c"
            @click.stop="deleteBase(item)"
          ></span>
        </div>
@@ -49,24 +57,24 @@
  props: {
    listWidth: {
      default: "350px",
      type: String
      type: String,
    },
    title: {
      default: "",
      type: String
      type: String,
    },
    isSelected: {
      default: false,
      type: Boolean
      type: Boolean,
    },
    type: {
      default: "",
      type: String
      type: String,
    },
    activeId: {
      default: "",
      type: String
    }
      type: String,
    },
  },
  data() {
    return {
@@ -76,7 +84,7 @@
      // 当前点击的事件对象
      clickBase: {},
      // 事件名称
      eventName: ""
      eventName: "",
    };
  },
  mounted() {
@@ -86,12 +94,12 @@
    async enabled(item) {
      let json = {
        id: item.id,
        enable: item.enable
        enable: item.enable,
      };
      let res = await changeStatus(json);
      if (res && res.success) {
        // console.log(res, "更新状态");
        this.$emit("enabled", item)
        this.$emit("enabled", item);
      }
      // this.$emit("getEvents", item);
    },
@@ -122,27 +130,27 @@
      this.$confirm("确定要删除该条推送任务吗?", {
        center: true,
        cancelButtonClass: "comfirm-class-cancle",
        confirmButtonClass: "comfirm-class-sure"
        confirmButtonClass: "comfirm-class-sure",
      }).then(() => {
        let json = {
          type: "formData",
          id: data.id
          id: data.id,
        };
        deleteByid(json).then(res => {
        deleteByid(json).then((res) => {
          if (res && res.success) {
            this.$emit("del-list");
            this.$notify({
              type: "success",
              message: "删除成功"
            })
              message: "删除成功",
            });
          }
        });
      })
      });
    },
    // 查询事件列表
    async findAll() {
      let json = {
        name: this.eventName
        name: this.eventName,
      };
      let res = await findAll(json);
      if (res && res.success) {
@@ -155,11 +163,9 @@
          });
        }
        this.eventList = res.data;
      }
    }
  }
    },
  },
};
</script>
<style lang="scss" scoped>
@@ -193,7 +199,7 @@
  padding-top: 20px;
  //height: 50em;
  .left-list {
    min-width:340px;
    min-width: 340px;
    position: absolute;
    left: 15px;
    top: 10px;