Compare commits

...

6 Commits

Author SHA1 Message Date
Baghi330
7fd8cb9a65 11 2026-02-14 14:27:36 +03:30
Baghi330
32a2bb9e13 Merge remote-tracking branch 'origin/main' into Baghi/conflict 2026-02-14 14:13:05 +03:30
Baghi330
48926cd9d4 1 2026-02-14 14:11:43 +03:30
b0df396a38 conflict_relation_identification 2026-02-14 14:10:56 +03:30
29c4120730 children 2026-02-14 13:56:22 +03:30
Baghi330
d59355e6b8 console.log 2026-02-14 13:40:56 +03:30
4 changed files with 140 additions and 48 deletions

View File

@ -132,7 +132,7 @@
<button
:disabled="loading"
@click="handleSearch"
class="cursor-pointer flex items-center justify-center h-10 p-2 bg-primary text-white rounded-l-lg hover:bg-primary-400 dark:hover:bg-dark-primary-700 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 active:scale-95"
class="cursor-pointer flex items-center justify-center h-10 p-2 bg-primary text-white rounded-l-lg hover:bg-primary-400 dark:hover:bg-dark-primary-700 disabled:opacity-50 disabled:cursor-not-allowed transition-all duration-200 active:scale-95"
aria-label="جستجو"
>
جستجو
@ -504,7 +504,7 @@ const loadHistoryFromLocal = () => {
const parsed = JSON.parse(stored);
historyResults.value = parsed.slice(
0,
resolvedProps.value.maxHistoryItems
resolvedProps.value.maxHistoryItems,
);
recentSearches.value = historyResults.value
.slice(0, 5)
@ -520,7 +520,7 @@ const saveHistoryToLocal = () => {
try {
localStorage.setItem(
LOCAL_STORAGE_KEY,
JSON.stringify(historyResults.value)
JSON.stringify(historyResults.value),
);
} catch (err) {
console.error("خطا در ذخیره تاریخچه:", err);
@ -533,39 +533,39 @@ const hasVisibleResults = computed(
showResults.value &&
(showAutocompleteList.value ||
showHistoryList.value ||
showEmptyState.value)
showEmptyState.value),
);
const showAutocompleteList = computed(
() =>
showResults.value &&
autocompleteResults.value.length > 0 &&
searchQuery.value.length >= resolvedProps.value.minCharsForAutocomplete
searchQuery.value.length >= resolvedProps.value.minCharsForAutocomplete,
);
const showHistoryList = computed(
() => showResults.value && searchQuery.value.length === 0
() => showResults.value && searchQuery.value.length === 0,
);
const showEmptyState = computed(
() =>
showResults.value &&
!showAutocompleteList.value &&
!showHistoryList.value &&
searchQuery.value.length >= resolvedProps.value.minCharsForAutocomplete
searchQuery.value.length >= resolvedProps.value.minCharsForAutocomplete,
);
const totalResults = computed(
() =>
(showAutocompleteList.value ? autocompleteResults.value.length : 0) +
(showHistoryList.value ? historyResults.value.length : 0)
(showHistoryList.value ? historyResults.value.length : 0),
);
const selectedFilterIcon = computed(
() =>
quickFilters.value.find((f) => f.value === selectedFilter.value)?.icon ||
"i-heroicons-funnel"
"i-heroicons-funnel",
);
const selectedFilterLabel = computed(
() =>
quickFilters.value.find((f) => f.value === selectedFilter.value)?.label ||
"فیلتر"
"فیلتر",
);
// فرمت زمان
@ -599,6 +599,8 @@ const fetchAutocomplete = async () => {
let url = `${resolvedProps.value.autocompleteUrl}/q=${searchQuery.value}`;
if (selectedFilter.value !== "all") url += `&filter=${selectedFilter.value}`;
try {
console.log("url", url);
const response = await httpService.getRequest(url);
const hits = response?.hits?.hits || [];
autocompleteResults.value = hits
@ -611,8 +613,8 @@ const fetchAutocomplete = async () => {
hit._source?.type === "product"
? "i-heroicons-shopping-bag"
: hit._source?.type === "article"
? "i-heroicons-newspaper"
: "i-heroicons-document-text",
? "i-heroicons-newspaper"
: "i-heroicons-document-text",
}))
.slice(0, 6);
} catch (err) {
@ -654,7 +656,7 @@ const addToHistory = (item) => {
if (historyResults.value.length > resolvedProps.value.maxHistoryItems) {
historyResults.value = historyResults.value.slice(
0,
resolvedProps.value.maxHistoryItems
resolvedProps.value.maxHistoryItems,
);
}
recentSearches.value = historyResults.value.slice(0, 5).map((i) => i.label);
@ -882,7 +884,7 @@ const handleKeyDown = (event) => {
if (selectedIndex.value >= 0) {
if (activeSection.value === "autocomplete") {
handleAutocompleteSelect(
autocompleteResults.value[selectedIndex.value]
autocompleteResults.value[selectedIndex.value],
);
} else if (activeSection.value === "history") {
const historyIndex = selectedIndex.value - autocompleteCount;

View File

@ -52,7 +52,7 @@ function isList(text) {
(line) =>
line.trim().startsWith("*") ||
line.trim().startsWith("-") ||
/^\d+\./.test(line.trim())
/^\d+\./.test(line.trim()),
);
}
const toolbarGroups = [
@ -249,12 +249,12 @@ function generateDetailsHtml(item) {
let html = `<details class="custom-details" ${item.isOpen ? "open" : ""}>`;
html += `<summary>`;
if (item.tag) {
html += `<span href="${item.tag}"/>`;
html += `<span > ${item.tag} </span>`;
}
html += `${escapeHtml(item.title) || "بدون عنوان"}`;
if (item.link_url) {
html += `<a href="${item.link_url}">${item.link_label}</a>`;
html += `<a class="link-url" href="${item.link_url}">${item.link_label}</a>`;
}
html += "</summary>";
@ -297,7 +297,7 @@ watch(
loadFromJson();
});
},
{ deep: true, immediate: true }
{ deep: true, immediate: true },
);
onMounted(() => {
editor.value = new Editor({
@ -342,8 +342,8 @@ onBeforeUnmount(() => {
/* فقط متغیرهای غیررنگ (سایه، انحنا، RGB اصلی) رنگ‌ها در main.css تعریف شده‌اند */
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
--shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
--shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
0 2px 4px -1px rgba(0, 0, 0, 0.06);
--shadow-md:
0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
--radius: 0.75rem;
--radius-sm: 0.5rem;
--radius-lg: 1rem;
@ -365,7 +365,7 @@ onBeforeUnmount(() => {
border: 1px solid var(--color-primary-200);
border-radius: var(--radius-lg) var(--radius-lg) 0 0;
margin: 2rem auto 0;
max-width: 900px;
max-width: 1200px;
box-shadow: var(--shadow-sm);
}
@ -421,7 +421,7 @@ onBeforeUnmount(() => {
}
.editor-content {
max-width: 900px;
max-width: 1200px;
margin: 0 auto 2rem;
padding: 2rem;
background: var(--color-white-normal);
@ -433,8 +433,14 @@ onBeforeUnmount(() => {
}
.tiptap {
font-family: "Vazir", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
Roboto, sans-serif;
font-family:
"Vazir",
"Inter",
-apple-system,
BlinkMacSystemFont,
"Segoe UI",
Roboto,
sans-serif;
color: var(--color-dark-primary-700);
line-height: 1.7;
@ -553,14 +559,15 @@ onBeforeUnmount(() => {
padding: 1.25rem 1.25rem 1.25rem 3.5rem;
background: linear-gradient(
to right,
var(--color-dark-primary-50),
var(--color-primary-100),
var(--color-white-normal)
);
color: var(--color-primary-700);
border-radius: var(--radius) var(--radius) 0 0;
font-weight: 700;
font-size: 1.1rem;
color: var(--color-dark-primary-800);
cursor: pointer;
// cursor: pointer;
list-style: none;
user-select: none;
transition: all 0.2s ease;
@ -568,15 +575,6 @@ onBeforeUnmount(() => {
&::-webkit-details-marker {
display: none;
}
&:hover {
background: linear-gradient(
to right,
var(--color-primary-100),
var(--color-white-normal)
);
color: var(--color-primary-700);
}
}
> div {
@ -641,6 +639,10 @@ onBeforeUnmount(() => {
padding-right: 1rem;
border-right: 2px dashed var(--color-primary-100);
}
.link-url {
color: blue;
margin-right: 0.5em;
}
}
@keyframes slideDown {

View File

@ -40,15 +40,19 @@ const setDataEditor = async () => {
console.log("setDataEditor ", response);
let _source = response._source;
let base_url =
window.location.origin +
"/entity/show/view/qasection/{{qanon_id}}?jump_id={{section_id}}";
let base_url = window.location.origin;
base_url = base_url.replace("localhost:3007", "localhost:8082");
base_url = base_url.replace("majles.tavasi.ir", "jedit.tavasi.ir");
base_url += "/entity/show/view/qasection/{{qanon_id}}?jump_id={{section_id}}";
accordionItems.value = [];
let node = {}
if (_source.previous_info) {
let item = _source.previous_info;
accordionItems.value.push({
node = {
isOpen: false,
id: item.section_mom_id,
title: "قانون مقدم : " + item.qanon_title + " > " + item.full_path,
@ -58,12 +62,32 @@ const setDataEditor = async () => {
link_url: base_url
.replace("{{qanon_id}}", item.qanon_id)
.replace("{{section_id}}", item.section_mom_id),
children: [],
};
node["children"].push({
isOpen: false,
id: item.context_id,
title: "متن کامل با اجزاء دیگر مورد توجه : ",
content: _source.context1,
});
accordionItems.value.push(node);
item.rule_ids.forEach((rule_id) => {
let content = _source.rules_content[rule_id] ?? "";
accordionItems.value.push({
isOpen: false,
id: rule_id,
title: "حکم مورد استناد طرف مقدم با شناسه : " + rule_id,
content: content,
});
});
}
if (_source.next_info) {
let item = _source.next_info;
accordionItems.value.push({
node = {
isOpen: false,
id: item.section_mom_id,
title: "قانون موخر : " + item.qanon_title + " > " + item.full_path,
@ -73,9 +97,73 @@ const setDataEditor = async () => {
link_url: base_url
.replace("{{qanon_id}}", item.qanon_id)
.replace("{{section_id}}", item.section_mom_id),
children: [],
};
node["children"].push({
isOpen: false,
id: item.context_id,
title: "متن کامل با اجزاء دیگر مورد توجه : ",
content: _source.context1,
});
accordionItems.value.push(node);
item.rule_ids.forEach((rule_id) => {
let content = _source.rules_content[rule_id] ?? "";
accordionItems.value.push({
isOpen: false,
id: rule_id,
title: "حکم مورد استناد طرف موخر با شناسه : " + rule_id,
content: content,
});
});
}
/////-------------وحدت موضوع----------------------
node = {
isOpen: true,
id: 11,
title: "توضیح هوشمند برای وجود وحدت موضوع بین احکام استنادی ",
content: _source.subject_unity.reason,
children: [],
}
if(_source.subject_unity.description){
node["children"].push({
isOpen: false,
id: item.context_id,
title: "شرط اعتبار وحدت موضوع : ",
content: _source.subject_unity.description,
});
}
accordionItems.value.push(node);
/////-------------توضیح تخالف----------------------
node = {
isOpen: true,
id: 11,
title: "توضیح وجود تخالف بین دو ماده ",
content: _source.conflict_detection.description,
children: [],
}
accordionItems.value.push(node);
/////-------------بیان نوع تخالف----------------------
node = {
isOpen: true,
id: 11,
title: "بیان نوع تخالف بین دو ماده : " + _source.conflict_relation_identification.main_type,
content: _source.conflict_relation_identification.description,
children: [],
}
accordionItems.value.push(node);
/////-----------------------------------
console.log("accordionItems", accordionItems.value);
};

View File

@ -132,7 +132,7 @@ const getListConflict = async (textSearch = "", filterExtended = "") => {
request.url,
request.payload_full,
);
console.log("res", res);
// console.log("res", res);
listConflicts.value = res.hits;
pagination.value.total = res.hits.total.value;
@ -148,7 +148,7 @@ const getListConflict = async (textSearch = "", filterExtended = "") => {
function conflictDetails(event) {
conflictSelected.value = event.item;
activeTabKey.value = "RelationEdit";
console.log("event", event);
// console.log("event", event);
}
onMounted(() => {
getListConflict();
@ -156,20 +156,20 @@ onMounted(() => {
});
function myContentAction({ action, payload }) {
console.log("payload ==> ", payload);
console.log("action ==> ", action);
// 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);
// console.log("pagination.value ==> ", pagination.value);
getListConflict();
return;
}
}
function myHeaderToolsSearch(data) {
console.log("dataqqqq ==> ", data);
getListConflict(data);
function myHeaderToolsSearch(textSearch) {
console.log("dataqqqq ==> ", textSearch);
getListConflict(textSearch);
}
</script>