xiejun
2023-06-30 d5bafa63b4dcc7ad6840560134dd41f38ded1390
Source/UBCS-WEB/src/components/Tree/classifyTrees.vue
@@ -49,7 +49,7 @@
        </el-dialog>
        <!--        修改对话框-->
        <el-dialog :visible.sync="TreeEditFormVisible" append-to-body title="修改分类">
          <classifyTreeform ref="childForm" :loneTreeNewForm="TreeList" :nodeList="nodeList"></classifyTreeform>
          <classifyTreeform ref="childForm" :loneTreeNewForm="TreeList" :nodeList="nodeList" :flag="'edit'"></classifyTreeform>
        </el-dialog>
        <avue-tree ref="tree" v-model="CloneTreeAvueform" v-loading="loading" :data="CloneTreedata" :defaultExpandAll="false"
                   :option="Treeoption"
@@ -65,7 +65,7 @@
        <!--        右侧表格-->
        <avue-tabs :option="tabOption" @change="handleChange"></avue-tabs>
        <span v-if="type.prop==='tab1'">
           <classifyTreeform ref="childForm" :TreeNewForm="TreeList" :nodeList="nodeList"></classifyTreeform>
           <classifyTreeform ref="childForm" :loneTreeNewForm="TreeList" :nodeList="nodeList" :flag="'renonly'"></classifyTreeform>
        </span>
        <span v-else-if="type.prop==='tab2'">
            <basic-container>
@@ -74,9 +74,10 @@
                          @row-del="CrudRowDel"
                          @row-update="CrudRowUpdata"
                          :before-close="beforeClose"
                          @select="selectHandle"
               >
            <template slot="menuLeft">
              <el-button plain size="small" type="primary" @click="FindFormVisible = true;">查询</el-button>
              <el-button plain size="small" type="primary" @click="FindeHanler">查询</el-button>
              <el-button plain size="small" type="primary" @click="TemRefresh">刷新</el-button>
                    <el-button plain size="small" type="primary" @click="TreeEdit">修改</el-button>
            <el-button plain size="small" type="primary" @click="TreeDel">删除</el-button>
@@ -168,7 +169,7 @@
          </avue-crud>
          </basic-container>
          <templatePro :ProData="this.ProData"></templatePro>
          <templatePro :ProData="this.ProData" :crudOid="this.crudOid" :crudArray="this.crudArray" :Formlist="this.Formlist" :codeClassifyOid="this.codeClassifyOid"></templatePro>
        </span>
      </basic-container>
    </el-main>
@@ -202,9 +203,44 @@
  //使用inject接收参数
  //Treeoption左侧树新增表单项 Treedata左侧树节点 配置项 crudTreeOption右侧表格配置项 crudTreeData右侧表格显示内容
  //Treeform右侧表单配置项
  inject: ['crudTreeOption', "crudTreeData"],
  inject: [, "crudTreeData"],
  data() {
    return {
      // //表格option配置项
      // crudTreeOption: {
      //   index: true,
      //   border: true,
      //   height:180,
      //   selection:true,
      //   addBtn:this.addFlag,
      //   column: [
      //     {
      //       label: "模板编号",
      //       prop: "id"
      //     },
      //     {
      //       label:"模板名称",
      //       prop:"name"
      //     },
      //     {
      //       label: "模板描述",
      //       prop:"description"
      //     },
      //     {
      //       label:"版本号",
      //       prop:"revisionSeq"
      //     },
      //     {
      //       label:"状态",
      //       prop:"lcStatusText"
      //     }
      //   ]
      // },
      addFlag:false,
      // 表格当前行id
      crudOid:"",
      //表格当前选择数组
      crudArray:[],
      //模板属性展示内容
      ProData: [],
      //回车键搜索绑定值
@@ -398,7 +434,52 @@
    this.type = this.tabOption.column[0];
    this.getAttr();
  },
  computed:{
    crudTreeOption(){
      return{
        index: true,
        border: true,
        height:180,
        selection:true,
        addBtn:this.Formlist.length<=0  && this.nodeClickList != "",
        column: [
          {
            label: "模板编号",
            prop: "id"
          },
          {
            label:"模板名称",
            prop:"name"
          },
          {
            label: "模板描述",
            prop:"description"
          },
          {
            label:"版本号",
            prop:"revisionSeq",
            display:false
          },
          {
            label:"状态",
            prop:"lcStatusText",
            display:false
          }
        ]
      }
    }
  },
  methods: {
    //行单选事件
    selectHandle(selection,row){
      this.crudOid=row.oid;
      this.crudArray=selection;
      gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.Formlist[0].oid}).then(res => {
        this.ProData = res.data.data;
      }).catch(res => {
        this.$message.error(res)
      })
    },
    //分类树数据处理
    getAttr() {
      getAtrrList().then(res => {
@@ -518,7 +599,7 @@
          message: '请先从树上选择一条数据!'
        });
      } else {
        this.TreeEditFormVisible = true
        this.TreeEditFormVisible = true;
      }
    },
    //树刷新
@@ -592,7 +673,7 @@
    async nodeClick(data) {
      //定义一个模板属性id,数据是模板管理表格里面的oid
      this.nodeClickList = data
      console.log(data.oid)
      this.ProData=[]
      try {
        await TreeObjcet(data.oid).then(res => {
          this.FlagObj = res.data.data
@@ -607,30 +688,22 @@
              return item.codeclassifyoid == this.nodeClickList.oid
            }
          })
          gridCodeClassifyTemplateAttr({'conditionMap[classifyTemplateOid]': this.Formlist[0].oid}).then(res => {
            this.ProData = res.data.data
            console.log(this.ProData)
          }).catch(res => {
            this.$message.error(res)
          })
        }).catch(res => {
          console.log(res)
          this.$message.error(res)
        })
        //  基本信息表单数据
        await getObjectByOid(this.nodeClickList.oid).then(res => {
          this.TreeList = res.data.data
          // eslint-disable-next-line no-const-assig
          this.TreeList = res.data.data;
        }).catch(res => {
          this.$message.error(res)
        })
      } catch (error) {
        console.log(error)
        this.$message.error(error)
      }
    },
    //克隆模板树的点击切换数据
    async ClonenodeClick(data){
      this.ClonenodeClickList=data;
      console.log("aaa",this.ClonenodeClickList.oid)
      await gridCodeClassifyTemplate({'conditionMap[codeclassifyoid]': data.oid}).then(res=>{
        this.CloneFormlist = res.data.data.filter(item => {
          if (item.codeclassifyoid != "") {
@@ -745,7 +818,7 @@
        });
        done()
      }).catch(res => {
        console.log(res)
        this.$message.error(res)
      })
    },
    //模板管理删除
@@ -761,7 +834,6 @@
    },
    //模板管理表格查询
    EnterFind() {
      console.log(this.Formlist)
      if (this.FindText == "") {
        gridCodeClassifyTemplate().then(res => {
          this.Formlist = res.data.data
@@ -786,6 +858,14 @@
        })
      })
    },
    // 查询
    FindeHanler(){
      if(this.nodeClickList != ""){
        this.FindFormVisible=true
      }else {
        this.$message.warning('请从树上选择一条数据')
      }
    },
    //克隆模板选择确定
    Clonehandler(){
      if(this.CloneSelect.length <= 0){