index.vue 7.21 KB
Newer Older
Z's avatar
Z committed
1
<template>
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
  <div class="main">
    <div class="searchs">
      <div class="buttons">
        <el-button class="button buttonlight" size="small">创建任务</el-button>
        <el-button class="button buttondark" size="small">发布任务</el-button>
        <el-button class="button buttondark" size="small">批量删除</el-button>
      </div>

      <!-- 搜索区 -->
      <el-form class="searchzone" :inline="true" :model="data.search" label-width="auto">
        <!-- 第一行 -->
        <!-- <el-row type="flex" justify="start"> -->
        <!-- 柜组 -->
        <!-- <el-col :span="6"> -->
        <el-form-item label="柜组">
          <el-select
            size="small"
            v-model="data.search.bar"
            placeholder="请选择柜组"
            style="width:160px;"
          >
            <el-option
              v-for="item in list.search.bar"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            ></el-option>
          </el-select>
        </el-form-item>
        <!-- </el-col> -->

        <!-- 任务类型 -->
        <!-- <el-col :span="6"> -->
        <el-form-item label="任务类型" class="nature">
          <el-select
            size="small"
            v-model="data.search.taskType"
            placeholder="请选择任务类型"
            style="width:160px;"
          >
            <el-option
              v-for="item in list.search.taskType"
              :key="item.id"
              :label="item.name"
              :value="item.id"
            ></el-option>
          </el-select>
        </el-form-item>
        <!-- </el-col> -->

        <!-- 关键字 -->
        <!-- <el-col :span="6"> -->
        <el-form-item label="关键词">
          <el-input
            size="small"
            v-model="data.search.keys"
            style="width:160px"
            placeholder="请输入关键词"
          />
        </el-form-item>
        <!-- </el-col> -->
        <!-- </el-row> -->
        <el-button class="button buttondark" size="small">批量删除</el-button>
      </el-form>
    </div>
    <div class="lists">
      <el-table
        stripe
        class="list"
        ref="multipleTable"
        :data="list.main"
        tooltip-effect="dark"
        style="width: 100%"
        @selection-change="listPick"
        :header-cell-style="setListsHeadStyle"
      >
        <el-table-column type="selection" width="60"></el-table-column>
        <el-table-column prop="taskName" label="任务名" align="center" width="200"></el-table-column>
        <el-table-column prop="taskType" label="任务类型" align="center" width="120"></el-table-column>
        <el-table-column prop="bar" label="柜组" align="center" width="120"></el-table-column>
        <el-table-column prop="taskContent" label="任务内容"></el-table-column>
        <el-table-column label="发布日期" width="120">
          <template slot-scope="scope">{{ scope.row.sendDate }}</template>
        </el-table-column>

        <el-table-column label="操作" align="center" fixed="right" width="240">
          <template slot-scope="scope">
            <el-button type="text" @click="testButtonClick(scope.row)">详情</el-button>
            <el-button type="text" @click="testButtonClick(scope.row)">编辑</el-button>
            <el-button type="text" @click="testButtonClick(scope.row.id)">下发</el-button>
            <el-button type="text" @click="testButtonClick(scope.row)" class="listButtonRed">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <div class="pages">
      <el-pagination
        @size-change="pagesSizeChange"
        @current-change="pagesNowPageChange"
        :current-page="currentPage4"
        :page-sizes="[100, 200, 300, 400]"
        :page-size="100"
        layout="prev, pager, next, sizes, jumper"
        :total="400"
      ></el-pagination>
    </div>
  </div>
Z's avatar
Z committed
109
</template>
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175
<script>
import TaskBar from "../bar/index";
import TaskCom from "../com/index";
import TaskCount from "../count/index";

export default {
  components: {},
  data() {
    return {
      list: {
        main: [
          {
            id: "1001",
            taskName: "2019年男装销售任务",
            taskType: "拉新",
            bar: "男装",
            taskContent: "任务内容任务内容任务内容...",
            sendDate: "2019/02/08"
          },
          {
            id: "1002",
            taskName: "2019年男装销售任务",
            taskType: "拉新",
            bar: "男装",
            taskContent: "任务内容任务内容任务内容...",
            sendDate: "2019/02/08"
          },
          {
            id: "1003",
            taskName: "2019年男装销售任务",
            taskType: "拉新",
            bar: "男装",
            taskContent: "任务内容任务内容任务内容...",
            sendDate: "2019/02/08"
          }
        ],
        search: {
          bar: [
            {
              id: "1",
              name: "全部"
            },
            {
              id: "2",
              name: "测试"
            }
          ],
          taskType: [
            {
              id: "1",
              name: "全部"
            },
            {
              id: "2",
              name: "测试"
            }
          ]
        }
      },
      data: {
        search: {
          bar: "",
          taskType: "",
          date: "",
          keys: ""
        },
Z's avatar
Z committed
176
        page: {
177 178 179 180 181 182 183 184 185
          nowPageNum: 4
        }
      }
    };
  },
  created() {},
  methods: {
    listPick() {},
    testButtonClick() {},
Z's avatar
Z committed
186 187 188 189 190 191 192
    pagesSizeChange() {},
    pagesNowPageChange() {},
    setListsHeadStyle({ row, column, rowIndex, columnIndex }) {
      if (rowIndex === 0) {
        return "background-color: #0B0F32; border-right: 1px solid white;color: white;";
      } else {
        return "";
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
      }
    }
  }
};
</script>
<style lang="scss" scoped>
.main {
  // border: 2px solid orange;
  height: 100vh;

  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.searchs {
  // border: 2px solid red;
  height: 40px;
  width: 100%;

  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}
.buttons {
  // border: 2px solid darkcyan;
  // width: 30%;
  // min-width: 266px;
  width: 266px;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
}
.buttonlight {
  background-color: #e8e9fe;
  color: #4e59c7;
  border: 1px solid #4e59c7;
  box-sizing: border-box;
}
.buttonlight:hover {
}
.buttondark {
  background-color: #4e59c7;
  color: #ffffff;
  border: 1px solid #4e59c7;
  box-sizing: border-box;
}
.buttondark:hover {
}
.searchzone {
  // border: 2px solid orange;
  height: 40px;
  width: auto;
  min-width: 654px;

  // display: flex;
  // flex-direction: row;
  // justify-content: space-between;
  // align-items: center;
}
.lists {
  // border: 2px solid greenyellow;
  height: auto;
  // min-height: 400px;
  min-height: 70%;
  width: 100%;
  margin-top: 20px;
}
.list {
  // border: 1px solid red;
}
.listButtonRed {
  // border: 2px solid green;
  color: red;
}
.pages {
  // border: 2px solid steelblue;
  height: 40px;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  align-items: center;
}
</style>