mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-11 11:56:46 +08:00
-- 项目名称校验
This commit is contained in:
@@ -131,6 +131,7 @@ export const addStudentCourse = (obj) => http.post("/admin/offcourse/addStudent"
|
|||||||
// 获取组织结构树
|
// 获取组织结构树
|
||||||
export const orgtree = () => http.get("/org/tree");
|
export const orgtree = () => http.get("/org/tree");
|
||||||
export const saveStu = obj => http.post("/admin/student/addStudent", obj);
|
export const saveStu = obj => http.post("/admin/student/addStudent", obj);
|
||||||
|
export const validateName = obj => http.post("/admin/validate/validateName", obj);
|
||||||
|
|
||||||
//获取积分列表
|
//获取积分列表
|
||||||
export const noticeList = (projectId) =>
|
export const noticeList = (projectId) =>
|
||||||
|
|||||||
58
src/components/project/NameInput.vue
Normal file
58
src/components/project/NameInput.vue
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
<template>
|
||||||
|
<a-input
|
||||||
|
v-model:value="modelV"
|
||||||
|
placeholder="请输入项目名称"
|
||||||
|
:show-count="showCount"
|
||||||
|
:maxlength="maxlength"
|
||||||
|
@blur="validateProName"
|
||||||
|
/>
|
||||||
|
<div style="color:red;font-size: 10px" v-if="value && !validate">名称重复,请重新输入</div>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import {defineProps, defineEmits, watch, ref} from "vue";
|
||||||
|
import {validateName} from "@/api/index1";
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
value: {
|
||||||
|
type: String,
|
||||||
|
},
|
||||||
|
validate: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
type: {
|
||||||
|
type: Number,
|
||||||
|
default: 1
|
||||||
|
},
|
||||||
|
maxlength: {
|
||||||
|
type: Number,
|
||||||
|
default: 30
|
||||||
|
},
|
||||||
|
showCount: {
|
||||||
|
type: Boolean,
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const emit = defineEmits({})
|
||||||
|
|
||||||
|
const modelV = ref()
|
||||||
|
|
||||||
|
watch(() => props.value, () => {
|
||||||
|
if (props.value !== modelV.value) {
|
||||||
|
modelV.value = props.value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
watch(modelV, () => {
|
||||||
|
emit('update:value', modelV.value)
|
||||||
|
})
|
||||||
|
|
||||||
|
function validateProName() {
|
||||||
|
console.log(props.value)
|
||||||
|
props.value && validateName({name: props.value, type: props.type}).then(res => {
|
||||||
|
emit('update:validate', res.data.data !== 1)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
@@ -132,16 +132,17 @@
|
|||||||
</div>
|
</div>
|
||||||
<span style="margin-right: 3px">课程名称:</span>
|
<span style="margin-right: 3px">课程名称:</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="b_input">
|
<div class="in b_input">
|
||||||
<a-input
|
<NameInput placeholder="请输入课程名称" v-model:value="xzinputV1" v-model:validate="validate" :maxlength="20" show-count :type="2"></NameInput>
|
||||||
v-model:value="xzinputV1"
|
<!-- <a-input-->
|
||||||
maxlength="20"
|
<!-- v-model:value="xzinputV1"-->
|
||||||
style="width: 440px; height: 40px; border-radius: 8px"
|
<!-- maxlength="20"-->
|
||||||
placeholder="请输入课程名称"
|
<!-- style="width: 440px; height: 40px; border-radius: 8px"-->
|
||||||
/>
|
<!-- placeholder="请输入课程名称"-->
|
||||||
<div class="inp_num">
|
<!-- />-->
|
||||||
<span style="color: #c7cbd2">{{ xzinputV1.length }}/20</span>
|
<!-- <div class="inp_num">-->
|
||||||
</div>
|
<!-- <span style="color: #c7cbd2">{{ xzinputV1.length }}/20</span>-->
|
||||||
|
<!-- </div>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="b_sub">
|
<div class="b_sub">
|
||||||
@@ -336,14 +337,15 @@
|
|||||||
<span style="margin-right: 14px">课程名称</span>
|
<span style="margin-right: 14px">课程名称</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="item_inp">
|
<div class="item_inp">
|
||||||
<div class="i1_input">
|
<div class="in i1_input">
|
||||||
<a-input
|
<!-- <a-input-->
|
||||||
aria-readonly="true"
|
<!-- aria-readonly="true"-->
|
||||||
v-model:value="qdms_inputV1"
|
<!-- v-model:value="qdms_inputV1"-->
|
||||||
maxlength="90"
|
<!-- maxlength="90"-->
|
||||||
style="width: 440px; height: 40px; border-radius: 8px"
|
<!-- style="width: 440px; height: 40px; border-radius: 8px"-->
|
||||||
placeholder="请输入课程名称"
|
<!-- placeholder="请输入课程名称"-->
|
||||||
/>
|
<!-- />-->
|
||||||
|
<NameInput placeholder="请输入课程名称" v-model:value="qdms_inputV1" v-model:validate="validate" :maxlength="20" show-count :type="2"></NameInput>
|
||||||
<div class="inp_num">
|
<div class="inp_num">
|
||||||
<span style="color: #c7cbd2">
|
<span style="color: #c7cbd2">
|
||||||
{{ qdms_inputV1.length }}/90
|
{{ qdms_inputV1.length }}/90
|
||||||
@@ -2752,6 +2754,7 @@ import { useRouter, useRoute } from "vue-router";
|
|||||||
import addOnlineCourse from "../../components/Modals/addOnlineCourse.vue";
|
import addOnlineCourse from "../../components/Modals/addOnlineCourse.vue";
|
||||||
|
|
||||||
import ProjOwnerShip from "../../components/drawers/ProjectOwn";
|
import ProjOwnerShip from "../../components/drawers/ProjectOwn";
|
||||||
|
import NameInput from "../../components/project/NameInput";
|
||||||
import ProjPowerList from "../../components/drawers/ProjPowerList";
|
import ProjPowerList from "../../components/drawers/ProjPowerList";
|
||||||
import ProjCheckShip from "../../components/drawers/ProjCheckPower";
|
import ProjCheckShip from "../../components/drawers/ProjCheckPower";
|
||||||
import AssessmentList from "../../components/drawers/AssessmentList.vue";
|
import AssessmentList from "../../components/drawers/AssessmentList.vue";
|
||||||
@@ -3305,6 +3308,7 @@ export default defineComponent({
|
|||||||
ProjPowerList,
|
ProjPowerList,
|
||||||
ProjCheckShip,
|
ProjCheckShip,
|
||||||
AssessmentList,
|
AssessmentList,
|
||||||
|
NameInput,
|
||||||
// VNodes: (_, {attrs}) => {
|
// VNodes: (_, {attrs}) => {
|
||||||
// return attrs.vnodes;
|
// return attrs.vnodes;
|
||||||
// },
|
// },
|
||||||
@@ -3535,6 +3539,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
imageUrl: "",
|
imageUrl: "",
|
||||||
imgList: [],
|
imgList: [],
|
||||||
|
validate:true,
|
||||||
|
|
||||||
pageSize2: 10,
|
pageSize2: 10,
|
||||||
currentPage2: 0,
|
currentPage2: 0,
|
||||||
@@ -4481,6 +4486,10 @@ export default defineComponent({
|
|||||||
message.destroy();
|
message.destroy();
|
||||||
return message.warning("请输入必填项");
|
return message.warning("请输入必填项");
|
||||||
}
|
}
|
||||||
|
if (!state.validate) {
|
||||||
|
message.destroy();
|
||||||
|
return message.warning("路径图名称重复");
|
||||||
|
}
|
||||||
console.log(
|
console.log(
|
||||||
"state.bs_hs && state.valueE1 == 2",
|
"state.bs_hs && state.valueE1 == 2",
|
||||||
state.bs_hs,
|
state.bs_hs,
|
||||||
@@ -4594,7 +4603,10 @@ export default defineComponent({
|
|||||||
} else {
|
} else {
|
||||||
state.addLoading = true;
|
state.addLoading = true;
|
||||||
}
|
}
|
||||||
|
if (!state.validate) {
|
||||||
|
message.destroy();
|
||||||
|
return message.warning("路径图名称重复");
|
||||||
|
}
|
||||||
edit(postData).then((res) => {
|
edit(postData).then((res) => {
|
||||||
if (res.data.code === 200) {
|
if (res.data.code === 200) {
|
||||||
getTableDate();
|
getTableDate();
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -3,13 +3,13 @@
|
|||||||
<div class="projectAdd">
|
<div class="projectAdd">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<span class="title"
|
<span class="title"
|
||||||
>{{ projectInfo.parentId ? "编辑" : "创建" }}项目</span
|
>{{ projectInfo.parentId ? "编辑" : "创建" }}项目</span
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@click="backPage"
|
@click="backPage"
|
||||||
style="cursor: pointer"
|
style="cursor: pointer"
|
||||||
to="/projectmanage"
|
to="/projectmanage"
|
||||||
class="goback"
|
class="goback"
|
||||||
>
|
>
|
||||||
<span class="return"></span><span class="returntext">返回</span>
|
<span class="return"></span><span class="returntext">返回</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -19,8 +19,8 @@
|
|||||||
<div class="name" v-if="projectInfo.parentName">
|
<div class="name" v-if="projectInfo.parentName">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img
|
||||||
class="nameimg"
|
class="nameimg"
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
src="../../assets/images/basicinfo/asterisk.png"
|
||||||
/>
|
/>
|
||||||
<div class="inname">项目归属</div>
|
<div class="inname">项目归属</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -33,33 +33,27 @@
|
|||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img
|
||||||
class="nameimg"
|
class="nameimg"
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
src="../../assets/images/basicinfo/asterisk.png"
|
||||||
/>
|
/>
|
||||||
<div class="inname">项目名称</div>
|
<div class="inname">项目名称</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-input
|
<NameInput placeholder="请输入项目名称" v-model:value="projectInfo.name" v-model:validate="projectInfo.validate" :maxlength="30" show-count></NameInput>
|
||||||
v-model:value="projectInfo.name"
|
|
||||||
placeholder="请输入项目名称"
|
|
||||||
show-count
|
|
||||||
:maxlength="30"
|
|
||||||
:disabled="viewDetail ? true : false"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name flex-top">
|
<div class="name flex-top">
|
||||||
<div class="namebox" style="margin-top: 10px">
|
<div class="namebox" style="margin-top: 10px">
|
||||||
<img
|
<img
|
||||||
class="nameimg"
|
class="nameimg"
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
src="../../assets/images/basicinfo/asterisk.png"
|
||||||
/>
|
/>
|
||||||
<div class="inname">封面图</div>
|
<div class="inname">封面图</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in select" style="flex: 1; display: flex">
|
<div class="in select" style="flex: 1; display: flex">
|
||||||
<div
|
<div
|
||||||
:class="`box ${projectInfo.picUrl === src.value ? 'active' : ''}`"
|
:class="`box ${projectInfo.picUrl === src.value ? 'active' : ''}`"
|
||||||
style="
|
style="
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
@@ -67,19 +61,19 @@
|
|||||||
position: relative;
|
position: relative;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
"
|
"
|
||||||
v-for="(src, index) in projectPic"
|
v-for="(src, index) in projectPic"
|
||||||
:key="index"
|
:key="index"
|
||||||
@click="() => (projectInfo.picUrl = src.value)"
|
@click="() => (projectInfo.picUrl = src.value)"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
style="
|
style="
|
||||||
width: 100px;
|
width: 100px;
|
||||||
height: 100px;
|
height: 100px;
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
margin-right: 4px;
|
margin-right: 4px;
|
||||||
"
|
"
|
||||||
:src="src.value"
|
:src="src.value"
|
||||||
alt="avatar"
|
alt="avatar"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -87,63 +81,63 @@
|
|||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img
|
||||||
class="nameimg"
|
class="nameimg"
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
src="../../assets/images/basicinfo/asterisk.png"
|
||||||
/>
|
/>
|
||||||
<div class="inname">项目时间</div>
|
<div class="inname">项目时间</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-range-picker
|
<a-range-picker
|
||||||
show-time
|
show-time
|
||||||
separator="至"
|
separator="至"
|
||||||
:placeholder="[' 开始时间', ' 结束时间']"
|
:placeholder="[' 开始时间', ' 结束时间']"
|
||||||
v-model:value="projectInfo.rangeTime"
|
v-model:value="projectInfo.rangeTime"
|
||||||
style="width: 100%; height: 40px; border-radius: 5px"
|
style="width: 100%; height: 40px; border-radius: 5px"
|
||||||
valueFormat="YYYY-MM-DD HH:mm:ss"
|
valueFormat="YYYY-MM-DD HH:mm:ss"
|
||||||
@change="timeChange"
|
@change="timeChange"
|
||||||
:disabled="viewDetail ? true : false"
|
:disabled="viewDetail ? true : false"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img
|
||||||
class="nameimg"
|
class="nameimg"
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
src="../../assets/images/basicinfo/asterisk.png"
|
||||||
/>
|
/>
|
||||||
<div class="inname">项目经理</div>
|
<div class="inname">项目经理</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<ProjectManager
|
<ProjectManager
|
||||||
v-model:value="projectInfo.managerId"
|
v-model:value="projectInfo.managerId"
|
||||||
v-model:name="projectInfo.manager"
|
v-model:name="projectInfo.manager"
|
||||||
@onChange="managerChange"
|
@onChange="managerChange"
|
||||||
mode="multiple"
|
mode="multiple"
|
||||||
></ProjectManager>
|
></ProjectManager>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img
|
||||||
class="nameimg"
|
class="nameimg"
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
src="../../assets/images/basicinfo/asterisk.png"
|
||||||
/>
|
/>
|
||||||
<div class="inname">资源归属</div>
|
<div class="inname">资源归属</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="in select">
|
<div class="in select">
|
||||||
<OrgClass
|
<OrgClass
|
||||||
v-model:value="projectInfo.sourceBelongId"
|
v-model:value="projectInfo.sourceBelongId"
|
||||||
v-model:name="projectInfo.sourceBelongName"
|
v-model:name="projectInfo.sourceBelongName"
|
||||||
></OrgClass>
|
></OrgClass>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img
|
||||||
class="nameimg"
|
class="nameimg"
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
src="../../assets/images/basicinfo/asterisk.png"
|
||||||
/>
|
/>
|
||||||
<div class="inname">项目级别</div>
|
<div class="inname">项目级别</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -154,8 +148,8 @@
|
|||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img
|
||||||
class="nameimg"
|
class="nameimg"
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
src="../../assets/images/basicinfo/asterisk.png"
|
||||||
/>
|
/>
|
||||||
<div class="inname">培训分类</div>
|
<div class="inname">培训分类</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -166,15 +160,15 @@
|
|||||||
<div class="name">
|
<div class="name">
|
||||||
<div class="namebox">
|
<div class="namebox">
|
||||||
<img
|
<img
|
||||||
class="nameimg"
|
class="nameimg"
|
||||||
src="../../assets/images/basicinfo/asterisk.png"
|
src="../../assets/images/basicinfo/asterisk.png"
|
||||||
/>
|
/>
|
||||||
<div class="inname">是否BOEU实施</div>
|
<div class="inname">是否BOEU实施</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-radio-group
|
<a-radio-group
|
||||||
v-model:value="projectInfo.boeFlag"
|
v-model:value="projectInfo.boeFlag"
|
||||||
:disabled="viewDetail ? true : false"
|
:disabled="viewDetail ? true : false"
|
||||||
>
|
>
|
||||||
<a-radio :style="radioStyle" :value="1">是</a-radio>
|
<a-radio :style="radioStyle" :value="1">是</a-radio>
|
||||||
<a-radio :style="radioStyle" :value="0">否</a-radio>
|
<a-radio :style="radioStyle" :value="0">否</a-radio>
|
||||||
@@ -187,16 +181,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-checkbox
|
<a-checkbox
|
||||||
v-model:checked="courseSyncFlag"
|
v-model:checked="courseSyncFlag"
|
||||||
:disabled="viewDetail ? true : false"
|
:disabled="viewDetail ? true : false"
|
||||||
><span
|
><span
|
||||||
style="
|
style="
|
||||||
width: 100%;
|
width: 100%;
|
||||||
color: rgba(109, 117, 132, 1);
|
color: rgba(109, 117, 132, 1);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
"
|
"
|
||||||
>同步课程学习记录(如学员在课程库中拥有课程的学习记录,自动免修该课程)</span
|
>同步课程学习记录(如学员在课程库中拥有课程的学习记录,自动免修该课程)</span
|
||||||
></a-checkbox
|
></a-checkbox
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -206,12 +200,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-textarea
|
<a-textarea
|
||||||
v-model:value="projectInfo.remark"
|
v-model:value="projectInfo.remark"
|
||||||
style="height: 80px"
|
style="height: 80px"
|
||||||
placeholder="请输入说明"
|
placeholder="请输入说明"
|
||||||
show-count
|
show-count
|
||||||
:maxlength="200"
|
:maxlength="200"
|
||||||
:disabled="viewDetail ? true : false"
|
:disabled="viewDetail ? true : false"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -221,18 +215,18 @@
|
|||||||
<div class="inname" style="width: 50px">模版</div>
|
<div class="inname" style="width: 50px">模版</div>
|
||||||
<div class="in select" style="margin-left: 2px">
|
<div class="in select" style="margin-left: 2px">
|
||||||
<a-select
|
<a-select
|
||||||
:getPopupContainer="
|
:getPopupContainer="
|
||||||
(triggerNode) => {
|
(triggerNode) => {
|
||||||
return triggerNode.parentNode || document.body;
|
return triggerNode.parentNode || document.body;
|
||||||
}
|
}
|
||||||
"
|
"
|
||||||
placeholder="请选择模版"
|
placeholder="请选择模版"
|
||||||
:size="size"
|
:size="size"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:options="classifyList5"
|
:options="classifyList5"
|
||||||
@change="classificationChange5"
|
@change="classificationChange5"
|
||||||
@popupScroll="templateScroll"
|
@popupScroll="templateScroll"
|
||||||
:fieldNames="{
|
:fieldNames="{
|
||||||
label: 'name',
|
label: 'name',
|
||||||
value: 'projectTemplateId',
|
value: 'projectTemplateId',
|
||||||
}"
|
}"
|
||||||
@@ -246,29 +240,31 @@
|
|||||||
<div class="btn">
|
<div class="btn">
|
||||||
<a-button @click="backPage" class="btn2">取消</a-button>
|
<a-button @click="backPage" class="btn2">取消</a-button>
|
||||||
<a-button
|
<a-button
|
||||||
v-on:click="createProject"
|
v-on:click="createProject"
|
||||||
type="primary"
|
type="primary"
|
||||||
class="btn1"
|
class="btn1"
|
||||||
style="margin-left: 20px"
|
style="margin-left: 20px"
|
||||||
>确定</a-button
|
>确定
|
||||||
|
</a-button
|
||||||
>
|
>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { onMounted, reactive, toRefs, watch } from "vue";
|
import {onMounted, reactive, toRefs, watch} from "vue";
|
||||||
import { message } from "ant-design-vue";
|
import {message} from "ant-design-vue";
|
||||||
import { useRoute, useRouter } from "vue-router";
|
import {useRoute, useRouter} from "vue-router";
|
||||||
import * as api from "../../api/index";
|
import * as api from "../../api/index";
|
||||||
import { useStore } from "vuex";
|
import {useStore} from "vuex";
|
||||||
// import ProjectClass from "@/components/project/ProjectClass";
|
// import ProjectClass from "@/components/project/ProjectClass";
|
||||||
import TrainClass from "@/components/project/TrainClass";
|
import TrainClass from "@/components/project/TrainClass";
|
||||||
import OrgClass from "@/components/project/OrgClass";
|
import OrgClass from "@/components/project/OrgClass";
|
||||||
import ProjectManager from "@/components/project/ProjectManagerNew";
|
import ProjectManager from "@/components/project/ProjectManagerNew";
|
||||||
|
import NameInput from "@/components/project/NameInput";
|
||||||
import ProjectLevel from "@/components/project/ProjectLevel";
|
import ProjectLevel from "@/components/project/ProjectLevel";
|
||||||
import { changeOwnership, scrollLoad } from "@/api/method";
|
import {changeOwnership, scrollLoad} from "@/api/method";
|
||||||
import { storage } from "../../api/storage";
|
import {storage} from "../../api/storage";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "projectAdd",
|
name: "projectAdd",
|
||||||
@@ -277,6 +273,7 @@ export default {
|
|||||||
ProjectLevel,
|
ProjectLevel,
|
||||||
// ProjectClass,
|
// ProjectClass,
|
||||||
TrainClass,
|
TrainClass,
|
||||||
|
NameInput,
|
||||||
OrgClass,
|
OrgClass,
|
||||||
},
|
},
|
||||||
setup() {
|
setup() {
|
||||||
@@ -326,10 +323,10 @@ export default {
|
|||||||
state.projectInfo.parentId = routers.query.parentId;
|
state.projectInfo.parentId = routers.query.parentId;
|
||||||
state.projectInfo.projectId = routers.query.projectId;
|
state.projectInfo.projectId = routers.query.projectId;
|
||||||
(state.projectInfo.projectId || state.projectInfo.parentId) &&
|
(state.projectInfo.projectId || state.projectInfo.parentId) &&
|
||||||
api
|
api
|
||||||
.getProjectDetail({
|
.getProjectDetail({
|
||||||
projectId:
|
projectId:
|
||||||
state.projectInfo.projectId || state.projectInfo.parentId,
|
state.projectInfo.projectId || state.projectInfo.parentId,
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
state.projectInfo = {
|
state.projectInfo = {
|
||||||
@@ -422,19 +419,24 @@ export default {
|
|||||||
if (!validate(state.projectInfo, errorMsgs)) {
|
if (!validate(state.projectInfo, errorMsgs)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!state.projectInfo.validate) {
|
||||||
|
message.destroy();
|
||||||
|
message.warning('项目名称重复,请修改名称!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
state.projectInfo.type = 3;
|
state.projectInfo.type = 3;
|
||||||
state.projectInfo.courseSyncFlag = state.courseSyncFlag ? 1 : 0;
|
state.projectInfo.courseSyncFlag = state.courseSyncFlag ? 1 : 0;
|
||||||
api.createProject(state.projectInfo).then((res) => {
|
api.createProject(state.projectInfo).then((res) => {
|
||||||
state.projectInfo.projectId ||
|
state.projectInfo.projectId ||
|
||||||
changeOwnership("project", res.data.data.projectId, [
|
changeOwnership("project", res.data.data.projectId, [
|
||||||
{ id: res.data.data.createId, name: res.data.data.createName },
|
{id: res.data.data.createId, name: res.data.data.createName},
|
||||||
]);
|
]);
|
||||||
message.destroy();
|
message.destroy();
|
||||||
message.success(state.projectInfo.projectId ? "编辑成功" : "创建成功");
|
message.success(state.projectInfo.projectId ? "编辑成功" : "创建成功");
|
||||||
// router.back();
|
// router.back();
|
||||||
router.push({
|
router.push({
|
||||||
path: "/taskpage",
|
path: "/taskpage",
|
||||||
query: { projectId: res.data.data.projectId },
|
query: {projectId: res.data.data.projectId},
|
||||||
});
|
});
|
||||||
storage.set("projectId", res.data.data.projectId);
|
storage.set("projectId", res.data.data.projectId);
|
||||||
});
|
});
|
||||||
@@ -442,9 +444,9 @@ export default {
|
|||||||
|
|
||||||
function managerChange(e, l, d) {
|
function managerChange(e, l, d) {
|
||||||
!state.projectInfo.sourceBelongId &&
|
!state.projectInfo.sourceBelongId &&
|
||||||
(state.projectInfo.sourceBelongId = d);
|
(state.projectInfo.sourceBelongId = d);
|
||||||
!state.projectInfo.sourceBelongId &&
|
!state.projectInfo.sourceBelongId &&
|
||||||
(state.projectInfo.sourceBelongName = d);
|
(state.projectInfo.sourceBelongName = d);
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -179,13 +179,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="inname">项目名称:</div>
|
<div class="inname">项目名称:</div>
|
||||||
<div class="in">
|
<div class="in">
|
||||||
<a-input
|
<NameInput placeholder="请输入项目名称" v-model:value="projectInfo.name" v-model:validate="projectInfo.validate" :maxlength="30" show-count></NameInput>
|
||||||
v-model:value="projectInfo.name"
|
|
||||||
show-count
|
|
||||||
:maxlength="30"
|
|
||||||
placeholder="请输入项目名称"
|
|
||||||
style="border-radius: 8px"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="name">
|
<div class="name">
|
||||||
@@ -828,6 +822,7 @@ import OrgClass from "@/components/project/OrgClass";
|
|||||||
import dayjs from "dayjs";
|
import dayjs from "dayjs";
|
||||||
import * as moment from "moment";
|
import * as moment from "moment";
|
||||||
import { changeOwnership } from "@/api/method";
|
import { changeOwnership } from "@/api/method";
|
||||||
|
import NameInput from "@/components/project/NameInput";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "projectManage",
|
name: "projectManage",
|
||||||
@@ -835,6 +830,7 @@ export default {
|
|||||||
ProjOwnerShip,
|
ProjOwnerShip,
|
||||||
ProjPowerList,
|
ProjPowerList,
|
||||||
ProjCheckShip,
|
ProjCheckShip,
|
||||||
|
NameInput,
|
||||||
ProjectManager,
|
ProjectManager,
|
||||||
// ProjectClass,
|
// ProjectClass,
|
||||||
OrgClass,
|
OrgClass,
|
||||||
@@ -965,6 +961,11 @@ export default {
|
|||||||
if (!validate(state.projectInfo, errorMsgs)) {
|
if (!validate(state.projectInfo, errorMsgs)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!state.projectInfo.validate) {
|
||||||
|
message.destroy();
|
||||||
|
message.warning('项目名称重复,请修改名称!');
|
||||||
|
return;
|
||||||
|
}
|
||||||
api.createProject(state.projectInfo).then((res) => {
|
api.createProject(state.projectInfo).then((res) => {
|
||||||
state.doublepro = false;
|
state.doublepro = false;
|
||||||
message.destroy();
|
message.destroy();
|
||||||
|
|||||||
Reference in New Issue
Block a user