田源
2023-12-14 6023b713ba3cf468b5fb43ec101ef3cfc383e9d9
Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
@@ -31,18 +31,30 @@
                </el-button>
              </div>
            </div>
            <div style="display: flex;justify-content: space-around;margin-top: 5px;margin-bottom: 5px">
            <div style="display: flex;margin-top: 5px;margin-bottom: 5px">
              <el-button v-if="permissionList.flowingBtnStuatus" plain size="mini" type="primary" @click="testHandler">流水处理
              </el-button>
            </div>
          </div>
        </div>
          <!--          左侧树-->
          <div style="height: calc(100vh - 230px);overflow: auto">
            <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata"
                       :defaultExpandAll="false"
                       :option="Treeoption"
                       class="classifyTree"
                       style="height: calc(100vh - 280px)"
                       style="height: calc(100vh - 290px)"
                       @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="500"
                            placement="right-start">
                <span style="font-size: 14px;">
                {{ (node || {}).label }}
              </span>
                </el-tooltip>
              </template>
            </avue-tree>
          </div>
@@ -50,7 +62,7 @@
          <el-dialog v-loading="AddLoading" :before-close="TreeEscHandler"
                     :title="this.TreeFlag ? '添加分类' :'添加主题库'" :visible.sync="TreeAddFormVisible" append-to-body
                     style="width: 1700px;margin: auto">
            <el-form ref="myForm" :model="TreeAddform" :rules="rules">
            <el-form ref="myForm" :model="TreeAddform" :rules=  "rules">
              <el-form-item :label="this.TreeFlag ? '分类编号:' :'主题库编号:'" label-width="150px" prop="id"
                            style="display: inline-block">
                <el-input v-model="TreeAddform.id" autocomplete="off" style="width: 170px"></el-input>
@@ -102,7 +114,6 @@
                              :nodeList="nodeList" @MasterHandler="MasterHandler" @flushed="flushed"
                              @referTreeForm="referTreeForm"></classifyTreeform>
          </el-dialog>
        </div>
      </basic-container>
    </el-aside>
    <el-main>
@@ -423,7 +434,8 @@
  upVersion,
  stopLose,
  startRelease,
  exportClassify
  exportClassify,
  flowingDependencyGen
} from "@/api/template/templateAttr";
import {defaultReferDataGrid, referDataGrid} from '@/api/MasterData/master'
import func from "@/util/func";
@@ -433,6 +445,7 @@
  name: "classifyTrees.vue",
  data() {
    return {
      activeName: 'first',
      masterRow: null,
      AddLoading: false,
      // 定义一个变量来保存树请求的数量
@@ -472,6 +485,8 @@
      masterOption: {
        addBtn: false,
        index: true,
        refreshBtn:false,
        columnBtn: false,
        border: true,
        menu: false,
        height: 380,
@@ -500,6 +515,7 @@
        addBtn: false,
        index: true,
        columnBtn: false,
        refreshBtn:false,
        border: true,
        menu: false,
        height: 380,
@@ -817,6 +833,7 @@
        FindStatus: this.vaildData(this.permission.classifyTree.manage_search, false),
        TemRefreshStatus: this.vaildData(this.permission.classifyTree.manage_break, false),
        CloneBtnStuatus: this.vaildData(this.permission.classifyTree.manage_clone, false),
        flowingBtnStuatus: this.vaildData(this.permission.classifyTree.tree_flowing, false),
      }
    },
    crudTreeOption() {
@@ -879,10 +896,23 @@
  created() {
  },
  methods: {
    handleTabClick(){
    },
    testHandler(){
      if(this.nodeClickList.length <=0 ){
        this.$message.warning('请至少选择一条数据!')
        return;
      }
      flowingDependencyGen(this.nodeClickList.oid).then(res => {
        this.$message.success('操作成功')
      }).catch(res => {
        this.$message.error(res)
      })
    },
    // switch
    switchChange() {
      this.TreeAddform.isParticipateCheck = this.TreeAddform.codeKeyAttrValue === true ? 1 : 0;
      // console.log(this.TreeAddform.isParticipateCheck)
    },
    //存储的业务类型关闭
    BtmEscHandler() {
@@ -1114,6 +1144,7 @@
    },
    //分类树数据处理
    getAttr() {
      this.loading = true;
      return new Promise((resolve, reject) => {
        getAtrrList()
          .then(res => {
@@ -1132,6 +1163,7 @@
              }
              return item;
            });
            this.loading = false;
            resolve(); // 完成请求,调用resolve方法
          })
          .catch(error => {
@@ -1185,35 +1217,31 @@
      this.$refs.myForm.clearValidate();
    },
    //树节点添加事件
    TreeAddHandler() {
    async TreeAddHandler() {
      if ((!this.TreeAddform.id || !this.TreeAddform.name) || (this.TreeFlagCode && !this.TreeAddform.btmTypeName)) {
        this.$message.warning('请输入内容!');
      } else {
        return;
      }
      try {
        const data = this.TreeAddform;
        this.$set(data, "parentCodeClassifyOid", this.nodeClickList.oid);
        TreeSave(data)
          .then(() => {
            this.$message({
              type: "success",
              message: "添加成功!",
            });
            Object.keys(this.TreeAddform).forEach(key => {
              this.TreeAddform[key] = "";
              this.TreeAddform.codeKeyAttrValue = true;
              this.TreeAddform.isParticipateCheck = 1;
            });
            this.getAttr();
            this.TreeAddFormVisible = false;
            //添加完成后右侧清空
            this.ProData = [];
            this.Formlist = [];
          })
          .catch((res) => {
            this.$message({
              type: "warning",
              message: res,
            });
          });
        await TreeSave(data)
        this.$message.success("添加成功!");
        Object.keys(this.TreeAddform).forEach(key => {
          this.TreeAddform[key] = "";
        });
        this.TreeAddform.codeKeyAttrValue = true;
        this.TreeAddform.isParticipateCheck = 1;
        this.getAttr();
        this.TreeAddFormVisible = false;
        //添加完成后右侧清空
        this.ProData = [];
        this.Formlist = [];
      } catch (res) {
        this.$message({
          type: "warning",
          message: res,
        });
      }
    },
    //树节点删除按钮
@@ -1285,16 +1313,11 @@
    },
    //树刷新
    async flushed() {
      this.loading = true;
      try {
        await this.getAttr()
        this.$refs.tree.setCurrentKey(null);
        this.nodeClickList = {}
        this.TreeList = []
        this.TreeFlagCode = true;
      } finally {
        this.loading = false;
      }
    },
    //启用和停用都先判断状态
    //启用
@@ -1333,7 +1356,7 @@
          });
        }
      } catch (error) {
        console.error(error);
        // console.error(error);
      } finally {
        this.loading = false;
      }
@@ -1376,7 +1399,7 @@
          });
        }
      } catch (error) {
        console.error(error);
        // console.error(error);
      } finally {
        this.loading = false;
      }
@@ -1446,7 +1469,7 @@
      }
    },
    treeClick(e) {
      console.log(e);
      // console.log(e);
    },
    //基本信息表单刷新
    referTreeForm() {