Compare commits
No commits in common. "7fd8cb9a65909be99dc2e3f98d0613a5dabbbaa3" and "d69b74561c3b5ae6a5d6d6fb95f910034157a853" have entirely different histories.
7fd8cb9a65
...
d69b74561c
|
|
@ -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,8 +599,6 @@ 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
|
||||
|
|
@ -656,7 +654,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);
|
||||
|
|
@ -884,7 +882,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;
|
||||
|
|
|
|||
|
|
@ -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 > ${item.tag} </span>`;
|
||||
html += `<span href="${item.tag}"/>`;
|
||||
}
|
||||
|
||||
html += `${escapeHtml(item.title) || "بدون عنوان"}`;
|
||||
if (item.link_url) {
|
||||
html += `<a class="link-url" href="${item.link_url}">${item.link_label}</a>`;
|
||||
html += `<a 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: 1200px;
|
||||
max-width: 900px;
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
|
|
@ -421,7 +421,7 @@ onBeforeUnmount(() => {
|
|||
}
|
||||
|
||||
.editor-content {
|
||||
max-width: 1200px;
|
||||
max-width: 900px;
|
||||
margin: 0 auto 2rem;
|
||||
padding: 2rem;
|
||||
background: var(--color-white-normal);
|
||||
|
|
@ -433,14 +433,8 @@ 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;
|
||||
|
||||
|
|
@ -559,15 +553,14 @@ onBeforeUnmount(() => {
|
|||
padding: 1.25rem 1.25rem 1.25rem 3.5rem;
|
||||
background: linear-gradient(
|
||||
to right,
|
||||
var(--color-primary-100),
|
||||
var(--color-dark-primary-50),
|
||||
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;
|
||||
|
|
@ -575,6 +568,15 @@ 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 {
|
||||
|
|
@ -639,10 +641,6 @@ onBeforeUnmount(() => {
|
|||
padding-right: 1rem;
|
||||
border-right: 2px dashed var(--color-primary-100);
|
||||
}
|
||||
.link-url {
|
||||
color: blue;
|
||||
margin-right: 0.5em;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slideDown {
|
||||
|
|
|
|||
|
|
@ -40,19 +40,15 @@ const setDataEditor = async () => {
|
|||
console.log("setDataEditor ", response);
|
||||
|
||||
let _source = response._source;
|
||||
|
||||
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}}";
|
||||
let base_url =
|
||||
window.location.origin +
|
||||
"/entity/show/view/qasection/{{qanon_id}}?jump_id={{section_id}}";
|
||||
|
||||
accordionItems.value = [];
|
||||
let node = {}
|
||||
|
||||
if (_source.previous_info) {
|
||||
let item = _source.previous_info;
|
||||
node = {
|
||||
accordionItems.value.push({
|
||||
isOpen: false,
|
||||
id: item.section_mom_id,
|
||||
title: "قانون مقدم : " + item.qanon_title + " > " + item.full_path,
|
||||
|
|
@ -62,32 +58,12 @@ 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;
|
||||
node = {
|
||||
accordionItems.value.push({
|
||||
isOpen: false,
|
||||
id: item.section_mom_id,
|
||||
title: "قانون موخر : " + item.qanon_title + " > " + item.full_path,
|
||||
|
|
@ -97,73 +73,9 @@ 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);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -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(textSearch) {
|
||||
console.log("dataqqqq ==> ", textSearch);
|
||||
getListConflict(textSearch);
|
||||
function myHeaderToolsSearch(data) {
|
||||
console.log("dataqqqq ==> ", data);
|
||||
getListConflict(data);
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user