Compare commits

...

2 Commits

Author SHA1 Message Date
Mehdi104797
fd3221ea12 تغییرات در ایمپورت ها 2025-04-28 13:21:11 +03:30
Mehdi104797
03122c1c62 . 2025-04-28 11:10:28 +03:30
14 changed files with 1372 additions and 66 deletions

View File

@ -183,7 +183,7 @@
>
<div class="main-page_body-items-move-copy in-desktop mt-2">
<div class="btn-move move ms-3">
<date-picker
<PersianDatepicker
title="انتقال"
label="انتقال محتوا به تاریخ دیگر"
class="date-picker text-move"
@ -199,7 +199,7 @@
</span>
</div>
<div class="copy btn-copy">
<date-picker
<PersianDatepicker
title="کپی"
label="کپی محتوا به تاریخ دیگر"
class="date-picker text-copy"
@ -217,7 +217,7 @@
</div>
<div class="main-page_body-items-move-copy in-mobile mt-2">
<div class="btn-move move ms-3">
<date-picker
<PersianDatepicker
title="انتقال"
label="انتقال"
class="date-picker text-move"
@ -234,7 +234,7 @@
</span>
</div>
<div class="copy btn-copy">
<date-picker
<PersianDatepicker
title="کپی"
label="کپی"
class="date-picker text-copy"
@ -259,15 +259,18 @@
// import ImageUploader from "vue-image-upload-resize";
// import keyValueApi from "@apis/keyValueApi";
// import { mapActions, mapGetters, mapMutations } from "vuex";
import taskApi from "@apis/taskApi";
import HttpService from "@services/httpService";
import VuePersianDatetimePicker from "vue-persian-datetime-picker";
import taskApi from "@task/apis/taskApi";
// import HttpService from "@services/httpService";
// import VuePersianDatetimePicker from "vue-persian-datetime-picker";
import { p2e } from "@plugins/persianNumber";
import { mapGetters, mapMutations } from "vuex";
// import { mapGetters, mapMutations } from "vuex";
import { mapState, mapActions } from "pinia";
import { useAuthStore } from "~/stores/authStore";
export default {
beforeMount() {
this.httpService = new HttpService();
// this.httpService = new HttpService();
this.httpService = useNuxtApp()["$http"];
},
mounted() {
this.setCurrentUserData();
@ -293,6 +296,7 @@ export default {
data() {
return {
httpService: {},
foundUsers: [],
selectedUser: {
id: undefined,
@ -346,7 +350,7 @@ export default {
};
},
computed: {
...mapGetters(["currentUser", "taskSchemaGetter"]),
...mapState(useAuthStore,["currentUser", "taskSchemaGetter"]),
},
methods: {
setCurrentUserData() {

View File

@ -23,9 +23,9 @@
@click.prevent="toggleSidebarMenu()"
>
<span class="sr-only">باز کردن منوی کنار</span>
<svg class="s18" data-testid="sidebar-icon">
<!-- <svg class="s18" data-testid="sidebar-icon">
<use href="@assets/common/img/icons.svg#sidebar"></use>
</svg>
</svg> -->
</button>
</div>
<!-- <div v-if="$route.name === 'taskTimes'" class="d-md-none dropdown-hamburger">
@ -65,7 +65,9 @@
</template>
<script>
import { mapGetters, mapMutations, mapActions } from "vuex";
// import { mapGetters, mapMutations, mapActions } from "vuex";
import { mapState, mapActions } from "pinia";
import { useCommonStore } from "~/stores/commonStore";
export default {
beforeMount() {
@ -87,7 +89,11 @@ export default {
};
},
computed: {
...mapGetters(["getPanelStatus", "getRefreshForm", "isSidebarCollapsed"]),
...mapState(useCommonStore, [
"getPanelStatus",
"getRefreshForm",
"isSidebarCollapsed",
]),
navTitle() {
return process.env.VUE_APP_TITLE;
},
@ -110,10 +116,10 @@ export default {
// ...mapActions(["setBodyClass"]),
},
components: {
Navbar: () =>
import(
"@dashboard/majles/components/Navbar"
),
// Navbar: () =>
// import(
// "@dashboard/majles/components/Navbar"
// ),
// MySystem: () =>
// import(
// "@dashboard/default/pages/MySystem"

View File

@ -175,17 +175,23 @@
</template>
<script>
import taskApi from "@apis/taskApi";
import { mapGetters } from "vuex";
import HttpService from "@services/httpService";
import taskApi from "@task/apis/taskApi";
// import taskApi from "@apis/taskApi";
// import { mapGetters } from "vuex";
import { mapState, mapActions } from "pinia";
import { useSearchStore } from "@search/stores/searchStore";
import { useAuthStore } from "~/stores/authStore";
// import HttpService from "@services/httpService";
import VuePersianDatetimePicker from "vue-persian-datetime-picker";
import { p2e } from "@plugins/persianNumber";
import thiqatRoutes from "../../../routes/thiqatRoutes";
// import thiqatRoutes from "../../../routes/thiqatRoutes";
export default {
// mixins: [dragDropMoveMixin],
beforeMount() {
this.httpService = new HttpService(this.taskMicroServiceName);
// this.httpService = new HttpService(this.taskMicroServiceName);
this.httpService = useNuxtApp()["$http"];
this.activeUserId = this.currentUser.user_id;
// event fired from MainSection.vue.
@ -231,8 +237,9 @@ export default {
// "getPanelStatus",
// "sidebarListStatusGetter",
// ]),
...mapGetters("list", ["listGetter"]),
...mapGetters(["currentUser"]),
// ...mapGetters("list", ["listGetter"]),
...mapState(useSearchStore, ["listGetter"]),
...mapState(useAuthStore,["currentUser"]),
taskMicroServiceName() {
return process.env.VUE_APP_TASK;
},

View File

@ -0,0 +1,210 @@
<template>
<div class="form-group" :key="$attrs.name">
<div class="d-flex switch-main">
<!-- <div class="custom-control custom-switch">
<input
type="checkbox"
@change="updateMode"
:id="$attrs.name"
:name="$attrs.name"
v-model="textValue"
:true-value="true"
:false-value="false"
class="custom-control-input"
/>
<label class="custom-control-label" :for="$attrs.name">{{
$t(text1)
}}</label>
</div> -->
<div class="form-check form-switch">
<input
class="form-check-input"
type="checkbox"
@change="updateMode"
:id="$attrs.name"
:name="$attrs.name"
v-model="textValue"
:true-value="true"
:false-value="false"
/>
<label class="form-check-label" :for="$attrs.name">{{
$t(text1)
}}</label>
</div>
<label class="mb-0 me-2 text-2" :for="$attrs.name">{{ $t(text2) }}</label>
</div>
</div>
</template>
<script>
// import formBuilderMixin from "@mixins/formBuilderMixin";
/**
* @vue-prop {string} [texts2 = Statistics] - متنی که برای نمایش به عنوان "ChartList" استفاده میشود.
* @vue-prop {string} [texts1 = Normal] - متنی که برای نمایش به عنوان "Chart" استفاده میشود.
*
* @vue-data {boolean} [textValue = true] - حالت انتخاب شده ی سوئیچ در حالت true فعال و در حالت false غیر فعال می باشد
* @vue-data {String} [text1 = ""] - متن اول که در برچسب اول نمایش داده میشود.
* @vue-data {String} [text2 = ""] - متن دوم که در برچسب دوم نمایش داده میشود.
*/
export default {
// mixins: [formBuilderMixin],
// props: ["texts1", "texts2"],
props: {
texts2: {
default: "Statistics",
},
texts1: {
default: "Normal",
},
value: {
default: true,
},
},
data() {
return {
textValue: true,
text1: "Chart",
text2: "ChartList",
};
},
mounted() {
this.textValue = this.value;
this.updateText();
},
methods: {
/**
* متنهای پراپها را به متغیرهای اختصاص میدهد.
* اگر texts1 تعریف شده باشد، مقادیر text1 و text2 را به ترتیب با texts1 و texts2 جایگزین میکند.
*/
updateText() {
if (this.texts1 !== undefined) {
this.text1 = this.texts1;
this.text2 = this.texts2;
}
},
/**
* رویداد تغییر وضعیت چکباکس را مدیریت میکند.
* مقدار جدید textValue را از طریق رویداد "change-mode" به والد کامپوننت ارسال میکند.
*/
updateMode() {
this.$emit("change-mode", this.textValue);
},
},
};
</script>
<style scoped lang="scss">
.custom-control-label {
white-space: nowrap;
&::before {
border-color: var(--primary-color) !important ;
// background-color: var(--primary-color)!important;
}
}
.entity-text-switch {
.switch-main {
justify-content: end;
margin-left: 3em;
}
.custom-control-input {
width: 5em;
z-index: 99;
}
}
.custom-control {
.custom-control-input {
&:checked ~ .custom-control-label::before {
background-color: var(--primary-color);
}
}
}
.task-admin-switch {
&.form-group {
margin-bottom: 0 !important;
margin-top: 1em;
margin-right: 1em;
}
.custom-control-label {
&::before {
border-color: #fff;
background-color: rgb(128, 128, 128);
}
&::after {
background-color: #fff;
}
}
}
.compare-switch {
.custom-control-label {
&::before {
border-color: #fff;
background-color: rgb(189, 189, 189);
}
&::after {
background-color: #fff;
}
}
}
.text-2 {
white-space: nowrap;
}
.form-switch {
white-space: nowrap;
}
/* .form-control {
height: auto !important;
} */
/*
.checkbox-4 {
width: 100px;
appearance: none;
height: 40px;
border-radius: 100px;
cursor: pointer;
background: #ffffff;
position: relative;
background: #e0e5ec;
box-shadow: 4px 4px 6px 0 rgba(255, 255, 255, 0.3),
-4px -4px 6px 0 rgba(116, 125, 136, 0.2),
inset -4px -4px 6px 0 rgba(255, 255, 255, 0.2),
inset 4px 4px 6px 0 rgba(0, 0, 0, 0.2);
transition: all 0.5s;
}
.checkbox-4::after {
content: "";
width: 30px;
height: 30px;
position: absolute;
left: 8px;
top: 5px;
border-radius: 100%;
background-color: #ffffff;
box-shadow: inset 2px 2px 2px 0px rgba(255, 255, 255, 0.5),
7px 7px 20px 0px rgba(0, 0, 0, 0.1), 4px 4px 5px 0px rgba(0, 0, 0, 0.1);
transition: all 0.5s;
}
.checkbox-4:checked::after {
left: 65px;
}
.checkbox-4-pink:checked {
background: #fb2175;
}
.checkbox-4-danger:checked {
background: var(--danger);
}
.checkbox-4-success:checked {
background: var(--success);
}
.checkbox-4-info:checked {
background: var(--info);
}
.checkbox-4-dark:checked {
background: #1a1a1a;
}
.checkbox-4-magic:checked {
background: var(--magic);
} */
</style>

View File

@ -195,16 +195,24 @@
</template>
<script>
import { mapGetters, mapActions } from "vuex";
import HttpService from "@services/httpService";
// import { mapGetters, mapActions } from "vuex";
// import HttpService from "@services/httpService";
import menu from "@task/json/menu.json";
import adminApi from "@apis/adminApi";
import taskApi from "@apis/taskApi";
import adminApi from "~/apis/adminApi";
import { mapState, mapActions } from "pinia";
// import taskApi from "@apis/taskApi";
import taskApi from "@task/apis/taskApi";
import { useCommonStore } from "~/stores/commonStore";
import { p2e } from "@plugins/persianNumber";
export default {
beforeMount() {
this.httpService = new HttpService(this.taskMicroServiceName);
// this.httpService = new HttpService(this.taskMicroServiceName);
this.httpService = useNuxtApp()["$http"];
},
mounted() {
this.checkPermisionBeforGetList();
@ -240,7 +248,7 @@ export default {
mainList: [],
menu: menu,
firstTimeSearching: false,
httpService: undefined,
httpService: {},
tableActions: [
{
showOutside: true,
@ -387,7 +395,7 @@ export default {
},
},
methods: {
...mapActions(["checkPermissions"]),
...mapActions(useCommonStore,["checkPermissions"]),
checkPermisionBeforGetList() {
if (this.fetchingData) return;
@ -817,14 +825,14 @@ export default {
},
},
components: {
UsersSearch: () => import("@admin/components/UsersSearch"),
UsersSearch: () => import("@components/admin/components/UsersSearch"),
TeamForm: () => import("@task/components/TeamForm"),
SortingTasksAdmin: () => import("@task/components/SortingTasksAdmin"),
SortingByDayTasksAdmin: () =>
import("@task/components/SortingByDayTasksAdmin"),
PieDonut: () => import("@components/charts/PieDonut.vue"),
SwitchComponent: () => import("@components/SwitchComponent.vue"),
SwitchComponent: () => import("@task/components/SwitchComponent.vue"),
},
};
</script>

View File

@ -2,11 +2,11 @@
<section>
<Navbar class="task-navbar"> </Navbar>
<the-sidebar2
<!-- <the-sidebar2
:showUserAvatar="true"
:menu="menu"
@statusPage="statusPage"
></the-sidebar2>
></the-sidebar2> -->
<main class="main-page__content" :class="{ expanded: !isSidebarCollapsed }">
<right-section
@ -34,13 +34,17 @@
</template>
<script>
import { mapGetters, mapMutations, mapActions } from "vuex";
import HttpService from "@services/httpService";
// import { mapGetters, mapMutations, mapActions } from "vuex";
// import HttpService from "@services/httpService";
import { mapState, mapActions } from "pinia";
import { useCommonStore } from "~/stores/commonStore";
import menu from "@task/json/menu.json";
export default {
beforeMount() {
this.httpService = new HttpService();
// this.httpService = new HttpService();
this.httpService = useNuxtApp()["$http"];
this.getSchemas();
},
@ -64,7 +68,7 @@ export default {
},
data() {
return {
httpService: {},
nomber: 0,
statusPagHedear: 1,
render: 1,
@ -73,19 +77,20 @@ export default {
};
},
computed: {
...mapGetters([
...mapState(useCommonStore,[
"getPanelStatus",
"isSidebarCollapsed",
"organNameGetter",
]),
},
methods: {
...mapMutations([
...mapActions(useCommonStore,[
"TOGGLE_PANEL",
"sidebarCollapsedSetter",
"taskSchemaSetter",
"checkPermissions"
]),
...mapActions(["checkPermissions"]),
// ...mapActions(["checkPermissions"]),
getSchemas() {
let url = this.repoMicroServiceName + "schema";
this.httpService

View File

@ -123,8 +123,7 @@ export default {
},
computed: {
...mapState(useAuthStore,[
"currentUser",
"currentUser",
]),
...mapState(useCommonStore,[
"getPanelStatus",

View File

@ -1,10 +1,10 @@
<template>
<div>
<the-sidebar2
<!-- <the-sidebar2
:class="buildName"
:menu="menu"
:showUserAvatar="true"
></the-sidebar2>
></the-sidebar2> -->
<div class="container-fluid">
<div>
<div>
@ -66,20 +66,24 @@
</template>
<script>
import HttpService from "@services/httpService";
import menu from "@task/json/menu.json";
import { mapGetters, mapMutations } from "vuex";
// import { mapGetters, mapMutations } from "vuex";
import { mapState, mapActions } from "pinia";
import { useEntityStore } from "@task/stores/entityStore";
import { useCommonStore } from "~/stores/commonStore";
export default {
beforeMount() {
this.httpService = new HttpService(this.taskMicroServiceName);
// this.httpService = new HttpService(this.taskMicroServiceName);
this.httpService = useNuxtApp()["$http"];
},
mounted() {
this.setActiveTab(this.navList[0]);
},
data() {
return {
httpService: undefined,
// httpService: undefined,
httpService: {},
menu: menu,
mainComponentName: "TaskUserReport",
navList: [
@ -92,11 +96,12 @@ export default {
};
},
computed: {
...mapGetters("entity", ["activeTabGetter"]),
...mapGetters(["isSidebarCollapsed"]),
...mapState(useEntityStore, ["activeTabGetter"]),
// ...mapGetters(["isSidebarCollapsed"]),
...mapState(useCommonStore, ["isSidebarCollapsed"]),
},
methods: {
...mapMutations("entity", ["activeTabSetter"]),
...mapActions(useEntityStore, ["activeTabSetter"]),
setActiveTab(tab) {
this.activeTabSetter(tab);
if (tab.key == "group") {
@ -137,6 +142,6 @@ export default {
background-color: #eee;
}
.nav-tabs {
border-bottom: unset;
}
border-bottom: unset;
}
</style>

View File

@ -4,7 +4,7 @@
<header>
<the-navbar></the-navbar>
</header>
<the-sidebar2 :menu="menu" :showUserAvatar="true"></the-sidebar2>
<!-- <the-sidebar2 :menu="menu" :showUserAvatar="true"></the-sidebar2> -->
<main
class="pages-content-container main-page__content"
:class="{ expanded: !isSidebarCollapsed }"
@ -168,15 +168,21 @@
</template>
<script>
import { mapGetters, mapActions } from "vuex";
import HttpService from "@services/httpService";
// import { mapGetters, mapActions } from "vuex";
// import HttpService from "@services/httpService";
import { useCommonStore } from "~/stores/commonStore";
import { usePermitStore } from "~/stores/permitStore";
import { mapState, mapActions } from "pinia";
import menu from "@task/json/menu.json";
import permitApis from "@apis/permitApi";
import taskApi from "@apis/taskApi";
import taskApi from "@task/apis/taskApi";
export default {
beforeMount() {
this.httpService = new HttpService(this.taskMicroServiceName);
// this.httpService = new HttpService(this.taskMicroServiceName);
this.httpService = useNuxtApp()["$http"];
},
mounted() {
this.checkPermisionBeforGetList();
@ -192,7 +198,8 @@ export default {
groupLists: [],
menu: menu,
firstTimeSearching: false,
httpService: undefined,
// httpService: undefined,
httpService: {},
tableActions: [
{
showOutside: true,
@ -262,12 +269,12 @@ export default {
};
},
computed: {
...mapGetters(["isSidebarCollapsed"]),
...mapState(useCommonStore,["isSidebarCollapsed"]),
...mapGetters("permit", ["projectGetter"]),
// ...mapGetters("permit", ["projectGetter"]),
},
methods: {
...mapActions(["checkPermissions"]),
...mapActions(useCommonStore,["checkPermissions"]),
async getGroups() {
let url = taskApi.taskTeams.getList;

View File

@ -6,7 +6,7 @@
<script>
import { clearBodyClass } from "@manuals/utilities";
import menu from "@chat/json/menu.json";
import menu from "@task/json/menu.json";
export default {
name: "taskRouterView",

302
stores/entityStore.ts Normal file
View File

@ -0,0 +1,302 @@
import type {
ActiveEntityViewSchema,
activeResearchType,
ActiveTab,
EntityViewSchema,
ListEntity,
qruleActiveTab,
qruleActiveTabGetter,
SelectedItemEntity,
SimilarInfo,
} from "~/types/entityType";
export const useEntityStore = defineStore("entityStore", {
persist: {
storage: piniaPluginPersistedstate.localStorage(),
pick: [
"draftSchema",
"draftActiveStep",
"draftActiveSchema",
"draftSaveBoxSchema",
"activeTab",
"isReadingMode",
"entityViewSchema",
"activeEntityViewSchema",
"qruleActiveTab",
"qruleSchema",
"qruleActiveSchema",
"listHighlightText",
"activeResearchType",
],
},
state: () => ({
activeTab: undefined as ActiveTab | undefined,
entityViewSchema: undefined as EntityViewSchema | undefined,
selectedItemEntity: undefined as SelectedItemEntity | undefined,
listEntity: undefined as ListEntity | undefined,
activeEntityViewSchema: undefined as ActiveEntityViewSchema | undefined,
similarInfo: {} as SimilarInfo | undefined,
vuexEntity: undefined, //پیدا نکردم
qruleActiveSchema: undefined as qruleActiveTabGetter | undefined,
qruleActiveTab: undefined as qruleActiveTab | undefined,
activeResearchType: undefined as activeResearchType | undefined,
isReadingMode: false,
fontSize: undefined as undefined | string,
selectedText: undefined as undefined | string,
showSidebar: false,
statusId: undefined,
statusButton: undefined,
statusEntityViewPage: undefined,
textSteps: [],
listHighlightText: [],
breadCrumb: [],
// draft law
nlpTree: undefined,
draftActiveStep: undefined,
draftActiveSchema: undefined,
draftSchema: undefined,
draftSaveBoxSchema: [],
// draft law
qruleSchema: undefined,
queryParams: undefined,
statusRemovCheckBox: undefined,
requestSimilar: false, // این متغییر دیگه نباید استفاده شود
newSimilar: false, // این متغییر دیگه نباید استفاده شود
showModal: false,
changePagForFish: 0,
itemEditForFish: undefined,
fishActions: undefined,
annotationActions: undefined,
itemEditForAnnotation: undefined,
showModalAnnotation: false,
}),
getters: {
// start: draft page
nlpTreeGetter(state) {
return state.nlpTree;
},
draftActiveStepGetter(state) {
return state.draftActiveStep;
},
draftSchemaGetter(state) {
return state.draftSchema;
},
draftActiveSchemaGetter(state) {
return state.draftActiveSchema;
},
draftSaveBoxSchemaGetter(state) {
return state.draftSaveBoxSchema;
},
// end: draft page
vuexEntityGetter(state) {
return state.vuexEntity;
},
breadCrumbGetter(state) {
return state.breadCrumb;
},
entityViewSchemaGetter(state) {
return state.entityViewSchema;
},
activeTabGetter(state) {
return state.activeTab;
},
qruleActiveTabGetter(state) {
return state.qruleActiveTab;
},
qruleActiveSchemaGetter(state) {
return state.qruleActiveSchema;
},
selectedItemEntityGetter(state) {
return state.selectedItemEntity;
},
listEntityGetter(state) {
return state.listEntity;
},
activeEntityViewSchemaGetter(state) {
return state.activeEntityViewSchema;
},
fontSizeGerrer(state) {
return state.fontSize;
},
statusButtonGetter(state) {
return state.statusButton;
},
statusEntityViewPageGetter(state) {
return state.statusEntityViewPage;
},
textStepsGetter(state) {
return state.textSteps;
},
showSidebarGetter(state) {
return state.showSidebar;
},
similarInfoGetter(state) {
return state.similarInfo;
},
selectedTextGetter(state) {
return state.selectedText;
},
listHighlightTextGetter(state) {
return state.listHighlightText;
},
activeResearchTypeGetter(state) {
return state.activeResearchType;
},
isReadingModeGetter(state) {
return state.isReadingMode;
},
},
actions: {
// start: draft page
nlpTreeSetter(nlpTree = undefined) {
this.nlpTree = nlpTree;
},
draftActiveStepSetter(draftActiveStep = undefined) {
this.draftActiveStep = draftActiveStep;
},
draftSchemaSetter(draftSchema = undefined) {
this.draftSchema = draftSchema;
},
draftActiveSchemaSetter(draftActiveSchema = undefined) {
this.draftActiveSchema = draftActiveSchema;
},
draftSaveBoxSchemaSetter(draftSaveBoxSchema = []) {
this.draftSaveBoxSchema = draftSaveBoxSchema;
},
// end: draft page
vuexEntitySetter(vuexEntity = undefined) {
this.vuexEntity = vuexEntity;
},
breadCrumbSetter(newItem = undefined) {
if (!newItem) this.breadCrumb = [];
else this.breadCrumb = [...this.breadCrumb, newItem];
},
entityViewSchemaSetter(entityViewSchema = undefined) {
this.entityViewSchema = entityViewSchema;
},
activeEntityViewSchemaSetter(activeEntityViewSchema = undefined) {
this.activeEntityViewSchema = activeEntityViewSchema;
},
qruleActiveTabSetter(qruleActiveTab = undefined) {
this.qruleActiveTab = qruleActiveTab;
},
qruleSchemaSetter(qruleSchema = undefined) {
this.qruleSchema = qruleSchema;
},
qruleActiveSchemaSetter(qruleActiveSchema = undefined) {
this.qruleActiveSchema = qruleActiveSchema;
},
activeTabSetter(activeTab = undefined) {
this.activeTab = activeTab;
},
SET_ITEM_ENTITY(item=undefined) {
this.selectedItemEntity = item;
},
SET_LIST_ENTITY(list=undefined) {
this.listEntity = list;
},
SET_FONT(fontSize=undefined) {
this.fontSize = fontSize;
},
// SET_QUERY( queryParams) {
// this.queryParams = queryParams;
// },
SET_ITEM_LIST_SELECTED_ID(itemListIdSelected) {
this.itemListIdSelected = itemListIdSelected;
},
SET_STATUS_BUTTON(statusButton = undefined) {
this.statusButton = statusButton;
},
SET_STATUS_ENTITY_VIEWPAGE(statusEntityViewPage=undefined) {
this.statusEntityViewPage = statusEntityViewPage;
},
SET_STATUS_REMOVE_CHECKBOX(statusRemovCheckBox) {
this.statusRemovCheckBox = statusRemovCheckBox;
},
SET_TEXT_STEPS(textSteps) {
this.textSteps = textSteps;
},
SET_SHOW_SIDEBAR(showSidebar) {
this.showSidebar = showSidebar;
},
SET_REQUEST_SIMILAR(requestSimilar) {
this.requestSimilar = requestSimilar;
},
SET_NEW_SIMILAR(newSimilar) {
this.newSimilar = newSimilar;
},
selectedTextSetter(selectedText) {
this.selectedText = selectedText;
},
SET_SHOW_MODAL(showModal) {
this.showModal = showModal;
},
SET_CHANGE_PAG_FOR_FISH(changePagForFish) {
this.changePagForFish = changePagForFish;
},
itemEditForFishSetter(itemEditForFish) {
this.itemEditForFish = itemEditForFish;
},
fishActionsSetter(fishActions) {
this.fishActions = fishActions;
},
annotationActionsSetter(annotationActions) {
this.annotationActions = annotationActions;
},
itemEditForAnnotationSetter(itemEditForAnnotation) {
this.itemEditForAnnotation = itemEditForAnnotation;
},
showModalAnnotationSetter(showModalAnnotation) {
this.showModalAnnotation = showModalAnnotation;
},
similarInfoSetter(similarInfo) {
this.similarInfo = similarInfo;
},
listHighlightTextSetter(listHighlightText) {
// this.listHighlightText = listHighlightText;
// if (!this.listHighlightText.includes(listHighlightText)) {
// this.listHighlightText.push(listHighlightText);
// }
const exists = this.listHighlightText.some(
(item) => item.text === listHighlightText.text
);
if (!exists) {
this.listHighlightText.push(listHighlightText);
}
},
removeHighlightTextSetter(listHighlightText) {
this.listHighlightText = this.listHighlightText.filter(
(item) => item.text !== listHighlightText.text
);
},
toggleShowHighlightSetter(newState) {
this.listHighlightText.forEach((item) => (item.show = newState));
},
activeResearchTypeSetter(activeResearchType) {
this.activeResearchType = activeResearchType;
},
isReadingModeSetter(isReadingMode) {
this.isReadingMode = isReadingMode;
},
},
});
// export default {
// namespaced:true,
// state,
// actions,
// mutations,
// getters
// };

210
stores/searchStore.ts Normal file
View File

@ -0,0 +1,210 @@
import type {
activeSearchChartSchema,
activeSearchListSchema,
Domain,
searchActiveTab,
searchChartActiveTab,
searchListActiveTab,
searchSchema,
searchSynonymForm,
searchSynonymTitle,
selectionFilterItems,
} from "~/types/searchTypes";
import type {
isReturnFromItemshowPage,
list,
listComponentName,
listId,
projects,
selectedItem,
selectedProject,
} from "~/types/listTypes";
export const useSearchStore = defineStore("searchStore", {
persist: {
storage: piniaPluginPersistedstate.localStorage(),
}, state: () => ({
selectedProject: undefined as selectedProject | undefined,
isReturnFromItemshowPage: false as isReturnFromItemshowPage,
list: undefined as list | undefined,
listId: undefined as listId | undefined,
listComponentName: "ItemList" as listComponentName | undefined,
projects: [] as projects[],
// pieData: [],
selectedItem: undefined as selectedItem | undefined,
// activeTab: undefined,
searchActiveTab: undefined as searchActiveTab | undefined,
searchSchema: undefined as searchSchema | undefined,
searchActiveSchema: undefined as searchActiveTab | undefined,
searchListActiveTab: undefined as searchListActiveTab | undefined,
searchListSchema: undefined as searchListActiveTab[] | undefined,
activeSearchListSchema: undefined as activeSearchListSchema | undefined,
searchChartActiveTab: undefined as searchChartActiveTab | undefined,
searchChartSchema: undefined as searchChartActiveTab[] | undefined,
activeSearchChartSchema: undefined as activeSearchChartSchema | undefined,
searchSynonymTitle: undefined as searchSynonymTitle | undefined,
searchSynonymForm: undefined as searchSynonymForm | undefined,
selectionFilterItems: [] as selectionFilterItems,
}),
getters: {
projectsGetter(state) {
return state.projects;
},
selectedProjectGetter(state) {
return state.selectedProject;
},
listIdGetter(state) {
return state.listId;
},
listComponentNameGetter(state) {
return state.listComponentName;
},
selectedItemGetter(state) {
return state.selectedItem;
},
isReturnFromItemshowPageGetter(state) {
return state.isReturnFromItemshowPage;
},
listGetter(state) {
return state.list;
},
searchSynonymTitleGetter(state) {
return state.searchSynonymTitle;
},
searchSynonymFormGetter(state) {
return state.searchSynonymForm;
},
// activeTabGetter(state) {
// return state.activeTab;
// },
// search page
searchActiveTabGetter(state) {
return state.searchActiveTab;
},
searchSchemaGetter(state) {
return state.searchSchema;
},
searchActiveSchemaGetter(state) {
return state.searchActiveSchema;
},
// search list
searchListActiveTabGetter(state) {
return state.searchListActiveTab;
},
searchListSchemaGetter(state) {
return state.searchListSchema;
},
searchListActiveSchemaGetter(state) {
return state.activeSearchListSchema;
},
// search chart
searchChartActiveTabGetter(state) {
return state.searchChartActiveTab;
},
searchChartSchemaGetter(state) {
return state.searchChartSchema;
},
searchChartActiveSchemaGetter(state) {
return state.activeSearchChartSchema;
},
selectionFilterItemsGetter(state) {
return state.selectionFilterItems;
},
},
actions: {
SET_SELECTED_PROJECT(selectedProject = undefined) {
this.selectedProject = selectedProject;
},
SET_LIST_ID(listId = undefined) {
this.listId = listId;
},
SET_LIST_COMPONENT_NAME(
payload = { selectedItem: undefined, listComponentName: undefined }
) {
this.selectedItem = payload.selectedItem;
this.listComponentName = payload.listComponentName;
},
SET_SELECTED_ITEM(selectedItem = undefined) {
this.selectedItem = selectedItem;
},
SET_IS_RETURN_FROM_ITEM_SHOW_PAGE(isReturnFromItemshowPage = false) {
this.isReturnFromItemshowPage = isReturnFromItemshowPage;
},
SET_LIST(list = undefined) {
this.list = list;
},
searchSynonymFormSetter(searchSynonymForm = undefined) {
this.searchSynonymForm = searchSynonymForm;
},
searchSynonymTitleSetter(searchSynonymTitle = undefined) {
this.searchSynonymTitle = searchSynonymTitle;
},
// activeTabSetter(activeTab = undefined) {
// this.activeTab = activeTab;
// },
// search page
searchActiveTabSetter(searchActiveTab: searchActiveTab = undefined) {
this.searchActiveTab = searchActiveTab;
},
searchSchemaSetter(searchSchema = undefined) {
this.searchSchema = searchSchema;
},
searchActiveSchemaSetter(searchActiveSchema = undefined) {
this.searchActiveSchema = searchActiveSchema;
},
// search list
searchListActiveTabSetter(searchListActiveTab = undefined) {
this.searchListActiveTab = searchListActiveTab;
},
searchListSchemaSetter(searchListSchema = undefined) {
this.searchListSchema = searchListSchema;
},
searchListActiveSchemaSetter(activeSearchListSchema = undefined) {
this.activeSearchListSchema = activeSearchListSchema;
},
// search chart
searchChartActiveTabSetter(searchChartActiveTab = undefined) {
this.searchChartActiveTab = searchChartActiveTab;
},
searchChartSchemaSetter(searchChartSchema = undefined) {
this.searchChartSchema = searchChartSchema;
},
searchChartActiveSchemaSetter(activeSearchChartSchema = undefined) {
this.activeSearchChartSchema = activeSearchChartSchema;
},
selectionFilterItemsSetter(selectionFilterItems = []) {
this.selectionFilterItems = <selectionFilterItems>selectionFilterItems;
},
},
});
// export default {
// namespaced:true,
// state,
// actions,
// mutations,
// getters
// };

283
types/entityType.ts Normal file
View File

@ -0,0 +1,283 @@
// #region common Types
export type ListSource = {
ref_id: number;
ts_ref: string;
other_info: OtherInfo;
topics: [];
sort_date_timestamp: number;
main_type: string;
version_info: VersionInfo;
content: string;
expire_date: string;
sub_type: string;
parent_id: string;
qanon_etebar: string;
ts_date: string;
qanon_title: string;
qanon_id: string;
ref_key: string;
html: string;
id: string;
content_len: number;
state_etebar: string;
ts_year: string;
child_order: number;
title_type: string;
};
export type OtherInfo = {
level: number;
hierarchy: string;
number_text: string;
full_path: string;
};
export type VersionInfo = {
number: number;
operation: string;
timestamp: number;
};
// #endregion common Types
// #region ListItem Types
export type ListItem = {
_index: string;
_id: string;
_score: null;
_source: ListSource;
sort: number[];
};
export type List = ListItem[];
// #endregion ListItem Types
// #region ActiveEntityViewSchema Types
export type ActiveEntityViewSchema = {
key: string;
routeName: string;
type: string;
label: string;
header: {
componentName: string;
top_main: HeaderItems[];
top_jump: [];
top_mirror: HeaderItems[];
tools: {
showCompare: number;
showSearch: number;
showHeading: number;
showSettings: number;
showHilight: number;
showChanges: number;
};
};
entityPanel: {
entityHeading: EntityPanel & {
type: string;
};
navigation: EntityPanel;
};
contextMenu: ContextMenu[];
researchs: Researchs[];
property: Property[];
settings: Settings[];
versionEnable: false;
field_collapse: string;
entity_title: string;
items: ActiveEntityViewSchemaItems[];
tabs: Tabs[];
};
export type Property = {
title: string;
key: string;
type: string;
items: PropertyItem[];
};
export type PropertyItem = {
hideInCreateEntity: number;
key: string;
label: string;
type: string;
placeholder: string;
required: string;
validation_regex: string;
validation_error: string;
multi_select: string;
options: [];
labelClass: string;
inputClass: string;
};
export type Panel = {
header: [{ key: string; label: string; type: string }];
content: { key: string; label: string; type: string };
};
export type ContextMenu = {
key: string;
title: string;
icon: string;
panel: Panel[];
form?: [];
};
export type TstateOptions = {
value: string;
title: string;
type_label: string;
showInput: number;
};
export type ActiveEntityViewSchemaItems = {
title: string;
scrollTitle: string;
key: string;
type: string;
filed_state: string;
readonly: number;
modalName: string;
completion: string;
tstate_options: TstateOptions[];
items: ActiveEntityViewSchemaItemschilds[];
};
export type ActiveEntityViewSchemaItemschilds = {
key: string;
label: string;
};
export type EntityPanel = {
title: string;
key: string;
routeName: string;
};
export type HeaderItems = {
title: string;
key: string;
type: string;
col: string;
};
export type Researchs = {
key: string;
title: string;
icon: string;
form: [];
};
export type Settings = {
label: string;
key: string;
type: string;
items: [{ value: string; title: string }];
default: string | boolean;
};
export type Tabs = {
title: string;
componentName: string;
key: string;
};
// #endregion ActiveEntityViewSchema Types
// #region ActiveSystem Types
export type ActiveSystem = {
id: number;
created_at: number;
updated_at: number;
title: string;
users: string;
organ: string;
owner: number;
comment: string;
link: string;
showInDashboard: number;
loading: boolean;
};
// #endregion ActiveSystem Types
// #region ActiveTab Types
export type ActiveTab = {
title: string;
componentName: string;
key: string;
};
// #endregion ActiveTab Types
export type EntityViewSchema = ActiveEntityViewSchema[];
// #region ListEntity Types
export type ListEntity = [
ListItem & {
fields: { qanon_id: string[] };
inner_hits: InnerHits;
}
];
export type InnerHits = {
by_collapse: {
hits: {
total: { value: number; relation: string };
max_score: number;
hits: ListItem[];
};
};
};
// #endregion ListEntity Types
export type SelectedItemEntity = ListItem & ListSource;
// #region SimilarInfo Types
export type SimilarInfo = {
type: string;
show: boolean;
text: string;
id: string;
label: string;
};
// #endregion SimilarInfo Types
// #region qruleActiveTabGetter Types
export type qruleActiveTabGetter = {
key: string;
routeName: string;
type: string;
label: string;
field_collapse: string;
filter: qruleActiveTabFilter[];
tabs: qruleActiveTabGetterTabs[];
};
export type qruleActiveTabFilter = {
title: string;
filter_key: string;
source_key: string;
by_more: number;
};
export type qruleActiveTabGetterTabsTable_columns = {
key: string;
title: string;
width: string;
textAlign: string;
isLink: boolean;
trancate_word: number;
process: string;
};
export type qruleActiveTabGetterTabsItems_headers = {
key: string;
label: string;
options: [{ value: string; title: string }];
};
export type qruleActiveTabGetterTabsItems = {
key: string;
label: string;
type: string;
placeholder: string;
required: string;
delimiter: string;
isarray: 1;
classes: string;
url_GET: string;
rows: string;
options: [{ value: string; title: string }];
};
export type qruleActiveTabGetterTabs = {
title: "اجزاء قانون";
key: "rulesection";
componentName: "EntityQModelRule";
key_filter: "";
items_headers: qruleActiveTabGetterTabsItems_headers[];
table_columns: qruleActiveTabGetterTabsTable_columns[];
items: qruleActiveTabGetterTabsItems[];
};
// #endregion qruleActiveTabGetter Types
export type qruleActiveTab = {
title: string;
key: string;
componentName: string;
key_filter: string;
items_headers: [];
table_columns: qruleActiveTabGetterTabsTable_columns[];
};
export type activeResearchType = { key: string; title: string };

260
types/searchTypes.ts Normal file
View File

@ -0,0 +1,260 @@
export type SummaryOption = { key: string; label: string; type: string };
export type Filter = {
title: string;
filter_key: string;
source_key: string;
by_more: number;
};
export type Summary = {
title: string;
key: string;
options: SummaryOption[];
};
export type Tag = {
قانون: string;
عنوان: string;
متن: string;
ماده: string;
نوع: string;
سال: string;
دسته: string;
مصوب: string;
تاریخ: string;
};
export type Domain = {
label: string;
tag: string;
key: string;
field_collapse: string;
table_actions: TableActions[];
table_columns: TableColumns;
};
export type DomainItem = {
label: string;
tag: string;
key: string;
field_collapse: string;
table_actions: TableActions[];
table_columns: TableColumns[];
};
export type baseTableAction = {
title: string;
key: string;
"v-can": string;
icon: string;
type: string;
link_route?: {
id: string;
name: string;
key: string;
};
toggle_icons?: { icon1: string; icon2: string };
};
export type TableActions = [
baseTableAction & {
api_items: {
data_type: string;
ref_key: string;
id: string;
title: string;
};
}
];
export type TableColumnItem = {
key: string;
title: string;
width: string;
textAlign?: string;
isLink?: true;
link_route?: { id: string; name: string; key: string };
trancate_word?: number;
colors?: {
منسوخه: string;
معتبر: string;
موقت: string;
"بااجرامنتفي مي شود": string;
تمديد: string;
آزمايشي: string;
تنفيذ: string;
};
};
export type TableColumns = TableColumnItem[];
export type Advance = {
key: string;
label: string;
tag: string;
type: string;
placeholder: string;
labelClass: string;
inputClass: string;
multi_select: string;
options?: [{ value: string; title: string }];
};
export type SearchType = {
key: string;
description?: string;
label: string;
item?: {
label: string;
type: string;
component: string;
};
};
export type SearchContentActions = {
icon?: "";
title: string;
key: string;
type: string;
"v-can": string;
api_items?: {
data_type: string;
ref_key: string;
id: string;
title: string;
};
toggle_icons?: { icon1: string; icon2: string };
};
export type Item = {
key: string;
source_key: string;
label: string;
style: string;
process?: string;
link_route?: {
id: string;
name: string;
key: string;
};
};
export type Items = {
key: string;
items: Item[];
array_key: string;
};
export type SearchContentCollapseItems = {
key: string;
items: Items[];
};
export type ListItem = {
title: string;
list_key: string;
filter_key: string;
icon: string;
};
export type List = ListItem[];
// search
export type searchActiveTab = {
key: string;
label: string;
key_navbar:string;
description: string;
routeName: string;
searchContent: string;
showTableList: number;
summary: Summary;
filter: Filter[];
domain: {
tags: Tag;
domain: Domain[] | [];
}|{};
advance: Advance[];
searchType: SearchType[];
search_content: {
actions: SearchContentActions[];
collapse_items: SearchContentCollapseItems;
};
lists: List;
colors_qanon_etebar: {
منسوخه: "red";
معتبر: "green";
موقت: "blue";
"بااجرامنتفي مي شود": "blue";
تمديد: "coral";
آزمايشي: "blue";
تنفيذ: "coral";
};
}| undefined;
export type searchSchema = searchActiveTab[];
export type searchActiveSchema = [];
// search list
export type searchChartSchemaItem = {
key: string;
label: string;
description: string;
routeName: string;
searchContent: string;
showTableList: number;
summary: Summary;
filter: Filter[];
search_content: {
actions: SearchContentActions[];
collapse_items: SearchContentCollapseItems;
};
info: {
title: string;
index_name: string;
meta: string;
table_columns: string;
table_columns_subject: string;
entity_view: string;
lists: [];
items: [{ name: string; title: string }];
};
actions: TableActions;
items: searchListActiveTab[];
};
export type searchListActiveTabItem = {
key: string;
id: number;
url_GET_item: string;
key_filter: string;
label: string;
};
export type searchListActiveTab = {
key: string;
label: string;
field_collapsed: string;
items: searchListActiveTabItem[];
};
export type searchListSchema = searchChartSchemaItem[];
export type activeSearchListSchema = searchChartSchemaItem;
// search chart
export type searchChartActiveTab = {
key: string;
componentName: string;
label: string;
chartBase: {
key: string;
label: string;
items: [{ key: string; label: string }];
};
};
export type searchChartSchema = activeSearchChartSchema[];
export type activeSearchChartSchema = searchActiveTab & {
items: searchChartSchemaItem[];
};
export type searchSynonymTitle = {};
export type searchSynonymForm = [];
export type selectionFilterItems = [];
export type helpSchema = helpActiveSchema[];
export type helpActiveSchema = {
key: string;
label: string;
title: string;
comment: string;
};
export type DomainActive = Domain;