<!--
 * @Author: WangJiaCheng
 * @Date: 2021-05-07 12:09:58
 * @LastEditors: WangJiaCheng
 * @LastEditTime: 2021-05-10 17:33:16
 * @Description:
-->
<template>
  <div class="dashboard">
    <div class="entry">
      <div class="entry-row">
        <div
          class="entry-item"
          @click="handleCreate('page')"
        >
          <span>新建页面</span>
        </div>
        <div :span="12" class="entry-item">
          新建模板
        </div>
      </div>
      <div class="entry-row">
        <div :span="12" class="entry-item">
          新建表单
        </div>
        <div :span="12" class="entry-item">
          新建列表
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'DashBoard',
  data() {
    return {}
  },
  methods: {
    handleCreate(type) {
      this.$router.push({
        name: `${type}Edit`,
        params: { type: 'create' }
      })
    }
  }
}
</script>

<style lang="less">
  @base: #1890ff;
  .entry {
    margin: 20px auto;
    width: 90%;
    max-width: 900px;
    .entry-row {
      display: flex;
      justify-content: center;
      .entry-item {
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 10px;
        border-radius: 4px;
        height: 200px;
        width: 400px;
        cursor: pointer;
        font-size: 20px;
        background: spin(lighten(@base, 25%), 8);
      }
    }
  }
</style>
