featMultiple(AppStoreBoardFilter): 添加一键归位功能

- 在组件中添加 reset 方法,用于重置多店看板的位置
- 在模板中添加一键归位按钮,点击时调用 reset 方法
- 优化了组件初始化时的数据加载逻辑
This commit is contained in:
aixianling
2025-01-07 16:08:35 +08:00
parent 4403ec5322
commit c2743d926e

View File

@@ -24,6 +24,13 @@ export default {
}
})
},
reset() {
$http.post("/data-boot/la/screen/multipleStoreBoard/move").then(res => {
if (res?.data) {
this.$message.success("已重置")
}
})
}
},
watch: {
'form.interval'(v) {
@@ -40,7 +47,7 @@ export default {
this.getOptions().then(() => {
setTimeout(() => {
const {dayjs} = window
const hourNum = new Date().getHours()+1, groupCodeList = "", interval = 60000
const hourNum = new Date().getHours() + 1, groupCodeList = "", interval = 60000
const currentDate = dayjs().subtract(7, 'day').format("YYYYMMDD")
this.form = {hourNum, groupCodeList, type: "1", changeWay: "1", currentDate, interval}
this.$set(this.$multipleStoreBoard, 'search', {hourNum, groupCodeList: [], type: "1", changeWay: "1", categoryId: "", currentDate, interval})
@@ -52,6 +59,9 @@ export default {
<template>
<el-form class="AppMultipleStoreBoardFilter flex" size="small" label-width="70px">
<el-form-item label-width="0">
<el-button @click="reset">一键归位</el-button>
</el-form-item>
<el-form-item label="品类">
<el-select v-model="form.categoryId" @change="v=>$multipleStoreBoard.search.categoryId=v" clearable placeholder="全部">
<el-option v-for="item in dicts.品类" :key="item.value" :label="item.label" :value="item.value"/>