田源
2024-09-29 7d05c69630d066c0992368423f90e440e3638f91
Source/UBCS-WEB/src/views/modeling/Business.vue
@@ -1,31 +1,40 @@
<template>
  <el-container>
<!--    <el-header class="businessHeader" style="height: 40px;padding:0 8px">-->
    <!--    <el-header class="businessHeader" style="height: 40px;padding:0 8px">-->
<!--    </el-header>-->
    <!--    </el-header>-->
    <el-container>
      <el-aside style="width: 20%">
      <el-aside style="width: 300px">
        <basic-container class="businessTreeContainer">
          <div class="app">
          <div class="app"style="height: calc(100vh - 145px);">
            <div style="display: flex;margin-bottom: 10px;justify-content: space-around;">
              <el-button v-if="permissionList.addBtn"  size="mini" type="primary" @click="businessAdd" plain style="width: 60px">
              <el-button v-if="permissionList.addBtn" plain size="mini"  type="primary"
                         @click="businessAdd">
                新增
              </el-button>
              <el-button v-if="permissionList.editBtn"  size="mini" type="primary" @click="businessEdit" plain style="width: 60px">
              <el-button v-if="permissionList.editBtn" plain size="mini"  type="primary"
                         @click="businessEdit">
                修改
              </el-button>
              <el-button v-if="permissionList.table"  size="mini" type="primary"
                         @click="selectFromTable" plain> 从已有中获取
              <el-button v-if="permissionList.table" plain size="mini"
                         type="primary" @click="selectFromTable"> 从已有中获取
              </el-button>
            </div>
            <avue-tree :data="treeData" :option="treeOption" class="businessTree" @node-click="nodeClick" style="width: fit-content;">
            <template slot-scope="{ node, data }" class="el-tree-node__label">
              <span>
            <div style="height:  calc(100vh - 220px);overflow: auto">
              <avue-tree :data="treeData" :option="treeOption" class="businessTree"
                         @node-click="nodeClick">
                <template slot-scope="{ node, data }" class="el-tree-node__label">
                  <el-tooltip :content="$createElement('div', { domProps: { innerHTML: node.label } })" class="item" effect="dark"
                              open-delay="250"
                              placement="top-start">
                <span style="font-size: 15px;">
                <i :class="(node || {}).level === 2 ? 'el-icon-star-off' : 'el-icon-folder-opened'"></i>
                {{ (node || {}).label }}
              </span>
            </template>
            </avue-tree>
                  </el-tooltip>
                </template>
              </avue-tree>
            </div>
          </div>
        </basic-container>
@@ -87,24 +96,6 @@
                </template>
                {{ obj.lifeCycleName ? obj.lifeCycleName + '(' + obj.lifeCycleId + ')' : '' }}
              </el-descriptions-item>
<!--              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"-->
<!--                                    :labelStyle="descriptionOption.labelStyle">-->
<!--                <template slot="label">-->
<!--                  <i :class="icons.view"></i>-->
<!--                  视图-->
<!--                </template>-->
<!--                <el-tag v-if="obj.viewText" size="small">-->
<!--                  {{ obj.viewText }}-->
<!--                </el-tag>-->
<!--                <span v-else></span>-->
<!--              </el-descriptions-item>-->
              <!-- <el-descriptions-item>
            <template slot="label">
              <i class="el-icon-arrow-down"></i>
              实现类
            </template>
            {{ obj.implClass }}
          </el-descriptions-item> -->
              <el-descriptions-item :contentStyle="descriptionOption.contentStyle"
                                    :labelStyle="descriptionOption.labelStyle">
                <template slot="label">
@@ -118,14 +109,16 @@
          <!-- 属性列表-->
          <basic-container>
            <p style="margin-top: 10px;font-weight: 570;font-size: 19px">属性列表</p>
            <avue-crud v-model="obj" :data="obj.attributes" :option="loadOption" class="attributeCrud">
<!--            style="height: calc(100vh - 435px)"-->
            <avue-crud v-model="obj" :data="obj.attributes" :option="loadOption"  class="attributeCrud">
              <template slot="attrDataTypeText" slot-scope="{row}">
                <el-tag>{{ row.attrDataTypeText }}</el-tag>
              </template>
            </avue-crud>
          </basic-container>
        </el-main>
        <el-dialog :visible="ref.visible" append-to-body title="从数据库中添加" width="700px" @close="dialoghandelfalse" top="9vh">
        <el-dialog :visible="ref.visible" append-to-body title="从数据库中添加" top="4vh" width="600px"
                   @close="dialoghandelfalse">
          选择领域:
          <el-select v-model="domain" placeholder="请选择" size="small" @change="refOnLoad">
            <el-option v-for="item in domainOptions" :key="item.value" :label="item.label" :value="item.value">
@@ -147,6 +140,10 @@
    <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons" :type="type"
                  @refreshTable="initTreeOnLoad">
    </business-add>
    <business-edit ref="btmEdit" :btmType="addOption.btmEditType" :domainOption="domainOptions" :icons="icons" :type="type"
                   @refreshTable="initTreeOnLoad">
    </business-edit>
  </el-container>
</template>
<script>
@@ -163,7 +160,7 @@
  name: "Business",
  data() {
    return {
      type:"",
      type: "",
      //生命周期对话框状态
      packageLifeBox: false,
      //版本规则状态
@@ -172,6 +169,7 @@
      selectionList: [],
      treeData: [],
      treeOption: {
        height:'auto',
        defaultExpandAll: false,
        title: '业务类型树',
        addBtn: false,
@@ -184,10 +182,16 @@
        }
      },
      addOption: {
        btmType: {},
        btmType: {
          attributes:[]
        },
        btmEditType:{
          attributes:[]
        }
      },
      loadOption: {
        height:'auto',
        height: 'auto',
        calcHeight: 0,
        border: true,
        editBtn: false,
        addBtn: false,
@@ -254,6 +258,7 @@
          tabs: true,
          addBtn: false,
          menu: false,
          refreshBtn:false,
          highlightCurrentRow: true,
          column: [
            {
@@ -293,6 +298,18 @@
      if (data.oid) {
        getDetail(data.oid).then(res => {
          this.obj = res.data.data;
          this.addOption.btmEditType = res.data.data;
          // if(this.addOption.btmEditType.domainText){
          //   this.$refs.btmEdit.getDefaultData('reVersionRule', 'ruleData', 'ruleFirstSelection');
          // }
          // //版本规则
          // if(this.addOption.btmEditType.revisionRuleName && this.addOption.btmEditType.revisionRuleId){
          //   this.$refs.btmEdit.getDefaultData('reVersionRule', 'ruleData', 'ruleFirstSelection');
          // }
          // //生命周期
          // if(this.addOption.btmEditType.lifeCycleId && this.addOption.btmEditType.lifeCycleName){
          //   this.$refs.btmEdit.getDefaultData('lifeCycle', 'lifeData', 'lifeCycleSelection')
          // }
        })
      } else {
        this.$message.warning('请点击子节点');
@@ -371,9 +388,9 @@
        this.$message.warning("请选择一条叶子节点的业务类型");
        return;
      }
      const json = JSON.stringify(this.obj);
      this.$refs.btmAdd.btmType = JSON.parse(json);
      this.$refs.btmAdd.showSubmitDialog = true;
      // const json = JSON.stringify(this.obj);
      // this.$refs.btmAdd.btmType = JSON.parse(json);
      this.$refs.btmEdit.showSubmitDialog = true;
      this.type = 'edit'
      this.ifRefreshBtmAddRefresh();
    },
@@ -395,27 +412,25 @@
}
.app {
  overflow: auto;
  height: 84.3vh;
}
.app::-webkit-scrollbar {
  height: 15px; // 纵向滚动条 必写
  background: white;
  border: white;
  width: 10px;
}
// 滚动条的滑块
.app::-webkit-scrollbar-thumb {
  width: 10px;
  height: 10px;
  background-color: #ececec;
  border-radius: 20px;
  border: #ececec;
}
//
//.app::-webkit-scrollbar {
//  height: 15px; // 纵向滚动条 必写
//  background: white;
//  border: white;
//  width: 10px;
//
//}
//
//// 滚动条的滑块
//.app::-webkit-scrollbar-thumb {
//  width: 10px;
//  height: 10px;
//  background-color: #ececec;
//  border-radius: 20px;
//  border: #ececec;
//}
</style>