工作总结

<SearchItemLabel text="周期" />    代表每一个文本信息。

<SearchItemInput> : 标签代表每一个输入框, 或者每一个下拉框。

调用搜索的方法的时候:
1: this.$refs.divBar.style.display = "block";
把block 显示出来

<SearchButtons>: 代表按钮组:   <Button @click="reset">重置</Button> : 代表每一个按钮事件。

Select: 下拉框默认显示第一条数据: 在data 数据源中: searchModel: { top: "week" },  默认显示第一条数据。

<div id="xxxx" ref="divBar" style="width: 100%; height: 600px; margin-top: 0.3rem"></div>

拿到div 引用元素: 点击重置按钮: 把echarts 隐藏掉: 

1: this.$refs.divBar.style.display = "block";  // 把echarts 显示。
2: 当点击重置按钮的时候:把echarts 隐藏掉。

1: 导出按钮操作: <Button @click="exportData"> 导出</Button>

   exportData: function () {
      api
        .get(传递参数, { url: `xxxxxxxxxx` })
        .then((res) => {
          if (res && res.result == "1") {
            downLoadFile({ path: res.path, name: "导出操作" });
          } else if (res) {
            throw new Error(res.details);
          } else {
            throw new Error("导出失败,请稍后再试!");
          }
        })
        .catch((errData) => {
          this.$Modal.error({
            title: "错误",
            content: errData.message,
          });
        });
    },

在导出方法操作: 调用api 接口操作。  加上传递参数, 拼接上url 路径: 如果res 存在或者res.result == ‘1’; 调用下载方法:

downloadFile ({path: res.path, name: "导出数据"})

else if (res) { throw new Error (res.details)}  else { throw new Error:"导出失败, 请稍后重试"}

.catch 方法: 使用箭头函数: 使用弹框进行弹出   this.$Modal.error({

       title: "错误"     // 弹框标题

      content: errData.message,    // 弹框内容

 })

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值