田源
2023-07-04 8343c82dcfd2f1ce67e234a77af9ad4ae7a3533f
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>
@@ -77,7 +77,7 @@
                          @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>
@@ -169,7 +169,7 @@
          </avue-crud>
          </basic-container>
          <templatePro :ProData="this.ProData" :crudOid="this.crudOid" :crudArray="this.crudArray" :Formlist="this.Formlist"></templatePro>
          <templatePro :ProData="this.ProData" :crudOid="this.crudOid" :crudArray="this.crudArray" :Formlist="this.Formlist" :codeClassifyOid="this.codeClassifyOid"></templatePro>
        </span>
      </basic-container>
    </el-main>
@@ -206,36 +206,36 @@
  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"
          }
        ]
      },
      // //表格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:"",
@@ -434,11 +434,51 @@
    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
      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() {
@@ -559,7 +599,7 @@
          message: '请先从树上选择一条数据!'
        });
      } else {
        this.TreeEditFormVisible = true
        this.TreeEditFormVisible = true;
      }
    },
    //树刷新
@@ -633,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
@@ -648,16 +688,8 @@
              return item.codeclassifyoid == this.nodeClickList.oid
            }
          })
          if(this.Formlist.length >0){
            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 => {
@@ -666,13 +698,12 @@
          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 != "") {
@@ -760,8 +791,7 @@
          message: '请先从树上选择一条数据!'
        });
      } else {
        let codeClassifyOid = this.codeClassifyOid
        this.$set(row, "codeclassifyoid", codeClassifyOid)
        this.$set(row, "codeclassifyoid", this.nodeClickList.oid)
        addSave(row).then(() => {
          this.$message({
            type: "success",
@@ -776,6 +806,7 @@
          });
        })
      }
      console.log('123',this.codeClassifyOid)
    },
    //模板管理修改
    CrudRowUpdata(row,index,done) {
@@ -787,7 +818,7 @@
        });
        done()
      }).catch(res => {
        console.log(res)
        this.$message.error(res)
      })
    },
    //模板管理删除
@@ -803,7 +834,6 @@
    },
    //模板管理表格查询
    EnterFind() {
      console.log(this.Formlist)
      if (this.FindText == "") {
        gridCodeClassifyTemplate().then(res => {
          this.Formlist = res.data.data
@@ -828,6 +858,14 @@
        })
      })
    },
    // 查询
    FindeHanler(){
      if(this.nodeClickList != ""){
        this.FindFormVisible=true
      }else {
        this.$message.warning('请从树上选择一条数据')
      }
    },
    //克隆模板选择确定
    Clonehandler(){
      if(this.CloneSelect.length <= 0){