Compare commits
No commits in common. "d69b74561c3b5ae6a5d6d6fb95f910034157a853" and "c9fe6b38c54a577a64ce6e0a867bba9721ef3270" have entirely different histories.
d69b74561c
...
c9fe6b38c5
|
|
@ -23,8 +23,5 @@ export default {
|
||||||
},
|
},
|
||||||
data_entry:{
|
data_entry:{
|
||||||
getSchema:"elp/schema/get"
|
getSchema:"elp/schema/get"
|
||||||
},
|
|
||||||
conflict:{
|
|
||||||
get:"elp/conflict/{{type_name}}/get/text/{{doc_id}}"
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, nextTick, onMounted, onBeforeUnmount, watch } from "vue";
|
import { ref, nextTick, onMounted, onBeforeUnmount } from "vue";
|
||||||
import {
|
import {
|
||||||
Details,
|
Details,
|
||||||
DetailsContent,
|
DetailsContent,
|
||||||
|
|
@ -52,7 +52,7 @@ function isList(text) {
|
||||||
(line) =>
|
(line) =>
|
||||||
line.trim().startsWith("*") ||
|
line.trim().startsWith("*") ||
|
||||||
line.trim().startsWith("-") ||
|
line.trim().startsWith("-") ||
|
||||||
/^\d+\./.test(line.trim())
|
/^\d+\./.test(line.trim()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const toolbarGroups = [
|
const toolbarGroups = [
|
||||||
|
|
@ -247,16 +247,7 @@ function formatContent(content) {
|
||||||
|
|
||||||
function generateDetailsHtml(item) {
|
function generateDetailsHtml(item) {
|
||||||
let html = `<details class="custom-details" ${item.isOpen ? "open" : ""}>`;
|
let html = `<details class="custom-details" ${item.isOpen ? "open" : ""}>`;
|
||||||
html += `<summary>`;
|
html += `<summary>${escapeHtml(item.title) || "بدون عنوان"}</summary>`;
|
||||||
if (item.tag) {
|
|
||||||
html += `<span href="${item.tag}"/>`;
|
|
||||||
}
|
|
||||||
|
|
||||||
html += `${escapeHtml(item.title) || "بدون عنوان"}`;
|
|
||||||
if (item.link_url) {
|
|
||||||
html += `<a href="${item.link_url}">${item.link_label}</a>`;
|
|
||||||
}
|
|
||||||
html += "</summary>";
|
|
||||||
|
|
||||||
const formattedContent = formatContent(item.content || "");
|
const formattedContent = formatContent(item.content || "");
|
||||||
html += `<div class="details-content">${formattedContent}</div>`;
|
html += `<div class="details-content">${formattedContent}</div>`;
|
||||||
|
|
@ -277,7 +268,7 @@ function loadFromJson() {
|
||||||
if (!editor.value) return;
|
if (!editor.value) return;
|
||||||
|
|
||||||
let html =
|
let html =
|
||||||
'<p style="margin-bottom: 1.5rem; color: var(--color-dark-primary-700);"></p>';
|
'<p style="margin-bottom: 1.5rem; color: var(--color-dark-primary-700);">✨ اطلاعات محصول</p>';
|
||||||
|
|
||||||
props.accordionData.forEach((item) => {
|
props.accordionData.forEach((item) => {
|
||||||
html += generateDetailsHtml(item);
|
html += generateDetailsHtml(item);
|
||||||
|
|
@ -285,20 +276,7 @@ function loadFromJson() {
|
||||||
|
|
||||||
editor.value.commands.setContent(html);
|
editor.value.commands.setContent(html);
|
||||||
}
|
}
|
||||||
watch(
|
|
||||||
() => props.accordionData,
|
|
||||||
(newVal) => {
|
|
||||||
if (!editor.value) return;
|
|
||||||
if (!newVal || newVal.length === 0) return;
|
|
||||||
|
|
||||||
console.log("accordionData updated:", newVal);
|
|
||||||
|
|
||||||
nextTick(() => {
|
|
||||||
loadFromJson();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
{ deep: true, immediate: true }
|
|
||||||
);
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
editor.value = new Editor({
|
editor.value = new Editor({
|
||||||
extensions: [
|
extensions: [
|
||||||
|
|
@ -342,8 +320,8 @@ onBeforeUnmount(() => {
|
||||||
/* فقط متغیرهای غیررنگ (سایه، انحنا، RGB اصلی) – رنگها در main.css تعریف شدهاند */
|
/* فقط متغیرهای غیررنگ (سایه، انحنا، RGB اصلی) – رنگها در main.css تعریف شدهاند */
|
||||||
--shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
|
--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: 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),
|
--shadow-md:
|
||||||
0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
||||||
--radius: 0.75rem;
|
--radius: 0.75rem;
|
||||||
--radius-sm: 0.5rem;
|
--radius-sm: 0.5rem;
|
||||||
--radius-lg: 1rem;
|
--radius-lg: 1rem;
|
||||||
|
|
@ -433,8 +411,14 @@ onBeforeUnmount(() => {
|
||||||
}
|
}
|
||||||
|
|
||||||
.tiptap {
|
.tiptap {
|
||||||
font-family: "Vazir", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
|
font-family:
|
||||||
Roboto, sans-serif;
|
"Vazir",
|
||||||
|
"Inter",
|
||||||
|
-apple-system,
|
||||||
|
BlinkMacSystemFont,
|
||||||
|
"Segoe UI",
|
||||||
|
Roboto,
|
||||||
|
sans-serif;
|
||||||
color: var(--color-dark-primary-700);
|
color: var(--color-dark-primary-700);
|
||||||
line-height: 1.7;
|
line-height: 1.7;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,84 +6,25 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import { ref, watch, onMounted } from "vue";
|
|
||||||
import { useElpService } from "~/composables/useElpService";
|
|
||||||
|
|
||||||
const { uepGetConflictDoc } = useElpService();
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
listConflicts: {
|
listConflicts: {
|
||||||
type: Array,
|
type: Array,
|
||||||
default: () => [],
|
default: () => [],
|
||||||
},
|
},
|
||||||
conflict_id: {
|
conflictSelected: {
|
||||||
type: String,
|
type: Object,
|
||||||
default: () => "",
|
default: () => {},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
const accordionItems = [
|
||||||
let accordionItems = ref([
|
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
tag: "",
|
|
||||||
title: "عنوان",
|
title: "عنوان",
|
||||||
link_label: "منبع",
|
|
||||||
link_url: "",
|
|
||||||
content: "متن",
|
content: "متن",
|
||||||
isOpen: true,
|
isOpen: true,
|
||||||
children: [],
|
children: [],
|
||||||
},
|
},
|
||||||
]);
|
];
|
||||||
|
|
||||||
const setDataEditor = async () => {
|
|
||||||
let response = await uepGetConflictDoc(props.conflict_id);
|
|
||||||
console.log("setDataEditor ", response);
|
|
||||||
|
|
||||||
let _source = response._source;
|
|
||||||
let base_url =
|
|
||||||
window.location.origin +
|
|
||||||
"/entity/show/view/qasection/{{qanon_id}}?jump_id={{section_id}}";
|
|
||||||
|
|
||||||
accordionItems.value = [];
|
|
||||||
|
|
||||||
if (_source.previous_info) {
|
|
||||||
let item = _source.previous_info;
|
|
||||||
accordionItems.value.push({
|
|
||||||
isOpen: false,
|
|
||||||
id: item.section_mom_id,
|
|
||||||
title: "قانون مقدم : " + item.qanon_title + " > " + item.full_path,
|
|
||||||
tag: item.state_etebar,
|
|
||||||
content: _source.content1,
|
|
||||||
link_label: "«منبع»",
|
|
||||||
link_url: base_url
|
|
||||||
.replace("{{qanon_id}}", item.qanon_id)
|
|
||||||
.replace("{{section_id}}", item.section_mom_id),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_source.next_info) {
|
|
||||||
let item = _source.next_info;
|
|
||||||
accordionItems.value.push({
|
|
||||||
isOpen: false,
|
|
||||||
id: item.section_mom_id,
|
|
||||||
title: "قانون موخر : " + item.qanon_title + " > " + item.full_path,
|
|
||||||
tag: item.state_etebar,
|
|
||||||
content: _source.content2,
|
|
||||||
link_label: "«منبع»",
|
|
||||||
link_url: base_url
|
|
||||||
.replace("{{qanon_id}}", item.qanon_id)
|
|
||||||
.replace("{{section_id}}", item.section_mom_id),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
console.log("accordionItems", accordionItems.value);
|
|
||||||
};
|
|
||||||
|
|
||||||
// #region Lifecycle
|
|
||||||
onMounted(() => {
|
|
||||||
setDataEditor();
|
|
||||||
});
|
|
||||||
// #endregion
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style></style>
|
<style></style>
|
||||||
|
|
|
||||||
|
|
@ -69,37 +69,10 @@ export function useElpService(props, emit) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
///-----------------------------------------------------
|
|
||||||
///--- با توجه به یک فیلد، مقدار محاسبه شده ای بر میگردند مثلا : بیشترین مقدار یا مجموع یا ...
|
|
||||||
///-----------------------------------------------------
|
|
||||||
async function uepGetConflictDoc(
|
|
||||||
doc_id,
|
|
||||||
key = "qaconflict"
|
|
||||||
) {
|
|
||||||
let url = elpApi.conflict.get;
|
|
||||||
url = url.replace("{{type_name}}", key);
|
|
||||||
url = url.replace("{{doc_id}}", doc_id);
|
|
||||||
|
|
||||||
return await httpService
|
|
||||||
.getRequest(url)
|
|
||||||
.then((res) => {
|
|
||||||
return res;
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
toast.add({
|
|
||||||
title: "خطا",
|
|
||||||
description: "خطا در انجام عملیات، دوباره تلاش کنید",
|
|
||||||
color: "red",
|
|
||||||
});
|
|
||||||
return undefined;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
///-----------------------------------------------------
|
///-----------------------------------------------------
|
||||||
///-----------------------------------------------------
|
///-----------------------------------------------------
|
||||||
return {
|
return {
|
||||||
uepUpdateField,
|
uepUpdateField,
|
||||||
uepGetComputeField,
|
uepGetComputeField,
|
||||||
uepGetConflictDoc,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,16 +6,16 @@ export const isLoginRemoved = () => process.env.VUE_APP_LOGIN_REMOVE == 1;
|
||||||
|
|
||||||
// util to export to excel file using plugin
|
// util to export to excel file using plugin
|
||||||
// https://github.com/zheeeng/export-from-json
|
// https://github.com/zheeeng/export-from-json
|
||||||
// export const convertJsonToExcelUsingPlugin = async (
|
export const convertJsonToExcelUsingPlugin = async (
|
||||||
// data,
|
data,
|
||||||
// fileName = "download"
|
fileName = "download"
|
||||||
// ) => {
|
) => {
|
||||||
// // 'txt'(default), 'css', 'html', 'json', 'csv', 'xls', 'xml'
|
// 'txt'(default), 'css', 'html', 'json', 'csv', 'xls', 'xml'
|
||||||
// const exportType = exportFromJSON.types.xls;
|
const exportType = exportFromJSON.types.xls;
|
||||||
// const withBOM = true;
|
const withBOM = true;
|
||||||
|
|
||||||
// return await exportFromJSON({ data, fileName, exportType, withBOM });
|
return await exportFromJSON({ data, fileName, exportType, withBOM });
|
||||||
// };
|
};
|
||||||
|
|
||||||
// util to export to excel file manually
|
// util to export to excel file manually
|
||||||
export const exportJsonToExcelManually = (JSONData, FileTitle, ShowLabel) => {
|
export const exportJsonToExcelManually = (JSONData, FileTitle, ShowLabel) => {
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@
|
||||||
:listConflicts="listConflicts"
|
:listConflicts="listConflicts"
|
||||||
:conflictSelected="conflictSelected"
|
:conflictSelected="conflictSelected"
|
||||||
:pagination="pagination"
|
:pagination="pagination"
|
||||||
:conflict_id="conflictSelected?._id"
|
|
||||||
@conflict-details="conflictDetails"
|
@conflict-details="conflictDetails"
|
||||||
@my-content-action="myContentAction"
|
@my-content-action="myContentAction"
|
||||||
@my-header-tools-search="myHeaderToolsSearch"
|
@my-header-tools-search="myHeaderToolsSearch"
|
||||||
|
|
@ -146,7 +145,7 @@ const getListConflict = async (textSearch = "", filterExtended = "") => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function conflictDetails(event) {
|
function conflictDetails(event) {
|
||||||
conflictSelected.value = event.item;
|
conflictSelected.value = event;
|
||||||
activeTabKey.value = "RelationEdit";
|
activeTabKey.value = "RelationEdit";
|
||||||
console.log("event", event);
|
console.log("event", event);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user