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;
        }
      });
    },
相关推荐
aidou13145 天前
Android中自定义日期选择器样式DatePickerDialog
android·dialog·日期选择器·时间选择器·datepicker·自定义样式·timepicker
极客先躯18 天前
基于 EasyUI 和 jQuery 封装的企业级日期时间选择器组件库,采用标准的 jQuery 插件开发规范,实现了高度模块化和可复用的 UI 组件
ui·jquery·日期选择器·时间选择器·easyui
Sheldon一蓑烟雨任平生3 个月前
Vue3 组件库 Element Plus
vue.js·vue3·element plus·element ui·vue3 常用组件库
weixin_422201308 个月前
element的el-table翻页选中功能
el-table·翻页·element ui·选中·复选框
weixin_422201309 个月前
element ui el-col的高度不一致导致换行
布局·高度·element ui·换行·el-col
cxsj9991 年前
elementui的默认样式修改
vue.js·vue·消息提示·element ui·自定义样式·默认样式更改
前端熊猫1 年前
Vue el-data-picker选中开始时间,结束时间自动加半小时
vue3·element plus·el-data-picker