first commit

This commit is contained in:
mustafa-rezae 2025-02-04 16:10:58 +03:30
commit 947af21d6d
40 changed files with 10223 additions and 0 deletions

24
apis/researchApi.js Normal file
View File

@ -0,0 +1,24 @@
export default {
admin: {
list: "",
show: "",
edit: "",
update: "",
delete: "",
},
research:{
listDefault:"research/search/{{user_id}}/{{offset}}/{{limit}}",
listBySearch:"research/search/{{user_id}}/{{offset}}/{{limit}}/q=",
deleteItem: "/public/{{index_key}}/delete/{{id}}", //ایدی فیش و یا حاشیه
},
subject: {
move: 'subject/order/move/parent',
order: 'subject/order/move/one',
list: 'list/subject/list',
add: 'list/subject/add',
edit: 'list/subject/edit',
delete: 'list/subject/delete',
order: 'list/subject/order',
},
};

View File

@ -0,0 +1,142 @@
.research-system {
.main-page__content {
margin-right: var(--sidebar-collapsed-width);
.search-items {
height: calc(100vh - 10em);
overflow: auto;
}
.myResearches {
.search-container {
.input-group {
/* justify-content: space-between; */
border-radius: 50px;
.form-control {
border: 0;
border-right: 1px solid #eee;
border-left: 1px solid #eee;
height: 3em;
}
.btn-primary {
border-radius: 50px 0 0 50px;
min-width: 5em;
}
}
}
}
.advanced-search {
position: absolute;
top: 0;
right: 0;
bottom: 0;
padding-top: 1em;
padding-bottom: 1em;
width: 20em;
// height: calc(100dvh - 10em);
overflow-y: auto;
background: #fff;
z-index: 99;
box-shadow: 0 0.4688rem 2.1875rem rgba(4, 9, 20, 0.03),
0 0.9375rem 1.4063rem rgba(4, 9, 20, 0.03),
0 0.25rem 0.5313rem rgba(4, 9, 20, 0.03),
0 0.125rem 0.1875rem rgba(4, 9, 20, 0.03);
// border-radius: 0.25em;
.multiselect__tags {
border: unset !important;
}
.bottom-close-form {
&:hover {
color: #6acfef;
}
}
@media (max-width: 768px) {
.bottom-close-form {
position: absolute;
bottom: 7em !important;
}
}
// .search-page__search.in-search {
// input {
// padding-right: 5em !important;
// border: 1px solid transparent;
// }
// }
.form-group {
&.inside-advanced-search {
.form-control {
border-radius: 0.5em;
border: 1px solid #ced4da;
// padding: 1.2em;
// width: 14em;
&:focus {
border: 1px solid #61bb9e;
}
}
.date-picker {
.vpd-input-group {
direction: ltr;
.vpd-icon-btn {
margin-bottom: 0;
// position: absolute;
// right: 15.6em;
// height: 3em;
border-radius: 0.5em 0em 0em 0.5em;
}
.form-control {
border-radius: 0 0.5em 0.5em 0;
}
}
}
}
}
.select.in-advanced-search {
// padding: 0.3em !important;
border-radius: 0.5em;
font-size: 1rem;
// height: 3em;
// width: 15em !important;
border: 1px solid #ced4da !important;
&:focus {
border: 1px solid rgb(127, 170, 170) !important;
}
}
// .tribute.in-advanced-search {
// width: 18em !important;
// }
.form-control {
height: 2.2em;
}
}
.filter-list-container {
.mobile-mode {
display: none;
}
}
.TermPage {
.nav-tabs-container {
display: flex;
justify-content: center;
.nav-link {
.active {
color: #495057;
background-color: #fff;
border-color: #dee2e6 #dee2e6 #fff;
}
}
}
.pages-content {
width: 100%;
// margin-top: 2em;
padding: 0;
// height: calc(100dvh - 2em);
}
}
}
@import "./responsive/responsive";
}

View File

@ -0,0 +1,130 @@
.main-page__content {
// .pages {
// .pages-content {
.menu-bar__content {
position: fixed !important;
max-width: 24em;
min-width: 22em;
z-index: 3;
background-color: #fff;
right: 0;
// overflow: hidden;
transition: right 0.3s ease-out;
top: 0;
bottom: 4.5em;
&.mini {
right: -100%;
transition: right 0.3s ease-out;
}
.home-list__header {
.search-form {
.form-group {
.form-control {
// width: 98%;
}
.dropdown {
// width: 1.5rem;
// position: relative;
// left: 0.5rem;
// top: 0.25rem;
}
}
}
}
.home-list__content {
.scroll-needed {
height: calc(100dvh - 10em);
}
}
.hide-list-panel {
}
.groups-header {
display: flex;
justify-content: space-between;
align-items: center;
.right-icons {
.toggle-list {
display: none!important;
}
// .group-name {
// display: none;
// }
}
.left-icons {
position: relative;
display: flex;
align-items: center;
}
.dropdown {
&.profile-dropdown {
.nav-link {
&.dropdown-toggle {
span {
display: none;
}
}
}
}
}
.btn {
// display: none;
}
}
.create-forms {
right: 0;
z-index: 99;
max-width: 80%;
border-left: 1px solid #eee;
}
}
.position-relative {
.show-toggle-list-panel {
// position: absolute;
// right: 3rem;
// top: 0.25rem;
// display: block;
// button {
// left: 0px;
// }
}
.dropdown {
// position: absolute;
// top: 0px;
}
}
.hide-list-panel .toggle-mobile-nav {
// position: absolute;
// bottom: 0.25rem;
// right: 0.25rem;
}
}
#myTabContent {
#property {
// position: relative;
// top: 8rem;
}
}
// }
// }
// }
.navbar {
.profile-dropdown {
// bottom: 0.5rem;
}
}

View File

@ -0,0 +1,40 @@
#replays {
position: fixed !important;
left: -25em;
top: 0;
bottom: 4.5em;
transition: left 0.3s ease-out;
max-width: 80%;
z-index: 98;
&.show {
transition: left 0.3s ease-out;
left: 0;
}
.replay-list {
.comment-container {
.comment {
margin-right: 0;
&::after,
&::before {
display: none;
}
.comment-header {
display: flex;
align-items: center;
margin-bottom: 0.5em;
.commentor-avatar {
margin-left: 0.5em;
position: static;
}
}
.comment-actions {
visibility: visible;
}
}
}
}
}

View File

@ -0,0 +1,78 @@
.mobile-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
/* height: 3.5em; */
/* -webkit-box-shadow: 0px 1px 6px 3px #eee; */
box-shadow: 0px 1px 6px 3px #eee;
display: flex;
flex-direction: column;
justify-content: center;
padding: 0.5em 1em;
background-color: #fafafa;
z-index: 98;
.footer-menu {
display: flex;
align-items: center;
justify-content: space-between;
justify-content: space-around;
list-style: none;
margin: 0;
padding: 0;
.footer-menu-item {
.footer-menu-item-btn {
width: 3.3em;
height: 3.3em;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border-radius: 50%;
padding: 0;
color: #333;
position: relative;
* {
padding: 0;
}
.button-title {
font-size: 0.8rem;
// color:#6f6f6f;
}
&.active {
color: #00b6e3;
// fill:blue;
.icon {
// background-color: blue;
}
// border: 1px solid #c7c7c7;
// background-color: #fafafa;
// border-color: green;
// transform: translateY(-10px) scale(1.1);
&::before {
content: "";
display: block;
position: absolute;
top: -0.6em;
left: 0;
right: 0;
border-top: 2px solid #00b6e3;
}
}
&.disabled, &:disabled {
opacity: 0.4;
// filter: grayscale(0.6);
}
}
}
}
}

View File

@ -0,0 +1,126 @@
.main-page__content {
#comments-and-replays {
.chat-list-group-info {
.group-info-actions {
& > .btn:not(.issue-redirect-btn),
& > .multiselect,
& > .multiselect-container {
display: none;
}
}
.group-row .group-content .group-title-container .group-title {
max-width: 13em;
}
.group-row
.group-content
.group-description-container
.group-description {
max-width: 13em;
}
}
.comment-list {
.comments {
// height: 70vh;
// height: calc(100dvh - 70px - 63px - 3.7em);
// height: calc(100dvh - 8.5em);
// height: calc(100dvh - 10em);
.drop {
// height: calc(100dvh - 16.5em);
.stream {
// height: calc(100dvh - 12em);
// height: calc(100dvh - 16.5em);
height: calc(100dvh - 16.5em);
&.filter-is-active {
// height: calc(100dvh - 21em) !important;
// height: calc(100dvh - 24.5em) !important;
height: calc(100dvh - 21em);
& + .empty .wrapper {
bottom: 5em;
}
}
}
}
}
&.replays-is-open {
.comments {
// height: 70vh;
// height: calc(100dvh - 70px - 63px - 3.7em);
// height: calc(100dvh - 8.5em);
// height: calc(100dvh - 10em);
.drop {
// height: calc(100dvh - 16.5em);
.stream {
height: calc(100dvh - 20em);
&.filter-is-active {
// height: calc(100dvh - 21em) !important;
// height: calc(100dvh - 24.5em) !important;
height: calc(100dvh - 24em);
& + .empty .wrapper {
bottom: 8.5em;
}
}
}
}
}
}
.comment-form-container {
min-width: unset;
}
.comments {
.comment-container {
margin: 0;
&.replayer {
.comment {
margin-left: 0;
}
}
.comment {
margin-right: 0;
max-width: 20em;
&::after,
&::before {
display: none;
}
.comment-header {
display: flex;
align-items: center;
margin-bottom: 0.5em;
.commentor-avatar {
margin-left: 0.5em;
position: static;
}
}
.comment-actions {
visibility: visible;
}
}
}
.first-last-button {
display: none;
}
}
}
.menu-multiselect {
}
.auth-page .sign-up--tabs {
height: auto;
}
}
}

View File

@ -0,0 +1,130 @@
// 1600px
@media screen and (max-width: 100em) {
// @import "./1600/my_table_1600";
// @import "./1600/the_list_panel_1600";
// @import "./1600/sub_header_1600";
}
// 1399px
@media screen and (max-width: 87.499em) {
// @import "./1399/the_list_panel-1399";
// @import "./1399/_sub_header_1399";
}
// 991px
@media screen and (max-width: 61.998em) {
.main-page__content {
.search-items {
height: calc(100vh - 13em);
}
.filter-list-container {
padding-top: 0.5em;
position: fixed;
z-index: 9;
width: auto;
.main-filter {
display: none;
}
.mobile-mode {
display: flex;
justify-content: flex-end;
.btn {
border-radius: 50%;
// font-size: 0.7rem;
width: 2.5em;
height: 2.5em;
box-shadow: 0px 0px 7px 1px #eee;
display: flex;
justify-content: center;
align-items: center;
transform: translateX(1.5em);
background-color: #eee;
&:hover {
filter: brightness(0.8);
}
}
}
&.expanded {
top: 0;
bottom: 0;
right: 0;
margin-right: var(--sidebar-collapsed-width);
background: #fff;
justify-content: center;
box-shadow: -1px 0px 7px 1px #eee;
.main-filter {
display: block;
}
}
}
}
// @import "./991/group";
// @import "./991/the-footer";
// @import "./991/chat-list.scss";
// @import "./991/replays";
// @import "./991/_sub_header_991";
// @import "./991/my_table_991";
}
// 767px
@media screen and (max-width: 47.938em) {
.main-page__content {
.search-items {
height: calc(100vh - 15em);
}
}
// @import "./767/group";
// @import "./767/the_list_panel_767";
// @import "./767/the_navbar_767";
// @import "./767/_sub_header_767";
// @import "./767/the-footer";
}
// 575px
@media screen and (max-width: 35.938em) {
.main-page__content {
.search-items {
height: calc(100vh - 15em);
}
}
// @import "./575/main_575";
// @import "./575/my_table_575";
// @import "./575/the_list_panel_575";
// @import "./575/the_navbar_575";
// @import "./575/sub_header_575";
}
// 399px
@media screen and (max-width: 24.938em) {
.main-page__content {
.search-items {
height: calc(100vh - 15em);
}
}
// @import "./399/chat-list.scss";
// @import "./399/my_table_399";
// @import "./399/sub_header_399";
// @import "./399/the-_navbar_399";
// @import "./399/the_list_panel_399";
}
//360px
@media screen and (max-width: 22.5em) {
// @import "./360/main_360";
// @import "./360/sub_header_360";
// @import "./360/the_list_panel_360";
// @import "./360/the_navbar_360";
}

View File

@ -0,0 +1,78 @@
.main-page__content {
.menu-bar__content {
// max-width: 50%;
// min-width: 50%;
.groups-header {
// display: flex;
// justify-content: space-between;
// align-items: center;
.dropdown {
&.profile-dropdown {
// display: none;
}
}
}
.group-filter-mobile {
// display: none;
}
.toggle-sidebar {
// display: none;
}
.toggle-menu-bar {
// display: none;
}
&.mini {
// max-width: 5em;
// min-width: 5em;
.right-icons {
& > .btn:not(.toggle-list), .group-name ,& > svg {
// display: none;
}
}
.groups-header {
.toggle-search {
// display: none;
}
.toggle-filter {
// display: none;
}
}
.group-item {
.group-row {
.group-picture-container {
.context-menu-dropdown {
// display: none !important;
}
.group-picture.mini-mode {
// display: inline !important;
// cursor: pointer;
}
.group-picture {
// display: none;
}
}
.group-content {
// display: none;
}
}
}
.home-list__content {
}
}
}
.position-relative {
.dropdown {
// top: 50px;
}
}
}

View File

@ -0,0 +1,80 @@
.main-page__content {
.menu-bar__content {
// max-width: 24em;
// min-width: 20em;
.groups-header {
// display: flex;
// justify-content: space-between;
// align-items: center;
.dropdown {
&.profile-dropdown {
// display: none;
}
}
}
.group-filter-mobile {
// display: none;
}
.toggle-sidebar {
// display: none;
}
.toggle-menu-bar {
// display: none;
}
&.mini {
// max-width: 5em;
// min-width: 5em;
.right-icons {
& > .btn:not(.toggle-list),
.group-name,
& > svg {
// display: none;
}
}
.groups-header {
.toggle-search {
// display: none;
}
.toggle-filter {
// display: none;
}
}
.group-item {
.group-row {
.group-picture-container {
.context-menu-dropdown {
// display: none !important;
}
.group-picture.mini-mode {
// display: inline !important;
// cursor: pointer;
}
.group-picture {
// display: none;
}
}
.group-content {
// display: none;
}
}
}
.home-list__content {
}
}
}
.position-relative {
.dropdown {
// top: 50px;
}
}
}

View File

@ -0,0 +1,81 @@
.main-page__content {
.menu-bar__content {
// max-width: 40%;
// min-width: 40%;
right:4.5em;
.groups-header {
// display: flex;
// justify-content: space-between;
// align-items: center;
.dropdown {
&.profile-dropdown {
// display: none;
}
}
}
.group-filter-mobile {
// display: none;
}
.toggle-sidebar {
// display: none;
}
.toggle-menu-bar {
// display: none;
}
&.mini {
// max-width: 5em;
// min-width: 5em;
.right-icons {
& > .btn:not(.toggle-list),
.group-name,
& > svg {
// display: none;
}
}
.groups-header {
.toggle-search {
// display: none;
}
.toggle-filter {
// display: none;
}
}
.group-item {
.group-row {
.group-picture-container {
.context-menu-dropdown {
// display: none !important;
}
.group-picture.mini-mode {
// display: inline !important;
// cursor: pointer;
}
.group-picture {
// display: none;
}
}
.group-content {
// display: none;
}
}
}
.home-list__content {
}
}
}
.position-relative {
.dropdown {
// top: 50px;
}
}
}

View File

@ -0,0 +1,81 @@
.main-page__content {
.menu-bar__content {
// -webkit-box-flex: 1;
// -ms-flex: 1 1 100%;
// max-width: 200px;
// width: auto;
// position: fixed!important;
.groups-header {
display: flex;
justify-content: space-between;
align-items: center;
.dropdown {
&.profile-dropdown {
display: none;
}
}
}
.group-filter-mobile {
display: none;
}
.toggle-sidebar {
display: none;
}
.toggle-menu-bar {
display: none;
}
&.mini {
max-width: 5em;
min-width: 5em;
.right-icons {
& > .btn:not(.toggle-list), .group-name ,& > svg {
display: none;
}
}
.groups-header {
.toggle-search {
display: none;
}
.toggle-filter {
display: none;
}
}
.group-item {
.group-row {
.group-picture-container {
.context-menu-dropdown {
display: none !important;
}
.group-picture.mini-mode {
display: inline !important;
cursor: pointer;
}
.group-picture {
display: none;
}
}
.group-content {
display: none;
}
}
}
.home-list__content {
}
}
}
.position-relative {
.dropdown {
// top: 50px;
}
}
}

View File

@ -0,0 +1,3 @@
.mobile-footer {
display: none;
}

View File

@ -0,0 +1,45 @@
// 200px
@media screen and (min-width: 200px) {
// @import "./200/main_200";
}
//400px
@media screen and (min-width: 24.938em) {
// @import "./400/group";
// @import "./399/sub_header_399";
// @import "./399/the_navbar_399";
}
// 576px
@media screen and (min-width: 36em) {
// @import "./576/group";
// @import "./576/sub_header_576";
// @import "./576/my_table_576";
}
// 768px
@media screen and (min-width: 48em) {
// @import "./768/group";
// @import "./576/sub_header_576";
// @import "./576/my_table_576";
}
// 992px
@media screen and (min-width: 62em) {
// @import "./992/group";
// @import "./992/the-footer";
// @import "./992/sub_header_992";
}
// 1200px
// 1400px
// // 1600px
// @media screen and (min-width: 100.000em) {
// @import "./992/category_992";
// }
// //1800px
// @media screen and (min-width: 112.500em) {}
// //2000px
// @media screen and (min-width: 125.000em) {}

View File

@ -0,0 +1,11 @@
// the base pixel size is : "16px"
//
// max width media queries
//
@import "./max_width/max_width.scss";
//
// min width media queries
//
@import "./min_width/min-width.scss";

View File

@ -0,0 +1,178 @@
<template>
<div class="advanced-search firefox-scrollbar">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<form>
<component
v-for="(formElement, index) in localFormElements"
:key="index"
:formElement="getValueToFormElement(formElement)"
:inputClass="formElement.inputClass"
:labelClass="formElement.labelClass"
:is="returnComponentName(formElement.type)"
@tribute-on-search="remoteSearch"
@oninput="createQuery($event, index)"
class="inside-advanced-search"
></component>
<div class="d-flex justify-content-end align-items-baseline">
<div class="bottom-close-form ms-3">
<a @click.prevent="closeAdvancedSearch">بستن</a>
</div>
<div class="bottom-save-form">
<button
type="submit"
class="btn btn-primary"
style="font-size: 11px; height: 3em; width: 7em"
@click.prevent="searchStart()"
>
جستجو
</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</template>
<script>
import { useResearchStore } from "~/stores/researchStore";
import { mapState } from "pinia";
export default {
data() {
return {
listUpdatedText: {},
localFormElements: [],
value: "",
};
},
computed: {
...mapState(useSearchStore, ["searchActiveTabGetter"]),
...mapState(useResearchStore, ["researchSchemaGetter"]),
},
watch: {
researchSchemaGetter: {
handler: function (newSchema) {
if (newSchema[0].advance)
this.localFormElements = structuredClone(newSchema[0].advance);
},
// deep: true,
immediate: true,
},
},
beforeMount() {
this.httpService = new HttpService(import.meta.env.VITE_BASE_URL);
},
mounted() {
this.localFormElements = structuredClone(
this.researchSchemaGetter[0].advance
);
},
methods: {
closeAdvancedSearch() {
this.$emit("closeAdvancedSearch");
},
remoteSearch({ text, cb, item }) {
// for clearing the query when user remove by keyboard backspace.
if (text == "") this.makeSearchParams(undefined, 1);
let url = item.completion;
text = text.trim();
url = url.replace("{{key}}", this.researchSchemaGetter[0].key);
if (text == "") url = url.replace("/{{query}}", "");
else url = url.replace("{{query}}", text);
this.httpService.getRequest(url).then((response) => {
cb(response.data);
});
},
getValueToFormElement(elements) {
Object.keys(elements).forEach((key, index) => {
elements["value"] = this.researchSchemaGetter[0][elements.key];
});
return elements;
},
saveComponentValue(value, formElement) {
// در صورت تغییر نگهداری می شود تا وقتی کلید ثبت زد، ذخیره شود
if (this.researchSchemaGetter[0][formElement.key] != value) {
this.listUpdatedText[formElement.key] = value;
}
},
returnComponentName(type) {
// if(!this.isEditable(searchActiveTabGetter?.key))
// return "LabelComponent";
if (type == "select") return "SelectComponent";
else if (type == "range_date") return "RangeDateComponent";
else if (type == "completion") return "TributeComponent";
else return "InputComponent";
},
// این لازم نیست و استفاده نداره!!!!!
// saveProperty() {
// let id = this.$route.params.id;
// let key = this.$route.params.key;
// let formData = {
// id: id,
// meta: JSON.stringify(this.listUpdatedText),
// };
// let url = "/public/{{index_key}}/update/{{id}}";
// url = url.replace("{{index_key}}", key).replace("{{id}}", id);
// this.httpService.postRequest(url, formData).then((res) => {
// this.getServerItem();
// });
// },
createQuery(evt, index) {
// evt.target.value => from input component.
//evt => from datetime component.
let value = evt?.target?.value ?? evt;
this.$emit("set-query-advanced", this.makeSearchParams(value, index));
},
makeSearchParams(value, index) {
if (value != undefined) this.localFormElements[index].value = value;
else this.localFormElements[index].value = undefined;
let query = "";
this.localFormElements.forEach((item, rowIndex, array) => {
if (item.value?.length)
query += "#" + item.tag + " " + item.value + " ";
});
return query;
},
searchStart() {
this.$emit("searchStart", this.searchStartValue());
},
searchStartValue() {
let query = "";
this.localFormElements.forEach((item, rowIndex, array) => {
if (item.value?.length)
query += "#" + item.tag + " " + item.value + " ";
});
return myEncodeQuery(query);
},
myEncodeQuery(text) {
let ch1 = encodeURIComponent("#");
let ch2 = encodeURIComponent("/");
let ch3 = encodeURIComponent("\\");
// let ch4 = encodeURIComponent(".");
text = text.replaceAll("#", ch1);
text = text.replaceAll("/", "\\");
text = text.replaceAll("\\", ch3);
// text = text.replaceAll(".", '%2E');
return text;
},
},
};
</script>

View File

@ -0,0 +1,76 @@
<template>
<form
class="container"
role="create"
style="height: 100%; display: flex; flex-direction: column"
>
<div class="form-group">
<label>نام را وارد کنید :</label>
<input
type="text"
class="form-control"
placeholder="شروع به نوشتن کنید"
v-focus
v-model="nameInput"
/>
</div>
<div class="form-row d-flex justify-content-end">
<div class="form-group">
<button
@click.prevent="close()"
type="button"
class="btn btn-default"
data-dismiss="modal"
>
بستن
</button>
<button
@click.prevent="save()"
type="button"
class="btn btn-outline-primary me-2"
>
ذخیره
</button>
<!-- <button
:disabled="fetchingData"
@click.prevent="remove()"
type="button"
class="btn btn-primary"
>
حذف
</button> -->
</div>
</div>
</form>
</template>
<script>
export default {
props: {
value: {
default: "",
},
},
mounted() {
this.httpService = new HttpService(import.meta.env.VITE_BASE_URL);
},
data() {
return {
nameInput: "",
inputfocused: false,
};
},
methods: {
close() {
this.$emit("closeAddName");
},
save() {
this.$emit("addNewChildren", this.nameInput);
this.$emit("close");
},
},
};
</script>

View File

@ -0,0 +1,74 @@
<template>
<form
class="container"
role="create"
style="height: 100%; display: flex; flex-direction: column"
>
<div class="form-group">
<label>نام را وارد کنید :</label>
<input
type="text"
class="form-control"
placeholder="شروع به نوشتن کنید"
v-model="nameInput"
/>
</div>
<div class="form-row d-flex justify-content-end">
<div class="form-group">
<button
@click.prevent="close()"
type="button"
class="btn btn-default"
data-dismiss="modal"
>
بستن
</button>
<button
@click.prevent="save()"
type="button"
class="btn btn-outline-primary me-2"
>
ذخیره
</button>
<!-- <button
:disabled="fetchingData"
@click.prevent="remove()"
type="button"
class="btn btn-primary"
>
حذف
</button> -->
</div>
</div>
</form>
</template>
<script>
export default {
props: {
value: {
default: "",
},
},
mounted() {
this.httpService = new HttpService(import.meta.env.VITE_BASE_URL);
},
data() {
return {
nameInput: "",
};
},
methods: {
close() {
this.$emit("closeAddName");
},
save() {
this.$emit("addNew", this.nameInput);
this.$emit("close");
},
},
};
</script>

View File

@ -0,0 +1,78 @@
<template>
<form
class="container"
role="create"
style="height: 100%; display: flex; flex-direction: column"
>
<div class="form-group">
<label>نام را وارد کنید :</label>
<input
type="text"
class="form-control"
placeholder="شروع به نوشتن کنید"
v-model="nameInput"
/>
</div>
<div class="form-row d-flex justify-content-end">
<div class="form-group">
<button
@click.prevent="close()"
type="button"
class="btn btn-default"
data-dismiss="modal"
>
بستن
</button>
<button
@click.prevent="save()"
type="button"
class="btn btn-outline-primary me-2"
>
ذخیره
</button>
<!-- <button
:disabled="fetchingData"
@click.prevent="remove()"
type="button"
class="btn btn-primary"
>
حذف
</button> -->
</div>
</div>
</form>
</template>
<script>
export default {
props: {
value: {
default: "",
},
editingItem: {
default: {},
},
},
mounted() {
this.httpService = new HttpService(import.meta.env.VITE_BASE_URL);
this.nameInput = this.editingItem?.text
},
data() {
return {
nameInput: "",
};
},
methods: {
close() {
this.$emit("closeAddName");
},
save() {
this.$emit("edit", this.nameInput);
this.$emit("close");
},
},
};
</script>

View File

@ -0,0 +1,169 @@
<template>
<form @submit.prevent="save()">
<div class="form-group form-row">
<label class="col-2" for="title">عنوان: </label>
<input
class="form-control col"
placeholder="عنوان را وارد کنید"
type="text"
id="title"
name="title"
v-model.trim="selectedItemClone.title"
/>
</div>
<div class="form-group form-row">
<div class="col-12 d-flex justify-content-between">
<div class="d-flex">
<button-component
type="submit"
classes="btn-outline-primary"
:buttonText="buttonText"
:buttonLoading="buttonLoading"
></button-component>
<button-component
classes="btn-default"
@click="closeModal()"
buttonText="انصراف"
:buttonLoading="buttonLoading"
></button-component>
</div>
<button-component
v-if="selectedItem.id"
classes="delete-btn btn-outline-danger"
@click="deleteItem()"
buttonText="حذف"
:buttonLoading="buttonLoading"
>
<i class="tavasi tavasi-bin"></i>
</button-component>
</div>
</div>
</form>
</template>
<script>
import apis from "~/apis/listApi";
import { mapState } from "pinia";
export default {
props: {
selectedItem: {
default() {
return {};
},
},
parentId: {
default: 0,
},
apiName: {
type: String,
default: '',
},
},
emits: ["update-list", "close-modal", "delete-item"],
data() {
return {
buttonLoading: false,
selectedItemClone: {
id: undefined,
title: "",
listtype: 0,
projectid: this.selectedProjectGetter?.id,
parent: this.parentId,
},
};
},
computed: {
...mapState("list", [
"selectedProjectGetter",
"listIdGetter",
"selectedItemGetter",
]),
buttonText() {
return this.selectedItemClone.id || this.selectedItemClone.guid
? "ذخیره"
: "ثبت";
},
},
methods: {
save() {
if (this.buttonLoading) return;
this.buttonLoading = true;
// apiName = subject | list
const url = this.selectedItemClone.id
? apis[this.apiName].edit
: apis[this.apiName].add;
this.selectedItemClone.listid = this.listIdGetter;
ApiService.formData(url, this.selectedItemClone)
.then((res) => {
mySwalToast({
title: "تبریک",
html: res.data.message,
icon: "success",
});
this.$emit("update-list");
})
.finally(() => {
this.buttonLoading = false;
});
},
deleteItem() {
if (this.buttonLoading) return;
this.buttonLoading = true;
const data = { id: this.listIdGetter, projectid: this.selectedProjectGetter?.id };
mySwalConfirm({
title: "هشدار!!!",
html: "از حذف این مورد مطمئن هستید؟",
}).then((result) => {
if (result.isConfirmed) {
ApiService.formData(apis.item.delete, data)
.then((response) => {
mySwalToast({
title: "تبریک",
html: response.data.message,
icon: "success",
});
this.$emit("delete-item");
})
.finally(() => {
this.buttonLoading = false;
});
}
});
},
closeModal() {
this.resetForm();
this.$emit("close-modal");
},
resetForm() {
this.selectedItemClone = {
id: undefined,
title: "",
listtype: 0,
projectid: this.selectedProjectGetter?.id,
parent: this.parentId,
};
},
},
mounted() {
if (this.selectedItem?.id)
this.selectedItemClone = structuredClone(this.selectedItem);
else this.resetForm();
},
};
</script>

View File

@ -0,0 +1,94 @@
<template>
<form
class="create-form container"
role="create"
style="height: 100%; display: flex; flex-direction: column"
>
<div class="form-row">
<div class="form-group">
<input
class="form-check-input"
type="radio"
value="delete_all"
v-model="selectedOption"
/>
<label for="title" class="me-5">حذف کل شاخه:</label>
</div>
</div>
<div class="form-row">
<div class="form-group">
<input
class="form-check-input"
type="radio"
value="delete_one"
v-model="selectedOption"
/>
<label for="title" class="me-5">حذف گره اصلی:</label>
</div>
</div>
<div class="d-flex justify-content-center">
<div v-if="selectedOption == 'delete_all'">
<p>مراقب باشد کل داده شما پاک میشود</p>
</div>
<div v-else-if="selectedOption == 'delete_one'">
<p>فقط مقدار اول پاک می شود و داده های آن به شاخه اصلی منتقل می شود</p>
</div>
<div v-else>
<p>یکی از موارد را انتخاب کنید</p>
</div>
</div>
<div class="d-flex justify-content-end align-items-end mt-auto">
<button
@click.prevent="close()"
type="button"
class="btn btn-secondary"
data-dismiss="modal"
>
بستن
</button>
<button
@click.prevent="save()"
type="button"
class="btn btn-primary me-2"
>
حذف
</button>
</div>
</form>
</template>
<script>
import apis from "~/apis/borhanApi.js";
export default {
props: {
value: {
default: "",
},
},
mounted() {
this.httpService = new HttpService(import.meta.env.VITE_BASE_URL);
},
data() {
return {
selectedOption: null,
};
},
methods: {
close() {
this.$emit("close");
},
save() {
this.$emit("removItem", this.selectedOption);
this.$emit("close");
this.selectedOption = ""
},
},
};
</script>

View File

@ -0,0 +1,290 @@
<template>
<div class="prodigy-annotator c01118">
<div class="c01119">
<div class="prodigy-container c01139 c01137">
<div tabindex="-1"></div>
<div class="c01146">
<div class="prodigy-title-wrapper c01152">
<div class="prodigy-title c01150 c01147 c01151">
<div tabindex="-1">
<div class="prodigy-labels c01153">
<span
><input
hidden=""
type="radio"
name="label"
id="7cc2eef9-c52c-4a85-a815-aa7229ad261a"
value="PERSON"
checked=""
/><label
class="prodigy-label c01154 c01155"
for="7cc2eef9-c52c-4a85-a815-aa7229ad261a"
data-prodigy-label="PERSON"
>PERSON<span class="c01156">1</span></label
></span
><span
><input
hidden=""
type="radio"
name="label"
id="cb04bff7-3de1-4f74-a3e8-7f8ef398d98b"
value="ORG"
/><label
class="prodigy-label c01154"
for="cb04bff7-3de1-4f74-a3e8-7f8ef398d98b"
data-prodigy-label="ORG"
>ORG<span class="c01156">2</span></label
></span
>
</div>
</div>
</div>
</div>
<div class="prodigy-content c01158 c01157">
<div
ref="section1"
id="section1"
@mouseup.left="onMouseUp($event)"
class="c01164 c01148 c01165"
>
<p id="c01157">
ماده واحده - به بانک مرکزی جمهوری اسلامی ایران اجازه داده می شود
در اجرای ماده (11) قانون موافقتنامه تشویق و حمایت متقابل از
سرمایه گذاری بین دولت جمهوری اسلامی ایران و دولت پادشاهی بحرین
مصوب 1382/10/23 با همکاری معاونت حقوقی ریاست جمهوری نسبت به طی
فرایند داوری مطابق موافقتنامه مذکور درباره اختلافات آن شرکت با
دولت بحرین اقدام نماید.
</p>
</div>
</div>
</div>
<!-- <div class="c01202 prodigy-meta">
<span><strong>SOURCE: </strong>CMU Movie Summary Corpus</span>
</div> -->
</div>
</div>
<!-- <footer class="c01122">
<div class="prodigy-buttons c01127 c01126">
<button
class="prodigy-button-accept c01129 c01130"
aria-label="accept (a)"
title="accept (a)"
>
<svg
aria-hidden="true"
fill="currentColor"
width="40"
height="40"
viewBox="0 0 24 24"
class="c01134"
>
<path
d="M9 16.172l10.594-10.594 1.406 1.406-12 12-5.578-5.578 1.406-1.406z"
></path>
</svg></button
><button
class="prodigy-button-reject c01129 c01131"
aria-label="reject (x)"
title="reject (x)"
>
<svg
aria-hidden="true"
fill="currentColor"
width="40"
height="40"
viewBox="0 0 24 24"
class="c01134"
>
<path
d="M18.984 6.422l-5.578 5.578 5.578 5.578-1.406 1.406-5.578-5.578-5.578 5.578-1.406-1.406 5.578-5.578-5.578-5.578 1.406-1.406 5.578 5.578 5.578-5.578z"
></path>
</svg></button
><button
class="prodigy-button-ignore c01129 c01132"
aria-label="ignore (space)"
title="ignore (space)"
>
<svg
aria-hidden="true"
fill="currentColor"
width="40"
height="40"
viewBox="0 0 24 24"
class="c01134"
>
<path
d="M12 20.016c4.406 0 8.016-3.609 8.016-8.016 0-1.828-0.609-3.563-1.688-4.922l-11.25 11.25c1.359 1.078 3.094 1.688 4.922 1.688zM3.984 12c0 1.828 0.609 3.563 1.688 4.922l11.25-11.25c-1.359-1.078-3.094-1.688-4.922-1.688-4.406 0-8.016 3.609-8.016 8.016zM12 2.016c5.531 0 9.984 4.453 9.984 9.984s-4.453 9.984-9.984 9.984-9.984-4.453-9.984-9.984 4.453-9.984 9.984-9.984z"
></path>
</svg></button
><button
class="prodigy-button-undo c01129 c01133"
aria-label="undo (backspace, del)"
title="undo (backspace, del)"
>
<svg
aria-hidden="true"
fill="currentColor"
width="40"
height="40"
viewBox="0 0 24 24"
class="c01134"
>
<path
d="M11.016 9l1.406 1.406-3.609 3.609h9.188v-10.031h2.016v12h-11.203l3.609 3.609-1.406 1.406-6-6z"
></path>
</svg>
</button>
</div>
</footer> -->
</div>
</template>
<script>
// import Vue from "vue";
// import VueRecord from "@codekraft-studio/vue-record";
import { mapState, mapActions } from "pinia";
import chatApi from "~/apis/chatApi";
import selectTextMixin from "~/research/mixins/selectTextMixin";
// import commentMixin from "~/mixins/commentMixin";
export default {
mixins: [selectTextMixin],
beforeMount() {
// this.initServices();
},
mounted() {
// this.linksHandler();
},
watch: {
$route: {
handler: function (to) {},
deep: true,
// immediate: true,
},
},
computed: {
...mapState([
"getPanelStatus",
"isSidebarCollapsed",
"currentUser",
"sidebarListStatusGetter",
]),
},
methods: {
...mapActions(["checkPermissions"]),
},
};
</script>
<style lang="scss" scoped>
.c01150 {
color: #fff;
width: 100%;
padding: 15px 20px;
font-size: 20px;
background: #583fcf;
text-align: center;
box-sizing: border-box;
font-weight: bold;
font-family: "Roboto Condensed", "Arial Narrow", sans-serif;
text-transform: uppercase;
border-top-left-radius: 0;
border-top-right-radius: 0;
}
.c01151 {
padding: 8px 20px;
}
.c01147 {
display: flex;
text-align: left;
}
.c01152 {
top: 0;
width: 100%;
z-index: 100;
position: sticky;
}
.c01153 {
display: flex;
flex-wrap: wrap;
}
.c01150 {
color: #fff;
font-size: 20px;
text-align: center;
font-weight: bold;
font-family: "Roboto Condensed", "Arial Narrow", sans-serif;
text-transform: uppercase;
}
.c01154 {
margin: 5px 10px 5px 0;
border: 1px solid;
cursor: pointer;
display: block;
padding: 1px 10px;
position: relative;
border-radius: 4px;
}
.c01148 {
padding: 20px;
line-height: 2;
}
.c01165 ::selection {
background: #ffe184;
}
.c01186 {
margin: 0 1px;
display: inline-block;
position: relative;
}
.c01210 {
color: #583fcf;
font-size: 0.675em;
font-weight: bold;
font-family: "Roboto Condensed", "Arial Narrow", sans-serif;
margin-left: 8px;
text-transform: uppercase;
vertical-align: middle;
}
.c01174 {
top: -7px;
left: -7px;
color: #fff;
width: 14px;
height: 14px;
display: flex;
opacity: 0;
z-index: 10;
position: absolute;
font-size: 0.9em;
background: #444;
text-align: center;
transition: opacity 0.1s ease;
align-items: center;
font-family: sans-serif;
line-height: 1.1;
user-select: none;
border-radius: 50%;
justify-content: center;
}
.c01172 {
position: relative;
}
.c01173:hover .c01174 {
opacity: 1;
}
.c01206 {
color: inherit;
margin: 0 0.15em;
display: inline;
padding: 0.25em 0.4em;
background: #ffe184;
font-weight: bold;
line-height: 1;
box-decoration-break: clone;
}
</style>

View File

@ -0,0 +1,29 @@
<template>
<div>سسسس</div>
</template>
<script>
import researchApi from "~/apis/researchApi";
import { mapActions, mapState } from "pinia";
import { useResearchStore } from "~/stores/researchStore";
export default {
data() {
return {
httpService: undefined,
};
},
computed: {
...mapState(useResearchStore, ["researchSchemaGetter"]),
},
beforeMount() {
this.httpService = new HttpService(import.meta.env.VITE_BASE_URL);
},
};
</script>

View File

@ -0,0 +1,843 @@
<template>
<div class="">
<div class="pt-1">
<div class="search-items firefox-scrollbar">
<div
class="search-items__item"
v-for="(item, i) in listAnswer"
:key="i"
>
<div>
<div class="search-items__header">
<a class="search-items__label text__13 text__dark-gray">{{
item._source.research_type
}}</a>
<a
class="search-items__title text__15 text__blue"
@click.prevent="showModalResearch(item, true)"
@auxclick.prevent.stop="showModalResearch(item, true)"
v-html="
highlightKey(item, 'title', 'text_subject', 'text_user')
"
>
</a>
</div>
<div>
<span style="margin-left: 10px"
>نشانی :
<a
class="search-items__title text__15 text__blue"
@click.prevent="
showtext(item._source, listAnswer, i, item._id)
"
@auxclick.prevent.stop="
showtext(item._source, listAnswer, i, item._id)
"
>
{{ item._source.address ?? "--" }}
</a>
</span>
</div>
<div class="text__15 text__dark-gray search-items__code">
<span style="margin-left: 10px"
>نوع برداشت : {{ item._source.take_type ?? "--" }}</span
>
<span style="margin-left: 10px"
>فعل متن : {{ item._source.text_verb ?? "--" }}</span
>
<span style="margin-left: 10px"
>تاریخ : {{ datefa(item._source.date_create * 1000) }}</span
>
</div>
<div class="search-items__content">
<div
class="text__15 line-clamp__2"
v-html="highlightKey(item, 'text_main')"
></div>
<div
v-if="
item._source?.subject?.length && $route.name == 'TermPage'
"
class="mt-2 text__15 text__dark-gray search-items__code"
>
<span style="margin-left: 10px">اصطلاحات :</span>
<ul>
<li
v-for="(sub, subIndex) in item._source.subject"
:key="subIndex"
>
{{ sub.title }}
</li>
</ul>
</div>
</div>
<div class="search-item__actions">
<span class="tavasi tavasi-more-vert"></span>
<!-- <button
v-can="'search_summary'"
@click.pevent="AddToFavorites(item, i)"
title="علاقه مندی ها"
class="btn show-detail-btn favorites"
type="button"
>
<svg
class="icon"
:class="
item._source.tbookmark == 1
? 'icon-bookmark-1'
: 'icon-bookmark-4'
"
>
<use
:xlink:href="
item._source.tbookmark == 1
? '#icon-bookmark-1'
: '#icon-bookmark-4'
"
></use>
</svg>
</button> -->
<!-- <button
v-can="'search_analyze'"
@click="showDetails(item)"
title="نمایش جزییات"
class="btn show-detail-btn"
type="button"
>
<span class="tavasi tavasi-eye"></span>
</button> -->
<!-- v-can="$route.name + '_subject'" برای موضوع زنی -->
<button
@click="SubjectFormHandler(item)"
title="موضوع زنی"
class="btn show-detail-btn px-1"
type="button"
>
<span class="tavasi tavasi-doc-outline"></span>
</button>
<button
v-can="'search_summary'"
@click="showModalResearch(item, false)"
title="ویرایش"
class="btn show-detail-btn -rotate-180"
type="button"
>
<svg style="color: #adbec4" class="icon icon-Component-242--1">
<use xlink:href="#icon-Component-242--1"></use>
</svg>
</button>
<button
v-can="'search_summary'"
@click="deleteResearch(item)"
title="حذف"
class="btn show-detail-btn -rotate-180"
type="button"
>
<svg style="color: #adbec4" class="icon icon-Component-295--1">
<use xlink:href="#icon-Component-295--1"></use>
</svg>
</button>
<button-component
:title="copyButtonTitleMaker(item._source)"
buttonText=""
class="btn show-detail-btn px-1"
@click="
copyToClipboard(
'',
urlResolver(item._source, item, 'entityResearch')
)
"
>
<svg class="icon icon-copy2 fz-8">
<use xlink:href="#icon-copy2"></use>
</svg>
</button-component>
</div>
</div>
</div>
</div>
<jahat-pagination
class="pagination"
style="font-size: 13px"
v-if="page.total"
:paginationInfo="page"
@page-changed="pageChanged"
@page-limit-changed="pageLimitChanged"
@sort-changed="sortChanged"
>
</jahat-pagination>
</div>
<base-modal
v-if="openSubjectForm"
modalSize="modal-lg"
:modalTitle="modalTitle"
:hasFooter="false"
@close="hideSubjectForm"
>
<component :is="slotComponentName"></component>
</base-modal>
</div>
</template>
<script>
import favoriteApi from "~/apis/favoriteApi";
import researchApi from "~/apis/researchApi";
import { mapState, mapActions } from "pinia";
import { useResearchStore } from "~/stores/researchStore";
export default {
props: {
summeryKeys: {
default() {
return {};
},
},
listAnswer: {
type: Array,
default: () => [],
},
pagination: {
default() {
return {};
},
},
listSelectedPoint: {
default() {
return [];
},
},
},
beforeMount() {
this.httpService = new HttpService(import.meta.env.VITE_REPO_BASE_URL);
},
mounted() {
window.scrollTo(0, 0);
if (this.$route.query.q) this.searchText = this.$route.query.q;
if (this.myActiveSchema) {
this.researchActiveSchemaSetter(this.myActiveSchema);
}
// if (this.listAnswer.length>=0) {
// console.log(this.selectedlists)
// this.listAnswer=this.selectedlists
// }
},
watch: {
// selectedlists(newVal) {
// if (this.listAnswer.length>=0) {
// console.log(this.selectedlists)
// this.listAnswer=this.selectedlists
// }
// },
pagination(newVal) {
this.page = newVal;
},
listSelectedPoint(newVal) {
this.listAnswer = newVal;
},
},
data() {
return {
openSubjectForm: false,
slotComponentName: "",
modalTitle: "",
showModal: false,
listId: undefined,
projectId: undefined,
selectedItem: undefined,
page: this.pagination,
// listAnswer: [],
totalCount: 0,
typeCount: "",
countInPage: 0,
maxPage: 0,
currentPage: 1,
beginPage: 1,
endPage: 1,
listPage: [],
textSearch: "",
iscode: true,
maxLength: 250,
httpService: undefined,
navigationOptions: [],
sorting: {
sortby: "created",
sortorder: undefined, // asc | desc | none
},
};
},
computed: {
...mapState(["userPermisionGetter", "currentUser", "selectedlists"]),
...mapState(useResearchStore, ["researchSchemaGetter"]),
...mapState(useSearchStore, ["searchActiveTabGetter"]),
showActionMenu() {
let show = false;
if (this.userPermisionGetter?.length)
["search_analyze", "search_summary"].forEach(
(item) =>
(show =
this.currentUser.user_level > 1 ||
this.userPermisionGetter.includes(item))
);
return show;
},
myActiveSchema() {
return this.researchSchemaGetter?.find((item) => {
return item.key == "research";
});
},
},
methods: {
...mapActions("list", ["SET_SELECTED_ITEM", "SET_LIST"]),
...mapActions(useResearchStore, ["researchActiveSchemaSetter"]),
...mapActions("entity", ["SET_ITEM_ENTITY", "SET_LIST_ENTITY"]),
showModalResearch(item, isReadonly) {
let schema = this.myActiveSchema.contextMenu.find(
(itemKey) => itemKey.key === item._source?.research_key
);
this.$emit("researchModalHandler", {
action: "edit",
itemEdit: item,
itemSchema: schema,
isReadonly: isReadonly,
});
},
deleteResearch(item) {
mySwalConfirm({
title: "هشدار!!!",
html: `از حذف <b>${item._source.text_subject}</b> اطمینان دارید؟ `,
icon: "warning",
}).then((result) => {
if (result.isConfirmed) {
let url = researchApi.research.deleteItem;
url = url.replace("{{index_key}}", item._source.ref_key);
url = url.replace("{{id}}", item._id);
this.httpService.postRequest(url).then((res) => {
mySwalToast({
html: res.message,
});
setTimeout(() => {
this.$emit("updateForDeleteResearch");
}, 500);
});
}
});
},
SubjectFormHandler(item) {
this.openModalFilter("SubjectForm", "موضوع زنی");
let cloneItem = structuredClone(item);
cloneItem = { ...item._source, _id: item._id };
this.SET_SELECTED_ITEM(cloneItem);
},
openModalFilter(componentName, title) {
this.openSubjectForm = true;
this.slotComponentName = componentName;
this.modalTitle = title;
setTimeout(() => {
$("#meta-item-modal").modal(
{ backdrop: "static", keyboard: false },
"show"
);
}, 500);
},
hideSubjectForm() {
$("#base-modal").modal({
show: false,
});
setTimeout(() => {
this.openSubjectForm = false;
}, 200);
},
copyButtonTitleMaker(item) {
return `کپی لینک: link:\n${location.origin + this.urlResolver(item)}`;
},
// //This function adds a new favorite to the user's favorites
// AddToFavorites(item, index) {
// if (item._source.tbookmark == 0) {
// let url = favoriteApi.favorite.add;
// url = url.replace("{{data_type}}", "bookmark");
// url = url.replace("{{ref_key}}", this.researchSchemaGetter[0].key);
// const formData = {
// ref_id: item._id,
// title: item._source.title,
// };
// this.httpService.postRequest(url, formData).then((res) => {
// console.log(res);
// // this.UpdateList();
// //refresh After removing or adding favorites
// //this.$emit("UpdateList", item.tbookmark);
// this.updateListAnswer(index, "tbookmark", 1);
// });
// } else {
// let url = favoriteApi.favorite.delete;
// url = url.replace("{{data_type}}", "bookmark");
// url = url.replace("{{id}}", item._id);
// const formData = {
// ref_id: item._id,
// title: item._source.title,
// };
// this.httpService.postRequest(url, formData).then((res) => {
// console.log(res);
// //refresh After removing or adding favorites
// //this.$emit("UpdateList", item.tbookmark);
// this.updateListAnswer(index, "tbookmark", 0);
// });
// }
// },
updateListAnswer(index, key, value) {
if (index in this.listAnswer) {
if (key in this.listAnswer[index]["_source"])
this.listAnswer[index]["_source"][key] = value;
}
},
datefa(item) {
var m = item;
var d = new Date(m).toLocaleDateString("fa-IR");
return d;
},
countAudio(item) {
return item._source.voices;
},
showDetails(selectedItem) {
this.selectedItem = selectedItem;
this.openModal();
},
closeModal() {
$("#subject-modal")?.modal("hide");
setTimeout(() => {
this.showModal = false;
}, 500);
},
openModal() {
this.showModal = true;
setTimeout(() => {
$("#subject-modal")?.modal(
{ backdrop: "static", keyboard: false },
"show"
);
}, 500);
},
highlightKey(item, key1, key2 = "", key3 = "") {
var text = "";
if (item.highlight) {
if (item.highlight[key1]) text = item.highlight[key1].join("... ");
else if (key2 && item.highlight[key2])
text = item.highlight[key2].join("... ");
else if (key3 && item.highlight[key3])
text = item.highlight[key3].join("... ");
}
if (text == "") {
if (item._source[key1]) text = item._source[key1];
else if (key2 && item._source[key2]) text = item._source[key2];
else if (key3 && item._source[key3]) text = item._source[key3];
if (text.length > 500) text = text.substring(0, 500);
}
return text;
},
/*
اگر تب انتخاب شده همه باشد،کلید ها content خواهد بود.
اگر تب انتخاب شده فهرست باشد،کلید ها mindex & mintro خواهد بود.
*/
// urlResolver(_id) {
// if (this.researchSchemaGetter) {
// const routeData = this.$router.resolve({
// name: "navigationView",
// params: {
// id: _id,
// key: this.researchSchemaGetter[0].key,
// },
// query: {},
// });
// return routeData.href;
// }
// },
urlResolver(_source, item, _name = "research") {
const routeData = this.$router.resolve({
name: _name,
params: {
id: _source.ref_id,
key: "sanad",
},
query: {
research_id: item?._id ?? undefined,
research_type: _source?.research_type ?? undefined,
},
});
return routeData.href;
},
showMultiText(id, _listkey) {
let _name = "navigation";
const routeData = this.$router.resolve({
name: _name,
params: {
id: id,
key: this.researchSchemaGetter[0].key,
},
query: {
searchtext: this.textSearch ?? undefined,
listkey: _listkey,
},
});
window.open(routeData.href, "_blank");
},
showtext(item, listAnswer, i, _id) {
let cloneList = structuredClone(listAnswer);
cloneList.forEach((item, index) => {
cloneList[index] = { ...item, ...item._source };
});
let cloneItem = structuredClone(item);
cloneItem = { ...item, _id: _id };
// this.SET_ITEM_ENTITY(cloneItem);
// this.SET_LIST_ENTITY(cloneList);
// localStorage.setItem("myList", JSON.stringify(cloneList));
// localStorage.setItem("myItem", JSON.stringify(cloneItem));
const domainName = buildName() + "";
let _name = "entityResearch";
const routeData = this.$router.resolve({
name: _name,
params: {
id: cloneItem.ref_id,
// key: cloneItem.ref_key,
key: "sanad",
},
query: {
research_id: cloneItem._id ?? undefined,
research_type: cloneItem.research_type ?? undefined,
},
});
window.open(routeData.href, "_blank");
},
setAnswer: function (list, count = -1, _typeCount = "") {
if (count != -1) {
this.totalCount = count;
this.typeCount = _typeCount == "eq" ? "مساوی با " : "بیشتر از ";
this.maxPage =
this.totalCount == 0
? 0
: Math.floor(this.totalCount / this.countInPage) + 1;
this.currentPage = 1;
this.beginPage = 2;
this.endPage = this.beginPage + 3;
if (this.endPage > this.maxPage - 1) {
this.endPage = this.maxPage - 1;
if (this.beginPage > 2) this.beginPage = this.beginPage - 1;
}
this.updateListPage();
}
const total = count;
const pages = Math.ceil(total / this.page.limit);
const pagination = {
total: total,
pages: pages == 0 ? 1 : pages,
};
this.page = { ...this.pagination, ...pagination };
this.listAnswer = list;
this.scrollToTop();
localStorage.setItem("answer", JSON.stringify(this.listAnswer));
},
updateListPage: function () {
this.listPage = [];
for (let i = this.endPage; i >= this.beginPage; i--) {
this.listPage.push(i);
}
setTimeout(() => {
this.scrollToTop();
}, 700);
},
nextPage: function (item) {
if (item > 0) this.setPage(this.currentPage + 1);
else this.setPage(this.currentPage - 1);
},
setPage: function (item) {
if (item == -1) {
// begin ...
item = 3;
this.beginPage = 2;
this.endPage = 5;
} else if (item == -2) {
// end ...
item = this.maxPage - 3;
this.beginPage = this.maxPage - 5;
this.endPage = this.maxPage - 1;
} else if (item == this.beginPage) {
this.beginPage--;
if (this.beginPage > 5) {
this.beginPage--;
this.endPage--;
} else {
this.beginPage = 2;
this.endPage = 5;
}
} else if (item == this.endPage) {
if (this.endPage < this.maxPage - 5) {
this.endPage++;
this.beginPage++;
} else {
this.beginPage = this.maxPage - 5;
this.endPage = this.maxPage - 1;
}
}
this.updateListPage();
this.currentPage = item;
this.$emit("changePage", item - 1);
},
changeCurrent: function (i) {
this.$emit("changeCurrent", this.listAnswer[i]);
},
setTextSearch(item, countInPage) {
this.textSearch = item;
this.countInPage = countInPage;
// console.log(this.textSearch);
},
scrollToTop() {
window.scrollTo(0, 0);
},
//mehdi
pageLimitChanged(paging) {
this.resetPagination();
this.page.limit = paging.limit;
this.$emit("changePage", this.page);
},
pageChanged(paging) {
let page = paging.pageNumber;
page -= 1;
this.page.offset = page * paging.limit;
this.page.limit = paging.limit;
this.page.page = paging.pageNumber;
this.$emit("changePage", this.page);
},
sortChanged(sorting) {
this.page.page = this.page.offset = 0;
this.sorting = sorting;
this.$emit("changePage", this.sorting);
},
resetPagination() {
this.page = {
pages: 0,
total: 0,
page: 1,
offset: 0,
limit: 10,
};
},
setListAnswer() {},
// getListSpecial(_entityType, _specialType) {
// if (this.fetchingData) return;
// this.fetchingData = true;
// this.entity_type = _entityType;
// let url = searchApi.Farhanghestan.search_normal;
// url = url + `/${this.pagination.offset}/${this.pagination.limit}/`;
// this.httpService.getRequest(url).then((res) => {
// this.listEntity = res.hits.hits;
// const total = res.hits.total.value;
// const pages = Math.ceil(total / this.pagination.limit);
// const pagination = {
// total: total,
// pages: pages == 0 ? 1 : pages
// }
// this.pagination = { ...this.pagination, ...pagination };
// this.fetchingData = false;
// });
// },
getList(_entityType) {
if (this.fetchingData) return;
this.fetchingData = true;
this.entity_type = _entityType;
let url =
searchApi.Farhanghestan.search_normal +
`/${this.page.offset}/${this.page.limit}`;
this.httpService.getRequest(url).then((res) => {
this.listEntity = res.hits.hits;
const total = res.hits.total.value;
const pages = Math.ceil(total / this.page.limit);
const pagination = {
total: total,
pages: pages == 0 ? 1 : pages,
};
this.page = { ...this.pagination, ...pagination };
this.fetchingData = false;
});
},
},
};
</script>
<style lang="scss" scoped>
// .detail-page__tab-content {
// width: 90%;
// margin-right: 0 !important;
// position: relative;
// &.serve-majles {
// width: 100%;
// }
// }
// .search-items {
// overflow-y: auto;
// height: calc(100vh - 13em);
// }
.search-items__item {
position: relative;
padding: 1em;
overflow: hidden;
&:not(:last-child) {
margin-bottom: 30px;
}
&:hover,
&.active {
background-color: var(--list-background-color);
.search-item__actions {
// width: 6.5em;
width: auto;
transition: width 0.5s;
background: #fff;
border-radius: 0 0.5em 0.5em 0;
.tavasi-more-vert {
transition: all 0.2s;
display: none;
}
}
}
}
.search-item__actions {
position: absolute;
left: 0;
width: 1.6em;
top: 1em;
// overflow: hidden;
transition: all 0.5s;
display: flex;
align-items: center;
.btn {
display: flex;
align-items: center;
justify-content: center;
padding: 0.175rem 0.35rem;
&:hover {
filter: brightness(0.7);
}
.tavasi,
.icon-copy2 {
color: #adbec4;
}
.icon-copy2 {
font-size: 0.8rem;
}
&.favorites {
color: calc(--primary-color);
.icon-bookmark-1,
.icon-bookmark-4 {
height: 1.3em;
}
}
}
}
// .detail-page__content {
// top: 35px !important;
// }
// @media only screen and (min-width: 576px) and (max-width: 767.98px) {
// .detail-page__content {
// top: 170px !important;
// }
// }
// @media (max-width: 575.98px) {
// .detail-page__content {
// top: 170px !important;
// }
// }
// @media (max-width: 575.98px) {
// }
// @media only screen and (min-width: 576px) and (max-width: 767.98px) {
// .detail-page__tab-content {
// max-width: 500px;
// }
// }
// @media only screen and (min-width: 768px) and (max-width: 900.98px) {
// .detail-page__tab-content {
// max-width: 600px;
// }
// }
// @media only screen and (min-width: 901px) and (max-width: 1049.98px) {
// .detail-page__tab-content {
// max-width: 900px;
// }
// }
// @media (min-width: 1050px) {
// }
</style>

View File

@ -0,0 +1,749 @@
<template>
<div class="">
<div class="" v-if="listAnswer?.length">
<div class="search-items firefox-scrollbar">
<div
class="search-items__item"
v-for="(item, i) in listAnswer"
:key="i"
>
<div>
<div class="search-items__header">
<span class="search-items__label text__13 text__dark-gray">
نشانی
</span>
<a
@click.prevent="goToDocumentPage(item)"
:href="urlResolver(item._source)"
class="search-items__title text__15 text__blue"
v-html="highlightKey(item, 'address')"
>
</a>
</div>
<div class="text__15 text__dark-gray search-items__code">
<span v-if="item._source.take_type" style="margin-left: 10px"
>نوع برداشت : {{ item._source.take_type }}</span
>
<span v-if="item._source.text_verb" style="margin-left: 10px"
>فعل متن : {{ item._source.text_verb }}</span
>
<!-- <span style="margin-left: 10px"
>تاریخ ایجاد : {{ datefa(item._source.date_edit * 1000) }}</span
> -->
<span style="margin-left: 10px"
>تاریخ ایجاد : {{ item._source.date_edit }}</span
>
<span
v-if="item._source.text_position?.length"
style="margin-left: 10px"
>خط : {{ lineExtractor(item._source.text_position) }}</span
>
</div>
<div class="search-items__content">
<div
class="text__15 line-clamp__2"
v-html="highlightKey(item, 'text_main')"
></div>
<div
v-if="item._source?.subject?.length"
class="mt-2 text__15 text__dark-gray search-items__code"
>
<span style="margin-left: 10px">اصطلاحات :</span>
<ul>
<li
v-for="(sub, subIndex) in item._source.subject"
:key="subIndex"
>
{{ sub.title }}
</li>
</ul>
</div>
</div>
<div class="search-item__actions">
<span class="tavasi tavasi-more-vert"></span>
<!-- <button
v-can="'search_summary'"
@click.pevent="AddToFavorites(item, i)"
title="علاقه مندی ها"
class="btn show-detail-btn favorites"
type="button"
>
<svg
class="icon"
:class="
item._source.tbookmark == 1
? 'icon-bookmark-1'
: 'icon-bookmark-4'
"
>
<use
:xlink:href="
item._source.tbookmark == 1
? '#icon-bookmark-1'
: '#icon-bookmark-4'
"
></use>
</svg>
</button> -->
<!-- <button
v-can="'search_analyze'"
@click="showDetails(item)"
title="نمایش جزییات"
class="btn show-detail-btn"
type="button"
>
<span class="tavasi tavasi-eye"></span>
</button> -->
<!-- v-can="$route.name + '_subject'" برای موضوع زنی -->
<button
@click="openModalFilter(item,'SubjectForm', 'فیلتر ها')"
title="موضوع زنی"
class="btn show-detail-btn px-1"
type="button"
>
<span class="tavasi tavasi-doc-outline"></span>
</button>
<!-- <button
v-can="'search_summary'"
@click="changeCurrent(i)"
title="مشخصات"
class="btn show-detail-btn -rotate-180"
type="button"
>
<span class="tavasi tavasi-Component-71--1"></span>
</button> -->
<button-component
:title="copyButtonTitleMaker(item._id)"
buttonText=""
class="btn show-detail-btn px-1"
@click="copyToClipboard('', urlResolver(item._source))"
>
<svg class="icon icon-copy2 fz-8">
<use xlink:href="#icon-copy2"></use>
</svg>
</button-component>
</div>
</div>
</div>
</div>
<jahat-pagination
class="pagination"
style="font-size: 13px"
v-if="page.total"
:paginationInfo="page"
@page-changed="pageChanged"
@page-limit-changed="pageLimitChanged"
@sort-changed="sortChanged"
>
</jahat-pagination>
</div>
<no-data v-else></no-data>
<!-- <SubjectModal
v-if="showModal"
:selectedItem="selectedItem"
@close-modal="closeModal"
>
</SubjectModal> -->
<base-modal
v-if="openSubjectForm"
modalSize="modal-lg"
:modalTitle="modalTitle"
:hasFooter="false"
@close="hideSubjectForm"
>
<component :metaItems="selectedItem?._source?.subject" :is="slotComponentName"></component>
</base-modal>
</div>
</template>
<script>
import favoriteApi from "~/apis/favoriteApi";
import { mapState, mapActions } from "pinia";
import { useResearchStore } from "~/stores/researchStore";
export default {
props: [
"summeryKeys",
"pagination",
"listSelectedPoint",
"listAnswerForTerm",
],
data() {
return {
openSubjectForm: false,
slotComponentName: "",
modalTitle: "",
showModal: false,
// listId: undefined,
// projectId: undefined,
selectedItem: undefined,
page: this.pagination,
listAnswer: [],
totalCount: 0,
typeCount: "",
countInPage: 0,
maxPage: 0,
currentPage: 1,
beginPage: 1,
endPage: 1,
listPage: [],
textSearch: "",
// iscode: true,
// maxLength: 250,
httpService: undefined,
// navigationOptions: [],
sorting: {
sortby: "created",
sortorder: undefined, // asc | desc | none
},
};
},
beforeMount() {
this.httpService = new HttpService(import.meta.env.VITE_REPO_BASE_URL);
},
computed: {
...mapState(["userPermisionGetter", "currentUser", "selectedlists"]),
...mapState(useResearchStore, ["researchSchemaGetter"]),
// showActionMenu() {
// let show = false;
// if (this.userPermisionGetter?.length)
// ["search_analyze", "search_summary"].forEach(
// (item) =>
// (show =
// this.currentUser.user_level > 1 ||
// this.userPermisionGetter.includes(item))
// );
// return show;
// },
},
watch: {
listAnswerForTerm(newVal) {
this.listAnswer = newVal;
},
pagination(newVal) {
this.page = newVal;
},
listSelectedPoint(newVal) {
this.listAnswer = newVal;
},
},
mounted() {
window.scrollTo(0, 0);
if (this.$route.query.q) this.searchText = this.$route.query.q;
this.listAnswer = this.listAnswerForTerm;
},
methods: {
...mapActions("list", ["SET_SELECTED_ITEM", "SET_LIST"]),
...mapActions("entity", ["SET_ITEM_ENTITY", "SET_LIST_ENTITY"]),
goToDocumentPage({ _source }) {
window.open(this.urlResolver(_source), "_blank");
},
lineExtractor(text_position) {
let items = text_position.split(",");
let from = items[0].split(":")[1];
let to = items[2].split(":")[1];
return `${from} تا ${to}`;
},
openModalFilter(selectedItem,componentName, title) {
this.openSubjectForm = true;
this.slotComponentName = componentName;
this.modalTitle = title;
this.selectedItem = selectedItem;
this.SET_SELECTED_ITEM(selectedItem)
this.openModal();
// setTimeout(() => {
// $("#meta-item-modal").modal(
// { backdrop: "static", keyboard: false },
// "show"
// );
// }, 500);
},
hideSubjectForm() {
$("#base-modal").modal({
show: false,
});
setTimeout(() => {
this.openSubjectForm = false;
}, 200);
},
copyButtonTitleMaker(id) {
return `کپی لینک: link:\n${location.origin + this.urlResolver(id)}`;
},
// //This function adds a new favorite to the user's favorites
// AddToFavorites(item, index) {
// if (item._source.tbookmark == 0) {
// let url = favoriteApi.favorite.add;
// url = url.replace("{{data_type}}", "bookmark");
// url = url.replace("{{ref_key}}", this.researchSchemaGetter[0].key);
// const formData = {
// ref_id: item._id,
// title: item._source.title,
// };
// this.httpService.postRequest(url, formData).then((res) => {
// console.log(res);
// // this.UpdateList();
// //refresh After removing or adding favorites
// //this.$emit("UpdateList", item.tbookmark);
// this.updateListAnswer(index, "tbookmark", 1);
// });
// } else {
// let url = favoriteApi.favorite.delete;
// url = url.replace("{{data_type}}", "bookmark");
// url = url.replace("{{id}}", item._id);
// const formData = {
// ref_id: item._id,
// title: item._source.title,
// };
// this.httpService.postRequest(url, formData).then((res) => {
// console.log(res);
// //refresh After removing or adding favorites
// //this.$emit("UpdateList", item.tbookmark);
// this.updateListAnswer(index, "tbookmark", 0);
// });
// }
// },
updateListAnswer(index, key, value) {
if (index in this.listAnswer) {
if (key in this.listAnswer[index]["_source"])
this.listAnswer[index]["_source"][key] = value;
}
},
datefa(item) {
var m = item;
var d = new Date(m).toLocaleDateString("fa-IR");
return d;
},
countAudio(item) {
return item._source.voices;
},
showDetails(selectedItem) {
this.selectedItem = selectedItem;
this.openModal();
},
closeModal() {
$("#subject-modal")?.modal("hide");
setTimeout(() => {
this.showModal = false;
}, 500);
},
openModal() {
this.showModal = true;
setTimeout(() => {
$("#subject-modal")?.modal(
{ backdrop: "static", keyboard: false },
"show"
);
}, 500);
},
highlightKey(item, key1, key2 = "", key3 = "") {
var text = "";
if (item.highlight) {
if (item.highlight[key1]) text = item.highlight[key1].join("... ");
else if (key2 && item.highlight[key2])
text = item.highlight[key2].join("... ");
else if (key3 && item.highlight[key3])
text = item.highlight[key3].join("... ");
}
if (text == "") {
if (item._source[key1]) text = item._source[key1];
else if (key2 && item._source[key2]) text = item._source[key2];
else if (key3 && item._source[key3]) text = item._source[key3];
if (text.length > 500) text = text.substring(0, 500);
}
return text;
},
/*
اگر تب انتخاب شده همه باشد،کلید ها content خواهد بود.
اگر تب انتخاب شده فهرست باشد،کلید ها mindex & mintro خواهد بود.
*/
urlResolver(_source) {
// const routeData = this.$router.resolve({
// name: "navigationView",
// params: {
// id: _id,
// key: this.researchSchemaGetter[0].key,
// },
// query: {},
// });
const routeData = this.$router.resolve({
name: "navigation",
params: {
id: _source.ref_id,
key: _source.ref_key,
},
});
return routeData.href;
},
showMultiText(id, _listkey) {
let _name = "navigation";
const routeData = this.$router.resolve({
name: _name,
params: {
id: id,
key: this.researchSchemaGetter[0].key,
},
query: {
searchtext: this.textSearch ?? undefined,
listkey: _listkey,
},
});
window.open(routeData.href, "_blank");
},
showtext(item, listAnswer, i, _id) {
let cloneList = structuredClone(listAnswer);
cloneList.forEach((item, index) => {
cloneList[index] = { ...item, ...item._source };
});
let cloneItem = structuredClone(item);
cloneItem = { ...item, _id: _id };
this.SET_ITEM_ENTITY(cloneItem);
this.SET_LIST_ENTITY(cloneList);
localStorage.setItem("myList", JSON.stringify(cloneList));
localStorage.setItem("myItem", JSON.stringify(cloneItem));
const domainName = buildName() + "";
let _name = "navigation";
const routeData = this.$router.resolve({
name: _name,
params: {
id: cloneItem._id,
key: this.researchSchemaGetter[0].key,
},
query: {
searchtext: this.textSearch ?? undefined,
},
});
window.open(routeData.href, "_blank");
},
setAnswer: function (list, count = -1, _typeCount = "") {
if (count != -1) {
this.totalCount = count;
this.typeCount = _typeCount == "eq" ? "مساوی با " : "بیشتر از ";
this.maxPage =
this.totalCount == 0
? 0
: Math.floor(this.totalCount / this.countInPage) + 1;
this.currentPage = 1;
this.beginPage = 2;
this.endPage = this.beginPage + 3;
if (this.endPage > this.maxPage - 1) {
this.endPage = this.maxPage - 1;
if (this.beginPage > 2) this.beginPage = this.beginPage - 1;
}
this.updateListPage();
}
const total = count;
const pages = Math.ceil(total / this.page.limit);
const pagination = {
total: total,
pages: pages == 0 ? 1 : pages,
};
this.page = { ...this.pagination, ...pagination };
this.listAnswer = list;
this.scrollToTop();
localStorage.setItem("answer", JSON.stringify(this.listAnswer));
},
updateListPage: function () {
this.listPage = [];
for (let i = this.endPage; i >= this.beginPage; i--) {
this.listPage.push(i);
}
setTimeout(() => {
this.scrollToTop();
}, 700);
},
nextPage: function (item) {
if (item > 0) this.setPage(this.currentPage + 1);
else this.setPage(this.currentPage - 1);
},
setPage: function (item) {
if (item == -1) {
// begin ...
item = 3;
this.beginPage = 2;
this.endPage = 5;
} else if (item == -2) {
// end ...
item = this.maxPage - 3;
this.beginPage = this.maxPage - 5;
this.endPage = this.maxPage - 1;
} else if (item == this.beginPage) {
this.beginPage--;
if (this.beginPage > 5) {
this.beginPage--;
this.endPage--;
} else {
this.beginPage = 2;
this.endPage = 5;
}
} else if (item == this.endPage) {
if (this.endPage < this.maxPage - 5) {
this.endPage++;
this.beginPage++;
} else {
this.beginPage = this.maxPage - 5;
this.endPage = this.maxPage - 1;
}
}
this.updateListPage();
this.currentPage = item;
this.$emit("changePage", item - 1);
},
changeCurrent: function (i) {
this.$emit("changeCurrent", this.listAnswer[i]);
},
setTextSearch(item, countInPage) {
this.textSearch = item;
this.countInPage = countInPage;
// console.log(this.textSearch);
},
scrollToTop() {
window.scrollTo(0, 0);
},
//mehdi
pageLimitChanged(paging) {
this.resetPagination();
this.page.limit = paging.limit;
this.$emit("changePage", this.page);
},
pageChanged(paging) {
let page = paging.pageNumber;
page -= 1;
this.page.offset = page * paging.limit;
this.page.limit = paging.limit;
this.page.page = paging.pageNumber;
this.$emit("changePage", this.page);
},
sortChanged(sorting) {
this.page.page = this.page.offset = 0;
this.sorting = sorting;
this.$emit("changePage", this.sorting);
},
resetPagination() {
this.page = {
pages: 0,
total: 0,
page: 1,
offset: 0,
limit: 10,
};
},
setListAnswer() {},
// getListSpecial(_entityType, _specialType) {
// if (this.fetchingData) return;
// this.fetchingData = true;
// this.entity_type = _entityType;
// let url = searchApi.Farhanghestan.search_normal;
// url = url + `/${this.pagination.offset}/${this.pagination.limit}/`;
// this.httpService.getRequest(url).then((res) => {
// this.listEntity = res.hits.hits;
// const total = res.hits.total.value;
// const pages = Math.ceil(total / this.pagination.limit);
// const pagination = {
// total: total,
// pages: pages == 0 ? 1 : pages
// }
// this.pagination = { ...this.pagination, ...pagination };
// this.fetchingData = false;
// });
// },
getList(_entityType) {
if (this.fetchingData) return;
this.fetchingData = true;
this.entity_type = _entityType;
let url =
searchApi.Farhanghestan.search_normal +
`/${this.page.offset}/${this.page.limit}`;
this.httpService.getRequest(url).then((res) => {
this.listEntity = res.hits.hits;
const total = res.hits.total.value;
const pages = Math.ceil(total / this.page.limit);
const pagination = {
total: total,
pages: pages == 0 ? 1 : pages,
};
this.page = { ...this.pagination, ...pagination };
this.fetchingData = false;
});
},
},
};
</script>
<style lang="scss" scoped>
// .detail-page__tab-content {
// width: 90%;
// margin-right: 0 !important;
// position: relative;
// &.serve-majles {
// width: 100%;
// }
// }
// .search-items {
// overflow-y: auto;
// height: calc(100vh - 13em);
// }
.search-items__item {
position: relative;
padding: 1em;
overflow: hidden;
&:not(:last-child) {
margin-bottom: 30px;
}
&:hover,
&.active {
background-color: var(--list-background-color);
.search-item__actions {
// width: 6.5em;
width: auto;
transition: width 0.5s;
background: #fff;
border-radius: 0 0.5em 0.5em 0;
.tavasi-more-vert {
transition: all 0.2s;
display: none;
}
}
}
}
.search-item__actions {
position: absolute;
left: 0;
width: 1.6em;
top: 1em;
// overflow: hidden;
transition: all 0.5s;
display: flex;
align-items: center;
.btn {
display: flex;
align-items: center;
justify-content: center;
padding: 0.175rem 0.35rem;
&:hover {
filter: brightness(0.7);
}
.tavasi,
.icon-copy2 {
color: #adbec4;
}
.icon-copy2 {
font-size: 0.8rem;
}
&.favorites {
color: calc(--primary-color);
.icon-bookmark-1,
.icon-bookmark-4 {
height: 1.3em;
}
}
}
}
// .detail-page__content {
// top: 35px !important;
// }
// @media only screen and (min-width: 576px) and (max-width: 767.98px) {
// .detail-page__content {
// top: 170px !important;
// }
// }
// @media (max-width: 575.98px) {
// .detail-page__content {
// top: 170px !important;
// }
// }
// @media (max-width: 575.98px) {
// }
// @media only screen and (min-width: 576px) and (max-width: 767.98px) {
// .detail-page__tab-content {
// max-width: 500px;
// }
// }
// @media only screen and (min-width: 768px) and (max-width: 900.98px) {
// .detail-page__tab-content {
// max-width: 600px;
// }
// }
// @media only screen and (min-width: 901px) and (max-width: 1049.98px) {
// .detail-page__tab-content {
// max-width: 900px;
// }
// }
// @media (min-width: 1050px) {
// }
</style>

View File

@ -0,0 +1,677 @@
<template>
<div class="main-filter" ref="filterdiv">
<!-- <div class="button-hiden text__12" ref="button" :style="{ height: $attrs.height}">
<button class="btn btn-primary" @click.prevent="hidenfilter">
<svg class="icon icon-chevron-double-right ms-1">
<use xlink:href="#icon-chevron-double-right"></use>
</svg>
بستن فیلتر
</button>
</div> -->
<div class="search-items filter-list firefox-scrollbar mt-2">
<div :key="reRender">
<div>
<a
v-if="filterSelect.length"
@click.prevent="emptyFilter()"
class="filters__delete text__12"
>حذف فیلترها
</a>
<filter-items
:key="filterListKey"
:filters="filterItems"
@remove-filter="delFilterItem"
></filter-items>
</div>
<div
v-for="(filter, index) in researchSchemaGetter[0].filter"
v-if="researchSchemaGetter && listFilter && listFilter[filter.source_key]?.buckets.length > 0"
class="filters__sec"
:key="index"
>
<div class="main-title">{{ filter.title }}</div>
<ul>
<li
v-for="(item, i) in getFilterItems(
filter.source_key,
filter.by_more
)"
:key="i"
>
<a
@click.prevent="
toggelClick($event.target, filter.filter_key, item.key)
"
class="text-filter mt-2"
>
<span class="title text__14">{{ getTitle(item) }}</span>
<span class="num text__12">{{ getCount(item) }}</span>
</a>
</li>
<li
v-if="
filter.by_more &&
listFilter &&
listFilter[filter.source_key]?.buckets.length > maxItem
"
style="color: #3f4abc"
>
<a
v-if="!filter_expand2[filter.source_key]"
@click.prevent="setFilterExpand(filter.source_key, true)"
>بیشتر</a
>
<a
v-if="filter_expand2[filter.source_key]"
@click.prevent="setFilterExpand(filter.source_key, false)"
>بستن</a
>
</li>
</ul>
</div>
</div>
</div>
</div>
</template>
<script>
import { mapState, mapActions } from "pinia";
import { useSearchStore } from "~/stores/searchStore";
import { useResearchStore } from "~/stores/researchStore";
export default {
name: "FilterList",
props: ["changePageFilter", "listAggregations", "selectedFilterItems"],
data() {
return {
reRender: 1,
listFilter: [],
filterSelect: [],
filterItems: [],
filterListKey: 1,
filterUrl: "",
filter_schema: [],
filter_expand2: {},
maxItem: 5,
tagsExpanded: false,
isHideFilter: 0,
windowWidth: window?.innerWidth,
};
},
computed: {
...mapState(useSearchStore, [
"searchSchemaGetter",
"searchActiveTabGetter",
"selectionFilterItemsGetter",
]),
...mapState(useResearchStore, [
"researchSchemaGetter",
]),
listTags() {
if (
this.tagsExpanded ||
this.listFilter?.tags?.buckets.length < this.maxItem
)
return this.listFilter.tags.buckets;
else return this.listFilter.tags.buckets.slice(0, this.maxItem);
},
},
watch: {
// changePageFilter(newVal) {
// if (this.$route.name === "searchResult") {
// if (newVal == 0) {
// this.$refs.filterdiv.classList.remove("hide");
// this.$refs.filterdiv.classList.add("show");
// } else {
// this.$refs.filterdiv.classList.remove("show");
// this.$refs.filterdiv.classList.add("hide");
// }
// } else {
// if (newVal == 0) {
// this.$refs.filterdiv.classList.remove("d-none");
// this.$refs.filterdiv.classList.remove("hide");
// this.$refs.filterdiv.classList.add("show");
// } else {
// this.$refs.filterdiv.classList.remove("show");
// this.$refs.filterdiv.classList.add("hide");
// }
// }
// },
filterItems(newVal) {
// this.selectionFilterItemsSetter(newVal)
this.$emit("filterItems", newVal);
},
$route: {
handler: function (to, from) {},
},
},
beforeDestroy() {
window.removeEventListener("resize", this.handleResize);
},
mounted() {
window.addEventListener("resize", this.handleResize);
if (this.$route.name === "searchResult") {
// this.$refs.filterbuttom.classList.add("d-none");
// this.$refs.button.classList.add("d-none");
// this.$refs.filterdiv.classList.remove("show");
} else if (this.$route.name === "searchCategory") {
// this.$refs.filterbuttom.classList.remove("show");
// this.$refs.filterdiv.classList.add("d-none");
// this.$refs.filterbuttom.classList.add("d-none");
// this.hidenfilter();
} else if (this.$route.name === "searchNavigation") {
this.setAnswer(this.listAggregations);
this.filterItems = this.selectedFilterItems ;
this.selectedFilterItems.forEach((element) => {
this.filterSelect.push(element.id);
});
this.searchfilter();
// this.filterSelect = this.selectedFilterItems
} else if (this.$route.name !== "searchCategory") {
// this.$refs.filterbuttom.classList.add("d-none");
// this.$refs.button.classList.add("d-none");
// this.$refs.filterdiv.classList.remove("hide");
}
// window.addEventListener('resize', this.handleResize);
// if (window.innerWidth <= 991) {
// this.$nextTick(() => {
// this.$refs.filterdiv.classList.remove("hide");
// });
// }
},
methods: {
...mapActions(useSearchStore, ["selectionFilterItemsSetter"]),
// handleResize() {
// this.windowWidth = window.innerWidth;
// if (this.$route.name === "searchCategory") {
// this.$refs.filterdiv.classList.add("d-none");
// if (this.windowWidth < 991) {
// this.$refs.filterbuttom.classList.add("d-none");
// this.$refs.filterbuttom.classList.add("hide");
// // this.$refs.filterbuttom.classList.add("d-none");
// } else if (this.windowWidth > 991) {
// this.$refs.filterbuttom.classList.remove("d-none");
// this.$refs.filterbuttom.classList.remove("hide");
// }
// // if (!this.$refs.filterdiv.classList.contains("d-none")) {}
// } else {
// if (this.windowWidth > 991) {
// this.$refs.filterdiv.classList.remove("hide");
// this.$refs.filterdiv.classList.add("show");
// this.$refs.filterbuttom.classList.remove("d-none");
// this.$refs.button.classList.remove("hide");
// } else if (this.windowWidth < 991) {
// this.$refs.filterdiv.classList.remove("show");
// this.$refs.filterdiv.classList.add("hide");
// this.$refs.filterbuttom.classList.add("hide");
// this.$refs.button.classList.add("hide");
// }
// }
// },
showfilter: function () {
// this.$refs.filterdiv.classList.add("show");
// this.$refs.filterdiv.classList.remove("d-none");
// this.$refs.filterdiv.classList.remove("hide");
// this.$refs.filterdiv.classList.add("show");
// this.$refs.filterbuttom.classList.add("hide");
// this.$refs.filterbuttom.classList.remove("show");
this.isHideFilter = 0;
this.$emit("changeHideFilter", this.isHideFilter);
},
hidenfilter: function () {
// this.$refs.filterdiv.classList.remove("show");
// this.$refs.filterdiv.classList.add("hide");
// this.$refs.filterdiv.classList.remove("show");
// this.$refs.filterbuttom.classList.remove("hide");
this.isHideFilter = 1;
this.$emit("changeHideFilter", this.isHideFilter);
},
setAnswer: function (list, emptyPrevFilter = true) {
// console.log(list)
this.listFilter = list;
this.reRender++;
},
resetFilter() {
this.filterSelect = [];
this.filterItems = [];
this.listFilter = [];
this.filterListKey++;
},
emptyFilter: function () {
this.filterSelect = [];
this.filterItems = [];
this.filterListKey++;
this.$el.querySelectorAll("a.active").forEach((el) => {
el.classList.remove("active");
});
this.searchfilter();
},
// toggelClick(el, type, item) {
// var key = type + "#" + item;
// if (el.classList.contains("active")) {
// this.delFilter(key);
// el.classList.remove("active");
// } else {
// this.addFilter(key);
// this.filterItems.push({ id: key, title: item });
// el.classList.add("active");
// }
// // this.selectionFilterItemsSetter(this.filterItems);
// this.filterListKey++;
// },
toggelClick(el, type, item) {
var key = type + "#" + item;
var foundIndex = -1;
// جستجو در آرایه filterItems برای یافتن ایتم مورد نظر
for (var i = 0; i < this.filterItems.length; i++) {
if (this.filterItems[i].id === key) {
foundIndex = i;
break;
}
}
if (foundIndex !== -1) {
// اگر ایتم در آرایه وجود داشت، آن را حذف کن
this.delFilter(key);
// this.filterItems.splice(foundIndex, 1);
el.classList.remove("active");
} else {
// اگر ایتم در آرایه وجود نداشت، آن را اضافه کن
this.addFilter(key);
this.filterItems.push({ id: key, title: item });
el.classList.add("active");
}
// this.selectionFilterItemsSetter(this.filterItems);
this.filterListKey++;
},
delFilterItem(key) {
var index = this.filterItems.indexOf(key);
if (index != -1) {
this.filterSelect.splice(index, 1);
this.filterItems.splice(index, 1);
// this.selectionFilterItemsSetter(this.filterItems);
}
this.filterListKey++;
this.searchfilter();
},
delFilter(key) {
var index = this.filterSelect.indexOf(key);
if (index != -1) {
this.filterSelect.splice(index, 1);
this.filterItems.splice(index, 1);
}
this.filterListKey++;
this.searchfilter();
},
addFilter(key) {
this.filterSelect.push(key);
this.filterListKey++;
this.searchfilter();
},
searchfilter() {
this.filterSelect.sort(function (x, y) {
return y - x;
});
this.filterUrl = "";
var prevType = "";
this.filterSelect.forEach((item) => {
var items = item.split("#");
if (prevType == items[0]) {
this.filterUrl += "$" + items[1];
} else {
this.filterUrl += "&" + items[0] + "=" + items[1];
}
prevType = items[0];
});
this.$emit("filterUpdate", this.filterUrl);
},
isFilterExpand(key) {
if (!(key in this.filter_expand2))
this.$set(this.filter_expand2, key, false);
return this.filter_expand2[key];
},
setFilterExpand(key, state = false) {
this.$set(this.filter_expand2, key, state);
},
getFilterItems(key, by_more = 0) {
if (!(key in this.listFilter)) return [];
if (!by_more) {
return this.listFilter[key].buckets;
} else if (!this.isFilterExpand(key)) {
if (this.listFilter[key].buckets.length < this.maxItem)
return this.listFilter[key].buckets;
else return this.listFilter[key].buckets.slice(0, this.maxItem);
} else return this.listFilter[key].buckets;
},
getTitle(item) {
if (item && item.key && item.key != "") return item.key;
else return "نامشخص";
},
getCount(item) {
if (item.total && item.total.value)
return item.total.value; //برای حالت کولپس اجزاء مثل قانون
else return item.doc_count;
},
},
};
</script>
<style lang="scss" scoped>
.accordion {
margin-top: 24px;
.card {
border-radius: 0;
border: none;
.card-header {
background-color: #fff;
// width: 20em;
display: flex;
align-items: center;
justify-content: space-between;
// border-bottom: none;
button {
position: relative;
left: -31px;
}
p {
width: 10em;
position: relative;
right: -19px;
}
}
.show {
height: 19vh;
}
.card-body {
padding: 0 !important;
height: 25vh;
}
}
}
// .search-items {
// height: calc(100vh - 17em);
// border-left: 1px solid #f2f2e6;
// }
.circle {
position: relative;
width: 30px;
height: 30px;
border-radius: 50%;
border: black solid 1px;
display: flex;
cursor: pointer;
justify-content: center;
align-items: center;
}
.circle-icon {
position: fixed;
margin-right: 15.6%;
top: 9em;
&:hover {
margin-right: 15.9%;
}
}
</style>
<!-- <style lang="scss">
.main-tree {
position: fixed;
right: 57px;
z-index: 10;
top: 149px;
width: 13.1%;
background-color: #fff;
border-left: 1px solid #f2f2e6;
height: 81vh;
}
.main-tree-select {
.form-control {
border-radius: 0.35rem !important;
width: 92% !important;
margin: 15px auto;
}
}
.os-scrollbar-horizontal {
display: none !important;
}
.os-host-overflow {
height: 79vh;
}
.button-close {
display: flex;
justify-content: flex-end;
margin: 5px 0;
button {
border: 0px;
color: #5897fb;
background-color: #fff;
}
}
.detail-page__filters {
top: 7.75rem !important;
}
.scrollbar {
height: 100vh !important ;
padding-right: 18px !important;
padding-left: 18px !important;
}
.display-none {
display: none !important;
}
@media (min-width: 992px) {
.tab-content--scrolled {
max-height: 100vh;
}
.detail-page__filters {
top: 9.15rem !important;
}
.detail-page__filters{
right: 22.1rem !important;
}
}
@media (max-width: 720px) {
.buttonshow {
position: fixed;
right: 5px;
top: 30vh;
}
.detail-page__filters {
top: 11.35rem !important;
}
}
@media (max-width: 575.98px) {
.display-none {
display: flex !important;
}
}
@media only screen and (min-width: 576px) and (max-width: 767.98px) {
.display-none {
display: flex !important;
}
}
@media only screen and (min-width: 768px) and (max-width: 991.98px) {
.display-none {
display: flex !important;
}
}
</style> -->
<style lang="scss" scoped>
// .main-filter {
// background-color: green;
// z-index: 2;
// width: 16.3%;
// height: 82.6vh;
// position: fixed;
// margin-right: 16.5%;
// top: 8.9em;
// top: 0;
// background-color: #fff;
// width: 95%;
// margin: 5px auto;
// height: 100%;
// }
.button-hiden {
padding: 1em;
display: flex;
justify-content: flex-end;
// position: relative;
// top: 21px;
// left: 17px;
// z-index: 9;
.btn {
background-color: var(--primary-color);
font-size: 0.7rem;
border-radius: 0.5em;
border: 1px solid var(--primary-color);
* {
color: #fff;
&::before {
color: inherit;
}
}
}
}
// .body-filter {
// height: calc(100dvh - 13em);
// overflow: auto;
// }
.text-filter {
display: flex;
justify-content: space-between !important;
margin: 0px 12px;
}
.hide {
// transform: translateX(80%);
display: none;
}
.show {
// transform: translateX(0);
display: block;
}
@media (max-width: 575.98px) {
// .main-filter {
// width: 100%;
// height: 99.5vh;
// top: 0;
// margin: 0;
// }
// .search-items {
// height: calc(100vh - 3em);
// border-left: 1px solid #f2f2e6;
// }
// .body-filter {
// height: 100%;
// }
}
@media only screen and (min-width: 576px) and (max-width: 767.98px) {
// .main-filter {
// width: 26em;
// height: 98.2vh;
// top: 11.9em;
// margin-right: 3.5%;
// }
// .search-items {
// height: calc(100vh - 4em);
// }
// .body-filter {
// height: 100%;
// }
}
@media only screen and (min-width: 768px) and (max-width: 991.98px) {
// .main-filter {
// width: 23em;
// height: 83.2vh;
// top: 8.9em;
// margin-right: 6.5%;
// }
// .body-filter {
// height: 100%;
// }
// .search-items {
// height: calc(100vh - 3em);
// }
}
@media only screen and (min-width: 992px) and (max-width: 1049.98px) {
// .main-filter {
// width: 20em;
// height: 83.2vh;
// top: 8.9em;
// margin-right: 5.5%;
// }
.circle-icon {
position: fixed;
margin-right: 2.8em;
top: 9em;
&:hover {
margin-right: 2.9em;
}
}
}
@media (min-width: 1050px) {
// .main-filter {
// width: 20em;
// height: 83.2vh;
// // top: 8.9em;
// margin-right: 3.5em;
// }
.circle-icon {
position: fixed;
margin-right: 2.8em;
top: 9em;
&:hover {
margin-right: 2.9em;
}
}
}
</style>
<style lang="scss">
.filters__delete {
padding: 5px;
}
.text-filter:hover {
.title {
color: var(--primary-color);
}
span {
color: var(--primary-color);
}
}
</style>

View File

@ -0,0 +1,448 @@
<template>
<div
class="container-fluid"
:style="{
height: $attrs.height,
}"
>
<div class="row h-100">
<!-- #region قسمت مربوط به تبهای فعال -->
<div v-if="valueModal.itemSchema">
<div class="col h-100 d-flex flex-column ">
<div class="row " style="height: 90%; overflow: auto;">
<div class="col-12">
<FormBuilder
v-if="showFormBuilder"
:formElements="valueModal.itemSchema.form.items_main"
:formData="formDataInit"
:readOnly="
readOnlyHandler(
valueModal.itemSchema,
valueModal.itemEdit._source.user.user_id
)
"
:displayMode="'default'"
@saveComponentValue="changedFormValues"
class="row"
></FormBuilder>
</div>
<div class="col-12 mt-2" v-show="showMore">
<FormBuilder
v-if="showFormBuilder"
:formElements="valueModal.itemSchema.form.items_more"
:formData="formDataInit"
:displayMode="'default'"
:readOnly="
readOnlyHandler(
valueModal.itemSchema,
valueModal.itemEdit._source.user.user_id
)
"
@saveComponentValue="changedFormValues"
class="row"
></FormBuilder>
</div>
<div
class="col-12 d-flex justify-content-start align-items-start mb-2"
>
<ToggleButton
openText="بیشتر"
openIcon="Component-25--1"
closeText="بستن"
closeIcon="Component-22--1"
@toggle="clickToggleButton"
>
</ToggleButton>
</div>
</div>
<div class="row px-3 border-top h-auto">
<div class="col-12 d-flex justify-content-end align-items-end">
<button
title="ذخیره"
classes="btn btn-outline-primary fz-13"
@click="saveFish(valueModal.action)"
buttonText="ذخیره"
class="btn btn-outline-primary fz-13 mt-2"
:class="{ disabled: valueModal?.isReadonly == true }"
>
ذخیره
</button>
</div>
</div>
</div>
</div>
<div v-else>
<div class="col">
<h2>در حال بارگزاری ...</h2>
<!-- <EntityEditFormBuilder> </EntityEditFormBuilder> -->
</div>
</div>
<!-- #endregion -->
</div>
</div>
</template>
<script>
import entityApi from "~/apis/entityApi.js";
import { mapState } from "pinia";
/**
* @vue-prop {Object} [valueModal={}] - یک آبجکت از مقادیر مورد نیاز برای فیش
* @vue-data {Object} [formDataInit={}] - آبجکتی که شامل مقادیر ورودی ثابت برای فرم بیلدر است
* @vue-data {Object} [changValue={}] - مقادیر بازگشتی از فرم بیلدر که خود فرد پر کرده است
* @vue-data {Object} [itemForEdit={}] - آبجکتی که متشکل از مقادیری است که باید ویرایش شود
* @vue-data {String} [date_create=""] - تاریخ ایجاد فیش
* @vue-data {String} [username=""] - نام فردی که فیش را ایجاد کرده است
* @vue-data {String} [address=""] - آدرس ایجاد فیش
* @vue-data {Number} [showFormBuilder=false] - برای دوباره ساختن فرم بیلدر
* @vue-data {String} [httpService=undefined] - محل قرارگیری URL
* @vue-data {Array} [tableActions=[]] - لیست اقدامات context-menu
* @vue-data {String} [listFishs=""] - لیست تمام فیشهای زده شده
* @vue-data {Boolean} [ShowMore=false] - وضعیت نمایش موارد بیشتر .
*
* @vue-event {Object} removeItemHandler - این متد برای حذف آیتم از لیست استفاده میشود.
* @vue-event {Object} editItemHandler - این متد برای ویرایش آیتم از لیست استفاده میشود.
* @vue-event {String} saveFish - این متد برای ذخیره فیش جدید یا ویرایش شده استفاده میشود.
*/
export default {
props: {
valueModal: {
type: Object,
default: () => ({}),
},
},
beforeMount() {
this.httpService = new HttpService(import.meta.env.VITE_REPO_BASE_URL);
},
mounted() {
if (this.valueModal.action == "edit") {
this.itemForEdit = this.valueModal.itemEdit._source;
// filter null/undefined values
Object.keys(this.itemForEdit).forEach((key) => {
if (this.itemForEdit[key] == null) return;
this.formDataInit[key] = this.itemForEdit[key];
});
}
this.showFormBuilder = true;
},
data() {
return {
showMore: false,
httpService: undefined,
formDataInit: {},
changValue: {},
itemForEdit: {},
date_create: "",
address: "",
username: "",
showFormBuilder: false,
};
},
computed: {
...mapState(["userPermisionGetter", "currentUser"]),
},
methods: {
//برسی میکنه که آیا اجازه ویرایش فیش بدهد یا نه
readOnlyHandler(Schema, OwnerResearch) {
if (this.valueModal.isReadonly == true) return true;
let isUserAccess = this.isEditable(Schema.key);
let isOwnerResearch = "";
if (this.currentUser.user_id == OwnerResearch) isOwnerResearch = true;
else isOwnerResearch = false;
if (isUserAccess == true || isOwnerResearch == true) return false;
else return true;
},
isEditable(key) {
if (key) {
let res = this.hasPermission(key + "_edit");
return res;
}
return true;
},
hasPermission(permission) {
if (this.currentUser?.user_level > 1) return true;
if (this.userPermisionGetter && this.userPermisionGetter?.length)
return this.userPermisionGetter?.includes(permission);
return false;
},
/**
* تغییر وضعیت نمایش بیشتر با توجه به ایونت دریافتی.
* @param {Boolean} event - وضعیت جدید برای نمایش بیشتر.
* @description این متد وضعیت نمایش بیشتر را بر اساس ایونت دریافتی تغییر میدهد.
* این متد معمولاً به عنوان یک هندلر برای ایونتهای toggle استفاده میشود.
*/
clickToggleButton(event) {
this.showMore = event;
},
/**
* بستن مدال.
* @description این متد برای بستن مدال استفاده میشود.
* @fires close
*/
close() {
this.$emit("close");
},
// استفاده نشده ... !!!!!!!!!!!!!!!!!!!
// /**
// * دریافت متن مرجع.
// * @param {Object} fieldFooter متغیر حاوی اطلاعات مرجع
// * @returns {String} متن مرجع
// * @description این متد برای دریافت متن مرجع استفاده میشود.
// */
// referenceText(fieldFooter) {
// if (!fieldFooter.reference) return;
// const regex = /(\{(\w+)\})/gm;
// const str = fieldFooter.reference;
// let m;
// let matches = [];
// while ((m = regex.exec(str)) !== null) {
// if (m.index === regex.lastIndex) {
// regex.lastIndex++;
// }
// matches.push(m);
// }
// let reference = str;
// matches.forEach((match, groupIndex) => {
// let group = match[0];
// let key = group.replace("{", "").replace("}", "");
// reference = reference.replaceAll(
// group,
// this.selectedItemEntityGetter[key]
// );
// });
// this.addressFish = reference;
// return reference;
// },
/**
* دریافت تاریخ امروز به شکل رشته متنی.
* @returns {String} تاریخ امروز به فرمت YYYY/MM/DD
* @description این متد برای دریافت تاریخ امروز به فرمت مشخص شده استفاده میشود.
*/
todays() {
const today = new Date();
const year = today.getFullYear();
const month = today.getMonth() + 1;
const day = today.getDate();
const currentDate = `${year}/${month}/${day}`;
return this.datefa(currentDate);
},
/**
* تبدیل تاریخ میلادی به تاریخ فارسی.
* @param {String} date تاریخ میلادی
* @returns {String} تاریخ فارسی
* @description این متد برای تبدیل تاریخ میلادی به تاریخ فارسی استفاده میشود.
*/
datefa(date) {
var m = date;
var d = new Date(m).toLocaleDateString("fa-IR");
return d;
},
/**
* تغییرات اعمال شده در فرم را ذخیره کنید.
* @param {Object} form فرم با تغییرات جدید
* @description این متد برای ذخیره تغییراتی که در فرم اعمال شدهاند استفاده میشود.
*/
changedFormValues(form) {
Object.keys(form).forEach((key) => {
if (this.itemForEdit[key] !== form[key]) {
this.changValue[key] = form[key];
}
});
},
/**
* ذخیره فیش.
* @param {String} editState وضعیت ویرایش یا اضافه کردن
* @description این متد برای ذخیره فیش جدید یا ویرایش شده استفاده میشود.
*/
saveFish(editState) {
let item = this.changValue;
let url = "";
let formData = {};
let key = "";
if (this.$route.params?.key) key = this.$route.params.key;
if (editState == "edit") {
url = entityApi.fish.update;
url = url.replace("{{id}}", this.valueModal.itemEdit._id);
formData = item;
}
url = url.replace("{{index_key}}", "research");
this.httpService.postRequest(url, formData).then((res) => {
mySwalToast({
html: res.message,
});
this.$emit("closeAfterSaving");
});
},
},
};
</script>
<style scoped lang="scss">
// #region all
.modal {
background-color: rgba(81, 79, 78, 0.577);
}
.modal-dialog {
max-width: 1200px;
margin: 2.75rem auto;
}
.active {
background-color: #e8fcff;
}
.nav_item {
cursor: pointer;
span {
margin-left: 10px;
}
&:hover {
background-color: #e8fcff;
}
}
.button_grop {
display: flex;
justify-content: flex-end;
margin-top: 8px;
}
.footer_fish {
.footer_fish_main {
display: flex;
margin-right: 3px;
margin-top: 12px;
div {
margin-right: 10px;
}
}
}
// #endregion
// #region activeTab===0
.header_fish_list {
display: grid;
justify-content: space-evenly;
// grid-template-columns: 1fr 1fr 1fr;
// grid-template-rows: 1fr 1fr 1fr;
// grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
margin-left: 5px;
// background-color: green;
// grid-template-columns: repeat(3, 12px);
// grid-template-rows: repeat(3, auto);
// grid-row-gap: 1px;
grid-column-gap: 9px;
.header_item {
display: grid;
grid-template-columns: 2fr 4fr;
align-items: center;
justify-items: flex-start;
margin: 5px 5px 5px 5px;
input {
margin: 0 5px !important;
}
}
}
// #endregion
// #region activeTab===1
.main_pag {
width: 83%;
// height: 76vh;
height: 15em;
// display: grid;
// grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
// gap: 15px 15px;
display: flex;
flex-wrap: wrap;
justify-content: flex-start;
align-content: flex-start;
overflow: auto;
}
.card_fish {
width: 17em;
height: 150px;
display: grid;
grid-template-rows: 1fr 2fr 1fr;
justify-self: center;
background-color: #f2f2f2;
border-radius: 10px;
// box-shadow: 0px 3px 7px;
box-shadow: 0px 1px 3px;
margin: 2em;
.img {
display: flex;
justify-content: space-between;
margin: 6px 10px;
.text-date {
font-size: 0.875em;
color: #a7a098;
}
}
.card_fish_main {
.text_fish {
margin: 0px 12px;
height: 73px;
overflow: hidden;
p {
font-size: 12px;
}
}
}
.card_fish_footer {
// display: grid;
display: none;
grid-template-columns: 25px 25px 25px;
align-items: center;
justify-content: flex-end;
div {
font-size: 12px;
}
}
}
// #endregion
@media only screen and (min-width: 768px) and (max-width: 991.98px) {
}
@media only screen and (min-width: 576px) and (max-width: 766.98px) {
}
@media (max-width: 575.98px) {
}
</style>

View File

@ -0,0 +1,647 @@
<template>
<div class="tree-list-container text-end">
<div class="d-flex align-items-center py-1 my-2 border-bottom">
<label for="">پوشه جدید :</label>
<button
class="btn"
@click="openModal('FormAddToTree', ' فرم ایجاد خصوصیت ')"
>
<svg class="icon icon-Component-212--1">
<use xlink:href="#icon-Component-212--1"></use>
</svg>
</button>
</div>
<div class="firefox-scrollbar v-jstree">
<v-jstree
allow-transition
:data="data"
:draggable="true"
ref="tree"
klass="tree-rtl"
size="large"
multiple
tree-rtl
textFieldName="text"
valueFieldName="item"
@item-click="itemclick"
@item-toggle="itemtoggle"
@item-drag-start="onItemDragStart"
@item-drag-end="onItemDragEnd"
@item-drop-before="onItemDropBefore"
@item-drop="onItemDrop"
>
<slot name="node">
<div
class="row tree-item mx-0"
style="width: 25em"
:class="{
'active-item': activeItem && activeItem.id === node.model.id,
}"
@click="setActiveItem(node.model, node.vm)"
>
<div class="col-8">
<div v-if="node.model.isEdit" class="d-flex align-items-center">
<input
type="text"
class="form-control"
v-model="node.model.text"
/>
<button @click.prevent="node.model.isEdit = false" class="btn">
Save
</button>
</div>
<div
class="text-truncate"
v-tooltip="node.model.text"
style="width: 100px"
v-else
>
{{ node.model.text }}
</div>
</div>
<div class="col-4 button-group" v-if="node.model.id !== 0">
<button
@click="removeNode(node.vm)"
class="btn p-0"
style="font-size: 0.6rem"
>
<svg class="icon icon-Component-295--1">
<use xlink:href="#icon-Component-295--1"></use>
</svg>
</button>
<button
@click.prevent="editNode(node.vm)"
class="btn p-0"
style="font-size: 0.6rem"
>
<svg class="icon icon-Component-242--1">
<use xlink:href="#icon-Component-242--1"></use>
</svg>
</button>
<button
@click.prevent="addChildNode(node.model, node.vm)"
class="btn p-0"
style="font-size: 0.6rem"
>
<svg class="icon icon-Component-133--1">
<use xlink:href="#icon-Component-133--1"></use>
</svg>
</button>
</div>
</div>
</slot>
</v-jstree>
</div>
<base-modal
v-if="uploadForFirstTime"
@canel="closeModal()"
:showHeaderCloseButton="true"
:modalTitle="modalTitle"
class="borhan-modal"
modalSize="modal-lg"
height="auto"
maxHeight="20em"
overflow="hidden"
width="30em"
:showSaveButton="true"
:hasFooter="false"
>
<component
:is="slotComponentName"
:uploadForFirstTime="uploadForFirstTime"
:editingItem="editingItem"
@close="closeModal()"
@addNew="addNewItem($event)"
@edit="edit($event)"
@addNewChildren="addNewChildren($event)"
></component>
</base-modal>
</div>
</template>
<script>
// import VJstree from "vue-jstree";
import researchApi from "~/apis/researchApi";
import { mapActions, mapState } from "pinia";
import { useResearchStore } from "~/stores/researchStore";
/**
* @vue-event {Number} increment - Emit counter's value after increment
* @vue-event {Number} decrement - Emit counter's value after decrement
*/
export default {
beforeMount() {
this.httpService = new HttpService(import.meta.env.VITE_BASE_URL);
},
props: {
treeItems: {
default() {
return [];
},
},
newProjects: {
default() {
return [];
},
},
},
data() {
return {
isEdit: false,
// searchText: "",
uploadForFirstTime: false,
slotComponentName: null,
modalTitle: null,
data: [
{
text: "همه",
name: "Root",
id: "0",
pid: "Root",
opened: false,
selected: false,
disabled: true,
loading: false,
children: [],
label: {
backgroundColor: "#ee6666",
},
},
],
httpService: undefined,
editingItem: "",
editingNode: "",
activeItem: null,
colors: [
"#5470C6",
"#d44646",
"#008b8b",
"#3BA272",
"#FC8452",
"#9A60B4",
"#EA7CCC",
"#F59F00",
"#ddc4b0",
"#73C0DE",
"#b333ad",
"#e86c6b",
"#39cfed",
],
currentIndex: 0,
};
},
watch: {
treeItems(newValue) {
this.data[0].children = [];
if (Array.isArray(newValue)) {
newValue.forEach((element, index) => {
const color = this.getNextColor();
var node = {
item: element,
text: element.title,
name: element.title,
id: element.id,
pid: 0,
opened: false,
selected: false,
disabled: false,
loading: false,
children: [],
label: {
backgroundColor: color,
},
itemStyle: {
color: color,
},
};
// if (element.children >= 1) {
// node.children = [];
// }
this.data[0].children.push(node);
this.dataForTreeMapSetter(this.data);
});
}
},
// data(newValue){
// console.log("🚀 ~ data ~ newValue:", newValue)
// },
},
computed: {
...mapState(useResearchStore, ["researchTermsGetter"]),
},
methods: {
...mapActions(useResearchStore, ["dataForTreeMapSetter"]),
getNextColor() {
// Get the color at the current index
const color = this.colors[this.currentIndex];
// Update the index to the next color
this.currentIndex = (this.currentIndex + 1) % this.colors.length;
return color;
},
// #region function Default for tree
/**
* دادههای لیست درخت را از API دریافت میکند.
* @param {number} [parent=0] - شناسه والد برای دریافت فرزندان.
* @param {boolean} [ischildren=false] - پرچمی برای نشان دادن دریافت گرههای فرزند.
* @param {Object} [parentItem={}] - شیء آیتم والد.
* @returns {Promise} - پاسخ API که شامل دادههای درخت است.
*/
getListTree(parent = 0, ischildren = false, parentItem = {}) {
const payload = {
projectid: this.newProjects?.id,
parent: parent,
sortby: "id",
offset: 0,
limit: 100,
listtype: 0,
};
let url = researchApi.subject.list;
return this.httpService.formDataRequest(url, payload).then((res) => {
return res.data;
});
},
/**
* مدال افزودن گره فرزند را باز میکند.
* @param {Object} parentNode - مدل گره والد.
* @param {Object} node - مدل نمای گره.
*/
addChildNode(parentNode, node) {
this.editingItem = node.model;
this.editingNode = node;
this.openModal("FormAddChildrenToTree", " فرم ایجاد فرزند ");
},
/**
* یک گره را از درخت پس از تأیید حذف میکند.
* @param {Object} vm - مدل نمای گره برای حذف.
*/
removeNode(vm) {
mySwalConfirm({
title: "هشدار!!!",
html: `از حذف <b>${vm.model.text}</b> اطمینان دارید؟ `,
icon: "warning",
}).then((result) => {
if (result.isConfirmed) {
this.editingItem = vm.model;
this.editingNode = vm;
this.getRemov(this.editingItem);
if (this.editingItem.id !== undefined) {
var index = this.editingNode.parentItem.indexOf(this.editingItem);
this.editingNode.parentItem.splice(index, 1);
}
}
});
},
/**
* درخواست حذف یک آیتم از API را ارسال میکند.
* @param {Object} item - آیتمی که باید حذف شود.
*/
getRemov(item) {
const payload = {
subjectid: item.id,
projectid: this.newProjects?.id,
listid: item.id,
};
let url = researchApi.subject.delete;
this.httpService.postRequest(url, payload).then((res) => {
mySwalToast({
title: "موفق",
html: "با موفقیت حذف شد",
icon: "success",
});
});
},
/**
* مدال ویرایش یک گره را باز میکند.
* @param {Object} node - مدل نمای گره برای ویرایش.
*/
editNode(node) {
this.editingItem = node.model;
this.editingNode = node;
this.openModal("FormEditToTree", " فرم ویرایش خصوصیت ");
// this.editingNode = node;
},
/**
* رویداد کلیک روی آیتم را مدیریت میکند و فرزندان را اگر قبلاً بارگیری نشده باشند بارگیری میکند.
* @param {Object} nodeItem - آیتم گره کلیک شده.
*/
itemclick(nodeItem) {
if (nodeItem.model.children.length >= 1) return;
let parent = nodeItem.model;
try {
this.getListTree(parent.id, true, parent).then((list) => {
list.forEach((element, index) => {
var node = {
item: element,
text: element.title,
name: element.title,
id: element.id,
pid: parent.id,
opened: false,
selected: false,
disabled: false,
loading: false,
lineStyle: parent.lineStyle,
label: parent.label,
children: [],
};
const nodeExists = parent.children.some(
(child) => child.id === node.id
);
if (!nodeExists) {
parent.children.push(node);
}
});
});
} catch (error) {
console.error("Error fetching children nodes:", error);
}
},
/**
* رویداد تغییر وضعیت آیتم را مدیریت میکند.
* @param {Object} data - دادههای آیتم تغییر وضعیت داده شده.
*/
itemtoggle(data) {
},
/**
* آیتم فعال را تنظیم میکند و رویداد 'on-click' را ارسال میکند.
* @param {Object} item - آیتمی که باید به عنوان فعال تنظیم شود.
*/
setActiveItem(item) {
this.activeItem = item;
this.$emit("on-click", item);
},
// #endregion
// #region function for modals
/**
* مدال را میبندد و پرچم uploadForFirstTime را تنظیم مجدد میکند.
*/
closeModal() {
$("#base-modal").modal("hide");
setTimeout(() => {
this.uploadForFirstTime = false;
}, 500);
},
/**
* یک مدال با مؤلفه و عنوان مشخص باز میکند.
* @param {string} componentName - نام مؤلفهای که باید در مدال بارگیری شود.
* @param {string} title - عنوان مدال.
*/
openModal(componentName, title) {
this.uploadForFirstTime = true;
this.slotComponentName = componentName;
this.modalTitle = title;
setTimeout(() => {
$("#base-modal").modal({ backdrop: "static", keyboard: false }, "show");
}, 500);
},
/**
* یک آیتم جدید به درخت اضافه میکند.
* @param {Object} item - آیتمی که باید اضافه شود.
*/
addNewItem(item) {
// console.log("🚀 ~ addNewItem ~ item:", item);
const payload = {
id: undefined,
listtype: 0,
parent: 0,
projectid: this.newProjects?.id,
title: item,
};
let url = researchApi.subject.add;
this.httpService.postRequest(url, payload).then((res) => {
mySwalToast({
title: "موفق",
html: res.data.message,
icon: "success",
});
res.data.forEach((element, index) => {
var node = {
item: element,
text: element.title,
name: element.title,
id: element.id,
pid: 0,
opened: false,
selected: false,
disabled: false,
loading: false,
children: [],
};
this.data[0].children.push(node);
this.dataForTreeMapSetter(this.data);
});
});
},
/**
* یک آیتم موجود در درخت را ویرایش میکند.
* @param {string} item - عنوان جدید برای آیتم.
*/
edit(item) {
this.editingItem.text = item;
const payload = {
subjectid: this.editingItem.id,
projectid: this.newProjects?.id,
title: this.editingItem.text,
};
let url = researchApi.subject.edit;
this.httpService.formDataRequest(url, payload).then((res) => {
mySwalToast({
title: "موفق",
html: "تغییر نام با موفقیت انجام شد ",
icon: "success",
});
});
},
/**
* یک آیتم فرزند جدید به درخت اضافه میکند.
* @param {Object} item - آیتم فرزند که باید اضافه شود.
*/
addNewChildren(item) {
const payload = {
projectid: this.newProjects?.id,
parent: this.editingItem.id,
listid: this.editingItem.id,
listtype: 0,
title: item,
};
let url = researchApi.subject.add;
this.httpService.postRequest(url, payload).then((res) => {
mySwalToast({
title: "موفق",
html: " با موفقیت انجام شد ",
icon: "success",
});
res.data.forEach((element, index) => {
var node = {
item: element,
text: element.title,
name: element.title,
id: element.id,
pid: 0,
opened: false,
selected: false,
disabled: false,
loading: false,
children: [],
};
this.editingItem.children.push(node);
});
});
},
// #endregion
// #region function draggable for tree
/**
* قبل از انداختن آیتم، رویداد را مدیریت میکند.
* @param {Object} node - گرهای که آیتم به آن انداخته میشود.
* @param {Object} item - آیتمی که درگ شده است.
* @param {Object} draggedItem - آیتمی که در حال درگ شدن است.
* @param {Object} e - رویداد.
*/
onItemDropBefore(node, item, draggedItem, e) {
this.itemclick(node);
},
/**
* رویداد انداختن آیتم را مدیریت میکند.
* @param {Object} node - گرهای که آیتم به آن انداخته شده است.
* @param {Object} item - آیتمی که درگ شده است.
* @param {Object} draggedItem - آیتمی که در حال درگ شدن است.
* @param {Object} e - رویداد.
*/
onItemDrop(node, item, draggedItem, e) {
const cloneId = draggedItem.id;
// const fromId = draggedItem.id;
const toId = item?.id;
this.moveFromFolderToFolder(cloneId, toId);
},
/**
* آیتم را از یک فولدر به فولدر دیگر منتقل میکند.
* @param {number} cloneId - شناسه آیتمی که باید منتقل شود.
* @param {number} toId - شناسه فولدر مقصد.
*/
moveFromFolderToFolder(cloneId, toId) {
const formData = {
id: cloneId,
newparent: toId ?? 0,
projectid: this.researchTermsGetter?.id,
};
this.moveItem(formData);
},
/**
* آیتم را جابجا میکند.
* @param {Object} formData - دادههای فرم برای جابجایی آیتم.
*/
moveItem(formData) {
let url = listUrl() + researchApi.subject.move;
this.httpService
.formDataRequest(url, formData)
.then((res) => {
// console.log("🚀 ~ .then ~ res:", res);
mySwalToast({
title: "تبریک",
html: res.message,
icon: "success",
});
})
.catch((err) => {
mySwalToast({
title: "خطا!!!",
html: err?.message,
icon: "error",
});
});
},
onItemDragStart() {},
onItemDragEnd() {},
// #endregion
moveToParent(node) {
let cloneId = node.model.id;
this.moveFromFolderToRoot(cloneId);
},
moveUp() {},
moveDown() {},
},
};
</script>
<style lang="scss">
.item-content {
display: flex;
justify-content: space-between;
width: 100%;
}
.button-group {
display: none;
align-items: center;
}
.tree-item:hover .button-group {
display: flex;
}
.tree-open {
.tree-children {
.tree-anchor {
.tree-item {
width: 150px;
}
}
}
}
</style>
<style lang="scss" scoped>
.tree-list-container {
width: 100%;
// height: calc(100vh - 10em);
// overflow-y: auto;
.tree-item {
width: 220px;
position: relative;
&:hover {
color: var(--primary-color); /* رنگ پس‌زمینه هاور سفارشی */
}
.icon {
&:hover {
cursor: pointer;
color: var(--primary-color);
}
}
}
.active-item {
background-color: var(--hover-color) !important;
}
.tree {
text-align: right;
height: calc(100vh - 10em);
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: #ccc #eee;
}
.v-jstree {
}
}
</style>

View File

@ -0,0 +1,443 @@
<template>
<div
class="menu-bar__content home-list p-3"
:class="[{ mini: sidebarListStatusGetter }]"
>
<div class="home-list__content" :class="{ loading: fetchingData }">
<div class="content scroll-needed">
<the-content-loading
class="absolute-positioning"
v-if="fetchingData"
></the-content-loading>
<div v-else>
<form action="" class="my-form">
<div class="prodigy-sidebar c0177">
<!-- <header class="prodigy-sidebar-title c0179">
<a href="https://prodi.gy"
><svg
aria-label="Prodigy"
viewBox="0 0 540 158"
width="100"
height="29"
>
<path
d="M70.6 48.6c7 7.3 10.5 17 10.5 29.2s-3.3 22-10.4 29.2c-7 7.3-16 11-27 11-9.4 0-16.8-2.6-21.7-8v44.7H0V39h20.7v8c4.8-6.3 12.4-9.5 23-9.5 11 0 20 3.7 27 11zM22 76v3.6c0 12 7.2 19.8 18.2 19.8 11.2 0 18.7-8 18.7-21.6S51.3 56.2 40 56.2C29.2 56.2 22 64 22 76zM133.8 59.4c-12.6 0-20.5 7-20.5 17.8v39.3h-22V39h21v8.8c4-6.4 11.3-9.6 21.4-9.6v21.2zM209.5 107c-7.6 7.4-17.5 11.2-29.5 11.2s-22-3.8-29.7-11c-7.6-7.6-11.5-17.3-11.5-29.3 0-12.2 4-22 11.5-29.3 7.8-7.3 17.7-11 29.7-11s22 3.7 29.5 11c7.8 7.3 11.7 17 11.7 29.2 0 11.8-4 21.6-11.7 29zM180 56.3c-5.7 0-10.3 2-13.8 5.8s-5.2 9-5.2 15.7c0 6.7 1.8 12 5.2 15.7 3.4 3.8 8 5.7 13.8 5.7s10.3-1.8 13.8-5.6 5.2-9 5.2-15.7c0-6.8-1.8-12-5.2-15.7-3.5-3.8-8-5.8-13.8-5.8zM313 116.5h-20.5v-8c-4.4 5.6-12.7 9.7-23 9.7-11 0-20-3.8-27-11-7-7.5-10.5-17.2-10.5-29.4s3.5-22 10.3-29.2c7-7.3 16-11 27-11 9.7 0 17 2.6 22 8V0H313v116.5zm-58.8-38.7c0 13.6 7.5 21.4 18.7 21.4 10.8 0 18.2-7.3 18.2-19.8V76c0-12.2-7.3-19.8-18.3-19.8-11.3 0-18.8 8-18.8 21.6zM354 13.6c0 3.6-1.2 6.8-3.8 9.3-5 4.8-13.6 4.8-18.6 0C323.2 15.3 330-.3 341 .3c7.3 0 13 6 13 13.2zm-2 103h-22V39h22v77.5zM425 47v-8h20.6v80.4c0 11.2-3.6 20-10.6 26.8-7 6.7-16.6 10-28.5 10-23.4 0-37-11.4-40-29.8l21.8-.8c1 7.6 7.6 12 17.4 12 11.2 0 18-5.8 18-16.6v-11c-5 5.4-12.4 8-21.8 8-11 0-20-3.7-27-11s-10.4-17-10.4-29.2 3.5-22 10.3-29.2c7-7.3 16-11 27-11 10.6 0 18.3 3 23 9.5zM387 78c0 13.6 7.5 21.6 18.7 21.6 11 0 18.3-7.6 18.3-19.8V76c0-12.2-7.3-19.8-18.3-19.8-11.2 0-18.7 8-18.7 21.6zM488.8 154.8H465l19.8-45L454.5 39h24l18 46.2L514 39h24.3l-49.7 115.8z"
></path>
</svg>
</a>
<div class="c0180"></div>
</header> -->
<div class="prodigy-content">
<section class="c0197">
<div class="c01104">
<div class="c01111">Example</div>
<select class="c01112">
<option value="ner_manual" id="ner_manual">
Named Entities (manual)
</option>
<option value="ner_chars" id="ner_chars">
Named Entities (character-based)
</option>
<option value="ner" id="ner">
Named Entities (binary)
</option>
<option value="spans_manual" id="spans_manual">
Span Categorization (overlapping)
</option>
<option value="textcat_multi" id="textcat_multi">
Text Classification (multiple)
</option>
<option value="textcat" id="textcat">
Text Classification (binary)
</option>
<option value="pos_manual" id="pos_manual">
POS Tagging (manual)
</option>
<option value="dep" id="dep">
Dependency Parsing (manual)
</option>
<option value="rel_spans" id="rel_spans">
Relations &amp; Spans (manual)
</option>
<option value="rel_coref" id="rel_coref">
Relations (coreference)
</option>
<option value="rel_bio" id="rel_bio">
Relations (biomedical)
</option>
<option value="image_manual" id="image_manual">
Image (manual)
</option>
<option value="imageseg" id="imageseg">
Image (binary)
</option>
<option value="image_caption" id="image_caption">
Image (captioning)
</option>
<option value="audio_manual" id="audio_manual">
Audio (manual)
</option>
<option value="video" id="video">Video (manual)</option>
<option value="audio_transcript" id="audio_transcript">
Audio (transcript)
</option>
<option value="textchoice" id="textchoice">
Single Choice (Text)
</option>
<option value="imgchoice" id="imgchoice">
Multiple Choice (Image)
</option>
<option value="diff" id="diff">Diff</option>
<option value="html" id="html">Custom HTML</option>
</select>
</div>
<div class="c01104">
<div class="c01111">Theme</div>
<select class="c01112">
<option value="basic" id="basic">Basic</option>
<option value="dark" id="dark">Dark</option>
<option value="eighties" id="eighties">Eighties</option>
<option value="spacy" id="spacy">spaCy</option>
<option value="brutalist" id="brutalist">
Brutalist
</option>
</select>
</div>
</section>
<section class="c0197">
<h3 class="c0189">Project Info</h3>
<div class="c01104">
<div class="c01111">Dataset</div>
prodigy_demo
</div>
<div class="c01104">
<div class="c01111">View ID</div>
ner_manual
</div>
</section>
<section class="c0197">
<h3 class="c0189">Progress</h3>
<div class="c01104">
<div class="c01111">This session</div>
0
</div>
<div class="c01104">
<div class="c01111">Total</div>
0
</div>
<div class="c0194">
<progress class="c0195" max="100" value="0"></progress>
<div class="c0196">0%</div>
</div>
<div>
<div class="c01113 c01114">
<svg viewBox="0 0 225 10" width="225" height="10"></svg>
</div>
<div class="c01104">
<div class="c01111">accept</div>
0
</div>
<div class="c01104">
<div class="c01111">reject</div>
0
</div>
<div class="c01104">
<div class="c01111">ignore</div>
0
</div>
</div>
</section>
<section class="c0197 c0198">
<h3 class="c0189 c0190">History</h3>
<span></span>
</section>
<footer class="c0188">
<a href="https://explosion.ai" target="_blank"
>© 2017-2024 Explosion</a
><a href="https://prodi.gy" target="_blank"
>(<strong>Prodigy</strong> v1.11)</a
>
</footer>
</div>
</div>
</form>
<!-- <div v-if="groups && groups.length"> </div>
<no-data v-else></no-data> -->
</div>
</div>
</div>
<base-modal
v-if="showInvitePostModal"
modalSize="modal-lg"
modalTitle="فرم ایجاد پست دعوت نامه"
:hasFooter="false"
@close="closeAndResetInvitePostModal"
>
</base-modal>
</div>
</template>
<script>
// import { dragDropMoveMixin } from "~/list/mixins/dragDropMoveMixin";
// import { searchMixin } from "~/list/mixins/searchMixin";
import aiToolsApi from "~/apis/aiToolsApi";
import { mapState, mapActions } from "pinia";
import menu from "~/json/research/json/menu.json";
export default {
props: {
// statusPagHedear: {
// default: 1,
// type: Number,
// },
},
watch: {
$route: {
handler: function (to) {},
deep: true,
// immediate: true,
},
},
beforeMount() {
this.httpService = new HttpService(
import.meta.env.VITE_BASE_URL
// headers
);
// window.addEventListener("load", this.resizeAction);
// window.addEventListener("resize", this.resizeAction);
},
mounted() {
// this.getGroupTypes();
},
beforeDestroy() {
// window.removeEventListener("load", this.resizeAction);
// window.removeEventListener("resize", this.resizeAction);
},
data() {
return {
// #region mehdi
showMainpag: true,
menu: menu,
// #endregion
typingTimer: 0,
doneTypingInterval: 500,
searchText: "",
searchType: "groups",
showAddUserForm: false,
busy: false,
foundGroups: [],
showUploadAvatarForm: false,
showGroupSearchForm: false,
groupsExpanded: false,
showNewGroupForm: false,
hasImage: false,
imageUrl: undefined,
uploading: false,
selectedUser: {},
foundUsers: [],
isLoading: false,
showUserSearchForm: false,
selectedGroup: undefined,
commonContextMenu: [],
fetchingData: false,
users: [],
prevSelectedItemIndex: 0,
prevParentSelectedItemIndex: 0,
convertGroupIntegerToString: {
groups: 1,
lobbies: 2,
privates: 3,
},
convertGroupStringToInteger: {
1: "groups",
2: "lobbies",
3: "privates",
},
showForm: false,
formType: 1,
form: {
id: undefined,
title: null,
desc: null,
type: 1,
is_public: 1,
message_state: 1,
members: [],
parent_id: undefined,
},
collapseAll: false,
groups: [],
showReplaceInput: true,
httpService: undefined,
authHttpService: undefined,
list: [],
pagination: {
pages: 0,
total: 0,
page: 1,
offset: 0, // page * per_page
limit: 15, //per_page
},
isRedirectedFromOtherSystems: false,
groupId: undefined,
messageId: undefined,
groupModel: {
id: undefined,
title: null,
desc: null,
avatar: null,
user: undefined,
icon_type: 1,
type: 0,
parent_id: 0,
refrence_id: 0,
subject_id: 0,
template_key: null,
admins: [],
created_at: undefined,
message_state: 0,
live_link: null,
live_button_pic: null,
live_start_time: null,
live_duration: null,
message_expire_time: 0,
file_type: 0,
last_message: {
id: undefined,
text: null,
user: undefined,
message_type: undefined,
date_c: undefined,
date_e: undefined,
},
attachment: {
name: null,
url: null,
ext: null,
size: undefined,
length: 0,
width: 0,
height: 0,
},
},
showSearch: false,
showInvitePostModal: false,
groupToInvite: {},
inviteLinkId: null,
redirectViaInviteLink: false,
searchInCurrentGroup: false,
groupfilters: [],
isGroupFilterActive: false, // toggle group filter
selectedGroupFilter: [], // group filter items.
// showSidebarInMobile: false, // close the panel.
};
},
computed: {
...mapState([
"isSidebarCollapsed",
"getForwardItem",
"userPermisionGetter",
"getPanelStatus",
"sidebarListStatusGetter",
]),
...mapState("list", ["listGetter"]),
},
methods: {
...mapActions([
"TOGGLE_PANEL",
"checkPermissions",
"SET_SIDEBAR_LIST_STATUS",
]),
...mapActions("list", ["SET_LIST"]),
},
};
</script>
<style scoped lang="scss">
.c0177 {
// width: 260px;
color: #fff;
// z-index: 30;
// transform: translateX(-100%);
font-size: 14px;
background: #54606e;
font-family: "Lato", "Trebuchet MS", Roboto, Helvetica, Arial, sans-serif;
border-right: none;
transition: transform 0.2s ease;
min-height: 90dvh;
max-height: 90dvh;
overflow-y: auto;
overflow-x: hidden;
padding:2em 0;
}
.c0179 {
flex: 0 0 50px;
display: flex;
padding: 15px 20px;
background: #384451;
align-items: center;
margin-bottom: 20px;
justify-content: space-between;
}
.c0197 {
padding: 0 17.5px 20px 17.5px;
}
.c0197:not(:last-child) {
border-bottom: 1px solid #384451;
margin-bottom: 17.5px;
}
.c01104 {
display: flex;
text-align: right;
line-height: 1.5;
justify-content: space-between;
}
.c01111 {
color: #b9b9b9;
font-size: 14px;
font-weight: bold;
font-family: "Roboto Condensed", "Arial Narrow", sans-serif;
margin-right: 10px;
text-transform: uppercase;
}
.c01112 {
color: #444;
width: 130px;
height: 22px;
border: none;
padding: 0 2.5px;
font-size: 14px;
background: #fff;
font-family: inherit;
border-radius: 4px;
margin-bottom: 10px;
}
.c0197:not(:last-child) {
border-bottom: 1px solid #384451;
margin-bottom: 17.5px;
}
</style>

View File

@ -0,0 +1,579 @@
<template>
<div class="position-relative">
<form @submit.prevent="save()" class="p-3">
<!-- <div class="form-row p-0">
<div class="col d-flex align-items-center">
<div v-for="(metaItem, index) in metaItems">
<span :key="'meta' + metaItem.id" class="title text__12">
{{ metaItem.title }}
</span>
<span
style="color: blue"
v-if="index < metaItems.length - 1"
class="tavasi tavasi-Component-22--1"
></span>
</template>
</div>
</div> -->
<div class="form-row form-group p-0">
<label class="col-md-4" for="title">فهرست موضوعی</label>
<div class="col-md-8">
<div class="row form-group">
<select
@change="projectChanged"
v-model="subjectProjectId"
class="form-control col-md-9"
>
<option :value="undefined" selected disabled>
انتخاب فهرست موضوعی
</option>
<option v-for="item in projects" :key="item.id" :value="item.id">
{{ item.title }}
</option>
</select>
<div class="col"></div>
</div>
</div>
</div>
<div class="form-row form-group p-0" v-if="comboListCount">
<label class="col-md-4" for="subject">موضوع</label>
<div class="col-md-8">
<div
v-for="(comboItem, key) in comboListCount"
:key="key"
class="row d-flex align-items-center form-group"
>
<select
id="subject"
name="subject"
class="form-control col-md-9"
@change="getSubjects($event, comboItem)"
v-model="arrayOfSubjectId[key]"
>
<option :value="undefined" selected disabled>انتخاب موضوع</option>
<option
v-for="(item, key) in subjects[key]"
:key="item.id"
:value="item.title + '#' + item.id"
>
{{ item.title }}
&nbsp; ({{ item.children }})
</option>
</select>
<!-- <div class="col-md-4 remov_button "> -->
<div class="col-auto d-flex">
<button-component
title="باز کردن فرم ایجاد موضوع جدید"
v-if="key == lastComboItem"
classes=" btn btn-default popUp-tab__clear button_giveup px-1"
@click="openNewSubjectForm(comboItem)"
buttonText=""
>
<span class="tavasi tavasi-Component-133--1"></span>
</button-component>
<button-component
v-if="key == lastComboItem && comboListCount > 1"
classes=" btn btn-default popUp-tab__clear button_giveup px-1"
@click="removeSubject(key)"
buttonText=""
>
<span class="tavasi tavasi-Component-295--1"></span>
</button-component>
</div>
</div>
</div>
</div>
<div
class="form-row form-group p-0 submit_button d-flex justify-content-sm-end"
>
<button-component
type="submit"
classes="btn-outline-primary"
buttonText="افزودن"
:buttonLoading="buttonLoading"
@click="save()"
></button-component>
</div>
<div class="form-row form-group p-0">
<!-- <the-content-loading v-if="fetchingData"></the-content-loading> -->
<!-- <template v-else> -->
<my-table
height="auto"
:showHeaderSortButton="false"
:hasPagination="false"
:fetchingData="fetchingData"
:items="itemSubject"
:tableActions="tableActions"
:tableColumns="tableColumns"
:paginationInfo="pagination"
:sortingInfo="sorting"
@delete-table-item="deleteItem"
/>
<!-- </template> -->
</div>
<!-- <div class="popUp-tab__buttons">
<div class="d-flex justify-content-between flex-grow-1">
<span>&nbsp;</span>
<div data-v-e8ee7a26="" class="d-flex">
<button
title="لغو"
@click.prevent="$emit('close-modal')"
class="popUp-tab__clear btn"
type="button"
data-dismiss="modal"
>
لغو
</button>
</div>
</div>
</div> -->
</form>
<div class="new-subject-form-container" v-if="showSubjectForm">
<title-form
:selectedItem="{}"
@close-modal="closeNewSubjectForm"
@save-title="addNewItemToCombo"
></title-form>
</div>
</div>
</template>
<script>
import repoApi from "~/apis/repoApi";
import listApis from "~/apis/listApi";
import { mapState, mapActions } from "pinia";
import { useResearchStore } from "~/stores/researchStore";
export default {
props: {
metaItems: {
default() {
return [];
},
},
// called from jahat entity list subjecting.
projectTagsName: {
default: undefined,
},
},
emits: ["update-list", "close-modal", "delete-item"],
mounted() {
this.httpService = new HttpService(import.meta.env.VITE_BASE_URL);
this.httpServiceJahat = new HttpService(
import.meta.env.VITE_REPO_BASE_URL + this.researchActiveSchemaGetter?.key
);
this.httpServiceList = new HttpService(import.meta.env.VITE_LIST_BASE_URL);
this.getProjects();
if (
this.selectedItemGetter?.subject ||
this.selectedItemGetter?._source?.subject
)
this.itemSubject =
this.selectedItemGetter.subject ??
this.selectedItemGetter?._source?.subject;
},
data() {
return {
showSubjectForm: false,
tableActions: [
{
showOutside: true,
show: true,
icon: "tavasi tavasi-Component-295--1",
title: "حذف",
to: {
name: "undefined",
},
selected: false,
disabled: false,
howToOpen: "",
href: "",
class: "delete-btn",
action: "delete-table-item",
// can: "subject-",
},
],
tableColumns: [
{
key: "title",
title: "عنوان",
},
{
key: "path",
title: "مسیر",
},
],
sorting: {
sortby: "created",
sortorder: undefined, // asc | none
},
pagination: {
pages: 0,
total: 0,
page: 1,
offset: 0, // page * per_page
limit: 100, //per_page
},
httpService: undefined,
httpServiceList: undefined,
httpServiceJahat: undefined,
fetchingData: false,
itemSubject: [],
subjectProjectId: undefined,
projects: [],
comboListCount: 0,
arrayOfSubjectId: [],
subjects: {},
buttonLoading: false,
lastSubjectSelected: undefined,
selectedItemClone: {
id: undefined,
title: "",
number: "",
resource: "",
date_text: "",
text: "",
projectid: this.subjectProjectId,
item_type: "text",
},
};
},
computed: {
...mapState("list", ["selectedProjectGetter", "selectedItemGetter"]),
...mapState(useResearchStore, ["researchActiveSchemaGetter"]),
lastComboItem() {
return this.comboListCount - 1;
},
},
methods: {
...mapActions("list", ["SET_SELECTED_PROJECT"]),
removeSubject(index) {
this.arrayOfSubjectId.splice(index, 1);
this.comboListCount--;
},
getProjects() {
const payload = {
isown: 3,
type: 3,
tags: "term",
...this.sorting,
...this.pagination,
};
this.httpServiceList
.formDataRequest(listApis.projects.list, payload)
.then((response) => {
this.projects = response.data;
this.subjectProjectId = this.projects[0].id;
this.SET_SELECTED_PROJECT(this.projects[0]);
this.getSubjects(0, 0);
// this.getItemSubject();
});
},
projectChanged() {
this.comboListCount = 0;
this.arrayOfSubjectId = [];
this.subjects = {};
this.getSubjects(0, 0);
},
getSubjects(ev, index) {
let parentid = 0;
this.lastSubjectSelected = undefined;
if (typeof ev == "object") {
let value = ev.target.value;
let items = value.split("#");
this.lastSubjectSelected = {
id: items[1],
title: items[0],
};
parentid = items[1];
}
const payload = {
projectid: this.subjectProjectId,
parent: parentid,
sortby: "id",
offset: 0,
limit: 100,
};
this.httpServiceList
.formDataRequest(listApis.subject.list, payload)
.then((response) => {
if (response.data.length) {
this.subjects[index] = response.data;
this.comboListCount = ++index;
this.arrayOfSubjectId = this.arrayOfSubjectId.slice(0, index);
}
});
},
getItemSubject() {
if (this.fetchingData) return;
this.fetchingData = true;
const payload = {
projectid: this.selectedProjectGetter?.id,
id: this.selectedItemGetter.id,
sortby: "id",
offset: 0,
limit: 100,
};
this.httpServiceJahat
.formDataRequest(repoApi.item.subject, payload)
.then((response) => {
if (response.data.length) {
{
const myResponse = structuredClone(response.data);
myResponse.forEach((element) => {
const stringPath = element.path.map((mapItem) => mapItem.title);
element.path = stringPath.join("/");
});
this.itemSubject = myResponse;
}
} else this.itemSubject = [];
this.fetchingData = false;
})
.catch(() => (this.fetchingData = false));
},
save() {
if (this.buttonLoading) return;
this.buttonLoading = true;
const formData = {
id: this.selectedItemGetter?._id,
subject_id: this.lastSubjectSelected?.id,
subject_title: this.lastSubjectSelected?.title,
};
if (formData.subject_id === undefined) {
mySwalToast({
title: "موضوع انتخاب نشده است.",
html: null,
icon: "error",
});
this.buttonLoading = false;
return;
}
let url =
repoUrl() +
"public/" +
this.researchActiveSchemaGetter?.key +
"/" +
repoApi.subject.add;
this.httpService
.formDataRequest(url, formData)
.then((response) => {
this.itemSubject.push({
id: formData.subject_id,
title: formData?.subject_title,
});
mySwalToast({
title: response.message,
html: null,
icon: "success",
});
// setTimeout(() => {
// this.getItemSubject();
// }, 500);
})
.catch((err) => {
// mySwalToast({
// title: err.response.data.message,
// html: null,
// icon: "error",
// });
})
.finally(() => {
this.buttonLoading = false;
});
},
deleteItem(tableRowItemIndex) {
const data = {
id: this.selectedItemGetter?._id,
subject_id: this.itemSubject[tableRowItemIndex].id,
subject_title: this.itemSubject[tableRowItemIndex].title,
};
mySwalConfirm({
title: "هشدار",
html: "از حذف رابطه موضوع مطمئن هستید؟",
icon: "warning",
}).then((result) => {
if (result.isConfirmed) {
const url =
repoUrl() +
"public/" +
this.researchActiveSchemaGetter.key +
"/" +
repoApi.subject.delete;
this.httpService.formDataRequest(url, data).then((res) => {
this.itemSubject.splice(tableRowItemIndex, 1);
mySwalToast({
title: res.message,
html: undefined,
icon: "success",
});
});
}
});
},
closeNewSubjectForm() {
this.showSubjectForm = false;
},
openNewSubjectForm(comboItem) {
this.showSubjectForm = true;
},
addNewItemToCombo(item) {
const payload = {
title: item.title,
listtype: this.listTypeId ?? 0,
projectid: this.selectedProjectGetter?.id,
parent: this.lastSubjectSelected?.id,
};
this.httpServiceList
.formDataRequest(listApis.subject.add, payload)
.then((res) => {
mySwalToast({
title: "تبریک",
html: res.message,
icon: "success",
});
payload["id"] = res.data["id"];
this.subjects[this.lastComboItem].push(payload);
})
.catch((err) => {
mySwalToast({
title: err.message,
html: null,
icon: "error",
});
})
.finally(() => {
this.closeNewSubjectForm();
});
},
// pageChanged({ pageNumber, limit }) {
// let page = paging.pageNumber;
// page -= 1;
// this.pagination.offset = page * paging.limit;
// this.pagination.limit = paging.limit;
// this.pagination.page = pageNumber;
// this.countInPage = limit;
// this.getItemSubject();
// },
// pageLimitChanged(paging) {
// this.resetPagination();
// this.pagination.limit = paging.limit;
// this.getItemSubject();
// },
},
};
</script>
<style lang="scss" scoped>
.new-subject-form-container {
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: #fff;
box-shadow: 0px 0px 17px 1px #eee;
padding: 1em;
width: 70%;
margin: auto;
height: 50%;
}
.form-control {
// border-radius: 0 20px 20px 0;
font-size: 14px;
font-weight: 300;
text-align: right;
color: #707b87;
height: 100%;
// border-color: transparent;
// padding-right: 0;
// padding-left: 0;
}
.remov_button {
top: 20px;
right: 60%;
}
.submit_button {
// position: relative;
// right: 90px !important;
}
.form-control::-webkit-input-placeholder {
/* Chrome/Opera/Safari */
color: pink;
}
.form-control::-moz-placeholder {
/* Firefox 19+ */
color: pink;
}
.form-control:-ms-input-placeholder {
/* IE 10+ */
color: pink;
}
.form-control:-moz-placeholder {
/* Firefox 18- */
color: pink;
}
.form-row {
flex-direction: unset !important;
}
.col {
flex-basis: unset;
}
.new-subject-form-container {
box-shadow: rgba(22, 19, 19, 0.24) 0px 2px 10px;
border-radius: 1em;
z-index: 99;
}
</style>

View File

@ -0,0 +1,59 @@
<template>
<div class="container-fluid">
<div class="row">
<div class="col-12 d-flex justify-content-end">
<button @click.prevent="saveForm" title="" type="button" class="btn btn-outline-primary">
ثبت
</button>
</div>
<div class="col-12 mt-3">
<div style="height: calc(100dvh - 8em); overflow-y: auto;">
<VueEditor
dir="rtl"
v-model="editorData"
:editorOptions="editorOptions"
class="h-75"
></VueEditor>
</div>
</div>
</div>
</div>
</template>
<script>
import researchApi from "~/apis/researchApi";
import { mapActions, mapState } from "pinia";
import { VueEditor } from "vue2-editor";
import { useResearchStore } from "~/stores/researchStore";
export default {
data() {
return {
httpService: undefined,
editorData: "",
editorOptions: {
formats: {
direction: "rtl",
align: "right",
},
placeholder: "توضیحات...",
// readOnly: true,
// theme: "snow",
},
};
},
computed: {
...mapState(useResearchStore, ["researchSchemaGetter"]),
},
beforeMount() {
this.httpService = new HttpService(import.meta.env.VITE_BASE_URL);
},
};
</script>

View File

@ -0,0 +1,28 @@
{
"researches": [
{
"icon": "Home-21",
"color": 1,
"link": "defaultRoute",
"actionMode": 1,
"title": "خانه",
"translateKey": "Home"
},
{
"color": 1,
"icon": "reports",
"link": "myResearches",
"title": "تحقیقات",
"longTitle": "تحقیقات ",
"translateKey": "MyResearchs"
},
{
"color": 1,
"icon": "Component-68--1",
"link": "TermPage",
"title": "اصطلاحات",
"longTitle": "اصطلاحات",
"translateKey": "TermPage"
}
]
}

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,50 @@
const HISTORY_SEARCH_RECENT = "historysearchrecent";
export default {
mounted() {
if (window.localStorage.getItem([HISTORY_SEARCH_RECENT])) {
try {
this.historySearch = JSON.parse(
window.localStorage.getItem([HISTORY_SEARCH_RECENT])
);
} catch (e) {
window.localStorage.removeItem([HISTORY_SEARCH_RECENT]);
}
}
},
methods: {
initText(item) {
this.textSearch = item;
},
getHighlight(item) {
var find = this.textSearch;
var text = item.replaceAll(find, "<b>" + find + "</b>");
return text;
},
selectHistorySearch(item) {
this.textSearch = item;
this.searchStart(this.textSearch);
},
addHistorySearch(newSearch = "") {
if (newSearch == "") {
return;
}
var index = this.historySearch.indexOf(newSearch);
if (index != -1) {
this.historySearch.splice(index, 1);
}
this.historySearch.unshift(newSearch);
this.saveHistorySearch();
},
removeHistorySearch(x) {
this.historySearch.splice(x, 1);
this.saveHistorySearch();
},
saveHistorySearch() {
const parsed = JSON.stringify(this.historySearch);
window.localStorage.setItem([HISTORY_SEARCH_RECENT], parsed);
},
},
};

View File

@ -0,0 +1,441 @@
import apis from "~/apis/tahrirApi";
// import tinyTahrir from "assets/tahrir/vendors/tinymce-files/tinytahrir";
export default {
created() {
this.httpService = useNuxtApp()["$http"];
},
// beforeMount() {
// this.commentHttpService = new HttpService(
// import.meta.env.VITE_TAHRIR_BASE_URL
// );
// },
destroyed() {
// window.removeEventListener("scroll", this.handleScroll);
},
data() {
return {
id: "",
comments: [],
newComment: false,
selectedText: null,
globalGuid: undefined,
paragraphId: undefined,
paragraphParentId: undefined,
commentHttpService: undefined,
};
},
methods: {
/*
open comment form when user select a text
*/
onMouseUp($event) {
// Get selected text and encode it
const selection = encodeURIComponent(
this.getSelected().toString()
).replace(/[!'()*]/g);
if (selection) {
this.selectedText = selection;
this.setParagraphId($event);
// this.createPopup($event);
this.saveSelectedTextComment($event);
}
},
/*
extract user selected text
*/
getSelected() {
if (window.getSelection) {
return window.getSelection();
} else if (document.getSelection) {
return document.getSelection();
} else {
var selection = document.selection && document.selection.createRange();
if (selection.text) {
return selection.text;
}
return false;
}
},
setParagraphId(ev) {
this.paragraphId = ev.target.id;
this.paragraphParentId = ev.target.parentNode?.id;
},
/*
create comment popup and place it on top fo the selected text;
*/
createPopup(event) {
// this.openCommentForm();
// Get cursor position
// const posX = event.clientX - 130;
// const posY = event.clientY - 200;
// const posX = event.clientX;
// const posY = event.clientY;
// try {
// this.$refs.popupMenu.$el.style.top = posY + "px";
// this.$refs.popupMenu.$el.style.left = posX + "px";
// this.$refs.popupMenu.$el.style.opacity = 1;
// }
// catch(err) {
// setTimeout(() => {
// this.$refs.popupMenu.$el.style.top = posY + "px";
// this.$refs.popupMenu.$el.style.left = posX + "px";
// this.$refs.popupMenu.$el.style.opacity = 1;
// }, 700);
// }
},
openCommentForm() {
this.newComment = true;
},
/*
summary: save selected text
description: replace selected text with the new span.tcomment tag and then save it.
send a new request to api for saving the comment.
then update/replace paragraph content with newely created content.
then crawle all paragraphs for .tcomment ids.
then request api for paragraphs comments.
@fires when user clicked on comment popup save button.
@param {userComment} Html user comment.
@return void.
*/
saveSelectedTextComment(userComment) {
const url = tahrirUrl()+ apis.comments.addCommentToSelectedParag;
const replacedContent = this.replaceSelectedText();
const payload = {
content: replacedContent,
guid: this.paragraphId,
};
this.commentHttpService
.formDataRequest(url, payload)
.then((res) => {
this.newComment = false;
this.addComment(
{
text: userComment,
pid: this.globalGuid,
},
replacedContent
);
})
.catch((err) => {
mySwalToast({
html: err?.message,
});
})
.finally(() => (this.loading = false));
},
/*
summary: save comment
description:
send a new request to api for saving the comment.
then update/replace paragraph content with newely created content.
then crawle all paragraphs for .tcomment ids.
then request api for paragraphs comments.
@fires when saveSelectedTextComment method completed...
@param {text} String user comment.
@param {pid} String globalGuid.
@param {replacedContent} Html user comment.
@return void.
*/
addComment({ text, pid }, replacedContent) {
const payload = { text: JSON.stringify(text) };
const url = tahrirUrl()+ apis.comments.add + "/" + pid;
this.commentHttpService.formDataRequest(url, payload).then((res) => {
this.updateParagraphContentProperty(replacedContent);
this.crawlParagsForCommentId(this.localParagraphs).then((guidList) => {
this.getComments(guidList);
});
mySwalToast({
html: res.message,
});
});
},
/*
summary: update paragraph content property
description: update paragraph old content property with updated content.
@fires when addComment method completed...
@param {replacedContent} Html user comment.
@return void.
*/
updateParagraphContentProperty(replacedContent) {
this.localParagraphs.forEach((pars) => {
if (pars.id == this.paragraphParentId.slice(7))
pars.content = replacedContent;
});
},
/*
summary: update new comment form position
description: update position of new comment form when scrolling.
@fires when user scroll
@param {event} event window scroll event.
@return void.
*/
updateCommentFormTopPosition(event) {
// Find out how much (if any) user has scrolled
var scrollTop =
window.screenY !== undefined
? window.screenY
: (
document.documentElement ||
document.body.parentNode ||
document.body
).scrollTop;
const posY = event.clientY - 200 + scrollTop;
this.$refs.popupMenu._vnode.elm.style.top = posY + "px";
},
/*
summary: comment list
description: getting list of comments from the api.
@fires after page crawl for tcomment complete.
@param {array} guidList paragraph's comment ids.
@return void.
*/
getComments(guidList) {
const payload = {
pids: guidList,
};
this.commentHttpService
.formDataRequest(tahrirUrl()+apis.comments.documentComment, payload)
.then((res) => {
if (res.data) this.attachCommentsToParags(res.data);
});
},
/*
summary: attach comments to paragraphs object
description: loop over paragraphs and find paragraphs that
its content property math the comment id catched from the api.
@fires after getComment method called.
@param {object}
@return void.
*/
attachCommentsToParags(comments) {
try {
this.localParagraphs.forEach((parag) => {
const commentList = [];
Object.keys(comments).forEach((value) => {
if (parag.content.includes(value))
commentList.push(comments[value]);
});
this.$set(parag, "comments", commentList);
});
} catch (err) {
this.comments = comments;
}
this.fetchingData = false;
},
/*
summary: replace selected text with new span.
description: find the parent paragraph with its refs and
then replace the selected text with new span.
@fires when saveSelectedTextComment method called.
@return Html.
*/
replaceSelectedText() {
const text = decodeURIComponent(this.selectedText);
this.globalGuid = this.newGuid();
const replacementTag = `<mark id="${this.globalGuid}" class="c01206 c01172 c01173"><span class="c01186" id="19">${text} </span> <span class="c01210 c01209">ORG<span class="c01174">×</span></span></mark>`;
const refContent = this.$refs[this.paragraphParentId];
refContent.innerHTML = refContent.innerHTML.replace(text, replacementTag);
return refContent.innerHTML;
},
closeCommentForm() {
this.newComment = false;
},
/*
summary: crawl paragraphs for .tcomment.
description: crawl paragraph fot .tcomment tags and getting its id.
@fires when addComment method called.
@return Html.
*/
async crawlParagsForCommentId(pars) {
return await pars
.map((par) => {
if (par?.content.includes("tcomment"))
return this.geCommenttIds(par.content);
})
.filter((item) => item)
.join(",");
},
/*
summary: create unique id.
@fires when crawlParagsForCommentId method called.
@return string.
*/
newGuid() {
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
/[xy]/g,
function (c) {
var r = (Math.random() * 16) | 0,
v = c == "x" ? r : (r & 0x3) | 0x8;
return v.toString(16);
}
);
},
/*
summary: separate spans id property..
@fires when crawlParagsForCommentId method called.
@return string.
*/
geCommenttIds(content) {
var ids = "";
var regex =
/\<span id=\\{0,1}\"([a-z0-9-]*?)\\{0,1}\" class=\\{0,1}\"tcomment\\{0,1}\".*?\>/g;
var m = regex.exec(content);
while (m !== null) {
if (m.index === regex.lastIndex) {
regex.lastIndex++;
}
if (ids != "") ids += ",";
ids += m[1];
m = regex.exec(content);
}
return ids;
},
handleScroll(event) {
// Any code to be executed when the window is scrolled
},
/*
summary: hide/show other paragraphs comments.
description: when user clicked on comment, hide other
comments and add active class to .tcomment tag in the paragraph
@fires when user open/close the comments.
@param {object} paragraph
@param {Number} commentIndex
@return void.
*/
hideOtherComments({ paragraph, commentIndex }) {
const _this = this;
_this.localParagraphs.forEach((par) => {
// parse other paragraphs
if (par.id != paragraph.id) {
if (par.comments?.length) {
par.comments.forEach((com, index) => {
const res = com.isShow == undefined ? false : !com.isShow;
_this.$set(par.comments[index], "isShow", res);
});
}
}
// parse selected paragraph
else {
if (par.comments?.length) {
par.comments.forEach((com, index) => {
// hide sibling comments in the active paragraph.
if (index != commentIndex) {
const res = com.isShow == undefined ? false : !com.isShow;
_this.$set(par.comments[index], "isShow", res);
}
// toggle paragraph .tcomment class
else {
Array.from(
_this.$refs["parent-" + par.id][0].children[0].children
).forEach((child) => {
if (child.id == com[0].pid) {
child.classList.toggle("active");
}
});
}
});
}
}
});
},
removSpan(comment) {
const spanTag = document.getElementsById(comment.pid);
const rawText = spanTag.innerHTML;
this.paragraph.content = this.paragraph.content.replace(spanTag, rawText);
return this.paragraph.content;
},
saveChangeSelectedTextComment(userComment) {
const url = apis.comments.addCommentToSelectedParag;
const replacedContent = this.removSpan();
const payload = {
content: replacedContent,
guid: this.paragraphId,
};
ApiService.formData(url, payload)
.then((res) => {
this.newComment = false;
this.addComment(
{
text: userComment,
pid: this.globalGuid,
},
replacedContent
);
})
.catch((err) => {
mySwalToast({
html: err?.message,
});
})
.finally(() => (this.loading = false));
},
},
};

1018
pages/Research.vue Normal file

File diff suppressed because it is too large Load Diff

421
pages/TermPage.vue Normal file
View File

@ -0,0 +1,421 @@
<template>
<section :class="$route.name">
<div class="container-fluid mt-3">
<div class="row">
<div class="col col-md-3 border-start right-panel" v-if="isRightPanel">
<div class="pages-content" ref="navigationFilter">
<div class="container-fluid">
<div class="row">
<div class="d-flex justify-content-between w-100">
<multiselect
:allow-empty="false"
:searchable="true"
:close-on-select="true"
:show-labels="false"
label="title"
track-by="id"
placeholder="انتخاب پروژه"
:value="newProjects"
:options="projects"
@select="selectProject"
:hide-selected="false"
:max-height="200"
style="width: auto"
>
<template #singleLabel="props">
<span class="option__desc"
><span
class="option__title text-truncate"
style="display: block; max-width: 120px"
>
{{ props.option.title }}
</span></span
>
</template>
</multiselect>
<button
type="button"
class="close btn-right-panel"
aria-label="Close"
@click="isRightPanel = false"
>
<span aria-hidden="true">&times;</span>
</button>
</div>
</div>
<div class="row">
<ResearchTreeList
:treeItems="treeItems"
:newProjects="newProjects"
@on-click="clickOnTreeItem"
></ResearchTreeList>
</div>
</div>
</div>
</div>
<div class="col">
<div class="row border-bottom mx-0">
<div
class="col-12 order-1 order-lg-1 col-lg-1 d-flex justify-content-start"
>
<div
class="d-flex position-relative align-items-center"
style="top: -0.3em"
>
<button
class="btn btn-right-panel"
@click="isRightPanel = true"
>
<svg class="icon icon-Component-356--1">
<use xlink:href="#icon-Component-356--1"></use>
</svg>
</button>
<button
name="button"
type="button"
class="toggle-mobile-nav dropdown-hamburger d-md-none"
@click.prevent="toggleSidebarMenu()"
>
<span class="sr-only">باز کردن منوی کنار</span>
<svg class="s18" data-testid="sidebar-icon">
<use href="assets/common/img/icons.svg#sidebar"></use>
</svg>
</button>
</div>
</div>
<div class="col-12 order-2 order-lg-1 col-lg-10">
<div class="nav-tabs-container nav-tabs border-bottom-0">
<ul class="nav">
<li
class="nav-item desktop"
v-for="(navItem, index) in myActiveSchema?.tabs"
:key="index"
>
<button
:title="navItem.label"
type="button"
@click.prevent="updateCategoryList(navItem, index)"
class="btn nav-link"
:class="{ active: activeTab?.key == navItem.key }"
>
{{ navItem.title }}
</button>
</li>
<li
class="nav-item mobile tabs-more-btn d-md-none"
v-if="myActiveSchema?.tabs?.length > 2"
>
<div class="dropdown">
<button
class="btn"
type="button"
id="dropdownMenuButton"
data-bs-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false"
>
<svg class="icon icon-Component-81--1">
<use xlink:href="#icon-Component-81--1"></use>
</svg>
</button>
<div
class="dropdown-menu"
aria-labelledby="dropdownMenuButton"
>
<a
class="dropdown-item"
@click.prevent="updateCategoryList(navItem, index)"
v-for="(navItem, index) in myActiveSchema?.tabs"
:key="index"
:class="{ active: activeTab?.key == navItem.key }"
>
{{ navItem.title }}</a
>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
<div class="row">
<div class="col-12 pt-3">
<component
:is="contentComponentName(activeTab?.key)"
:listAnswer="listAnswerForTerm"
:pagination="pagination"
@changePage="changePaging"
@researchModalHandler="researchModalHandler"
></component>
</div>
</div>
</div>
</div>
<base-modal-v2
v-if="showModal"
@close="closeBaseModal"
:showHeaderCloseButton="true"
:hasFooter="false"
:modalTitle="modalTitle"
minHeight="17em"
overflow="hidden"
:showSaveButton="true"
:showCloseButton="true"
:showDeleteButton="false"
>
<slot> {{ modalTitle }}</slot>
<slot name="body">
<component
:is="slotComponentName"
:valueModal="valueModalResearch"
@closeAfterSaving="closeAfterSaving"
></component>
</slot>
</base-modal-v2>
</div>
</section>
</template>
<script>
import { mapState, mapActions } from "pinia";
import researchApi from "~/apis/researchApi";
import { useResearchStore } from "~/stores/researchStore";
export default {
beforeMount() {
this.httpService = new HttpService(import.meta.env.VITE_BASE_URL);
},
mounted() {
if (this.myActiveSchema) {
this.researchActiveSchemaSetter(this.myActiveSchema);
this.getMultiSelect(this.myActiveSchema.lists.url_GET);
this.activeTab = this.myActiveTabs;
}
},
beforeDestroy() {},
data() {
return {
projects: [],
showModal: false,
modalTitle: null,
slotComponentName: null,
valueModalResearch: {},
newProjects: "",
listAnswerForTerm: [],
treeItems: [],
childrenList: [],
parentList: {},
httpService: undefined,
activeTab: null,
listTypeId: 0,
firstChoiceOfTree: "",
isRightPanel: true,
pagination: {
page: 1,
pages: 0,
total: 0,
offset: 0, // page * per_page
limit: 10, //per_page
},
};
},
computed: {
...mapState(useResearchStore, ["researchSchemaGetter", "researchTermsGetter"]),
repoUrl() {
return import.meta.env.VITE_REPO + "/";
},
myActiveSchema() {
return this.researchSchemaGetter.find((item) => {
return item.key == "term";
});
},
myActiveTabs() {
return this.myActiveSchema.tabs.find((item) => {
return item.key == "fish";
});
},
},
methods: {
...mapActions(useResearchStore, [
"researchTermsSetter",
"researchActiveSchemaSetter",
]),
closeAfterSaving() {
this.closeBaseModal();
setTimeout(() => {
this.getItemsForResearch(this.firstChoiceOfTree.id);
}, 1000);
},
// #region function all
researchModalHandler(event) {
this.openBaseModal("ResearchFishModal", event.itemSchema.title);
this.valueModalResearch = event;
},
openBaseModal(componentName, title) {
this.showModal = true;
this.slotComponentName = componentName;
this.modalTitle = title;
},
closeBaseModal() {
this.showModal = false;
},
updateCategoryList(navItem, index) {
this.activeTab = navItem;
},
contentComponentName(key) {
if (key == "fish") return "ResearchContent";
else if (key == "wiki") return "WikiPage";
else if (key == "change") return "ProcessologyPage";
else if (key == "treechart") return "Tree";
return "ResearchContent";
},
selectProject(item) {
this.researchTermsSetter(item);
this.newProjects = item;
this.getListTree();
},
// #endregion
// #region function for tree and MultiSelect
getMultiSelect(url) {
this.httpService.getRequest(url).then((res) => {
this.researchTermsSetter(res.data[0]);
this.projects = res.data;
this.newProjects = res.data[0];
this.getListTree();
});
},
getListTree(parent = 0, ischildren = false, parentItem = {}) {
const payload = {
projectid: this.newProjects?.id,
parent: parent,
sortby: "id",
offset: 0,
limit: 100,
listtype: this.listTypeId,
};
let url = researchApi.subject.list;
this.httpService.formDataRequest(url, payload).then((res) => {
if (!ischildren) {
this.treeItems = res.data;
this.firstChoiceOfTree = res.data[0];
this.getItemsForResearch(res.data[0].id);
} else {
this.childrenList = res.data;
this.parentList = parentItem;
}
});
},
clickOnTreeItem(item) {
this.firstChoiceOfTree = item;
this.resetPagination();
this.getItemsForResearch(item.id);
},
// #endregion
// #region function for component
getItemsForResearch(id) {
let url = this.activeTab?.url_GET;
url = url.replace("{{offset}}", this.pagination.offset);
url = url.replace("{{limit}}", this.pagination.limit);
let filter = "";
if (id == 0)
filter = `&f_rt=${this.myActiveSchema.label}`; // برای نمایش همه
else filter = `&f_rt=${this.myActiveSchema.label}&f_sb=${id}`;
url = url.replace("{{filter}}", filter);
this.httpService.getRequest(url).then((res) => {
this.listAnswerForTerm = res.hits.hits;
const total = res.hits.total.value;
const pages = Math.ceil(total / this.pagination.limit);
const pagination = {
total: total,
pages: pages == 0 ? 1 : pages,
};
this.pagination = { ...this.pagination, ...pagination };
});
},
changePaging(item) {
this.pagination = item;
this.getItemsForResearch(this.firstChoiceOfTree.id);
},
resetPagination() {
this.pagination = {
page: 1,
pages: 0,
total: 0,
offset: 0, // page * per_page
limit: 10, //per_page
};
},
// #endregion
},
};
</script>
<style scoped lang="scss">
.v-popper--theme-dropdown {
display: flex;
.v-popper__inner {
.my-tooltip-content {
color: white;
background-color: black;
padding: 1em;
}
}
}
.btn-right-panel {
display: none;
}
@media screen and (max-width: 61.998em) {
.right-panel {
padding-top: 0.5em;
position: fixed;
z-index: 9;
width: 24em;
top: 0;
bottom: 0;
right: 0;
margin-right: var(--sidebar-collapsed-width);
background: #fff;
justify-content: center;
// box-shadow: -1px 0px 7px 1px #eee;
}
.btn-right-panel {
display: block;
}
}
@media screen and (max-width: 47.938em) {
.nav {
li {
.nav-link {
font-size: 0.8rem;
}
}
li.desktop:nth-child(n + 3) {
display: none;
}
.dropdown-menu {
a.dropdown-item:nth-child(-n + 2) {
display: none;
}
}
// .combo-list {
// margin-top: 1em;
// }
}
.right-panel {
margin-right: 0;
width: 18em;
}
}
</style>

1176
pages/index.vue Normal file

File diff suppressed because it is too large Load Diff

116
stores/researchStore.ts Normal file
View File

@ -0,0 +1,116 @@
import type {
domain,
researchActiveSchema,
researchTerms,
searchActiveTab,
selectionFilterItems,
} from "~/types/researchTypes";
import { defineStore } from "pinia";
export const useResearchStore = defineStore("researchStore", {
persist: {
storage: piniaPluginPersistedstate.localStorage(),
}, state: () => ({
researchActiveSchema: [] as researchActiveSchema[],
researchSchema: [] as researchActiveSchema[],
researchDomainActive: {} as domain,
searchActiveTab: undefined as searchActiveTab | undefined,
selectionFilterItems: [] as selectionFilterItems,
researchTerms: undefined as researchTerms | undefined,
// dataForTreeMap: undefined,
// activeTab: undefined,
// navigateListActiveTab: undefined,
// navigateListSchema: undefined,
// activeNavigateListSchema: undefined,
// navigateChartActiveTab: undefined,
// navigateChartSchema: undefined,
// activeNavigateChartSchema: undefined,
}),
getters: {
researchSchemaGetter(state) {
return state.researchSchema;
},
researchActiveSchemaGetter(state) {
return state.researchActiveSchema;
},
researchDomainActiveGetter(state) {
return state.researchDomainActive;
},
searchActiveTabGetter(state) {
return state.searchActiveTab;
},
selectionFilterItemsGetter(state) {
return state.selectionFilterItems;
},
researchTermsGetter(state) {
return state.researchTerms;
},
// dataForTreeMapGetter(state) {
// return state.dataForTreeMap;
// },
// activeTabGetter(state) {
// return state.activeTab;
// },
// navigateListActiveTabGetter(state) {
// return state.activeTab;
// },
// navigateListSchemaGetter(state) {
// return state.navigateListSchema;
// },
// activeNavigateListSchemaGetter(state) {
// return state.activeNavigateListSchema;
// },
// activeTabGetter(state) {
// return state.activeTab;
// },
// navigateChartSchemaGetter(state) {
// return state.navigateChartSchema;
// },
// activeNavigateChartSchemaGetter(state) {
// return state.activeNavigateChartSchema;
// },
},
actions: {
researchTermsSetter( researchTerms = undefined) {
this.researchTerms = researchTerms;
},
researchSchemaSetter( researchSchema = undefined) {
this.researchSchema = researchSchema;
},
researchActiveSchemaSetter( researchActiveSchema = undefined) {
this.researchActiveSchema = researchActiveSchema;
},
researchDomainActiveSetter(domain:domain) {
this.researchDomainActive = domain;
},
searchActiveTabSetter( searchActiveTab = undefined) {
this.searchActiveTab = searchActiveTab;
},
selectionFilterItemsSetter( selectionFilterItems: selectionFilterItems = []) {
this.selectionFilterItems = selectionFilterItems;
},
// dataForTreeMapSetter(state, dataForTreeMap = undefined) {
// state.dataForTreeMap = dataForTreeMap;
// },
// activeTabSetter(state, activeTab = undefined) {
// state.activeTab = activeTab;
// },
// navigateChartActiveTabSetter(state, navigateChartActiveTab = undefined) {
// state.navigateChartActiveTab = navigateChartActiveTab;
// },
// navigateChartSchemaSetter(state, navigateChartSchema = undefined) {
// state.navigateChartSchema = navigateChartSchema;
// },
// activeNavigateChartSchemaSetter(
// state,
// activeNavigateChartSchema = undefined
// ) {
// state.activeNavigateChartSchema = activeNavigateChartSchema;
// },
},
});

307
types/researchTypes.ts Normal file
View File

@ -0,0 +1,307 @@
export type researchTerms = {
id: number;
created_at: number;
updated_at: number;
type: number;
title: string;
color: number;
meta: string;
guid: string;
owner: number;
comment: string;
ispublic: number;
stt: number;
project_version: number;
organ_code: number;
project_relations: null;
item_state: number;
table_columns: string;
tags: string;
repo_index: number;
};
export type options = [{ value: string; title: string }];
export type items_main = [
{
key: string;
label: string;
type: string;
placeholder: string;
required: string;
classes: string;
inputClass: string;
multi_select: string;
options: options[];
}
];
export type items_more = [
{
key: string;
label: string;
type: string;
placeholder: string;
required: number | string;
classes: string;
inputClass: string;
multi_select: number | string;
options: options[];
}
];
export type form = {
title: string;
key: string;
items_main: items_main[];
items_more: items_more[];
};
export type contextMenu = [
{ key: string; title: string; icon: string; form: form }
];
export type filter = [
{ title: string; filter_key: string; source_key: string; by_more: number }
];
export type advance = [
{
key: string;
label: string;
tag: string;
placeholder: string;
labelClass: string;
inputClass: string;
options: [];
}
];
export type lists = [
{
title: string;
list_key: string;
filter_key: string;
icon: string;
key: string;
number: number;
label: string;
type: string;
placeholder: string;
required: number | string;
classes: number | string;
multi_select: number | string;
url_GET: string;
}
];
export type researchSchemaRes = {
status: number;
message: string;
postion: number;
meta: null;
data: {
dataset: researchActiveSchema[];
};
};
export type researchActiveSchema = {
key: string;
routeName: string;
searchContent: string;
label: string;
description: string;
contextMenu: contextMenu[];
summary: null;
filter: filter[];
domain: {
tags: { عنوان: string; منبع: string; تاریخ: string };
domain: domain;
};
advance: advance[];
lists: lists[];
tabs: [
{
title: string;
key: string;
url_GET: string;
}
];
};
export type domain = { label: string; key: string };
export type table_actions = [
{
icon: string;
title: string;
key: string;
"v-can": string;
type: string;
api_items: {
data_type: string;
ref_key: string;
id: string;
title: string;
};
toggle_icons: { icon1: string; icon2: string };
link_route: { id: string; name: string; key: string };
}
];
export type table_columns = [
{
key: string;
title: string;
width: number | string;
textAlign: string;
isLink: boolean;
link_route: { id: string; name: string; key: string };
trancate_word: 50;
}
];
export type domainActive = {
label: string;
tag: string;
key: string;
field_collapse: string;
table_actions: table_actions[];
table_columns: table_columns[];
};
export type summary = {
title: string;
key: string;
options: [{ key: string; label: string; type: string }];
};
export type items = [
{
key: string;
items: [
{
key: string;
source_key: string;
label: string;
style: string;
hilight_key: string;
link_route: { id: string; name: string; key: string };
}
];
}
];
export type actions = [
{
icon: string;
title: string;
key: string;
"v-can": string;
type: string;
api_items: {
data_type: string;
ref_key: string;
id: string;
title: string;
};
toggle_icons: {
icon1: string;
icon2: string;
};
link_route: {
id: string;
name: string;
key: string;
};
}
];
export type search_content = {
items: items[];
actions: actions[];
};
export type searchActiveTab = {
key: string;
routeName: string;
searchContent: string;
label: string;
description: string;
showTableList: number;
summary: summary;
filter: filter[];
domain: {
tags: {
قانون: string;
عنوان: string;
متن: string;
سال: string;
مقنن: string;
منبع: string;
مصوب: string;
تاریخ: string;
};
domain: domainActive[];
};
advance: advance[];
searchType: [
{ key: string; label: string },
{
key: string;
description: string;
label: string;
},
{
key: string;
description: string;
label: string;
},
{
key: string;
description: string;
label: string;
item: {
label: string;
type: string;
component: string;
};
},
{
key: string;
description: string;
label: string;
}
];
search_content: search_content;
lists: lists[];
};
export type selectionFilterItems = [];
export type researchQuery = [
{
_index: string;
_id: string;
_score: null;
_ignored: [string];
_source: {
research_type: string;
research_key: string;
service: string;
ref_key: string;
ref_id: string;
text_position: string;
address: string;
date_create: number;
text_main: string;
username: string;
take_type: string;
text_user: string;
user_create: number;
title: null;
text_target: null;
text_subject: null;
text_verb: null;
subject_public: null;
subject_specific: null;
time_edit: number;
date_edit: string;
user_edit: number;
user: {
id: number;
user_id: number;
first_name: string;
last_name: string;
username: string;
full_name: string;
avatar: string;
color: string;
};
};
sort: [number];
}
];