Compare commits

..

2 Commits

Author SHA1 Message Date
Baghi330
f88deee0c3 conflictSelected 2026-02-14 11:16:55 +03:30
Baghi330
d3873be2b5 bug 2026-02-14 11:04:51 +03:30
4 changed files with 33 additions and 24 deletions

View File

@ -15,7 +15,7 @@
</template> </template>
<script setup> <script setup>
import sampelDataDb from "@/json/data-entry/sampelDataDb.json"; import myContentJson from "@/json/data-entry/myContentJson.json";
import refineCodes from "@/json/refineCodes.json"; import refineCodes from "@/json/refineCodes.json";
import MyContent from "@/components/lazy-load/global/MyContent.vue"; import MyContent from "@/components/lazy-load/global/MyContent.vue";
const { $http: httpService } = useNuxtApp(); const { $http: httpService } = useNuxtApp();
@ -25,19 +25,25 @@ const props = defineProps({
default: () => [], default: () => [],
}, },
}); });
const emit = defineEmits(["conflict-details"]);
const pagination = ref({ const pagination = ref({
total: 0, total: 0,
page: 1, page: 1,
limit: 10, limit: 10,
}); });
let myContentSchema = {}; const myContentSchema = computed(() => {
myContentSchema = ref(JSON.parse(JSON.stringify(sampelDataDb))); const baseSchema = JSON.parse(JSON.stringify(myContentJson));
myContentSchema.value.items = props.listConflicts.hits.hits;
myContentSchema.value.pagination = { return {
total: props.listConflicts.hits.total.value, ...baseSchema,
items: props.listConflicts?.hits ?? [],
pagination: {
total: props.listConflicts?.total?.value ?? 0,
page: pagination.value.page, page: pagination.value.page,
limit: pagination.value.limit, limit: pagination.value.limit,
},
}; };
});
const headerTools = computed(() => [ const headerTools = computed(() => [
{ {
items: [ items: [
@ -72,8 +78,10 @@ function headerToolsAction({ action, data }) {
if (action === "next-click") { if (action === "next-click") {
} }
} }
function myContentAction({ action, data }) { function myContentAction({ action, payload }) {
console.log(action, data); if (action === "conflict_Details") {
emit("conflict-details", payload);
}
} }
</script> </script>

View File

@ -11,6 +11,10 @@ const props = defineProps({
type: Array, type: Array,
default: () => [], default: () => [],
}, },
conflictSelected: {
type: Object,
default: () => {},
},
}); });
const accordionItems = [ const accordionItems = [
{ {

View File

@ -2,20 +2,9 @@
"items": [], "items": [],
"tableActions": [ "tableActions": [
{ {
"key": "meta_infos", "key": "conflict_Details",
"icon": "i-lucide-info", "icon": "i-lucide-info",
"title": "ورود اطلاعات" "title": "ورود اطلاعات"
},
{
"key": "manageFiles",
"icon": "i-lucide-upload",
"title": "بارگذاری فایل"
},
{
"key": "hasMedia",
"icon": "lucide:list-checks",
"title": ""
} }
], ],
"tableColumns": [ "tableColumns": [

View File

@ -14,6 +14,8 @@
v-if="currentComponent" v-if="currentComponent"
:activeTabKey="activeTabKey" :activeTabKey="activeTabKey"
:listConflicts="listConflicts" :listConflicts="listConflicts"
:conflictSelected="conflictSelected"
@conflict-details="conflictDetails"
/> />
</div> </div>
</template> </template>
@ -78,6 +80,7 @@ const handleTabChange = (tab) => {
} }
}; };
const headerSchema = ref({}); const headerSchema = ref({});
const conflictSelected = ref({});
headerSchema.value = { headerSchema.value = {
breadcrumb: true, breadcrumb: true,
logo: false, logo: false,
@ -127,11 +130,16 @@ const getListConflict = async (textSearch = "", filterExtended = "") => {
); );
console.log("res", res); console.log("res", res);
listConflicts.value = res; listConflicts.value = res.hits;
} catch (err) { } catch (err) {
console.error("خطا در دریافت داده:", err); console.error("خطا در دریافت داده:", err);
} }
}; };
function conflictDetails(event) {
conflictSelected.value = event;
activeTabKey.value = "RelationEdit";
console.log("event", event);
}
onMounted(() => { onMounted(() => {
getListConflict(); getListConflict();
activeTabKey.value = headerTabs.value[0]?.id || ""; activeTabKey.value = headerTabs.value[0]?.id || "";