mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-14 21:36:44 +08:00
创建路径名字重复校验
This commit is contained in:
@@ -278,7 +278,7 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="inname">路径图名称</div>
|
<div class="inname">路径图名称</div>
|
||||||
<div class="in" >
|
<div class="in road" >
|
||||||
<!-- <a-input-->
|
<!-- <a-input-->
|
||||||
<!-- v-model:value="pathName"-->
|
<!-- v-model:value="pathName"-->
|
||||||
<!-- maxlength="20"-->
|
<!-- maxlength="20"-->
|
||||||
@@ -710,6 +710,7 @@ import { storage } from "../../api/storage";
|
|||||||
import { useStore } from "vuex";
|
import { useStore } from "vuex";
|
||||||
import OrgClass from "@/components/project/OrgClass";
|
import OrgClass from "@/components/project/OrgClass";
|
||||||
import NameInput from "@/components/project/NameInput";
|
import NameInput from "@/components/project/NameInput";
|
||||||
|
import {validateName} from "../../api/index1";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "learningPath",
|
name: "learningPath",
|
||||||
@@ -1458,7 +1459,7 @@ export default {
|
|||||||
state.organizationSelectId = e;
|
state.organizationSelectId = e;
|
||||||
};
|
};
|
||||||
//创建学习路径图
|
//创建学习路径图
|
||||||
const createLearnPath = () => {
|
const createLearnPath = async() => {
|
||||||
if (!state.pathName) {
|
if (!state.pathName) {
|
||||||
message.destroy();
|
message.destroy();
|
||||||
return message.warning("请输入路径图名称");
|
return message.warning("请输入路径图名称");
|
||||||
@@ -1475,6 +1476,17 @@ export default {
|
|||||||
message.destroy();
|
message.destroy();
|
||||||
message.warning("路径图名称重复");
|
message.warning("路径图名称重复");
|
||||||
return;
|
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;
|
state.lpLoading = true;
|
||||||
let obj = {
|
let obj = {
|
||||||
@@ -1636,7 +1648,7 @@ export default {
|
|||||||
state.out1 = true;
|
state.out1 = true;
|
||||||
};
|
};
|
||||||
//编辑学习路径图
|
//编辑学习路径图
|
||||||
const editLearnPath = () => {
|
const editLearnPath = async () => {
|
||||||
if (!state.pathName) {
|
if (!state.pathName) {
|
||||||
message.destroy();
|
message.destroy();
|
||||||
return message.warning("请输入路径图名称");
|
return message.warning("请输入路径图名称");
|
||||||
@@ -1661,6 +1673,17 @@ export default {
|
|||||||
// state.pathIntro = detail.remark;
|
// state.pathIntro = detail.remark;
|
||||||
// state.editPathId = id;
|
// state.editPathId = id;
|
||||||
// state.createLoading = true;
|
// 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 = {
|
let obj = {
|
||||||
routerId: state.editPathId,
|
routerId: state.editPathId,
|
||||||
name: state.pathName,
|
name: state.pathName,
|
||||||
|
|||||||
Reference in New Issue
Block a user