ludc
2023-08-04 42c17fe468ceea7e5eed7fec520b9858bed02e85
Source/UBCS-WEB/src/components/Theme/ThemeClassifyTrees.vue
@@ -121,12 +121,12 @@
        </div>
           </el-dialog>
              <!--            模板克隆  -->
                <el-dialog :visible.sync="CloneVisible" append-to-body title="克隆模板">
                <el-dialog :visible.sync="CloneVisible" append-to-body title="克隆模板" :before-close="cloneClose">
                  <el-container>
                    <el-aside width="300px">
                      <div style="margin-bottom: 5px"><el-tag>主题库分类</el-tag></div>
                      <!--                      克隆模板的树 沿用首页树的loading和option,但是data和v-model绑定的数据创建一个新的变量,另外点击方法也是重新获取来操作克隆模板的数据-->
                        <avue-tree  v-model="TreeAvueform" v-loading="loading" :data="Treedata"
                        <avue-tree ref="cloneTree" v-model="TreeAvueform" v-loading="loading" :data="Treedata"
                                    :defaultExpandAll="false"
                                    :option="Treeoption"
                                    style="height: 50.5vh;margin-right: 10px"
@@ -160,7 +160,7 @@
                    </el-container >
                   <div style="display: flex; justify-content: flex-end; align-items: center;margin-top: 10px" >
                     <el-button size="small " type="primary" @click="Clonehandler">确定</el-button>
                     <el-button size="small" @click="CloneVisible=false" >取消</el-button>
                     <el-button size="small" @click="cloneClose" >取消</el-button>
                   </div>
                      <el-dialog
                        width="30%"
@@ -427,7 +427,7 @@
          label: '英文名称'
        }
      ],
      SelectValue:"",
      SelectValue:"id",
      SelectFInd:"",
      addFlag:false,
      // 表格当前行id
@@ -498,10 +498,10 @@
      },
      rules: {
        id: [
          { required: true, message: '请输入名称', trigger: 'blur' },
          { required: true, message: '请输入编号', trigger: 'blur' },
        ],
        name:[
          { required: true, message: '请输入编号', trigger: 'blur' },
          { required: true, message: '请输入名称', trigger: 'blur' },
        ],
        btmTypeName:[
          { required: true, message: '请选择业务类型', trigger: 'blur' },
@@ -672,11 +672,7 @@
    }
  },
  watch:{
    TreeFlagCode:{
      handler(newval,oldval){
        console.log('TreeFlagCode',newval)
      }
    }
  },
  //tab栏默认是表格
  mounted() {
@@ -753,6 +749,8 @@
  },
  methods: {
    // 关闭弹窗
    /** 导入 */
    ImportExcel(){
      this.ThemeImportVisible=true;
@@ -787,15 +785,11 @@
          'conditionMap[id]':this.SelectFInd
        }
        this.MasterdefaultRend(masterParameter);
        this.SelectValue=""
        this.SelectFInd=""
      }else if(this.SelectValue == 'name'){
        const masterParameter={
          'conditionMap[name]':this.SelectFInd
        }
        this.MasterdefaultRend(masterParameter)
        this.SelectValue=""
        this.SelectFInd=""
      }
    },
    //编码规则确定
@@ -846,15 +840,11 @@
          'conditionMap[id]':this.SelectFInd
        }
        this.KeydefaultRend(masterParameter);
        this.SelectValue="";
        this.SelectFInd="";
      }else if(this.SelectValue == 'name'){
        const masterParameter={
          'conditionMap[name]':this.SelectFInd
        }
        this.KeydefaultRend(masterParameter)
        this.SelectValue=""
        this.SelectFInd=""
      }
    },
    //关键属性接口
@@ -899,15 +889,11 @@
          'conditionMap[id]':this.SelectFInd
        }
        this.simdefaultRend(masterParameter);
        this.SelectValue=""
        this.SelectFInd=""
      }else if(this.SelectValue == 'name'){
        const masterParameter={
          'conditionMap[name]':this.SelectFInd
        }
        this.simdefaultRend(masterParameter)
        this.SelectValue=""
        this.SelectFInd=""
      }
    },
    //  相似项多选
@@ -952,15 +938,11 @@
          'conditionMap[id]':this.SelectFInd
        }
        this.btmdefaultRend(masterParameter);
        this.SelectValue=""
        this.SelectFInd=""
      }else if(this.SelectValue == 'name'){
        const masterParameter={
          'conditionMap[name]':this.SelectFInd
        }
        this.btmdefaultRend(masterParameter);
        this.SelectValue="";
        this.SelectFInd="";
      }
    },
    //业务类型多选
@@ -1226,6 +1208,7 @@
      this.editTreeFLagCode = !data.parentId;
      this.nodeClickList = data;
      this.selectRow = 0;
      this.crudArray=[]
      try {
        this.requestCount += 1;
        const [res1, res2, res3] = await Promise.all([
@@ -1378,6 +1361,13 @@
        });
      })
    },
    //克隆取消
    cloneClose(){
      this.$refs.cloneTree.setCurrentKey(null)
      this.ClonenodeClickList = {}
      this.CloneFormlist=[]
      this.CloneVisible=false;
    },
    //克隆模板查询
    CloneEnterFind(){
      gridCodeClassifyTemplate().then(res => {
@@ -1426,29 +1416,32 @@
      }
    },
    //克隆模板单选框改变
    selectionChange(row){
      this.CloneSelect=row;
      //双向绑定,提交表单输入框回填上当前选择的数据
      this.CloneModel.id=row[0].id;
      this.CloneModel.name=row[0].name;
      //这里有点绕,CloneSelect是我选择框选择的数据。等于this.nodeClickList.oid是因为,克隆模板传递数据要把当前选择树的oid传递给后端。而不是当前要克隆模板的oid
      this.CloneSelect[0].codeclassifyoid=this.nodeClickList.oid
    selectionChange(row) {
      this.CloneSelect = row;
      const { id, name } = row[0];
      this.CloneModel = { id, name };
      this.CloneSelect[0].codeclassifyoid = this.nodeClickList.oid;
      console.log('row',row)
      console.log('CloneSelect',this.CloneSelect)
      console.log('CloneModel',this.CloneModel)
    },
    //克隆表单提交
    Clonesubmit(row,done){
      //重新赋值CloneSelect传递的数据为输入框可以修改的数据,CloneModel提交表单输入框双向绑定数据
      this.CloneSelect[0].id=this.CloneModel.id;
      this.CloneSelect[0].name=this.CloneModel.name;
      copy(this.CloneSelect[0]).then(()=>{
        //因为是嵌套弹窗所以手动关闭CloneinnerVisible,CloneVisible两个弹窗。
        this.CloneinnerVisible=false
        this.CloneVisible=false
        this.$message.success("复制成功")
        this.CrudRend()
        done(row)
      }).catch(res=>{
        done(res)
      })
    Clonesubmit(row, done) {
      // 重新赋值CloneSelect传递的数据为输入框可以修改的数据,CloneModel提交表单输入框双向绑定数据
      Object.assign(this.CloneSelect[0], this.CloneModel);
      // CloneSelect数组第一项 匹配CloneModel对象
      copy(this.CloneSelect[0])
        .then(() => {
          // 因为是嵌套弹窗所以手动关闭CloneinnerVisible,CloneVisible两个弹窗。
          this.CloneinnerVisible = false;
          this.CloneVisible = false;
          this.$message.success("复制成功");
          this.TemRefresh();
          done(row);
        })
        .catch((error) => {
          done(error);
        });
    },
    //刷新
    TemRefresh() {