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
* @Date: 2022-11-21 14:32:52
* @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
* @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 router from "@/router";
// import { getCookie } from '../api/method'
@@ -17,60 +17,60 @@ import router from "@/router";
axios.defaults.withCredentials = true;
const http = axios.create({
baseURL: process.env.VITE_BASE_API,
timeout: 1000 * 15,
// headers: { "Content-Type": "multipart/form-data" },
headers: {"Content-Type": "application/json"},
baseURL: process.env.VITE_BASE_API,
timeout: 1000 * 15,
// headers: { "Content-Type": "multipart/form-data" },
headers: { "Content-Type": "application/json" },
});
http.interceptors.request.use(
(config) => {
// console.log("config", config);
// const token = localStorage.getItem("token");
// // const token = getCookie('token')
// // console.log('token', token)
// if (token) {
// config.headers.token = token; //测试1111
// } else {
// console.log("当前请求页面无token,请执行操作!!!");
(config) => {
// console.log("config", config);
// const token = localStorage.getItem("token");
// // const token = getCookie('token')
// // console.log('token', token)
// if (token) {
// config.headers.token = token; //测试1111
// } else {
// console.log("当前请求页面无token,请执行操作!!!");
// // 此处测试默认配置token
// config.headers.token =
// "eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC91LmJvZS5jb20iLCJpYXQiOjE2NzAxNTMxMDMsImV4cCI6MTY3MDE2MDMwMywiR2l2ZW5OYW1lIjoiYm9ldSIsInVzZXJJZCI6IjZCMDQ5RkFGLUMzMTQtN0NDRi0wRDI4LTBEMjNGNEM0MjUzMSIsInVJZCI6Ijk2NTM0MjAyNzQ5NzYwNzE2OCIsInBlcm1pc3Npb24iOiIifQ==.c937b2d3a59cbab2136fdde55fd38f06bdff041212aab0fa6741bc4be41e28a7";
// // }
return config;
},
(err) => {
console.log("登陆前拦截", err);
return Promise.reject(err);
}
// // 此处测试默认配置token
// config.headers.token =
// "eyJ0eXBlIjoidG9rZW4iLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC91LmJvZS5jb20iLCJpYXQiOjE2NzAxNTMxMDMsImV4cCI6MTY3MDE2MDMwMywiR2l2ZW5OYW1lIjoiYm9ldSIsInVzZXJJZCI6IjZCMDQ5RkFGLUMzMTQtN0NDRi0wRDI4LTBEMjNGNEM0MjUzMSIsInVJZCI6Ijk2NTM0MjAyNzQ5NzYwNzE2OCIsInBlcm1pc3Npb24iOiIifQ==.c937b2d3a59cbab2136fdde55fd38f06bdff041212aab0fa6741bc4be41e28a7";
// // }
return config;
},
(err) => {
console.log("登陆前拦截", err);
return Promise.reject(err);
}
);
http.interceptors.response.use(
(response) => {
// console.log('response', response)
const {
data: {code, msg},
} = response;
// console.log('code', code)
if (code === 0 || code === 200) {
return response;
} else {
if (code === 1000) {
process.env.NODE_ENV === 'development' ? router.push({path: 'login'}) : (window.location.href = process.env.VITE_LOGIN_URL)
}
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);
(response) => {
// console.log('response', response)
const {
data: { code, msg },
} = response;
// console.log('code', code)
if (code === 0 || code === 200) {
return response;
} else {
if (code === 1000) {
process.env.NODE_ENV === 'development' ? router.push({ path: 'login' }) : (window.location.href = process.env.VITE_LOGIN_URL)
}
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);
}
);
export default http;

View File

@@ -278,7 +278,7 @@ const organizationalTree = []
//嵌套页面
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"

View File

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

View File

@@ -3,13 +3,13 @@
<div class="projectAdd">
<div class="header">
<span class="title"
>{{ projectInfo.parentId ? "编辑" : "创建" }}项目</span
>{{ projectInfo.parentId ? "编辑" : "创建" }}项目</span
>
<div
@click="backPage"
style="cursor: pointer"
to="/projectmanage"
class="goback"
@click="backPage"
style="cursor: pointer"
to="/projectmanage"
class="goback"
>
<span class="return"></span><span class="returntext">返回</span>
</div>
@@ -19,8 +19,8 @@
<div class="name" v-if="projectInfo.parentName">
<div class="namebox">
<img
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
/>
<div class="inname">项目归属</div>
</div>
@@ -33,29 +33,36 @@
<div class="name">
<div class="namebox">
<img
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
/>
<div class="inname">项目名称</div>
<div class="inname">
{{ ptojectType == 3 ? "班级名称" : "项目名称" }}
</div>
</div>
<div class="in">
<NameInput placeholder="请输入项目名称" v-model:value="projectInfo.name"
v-model:validate="projectInfo.validate" :maxlength="30" show-count
:id="projectInfo.projectId"></NameInput>
<NameInput
placeholder="请输入项目名称"
v-model:value="projectInfo.name"
v-model:validate="projectInfo.validate"
:maxlength="30"
show-count
:id="projectInfo.projectId"
></NameInput>
</div>
</div>
<div class="name flex-top">
<div class="namebox" style="margin-top: 10px">
<img
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
/>
<div class="inname">封面图</div>
</div>
<div class="in select" style="flex: 1; display: flex">
<div
:class="`box ${projectInfo.picUrl === src.value ? 'active' : ''}`"
style="
:class="`box ${projectInfo.picUrl === src.value ? 'active' : ''}`"
style="
width: 100px;
height: 100px;
border-radius: 5px;
@@ -63,19 +70,19 @@
position: relative;
overflow: hidden;
"
v-for="(src, index) in projectPic"
:key="index"
@click="() => (projectInfo.picUrl = src.value)"
v-for="(src, index) in projectPic"
:key="index"
@click="() => (projectInfo.picUrl = src.value)"
>
<img
style="
style="
width: 100px;
height: 100px;
margin-bottom: 4px;
margin-right: 4px;
"
:src="src.value"
alt="avatar"
:src="src.value"
alt="avatar"
/>
</div>
</div>
@@ -83,63 +90,63 @@
<div class="name">
<div class="namebox">
<img
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
/>
<div class="inname">项目时间</div>
</div>
<div class="in">
<a-range-picker
show-time
separator="至"
:placeholder="[' 开始时间', ' 结束时间']"
v-model:value="projectInfo.rangeTime"
style="width: 100%; height: 40px; border-radius: 5px"
valueFormat="YYYY-MM-DD HH:mm:ss"
@change="timeChange"
:disabled="viewDetail ? true : false"
show-time
separator="至"
:placeholder="[' 开始时间', ' 结束时间']"
v-model:value="projectInfo.rangeTime"
style="width: 100%; height: 40px; border-radius: 5px"
valueFormat="YYYY-MM-DD HH:mm:ss"
@change="timeChange"
:disabled="viewDetail ? true : false"
/>
</div>
</div>
<div class="name">
<div class="namebox">
<img
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
/>
<div class="inname">项目经理</div>
</div>
<div class="in">
<ProjectManager
v-model:value="projectInfo.managerId"
v-model:name="projectInfo.manager"
@onChange="managerChange"
mode="multiple"
v-model:value="projectInfo.managerId"
v-model:name="projectInfo.manager"
@onChange="managerChange"
mode="multiple"
></ProjectManager>
</div>
</div>
<div class="name">
<div class="namebox">
<img
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
/>
<div class="inname">资源归属</div>
</div>
<div class="in select">
<OrgClass
v-model:value="projectInfo.sourceBelongId"
v-model:name="projectInfo.sourceBelongName"
v-model:value="projectInfo.sourceBelongId"
v-model:name="projectInfo.sourceBelongName"
></OrgClass>
</div>
</div>
<div class="name">
<div class="namebox">
<img
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
/>
<div class="inname">项目级别</div>
</div>
@@ -150,8 +157,8 @@
<div class="name">
<div class="namebox">
<img
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
/>
<div class="inname">培训分类</div>
</div>
@@ -162,15 +169,15 @@
<div class="name">
<div class="namebox">
<img
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
class="nameimg"
src="../../assets/images/basicinfo/asterisk.png"
/>
<div class="inname">是否BOEU实施</div>
</div>
<div class="in">
<a-radio-group
v-model:value="projectInfo.boeFlag"
:disabled="viewDetail ? true : false"
v-model:value="projectInfo.boeFlag"
:disabled="viewDetail ? true : false"
>
<a-radio :style="radioStyle" :value="1"></a-radio>
<a-radio :style="radioStyle" :value="0"></a-radio>
@@ -183,16 +190,16 @@
</div>
<div class="in">
<a-checkbox
v-model:checked="courseSyncFlag"
:disabled="viewDetail ? true : false"
><span
v-model:checked="courseSyncFlag"
:disabled="viewDetail ? true : false"
><span
style="
width: 100%;
color: rgba(109, 117, 132, 1);
font-size: 14px;
"
>同步课程学习记录如学员在课程库中拥有课程的学习记录自动免修该课程</span
></a-checkbox
>同步课程学习记录如学员在课程库中拥有课程的学习记录自动免修该课程</span
></a-checkbox
>
</div>
</div>
@@ -202,12 +209,12 @@
</div>
<div class="in">
<a-textarea
v-model:value="projectInfo.remark"
style="height: 80px"
placeholder="请输入说明"
show-count
:maxlength="200"
:disabled="viewDetail ? true : false"
v-model:value="projectInfo.remark"
style="height: 80px"
placeholder="请输入说明"
show-count
:maxlength="200"
:disabled="viewDetail ? true : false"
/>
</div>
</div>
@@ -217,7 +224,7 @@
<div class="inname" style="margin-top: 13px">审核意见</div>
</div>
<div class="description">
{{auditDescription}}
{{ auditDescription }}
</div>
</div>
</div>
@@ -226,18 +233,18 @@
<div class="inname" style="width: 50px">模版</div>
<div class="in select" style="margin-left: 2px">
<a-select
:getPopupContainer="
:getPopupContainer="
(triggerNode) => {
return triggerNode.parentNode || document.body;
}
"
placeholder="请选择模版"
:size="size"
style="width: 100%"
:options="classifyList5"
@change="classificationChange5"
@popupScroll="templateScroll"
:fieldNames="{
placeholder="请选择模版"
:size="size"
style="width: 100%"
:options="classifyList5"
@change="classificationChange5"
@popupScroll="templateScroll"
:fieldNames="{
label: 'name',
value: 'projectTemplateId',
}"
@@ -251,33 +258,32 @@
<div class="btn">
<a-button @click="backPage" class="btn2">取消</a-button>
<a-button
v-on:click="createProject"
type="primary"
class="btn1"
style="margin-left: 20px"
>确定
</a-button
>
v-on:click="createProject"
type="primary"
class="btn1"
style="margin-left: 20px"
>确定
</a-button>
</div>
</div>
</div>
</template>
<script>
import {onMounted, reactive, toRefs, watch} from "vue";
import {message} from "ant-design-vue";
import {useRoute, useRouter} from "vue-router";
import { onMounted, reactive, toRefs, watch } from "vue";
import { message } from "ant-design-vue";
import { useRoute, useRouter } from "vue-router";
import * as api from "../../api/index";
import {useStore} from "vuex";
import { useStore } from "vuex";
// import ProjectClass from "@/components/project/ProjectClass";
import TrainClass from "@/components/project/TrainClass";
import OrgClass from "@/components/project/OrgClass";
import ProjectManager from "@/components/project/ProjectManagerNew";
import NameInput from "@/components/project/NameInput";
import ProjectLevel from "@/components/project/ProjectLevel";
import {changeOwnership, scrollLoad} from "@/api/method";
import {storage} from "../../api/storage";
import { changeOwnership, scrollLoad } from "@/api/method";
import { storage } from "../../api/storage";
import * as api2 from "../../api/indexAudit";
import {validateName} from "@/api/index1";
import { validateName } from "@/api/index1";
export default {
name: "projectAdd",
@@ -308,7 +314,7 @@ export default {
},
classifyList5: [],
courseSyncFlag: false,
auditDescription:"",
auditDescription: "",
});
// 封面图选择
@@ -324,6 +330,8 @@ export default {
state.viewDetail = routers.query.viewDetail;
getProjectInfo();
getTemplate();
state.ptojectType = routers.query.ptojectType;
// console.log("routers.query.ptojectType", routers.query.ptojectType);
});
watch(routers.query, () => {
@@ -337,10 +345,10 @@ export default {
state.projectInfo.parentId = routers.query.parentId;
state.projectInfo.projectId = routers.query.projectId;
(state.projectInfo.projectId || state.projectInfo.parentId) &&
api
api
.getProjectDetail({
projectId:
state.projectInfo.projectId || state.projectInfo.parentId,
state.projectInfo.projectId || state.projectInfo.parentId,
})
.then((res) => {
state.projectInfo = {
@@ -353,23 +361,24 @@ export default {
];
state.courseSyncFlag = !!state.projectInfo.courseSyncFlag;
if (Number(state.projectInfo.status) === -5) {
let obj = {
project_id: state.projectInfo.projectId,
type: 1,
pageNo: 1,
pageSize: 1,
};
api2.auditList(obj).then((d) => {
if (d.data.code === 200) {
let res =d.data.data;
if (res.rows && res.rows.length > 0) {
let i = res.rows.length;
state.auditDescription = res.rows[i - 1].description ? res.rows[i - 1].description : "-";
let obj = {
project_id: state.projectInfo.projectId,
type: 1,
pageNo: 1,
pageSize: 1,
};
api2.auditList(obj).then((d) => {
if (d.data.code === 200) {
let res = d.data.data;
if (res.rows && res.rows.length > 0) {
let i = res.rows.length;
state.auditDescription = res.rows[i - 1].description
? res.rows[i - 1].description
: "-";
}
}
}
});
}
});
}
});
}
@@ -446,7 +455,7 @@ export default {
return true;
}
const createProject = async() => {
const createProject = async () => {
console.log("保存", state.projectInfo);
if (!validate(state.projectInfo, errorMsgs)) {
return;
@@ -457,26 +466,30 @@ export default {
message.warning('项目名称重复,请修改名称!');
return;
}*/
const offName = await validateName({name:state.projectInfo.name, type:1, id:state.projectInfo.projectId}).then(res => {
return res.data.data == 1;
});
if(offName){
message.destroy();
return message.warning("项目名称重复,请重新填写");
}
const offName = await validateName({
name: state.projectInfo.name,
type: 1,
id: state.projectInfo.projectId,
}).then((res) => {
return res.data.data == 1;
});
if (offName) {
message.destroy();
return message.warning("项目名称重复,请重新填写");
}
state.projectInfo.type = 3;
state.projectInfo.courseSyncFlag = state.courseSyncFlag ? 1 : 0;
api.createProject(state.projectInfo).then((res) => {
state.projectInfo.projectId ||
changeOwnership("project", res.data.data.projectId, [
{id: res.data.data.createId, name: res.data.data.createName},
]);
changeOwnership("project", res.data.data.projectId, [
{ id: res.data.data.createId, name: res.data.data.createName },
]);
message.destroy();
message.success(state.projectInfo.projectId ? "编辑成功" : "创建成功");
// router.back();
router.push({
path: "/taskpage",
query: {projectId: res.data.data.projectId},
query: { projectId: res.data.data.projectId },
});
storage.set("projectId", res.data.data.projectId);
});
@@ -484,9 +497,9 @@ export default {
function managerChange(e, l, d, t) {
!state.projectInfo.sourceBelongId &&
(state.projectInfo.sourceBelongId = d);
(state.projectInfo.sourceBelongId = d);
!state.projectInfo.sourceBelongName &&
(state.projectInfo.sourceBelongName = t);
(state.projectInfo.sourceBelongName = t);
}
return {
@@ -701,7 +714,7 @@ export default {
.name2 {
display: flex;
align-items: flex-start;
.description{
.description {
margin-top: 14px;
margin-left: 11px;
}

View File

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