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