بیلد تسک

This commit is contained in:
Mehdi104797 2025-05-10 10:41:34 +03:30
parent cc55ac6684
commit dcff122bba
5 changed files with 87 additions and 61 deletions

View File

@ -76,17 +76,19 @@
</div> </div>
</template> </template>
<script> <script>
import HttpService from "@services/httpService"; // import HttpService from "@services/httpService";
export default { export default {
name: "sharemodal", name: "sharemodal",
props: ["item", "itemType"], props: ["item", "itemType"],
mounted() { mounted() {
this.httpService = new HttpService(this.loginMicroServiceName); // this.httpService = new HttpService(this.loginMicroServiceName);
this.httpService = useNuxtApp()["$http"];
}, },
data() { data() {
return { return {
httpService: undefined, // httpService: undefined,
httpService: {},
newItemType: 0, newItemType: 0,
suggestionMode: false, suggestionMode: false,
query: "", query: "",

View File

@ -61,19 +61,24 @@
</template> </template>
<script> <script>
import HttpService from "@services/httpService"; // import HttpService from "@services/httpService";
import taskApi from "@apis/taskApi"; import taskApi from "@task/apis/taskApi";
export default { export default {
props: { props: {
workList: [], workList: [],
userId: "", userId: "",
}, },
beforeMount() { beforeMount() {
this.httpService = new HttpService( this.taskMicroServiceName // this.httpService = new HttpService( this.taskMicroServiceName
); // );
this.httpService = useNuxtApp()["$http"];
},
data() {
return {
httpService: {},
};
}, },
computed: { computed: {
taskMicroServiceName() { taskMicroServiceName() {
return process.env.VUE_APP_TASK; return process.env.VUE_APP_TASK;
@ -97,13 +102,10 @@ export default {
}; };
const url = taskApi.workingHours.day; const url = taskApi.workingHours.day;
this.httpService this.httpService.postRequest(url, payload).then((res) => {
.postRequest(url, payload) this.$set(hourItem, "tasks", res.data);
.then((res) => { // this.sortForms = res.data;
this.$set(hourItem, "tasks", res.data); });
// this.sortForms = res.data;
})
}, },
}, },
}; };

View File

@ -1,5 +1,5 @@
<template> <template>
<div class=" container-fluid"> <div class="container-fluid">
<div class="all-selects justify-content-between col-12"> <div class="all-selects justify-content-between col-12">
<div class="selects col-md-4 justify-content-start align-items-center"> <div class="selects col-md-4 justify-content-start align-items-center">
<div> <div>
@ -30,7 +30,11 @@
</div> </div>
<div> <div>
<label class="teams-label">تیم ها:</label> <label class="teams-label">تیم ها:</label>
<select v-model="group_id" @change="getMainList" class="form-select form-control"> <select
v-model="group_id"
@change="getMainList"
class="form-select form-control"
>
<option selected value="">همه</option> <option selected value="">همه</option>
<option v-for="item in groups" :value="item.id"> <option v-for="item in groups" :value="item.id">
{{ item.title }} {{ item.title }}
@ -142,7 +146,6 @@
height="300px" height="300px"
></pie-donut> ></pie-donut>
</div> </div>
</div> </div>
</div> </div>
</main> </main>
@ -150,17 +153,20 @@
</template> </template>
<script> <script>
import { mapGetters, mapActions } from "vuex"; // import { mapGetters, mapActions } from "vuex";
import HttpService from "@services/httpService"; import { mapState, mapActions } from "pinia";
import { useCommonStore } from "~/stores/commonStore";
// import HttpService from "@services/httpService";
import menu from "@task/json/menu.json"; import menu from "@task/json/menu.json";
import adminApi from "@apis/adminApi"; // import adminApi from "@apis/adminApi";
import taskApi from "@apis/taskApi"; import taskApi from "@task/apis/taskApi";
import { p2e } from "@plugins/persianNumber"; // import { p2e } from "@plugins/persianNumber";
export default { export default {
beforeMount() { beforeMount() {
this.httpService = new HttpService( this.taskMicroServiceName // this.httpService = new HttpService( this.taskMicroServiceName
); // );
this.httpService = useNuxtApp()["$http"];
}, },
mounted() { mounted() {
this.checkPermisionBeforGetList(); this.checkPermisionBeforGetList();
@ -196,7 +202,8 @@ export default {
mainList: [], mainList: [],
menu: menu, menu: menu,
firstTimeSearching: false, firstTimeSearching: false,
httpService: undefined, // httpService: undefined,
httpService: {},
tableActions: [ tableActions: [
{ {
showOutside: true, showOutside: true,
@ -288,7 +295,6 @@ export default {
{ label: "تعداد فرآیند", key: "task_count", class: "col-2" }, { label: "تعداد فرآیند", key: "task_count", class: "col-2" },
{ label: "مدت", key: "duration", class: "col-2" }, { label: "مدت", key: "duration", class: "col-2" },
]; ];
else if (this.groupType == "organ") else if (this.groupType == "organ")
return [ return [
{ label: "سازمان", key: "organ", class: "col-6" }, { label: "سازمان", key: "organ", class: "col-6" },
@ -296,7 +302,6 @@ export default {
{ label: "تعداد فرآیند", key: "task_count", class: "col-2" }, { label: "تعداد فرآیند", key: "task_count", class: "col-2" },
{ label: "مدت", key: "duration", class: "col-2" }, { label: "مدت", key: "duration", class: "col-2" },
]; ];
else if (this.groupType == "title") else if (this.groupType == "title")
return [ return [
{ label: "عنوان", key: "title", class: "col-6" }, { label: "عنوان", key: "title", class: "col-6" },
@ -304,13 +309,13 @@ export default {
{ label: "تعداد فرآیند", key: "category_count", class: "col-2" }, { label: "تعداد فرآیند", key: "category_count", class: "col-2" },
{ label: "مدت", key: "duration", class: "col-2" }, { label: "مدت", key: "duration", class: "col-2" },
]; ];
else
else return [ return [
{ label: "تاریخ", key: "normalDate", class: "col-2" }, { label: "تاریخ", key: "normalDate", class: "col-2" },
{ label: "دسته", key: "category", class: "col-3" }, { label: "دسته", key: "category", class: "col-3" },
{ label: "عنوان", key: "title", class: "col-6" }, { label: "عنوان", key: "title", class: "col-6" },
{ label: "مدت", key: "duration", class: "col-1" }, { label: "مدت", key: "duration", class: "col-1" },
]; ];
}, },
buildName() { buildName() {
@ -318,8 +323,8 @@ export default {
}, },
}, },
methods: { methods: {
...mapGetters(["isSidebarCollapsed"]), ...mapState(useCommonStore, ["isSidebarCollapsed"]),
...mapActions(["checkPermissions"]), ...mapActions(useCommonStore, ["checkPermissions"]),
checkPermisionBeforGetList() { checkPermisionBeforGetList() {
if (this.fetchingData) return; if (this.fetchingData) return;
@ -473,7 +478,6 @@ export default {
// this.getGroupsWithoutAdmin(query); // this.getGroupsWithoutAdmin(query);
}, },
toggleUsersPanel(index = undefined) { toggleUsersPanel(index = undefined) {
if (index !== undefined) { if (index !== undefined) {
if (this.prevSelectedItemIndex !== undefined) if (this.prevSelectedItemIndex !== undefined)
@ -532,7 +536,7 @@ export default {
this.resetPagination(); this.resetPagination();
this.getMainList(); this.getMainList();
}, },
openCreatePanel() { openCreatePanel() {
if (this.showPanelTeams) { if (this.showPanelTeams) {
this.showPanelTeams = false; this.showPanelTeams = false;
@ -665,22 +669,38 @@ export default {
}, },
}, },
components: { components: {
UsersSearch: () => UsersSearch: defineAsyncComponent(() =>
import( import("~/components/admin/components/UsersSearch.vue")
"@admin/components/UsersSearch" ),
), // UsersSearch: () =>
TeamForm: () => // import(
import( "@task/components/TeamForm"), // "@admin/components/UsersSearch"
SortingTasksAdmin: () => // ),
import( TeamForm: defineAsyncComponent(() => import("@task/components/TeamForm")),
"@task/components/SortingTasksAdmin" // TeamForm: () =>
), // import( "@task/components/TeamForm"),
SortingByDayTasksAdmin: () => SortingTasksAdmin: defineAsyncComponent(() =>
import( import("@task/components/SortingTasksAdmin")
"@task/components/SortingByDayTasksAdmin" ),
), // SortingTasksAdmin: () =>
PieDonut: () => import("@components/charts/PieDonut.vue"), // import(
SwitchComponent: () => import("@components/SwitchComponent.vue"), // "@task/components/SortingTasksAdmin"
// ),
SortingByDayTasksAdmin: defineAsyncComponent(() =>
import("@task/components/SortingByDayTasksAdmin")
),
// SortingByDayTasksAdmin: () =>
// import(
// "@task/components/SortingByDayTasksAdmin"
// ),
PieDonut: defineAsyncComponent(() =>
import("@components/charts/PieDonut.vue")
),
// PieDonut: () => import("@components/charts/PieDonut.vue"),
// SwitchComponent: () => import("@components/SwitchComponent.vue"),
SwitchComponent: defineAsyncComponent(() =>
import("@task/components/SwitchComponent.vue")
),
}, },
}; };
</script> </script>
@ -766,7 +786,7 @@ export default {
margin-top: 2em; margin-top: 2em;
margin-right: 1em; margin-right: 1em;
} }
.form-control{ .form-control {
width: 6em; width: 6em;
} }
</style> </style>

View File

@ -206,7 +206,7 @@ import { mapState, mapActions } from "pinia";
import taskApi from "@task/apis/taskApi"; import taskApi from "@task/apis/taskApi";
import { useCommonStore } from "~/stores/commonStore"; import { useCommonStore } from "~/stores/commonStore";
import { p2e } from "@plugins/persianNumber"; // import { p2e } from "@plugins/persianNumber";
export default { export default {
beforeMount() { beforeMount() {

View File

@ -47,12 +47,13 @@
<script> <script>
// import taskApi from "@apis/taskApi"; // import taskApi from "@apis/taskApi";
import HttpService from "@services/httpService"; // import HttpService from "@services/httpService";
export default { export default {
beforeMount() { beforeMount() {
this.httpService = new HttpService( this.taskMicroServiceName // this.httpService = new HttpService( this.taskMicroServiceName
); // );
this.httpService = useNuxtApp()["$http"];
}, },
props: { props: {
parentLoading: false, parentLoading: false,
@ -87,6 +88,7 @@ export default {
organ: null, organ: null,
title: null, title: null,
}, },
httpService: {},
}; };
}, },
computed: { computed: {