|
|
@@ -4,51 +4,20 @@ |
|
|
|
<!-- <head-form :form-config="headFormConfig" @headBtnClick="btnClick" /> --> |
|
|
|
<BaseSearchForm :head-config="headConfig" @btn-click="handleBtnClick" /> |
|
|
|
|
|
|
|
<BaseListTable |
|
|
|
v-loading="tableLoading" |
|
|
|
:table-config="tableConfig.table" |
|
|
|
:column-config="tableConfig.column" |
|
|
|
:table-data="dataList" |
|
|
|
@operate-event="handleOperate" |
|
|
|
:current-page="page" |
|
|
|
:current-size="size" |
|
|
|
:refresh-layout-key="refreshLayoutKey" |
|
|
|
/> |
|
|
|
<BaseListTable v-loading="tableLoading" :table-config="tableConfig.table" :column-config="tableConfig.column" |
|
|
|
:table-data="dataList" @operate-event="handleOperate" :current-page="page" :current-size="size" |
|
|
|
:refresh-layout-key="refreshLayoutKey" /> |
|
|
|
|
|
|
|
<el-pagination |
|
|
|
class="mt-5 flex justify-end" |
|
|
|
@size-change="handleSizeChange" |
|
|
|
@current-change="handlePageChange" |
|
|
|
:current-page.sync="page" |
|
|
|
:page-sizes="[20, 50, 100]" |
|
|
|
:page-size="size" |
|
|
|
:total="totalPage" |
|
|
|
layout="total, sizes, prev, pager, next, jumper" |
|
|
|
></el-pagination> |
|
|
|
<!-- :current-page.sync="currentPage" |
|
|
|
:page-size.sync="pageSize" --> |
|
|
|
<el-pagination class="mt-5 flex justify-end" @size-change="handleSizeChange" @current-change="handlePageChange" |
|
|
|
:current-page.sync="page" :page-sizes="[20, 50, 100]" :page-size="size" :total="totalPage" |
|
|
|
layout="total, sizes, prev, pager, next, jumper"></el-pagination> |
|
|
|
|
|
|
|
<DialogWithMenu |
|
|
|
ref="edit-dialog" |
|
|
|
v-if="!!dialogConfigs && dialogType === DIALOG_WITH_MENU" |
|
|
|
:dialog-visible.sync="dialogVisible" |
|
|
|
:configs="dialogConfigs" |
|
|
|
@refreshDataList="getList" |
|
|
|
/> |
|
|
|
<DialogJustForm |
|
|
|
ref="edit-dialog" |
|
|
|
v-if="!!dialogConfigs && dialogType === DIALOG_JUST_FORM" |
|
|
|
:dialog-visible.sync="dialogVisible" |
|
|
|
:configs="dialogConfigs" |
|
|
|
@refreshDataList="getList" |
|
|
|
/> |
|
|
|
<DialogCarPayload |
|
|
|
ref="car-payload-dialog" |
|
|
|
v-if="!!carPayloadDialogConfigs" |
|
|
|
:dialog-visible.sync="carPayloadDialogVisible" |
|
|
|
:configs="carPayloadDialogConfigs" |
|
|
|
@refreshDataList="getList" |
|
|
|
/> |
|
|
|
<DialogWithMenu ref="edit-dialog" v-if="!!dialogConfigs && dialogType === DIALOG_WITH_MENU" |
|
|
|
:dialog-visible.sync="dialogVisible" :configs="dialogConfigs" @refreshDataList="getList" /> |
|
|
|
<DialogJustForm ref="edit-dialog" v-if="!!dialogConfigs && dialogType === DIALOG_JUST_FORM" |
|
|
|
:dialog-visible.sync="dialogVisible" :configs="dialogConfigs" @refreshDataList="getList" /> |
|
|
|
<DialogCarPayload ref="car-payload-dialog" v-if="!!carPayloadDialogConfigs" |
|
|
|
:dialog-visible.sync="carPayloadDialogVisible" :configs="carPayloadDialogConfigs" @refreshDataList="getList" /> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
@@ -137,6 +106,7 @@ export default { |
|
|
|
dataList: [], |
|
|
|
tableLoading: false, |
|
|
|
refreshLayoutKey: null, |
|
|
|
cachedSearchCondition: {} |
|
|
|
}; |
|
|
|
}, |
|
|
|
inject: ["urls"], |
|
|
@@ -151,9 +121,9 @@ export default { |
|
|
|
const params = queryParams |
|
|
|
? { ...queryParams, page: this.page, limit: this.size } |
|
|
|
: { |
|
|
|
page: this.page, |
|
|
|
limit: this.size, |
|
|
|
}; |
|
|
|
page: this.page, |
|
|
|
limit: this.size, |
|
|
|
}; |
|
|
|
|
|
|
|
if (!queryParams && this.listQueryExtra && this.listQueryExtra.length) { |
|
|
|
this.listQueryExtra.map((nameOrObj) => { |
|
|
@@ -173,11 +143,11 @@ export default { |
|
|
|
this.urls.page, |
|
|
|
this.urls.pageIsPostApi |
|
|
|
? { |
|
|
|
...params, |
|
|
|
} |
|
|
|
...params, |
|
|
|
} |
|
|
|
: { |
|
|
|
params, |
|
|
|
} |
|
|
|
params, |
|
|
|
} |
|
|
|
) |
|
|
|
.then(({ data: res }) => { |
|
|
|
console.log("[http response] res is: ", res); |
|
|
@@ -273,7 +243,7 @@ export default { |
|
|
|
} |
|
|
|
}); |
|
|
|
}) |
|
|
|
.catch((err) => {}); |
|
|
|
.catch((err) => { }); |
|
|
|
} |
|
|
|
case "edit": { |
|
|
|
this.openDialog(data); /** data is ==> id */ |
|
|
@@ -460,17 +430,19 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
case "查询": { |
|
|
|
const params = {}; |
|
|
|
if (typeof payload === "object") { |
|
|
|
// BaseSearchForm 给这个组件传递了数据 |
|
|
|
Object.assign(params, payload); |
|
|
|
if ("timerange" in params) { |
|
|
|
if (!!params.timerange) { |
|
|
|
const [startTime, endTime] = params["timerange"]; |
|
|
|
params.startTime = moment(startTime).format("YYYY-MM-DDTHH:mm:ss"); |
|
|
|
params.endTime = moment(endTime).format("YYYY-MM-DDTHH:mm:ss"); |
|
|
|
Object.assign(this.cachedSearchCondition, payload); |
|
|
|
if ("timerange" in payload) { |
|
|
|
if (!!payload.timerange) { |
|
|
|
const [startTime, endTime] = payload["timerange"]; |
|
|
|
this.cachedSearchCondition.startTime = moment(startTime).format("YYYY-MM-DDTHH:mm:ss"); |
|
|
|
this.cachedSearchCondition.endTime = moment(endTime).format("YYYY-MM-DDTHH:mm:ss"); |
|
|
|
} else { |
|
|
|
delete this.cachedSearchCondition.startTime; |
|
|
|
delete this.cachedSearchCondition.endTime; |
|
|
|
} |
|
|
|
delete params.timerange; |
|
|
|
delete this.cachedSearchCondition.timerange; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -478,18 +450,18 @@ export default { |
|
|
|
this.listQueryExtra?.map((cond) => { |
|
|
|
if (typeof cond === "string") { |
|
|
|
if (!!payload[cond]) { |
|
|
|
params[cond] = payload[cond]; |
|
|
|
this.cachedSearchCondition[cond] = payload[cond]; |
|
|
|
} else { |
|
|
|
params[cond] = ""; |
|
|
|
this.cachedSearchCondition[cond] = ""; |
|
|
|
} |
|
|
|
} else if (typeof cond === "object") { |
|
|
|
Object.keys(cond).forEach((key) => { |
|
|
|
params[key] = cond[key]; |
|
|
|
this.cachedSearchCondition[key] = cond[key]; |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
console.log("查询", params); |
|
|
|
this.getList(params); |
|
|
|
console.log("查询", this.cachedSearchCondition); |
|
|
|
this.getList(this.cachedSearchCondition); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
@@ -508,12 +480,12 @@ export default { |
|
|
|
// val 是新值 |
|
|
|
this.page = 1; |
|
|
|
this.size = val; |
|
|
|
this.getList(); |
|
|
|
this.getList(this.cachedSearchCondition); |
|
|
|
}, |
|
|
|
|
|
|
|
handlePageChange(val) { |
|
|
|
// val 是新值 |
|
|
|
this.getList(); |
|
|
|
this.getList(this.cachedSearchCondition); |
|
|
|
}, |
|
|
|
|
|
|
|
/** 打开对话框 */ |
|
|
|