# Conflicts:
#	src/router/routes/modules/zy/zy.ts
#	src/views/site/renKeJiaoCheng/checkKecheng/dqxqkcMenu.vue
This commit is contained in:
bai 2024-05-15 08:58:43 +08:00
commit 0a03f3465e
57 changed files with 4685 additions and 432 deletions

View File

@ -19,7 +19,8 @@ VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
VITE_GLOB_API_URL=/jeecg-boot
#后台接口全路径地址(必填)
VITE_GLOB_DOMAIN_URL=https://zxkccx.webvpn.nenu.edu.cn/jeecg-boot
#VITE_GLOB_DOMAIN_URL=https://zxkccx.webvpn.nenu.edu.cn/jeecg-boot
VITE_GLOB_DOMAIN_URL=https://kczxcs.nenu.edu.cn/jeecg-boot
#RTC服务器地址
VITE_GLOB_RTC_SERVER = https://zxkccx.webvpn.nenu.edu.cn:8081
@ -37,5 +38,5 @@ VITE_USE_PWA = false
VITE_LEGACY = false
# 是否开启单点登录
VITE_GLOB_APP_OPEN_SSO = true
VITE_GLOB_APP_OPEN_SSO = false

View File

@ -26,7 +26,7 @@
</template>
<script lang="ts" setup>
import { ref, reactive, computed, watch, nextTick, createApp } from 'vue';
import { ref, reactive, computed, watch, nextTick, createApp, unref } from 'vue';
import { Icon } from '/@/components/Icon';
import { getToken } from '/@/utils/auth';
import { uploadUrl } from '/@/api/common/api';
@ -66,6 +66,10 @@
//
removeConfirm: propTypes.bool.def(false),
beforeUpload: propTypes.func,
//使beforeUpload
forceBeforeUploadFn: propTypes.bool.def(true),
//accept*.jpg,*.gifvideo/*,audio/*,image/jpeg
forceAcceptVerify: propTypes.bool.def(false),
disabled: propTypes.bool.def(false),
});
@ -82,7 +86,7 @@
const isImageMode = computed(() => props.fileType === UploadTypeEnum.image);
// props attrs
const bindProps = computed(() => {
const bind: any = Object.assign({}, props, attrs);
const bind: any = Object.assign({}, props, unref(attrs));
bind.name = 'file';
bind.listType = isImageMode.value ? 'picture-card' : 'text';
bind.class = [bind.class, { 'upload-disabled': props.disabled }];
@ -90,6 +94,9 @@
//update-begin-author:taoyan date:20220407 for: beforeUpload return false
if (!bind.beforeUpload) {
bind.beforeUpload = onBeforeUpload;
} else if(!bind.forceBeforeUploadFn){
//使
bind.beforeUpload = onBeforeUpload;
}
//update-end-author:taoyan date:20220407 for: beforeUpload return false
//
@ -221,9 +228,28 @@
return false;
}
}
//()
if(props.forceAcceptVerify){
let fileName = file?.name;
if(fileName.indexOf('.')){
let suffix = fileName.split('.')[1];
let fileTypes = unref(bindProps).accept;
if(fileTypes){
if(fileTypes.indexOf(',')){
let typeList = fileTypes.split(',');
if(typeList.indexOf('.' + suffix) == -1){
createMessage.warning('请上传【*' + typeList.join(',*') + '】格式的文件');
uploadGoOn.value = false;
return false;
}
}
}
}
}
// beforeUpload
if (typeof props.beforeUpload === 'function') {
return props.beforeUpload(file);
return props.beforeUpload(file, unref(bindProps), () => uploadGoOn.value = false );
}
return true;
}

View File

@ -2,7 +2,7 @@ import type { AppRouteModule } from '/@/router/types';
// import { LAYOUT } from '/@/router/constant';
import { t } from '/@/hooks/web/useI18n';
const stuzy: AppRouteModule = {
path: '/stuzy',
name: 'stuzy',
@ -38,7 +38,22 @@ const stuzy: AppRouteModule = {
},
component: () => import('/@/views/zy/zyInfo/SutdentZyInfoHistoryList.vue'),
},
{
path: 'stuCeshiWenjuan',
name: 'stuCeshiWenjuan',
component: () => import('/@/views/kc/wjxCswj/WjxCswjStuList.vue'),
meta: {
title: '测试问卷',
},
},
{
path: 'stuDcwjWenjuan',
name: 'stuDcwjWenjuan',
component: () => import('/@/views/kc/wjxDcwj/WjxDcwjStuList.vue'),
meta: {
title: '调查问卷',
},
},
]
}

View File

@ -33,7 +33,7 @@ const zuoye: AppRouteModule = {
{
path: 'dqkcDqzy',
name: 'dqkcDqzy',
component: () => import('/@/views/zy/zyInfo/ZyInfoList.vue'),
component: () => import('/@/views/zy/zyInfo/ZyInfoMainList.vue'),
meta: {
title: '当前作业',
},
@ -49,7 +49,7 @@ const zuoye: AppRouteModule = {
{
path: 'dqkcGongju',
name: 'dqkcGongju',
component: () => import('/@/views/site/renKeJiaoCheng/checkKecheng/dqxqkcGongju.vue'),
component: () => import('/@/views/kc/detection/zyZhjsList.vue'),
meta: {
title: '课程工具',
},
@ -72,14 +72,21 @@ const zuoye: AppRouteModule = {
},
{
path: 'dqkcWenjuan',
name: 'dqkcWenjuan',
component: () => import('/@/views/kc/wjxWjxx/WjxWjxxList.vue'),
path: 'ceshiWenjuan',
name: 'ceshiWenjuan',
component: () => import('/@/views/kc/wjxCswj/WjxCswjMainList.vue'),
meta: {
title: '当前问卷',
title: '测试问卷',
},
},
{
path: 'dcwjWenjuan',
name: 'dcwjWenjuan',
component: () => import('/@/views/kc/wjxDcwj/WjxDcwjMainList.vue'),
meta: {
title: '调查问卷',
},
},
]
}

View File

@ -0,0 +1,334 @@
<template>
<div style="background: #fff;height: 97%;margin: 10px 0;">
<!--查询区域-->
<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="7">
<a-form-item label="问卷名称">
<a-input placeholder="请输入问卷名称" v-model:value="queryParam.title"></a-input>
</a-form-item>
</a-col>
<a-col :lg="7">
<a-form-item label="问卷类型">
<a-select placeholder="请选择问卷状态" ref="select" v-model:value="queryParam.qpublish">
<a-select-option value="">全部</a-select-option>
<a-select-option value="0">未发布</a-select-option>
<a-select-option value="1">已发布</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleAdd" style="margin-left: 8px"> 新增</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<a-row>
<a-col :span="8" v-for="(item, index) in tableData" :key="index" style="padding: 0px 0px 10px 5px;overflow:hidden;">
<div style="width: 100%; height: 20px; background-color: rgb(28, 132, 198);"></div>
<a-card style="height: 280px;">
<div class="rotate" :style="classFun(item.qpublish)">{{item.qpublish =='0'? '待发布':'已发布'}}</div>
<a-row style="top: -48px;position: relative;">
<a-col :span="24" style="margin-bottom: 10px;height:53px;overflow:hidden;">
<div style="font-size: 18px;font-weight: bold;">{{item.title}}</div>
</a-col>
<a-col :span="24" class="zyCon">
<a-row>
<a-col :span="6" class="zyCon">时间
</a-col>
<a-col :span="16" class="zyCon">
<a-col :span="24" class="zyCon">{{item.startTime}}</a-col>
<a-col :span="24" class="zyCon">{{item.endTime}}</a-col>
</a-col>
</a-row>
</a-col>
<a-col :span="24" class="zyCon">
<a-row>
<a-col :span="12" class="zyCon">{{item.xqxn}}</a-col>
<a-col :span="12" class="zyCon"><div style="float:right;" @click="openXkrs(item)"><a>{{item.xkrs}}人选课</a></div></a-col>
</a-row>
</a-col>
<a-col :span="24" class="zyCon">
<a-row>
<a-col :span="12" class="zyCon"><div style="float:left;" @click="handleDjjgs(item,'0')" v-if="item.wwcrs>0"><a>未提交{{item.wwcrs}}</a></div></a-col>
<a-col :span="12" class="zyCon"><div style="float:right;" @click="handleDjjgs(item,'1')" v-if="item.ywcrs>0"><a>已提交{{item.ywcrs}}</a></div></a-col>
</a-row>
</a-col>
<a-col :span="24" style="text-align:center;margin-top:20px;">
<a-button type="primary" @click="handleEdit(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==0">编辑</a-button>
<a-button type="primary" @click="handlePeizhi(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==0">配置</a-button>
<a-button type="primary" @click="handleFabu(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==0">发布</a-button>
<a-button type="primary" @click="handleDelete(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==0">删除</a-button>
<a-button type="primary" @click="handleDetail(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==1">详情</a-button>
<a-button type="primary" @click="handlePeizhiXq(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==1">配置</a-button>
<!-- <a-button type="primary" @click="handleDjjgs(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==1">结果</a-button>-->
</a-col>
<!-- <a-col :span="24" style="text-align:center;margin-top:20px;">-->
<!-- <a-button type="primary" @click="handleDj(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==1">答卷</a-button>-->
<!-- <a-button type="primary" @click="handleDjjg(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==1">查看答卷</a-button>-->
<!-- </a-col>-->
</a-row>
</a-card>
</a-col>
<a-col :span="24">
<div v-show="tableData.length>0">
<a-pagination v-model="current" :total="total" @change="handlePageChange" :pageSize="pageSize" style="text-align: right;"/>
</div>
<div v-show="tableData.length==0">
<a-empty/>
</div>
</a-col>
</a-row>
<!-- 表单区域 -->
<WjxWjxxModal ref="registerModal" @success="handleSuccess"></WjxWjxxModal>
<WjxWjxxTmlbModal ref="WjxWjxxTmlbModalPage" @success="handleSuccess"></WjxWjxxTmlbModal>
<WjxWjxxTmlbDjModal ref="WjxWjxxTmlbDjModalPage" @success="handleSuccess"></WjxWjxxTmlbDjModal>
<WjxWjxxTmlbDjjgsModal ref="WjxWjxxTmlbDjjgsModalPage" @success="handleSuccess"></WjxWjxxTmlbDjjgsModal>
<XxhbbksListModal ref="XxhbbksListModalPage"></XxhbbksListModal>
</div>
</template>
<script lang="ts" name="wjxWjxx-wjxWjxx" setup>
import {ref, reactive, defineExpose, unref, onMounted} from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { Input, Popover, Pagination, Empty } from 'ant-design-vue';
import { list ,deleteOne } from '/@/views/kc/wjxWjxx/WjxWjxx.api';
import WjxWjxxModal from '/@/views/kc/wjxWjxx/components/WjxWjxxModal.vue'
import WjxWjxxTmlbModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbModal.vue'
import WjxWjxxTmlbDjModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjModal.vue'
import WjxWjxxTmlbDjjgsModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgsModal.vue'
import XxhbbksListModal from '/@/views/kc/xxhbbks/XxhbbksListModal.vue';
import {useRouter} from "vue-router";
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh,xqxn,typa } = query;//
const APagination = Pagination;
const queryParam = ref<any>({});
const current = ref<number>(0);
const total = ref<number>(0);
const pageNo = ref<number>(0);
const pageSize = ref<number>(6);
const tableData = ref<any>([]);
const registerModal = ref();
const WjxWjxxTmlbModalPage = ref();
const WjxWjxxTmlbDjModalPage = ref();
const WjxWjxxTmlbDjjgsModalPage = ref()
const WjxWjxxTmlbDjjgsDcModalPage = ref();
const XxhbbksListModalPage = ref();
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("6");
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 获取选课人数
*/
function openXkrs(record){
// console.log(`🚀 ~ openXkrs ~ record:`, record)
XxhbbksListModalPage.value.disableSubmit = true;
XxhbbksListModalPage.value.init(record);
}
/**
* 配置
*/
function handlePeizhi(record: Recordable) {
WjxWjxxTmlbModalPage.value.disableSubmit = false;
WjxWjxxTmlbModalPage.value.edit(record,"6");
}
/**
* 配置详情
*/
function handlePeizhiXq(record: Recordable) {
WjxWjxxTmlbDjModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjModalPage.value.edit(record,true,"6",'ls');
}
// /**
// *
// */
// function handleDj(record: Recordable) {
// WjxWjxxTmlbDjModalPage.value.disableSubmit = false;
// WjxWjxxTmlbDjModalPage.value.edit(record,false);
// }
// /**
// *
// */
// function handleDjjg(record: Recordable) {
// WjxWjxxTmlbDjjgModalPage.value.disableSubmit = true;
// WjxWjxxTmlbDjjgModalPage.value.edit(record,false);
// }
/**
* 学生答卷列表
*/
function handleDjjgs(record: Recordable,flag) {
WjxWjxxTmlbDjjgsModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjjgsModalPage.value.edit(record,flag);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 发布
*/
function handleFabu(record: Recordable) {
defHttp.get({ url: '/wjxWjxx/wjxWjxx/fbwj', params: { id: record.id,wjlx: "6" } }).then(res => {
total.value = 1;
pageNo.value = 0;
reload();
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
function reload(){
queryParam.value.pageNo = pageNo;
queryParam.value.pageSize = pageSize;
queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn;
queryParam.value.atype = "6";
defHttp.get({ url: '/wjxWjxx/wjxWjxx/list', params: queryParam.value }).then(res => {
// console.log(`🚀 ~ defHttp.get ~ res:`, res)
total.value = res.total;
pageNo.value = res.pages;
current.value = res.current;
tableData.value = res.records;
});
}
/**
* 成功回调
*/
function handleSuccess() {
total.value = 1;
pageNo.value = 0;
reload();
}
/**
* 查询
*/
function searchQuery() {
pageNo.value = 0;
reload();
}
/**
* 重置
*/
function searchReset() {
queryParam.value = {};
total.value = 1;
handlePageChange(1);
}
function handlePageChange(record){
pageNo.value = record;
reload();
}
onMounted(() => {
searchQuery();
});
function classFun(type){
if(type == '0'){
return "background: #a7a6a6";
}else if(type == '1'){
return "background: #18a689";
}
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.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
}
}
.jeecg-basic-table-form-container .ant-form {
padding: 12px 10px 0px 10px;
margin-bottom: 0px;
background-color: #fff;
border-radius: 2px;
}
.ellipsis {
overflow: hidden; /* 确保超出容器的内容被裁剪 */
white-space: nowrap; /* 确保文本在一行内显示 */
text-overflow: ellipsis; /* 超出部分显示省略号 */
}
.zyCon{
line-height: 30px;
}
.rotate {
transform: rotate(45deg);
background: rgb(28, 132, 198);
color: #fff;
padding: 19px 10px 3px 10px;
position: relative;
top: -54px;
right: -131px;
text-align: center;
font-size: 11px;
}
</style>

View File

@ -0,0 +1,27 @@
<template>
<div style="background: #fff;height: 97%;margin: 10px 0;">
<div style="text-align:right;width:100%;">
<a-switch v-model:checked="checked1" @change="onChange1"/>
</div>
<div v-show="checked1">
<WjxCswjList/>
</div>
<div v-show="!checked1">
<WjxCswjTableList/>
</div>
</div>
</template>
<script lang="ts" name="wjx-cswj" setup>
import { ref, reactive, onMounted,unref } from 'vue';
import WjxCswjTableList from '/@/views/kc/wjxCswj/WjxCswjTableList.vue'
import WjxCswjList from '/@/views/kc/wjxCswj/WjxCswjList.vue'
const checked1 = ref(true);
function onChange1(record){
}
</script>
<style lang="less" scoped>
</style>

View File

@ -0,0 +1,252 @@
<template>
<div style="background: #fff;height: 97%;margin: 10px 0;">
<!--查询区域-->
<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="7">
<a-form-item label="问卷名称">
<a-input placeholder="请输入问卷名称" v-model:value="queryParam.title"></a-input>
</a-form-item>
</a-col>
<a-col :lg="7">
<a-form-item label="问卷类型">
<a-select placeholder="请选择问卷状态" ref="select" v-model:value="queryParam.flag">
<a-select-option value="">全部</a-select-option>
<a-select-option value="-1">待提交</a-select-option>
<a-select-option value="0">已提交</a-select-option>
<a-select-option value="1">已完成</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<a-row>
<a-col :span="8" v-for="(item, index) in tableData" :key="index" style="padding: 0px 0px 10px 5px;overflow:hidden;">
<div style="width: 100%; height: 20px; background-color: rgb(28, 132, 198);"></div>
<a-card style="height: 210px;">
<div class="rotate" :style="classFun(item.flag)">{{getStatus(item.flag)}}</div>
<a-row style="top: -48px;position: relative;">
<a-col :span="24" style="margin-bottom: 10px;height:53px;overflow:hidden;">
<div style="font-size: 18px;font-weight: bold;">{{item.title}}</div>
</a-col>
<a-col :span="24" class="zyCon">
<a-row>
<a-col :span="6" class="zyCon">时间
</a-col>
<a-col :span="16" class="zyCon">
<a-col :span="24" class="zyCon">{{item.startTime}}</a-col>
<a-col :span="24" class="zyCon">{{item.endTime}}</a-col>
</a-col>
</a-row>
</a-col>
<a-col :span="24" style="text-align:center;margin-top:20px;">
<a-button type="primary" @click="handleDj(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.flag=='-1'">答卷</a-button>
<a-button type="primary" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);color:#ffffff" v-if="item.flag=='0'" disabled>正在批卷</a-button>
<a-button type="primary" @click="handleDjjg(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.flag=='1'">查看答卷</a-button>
</a-col>
</a-row>
</a-card>
</a-col>
<a-col :span="24">
<div v-show="tableData.length>0">
<a-pagination v-model="current" :total="total" @change="handlePageChange" :pageSize="pageSize" style="text-align: right;"/>
</div>
<div v-show="tableData.length==0">
<a-empty/>
</div>
</a-col>
</a-row>
<WjxWjxxTmlbDjModal ref="WjxWjxxTmlbDjModalPage" @success="handleSuccess"></WjxWjxxTmlbDjModal>
<WjxWjxxTmlbDjjgModal ref="WjxWjxxTmlbDjjgModalPage" @success="handleSuccess"></WjxWjxxTmlbDjjgModal>
</div>
</template>
<script lang="ts" name="wjxWjxx-wjxWjxx" setup>
import {ref, reactive, defineExpose, unref, onMounted} from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { Input, Popover, Pagination, Empty } from 'ant-design-vue';
import WjxWjxxTmlbDjModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjModal.vue'
import WjxWjxxTmlbDjjgModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgModal.vue'
import {useRouter} from "vue-router";
import {useMessage} from "/@/hooks/web/useMessage";
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh,xqxn,typa } = query;//
const { createMessage } = useMessage();
const APagination = Pagination;
const queryParam = ref<any>({});
const current = ref<number>(0);
const total = ref<number>(0);
const pageNo = ref<number>(0);
const pageSize = ref<number>(6);
const tableData = ref<any>([]);
const WjxWjxxTmlbDjModalPage = ref();
const WjxWjxxTmlbDjjgModalPage = ref();
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 16 },
});
/**
* 答卷详情
*/
function handleDj(record: Recordable) {
let timestamp = new Date().getTime();
let startTimestamp = Date.parse(record.startTime);
if(timestamp<startTimestamp){
createMessage.error('还未到答卷时间!');
return;
}
let endTimestamp = Date.parse(record.endTime);
if(timestamp>endTimestamp){
createMessage.error('答卷时间已过!');
return;
}
WjxWjxxTmlbDjModalPage.value.disableSubmit = false;
WjxWjxxTmlbDjModalPage.value.edit(record,false,"6",'xs');
}
/**
* 答卷详情
*/
function handleDjjg(record: Recordable) {
WjxWjxxTmlbDjjgModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjjgModalPage.value.edit(record.djId,false);
}
function reload(){
queryParam.value.pageNo = pageNo;
queryParam.value.pageSize = pageSize;
queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn;
queryParam.value.atype = "6";
defHttp.get({ url: '/wjxWjxx/wjxWjxx/stuList', params: queryParam.value }).then(res => {
// console.log(`🚀 ~ defHttp.get ~ res:`, res)
total.value = res.total;
pageNo.value = res.pages;
current.value = res.current;
tableData.value = res.records;
});
}
/**
* 成功回调
*/
function handleSuccess() {
total.value = 1;
pageNo.value = 0;
reload();
}
/**
* 查询
*/
function searchQuery() {
pageNo.value = 0;
reload();
}
/**
* 重置
*/
function searchReset() {
queryParam.value = {};
total.value = 1;
handlePageChange(1);
}
function handlePageChange(record){
pageNo.value = record;
reload();
}
onMounted(() => {
searchQuery();
});
function classFun(type){
if(type == '-1'){
return "background: #a7a6a6";
}else if(type == '0'){
return "background: #1c84c6";
}else if(type == '1'){
return "background: #18a689";
}
}
function getStatus(flag){
if(flag == '-1'){
return "待答卷";
}else if(flag == '0'){
return "待批卷";
}else if(flag == '1'){
return "已完成";
}
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.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
}
}
.jeecg-basic-table-form-container .ant-form {
padding: 12px 10px 0px 10px;
margin-bottom: 0px;
background-color: #fff;
border-radius: 2px;
}
.ellipsis {
overflow: hidden; /* 确保超出容器的内容被裁剪 */
white-space: nowrap; /* 确保文本在一行内显示 */
text-overflow: ellipsis; /* 超出部分显示省略号 */
}
.zyCon{
line-height: 30px;
}
.rotate {
transform: rotate(45deg);
background: rgb(28, 132, 198);
color: #fff;
padding: 19px 10px 3px 10px;
position: relative;
top: -54px;
right: -131px;
text-align: center;
font-size: 11px;
}
</style>

View File

@ -0,0 +1,313 @@
<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="7">
<a-form-item label="问卷名称">
<a-input placeholder="请输入问卷名称" v-model:value="queryParam.title"></a-input>
</a-form-item>
</a-col>
<a-col :lg="7">
<a-form-item label="问卷类型">
<a-select placeholder="请选择问卷状态" ref="select" v-model:value="queryParam.qpublish">
<a-select-option value="">全部</a-select-option>
<a-select-option value="0">未发布</a-select-option>
<a-select-option value="1">已发布</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleAdd" style="margin-left: 8px"> 新增</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" >
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
</BasicTable>
<!-- 表单区域 -->
<WjxWjxxModal ref="registerModal" @success="handleSuccess"></WjxWjxxModal>
<WjxWjxxTmlbModal ref="WjxWjxxTmlbModalPage" @success="handleSuccess"></WjxWjxxTmlbModal>
<WjxWjxxTmlbDjModal ref="WjxWjxxTmlbDjModalPage" @success="handleSuccess"></WjxWjxxTmlbDjModal>
<WjxWjxxTmlbDjjgModal ref="WjxWjxxTmlbDjjgModalPage" @success="handleSuccess"></WjxWjxxTmlbDjjgModal>
<WjxWjxxTmlbDjjgsModal ref="WjxWjxxTmlbDjjgsModalPage" @success="handleSuccess"></WjxWjxxTmlbDjjgsModal>
<XxhbbksListModal ref="XxhbbksListModalPage"></XxhbbksListModal>
</div>
</template>
<script lang="ts" name="wjxWjxx-wjxWjxx" setup>
import {ref, reactive, defineExpose, unref} from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { defHttp } from '/@/utils/http/axios';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from '/@/views/kc/wjxWjxx/WjxWjxx.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from '/@/views/kc/wjxWjxx/WjxWjxx.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import WjxWjxxModal from '/@/views/kc/wjxWjxx/components/WjxWjxxModal.vue'
import WjxWjxxTmlbModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbModal.vue'
import WjxWjxxTmlbDjModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjModal.vue'
import WjxWjxxTmlbDjjgModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgModal.vue'
import WjxWjxxTmlbDjjgsModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgsModal.vue'
import XxhbbksListModal from '/@/views/kc/xxhbbks/XxhbbksListModal.vue';
import {useRouter} from "vue-router";
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh,xqxn,typa} = query;//
const queryParam = ref<any>({rwbh : rwbh,xqxn : xqxn,atype : "6"});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const WjxWjxxTmlbModalPage = ref();
const WjxWjxxTmlbDjModalPage = ref();
const WjxWjxxTmlbDjjgsModalPage = ref();
const XxhbbksListModalPage = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '',
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 280,
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("6");
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 配置
*/
function handlePeizhi(record: Recordable) {
WjxWjxxTmlbModalPage.value.disableSubmit = false;
WjxWjxxTmlbModalPage.value.edit(record,"6");
}
/**
* 配置详情
*/
function handlePeizhiXq(record: Recordable) {
WjxWjxxTmlbDjModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjModalPage.value.edit(record,true,"6",'ls');
}
// /**
// *
// */
// function handlePeizhiDj(record: Recordable) {
// WjxWjxxTmlbDjModalPage.value.disableSubmit = false;
// WjxWjxxTmlbDjModalPage.value.edit(record,false);
// }
//
// /**
// *
// */
// function handlePeizhiDjjg(record: Recordable) {
// WjxWjxxTmlbDjjgModalPage.value.disableSubmit = true;
// WjxWjxxTmlbDjjgModalPage.value.edit(record,false);
// }
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 学生答卷列表
*/
function handleDjjgs(record: Recordable,flag) {
WjxWjxxTmlbDjjgsModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjjgsModalPage.value.edit(record, flag);
}
/**
* 发布
*/
function handleFabu(record: Recordable) {
defHttp.get({ url: '/wjxWjxx/wjxWjxx/fbwj', params: { id: record.id,wjlx: "6" } }).then(res => {
reload();
});
}
/**
* 删除事件
*/
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 getTableAction(record) {
if(record.qpublish == '1'){
return [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '配置详情',
onClick: handlePeizhiXq.bind(null, record),
},
{
label: '学生列表',
onClick: handleDjjgs.bind(null, record,"1"),
},
]
}else{
return [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
label: '配置',
onClick: handlePeizhi.bind(null, record),
},
{
label: '发布',
onClick: handleFabu.bind(null, record),
},
{
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
]
};
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
]
}
/**
* 查询
*/
function searchQuery() {
reload();
}
/**
* 重置
*/
function searchReset() {
queryParam.value = {};
queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn;
queryParam.value.atype = "6";
selectedRowKeys.value = [];
//
reload();
}
function init(){
defHttp.get({url:'/wjxWjxx/wjxWjxx/getWjxLogin',params:{}}).then(res =>{
})
}
defineExpose({
init
});
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.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,335 @@
<template>
<div style="background: #fff;height: 97%;margin: 10px 0;">
<!--查询区域-->
<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="7">
<a-form-item label="问卷名称">
<a-input placeholder="请输入问卷名称" v-model:value="queryParam.title"></a-input>
</a-form-item>
</a-col>
<a-col :lg="7">
<a-form-item label="问卷类型">
<a-select placeholder="请选择问卷状态" ref="select" v-model:value="queryParam.qpublish">
<a-select-option value="">全部</a-select-option>
<a-select-option value="0">未发布</a-select-option>
<a-select-option value="1">已发布</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleAdd" style="margin-left: 8px"> 新增</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<a-row>
<a-col :span="8" v-for="(item, index) in tableData" :key="index" style="padding: 0px 0px 10px 5px;overflow:hidden;">
<div style="width: 100%; height: 20px; background-color: rgb(28, 132, 198);"></div>
<a-card style="height: 280px;">
<div class="rotate" :style="classFun(item.qpublish)">{{item.qpublish =='0'? '待发布':'已发布'}}</div>
<a-row style="top: -48px;position: relative;">
<a-col :span="24" style="margin-bottom: 10px;height:53px;overflow:hidden;">
<div style="font-size: 18px;font-weight: bold;">{{item.title}}</div>
</a-col>
<a-col :span="24" class="zyCon">
<a-row>
<a-col :span="6" class="zyCon">时间
</a-col>
<a-col :span="16" class="zyCon">
<a-col :span="24" class="zyCon">{{item.startTime}}</a-col>
<a-col :span="24" class="zyCon">{{item.endTime}}</a-col>
</a-col>
</a-row>
</a-col>
<a-col :span="24" class="zyCon">
<a-row>
<a-col :span="12" class="zyCon">{{item.xqxn}}</a-col>
<a-col :span="12" class="zyCon"><div style="float:right;" @click="openXkrs(item)"><a>{{item.xkrs}}人选课</a></div></a-col>
</a-row>
</a-col>
<a-col :span="24" class="zyCon">
<a-row>
<a-col :span="12" class="zyCon"><div style="float:left;" @click="handleDjjgs(item,'0')" v-if="item.wwcrs>0"><a>未提交{{item.wwcrs}}</a></div></a-col>
<a-col :span="12" class="zyCon"><div style="float:right;" @click="handleDjjgs(item,'1')" v-if="item.ywcrs>0"><a>已提交{{item.ywcrs}}</a></div></a-col>
</a-row>
</a-col>
<a-col :span="24" style="text-align:center;margin-top:20px;">
<a-button type="primary" @click="handleEdit(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==0">编辑</a-button>
<a-button type="primary" @click="handlePeizhi(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==0">配置</a-button>
<a-button type="primary" @click="handleFabu(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==0">发布</a-button>
<a-button type="primary" @click="handleDelete(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==0">删除</a-button>
<a-button type="primary" @click="handleDetail(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==1">详情</a-button>
<a-button type="primary" @click="handlePeizhiXq(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==1">配置</a-button>
<!-- <a-button type="primary" @click="handleDjjgs(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==1">结果</a-button>-->
</a-col>
<!-- <a-col :span="24" style="text-align:center;margin-top:20px;">-->
<!-- <a-button type="primary" @click="handleDj(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==1">答卷</a-button>-->
<!-- <a-button type="primary" @click="handleDjjg(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.qpublish==1">查看答卷</a-button>-->
<!-- </a-col>-->
</a-row>
</a-card>
</a-col>
<a-col :span="24">
<div v-show="tableData.length>0">
<a-pagination v-model="current" :total="total" @change="handlePageChange" :pageSize="pageSize" style="text-align: right;"/>
</div>
<div v-show="tableData.length==0">
<a-empty/>
</div>
</a-col>
</a-row>
<!-- 表单区域 -->
<WjxWjxxModal ref="registerModal" @success="handleSuccess"></WjxWjxxModal>
<WjxWjxxTmlbModal ref="WjxWjxxTmlbModalPage" @success="handleSuccess"></WjxWjxxTmlbModal>
<WjxWjxxTmlbDjModal ref="WjxWjxxTmlbDjModalPage" @success="handleSuccess"></WjxWjxxTmlbDjModal>
<WjxWjxxTmlbDjjgModal ref="WjxWjxxTmlbDjjgModalPage" @success="handleSuccess"></WjxWjxxTmlbDjjgModal>
<WjxWjxxTmlbDjjgsDcModal ref="WjxWjxxTmlbDjjgsDcModalPage" @success="handleSuccess"></WjxWjxxTmlbDjjgsDcModal>
<XxhbbksListModal ref="XxhbbksListModalPage"></XxhbbksListModal>
</div>
</template>
<script lang="ts" name="wjxWjxx-wjxWjxx" setup>
import {ref, reactive, defineExpose, unref, onMounted} from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { Input, Popover, Pagination, Empty } from 'ant-design-vue';
import { list ,deleteOne } from '/@/views/kc/wjxWjxx/WjxWjxx.api';
import WjxWjxxModal from '/@/views/kc/wjxWjxx/components/WjxWjxxModal.vue'
import WjxWjxxTmlbModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbModal.vue'
import WjxWjxxTmlbDjModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjModal.vue'
import WjxWjxxTmlbDjjgModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgModal.vue'
import WjxWjxxTmlbDjjgsDcModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgsDcModal.vue'
import XxhbbksListModal from '/@/views/kc/xxhbbks/XxhbbksListModal.vue';
import {useRouter} from "vue-router";
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh,xqxn,typa} = query;//
const APagination = Pagination;
const queryParam = ref<any>({});
const current = ref<number>(0);
const total = ref<number>(0);
const pageNo = ref<number>(0);
const pageSize = ref<number>(6);
const tableData = ref<any>([]);
const registerModal = ref();
const WjxWjxxTmlbModalPage = ref();
const WjxWjxxTmlbDjModalPage = ref();
const WjxWjxxTmlbDjjgsDcModalPage = ref();
const XxhbbksListModalPage = ref();
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("1");
}
/**
* 编辑事件
*/
function handleEdit(record: Recordable) {
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
/**
* 获取选课人数
*/
function openXkrs(record){
// console.log(`🚀 ~ openXkrs ~ record:`, record)
XxhbbksListModalPage.value.disableSubmit = true;
XxhbbksListModalPage.value.init(record);
}
/**
* 配置
*/
function handlePeizhi(record: Recordable) {
WjxWjxxTmlbModalPage.value.disableSubmit = false;
WjxWjxxTmlbModalPage.value.edit(record,"1");
}
/**
* 配置详情
*/
function handlePeizhiXq(record: Recordable) {
WjxWjxxTmlbDjModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjModalPage.value.edit(record,true,"1",'ls');
}
// /**
// *
// */
// function handleDj(record: Recordable) {
// WjxWjxxTmlbDjModalPage.value.disableSubmit = false;
// WjxWjxxTmlbDjModalPage.value.edit(record,false);
// }
/**
* 答卷详情
*/
// function handleDjjg(record: Recordable) {
// WjxWjxxTmlbDjjgModalPage.value.disableSubmit = true;
// WjxWjxxTmlbDjjgModalPage.value.edit(record,false);
// }
/**
* 学生答卷列表
*/
function handleDjjgs(record: Recordable,flag) {
WjxWjxxTmlbDjjgsDcModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjjgsDcModalPage.value.edit(record, flag);
}
/**
* 详情
*/
function handleDetail(record: Recordable) {
registerModal.value.disableSubmit = true;
registerModal.value.edit(record);
}
/**
* 发布
*/
function handleFabu(record: Recordable) {
defHttp.get({ url: '/wjxWjxx/wjxWjxx/fbwj', params: { id: record.id,wjlx: "1" } }).then(res => {
total.value = 1;
pageNo.value = 0;
reload();
});
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
function reload(){
queryParam.value.pageNo = pageNo;
queryParam.value.pageSize = pageSize;
queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn;
queryParam.value.atype = "1";
defHttp.get({ url: '/wjxWjxx/wjxWjxx/list', params: queryParam.value }).then(res => {
// console.log(`🚀 ~ defHttp.get ~ res:`, res)
total.value = res.total;
pageNo.value = res.pages;
current.value = res.current;
tableData.value = res.records;
});
}
/**
* 成功回调
*/
function handleSuccess() {
total.value = 1;
pageNo.value = 0;
reload();
}
/**
* 查询
*/
function searchQuery() {
pageNo.value = 0;
reload();
}
/**
* 重置
*/
function searchReset() {
queryParam.value = {};
total.value = 1;
handlePageChange(1);
}
function handlePageChange(record){
pageNo.value = record;
reload();
}
onMounted(() => {
searchQuery();
});
function classFun(type){
if(type == '0'){
return "background: #a7a6a6";
}else if(type == '1'){
return "background: #18a689";
}
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.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
}
}
.jeecg-basic-table-form-container .ant-form {
padding: 12px 10px 0px 10px;
margin-bottom: 0px;
background-color: #fff;
border-radius: 2px;
}
.ellipsis {
overflow: hidden; /* 确保超出容器的内容被裁剪 */
white-space: nowrap; /* 确保文本在一行内显示 */
text-overflow: ellipsis; /* 超出部分显示省略号 */
}
.zyCon{
line-height: 30px;
}
.rotate {
transform: rotate(45deg);
background: rgb(28, 132, 198);
color: #fff;
padding: 19px 10px 3px 10px;
position: relative;
top: -54px;
right: -131px;
text-align: center;
font-size: 11px;
}
</style>

View File

@ -0,0 +1,27 @@
<template>
<div style="background: #fff;height: 97%;margin: 10px 0;">
<div style="text-align:right;width:100%;">
<a-switch v-model:checked="checked1" @change="onChange1"/>
</div>
<div v-show="checked1">
<WjxDcwjList/>
</div>
<div v-show="!checked1">
<WjxDcwjTableList/>
</div>
</div>
</template>
<script lang="ts" name="wjx-dcwj" setup>
import { ref, reactive, onMounted,unref } from 'vue';
import WjxDcwjTableList from '/@/views/kc/wjxDcwj/WjxDcwjTableList.vue'
import WjxDcwjList from '/@/views/kc/wjxDcwj/WjxDcwjList.vue'
const checked1 = ref(true);
function onChange1(record){
}
</script>
<style lang="less" scoped>
</style>

View File

@ -0,0 +1,252 @@
<template>
<div style="background: #fff;height: 97%;margin: 10px 0;">
<!--查询区域-->
<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="7">
<a-form-item label="问卷名称">
<a-input placeholder="请输入问卷名称" v-model:value="queryParam.title"></a-input>
</a-form-item>
</a-col>
<a-col :lg="7">
<a-form-item label="问卷类型">
<a-select placeholder="请选择问卷状态" ref="select" v-model:value="queryParam.flag">
<a-select-option value="">全部</a-select-option>
<a-select-option value="-1">待提交</a-select-option>
<a-select-option value="0">已提交</a-select-option>
<a-select-option value="1">已完成</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<a-row>
<a-col :span="8" v-for="(item, index) in tableData" :key="index" style="padding: 0px 0px 10px 5px;overflow:hidden;">
<div style="width: 100%; height: 20px; background-color: rgb(28, 132, 198);"></div>
<a-card style="height: 210px;">
<div class="rotate" :style="classFun(item.flag)">{{getStatus(item.flag)}}</div>
<a-row style="top: -48px;position: relative;">
<a-col :span="24" style="margin-bottom: 10px;height:53px;overflow:hidden;">
<div style="font-size: 18px;font-weight: bold;">{{item.title}}</div>
</a-col>
<a-col :span="24" class="zyCon">
<a-row>
<a-col :span="6" class="zyCon">时间
</a-col>
<a-col :span="16" class="zyCon">
<a-col :span="24" class="zyCon">{{item.startTime}}</a-col>
<a-col :span="24" class="zyCon">{{item.endTime}}</a-col>
</a-col>
</a-row>
</a-col>
<a-col :span="24" style="text-align:center;margin-top:20px;">
<a-button type="primary" @click="handleDj(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.flag=='-1'">答卷</a-button>
<a-button type="primary" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.flag=='0'" disabled>正在批卷</a-button>
<a-button type="primary" @click="handleDjjg(item)" style="margin-left:5px;padding: 0px 8px;background:rgb(28, 132, 198);" v-if="item.flag=='1'">查看答卷</a-button>
</a-col>
</a-row>
</a-card>
</a-col>
<a-col :span="24">
<div v-show="tableData.length>0">
<a-pagination v-model="current" :total="total" @change="handlePageChange" :pageSize="pageSize" style="text-align: right;"/>
</div>
<div v-show="tableData.length==0">
<a-empty/>
</div>
</a-col>
</a-row>
<WjxWjxxTmlbDjModal ref="WjxWjxxTmlbDjModalPage" @success="handleSuccess"></WjxWjxxTmlbDjModal>
<WjxWjxxTmlbDjjgModal ref="WjxWjxxTmlbDjjgModalPage" @success="handleSuccess"></WjxWjxxTmlbDjjgModal>
</div>
</template>
<script lang="ts" name="wjxWjxx-wjxWjxx" setup>
import {ref, reactive, defineExpose, unref, onMounted} from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { Input, Popover, Pagination, Empty } from 'ant-design-vue';
import WjxWjxxTmlbDjModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjModal.vue'
import WjxWjxxTmlbDjjgModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgModal.vue'
import {useRouter} from "vue-router";
import {useMessage} from "/@/hooks/web/useMessage";
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh,xqxn,typa } = query;//
const { createMessage } = useMessage();
const APagination = Pagination;
const queryParam = ref<any>({});
const current = ref<number>(0);
const total = ref<number>(0);
const pageNo = ref<number>(0);
const pageSize = ref<number>(6);
const tableData = ref<any>([]);
const WjxWjxxTmlbDjModalPage = ref();
const WjxWjxxTmlbDjjgModalPage = ref();
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 16 },
});
/**
* 答卷详情
*/
function handleDj(record: Recordable) {
let timestamp = new Date().getTime();
let startTimestamp = Date.parse(record.startTime);
if(timestamp<startTimestamp){
createMessage.error('还未到答卷时间!');
return;
}
let endTimestamp = Date.parse(record.endTime);
if(timestamp>endTimestamp){
createMessage.error('答卷时间已过!');
return;
}
WjxWjxxTmlbDjModalPage.value.disableSubmit = false;
WjxWjxxTmlbDjModalPage.value.edit(record,false,"1",'xs');
}
/**
* 答卷详情
*/
function handleDjjg(record: Recordable) {
WjxWjxxTmlbDjjgModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjjgModalPage.value.edit(record.djId,false);
}
function reload(){
queryParam.value.pageNo = pageNo;
queryParam.value.pageSize = pageSize;
queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn;
queryParam.value.atype = "1";
defHttp.get({ url: '/wjxWjxx/wjxWjxx/stuList', params: queryParam.value }).then(res => {
// console.log(`🚀 ~ defHttp.get ~ res:`, res)
total.value = res.total;
pageNo.value = res.pages;
current.value = res.current;
tableData.value = res.records;
});
}
/**
* 成功回调
*/
function handleSuccess() {
total.value = 1;
pageNo.value = 0;
reload();
}
/**
* 查询
*/
function searchQuery() {
pageNo.value = 0;
reload();
}
/**
* 重置
*/
function searchReset() {
queryParam.value = {};
total.value = 1;
handlePageChange(1);
}
function handlePageChange(record){
pageNo.value = record;
reload();
}
onMounted(() => {
searchQuery();
});
function classFun(type){
if(type == '-1'){
return "background: #a7a6a6";
}else if(type == '0'){
return "background: #1c84c6";
}else if(type == '1'){
return "background: #18a689";
}
}
function getStatus(flag){
if(flag == '-1'){
return "待答卷";
}else if(flag == '0'){
return "待批卷";
}else if(flag == '1'){
return "已完成";
}
}
</script>
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.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
}
}
.jeecg-basic-table-form-container .ant-form {
padding: 12px 10px 0px 10px;
margin-bottom: 0px;
background-color: #fff;
border-radius: 2px;
}
.ellipsis {
overflow: hidden; /* 确保超出容器的内容被裁剪 */
white-space: nowrap; /* 确保文本在一行内显示 */
text-overflow: ellipsis; /* 超出部分显示省略号 */
}
.zyCon{
line-height: 30px;
}
.rotate {
transform: rotate(45deg);
background: rgb(28, 132, 198);
color: #fff;
padding: 19px 10px 3px 10px;
position: relative;
top: -54px;
right: -131px;
text-align: center;
font-size: 11px;
}
</style>

View File

@ -4,11 +4,20 @@
<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">
<a-col :lg="7">
<a-form-item label="问卷名称">
<a-input placeholder="请输入问卷名称" v-model:value="queryParam.title"></a-input>
</a-form-item>
</a-col>
<a-col :lg="7">
<a-form-item label="问卷类型">
<a-select placeholder="请选择问卷状态" ref="select" v-model:value="queryParam.qpublish">
<a-select-option value="">全部</a-select-option>
<a-select-option value="0">未发布</a-select-option>
<a-select-option value="1">已发布</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
@ -23,55 +32,55 @@
</div>
<!--引用表格-->
<BasicTable @register="registerTable" >
<!--插槽:table标题-->
<template #tableTitle>
<!-- <a-button type="primary" @click="init" preIcon="ant-design:plus-outlined"> 登录</a-button> -->
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></div>
</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>
<!-- 表单区域 -->
<WjxWjxxModal ref="registerModal" @success="handleSuccess"></WjxWjxxModal>
<WjxWjxxTmlbModal ref="WjxWjxxTmlbModalPage" @success="handleSuccess"></WjxWjxxTmlbModal>
<WjxWjxxTmlbDjModal ref="WjxWjxxTmlbDjModalPage" @success="handleSuccess"></WjxWjxxTmlbDjModal>
<WjxWjxxTmlbDjjgModal ref="WjxWjxxTmlbDjjgModalPage" @success="handleSuccess"></WjxWjxxTmlbDjjgModal>
<WjxWjxxTmlbDjjgsDcModal ref="WjxWjxxTmlbDjjgsDcModalPage" @success="handleSuccess"></WjxWjxxTmlbDjjgsDcModal>
<XxhbbksListModal ref="XxhbbksListModalPage"></XxhbbksListModal>
</div>
</template>
<script lang="ts" name="wjxWjxx-wjxWjxx" setup>
import { ref, reactive,defineExpose } from 'vue';
import {ref, reactive, defineExpose, unref} from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { defHttp } from '/@/utils/http/axios';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './WjxWjxx.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './WjxWjxx.api';
import { columns } from '/@/views/kc/wjxWjxx/WjxWjxx.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from '/@/views/kc/wjxWjxx/WjxWjxx.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import WjxWjxxModal from './components/WjxWjxxModal.vue'
import WjxWjxxModal from '/@/views/kc/wjxWjxx/components/WjxWjxxModal.vue'
import WjxWjxxTmlbModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbModal.vue'
import WjxWjxxTmlbDjModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjModal.vue'
import WjxWjxxTmlbDjjgModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgModal.vue'
import WjxWjxxTmlbDjjgsDcModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgsDcModal.vue'
import XxhbbksListModal from '/@/views/kc/xxhbbks/XxhbbksListModal.vue';
import {useRouter} from "vue-router";
const queryParam = ref<any>({});
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh,xqxn,typa} = query;//
const queryParam = ref<any>({rwbh : rwbh,xqxn : xqxn,atype : "1"});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const WjxWjxxTmlbModalPage = ref();
const WjxWjxxTmlbDjModalPage = ref();
const WjxWjxxTmlbDjjgModalPage = ref();
const WjxWjxxTmlbDjjgsDcModalPage = ref();
const XxhbbksListModalPage = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '问卷信息',
title: '',
api: list,
columns,
canResize:false,
@ -109,7 +118,7 @@
*/
function handleAdd() {
registerModal.value.disableSubmit = false;
registerModal.value.add();
registerModal.value.add("1");
}
/**
@ -125,7 +134,7 @@
*/
function handlePeizhi(record: Recordable) {
WjxWjxxTmlbModalPage.value.disableSubmit = false;
WjxWjxxTmlbModalPage.value.edit(record);
WjxWjxxTmlbModalPage.value.edit(record,"1");
}
/**
@ -133,24 +142,24 @@
*/
function handlePeizhiXq(record: Recordable) {
WjxWjxxTmlbDjModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjModalPage.value.edit(record,true);
WjxWjxxTmlbDjModalPage.value.edit(record,true,"1",'ls');
}
/**
* 答卷详
*/
function handlePeizhiDj(record: Recordable) {
WjxWjxxTmlbDjModalPage.value.disableSubmit = false;
WjxWjxxTmlbDjModalPage.value.edit(record,false);
}
/**
* 答卷详
*/
function handlePeizhiDjjg(record: Recordable) {
WjxWjxxTmlbDjjgModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjjgModalPage.value.edit(record,false);
}
// /**
// *
// */
// function handlePeizhiDj(record: Recordable) {
// WjxWjxxTmlbDjModalPage.value.disableSubmit = false;
// WjxWjxxTmlbDjModalPage.value.edit(record,false);
// }
//
// /**
// *
// */
// function handlePeizhiDjjg(record: Recordable) {
// WjxWjxxTmlbDjjgModalPage.value.disableSubmit = true;
// WjxWjxxTmlbDjjgModalPage.value.edit(record,false);
// }
/**
* 详情
@ -160,8 +169,19 @@
registerModal.value.edit(record);
}
/**
* 学生答卷列表
*/
function handleDjjgs(record: Recordable,flag) {
WjxWjxxTmlbDjjgsDcModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjjgsDcModalPage.value.edit(record, flag);
}
/**
* 发布
*/
function handleFabu(record: Recordable) {
defHttp.get({ url: '/wjxWjxx/wjxWjxx/fbwj', params: { id: record.id } }).then(res => {
defHttp.get({ url: '/wjxWjxx/wjxWjxx/fbwj', params: { id: record.id,wjlx: "1" } }).then(res => {
reload();
});
}
@ -192,21 +212,17 @@
function getTableAction(record) {
if(record.qpublish == '1'){
return [
{
label: '配置详情',
onClick: handlePeizhiXq.bind(null, record),
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '答卷',
onClick: handlePeizhiDj.bind(null, record),
label: '配置详情',
onClick: handlePeizhiXq.bind(null, record),
},
{
label: '答卷结果',
onClick: handlePeizhiDjjg.bind(null, record),
label: '学生列表',
onClick: handleDjjgs.bind(null, record,"1"),
},
]
}else{
@ -224,9 +240,6 @@
onClick: handleFabu.bind(null, record),
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
@ -257,6 +270,9 @@
*/
function searchReset() {
queryParam.value = {};
queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn;
queryParam.value.atype = "1";
selectedRowKeys.value = [];
//
reload();
@ -278,6 +294,7 @@
<style lang="less" scoped>
.jeecg-basic-table-form-container {
padding: 0;
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;

View File

@ -5,17 +5,9 @@ import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
{
title: '创建人',
title: '是否发布问卷',
align: "center",
dataIndex: 'createBy'
},
{
title: '创建时间',
align: "center",
dataIndex: 'createTime',
customRender:({text}) =>{
return !text?"":(text.length>10?text.substr(0,10):text);
},
dataIndex: 'qpublish_dictText'
},
{
title: '问卷名称',
@ -23,26 +15,34 @@ export const columns: BasicColumn[] = [
dataIndex: 'title'
},
{
title: '问卷类型',
title: '开始时间',
align: "center",
dataIndex: 'atype',
customRender: ({ text }) => {
let dictMap = {
'1': '调查',
'6': '考试',
}
return dictMap[text??''];
}
dataIndex: 'startTime'
},
{
title: '问卷描述',
title: '结束时间',
align: "center",
dataIndex: 'content'
dataIndex: 'endTime'
},
{
title: '是否发布问卷',
title: '学期学年',
align: "center",
dataIndex: 'qpublish_dictText'
dataIndex: 'xqxn'
},
{
title: '选课人数',
align: "center",
dataIndex: 'xkrs'
},
{
title: '未提交',
align: "center",
dataIndex: 'wwcrs'
},
{
title: '已提交',
align: "center",
dataIndex: 'ywcrs'
},
];

View File

@ -8,15 +8,13 @@
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="问卷类型" v-bind="validateInfos.atype">
<a-select
ref="select"
v-model:value="formData.atype"
style="width: 120px"
>
<a-select-option value="1">调查</a-select-option>
<a-select-option value="6">考试</a-select-option>
</a-select>
<a-form-item label="开始时间" v-bind="validateInfos.startTime">
<a-date-picker placeholder="请选择开始时间" v-model:value="formData.startTime" value-format="YYYY-MM-DD HH:mm:ss" :show-time="true" style="width: 100%" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="结束时间" v-bind="validateInfos.endTime">
<a-date-picker placeholder="请选择结束时间" v-model:value="formData.endTime" value-format="YYYY-MM-DD HH:mm:ss" :show-time="true" style="width: 100%" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="24">
@ -24,37 +22,55 @@
<a-textarea v-model:value="formData.content" rows="4" placeholder="请输入问卷描述" :disabled="disabled"/>
</a-form-item>
</a-col>
<!-- <a-col :span="24">
<a-form-item label="是否发布问卷" v-bind="validateInfos.qpublish">
<j-dict-select-tag type='radio' v-model:value="formData.qpublish" dictCode="yn" placeholder="请选择是否发布问卷" :disabled="disabled"/>
<a-col :span="24">
<a-form-item label="学年学期">
<a-input v-model:value="formData.xqxn" disabled></a-input>
</a-form-item>
</a-col> -->
</a-col>
<a-col :span="24">
<a-form-item label="课程名称">
<a-input v-model:value="formData.kcmc" disabled></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="选课人数">
<a-input v-model:value="formData.xkrs" 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 {ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted, unref} from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../WjxWjxx.api';
import { Form } from 'ant-design-vue';
import {useRouter} from "vue-router";
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh,xqxn } = query;//
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: ()=>{} },
formBpm: { type: Boolean, default: true }
});
const atype = ref(<string>(''));
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
id: '',
title: '',
atype: '1',
atype: '',
content: '',
// qpublish: '',
});
@ -64,8 +80,7 @@
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
title: [{ required: true, message: '请输入问卷名称!'},],
atype: [{ required: true, message: '请选择问卷类型!'},],
title: [{ required: true, message: '请输入问卷名称!'},]
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
@ -81,12 +96,25 @@
return props.formDisabled;
});
function init(){
defHttp.get({ url: '/wjxWjxx/wjxWjxx/kcxx', params: { rwbh: rwbh,xqxn: xqxn } }).then(res => {
formData.xqxn = xqxn;
formData.rwbh = rwbh;
formData.atype = atype.value;
formData.kcmc = res.kcmc;
formData.xkrs = res.xkrs;
formData.startTime = '';
formData.endTime = '';
});
}
/**
* 新增
*/
function add() {
function add(value) {
atype.value = value;
edit({});
init();
}
/**

View File

@ -7,7 +7,7 @@
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import WjxWjxxForm from './WjxWjxxForm.vue'
const title = ref<string>('');
const width = ref<number>(800);
const visible = ref<boolean>(false);
@ -18,14 +18,14 @@
/**
* 新增
*/
function add() {
function add(value) {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
registerForm.value.add(value);
});
}
/**
* 编辑
* @param record
@ -37,7 +37,7 @@
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/

View File

@ -15,9 +15,9 @@
<span>{{index+1}}</span><span v-html:value="item.wjTitle" style="white-space:pre-wrap;word-wrap : break-word"></span>
</template>
<template #extra>
<span style="margin-left: 40px;">题目分值 {{item.wjScore}} </span>
<span style="margin-left: 40px;" v-if="isShow">题目分值 {{item.wjScore}} </span>
</template>
<a-radio-group v-model:value="item.itemSelected" style="width: 100%" size="default" :disabled="disabled" >
<a-radio-group v-model:value="item.itemSelected" style="width: 100%" size="default" :disabled="disabled">
<div style="width: 100%" v-for="(tmxx,index) in item.wjxWjxxTmxxList">
<a-radio :value="tmxx.itemIndex+``" style="width: 100%;margin-bottom: 5px;">
<span v-html:value="tmxx.itemTitle" style="width:80%;font-size: 16px;"></span>
@ -34,9 +34,9 @@
<span>{{index+1}}</span><span v-html:value="item.wjTitle" style="white-space:pre-wrap;word-wrap : break-word"/>
</template>
<template #extra>
<span style="margin-left: 40px;">题目分值 {{item.wjScore}} </span>
<span style="margin-left: 40px;" v-if="isShow">题目分值 {{item.wjScore}} </span>
</template>
<a-checkbox-group v-model:value="item.itemSelected" style="width: 100%" size="default" :disabled="disabled" >
<a-checkbox-group v-model:value="item.itemSelected" style="width: 100%" size="default" :disabled="disabled">
<a-row>
<a-col :span="24" v-for="(tmxx,index) in item.wjxWjxxTmxxList">
<a-checkbox :value="tmxx.itemIndex" style="width: 100%;margin-bottom: 5px;">
@ -47,6 +47,23 @@
</a-checkbox-group>
</a-card>
</div>
<!-- 多选题 -->
<div style="width: 100%;" v-else-if="item.wjType==5">
<div style="text-align: left;width: 100%;font-weight: bold;font-size: 18px;padding: 20px;">填空题</div>
<a-card >
<template #title>
<span>{{index+1}}</span><span v-html:value="item.wjTitle" style="white-space:pre-wrap;word-wrap : break-word"/>
</template>
<template #extra>
<span style="margin-left: 40px;" v-if="isShow">题目分值 {{item.wjScore}} </span>
</template>
<a-row>
<a-col :span="24">
<a-textarea placeholder="请填写答案" v-model:value="item.wjAnswer" style="width:100%;" :auto-size="{ minRows: 2, maxRows: 5 }" :disabled="disabled"/>
</a-col>
</a-row>
</a-card>
</div>
<div v-else>
无对应类型
</div>
@ -69,6 +86,7 @@ import {
} from '/@/views/kc/wjxWjxxTmlb/WjxWjxxTmlb.api';
const title = ref<string>('');
const mainId = ref<string>('');
const isShow = ref<boolean>(false);
const disabled = ref<boolean>(false);
const confirmLoading = ref<boolean>(false);
const tiganData = ref<any>([]);
@ -79,44 +97,61 @@ const { createMessage } = useMessage();
const emit = defineEmits(['ok', 'closeLoading']);
//
function edit(record,isDisabled){
function edit(record,isDisabled,type,flag){
openTime.value = getCurrentTimeFormat();
tiganData.value = [];
disabled.value = isDisabled;
if(type == '6'){
isShow.value = true;
}else if(type == '1'){
isShow.value = false;
}
title.value = record.title;
mainId.value = record.id;
defHttp.get({url:'/wjxWjxxTmlb/wjxWjxxTmlb/queryByMainId',params:{id:record.id}}).then(res =>{
console.log(`🚀 ~ defHttp.get ~ res:`, res)
var list = res;
for(var i=0;i<list.length;i++){
var par = list[i];
if(disabled.value){
if(par.wjType==4){
var lssj = par.itemSelected.split(",");
const numArray = lssj.map(str => parseInt(str));
list[i].itemSelected = numArray;
if(flag == 'ls'){
defHttp.get({url:'/wjxWjxxTmlb/wjxWjxxTmlb/queryByMainId',params:{id:record.id}}).then(res =>{
// console.log(`🚀 ~ defHttp.get ~ res:`, res)
let list = res;
for(let i=0;i<list.length;i++){
let par = list[i];
if(disabled.value){
if(par.wjType==4){
let lssj = par.itemSelected.split(",");
const numArray = lssj.map(str => parseInt(str));
list[i].itemSelected = numArray;
}
}
}else{
par.itemSelected = null;
}
}
tiganData.value = res;
})
tiganData.value = res;
})
}else{
defHttp.get({url:'/wjxWjxxTmlb/wjxWjxxTmlb/queryDjByMainId',params:{id:record.id}}).then(res =>{
tiganData.value = res;
})
}
}
//
async function submitForm(){
const data = tiganData.value;
console.log(`🚀 ~ submitForm ~ data:`, data)
// console.log(`🚀 ~ submitForm ~ data:`, data)
const values = Object.assign([], data);
for(var i=0;i<values.length;i++){
var param = values[i];
if(param.itemSelected == null){
emit('closeLoading');
createMessage.warning("有题目没有作答,请检查试卷,完成所有作答!");
return;
for(let i=0;i<values.length;i++){
let param = values[i];
if(param.wjType == 3 || param.wjType == 4){
if(param.itemSelected == null){
emit('closeLoading');
createMessage.warning("有题目没有作答,请检查试卷,完成所有作答!");
return;
}
values[i].itemSelected = param.itemSelected+"";
}else if(param.wjType == 5){
if(param.wjAnswer == null){
emit('closeLoading');
createMessage.warning("有题目没有作答,请检查试卷,完成所有作答!");
return;
}
}
values[i].itemSelected = param.itemSelected+"";
values[i].openTime = openTime.value;
}
const isUpdate = false

View File

@ -20,12 +20,12 @@
* 编辑
* @param record
*/
function edit(record,isDisabled) {
title.value = disableSubmit.value ? '详情' : '编辑';
function edit(record,isDisabled,type,flag) {
title.value = disableSubmit.value ? '配置详情' : '答卷';
visible.value = true;
loading.value = false;
nextTick(() => {
registerForm.value.edit(record,isDisabled);
registerForm.value.edit(record,isDisabled,type,flag);
});
}

View File

@ -5,8 +5,9 @@
<a-col :span="24" style="overflow-y: scroll;height: calc(80vh);">
<div style="text-align: center;width: 100%;font-weight: bold;font-size: 20px;padding: 20px;">{{ djxxData.title }}</div>
<div style="text-align: right;font-size: 16px;padding-right: 20px;">
<span v-if="djxxData.atype == 6" style="text-decoration: underline;margin-right: 15px;">总分{{ djxxData.totalScore }} </span>
<span v-if="djxxData.atype == 6" style="text-decoration: underline;margin-right: 15px;">得分{{ djxxData.score }} </span>
<span style="text-decoration: underline;margin-right: 15px;">答卷人{{ djxxData.userName }} </span>
<span v-if="djxxData.atype == 6" style="text-decoration: underline;margin-right: 15px;">总分{{ djxxData.totalScore }} </span>
<span v-if="djxxData.atype == 6" style="text-decoration: underline;margin-right: 15px;">得分{{ djxxData.score }} </span>
<span style="text-decoration: underline;margin-right: 15px;">用时{{djxxData.answerSfm}} </span>
</div>
<!-- 题干信息 -->
@ -53,6 +54,24 @@
</a-checkbox-group>
</a-card>
</div>
<!-- 填空题 -->
<div style="width: 100%;" v-else-if="item.wjType==5">
<div style="text-align: left;width: 100%;font-weight: bold;font-size: 18px;padding: 20px;">填空题</div>
<a-card >
<template #title>
<span>{{index+1}}</span><span v-html:value="item.wjTitle" style="white-space:pre-wrap;word-wrap : break-word"/>
</template>
<template #extra v-if="djxxData.atype == 6">
<div style="margin-left: 40px;">题目分值 {{item.wjScore}} </div>
<div style="margin-left: 40px;">所得分值 {{item.itemScore}} </div>
</template>
<a-row>
<a-col :span="24">
<a-textarea v-model:value="item.answerText" style="width:100%;" :auto-size="{ minRows: 2, maxRows: 5 }" disabled/>
</a-col>
</a-row>
</a-card>
</div>
<div v-else>
无对应类型
</div>
@ -83,16 +102,15 @@ const { createMessage } = useMessage();
const emit = defineEmits(['register', 'success']);
//
function edit(record){
function edit(id){
tiganData.value = [];
mainId.value = record.id;
defHttp.get({url:'/wjxDjxx/queryByMainId',params:{id:record.id}}).then(res =>{
console.log(`🚀 ~ defHttp.get ~ res:`, res)
mainId.value = id;
defHttp.get({url:'/wjxDjxx/queryByMainId',params:{id:id}}).then(res =>{
// console.log(`🚀 ~ defHttp.get ~ res:`, res)
let djxx = res;
let list = djxx.wjxDjxxTmxxList;
for(let i=0;i<list.length;i++){
let par = list[i];
console.log(par);
if(par.wjType==4){
let lssj = par.itemSelected.split(",");
const numArray = lssj.map(str => parseInt(str));

View File

@ -19,11 +19,11 @@
* 编辑
* @param record
*/
function edit(record) {
function edit(id) {
title.value = disableSubmit.value ? '答卷结果' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
registerForm.value.edit(id);
});
}

View File

@ -0,0 +1,15 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/wjxDjxx/djjglist',
}
/**
*
* @param params
*/
export const list = (params) => defHttp.get({ url: Api.list, params });

View File

@ -0,0 +1,169 @@
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: '问卷名称',
align: "center",
dataIndex: 'title',
width: 200
},
{
title: '学号',
align: "center",
dataIndex: 'userId',
width: 100
},
{
title: '学生',
align: "center",
dataIndex: 'userName',
width: 100
},
{
title: '得分',
align: "center",
dataIndex: 'score',
width: 80
},
{
title: '总分数',
align: "center",
dataIndex: 'totalScore',
width: 80
},
{
title: '答卷时间',
align: "center",
dataIndex: 'openTime',
width: 150
},
{
title: '交卷时间',
align: "center",
dataIndex: 'commitTime',
width: 150
},
{
title: '答卷用时',
align: "center",
dataIndex: 'answerSfm',
width: 80
},
{
title: '学期学年',
align: "center",
dataIndex: 'xqxn',
width: 80
},
{
title: '课程名称',
align: "center",
dataIndex: 'kcmc',
width: 200
},
{
title: '开始时间',
align: "center",
dataIndex: 'startTime',
width: 150
},
{
title: '结束时间',
align: "center",
dataIndex: 'endTime',
width: 150
},
{
title: '问卷描述',
align: "center",
dataIndex: 'content',
width: 200
},
];
export const dccolumns: BasicColumn[] = [
{
title: '问卷名称',
align: "center",
dataIndex: 'title',
width: 200
},
{
title: '学号',
align: "center",
dataIndex: 'userId',
width: 100
},
{
title: '学生',
align: "center",
dataIndex: 'userName',
width: 100
},
{
title: '答卷时间',
align: "center",
dataIndex: 'openTime',
width: 150
},
{
title: '交卷时间',
align: "center",
dataIndex: 'commitTime',
width: 150
},
{
title: '答卷用时',
align: "center",
dataIndex: 'answerSfm',
width: 80
},
{
title: '学期学年',
align: "center",
dataIndex: 'xqxn',
width: 80
},
{
title: '课程名称',
align: "center",
dataIndex: 'kcmc',
width: 200
},
{
title: '开始时间',
align: "center",
dataIndex: 'startTime',
width: 150
},
{
title: '结束时间',
align: "center",
dataIndex: 'endTime',
width: 150
},
{
title: '问卷描述',
align: "center",
dataIndex: 'content',
width: 200
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,108 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" >
<!--操作栏-->
<template #action="{ record }" v-if="isFinished=='1'">
<TableAction :actions="getTableAction(record)"/>
</template>
</BasicTable>
<!-- 表单区域 -->
<WjxWjxxTmlbDjjgModal ref="WjxWjxxTmlbDjjgModalPage" @success="handleSuccess"></WjxWjxxTmlbDjjgModal>
</div>
</template>
<script lang="ts" name="wjxWjxx-wjxWjxx" setup>
import {ref, reactive, defineExpose, unref} from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { defHttp } from '/@/utils/http/axios';
import { useListPage } from '/@/hooks/system/useListPage';
import {dccolumns} from './WjxWjxxTmlbDjjgs.data';
import { list } from './WjxWjxxTmlbDjjgs.api';
import WjxWjxxTmlbDjjgModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgModal.vue'
const queryParam = ref<any>({});
const isFinished = ref<string>('');
const toggleSearchStatus = ref<boolean>(false);
const WjxWjxxTmlbDjjgModalPage = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '',
api: list,
columns:dccolumns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
params.column = '',params.order = '';//
return Object.assign(params, queryParam.value);
},
}
});
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 handlePeizhiDjjg(record: Recordable) {
WjxWjxxTmlbDjjgModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjjgModalPage.value.edit(record.id,false);
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '答卷结果',
onClick: handlePeizhiDjjg.bind(null, record),
}
]
}
function init(record,flag){
queryParam.value.id = record.id;
queryParam.value.rwbh = record.rwbh;
queryParam.value.isFinished = flag;
isFinished.value = flag;
reload();
}
defineExpose({
init
});
</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,67 @@
<template>
<a-modal :title="title" :width="width" centered :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<WjxWjxxTmlbDjjgsDcList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></WjxWjxxTmlbDjjgsDcList>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import WjxWjxxTmlbDjjgsDcList from './WjxWjxxTmlbDjjgsDcList.vue'
const title = ref<string>('');
const width = ref<string>('90%');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 编辑
* @param record
*/
function edit(record,flag) {
if(flag == '1'){
title.value = '已完成答卷学生列表';
}else{
title.value = '已完成答卷学生列表';
}
visible.value = true;
nextTick(() => {
registerForm.value.init(record,flag);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
edit,
disableSubmit,
});
</script>
<style>
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>

View File

@ -0,0 +1,108 @@
<template>
<div>
<!--引用表格-->
<BasicTable @register="registerTable" >
<!--操作栏-->
<template #action="{ record }" v-if="isFinished=='1'">
<TableAction :actions="getTableAction(record)"/>
</template>
</BasicTable>
<!-- 表单区域 -->
<WjxWjxxTmlbDjjgModal ref="WjxWjxxTmlbDjjgModalPage" @success="handleSuccess"></WjxWjxxTmlbDjjgModal>
</div>
</template>
<script lang="ts" name="wjxWjxx-wjxWjxx" setup>
import {ref, reactive, defineExpose, unref} from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { defHttp } from '/@/utils/http/axios';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './WjxWjxxTmlbDjjgs.data';
import { list } from './WjxWjxxTmlbDjjgs.api';
import WjxWjxxTmlbDjjgModal from '/@/views/kc/wjxWjxx/components/WjxWjxxTmlbDjjgModal.vue'
const queryParam = ref<any>({});
const isFinished = ref<string>('');
const toggleSearchStatus = ref<boolean>(false);
const WjxWjxxTmlbDjjgModalPage = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '',
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 120,
fixed: 'right',
},
beforeFetch: (params) => {
params.column = '',params.order = '';//
return Object.assign(params, queryParam.value);
},
}
});
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 handlePeizhiDjjg(record: Recordable) {
WjxWjxxTmlbDjjgModalPage.value.disableSubmit = true;
WjxWjxxTmlbDjjgModalPage.value.edit(record.id,false);
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
{
label: '答卷结果',
onClick: handlePeizhiDjjg.bind(null, record),
}
]
}
function init(record,flag){
queryParam.value.id = record.id;
queryParam.value.rwbh = record.rwbh;
queryParam.value.isFinished = flag;
isFinished.value = flag;
reload();
}
defineExpose({
init
});
</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,67 @@
<template>
<a-modal :title="title" :width="width" centered :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<WjxWjxxTmlbDjjgsList ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></WjxWjxxTmlbDjjgsList>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import WjxWjxxTmlbDjjgsList from './WjxWjxxTmlbDjjgsList.vue'
const title = ref<string>('');
const width = ref<string>('90%');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 编辑
* @param record
*/
function edit(record,flag) {
if(flag == '1'){
title.value = '已完成答卷学生列表';
}else{
title.value = '已完成答卷学生列表';
}
visible.value = true;
nextTick(() => {
registerForm.value.init(record,flag);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
edit,
disableSubmit,
});
</script>
<style>
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>

View File

@ -6,6 +6,7 @@
<a-card title="可选题型" style="height: 450px;border: 1px solid #e8e8e8;">
<p><a-button type="primary" preIcon="ant-design:check-circle-outlined" @click="addTigan(3)">单选</a-button></p>
<p><a-button type="primary" preIcon="ant-design:check-square-outlined" @click="addTigan(4)">多选</a-button></p>
<p><a-button type="primary" preIcon="ant-design:check-square-outlined" @click="addTigan(5)">填空</a-button></p>
</a-card>
</a-col>
<a-col :span="20" style="overflow-y: scroll;height: calc(80vh);">
@ -17,10 +18,10 @@
<div style="width: 100%;" v-if="item.wjType==3">
<a-card >
<template #title>
<span>{{index+1}}</span><a-textarea placeholder="请填写单选题题干" v-model:value="item.wjTitle" style="width: 75%" auto-size/>
<span>{{index+1}}</span><a-textarea placeholder="请填写单选题题干" v-model:value="item.wjTitle" style="width: 75%" :auto-size="{ minRows: 2, maxRows: 5 }"/>
</template>
<template #extra>
<a-tooltip placement="topRight" title="题目分数">
<a-tooltip placement="topRight" title="题目分数" v-if="isShow">
<a-select style="width: 120px" v-model:value="item.wjScore" placeholder="请选择分数">
<a-select-option value="5">5</a-select-option>
<a-select-option value="4">4</a-select-option>
@ -31,7 +32,12 @@
</a-tooltip >
<a-tooltip placement="topRight" title="删除此题"><Icon icon="ant-design:delete-outlined" style="cursor: pointer;font-size: 20px;margin: 10px" @click="handleDelTigan(item,index)" /></a-tooltip >
</template>
<a-radio-group v-model:value="item.itemSelected" style="width: 100%" size="default">
<a-row v-if="isShow">
<a-col :span="24" style="color: darkgrey;font-size: 13px;">
选中即为正确答案
</a-col>
</a-row>
<a-radio-group v-model:value="item.itemSelected" style="width: 100%" size="default" :disabled="!isShow">
<div style="width: 100%" v-for="(tmxx,index) in item.wjxWjxxTmxxList">
<a-radio :value="tmxx.itemIndex+``" style="width: 100%"><a-input placeholder="请填写标题" v-model:value="tmxx.itemTitle" :bordered="false" style="width:80%;"/>
<a-tooltip placement="topLeft" title="在下方添加新的选项"><Icon icon="ant-design:plus-circle-outlined" style="cursor: pointer;margin:5px;font-size:20px;color: #1890ff;" @click="handleAddTmxx(tmxx,index,item.wjxWjxxTmxxList)" /></a-tooltip >
@ -45,10 +51,10 @@
<div style="width: 100%;" v-else-if="item.wjType==4">
<a-card >
<template #title>
<span>{{index+1}}</span><a-textarea placeholder="请填写多选题题干" v-model:value="item.wjTitle" style="width: 75%" auto-size/>
<span>{{index+1}}</span><a-textarea placeholder="请填写多选题题干" v-model:value="item.wjTitle" style="width: 75%" :auto-size="{ minRows: 2, maxRows: 5 }"/>
</template>
<template #extra>
<a-tooltip placement="topRight" title="题目分数">
<a-tooltip placement="topRight" title="题目分数" v-if="isShow">
<a-select style="width: 120px" v-model:value="item.wjScore" placeholder="请选择分数">
<a-select-option value="5">5</a-select-option>
<a-select-option value="4">4</a-select-option>
@ -59,7 +65,12 @@
</a-tooltip >
<a-tooltip placement="topRight" title="删除此题"><Icon icon="ant-design:delete-outlined" style="cursor: pointer;font-size: 20px;margin: 10px" @click="handleDelTigan(item,index)" /></a-tooltip >
</template>
<a-checkbox-group v-model:value="item.itemSelected" style="width: 100%">
<a-row v-if="isShow">
<a-col :span="24" style="color: darkgrey;font-size: 13px;">
选中即为正确答案
</a-col>
</a-row>
<a-checkbox-group v-model:value="item.itemSelected" style="width: 100%" :disabled="!isShow">
<a-row>
<a-col :span="24" v-for="(tmxx,index) in item.wjxWjxxTmxxList">
<a-checkbox :value="tmxx.itemIndex"><a-input placeholder="请填写标题" v-model:value="tmxx.itemTitle" :bordered="false" style="width:80%;"/></a-checkbox>
@ -70,6 +81,31 @@
</a-checkbox-group>
</a-card>
</div>
<!-- 填空题 -->
<div style="width: 100%;" v-else-if="item.wjType==5">
<a-card >
<template #title>
<span>{{index+1}}</span><a-textarea placeholder="请填写填空题题干" v-model:value="item.wjTitle" style="width: 75%" :auto-size="{ minRows: 2, maxRows: 5 }"/>
</template>
<template #extra>
<a-tooltip placement="topRight" title="题目分数" v-if="isShow">
<a-select style="width: 120px" v-model:value="item.wjScore" placeholder="请选择分数">
<a-select-option value="5">5</a-select-option>
<a-select-option value="4">4</a-select-option>
<a-select-option value="3">3</a-select-option>
<a-select-option value="2">2</a-select-option>
<a-select-option value="1">1</a-select-option>
</a-select>
</a-tooltip >
<a-tooltip placement="topRight" title="删除此题"><Icon icon="ant-design:delete-outlined" style="cursor: pointer;font-size: 20px;margin: 10px" @click="handleDelTigan(item,index)" /></a-tooltip >
</template>
<a-row v-if="isShow">
<a-col :span="24">
<a-textarea placeholder="请填写答案" v-model:value="item.wjAnswer" :bordered="true" style="width:100%;" :auto-size="{ minRows: 2, maxRows: 5 }"/>
</a-col>
</a-row>
</a-card>
</div>
<div v-else>
无对应类型
</div>
@ -87,6 +123,7 @@ import { defHttp } from '/@/utils/http/axios';
import { queryWjxWjxxTmxxListByMainId, queryDataById, saveOrUpdate } from '/@/views/kc/wjxWjxxTmlb/WjxWjxxTmlb.api';
const title = ref<string>('');
const mainId = ref<string>('');
const isShow = ref<boolean>(false);
const confirmLoading = ref<boolean>(false);
const tiganData = ref<any>([]);
const tmxxPar = ref<any>({});
@ -97,30 +134,40 @@ const emit = defineEmits(['register', 'success']);
function addTigan(type){
var list = tiganData.value;
if(type==3){
var params = {
let params = {
wjType:parseInt(type),
wjIndex:list.length+1,
mainId:mainId,
wjTitle:null,
wjScore:null,
itemSelected:'1',
// itemSelected:'1',
wjxWjxxTmxxList:[{itemTitle:null,itemIndex:'1'},{itemTitle:null,itemIndex:'2'}],
}
list.push(params);
tiganData.value = [...list];
}else if(type==4){
var params = {
let params = {
wjType:parseInt(type),
wjIndex:list.length+1,
mainId:mainId,
wjTitle:null,
wjScore:null,
itemSelected:['1'],
// itemSelected:['1'],
wjxWjxxTmxxList:[{itemTitle:null,itemIndex:'1'},{itemTitle:null,itemIndex:'2'}],
}
list.push(params);
tiganData.value = [...list];
}else if(type==5){
let params = {
wjType:parseInt(type),
wjIndex:list.length+1,
mainId:mainId,
wjTitle:null,
wjScore:null,
wjAnswer:null,
}
list.push(params);
tiganData.value = [...list];
}
}
//
@ -140,7 +187,7 @@ function handleRemTmxx(record,index,list){
}
}
function getType(value,type){
console.log(`🚀 ~ getType ~ value,type:`, value,type)
// console.log(`🚀 ~ getType ~ value,type:`, value,type)
if(type=='3'){
return parseInt(value);
}else if(type=='4'){
@ -148,12 +195,17 @@ function getType(value,type){
}
}
//
function edit(record){
function edit(record,type){
tiganData.value = [];
title.value = record.title;
mainId.value = record.id;
if(type == '6'){
isShow.value = true;
}else if(type == '1'){
isShow.value = false;
}
defHttp.get({url:'/wjxWjxxTmlb/wjxWjxxTmlb/queryByMainId',params:{id:record.id}}).then(res =>{
console.log(`🚀 ~ defHttp.get ~ res:`, res)
// console.log(`🚀 ~ defHttp.get ~ res:`, res)
var list = res;
for(var i=0;i<list.length;i++){
var par = list[i];
@ -170,17 +222,20 @@ function edit(record){
//
async function submitForm(){
const data = tiganData.value;
console.log(`🚀 ~ submitForm ~ data:`, data)
// console.log(`🚀 ~ submitForm ~ data:`, data)
const values = Object.assign([], data);
for(var i=0;i<values.length;i++){
var param = values[i];
values[i].itemSelected = param.itemSelected+"";
if(values.length>0){
for(let i=0;i<values.length;i++){
let param = values[i];
values[i].itemSelected = param.itemSelected+"";
}
const isUpdate = false
await saveOrUpdate(values, isUpdate);
//
emit('ok');
}else{
createMessage.error('至少创建一个试题');
}
const isUpdate = false
await saveOrUpdate(values, isUpdate);
//
emit('ok');
}
defineExpose({

View File

@ -7,7 +7,7 @@
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import WjxWjxxTmlbForm from './WjxWjxxTmlbForm.vue'
const title = ref<string>('');
const width = ref<string>('100%');
const visible = ref<boolean>(false);
@ -15,19 +15,19 @@
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 编辑
* @param record
*/
function edit(record) {
function edit(record,type) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
registerForm.value.edit(record,type);
});
}
/**
* 确定按钮点击事件
*/

View File

@ -19,7 +19,7 @@
<!-- 任教教程 -->
<renKeJiaoChengPage v-if="getUserSf()=='T'&&getSysConfig().flag2=='1'&&getSysConfig().sfbmd=='n'" />
<!-- 评价结果 -->
<pjjgPage v-if="getSysConfig().sfbmd=='n'"/>
<pjjgPage v-if="getSysConfig().sfbmd=='n'&&getUserSf()=='T'"/>
<!-- 预约课程 -->
<yuYueKeChengPage ref="yykcModeal" @orther-load="yykcLoad" v-if="getUserSf()=='T'&&getSysConfig().flag3=='1'"/>
<!-- 精彩公开课 -->

View File

@ -0,0 +1,194 @@
<template>
<div style="width:100%;text-align: right;line-height:40px;">
<!-- <a style="padding-right: 0.5rem;" @click="init()">刷新</a>
<RouterLink to="/site/xspjjgore">查看更多</RouterLink> -->
</div>
<a-list item-layout="horizontal" :data-source="list" :grid="{ gutter: 12, xs: 2, sm: 3, md: 3, lg: 3, xl: 3, xxl: 3, xxxl: 3 }">
<template #renderItem="{ item }">
<a-list-item>
<div style="border: 2px #eef1f2 solid;">
<div>
<div style="width: 100%;height: 20px;background-color: #1c84c6;"></div>
<div style="width:100%;white-space:normal; word-break:break-all;overflow:hidden;padding: 10px;height: 70px;font-weight: 600;font-size: 16px;">
{{ item.kcmc }}
</div>
</div>
<a-divider style="margin: 0px;color: #eef1f2;" />
<div style="padding: 20px;font-weight: 600;">
<a-row>
<a-col :span="16">
<div style="height: 38px;font-size: 16px;font-weight: 700;">{{ item.skjs }}</div>
<div style="font-size: 14px;font-weight: 700;height: 50px;">{{ item.kkdw }}</div>
</a-col>
<a-col :span="8" style="text-align: center;height: 70px;">
<div style="color: #1c84c6;font-size: 24px;font-weight: 600;">{{ item.xsrs }}</div>
<div style="font-size: 14px;font-weight: 700;">学生人数</div>
</a-col>
<a-col :span="24" style="margin-top:0px;font-weight: 700;">
<div>样本总数{{ item.ybzs }}</div>
<div> {{ item.cpl }}(%)</div>
<div> {{ item.yxs }}</div>
<div>综合评价{{ item.zhpj }}</div>
</a-col>
<a-col :span="24">
<a-row style="text-align: center;">
<a-col :span="24">
<a-button type="primary" class="bcClass" @click="openJspjPage(item)" >详情</a-button>
</a-col>
</a-row>
</a-col>
</a-row>
</div>
</div>
</a-list-item>
</template>
</a-list>
<a-pagination v-model="current" :total="total" show-less-items @change="handlePageChange" v-if="props.flagPage" style="text-align: right;" :hideOnSinglePage="true"/>
<KcXsktjxmydcpDetailModal ref="KcXsktjxmydcpDetailModalPage"/>
</template>
<script setup lang="ts">
import { ref, onMounted, watch,unref } from 'vue';
import { TeamOutlined, FormOutlined } from '@ant-design/icons-vue';
import { Pagination } from 'ant-design-vue';
import { getUserId, getSysConfig } from '/@/views/site/utils/index';
import { useRouter } from 'vue-router';
import KcXsktjxmydcpDetailModal from '/@/views/kc/kcXsktjxmydcp/components/KcXsktjxmydcpDetailModal.vue';
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh,xqxn } = query;//
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/kcXsktjxmydcp/kcXsktjxmydcp/groupByList'
}
const KcXsktjxmydcpDetailModalPage = ref();
const current = ref<number>(0);
const total = ref<number>(2);
const loadingList = ref<boolean>(false);
const APagination = Pagination;
const emit = defineEmits(['changeParam']);
const props = defineProps({
queryParam: { type: Object, default: () => ({}) },
flagPage: { type:Boolean,default:false}
});
/**
* 列表接口
* @param params
*/
const listApi = (params) => defHttp.get({ url: Api.list, params });
const list = ref<any>([]);
onMounted(() => {
init();
});
watch(
() => props.queryParam,
(v) => init(),
{
deep:true,
immediate:true,
}
);
async function init() {
console.log('init');
loadingList.value = true;
console.log('props.queryParam-1-->',props.queryParam);
await defHttp.get({ url: '/ktgl/kcKechengbiao/getKcxxByRwbhXqxn', params: { rwbh:rwbh,xqxn:xqxn } }).then((res) => {
console.log(`🚀 ~ defHttp.get ~ res:`, res)
props.queryParam.kcbh = res.kcbh;
});
console.log('props.queryParam-2-->',props.queryParam);
await listApi({ jgh: getUserId(), searchByNowXqxn: true, ...props.queryParam }).then(res => {
list.value = res?.records ?? [];
total.value = res.total;
current.value = res.current;
list.value = res.records
loadingList.value = false
});
}
function handlePageChange(record){
emit('changeParam',record);
// loadData();
}
/**
* 转换时间由0012转成00:12
* @param time 四个字符时分无分隔
*/
function formatTime(time: string) {
if(!time) return '';
let t_i_m_e = time.split('');
return [t_i_m_e[0],t_i_m_e[1],':',t_i_m_e[2],t_i_m_e[3]].join('');
}
function onSearch() {
init();
}
//
function openJspjPage(item) {
KcXsktjxmydcpDetailModalPage.value.disableSubmit = true;
KcXsktjxmydcpDetailModalPage.value.edit(item)
}
defineExpose({
onSearch
});
</script>
<style lang="less" scoped>
.wenZiJuZhong {
text-align: center;
}
.wenZiJiaCu {
font-weight: 700;
}
.fs1d1r {
font-size: 16px;
min-height: 55.281px;
}
.hand {
cursor:pointer;
}
.dateAndTime {
padding-top: 10px;
}
.yyyClass{
background: #6cafda;font-weight: 600;color:#fff;border-radius: 5px;line-height: 23px;
}
.yyClass{
background-color: #1c84c6;font-weight: 600;color:#fff;border-radius: 5px;line-height: 23px;
}
.bcClass{
background-color: #1c84c6;font-weight: 600;border-radius: 5px;line-height: 23px;
}
.itemDate {
border-radius: 25px;
background: #cccccc8c;
width: 90%;
margin-bottom: 0.5rem;
text-align: center;
margin: 0 auto .5rem;
padding: 0.5rem;
font-weight: 700;
font-size: 16px;
}
</style>

View File

@ -1,33 +1,137 @@
<template>
<div>
<div style="margin-top:10px;background:#fff;height:630px;overflow:auto;">
<a-card>
<div>
<a-row>
<a-col :span="3" style="font-size: 18px;font-weight: bold;">课程介绍</a-col>
<a-col :span="15"><a-textarea style="width: 100%;"></a-textarea></a-col>
<a-col :span="6" style="text-align:right;"><a-button type="primary">提交</a-button><a-button type="primary" style="margin-left:10px;"></a-button></a-col>
</a-row>
</div>
</a-card>
<a-card>
<div>
<span style="float: left;line-height: 30px; font-size: 18px; font-weight: bold;">教学大纲</span>
<span style="width:300px;float: left;">
<span style="float:left;"><j-upload v-model:value="jxdgInfo.filePath"></j-upload></span>
</span>
<span style="float: right;"><a-button type="primary">提交</a-button><a-button type="primary" style="margin-left:10px;"></a-button></span>
</div>
</a-card>
<a-card>
<div style="line-height: 30px; font-size: 18px; font-weight: bold;width:100%;">
<span style="float: left;">常见问题</span>
<span style="float: right;"><a-button type="primary" @click="addCjwtHanle">新增</a-button></span>
</div>
<a-row style="margin-top: 50px;width:100%;display: block;">
<a-col :span="24" v-for="(item,index) in cjwtSource" :key="index">
<a-row>
<a-col :span="24">
<span style="float: left;">{{index+1}}.{{item.question}}</span>
<span style="float: right;">
<a title="修改" @click="handleEdit(item)"><Icon icon="ant-design:form-outlined" /></a>
<a-divider type="vertical" style="height: 30px; background-color: #7cb305" />
<a title="删除" @click="handleDelete(item)"><Icon icon="ant-design:delete-outlined" /></a>
</span>
</a-col>
<a-col :span="24"><span><Icon icon="ant-design:caret-right-outlined" />{{item.answer}}</span></a-col>
<a-col :span="24">
<a-divider />
</a-col>
</a-row>
</a-col>
<a-col :span="24" v-show="cjwtSource.length>0">
<a-pagination v-model="current" :total="total" @change="handlePageChange" :pageSize="pageSize" style="text-align: right;"/>
</a-col>
<a-col :span="24" v-show="cjwtSource.length==0">
<a-empty/>
</a-col>
</a-row>
</a-card>
<a-card>
<div style="line-height: 30px; font-size: 18px; font-weight: bold;width:100%;">
<span style="float: left;">往届学生评价</span>
</div>
<studentPjjgTeaList :queryParam="{ pageSize: 3, ...tkzjParam,kcbh:'' }" style="max-height: 106px;"/>
</a-card>
<ZyCjwtModal ref="ZyCjwtModalPage" @success="handleCjwtOk" />
</div>
</template>
<script lang="ts" setup>
import { ref, onMounted, unref } from 'vue';
import { getUserSf,getSysConfig } from '/@/views/site/utils/index';
import { defHttp } from '/@/utils/http/axios';
import { useRouter } from 'vue-router';
import { Icon } from '/@/components/Icon';
import { Pagination, Empty } from 'ant-design-vue';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import { deleteOne } from '/@/views/zy/zyCjwt/ZyCjwt.api';
import headerPage from '/@/views/site/common/header.vue';
import footerPage from '/@/views/site/common/footer.vue';
import dqxqkc from '/@/views/site/renKeJiaoCheng/checkKecheng/dqxqkc.vue';
import studentPjjgTeaList from '/@/views/site/pjjgPage/studentPjjgTeaList.vue';
import ZyCjwtModal from '/@/views/zy/zyCjwt/components/ZyCjwtModal.vue';
const maxClassName = ref<any>({});
const selectedKeys = ref<string[]>([]);
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh } = query;//
const { rwbh,xqxn } = query;//
const APagination = Pagination;
const current = ref<number>(0);
const total = ref<number>(0);
const pageNo = ref<number>(0);
const pageSize = ref<number>(3);
const tkzjParam = ref({rwbh:rwbh});
const ZyCjwtModalPage = ref();
const cjwtSource = ref([]);
let router = useRouter();
console.log(`🚀 ~ router:`, router)
const jxdgInfo = ref({
filePath:''
});
//
function addCjwtHanle(){
var params = { rwbh:rwbh,xqxn:xqxn };
ZyCjwtModalPage.value.disableSubmit = false;
ZyCjwtModalPage.value.add(params);
}
/**
* 常见问题编辑事件
*/
function handleEdit(record: Recordable) {
ZyCjwtModalPage.value.disableSubmit = false;
ZyCjwtModalPage.value.edit(record);
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleCjwtOk);
}
//
function handleCjwtOk() {
console.log('--------cjwt ok -----------')
cjwtData(1);
}
//
function handlePageChange(page: number) {
cjwtData(page);
}
function cjwtData(arg){
defHttp.get({ url: '/zyCjwt/zyCjwt/list', params: { pageSize: 3,pageNo:arg, rwbh:rwbh,xqxn:xqxn } }).then((res) => {
console.log(`🚀 ~ defHttp.get ~ res:`, res)
cjwtSource.value = res.records;
console.log(`🚀 ~ defHttp.get ~ cjwtSource:`, cjwtSource)
});
}
//
onMounted(() => {
console.log('rwbh:',rwbh);
cjwtData(1);
});
</script>

View File

@ -1,37 +1,42 @@
<template>
<div id="siteMain" style="min-height: calc(100vh - 150px);">
<div id="siteMain" style="min-height: calc(100vh - 160px);">
<a-row>
<a-col :span="24">
<a-menu
v-model:selectedKeys="selectedKeys"
style="width: 98%;min-height: calc(100vh - 130px);margin: 10px 0;"
style="width: 98%;min-height: calc(100vh - 142px);margin: 10px 0;"
mode="inline"
>
<a-sub-menu key="sub1">
<template #title>教学内容</template>
<a-menu-item key="1">课程介绍</a-menu-item>
<a-menu-item key="2" @click="getGzt('gonggao')">公告</a-menu-item>
<a-menu-item key="1" @click="getGzt('kcjs')">课程介绍</a-menu-item>
<a-menu-item key="2" @click="getGzt('gonggao')">通知公告</a-menu-item>
<a-menu-item key="3" @click="gotoPageByName('jiaoXueDanYuanNeiRong')">教学单元内容</a-menu-item>
</a-sub-menu>
<a-sub-menu key="sub2">
<template #title>测验/作业</template>
<a-menu-item key="4" @click="getGzt('dqzy')">课程作业</a-menu-item>
<a-menu-item key="5">课程测验</a-menu-item>
<a-menu-item key="5" @click="getGzt('kcjc')">课程测验</a-menu-item>
</a-sub-menu>
<a-menu-item key="sub3">
<span @click="getGzt('dqwj')">问卷调查</span>
<a-sub-menu key="sub3">
<template #title>教学工具</template>
<a-menu-item key="6" @click="getGzt('dcwj')">问卷调查</a-menu-item>
<a-menu-item key="7" @click="getGzt('gongju')">到课率识别</a-menu-item>
</a-sub-menu>
<a-menu-item key="sub4">
<span>教学资源库</span>
</a-menu-item>
<!-- <a-menu-item key="sub3">
<span @click="getGzt('dqwj')">问卷调查</span>
</a-menu-item> -->
<!-- <a-sub-menu key="sub3">
<template #title>问卷管理</template>
<a-menu-item key="6" @click="getGzt('dqwj')">当前问卷</a-menu-item>
<a-menu-item key="7">历史问卷</a-menu-item>
</a-sub-menu> -->
<a-menu-item key="sub4">
<span>资源库</span>
</a-menu-item>
<a-menu-item key="sub5">
<span>工具</span>
</a-menu-item>
<!-- <a-menu-item key="sub5">
<span @click="getGzt('gongju')">教学工具</span>
</a-menu-item> -->
</a-menu>
</a-col>
</a-row>
@ -60,16 +65,23 @@
function getGzt(zytype){
console.log(`🚀 ~ getGzt ~ type:`, zytype)
var param = {rwbh,xqxn,type};
// console.log(`🚀 ~ getGzt ~ type:`, zytype)
var href = "/zy/dqkcDqzy";
if(zytype=='dqzy'){
href = "/zy/dqkcDqzy";
}else if(zytype=='dqwj'){
href = "/zy/dqkcWenjuan";
}else if(zytype=='dcwj'){
href = "/zy/dcwjWenjuan";
}else if(zytype=='lszy'){
href = "/zy/dqkcLszy";
}else if(zytype=='gonggao'){
href = "/zy/tuGonggao";
}else if(zytype=='kcjs'){
href = "/zy/dqkcDetail";
}else if(zytype=='kcjc'){
href = "/zy/ceshiWenjuan";
}else if(zytype=='gongju'){
href = "/zy/dqkcGongju";
}
router.push({path:href,query: {rwbh,xqxn,type}});
@ -93,7 +105,7 @@
#maxSite {
//
max-width: 1070px;
min-height: 750px;
min-height: 730px;
//
margin: 0 auto;
.rowGutter{

View File

@ -1,8 +1,9 @@
<template>
<a-card class="rowGutter" id="rkjcDom">
<template #title>
<span style="font-size: 24px;font-weight: bold;" @click="openKecheng(null)">任教课程</span>
<span style="font-size: 24px;font-weight: bold;" >任教课程</span>
<span style="margin-left: 10px;"><a href="javascript:void(0);" @click="openChangeKcPage">修改课程提醒</a></span>
<span style="margin-left: 10px;"><a href="javascript:void(0);" @click="openKecheng(null)">全部课程</a></span>
</template>
<!-- <template #extra></template> -->
<div class="cardBody">

View File

@ -9,27 +9,22 @@
>
<a-sub-menu key="sub1">
<template #title>课程介绍</template>
<a-menu-item key="1">教学大纲</a-menu-item>
<a-menu-item key="2">常见问题</a-menu-item>
<a-menu-item key="1">课程介绍</a-menu-item>
<a-menu-item key="2">通知公告</a-menu-item>
<a-menu-item key="3">教学单元</a-menu-item>
</a-sub-menu>
<a-menu-item key="sub2">
<span>公告</span>
</a-menu-item>
<a-menu-item key="sub3">
<span>教学日历</span>
</a-menu-item>
<a-sub-menu key="sub4">
<template #title>测验/作业</template>
<a-menu-item key="4" @click="getGzt('dqzy')">当前作业</a-menu-item>
<a-menu-item key="5" @click="getGzt('lszy')">历史作业</a-menu-item>
<a-menu-item key="4" @click="getGzt('dqzy')">课程作业</a-menu-item>
<a-menu-item key="5" @click="getGzt('kcjc')">课程测验</a-menu-item>
</a-sub-menu>
<a-menu-item key="sub5">
<span>课堂调查</span>
<span @click="getGzt('dcwj')">问卷调查</span>
</a-menu-item>
<a-menu-item key="sub5">
<!-- <a-menu-item key="sub6">
<span>讨论区</span>
</a-menu-item>
-->
</a-menu>
</a-col>
</a-row>
@ -47,7 +42,7 @@
import headerPage from '/@/views/site/common/header.vue';
import footerPage from '/@/views/site/common/footer.vue';
import dqxqkc from '/@/views/site/renKeJiaoCheng/checkKecheng/dqxqkc.vue';
const maxClassName = ref<any>({});
const selectedKeys = ref<string[]>([]);
//
@ -55,15 +50,21 @@
const { query } = unref(currentRoute);
const { rwbh,xqxn,type } = query;//
let router = useRouter();
function getGzt(zytype){
console.log(`🚀 ~ getGzt ~ type:`, zytype)
var href = "/stuzy/dqkcDqzy";
var href = "";
if(zytype=='dqzy'){
href = "/stuzy/studentDqzy";
}else if(zytype=='lszy'){
href = "/stuzy/studentLszy";
}
// else if(zytype=='lszy'){
// href = "/stuzy/studentLszy";
// }
else if(zytype=='dcwj'){
href = "/stuzy/stuDcwjWenjuan";
}else if(zytype=='kcjc'){
href = "/stuzy/stuCeshiWenjuan";
}
router.push({path:href,query: {rwbh,xqxn,type}});
}
@ -72,7 +73,7 @@
onMounted(() => {
console.log('rwbh:',rwbh);
});
</script>
<style lang="less" scoped>
#siteMain {
@ -111,4 +112,4 @@
}
}
}
</style>
</style>

View File

@ -161,8 +161,8 @@
//
const formData = reactive<any>({
inputCode: '',
username: 'admin',
password: '123456',
username: '',
password: '',
});
//
const phoneFormData = reactive<any>({

View File

@ -1,6 +1,10 @@
<template>
<div>
<div><a-button @click="save">保存</a-button></div>
<div class="topButton">
<a-space>
<a-button @click="save">保存</a-button>
<a-button @click="reload">刷新</a-button>
<a-button type="primary" @click="addOne()" class="addBtn"><Icon icon="ant-design:plus-outlined"/></a-button>
</a-space>
</div>
<!-- <div v-for="(one, onei) in dataSource" :key="onei" class="oneCard localCard">
@ -38,66 +42,98 @@
<a-button type="dashed" block @click="addOne()" class="oenAddBtn"><Icon icon="ant-design:plus-outlined"/>addOne</a-button> -->
<a-button type="primary" @click="addOne()" class="addBtn"><Icon icon="ant-design:plus-outlined"/>addOne</a-button>
<div>
<draggable v-model="dataSource" item-key="id">
<div class="maxDiv">
<draggable @move="moveDraggable" @end="endDraggable" v-model="dataSource" item-key="_id">
<template #item="{ element: one }">
<div class="box">
<a-card>
<div class="itemTop">
<div>一级标题:</div>
<div><a-input v-modal="one.name" /></div>
</div>
</a-card>
<!-- 下一层 -->
<a-card>
<div>
<a-button type="primary" @click="addTwo(one)" class="addBtn"><Icon icon="ant-design:plus-outlined"/>addTwo</a-button>
</div>
<draggable v-model="one.childrenList" item-key="id">
<template #item="{ element: two }">
<div class="box">
<a-card>
<div class="itemTop">
<div>二级标题:</div>
<div><a-input v-modal="two.name" /></div>
</div>
</a-card>
<!-- 下一层 -->
<a-card>
<div>
<a-space>
<a-button type="primary" @click="addThree(two)" class="addBtn"><Icon icon="ant-design:plus-outlined"/>视频</a-button>
<a-button type="primary" @click="addThree(two)" class="addBtn"><Icon icon="ant-design:plus-outlined"/>文档</a-button>
<a-button type="primary" @click="addThree(two)" class="addBtn"><Icon icon="ant-design:plus-outlined"/>富文本</a-button>
<a-button type="primary" @click="addThree(two)" class="addBtn"><Icon icon="ant-design:plus-outlined"/>随堂测试</a-button>
<a-button type="primary" @click="addThree(two)" class="addBtn"><Icon icon="ant-design:plus-outlined"/>讨论</a-button>
</a-space>
</div>
<draggable v-model="two.childrenList" item-key="id">
<template #item="{ element: three }">
<div class="box">
<a-card>
<div class="itemTop">
<div>三级标题:</div>
<div><a-input v-modal="three.name" /></div>
<a-collapse v-model:activeKey="oneActiveKey" ghost expandIconPosition="right">
<a-collapse-panel :key="one._id">
<template #header>
<div class="topDiv">
<div>{{ one.sort }}一级标题:</div>
<div class="inputd"><a-input :value="one.name" @change="changeInput($event, one, 'name')" @click="stop" class="ainput"/></div>
</div>
</template>
<template #extra>
<a-space>
<div><a-button type="primary" @click="addTwo($event, one)" class="addBtn"><Icon icon="ant-design:plus-outlined"/></a-button></div>
<div><a-button type="primary" danger @click="delOne($event, one)" class="addBtn"><Icon icon="ant-design:delete"/></a-button></div>
</a-space>
</template>
<draggable @end="endDraggable2" v-model="one.childrenList" item-key="_id">
<template #item="{ element: two }">
<div class="box">
<!-- 下一层 -->
<a-card>
<a-collapse v-model:activeKey="twoActiveKey" ghost expandIconPosition="right">
<a-collapse-panel :key="two._id">
<template #header>
<div class="twoTopDiv">
<div class="topDiv">
<div>{{ two.sort }}二级标题:</div>
<div class="twoInputd"><a-input :value="two.name" @change="changeInput($event, two, 'name')" @click="stop" class="ainput"/></div>
</div>
</div>
</template>
<template #extra>
<div><a-button type="primary" danger @click="delTwo($event, one, two)" class="addBtn"><Icon icon="ant-design:delete"/></a-button></div>
</template>
<div style="padding-top: 1rem;">
<a-space>
<div><a-button type="primary" @click="addThree($event, two, 'video')" class="addBtn"><Icon icon="ant-design:plus-outlined"/>视频</a-button></div>
<div><a-button type="primary" @click="addThree($event, two, 'document')" class="addBtn"><Icon icon="ant-design:plus-outlined"/>文档</a-button></div>
<div><a-button type="primary" @click="addThree($event, two, 'richText')" class="addBtn"><Icon icon="ant-design:plus-outlined"/>富文本</a-button></div>
<!-- <div><a-button type="primary" @click="addThree($event, two, 'classroomTest')" class="addBtn"><Icon icon="ant-design:plus-outlined"/>随堂测试</a-button></div>
<div><a-button type="primary" @click="addThree($event, two, 'discuss')" class="addBtn"><Icon icon="ant-design:plus-outlined"/>讨论</a-button></div> -->
</a-space>
</div>
</a-card>
</div>
</template>
</draggable>
</a-card>
</div>
</template>
</draggable>
<draggable @end="endDraggable" v-model="two.childrenList" item-key="_id">
<template #item="{ element: three }">
<div class="box">
<a-card :title="three.sort + '三级内容:'">
<div class="topDiv">
<template v-if="three.type == 'video'">
<!-- <j-upload v-model:value="three.filePath" maxCount="1" suffixList="avi,mov,mkv,mpeg,asf,3gp,wmv,mp4,flv,rmvb"/> video/mp4,video/webm,video/ogv-->
<j-upload v-model:value="three.filePath" maxCount="1" text="上传视频" accept=".mp4,.webm,.ogv" :forceAcceptVerify="true"/>
</template>
<template v-if="three.type == 'document'">
<j-upload v-model:value="three.filePath" maxCount="1"/>
</template>
<template v-if="three.type == 'richText'">
-{{ three.richText }}-
<j-editor :ref="el => addRef(el, three._id)" v-model:value="three.richText" :disabled="disabled"/>
</template>
<!-- <template v-if="three.type == 'classroomTest'">
随堂测试
</template>
<template v-if="three.type == 'discuss'">
讨论
</template> -->
</div>
<template #extra>
<div><a-button type="primary" danger @click="delThree($event, two, three)" class="addBtn"><Icon icon="ant-design:delete"/></a-button></div>
</template>
</a-card>
</div>
</template>
</draggable>
</a-collapse-panel>
</a-collapse>
</a-card>
</div>
</template>
</draggable>
</a-collapse-panel>
</a-collapse>
</a-card>
</div>
</template>
<template #footer>
<a-button @click="sureChange" type="primary" style="margin-top: 100px">确定</a-button>
</template>
<!-- <template #footer> -->
<!-- <a-button @click="sureChange" type="primary" style="margin-top: 100px">确定</a-button> -->
<!-- </template> -->
</draggable>
</div>
@ -129,14 +165,20 @@
</template>
<script lang="ts" name="jiaoXueDanYuanNeiRongIndex" setup>
import { ref, reactive, onMounted, unref } from 'vue';
import { ref, reactive, onMounted, unref, nextTick } from 'vue';
import { Input, Popover, Pagination, Empty } from 'ant-design-vue';
import draggable from 'vuedraggable';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
import { useRouter } from 'vue-router';
import { getRandom } from '/@/utils/common/compUtils'
import draggable from 'vuedraggable';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import JEditor from '/@/components/Form/src/jeecg/components/JEditor.vue';
//src\components\Form\src\jeecg\components\JEditor.vue
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
@ -146,86 +188,193 @@
const queryParam = ref<any>({});
const dataSource = ref<any>([]);
const editorRefs = ref<any>({});
function addRef(el,id) {
editorRefs.value[id] = el;
}
// dataSource.value = [
// ];
function reload() {
loadData();
}
function loadData() {
let rdata = [
{
"id": "5079",
"name": "2qweqwe",
"sort": 1,
"childrenList": []
},
{
"id": "5643",
"name": "qweqwe",
"sort": 2,
"childrenList": [
{
"id": "3620",
"name": "",
"sort": 1,
"childrenList": [
{
"id": "564311",
"sort": 1,
"type": "video",
filePath: null,
richText: null,
},
{
"id": "5643112",
"sort": 2,
"type": "richText",
filePath: null,
richText: null,
},
]
},
{
"id": "2937",
"name": "",
"sort": 2,
"childrenList": []
}
]
}
];
dataRecursion(rdata, (x) => x._id = x.id);
dataSource.value = rdata;
}
//
function dataRecursion(list, fn){
let _list = list;
_list.forEach((x,i) => {
fn(x,i);
if(x.childrenList && x.childrenList.length){
dataRecursion(x.childrenList, fn);
}
})
}
//
function refreshDataSort(){
dataRecursion(dataSource.value, (x, i) => x.sort = i+1);
}
function createNoneData(){
let data = {
id: getRandom(10),
_id: getRandom(10),
name: '',
sort: 0,
childrenList: [],
}
return data;
}
function stop(e) {
e.stopPropagation();
}
function changeInput(e, pdata, key) {
let { target } = e;
let { value } = target;
pdata[key] = value;
}
function addOne(){
dataSource.value.push(createNoneData());
nextTick(() => {
refreshDataSort();
})
}
function insertOne(index){
dataSource.value.splice(index,0, createNoneData());
function delOne(e, one){
stop(e);
let index = dataSource.value.findIndex(x => x == one);
if(index == -1) return;
dataSource.value.splice(index, 1);
nextTick(() => {
refreshDataSort();
})
}
function addTwo(one){
// function insertOne(index){
// dataSource.value.splice(index,0, createNoneData());
// }
function addTwo(e, one){
stop(e);
one.childrenList.push(createNoneData());
nextTick(() => {
refreshDataSort();
})
}
function insertTwo(one, index){
one.childrenList.splice(index,0, createNoneData());
function delTwo(e, one, two){
stop(e);
let index = one.childrenList.findIndex(x => x == two);
if(index == -1) return;
one.childrenList.splice(index, 1);
nextTick(() => {
refreshDataSort();
})
}
function addThree(two){
two.childrenList.push(createNoneData());
// function insertTwo(one, index){
// one.childrenList.splice(index,0, createNoneData());
// }
function addThree(e, two, type){
stop(e);
let data = createNoneData();
data.type = type;
data.richText = '';
data.filePath = '';
two.childrenList.push(data);
nextTick(() => {
refreshDataSort();
})
}
function insertThree(two, index){
two.childrenList.splice(index,0, createNoneData());
function delThree(e, two, three){
stop(e);
let index = two.childrenList.findIndex(x => x == three);
if(index == -1) return;
two.childrenList.splice(index, 1);
nextTick(() => {
refreshDataSort();
})
}
function endDraggable(evt){
console.log(`🚀 -----------------------------🚀`);
console.log(`🚀 ~ endDraggable ~ evt:`, evt);
console.log(`🚀 -----------------------------🚀`);
nextTick(() => {
refreshDataSort();
})
}
function moveDraggable(...d) {
console.log(`🚀 --------------------------------🚀`);
console.log(`🚀 ~ moveDraggable ~ ...d:`, ...d, editorRefs);
console.log(`🚀 --------------------------------🚀`);
}
function save(){
console.log(unref(dataSource));
}
// const mockData = [
// { id: '000', sort: 0, filePath: 'https://static.jeecg.com/upload/test/1_1588149743473.jpg' },
// { id: '111', sort: 1, filePath: 'https://static.jeecg.com/upload/test/u27356337152749454924fm27gp0_1588149731821.jpg' },
// { id: '222', sort: 2, filePath: 'https://static.jeecg.com/upload/test/u24454681402491956848fm27gp0_1588149712663.jpg' },
// { id: '333', sort: 3, filePath: 'https://static.jeecg.com/temp/logo_1606575029126.png' },
// { id: '444', sort: 4, filePath: 'https://static.jeecg.com/upload/test/u8891206113801177793fm27gp0_1588149704459.jpg' },
// ];
//
// const dataArr = ref(mockData);
// //
// const oldDateSource = ref(mockData);
// //
// const newDateSource = ref([]);
/**
* 拖动结束事件
* @param evt
*/
function end(evt) {
console.log('拖动前的位置' + evt.oldIndex);
console.log('拖动后的位置' + evt.newIndex);
}
/**
* 确认更改事件
* @param evt
*/
function sureChange() {
for (let i = 0; i < unref(dataArr).length; i++) {
dataArr.value[i].sort = i;
}
newDateSource.value = unref(dataArr);
}
onMounted(() => {
});
loadData();
</script>
<style lang="less" scoped>
@ -246,4 +395,34 @@
.oneInput {
margin-bottom: .5rem;
}
.topButton {
padding-top: 1rem;
}
.ainput {
width: 100%;
}
.inputd {
width: calc(100% - 100px);
}
.topDiv {
width: 100%;
display: flex;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
}
.twoInputd {
width: calc(100% - 100px);
}
.twoTopDiv {
width: 100%;
}
:deep(.maxDiv) .ant-collapse-header{
align-items: center;
}
</style>

View File

@ -0,0 +1,81 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/zyCjwt/zyCjwt/list',
save='/zyCjwt/zyCjwt/add',
edit='/zyCjwt/zyCjwt/edit',
deleteOne = '/zyCjwt/zyCjwt/delete',
deleteBatch = '/zyCjwt/zyCjwt/deleteBatch',
importExcel = '/zyCjwt/zyCjwt/importExcel',
exportXls = '/zyCjwt/zyCjwt/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 });
/**
*
* @param params
* @param handleSuccess
*/
export const deleteOne = (params,handleSuccess) => {
createConfirm({
iconType: 'warning',
title: '确认删除',
content: '是否删除选中数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
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 });
}

View File

@ -0,0 +1,71 @@
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: 'createTime',
align: "center",
dataIndex: 'createTime',
customRender:({text}) =>{
return !text?"":(text.length>10?text.substr(0,10):text);
},
},
{
title: '学期学年',
align: "center",
dataIndex: 'xqxn'
},
{
title: '问题',
align: "center",
dataIndex: 'question'
},
{
title: '答案',
align: "center",
dataIndex: 'answer'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "问题",
field: 'question',
component: 'Input',
colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '问题',
field: 'question',
component: 'InputTextArea',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入问题!'},
];
},
},
{
label: '答案',
field: 'answer',
component: 'InputTextArea',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入答案!'},
];
},
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -5,27 +5,10 @@
<a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
<a-row :gutter="24">
<a-col :lg="8">
<a-form-item label="作业名称">
<a-input placeholder="请输入作业名称" v-model:value="queryParam.title"></a-input>
<a-form-item label="问题">
<a-input placeholder="请输入问题" v-model:value="queryParam.question"></a-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="类型">
<j-dict-select-tag placeholder="请选择类型" v-model:value="queryParam.zyType" dictCode="zy_type"/>
</a-form-item>
</a-col>
<!--<template v-if="toggleSearchStatus">-->
<a-col :lg="8">
<a-form-item label="状态">
<a-input placeholder="请输入状态" v-model:value="queryParam.zyStatus"></a-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="学年学期">
<a-input placeholder="请输入学年学期" v-model:value="queryParam.xnxq"></a-input>
</a-form-item>
</a-col>
<!--</template>-->
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
@ -80,19 +63,18 @@
</template>
</BasicTable>
<!-- 表单区域 -->
<ZyInfoModal ref="registerModal" @success="handleSuccess"></ZyInfoModal>
<ZyCjwtModal ref="registerModal" @success="handleSuccess"></ZyCjwtModal>
</div>
</template>
<script lang="ts" name="zyInfo-zyInfo" setup>
<script lang="ts" name="zyCjwt-zyCjwt" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './ZyInfo.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ZyInfo.api';
import { columns } from './ZyCjwt.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ZyCjwt.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ZyInfoModal from './components/ZyInfoModal.vue'
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import ZyCjwtModal from './components/ZyCjwtModal.vue'
const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
@ -100,7 +82,7 @@
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '作业发布',
title: '常见问题',
api: list,
columns,
canResize:false,
@ -115,7 +97,7 @@
},
},
exportConfig: {
name: "作业发布",
name: "常见问题",
url: getExportUrl,
},
importConfig: {

View File

@ -0,0 +1,135 @@
<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.question">
<a-input v-model:value="formData.question" rows="4" placeholder="请输入问题" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="答案" v-bind="validateInfos.answer">
<a-textarea v-model:value="formData.answer" rows="4" placeholder="请输入答案" :disabled="disabled"/>
</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 '../ZyCjwt.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: '',
question: '',
answer: '',
});
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 = {
question: [{ required: true, message: '请输入问题!'},],
answer: [{ required: true, message: '请输入答案!'},],
};
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(record) {
edit(record);
}
/**
* 编辑
*/
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="关闭">
<ZyCjwtForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ZyCjwtForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import ZyCjwtForm from './ZyCjwtForm.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(record) {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add(record);
});
}
/**
* 编辑
* @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

@ -1,5 +1,5 @@
<template>
<div>
<div style="background: #fff;min-height:97%;margin-top:10px;">
<!--查询区域-->
<div class="jeecg-basic-table-form-container">
<a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
@ -26,7 +26,7 @@
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable">
<BasicTable @register="registerTable" style="top: -16px;position: relative;">
<!--插槽:table标题-->
<template #tableTitle>
</template>
@ -53,7 +53,7 @@
</template>
<script lang="ts" name="zyGonggao-zyGonggao" setup>
import { ref, reactive } from 'vue';
import { ref, reactive, unref } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './ZyGonggao.data';
@ -62,11 +62,15 @@
import ZyGonggaoModal from './components/ZyGonggaoModal.vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
import { JJInput } from '/@/components/Form';
import { JInput } from '/@/components/Form';
import { useRouter } from 'vue-router';
const { createConfirm } = useMessage();
const queryParam = ref<any>({});
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh,xqxn } = query;//
const queryParam = ref<any>({rwbh, xqxn});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
//table

View File

@ -18,19 +18,23 @@
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted,unref } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JEditor from '/@/components/Form/src/jeecg/components/JEditor.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../ZyGonggao.api';
import { Form } from 'ant-design-vue';
import { useRouter } from 'vue-router';
const props = defineProps({
formDisabled: { type: Boolean, default: false },
formData: { type: Object, default: ()=>{} },
formBpm: { type: Boolean, default: true }
});
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh,xqxn } = query;//
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
@ -67,7 +71,7 @@
* 新增
*/
function add() {
edit({});
edit({rwbh,xqxn});
}
/**
@ -105,6 +109,7 @@
}
}
}
console.log(`🚀 ~ submitForm ~ model:`, model)
await saveOrUpdate(model, isUpdate.value)
.then((res) => {
if (res.success) {

View File

@ -9,11 +9,11 @@
<a-input placeholder="请输入作业名称" v-model:value="queryParam.title"></a-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<!-- <a-col :lg="8">
<a-form-item label="类型">
<j-dict-select-tag placeholder="请选择类型" v-model:value="queryParam.zyType" dictCode="zy_type"/>
</a-form-item>
</a-col>
</a-col> -->
<!-- <a-col :lg="8">
<a-form-item label="学年学期">
<a-input placeholder="请输入学年学期" v-model:value="queryParam.xnxq"></a-input>
@ -34,17 +34,17 @@
<a-col :span="8" v-for="(item, index) in tableData" :key="index" style="padding: 0px 0px 10px 5px;overflow:hidden;">
<div style="width: 100%; height: 20px; background-color: rgb(28, 132, 198);"></div>
<a-card style="height: 210px;border: 1px solid rgb(28, 132, 198);">
<div class="rotate" >{{item.zyStatus_dictText}}</div>
<div class="rotate" :style="classFun(item)">{{callText(item)}}</div>
<a-row style="top: -48px;position: relative;">
<a-col :span="24" style="margin-bottom: 10px;height:53px;overflow:hidden;" :title="item.title">
<!-- <div style="font-size: 18px;font-weight: bold;" class="ellipsis">{{item.title}}</div> -->
<div style="font-size: 18px;font-weight: bold;">{{item.zyType_dictText}}{{item.title}}</div>
<div style="font-size: 18px;font-weight: bold;">{{item.title}}</div>
</a-col>
<a-col :span="24" class="zyCon">时间{{item.startTime}} - {{item.endTime}}</a-col>
<a-col :span="24" class="zyCon"><div style="float:left">{{item.xnxq}}</div><div style="float:right;" @click="openXkrs(item)"><a>{{item.xkxs}}人选课</a></div></a-col>
<a-col :span="24" class="zyCon"><div style="float:left" v-if="item.score">{{item.score}}</div><div style="float:right;" @click="openXkrs(item)"><a>{{item.xkxs}}人选课</a></div></a-col>
<a-col :span="24" style="text-align:center;margin-top:20px;">
<a-button type="primary" @click="handleDetail(item)" style="margin-left:5px;background:rgb(28, 132, 198);">详情</a-button>
<a-button type="primary" @click="handleShangchuan(item)" style="margin-left:5px;background:rgb(28, 132, 198);" >上传</a-button>
<a-button type="primary" @click="handleShangchuan(item)" style="margin-left:5px;background:rgb(28, 132, 198);" v-if="!item.score" >上传</a-button>
</a-col>
</a-row>
</a-card>
@ -110,6 +110,24 @@
});
function classFun(record){
if(record.score){
return "background: #1f77f8";
}else if(record.stuFilePath){
return "background: #18a689";
}else{
return "background: #a7a6a6";
}
}
function callText(record){
if(record.score){
return "已评分";
}else if(record.stuFilePath){
return "已提交";
}else{
return "未提交";
}
}
/**
* 详情
*/
@ -120,8 +138,9 @@
//
function handleShangchuan(record){
ZyInfoStudentModalPage.value.disableSubmit = false;
var param = {mainId:record.id,zyfj:record.filePath}
var param = {id:record.stuId,zyfj:record.filePath}
ZyInfoStudentModalPage.value.edit(param);
}
@ -162,11 +181,10 @@
queryParam.value.pageSize = pageSize;
queryParam.value.rwbh = rwbh;
queryParam.value.xqxn = xqxn;
queryParam.value.sflssj = '0';
queryParam.value.zyStatus = '1,2';
queryParam.value.column="startTime";
queryParam.value.order="asc";
defHttp.get({ url: '/zyInfo/zyInfo/list', params: queryParam.value }).then(res => {
queryParam.value.zyStatus = '1,2,3,4';
queryParam.value.column="createTime";
queryParam.value.order="desc";
defHttp.get({ url: '/zyInfo/zyInfo/stuList', params: queryParam.value }).then(res => {
console.log(`🚀 ~ defHttp.get ~ res:`, res)
total.value = res.total;
pageNo.value = res.pages;

View File

@ -9,16 +9,11 @@ export const columns: BasicColumn[] = [
align: "center",
dataIndex: 'title'
},
{
title: '类型',
align: "center",
dataIndex: 'zyType_dictText'
},
{
title: '描述',
align: "center",
dataIndex: 'content'
},
// {
// title: '类型',
// align: "center",
// dataIndex: 'zyType_dictText'
// },
{
title: '开始时间',
align: "center",
@ -38,7 +33,7 @@ export const columns: BasicColumn[] = [
{
title: '状态',
align: "center",
dataIndex: 'zyStatus'
dataIndex: 'zyStatus_dictText'
},
{
title: '学年学期',
@ -46,34 +41,25 @@ export const columns: BasicColumn[] = [
dataIndex: 'xnxq'
},
{
title: '外网是否查重',
title: '选课人数',
align: "center",
dataIndex: 'wwcc_dictText'
dataIndex: 'xkxs'
},
{
title: '外网通过率',
title: '未提交人数',
align: "center",
dataIndex: 'wwtgl'
dataIndex: 'wtjnum',
customRender:({text}) =>{
return text?text:"0";
},
},
{
title: '内网查重',
title: '已提交人数',
align: "center",
dataIndex: 'nwcc_dictText'
},
{
title: '内网通过率',
align: "center",
dataIndex: 'nwtgl'
},
{
title: 'aigc查重',
align: "center",
dataIndex: 'aigccc_dictText'
},
{
title: 'aigc通过率',
align: "center",
dataIndex: 'aigctgl'
dataIndex: 'ytjnum',
customRender:({text}) =>{
return text?text:"0";
},
},
];

View File

@ -0,0 +1,276 @@
<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">
<a-form-item label="作业名称">
<a-input placeholder="请输入作业名称" v-model:value="queryParam.title"></a-input>
</a-form-item>
</a-col>
<a-col :lg="8">
<a-form-item label="状态">
<!-- <a-input placeholder="请输入状态" v-model:value="queryParam.zyStatus"></a-input> -->
<j-dict-select-tag placeholder="请选择状态" v-model:value="queryParam.zyStatus" dictCode="zy_status"/>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:reload-outlined" @click="searchReset" style="margin-left: 8px">重置</a-button>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined" style="margin-left: 8px;"> 新增</a-button>
<!--<a @click="toggleSearchStatus = !toggleSearchStatus" style="margin-left: 8px">
{{ toggleSearchStatus ? '收起' : '展开' }}
<Icon :icon="toggleSearchStatus ? 'ant-design:up-outlined' : 'ant-design:down-outlined'" />
</a>-->
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<BasicTable @register="registerTable" style="margin-top: -20px;">
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></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>
<!-- 表单区域 -->
<ZyInfoModal ref="registerModal" @success="handleSuccess"></ZyInfoModal>
<ZyInfoStudentListModal ref="ZyInfoStudentListModalPage"></ZyInfoStudentListModal>
</div>
</template>
<script lang="ts" name="zyInfo-zyInfo" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './ZyInfo.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ZyInfo.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ZyInfoModal from './components/ZyInfoModal.vue'
import { useMessage } from "/@/hooks/web/useMessage";
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import ZyInfoStudentListModal from '/@/views/zy/zyInfoStudent/ZyInfoStudentListModal.vue';
import { defHttp } from '/@/utils/http/axios';
const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const ZyInfoStudentListModalPage = ref();
const { createConfirm,createMessage } = useMessage();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
api: list,
columns,
canResize:false,
useSearchForm: false,
actionColumn: {
width: 220,
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);
}
/**
* 删除事件
*/
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 getTableAction(record) {
var list = [];
if(record.zyStatus=='0'){
list = [
{
label: '编辑',
onClick: handleEdit.bind(null, record),
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '发布',
onClick: handleFabu.bind(null, record),
}, {
label: '删除',
popConfirm: {
title: '是否确认删除',
confirm: handleDelete.bind(null, record),
}
}
];
}else{
list = [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '作业',
onClick: handleZyxx.bind(null, record),
},
]
}
return list;
}
//
function handleZyxx(record){
ZyInfoStudentListModalPage.value.disableSubmit = true;
ZyInfoStudentListModalPage.value.init(record);
}
//
async function handleFabu(record){
createConfirm({
iconType: 'warning',
title: '确认发布',
content: '是否发布作业数据',
okText: '确认',
cancelText: '取消',
onOk: () => {
var url = "/zyInfo/zyInfo/edit";
var params = {id:record.id,zyStatus:'1'};
defHttp.post({ url: url, params }).then((res) => {
handleZySuccess(record.id);
});
}
});
}
function handleZySuccess(zyid){
var url = "/zyInfo/zyInfo/editStudent";
defHttp.get({ url: url, params:{id:zyid} }).then((res) => {
});
setTimeout(()=>{handleSuccess()}, 1500);
}
/**
* 下拉操作栏
*/
function getDropDownAction(record) {
return [
]
}
/**
* 查询
*/
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

@ -39,7 +39,7 @@
<a-row>
<a-col :span="8" v-for="(item, index) in tableData" :key="index" style="padding: 0px 0px 10px 5px;overflow:hidden;">
<div style="width: 100%; height: 20px; background-color: rgb(28, 132, 198);"></div>
<a-card style="height: 210px;border: 1px solid rgb(28, 132, 198);">
<a-card style="height: 240px;border: 1px solid rgb(28, 132, 198);">
<div class="rotate" :style="classFun(item.zyStatus)">{{item.zyStatus_dictText}}</div>
<a-row style="top: -48px;position: relative;">
<a-col :span="24" style="margin-bottom: 10px;height:53px;overflow:hidden;" :title="item.title">
@ -47,12 +47,14 @@
</a-col>
<a-col :span="24" class="zyCon">时间{{item.startTime}} - {{item.endTime}}</a-col>
<a-col :span="24" class="zyCon"><div style="float:left">{{item.xnxq}}</div><div style="float:right;" @click="openXkrs(item)"><a>{{item.xkxs}}人选课</a></div></a-col>
<a-col :span="24" class="zyCon"><div style="float:left">未提交{{item.wtjnum?item.wtjnum:0}};</div><div style="float:right;" >已提交{{item.ytjnum?item.ytjnum:0}}</div></a-col>
<a-col :span="24" style="text-align:center;margin-top:20px;">
<a-button type="primary" @click="handleEdit(item)" style="margin-left:5px;background:rgb(28, 132, 198);" v-if="item.zyStatus==0">编辑</a-button>
<a-button type="primary" @click="handleFabu(item)" style="margin-left:5px;background:rgb(28, 132, 198);" v-if="item.zyStatus==0">发布</a-button>
<a-button type="primary" @click="handleDetail(item)" style="margin-left:5px;background:rgb(28, 132, 198);">详情</a-button>
<a-button type="primary" @click="handleZyxx(item)" style="margin-left:5px;background:rgb(28, 132, 198);" v-if="item.zyStatus==1||item.zyStatus==2||item.zyStatus==3">作业</a-button>
<a-button type="primary" @click="handleShangchuan(item)" style="margin-left:5px;background:rgb(28, 132, 198);" v-if="item.zyStatus==1||item.zyStatus==2||item.zyStatus==3">上传</a-button>
<!-- <a-button type="primary" @click="handleShangchuan(item)" style="margin-left:5px;background:rgb(28, 132, 198);" v-if="item.zyStatus==1||item.zyStatus==2||item.zyStatus==3">上传</a-button> -->
</a-col>
</a-row>
</a-card>
@ -123,7 +125,6 @@
}else if(type == '1'){
return "background: #18a689";
}
}
/**
* 新增事件
@ -189,7 +190,7 @@
var url = "/zyInfo/zyInfo/edit";
var params = {id:record.id,zyStatus:'1'};
defHttp.post({ url: url, params }).then((res) => {
handleSuccess();
handleZySuccess(record.id);
});
}
});
@ -202,6 +203,15 @@
function handleSuccess() {
reload()
}
function handleZySuccess(zyid){
setTimeout(()=>{handleSuccess()}, 1500);
var url = "/zyInfo/zyInfo/editStudent";
defHttp.get({ url: url, params:{id:zyid} }).then((res) => {
});
}
/**

View File

@ -0,0 +1,29 @@
<template>
<div style="background: #fff;height: 97%;margin: 10px 0;">
<div style="text-align:right;width:100%;">
<a-switch v-model:checked="checked1" @change="onChange1"/>
</div>
<div v-show="checked1">
<ZyInfoList/>
</div>
<div v-show="!checked1">
<ZyInfoLiebiaoList/>
</div>
</div>
</template>
<script lang="ts" name="zyInfo-zyInfo" setup>
import { ref, reactive, onMounted,unref } from 'vue';
import ZyInfoLiebiaoList from '/@/views/zy/zyInfo/ZyInfoLiebiaoList.vue'
import ZyInfoList from '/@/views/zy/zyInfo/ZyInfoList.vue'
const checked1 = ref(true);
function onChange1(record){
console.log(`🚀 ~ onChange1 ~ record:`, record)
}
</script>
<style lang="less" scoped>
</style>

View File

@ -20,17 +20,22 @@ export const columns: BasicColumn[] = [
dataIndex: 'createTime'
},
{
title: '作业附件',
title: '评分',
align: "center",
dataIndex: 'filePath',
slots: { customRender: 'fileSlot' },
},
{
title: '在线预览',
align: "center",
dataIndex: 'filePath',
slots: { customRender: 'fileZxSlot' },
dataIndex: 'score'
},
// {
// title: '作业附件',
// align: "center",
// dataIndex: 'filePath',
// slots: { customRender: 'fileSlot' },
// },
// {
// title: '在线预览',
// align: "center",
// dataIndex: 'filePath',
// slots: { customRender: 'fileZxSlot' },
// },
{
title: '外网相似律',
align: "center",

View File

@ -48,6 +48,8 @@
</BasicTable>
<!-- 表单区域 -->
<ZyInfoStudentModal ref="registerModal" @success="handleSuccess"></ZyInfoStudentModal>
<ZyInfoStudentScoreModal ref="registerScoreModal" @success="handleSuccess"></ZyInfoStudentScoreModal>
</div>
</template>
@ -61,12 +63,15 @@
import ZyInfoStudentModal from './components/ZyInfoStudentModal.vue'
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
import ZyInfoStudentScoreModal from '/@/views/zy/zyInfoStudent/components/ZyInfoStudentScoreModal.vue'
const queryParam = ref<any>({});
const mainId = ref<string>('');
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const registerScoreModal = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
@ -76,7 +81,7 @@ import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
canResize:false,
useSearchForm: false,
actionColumn: {
width: 120,
width: 220,
fixed: 'right',
},
beforeFetch: (params) => {
@ -124,6 +129,11 @@ import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
registerModal.value.disableSubmit = false;
registerModal.value.edit(record);
}
function handleScore(record: Recordable) {
registerScoreModal.value.disableSubmit = false;
registerScoreModal.value.edit(record);
}
/**
* 详情
@ -153,17 +163,61 @@ import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
function handleSuccess() {
reload();
}
function handleDown(record){
downloadFile(text);
}
/**
* 操作栏
*/
function getTableAction(record) {
return [
if(record.filePath){
if(record.score){
var list = [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '下载',
onClick: handleDown.bind(null, record),
},
{
label: '预览',
onClick: yulanFile.bind(null, record),
}];
return list;
}else{
var list = [
{
label: '评分',
onClick: handleScore.bind(null, record),
},
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
{
label: '下载',
onClick: handleDown.bind(null, record),
},
{
label: '预览',
onClick: yulanFile.bind(null, record),
}];
return list;
}
}else{
var list = [
{
label: '详情',
onClick: handleDetail.bind(null, record),
},
];
},];
return list;
}
}
/**

View File

@ -0,0 +1,129 @@
<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.score">
<a-input v-model:value="formData.score" :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 JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../ZyInfoStudent.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: '',
score: '',
});
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 = {
score: [{ required: true, message: '请输入评分!'},],
};
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="关闭">
<ZyInfoStudentForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ZyInfoStudentForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import ZyInfoStudentForm from './ZyInfoStudentScoreForm.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 = '评分';
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,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/zyJxdg/zyJxdg/list',
save='/zyJxdg/zyJxdg/add',
edit='/zyJxdg/zyJxdg/edit',
deleteOne = '/zyJxdg/zyJxdg/delete',
deleteBatch = '/zyJxdg/zyJxdg/deleteBatch',
importExcel = '/zyJxdg/zyJxdg/importExcel',
exportXls = '/zyJxdg/zyJxdg/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 });
/**
*
* @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 });
}

View File

@ -0,0 +1,35 @@
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: '附件',
align: "center",
dataIndex: 'filePath',
slots: { customRender: 'fileSlot' },
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '附件',
field: 'filePath',
component: 'JUpload',
componentProps:{
},
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,215 @@
<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-row>
</a-form>
</div>
<!--引用表格-->
<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" 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)" :dropDownActions="getDropDownAction(record)"/>
</template>
<!--字段回显插槽-->
<template #htmlSlot="{text}">
<div v-html="text"></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>
<!-- 表单区域 -->
<ZyJxdgModal ref="registerModal" @success="handleSuccess"></ZyJxdgModal>
</div>
</template>
<script lang="ts" name="zyJxdg-zyJxdg" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './ZyJxdg.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ZyJxdg.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ZyJxdgModal from './components/ZyJxdgModal.vue'
const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '教学大纲',
api: list,
columns,
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);
}
/**
* 删除事件
*/
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 getTableAction(record) {
return [
{
label: '编辑',
onClick: handleEdit.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,26 @@
-- 注意该页面对应的前台目录为views/zyJxdg文件夹下
-- 如果你想更改到其他目录请修改sql中component字段对应的值
INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external)
VALUES ('202405110931940070', NULL, '教学大纲', '/zyJxdg/zyJxdgList', 'zyJxdg/ZyJxdgList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2024-05-11 09:31:07', NULL, NULL, 0);
-- 权限控制sql
-- 新增
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202405110931940071', '202405110931940070', '添加教学大纲', NULL, NULL, 0, NULL, NULL, 2, 'zyJxdg:zy_jxdg:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-05-11 09:31:07', NULL, NULL, 0, 0, '1', 0);
-- 编辑
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202405110931940072', '202405110931940070', '编辑教学大纲', NULL, NULL, 0, NULL, NULL, 2, 'zyJxdg:zy_jxdg:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-05-11 09:31:07', NULL, NULL, 0, 0, '1', 0);
-- 删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202405110931940073', '202405110931940070', '删除教学大纲', NULL, NULL, 0, NULL, NULL, 2, 'zyJxdg:zy_jxdg:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-05-11 09:31:07', NULL, NULL, 0, 0, '1', 0);
-- 批量删除
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202405110931940074', '202405110931940070', '批量删除教学大纲', NULL, NULL, 0, NULL, NULL, 2, 'zyJxdg:zy_jxdg:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-05-11 09:31:07', NULL, NULL, 0, 0, '1', 0);
-- 导出excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202405110931940075', '202405110931940070', '导出excel_教学大纲', NULL, NULL, 0, NULL, NULL, 2, 'zyJxdg:zy_jxdg:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-05-11 09:31:07', NULL, NULL, 0, 0, '1', 0);
-- 导入excel
INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external)
VALUES ('202405110931940076', '202405110931940070', '导入excel_教学大纲', NULL, NULL, 0, NULL, NULL, 2, 'zyJxdg:zy_jxdg:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2024-05-11 09:31:07', NULL, NULL, 0, 0, '1', 0);

View File

@ -0,0 +1,128 @@
<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.filePath">
<j-upload v-model:value="formData.filePath" :disabled="disabled" ></j-upload>
</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 JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../ZyJxdg.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: '',
filePath: '',
});
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="关闭">
<ZyJxdgForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ZyJxdgForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import ZyJxdgForm from './ZyJxdgForm.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>