conflict-nuxt-4/app/components/lazy-load/data-entry/MainList.vue
Baghi330 7892a7cefb 1
2026-02-14 10:41:53 +03:30

81 lines
1.9 KiB
Vue

<template>
<div>
<HeaderTools
:header-tools="headerTools"
@header-tools-action="headerToolsAction"
></HeaderTools>
<div class="p-4 pt-0 w-full lg:flex-1">
<MyContent
:mainSchema="myContentSchema"
:pagination="pagination"
@my-content-action="myContentAction"
/>
</div>
</div>
</template>
<script setup>
import sampelDataDb from "@/json/data-entry/sampelDataDb.json";
import refineCodes from "@/json/refineCodes.json";
import MyContent from "@/components/lazy-load/global/MyContent.vue";
const { $http: httpService } = useNuxtApp();
const props = defineProps({
listConflicts: {
type: Array,
default: () => [],
},
});
const pagination = ref({
total: 0,
page: 1,
limit: 10,
});
let myContentSchema = {};
myContentSchema = ref(JSON.parse(JSON.stringify(sampelDataDb)));
myContentSchema.value.items = props.listConflicts.hits.hits;
myContentSchema.value.pagination = {
total: props.listConflicts.hits.total.value,
page: pagination.value.page,
limit: pagination.value.limit,
};
const headerTools = computed(() => [
{
items: [
{
type: "dropdown",
key: "dropdown",
name: "refine_codes",
dropdownSchema: {
width: "18em",
modelValue: null, // ✅ اینو بذار
optionAttribute: "title",
valueAttribute: "value",
searchable: false,
placeholder: "انتخاب کنید",
items: refineCodes,
},
},
{
key: "prevNext",
name: "entityNavigator",
prevDisabled: false,
nextDisabled: true,
},
],
},
]);
function headerToolsAction({ action, data }) {
if (action === "prev-click") {
}
if (action === "next-click") {
}
}
function myContentAction({ action, data }) {
console.log(action, data);
}
</script>
<style lang="scss"></style>