diff --git a/src/views/learningpath/LearningPath.vue b/src/views/learningpath/LearningPath.vue
index b7af07a2..e7c377e8 100644
--- a/src/views/learningpath/LearningPath.vue
+++ b/src/views/learningpath/LearningPath.vue
@@ -278,7 +278,7 @@
/>
+
@@ -710,6 +710,7 @@ import { storage } from "../../api/storage";
import { useStore } from "vuex";
import OrgClass from "@/components/project/OrgClass";
import NameInput from "@/components/project/NameInput";
+import {validateName} from "../../api/index1";
export default {
name: "learningPath",
@@ -1458,7 +1459,7 @@ export default {
state.organizationSelectId = e;
};
//创建学习路径图
- const createLearnPath = () => {
+ const createLearnPath = async() => {
if (!state.pathName) {
message.destroy();
return message.warning("请输入路径图名称");
@@ -1475,6 +1476,17 @@ export default {
message.destroy();
message.warning("路径图名称重复");
return;
+ }
+ const offName = await validateName({
+ name: state.pathName,
+ type: 3,
+ id:state.editPathId,
+ }).then(res => {
+ return res.data.data == 1;
+ });
+ if (offName) {
+ message.destroy();
+ return message.warning("项目名称重复,请重新填写");
}
state.lpLoading = true;
let obj = {
@@ -1636,7 +1648,7 @@ export default {
state.out1 = true;
};
//编辑学习路径图
- const editLearnPath = () => {
+ const editLearnPath = async () => {
if (!state.pathName) {
message.destroy();
return message.warning("请输入路径图名称");
@@ -1661,6 +1673,17 @@ export default {
// state.pathIntro = detail.remark;
// state.editPathId = id;
// state.createLoading = true;
+ const offName = await validateName({
+ name: state.pathName,
+ type: 3,
+ id:state.editPathId,
+ }).then(res => {
+ return res.data.data == 1;
+ });
+ if (offName) {
+ message.destroy();
+ return message.warning("项目名称重复,请重新填写");
+ }
let obj = {
routerId: state.editPathId,
name: state.pathName,