avue2.1.0 avue-crud 复制按钮怎样调用弹框

在avue2.1.0版本的vue项目中,由于复制按钮功能仅在2.6版本及以上提供,因此需要通过编辑按钮进行操作模拟复制。通过绑定ref并自定义handleIssueA方法,利用编辑按钮触发复制所需的操作,最终实现了类似复制的功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

avue2.1.0 avue-crud 怎样添加复制按钮

vue项目里的avue是2.1.0版本的,但是 复制按钮 是2.6版本才有的. 所以呢, 项目里用不了,只能利用编辑按钮来进行操作

新的改变

这是vue项目里的avue-crud ,绑定了ref

<avue-crud :page="page" @size-change="onSizeChange" @current-change="onCurrentChange" 
    v-model="form" :data="data" ref="crud"
     @refresh-change="refreshData" 
     @row-save="onSave" 
     @row-update="onUpdate" 
     @row-del="onDel" 
     :option="option">
      <template slot-scope="scope" slot="userNameForm">
        <userData @onChangeUser="onChangeUser" :form="form" :props=" { value:'userName' } " :params="{}" />
      </template>
      <template slot-scope="scope" slot="menu">
        <el-button type="primary"
                     icon="el-icon-check"
                     size="small"
                     plain
                     @click.stop="handleDesign(scope.row,scope.index)">设计</el-button>
      </template>
      <template slot-scope="scope" slot="menuBtn">
        <el-dropdown-item divided @click.native="handleIssue(scope.row)">发布</el-dropdown-item>
        <el-dropdown-item divided @click.native="handleIssueA(scope.row,scope.index)">复制</el-dropdown-item>
      </template>
    </avue-crud> 

重点看handleIssueA方法, 这里要调用绑定的实例, 利用编辑按钮做跳板

 //复制
      handleIssueA(row, index){
        console.log(row,index)
        this.$set(row, 'copy', true)
        this.$refs.crud.rowEdit(row, index)
      },
      //编辑数据后确定触发该事件
    onUpdate(row, index, done, loading){
      console.log('done',done)
      this.saveData('update',row, done, loading)
    },
    saveData(type,row, done, loading){
      let api=""
      let para = {}
      if(row.copy) {
        type = 'update'
      }
      if(type==='add'){
        api="review/lpaReviewPlanTemplate/add"
        para = {
          name:row.name,
          reviewTypePid:this.bigTypeId,//大类id
          fullOrgCode:this.fullOrgCode,//组织代码拼接
          reviewTypeCid:this.auditTypeId,
          currentPage: this.page.currentPage,
          pageSize: this.page.pageSize,
          orgCode:this.departmentName,
        }
        console.log('this.auditTypeId',this.auditTypeId)
        console.log('this.departmentName',this.departmentName)
        console.log('this.page',this.page)
        this.sy.request(api,para,res=>{
          done()
          this.$message.success('新增成功!')
          this.getTableData()
        },err=>{
          loading()
        })
        this.$set(row,'name',row.name)
      }else if(type == 'update'){
        if(row.copy) {
          api="review/lpaReviewPlanTemplate/copy"   
          console.log('row',row)
          this.sy.request(api,row,res=>{
            done()
            this.$message.success('复制成功!')
            this.getTableData()
          },err=>{
            loading()
          })
          // this.$set(row,'name',row.name)
          this.getTableData();
        }else{
          api="review/lpaReviewPlanTemplate/update"
          console.log('row',row)
          this.sy.request(api,row,res=>{
            done()
            this.$message.success('保存成功!')
            this.getTableData()
          },err=>{
            loading()
          })
          // this.$set(row,'name',row.name)
          this.getTableData();
        }
      }else{
        api="review/reviewPlanFounder/update"
        this.sy.request(api,para,res=>{
          done()
          this.$message.success('修改成功!')
          this.getTableData()
        },err=>{
          loading()
        })
        this.getTableData();
      }
    },

最后效果:
在这里插入图片描述

apache-atlas-2.1.0-hive-hook.tar.gz是Apache Atlas项目中的一个软件包。Apache Atlas是一个开源的数据治理和元数据架,用于收集、集成、索引和搜索数据资产。它提供了一个统一的视图来管理企业中的所有数据资产,包括表、列、模式、实体和关系等。而apache-atlas-2.1.0-hive-hook.tar.gz是Atlas项目为了与Hive集成而提供的一个插件。 Hive是一个构建在Hadoop之上的数据仓库基础设施工具,用于处理大规模的结构化数据。它提供了类似于SQL的查询和分析功能,可以将数据批量导入、导出和查询。通过与Apache Atlas的集成,可以实现对Hive中数据资产的元数据管理和治理。 在实际的应用中,apache-atlas-2.1.0-hive-hook.tar.gz可以被部署到Hive的服务器上,并与Hive的插件机制进行集成。通过配置Hive的元数据存储URL、用户名和密码等信息,Atlas可以自动从Hive中提取元数据,并将其索引到Atlas的元数据仓库中。这样,用户可以在Atlas的界面中浏览和搜索Hive中的表、列和关系,并进行数据资产的管理和治理。 此外,apache-atlas-2.1.0-hive-hook.tar.gz还提供了一些其他功能,如基于分类标签的权限控制、数据血缘追踪、数据脱敏等。通过这些功能,用户可以更好地理解和管理Hive中的数据资产,提高数据治理的效率和质量。 总之,apache-atlas-2.1.0-hive-hook.tar.gz是Apache Atlas项目中用于与Hive集成的插件,通过它可以实现对Hive中数据资产的元数据管理和数据治理。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值