mail.vue 10.4 KB
Newer Older
xd's avatar
xd committed
1 2 3 4 5 6 7 8 9 10 11 12
<template>
  <div class="ct">
    <div class="left">
      <div class="title">组织架构</div>
      <div class="bottom">
        <div class="ty">
          <div>
            <span>全部</span>
            <span class="number">(103)</span>
          </div>
          <div>
            <span><d2-icon-svg name="edit" class="icon"/></span>
xd's avatar
xd committed
13 14 15
            <span style="margin-left:8px;"
              ><d2-icon-svg name="delete" class="icon"
            /></span>
xd's avatar
xd committed
16 17 18 19 20 21 22 23 24
          </div>
        </div>
        <div class="ty" style="margin:15px 0;">
          <div>
            <span>未分组</span>
            <span class="number">(8)</span>
          </div>
          <div>
            <span><d2-icon-svg name="edit" class="icon"/></span>
xd's avatar
xd committed
25 26 27
            <span style="margin-left:8px;"
              ><d2-icon-svg name="delete" class="icon"
            /></span>
xd's avatar
xd committed
28 29 30 31 32 33 34 35 36
          </div>
        </div>
        <el-tree
          :data="data"
          show-checkbox
          node-key="id"
          default-expand-all
          :expand-on-click-node="false"
        >
xd's avatar
xd committed
37
          <span class="custom-tree-node" slot-scope="{ node, data }">
xd's avatar
xd committed
38 39
            <span>{{ node.label }}</span>
            <span style="margin-left:20px;">
xd's avatar
xd committed
40 41 42 43 44 45
              <d2-icon-svg name="edit" class="icon" @click="() => edit(data)" />
              <d2-icon-svg
                name="delete"
                class="icon"
                @click="() => remove(node, data)"
              />
xd's avatar
xd committed
46 47 48 49
            </span>
          </span>
        </el-tree>
      </div>
xd's avatar
xd committed
50 51 52 53
      <div class="end">
        <span class="add-l">添加柜组</span>
        <span class="add-r">添加部门</span>
      </div>
xd's avatar
xd committed
54 55
    </div>
    <div class="right">
xd's avatar
xd committed
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 109 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
      <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
            >
            
          </div>

          <!-- 搜索区 -->
          <el-form
            class="searchzone"
            :inline="true"
            :model="data.search"
            label-width="auto"
          >
            <!-- 关键字 -->
            <!-- <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="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 label="同步时间" width="178" align="center">
              <template slot-scope="scope">{{ scope.row.sendDate }}</template>
            </el-table-column>
            <el-table-column
              prop="bar"
              label="备注"
              align="center"
              width="120"
            ></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>
xd's avatar
xd committed
151 152 153 154 155 156
    </div>
  </div>
</template>

<script>
export default {
xd's avatar
xd committed
157
  data() {
xd's avatar
xd committed
158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208
    const data = [
      {
        id: 1,
        label: "一级 1",
        children: [
          {
            id: 4,
            label: "二级 1-1",
            children: [
              {
                id: 9,
                label: "三级 1-1-1"
              },
              {
                id: 10,
                label: "三级 1-1-2"
              }
            ]
          }
        ]
      },
      {
        id: 2,
        label: "一级 2",
        children: [
          {
            id: 5,
            label: "二级 2-1"
          },
          {
            id: 6,
            label: "二级 2-2"
          }
        ]
      },
      {
        id: 3,
        label: "一级 3",
        children: [
          {
            id: 7,
            label: "二级 3-1"
          },
          {
            id: 8,
            label: "二级 3-2"
          }
        ]
      }
    ];
    return {
xd's avatar
xd committed
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
      data: JSON.parse(JSON.stringify(data)),
      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: ""
        },
        page: {
          nowPageNum: 4
        }
      }
xd's avatar
xd committed
271 272 273
    };
  },
  methods: {
xd's avatar
xd committed
274
    append(data) {
xd's avatar
xd committed
275 276 277 278 279 280
      const newChild = { id: id++, label: "testtest", children: [] };
      if (!data.children) {
        this.$set(data, "children", []);
      }
      data.children.push(newChild);
    },
xd's avatar
xd committed
281 282
    edit(data) {},
    remove(node, data) {
xd's avatar
xd committed
283 284 285 286
      const parent = node.parent;
      const children = parent.data.children || parent.data;
      const index = children.findIndex(d => d.id === data.id);
      children.splice(index, 1);
xd's avatar
xd committed
287 288 289 290 291 292 293 294 295 296 297
    },
    listPick() {},
    testButtonClick() {},
    pagesSizeChange() {},
    pagesNowPageChange() {},
    setListsHeadStyle({ row, column, rowIndex, columnIndex }) {
      if (rowIndex === 0) {
        return "background-color: #0B0F32; border-right: 1px solid white;color: white;";
      } else {
        return "";
      }
xd's avatar
xd committed
298 299
    }
  }
xd's avatar
xd committed
300
};
xd's avatar
xd committed
301 302 303
</script>

<style scoped>
xd's avatar
xd committed
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329
.end {
  position: absolute;
  height: 32px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(78, 89, 199, 1);
  width: 100%;
  bottom: 0;
}
.add-l,
.add-r {
  width: 50%;
  height: 32px;
  border: 1px solid rgba(78, 89, 199, 1);
  width: 100%;
  text-align: center;
  line-height: 32px;
}
.add-l {
  background-color: #e8e9fe;
  color: rgba(78, 89, 199, 1);
}
.add-r {
  background-color: #4e59c7;
  color: #fff;
}
xd's avatar
xd committed
330
.ty {
xd's avatar
xd committed
331 332 333
  height: 40px;
  background: rgba(248, 248, 248, 1);
  border-radius: 26px;
xd's avatar
xd committed
334 335 336 337
  display: flex;
  align-items: center;
  padding: 0 16px;
  font-size: 16px;
xd's avatar
xd committed
338
  color: rgba(51, 51, 51, 1);
xd's avatar
xd committed
339 340 341 342 343 344 345
  justify-content: space-between;
}
.bottom {
  padding: 12px;
}
.title {
  height: 48px;
xd's avatar
xd committed
346
  background: rgba(78, 89, 199, 1);
xd's avatar
xd committed
347 348 349 350 351 352 353 354 355
  line-height: 48px;
  text-align: center;
  color: #fff;
  font-size: 16px;
}
.ct {
  display: flex;
  justify-content: space-between;
  flex-direction: row;
xd's avatar
xd committed
356
  background-color: #f8f8f8;
xd's avatar
xd committed
357 358 359 360
  padding: 16px;
  min-height: 100%;
}
.left {
xd's avatar
xd committed
361 362
  position: relative;
  width: 180px;
xd's avatar
xd committed
363
}
xd's avatar
xd committed
364 365
.left,
.right {
xd's avatar
xd committed
366 367 368 369
  background-color: #fff;
  min-height: 100%;
}
.right {
xd's avatar
xd committed
370 371
  padding: 10px;
  margin-left: 10px;
xd's avatar
xd committed
372 373 374 375 376 377 378 379 380 381 382 383
}
.number {
  font-size: 14px;
  margin-top: 2px;
  margin-left: 8px;
}
.icon {
  /* display: inline-block; */
  width: 16px;
  height: 16px;
}

xd's avatar
xd committed
384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462
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 {
  width: 88px;
  height: 32px;
  margin-top: 4px;
  background-color: #e8e9fe;
  color: #4e59c7;
  border: 1px solid #4e59c7;
  box-sizing: border-box;
}
.buttonlight:hover {
}
.buttondark {
  width: 88px;
  height: 32px;
  background-color: #4e59c7;
  color: #ffffff;
  border: 1px solid #4e59c7;
  box-sizing: border-box;
  margin-top: 4px;
}
.buttondark:hover {
}
.searchzone {
  /* // border: 2px solid orange; */
  height: 40px;
  width: auto;
  min-width: 654px;
}
.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;
}
xd's avatar
xd committed
463
</style>