90 lines
2.0 KiB
Vue
90 lines
2.0 KiB
Vue
<template>
|
|
<div>
|
|
<HeaderTools></HeaderTools>
|
|
<TiptapEditor :accordionData="accordionItems"></TiptapEditor>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { ref, watch, onMounted } from "vue";
|
|
import { useElpService } from "~/composables/useElpService";
|
|
|
|
const { uepGetConflictDoc } = useElpService();
|
|
|
|
const props = defineProps({
|
|
listConflicts: {
|
|
type: Array,
|
|
default: () => [],
|
|
},
|
|
conflict_id: {
|
|
type: String,
|
|
default: () => "",
|
|
},
|
|
});
|
|
|
|
let accordionItems = ref([
|
|
{
|
|
id: 1,
|
|
tag: "",
|
|
title: "عنوان",
|
|
link_label: "منبع",
|
|
link_url: "",
|
|
content: "متن",
|
|
isOpen: true,
|
|
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>
|
|
|
|
<style></style>
|