田源
2024-07-26 0b034a97c5da37937678b796c5c94b889bde910d
属性池&&链接类型页面展示 以及部分功能
已修改4个文件
已添加1个文件
1014 ■■■■■ 文件已修改
Source/plt-web/plt-web-ui/src/api/modeling/attributePool/api.js 36 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/modeling/linkType/api.js 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/util/basic-option.js 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue 676 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue 283 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/modeling/attributePool/api.js
@@ -12,3 +12,39 @@
    }
  });
}
// // åˆ›å»º
// export function gridAttribute(params) {
//   return request({
//     url: "/api/attributeController/gridAttribute",
//     method: "post",
//     params
//   });
// }
// åˆ é™¤
export function deleteAttributes(params) {
  return request({
    url: "/api/attributeController/deleteAttributes",
    method: "delete",
    data:params
  });
}
// æŸ¥çœ‹åº”用范围
export function getUsedAttributeList(params) {
  return request({
    url: "/api/attributeController/getUsedAttributeList",
    method: "get",
    params:params
  });
}
// æžšä¸¾ç±»åž‹é€‰æ‹©æ¡†æŸ¥è¯¢
export function getEnumMapByType(params) {
  return request({
    url: "/api/webEnumController/getEnumMapByType",
    method: "get",
    params:params
  });
}
Source/plt-web/plt-web-ui/src/api/modeling/linkType/api.js
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,18 @@
import request from '@/router/axios';
// åˆ—表查询
export function gridLink() {
  return request({
    url: "/api/linkTypeController/gridLink",
    method: "get",
  });
}
// é€šè¿‡å±žæ€§æ± è¿”回的 attributes èŽ·å–å®Œæ•´çš„ä¿¡æ¯
export function getByAttributeNames(params) {
  return request({
    url: "/api/attributeController/getByAttributeNames",
    method: "get",
    params
  });
}
Source/plt-web/plt-web-ui/src/util/basic-option.js
@@ -9,6 +9,7 @@
  stripe:true,
  headerAlign: 'center',
  align: 'center',
  emptyText: '暂无内容',
  // selection æ˜¯å¦æœ‰é€‰æ‹©æ¡†
  // indexFixed:true/left/right, å›ºå®šåˆ—
  // menu:false, æ˜¯å¦æœ‰æ“ä½œæ 
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/attributePool/index.vue
@@ -35,109 +35,370 @@
    <el-aside width="30%">
      <basic-container>
       <div style="height: 85vh; overflow-y: auto">
         <el-descriptions :column="1" border  size="medium" title="属性项">
           <el-descriptions-item>
             <template slot="label">
               åç§°
             </template>
             åç§°
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label">
               æ ‡ç­¾
             </template>
             æ ‡ç­¾
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label">
               æè¿°
             </template>
             æè¿°
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label">
               æ“ä½œç±»åž‹
             </template>
             æ“ä½œç±»åž‹
           </el-descriptions-item>
         </el-descriptions>
        <div style="height: 85vh; overflow-y: auto">
          <el-descriptions :column="1" border size="medium" title="属性项">
            <el-descriptions-item>
              <template slot="label">
                åç§°
              </template>
              {{ lastItem.id }}
            </el-descriptions-item>
            <el-descriptions-item>
              <template slot="label">
                æ ‡ç­¾
              </template>
              {{ lastItem.name }}
            </el-descriptions-item>
            <el-descriptions-item>
              <template slot="label">
                æè¿°
              </template>
              {{ lastItem.description }}
            </el-descriptions-item>
            <el-descriptions-item>
              <template slot="label">
                æ“ä½œç±»åž‹
              </template>
              {{ lastItem.attributeDataType }}
            </el-descriptions-item>
          </el-descriptions>
         <el-descriptions :column="1" border class="margin-top" size="medium" title="VTString">
           <el-descriptions-item>
             <template slot="label">
               å…è®¸ä¸ºç©º
             </template>
             <el-tag type="success">是</el-tag>
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label">
               ç²¾åº¦
             </template>
             ç²¾åº¦
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label">
               é•¿åº¦
             </template>
             é•¿åº¦
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label">
               é»˜è®¤å€¼
             </template>
             é»˜è®¤å€¼
           </el-descriptions-item>
         </el-descriptions>
          <!-- å€¼åŸŸ -->
          <el-descriptions v-if="!isSpecialDataType" :column="1" :title="lastItem.attributeDataType" border
                           class="margin-top"
                           size="medium">
            <el-descriptions-item>
              <template slot="label">
                å…è®¸ä¸ºç©º
              </template>
              <el-tag :type="lastItem.nullableFlag ? 'success' : 'danger'">
                {{ lastItem.nullableFlag ? '是' : '否' }}
              </el-tag>
            </el-descriptions-item>
            <el-descriptions-item v-if="accuracy">
              <template slot="label">
                ç²¾åº¦
              </template>
              ç²¾åº¦
            </el-descriptions-item>
            <el-descriptions-item v-if="length">
              <template slot="label">
                é•¿åº¦
              </template>
              {{ lastItem.attrLength }}
            </el-descriptions-item>
            <el-descriptions-item>
              <template slot="label">
                é»˜è®¤å€¼
              </template>
              {{ lastItem.defaultValue }}
            </el-descriptions-item>
          </el-descriptions>
         <el-descriptions :column="1" border class="margin-top" size="medium" title="值域">
           <el-descriptions-item>
             <template slot="label">
               å½“前类型
             </template>
             ä¸šåŠ¡ç±»åž‹
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label">
               å½“前类型值
             </template>
          <!--   VTString  -->
          <el-descriptions v-if="lastItem.attributeDataType === 'VTString' || !lastItem.attributeDataType"
                           :column="1" border class="margin-top" size="medium" title="值域">
            <el-descriptions-item>
              <template slot="label">
                å½“前类型
              </template>
              {{ lastItem.version ? '链接类型' : '业务类型' }}
            </el-descriptions-item>
            <el-descriptions-item>
              <template slot="label">
                å½“前类型值
              </template>
              {{ lastItem.version ? lastItem.linkTypeName : lastItem.btmTypeId }}
            </el-descriptions-item>
            <el-descriptions-item v-if="lastItem.version">
              <template slot="label">
                å½“前版本次
              </template>
              {{ lastItem.version }}
            </el-descriptions-item>
            <el-descriptions-item>
              <template slot="label">
                ä½¿ç”¨æžšä¸¾
              </template>
              <el-tag :type="lastItem.enumId ? 'success' : 'danger'">
                {{ lastItem.enumId ? '是' : '否' }}
              </el-tag>
            </el-descriptions-item>
            <el-descriptions-item>
              <template slot="label">
                æžšä¸¾ç±»åž‹
              </template>
              {{ lastItem.enumId }}
            </el-descriptions-item>
            <el-descriptions-item>
              <template slot="label">
                å–值范围
              </template>
              <div style="width: 330px; height: 80px;overflow: auto">
                <el-tag v-for="item in rangeList" plain style="margin: 5px">{{ item }}</el-tag>
              </div>
            </el-descriptions-item>
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label">
               å½“前版本次
             </template>
          </el-descriptions>
          <!-- VTInteger && VTInteger  -->
          <el-descriptions
            v-if="lastItem.attributeDataType === 'VTInteger' || lastItem.attributeDataType === 'VTInteger'"
            :column="1" border class="margin-top" size="medium" title="值域">
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label">
               ä½¿ç”¨æžšä¸¾
             </template>
             <el-tag type="success">是</el-tag>
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label">
               æžšä¸¾ç±»åž‹
             </template>
             æžšä¸¾ç±»åž‹
           </el-descriptions-item>
           <el-descriptions-item>
             <template slot="label">
               æžšä¸¾å€¼
             </template>
            <el-descriptions-item>
              <template slot="label">
                ä½¿ç”¨æžšä¸¾
              </template>
              <el-tag :type="lastItem.enumId ? 'success' : 'danger'">
                {{ lastItem.enumId ? '是' : '否' }}
              </el-tag>
            </el-descriptions-item>
            <el-descriptions-item>
              <template slot="label">
                æžšä¸¾ç±»åž‹
              </template>
              {{ lastItem.enumId }}
            </el-descriptions-item>
            <el-descriptions-item>
              <template slot="label">
                å–值范围
              </template>
              <div style="width: 330px; height: 80px;overflow: auto">
                <el-tag v-for="item in rangeList" plain style="margin: 5px">{{ item }}</el-tag>
              </div>
            </el-descriptions-item>
           </el-descriptions-item>
          </el-descriptions>
          <!-- VTDouble -->
          <el-descriptions v-if="lastItem.attributeDataType === 'VTDouble'"
                           :column="1" border class="margin-top" size="medium" title="值域">
         </el-descriptions>
            <el-descriptions-item>
              <template slot="label">
                å–值范围
              </template>
              <div style="width: 330px; height: 80px;overflow: auto">
                <el-tag v-for="item in rangeList" plain style="margin: 5px">{{ item }}</el-tag>
              </div>
            </el-descriptions-item>
       </div>
          </el-descriptions>
          <!--      VTDate VTTime VTDateTime VTNote VTFilePath VTClob均不显示 VTBoolean不显示值域 åªæ˜¾ç¤ºç±»åž‹   -->
        </div>
      </basic-container>
    </el-aside>
    <!-- æŸ¥çœ‹ä½¿ç”¨èŒƒå›´    -->
    <el-dialog
      v-dialogDrag
      v-loading="checkViewLoading"
      :visible.sync="checkViewVisible"
      append-to-body="true"
      class="avue-dialog"
      title="查看使用范围"
      width="70%"
    >
      <avue-crud
        ref="checkViewCrud"
        :data="checkViewData"
        :option="checkViewOption"
        @search-change="checkHandleSearch"
        @search-reset="checkHandleReset"
      >
      </avue-crud>
    </el-dialog>
    <!-- æ–°å¢žå¯¹è¯æ¡†    -->
    <el-dialog
      v-dialogDrag
      v-loading="addLoading"
      :visible.sync="addVisible"
      append-to-body="true"
      class="avue-dialog"
      title="创建"
      width="65%"
    >
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <el-row>
          <div class="addDialog">
            <div>
              <h3>属性项</h3>
              <el-col :span="12">
                <el-form-item label="名称:" prop="id">
                  <el-input v-model="form.id"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="标签:">
                  <el-input v-model="form.name"></el-input>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="属性类型:">
                  <el-select v-model="form.attributeDataType" placeholder="请选择属性类型" @change="attributeDataTypeChange">
                    <el-option v-for="item in typeSelectList" :label="item" :value="item"></el-option>
                  </el-select>
                </el-form-item>
              </el-col>
              <el-col :span="12">
                <el-form-item label="描述:">
                  <el-input v-model="form.description" :rows="2" type="textarea"></el-input>
                </el-form-item>
              </el-col>
            </div>
            <div v-if="!hideType" class="addDialogBottom">
              <div class="left">
                <h3>{{ form.attributeDataType }}</h3>
                <el-form-item
                  v-if="form.attributeDataType !== 'VTInteger' && form.attributeDataType !== 'VTLong'
                  && form.attributeDataType !== 'VTDouble' && form.attributeDataType !== 'VTBoolean'"
                  label="长度:">
                  <el-input v-model="form.attrLength"></el-input>
                </el-form-item>
                <el-form-item v-if="form.attributeDataType === 'VTDouble'" label="精度:">
                  <el-input v-model="form.precisionLength"></el-input>
                </el-form-item>
                <el-form-item v-if="form.attributeDataType === 'VTDouble'" label="长度:">
                  <el-input v-model="form.scaleLength"></el-input>
                </el-form-item>
                <el-form-item v-if="form.attributeDataType !== 'VTBoolean'" label="默认值:">
                  <el-input v-model="form.defaultValue"></el-input>
                </el-form-item>
                <el-form-item v-if="form.attributeDataType === 'VTBoolean'" label="默认值:">
                  <el-select>
                    <el-option label="false" value="false"></el-option>
                    <el-option label="true" value="true"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="允许为空:">
                  <el-switch v-model="form.nullableFlag"></el-switch>
                </el-form-item>
              </div>
              <el-divider direction="vertical"></el-divider>
              <!--  VTString   -->
              <div v-if="form.attributeDataType === 'VTString'" class="right">
                <h3>值域</h3>
                <el-form-item label="当前值域类型:">
                  <el-select v-model="form.attributeSelectType" placeholder="请选择属性类型" @change="attributeSelectTypeChange">
                    <el-option label="业务类型" value="business"></el-option>
                    <el-option label="链接类型" value="link"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="选择参照类型:">
                  <el-input v-model="form.attrLength"></el-input>
                </el-form-item>
                <el-form-item label="使用枚举:">
                  <el-switch v-model="form.enumSwitch" @change="switchEnumChange"></el-switch>
                </el-form-item>
                <el-form-item :label="form.enumSwitch ? '枚举选择:' : '添加枚举值:'">
                  <el-select v-if="form.enumSwitch" v-model="form.attributeDataTypePick" placeholder="请选择枚举类型"
                             @change="enumSelectChange">
                    <el-option v-for="(item,index) in attributeDataTypePickList" :key="index" :label="item.key"
                               :value="item.key"></el-option>
                  </el-select>
                  <el-input v-if="!form.enumSwitch" v-model="form.enumAddValue">
                  </el-input>
                </el-form-item>
                <el-form-item v-if="!form.enumSwitch" label="运算符:">
                  <div>
                    <el-button size="mini" @click="enumAddHandler"> =</el-button>
                  </div>
                </el-form-item>
                <el-form-item label="当前枚举值:">
                  <textarea v-model="form.range"
                            style="width: 330px; height: 80px; border: 1px solid #DCDFE6; overflow: auto; text-align: left;resize: none;">
                  </textarea>
                </el-form-item>
              </div>
              <!--  VTInteger VTLong   -->
              <div v-if="form.attributeDataType === 'VTInteger' || form.attributeDataType === 'VTLong' " class="right">
                <h3>值域</h3>
                <el-form-item label="使用枚举:">
                  <el-switch v-model="form.enumSwitch" @change="switchEnumChange"></el-switch>
                </el-form-item>
                <el-form-item :label="form.enumSwitch ? '枚举选择:' : '添加枚举值:'">
                  <el-select v-if="form.enumSwitch" v-model="form.attributeDataTypePick" placeholder="请选择枚举类型"
                             @change="enumSelectChange">
                    <el-option v-for="(item,index) in attributeDataTypePickList" :key="index" :label="item.key"
                               :value="item.key"></el-option>
                  </el-select>
                  <el-input v-if="!form.enumSwitch" v-model="form.enumAddValue">
                  </el-input>
                </el-form-item>
                <el-form-item v-if="!form.enumSwitch" label="运算符:">
                  <div>
                    <el-button size="mini"> ></el-button>
                    <el-button size="mini"> <</el-button>
                    <el-button size="mini"> >=</el-button>
                    <el-button size="mini"> <=</el-button>
                    <el-button size="mini"> =</el-button>
                    <el-button size="mini"> !=</el-button>
                    <el-button size="mini"> ( )</el-button>
                  </div>
                </el-form-item>
                <el-form-item label="当前枚举值:">
                  <textarea v-model="form.range"
                            style="width: 330px; height: 80px; border: 1px solid #DCDFE6; overflow: auto; text-align: left;resize: none;">
                  </textarea>
                </el-form-item>
              </div>
              <!--   VTDouble    -->
              <div v-if="form.attributeDataType === 'VTDouble'" class="right">
                <h3>值域</h3>
                <el-form-item label="添加枚举值:">
                  <el-input v-model="form.enumAddValue">
                  </el-input>
                </el-form-item>
                <el-form-item label="运算符:">
                  <div>
                    <el-button size="mini"> ></el-button>
                    <el-button size="mini"> <</el-button>
                    <el-button size="mini"> >=</el-button>
                    <el-button size="mini"> <=</el-button>
                    <el-button size="mini"> =</el-button>
                    <el-button size="mini"> !=</el-button>
                    <el-button size="mini"> ( )</el-button>
                  </div>
                </el-form-item>
                <el-form-item label="当前枚举值:">
                  <textarea v-model="form.range"
                            style="width: 330px; height: 80px; border: 1px solid #DCDFE6; overflow: auto; text-align: left;resize: none;">
                  </textarea>
                </el-form-item>
              </div>
            </div>
          </div>
        </el-row>
      </el-form>
    </el-dialog>
  </el-container>
</template>
<script>
import {gridAttribute} from "@/api/modeling/attributePool/api";
import {gridAttribute, getUsedAttributeList, getEnumMapByType} from "@/api/modeling/attributePool/api";
import basicOption from '@/util/basic-option';
import {column} from "./option"
@@ -163,7 +424,100 @@
        pageSizes: [10, 30, 50, 100],
      },
      searchParams: {},
      selectList: []
      selectList: [],
      checkViewData: [],
      checkViewDataSearch: [],
      checkViewVisible: false,
      checkViewLoading: false,
      checkViewOption: {
        ...basicOption,
        addBtn: false,
        menu: false,
        searchMenuSpan: 8,
        refreshBtn: false,
        selection: false,
        column: [
          {
            label: '名称',
            prop: 'attributeName',
            sortable: true,
          },
          {
            label: '来源',
            prop: 'source',
            sortable: true,
            search: true
          },
          {
            label: '说明',
            prop: 'desc',
          }
        ]
      },
      addVisible: false,
      addLoading: false,
      form: {
        id: "",
        name: "",
        attributeDataType: "VTString",
        description: "",
        nullableFlag: true,
        attrLength: 50,
        enumId: false,
        enumSwitch: false,
        attributeDataTypePick: "",
        enumAddValue: '',
        range: ''
      },
      defaultForm: {
        id: "",
        name: "",
        attributeDataType: "VTString",
        description: "",
        nullableFlag: true,
        attrLength: 50,
        enumId: false,
        enumSwitch: false,
        attributeDataTypePick: "",
        enumAddValue: '',
        range: '',
        attributeSelectType:'business'
      },
      rules: [],
      typeSelectList: ['VTString', 'VTInteger', 'VTLong', 'VTDouble', 'VTBoolean', 'VTDate', 'VTTime', 'VTDateTime', 'VTNote', 'VTFilePath', 'VTClob'],
      attributeDataTypePickList: [],
      enumAddListChange: []
    }
  },
  computed: {
    lastItem() {
      return this.selectList.length > 0 ? this.selectList[this.selectList.length - 1] : {};
    },
    isSpecialDataType() {
      // å®šä¹‰ä¸€ä¸ªåŒ…含所有需要比较的类型的数组
      const specialTypes = ['VTDate', 'VTTime', 'VTDateTime', 'VTNote', 'VTFilePath', 'VTClob'];
      // åˆ¤æ–­ lastItem.attributeDataType æ˜¯å¦åœ¨è¿™ä¸ªæ•°ç»„中
      return specialTypes.includes(this.lastItem.attributeDataType);
    },
    rangeList() {
      if (this.lastItem.range) {
        return this.lastItem.range.split(';');
      }
    },
    accuracy() {
      return this.lastItem.attributeDataType === 'VTDouble';
    },
    length() {
      return this.lastItem.attributeDataType === 'VTString' || this.lastItem.attributeDataType === 'VTDoubule';
    },
    // ç­‰äºŽå…¶ä¸­ä»¥ä¸‹å€¼ ä¸å±•示枚举
    hideType() {
      return this.form.attributeDataType === 'VTNote' ||
        this.form.attributeDataType === 'VTDate' ||
        this.form.attributeDataType === 'VTTime' ||
        this.form.attributeDataType === 'VTClob' ||
        this.form.attributeDataType === 'VTDateTime' ||
        this.form.attributeDataType === 'VTFilePath';
    }
  },
  methods: {
@@ -203,6 +557,7 @@
    // ç‚¹å‡»è¡Œ
    rowClickHandler(row) {
      this.$refs.userCrud.toggleRowSelection(row);
      console.log(row);
    },
    // æ¡æ•°
@@ -215,16 +570,60 @@
      this.page.currentPage = val;
    },
    // åˆ›å»ºæ‰“开对话框
    rowSaveHandlerClick() {
      this.addVisible = true;
      this.form = this.defaultForm;
      this.getEnumMapByTypeHandler('VTString');
    },
    allDelHandler() {
    },
    // æŸ¥çœ‹ä½¿ç”¨èŒƒå›´
    chekView() {
      if (this.selectList.length <= 0) {
        this.$message.warning('请至少选择一条数据');
        return;
      }
      if (this.selectList.length > 1) {
        this.$message.warning('只能选择一条数据进行查看');
        return;
      }
      getUsedAttributeList({attributeName: this.selectList[0].id}).then(res => {
        if (res.data.code === 200) {
          this.checkViewVisible = true;
          this.checkViewData = res.data.data;
          this.checkViewDataSearch = res.data.data;
        }
      })
    },
    // æŸ¥çœ‹ä½¿ç”¨èŒƒå›´æŸ¥è¯¢
    checkHandleSearch(params, done) {
      const {source} = params;
      if (!params.source) {
        this.checkViewData = this.checkViewDataSearch;
        return done();
      }
      ;
      this.checkViewData = this.checkViewData.filter(item => {
        return item.source && item.source.includes(source);
      });
      done();
    },
    // æŸ¥çœ‹ä½¿ç”¨èŒƒå›´é‡ç½®
    checkHandleReset() {
      this.checkViewData = this.checkViewDataSearch;
    },
    editBtnClick() {
@@ -232,13 +631,106 @@
    rowDeleteHandler() {
    },
    // å±žæ€§ç±»åž‹ä¸‹æ‹‰æ¡†change
    attributeDataTypeChange(val) {
      this.getEnumMapByTypeHandler(val);
      this.form.enumSwitch = false;
    },
    // å±žæ€§ç±»åž‹ä¸‹æ‹‰æ¡†æ•°æ®å¤„理
    getEnumMapByTypeHandler(val) {
      const enumType = {
        VTString: 'String',
        VTInteger: 'Integer',
        VTLong: 'Integer',
      };
      if (enumType[val]) {
        const string = enumType[val];
        getEnumMapByType({enumType: string}).then(res => {
          const data = res.data.data;
          this.attributeDataTypePickList = data.flatMap(obj =>
            Object.entries(obj).map(([key, values]) => ({
              key: key,
              values: values
            }))
          );
        })
      }
    },
    // ä½¿ç”¨æžšä¸¾æ—¶ æžšä¸¾é€‰æ‹©ä¸‹æ‹‰æ¡†change事件
    enumSelectChange(val) {
      const list = this.attributeDataTypePickList.find(item => item.key === val).values;
      this.form.range = list.join('\n');
    },
    // ä½¿ç”¨æžšä¸¾switch滑块change事件
    switchEnumChange(status) {
      if (status) {
        this.form.attributeDataTypePick = this.attributeDataTypePickList[0].key;
        const list = this.attributeDataTypePickList[0].values;
        this.form.range = list.join('\n');
      } else {
        this.form.range = "";
      }
    },
    // ä¸ä½¿ç”¨æžšä¸¾ æ‰‹åŠ¨æ·»åŠ æžšä¸¾å€¼
    enumAddHandler() {
      // æ£€æŸ¥å’Œè½¬æ¢ this.form.range ä¸ºæ•°ç»„,同时排除空值
      let currentRangeArray = this.form.range ? this.form.range.split('\n').filter(item => item.trim() !== '') : [];
      let newValue = this.form.enumAddValue.trim();
      if (currentRangeArray.includes(newValue)) {
        this.$message.error('该值域规则已经存在!')
        return;
      }
      currentRangeArray.push(newValue);
      this.enumAddListChange = currentRangeArray;
      this.form.range = currentRangeArray.join('\n');
      this.form.enumAddValue = "";
    },
    // å€¼åŸŸç±»åž‹åˆ‡æ¢
    attributeSelectTypeChange(){
    }
  }
}
</script>
<style lang="scss" scoped>
.margin-top{
.margin-top {
  margin-top: 25px;
}
.left {
  width: 45%;
  height: 100%;
  margin-right: 60px;
}
.right {
  height: 100%;
  width: auto;
  margin-left: 60px;
}
.addDialogBottom {
  width: 100%;
  display: flex;
  flex-direction: row;
}
.addDialogBottom > .el-divider--vertical {
  width: 2px;
  height: 78%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -10%);
}
</style>
Source/plt-web/plt-web-ui/src/views/modelingMenu/modeling/linkType/index.vue
@@ -1,13 +1,290 @@
<template>
  <p>链接类型</p>
  <el-container>
    <el-aside>
      <basic-container>
        <div ref="TreeBox" style="height: calc(100vh - 144px);!important;">
          <div class="headerCon">
            <el-button icon="el-icon-plus" plain size="small" type="primary">创建
            </el-button>
            <el-button icon="el-icon-edit" plain size="small" type="primary">修改
            </el-button>
            <el-button icon="el-icon-delete" plain size="small" type="danger">删除
            </el-button>
            <el-button icon="el-icon-view" plain size="small" type="primary">查看
            </el-button>
            <el-button icon="el-icon-download" plain size="small" type="primary">导出
            </el-button>
            <el-button icon="el-icon-upload2" plain size="small" type="primary">导入
            </el-button>
            <el-button icon="el-icon-circle-plus-outline" plain size="small"
                       type="primary">创建视图
            </el-button>
            <el-button icon="el-icon-menu" plain size="small"
                       type="primary">一致性检查
            </el-button>
          </div>
          <!-- å·¦ä¾§æ ‘         -->
          <div style="height:  calc(100vh - 300px);">
            <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick">
          <span slot-scope="{ node, data }" class="el-tree-node__label">
           <span>
              <i class="el-icon-s-promotion"></i>
                {{ (node || {}).label }}
            </span>
          </span>
            </avue-tree>
          </div>
        </div>
      </basic-container>
    </el-aside>
    <el-main>
      <basic-container>
        <div>
          <el-descriptions :column="2" border class="margin-top" size="medium">
            <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                  :labelStyle="descriptionOption.labelStyle">
              <template slot="label">
                <i :class="icons.id"></i>
                åç§°
              </template>
              {{ nodeRow.name }}
            </el-descriptions-item>
            <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                  :labelStyle="descriptionOption.labelStyle">
              <template slot="label">
                <i :class="icons.name"></i>
                æ ‡ç­¾
              </template>
              {{ nodeRow.tag }}
            </el-descriptions-item>
            <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                  :labelStyle="descriptionOption.labelStyle">
              <template slot="label">
                <i :class="icons.tableName"></i>
                å®žçŽ°ç±»
              </template>
              {{ nodeRow.implClass }}
            </el-descriptions-item>
            <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                  :labelStyle="descriptionOption.labelStyle">
              <template slot="label">
                <i :class="icons.domain"></i>
                å½¢çж
              </template>
              <el-tag v-if="nodeRow.shape" size="small">
                {{ nodeRow.shape }}
              </el-tag>
            </el-descriptions-item>
            <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                  :labelStyle="descriptionOption.labelStyle">
              <template slot="label">
                <i :class="icons.desc"></i>
                æè¿°
              </template>
              {{ nodeRow.description }}
            </el-descriptions-item>
          </el-descriptions>
          <el-descriptions :column="3" border class="margin-top" direction="vertical">
            <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                  :labelStyle="descriptionOption.labelStyle">
              <template slot="label">
                <i :class="icons.from"></i>
                From端类型
              </template>
              <span v-for="item in nodeRow.btmItemsFrom" style="margin-left:2px;">
              <el-tag effect="plain" size="small" style="margin-top: 2px;">
                  {{ item }}
              </el-tag>
            </span>
            </el-descriptions-item>
            <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                  :labelStyle="descriptionOption.labelStyle">
              <template slot="label">
                <i :class="icons.from"></i>
                Form端主类型
              </template>
              <el-tag v-if="nodeRow.primitivesFrom" effect="plain" size="small">
                {{ nodeRow.primitivesFrom === '请选择' ? nodeRow.btmItemsFrom[0] : nodeRow.primitivesFrom }}
              </el-tag>
            </el-descriptions-item>
            <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                  :labelStyle="descriptionOption.labelStyle">
              <template slot="label">
                <i :class="icons.from"></i>
                From端对应关系
              </template>
              <el-tag v-if="nodeRow.relationFrom" effect="plain" size="small">{{ nodeRow.relationFrom }}</el-tag>
            </el-descriptions-item>
          </el-descriptions>
          <el-descriptions :column="3" border class="margin-top" direction="vertical">
            <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                  :labelStyle="descriptionOption.labelStyle">
              <template slot="label">
                <i :class="icons.to"></i>
                To端类型
              </template>
              <span v-for="item in nodeRow.btmItemsTo" style="margin-left:2px;">
              <el-tag effect="plain" size="small" style="margin-top: 2px;">
                  {{ item }}
              </el-tag>
            </span>
            </el-descriptions-item>
            <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                  :labelStyle="descriptionOption.labelStyle">
              <template slot="label">
                <i :class="icons.to"></i>
                To端主类型
              </template>
              <el-tag v-if="nodeRow.primitivesTo" effect="plain" size="small">
                {{ nodeRow.primitivesTo === '请选择' ? nodeRow.btmItemsTo[0] : nodeRow.primitivesTo }}
              </el-tag>
            </el-descriptions-item>
            <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                  :labelStyle="descriptionOption.labelStyle">
              <template slot="label">
                <i :class="icons.to"></i>
                To端对应关系
              </template>
              <el-tag v-if="nodeRow.relationTo" effect="plain" size="small">{{ nodeRow.relationTo }}</el-tag>
            </el-descriptions-item>
          </el-descriptions>
        </div>
        <div style="margin-top: 20px">
          <h3>属性池列表</h3>
          <avue-crud
            :data="tableData"
            :option="tableOption"
          ></avue-crud>
        </div>
      </basic-container>
    </el-main>
  </el-container>
</template>
<script>
import {gridLink} from "@/api/modeling/linkType/api";
import basicOption from '@/util/basic-option'
export default {
  name: "index"
  name: "index",
  data() {
    return {
      treeOption: {
        height: 'auto',
        defaultExpandAll: false,
        menu: false,
        addBtn: false,
        props: {
          label: 'name',
          value: 'name',
          children: 'children'
        }
      },
      treeData: [],
      tableData: [],
      tableOption: {
        ...basicOption,
        editBtn: false,
        refreshBtn: false,
        selection: false,
        // index:false,
        column: [
          {
            label: '属性名',
            prop: 'attributeName',
            sortable: true,
          },
          {
            label: '属性类型',
            prop: 'source',
            sortable: true,
          },
          {
            label: '初始值',
            prop: 'source',
            sortable: true,
          },
          {
            label: '说明',
            prop: 'desc',
          }
        ]
      },
      nodeRow: {},
      descriptionOption: {
        labelStyle: 'text-align:center;width:120px',
        contentStyle: 'width:240px;text-align:center;word-break;break-all;'
      },
      icons: {
        id: 'el-icon-finished',
        name: 'el-icon-tickets',
        tableName: 'el-icon-date',
        domain: 'el-icon-connection',
        from: 'el-icon-sort-down',
        to: 'el-icon-sort-up',
        main: 'el-icon-warning-outline',
        desc: 'el-icon-chat-line-square'
      },
    }
  },
  created() {
    this.getTreeList();
  },
  mounted() {
  },
  methods: {
    // æ ‘onLoad请求
    getTreeList() {
      gridLink().then(res => {
        const data = res.data.data;
        this.treeData = data;
        this.tableLoading = false;
      }).catch(err => {
        this.$message.error(err)
      });
    },
    // æ ‘点击事件
    nodeClick(row) {
      console.log(row);
      this.nodeRow = row;
    }
  }
}
</script>
<style scoped>
<style lang="scss" scoped>
::v-deep {
  .el-scrollbar__wrap {
    overflow: auto !important;
  }
}
.headerCon {
  display: flex;
  flex-wrap: wrap;
  margin-bottom: 5px;
  .el-button + .el-button {
    margin-left: 5px;
  }
  .el-button {
    margin-top: 5px;
  }
}
.headerCon > .el-button:nth-child(4) {
  margin-left: 0;
}
.headerCon > .el-button:nth-child(7) {
  margin-left: 0;
}
</style>