element ui设置结束时间为23:59:59

开始时间为00:00:00结束时间为23:59:59

在请求接口前,用substring取结束时间的年月日,并替换时间值即可

bash 复制代码
<el-form
          ref="searchForm"
          :model="searchForm"
          :inline="true"
          size="mini"
          @keyup.enter.native="getDataList()"
        >
                    <el-form-item label="创建时间" prop="timeArray">
              <el-date-picker
                v-model="searchForm.timeArray"
                type="daterange"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                value-format="yyyy-MM-dd HH:mm:ss"
                size="small"
              >
              </el-date-picker>
            </el-form-item>
</el-form>
        timeArray: [],

  // 获取数据列表
    getDataList() {
      this.dataListLoading = true;

  //设置结束时间为23:59:59
      if (this.searchForm.timeArray != null) {
        if (
          this.searchForm.timeArray.length === 2 &&
          this.searchForm.timeArray[1] !== ""
        ) {
          this.searchForm.timeArray[1] =
            this.searchForm.timeArray[1].substring(0, 10) + " 23:59:59";
        }
      }

      this.dataListLiveness = [];

      fetchList(this.searchForm).then((response) => {
        this.dataList = response.data.data.records;
        this.totalPage = response.data.data.total;

        console.log(
          "this.permissions.training_orgliveness_view:",
          this.permissions.training_orgliveness_view
        );
        console.log("response:", response);

        if (response.headers.check) {
          this.isNeedSlide = true;
        }

        if (this.permissions.training_orgliveness_view) {
          //获取活跃度
          let orgIds = [];
          for (var i in this.dataList) {
            if (this.dataList[i].hasSubsidy == 1) {
              orgIds.push("trainorg#" + this.dataList[i].trainorgId);
            } else {
              orgIds.push("trainorg@nosub#" + this.dataList[i].trainorgId);
            }
          }

          if (this.dataList.length > 0) {
            this.getLivenessData(orgIds);
          } else {
            this.dataListLoading = false;
          }
        } else {
          this.dataListLoading = false;
        }
      });
    },
相关推荐
cxsj9993 个月前
elementui的默认样式修改
vue.js·vue·消息提示·element ui·自定义样式·默认样式更改
前端熊猫3 个月前
Vue el-data-picker选中开始时间,结束时间自动加半小时
vue3·element plus·el-data-picker
赢乐4 个月前
使用Element UI实现前端分页,前端搜索,及el-table表格跨页选择数据,切换分页保留分页数据,限制多选数量
前端分页·element ui·跨页选择·el-table表格·限制多选数量·切换分页保留数据·前端搜索过滤
€键盘人生8 个月前
跟我一起学习和开发动态表单系统-前端用vue、elementui实现方法(3)
java·vue·mvc·mybatis·web·动态表单·element ui·srping boot
码农研究僧9 个月前
Uni-App中的u-datetime-picker时间选择器Demo
uni-app·时间选择器·js
赢乐10 个月前
Vue开发中Element UI/Plus使用指南:常见问题(如Missing required prop: “value“)及中文全局组件配置解决方案
el-table·v-model·element ui·required prop·type=index·不显示序号·配置中文
天外天-亮1 年前
element + table 行列合并
javascript·element plus·element ui
丰的传说1 年前
element ui el-avatar 源码解析零基础逐行解析
ui·element ui·elementui 源码