feat:合并

This commit is contained in:
lixg
2023-01-31 13:46:24 +08:00
9 changed files with 578 additions and 398 deletions

View File

@@ -19,3 +19,5 @@ export const IsExistenceProject = (obj) => http.post('/admin/project/queryTaskDo
// 判断当前在线课是否已经添加到该模板库下
export const IsExistenceProjectTemplate = (obj) => http.post('/admin/project/template/queryTaskDoesItExistForTemplate',obj);
// 新建外部考试
export const CreateExternalExam = (obj) => http.post('/external/exam/createExternalExam',obj);

View File

@@ -382,6 +382,13 @@ export default {
console.log("value", value, index);
};
const closeDrawer = () => {
state.selectedRowKeys = [];
state.tableDataTotalLoading = true;
state.currentPage = 1;
state.name = null;
state.projectName2 = undefined;
state.tableDataTotal = -1;
state.tableDataTotal2 = 0;
ctx.emit("update:AAvisible", false);
};
@@ -462,6 +469,7 @@ export default {
taskType: props.datasource.type,
status: state.projectName,
studentName: state.name,
signStatus: state.projectName2
})
.then((res) => {
console.log(res);
@@ -506,6 +514,7 @@ export default {
taskType: props.datasource.type,
status: state.projectName,
studentName: state.name,
signStatus: state.projectName2
})
.then((res) => {
console.log(res);
@@ -899,7 +908,7 @@ export default {
process.env.VUE_APP_BASE_API
}/admin/student/exportTaskStudent?currentStageId=${
props.datasource.chapterId
}&type=2&pid=${props.datasource.courseId}&thirdType=1&taskId=${props.datasource.routerTaskId}`
}&type=2&pid=${props.datasource.courseId}&thirdType=1&taskId=${props.datasource.routerTaskId}&taskType=${props.datasource.type}`
);
}else{
window.open(
@@ -907,7 +916,7 @@ export default {
process.env.VUE_APP_BASE_API
}/admin/student/exportTaskStudent?currentStageId=${
props.datasource.stageId
}&type=1&pid=${props.datasource.courseId}&thirdType=1&taskId=${props.datasource.projectTaskId}`
}&type=1&pid=${props.datasource.courseId}&thirdType=1&taskId=${props.datasource.projectTaskId}&taskType=${props.datasource.type}`
);
}

View File

@@ -303,7 +303,7 @@
</div>
<div class="btnbox">
<a-input
v-model:value="test1.examinationName"
v-model:value="test1.externalName"
style="width: 400px; height: 40px; border-radius: 8px"
placeholder="请输入考试名称"
:maxlength="20"
@@ -322,9 +322,9 @@
</div>
<div class="btnbox">
<a-input
v-model:value="test1.examinationName"
v-model:value="test1.source"
style="width: 400px; height: 40px; border-radius: 8px"
placeholder="请输入考试名称"
placeholder="请输入数据来源"
:maxlength="20"
/>
</div>
@@ -335,7 +335,7 @@
</div>
<div class="textarea">
<a-textarea
v-model:value="test1.examinationExplain"
v-model:value="test1.externalExplain"
placeholder="请输入考试说明"
allow-clear
show-count
@@ -369,7 +369,7 @@ import {
} from "@/api/indexExam";
// updateExamination,
import STest from "./SelectTest.vue";
import {ProjectEditTask, RouterEditTask} from "@/api/indexTask";
import {ProjectEditTask, RouterEditTask,CreateExternalExam} from "@/api/indexTask";
import {addTempTask} from "../../api/indexTaskadd";
import dayjs from "dayjs";
//import { toDate } from "@/api/method";
@@ -456,16 +456,9 @@ export default {
questionArrangement: 4,
},
test1: {
examinationName: '',
chooseTime: '',
examinationDuration: '',
passLine: '',
examinationExplain: null,
examinationLimit: null,
showAnswers: 1,
showAnalysis: 1,
scoringModel: 2,
questionArrangement: 4,
externalName: '',
source: '',
externalExplain: null
},
addLoading: false,
@@ -510,7 +503,7 @@ export default {
ctx.emit("update:addtestVisible", false);
ctx.emit("update:edit", false);
ctx.emit("update:EditTestId", state.EditTestId);
ctx.emit("update:testName", state.test.examinationName);
ctx.emit("update:testName", state.isOuter==1 ? state.test.examinationName : state.test1.externalName);
console.log("statetestName", state.test.examinationName);
localStorage.setItem("stageId", props.chooseStageId);
localStorage.setItem("chapterId", props.isactive);
@@ -570,95 +563,141 @@ export default {
});
};
const updateTest = () => {
if (!state.test.examinationName) {
message.destroy();
return message.warning("请输入考试名称");
}
if (!state.paperId) {
message.destroy();
return message.warning("请输入选择试卷");
}
if (!state.test.chooseTime) {
message.destroy();
return message.warning("请输入开始结束时间");
}
if (!state.test.examinationDuration) {
message.destroy();
return message.warning("请输入考试时长");
}
if (!state.test.passLine) {
message.destroy();
return message.warning("请输入及格线");
}
if(state.isOuter==1){
if (!state.test.examinationName) {
message.destroy();
return message.warning("请输入考试名称");
}
if (!state.paperId) {
message.destroy();
return message.warning("请输入选择试卷");
}
if (!state.test.chooseTime) {
message.destroy();
return message.warning("请输入开始结束时间");
}
if (!state.test.examinationDuration) {
message.destroy();
return message.warning("请输入考试时长");
}
if (!state.test.passLine) {
message.destroy();
return message.warning("请输入及格线");
}
state.addLoading = true;
console.log("test", state.test);
// state.test.examinationStartTime = toDate(
// new Date(state.test.chooseTime[0].$d).getTime() / 1000,
// "Y-M-D h:m"
// );
// state.test.examinationEndTime =toDate(
// new Date(state.test.$slotschooseTime[1].$d).getTime() / 1000,
// "Y-M-D h:m"
// );
(state.test.examinationStartTime = dayjs(state.test.chooseTime[0]).format(
"YYYY-MM-DD HH:mm"
)),
(state.test.examinationEndTime = dayjs(state.test.chooseTime[1]).format(
"YYYY-MM-DD HH:mm"
)),
(state.test.examinationPaperId = state.paperId);
//TODO缺少paperName字段
state.test.examinationTestName = state.paperName;
//考试推送
state.test.targetId = 0;
state.test.type = 0;
state.test.chapterId=0;
console.log("props.offCourseId",props.offCourseId);
if (props.faceLevel && props.offCourseId > 0) {
state.test.targetId = props.offCourseId;
state.test.type = 3;
}else{
if(props.isLevel == 1){
state.test.targetId = props.routerId;
state.test.chapterId = props.isactive;
state.test.type = 2;
} else if (props.isLevel == 2) {
state.test.targetId = props.projectId;
state.test.type = 1;
}
}
state.addLoading = true;
console.log("test", state.test);
// state.test.examinationStartTime = toDate(
// new Date(state.test.chooseTime[0].$d).getTime() / 1000,
// "Y-M-D h:m"
// );
// state.test.examinationEndTime =toDate(
// new Date(state.test.$slotschooseTime[1].$d).getTime() / 1000,
// "Y-M-D h:m"
// );
(state.test.examinationStartTime = dayjs(state.test.chooseTime[0]).format(
"YYYY-MM-DD HH:mm"
)),
(state.test.examinationEndTime = dayjs(state.test.chooseTime[1]).format(
"YYYY-MM-DD HH:mm"
)),
(state.test.examinationPaperId = state.paperId);
//TODO缺少paperName字段
state.test.examinationTestName = state.paperName;
//考试推送
state.test.targetId = 0;
state.test.type = 0;
state.test.chapterId=0;
console.log("props.offCourseId",props.offCourseId);
if (props.faceLevel && props.offCourseId > 0) {
state.test.targetId = props.offCourseId;
state.test.type = 3;
}else{
if(props.isLevel == 1){
state.test.targetId = props.routerId;
state.test.chapterId = props.isactive;
state.test.type = 2;
} else if (props.isLevel == 2) {
state.test.targetId = props.projectId;
state.test.type = 1;
}
}
// if (props.EditTestId > 0) {
// // 编辑任务
// updateExamination(state.test)
// .then(async (res) => {
// await updateTask(res);
// // closeDrawer();
// })
// .catch(() => {
// message.destroy();
// message.error(`编辑失败`);
// });
// } else {
// 创建任务
createExamination(state.test)
.then(async (res) => {
await updateTask(res);
// closeDrawer();
})
.catch(() => {
message.destroy();
message.error(`创建失败`);
});
// }
}else{
// 创建外部考试
console.log('我是点了外部考试')
if (!state.test1.externalName) {
message.destroy();
message.warning("请输入考试名称");
return
}
if (!state.test1.source) {
message.destroy();
message.warning("请输入数据来源");
return
}
//考试推送
state.test1.targetId = 0;
state.test1.type = 0;
state.test1.chapterId=0;
console.log("props.offCourseId",props.offCourseId);
if (props.faceLevel && props.offCourseId > 0) {
state.test1.targetId = props.offCourseId;
state.test1.type = 3;
}else{
if(props.isLevel == 1){
state.test1.targetId = props.routerId;
state.test1.chapterId = props.isactive;
state.test1.type = 2;
} else if (props.isLevel == 2) {
state.test1.targetId = props.projectId;
state.test1.type = 1;
// if (props.EditTestId > 0) {
// // 编辑任务
// updateExamination(state.test)
// .then(async (res) => {
// await updateTask(res);
// // closeDrawer();
// })
// .catch(() => {
// message.destroy();
// message.error(`编辑失败`);
// });
// } else {
// 创建任务
createExamination(state.test)
.then(async (res) => {
await updateTask(res);
// closeDrawer();
})
.catch(() => {
message.destroy();
message.error(`创建失败`);
});
// }
}
}
// 新建外部考试
CreateExternalExam(state.test1).then( async res=>{
console.log(res)
// 添加更新到任务
await updateTask1(res);
}).catch(err=>{
console.log(err)
})
}
};
// 系统考试
const updateTask = (res) => {
state.EditTestId = res.data.data.examinationId;
if (props.faceLevel) {
@@ -734,6 +773,81 @@ export default {
}
}
};
// 外部考试
const updateTask1 = (res) => {
state.EditTestId = res.data.data.externalId;
if (props.faceLevel) {
state.EditTestId = res.data.data.externalId;
state.paperName = "";
closeDrawer();
} else {
if (props.isLevel == 1) {
if (!props.isactive) {
message.destroy();
return message.warning("请先选中关卡");
}
let editObj1 = {
chapterId: props.isactive,
courseId: res.data.data.externalId,
name: res.data.data.externalName,
routerId: props.routerId,
routerTaskId: props.routerTaskId || 0,
type: 5,
};
RouterEditTask(editObj1)
.then(() => {
console.log("props.edit", props.edit);
message.success(`${props.edit ? "编辑" : "新增"}任务成功`);
ctx.emit("changeData", false);
state.paperName = "";
closeDrawer();
})
.catch(() => {
//message.error(`${props.edit ? "编辑" : "新增"}关卡任务失败`);
});
} else if (props.isLevel == 2) {
let editObj = {
courseId: res.data.data.externalId,
name: res.data.data.externalName,
projectId: props.projectId,
projectTaskId: props.projectTaskId || 0,
stageId: props.chooseStageId || 0,
type: 5,
};
// 新增编辑或新增项目
ProjectEditTask(editObj)
.then(() => {
message.success(`${props.edit ? "编辑" : "新增"}任务成功`);
ctx.emit("changeData", false);
state.paperName = "";
closeDrawer();
})
.catch(() => {
//message.error(`${props.EditTestId ? "编辑" : "新增"}阶段任务失败`);
});
} else if (props.isLevel == 3) {
addTempTask({
courseId: res.data.data.externalId,
name: res.data.data.externalName,
projectTemplateId: props.projectTemplateId,
projectTaskId: props.projectTaskId || 0,
stageId: props.chooseStageId || 0,
type: 5,
})
.then(() => {
message.success(`${props.edit ? "编辑" : "新增"}任务成功`);
ctx.emit("changeData", false);
state.paperName = "";
closeDrawer();
})
.catch(() => {
//message.error(`${props.EditTestId ? "编辑" : "新增"}阶段任务失败`);
});
}
}
};
const cloradio1 = (value) => {
if (value != "") {
state.showAnswers = "";

View File

@@ -11,7 +11,7 @@
<div class="drawerMain" id="ProjCheckship" style="">
<div class="header">
<div class="headerTitle">
{{ {1: "添加学员", 2: "添加学员", 3: "添加学员",4: "查看权",5: "管理权"}[type] || "" }}
{{ {1: "添加学员", 2: "添加学员", 3: "添加学员",4: "查看权",5: "管理权"}[type] || title }}
</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
@@ -99,7 +99,7 @@
</div>
</div>
</a-tab-pane>
<a-tab-pane :key="2" tab="添加组织">
<a-tab-pane v-if="!selectStu" :key="2" tab="添加组织">
<div :style="{ height: screenHeight - 235 + 'px' }">
<div class="tab2">
<a-form-item label="组织:">
@@ -146,7 +146,7 @@
</div>
</div>
</a-tab-pane>
<a-tab-pane :key="3" tab="受众关联">
<a-tab-pane v-if="!selectStu" :key="3" tab="受众关联">
<div :style="{ height: screenHeight - 235 + 'px' }">
<div>
<a-form-item label="受众名称:">
@@ -174,7 +174,7 @@
</div>
<div class="tableBox tabb">
<a-table
style="border: 1px solid #f2f6fe"
style="border: 1px solid #f2f6fe;width:800px"
row-key="id"
:columns="audiColums"
:data-source="audiData"
@@ -193,126 +193,94 @@
<div class="already">已选</div>
</div>
</div>
<div
class="selecteds"
:style="{ 'max-height': screenHeight - 235 + 'px' }"
style="overflow-y: auto"
>
<div class="person">快速选人</div>
<div v-for="(item, i) in selectsData.studentList">
<div v-if="i < 11">
<div class="chose">
{{ item.realName }}
<div class="ch" @click="stuDel(i)"></div>
</div>
</div>
<div v-else>
<div v-if="person">
<div :style="{ 'max-height': screenHeight - 235 + 'px' }" style="overflow-y: auto">
<div class="selecteds">
<div class="person">快速选人</div>
<div v-for="(item, i) in selectsData.studentList">
<div v-if="i < 11">
<div class="chose">
{{ item.realName }}
<div class="ch" @click="stuDel(i)"></div>
</div>
</div>
</div>
</div>
<div
v-if="!person && selectsData.studentList.length > 10"
class="ifsw"
>
<div @click="person = !person" class="“sw”">查看更多></div>
</div>
<div
v-if="person && selectsData.studentList.length > 10"
class="ifsw"
>
<div @click="person = !person" class="sw">收起&lt;</div>
</div>
<div class="dept">添加组织</div>
<div v-for="(item,i) in selectsData.deptList">
<div v-if="i<11">
<div class="chose1">
<div class="span"> {{ item.name }}</div>
<div class="ch1" @click="orgDel(i)"></div>
<div v-else>
<div v-if="person">
<div class="chose">
{{ item.realName }}
<div class="ch" @click="stuDel(i)"></div>
</div>
</div>
</div>
</div>
<div v-else>
<div v-if="dept">
<div
v-if="!person && selectsData.studentList.length > 10"
class="ifsw"
>
<div @click="person = !person" class="“sw”">查看更多></div>
</div>
<div
v-if="person && selectsData.studentList.length > 10"
class="ifsw"
>
<div @click="person = !person" class="sw">收起&lt;</div>
</div>
</div>
<div v-if="!selectStu" class="selecteds">
<div class="dept">添加组织</div>
<div v-for="(item,i) in selectsData.deptList">
<div v-if="i<11">
<div class="chose1">
<div class="span"> {{ item.name }}</div>
<div class="ch1" @click="orgDel(i)"></div>
</div>
</div>
</div>
</div>
<div v-if="!dept && selectsData.deptList.length >10" class="ifsw">
<div @click="dept = !dept" class=sw>查看更多></div>
</div>
<div v-if="dept && selectsData.deptList.length >10" class="ifsw">
<div @click="dept = !dept" class="sw"> 收起&lt;</div>
</div>
<!--受众-->
<div class="group">受众关联</div>
<div v-for="(item, i) in selectsData.groupList">
<div v-if="i < 11">
<div class="chose2">
<div class="span">{{ item.audienceName }}</div>
<div class="ch2" @click="AuditDel(i)"></div>
</div>
</div>
<div v-else>
<div v-if="group">
<div class="chose2">
<div class="span">{{ item.audienceName }}</div>
<div class="ch2" @click="AuditDel(i)"></div>
<div v-else>
<div v-if="dept">
<div class="chose1">
<div class="span"> {{ item.name }}</div>
<div class="ch1" @click="orgDel(i)"></div>
</div>
</div>
</div>
</div>
<div v-if="!dept && selectsData.deptList.length >10" class="ifsw">
<div @click="dept = !dept" class=sw>查看更多></div>
</div>
<div v-if="dept && selectsData.deptList.length >10" class="ifsw">
<div @click="dept = !dept" class="sw"> 收起&lt;</div>
</div>
</div>
<div
v-if="!group && selectsData.groupList.length > 10"
class="ifsw"
>
<div @click="group = !group" class="“sw”">查看更多></div>
</div>
<div v-if="group && selectsData.groupList > 10" class="ifsw">
<div @click="group = !group" class="sw">收起&lt;</div>
</div>
<!--受众-->
<div v-if="!selectStu" class="selecteds">
<div class="group">受众关联</div>
<div v-for="(item, i) in selectsData.groupList">
<div v-if="i < 11">
<div class="chose2">
<div class="span">{{ item.audienceName }}</div>
<div class="ch2" @click="AuditDel(i)"></div>
</div>
</div>
<div v-else>
<div v-if="group">
<div class="chose2">
<div class="span">{{ item.audienceName }}</div>
<div class="ch2" @click="AuditDel(i)"></div>
</div>
</div>
</div>
</div>
<div
v-if="!group && selectsData.groupList.length > 10"
class="ifsw"
>
<div @click="group = !group" class="“sw”">查看更多></div>
</div>
<div v-if="group && selectsData.groupList > 10" class="ifsw">
<div @click="group = !group" class="sw">收起&lt;</div>
</div>
</div>
</div>
</div>
<!-- <div style="padding:100px 0 0 20px;display: grid;grid-template-rows: auto auto auto;">
<div>
<div style="margin-top: 20px">快速选人</div>
// eslint-disable-next-line vue/require-v-for-key
<div v-for="(item,i) in selectsData.studentList" >
<a-tag v-if="i < 10" :closable="true" color="#4ea6ff" @close="stuDel(i)"
:key="i" style="margin-top:20px">
{{ item.realName }}
</a-tag>
<a-tag v-else :closable="true" color="#4ea6ff" @close="stuDel(i)"
style="margin-top:20px">
{{ item.realName }}
</a-tag>
<div></div>
</div>
</div>
<div>
<div style="margin-top: 20px">组织添加</div>
<a-tag :closable="true" color="#4ea6ff" @close="orgDel(i)" v-for="(item,i) in selectsData.deptList"
:key="i"
style="margin-top:20px">
{{ item.name }}
</a-tag>
</div>
<div>
<div style="margin-top: 20px">受众添加</div>
<a-tag :closable="true" color="#4ea6ff" @close="AuditDel(i)" v-for="(item,i) in selectsData.groupList"
:key="i" style="margin-top:20px">
{{ item.audienceName }}
</a-tag>
</div>
</div>-->
</div>
<div class="btnn">
<button class="btn1" @click="closeDrawer">取消</button>
@@ -419,6 +387,22 @@ const emit = defineEmits({});
const props = defineProps({
type: Number,
id: String,
title: {
type: String,
default: '',
},
clear: {
type: Boolean,
default: false,
},
selectStu: {
type: Boolean,
default: false,
},
selectOne: {
type: Boolean,
default: false,
},
stage: {
type: Array,
default: () => [],
@@ -577,6 +561,7 @@ const auditSelectKeys = ref([]);
const screenHeight = ref(document.body.clientHeight);
//const screenWidth = ref(document.body.clientWidth);
const stuRowSelection = computed(() => ({
type:props.selectOne?'radio':'checkbox',
columnWidth: 20,
selectedRowKeys: stuSelectKeys.value,
onChange: onStuSelectChange,
@@ -764,6 +749,7 @@ function handleStageOk() {
saveStu({
targetId: props.id,
type: props.type,
clear:props.clear,
deptIds: selectsData.value.deptList?.map((e) => e.id),
stageId: selectsData.value.stageId,
groupIds: selectsData.value.groupList?.map((e) => e.id),

View File

@@ -0,0 +1,47 @@
<!--
* @Author: lixg lixg@dongwu-inc.com
* @Date: 2023-01-31 13:41:35
* @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2023-01-31 13:45:07
* @FilePath: /fe-manage/src/components/student/OwnerTableModelStudent.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
<TableModelStudent :types="types" :id="id" ref="tableModelRef">
<template #extension="{ data: { record } }">
<CommonStudent
v-if="record.type === type"
:type="type"
:id="id"
@finash="submitCall"
:clear="true"
:select-stu="true"
:select-one="true"
>
<a-button type="link">转移归属权</a-button>
</CommonStudent>
</template>
<slot></slot>
</TableModelStudent>
</template>
<script setup>
import { defineProps, ref } from "vue";
import TableModelStudent from "@/components/student/TableModelStudent";
import CommonStudent from "@/components/student/CommonStudent";
const props = defineProps({
id: String,
type: Number,
types: {
type: Array,
default: () => [],
},
});
console.log("props", props.types);
const tableModelRef = ref();
function submitCall(flag) {
tableModelRef.value.loading = true;
flag && tableModelRef.value.searchStu();
}
</script>

View File

@@ -1,51 +1,61 @@
<template>
<div class="CommonStudent">
<a-drawer
:visible="visiable"
class="drawerStyle ProjCheckship"
placement="right"
width="40%"
:visible="visiable"
class="drawerStyle ProjCheckship"
placement="right"
width="40%"
>
<div class="drawerMain" id="ProjCheckship" style="">
<div class="header">
<div class="headerTitle">
权限名单
</div>
<div class="headerTitle">权限名单</div>
<img
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@click="closeDrawer"
style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png"
@click="closeDrawer"
/>
</div>
<div class="TableStudent">
<a-row
type="flex"
gutter="12"
style="padding-left: 20px; margin-right: 0px"
type="flex"
gutter="12"
style="padding-left: 20px; margin-right: 0px"
>
<a-col>
<a-form-item title="姓名:">
<a-input
class="cus-input"
v-model:value="searchParams.studentName"
placeholder="请输入姓名"
class="cus-input"
v-model:value="searchParams.studentName"
placeholder="请输入姓名"
/>
</a-form-item>
</a-col>
<a-col>
<a-button
class="cus-btn"
style="background: #4ea6ff; color: #fff; width: 100px"
@click="searchStu"
class="cus-btn"
style="background: #4ea6ff; color: #fff; width: 100px"
@click="searchStu"
>
<template #icon><img style="margin-right: 10px" src="../../assets/images/courseManage/search0.png"/>
<template #icon
><img
style="margin-right: 10px"
src="../../assets/images/courseManage/search0.png"
/>
</template>
搜索
</a-button>
</a-col>
<a-col :span="2">
<a-button class="cus-btn white" style="width: 100px" @click="reset">
<template #icon><img style="margin-right: 10px" src="../../assets/images/leveladd/reset.png"/>
<a-button
class="cus-btn white"
style="width: 100px"
@click="reset"
>
<template #icon
><img
style="margin-right: 10px"
src="../../assets/images/leveladd/reset.png"
/>
</template>
重置
</a-button>
@@ -53,16 +63,18 @@
</a-row>
<div style="margin-top: 20px">
<a-table
:columns="columns"
:data-source="studentList"
:pagination="stuPagination"
:loading="loading"
row-key="id"
:columns="columns"
:data-source="studentList"
:pagination="stuPagination"
:loading="loading"
row-key="id"
>
<template #action="{ record }">
<a-space :size="2">
<slot name="extension" v-bind:data="{ record }"></slot>
<a-button @click="del(record.id)" type="link" danger>删除</a-button>
<a-button @click="del(record.id)" type="link" danger
>删除</a-button
>
</a-space>
</template>
</a-table>
@@ -80,12 +92,19 @@
</div>
</template>
<script setup>
import {computed, createVNode, defineProps, ref, watch} from "vue";
import {usePage} from "@/api/request";
import {STUDENT_LIST} from "@/api/apis";
import {delStudentList} from "@/api/index1";
import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
import {Modal} from "ant-design-vue";
import {
computed,
createVNode,
defineProps,
defineExpose,
ref,
watch,
} from "vue";
import { usePage } from "@/api/request";
import { STUDENT_LIST } from "@/api/apis";
import { delStudentList } from "@/api/index1";
import { ExclamationCircleOutlined } from "@ant-design/icons-vue";
import { Modal } from "ant-design-vue";
const props = defineProps({
type: Number,
@@ -106,12 +125,12 @@ const initParams = {
studentName: "",
page: 1,
pageSize: 10,
type: props.type || '',
type: props.type || "",
types: props.types,
pid: props.id || '',
}
pid: props.id || "",
};
const searchParams = ref(initParams)
const searchParams = ref(initParams);
const columns = ref([
{
@@ -144,7 +163,8 @@ const columns = ref([
key: "type",
width: 30,
align: "center",
customRender: ({record: {type}}) => ({4: "查看权", 5: "管理权", 6: "归属权"}[type]),
customRender: ({ record: { type } }) =>
({ 4: "查看权", 5: "管理权", 6: "归属权" }[type]),
},
{
title: "操作",
@@ -152,11 +172,16 @@ const columns = ref([
key: "operation",
width: 50,
align: "center",
slots: {customRender: "action"},
slots: { customRender: "action" },
},
])
]);
const {data: studentList, fetch: searchStu, total, loading} = usePage(STUDENT_LIST, searchParams.value)
const {
data: studentList,
fetch: searchStu,
total,
loading,
} = usePage(STUDENT_LIST, searchParams.value);
const stuPagination = computed(() => ({
total: total,
@@ -176,14 +201,14 @@ const changePagination = (page) => {
function del(id) {
Modal.confirm({
title: () => '确定删除?',
title: () => "确定删除?",
icon: () => createVNode(ExclamationCircleOutlined),
content: () => '数据删除后不可恢复!',
okText: () => '确定',
okType: 'danger',
cancelText: () => '取消',
content: () => "数据删除后不可恢复!",
okText: () => "确定",
okType: "danger",
cancelText: () => "取消",
onOk() {
id && delStudentList({ids: [id]}).then(() => searchStu())
id && delStudentList({ ids: [id] }).then(() => searchStu());
},
});
}
@@ -192,14 +217,19 @@ const closeDrawer = () => {
visiable.value = false;
};
function reset(){
searchParams.value = initParams
searchStu()
function reset() {
searchParams.value = initParams;
searchStu();
}
watch(visiable, () => {
visiable.value && searchStu()
searchParams.value = initParams
visiable.value && searchStu();
searchParams.value = initParams;
});
defineExpose({
searchStu,
loading,
});
</script>
<style lang="scss">

View File

@@ -691,7 +691,7 @@
import { reactive, toRefs, onMounted, watch, computed } from "vue";
import { useRouter } from "vue-router";
import CommonStudent from "@/components/student/CommonStudent";
import TableModelStudent from "@/components/student/TableModelStudent";
import OwnerTableModelStudent from "@/components/student/OwnerTableModelStudent";
import ProjOwnerShip from "../../components/drawers/ProjectOwn";
import ProjPowerList from "../../components/drawers/ProjPowerList";
import ProjCheckShip from "../../components/drawers/ProjCheckPower";
@@ -700,7 +700,6 @@ import * as apiStu from "../../api/index";
import { message } from "ant-design-vue";
import {
commonData,
changeOwnership,
} from "@/api/method";
import { storage } from "@/api/storage";
import { useStore } from "vuex";
@@ -1254,7 +1253,7 @@ export default {
dropdownClassName="tabledropdown"
>
<a-select-option value="权限名单" label="权限名单">
<TableModelStudent types={[7,8,9]} id={text.record.id}>权限名单</TableModelStudent>
<OwnerTableModelStudent types={[7,8,9]} id={text.record.id} type={9}>权限名单</OwnerTableModelStudent>
</a-select-option>
<a-select-option value="查看权" label="查看权">
<CommonStudent type={7} id={text.record.id}>查看权</CommonStudent>
@@ -1497,15 +1496,6 @@ export default {
.catch((chapterErr) => {
console.log("关卡创建失败", chapterErr);
});
//添加归属权 [id: '966735050643083264', name: '丁舟航']
let selectPeopleArr = [
{ id: res.data.data.createId, name: res.data.data.createName },
];
changeOwnership(
"learnPath",
res.data.data.routerId,
selectPeopleArr
);
}
})
.catch((err) => {

View File

@@ -3,15 +3,14 @@
<div class="projectAdd">
<div class="header">
<span class="title"
>{{
projectInfo.projectId ? "编辑" : "创建"
>{{ projectInfo.projectId ? "编辑" : "创建"
}}{{ ptojectType == "3" ? "班级" : "项目" }}</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>
@@ -21,8 +20,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>
@@ -35,8 +34,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">
{{ ptojectType == 3 ? "班级名称" : "项目名称" }}
@@ -44,27 +43,27 @@
</div>
<div class="in">
<NameInput
placeholder="请输入项目名称"
v-model:value="projectInfo.name"
v-model:validate="projectInfo.validate"
:maxlength="30"
show-count
:id="projectInfo.projectId"
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;
@@ -72,19 +71,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>
@@ -92,65 +91,65 @@
<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="至"
:show-time="{ format: 'HH:mm' }"
:placeholder="[' 开始时间', ' 结束时间']"
:disabled-date="disabledDate"
v-model:value="projectInfo.rangeTime"
style="width: 100%; height: 40px; border-radius: 5px"
valueFormat="YYYY-MM-DD HH:mm"
@change="timeChange"
:disabled="viewDetail ? true : false"
separator="至"
:show-time="{ format: 'HH:mm' }"
:placeholder="[' 开始时间', ' 结束时间']"
:disabled-date="disabledDate"
v-model:value="projectInfo.rangeTime"
style="width: 100%; height: 40px; border-radius: 5px"
valueFormat="YYYY-MM-DD HH:mm"
@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:fullName="projectInfo.sourceBelongFullName"
v-model:value="projectInfo.sourceBelongId"
v-model:name="projectInfo.sourceBelongName"
v-model:fullName="projectInfo.sourceBelongFullName"
></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>
@@ -161,8 +160,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>
@@ -173,15 +172,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>
@@ -194,30 +193,28 @@
</div>
<div class="in ggysxz" v-if="courseSyncFlag">
<!-- :disabled="viewDetail ? true : false" -->
<a-checkbox
v-model:checked="courseSyncFlag"
disabled>
<a-checkbox v-model:checked="courseSyncFlag" disabled>
<span
style="
width: 100%;
color: rgba(109, 117, 132, 1);
font-size: 14px;
">
"
>
同步课程学习记录如学员在课程库中拥有课程的学习记录自动免修该课程
</span>
</a-checkbox>
</div>
<div class="in" v-else>
<!-- :disabled="viewDetail ? true : false" -->
<a-checkbox
v-model:checked="courseSyncFlag"
disabled>
<a-checkbox v-model:checked="courseSyncFlag" disabled>
<span
style="
width: 100%;
color: rgba(109, 117, 132, 1);
font-size: 14px;
">
"
>
同步课程学习记录如学员在课程库中拥有课程的学习记录自动免修该课程
</span>
</a-checkbox>
@@ -229,12 +226,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>
@@ -253,18 +250,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',
}"
@@ -278,35 +275,34 @@
<div class="btn">
<a-button @click="backPage" class="btn2">取消</a-button>
<a-button
:loading="loading"
v-on:click="createProject"
type="primary"
class="btn1"
style="margin-left: 20px"
>确定
:loading="loading"
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 { storage } from "../../api/storage";
import * as api2 from "../../api/indexAudit";
import {validateName} from "@/api/index1";
import { validateName } from "@/api/index1";
import dayjs from "dayjs";
import { scrollLoad } from "@/api/method";
export default {
name: "projectAdd",
components: {
@@ -369,17 +365,19 @@ 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 = {
...res.data.data.projectInfo,
...state.projectInfo,
};
!routers.query.projectId && !!routers.query.parentId && (state.projectInfo.name = '')
!routers.query.projectId &&
!!routers.query.parentId &&
(state.projectInfo.name = "");
state.projectInfo.rangeTime = [
state.projectInfo.beginTime,
state.projectInfo.endTime,
@@ -398,8 +396,8 @@ export default {
if (res.rows && res.rows.length > 0) {
let i = res.rows.length;
state.auditDescription = res.rows[i - 1].description
? res.rows[i - 1].description
: "-";
? res.rows[i - 1].description
: "-";
}
}
});
@@ -504,33 +502,29 @@ export default {
}
state.projectInfo.type = 3;
state.projectInfo.courseSyncFlag = state.courseSyncFlag ? 1 : 0;
state.loading = true
state.loading = true;
api.createProject(state.projectInfo).then((res) => {
state.loading = false
state.projectInfo.projectId ||
changeOwnership("project", res.data.data.projectId, [
{id: res.data.data.createId, name: res.data.data.createName},
]);
state.loading = false;
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);
});
};
function managerChange(e, l, d, t, orgName) {
console.log(e, l)
state.projectInfo.sourceBelongId = d
state.projectInfo.sourceBelongName = t
state.projectInfo.sourceBelongFullName = orgName
console.log(e, l);
state.projectInfo.sourceBelongId = d;
state.projectInfo.sourceBelongName = t;
state.projectInfo.sourceBelongFullName = orgName;
}
const disabledDate = (current) => {
return current && current < dayjs().startOf('day');
return current && current < dayjs().startOf("day");
};
return {
@@ -549,13 +543,12 @@ export default {
};
</script>
<style lang="scss">
.ggysxz {
.ant-checkbox-disabled.ant-checkbox-checked .ant-checkbox-inner::after {
border-color: #FFF !important;
border-color: #fff !important;
}
.ant-checkbox-disabled .ant-checkbox-inner {
background-color: #1890ff !important;
background-color: #1890ff !important;
}
}

View File

@@ -834,7 +834,6 @@ import TrainClass from "@/components/project/TrainClass";
import OrgClass from "@/components/project/OrgClass";
import dayjs from "dayjs";
import * as moment from "moment";
import { changeOwnership } from "@/api/method";
import NameInput from "@/components/project/NameInput";
import { validateName } from "@/api/index1";
import CommonStudent from "@/components/student/CommonStudent";
@@ -993,14 +992,11 @@ export default {
return message.warning("项目名称重复,请重新填写");
}
api.createProject(state.projectInfo).then((res) => {
console.log("res", res);
state.doublepro = false;
message.destroy();
message.success("创建成功");
state.currentPage = 1;
state.projectInfo.projectId ||
changeOwnership("project", res.data.data.projectId, [
{ id: res.data.data.createId, name: res.data.data.createName },
]);
getTableDate();
});
};
@@ -1512,17 +1508,30 @@ export default {
)}
{
<div className="tableSelect">
<a-select style="width: 50px;" value="授权" dropdownClassName="tabledropdown">
<a-select-option value="权限名单" label="权限名单">
<TableModelStudent types={[4,5,6]} id={value.record.projectId}>权限名单</TableModelStudent>
</a-select-option>
<a-select-option value="查看权" label="查看权">
<CommonStudent type={4} id={value.record.projectId}>查看权</CommonStudent>
</a-select-option>
<a-select-option value="管理权" label="管理权">
<CommonStudent type={5} id={value.record.projectId}>管理权</CommonStudent>
</a-select-option>
</a-select>
<a-select
style="width: 50px;"
value="授权"
dropdownClassName="tabledropdown"
>
<a-select-option value="权限名单" label="权限名单">
<TableModelStudent
types={[4, 5, 6]}
id={value.record.projectId}
>
权限名单
</TableModelStudent>
</a-select-option>
<a-select-option value="查看权" label="查看权">
<CommonStudent type={4} id={value.record.projectId}>
查看权
</CommonStudent>
</a-select-option>
<a-select-option value="管理权" label="管理权">
<CommonStudent type={5} id={value.record.projectId}>
管理权
</CommonStudent>
</a-select-option>
</a-select>
</div>
}
{value.record.type === 1 ? (