This commit is contained in:
hsafaei 2026-02-14 19:29:21 +03:30
parent b09ead1f12
commit 990d31ced2
3 changed files with 24 additions and 88 deletions

View File

@ -248,19 +248,12 @@ function formatContent(content) {
} }
function generateDetailsHtml(item) { function generateDetailsHtml(item) {
let html = `<details class="custom-details #bcolor# " ${item.isOpen ? "open" : ""}>`; let html = `<details class="custom-details" ${item.isOpen ? "open" : ""}>`;
if(item.background)
html.replace("#bcolor#", item.background)
else
html.replace("#bcolor#", "")
html += `<summary>`; html += `<summary>`;
if (item.tag) { if (item.tag) {
html += `<a class="tag" target="normal" @click.stop="true" > ${item.tag} </a>`; html += `<a class="tag" target="normal" @click.stop="true" > ${item.tag} </a>`;
// console.log(" html 1 ", html); // console.log(" html 1 ", html);
} }
html += `${item.title || "بدون عنوان"}`; html += `${item.title || "بدون عنوان"}`;
@ -279,6 +272,11 @@ function generateDetailsHtml(item) {
html += `</details>`; html += `</details>`;
if(item.background)
html = html.replaceAll("#bcolor#", item.background)
else
html = html.replaceAll("#bcolor#", "")
// console.log(" html 10 ", html); // console.log(" html 10 ", html);
return html; return html;
} }
@ -521,14 +519,14 @@ onBeforeUnmount(() => {
} }
} }
.b_color1{ .bcolor1{
background: rgb(227, 242, 253) background: rgb(227, 242, 253) !important;
} }
.b_color2{ .bcolor2{
background: rgb(232, 245, 233) background: rgb(232, 245, 233) !important;
} }
.b_color3{ .bcolor3{
background: rgb(243, 229, 245) background: rgb(243, 229, 245) !important;
} }
/* استایل آکاردئون‌ها */ /* استایل آکاردئون‌ها */

View File

@ -51,14 +51,15 @@ const setDataEditor = async () => {
accordionItems.value = []; accordionItems.value = [];
let node = {}; let node = {};
/////-----------------------------------------
if (_source.previous_info) { if (_source.previous_info) {
let item = _source.previous_info; let item = _source.previous_info;
node = { node = {
background:"b_color1", background:"bcolor1",
isOpen: false, isOpen: false,
id: item.section_mom_id, id: item.section_mom_id,
title: title:
`<a class="label" href="#">قانون مقدم : </a>` + `<a class="label #bcolor# " href="#">قانون مقدم : </a>` +
item.qanon_title + item.qanon_title +
" - " + " - " +
item.full_path, item.full_path,
@ -96,14 +97,15 @@ const setDataEditor = async () => {
}); });
} }
/////-----------------------------------------
if (_source.next_info) { if (_source.next_info) {
let item = _source.next_info; let item = _source.next_info;
node = { node = {
background:"b_color2", background:"bcolor2",
isOpen: false, isOpen: false,
id: item.section_mom_id, id: item.section_mom_id,
title: title:
`<a class="label">قانون موخر : </a>` + `<a class="label #bcolor# " href="#">قانون موخر : </a>` +
item.qanon_title + item.qanon_title +
" - " + " - " +
item.full_path, item.full_path,
@ -126,7 +128,12 @@ const setDataEditor = async () => {
accordionItems.value.push(node); accordionItems.value.push(node);
let unrepeat_id = {}
item.rule_ids.forEach((rule_id) => { item.rule_ids.forEach((rule_id) => {
if(unrepeat_id[rule_id])
return
unrepeat_id[rule_id] = 1
let content = _source.rules_content[rule_id] ?? ""; let content = _source.rules_content[rule_id] ?? "";
accordionItems.value.push({ accordionItems.value.push({
isOpen: false, isOpen: false,
@ -139,7 +146,7 @@ const setDataEditor = async () => {
/////-------------وحدت موضوع---------------------- /////-------------وحدت موضوع----------------------
node = { node = {
background:"b_color3", background:"bcolor3",
isOpen: true, isOpen: true,
id: 11, id: 11,
title: "توضیح هوشمند برای وجود وحدت موضوع بین احکام استنادی ", title: "توضیح هوشمند برای وجود وحدت موضوع بین احکام استنادی ",

View File

@ -1,69 +0,0 @@
<template>
<div
class="min-h-[calc(100dvh-4em)] flex items-center justify-center p-4 bg-gray-100 dark:bg-dark-primary"
>
<div
class="max-w-md w-full bg-white dark:bg-dark-primary-800 rounded-2xl shadow-xl p-8 text-center border border-gray-200 dark:border-dark-primary-600"
>
<!-- Tabs -->
<ul class="flex border-b border-gray-200">
<li class="flex-1">
<button
class="w-full py-3.5 font-medium transition-all duration-200 cursor-pointer"
:class="tabClass('login')"
@click="setActive('login')"
>
ورود
</button>
</li>
<li class="flex-1">
<button
class="w-full py-3.5 font-medium transition-all duration-200 cursor-pointer"
:class="tabClass('register')"
@click="setActive('register')"
>
ثبتنام
</button>
</li>
</ul>
<!-- Content -->
<div class="mt-8">
<component :is="currentComponent" />
</div>
</div>
</div>
</template>
<script setup>
import { ref } from "vue";
definePageMeta({ layout: "login-layout" });
// --- Lazy load components ---
import LoginForm from "~/components/lazy-load/auth/LoginForm.vue";
import RegisterForm from "~/components/lazy-load/auth/RegisterForm.vue";
// --- State ---
const activeTab = ref("login");
const currentComponent = ref(LoginForm);
const componentsMap = {
login: LoginForm,
register: RegisterForm,
};
// --- Methods ---
function setActive(tab) {
activeTab.value = tab;
currentComponent.value = componentsMap[tab];
}
// --- Compute class for tabs ---
function tabClass(tab) {
if (activeTab.value === tab) {
return "text-primary border-b-1 border-primary font-semibold";
} else {
return "text-gray-500 hover:text-primary";
}
}
</script>
<style></style>