添加新功能

This commit is contained in:
yangjun 2024-07-30 20:39:43 +08:00
parent d3fc6ffb51
commit d08cc33ff4
16 changed files with 1358 additions and 85 deletions

View File

@ -78,6 +78,14 @@ const stuzy: AppRouteModule = {
title: '讨论区',
},
},
{
path: 'zyhp',
name: 'zyhp',
component: () => import('/@/views/zy/zyInfoStudentHp/ZyInfoStudentHpList.vue'),
meta: {
title: '作业互评',
},
},
]
}

View File

@ -19,6 +19,9 @@
<a-menu-item key="sub4">
<span @click="getGzt('dqzy')">课程作业</span>
</a-menu-item>
<!-- <a-menu-item key="sub8">
<span @click="getGzt('zyhp')">作业互评</span>
</a-menu-item> -->
<a-menu-item key="sub7">
<span @click="getGzt('kcjc')">课程测验</span>
</a-menu-item>
@ -112,6 +115,8 @@
href = "/stuzy/StudentGonggaoList";
}else if(zytype=='tlq'){//
href = "/stuzy/stuTlq";
}else if(zytype=='zyhp'){//
href = "/stuzy/zyhp";
}else if(zytype == 'stuJiaoXueDanYuanNeiRong'){//
router.push({ name: 'stuJiaoXueDanYuanNeiRong', query: { rwbh,xqxn,type,teano } });
return;

View File

@ -30,7 +30,7 @@
<template #bodyCell="{ column, record }">
<template v-if="column.key === 'score'">
<span>
<a-input-number v-model:value="record.score" :max="100" />
<a-input-number v-model:value="record.score" :max="100"> <template #addonAfter> % </template></a-input-number>
</span>
</template>
<template v-else-if="column.key === 'lstitle'">
@ -73,7 +73,7 @@
<a-button type="primary" @click="handleKcnr">选择</a-button>
</a-form-item>
</a-col>
<a-col :span="24" style="padding: 0 20px" v-if="dataKhnr.length>0">
<a-col :span="24" style="padding: 0 20px" v-if="dataKhnr.length > 0">
<a-table :columns="columnsKhnr" rowKey="id" :data-source="dataKhnr" :pagination="false" />
</a-col>
@ -130,40 +130,63 @@
</a-col>
<a-col :span="24">
<a-form-item label="学生互评">
<div class="tishi">温馨提示每份作业至少互评3次每个学生互评5份作业</div>
<j-dict-select-tag
type="radio"
v-model:value="zyInfo.xshpkg"
dictCode="yn"
placeholder="请选择是否允许学生查看"
style="margin-top: 15px"
@change="handleXshpkg"
/>
<a-form-item label="设置互评人数" :labelCol="labelCol3" :wrapperCol="wrapperCol2" style="margin-top: 20px">
<a-input-number v-model:value="zyInfo.xshprsq" placeholder="请设置互评人数" style="width: 60%" :max="100" :min="0">
<template #addonAfter></template>
</a-input-number>
</a-form-item>
<a-form-item label="互评开始时间" :labelCol="labelCol3" :wrapperCol="wrapperCol2">
<a-date-picker
placeholder="请选择互评开始时间"
v-model:value="zyInfo.xshpkssj"
:disabled-date="disabledDate"
:show-time="{ format: 'YYYY-MM-DD HH:mm' }"
valueFormat="YYYY-MM-DD HH:mm"
format="YYYY-MM-DD HH:mm"
style="width: 100%"
/>
</a-form-item>
<a-form-item label="互评开始时间" :labelCol="labelCol3" :wrapperCol="wrapperCol2">
<a-date-picker
placeholder="请选择互评开始时间"
v-model:value="zyInfo.xshpjssj"
:disabled-date="disabledDate"
:show-time="{ format: 'YYYY-MM-DD HH:mm' }"
valueFormat="YYYY-MM-DD HH:mm"
format="YYYY-MM-DD HH:mm"
style="width: 100%"
/>
</a-form-item>
<div v-if="zyInfo.xshpkg == '1'">
<a-form-item label="设置互评人数" :labelCol="labelCol3" :wrapperCol="wrapperCol3" style="margin-top: 20px">
<a-input-number v-model:value="zyInfo.xshprsq" placeholder="请设置互评人数" style="width: 60%" :max="100" :min="0">
<template #addonAfter></template>
</a-input-number>
</a-form-item>
<a-form-item label="互评成绩" :labelCol="labelCol3" :wrapperCol="wrapperCol3" style="margin-top: 20px">
<a-radio-group v-model:value="zyInfo.sfzzcj" style="width: 100%" size="default">
<a-radio :value="'1'" style="width: 100%; margin-bottom: 5px">互评成绩为最终成绩</a-radio>
<a-radio :value="'0'" style="width: 100%; margin-bottom: 5px">互评成绩作为教师评分的参考成绩</a-radio>
</a-radio-group>
</a-form-item>
<a-form-item label="是否允许学生看到互评成绩" :labelCol="labelCol4" :wrapperCol="wrapperCol4" style="margin-top: 20px">
<a-radio-group v-model:value="zyInfo.xssfck">
<a-radio :value="'1'" style="margin-top: 5px">(匿名)</a-radio>
<a-radio :value="'0'" style="margin-top: 5px"></a-radio>
</a-radio-group>
<!-- <j-dict-select-tag
type="radio"
v-model:value="zyInfo.xshpkg"
dictCode="yn"
placeholder="请选择是否允许学生查看"
style="margin-top: 15px"
/> -->
</a-form-item>
<a-form-item label="互评开始时间" :labelCol="labelCol3" :wrapperCol="wrapperCol3">
<a-date-picker
placeholder="请选择互评开始时间"
v-model:value="zyInfo.xshpkssj"
:disabled-date="disabledDate"
:show-time="{ format: 'YYYY-MM-DD HH:mm' }"
valueFormat="YYYY-MM-DD HH:mm"
format="YYYY-MM-DD HH:mm"
style="width: 100%"
/>
</a-form-item>
<a-form-item label="互评结束时间" :labelCol="labelCol3" :wrapperCol="wrapperCol3">
<a-date-picker
placeholder="请选择互评结束时间"
v-model:value="zyInfo.xshpjssj"
:disabled-date="disabledDate"
:show-time="{ format: 'YYYY-MM-DD HH:mm' }"
valueFormat="YYYY-MM-DD HH:mm"
format="YYYY-MM-DD HH:mm"
style="width: 100%"
/>
</a-form-item>
</div>
</a-form-item>
</a-col>
<a-col :span="24">
@ -256,21 +279,21 @@
<template #zgcclaction="{ record }">
<div v-if="record.alltgl">
<span v-if="record.filePath">
<template v-if="record.zgccl && record.zgccl!='0'">
<span v-if="record.zgccl<=record.alltgl" title="通过" style="color: #36b395;" @click="handleViewInfo(record)">{{record.zgccl}}</span>
<span v-else title="未通过" style="color:red;" @click="handleViewInfo(record)">{{record.zgccl}}</span>
<template v-if="record.zgccl && record.zgccl != '0'">
<span v-if="record.zgccl <= record.alltgl" title="通过" style="color: #36b395" @click="handleViewInfo(record)">{{
record.zgccl
}}</span>
<span v-else title="未通过" style="color: red" @click="handleViewInfo(record)">{{ record.zgccl }}</span>
</template>
<template v-else>查重中</template>
</span>
<span v-else>
未提交
</span>
<span v-else> 未提交 </span>
</div>
<div v-else>
<span>未设置查重</span>
</div>
</template>
<template #htmlSlot="{ text }">
<div v-html="text"></div>
</template>
@ -278,7 +301,8 @@
</a-col>
</a-row>
</div>
<div v-if="showType == 4"> <a-row>
<div v-if="showType == 4">
<a-row>
<a-col :span="24"><span class="title">查重相似度详情</span><a-divider /></a-col>
<a-col><a-button type="primary" @click="handleShowType(3)">返回</a-button></a-col>
<a-col :span="24">
@ -295,7 +319,6 @@
</a-row>
</div>
<div v-if="showType == 999">
<a-row>
<a-col :span="24"><span class="title">布置作业</span><a-divider /></a-col>
@ -316,7 +339,7 @@
<a @click="handleDelete(item)">删除</a>
</div>
</a-card>
<a-card :title="'第' + item.sort + '次作业(占比' + item.score + '%)'" v-if="item.endTime && item.zyStatus == 1" class="cardClass">
<a-card :title="'第' + item.sort + '次作业(占比' + item.score + '%)'" v-if="item.endTime && item.zyStatus == '1'" class="cardClass">
<template #extra> 已发布 </template>
<div
><span style="float: left; width: 70%" class="ellipsis" :title="item.title">作业名称{{ item.title }}</span
@ -337,24 +360,24 @@
></div
>
<div style="text-align: center; margin-top: 30px; width: 100%">
<a @click="handleEdit(item, false)">编辑作业</a>
<a @click="handleEdit(item, true)">编辑作业</a>
<a-divider type="vertical" />
<a @click="handleZyxx(item, '')">查看作业</a>
<a-divider type="vertical" />
<a @click="handleDelete(item)">删除</a>
</div>
</a-card>
<a-card :title="'第' + item.sort + '次作业(占比' + item.score + '%)'" v-if="item.endTime && item.zyStatus == 0" class="cardClass">
<a-card :title="'第' + item.sort + '次作业(占比' + item.score + '%)'" v-if="item.endTime && item.zyStatus == '0'" class="cardClass">
<template #extra> 待发布 </template>
<div
><span style="float: left; width: 70%" class="ellipsis" :title="item.title">作业名称{{ item.title }}</span
><span style="float: left; width: 70%" class="ellipsis" :title="item.title">作业名称{{ item.title }}</span
><a style="float: right; width: 30%; text-align: right" @click="openXkrs(item)">{{ item.xkxs }}人选课</a></div
>
<div>作业发布时间{{ item.startTime ? dayjs(item.startTime).format('YYYY.MM.DD HH:mm') : '未设置' }}</div>
<div>作业截止时间{{ dayjs(item.endTime).format('YYYY.MM.DD HH:mm') }}</div>
<div style="height: 45px">&nbsp;</div>
<div style="text-align: center; margin-top: 30px">
<a @click="handleEdit(item, true)">编辑作业</a>
<a @click="handleEdit(item, false)">编辑作业</a>
<a-divider type="vertical" />
<a @click="handleFabu(item)">发布作业</a>
<a-divider type="vertical" />
@ -491,8 +514,12 @@ const disabledDate = (current: Dayjs) => {
};
const useForm = Form.useForm;
function handleXshpkg(record) {
console.log('👨‍👧‍👦', record);
}
//
function handleViewInfo(record){
function handleViewInfo(record) {
defHttp.get({ url: '/zyCcjg/zyCcjg/ccjglist', params: { zyStuId: record.id } }).then((res) => {
console.log('🤦‍♀️', res);
tableCcjgData.value = res;
@ -500,16 +527,16 @@ function handleViewInfo(record){
handleShowType(4);
}
//
function handleOpenLwxx(record){
window.open(record.paperviewurl,"_blank");
function handleOpenLwxx(record) {
window.open(record.paperviewurl, '_blank');
}
//
function handleCheckZcjcSuccess(record) {
console.log('🙅‍♂️', record);
console.log('🙅‍♂️', record[0]);
var kcnr = "";
kcnr = kcnr?kcnr:'';
var kcnr = '';
kcnr = kcnr ? kcnr : '';
for (var i = 0; i < record.length; i++) {
kcnr = kcnr + record[i] + ',';
}
@ -519,20 +546,19 @@ function handleCheckZcjcSuccess(record) {
zyInfo.value.kcnr = kcnr;
console.log('💑', kcnr);
if(kcnr){
if (kcnr) {
defHttp.get({ url: '/teachingunitcontent/kcTeachingUnitContentOne/getAllList', params: { id: kcnr } }).then((res) => {
console.log('🤦‍♀️', res);
dataKhnr.value = res;
});
}else{
} else {
dataKhnr.value = [];
}
}
//
function handleKcnr() {
registerZcjcModal.value.disableSubmit = true;
registerZcjcModal.value.disableSubmit = false;
registerZcjcModal.value.init({ rwbh, xnxq: xqxn, createBy: teano });
// defHttp.get({ url: '/teachingunitcontent/kcTeachingUnitContentOne/getAllList', params: { rwbh, xnxq: xqxn, createBy: teano } }).then((res) => {
// console.log('🤦', res);
@ -545,13 +571,16 @@ function handleKcnr() {
*/
function searchQueryZyxq() {
selectedRowKeys.value = [];
queryParam.value.mainId = zyInfo.value.id;
queryParam.value.queryType = queryType.value;
reload();
}
//
function handleAddOne() {
defHttp.post({ url: '/zyInfo/zyInfo/addOne', params: { rwbh, xnxq: xqxn, teano } }).then((res) => {
handleSuccess();
handleSuccess2();
});
}
@ -661,8 +690,26 @@ async function batchHandleFabu() {
createMessage.warn('请勾选要发布的数据!');
return;
}
await batchFabu({ ids: selectedRowKeys.value }, handleSuccess);
var datapar2 = rowSelection.selectedRows;
console.log('👌', datapar2);
var sfjx = '0';
for (var i = 0; i < datapar2.length; i++) {
var score = datapar2[i].score;
if (!score) {
sfjx = '1';
break;
}
}
if (sfjx == '1') {
createMessage.warning('您有未填写的评分信息,不可一键发布,请检查您的评分数据!');
return;
} else {
await batchFabu({ ids: selectedRowKeys.value }, handleSuccess2);
}
}
//
//
const validatorRules = {
title: [{ required: true, message: '请输入作业名称!' }],
@ -689,6 +736,12 @@ const labelCol3 = reactive({
const wrapperCol3 = reactive({
sm: { span: 20 },
});
const labelCol4 = reactive({
sm: { span: 8 },
});
const wrapperCol4 = reactive({
sm: { span: 14 },
});
//
function handleZyyqShow(type) {
if (type == 1) {
@ -708,6 +761,7 @@ function handlePfbzShow(type) {
//
function handleSzzynr(record) {
zyInfo.value = record;
dataKhnr.value = [];
handleShowType(2);
}
//
@ -890,7 +944,7 @@ const columnsCcjg = [
dataIndex: 'ccType',
key: 'ccType',
customRender: (text) => {
return "是";
return '是';
},
},
{
@ -948,10 +1002,11 @@ function handleAdd() {
*/
function handleEdit(record, type) {
editDisabled.value = type;
console.log('👨‍👨‍👧‍👧', editDisabled);
zyInfo.value = record;
dataKhnr.value = [];
var kcnr = zyInfo.value.kcnr;
if(kcnr){
if (kcnr) {
defHttp.get({ url: '/teachingunitcontent/kcTeachingUnitContentOne/getAllList', params: { id: kcnr } }).then((res) => {
console.log('🤦‍♀️', res);
dataKhnr.value = res;
@ -975,6 +1030,7 @@ function handleDetail(record: Recordable) {
//
function handleZyxx(record, type) {
zyInfo.value = record;
handleShowType(3);
queryType.value = type;
queryParam.value = {};
@ -1040,12 +1096,12 @@ function handleSuccess2() {
* 成功回调用于增加修改发布和撤回
*/
function handleSuccess() {
reloadZy();
searchQueryZyxq();
}
function handleZySuccess(zyid) {
setTimeout(() => {
handleSuccess();
handleSuccess2();
}, 1500);
var url = '/zyInfo/zyInfo/editStudent';
defHttp.get({ url: url, params: { id: zyid } }).then((res) => {});
@ -1065,7 +1121,7 @@ function searchQuery() {
function searchReset() {
queryParam.value = {};
total.value = 1;
handlePageChange(1);
searchQueryZyxq();
}
//
@ -1118,7 +1174,7 @@ onMounted(() => {
.tishi {
font-size: 12px;
color: #adabab;
margin-top: 50px;
margin-top: 8px;
}
.cardClass {
min-height: 200px;

View File

@ -3,9 +3,81 @@
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24">
<span class="spana">作业名称{{formData.title}}</span>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24">
<a-form-item label="作业题目">
{{formData.title}}
</a-form-item>
</a-col>
<a-col :span="24" v-if="dataKhnr.length > 0">
<a-form-item label="考察内容">
<a-table :columns="columnsKhnr" rowKey="id" :data-source="dataKhnr" :pagination="false" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="作业截止时间" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
{{formData.endTime}}
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="作业发布时间" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
{{formData.startTime}}
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="作业要求" >
<div v-html="formData.content"></div>
</a-form-item>
</a-col>
<a-col :span="24" v-if="formData.filePath">
<a-form-item label="参考资料" >
<a-button type="primary" style="margin-left: 10px" @click="downLoad(formData.filePath)">下载</a-button>
</a-form-item>
</a-col>
<a-col :span="24" v-show="formData.sturead=='1' && formData.pfbz">
<a-form-item label="评分标准" layout="inline">
<div v-html="formData.pfbz"></div>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="查重设置" layout="inline">
<a-form-item label="检测通过率" :labelCol="labelCol3" :wrapperCol="wrapperCol3">
<span style="padding: 7px 20px"></span>
<a-input-number
v-model:value="formData.wwtgl"
placeholder="检测通过率"
style="width: 60%"
:max="100"
:min="0"
disabled
>
<template #addonAfter> % </template>
</a-input-number>
</a-form-item>
<a-form-item label="比对库设置" :labelCol="labelCol3" :wrapperCol="wrapperCol3">
<div style="padding: 7px 20px">维普</div>
<div style="padding: 0 40px">
<a-checkbox v-model:checked="formData.wwcc" style="margin-left: 10px" disabled
>维普资源库查重中文科技期刊数据库硕博学位论文库高校特色论文库互联网数据资源/互联网文档资源</a-checkbox
>
<a-checkbox v-model:checked="formData.xncc" disabled>学校作业库查重历届学生提供的作业库内查重</a-checkbox>
<a-checkbox v-model:checked="formData.nwcc" disabled>本次作业查重本次学生提交的作业间查重</a-checkbox>
</div>
<div style="padding: 7px 20px">AIGC</div>
<div style="padding: 0 40px">
<a-checkbox v-model:checked="formData.aigccc" style="margin-left: 10px" disabled
>AIGC查重检测作业是否部分或全部由AI模型生成</a-checkbox
>
</div>
</a-form-item>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-col>
<a-col :span="24">
<!-- <a-col :span="24">
<span class="spana">作业分值{{formData.score?formData.score:'未填写'}}</span>
</a-col>
<a-col :span="24">
@ -38,7 +110,7 @@
</a-col>
<a-col :span="12">
<span class="spana">是否校内查重{{formData.xncc=='0'?'否':'是'}}</span> <span class="spanb">网络通过率{{formData.xntgl?formData.xntgl+"%":'未配置'}}</span>
</a-col>
</a-col> -->
</a-row>
</a-form>
</a-spin>
@ -55,6 +127,7 @@
import { useRouter } from 'vue-router';
import dayjs, { Dayjs } from 'dayjs';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import {getFileAccessHttpUrl} from "/@/utils/common/compUtils";
import { downloadFile } from '/@/utils/common/renderUtils';
//
@ -69,6 +142,7 @@
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const dataKhnr = ref<any>([]);
const formData = reactive<Record<string, any>>({
id: '',
title: '',
@ -88,10 +162,25 @@
xntgl: undefined,
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 6 } });
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 3 } });
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 20 } });
// const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 3 } });
// const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 20 } });
const labelCol2 = reactive({
sm: { span: 10 },
});
const wrapperCol2 = reactive({
sm: { span: 10 },
});
const labelCol3 = reactive({
sm: { span: 4 },
});
const wrapperCol3 = reactive({
sm: { span: 20 },
});
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
@ -125,6 +214,40 @@
});
const columnsKhnr = [
{
title: '序号',
dataIndex: 'no',
key: 'no',
customRender: (text) => {
return text.index + 1;
},
width: 80,
},
{
title: '章次',
dataIndex: 'title',
key: 'title',
},
{
title: '节次',
dataIndex: 'twoTitle',
key: 'twoTitle',
},
];
function downLoad(file) {
if (file) {
let url = getFileAccessHttpUrl(file);
if (url) {
window.open(url);
}
} else {
createMessage.warning('暂无文件或文件上传中');
}
}
/**
* 新增
*/
@ -140,6 +263,7 @@
resetFields();
//
Object.assign(formData, record);
handleKcnr(formData.kcnr);
});
}
@ -211,6 +335,17 @@
});
}
//
function handleKcnr(kcnr) {
if(kcnr){
defHttp.get({ url: '/teachingunitcontent/kcTeachingUnitContentOne/getAllList', params: { id: kcnr } }).then((res) => {
console.log('🤦‍♀️', res);
dataKhnr.value = res;
});
}else{
dataKhnr.value = [];
}
}
defineExpose({
add,

View File

@ -4,7 +4,7 @@
<BasicTable @register="registerTable" :rowSelection="rowSelection">
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 确认</a-button>
<!-- <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 确认</a-button> -->
<!-- <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
@ -198,8 +198,18 @@ function init(record) {
reload();
}
/**
* 提交数据
*/
async function submitForm() {
var ids = selectedRowKeys.value;
console.log('😘', ids);
emit('ok',ids);
}
defineExpose({
init,
submitForm,
});
</script>

View File

@ -96,7 +96,7 @@ export const newcolumns: BasicColumn[] = [
title: '最高查重率',
align: "center",
dataIndex: 'zgccl',
sorter: true,
// sorter: true,
slots: { customRender: 'zgcclaction' },
},

View File

@ -2,14 +2,93 @@
<a-spin :spinning="confirmLoading">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24" style=";padding: 30px 0 0 75px;">
<a-col :span="24">
<a-col :span="24">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24">
<a-form-item label="作业题目">
{{zyInfo.title}}
</a-form-item>
</a-col>
<a-col :span="24" v-if="dataKhnr.length > 0">
<a-form-item label="考察内容">
<a-table :columns="columnsKhnr" rowKey="id" :data-source="dataKhnr" :pagination="false" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="作业截止时间" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
{{zyInfo.endTime}}
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="作业发布时间" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
{{zyInfo.startTime}}
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="作业要求" >
<div v-html="zyInfo.content"></div>
</a-form-item>
</a-col>
<a-col :span="24" v-if="zyInfo.filePath">
<a-form-item label="参考资料" >
<a-button type="primary" style="margin-left: 10px" @click="downLoad(zyInfo.filePath)">下载</a-button>
</a-form-item>
</a-col>
<a-col :span="24" v-show="zyInfo.sturead=='1' && zyInfo.pfbz">
<a-form-item label="评分标准" layout="inline">
<div v-html="zyInfo.pfbz"></div>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="查重设置" layout="inline">
<a-form-item label="检测通过率" :labelCol="labelCol3" :wrapperCol="wrapperCol3">
<span style="padding: 7px 20px"></span>
<a-input-number
v-model:value="zyInfo.wwtgl"
placeholder="检测通过率"
style="width: 60%"
:max="100"
:min="0"
disabled
>
<template #addonAfter> % </template>
</a-input-number>
</a-form-item>
<a-form-item label="比对库设置" :labelCol="labelCol3" :wrapperCol="wrapperCol3">
<div style="padding: 7px 20px">维普</div>
<div style="padding: 0 40px">
<a-checkbox v-model:checked="zyInfo.wwcc" style="margin-left: 10px" disabled
>维普资源库查重中文科技期刊数据库硕博学位论文库高校特色论文库互联网数据资源/互联网文档资源</a-checkbox
>
<a-checkbox v-model:checked="zyInfo.xncc" disabled>学校作业库查重历届学生提供的作业库内查重</a-checkbox>
<a-checkbox v-model:checked="zyInfo.nwcc" disabled>本次作业查重本次学生提交的作业间查重</a-checkbox>
</div>
<div style="padding: 7px 20px">AIGC</div>
<div style="padding: 0 40px">
<a-checkbox v-model:checked="zyInfo.aigccc" style="margin-left: 10px" disabled
>AIGC查重检测作业是否部分或全部由AI模型生成</a-checkbox
>
</div>
</a-form-item>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-col>
</a-col>
<!-- <a-col :span="24" style="padding: 30px 0 0 75px;">
<div style="line-height:40px;">作业名称{{zyInfo.title}}</div>
<div style="line-height:40px;">作业要求{{zyInfo.content?zyInfo.content:'无'}}</div>
<div style="line-height:40px;">作业要求<span v-html="zyInfo.content?zyInfo.content:'无'"></span></div>
<div style="line-height:40px;">上传时间{{zyInfo.startTime}} ~ {{zyInfo.endTime}}</div>
<div style="line-height:40px;">上传时间{{zyInfo.startTime}} ~ {{zyInfo.endTime}}</div>
<div style="line-height:40px;">检测方式是否网络查重-{{zyInfo.wwcc=='1'?'是':'否'}} 是否课程内查重-{{zyInfo.nwcc=='1'?'是':'否'}} Aigc是否查重-{{zyInfo.nwcc=='1'?'是':'否'}} 是否校内查重-{{zyInfo.xncc=='1'?'是':'否'}} </div>
<div v-if="zyInfo.filePath">附件
<a-button type="primary" style="margin-left: 10px" @click="downLoad(zyInfo.filePath)">下载</a-button></div>
</a-col>
</a-col> -->
<a-col :span="24" style="margin-top:30px;" v-if="!isYl">
<a-form-item label="上传作业" v-bind="validateInfos.filePath">
<j-upload v-model:value="formData.filePath" :disabled="disabled" maxCount="1" accept=".doc,.docx,.pdf" :forceAcceptVerify="true" ></j-upload>
@ -44,6 +123,7 @@
const globSetting = useGlobSetting();
const baseApiUrl = globSetting.domainUrl;
const { createConfirm } = useMessage();
const dataKhnr = ref<any>([]);
const props = defineProps({
formDisabled: { type: Boolean, default: false },
@ -81,7 +161,53 @@
return props.formDisabled;
});
const labelCol2 = reactive({
sm: { span: 10 },
});
const wrapperCol2 = reactive({
sm: { span: 10 },
});
const labelCol3 = reactive({
sm: { span: 4 },
});
const wrapperCol3 = reactive({
sm: { span: 20 },
});
const columnsKhnr = [
{
title: '序号',
dataIndex: 'no',
key: 'no',
customRender: (text) => {
return text.index + 1;
},
width: 80,
},
{
title: '章次',
dataIndex: 'title',
key: 'title',
},
{
title: '节次',
dataIndex: 'twoTitle',
key: 'twoTitle',
},
];
//
function handleKcnr(kcnr) {
if(kcnr){
defHttp.get({ url: '/teachingunitcontent/kcTeachingUnitContentOne/getAllList', params: { id: kcnr } }).then((res) => {
console.log('🤦‍♀️', res);
dataKhnr.value = res;
});
}else{
dataKhnr.value = [];
}
}
/**
* 新增
*/
@ -112,6 +238,8 @@
console.log(`🚀 ~ defHttp.get ~ res:`, res)
zyInfo.value = res;
console.log(`🚀 ~ defHttp.get ~ zyInfo:`, zyInfo)
handleKcnr(zyInfo.value.kcnr)
});

View File

@ -9,7 +9,7 @@
import ZyInfoStudentForm from './ZyInfoStudentForm.vue'
const title = ref<string>('');
const width = ref<number>(800);
const width = ref<number>(1100);
const visible = ref<boolean>(false);
const loading = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);

View File

@ -2,12 +2,12 @@
<a-spin :spinning="confirmLoading">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24">
<!-- <a-col :span="24">
<span style="margin-left: 8%;line-height:60px;">预设作业分值{{zyInfo.score?zyInfo.score+"分 评分不能高于预设分值":'未设置 评分不能高于100分'}}</span>
</a-col>
</a-col> -->
<a-col :span="24">
<a-form-item label="评分" v-bind="validateInfos.score">
<a-input-number v-model:value="formData.score" :max="zyInfo.score?zyInfo.score:100" :disabled="disabled" style="width:100%;" @change="handleJyfz" ></a-input-number>
<a-input-number v-model:value="formData.score" :max="100" :min="0" :disabled="disabled" style="width:100%;" @change="handleJyfz" ></a-input-number>
</a-form-item>
</a-col>
</a-row>
@ -61,16 +61,26 @@
function handleJyfz(record){
console.log(`🚀 ~ handleJyfz ~ record:`, record)
if(zyInfo.score){
if(parseInt(record) > parseInt(zyInfo.score)){
createMessage.warning('评分不能超过预设作业分值!');
formData.score = zyInfo.score;
}
}else{
if(parseInt(record) > 100){
createMessage.warning('评分不能超过100分!');
formData.score = zyInfo.score;
}
// if(zyInfo.score){
// if(parseInt(record) > parseInt(zyInfo.score)){
// createMessage.warning('!');
// formData.score = zyInfo.score;
// }
// }else{
// if(parseInt(record) > 100){
// createMessage.warning('100!');
// formData.score = zyInfo.score;
// }
// }
if(parseInt(record) > 100){
createMessage.warning('评分不能超过100分!');
formData.score = 100;
}
if(parseInt(record) < 0){
createMessage.warning('评分不能低于0分!');
formData.score = 0;
}
}

View File

@ -0,0 +1,85 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/zyInfoStudentHp/zyInfoStudentHp/list',
getHpxxList = '/zyInfoStudent/zyInfoStudent/getHpxxList',
save='/zyInfoStudentHp/zyInfoStudentHp/add',
saveOne='/zyInfoStudentHp/zyInfoStudentHp/saveOne',
saveTwo='/zyInfoStudentHp/zyInfoStudentHp/saveTwo',
edit='/zyInfoStudentHp/zyInfoStudentHp/edit',
deleteOne = '/zyInfoStudentHp/zyInfoStudentHp/delete',
deleteBatch = '/zyInfoStudentHp/zyInfoStudentHp/deleteBatch',
importExcel = '/zyInfoStudentHp/zyInfoStudentHp/importExcel',
exportXls = '/zyInfoStudentHp/zyInfoStudentHp/exportXls',
}
/**
* api
* @param params
*/
export const getExportUrl = Api.exportXls;
/**
* api
*/
export const getImportUrl = Api.importExcel;
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });
export const getHpxxList = (params) => defHttp.get({ url: Api.getHpxxList, params });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
/**
*
* @param params
* @param handleSuccess
*/
export const batchDelete = (params, handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
handleSuccess();
});
}
});
}
/**
*
* @param params
* @param isUpdate
*/
export const saveOrUpdate = (params, isUpdate) => {
let url = isUpdate ? Api.edit : Api.save;
return defHttp.post({ url: url, params }, { isTransformResponse: false });
}
export const saveOne = (params,handleSuccess) => {
return defHttp.post({ url: Api.saveOne, params }, { isTransformResponse: false });
}
export const saveTwo = (params,handleSuccess) => {
return defHttp.post({ url: Api.saveTwo, params }, { isTransformResponse: false });
}

View File

@ -0,0 +1,117 @@
import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '作业id',
align: "center",
dataIndex: 'zyStuId'
},
{
title: '学生id',
align: "center",
dataIndex: 'stuId'
},
{
title: '评分',
align: "center",
dataIndex: 'stuScore'
},
{
title: '第几次',
align: "center",
dataIndex: 'verType'
},
{
title: '学生姓名',
align: "center",
dataIndex: 'stuName'
},
{
title: '是否采纳',
align: "center",
dataIndex: 'sfcn'
},
{
title: '作业主id',
align: "center",
dataIndex: 'mainId'
},
];
export const columnsZyhp: BasicColumn[] = [
{
title: '作业名称',
align: "center",
dataIndex: 'zytitle'
},
{
title: '学生姓名',
align: "center",
dataIndex: 'studentName'
},
{
title: '作业下载',
align: "center",
dataIndex: 'filePath',
slots: { customRender: 'fileSlot' },
},
{
title: '是否完成',
align: "center",
dataIndex: 'sfpf',
slots: { customRender: 'sfpfSlot' },
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '作业id',
field: 'zyStuId',
component: 'Input',
},
{
label: '学生id',
field: 'stuId',
component: 'Input',
},
{
label: '评分',
field: 'stuScore',
component: 'Input',
},
{
label: '第几次',
field: 'verType',
component: 'Input',
},
{
label: '学生姓名',
field: 'stuName',
component: 'Input',
},
{
label: '是否采纳',
field: 'sfcn',
component: 'Input',
},
{
label: '作业主id',
field: 'mainId',
component: 'Input',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,273 @@
<template>
<div>
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="8" :sm="24">
<a-form-item label="作业名称">
<a-input placeholder="请输入作业名称" v-model:value="queryParam.zytitle"></a-input>
</a-form-item>
</a-col>
<a-col :lg="8" :sm="24">
<a-form-item label="学生姓名">
<j-input placeholder="请输入学生姓名" v-model:value="queryParam.studentName"></j-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="8" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable">
<!--插槽:table标题-->
<template #tableTitle>
<!--<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
<a-dropdown v-if="selectedRowKeys.length > 0">
<template #overlay>
<a-menu>
<a-menu-item key="1" @click="batchHandleDelete">
<Icon icon="ant-design:delete-outlined"></Icon>
删除
</a-menu-item>
</a-menu>
</template>
<a-button>批量操作
<Icon icon="mdi:chevron-down"></Icon>
</a-button>
</a-dropdown>
-->
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
<!--字段回显插槽-->
<template #htmlSlot="{ text }">
<div v-html="text"></div>
</template>
<template #sfpfSlot="{ text }">
<div v-if="text == '0'"></div>
<div v-if="text == '1'"></div>
</template>
<!--省市区字段回显插槽-->
<!--<template #pcaSlot="{text}">
{{ getAreaTextByCode(text) }}
</template>-->
<template #fileSlot="{ text }">
<span v-if="!text" style="font-size: 12px; font-style: italic">无文件</span>
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
</template>
</BasicTable>
<!-- 表单区域 -->
<ZyInfoStudentHpModal ref="registerModal" @success="handleSuccess"></ZyInfoStudentHpModal>
<ZyInfoDetailModal ref="registerZyxxModal" @success="handleSuccess"></ZyInfoDetailModal>
<ZyInfoStudentHpOneModal ref="registerOneModal" @success="handleSuccess"></ZyInfoStudentHpOneModal>
</div>
</template>
<script lang="ts" name="zyInfoStudentHp-zyInfoStudentHp" setup>
import { ref, reactive, unref } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns, columnsZyhp } from './ZyInfoStudentHp.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, getHpxxList } from './ZyInfoStudentHp.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ZyInfoStudentHpModal from './components/ZyInfoStudentHpModal.vue';
import ZyInfoDetailModal from '/@/views/zy/zyInfo/components/ZyInfoDetailModal.vue';
import ZyInfoStudentHpOneModal from '/@/views/zy/zyInfoStudentHp/components/ZyInfoStudentHpOneModal.vue';
import { defHttp } from '/@/utils/http/axios';
import { JInput } from '/@/components/Form';
import { useRouter } from 'vue-router';
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh, xqxn, type, teano } = query; //
const toggleSearchStatus = ref<boolean>(false);
const queryParam = ref<any>({rwbh});
const registerModal = ref();
const registerZyxxModal = ref();
const registerOneModal = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '学生成绩互评',
api: getHpxxList,
columns: columnsZyhp,
canResize: false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
(params.column = ''), (params.order = ''); //
return Object.assign(params, queryParam.value);
},
},
exportConfig: {
name: '学生成绩互评',
url: getExportUrl,
},
importConfig: {
url: getImportUrl,
success: handleSuccess,
},
});
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] =
tableContext;
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 16 },
});
/**
* 新增事件
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
function handleOneScore(record: Recordable) {
record.zyStuId = record.id;
registerOneModal.value.disableSubmit = false;
registerOneModal.value.edit(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 批量删除事件
*/
async function batchHandleDelete() {
await batchDelete({ ids: selectedRowKeys.value }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
(selectedRowKeys.value = []) && reload();
}
function handleZyxxDetail(record: Recordable) {
defHttp.get({ url: '/zyInfo/zyInfo/queryById', params: { id: record.mainId } }).then((res) => {
console.log('😒', res);
registerZyxxModal.value.disableSubmit = true;
registerZyxxModal.value.edit(res);
});
}
/**
* 操作栏
*/
function getTableAction(record) {
if(record.sfpf == '0'){
return [
{
label: '作业信息',
onClick: handleZyxxDetail.bind(null, record),
},
{
label: '评分',
onClick: handleOneScore.bind(null, record),
},
];
}else{
return [
{
label: '作业信息',
onClick: handleZyxxDetail.bind(null, record),
},
];
}
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
},
},
];
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
queryParam.value = {};
selectedRowKeys.value = [];
//
reload();
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
.query-group-cust {
width: calc(50% - 15px);
min-width: 100px !important;
}
.query-group-split-cust {
width: 30px;
display: inline-block;
text-align: center;
}
}
</style>

View File

@ -0,0 +1,163 @@
<template>
<a-spin :spinning="confirmLoading">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24">
<a-form-item label="作业id" v-bind="validateInfos.zyStuId">
<a-input v-model:value="formData.zyStuId" placeholder="请输入作业id" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="学生id" v-bind="validateInfos.stuId">
<a-input v-model:value="formData.stuId" placeholder="请输入学生id" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="评分" v-bind="validateInfos.stuScore">
<a-input v-model:value="formData.stuScore" placeholder="请输入评分" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="第几次" v-bind="validateInfos.verType">
<a-input v-model:value="formData.verType" placeholder="请输入第几次" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="学生姓名" v-bind="validateInfos.stuName">
<a-input v-model:value="formData.stuName" placeholder="请输入学生姓名" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="是否采纳" v-bind="validateInfos.sfcn">
<a-input v-model:value="formData.sfcn" placeholder="请输入是否采纳" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="作业主id" v-bind="validateInfos.mainId">
<a-input v-model:value="formData.mainId" placeholder="请输入作业主id" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../ZyInfoStudentHp.api';
import { Form } from 'ant-design-vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: ()=>{} },
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
zyStuId: '',
stuId: '',
stuScore: '',
verType: '',
stuName: '',
sfcn: '',
mainId: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
//
Object.assign(formData, record);
});
}
/**
* 提交数据
*/
async function submitForm() {
//
await validate();
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
min-height: 500px !important;
overflow-y: auto;
padding: 24px 24px 24px 24px;
}
</style>

View File

@ -0,0 +1,75 @@
<template>
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<ZyInfoStudentHpForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ZyInfoStudentHpForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import ZyInfoStudentHpForm from './ZyInfoStudentHpForm.vue'
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style>
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>

View File

@ -0,0 +1,133 @@
<template>
<a-spin :spinning="confirmLoading">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24">
<a-form-item label="评分" v-bind="validateInfos.stuScore">
<a-input v-model:value="formData.stuScore" placeholder="请输入评分" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils';
import { saveOrUpdate,saveOne } from '../ZyInfoStudentHp.api';
import { Form } from 'ant-design-vue';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: ()=>{} },
formBpm: { type: Boolean, default: true }
});
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
zyStuId: '',
stuId: '',
stuScore: '',
verType: '',
stuName: '',
sfcn: '',
mainId: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit(record) {
nextTick(() => {
resetFields();
//
Object.assign(formData, record);
});
}
/**
* 提交数据
*/
async function submitForm() {
//
await validate();
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
let model = formData;
if (model.id) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
await saveOne(model, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success(res.message);
emit('ok');
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
min-height: 500px !important;
overflow-y: auto;
padding: 24px 24px 24px 24px;
}
</style>

View File

@ -0,0 +1,75 @@
<template>
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<ZyInfoStudentHpOneForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ZyInfoStudentHpOneForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import ZyInfoStudentHpOneForm from './ZyInfoStudentHpOneForm.vue'
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style>
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>