3328350766
6 天以前 761eb03d6b3bebd0b197179564c84d89d3d12a0d
1
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
<template>
  <el-dialog
    title="新增"
    :visible.sync="dialogVisible"
    width="800px"
    :append-to-body="true"
    :close-on-click-modal="false"
    class="bs-dialog-wrap bs-el-dialog"
  >
    <div class="type-wrap">
      <el-row :gutter="20">
        <el-col
          v-for="dataset in datasetTypeList.filter(item =>item.datasetType !=='')"
          :key="dataset.datasetType"
          :span="8"
          :xs="24"
          :sm="12"
          :md="8"
          style="minWidth: 200px;"
        >
          <el-card
            class="bs-el-card"
            shadow="hover"
          >
            <div
              class="type-item"
              @click="openAddForm(dataset.datasetType,dataset.componentName)"
            >
              <span>
                {{ dataset.name }}
              </span>
              <p>
                <span class="description">
                  {{ dataset.description }}
                </span>
              </p>
            </div>
          </el-card>
        </el-col>
      </el-row>
    </div>
  </el-dialog>
</template>
 
<script>
export default {
  props: {
    datasetTypeList: {
      type: Array,
      default: () => ([])
    }
  },
  data () {
    return {
      dialogVisible: false
    }
  },
  created () { },
  mounted () { },
  methods: {
    // 选择新增类型
    openAddForm (type, componentName) {
      this.dialogVisible = false
      this.$emit('openAddForm', type, componentName)
    }
  }
}
</script>
 
<style lang="scss" scoped>
.type-item {
  height: 104px;
  text-align: center;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  position: relative;
  padding-top: 35px;
  color: var(--bs-el-text);
  p {
    width: 100%;
    margin-top: 10px;
    font-size: 14px;
    line-height: 16px;
    color: #909399;
  }
  &:hover{
      color: var(--bs-el-color-primary);
    }
}
::v-deep .el-dialog__body {
  min-height: 130px !important;
}
.el-col {
  margin-bottom: 10px;
}
</style>