feat:充值流水分页

This commit is contained in:
dzc committed 2025-01-21 09:11:25 +08:00
1 parent dd6082e521
commit bb0317fbc8
3 files changed
+70 -41

No files matched your search

+50 -39
View File
@@ -4,25 +4,36 @@
<el-row shadow="hover" v-show="showSearch" class="ml10">
<el-form :model="state.queryForm" ref="queryRef" :inline="true" @keyup.enter="filter">
<el-form-item prop="deptName" :label="$t('sysdept.name')">
<el-input :placeholder="$t('sysdept.inputdeptNameTip')" style="max-width: 180px" v-model="state.queryForm.deptName"></el-input>
<el-input
:placeholder="$t('sysdept.inputdeptNameTip')"
style="max-width: 180px"
v-model="state.queryForm.deptName"
></el-input>
</el-form-item>
<el-form-item>
<el-button icon="search" type="primary" @click="filter">
{{ $t('common.queryBtn') }}
{{ $t("common.queryBtn") }}
</el-button>
<el-button @click="resetQuery" icon="Refresh">{{ $t('common.resetBtn') }}</el-button>
<el-button @click="resetQuery" icon="Refresh">{{ $t("common.resetBtn") }}</el-button>
</el-form-item>
</el-form>
</el-row>
<el-row>
<div class="mb8" style="width: 100%">
<el-button icon="folder-add" type="primary" class="top-right-btn" v-if="!defaultTreeViewRef" v-auth="'sys_dept_add'" @click="handleAdd">
{{ $t('common.addBtn') }}
<el-button
icon="folder-add"
type="primary"
class="top-right-btn"
v-if="!defaultTreeViewRef"
v-auth="'sys_dept_add'"
@click="handleAdd"
>
{{ $t("common.addBtn") }}
</el-button>
<el-button plain icon="upload-filled" type="primary" class="ml10" @click="excelUploadRef.show()">
{{ $t('common.importBtn') }}
{{ $t("common.importBtn") }}
</el-button>
<el-button @click="handleExpand"> {{ $t('common.expandBtn') }}</el-button>
<el-button @click="handleExpand"> {{ $t("common.expandBtn") }}</el-button>
<right-toolbar
v-model:showSearch="showSearch"
:export="'sys_dept_add'"
@@ -53,78 +64,78 @@
</template>
<script lang="ts" name="systemDept" setup>
import { downBlobFile } from '/@/utils/other';
import { useI18n } from 'vue-i18n';
import { downBlobFile } from "/@/utils/other"
import { useI18n } from "vue-i18n"
const TreeView = defineAsyncComponent(() => import('./tree-view.vue'));
const TableView = defineAsyncComponent(() => import('./table-view.vue'));
const TreeView = defineAsyncComponent(() => import("./tree-view.vue"))
const TableView = defineAsyncComponent(() => import("./table-view.vue"))
const { t } = useI18n();
const { t } = useI18n()
// 默认树视图展示
const defaultTreeViewRef = ref(true);
const treeViewRef = ref();
const tableViewRef = ref();
const excelUploadRef = ref();
const showSearch = ref(true);
const isExpand = ref(false);
const queryRef = ref();
const defaultTreeViewRef = ref(true)
const treeViewRef = ref()
const tableViewRef = ref()
const excelUploadRef = ref()
const showSearch = ref(true)
const isExpand = ref(false)
const queryRef = ref()
const state = reactive({
queryForm: {
deptName: '',
deptName: "",
},
});
})
/**
* 过滤节点
*/
const filter = () => {
if (defaultTreeViewRef.value) {
treeViewRef.value.filter(state.queryForm.deptName);
treeViewRef.value.filter(state.queryForm.deptName)
} else {
tableViewRef.value.state.queryForm.deptName = state.queryForm.deptName;
tableViewRef.value.getDataList();
tableViewRef.value.state.queryForm.deptName = state.queryForm.deptName
tableViewRef.value.getDataList()
}
};
}
const handleAdd = () => {
tableViewRef.value.handleAdd();
};
tableViewRef.value.handleAdd()
}
const handleView = () => {
defaultTreeViewRef.value = !defaultTreeViewRef.value;
};
defaultTreeViewRef.value = !defaultTreeViewRef.value
}
/**
* 处理展开/折叠树
*/
const handleExpand = () => {
if (defaultTreeViewRef.value) {
treeViewRef.value.handleExpand();
treeViewRef.value.handleExpand()
} else {
tableViewRef.value.handleExpand();
tableViewRef.value.handleExpand()
}
};
}
/**
* 导出Excel
*/
const exportExcel = () => {
downBlobFile('/admin/dept/export', state.queryForm, 'dept.xlsx');
};
downBlobFile("/admin/dept/export", state.queryForm, "dept.xlsx")
}
const getDataList = () => {
if (defaultTreeViewRef.value) {
treeViewRef.value.getOrgData();
treeViewRef.value.getOrgData()
} else {
tableViewRef.value.getDataList();
tableViewRef.value.getDataList()
}
};
}
/**
* 重置查询条件
*/
const resetQuery = () => {
queryRef.value.resetFields();
};
queryRef.value.resetFields()
}
</script>
+16 -1
View File
@@ -139,6 +139,7 @@ const menuDialogRef = ref()
const showSearch = ref(true)
const queryRef = ref()
const state: BasicTableProps = reactive<BasicTableProps>({
createdIsNeed: false,
pageList: pageList, // H
queryForm: {
parentId: -1,
@@ -149,6 +150,10 @@ const state: BasicTableProps = reactive<BasicTableProps>({
const { getDataList, tableStyle } = useTable(state)
onMounted(async () => {
getDataList()
})
// 根据类型判断是否有子节点
const setHasChildren = (arr: any[]) => {
arr.forEach((item) => {
@@ -201,7 +206,9 @@ const load = (row: any, treeNode: unknown, resolve: (date: any[]) => void) => {
if (Array.isArray(childrenList)) {
setHasChildren(childrenList)
}
resolve(childrenList)
if (childrenList && childrenList.length) {
resolve(childrenList)
}
})
}
@@ -222,3 +229,11 @@ const handleDelete = async (row: any) => {
}
}
</script>
<style lang="scss" scoped>
:deep() {
.el-table .row-expand-cover .cell .el-table__expand-icon {
display: none;
}
}
</style>
@@ -140,6 +140,9 @@ const multiple = ref(true)
// 表格变量
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pagination: {
pageSizes: [10, 20, 50, 100, 200, 500, 1000, 2000],
},
pageList: walletRechargeImportApi.pageJoin,
})
@@ -155,7 +158,7 @@ const handleDelete = async (ids: string[]) => {
return
}
try {
await walletRechargeApplyApi.delObjs(ids)
// await walletRechargeApplyApi.delObjs(ids)
getDataList()
useMessage().success("删除成功")
} catch (err: any) {