snapshot before 拆分组件“

This commit is contained in:
lb
2023-03-09 09:42:46 +08:00
parent 70b2dd6f33
commit 3709d3a29f
3 changed files with 111 additions and 92 deletions

View File

@@ -5,98 +5,91 @@
**/
-->
<template>
<div class="main-container">
<div class="inner-sidebar">
<a href="#ongoing" :class="{ active: activeTable === '#ongoing' }">进行中的订单</a>
<a href="#pending" :class="{ active: activeTable === '#pending' }">等待订单</a>
<a href="#finished" :class="{ active: activeTable === '#finished' }">完成订单</a>
</div>
<div class="list-view-with-head">
<section class="ongoing-order" id="ongoing">
<BaseSearchForm
head-title="进行中的订单"
:head-config="{ fields: headConfigs.ongoingTableSearch }"
@btn-click="handleBtnClick('ongoing', $event)"
/>
<BaseListTable
key="confirmed"
v-loading="tableLoadings.ongoing"
:table-config="null"
:column-config="tableConfigs.ongoingTable"
:table-data="dataLists.ongoing"
@operate-event="handleOperate('ongoing', $event)"
:refresh-layout-key="refreshLayoutKey"
/>
<div class="list-view-with-head">
<section class="ongoing-order" id="ongoing">
<BaseSearchForm
head-title="进行中的订单"
:head-config="{ fields: headConfigs.ongoingTableSearch }"
@btn-click="handleBtnClick('ongoing', $event)"
/>
<BaseListTable
key="confirmed"
v-loading="tableLoadings.ongoing"
:table-config="null"
:column-config="tableConfigs.ongoingTable"
:table-data="dataLists.ongoing"
@operate-event="handleOperate(type, $event)"
:refresh-layout-key="refreshLayoutKey"
/>
<el-pagination
class="mt-5 flex justify-end"
@size-change="handleSizeChange('ongoing', $event)"
@current-change="handlePageChange('ongoing', $event)"
:current-page.sync="conditions.ongoing.page"
:page-sizes="[1, 5, 10, 20]"
:page-size="conditions.ongoing.limit"
:total="totalPage.ongoing"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</section>
<el-pagination
class="mt-5 flex justify-end"
@size-change="handleSizeChange('ongoing', $event)"
@current-change="handlePageChange('ongoing', $event)"
:current-page.sync="conditions.ongoing.page"
:page-sizes="[1, 5, 10, 20]"
:page-size="conditions.ongoing.limit"
:total="totalPage.ongoing"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</section>
<section class="pending-order" id="pending">
<BaseSearchForm
head-title="等待中的订单"
:head-config="{ fields: headConfigs.pendingTableSearch }"
@btn-click="handleBtnClick('pending', $event)"
/>
<BaseListTable
key="unconfirmed"
v-loading="tableLoadings.pending"
:table-config="null"
:column-config="tableConfigs.pendingTable"
:table-data="dataLists.pending"
@operate-event="handleOperate(type, $event)"
:refresh-layout-key="refreshLayoutKey"
/>
<el-pagination
class="mt-5 flex justify-end"
@size-change="handleSizeChange('pending', $event)"
@current-change="handlePageChange('pending', $event)"
:current-page.sync="conditions.pending.page"
:page-sizes="[1, 5, 10, 20]"
:page-size="conditions.pending.limit"
:total="totalPage.pending"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</section>
<section class="pending-order" id="pending">
<BaseSearchForm
head-title="等待中的订单"
:head-config="{ fields: headConfigs.pendingTableSearch }"
@btn-click="handleBtnClick('pending', $event)"
/>
<BaseListTable
key="unconfirmed"
v-loading="tableLoadings.pending"
:table-config="null"
:column-config="tableConfigs.pendingTable"
:table-data="dataLists.pending"
@operate-event="handleOperate(type, $event)"
:refresh-layout-key="refreshLayoutKey"
/>
<el-pagination
class="mt-5 flex justify-end"
@size-change="handleSizeChange('pending', $event)"
@current-change="handlePageChange('pending', $event)"
:current-page.sync="conditions.pending.page"
:page-sizes="[1, 5, 10, 20]"
:page-size="conditions.pending.limit"
:total="totalPage.pending"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</section>
<section class="finished-order" id="finished">
<BaseSearchForm
head-title="已完成订单"
:head-config="{ fields: headConfigs.finishedTableSearch }"
@btn-click="handleBtnClick('finished', $event)"
/>
<BaseListTable
key="ended"
v-loading="tableLoadings.finished"
:table-config="null"
:column-config="tableConfigs.finishedTable"
:table-data="dataLists.finished"
@operate-event="handleOperate(type, $event)"
:refresh-layout-key="refreshLayoutKey"
/>
<section class="finished-order" id="finished">
<BaseSearchForm
head-title="已完成订单"
:head-config="{ fields: headConfigs.finishedTableSearch }"
@btn-click="handleBtnClick('finished', $event)"
/>
<BaseListTable
key="ended"
v-loading="tableLoadings.finished"
:table-config="null"
:column-config="tableConfigs.finishedTable"
:table-data="dataLists.finished"
@operate-event="handleOperate(type, $event)"
:refresh-layout-key="refreshLayoutKey"
/>
<el-pagination
class="mt-5 flex justify-end"
@size-change="handleSizeChange('finished', $event)"
@current-change="handlePageChange('finished', $event)"
:current-page.sync="conditions.finished.page"
:page-sizes="[1, 5, 10, 20]"
:page-size="conditions.finished.limit"
:total="totalPage.finished"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</section>
<el-pagination
class="mt-5 flex justify-end"
@size-change="handleSizeChange('finished', $event)"
@current-change="handlePageChange('finished', $event)"
:current-page.sync="conditions.finished.page"
:page-sizes="[1, 5, 10, 20]"
:page-size="conditions.finished.limit"
:total="totalPage.finished"
layout="total, sizes, prev, pager, next, jumper"
></el-pagination>
</section>
<!-- <DialogWithMenu
<!-- <DialogWithMenu
ref="edit-dialog"
v-if="dialogType === DIALOG_WITH_MENU"
:dialog-visible.sync="dialogVisible"
@@ -110,7 +103,6 @@
:configs="subdialogConfigs"
@refreshDataList="handleRefreshDatalist"
/> -->
</div>
</div>
</template>
@@ -119,6 +111,7 @@ import BaseListTable from "./BaseListTable.vue";
import BaseSearchForm from "./BaseSearchForm.vue";
import DialogWithMenu from "@/components/DialogWithMenu.vue";
import DialogJustForm from "./DialogJustForm.vue";
import moment from "moment";
const DIALOG_WITH_MENU = "DialogWithMenu";
const DIALOG_JUST_FORM = "DialogJustForm";
@@ -447,6 +440,22 @@ export default {
handleBtnClick(type, { btnName, payload }) {
switch (type) {
case "ongoing": {
if (btnName === "查询") {
let params = Object.assign({}, payload);
if ("timerange" in payload) {
// 处理时间段
if (!!payload.timerange) {
const [startTime, endTime] = payload["timerange"];
params.startTime = moment(startTime).format("YYYY-MM-DDTHH:mm:ss");
params.endTime = moment(endTime).format("YYYY-MM-DDTHH:mm:ss");
}
delete params.timerange;
}
console.log("[search form btn click]", Object.assign({}, this.conditions.ongoing, params));
// 发起请求
this.getSpecificList("ongoing", Object.assign({}, this.conditions.ongoing, params));
}
}
case "pending":
break;