refactor: set page Size
This commit is contained in:
parent
7cb55879f8
commit
829a5d8221
2 changed files with 13 additions and 4 deletions
|
|
@ -213,8 +213,10 @@ function openEmployerBranchForm(formType: 'create' | 'edit' | 'info') {
|
|||
customerBranchFormState.value.dialogModal = true;
|
||||
}
|
||||
|
||||
async function fetchEmployee(branchId: string) {
|
||||
const res = await fetchBranchEmployee(branchId);
|
||||
async function fetchEmployee(opts: { branchId: string; pageSize?: number }) {
|
||||
const res = await fetchBranchEmployee(opts.branchId, {
|
||||
pageSize: opts.pageSize,
|
||||
});
|
||||
|
||||
if (res) {
|
||||
listEmployee.value = res.data.result;
|
||||
|
|
@ -232,7 +234,10 @@ watch(
|
|||
() => statusEmployeeCreate.value,
|
||||
async () => {
|
||||
if (statusEmployeeCreate.value) {
|
||||
await fetchEmployee(currentBranchEmployee.value);
|
||||
await fetchEmployee({
|
||||
branchId: currentBranchEmployee.value,
|
||||
pageSize: 999,
|
||||
});
|
||||
|
||||
const br = branch.value?.find(
|
||||
(v) => v.id === currentBranchEmployee.value,
|
||||
|
|
@ -512,7 +517,10 @@ watch(
|
|||
@click.stop="
|
||||
async () => {
|
||||
currentBranchEmployee = props.row.id;
|
||||
await fetchEmployee(currentBranchEmployee);
|
||||
await fetchEmployee({
|
||||
branchId: currentBranchEmployee,
|
||||
pageSize: 999,
|
||||
});
|
||||
|
||||
currentBtnOpen.map((v, i) => {
|
||||
if (i !== props.rowIndex) {
|
||||
|
|
|
|||
|
|
@ -1346,6 +1346,7 @@ const emptyCreateDialog = ref(false);
|
|||
async () => {
|
||||
const res = await employeeStore.fetchList({
|
||||
customerId: props.row.id,
|
||||
pageSize: 999,
|
||||
});
|
||||
|
||||
if (res) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue