|
@@ -9,6 +9,7 @@ import {
|
|
|
getModelListByAssessmentId,
|
|
|
getUserListObjectByModelId
|
|
|
} from "@/api/draw";
|
|
|
+import { useRouter, useRoute } from "vue-router";
|
|
|
|
|
|
const $emit = defineEmits(["handClick"]);
|
|
|
|
|
@@ -24,6 +25,7 @@ const dataList = reactive({
|
|
|
assessmentObjectId: ""
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
// 考核模板
|
|
|
const getTemplateInfoListApi = async selectedItem => {
|
|
|
const { data, code } = await getModelListByAssessmentId(selectedItem);
|
|
@@ -39,23 +41,12 @@ const userPageWhitOrganizationApi = async selectedItem => {
|
|
|
assessmentId: selectedItem.assessmentId,
|
|
|
modelId: selectedItem.assessmentModelId
|
|
|
});
|
|
|
- console.log("1111", data);
|
|
|
if (code === 200) {
|
|
|
dataList.personList = data;
|
|
|
}
|
|
|
};
|
|
|
// userPageWhitOrganizationApi();
|
|
|
-// 考核活动
|
|
|
-const getAssessmentPageListApi = async () => {
|
|
|
- const { data, code } = await getAssessmentList({
|
|
|
- type: 1
|
|
|
- });
|
|
|
- if (code === 200) {
|
|
|
- dataList.magList = data;
|
|
|
- }
|
|
|
- console.log("await", data);
|
|
|
-};
|
|
|
-getAssessmentPageListApi();
|
|
|
+
|
|
|
// 部门
|
|
|
const postListTreeApi = async () => {
|
|
|
const { data, code } = await postListTree();
|
|
@@ -97,6 +88,7 @@ const handClickInit2 = value => {
|
|
|
...init
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
const handClickInit3 = value => {
|
|
|
if (value) {
|
|
|
const selectedItem = dataList.teplist.find(
|
|
@@ -111,6 +103,67 @@ const handClickInit3 = value => {
|
|
|
...init
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
+const route = useRoute();
|
|
|
+const getSearchFrom = () => {
|
|
|
+ route
|
|
|
+ ? console.log(route.query, "获取的路由信息")
|
|
|
+ : console.log("获得的路由信息为空", route);
|
|
|
+ if (Object.keys(route.query).length > 0) {
|
|
|
+ const {
|
|
|
+ assessmentId,
|
|
|
+ assessmentModelId,
|
|
|
+ assessmentObjectId,
|
|
|
+ assessmentName,
|
|
|
+ assessmentModelName,
|
|
|
+ assessmentObjectName
|
|
|
+ } = route.query;
|
|
|
+ const obj = ["assessmentId", "assessmentModelId", "assessmentObjectId"];
|
|
|
+ const initObj = [
|
|
|
+ "assessmentName",
|
|
|
+ "assessmentModelName",
|
|
|
+ "assessmentObjectName"
|
|
|
+ ];
|
|
|
+ obj.map(item => {
|
|
|
+ dataList.params[item] = route.query[item];
|
|
|
+ });
|
|
|
+ initObj.map(item => {
|
|
|
+ init[item] = route.query[item];
|
|
|
+ });
|
|
|
+ // dataList.params.assessmentId = assessmentId
|
|
|
+ // dataList.params.assessmentModelId = assessmentModelId
|
|
|
+ // dataList.params.assessmentObjectId = assessmentObjectId
|
|
|
+ // init.assessmentName = assessmentName;
|
|
|
+ // init.assessmentModelName = assessmentModelName
|
|
|
+ // init.assessmentObjectName = assessmentObjectName
|
|
|
+ const selectedItem = dataList.magList.find(
|
|
|
+ item => item.id === assessmentId
|
|
|
+ );
|
|
|
+ getTemplateInfoListApi(selectedItem);
|
|
|
+ const selectedItems = dataList.teplist.find(
|
|
|
+ item => item.assessmentModelId === dataList.params.assessmentModelId
|
|
|
+ );
|
|
|
+ userPageWhitOrganizationApi(selectedItems);
|
|
|
+ setTimeout(() => {
|
|
|
+ $emit("handClick", {
|
|
|
+ ...dataList.params,
|
|
|
+ ...init
|
|
|
+ });
|
|
|
+ }, 100);
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+// 考核活动
|
|
|
+const getAssessmentPageListApi = async () => {
|
|
|
+ const { data, code } = await getAssessmentList({
|
|
|
+ type: 1
|
|
|
+ });
|
|
|
+ if (code === 200) {
|
|
|
+ dataList.magList = data;
|
|
|
+ getSearchFrom();
|
|
|
+ }
|
|
|
+};
|
|
|
+getAssessmentPageListApi();
|
|
|
</script>
|
|
|
|
|
|
<template>
|