lihang
2023-05-23 1d91a31301494b9f0b7e17b3eef280f8d54e2806
Source/UBCS-WEB/src/views/modeling/Business.vue
@@ -1,14 +1,14 @@
<template>
  <el-container>
    <el-header>
      <el-button type="primary" @click="businessAdd">新增</el-button>
      <el-button type="primary" @click="businessEdit">修改</el-button>
      <el-button type="primary" @click="selectFromTable">从已有中获取</el-button>
    <el-header class="businessHeader" style="height: 40px;">
      <el-button type="primary" @click="businessAdd" size="small">新增</el-button>
      <el-button type="primary" @click="businessEdit" size="small">修改</el-button>
      <el-button type="primary" @click="selectFromTable" size="small">从已有中获取</el-button>
    </el-header>
    <el-container>
      <el-aside width="240px">
        <basic-container>
          <avue-tree id="basic" :data="treeData" :option="treeOption" @node-click="nodeClick">
        <basic-container class="businessTreeContainer">
          <avue-tree id="basic" :data="treeData" :option="treeOption" @node-click="nodeClick" class="businessTree">
            <span class="el-tree-node__label" slot-scope="{ node, data }">
              <span>
                <i class="el-icon-star-on"></i>
@@ -50,7 +50,9 @@
                  <i class="el-icon-folder-opened"></i>
                  所属领域
                </template>
                {{ obj.domain }}
                  <el-tag size="small">
                    {{ obj.domainText }}
                  </el-tag>
              </el-descriptions-item>
              <!-- <el-descriptions-item>
            <template slot="label">
@@ -85,7 +87,9 @@
                  <i class="el-icon-view"></i>
                  视图
                </template>
                {{ obj.viewFlag }}
               <el-tag size="small">
                  {{ obj.viewText }}
               </el-tag>
              </el-descriptions-item>
              <!-- <el-descriptions-item>
            <template slot="label">
@@ -106,15 +110,22 @@
          <!-- 属性列表-->
          <basic-container>
            <p style="margin-top: 10px;font-weight: 570;font-size: 19px">属性列表</p>
            <avue-crud v-model="obj" :data="obj.attributes" :option="loadOption" @row-save="loadSave"></avue-crud>
            <avue-crud class="attributeCrud" v-model="obj" :data="obj.attributes" :option="loadOption">
              <template slot="attrDataType" slot-scope="{row}" >
                    <el-tag>{{row.attrDataType}}</el-tag>
                </template>
            </avue-crud>
          </basic-container>
        </el-main>
        <el-dialog :visible="ref.visible" title="从数据库中添加" width="700px" append-to-body @close="dialoghandelfalse">
          选择领域:
          <el-select v-model="domain" placeholder="请选择" @change="refOnLoad">
            <el-option v-for="item in domainOptions" :key="item" :label="item" :value="item">
          <el-select v-model="domain" placeholder="请选择" @change="refOnLoad" size="small">
            <el-option v-for="item in domainOptions" :key="item.value" :label="item.label" :value="item.value">
            </el-option>
          </el-select>
          <div class="sep" style="height:7px">
          </div>
          <avue-crud class="businessCrud" v-model="ref.form" :option="ref.option" :data="ref.data" @selection-change="selectionChange">
          </avue-crud>
          <span slot="footer" class="dialog-footer">
@@ -124,7 +135,7 @@
        </el-dialog>
      </el-container>
    </el-container>
    <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions">
    <business-add ref="btmAdd" :btmType="addOption.btmType" :domainOption="domainOptions" :icons="icons" @refreshTable="initTreeOnLoad">
  </business-add>
  </el-container>
</template>
@@ -171,18 +182,19 @@
        columnBtn:false,
        column: [
          {
            label: '属性英文名称',
            label: '英文名称',
            prop: 'id',
            align: 'center'
          }, {
            label: '属性中文名称',
            label: '中文名称',
            prop: 'name',
            align: 'center'
          },
          {
            label: "属性类型",
            label: "类型",
            prop: "attrDataType",
            align: 'center'
            align: 'center',
            slot: true
          },
          {
            label: "默认值",
@@ -198,6 +210,16 @@
      },
      domain: null,
      domainOptions: [],
      icons:{
        key: 'el-icon-finished',
        name: 'el-icon-info',
        tableName: 'el-icon-date',
        domain: 'el-icon-folder-opened',
        revisionRule: 'el-icon-s-check',
        lifeCycle: 'el-icon-refresh-right',
        view: 'el-icon-view',
        desc: 'el-icon-chat-line-square'
      },
      ref: {
        // 从表中选择dialog状态
        visible: false,
@@ -240,38 +262,6 @@
    this.initDomainOption();
  },
  methods: {
    //生命周期对话框取消点击事件
    dialoghandelfalse() {
      this.packageLifeBox = false
    },
    //生命周期对话框确定点击事件
    dialoghandeltrue() {
      this.packageLifeBox = false
    },
    //选择生命周期对话框
    handelLife() {
      this.packageLifeBox = true
    },
    //版本规则手动输入和选择框的状态取反
    handelRules() {
      this.rulesFalg = !this.rulesFalg
    },
    //版本规则三个按钮的显示隐藏
    radioChange(val) {
      if (val.value == 0) {
        this.basicOption.group[1].column[1].display = false;
        this.basicOption.group[1].column[2].display = false;
        this.basicOption.group[1].column[3].display = false;
      } else if (val.value == 1) {
        this.basicOption.group[1].column[1].display = true;
        this.basicOption.group[1].column[2].display = true;
        this.basicOption.group[1].column[3].display = false;
      } else if (val.value == 2) {
        this.basicOption.group[1].column[1].display = true;
        this.basicOption.group[1].column[2].display = true;
        this.basicOption.group[1].column[3].display = true;
      }
    },
    nodeClick(data) {
      getDetail(data.oid).then(res => {
        this.obj = res.data.data;
@@ -312,7 +302,6 @@
    },
    initTreeOnLoad() {
      initTree().then(res => {
        console.log('123');
        this.treeData = res.data.data;
      });
    },
@@ -323,7 +312,6 @@
    },
    selectionChange(list) {
      this.selectionList = list;
      console.log(this.selectionList);
    },
    dialoghandelfalse() {
      this.ref.visible = false;
@@ -339,12 +327,15 @@
    },
    businessAdd(){
      this.$refs.btmAdd.showSubmitDialog = true;
      console.log('添加');
      this.ifRefreshBtmAddRefresh();
    },
    businessEdit(){
      this.addOption.btmType = this.obj;
      this.$refs.addOption.showSubmitDialog = true;
      console.log('编辑');
      this.$refs.btmAdd.btmType = this.obj;
      this.$refs.btmAdd.showSubmitDialog = true;
      this.ifRefreshBtmAddRefresh();
    },
    ifRefreshBtmAddRefresh(){
      // this.$refs.btmAdd.refreshAttrTable();
    }
  },
}
@@ -356,7 +347,13 @@
  border-radius: 10px;
}
.businessCrud > .el-card > .el-card__body > .avue-crud_menu{
  display: none!important;
.businessCrud > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu{
        display: none !important;
}
.attributeCrud > .el-card:nth-of-type(2) > .el-card__body > .avue-crud__menu{
        display: none !important;
}
.businessTreeContainer > .el-card > .el-card__body {
  height: 775px;
}
</style>