fix:修改小组

This commit is contained in:
lixg
2022-12-04 23:53:02 +08:00
parent a808aebeac
commit 7260014535
5 changed files with 92 additions and 40 deletions

View File

@@ -43,7 +43,7 @@ export default defineComponent({
const store = useStore(); const store = useStore();
const isLogin = ref(false); const isLogin = ref(false);
// console.log("router", router.getRoutes(), route); // console.log("router", router.getRoutes(), route);
console.log("版本0.13------------"); console.log("版本0.15------------");
const routes = computed(() => { const routes = computed(() => {
return router.getRoutes().filter((e) => e.meta?.isLink); return router.getRoutes().filter((e) => e.meta?.isLink);
}); });

View File

@@ -2,7 +2,7 @@
* @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-04 13:27:07 * @LastEditTime: 2022-12-04 23:51:45
* @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
*/ */
@@ -57,7 +57,7 @@ http.interceptors.response.use(
} else { } else {
if (code === 1000) { if (code === 1000) {
// window.open("https://u-pre.boe.com/web/", '_self'); // window.open("https://u-pre.boe.com/web/", '_self');
// window.open("http://111.231.196.214:12013/manage/login", '_self'); window.open("http://111.231.196.214:12013/manage/login", '_self');
} }
console.log("api %o", msg); console.log("api %o", msg);
} }

View File

@@ -97,8 +97,8 @@
</div> </div>
</div> </div>
<div class="btnn"> <div class="btnn">
<button class="btn1">取消</button> <button class="btn1" @click="closeDrawer">取消</button>
<button class="btn2">确定</button> <button class="btn2" @click="closeDrawer">确定</button>
</div> </div>
<!-- 批量删除的弹窗 --> <!-- 批量删除的弹窗 -->
<a-modal <a-modal
@@ -270,6 +270,8 @@ export default {
}); });
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("update:Lvisible", false); ctx.emit("update:Lvisible", false);
state.tabledata = [];
console.log("tabledata", state.tabledata);
}; };
const showModal = () => { const showModal = () => {
if (state.selectedRows.length == 0) { if (state.selectedRows.length == 0) {
@@ -345,18 +347,25 @@ export default {
state.tableDataTotal = -1; state.tableDataTotal = -1;
getProjStu(objf).then((res) => { getProjStu(objf).then((res) => {
console.log(res.data.data, "获取学员列表"); console.log(res.data.data, "获取学员列表");
let leng = res.data.data.rows.length; if (res.data.code === 200) {
state.total = res.data.data.total; state.total = res.data.data.total;
state.tableDataTotal = res.data.data.total; state.tableDataTotal = res.data.data.total;
if (leng > 0) {
let arr = res.data.data.rows; let arr = res.data.data.rows;
getTableDataList(arr); getTableDataList(arr);
} }
// let leng = res.data.data.rows.length;
// state.tableDataTotal = res.data.data.total;
// if (leng > 0) {
// }
}); });
}; };
const afterVisibleChange = () => { const afterVisibleChange = (bool) => {
getStu(); if (bool) {
getStu();
}
}; };
//分页 //分页
const changePaginationStu = (page) => { const changePaginationStu = (page) => {

View File

@@ -4429,8 +4429,8 @@ export default defineComponent({
}; };
// 关闭查看 // 关闭查看
const handlelookMs = () => { const handlelookMs = () => {
state.lookMs = false state.lookMs = false;
} };
//保存面授课 //保存面授课
const handlePush = (param) => { const handlePush = (param) => {
//state.isEdit = 1; //state.isEdit = 1;
@@ -5030,7 +5030,6 @@ export default defineComponent({
state.ft_eidt = true; state.ft_eidt = true;
}; };
const handleLook = async (itm, type) => { const handleLook = async (itm, type) => {
state.isEdit = 0; state.isEdit = 0;
console.log(45555); console.log(45555);
@@ -5370,7 +5369,7 @@ export default defineComponent({
watch( watch(
() => state.addAuthList, () => state.addAuthList,
(res) => { (res) => {
console.log("res", res, state.addStudentList); console.log("res 添加学员", res, state.addStudentList);
if (state.authClassify === 3) { if (state.authClassify === 3) {
let obj = { let obj = {
deptList: res[1], deptList: res[1],
@@ -5508,7 +5507,7 @@ export default defineComponent({
closeOnlineCoursevisible, closeOnlineCoursevisible,
handlelookMs, handlelookMs,
handleLook handleLook,
}; };
}, },
}); });

View File

@@ -777,7 +777,7 @@
</div> </div>
</div> </div>
<div class="second2"> <div class="second2">
<div class="btn1" @click="showModal2"> <div class="btn1" @click="showModal2(1, null)">
<img src="../../assets/images/courseManage/add0.png" /> <img src="../../assets/images/courseManage/add0.png" />
<span class="btn1text">创建小组</span> <span class="btn1text">创建小组</span>
</div> </div>
@@ -803,7 +803,9 @@
>. . .</span >. . .</span
> >
<div class="moreItems"> <div class="moreItems">
<div class="sammo">编辑</div> <div class="sammo" @click="showModal2(2, item)">
编辑
</div>
<div <div
class="sammo" class="sammo"
@click="deleteGroupBtn(item.projectGroupId)" @click="deleteGroupBtn(item.projectGroupId)"
@@ -1936,6 +1938,8 @@ export default {
valuestub: "", //学员管理部门 valuestub: "", //学员管理部门
valuestug: "", //学员小组管理名称 valuestug: "", //学员小组管理名称
valuestugroup: "", //学员管理小组名称 valuestugroup: "", //学员管理小组名称
projectGroupId: null, //是编辑小组id
stuMemberClassify: null, //1新建小组 2编辑小组
valueDate: "", //排行榜输入日期 valueDate: "", //排行榜输入日期
noticeChecked: true, noticeChecked: true,
noticeContent: "", noticeContent: "",
@@ -2642,11 +2646,23 @@ export default {
state.canclestu1 = false; state.canclestu1 = false;
}; };
const showModal2 = () => { const showModal2 = (classify, item) => {
state.stuMemberClassify = classify;
state.projectGroupId =
item && item.projectGroupId ? item.projectGroupId : null;
state.stugroup = true; state.stugroup = true;
if (item) {
state.valueaddg = item.groupName;
state.valueaddm = item.leaderName;
}
console.log("编辑小组item", item);
}; };
const closeModal2 = () => { const closeModal2 = () => {
state.stugroup = false; state.stugroup = false;
state.valueaddg = null;
state.valueaddm = null;
state.projectGroupId = null;
state.stuMemberClassify = null;
}; };
//点击确定创建小组 //点击确定创建小组
const createG = () => { const createG = () => {
@@ -2655,7 +2671,7 @@ export default {
return message.warning("请输入必填项"); return message.warning("请输入必填项");
} else { } else {
createGroup(); createGroup();
state.stugroup = false; closeModal2();
} }
}; };
const showFaceIn = () => { const showFaceIn = () => {
@@ -3234,6 +3250,7 @@ export default {
array.push(obj); array.push(obj);
}); });
state.groupList = array; state.groupList = array;
console.log("编辑小组", state.groupList);
}; };
//学员搜索 //学员搜索
const searchStu = () => { const searchStu = () => {
@@ -3294,7 +3311,7 @@ export default {
}; };
//获取学员列表 //获取学员列表
const getStu = (obj) => { const getStu = (obj) => {
state.loading = true state.loading = true;
let objf = obj || { let objf = obj || {
deptIds: [], //部门 deptIds: [], //部门
groupId: 0, groupId: 0,
@@ -3394,11 +3411,14 @@ export default {
getGroupList(objf) getGroupList(objf)
.then((res) => { .then((res) => {
console.log(res.data.data.rows, "获取小组列表成功"); console.log(res.data.data.rows, "获取小组列表成功");
let leng = res.data.data.rows.length; if (res.data.code === 200) {
if (leng > 0) {
let arr = res.data.data.rows; let arr = res.data.data.rows;
setGroupList(arr); setGroupList(arr);
} }
// let leng = res.data.data.rows.length;
// if (leng > 0) {
// }
}) })
.catch((err) => { .catch((err) => {
console.log(err, "获取列表失败"); console.log(err, "获取列表失败");
@@ -3416,23 +3436,47 @@ export default {
}; };
//创建小组 //创建小组
const createGroup = () => { const createGroup = () => {
let obj = { //新建
groupName: state.valueaddg, if (state.stuMemberClassify === 1) {
leaderId: 0, let obj = {
leaderName: state.valueaddm, groupName: state.valueaddg,
projectGroupId: 0, leaderId: 0,
projectId: state.projectId, leaderName: state.valueaddm,
}; // projectGroupId: 0,
editGroup(obj) projectId: state.projectId,
.then((res) => { };
console.log("小组创建成功", res); editGroup(obj)
message.success("小组创建成功"); .then((res) => {
getGroup(); console.log("小组创建成功", res);
}) message.success("小组创建成功");
.catch((err) => { getGroup();
console.log("小组创建失败", err); })
message.warning("小组创建失败"); .catch((err) => {
}); console.log("小组创建失败", err);
message.warning("小组创建失败");
});
}
//编辑
if (state.stuMemberClassify === 2) {
let obj = {
groupName: state.valueaddg,
leaderId: 0,
leaderName: state.valueaddm,
projectGroupId: state.projectGroupId,
projectId: state.projectId,
};
console.log("编辑小组obj", obj);
editGroup(obj)
.then((res) => {
console.log("小组编辑成功", res);
message.success("小组编辑成功");
getGroup();
})
.catch((err) => {
console.log("小组编辑失败", err);
message.warning("小组编辑失败");
});
}
}; };
//搜索小组重置 //搜索小组重置
const resetGroupName = () => { const resetGroupName = () => {