Merge remote-tracking branch 'origin/shadi/conflict' into Baghi/conflict
This commit is contained in:
commit
27c0470e16
|
|
@ -24,24 +24,20 @@ const props = defineProps({
|
|||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
pagination: {
|
||||
type: Object,
|
||||
default: () => {},
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(["conflict-details"]);
|
||||
const pagination = ref({
|
||||
total: 0,
|
||||
page: 1,
|
||||
limit: 10,
|
||||
});
|
||||
|
||||
const myContentSchema = computed(() => {
|
||||
const baseSchema = JSON.parse(JSON.stringify(myContentJson));
|
||||
|
||||
return {
|
||||
...baseSchema,
|
||||
items: props.listConflicts?.hits ?? [],
|
||||
pagination: {
|
||||
total: props.listConflicts?.total?.value ?? 0,
|
||||
page: pagination.value.page,
|
||||
limit: pagination.value.limit,
|
||||
},
|
||||
pagination: props.pagination,
|
||||
};
|
||||
});
|
||||
const headerTools = computed(() => [
|
||||
|
|
@ -81,6 +77,8 @@ function headerToolsAction({ action, data }) {
|
|||
function myContentAction({ action, payload }) {
|
||||
if (action === "conflict_Details") {
|
||||
emit("conflict-details", payload);
|
||||
} else {
|
||||
emit("my-content-action", { action, payload });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -15,7 +15,9 @@
|
|||
:activeTabKey="activeTabKey"
|
||||
:listConflicts="listConflicts"
|
||||
:conflictSelected="conflictSelected"
|
||||
:pagination="pagination"
|
||||
@conflict-details="conflictDetails"
|
||||
@my-content-action="myContentAction"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -131,6 +133,12 @@ const getListConflict = async (textSearch = "", filterExtended = "") => {
|
|||
console.log("res", res);
|
||||
|
||||
listConflicts.value = res.hits;
|
||||
pagination.value.total = res.hits.total.value;
|
||||
// reactiveSampleData.value.pagination = {
|
||||
// total: res.hits.total.value,
|
||||
// page: pagination.value.page,
|
||||
// limit: pagination.value.limit,
|
||||
// };
|
||||
} catch (err) {
|
||||
console.error("خطا در دریافت داده:", err);
|
||||
}
|
||||
|
|
@ -144,4 +152,18 @@ onMounted(() => {
|
|||
getListConflict();
|
||||
activeTabKey.value = headerTabs.value[0]?.id || "";
|
||||
});
|
||||
|
||||
function myContentAction({ action, payload }) {
|
||||
console.log("payload ==> ", payload);
|
||||
console.log("action ==> ", action);
|
||||
if (action === "pagination") {
|
||||
const { page, limit } = payload;
|
||||
pagination.value.page = page;
|
||||
pagination.value.limit = limit;
|
||||
console.log("pagination.value ==> ", pagination.value);
|
||||
|
||||
getListConflict();
|
||||
return;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user