添加功能
This commit is contained in:
parent
70a24be075
commit
622ed8a4a1
|
@ -54,13 +54,17 @@
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, watch } from 'vue';
|
import { ref, onMounted, watch,unref } from 'vue';
|
||||||
import { TeamOutlined, FormOutlined } from '@ant-design/icons-vue';
|
import { TeamOutlined, FormOutlined } from '@ant-design/icons-vue';
|
||||||
import { Pagination } from 'ant-design-vue';
|
import { Pagination } from 'ant-design-vue';
|
||||||
import { getUserId, getSysConfig } from '/@/views/site/utils/index';
|
import { getUserId, getSysConfig } from '/@/views/site/utils/index';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
import KcXsktjxmydcpDetailModal from '/@/views/kc/kcXsktjxmydcp/components/KcXsktjxmydcpDetailModal.vue';
|
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';
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
enum Api {
|
enum Api {
|
||||||
list = '/kcXsktjxmydcp/kcXsktjxmydcp/groupByList'
|
list = '/kcXsktjxmydcp/kcXsktjxmydcp/groupByList'
|
||||||
|
@ -101,10 +105,16 @@ watch(
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
function init() {
|
async function init() {
|
||||||
console.log('init');
|
console.log('init');
|
||||||
loadingList.value = true
|
loadingList.value = true;
|
||||||
listApi({ jgh: getUserId(), searchByNowXqxn: true, ...props.queryParam }).then(res => {
|
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 ?? [];
|
list.value = res?.records ?? [];
|
||||||
|
|
||||||
total.value = res.total;
|
total.value = res.total;
|
||||||
|
|
|
@ -12,29 +12,29 @@
|
||||||
<a-card>
|
<a-card>
|
||||||
<div style="line-height: 30px; font-size: 18px; font-weight: bold;width:100%;">
|
<div style="line-height: 30px; font-size: 18px; font-weight: bold;width:100%;">
|
||||||
<span style="float: left;">常见问题</span>
|
<span style="float: left;">常见问题</span>
|
||||||
<span style="float: right;"><a-button type="primary">新增</a-button></span>
|
<span style="float: right;"><a-button type="primary" @click="addCjwtHanle">新增</a-button></span>
|
||||||
</div>
|
</div>
|
||||||
<a-row style="margin-top: 50px;width:100%;display: block;">
|
<a-row style="margin-top: 50px;width:100%;display: block;">
|
||||||
<a-col :span="24" v-for="i in 3">
|
<a-col :span="24" v-for="(item,index) in cjwtSource" :key="index">
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<span style="float: left;">{{i}}.问题</span>
|
<span style="float: left;">{{index+1}}.{{item.question}}</span>
|
||||||
<span style="float: right;">
|
<span style="float: right;">
|
||||||
<a title="修改"><Icon icon="ant-design:form-outlined" /></a>
|
<a title="修改" @click="handleEdit(item)"><Icon icon="ant-design:form-outlined" /></a>
|
||||||
<a-divider type="vertical" style="height: 30px; background-color: #7cb305" />
|
<a-divider type="vertical" style="height: 30px; background-color: #7cb305" />
|
||||||
<a title="删除"><Icon icon="ant-design:delete-outlined" /></a>
|
<a title="删除" @click="handleDelete(item)"><Icon icon="ant-design:delete-outlined" /></a>
|
||||||
</span>
|
</span>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24"><span><Icon icon="ant-design:caret-right-outlined" />答:就是一个常见的问题及答案</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-col :span="24">
|
||||||
<a-divider />
|
<a-divider />
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<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-pagination v-model="current" :total="total" @change="handlePageChange" :pageSize="pageSize" style="text-align: right;"/>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24" v-show="false">
|
<a-col :span="24" v-show="cjwtSource.length==0">
|
||||||
<a-empty/>
|
<a-empty/>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
@ -43,8 +43,9 @@
|
||||||
<div style="line-height: 30px; font-size: 18px; font-weight: bold;width:100%;">
|
<div style="line-height: 30px; font-size: 18px; font-weight: bold;width:100%;">
|
||||||
<span style="float: left;">往届学生评价</span>
|
<span style="float: left;">往届学生评价</span>
|
||||||
</div>
|
</div>
|
||||||
<studentPjjgTeaList :queryParam="{ pageSize: 3, ...tkzjParam }" style="max-height: 106px;"/>
|
<studentPjjgTeaList :queryParam="{ pageSize: 3, ...tkzjParam,kcbh:'' }" style="max-height: 106px;"/>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
<ZyCjwtModal ref="ZyCjwtModalPage" @success="handleCjwtOk" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -56,32 +57,72 @@
|
||||||
import { Icon } from '/@/components/Icon';
|
import { Icon } from '/@/components/Icon';
|
||||||
import { Pagination, Empty } from 'ant-design-vue';
|
import { Pagination, Empty } from 'ant-design-vue';
|
||||||
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.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 headerPage from '/@/views/site/common/header.vue';
|
||||||
import footerPage from '/@/views/site/common/footer.vue';
|
import footerPage from '/@/views/site/common/footer.vue';
|
||||||
import studentPjjgTeaList from '/@/views/site/pjjgPage/studentPjjgTeaList.vue';
|
import studentPjjgTeaList from '/@/views/site/pjjgPage/studentPjjgTeaList.vue';
|
||||||
|
import ZyCjwtModal from '/@/views/zy/zyCjwt/components/ZyCjwtModal.vue';
|
||||||
|
|
||||||
|
|
||||||
//当前路由信息
|
//当前路由信息
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const { query } = unref(currentRoute);
|
const { query } = unref(currentRoute);
|
||||||
const { rwbh } = query;//获取传递参数
|
const { rwbh,xqxn } = query;//获取传递参数
|
||||||
const APagination = Pagination;
|
const APagination = Pagination;
|
||||||
const current = ref<number>(0);
|
const current = ref<number>(0);
|
||||||
const total = ref<number>(0);
|
const total = ref<number>(0);
|
||||||
const pageNo = ref<number>(0);
|
const pageNo = ref<number>(0);
|
||||||
const pageSize = ref<number>(3);
|
const pageSize = ref<number>(3);
|
||||||
const tkzjParam = ref({});
|
const tkzjParam = ref({rwbh:rwbh});
|
||||||
|
const ZyCjwtModalPage = ref();
|
||||||
|
const cjwtSource = ref([]);
|
||||||
let router = useRouter();
|
let router = useRouter();
|
||||||
const jxdgInfo = ref({
|
const jxdgInfo = ref({
|
||||||
filePath:''
|
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) {
|
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(() => {
|
onMounted(() => {
|
||||||
|
cjwtData(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -20,11 +20,11 @@
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
<a-sub-menu key="sub4">
|
<a-sub-menu key="sub4">
|
||||||
<template #title>测验/作业</template>
|
<template #title>测验/作业</template>
|
||||||
<a-menu-item key="4" @click="getGzt('dqzy')">当前作业</a-menu-item>
|
<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="5" @click="getGzt('lszy')">课程测验</a-menu-item>
|
||||||
</a-sub-menu>
|
</a-sub-menu>
|
||||||
<a-menu-item key="sub5">
|
<a-menu-item key="sub5">
|
||||||
<span>课堂调查</span>
|
<span>问卷调查</span>
|
||||||
</a-menu-item>
|
</a-menu-item>
|
||||||
<a-menu-item key="sub5">
|
<a-menu-item key="sub5">
|
||||||
<span>讨论区</span>
|
<span>讨论区</span>
|
||||||
|
@ -59,12 +59,13 @@
|
||||||
|
|
||||||
function getGzt(zytype){
|
function getGzt(zytype){
|
||||||
console.log(`🚀 ~ getGzt ~ type:`, zytype)
|
console.log(`🚀 ~ getGzt ~ type:`, zytype)
|
||||||
var href = "/stuzy/dqkcDqzy";
|
var href = "";
|
||||||
if(zytype=='dqzy'){
|
if(zytype=='dqzy'){
|
||||||
href = "/stuzy/studentDqzy";
|
href = "/stuzy/studentDqzy";
|
||||||
}else if(zytype=='lszy'){
|
|
||||||
href = "/stuzy/studentLszy";
|
|
||||||
}
|
}
|
||||||
|
// else if(zytype=='lszy'){
|
||||||
|
// href = "/stuzy/studentLszy";
|
||||||
|
// }
|
||||||
router.push({path:href,query: {rwbh,xqxn,type}});
|
router.push({path:href,query: {rwbh,xqxn,type}});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,17 @@ export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||||
* @param handleSuccess
|
* @param handleSuccess
|
||||||
*/
|
*/
|
||||||
export const deleteOne = (params,handleSuccess) => {
|
export const deleteOne = (params,handleSuccess) => {
|
||||||
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
createConfirm({
|
||||||
handleSuccess();
|
iconType: 'warning',
|
||||||
|
title: '确认删除',
|
||||||
|
content: '是否删除选中数据',
|
||||||
|
okText: '确认',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk: () => {
|
||||||
|
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||||
|
handleSuccess();
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="问题" v-bind="validateInfos.question">
|
<a-form-item label="问题" v-bind="validateInfos.question">
|
||||||
<a-textarea v-model:value="formData.question" rows="4" placeholder="请输入问题" :disabled="disabled"/>
|
<a-input v-model:value="formData.question" rows="4" placeholder="请输入问题" :disabled="disabled"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
|
@ -65,8 +65,8 @@
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
function add() {
|
function add(record) {
|
||||||
edit({});
|
edit(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -18,11 +18,11 @@
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
function add() {
|
function add(record) {
|
||||||
title.value = '新增';
|
title.value = '新增';
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
registerForm.value.add();
|
registerForm.value.add(record);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,11 +9,11 @@
|
||||||
<a-input placeholder="请输入作业名称" v-model:value="queryParam.title"></a-input>
|
<a-input placeholder="请输入作业名称" v-model:value="queryParam.title"></a-input>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :lg="8">
|
<!-- <a-col :lg="8">
|
||||||
<a-form-item label="类型">
|
<a-form-item label="类型">
|
||||||
<j-dict-select-tag placeholder="请选择类型" v-model:value="queryParam.zyType" dictCode="zy_type"/>
|
<j-dict-select-tag placeholder="请选择类型" v-model:value="queryParam.zyType" dictCode="zy_type"/>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col> -->
|
||||||
<!-- <a-col :lg="8">
|
<!-- <a-col :lg="8">
|
||||||
<a-form-item label="学年学期">
|
<a-form-item label="学年学期">
|
||||||
<a-input placeholder="请输入学年学期" v-model:value="queryParam.xnxq"></a-input>
|
<a-input placeholder="请输入学年学期" v-model:value="queryParam.xnxq"></a-input>
|
||||||
|
@ -41,10 +41,10 @@
|
||||||
<div style="font-size: 18px;font-weight: bold;">【{{item.zyType_dictText}}】{{item.title}}</div>
|
<div style="font-size: 18px;font-weight: bold;">【{{item.zyType_dictText}}】{{item.title}}</div>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24" class="zyCon">时间:{{item.startTime}} - {{item.endTime}}</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-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="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-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
@ -120,8 +120,9 @@
|
||||||
|
|
||||||
//上传作业附件
|
//上传作业附件
|
||||||
function handleShangchuan(record){
|
function handleShangchuan(record){
|
||||||
|
|
||||||
ZyInfoStudentModalPage.value.disableSubmit = false;
|
ZyInfoStudentModalPage.value.disableSubmit = false;
|
||||||
var param = {mainId:record.id,zyfj:record.filePath}
|
var param = {id:record.stuId,zyfj:record.filePath}
|
||||||
ZyInfoStudentModalPage.value.edit(param);
|
ZyInfoStudentModalPage.value.edit(param);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -162,11 +163,10 @@
|
||||||
queryParam.value.pageSize = pageSize;
|
queryParam.value.pageSize = pageSize;
|
||||||
queryParam.value.rwbh = rwbh;
|
queryParam.value.rwbh = rwbh;
|
||||||
queryParam.value.xqxn = xqxn;
|
queryParam.value.xqxn = xqxn;
|
||||||
queryParam.value.sflssj = '0';
|
queryParam.value.zyStatus = '1,2,3,4';
|
||||||
queryParam.value.zyStatus = '1,2';
|
queryParam.value.column="createTime";
|
||||||
queryParam.value.column="startTime";
|
queryParam.value.order="desc";
|
||||||
queryParam.value.order="asc";
|
defHttp.get({ url: '/zyInfo/zyInfo/stuList', params: queryParam.value }).then(res => {
|
||||||
defHttp.get({ url: '/zyInfo/zyInfo/list', params: queryParam.value }).then(res => {
|
|
||||||
console.log(`🚀 ~ defHttp.get ~ res:`, res)
|
console.log(`🚀 ~ defHttp.get ~ res:`, res)
|
||||||
total.value = res.total;
|
total.value = res.total;
|
||||||
pageNo.value = res.pages;
|
pageNo.value = res.pages;
|
||||||
|
|
|
@ -52,7 +52,7 @@
|
||||||
<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="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="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="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-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-card>
|
</a-card>
|
||||||
|
@ -189,7 +189,7 @@
|
||||||
var url = "/zyInfo/zyInfo/edit";
|
var url = "/zyInfo/zyInfo/edit";
|
||||||
var params = {id:record.id,zyStatus:'1'};
|
var params = {id:record.id,zyStatus:'1'};
|
||||||
defHttp.post({ url: url, params }).then((res) => {
|
defHttp.post({ url: url, params }).then((res) => {
|
||||||
handleSuccess();
|
handleZySuccess(record.id);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -202,6 +202,15 @@
|
||||||
function handleSuccess() {
|
function handleSuccess() {
|
||||||
reload()
|
reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleZySuccess(zyid){
|
||||||
|
setTimeout(()=>{handleSuccess()}, 1500);
|
||||||
|
|
||||||
|
var url = "/zyInfo/zyInfo/editStudent";
|
||||||
|
defHttp.get({ url: url, params:{id:zyid} }).then((res) => {
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -19,18 +19,18 @@ export const columns: BasicColumn[] = [
|
||||||
align: "center",
|
align: "center",
|
||||||
dataIndex: 'createTime'
|
dataIndex: 'createTime'
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: '作业附件',
|
// title: '作业附件',
|
||||||
align: "center",
|
// align: "center",
|
||||||
dataIndex: 'filePath',
|
// dataIndex: 'filePath',
|
||||||
slots: { customRender: 'fileSlot' },
|
// slots: { customRender: 'fileSlot' },
|
||||||
},
|
// },
|
||||||
{
|
// {
|
||||||
title: '在线预览',
|
// title: '在线预览',
|
||||||
align: "center",
|
// align: "center",
|
||||||
dataIndex: 'filePath',
|
// dataIndex: 'filePath',
|
||||||
slots: { customRender: 'fileZxSlot' },
|
// slots: { customRender: 'fileZxSlot' },
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: '外网相似律',
|
title: '外网相似律',
|
||||||
align: "center",
|
align: "center",
|
||||||
|
|
|
@ -48,6 +48,8 @@
|
||||||
</BasicTable>
|
</BasicTable>
|
||||||
<!-- 表单区域 -->
|
<!-- 表单区域 -->
|
||||||
<ZyInfoStudentModal ref="registerModal" @success="handleSuccess"></ZyInfoStudentModal>
|
<ZyInfoStudentModal ref="registerModal" @success="handleSuccess"></ZyInfoStudentModal>
|
||||||
|
<ZyInfoStudentScoreModal ref="registerScoreModal" @success="handleSuccess"></ZyInfoStudentScoreModal>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -61,12 +63,15 @@
|
||||||
import ZyInfoStudentModal from './components/ZyInfoStudentModal.vue'
|
import ZyInfoStudentModal from './components/ZyInfoStudentModal.vue'
|
||||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||||
|
import ZyInfoStudentScoreModal from '/@/views/zy/zyInfoStudent/components/ZyInfoStudentScoreModal.vue'
|
||||||
|
|
||||||
|
|
||||||
const queryParam = ref<any>({});
|
const queryParam = ref<any>({});
|
||||||
const mainId = ref<string>('');
|
const mainId = ref<string>('');
|
||||||
|
|
||||||
const toggleSearchStatus = ref<boolean>(false);
|
const toggleSearchStatus = ref<boolean>(false);
|
||||||
const registerModal = ref();
|
const registerModal = ref();
|
||||||
|
const registerScoreModal = ref();
|
||||||
//注册table数据
|
//注册table数据
|
||||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||||
tableProps: {
|
tableProps: {
|
||||||
|
@ -76,7 +81,7 @@ import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||||
canResize:false,
|
canResize:false,
|
||||||
useSearchForm: false,
|
useSearchForm: false,
|
||||||
actionColumn: {
|
actionColumn: {
|
||||||
width: 120,
|
width: 220,
|
||||||
fixed: 'right',
|
fixed: 'right',
|
||||||
},
|
},
|
||||||
beforeFetch: (params) => {
|
beforeFetch: (params) => {
|
||||||
|
@ -124,6 +129,11 @@ import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||||
registerModal.value.disableSubmit = false;
|
registerModal.value.disableSubmit = false;
|
||||||
registerModal.value.edit(record);
|
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() {
|
function handleSuccess() {
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleDown(record){
|
||||||
|
downloadFile(text);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 操作栏
|
* 操作栏
|
||||||
*/
|
*/
|
||||||
function getTableAction(record) {
|
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: '详情',
|
label: '详情',
|
||||||
onClick: handleDetail.bind(null, record),
|
onClick: handleDetail.bind(null, record),
|
||||||
},
|
},];
|
||||||
];
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -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>
|
|
@ -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>
|
Loading…
Reference in New Issue