<!--
 * @Author: WangJiaCheng
 * @Date: 2021-05-07 12:09:58
 * @LastEditors: WangJiaCheng
 * @LastEditTime: 2021-08-20 17:58:46
 * @Description:
-->
<template>
  <div class="dashboard">
    <div class="entry">
      <div class="entry-row">
        <div
          class="entry-item"
          @click="goEditor"
        >
          <span>开发页面</span>
        </div>
        <div :span="12" class="entry-item">
          开发可视化大屏
        </div>
      </div>
      <div class="entry-row">
        <div :span="12" class="entry-item" @click="handleCreate('page')">
          代码生成
        </div>
        <div :span="12" class="entry-item" @click="goFormDesign">
          表单设计
        </div>
      </div>
    </div>
  </div>
</template>

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

<style lang="less">
  .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;
        border: 1px solid #f0f0f0;
        margin: 10px;
        border-radius: 4px;
        height: 200px;
        width: 400px;
        cursor: pointer;
        font-size: 20px;
        // background: spin(lighten(@base, 25%), 8);
      }
    }
  }
</style>
