This commit is contained in:
hsafaei 2026-02-14 17:07:27 +03:30
parent 50cf02890a
commit dedd9c6d98
2 changed files with 50 additions and 15 deletions

View File

@ -248,7 +248,14 @@ function formatContent(content) {
} }
function generateDetailsHtml(item) { function generateDetailsHtml(item) {
let html = `<details class="custom-details" ${item.isOpen ? "open" : ""}>`; let html = `<details class="custom-details #bcolor# " ${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>`;
@ -515,6 +522,16 @@ onBeforeUnmount(() => {
} }
} }
.b_color1{
background: rgb(227, 242, 253)
}
.b_color2{
background: rgb(232, 245, 233)
}
.b_color3{
background: rgb(243, 229, 245)
}
/* استایل آکاردئون‌ها */ /* استایل آکاردئون‌ها */
.custom-details { .custom-details {
position: relative; position: relative;

View File

@ -54,9 +54,14 @@ const setDataEditor = async () => {
if (_source.previous_info) { if (_source.previous_info) {
let item = _source.previous_info; let item = _source.previous_info;
node = { node = {
background:"b_color1",
isOpen: false, isOpen: false,
id: item.section_mom_id, id: item.section_mom_id,
title: `<a class="label" href="#">قانون مقدم : </a>` + item.qanon_title + " - " + item.full_path, title:
`<a class="label" href="#">قانون مقدم : </a>` +
item.qanon_title +
" - " +
item.full_path,
tag: item.state_etebar, tag: item.state_etebar,
content: _source.content1, content: _source.content1,
link_label: "«منبع»", link_label: "«منبع»",
@ -66,6 +71,7 @@ const setDataEditor = async () => {
children: [], children: [],
}; };
if (item.group_section_ids?.length > 1)
node["children"].push({ node["children"].push({
isOpen: false, isOpen: false,
id: item.context_id, id: item.context_id,
@ -75,7 +81,11 @@ 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,
@ -89,9 +99,14 @@ 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",
isOpen: false, isOpen: false,
id: item.section_mom_id, id: item.section_mom_id,
title: `<a class="label">قانون موخر : </a>` + item.qanon_title + " - " + item.full_path, title:
`<a class="label">قانون موخر : </a>` +
item.qanon_title +
" - " +
item.full_path,
tag: item.state_etebar, tag: item.state_etebar,
content: _source.content2, content: _source.content2,
link_label: "«منبع»", link_label: "«منبع»",
@ -100,6 +115,8 @@ const setDataEditor = async () => {
.replace("{{section_id}}", item.section_mom_id), .replace("{{section_id}}", item.section_mom_id),
children: [], children: [],
}; };
if (item.group_section_ids?.length > 1)
node["children"].push({ node["children"].push({
isOpen: false, isOpen: false,
id: item.context_id, id: item.context_id,
@ -122,6 +139,7 @@ const setDataEditor = async () => {
/////-------------وحدت موضوع---------------------- /////-------------وحدت موضوع----------------------
node = { node = {
background:"b_color3",
isOpen: true, isOpen: true,
id: 11, id: 11,
title: "توضیح هوشمند برای وجود وحدت موضوع بین احکام استنادی ", title: "توضیح هوشمند برای وجود وحدت موضوع بین احکام استنادی ",