田源
2024-07-23 89bdfef24b9ee62719e8a9def5151c3ebb1224f9
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/enumType/index.vue
@@ -1,4 +1,6 @@
<template>
  <el-container>
    <el-main>
  <basic-container>
    <avue-crud
      ref="userCrud"
@@ -112,6 +114,47 @@
    <upload-file ref="upload" :fileType="upFileType" :fileUrl="fileUrl" :tipList="tipList" title="导入"
                 @updata="getTableList"></upload-file>
  </basic-container>
    </el-main>
    <el-aside width="30%">
      <basic-container>
        <el-descriptions :column="1" border size="medium" style="margin-bottom: 20px" title="枚举信息">
          <el-descriptions-item>
            <template slot="label">
              名称
            </template>
            {{ this.lastItem.id }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              标签
            </template>
            {{ this.lastItem.name }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              类型
            </template>
            {{ this.lastItem.enumValueDataType || 'String' }}
          </el-descriptions-item>
          <el-descriptions-item>
            <template slot="label">
              长度
            </template>
            <el-tag> {{ this.lastItem.length || 50 }}</el-tag>
          </el-descriptions-item>
        </el-descriptions>
        <p style="font-weight: bold">枚举项</p>
        <avue-crud
          :data="asideData"
          :option="asideOption"
        >
        </avue-crud>
      </basic-container>
    </el-aside>
  </el-container>
</template>
<script>
@@ -132,6 +175,31 @@
  name: "index",
  data() {
    return {
      asideOption: {
        ...basicOption,
        addBtn: false,
        editBtn: false,
        menu: false,
        refreshBtn: false,
        selection: false,
        index: false,
        column: [
          {
            label: '枚举项名称',
            prop: 'name',
            sortable: true,
          },
          {
            label: '枚举值',
            prop: 'value',
            sortable: true,
          },
          {
            label: '描述',
            prop: 'description',
          },
        ]
      },
      tipList: [
        "导入模板中标明红色字体的为必输项",
        "*注意*:第二行开始的数据为示例数据,导入前请将其删除,当导入的枚举下具备多个枚举项时,应按照示例enum2的写法",
@@ -255,6 +323,14 @@
      searchParams: {}
    }
  },
  computed: {
    lastItem() {
      return this.selectList.length > 0 ? this.selectList[this.selectList.length - 1] : {};
    },
    asideData() {
      return this.selectList.length > 0 ? this.selectList[this.selectList.length - 1].items : [];
    }
  },
  methods: {
    //表格查询请求
    getTableList() {
@@ -290,6 +366,7 @@
    // 选择框
    selectChange(row) {
      console.log(row)
      this.selectList = row;
    },