添加切换导航流程

This commit is contained in:
yangjun 2024-05-06 19:41:47 +08:00
parent 793efd15c7
commit 426450f48f
19 changed files with 1983 additions and 159 deletions

View File

@ -6,19 +6,27 @@ import { mainOutRoutes } from './mainOut';
import { PageEnum } from '/@/enums/pageEnum';
import { t } from '/@/hooks/web/useI18n';
import NoTokenSiteRoute from './modules/site/site';
// import NoTokenSiteRoute from './modules/site/site';
// import NoTokenZyRoute from './modules/zy/zy';
// import NoTokenSiteRoute from './modules/site.ts';
// const NoTokenSiteRoute = import.meta.glob('./modules/site/site.ts', { eager: true });
const modules = import.meta.glob('./modules/**/*.ts', { eager: true });
// console.log(`🚀 ~ modules:`, modules)
const routeModuleList: AppRouteModule[] = [];
const routeModuleStaticList: AppRouteModule[] = [];
// 加入到路由集合中
Object.keys(modules).forEach((key) => {
const mod = (modules as Recordable)[key].default || {};
const modList = Array.isArray(mod) ? [...mod] : [mod];
if(modList[0] && modList[0]?.meta?.isAddStaticPath){
routeModuleStaticList.push(...modList)
}
routeModuleList.push(...modList);
});
@ -85,5 +93,5 @@ export const basicRoutes = [
PAGE_NOT_FOUND_ROUTE,
TokenLoginRoute,
Oauth2LoginRoute,
NoTokenSiteRoute,
...routeModuleStaticList,
];

View File

@ -9,6 +9,7 @@ const site: AppRouteModule = {
component: () => import('/@/layouts/page/index.vue'),
redirect: '/site/index',
meta: {
isAddStaticPath: true,//是否静态引入不用配置menu表
orderNo: 10,
icon: 'ion:grid-outline',
title: t('routes.dashboard.dashboard'),
@ -189,24 +190,6 @@ const site: AppRouteModule = {
title: '选择课程',
},
},
{
path: 'dqkcDetail',
name: 'dqkcDetail',
component: () => import('/@/views/site/renKeJiaoCheng/checkKecheng/dqxqkcDetail.vue'),
meta: {
title: '课程工作台',
},
},
{
path: 'dqkcGongju',
name: 'dqkcGongju',
component: () => import('/@/views/site/renKeJiaoCheng/checkKecheng/dqxqkcGongju.vue'),
meta: {
title: '课程工具',
},
},
],
};

View File

@ -0,0 +1,52 @@
import type { AppRouteModule } from '/@/router/types';
// import { LAYOUT } from '/@/router/constant';
import { t } from '/@/hooks/web/useI18n';
const zuoye: AppRouteModule = {
path: '/zy',
name: 'zy',
component: () => import('/@/views/site/renKeJiaoCheng/checkKecheng/dqxqkcMain.vue'),
redirect: '/zy/main',
meta: {
isAddStaticPath: true,//是否静态引入不用配置menu表
orderNo: 103,
title: '作业',
},
children: [
{
path: 'main',
name: 'zuoyeMain',
meta: {
title: '作业管理',
},
component: () => import('/@/views/site/renKeJiaoCheng/checkKecheng/dqxqkcDetail.vue'),
},
{
path: 'dqkcDetail',
name: 'dqkcDetail',
component: () => import('/@/views/site/renKeJiaoCheng/checkKecheng/dqxqkcDetail.vue'),
meta: {
title: '课程工作台',
},
},
{
path: 'dqkcDqzy',
name: 'dqkcDqzy',
component: () => import('/@/views/zy/zyInfo/ZyInfoList.vue'),
meta: {
title: '当前作业',
},
},
{
path: 'dqkcGongju',
name: 'dqkcGongju',
component: () => import('/@/views/site/renKeJiaoCheng/checkKecheng/dqxqkcGongju.vue'),
meta: {
title: '课程工具',
},
},
]
}
export default zuoye;

View File

@ -92,6 +92,24 @@ export const columns: BasicColumn[] = [
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: '学年学期',
field: 'xnxq',
component: 'JDictSelectTag',
componentProps:{
dictCode:'kc_xqxn_history,title,title'
},
},
{
label: '课程名称',
field: 'kcmc',
component: 'JInput',
},
{
label: '听课教师',
field: 'tkjs',
component: 'JInput',
},
];
//表单数据
export const formSchema: FormSchema[] = [

View File

@ -4,7 +4,7 @@
<a-col :xs="{ span: 24 }" :sm="{ span: 8 }" :lg="{ span: 8 }" :key="index" v-for="(item, index) in allList" >
<div class="ketangCard ketangCardcol" >
<div class="rjkcTopDiv">
<div style="text-align: left;"><span>{{ toWeek(item.week) }}{{ item.hh }}</span></div>
<div style="text-align: left;"><span>{{ item.sksj }}</span></div>
</div>
<div class="rjkcBodyDiv">
<div class="kcmcDiv">{{ item.kcmc }}</div>
@ -22,8 +22,11 @@
import { getUserSf,getSysConfig } from '/@/views/site/utils/index';
import { defHttp } from '/@/utils/http/axios';
import { router } from '/@/router';
import { useRouter } from 'vue-router';
const allList = ref<any>([]);
const weebMap = {
'1': '星期一',
@ -47,7 +50,7 @@ function toWeek(week){
function openKechengDetail(item){
console.log(`🚀 ~ openKechengDetail ~ item:`, item)
window.open(`/site/dqkcDetail?kechengbiaoid=`+item.id,"_blank");
window.open(`/zy/dqkcDetail?rwbh=`+item.rwbh,"_blank");
}
</script>
<style lang="less" scoped>

View File

@ -1,97 +1,5 @@
<template>
<div id="siteMain">
<div id="maxSite" :style="maxClassName">
<a-layout style="height: calc(100vh - 140px)">
<headerPage/>
<!-- 页头 -->
<!-- <a-layout-sider style="height: calc(100vh - 160px);left: 0;top: 0;bottom: 0;min-height: calc(100vh - 160px);background-color: #ffffff;">
<a-row>
<a-col :span="24">
<a-menu
v-model:selectedKeys="selectedKeys"
style="width: 200px"
mode="inline"
>
<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="3">教学单元内容</a-menu-item>
</a-sub-menu>
<a-sub-menu key="sub2">
<template #title>测验/作业</template>
<a-menu-item key="4">当前作业</a-menu-item>
<a-menu-item key="5">历史作业</a-menu-item>
</a-sub-menu>
<a-sub-menu key="sub3">
<template #title>问卷管理</template>
<a-menu-item key="6">当前问卷</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" @click="getGzt('18')">
<span>工具</span>
</a-menu-item>
</a-menu>
</a-col>
<a-col :span="20">
</a-col>
</a-row>
</a-layout-sider>
<a-layout style="min-height: 100%;">
<a-layout-content style="overflow: initial">
<RouterView/>
</a-layout-content>
</a-layout> -->
<!-- 主体部分 -->
<a-layout-content style="margin: 10px 0; min-height: 580px;">
<a-card style="min-height: 580px;">
<a-row>
<a-col :span="4">
<a-menu
v-model:selectedKeys="selectedKeys"
style="width: 256px"
mode="inline"
>
<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="3">教学单元内容</a-menu-item>
</a-sub-menu>
<a-sub-menu key="sub2">
<template #title>测验/作业</template>
<a-menu-item key="4">当前作业</a-menu-item>
<a-menu-item key="5">历史作业</a-menu-item>
</a-sub-menu>
<a-sub-menu key="sub3">
<template #title>问卷管理</template>
<a-menu-item key="6">当前问卷</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>
</a-col>
<a-col :span="20">
</a-col>
</a-row>
</a-card>
</a-layout-content>
<!-- 页尾 -->
<footerPage/>
</a-layout>
</div>
<div>
</div>
</template>
@ -109,59 +17,28 @@
const maxClassName = ref<any>({});
const selectedKeys = ref<string[]>([]);
//
const { currentRoute,router } = useRouter();
const { query } = unref(currentRoute);
const { kechengbiaoid } = query;//
// let router = useRouter();
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh } = query;//
let router = useRouter();
function getGzt(type){
var href = "/site/dqkcGongju";
console.log(`🚀 ~ getGzt ~ type:`, type)
// var href = "/site/dqkcDetail";
var href = "/site/dqkcDqzy";
if(type=='dqzy'){
href = "/site/dqkcDqzy";
}
router.push(href);
}
//
onMounted(() => {
console.log('kechengbiaoid:',kechengbiaoid);
console.log('rwbh:',rwbh);
});
</script>
<style lang="less" scoped>
#siteMain {
// font-size: ;
// height: 100%;
background: #f3f3f4;
#maxSite {
//
max-width: 1070px;
min-height: 750px;
//
margin: 0 auto;
.rowGutter{
margin-top: 1rem;
margin-bottom: 1rem;
}
.ant-layout-header {
color: #fff;
background: #1ab394;
}
.ant-layout-footer {
line-height: 1.5;
background: #FFF;
}
.ant-layout-sider {
color: #fff;
line-height: 120px;
background: #3ba0e9;
}
.ant-layout-content {
min-height: 120px;
color: #000;
line-height: 120px;
background: #f3f3f4;
}
}
}
</style>

View File

@ -0,0 +1,95 @@
<template>
<div id="siteMain">
<div id="maxSite">
<a-layout style="height: calc(100vh - 30px)">
<headerPage/>
<a-row>
<a-col :span="5">
<dqxqkcMenu/>
</a-col>
<a-col :span="19">
<RouterView/>
</a-col>
</a-row>
<footerPage/>
</a-layout>
</div>
</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 headerPage from '/@/views/site/common/header.vue';
import footerPage from '/@/views/site/common/footer.vue';
import dqxqkcMenu from '/@/views/site/renKeJiaoCheng/checkKecheng/dqxqkcMenu.vue';
import dqxqkc from '/@/views/site/renKeJiaoCheng/checkKecheng/dqxqkc.vue';
const maxClassName = ref<any>({});
const selectedKeys = ref<string[]>([]);
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh } = query;//
let router = useRouter();
function getGzt(type){
console.log(`🚀 ~ getGzt ~ type:`, type)
// var href = "/site/dqkcDetail";
var href = "/site/dqkcDqzy";
if(type=='dqzy'){
href = "/site/dqkcDqzy";
}
router.push(href);
}
//
onMounted(() => {
console.log('rwbh:',rwbh);
});
</script>
<style lang="less" scoped>
#siteMain {
// font-size: ;
// height: 100%;
background: #f3f3f4;
#maxSite {
//
max-width: 1070px;
min-height: calc(100vh);
//
margin: 0 auto;
.rowGutter{
margin-top: 1rem;
margin-bottom: 1rem;
}
.ant-layout-header {
color: #fff;
background: #1ab394;
}
.ant-layout-footer {
line-height: 1.5;
background: #FFF;
}
.ant-layout-sider {
color: #fff;
line-height: 120px;
background: #3ba0e9;
}
.ant-layout-content {
min-height: 120px;
color: #000;
line-height: 120px;
background: #f3f3f4;
}
}
}
</style>

View File

@ -0,0 +1,111 @@
<template>
<div id="siteMain" style="min-height: calc(100vh - 150px);">
<a-row>
<a-col :span="24">
<a-menu
v-model:selectedKeys="selectedKeys"
style="width: 200px;min-height: calc(100vh - 150px);"
mode="inline"
>
<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="3">教学单元内容</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" @click="getGzt('lszy')">历史作业</a-menu-item>
</a-sub-menu>
<a-sub-menu key="sub3">
<template #title>问卷管理</template>
<a-menu-item key="6">当前问卷</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>
</a-col>
</a-row>
</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 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[]>([]);
//
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh } = query;//
let router = useRouter();
function getGzt(type){
console.log(`🚀 ~ getGzt ~ type:`, type)
var href = "/zy/dqkcDqzy";
if(type=='dqzy'){
href = "/zy/dqkcDqzy";
}
router.push(href);
}
//
onMounted(() => {
console.log('rwbh:',rwbh);
});
</script>
<style lang="less" scoped>
#siteMain {
// font-size: ;
// height: 100%;
background: #f3f3f4;
#maxSite {
//
max-width: 1070px;
min-height: 750px;
//
margin: 0 auto;
.rowGutter{
margin-top: 1rem;
margin-bottom: 1rem;
}
.ant-layout-header {
color: #fff;
background: #1ab394;
}
.ant-layout-footer {
line-height: 1.5;
background: #FFF;
}
.ant-layout-sider {
color: #fff;
line-height: 120px;
background: #3ba0e9;
}
.ant-layout-content {
min-height: 120px;
color: #000;
line-height: 120px;
background: #f3f3f4;
}
}
}
</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 = '/zyInfo/zyInfo/list',
save='/zyInfo/zyInfo/add',
edit='/zyInfo/zyInfo/edit',
deleteOne = '/zyInfo/zyInfo/delete',
deleteBatch = '/zyInfo/zyInfo/deleteBatch',
importExcel = '/zyInfo/zyInfo/importExcel',
exportXls = '/zyInfo/zyInfo/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,240 @@
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'
},
{
title: '类型',
align: "center",
dataIndex: 'zyType_dictText'
},
{
title: '描述',
align: "center",
dataIndex: 'content'
},
{
title: '开始时间',
align: "center",
dataIndex: 'startTime',
customRender:({text}) =>{
return !text?"":(text.length>10?text.substr(0,10):text);
},
},
{
title: '结束时间',
align: "center",
dataIndex: 'endTime',
customRender:({text}) =>{
return !text?"":(text.length>10?text.substr(0,10):text);
},
},
{
title: '状态',
align: "center",
dataIndex: 'zyStatus'
},
{
title: '学年学期',
align: "center",
dataIndex: 'xnxq'
},
{
title: '外网是否查重',
align: "center",
dataIndex: 'wwcc_dictText'
},
{
title: '外网通过率',
align: "center",
dataIndex: 'wwtgl'
},
{
title: '内网查重',
align: "center",
dataIndex: 'nwcc_dictText'
},
{
title: '内网通过率',
align: "center",
dataIndex: 'nwtgl'
},
{
title: 'aigc查重',
align: "center",
dataIndex: 'aigccc_dictText'
},
{
title: 'aigc通过率',
align: "center",
dataIndex: 'aigctgl'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "作业名称",
field: 'title',
component: 'Input',
colProps: {span: 6},
},
{
label: "类型",
field: 'zyType',
component: 'JDictSelectTag',
componentProps:{
dictCode: "zy_type"
},
colProps: {span: 6},
},
{
label: "状态",
field: 'zyStatus',
component: 'Input',
colProps: {span: 6},
},
{
label: "学年学期",
field: 'xnxq',
component: 'Input',
colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '作业名称',
field: 'title',
component: 'Input',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入作业名称!'},
];
},
},
{
label: '类型',
field: 'zyType',
component: 'JDictSelectTag',
componentProps:{
dictCode: "zy_type"
},
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入类型!'},
];
},
},
{
label: '描述',
field: 'content',
component: 'Input',
},
{
label: '开始时间',
field: 'startTime',
component: 'DatePicker',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入开始时间!'},
];
},
},
{
label: '结束时间',
field: 'endTime',
component: 'DatePicker',
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入结束时间!'},
];
},
},
{
label: '外网是否查重',
field: 'wwcc',
component: 'JDictSelectTag',
componentProps:{
dictCode: "yn"
},
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入外网是否查重!'},
];
},
},
{
label: '外网通过率',
field: 'wwtgl',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: false},
{ pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'},
];
},
},
{
label: '内网查重',
field: 'nwcc',
component: 'JDictSelectTag',
componentProps:{
dictCode: "yn"
},
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入内网查重!'},
];
},
},
{
label: '内网通过率',
field: 'nwtgl',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: false},
{ pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'},
];
},
},
{
label: 'aigc查重',
field: 'aigccc',
component: 'JDictSelectTag',
componentProps:{
dictCode: "yn"
},
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入aigc查重!'},
];
},
},
{
label: 'aigc通过率',
field: 'aigctgl',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {
return [
{ required: false},
{ pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'},
];
},
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,250 @@
<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="类型">
<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">
<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 @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" :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>
<!-- 表单区域 -->
<ZyInfoModal ref="registerModal" @success="handleSuccess"></ZyInfoModal>
</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 JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.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,250 @@
<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="类型">
<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">
<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 @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" :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>
<!-- 表单区域 -->
<ZyInfoModal ref="registerModal" @success="handleSuccess"></ZyInfoModal>
</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 JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.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,200 @@
<template>
<a-spin :spinning="confirmLoading">
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="12">
<a-form-item label="作业名称" v-bind="validateInfos.title">
<a-input v-model:value="formData.title" placeholder="请输入作业名称" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="类型" v-bind="validateInfos.zyType">
<j-dict-select-tag type='radio' v-model:value="formData.zyType" dictCode="zy_type" placeholder="请选择类型" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="描述" v-bind="validateInfos.content" :labelCol="labelCol2" :wrapperCol="wrapperCol2">
<a-input v-model:value="formData.content" placeholder="请输入描述" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="开始时间" v-bind="validateInfos.startTime">
<a-date-picker placeholder="请选择开始时间" v-model:value="formData.startTime" value-format="YYYY-MM-DD" style="width: 100%" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="结束时间" v-bind="validateInfos.endTime">
<a-date-picker placeholder="请选择结束时间" v-model:value="formData.endTime" value-format="YYYY-MM-DD" style="width: 100%" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="外网是否查重" v-bind="validateInfos.wwcc">
<j-dict-select-tag type='radio' v-model:value="formData.wwcc" dictCode="yn" placeholder="请选择外网是否查重" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="外网通过率" v-bind="validateInfos.wwtgl">
<a-input-number v-model:value="formData.wwtgl" placeholder="请输入外网通过率" style="width: 100%" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="内网是否查重" v-bind="validateInfos.nwcc">
<j-dict-select-tag type='radio' v-model:value="formData.nwcc" dictCode="yn" placeholder="请选择内网查重" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="内网通过率" v-bind="validateInfos.nwtgl">
<a-input-number v-model:value="formData.nwtgl" placeholder="请输入内网通过率" style="width: 100%" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="aigc是否查重" v-bind="validateInfos.aigccc">
<j-dict-select-tag type='radio' v-model:value="formData.aigccc" dictCode="yn" placeholder="请选择aigc查重" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="aigc通过率" v-bind="validateInfos.aigctgl">
<a-input-number v-model:value="formData.aigctgl" placeholder="请输入aigc通过率" style="width: 100%" :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 JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../ZyInfo.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: '',
title: '',
zyType: undefined,
content: '',
startTime: '',
endTime: '',
wwcc: undefined,
wwtgl: undefined,
nwcc: undefined,
nwtgl: undefined,
aigccc: undefined,
aigctgl: undefined,
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const labelCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 3 } });
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
title: [{ required: true, message: '请输入作业名称!'},],
zyType: [{ required: true, message: '请输入类型!'},],
startTime: [{ required: true, message: '请输入开始时间!'},],
endTime: [{ required: true, message: '请输入结束时间!'},],
wwcc: [{ required: true, message: '请输入外网是否查重!'},],
wwtgl: [{ required: false}, { pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'},],
nwcc: [{ required: true, message: '请输入内网查重!'},],
nwtgl: [{ required: false}, { pattern: /^-?\d+\.?\d*$/, message: '请输入数字!'},],
aigccc: [{ required: true, message: '请输入aigc查重!'},],
aigctgl: [{ required: false}, { pattern: /^-?\d+\.?\d*$/, 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="关闭">
<ZyInfoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ZyInfoForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import ZyInfoForm from './ZyInfoForm.vue'
const title = ref<string>('');
const width = ref<string>('80%');
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
const emit = defineEmits(['register', 'success']);
/**
* 新增
*/
function add() {
title.value = '新增';
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
title.value = disableSubmit.value ? '详情' : '编辑';
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
emit('success');
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style>
/**隐藏样式-modal确定按钮 */
.jee-hidden {
display: none !important;
}
</style>

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/zyInfoStudent/zyInfoStudent/list',
save='/zyInfoStudent/zyInfoStudent/add',
edit='/zyInfoStudent/zyInfoStudent/edit',
deleteOne = '/zyInfoStudent/zyInfoStudent/delete',
deleteBatch = '/zyInfoStudent/zyInfoStudent/deleteBatch',
importExcel = '/zyInfoStudent/zyInfoStudent/importExcel',
exportXls = '/zyInfoStudent/zyInfoStudent/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,81 @@
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: 'mainId'
},
{
title: '作业附件',
align: "center",
dataIndex: 'filePath',
slots: { customRender: 'fileSlot' },
},
{
title: '外网相似律',
align: "center",
dataIndex: 'wwxsl'
},
{
title: '内网相似律',
align: "center",
dataIndex: 'nwxsl'
},
{
title: 'aigc相似律',
align: "center",
dataIndex: 'aigcxsl'
},
{
title: '外网是否通过',
align: "center",
dataIndex: 'wwsftg'
},
{
title: '内网是否通过',
align: "center",
dataIndex: 'nwsftg'
},
{
title: 'aigc是否通过',
align: "center",
dataIndex: 'aigcsftg'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
{
label: "作业名称",
field: 'mainId',
component: 'Input',
colProps: {span: 6},
},
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: '作业附件',
field: 'filePath',
component: 'JUpload',
componentProps:{
},
dynamicRules: ({model,schema}) => {
return [
{ required: true, message: '请输入作业附件!'},
];
},
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -0,0 +1,233 @@
<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.mainId"></a-input>
</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 @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" :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>
<!-- 表单区域 -->
<ZyInfoStudentModal ref="registerModal" @success="handleSuccess"></ZyInfoStudentModal>
</div>
</template>
<script lang="ts" name="zyInfoStudent-zyInfoStudent" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './ZyInfoStudent.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ZyInfoStudent.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ZyInfoStudentModal from './components/ZyInfoStudentModal.vue'
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.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,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.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 '../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: '',
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 = {
filePath: [{ 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 './ZyInfoStudentForm.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>