mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-13 04:46:46 +08:00
创建路径名字重复校验
This commit is contained in:
@@ -278,7 +278,7 @@
|
||||
/>
|
||||
</div>
|
||||
<div class="inname">路径图名称</div>
|
||||
<div class="in" >
|
||||
<div class="in road" >
|
||||
<!-- <a-input-->
|
||||
<!-- v-model:value="pathName"-->
|
||||
<!-- maxlength="20"-->
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user