开始时间为00:00:00结束时间为23:59:59
在请求接口前,用substring取结束时间的年月日,并替换时间值即可
<el-formref="searchForm":model="searchForm":inline="true"size="mini"@keyup.enter.native="getDataList()"><el-form-item label="创建时间" prop="timeArray"><el-date-pickerv-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:59if (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;}});},