feat:合并

This commit is contained in:
lixg
2022-12-19 21:44:44 +08:00
6 changed files with 77 additions and 86 deletions

View File

@@ -57,6 +57,7 @@ export const getProjectDetail = (obj) => http.get('/admin/project/detail', {para
export const releaseProject = (obj) => http.post('/admin/project/publish', obj) export const releaseProject = (obj) => http.post('/admin/project/publish', obj)
//获取项目学员 //获取项目学员
export const projectStudent = (obj) => http.post('/admin/project/studentList', obj) export const projectStudent = (obj) => http.post('/admin/project/studentList', obj)
export const projectStudentCount = (obj) => http.get('/admin/student/getStudentCount', {params: obj})
//撤回发布、结束 //撤回发布、结束
export const handleProject = (obj) => http.post('/admin/project/handle', obj) export const handleProject = (obj) => http.post('/admin/project/handle', obj)

View File

@@ -4,9 +4,9 @@
<a-col> <a-col>
<a-form-item title="姓名:" @click="getStuList"> <a-form-item title="姓名:" @click="getStuList">
<a-input <a-input
class="cus-input" class="cus-input"
v-model:value="tableParam.studentName" v-model:value="tableParam.studentName"
placeholder="请输入姓名" placeholder="请输入姓名"
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
@@ -14,15 +14,16 @@
<a-button class="cus-btn" style="width: 100px"> <a-button class="cus-btn" style="width: 100px">
<template #icon> <template #icon>
<img <img
style="margin-right: 10px" style="margin-right: 10px"
src="../../assets/images/courseManage/search0.png" src="../../assets/images/courseManage/search0.png"
/></template> /></template>
搜索 搜索
</a-button> </a-button>
</a-col> </a-col>
<a-col :span="2"> <a-col :span="2">
<a-button class="cus-btn white" style="width: 100px" @click="reset" <a-button class="cus-btn white" style="width: 100px" @click="reset"
>重置</a-button >重置
</a-button
> >
</a-col> </a-col>
</a-row> </a-row>
@@ -30,14 +31,14 @@
<a-row type="flex" gutter="12" style="padding-left: 20px"> <a-row type="flex" gutter="12" style="padding-left: 20px">
<a-col :span="1.5"> <a-col :span="1.5">
<CommonStudent <CommonStudent
:type="type" :type="type"
:id="id" :id="id"
@finash="submitCall" @finash="submitCall"
:stage="stage" :stage="stage"
> >
<a-button class="cus-btn"> <a-button class="cus-btn">
<template #icon <template #icon
><img ><img
style="margin-right: 10px" style="margin-right: 10px"
src="../../assets/images/courseManage/add0.png" src="../../assets/images/courseManage/add0.png"
/></template> /></template>
@@ -48,7 +49,7 @@
<a-col :span="1.5"> <a-col :span="1.5">
<a-button class="cus-btn white" @click="bathDel"> <a-button class="cus-btn white" @click="bathDel">
<template #icon <template #icon
><img ><img
style="margin-right: 10px" style="margin-right: 10px"
src="../../assets/images/projectadd/delete.png" src="../../assets/images/projectadd/delete.png"
/></template> /></template>
@@ -58,17 +59,17 @@
</a-row> </a-row>
<div style="margin-top: 20px"> <div style="margin-top: 20px">
<a-table <a-table
:columns="tablecolumns" :columns="tablecolumns"
:data-source="tableData.list" :data-source="tableData.list"
:pagination="stuPagination" :pagination="stuPagination"
:loading="tableData.loading" :loading="tableData.loading"
row-key="id" row-key="id"
:row-selection="stuRowSelection" :row-selection="stuRowSelection"
> >
<template #action="{ record }"> <template #action="{ record }">
<div <div
@click="del(record.id)" @click="del(record.id)"
style="color: #4ea6ff; font-size: 14px; text-align: center" style="color: #4ea6ff; font-size: 14px; text-align: center"
> >
删除 删除
</div> </div>
@@ -96,8 +97,8 @@
</div> </div>
</template> </template>
<script setup> <script setup>
import { computed, defineProps, onMounted, ref } from "vue"; import {computed, defineProps, onMounted, ref, watch} from "vue";
import { delStudentList, getStuPage } from "@/api/index1"; import {delStudentList, getStuPage} from "@/api/index1";
import CommonStudent from "@/components/student/CommonStudent"; import CommonStudent from "@/components/student/CommonStudent";
const props = defineProps({ const props = defineProps({
@@ -145,8 +146,8 @@ const tablecolumns = ref([
key: "source", key: "source",
width: "10%", width: "10%",
align: "center", align: "center",
customRender: ({ record: { source } }) => customRender: ({record: {source}}) =>
({ 1: "快速添加", 2: "组织", 3: "受众" }[source]), ({1: "快速添加", 2: "组织", 3: "受众"}[source]),
}, },
...props.columns, ...props.columns,
{ {
@@ -155,7 +156,7 @@ const tablecolumns = ref([
key: "operation", key: "operation",
width: "25%", width: "25%",
align: "center", align: "center",
slots: { customRender: "action" }, slots: {customRender: "action"},
}, },
]); ]);
const tableParam = ref({ const tableParam = ref({
@@ -183,6 +184,11 @@ onMounted(() => {
getStuList(); getStuList();
}); });
watch(props, () => {
tableParam.value.pid= props.id
getStuList();
})
function onStuSelectChange(e) { function onStuSelectChange(e) {
stuSelectKeys.value = e; stuSelectKeys.value = e;
} }
@@ -210,25 +216,26 @@ function getStuList() {
}); });
} }
function reset() {} function reset() {
}
function bathDel() { function bathDel() {
stuSelectKeys.value && stuSelectKeys.value &&
stuSelectKeys.value.length && stuSelectKeys.value.length &&
delStudentList({ delStudentList({
ids: stuSelectKeys.value, ids: stuSelectKeys.value,
}).then(() => { }).then(() => {
getStuList(); getStuList();
}); });
} }
function del(id) { function del(id) {
id && id &&
delStudentList({ delStudentList({
ids: [id], ids: [id],
}).then(() => { }).then(() => {
getStuList(); getStuList();
}); });
} }
function submitCall(flag) { function submitCall(flag) {

View File

@@ -2278,7 +2278,7 @@
<span>{{ currentPlanItem.teacher }}</span> <span>{{ currentPlanItem.teacher }}</span>
</div> </div>
<div class="stmm_i5"> <div class="stmm_i5">
<TableStudent :type="3" :id="offcourseId" :columns="stuColumns"> <TableStudent :type="3" :id="offcoursePlanId" :columns="stuColumns">
<!-- <template #extension = "data">--> <!-- <template #extension = "data">-->
<!-- <div style="display: flex">--> <!-- <div style="display: flex">-->
<!-- <button @click="handlJoinStu(data)">成绩录入</button>--> <!-- <button @click="handlJoinStu(data)">成绩录入</button>-->
@@ -4982,7 +4982,7 @@ export default defineComponent({
console.log(state.currentPlanItem); console.log(state.currentPlanItem);
state.sm_hs = true; state.sm_hs = true;
getTableDate2(); // getTableDate2();
}; };
const sm_exit = () => { const sm_exit = () => {
state.sm_hs = false; state.sm_hs = false;

View File

@@ -203,7 +203,7 @@
<!-- <img class="im" src="../../assets/px.jpg" /> <!-- <img class="im" src="../../assets/px.jpg" />
<img class="im" src="../../assets/px.jpg" /> <img class="im" src="../../assets/px.jpg" />
<img class="im" src="../../assets/px.jpg" /> --> <img class="im" src="../../assets/px.jpg" /> -->
<div <div
@click="chooseImg(item)" @click="chooseImg(item)"
v-for="(item, index) in imgData" v-for="(item, index) in imgData"
@@ -244,7 +244,7 @@
class="aeLoading" class="aeLoading"
:style="{ display: lpLoading ? 'flex' : 'none' }" :style="{ display: lpLoading ? 'flex' : 'none' }"
> >
<a-spin :spinning="lpLoading" tip="" /> <a-spin :spinning="lpLoading" tip=""/>
</div> </div>
</div> </div>
</div> </div>
@@ -278,7 +278,7 @@
/> />
</div> </div>
<div class="inname">路径图名称</div> <div class="inname">路径图名称</div>
<div class="in"> <div class="in" >
<!-- <a-input--> <!-- <a-input-->
<!-- v-model:value="pathName"--> <!-- v-model:value="pathName"-->
<!-- maxlength="20"--> <!-- maxlength="20"-->
@@ -332,7 +332,7 @@
<!-- <img class="im" src="../../assets/px.jpg" /> <!-- <img class="im" src="../../assets/px.jpg" />
<img class="im" src="../../assets/px.jpg" /> <img class="im" src="../../assets/px.jpg" />
<img class="im" src="../../assets/px.jpg" /> --> <img class="im" src="../../assets/px.jpg" /> -->
<div <div
@click="chooseImg2(item)" @click="chooseImg2(item)"
v-for="(item, index) in imgData" v-for="(item, index) in imgData"
@@ -699,6 +699,7 @@ import ProjPowerList from "../../components/drawers/ProjPowerList";
import ProjCheckShip from "../../components/drawers/ProjCheckPower"; import ProjCheckShip from "../../components/drawers/ProjCheckPower";
// import ManageRight from "../../components/drawers/ManageRight"; // import ManageRight from "../../components/drawers/ManageRight";
import * as api from "../../api/index1"; import * as api from "../../api/index1";
import * as apiStu from "../../api/index";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import { import {
commonData, commonData,
@@ -709,7 +710,7 @@ import { storage } from "../../api/storage";
import { useStore } from "vuex"; import { useStore } from "vuex";
import OrgClass from "@/components/project/OrgClass"; import OrgClass from "@/components/project/OrgClass";
import NameInput from "@/components/project/NameInput"; import NameInput from "@/components/project/NameInput";
import { getStuPage } from "@/api/index1";
export default { export default {
name: "learningPath", name: "learningPath",
components: { components: {
@@ -857,7 +858,7 @@ export default {
state.pathName = ""; state.pathName = "";
state.pathBg = ""; state.pathBg = "";
state.pathBgId = ""; state.pathBgId = "";
if (store.state.userInfo.departId && store.state.userInfo.departName) { if(store.state.userInfo.departId && store.state.userInfo.departName){
state.organizationSelectName = store.state.userInfo.departName; state.organizationSelectName = store.state.userInfo.departName;
state.organizationSelectId = store.state.userInfo.departId; state.organizationSelectId = store.state.userInfo.departId;
} }
@@ -867,7 +868,7 @@ export default {
const handleOut1 = () => { const handleOut1 = () => {
state.pathName = ""; state.pathName = "";
state.pathBg = ""; state.pathBg = "";
state.pathBgId = 1; state.pathBgId =1;
state.organizationSelectName = null; state.organizationSelectName = null;
state.organizationSelectId = null; state.organizationSelectId = null;
state.pathIntro = ""; state.pathIntro = "";
@@ -905,23 +906,13 @@ export default {
console.log("err", err); console.log("err", err);
}); });
//获取学员列表 //获取学员列表
let stuobj = { apiStu.projectStudentCount({
pageNo: 1, pid: router.id,
pageSize: 10, type:2
pid: router.id, }).then((res) => {
type: 2, state.routeStudentsNum = res.data.data;
};
getStuPage(stuobj)
.then((res) => {
console.log("获取学员列表", res.data);
if (res.data.code === 200) {
state.routeStudentsNum = res.data.data.total;
state.pubLoading = false; state.pubLoading = false;
}
}) })
.catch((err) => {
console.log("获取学员列表失败", err);
});
}; };
//确定发布 //确定发布
const releaseLearnPath = () => { const releaseLearnPath = () => {
@@ -1175,7 +1166,7 @@ export default {
key: "opacation", key: "opacation",
width: "20%", width: "20%",
align: "center", align: "center",
// fixed: "right", // fixed: "right",
scopedSlots: { customRender: "action" }, //引入的插槽 scopedSlots: { customRender: "action" }, //引入的插槽
customRender: (text) => { customRender: (text) => {
// console.log(text); // console.log(text);
@@ -1626,16 +1617,17 @@ export default {
arr.forEach((item) => { arr.forEach((item) => {
if (item.dictValue === state.pathBg) { if (item.dictValue === state.pathBg) {
state.pathBgId = item.dictCode; state.pathBgId = item.dictCode;
} }
}); });
//for (let i = 0; i < arr.length; i++) { //for (let i = 0; i < arr.length; i++) {
// console.log("arr[i].dictValue", arr[i].dictValue, state.pathBg); // console.log("arr[i].dictValue", arr[i].dictValue, state.pathBg);
// if (arr[i].dictValue === state.pathBg) { // if (arr[i].dictValue === state.pathBg) {
// state.pathBgId = arr[i].dictCode; // state.pathBgId = arr[i].dictCode;
// } // }
// } // }
} }
}) })
.catch((err) => { .catch((err) => {
@@ -1744,7 +1736,7 @@ export default {
state.searchdate = null; state.searchdate = null;
state.startTime = null; state.startTime = null;
state.endTime = null; state.endTime = null;
state.createUser = null; state.createUser=null;
getLearnPath(); getLearnPath();
}; };
@@ -1802,7 +1794,7 @@ export default {
// state.imgData = ; // state.imgData = ;
// } // }
}); });
const imgData = computed(() => store.state.pathmapPic); const imgData = computed(()=>store.state.pathmapPic)
//添加权限 //添加权限
watch( watch(
() => state.addAuthList, () => state.addAuthList,

View File

@@ -357,6 +357,7 @@ export default {
...res.data.data.projectInfo, ...res.data.data.projectInfo,
...state.projectInfo, ...state.projectInfo,
}; };
!routers.query.projectId && !!routers.query.parentId && (state.projectInfo.name = '')
state.projectInfo.rangeTime = [ state.projectInfo.rangeTime = [
state.projectInfo.beginTime, state.projectInfo.beginTime,
state.projectInfo.endTime, state.projectInfo.endTime,

View File

@@ -51,6 +51,7 @@
format="YYYY-MM-DD" format="YYYY-MM-DD"
style="border-radius: 8px; height: 40px; margin-left: 5px" style="border-radius: 8px; height: 40px; margin-left: 5px"
:placeholder="[' 开始时间', ' 结束时间']" :placeholder="[' 开始时间', ' 结束时间']"
/> />
</div> </div>
<div style="display: flex; margin-bottom: 20px"> <div style="display: flex; margin-bottom: 20px">
@@ -828,7 +829,7 @@ import { changeOwnership } from "@/api/method";
import NameInput from "@/components/project/NameInput"; import NameInput from "@/components/project/NameInput";
import { validateName } from "@/api/index1"; import { validateName } from "@/api/index1";
//import { toDate } from "../../api/method"; //import { toDate } from "../../api/method";
import { getStuPage } from "@/api/index1";
export default { export default {
name: "projectManage", name: "projectManage",
components: { components: {
@@ -1046,25 +1047,13 @@ export default {
state.projectTasks = res.data.data.tasks; state.projectTasks = res.data.data.tasks;
}); });
//获取学员总数 //获取学员总数
let obj = { api.projectStudentCount({
pageNo: 0,
pageSize: 0,
pid: object.projectId, pid: object.projectId,
type: 1, type:1
}; }).then((res) => {
getStuPage(obj) state.projectStudentsNum = res.data.data
.then((res) => {
if (res.data.code === 200) {
// console.log("res", res.data);
state.projectStudentsNum = res.data.data.total
? res.data.data.total
: 0;
state.projectPubLoading = false; state.projectPubLoading = false;
}
}) })
.catch((err) => {
console.log("获取学员人数失败", err);
});
//获取阶段及任务总数 //获取阶段及任务总数
}; };
//确认发布项目 //确认发布项目
@@ -1698,6 +1687,7 @@ export default {
state.searchParam.valueDate && state.searchParam.valueDate &&
state.searchParam.valueDate.length === 2 state.searchParam.valueDate.length === 2
? dayjs(state.searchParam.valueDate[0]).format("YYYY-MM-DD") ? dayjs(state.searchParam.valueDate[0]).format("YYYY-MM-DD")
: "", : "",
endTime: endTime:
state.searchParam.valueDate && state.searchParam.valueDate &&