mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-15 22:06:45 +08:00
Merge remote-tracking branch 'origin/develop' into develop
This commit is contained in:
97
src/App.vue
97
src/App.vue
@@ -1,27 +1,27 @@
|
||||
<template>
|
||||
<div id="container" v-if="!isLogin">
|
||||
<nav-top/>
|
||||
<nav-top />
|
||||
<div style="display: flex">
|
||||
<nav-left/>
|
||||
<nav-left />
|
||||
<div style="flex: 1; display: flex; flex-direction: column; width: 0">
|
||||
<open-pages/>
|
||||
<bread-crumb/>
|
||||
<open-pages />
|
||||
<bread-crumb />
|
||||
<main>
|
||||
<a-config-provider :locale="zhCN">
|
||||
<router-view/>
|
||||
<router-view />
|
||||
</a-config-provider>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="container" v-if="isLogin">
|
||||
<router-view/>
|
||||
<router-view />
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {computed, defineComponent, ref, watch} from "vue";
|
||||
import {useRouter, useRoute} from "vue-router";
|
||||
import {useStore} from "vuex";
|
||||
import { computed, defineComponent, ref, watch } from "vue";
|
||||
import { useRouter, useRoute } from "vue-router";
|
||||
import { useStore } from "vuex";
|
||||
import NavLeft from "@/components/NavLeft";
|
||||
import NavTop from "@/components/NavTop";
|
||||
import OpenPages from "@/components/OpenPages";
|
||||
@@ -30,7 +30,6 @@ import zhCN from "ant-design-vue/es/locale/zh_CN";
|
||||
import * as api from "./api/index1";
|
||||
import * as api1 from "@/api/index1";
|
||||
import * as api2 from "@/api/index";
|
||||
|
||||
export default defineComponent({
|
||||
components: {
|
||||
NavLeft,
|
||||
@@ -44,20 +43,17 @@ export default defineComponent({
|
||||
const store = useStore();
|
||||
const isLogin = ref(false);
|
||||
// console.log("router", router.getRoutes(), route);
|
||||
console.log("版本0.12------------");
|
||||
console.log("版本0.13------------");
|
||||
const routes = computed(() => {
|
||||
return router.getRoutes().filter((e) => e.meta?.isLink);
|
||||
});
|
||||
|
||||
watch(
|
||||
() => route.path,
|
||||
() => {
|
||||
route.path === "/login" && (isLogin.value = true);
|
||||
}
|
||||
() => route.path,
|
||||
() => {
|
||||
route.path === "/login" && (isLogin.value = true);
|
||||
}
|
||||
);
|
||||
|
||||
const currentRouteName = computed(() => route.name);
|
||||
|
||||
function init() {
|
||||
console.log(store);
|
||||
getUserInfo();
|
||||
@@ -72,43 +68,40 @@ export default defineComponent({
|
||||
getMemberInfo();
|
||||
getOrgTree();
|
||||
}
|
||||
|
||||
async function getMemberInfo() {
|
||||
const list = localStorage.getItem('memberInitInfo');
|
||||
const list = localStorage.getItem("memberInitInfo");
|
||||
if (list) {
|
||||
store.commit("SET_MEMBER_INFO", JSON.parse(list));
|
||||
return;
|
||||
}
|
||||
const memberInitInfo = await api1.getMemberInfo({keyWord: '', pageNo: 1, pageSize: 10}).then(res=>res.data.data.rows);
|
||||
const memberInitInfo = await api1
|
||||
.getMemberInfo({ keyWord: "", pageNo: 1, pageSize: 10 })
|
||||
.then((res) => res.data.data.rows);
|
||||
store.commit("SET_MEMBER_INFO", memberInitInfo);
|
||||
localStorage.setItem('memberInitInfo', JSON.stringify(memberInitInfo));
|
||||
localStorage.setItem("memberInitInfo", JSON.stringify(memberInitInfo));
|
||||
}
|
||||
|
||||
async function getUserInfo() {
|
||||
const userInfo = await api2.userInfo()
|
||||
const userInfo = await api2.userInfo();
|
||||
store.commit("SET_USER", userInfo);
|
||||
}
|
||||
|
||||
async function initDict(key) {
|
||||
let list = localStorage.getItem(key);
|
||||
if (list) {
|
||||
store.commit("SET_DICT", {key, data: JSON.parse(list)});
|
||||
store.commit("SET_DICT", { key, data: JSON.parse(list) });
|
||||
return;
|
||||
}
|
||||
list = await getDictList(key);
|
||||
localStorage.setItem(key, JSON.stringify(list));
|
||||
store.commit("SET_DICT", {key, data: list});
|
||||
store.commit("SET_DICT", { key, data: list });
|
||||
}
|
||||
|
||||
const getDictList = (param) =>
|
||||
api1
|
||||
.getDict({
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
setCode: param,
|
||||
})
|
||||
.then((res) => res.data.data.rows);
|
||||
|
||||
api1
|
||||
.getDict({
|
||||
pageNo: 1,
|
||||
pageSize: 20,
|
||||
setCode: param,
|
||||
})
|
||||
.then((res) => res.data.data.rows);
|
||||
//获取组织树
|
||||
const getOrgTree = () => {
|
||||
const orgtreeList = localStorage.getItem("orgtreeList");
|
||||
@@ -123,22 +116,20 @@ export default defineComponent({
|
||||
pageSize: 20,
|
||||
};
|
||||
api
|
||||
.getOrgInfo(obj)
|
||||
.then((res) => {
|
||||
console.log("组织树获取成功", res);
|
||||
if (res.data.code === 200) {
|
||||
// state.treeData = res.data.data;
|
||||
localStorage.setItem("orgtreeList", JSON.stringify(res.data.data));
|
||||
store.commit("getOrgtreeList", res.data.data);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("组织树获取失败", err);
|
||||
});
|
||||
.getOrgInfo(obj)
|
||||
.then((res) => {
|
||||
console.log("组织树获取成功", res);
|
||||
if (res.data.code === 200) {
|
||||
// state.treeData = res.data.data;
|
||||
localStorage.setItem("orgtreeList", JSON.stringify(res.data.data));
|
||||
store.commit("getOrgtreeList", res.data.data);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("组织树获取失败", err);
|
||||
});
|
||||
};
|
||||
|
||||
init();
|
||||
|
||||
return {
|
||||
isLogin,
|
||||
routes,
|
||||
@@ -153,23 +144,20 @@ export default defineComponent({
|
||||
// font-family: MicrosoftYaHei, Microsoft YaHei, Avenir, Helvetica, Arial,
|
||||
// sans-serif;
|
||||
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB,
|
||||
Microsoft YaHei, Arial, sans-serif;
|
||||
Microsoft YaHei, Arial, sans-serif;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
color: #2c3e50;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
#container {
|
||||
margin: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
width: 100%;
|
||||
min-width: 1000px;
|
||||
min-height: 100%;
|
||||
background-color: rgba(245, 247, 250, 1);
|
||||
|
||||
main {
|
||||
height: 0;
|
||||
flex: 1 1 auto;
|
||||
@@ -185,7 +173,6 @@ export default defineComponent({
|
||||
background: #ffffff;
|
||||
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.07);
|
||||
}
|
||||
|
||||
// @media screen and (max-width: 1366px) {
|
||||
// .cmMain {
|
||||
// width: 750px;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: lixg lixg@dongwu-inc.com
|
||||
* @Date: 2022-11-21 14:32:52
|
||||
* @LastEditors: lixg lixg@dongwu-inc.com
|
||||
* @LastEditTime: 2022-12-03 19:52:09
|
||||
* @LastEditTime: 2022-12-04 11:13:37
|
||||
* @FilePath: /fe-manage/src/api/config.js
|
||||
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
||||
*/
|
||||
@@ -54,6 +54,7 @@ http.interceptors.response.use(
|
||||
} else {
|
||||
if (code === 1000) {
|
||||
// window.open("https://u-pre.boe.com/web/", '_self');
|
||||
// window.open("http://111.231.196.214:12013/manage/login", '_self');
|
||||
}
|
||||
console.log("api %o", msg);
|
||||
}
|
||||
|
||||
@@ -2517,13 +2517,13 @@
|
||||
<!-- 学员管理-添加学员抽屉 -->
|
||||
<!-- <StuAdd v-model:Stuvisible="Stuvisible" @sure="handlePostSure" /> -->
|
||||
<!-- 添加学员抽屉 -->
|
||||
<proj-check-ship
|
||||
<!-- <proj-check-ship
|
||||
v-model:ProjCheckvisible="viewpowervisible"
|
||||
:selectProjectId="offcourseId"
|
||||
v-model:addAuthList="addStudentList"
|
||||
v-model:addStudentList="addStudentList"
|
||||
:authClassify="authClassify"
|
||||
classify="addstudent"
|
||||
/>
|
||||
/> -->
|
||||
<!-- 新建在线课弹窗 -->
|
||||
<addOnlineCourse
|
||||
v-model:addOnlineCoursevisible="addOnlineCoursevisible"
|
||||
@@ -2551,7 +2551,7 @@
|
||||
:authClassify="authClassify"
|
||||
classify="course"
|
||||
/> -->
|
||||
<!-- 管理权抽屉 -->
|
||||
<!--查看权抽屉 管理权抽屉 添加学员抽屉 -->
|
||||
<proj-check-ship
|
||||
v-model:ProjCheckvisible="viewpowervisible"
|
||||
:selectProjectId="selectCourseId"
|
||||
@@ -3329,7 +3329,7 @@ export default defineComponent({
|
||||
selectCourseId: null, //授权选择的id
|
||||
|
||||
viewpowervisible: false, //查看权抽屉
|
||||
authClassify: null, //1:查看权 2:管理权
|
||||
authClassify: null, //1:查看权 2:管理权 3:学员
|
||||
addAuthList: null,
|
||||
|
||||
addStudentList: null, //选中列表
|
||||
@@ -3339,6 +3339,7 @@ export default defineComponent({
|
||||
|
||||
const showStuAdd = () => {
|
||||
state.viewpowervisible = true;
|
||||
state.authClassify = 3;
|
||||
};
|
||||
|
||||
// 富文本 sssssssssssssss
|
||||
@@ -4864,55 +4865,63 @@ export default defineComponent({
|
||||
() => state.addAuthList,
|
||||
(res) => {
|
||||
console.log("res", res, state.addAuthList);
|
||||
let obj = {
|
||||
type: 3,
|
||||
tag:
|
||||
state.authClassify === 1 ? 3 : state.authClassify === 2 ? 4 : null,
|
||||
opt: 3,
|
||||
deptList: res[1],
|
||||
groupList: res[2],
|
||||
refId: state.selectCourseId,
|
||||
pageNo: 20,
|
||||
pageSize: 1,
|
||||
studentList: res[0],
|
||||
keyWord: "",
|
||||
};
|
||||
console.log("obj", obj);
|
||||
api1
|
||||
.optionAuthPerm(obj)
|
||||
.then((res) => {
|
||||
console.log("添加授权成功", res);
|
||||
message.success("添加授权成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("添加授权失败", err);
|
||||
});
|
||||
if (state.authClassify === 1 || state.authClassify === 2) {
|
||||
let obj = {
|
||||
type: 3,
|
||||
tag:
|
||||
state.authClassify === 1
|
||||
? 3
|
||||
: state.authClassify === 2
|
||||
? 4
|
||||
: null,
|
||||
opt: 3,
|
||||
deptList: res[1],
|
||||
groupList: res[2],
|
||||
refId: state.selectCourseId,
|
||||
pageNo: 20,
|
||||
pageSize: 1,
|
||||
studentList: res[0],
|
||||
keyWord: "",
|
||||
};
|
||||
console.log("obj", obj);
|
||||
api1
|
||||
.optionAuthPerm(obj)
|
||||
.then((res) => {
|
||||
console.log("添加授权成功", res);
|
||||
message.success("添加授权成功");
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("添加授权失败", err);
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
//添加学员
|
||||
watch(
|
||||
() => state.addStudentList,
|
||||
() => state.addAuthList,
|
||||
(res) => {
|
||||
console.log("res", res, state.addStudentList);
|
||||
let obj = {
|
||||
deptList: res[1],
|
||||
groupList: res[2],
|
||||
offcourseId: state.offcourseId,
|
||||
offcoursePlanId: state.offcoursePlanId, //开课id
|
||||
studentList: res[0],
|
||||
};
|
||||
console.log("obj", obj);
|
||||
api1
|
||||
.addStudentCourse(obj)
|
||||
.then((res) => {
|
||||
console.log("添加学员成功", res);
|
||||
message.success("添加学员成功");
|
||||
getTableDate2();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("添加学员失败", err);
|
||||
});
|
||||
if (state.authClassify === 3) {
|
||||
let obj = {
|
||||
deptList: res[1],
|
||||
groupList: res[2],
|
||||
offcourseId: state.offcourseId,
|
||||
offcoursePlanId: state.offcoursePlanId, //开课id
|
||||
studentList: res[0],
|
||||
};
|
||||
console.log("obj", obj);
|
||||
api1
|
||||
.addStudentCourse(obj)
|
||||
.then((res) => {
|
||||
console.log("添加学员成功", res);
|
||||
message.success("添加学员成功");
|
||||
getTableDate2();
|
||||
})
|
||||
.catch((err) => {
|
||||
console.log("添加学员失败", err);
|
||||
});
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
<template>
|
||||
<div class="projectAdd">
|
||||
<div class="header">
|
||||
<span class="title">{{ projectInfo.parentId ? '编辑' : '创建' }}项目</span>
|
||||
<span class="title"
|
||||
>{{ 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>
|
||||
@@ -17,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>
|
||||
@@ -31,26 +33,26 @@
|
||||
<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-input
|
||||
v-model:value="projectInfo.name"
|
||||
placeholder="请输入项目名称"
|
||||
show-count
|
||||
:maxlength="30"
|
||||
:disabled="viewDetail ? true : false"
|
||||
v-model:value="projectInfo.name"
|
||||
placeholder="请输入项目名称"
|
||||
show-count
|
||||
:maxlength="30"
|
||||
: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>
|
||||
@@ -61,14 +63,14 @@
|
||||
<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="`box ${projectInfo.picUrl == src?'active':''}`"
|
||||
style="
|
||||
:class="`box ${projectInfo.picUrl == src ? 'active' : ''}`"
|
||||
style="
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border-radius: 5px;
|
||||
@@ -76,69 +78,77 @@
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
"
|
||||
v-for="(src,index) in projectPic"
|
||||
:key="index"
|
||||
@click="()=>{
|
||||
projectInfo.picUrl = src
|
||||
}"
|
||||
v-for="(src, index) in projectPic"
|
||||
:key="index"
|
||||
@click="
|
||||
() => {
|
||||
projectInfo.picUrl = src;
|
||||
}
|
||||
"
|
||||
>
|
||||
<img
|
||||
style="
|
||||
style="
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
margin-bottom: 4px;
|
||||
margin-right: 4px;
|
||||
"
|
||||
:src="src"
|
||||
alt="avatar"
|
||||
:src="src"
|
||||
alt="avatar"
|
||||
/>
|
||||
</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">
|
||||
<a-range-picker
|
||||
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"
|
||||
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"
|
||||
mode="multiple"></ProjectManager>
|
||||
<ProjectManager
|
||||
v-model:value="projectInfo.managerId"
|
||||
v-model:name="projectInfo.manager"
|
||||
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"></OrgClass>
|
||||
<OrgClass
|
||||
v-model:value="projectInfo.sourceBelongId"
|
||||
v-model:name="projectInfo.sourceBelongName"
|
||||
></OrgClass>
|
||||
</div>
|
||||
</div>
|
||||
<div class="name name2">
|
||||
@@ -147,12 +157,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>
|
||||
@@ -162,25 +172,26 @@
|
||||
</div>
|
||||
<div class="in">
|
||||
<a-switch
|
||||
v-model:checked="projectInfo.courseSyncFlag"
|
||||
:checkedValue="1"
|
||||
:unCheckedValue="0"
|
||||
:disabled="viewDetail ? true : false"
|
||||
><span
|
||||
v-model:checked="projectInfo.courseSyncFlag"
|
||||
:checkedValue="1"
|
||||
:unCheckedValue="0"
|
||||
:disabled="viewDetail ? true : false"
|
||||
><span
|
||||
style="
|
||||
width: 100%;
|
||||
color: rgba(109, 117, 132, 1);
|
||||
font-size: 14px;
|
||||
"
|
||||
>同步课程学习记录(如学员在课程库中拥有课程的学习记录,自动免修该课程)</span
|
||||
></a-switch>
|
||||
>同步课程学习记录(如学员在课程库中拥有课程的学习记录,自动免修该课程)</span
|
||||
></a-switch
|
||||
>
|
||||
</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>
|
||||
@@ -191,8 +202,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>
|
||||
@@ -202,19 +213,30 @@
|
||||
</div>
|
||||
<div class="name">
|
||||
<div class="namebox">
|
||||
<!-- <img-->
|
||||
<!-- class="nameimg"-->
|
||||
<!-- src="../../assets/images/basicinfo/asterisk.png"-->
|
||||
<!-- />-->
|
||||
<!-- <img-->
|
||||
<!-- class="nameimg"-->
|
||||
<!-- src="../../assets/images/basicinfo/asterisk.png"-->
|
||||
<!-- />-->
|
||||
<img
|
||||
class="nameimg"
|
||||
src="../../assets/images/basicinfo/asterisk.png"
|
||||
/>
|
||||
<div class="inname">是否BOEU实施</div>
|
||||
</div>
|
||||
<div class="in">
|
||||
<a-switch
|
||||
<!-- <a-switch
|
||||
v-model:checked="projectInfo.boeFlag"
|
||||
:checkedValue="1"
|
||||
:unCheckedValue="0"
|
||||
:disabled="viewDetail ? true : false"
|
||||
></a-switch>
|
||||
></a-switch> -->
|
||||
<a-radio-group
|
||||
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>
|
||||
</a-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -223,19 +245,19 @@
|
||||
<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;
|
||||
}
|
||||
"
|
||||
v-model:value="classifySelect5"
|
||||
placeholder="请选择模版"
|
||||
:size="size"
|
||||
style="width: 100%"
|
||||
:options="classifyList5"
|
||||
@change="classificationChange5"
|
||||
@popupScroll="templateScroll"
|
||||
:fieldNames="{
|
||||
v-model:value="classifySelect5"
|
||||
placeholder="请选择模版"
|
||||
:size="size"
|
||||
style="width: 100%"
|
||||
:options="classifyList5"
|
||||
@change="classificationChange5"
|
||||
@popupScroll="templateScroll"
|
||||
:fieldNames="{
|
||||
label: 'name',
|
||||
value: 'projectTemplateId',
|
||||
}"
|
||||
@@ -248,26 +270,25 @@
|
||||
<div class="footer">
|
||||
<div class="btn">
|
||||
<a-button v-on:click="createProject" type="primary" class="btn1"
|
||||
>确定
|
||||
</a-button
|
||||
>
|
||||
>确定
|
||||
</a-button>
|
||||
<a-button @click="backPage" class="btn2">取消</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/ProjectManager";
|
||||
import ProjectLevel from "@/components/project/ProjectLevel";
|
||||
import {scrollLoad} from "@/api/method";
|
||||
import { scrollLoad } from "@/api/method";
|
||||
|
||||
export default {
|
||||
name: "projectAdd",
|
||||
@@ -276,7 +297,7 @@ export default {
|
||||
ProjectLevel,
|
||||
ProjectClass,
|
||||
TrainClass,
|
||||
OrgClass
|
||||
OrgClass,
|
||||
},
|
||||
setup() {
|
||||
const store = useStore();
|
||||
@@ -295,37 +316,44 @@ export default {
|
||||
pageSize: 10,
|
||||
keyWord: "",
|
||||
},
|
||||
classifyList5: []
|
||||
classifyList5: [],
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
state.projectPic = store.state.projectPic.map(e => e.dictValue)
|
||||
state.viewDetail = routers.query.viewDetail
|
||||
getProjectInfo()
|
||||
getTemplate()
|
||||
})
|
||||
state.projectPic = store.state.projectPic.map((e) => e.dictValue);
|
||||
state.viewDetail = routers.query.viewDetail;
|
||||
getProjectInfo();
|
||||
getTemplate();
|
||||
});
|
||||
|
||||
watch(routers.query, () => {
|
||||
state.projectInfo.projectId = routers.query.projectId
|
||||
state.projectInfo.parentName = routers.query.parentName
|
||||
state.projectInfo.parentId = routers.query.parentId
|
||||
})
|
||||
|
||||
state.projectInfo.projectId = routers.query.projectId;
|
||||
state.projectInfo.parentName = routers.query.parentName;
|
||||
state.projectInfo.parentId = routers.query.parentId;
|
||||
});
|
||||
|
||||
function getProjectInfo() {
|
||||
if (!routers.query.projectId) {
|
||||
state.projectInfo = {parentName: routers.query.parentName, parentId: routers.query.parentId}
|
||||
return
|
||||
state.projectInfo = {
|
||||
parentName: routers.query.parentName,
|
||||
parentId: routers.query.parentId,
|
||||
};
|
||||
return;
|
||||
}
|
||||
api.getProjectDetail({projectId: routers.query.projectId}).then(res => {
|
||||
state.projectInfo = res.data.data.projectInfo
|
||||
state.projectInfo.rangeTime = [state.projectInfo.beginTime, state.projectInfo.endTime]
|
||||
state.projectInfo.parentName = routers.query.parentName
|
||||
})
|
||||
api
|
||||
.getProjectDetail({ projectId: routers.query.projectId })
|
||||
.then((res) => {
|
||||
state.projectInfo = res.data.data.projectInfo;
|
||||
state.projectInfo.rangeTime = [
|
||||
state.projectInfo.beginTime,
|
||||
state.projectInfo.endTime,
|
||||
];
|
||||
state.projectInfo.parentName = routers.query.parentName;
|
||||
});
|
||||
}
|
||||
|
||||
const backPage = () => {
|
||||
router.back()
|
||||
router.back();
|
||||
};
|
||||
|
||||
//选择分类
|
||||
@@ -334,25 +362,24 @@ export default {
|
||||
state.projectType = value; //分类选择的id
|
||||
};
|
||||
|
||||
|
||||
const classificationChange5 = (key, option) => {
|
||||
state.projectInfo = option
|
||||
state.projectInfo.type = 3
|
||||
state.projectInfo.rangeTime = [option.beginTime, option.endTime]
|
||||
state.projectInfo.parentName = routers.query.parentName
|
||||
state.projectInfo.parentId = routers.query.parentId
|
||||
state.projectInfo = option;
|
||||
state.projectInfo.type = 3;
|
||||
state.projectInfo.rangeTime = [option.beginTime, option.endTime];
|
||||
state.projectInfo.parentName = routers.query.parentName;
|
||||
state.projectInfo.parentId = routers.query.parentId;
|
||||
};
|
||||
//获取模版列表
|
||||
const getTemplate = () => {
|
||||
let obj = {
|
||||
pageNo: state.currentPage,
|
||||
pageSize: state.pageSize,
|
||||
status: 1
|
||||
status: 1,
|
||||
};
|
||||
api.getTemplate(obj).then((res) => {
|
||||
state.totalPages = Number(res.data.data.pages);
|
||||
state.classifyList5 = res.data.data.rows
|
||||
})
|
||||
state.classifyList5 = res.data.data.rows;
|
||||
});
|
||||
};
|
||||
|
||||
//模版滚动加载模板信息
|
||||
@@ -378,18 +405,19 @@ export default {
|
||||
sourceBelongId: "请选择资源归属",
|
||||
level: "请填写项目级别",
|
||||
systemId: "请填写项目培训体系",
|
||||
boeFlag: "请选择是否BOEU实施",
|
||||
};
|
||||
|
||||
function timeChange(e) {
|
||||
if (e && e.length === 2) {
|
||||
state.projectInfo.beginTime = e[0]
|
||||
state.projectInfo.endTime = e[1]
|
||||
state.projectInfo.beginTime = e[0];
|
||||
state.projectInfo.endTime = e[1];
|
||||
}
|
||||
}
|
||||
|
||||
function validate(obj, errorMsgs) {
|
||||
for (let i in errorMsgs) {
|
||||
if (!obj[i]) {
|
||||
if (!obj[i] && obj[i] !== 0) {
|
||||
message.destroy();
|
||||
message.warning(errorMsgs[i]);
|
||||
return false;
|
||||
@@ -403,13 +431,12 @@ export default {
|
||||
if (!validate(state.projectInfo, errorMsgs)) {
|
||||
return;
|
||||
}
|
||||
state.projectInfo.type = 3
|
||||
state.projectInfo.type = 3;
|
||||
api.createProject(state.projectInfo).then(() => {
|
||||
message.destroy();
|
||||
message.success("编辑成功");
|
||||
router.back()
|
||||
}
|
||||
)
|
||||
message.destroy();
|
||||
message.success("编辑成功");
|
||||
router.back();
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
@@ -419,7 +446,7 @@ export default {
|
||||
classificationChange5,
|
||||
createProject,
|
||||
backPage,
|
||||
templateScroll
|
||||
templateScroll,
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -523,7 +550,6 @@ export default {
|
||||
position: relative;
|
||||
margin-left: 14px;
|
||||
|
||||
|
||||
.box1 {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
|
||||
@@ -590,7 +590,6 @@
|
||||
style="
|
||||
width: 120px;
|
||||
text-align: center;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
Reference in New Issue
Block a user