Merge remote-tracking branch 'origin/develop' into develop

This commit is contained in:
yuping
2022-12-14 20:56:59 +08:00
5 changed files with 227 additions and 213 deletions

View File

@@ -2,11 +2,11 @@
* @Author: lixg lixg@dongwu-inc.com * @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-11-21 14:32:52 * @Date: 2022-11-21 14:32:52
* @LastEditors: lixg lixg@dongwu-inc.com * @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2022-12-14 17:51:50 * @LastEditTime: 2022-12-14 20:56:10
* @FilePath: /fe-manage/src/api/config.js * @FilePath: /fe-manage/src/api/config.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
import {message} from "ant-design-vue"; import { message } from "ant-design-vue";
import axios from "axios"; import axios from "axios";
import router from "@/router"; import router from "@/router";
// import { getCookie } from '../api/method' // import { getCookie } from '../api/method'
@@ -17,60 +17,60 @@ import router from "@/router";
axios.defaults.withCredentials = true; axios.defaults.withCredentials = true;
const http = axios.create({ const http = axios.create({
baseURL: process.env.VITE_BASE_API, baseURL: process.env.VITE_BASE_API,
timeout: 1000 * 15, timeout: 1000 * 15,
// headers: { "Content-Type": "multipart/form-data" }, // headers: { "Content-Type": "multipart/form-data" },
headers: {"Content-Type": "application/json"}, headers: { "Content-Type": "application/json" },
}); });
http.interceptors.request.use( http.interceptors.request.use(
(config) => { (config) => {
// console.log("config", config); // console.log("config", config);
// const token = localStorage.getItem("token"); // const token = localStorage.getItem("token");
// // const token = getCookie('token') // // const token = getCookie('token')
// // console.log('token', token) // // console.log('token', token)
// if (token) { // if (token) {
// config.headers.token = token; //测试1111 // config.headers.token = token; //测试1111
// } else { // } else {
// console.log("当前请求页面无token,请执行操作!!!"); // console.log("当前请求页面无token,请执行操作!!!");
// // 此处测试默认配置token // // 此处测试默认配置token
// config.headers.token = // config.headers.token =
// "eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC91LmJvZS5jb20iLCJpYXQiOjE2NzAxNTMxMDMsImV4cCI6MTY3MDE2MDMwMywiR2l2ZW5OYW1lIjoiYm9ldSIsInVzZXJJZCI6IjZCMDQ5RkFGLUMzMTQtN0NDRi0wRDI4LTBEMjNGNEM0MjUzMSIsInVJZCI6Ijk2NTM0MjAyNzQ5NzYwNzE2OCIsInBlcm1pc3Npb24iOiIifQ==.c937b2d3a59cbab2136fdde55fd38f06bdff041212aab0fa6741bc4be41e28a7"; // "eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC91LmJvZS5jb20iLCJpYXQiOjE2NzAxNTMxMDMsImV4cCI6MTY3MDE2MDMwMywiR2l2ZW5OYW1lIjoiYm9ldSIsInVzZXJJZCI6IjZCMDQ5RkFGLUMzMTQtN0NDRi0wRDI4LTBEMjNGNEM0MjUzMSIsInVJZCI6Ijk2NTM0MjAyNzQ5NzYwNzE2OCIsInBlcm1pc3Npb24iOiIifQ==.c937b2d3a59cbab2136fdde55fd38f06bdff041212aab0fa6741bc4be41e28a7";
// // } // // }
return config; return config;
}, },
(err) => { (err) => {
console.log("登陆前拦截", err); console.log("登陆前拦截", err);
return Promise.reject(err); return Promise.reject(err);
} }
); );
http.interceptors.response.use( http.interceptors.response.use(
(response) => { (response) => {
// console.log('response', response) // console.log('response', response)
const { const {
data: {code, msg}, data: { code, msg },
} = response; } = response;
// console.log('code', code) // console.log('code', code)
if (code === 0 || code === 200) { if (code === 0 || code === 200) {
return response; return response;
} else { } else {
if (code === 1000) { if (code === 1000) {
process.env.NODE_ENV === 'development' ? router.push({path: 'login'}) : (window.location.href = process.env.VITE_LOGIN_URL) process.env.NODE_ENV === 'development' ? router.push({ path: 'login' }) : (window.location.href = process.env.VITE_LOGIN_URL)
} }
console.log("api %o", msg); console.log("api %o", msg);
}
return response;
},
function (error) {
if (error.message == "timeout of 1ms exceeded") {
message.destroy();
message.error("请求超时");
}
console.log("api error %o", error);
return Promise.reject(error);
} }
return response;
},
function (error) {
if (error.message == "timeout of 1ms exceeded") {
message.destroy();
message.error("请求超时");
}
console.log("api error %o", error);
return Promise.reject(error);
}
); );
export default http; export default http;

View File

@@ -278,7 +278,7 @@ const organizationalTree = []
//嵌套页面 //嵌套页面
const iframeUrl = "https://u-pre.boe.com/pc/iframe" const iframeUrl = "https://u-pre.boe.com/pc/iframe"
//学员端路由 //学员端路由
const studentUrl = 'https://u.boe.com/pc/uc/study/courses' const studentUrl = 'https://u-pre.boe.com/pc/loading'
//二维码 //二维码
const codeUrl = "https://u-pre.boe.com" const codeUrl = "https://u-pre.boe.com"

View File

@@ -54,7 +54,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="mi_btns" style="margin-left:0px;"> <div class="mi_btns" style="margin-left: 0px">
<div class="btn btn1"> <div class="btn btn1">
<div class="search"></div> <div class="search"></div>
<div class="btnText" @click="searchProjectList()">搜索</div> <div class="btnText" @click="searchProjectList()">搜索</div>
@@ -141,11 +141,11 @@
</div> </div>
</div> </div>
</div> </div>
<div class="main_table"> <div class="main_table">
<div class="drawerbox"> <div class="drawerbox">
<!-- 添加的时候显示多选的表 --> <!-- 添加的时候显示多选的表 -->
<!-- 编辑的时候显示单选的表 --> <!-- 编辑的时候显示单选的表 -->
<a-table <a-table
:columns="tableDataFunc()" :columns="tableDataFunc()"
@@ -166,7 +166,7 @@
<div class="pa"> <div class="pa">
<a-pagination <a-pagination
v-if="tableDataTotal > 10" v-if="tableDataTotal > 10"
:showSizeChanger="false" :showSizeChanger="false"
showQuickJumper="true" showQuickJumper="true"
hideOnSinglePage="true" hideOnSinglePage="true"
:pageSize="pageSize" :pageSize="pageSize"
@@ -225,8 +225,9 @@
import { reactive, toRefs } from "vue"; import { reactive, toRefs } from "vue";
import { RouterEditTask } from "@/api/indexTask"; import { RouterEditTask } from "@/api/indexTask";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import * as apiProj from "../../api/index.js"; // import * as apiProj from "../../api/index.js";
import dayjs from "dayjs"; import dayjs from "dayjs";
import * as indexAudit from "../../api/indexAudit";
export default { export default {
name: "AddProject", name: "AddProject",
@@ -309,28 +310,28 @@ export default {
title: "项目名称", title: "项目名称",
dataIndex: "name", dataIndex: "name",
key: "projectName", key: "projectName",
width:"40%", width: "40%",
ellipsis: true, ellipsis: true,
}, },
{ {
title: "项目经理", title: "项目经理",
dataIndex: "manager", dataIndex: "manager",
key: "manager", key: "manager",
width:"20%", width: "20%",
align: "center", align: "center",
}, },
{ {
title: "创建人", title: "创建人",
dataIndex: "creater", dataIndex: "creater",
key: "creater", key: "creater",
width:"20%", width: "20%",
align: "center", align: "center",
}, },
{ {
title: "创建时间", title: "创建时间",
dataIndex: "time", dataIndex: "time",
key: "time", key: "time",
width:"20%", width: "20%",
align: "center", align: "center",
}, },
]; ];
@@ -400,8 +401,8 @@ export default {
// TODO 这里后续需要给接口或者改动 // TODO 这里后续需要给接口或者改动
// 获取所有,确定分页位置 // 获取所有,确定分页位置
const getCurrentPage = () => { const getCurrentPage = () => {
apiProj indexAudit
.getProjectList({ .auditlist({
createName: state.inputV1, createName: state.inputV1,
manager: state.inputV2, manager: state.inputV2,
name: state.inputV3, name: state.inputV3,
@@ -450,8 +451,8 @@ export default {
status: 3, status: 3,
}); });
apiProj indexAudit
.getProjectList({ .auditlist({
createName: state.inputV3, createName: state.inputV3,
manager: state.inputV2, manager: state.inputV2,
name: state.inputV1, name: state.inputV1,
@@ -551,7 +552,7 @@ export default {
const updateTask = async (res) => { const updateTask = async (res) => {
if (props.isLevel == 1) { if (props.isLevel == 1) {
if(!props.isactive){ if (!props.isactive) {
message.destroy(); message.destroy();
return message.warning("请先选中关卡"); return message.warning("请先选中关卡");
} }
@@ -849,7 +850,7 @@ export default {
} }
} }
} }
.main_item2 { .main_item2 {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
@@ -930,36 +931,36 @@ export default {
} }
} }
.main_table { .main_table {
position: relative; position: relative;
padding-bottom: 80px; padding-bottom: 80px;
.ant-checkbox-wrapper { .ant-checkbox-wrapper {
align-items: center; align-items: center;
margin-top: -2px; margin-top: -2px;
}
.ant-table-selection-column {
padding: 0px !important;
padding-left: 5px !important;
}
.ant-table-thead > tr > th {
background-color: rgba(239, 244, 252, 1);
}
th.h {
background-color: #eff4fc !important;
}
.ant-table-tbody
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
> td {
background: #f6f9fd;
}
.pa {
left: 0;
width: 100%;
display: flex;
justify-content: center;
position: absolute;
bottom: 20px;
}
} }
.ant-table-selection-column {
padding: 0px !important;
padding-left: 5px !important;
}
.ant-table-thead > tr > th {
background-color: rgba(239, 244, 252, 1);
}
th.h {
background-color: #eff4fc !important;
}
.ant-table-tbody
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
> td {
background: #f6f9fd;
}
.pa {
left: 0;
width: 100%;
display: flex;
justify-content: center;
position: absolute;
bottom: 20px;
}
}
.main_btns { .main_btns {
height: 72px; height: 72px;
width: 100%; width: 100%;
@@ -991,7 +992,6 @@ export default {
color: #fff; color: #fff;
} }
} }
} }
} }
</style> </style>

View File

@@ -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,29 +33,36 @@
<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">
{{ ptojectType == 3 ? "班级名称" : "项目名称" }}
</div>
</div> </div>
<div class="in"> <div class="in">
<NameInput placeholder="请输入项目名称" v-model:value="projectInfo.name" <NameInput
v-model:validate="projectInfo.validate" :maxlength="30" show-count placeholder="请输入项目名称"
:id="projectInfo.projectId"></NameInput> v-model:value="projectInfo.name"
v-model:validate="projectInfo.validate"
:maxlength="30"
show-count
:id="projectInfo.projectId"
></NameInput>
</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;
@@ -63,19 +70,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>
@@ -83,63 +90,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>
@@ -150,8 +157,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>
@@ -162,15 +169,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>
@@ -183,16 +190,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>
@@ -202,12 +209,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>
@@ -217,7 +224,7 @@
<div class="inname" style="margin-top: 13px">审核意见</div> <div class="inname" style="margin-top: 13px">审核意见</div>
</div> </div>
<div class="description"> <div class="description">
{{auditDescription}} {{ auditDescription }}
</div> </div>
</div> </div>
</div> </div>
@@ -226,18 +233,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',
}" }"
@@ -251,33 +258,32 @@
<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 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";
import * as api2 from "../../api/indexAudit"; import * as api2 from "../../api/indexAudit";
import {validateName} from "@/api/index1"; import { validateName } from "@/api/index1";
export default { export default {
name: "projectAdd", name: "projectAdd",
@@ -308,7 +314,7 @@ export default {
}, },
classifyList5: [], classifyList5: [],
courseSyncFlag: false, courseSyncFlag: false,
auditDescription:"", auditDescription: "",
}); });
// 封面图选择 // 封面图选择
@@ -324,6 +330,8 @@ export default {
state.viewDetail = routers.query.viewDetail; state.viewDetail = routers.query.viewDetail;
getProjectInfo(); getProjectInfo();
getTemplate(); getTemplate();
state.ptojectType = routers.query.ptojectType;
// console.log("routers.query.ptojectType", routers.query.ptojectType);
}); });
watch(routers.query, () => { watch(routers.query, () => {
@@ -337,10 +345,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 = {
@@ -353,23 +361,24 @@ export default {
]; ];
state.courseSyncFlag = !!state.projectInfo.courseSyncFlag; state.courseSyncFlag = !!state.projectInfo.courseSyncFlag;
if (Number(state.projectInfo.status) === -5) { if (Number(state.projectInfo.status) === -5) {
let obj = { let obj = {
project_id: state.projectInfo.projectId, project_id: state.projectInfo.projectId,
type: 1, type: 1,
pageNo: 1, pageNo: 1,
pageSize: 1, pageSize: 1,
}; };
api2.auditList(obj).then((d) => { api2.auditList(obj).then((d) => {
if (d.data.code === 200) { if (d.data.code === 200) {
let res =d.data.data; let res = d.data.data;
if (res.rows && res.rows.length > 0) { if (res.rows && res.rows.length > 0) {
let i = res.rows.length; let i = res.rows.length;
state.auditDescription = res.rows[i - 1].description ? res.rows[i - 1].description : "-"; state.auditDescription = res.rows[i - 1].description
? res.rows[i - 1].description
: "-";
}
} }
} });
}); }
}
}); });
} }
@@ -446,7 +455,7 @@ export default {
return true; return true;
} }
const createProject = async() => { const createProject = async () => {
console.log("保存", state.projectInfo); console.log("保存", state.projectInfo);
if (!validate(state.projectInfo, errorMsgs)) { if (!validate(state.projectInfo, errorMsgs)) {
return; return;
@@ -457,26 +466,30 @@ export default {
message.warning('项目名称重复,请修改名称!'); message.warning('项目名称重复,请修改名称!');
return; return;
}*/ }*/
const offName = await validateName({name:state.projectInfo.name, type:1, id:state.projectInfo.projectId}).then(res => { const offName = await validateName({
return res.data.data == 1; name: state.projectInfo.name,
}); type: 1,
if(offName){ id: state.projectInfo.projectId,
message.destroy(); }).then((res) => {
return message.warning("项目名称重复,请重新填写"); return res.data.data == 1;
} });
if (offName) {
message.destroy();
return message.warning("项目名称重复,请重新填写");
}
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);
}); });
@@ -484,9 +497,9 @@ export default {
function managerChange(e, l, d, t) { function managerChange(e, l, d, t) {
!state.projectInfo.sourceBelongId && !state.projectInfo.sourceBelongId &&
(state.projectInfo.sourceBelongId = d); (state.projectInfo.sourceBelongId = d);
!state.projectInfo.sourceBelongName && !state.projectInfo.sourceBelongName &&
(state.projectInfo.sourceBelongName = t); (state.projectInfo.sourceBelongName = t);
} }
return { return {
@@ -701,7 +714,7 @@ export default {
.name2 { .name2 {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
.description{ .description {
margin-top: 14px; margin-top: 14px;
margin-left: 11px; margin-left: 11px;
} }

View File

@@ -1595,6 +1595,7 @@ export default {
parentId: value.record.projectId, parentId: value.record.projectId,
parentName: parentName:
value.record.parentName + "——" + value.record.name, value.record.parentName + "——" + value.record.name,
ptojectType: 3,
}, },
}); });
}} }}