بیلد تسک

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,8 +61,8 @@
</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: [],
@ -70,10 +70,15 @@ export default {
}, },
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)
.then((res) => {
this.$set(hourItem, "tasks", res.data); this.$set(hourItem, "tasks", res.data);
// this.sortForms = res.data; // this.sortForms = res.data;
}) });
}, },
}, },
}; };

View File

@ -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,8 +309,8 @@ 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" },
@ -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)
@ -665,22 +669,38 @@ export default {
}, },
}, },
components: { components: {
UsersSearch: () => UsersSearch: defineAsyncComponent(() =>
import( import("~/components/admin/components/UsersSearch.vue")
"@admin/components/UsersSearch"
), ),
TeamForm: () => // UsersSearch: () =>
import( "@task/components/TeamForm"), // import(
SortingTasksAdmin: () => // "@admin/components/UsersSearch"
import( // ),
"@task/components/SortingTasksAdmin" TeamForm: defineAsyncComponent(() => import("@task/components/TeamForm")),
// TeamForm: () =>
// import( "@task/components/TeamForm"),
SortingTasksAdmin: defineAsyncComponent(() =>
import("@task/components/SortingTasksAdmin")
), ),
SortingByDayTasksAdmin: () => // SortingTasksAdmin: () =>
import( // import(
"@task/components/SortingByDayTasksAdmin" // "@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")
), ),
PieDonut: () => import("@components/charts/PieDonut.vue"),
SwitchComponent: () => import("@components/SwitchComponent.vue"),
}, },
}; };
</script> </script>

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: {