mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-08 18:36:46 +08:00
专业力必修测试环境部署代码
This commit is contained in:
@@ -19,6 +19,10 @@ export const publishedTask = (id) => http.get(API_URL + '/professional/task/publ
|
||||
export const withdrawTask = (id) => http.get(API_URL + '/professional/task/withdrawal/' + id)
|
||||
//批量删除学习任务
|
||||
export const deleteTask = (ids) => http.get(API_URL + '/professional/task/delete/' + ids)
|
||||
|
||||
|
||||
//列表排序
|
||||
export const toSortTask = (ids) => http.get(API_URL + `/professional/task/sortTask/` + ids)
|
||||
//新增、编辑成长路径
|
||||
// export const addEdit = (obj) => http.post('/admin/grow/edit', obj)
|
||||
//编辑获取路径信息
|
||||
@@ -48,8 +52,7 @@ export const copyCreate = (obj) => http.post('/admin/grow/copy', obj)
|
||||
export const removeTask = (obj) => http.post(`/admin/grow/removeTask?growId=${obj.growId}&taskIdList=${obj.taskId}`)
|
||||
//改变选修必修
|
||||
export const isRequiredTask = (obj) => http.post(`/admin/grow/isRequiredTask?taskId=${obj.taskId}`)
|
||||
//列表排序
|
||||
export const toSortTask = (obj) => http.post(`/admin/grow/toSortTask?taskIdList=${obj}`)
|
||||
|
||||
//获取学员列表
|
||||
export const getGrowStudent = (obj) => http.get('/admin/student/getGrowStudent', { params: obj })
|
||||
//获取查看详情
|
||||
|
||||
@@ -278,8 +278,8 @@ const commonData = {
|
||||
const organizationalTree = []
|
||||
|
||||
//嵌套页面
|
||||
// const iframeUrl = window.location.protocol + process.env.VUE_APP_IFRAME_URL
|
||||
const iframeUrl = 'http://localhost:80/pc/iframe'
|
||||
const iframeUrl = window.location.protocol + process.env.VUE_APP_IFRAME_URL
|
||||
// const iframeUrl = 'http://localhost:80/pc/iframe'
|
||||
//学员端路由
|
||||
const studentUrl = window.location.protocol + process.env.VUE_APP_IFRAME_STUDENT_URL
|
||||
const teacherUrl = window.location.protocol + process.env.VUE_APP_IFRAME_TEACHER_URL
|
||||
|
||||
355
src/components/growthpath/CommonHomework.vue
Normal file
355
src/components/growthpath/CommonHomework.vue
Normal file
@@ -0,0 +1,355 @@
|
||||
<template>
|
||||
<div class="growth-homework">
|
||||
<div class="contentMain">
|
||||
<div class="main_left">
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img src="@/assets/images/coursewareManage/asterisk.png" alt="" />
|
||||
</div>
|
||||
<span style="margin-right: 3px">作业名称:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="formData.workName"
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入作业名称"
|
||||
autocomplete="off"
|
||||
show-count
|
||||
:maxlength="20"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img src="@/assets/images/coursewareManage/asterisk.png" alt="" />
|
||||
</div>
|
||||
<span style="margin-right: 3px">开始时间:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-range-picker
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
:show-time="{ format: 'hh:mm' }"
|
||||
v-model:value="dateTime"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
@change="timeChange"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item2">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img src="@/assets/images/coursewareManage/asterisk.png" alt="" />
|
||||
</div>
|
||||
<span style="margin-right: 3px">作业要求:</span>
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<a-textarea
|
||||
v-model:value="formData.workRequirement"
|
||||
placeholder="请输入作业要求"
|
||||
autocomplete="off"
|
||||
allow-clear
|
||||
:rows="6"
|
||||
show-count
|
||||
:maxlength="200"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mbl_items">
|
||||
<div class="item_nam">
|
||||
<span style="margin-right: 10px"></span>
|
||||
</div>
|
||||
<div class="item_inp">
|
||||
<FJUpload v-model:value="formData.workEnclosureAddress" />
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 100%; height: 80px"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_btns" style="background: #fff">
|
||||
<a-button class="btn2" @click="closeDrawer">取消</a-button>
|
||||
<a-button class="btn2" html-type="submit" @click="confirm">确定</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { defineEmits, defineProps, ref, watch, onMounted } from "vue";
|
||||
import FJUpload from "@/components/common/FJUpload";
|
||||
import { useResetRef } from "@/utils/useCommon";
|
||||
import { Form, message } from "ant-design-vue";
|
||||
import dayjs from "dayjs";
|
||||
const props = defineProps({
|
||||
info: {},
|
||||
});
|
||||
|
||||
const formData = useResetRef({
|
||||
workName: "",
|
||||
submitStartTime: "",
|
||||
submitEndTime: "",
|
||||
workRequirement: "",
|
||||
workEnclosureAddress: "",
|
||||
});
|
||||
const emit = defineEmits(["update:info", "close"]);
|
||||
const dateTime = ref([]);
|
||||
const rulesRef = ref({
|
||||
workName: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入作业名称",
|
||||
},
|
||||
],
|
||||
submitStartTime: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择开始时间",
|
||||
},
|
||||
],
|
||||
submitEndTime: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择结束时间",
|
||||
},
|
||||
],
|
||||
workRequirement: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入作业要求",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const { resetFields, validate } = Form.useForm(formData, rulesRef);
|
||||
|
||||
onMounted(() => {
|
||||
formData.value = props.info;
|
||||
props.info.submitStartTime &&
|
||||
(dateTime.value = [
|
||||
dayjs(formData.value.submitStartTime, "YYYY-MM-DD HH:mm"),
|
||||
dayjs(formData.value.submitEndTime, "YYYY-MM-DD HH:mm"),
|
||||
]);
|
||||
});
|
||||
const closeDrawer = () => {
|
||||
dateTime.value = [];
|
||||
emit("close");
|
||||
};
|
||||
|
||||
function timeChange(time, timeStr) {
|
||||
console.log(dateTime.value);
|
||||
formData.value.submitStartTime = timeStr[0];
|
||||
formData.value.submitEndTime = timeStr[1];
|
||||
}
|
||||
|
||||
async function confirm() {
|
||||
// 表单校验
|
||||
await validate().catch(({ errorFields }) => {
|
||||
message.warning(errorFields[0].errors.join());
|
||||
throw Error("数据校验不通过");
|
||||
});
|
||||
emit("update:info", formData.value);
|
||||
closeDrawer();
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.growth-homework {
|
||||
.contentMain {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.main_left {
|
||||
flex: 1;
|
||||
border-right: 1px solid #e8e8e8;
|
||||
margin-top: 0px !important;
|
||||
padding-right: 0px;
|
||||
|
||||
.main_item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 32px;
|
||||
margin-bottom: 32px;
|
||||
|
||||
.signbox {
|
||||
width: 120px;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
|
||||
.sign {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.btnbox {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
|
||||
.xkbtn {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
height: 40px;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-right: 8px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.mbl_items {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
margin-bottom: 10px;
|
||||
|
||||
.item_nam {
|
||||
width: 100px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
white-space: nowrap;
|
||||
|
||||
.asterisk_icon {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
margin-right: 5px;
|
||||
margin-top: -15px;
|
||||
}
|
||||
}
|
||||
|
||||
.item_inp {
|
||||
flex: 1;
|
||||
position: relative;
|
||||
margin-left: -25px;
|
||||
|
||||
.inp_num {
|
||||
position: absolute;
|
||||
left: 398px;
|
||||
top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main_item2 {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 32px;
|
||||
|
||||
.textarea {
|
||||
width: 373px;
|
||||
|
||||
.ant-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ant-input-textarea-show-count {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ant-input-textarea-show-count::after {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 0px;
|
||||
}
|
||||
|
||||
.ant-input {
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.signbox {
|
||||
width: 120px;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
|
||||
.sign {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.kqszbox {
|
||||
.qdqtbox {
|
||||
margin-left: 56px;
|
||||
}
|
||||
|
||||
.setbox {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 24px;
|
||||
|
||||
.timerbox {
|
||||
margin-top: 6px;
|
||||
margin-right: 32px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btnbox2 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
|
||||
.xkbtn {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
height: 40px;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-right: 16px 8px 32px 0;
|
||||
color: #fff;
|
||||
margin-top: 16px;
|
||||
margin-bottom: 60px;
|
||||
margin-left: 124px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main_btns {
|
||||
position: absolute;
|
||||
height: 72px;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
|
||||
|
||||
.btn1 {
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
border: 1px solid #4ea6ff;
|
||||
border-radius: 8px;
|
||||
color: #4ea6ff;
|
||||
background-color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-left: 15px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
744
src/components/growthpath/CommonTest.vue
Normal file
744
src/components/growthpath/CommonTest.vue
Normal file
@@ -0,0 +1,744 @@
|
||||
<template>
|
||||
<div class="common-test drawerStyle">
|
||||
<template v-if="step == 1">
|
||||
<diva
|
||||
style="
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
padding-top: 0px;
|
||||
margin-top: 20px;
|
||||
margin-left: 32px;
|
||||
"
|
||||
>
|
||||
<div>
|
||||
<button
|
||||
v-show="formData.examType === 1 || !formData.id"
|
||||
@click="changeExamType(1)"
|
||||
style="width: 100px; cursor: pointer"
|
||||
:class="formData.examType === 1 ? 'outer' : 'notOuter'"
|
||||
>
|
||||
系统考试
|
||||
</button>
|
||||
<button
|
||||
v-show="formData.examType === 2 || !formData.id"
|
||||
@click="changeExamType(2)"
|
||||
style="width: 100px; cursor: pointer"
|
||||
:class="formData.examType === 2 ? 'outer' : 'notOuter'"
|
||||
>
|
||||
外部考试
|
||||
</button>
|
||||
</div>
|
||||
</diva>
|
||||
|
||||
<div v-if="formData.examType === 1" class="contentMain">
|
||||
<div class="main_left">
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">考试名称:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="formData.examinationName"
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入考试名称"
|
||||
:maxlength="20"
|
||||
showCount
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">选择试卷:</span>
|
||||
</div>
|
||||
<div v-if="formData.examinationPaperId">
|
||||
<a-tag
|
||||
closable
|
||||
color="processing"
|
||||
@close="delTag"
|
||||
:closeIcon="true"
|
||||
>
|
||||
<span style="font-size: 14px; line-height: 33px">{{
|
||||
formData.examinationTestName
|
||||
}}</span>
|
||||
</a-tag>
|
||||
</div>
|
||||
<div class="btnbox" @click="selectTest">
|
||||
<button class="xkbtn" style="margin: 0">
|
||||
{{ formData.examinationPaperId ? "重选" : "选择" }}试卷
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">考试时间:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-range-picker
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
:show-time="{ format: 'hh:mm' }"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
valueFormat="YYYY-MM-DD HH:mm"
|
||||
v-model:value="dateTime"
|
||||
@change="timeChange"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">考试时长:</span>
|
||||
</div>
|
||||
<div class="select">
|
||||
<a-input-number
|
||||
:min="0"
|
||||
:max="999999"
|
||||
:precision="0"
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
v-model:value="formData.examinationDuration"
|
||||
></a-input-number>
|
||||
<span style="color: #999999; margin-left: 8px">分钟</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">及格线:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input-number
|
||||
min="0"
|
||||
v-model:value="formData.passLine"
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
/>
|
||||
|
||||
<span style="color: #999999; margin-left: 8px">分</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item2">
|
||||
<div class="signbox">
|
||||
<span style="margin-right: 3px">考试说明:</span>
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<a-textarea
|
||||
v-model:value="formData.examinationExplain"
|
||||
placeholder="请输入考试说明"
|
||||
show-count
|
||||
:maxlength="200"
|
||||
:rows="6"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item2">
|
||||
<div class="signbox">
|
||||
<span style="margin-right: 3px; margin-top: 10px"
|
||||
>考试限制:</span
|
||||
>
|
||||
</div>
|
||||
<div class="kqszbox">
|
||||
<div class="setbox">
|
||||
<div class="timerbox">
|
||||
<span>允许重复考试:</span>
|
||||
<a-input-number
|
||||
:min="-1"
|
||||
:max="999999"
|
||||
:precision="0"
|
||||
style="
|
||||
width: 100px;
|
||||
height: 32px;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
"
|
||||
v-model:value="formData.examinationLimit"
|
||||
></a-input-number>
|
||||
<span style="color: #999999; margin-left: 8px"
|
||||
>次,-1表示无限制</span
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<span style="margin-right: 3px">显示答案:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-radio-group
|
||||
style="margin-right: 12px"
|
||||
v-model:value="formData.showAnswers"
|
||||
>
|
||||
<a-radio :value="'1'">允许查看</a-radio>
|
||||
<a-radio :value="'2'">不允许查看</a-radio>
|
||||
</a-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<span style="margin-right: 3px">显示解析:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-radio-group
|
||||
style="margin-right: 12px"
|
||||
v-model:value="formData.showAnalysis"
|
||||
>
|
||||
<a-radio :value="'1'">允许查看</a-radio>
|
||||
<a-radio :value="'2'">不允许查看</a-radio>
|
||||
</a-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<span style="margin-right: 3px">评分模式:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-radio-group
|
||||
style="margin-right: 12px"
|
||||
v-model:value="formData.scoringModel"
|
||||
>
|
||||
<a-radio :value="'1'">最高一次</a-radio>
|
||||
<a-radio :value="'2'">最后一次</a-radio>
|
||||
</a-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<span style="margin-right: 3px">试题排列:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-radio-group
|
||||
style="margin-right: 12px"
|
||||
v-model:value="formData.questionArrangement"
|
||||
>
|
||||
<a-radio :value="'1'">试题乱序</a-radio>
|
||||
<a-radio :value="'2'">选项乱序</a-radio>
|
||||
<a-radio :value="'3'">全部乱序</a-radio>
|
||||
<a-radio :value="'4'">不乱序</a-radio>
|
||||
</a-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item" style="height: 20px"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="contentMain">
|
||||
<div class="main_left">
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">考试名称:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="formData.examinationName"
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入考试名称"
|
||||
:maxlength="20"
|
||||
showCount
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">数据来源:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="formData.source"
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入数据来源"
|
||||
show-count
|
||||
:maxlength="420"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item2">
|
||||
<div class="signbox">
|
||||
<span style="margin-right: 3px">考试说明:</span>
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<a-textarea
|
||||
v-model:value="formData.examinationExplain"
|
||||
placeholder="请输入考试说明"
|
||||
show-count
|
||||
:maxlength="200"
|
||||
:rows="6"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="main_btns">
|
||||
<a-button class="btn2" @click="closeDrawer">取消</a-button>
|
||||
<a-button class="btn2" @click="confirm">确定</a-button>
|
||||
</div>
|
||||
</template>
|
||||
<div v-show="step == 2">
|
||||
<GrowthSelectTest
|
||||
ref="GrowthSelectTestRef"
|
||||
:selectId="formData.examinationPaperId"
|
||||
@confirm="selectTestConfirm"
|
||||
@addTest="addTest"
|
||||
>
|
||||
</GrowthSelectTest>
|
||||
</div>
|
||||
<!-- 新建考试 -->
|
||||
<div class="iframe-container" v-if="step == 3">
|
||||
<iframe
|
||||
id="iframe"
|
||||
style="width: 100%; height: 100%; border: none"
|
||||
:src="iframeUrl + '/exam/papers?addnew=true'"
|
||||
name="myframe"
|
||||
sandbox="allow-forms allow-downloads allow-scripts allow-same-origin allow-popups"
|
||||
></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { defineEmits, defineProps, ref, watch, computed } from "vue";
|
||||
import GrowthSelectTest from "./GrowthSelectTest.vue";
|
||||
import { Form, message } from "ant-design-vue";
|
||||
import { useResetRef } from "@/utils/useCommon";
|
||||
import { iframeUrl } from "@/api/method";
|
||||
|
||||
const props = defineProps({
|
||||
info: {},
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
formData.value = props.info;
|
||||
props.info.submitStartTime &&
|
||||
(dateTime.value = [
|
||||
dayjs(formData.value.examinationStartTime, "YYYY-MM-DD HH:mm"),
|
||||
dayjs(formData.value.examinationEndTime, "YYYY-MM-DD HH:mm"),
|
||||
]);
|
||||
});
|
||||
// 步骤数
|
||||
const step = ref(1);
|
||||
const GrowthSelectTestRef = ref(null);
|
||||
// 选择试卷
|
||||
const selectTest = () => {
|
||||
step.value = 2;
|
||||
emit("nextStep", 6);
|
||||
};
|
||||
|
||||
//新增试卷
|
||||
const addTest = () => {
|
||||
step.value = 3;
|
||||
emit("nextStep", 7);
|
||||
};
|
||||
// 选择试卷完毕
|
||||
const selectTestConfirm = (data) => {
|
||||
step.value = step.value - 1;
|
||||
formData.value.examinationPaperId = data.id;
|
||||
formData.value.examinationTestName = data.testName;
|
||||
};
|
||||
|
||||
const setStep = (val) => {
|
||||
step.value = val;
|
||||
};
|
||||
const initValue = {
|
||||
examinationName: "",
|
||||
examinationPaperId: "",
|
||||
examinationStartTime: "",
|
||||
examinationEndTime: "",
|
||||
examinationDuration: null,
|
||||
passLine: "",
|
||||
examType: 1,
|
||||
source: "",
|
||||
showAnswers: "2",
|
||||
showAnalysis: "2",
|
||||
scoringModel: "2",
|
||||
questionArrangement: "4",
|
||||
externalExplain: "",
|
||||
examinationExplain: "",
|
||||
type: 14,
|
||||
targetId: props.growId,
|
||||
};
|
||||
const formData = useResetRef(initValue);
|
||||
const innerRule = {
|
||||
examinationName: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入考试名称",
|
||||
},
|
||||
],
|
||||
examinationPaperId: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入选择试卷",
|
||||
},
|
||||
],
|
||||
examinationStartTime: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入考试时间",
|
||||
},
|
||||
],
|
||||
examinationEndTime: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入考试时间",
|
||||
},
|
||||
],
|
||||
examinationDuration: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入考试时长",
|
||||
},
|
||||
],
|
||||
passLine: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入及格线",
|
||||
},
|
||||
],
|
||||
};
|
||||
const outerRule = {
|
||||
examinationName: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入考试名称",
|
||||
},
|
||||
],
|
||||
source: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入数据来源",
|
||||
},
|
||||
],
|
||||
};
|
||||
const rulesRef = ref(innerRule);
|
||||
const emit = defineEmits({});
|
||||
const dateTime = ref([]);
|
||||
|
||||
const { resetFields, validate } = Form.useForm(formData.value, rulesRef);
|
||||
watch(
|
||||
() => formData.value.examType,
|
||||
() => {
|
||||
formData.value.examType === 1
|
||||
? (rulesRef.value = innerRule)
|
||||
: (rulesRef.value = outerRule);
|
||||
}
|
||||
);
|
||||
const closeDrawer = () => {
|
||||
// 新增完试卷需要更新数据
|
||||
if (step.value == 3) {
|
||||
GrowthSelectTestRef.value.fetch();
|
||||
}
|
||||
if (step.value > 1) {
|
||||
step.value = step.value - 1;
|
||||
} else {
|
||||
formData.reset();
|
||||
dateTime.value = [];
|
||||
emit("close");
|
||||
}
|
||||
};
|
||||
|
||||
function timeChange(time, timeStr) {
|
||||
formData.value.examinationStartTime = timeStr[0];
|
||||
formData.value.examinationEndTime = timeStr[1];
|
||||
}
|
||||
|
||||
// 系统考试
|
||||
async function confirm() {
|
||||
if (formData.value.examinationName.trim() == "") {
|
||||
message.warning("请输入考试名称");
|
||||
return;
|
||||
}
|
||||
if (formData.value.source.trim() == "" && formData.value.examType != 1) {
|
||||
message.warning("请输入数据来源");
|
||||
return;
|
||||
}
|
||||
await validate().catch(({ errorFields }) => {
|
||||
message.warning(errorFields[0].errors.join());
|
||||
throw Error("数据校验不通过");
|
||||
});
|
||||
emit("update:info", { ...formData.value });
|
||||
closeDrawer();
|
||||
}
|
||||
|
||||
const delTag = () => {
|
||||
formData.value.examinationPaperId = "";
|
||||
formData.value.examinationTestName = "";
|
||||
};
|
||||
// 切换考试类型
|
||||
function changeExamType(v) {
|
||||
// formData.reset()
|
||||
formData.value.examType = v;
|
||||
}
|
||||
defineExpose({ setStep });
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.outer {
|
||||
background-color: #4ea6ff;
|
||||
color: #fff;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #a09292;
|
||||
height: 36px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.notOuter {
|
||||
color: #000;
|
||||
border-radius: 5px;
|
||||
border: 1px solid #a09292;
|
||||
background: #fff;
|
||||
margin-right: 10px;
|
||||
padding: 3px;
|
||||
}
|
||||
|
||||
.tag-style {
|
||||
color: rgb(113, 113, 237);
|
||||
background-color: #d7d1f7;
|
||||
}
|
||||
|
||||
.common-test {
|
||||
.ant-input-number-input-wrap > .ant-input-number-input {
|
||||
height: 40px !important;
|
||||
}
|
||||
.contentMain {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.main_left {
|
||||
padding-right: 30px;
|
||||
margin-top: 0px;
|
||||
flex: 1;
|
||||
border-right: 1px solid #e8e8e8;
|
||||
|
||||
.main_item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 32px;
|
||||
margin-bottom: 32px;
|
||||
|
||||
.signbox {
|
||||
width: 120px;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
|
||||
.sign {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.btnbox {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
|
||||
.xkbtn {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
height: 40px;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-right: 8px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main_item2 {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 32px;
|
||||
|
||||
.textarea {
|
||||
width: 400px;
|
||||
|
||||
.ant-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ant-input-textarea-show-count {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ant-input-textarea-show-count::after {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 0px;
|
||||
}
|
||||
|
||||
.ant-input {
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
.signbox {
|
||||
width: 120px;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
|
||||
.sign {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.kqszbox {
|
||||
.qdqtbox {
|
||||
margin-left: 56px;
|
||||
}
|
||||
|
||||
.setbox {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.timerbox {
|
||||
margin-top: 6px;
|
||||
margin-right: 32px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btnbox2 {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
|
||||
.xkbtn {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
height: 40px;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-right: 16px 8px 32px 0;
|
||||
color: #fff;
|
||||
margin-top: 16px;
|
||||
margin-bottom: 60px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
}
|
||||
|
||||
.main_btns {
|
||||
height: 72px;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
|
||||
|
||||
.btn1 {
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
border: 1px solid #4ea6ff;
|
||||
border-radius: 8px;
|
||||
color: #4ea6ff;
|
||||
background-color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-left: 15px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
.iframe-container {
|
||||
width: 100%;
|
||||
height: calc(100% - 100px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,5 +1,6 @@
|
||||
<!-- 评估列表 -->
|
||||
<template>
|
||||
<div class="growth-invist">
|
||||
<div class="contentMain">
|
||||
<div class="main_item">
|
||||
<div class="fi_input">
|
||||
<a-input
|
||||
@@ -29,37 +30,94 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="main_notice" style="display: none">
|
||||
<div class="mntc_left">
|
||||
<div class="notice_icon"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_table">
|
||||
<a-table
|
||||
:customRow="customRow"
|
||||
class="ant-table-striped"
|
||||
:row-class-name="(_, index) => (index % 2 === 1 ? 'table-striped' : null)"
|
||||
:row-class-name="
|
||||
(_, index) => (index % 2 === 1 ? 'table-striped' : null)
|
||||
"
|
||||
row-key="id"
|
||||
:columns="columns"
|
||||
:data-source="data"
|
||||
:loading="loading"
|
||||
:pagination="pagination"
|
||||
:row-selection="rowSelection"
|
||||
/>
|
||||
>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.dataIndex === 'select'">
|
||||
<a
|
||||
:style="{
|
||||
color: selectId == record.id ? '#999' : null,
|
||||
}"
|
||||
@click="confirm(record)"
|
||||
>选择</a
|
||||
>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="jsx">
|
||||
import { computed, defineEmits, defineProps, ref, watch } from "vue";
|
||||
import { defineEmits, defineProps, ref, computed } from "vue";
|
||||
import { Form, message } from "ant-design-vue";
|
||||
import { useResetRef } from "@/utils/useCommon";
|
||||
// import { useRouter } from "vue-router";
|
||||
import { useRowsPage } from "@/api/request";
|
||||
import { ASSESSMENT_PAGE } from "@/api/apis";
|
||||
|
||||
const emit = defineEmits(["confirm"]);
|
||||
const props = defineProps({
|
||||
id: String,
|
||||
name: String,
|
||||
selectId: Number,
|
||||
});
|
||||
const emit = defineEmits([]);
|
||||
const initParams = {
|
||||
assessmentName: "",
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
releaseStatus: 2,
|
||||
};
|
||||
// const router = useRouter();
|
||||
const params = ref(initParams);
|
||||
const { data, loading, total, fetch } = useRowsPage(
|
||||
ASSESSMENT_PAGE,
|
||||
params.value
|
||||
);
|
||||
const pagination = computed(() => ({
|
||||
total: total.value,
|
||||
showSizeChanger: false,
|
||||
current: params.value.pageNo,
|
||||
pageSize: params.value.pageSize,
|
||||
onChange: changePagination,
|
||||
}));
|
||||
|
||||
const changePagination = (e) => {
|
||||
params.value.pageNo = e;
|
||||
fetch();
|
||||
};
|
||||
|
||||
function search() {
|
||||
params.value.pageIndex = 1;
|
||||
fetch();
|
||||
}
|
||||
|
||||
function reset() {
|
||||
params.value.pageIndex = 1;
|
||||
params.value.keyWord = "";
|
||||
params.value.assessmentName = "";
|
||||
fetch();
|
||||
}
|
||||
|
||||
const goResearchmanage = () => {
|
||||
// router.push({ path: "/researchmanage" });
|
||||
window.open(process.env.VUE_APP_BASE + "/researchmanage?openCreate=true");
|
||||
};
|
||||
const columns = ref([
|
||||
{
|
||||
title: "选择",
|
||||
dataIndex: "select",
|
||||
key: "select",
|
||||
width: "100px",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "名称",
|
||||
dataIndex: "assessmentName",
|
||||
@@ -105,143 +163,26 @@ const columns = ref([
|
||||
ellipsis: true,
|
||||
},
|
||||
]);
|
||||
const initParams = {
|
||||
assessmentName: "",
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
releaseStatus: 2,
|
||||
};
|
||||
// const router = useRouter();
|
||||
const params = ref(initParams);
|
||||
|
||||
const rowSelectKeys = ref([]);
|
||||
const selectsData = ref([]);
|
||||
|
||||
const { data, loading, total, fetch } = useRowsPage(
|
||||
ASSESSMENT_PAGE,
|
||||
params.value
|
||||
);
|
||||
console.log(data);
|
||||
watch(
|
||||
() => props.id,
|
||||
() => {
|
||||
if (props.id) {
|
||||
rowSelectKeys.value = [props.id];
|
||||
selectsData.value = [{ id: props.id, assessmentName: props.name }];
|
||||
} else {
|
||||
rowSelectKeys.value = [];
|
||||
selectsData.value = [];
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const customRow = (record) => ({
|
||||
onClick: () => {
|
||||
rowSelectKeys.value = [record.id];
|
||||
selectsData.value = [record];
|
||||
emit("update:id", selectsData.value[0].id);
|
||||
emit("update:name", selectsData.value[0].assessmentName);
|
||||
},
|
||||
});
|
||||
|
||||
const pagination = computed(() => ({
|
||||
total: total.value,
|
||||
showSizeChanger: false,
|
||||
current: params.value.pageNo,
|
||||
pageSize: params.value.pageSize,
|
||||
onChange: changePagination,
|
||||
}));
|
||||
|
||||
const changePagination = (e) => {
|
||||
params.value.pageNo = e;
|
||||
fetch();
|
||||
};
|
||||
const rowSelection = computed(() => ({
|
||||
type: "radio",
|
||||
columnWidth: 20,
|
||||
selectedRowKeys: rowSelectKeys.value,
|
||||
onChange: onSelectChange,
|
||||
preserveSelectedRowKeys: true,
|
||||
getCheckboxProps: getCheckboxProps,
|
||||
}));
|
||||
const getCheckboxProps = () => ({
|
||||
// 某几项默认禁止选中(R: 当state等于1时)
|
||||
disabled: false,
|
||||
});
|
||||
|
||||
function onSelectChange(e, l) {
|
||||
rowSelectKeys.value = e;
|
||||
selectsData.value = l;
|
||||
emit("update:id", selectsData.value[0].id);
|
||||
emit("update:name", selectsData.value[0].assessmentName);
|
||||
async function confirm(record) {
|
||||
emit("confirm", record);
|
||||
}
|
||||
|
||||
function search() {
|
||||
params.value.pageIndex = 1;
|
||||
fetch();
|
||||
}
|
||||
|
||||
function reset() {
|
||||
rowSelectKeys.value = [];
|
||||
selectsData.value = [];
|
||||
params.value.pageIndex = 1;
|
||||
params.value.keyWord = "";
|
||||
params.value.assessmentName = "";
|
||||
fetch();
|
||||
}
|
||||
|
||||
const goResearchmanage = () => {
|
||||
// router.push({ path: "/researchmanage" });
|
||||
window.open(process.env.VUE_APP_BASE + "/researchmanage?openCreate=true");
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.xkbtn {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
height: 40px;
|
||||
margin-top: 32px;
|
||||
margin-bottom: 32px;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-right: 8px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.addinvistDrawer {
|
||||
.drawerMain {
|
||||
.header {
|
||||
height: 73px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.headerTitle {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
line-height: 25px;
|
||||
margin-left: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.growth-invist > .ant-drawer-content-wrapper {
|
||||
min-width: 1300px !important;
|
||||
width: 1300px !important;
|
||||
}
|
||||
.growth-invist {
|
||||
.contentMain {
|
||||
.main_left {
|
||||
padding-right: 30px;
|
||||
margin-top: 32px;
|
||||
|
||||
.main_item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
|
||||
margin-top: 20px;
|
||||
.fi_input {
|
||||
margin-right: 20px;
|
||||
}
|
||||
@@ -279,7 +220,7 @@ const goResearchmanage = () => {
|
||||
.btnsn {
|
||||
padding: 0px 26px 0px 26px;
|
||||
height: 38px;
|
||||
background: rgba(64, 158, 255, 1) !important;
|
||||
background: #ffffff;
|
||||
border-radius: 8px;
|
||||
border: 1px solid rgba(64, 158, 255, 1);
|
||||
display: flex;
|
||||
@@ -292,31 +233,20 @@ const goResearchmanage = () => {
|
||||
.search {
|
||||
width: 16px;
|
||||
height: 18px;
|
||||
background-image: url("../../assets/images/courseManage/reset0.png") !important;
|
||||
background-image: url("../../assets/images/courseManage/reset1.png");
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.btnText {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #fff !important;
|
||||
color: #4ea6ff;
|
||||
line-height: 36px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main_item2 {
|
||||
.pa {
|
||||
width: 100%;
|
||||
margin: 15px auto;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main_table {
|
||||
position: relative;
|
||||
padding-bottom: 80px;
|
||||
@@ -344,48 +274,6 @@ const goResearchmanage = () => {
|
||||
> td {
|
||||
background: #f6f9fd;
|
||||
}
|
||||
|
||||
.pa {
|
||||
left: 0;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
bottom: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.main_btns {
|
||||
height: 72px;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
|
||||
|
||||
.btn1 {
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
border: 1px solid #4ea6ff;
|
||||
border-radius: 8px;
|
||||
color: #4ea6ff;
|
||||
background-color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-left: 15px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -345,7 +345,6 @@ defineExpose({ openDrawer });
|
||||
> td {
|
||||
background: #f6f9fd;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div @click="openDrawer">
|
||||
<div @click="openDrawer()">
|
||||
<slot></slot>
|
||||
</div>
|
||||
<a-drawer
|
||||
@@ -11,9 +11,7 @@
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="headerTitle">
|
||||
{{ taskIndex >= 0 ? "编辑" : "添加" }}在线
|
||||
</div>
|
||||
<div class="headerTitle">{{ selectData.id ? "编辑" : "添加" }}在线</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@@ -36,83 +34,52 @@
|
||||
<script setup lang="jsx">
|
||||
import { computed, defineEmits, defineProps, ref, watch, onMounted } from "vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import { addOrEditTask, pagelist } from "@/api/growthpath";
|
||||
import { saveTask } from "@/api/growthpath";
|
||||
import { iframeUrl } from "@/api/method";
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
id: Number,
|
||||
taskList: [],
|
||||
growId: String,
|
||||
// 选秀2 必修1
|
||||
activeKey: String,
|
||||
});
|
||||
const visible = ref(false);
|
||||
const taskIndex = ref(-1);
|
||||
const rowSelectKeys = ref([]);
|
||||
const selectsData = ref([]);
|
||||
const selectData = ref({});
|
||||
const emit = defineEmits({});
|
||||
const closeDrawer = () => {
|
||||
visible.value = false;
|
||||
taskIndex.value = -1;
|
||||
selectsData.value = [];
|
||||
rowSelectKeys.value = [];
|
||||
editId.value = null;
|
||||
selectData.value = {};
|
||||
};
|
||||
function confirm() {
|
||||
if (!selectsData.value.length || !rowSelectKeys.value.length) {
|
||||
message.warning("请选择在线课!");
|
||||
return;
|
||||
}
|
||||
const params = {
|
||||
growId: props.growId,
|
||||
name: selectsData.value[0].name,
|
||||
type: props.type,
|
||||
courseId: selectsData.value[0].id,
|
||||
duration: "",
|
||||
taskId: editId.value,
|
||||
};
|
||||
let isTrue = true;
|
||||
props.taskList.forEach((taskId) => {
|
||||
if (taskId.courseId == params.courseId) {
|
||||
message.warning("该课程已存在");
|
||||
isTrue = false;
|
||||
}
|
||||
async function confirm(row) {
|
||||
console.log(row)
|
||||
debugger
|
||||
// 新增
|
||||
if (!selectData.value?.id) {
|
||||
await saveTask({
|
||||
growthId: props.growId,
|
||||
taskName: row.name,
|
||||
taskType: props.type,
|
||||
taskId: row.id,
|
||||
type: props.activeKey,
|
||||
});
|
||||
if (isTrue) {
|
||||
addOrEditTask(params).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
if (params.taskId) {
|
||||
message.success("编辑成功");
|
||||
} else {
|
||||
message.success("添加成功");
|
||||
}
|
||||
emit("dataListUp", true);
|
||||
} else {
|
||||
message.error(res.msg);
|
||||
}
|
||||
});
|
||||
// 编辑
|
||||
selectData.value.taskName = row.name;
|
||||
selectData.value.taskId = row.id;
|
||||
await saveTask(selectData.value);
|
||||
message.success("编辑成功");
|
||||
}
|
||||
closeDrawer();
|
||||
emit("refresh");
|
||||
}
|
||||
|
||||
function selectCourse(row) {
|
||||
console.log(row, "row");
|
||||
rowSelectKeys.value = [row.id];
|
||||
selectsData.value = [row];
|
||||
if (rowSelectKeys.value.length != 0) {
|
||||
confirm();
|
||||
}
|
||||
confirm(row);
|
||||
}
|
||||
const editId = ref(null);
|
||||
function openDrawer(i, row) {
|
||||
console.log(i, row, "i,row");
|
||||
function openDrawer(row) {
|
||||
window.selectCourse = selectCourse;
|
||||
row && (rowSelectKeys.value = [row.courseId]);
|
||||
row && (selectsData.value = [row.info]);
|
||||
i >= 0 && (taskIndex.value = i);
|
||||
row && (editId.value = row.id);
|
||||
if (props.taskList.length >= 14 && (row == undefined || row == null)) {
|
||||
message.error("最多可添加14个任务");
|
||||
return;
|
||||
}
|
||||
row && (selectData.value = [row.info]);
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
|
||||
1414
src/components/growthpath/GrowthOpenCourse.vue
Normal file
1414
src/components/growthpath/GrowthOpenCourse.vue
Normal file
File diff suppressed because it is too large
Load Diff
@@ -251,15 +251,13 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 面授课开课弹框 -->
|
||||
<AddOpenCourse ref="coursePlanRef" :type="2" />
|
||||
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, onMounted, ref, watch } from "vue";
|
||||
import { message } from "ant-design-vue";
|
||||
import { useRoute } from "vue-router";
|
||||
import AddOpenCourse from "@/components/drawers/AddOpenCourse.vue";
|
||||
import { TASK_TYPE } from "@/utils/constGrown";
|
||||
import dialog from "@/utils/dialog";
|
||||
import {
|
||||
@@ -341,20 +339,7 @@ const getListTask = () => {
|
||||
}
|
||||
});
|
||||
};
|
||||
watch(
|
||||
() => listDatas.value,
|
||||
(old, val) => {
|
||||
if (old.length == val.length) {
|
||||
const listIds = old.map((item) => item.id).join(",");
|
||||
// toSortTask(listIds).then((res) => {
|
||||
// if (res.data.code == 200) {
|
||||
// // message.success('排序成功')
|
||||
// }
|
||||
// });
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
|
||||
const basicData = ref({});
|
||||
const getBasicInfoData = () => {
|
||||
getBasicInfo({ growId: growId }).then((res) => {
|
||||
@@ -364,8 +349,6 @@ const getBasicInfoData = () => {
|
||||
}
|
||||
});
|
||||
};
|
||||
// 开课按钮
|
||||
const openCourse = (ele) => coursePlanRef.value.openDrawer(ele);
|
||||
|
||||
// 发布
|
||||
const published = (element) => {
|
||||
|
||||
@@ -419,6 +419,15 @@
|
||||
</a-tabs>
|
||||
</div>
|
||||
|
||||
<!-- 面授管理抽屉 开始 -->
|
||||
<ProjectFaceTaskManage
|
||||
:permissions="preId"
|
||||
:createId="createId"
|
||||
:type="2"
|
||||
v-model:visible="faceTeachModelVisible"
|
||||
:datasource="faceData"
|
||||
/>
|
||||
<!-- 面授管理抽屉 结束-->
|
||||
<!-- 查看学员 传入查看学员的id-->
|
||||
<seeStu
|
||||
v-model:Seevisible="Seevisible"
|
||||
@@ -522,7 +531,7 @@
|
||||
</div>
|
||||
|
||||
<!-- 面授课开课弹框 -->
|
||||
<AddOpenCourse ref="coursePlanRef" :type="2" />
|
||||
<GrowthOpenCourse ref="coursePlanRef" :type="2" />
|
||||
</template>
|
||||
<script lang="jsx">
|
||||
import { ref, reactive, toRefs, onMounted, createVNode, watch } from "vue";
|
||||
@@ -535,12 +544,13 @@ import GrowthExternalExamManage from "@/components/growthpath/GrowthExternalExam
|
||||
import GrowthExamManage from "@/components/growthpath/GrowthExamManage";
|
||||
import GrowthOnlineManage from "@/components/growthpath/GrowthOnlineManage";
|
||||
import CommonStudent from "@/components/student/CommonStudent";
|
||||
import AddOpenCourse from "@/components/drawers/AddOpenCourse.vue";
|
||||
import GrowthOpenCourse from "@/components/growthpath/GrowthOpenCourse.vue";
|
||||
import qrCode from "@/utils/growQrCode";
|
||||
import { fixDoublePer, checkGrowthPer } from "@/utils/utils";
|
||||
import dialog from "@/utils/dialog";
|
||||
import { TASK_TYPE } from "@/utils/constGrown";
|
||||
import Draggable from "vuedraggable";
|
||||
import ProjectFaceTaskManage from "../../components/drawers/project/ProjectFaceTaskManage";
|
||||
import GrowthHomeworkManage from "@/components/growthpath/GrowthHomeworkManage";
|
||||
import {
|
||||
getOverview,
|
||||
@@ -548,6 +558,7 @@ import {
|
||||
taskOutline,
|
||||
handleGrowth,
|
||||
getPublishInfo,
|
||||
toSortTask,
|
||||
} from "@/api/growthpath";
|
||||
export default {
|
||||
name: "pathManage",
|
||||
@@ -560,6 +571,8 @@ export default {
|
||||
CommonStudent,
|
||||
GrowthHomeworkManage,
|
||||
Draggable,
|
||||
ProjectFaceTaskManage,
|
||||
GrowthOpenCourse
|
||||
},
|
||||
setup() {
|
||||
const router = useRouter();
|
||||
@@ -593,7 +606,22 @@ export default {
|
||||
TASK_TYPE: TASK_TYPE,
|
||||
// 课程类型 1必修 2选修
|
||||
courseType: "1",
|
||||
// 面授管理
|
||||
faceTeachModelVisible: false,
|
||||
faceTeachModelVisibleTitle: "",
|
||||
faceData: {},
|
||||
});
|
||||
|
||||
watch(
|
||||
() => state.listTaskData,
|
||||
(old, val) => {
|
||||
if (old.length == val.length) {
|
||||
const listIds = old.map((item) => item.id).join(",");
|
||||
toSortTask(listIds)
|
||||
}
|
||||
},
|
||||
{ deep: true }
|
||||
);
|
||||
const resize = () => {
|
||||
dialog({
|
||||
content: "确定撤回?",
|
||||
@@ -733,6 +761,14 @@ export default {
|
||||
state.homeworkData = data;
|
||||
// 作业弹框名称 RouterHomeworkManage
|
||||
};
|
||||
// 面授课点击管理弹框
|
||||
const faceTeachModel = (data) => {
|
||||
console.log(data);
|
||||
state.faceTeachModelVisible = true;
|
||||
state.faceTeachModelVisibleTitle = data.name;
|
||||
state.faceData = data;
|
||||
// 面授课弹框名称 RouterFaceTeachManage
|
||||
};
|
||||
const showOnline = (item) => {
|
||||
console.log(item, "item");
|
||||
item.targetId = state.routerId;
|
||||
@@ -807,9 +843,9 @@ export default {
|
||||
});
|
||||
};
|
||||
// 开课按钮
|
||||
const coursePlanRef = ref()
|
||||
const coursePlanRef = ref();
|
||||
const openCourse = (ele) => {
|
||||
coursePlanRef.value.openDrawer(ele)
|
||||
coursePlanRef.value.openDrawer(ele);
|
||||
};
|
||||
return {
|
||||
...toRefs(state),
|
||||
@@ -832,7 +868,8 @@ export default {
|
||||
getListTask,
|
||||
fixDoublePer,
|
||||
checkGrowthPer,
|
||||
openCourse
|
||||
openCourse,
|
||||
faceTeachModel,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
@@ -19,8 +19,8 @@ module.exports = defineConfig({
|
||||
},
|
||||
proxy: {
|
||||
"/professional": {
|
||||
target: 'http://192.168.16.195:32002',
|
||||
// target: 'http://192.168.175.141:32002',
|
||||
// target: 'http://192.168.16.195:32002',
|
||||
target: 'http://192.168.175.141:32002',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
"^/manageApi/growth": "",
|
||||
|
||||
Reference in New Issue
Block a user