2023年4月1日 修复问题
This commit is contained in:
parent
46ecc4f96f
commit
8ff3e20afc
|
@ -107,7 +107,7 @@
|
|||
|
||||
//update-begin-author:taoyan date:2022-6-1 for: VUEN-1144 online 配置成菜单后,打开菜单,显示名称未展示为菜单名称
|
||||
function storePathTitle(path) {
|
||||
console.log('storePathTitle', path);
|
||||
// console.log('storePathTitle', path);
|
||||
let title = '';
|
||||
if (instance!.attrs) {
|
||||
let item: any = instance!.attrs.item;
|
||||
|
|
|
@ -70,7 +70,7 @@ export const TokenLoginRoute: AppRouteRecordRaw = {
|
|||
},
|
||||
};
|
||||
|
||||
console.log('NoTokenSiteRoute =>', NoTokenSiteRoute, modules, Oauth2LoginRoute);
|
||||
// console.log('NoTokenSiteRoute =>', NoTokenSiteRoute, modules, Oauth2LoginRoute);
|
||||
/**
|
||||
* 门户页
|
||||
*/
|
||||
|
|
|
@ -8,7 +8,7 @@ export const LOCALE: { [key: string]: LocaleType } = {
|
|||
|
||||
export const localeSetting: LocaleSetting = {
|
||||
// 是否显示语言选择器
|
||||
showPicker: true,
|
||||
showPicker: false,
|
||||
// 当前语言
|
||||
locale: LOCALE.ZH_CN,
|
||||
// 默认语言
|
||||
|
|
|
@ -28,8 +28,7 @@ export const getImportUrl = Api.importExcel;
|
|||
* 列表接口
|
||||
* @param params
|
||||
*/
|
||||
// export const list = (params) => defHttp.get({ url: Api.list, params: { pageSize: -1, ...params } });
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params: { ...params } });
|
||||
export const list = (params) => defHttp.get({ url: Api.list, params });
|
||||
|
||||
/**
|
||||
* 删除单个
|
||||
|
|
|
@ -4,6 +4,19 @@ import { rules} from '/@/utils/helper/validator';
|
|||
import { render } from '/@/utils/common/renderUtils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: 'id',
|
||||
align: "center",
|
||||
width: '0',
|
||||
dataIndex: 'id',
|
||||
// ifShow: false,
|
||||
},
|
||||
{
|
||||
title: '课程编号',
|
||||
align: "center",
|
||||
width: '300px',
|
||||
dataIndex: 'kcbh'
|
||||
},
|
||||
{
|
||||
title: '课程名称',
|
||||
align: "center",
|
||||
|
@ -12,85 +25,275 @@ export const columns: BasicColumn[] = [
|
|||
{
|
||||
title: '授课教师',
|
||||
align: "center",
|
||||
dataIndex: 'skjs'
|
||||
dataIndex: 'skjs_dictText'
|
||||
},
|
||||
{
|
||||
title: '授课时间',
|
||||
title: '学科人数',
|
||||
align: "center",
|
||||
dataIndex: 'sksj'
|
||||
width: '80px',
|
||||
dataIndex: 'xkrs'
|
||||
},
|
||||
{
|
||||
title: '开课单位',
|
||||
align: "center",
|
||||
width: '100px',
|
||||
dataIndex: 'kkdw_dictText'
|
||||
},
|
||||
{
|
||||
title: '课程性质',
|
||||
align: "center",
|
||||
width: '105px',
|
||||
dataIndex: 'kcxz_dictText'
|
||||
},
|
||||
{
|
||||
title: '上课地点',
|
||||
align: "center",
|
||||
width: '100px',
|
||||
dataIndex: 'skdd'
|
||||
},
|
||||
{
|
||||
title: '上课周次',
|
||||
align: "center",
|
||||
width: '100px',
|
||||
dataIndex: 'jkzc_dictText'
|
||||
},
|
||||
{
|
||||
title: '节次',
|
||||
align: "center",
|
||||
dataIndex: 'hh'
|
||||
width: '70px',
|
||||
dataIndex: 'hh_dictText'
|
||||
},
|
||||
{
|
||||
title: '星期几',
|
||||
align: "center",
|
||||
dataIndex: 'week'
|
||||
width: '70px',
|
||||
dataIndex: 'week_dictText'
|
||||
},
|
||||
{
|
||||
title: '直播方式',
|
||||
title: '学分',
|
||||
align: "center",
|
||||
dataIndex: 'zbfs'
|
||||
width: '50px',
|
||||
dataIndex: 'xf'
|
||||
},
|
||||
{
|
||||
title: '会议号',
|
||||
title: '是否出镜',
|
||||
align: "center",
|
||||
dataIndex: 'hyh'
|
||||
dataIndex: 'sfcj',
|
||||
edit: true,
|
||||
editComponent: 'Select',
|
||||
// editComponentProps: {
|
||||
// // //选中
|
||||
// checkedChildren: "是-",
|
||||
// // checkedValue: 0,
|
||||
// // //未选中
|
||||
// unCheckedChildren:'否-',
|
||||
// // unCheckedValue: 1,
|
||||
// // onClick: (checked: boolean | string | number, event: Event) => {
|
||||
// // event.stopPropagation();
|
||||
// // console.log('选择后回调',checked,event);
|
||||
|
||||
// // }
|
||||
// },
|
||||
// editValueMap: (value) => value == '0'?'是':'否',
|
||||
// editValueMap: (value) => value?'0':'1',
|
||||
// format: (text) => ,C
|
||||
editComponentProps: {
|
||||
options: [
|
||||
{ label: '是', value: 0, },
|
||||
{ label: '否', value: 1, },
|
||||
],
|
||||
},
|
||||
// customRender: (r) => r.text == 0?'是':'否'
|
||||
},
|
||||
|
||||
|
||||
{
|
||||
title: '会议密码',
|
||||
title: '上课形式',
|
||||
align: "center",
|
||||
dataIndex: 'hymm'
|
||||
dataIndex: 'skxs',
|
||||
edit: true,
|
||||
editComponent: 'Select',
|
||||
editComponentProps: {
|
||||
options: [
|
||||
{ label: '线上', value: 0, },
|
||||
{ label: '线下', value: 1, },
|
||||
{ label: '线上线下混合', value: 2, },
|
||||
],
|
||||
},
|
||||
// customRender: (r) => r.text == 0?'线上':r.text == 1?'线下':'线上线下混合'
|
||||
},
|
||||
{
|
||||
title: '课程链接',
|
||||
align: "center",
|
||||
dataIndex: 'kclj'
|
||||
},
|
||||
// {
|
||||
// title: '直播平台',
|
||||
// align: "center",
|
||||
// dataIndex: 'zbpx'
|
||||
// },
|
||||
];
|
||||
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: "课程名称",
|
||||
field: 'kcmc',
|
||||
component: 'Input',
|
||||
colProps: {span: 6},
|
||||
},
|
||||
{
|
||||
label: "授课教师",
|
||||
field: 'skjs',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
},
|
||||
colProps: {span: 6},
|
||||
},
|
||||
{
|
||||
label: "开课单位",
|
||||
field: 'kkdw',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
},
|
||||
colProps: {span: 6},
|
||||
},
|
||||
{
|
||||
label: "课程性质",
|
||||
field: 'kcxz',
|
||||
component: 'Input',
|
||||
colProps: {span: 6},
|
||||
},
|
||||
{
|
||||
label: "节次",
|
||||
field: 'hh',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: "skjc"
|
||||
},
|
||||
colProps: {span: 6},
|
||||
},
|
||||
{
|
||||
label: "星期几",
|
||||
field: 'week',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: "week"
|
||||
},
|
||||
colProps: {span: 6},
|
||||
},
|
||||
];
|
||||
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '课程编号',
|
||||
field: 'kcbh',
|
||||
component: 'Input',
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入课程编号!'},
|
||||
{...rules.duplicateCheckRule('kc_kechengbiao', 'kcbh',model,schema)[0]},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '课程名称',
|
||||
field: 'kcmc',
|
||||
component: 'Input',
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入课程名称!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '授课教师',
|
||||
field: 'skjs',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: ""
|
||||
},
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入授课教师!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '学科人数',
|
||||
field: 'xkrs',
|
||||
component: 'Input',
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入学科人数!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '开课单位',
|
||||
field: 'kkdw',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: ""
|
||||
},
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入开课单位!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '课程性质',
|
||||
field: 'kcxz',
|
||||
component: 'Input',
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入课程性质!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '上课地点',
|
||||
field: 'skdd',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '授课时间',
|
||||
field: 'sksj',
|
||||
component: 'Input',
|
||||
label: '上课周次',
|
||||
field: 'jkzc',
|
||||
component: 'JSelectMultiple',
|
||||
componentProps:{
|
||||
dictCode: "skzc"
|
||||
},
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入上课周次!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '节次',
|
||||
field: 'hh',
|
||||
component: 'Input',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: "skjc"
|
||||
},
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入节次!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '星期几',
|
||||
field: 'week',
|
||||
component: 'Input',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: "week"
|
||||
},
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入星期几!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '直播方式',
|
||||
field: 'zbfs',
|
||||
component: 'Input',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: "skpt"
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '会议号',
|
||||
|
@ -108,9 +311,24 @@ export const formSchema: FormSchema[] = [
|
|||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '直播平台',
|
||||
field: 'zbpx',
|
||||
label: '学分',
|
||||
field: 'xf',
|
||||
component: 'Input',
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入学分!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '是否出镜,0-出镜,1-不出镜',
|
||||
field: 'sfcj',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
{
|
||||
label: '上课形式,0-线上,1-线下,2-线上线下混合',
|
||||
field: 'skxs',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
|
|
|
@ -4,15 +4,60 @@
|
|||
<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.kcmc"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="8">
|
||||
<a-form-item label="授课教师">
|
||||
<a-input placeholder="请输入授课教师" v-model:value="queryParam.skjs"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!--<template v-if="toggleSearchStatus">-->
|
||||
<a-col :lg="8">
|
||||
<a-form-item label="开课单位">
|
||||
<a-input placeholder="请输入开课单位" v-model:value="queryParam.kkdw"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="8">
|
||||
<a-form-item label="课程性质">
|
||||
<!-- <a-input placeholder="请输入课程性质" v-model:value="queryParam.kcxz"></a-input> -->
|
||||
<j-dict-select-tag v-model:value="queryParam.kcxz" dictCode="kcxz" placeholder="请选择课程性质"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="8">
|
||||
<a-form-item label="节次">
|
||||
<j-dict-select-tag placeholder="请选择节次" v-model:value="queryParam.hh" dictCode="skjc"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="8">
|
||||
<a-form-item label="星期几">
|
||||
<j-dict-select-tag placeholder="请选择星期几" v-model:value="queryParam.week" dictCode="week"/>
|
||||
</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">
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection" :beforeEditSubmit="beforeEditSubmit">
|
||||
<!--插槽: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>
|
||||
<!-- <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>
|
||||
|
@ -26,8 +71,10 @@
|
|||
<a-button>批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</a-dropdown> -->
|
||||
</template>
|
||||
<!-- 不显示【未选中任何数据】栏 -->
|
||||
<template #tableTop><span></span></template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
|
@ -47,6 +94,8 @@
|
|||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<KcKechengbiaoModal ref="registerModal" @success="handleSuccess"></KcKechengbiaoModal>
|
||||
|
||||
<KcKetangbiaoList v-show="selectedRows[0]" :currentRowKey="selectedRows[0]"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -54,35 +103,47 @@
|
|||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { columns } from './KcKechengbiao.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './KcKechengbiao.api';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, saveOrUpdate } from './KcKechengbiao.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import KcKechengbiaoModal from './components/KcKechengbiaoModal.vue'
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import KcKetangbiaoList from './KcKetangbiaoList.vue'
|
||||
|
||||
const queryParam = ref<any>({});
|
||||
const queryParam = ref<any>({ });
|
||||
const filterInfo = ref<any>({ xnxq: '2022-2023-2' });
|
||||
//kkdwid, week, hh, kcbh
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '课程管理',
|
||||
title: '课程管理-主表',
|
||||
api: list,
|
||||
columns,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
showIndexColumn: true,
|
||||
showActionColumn: false,
|
||||
clickToRowSelect: true,
|
||||
rowSelection: {
|
||||
type: 'radio'
|
||||
},
|
||||
pagination: {
|
||||
pageSize: 5
|
||||
},
|
||||
actionColumn: {
|
||||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
beforeFetch: (params) => {
|
||||
params.column = '',params.order = '';//新生成的默认不带排序
|
||||
return Object.assign(params, queryParam.value);
|
||||
return Object.assign(params, { ...queryParam.value, ...filterInfo.value});
|
||||
},
|
||||
showActionColumn: false,
|
||||
pagination: false,
|
||||
},
|
||||
exportConfig: {
|
||||
name: "课程管理",
|
||||
name: "课程管理-主表",
|
||||
url: getExportUrl,
|
||||
},
|
||||
importConfig: {
|
||||
|
@ -90,7 +151,7 @@
|
|||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext;
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys, selectedRows }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs: { span: 24 },
|
||||
sm: { span: 7 },
|
||||
|
@ -100,6 +161,8 @@
|
|||
sm: { span: 16 },
|
||||
});
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
|
@ -193,6 +256,92 @@
|
|||
}
|
||||
|
||||
|
||||
function handleEditEnd({ record, index, key, value }: Recordable) {
|
||||
console.log(record, index, key, value);
|
||||
return false;
|
||||
}
|
||||
|
||||
// 模拟将指定数据保存
|
||||
function feakSave({ value, key, id }) {
|
||||
createMessage.loading({
|
||||
content: `正在保存!`,
|
||||
key: '_save_fake_data',
|
||||
duration: 0,
|
||||
});
|
||||
const params = {
|
||||
id,
|
||||
};
|
||||
params[key] = value;
|
||||
return new Promise((resolve) => {
|
||||
saveOrUpdate(params ,true).then(res => {
|
||||
if (res.success) {
|
||||
createMessage.success({
|
||||
content: `记录已保存`,
|
||||
key: '_save_fake_data',
|
||||
duration: 2,
|
||||
});
|
||||
resolve(true);
|
||||
} else {
|
||||
createMessage.error({
|
||||
content: `保存失败:${res.message}`,
|
||||
key: '_save_fake_data',
|
||||
duration: 2,
|
||||
});
|
||||
resolve(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
async function beforeEditSubmit({ record, index, key, value }) {
|
||||
console.log('单元格数据正在准备提交', { record, index, key, value });
|
||||
return await feakSave({ id: record.id, key, value });
|
||||
}
|
||||
|
||||
function handleEditCancel() {
|
||||
console.log('cancel');
|
||||
}
|
||||
|
||||
|
||||
// function handleEditEnd({ record, index, key, value }: Recordable) {
|
||||
// console.log(record, index, key, value);
|
||||
// return false;
|
||||
// }
|
||||
|
||||
// async function beforeEditSubmit({ record, index, key, value }) {
|
||||
// console.log('编辑后回调', record, index, key, value );
|
||||
// createMessage.loading({
|
||||
// content: `正在模拟保存${key}`,
|
||||
// key: '_save_fake_data',
|
||||
// duration: 0,
|
||||
// });
|
||||
// return await new Promise((resolve) => {
|
||||
// setTimeout(() => {
|
||||
// if (value === '') {
|
||||
// createMessage.error({
|
||||
// content: '保存失败:不能为空',
|
||||
// key: '_save_fake_data',
|
||||
// duration: 2,
|
||||
// });
|
||||
// resolve(false);
|
||||
// } else {
|
||||
// createMessage.success({
|
||||
// content: `记录的${key}已保存`,
|
||||
// key: '_save_fake_data',
|
||||
// duration: 2,
|
||||
// });
|
||||
// resolve(true);
|
||||
// }
|
||||
// }, 2000);
|
||||
// });
|
||||
// }
|
||||
|
||||
// function handleEditCancel() {
|
||||
// console.log('cancel');
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
|
|
@ -67,6 +67,6 @@ export const batchDelete = (params, handleSuccess) => {
|
|||
* @param isUpdate
|
||||
*/
|
||||
export const saveOrUpdate = (params, isUpdate) => {
|
||||
const url = isUpdate ? Api.edit : Api.save;
|
||||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
||||
|
|
|
@ -4,40 +4,20 @@ import { rules} from '/@/utils/helper/validator';
|
|||
import { render } from '/@/utils/common/renderUtils';
|
||||
//列表数据
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '课程编号',
|
||||
align: "center",
|
||||
dataIndex: 'kcbh'
|
||||
},
|
||||
{
|
||||
title: '课程名称',
|
||||
align: "center",
|
||||
dataIndex: 'kcmc'
|
||||
},
|
||||
{
|
||||
title: '学分',
|
||||
align: "center",
|
||||
dataIndex: 'xf'
|
||||
},
|
||||
{
|
||||
title: '授课教师',
|
||||
align: "center",
|
||||
dataIndex: 'skjs'
|
||||
},
|
||||
{
|
||||
title: '选课人数',
|
||||
title: '上课时间',
|
||||
align: "center",
|
||||
dataIndex: 'xkrs'
|
||||
},
|
||||
{
|
||||
title: '开课单位',
|
||||
align: "center",
|
||||
dataIndex: 'kkdw_dictText'
|
||||
},
|
||||
{
|
||||
title: '课程性质',
|
||||
align: "center",
|
||||
dataIndex: 'kcxz_dictText'
|
||||
dataIndex: 'sksj'
|
||||
},
|
||||
{
|
||||
title: '节次',
|
||||
|
@ -49,6 +29,26 @@ export const columns: BasicColumn[] = [
|
|||
align: "center",
|
||||
dataIndex: 'week_dictText'
|
||||
},
|
||||
{
|
||||
title: '直播方式',
|
||||
align: "center",
|
||||
dataIndex: 'zbfs_dictText'
|
||||
},
|
||||
{
|
||||
title: '会议号',
|
||||
align: "center",
|
||||
dataIndex: 'hyh'
|
||||
},
|
||||
{
|
||||
title: '会议密码',
|
||||
align: "center",
|
||||
dataIndex: 'hymm'
|
||||
},
|
||||
{
|
||||
title: '课程链接',
|
||||
align: "center",
|
||||
dataIndex: 'kclj'
|
||||
},
|
||||
{
|
||||
title: '开课周次',
|
||||
align: "center",
|
||||
|
@ -58,29 +58,6 @@ export const columns: BasicColumn[] = [
|
|||
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
{
|
||||
label: "课程名称",
|
||||
field: 'kcmc',
|
||||
component: 'Input',
|
||||
colProps: {span: 6},
|
||||
},
|
||||
{
|
||||
label: "开课单位",
|
||||
field: 'kkdw',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
},
|
||||
colProps: {span: 6},
|
||||
},
|
||||
{
|
||||
label: "课程性质",
|
||||
field: 'kcxz',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: "kcxz"
|
||||
},
|
||||
colProps: {span: 6},
|
||||
},
|
||||
{
|
||||
label: "节次",
|
||||
field: 'hh',
|
||||
|
@ -103,17 +80,6 @@ export const searchFormSchema: FormSchema[] = [
|
|||
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '课程编号',
|
||||
field: 'kcbh',
|
||||
component: 'Input',
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入课程编号!'},
|
||||
{...rules.duplicateCheckRule('kc_ketangbiao', 'kcbh',model,schema)[0]},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '课程名称',
|
||||
field: 'kcmc',
|
||||
|
@ -124,16 +90,6 @@ export const formSchema: FormSchema[] = [
|
|||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '学分',
|
||||
field: 'xf',
|
||||
component: 'Input',
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入学分!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '授课教师',
|
||||
field: 'skjs',
|
||||
|
@ -145,40 +101,9 @@ export const formSchema: FormSchema[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
label: '选课人数',
|
||||
field: 'xkrs',
|
||||
label: '上课时间',
|
||||
field: 'sksj',
|
||||
component: 'Input',
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入选课人数!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '开课单位',
|
||||
field: 'kkdw',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: ""
|
||||
},
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入开课单位!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '课程性质',
|
||||
field: 'kcxz',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: "kcxz"
|
||||
},
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入课程性质!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '节次',
|
||||
|
|
|
@ -4,22 +4,7 @@
|
|||
<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.kcmc"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="8">
|
||||
<a-form-item label="开课单位">
|
||||
<a-input placeholder="请输入开课单位" v-model:value="queryParam.kkdw"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :lg="8">
|
||||
<a-form-item label="课程性质">
|
||||
<j-dict-select-tag placeholder="请选择课程性质" v-model:value="queryParam.kcxz" dictCode="kcxz"/>
|
||||
</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.hh" dictCode="skjc"/>
|
||||
</a-form-item>
|
||||
|
@ -28,18 +13,16 @@
|
|||
<a-form-item label="周几">
|
||||
<j-dict-select-tag placeholder="请选择周几" v-model:value="queryParam.week" dictCode="week"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<!-- <template v-if="toggleSearchStatus">
|
||||
</template> -->
|
||||
</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">
|
||||
<!-- <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>-->
|
||||
</a-col>
|
||||
</span>
|
||||
</a-col>
|
||||
|
@ -51,6 +34,8 @@
|
|||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" @click="handleEditPtxx" preIcon="ant-design:plus-outlined"> 修改平台信息</a-button>
|
||||
<a-button type="primary" @click="handleEditTeacher" 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">
|
||||
|
@ -67,6 +52,8 @@
|
|||
</a-button>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<!-- 不显示【未选中任何数据】栏 -->
|
||||
<template #tableTop><span></span></template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
|
@ -76,60 +63,43 @@
|
|||
<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>
|
||||
<KcKechengbiaoList />
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<KcKetangbiaoModal ref="registerModal" @success="handleSuccess"></KcKetangbiaoModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="ktgl-kcKetangbiao" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { ref, reactive, watch } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { columns } from './KcKetangbiao.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './KcKetangbiao.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import KcKetangbiaoModal from './components/KcKetangbiaoModal.vue'
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import KcKechengbiaoList from './KcKechengbiaoList.vue'
|
||||
|
||||
const queryParam = ref<any>({});
|
||||
const queryParam = ref<any>({kechengbiaoid: '-1'});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const { createMessage } = useMessage();
|
||||
const registerModal = ref();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: '课堂管理',
|
||||
title: '课堂管理-子表',
|
||||
api: list,
|
||||
columns,
|
||||
// showTableSetting: false,
|
||||
canResize:false,
|
||||
useSearchForm: false,
|
||||
// customRow: (record, index: number) => {
|
||||
// return {
|
||||
// // 点击行
|
||||
// onClick: (event) => {
|
||||
// console.log(record, index, event);
|
||||
// console.log(selectedRows,selectedRowKeys,);
|
||||
// console.log(ref([record]),ref([record.id]));
|
||||
// selectedRowKeys.value = ref([record]);
|
||||
// selectedRows.value = ref([record.id]);
|
||||
// // if (typeof rowSelection.onChange === 'function') {
|
||||
// // rowSelection.onChange(...args);
|
||||
// // }
|
||||
// },
|
||||
// };
|
||||
// },
|
||||
clickToRowSelect: true,
|
||||
pagination: {
|
||||
pageSize: 5
|
||||
},
|
||||
showActionColumn: false,
|
||||
rowSelection: {
|
||||
type: 'radio'
|
||||
},
|
||||
|
@ -137,27 +107,19 @@
|
|||
width: 120,
|
||||
fixed: 'right',
|
||||
},
|
||||
//to BasicTableProps
|
||||
// immediate: false,
|
||||
// pagination: false,
|
||||
// 发送请求之前调用的方法
|
||||
// function beforeFetch(params) {
|
||||
// // 默认以 createTime 降序排序
|
||||
// return Object.assign({ column: 'createTime', order: 'desc' }, params);
|
||||
// }
|
||||
beforeFetch: (params) => {
|
||||
// params.column = '',params.order = '';
|
||||
params.column = '',params.order = '';//新生成的默认不带排序
|
||||
return Object.assign(params, queryParam.value);
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "课堂管理",
|
||||
name: "课堂管理-子表",
|
||||
url: getExportUrl,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys, selectedRows }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
|
@ -169,19 +131,73 @@
|
|||
sm: { span: 16 },
|
||||
});
|
||||
|
||||
const props = defineProps({
|
||||
currentRowKey: Object,
|
||||
})
|
||||
|
||||
watch(() => props.currentRowKey, async (newRow, oldRow) => {
|
||||
// console.log('newRow =>',newRow);
|
||||
queryParam.value.kechengbiaoid = (newRow?.id)??'-1';
|
||||
if(queryParam.value.kechengbiaoid != '-1'){
|
||||
reload();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 新增事件
|
||||
*/
|
||||
function handleAdd() {
|
||||
registerModal.value.pFormData = {
|
||||
kechengbiaoid: queryParam.value.kechengbiaoid
|
||||
};
|
||||
console.log('queryParam.value.kechengbiaoid ->',queryParam.value.kechengbiaoid);
|
||||
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.type = 'all';
|
||||
registerModal.value.add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改平台信息
|
||||
*/
|
||||
function handleEditPtxx(){
|
||||
let record = selectedRows.value[0];
|
||||
|
||||
console.log(`🚀 ----------------------------------------------------------------------🚀`);
|
||||
console.log(`🚀 ~ file: KcKetangbiaoList.vue:161 ~ handleEditPtxx ~ record:`, selectedRows,record);
|
||||
console.log(`🚀 ----------------------------------------------------------------------🚀`);
|
||||
|
||||
if(!record){
|
||||
createMessage.error('请您至少选择一条记录进行操作。');
|
||||
return;
|
||||
}
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.type = 'pt';
|
||||
registerModal.value.edit(record);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改教师
|
||||
*/
|
||||
function handleEditTeacher(){
|
||||
let record = selectedRows.value[0];
|
||||
if(!record){
|
||||
createMessage.error('请您至少选择一条记录进行操作。');
|
||||
return;
|
||||
}
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.type = 'js';
|
||||
registerModal.value.edit(record);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑事件
|
||||
*/
|
||||
function handleEdit(record: Recordable) {
|
||||
registerModal.value.disableSubmit = false;
|
||||
registerModal.value.type = 'all';
|
||||
registerModal.value.edit(record);
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
课程 --> 课堂
|
|
@ -2,42 +2,68 @@
|
|||
<a-spin :spinning="confirmLoading">
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="课程编号" v-bind="validateInfos.kcbh">
|
||||
<a-input v-model:value="formData.kcbh" placeholder="请输入课程编号" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="课程名称" v-bind="validateInfos.kcmc">
|
||||
<a-input v-model:value="formData.kcmc" placeholder="请输入课程名称" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="学分" v-bind="validateInfos.xf">
|
||||
<a-input v-model:value="formData.xf" placeholder="请输入学分" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="授课教师" v-bind="validateInfos.skjs">
|
||||
<a-input v-model:value="formData.skjs" placeholder="请输入授课教师" :disabled="disabled"></a-input>
|
||||
<j-dict-select-tag v-model:value="formData.skjs" dictCode="" placeholder="请选择授课教师" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="授课时间" v-bind="validateInfos.sksj">
|
||||
<a-input v-model:value="formData.sksj" placeholder="请输入授课时间" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="节次" v-bind="validateInfos.hh">
|
||||
<a-input v-model:value="formData.hh" placeholder="请输入节次" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="星期几" v-bind="validateInfos.week">
|
||||
<a-input v-model:value="formData.week" placeholder="请输入星期几" :disabled="disabled"></a-input>
|
||||
<j-dict-select-tag v-model:value="formData.week" dictCode="week" placeholder="请选择星期几" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="节次" v-bind="validateInfos.hh">
|
||||
<j-dict-select-tag v-model:value="formData.hh" dictCode="skjc" placeholder="请选择节次" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="选课人数" v-bind="validateInfos.xkrs">
|
||||
<a-input v-model:value="formData.xkrs" placeholder="请输入选课人数" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="课程性质" v-bind="validateInfos.kcxz">
|
||||
<!-- <a-input v-model:value="formData.kcxz" placeholder="请输入课程性质" :disabled="disabled"></a-input> -->
|
||||
<j-dict-select-tag v-model:value="formData.kcxz" dictCode="kcxz" placeholder="请选择课程性质" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="直播方式" v-bind="validateInfos.zbfs">
|
||||
<a-input v-model:value="formData.zbfs" placeholder="请输入直播方式" :disabled="disabled"></a-input>
|
||||
<a-form-item label="上课周次" v-bind="validateInfos.jkzc">
|
||||
<j-checkbox type="checkbox" v-model:value="formData.jkzc" dictCode="skzc" placeholder="请选择上课周次" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="开课单位" v-bind="validateInfos.kkdw">
|
||||
<j-dict-select-tag v-model:value="formData.kkdw" dictCode="" placeholder="请选择开课单位" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="授课平台" v-bind="validateInfos.zbfs">
|
||||
<j-dict-select-tag v-model:value="formData.zbfs" dictCode="skpt" placeholder="请选择授课平台" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="会议号" v-bind="validateInfos.hyh">
|
||||
<a-input v-model:value="formData.hyh" placeholder="请输入会议号" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="会议密码" v-bind="validateInfos.hymm">
|
||||
<a-input v-model:value="formData.hymm" placeholder="请输入会议密码" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
|
@ -47,11 +73,22 @@
|
|||
<a-input v-model:value="formData.kclj" placeholder="请输入课程链接" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="直播平台" v-bind="validateInfos.zbpx">
|
||||
<a-input v-model:value="formData.zbpx" placeholder="请输入直播平台" :disabled="disabled"></a-input>
|
||||
<!--
|
||||
<a-col :span="12">
|
||||
<a-form-item label="上课地点" v-bind="validateInfos.skdd">
|
||||
<a-input v-model:value="formData.skdd" placeholder="请输入上课地点" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="是否出镜,0-出镜,1-不出镜" v-bind="validateInfos.sfcj">
|
||||
<a-input-number v-model:value="formData.sfcj" placeholder="请输入是否出镜,0-出镜,1-不出镜" style="width: 100%" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="上课形式,0-线上,1-线下,2-线上线下混合" v-bind="validateInfos.skxs">
|
||||
<a-input-number v-model:value="formData.skxs" placeholder="请输入上课形式,0-线上,1-线下,2-线上线下混合" style="width: 100%" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col> -->
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
|
@ -61,10 +98,13 @@
|
|||
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 JCheckbox from "/@/components/Form/src/jeecg/components/JCheckbox.vue";
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../KcKechengbiao.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
|
||||
import { duplicateValidate } from '/@/utils/helper/validator'
|
||||
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: ()=>{} },
|
||||
|
@ -75,23 +115,40 @@
|
|||
const emit = defineEmits(['register', 'ok']);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
kcbh: '',
|
||||
kcmc: '',
|
||||
skjs: '',
|
||||
sksj: '',
|
||||
xkrs: '',
|
||||
kkdw: '',
|
||||
kcxz: '',
|
||||
skdd: '',
|
||||
jkzc: '',
|
||||
hh: '',
|
||||
week: '',
|
||||
zbfs: '',
|
||||
hyh: '',
|
||||
hymm: '',
|
||||
kclj: '',
|
||||
zbpx: '',
|
||||
xf: '',
|
||||
sfcj: undefined,
|
||||
skxs: 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 labelCol = ref<any>({ style: { width: '150px' } });
|
||||
const wrapperCol = ref<any>({ style: { width: '100%' } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = {
|
||||
kcbh: [{ required: true, message: '请输入课程编号!'}, { validator: kcbhDuplicatevalidate }],
|
||||
kcmc: [{ required: true, message: '请输入课程名称!'},],
|
||||
skjs: [{ required: true, message: '请输入授课教师!'},],
|
||||
xkrs: [{ required: true, message: '请输入学科人数!'},],
|
||||
kkdw: [{ required: true, message: '请输入开课单位!'},],
|
||||
kcxz: [{ required: true, message: '请输入课程性质!'},],
|
||||
jkzc: [{ required: true, message: '请输入上课周次!'},],
|
||||
hh: [{ required: true, message: '请输入节次!'},],
|
||||
week: [{ required: true, message: '请输入星期几!'},],
|
||||
xf: [{ required: true, message: '请输入学分!'},],
|
||||
};
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||
|
||||
|
@ -107,7 +164,7 @@
|
|||
return props.formDisabled;
|
||||
});
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
|
@ -165,6 +222,9 @@
|
|||
}
|
||||
|
||||
|
||||
async function kcbhDuplicatevalidate(_r, value) {
|
||||
return duplicateValidate('kc_kechengbiao', 'kcbh', value, formData.id || '')
|
||||
}
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
|
|
|
@ -1,58 +1,10 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
-{{ formData }}-{{ props.pFormData }}-{{ formData.kcmc }}-
|
||||
<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.kcbh">
|
||||
<a-input v-model:value="formData.kcbh" placeholder="请输入课程编号" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="课程名称" v-bind="validateInfos.kcmc">
|
||||
<a-input v-model:value="formData.kcmc" placeholder="请输入课程名称" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="学分" v-bind="validateInfos.xf">
|
||||
<a-input v-model:value="formData.xf" placeholder="请输入学分" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="授课教师" v-bind="validateInfos.skjs">
|
||||
<a-input v-model:value="formData.skjs" placeholder="请输入授课教师" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="授课星期" v-bind="validateInfos.week">
|
||||
<j-dict-select-tag v-model:value="formData.week" dictCode="week" placeholder="请选择授课星期" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="授课节次" v-bind="validateInfos.hh">
|
||||
<j-dict-select-tag v-model:value="formData.hh" dictCode="skjc" placeholder="请选择授课节次" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="选课人数" v-bind="validateInfos.xkrs">
|
||||
<a-input v-model:value="formData.xkrs" placeholder="请输入选课人数" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="课程性质" v-bind="validateInfos.kcxz">
|
||||
<j-dict-select-tag v-model:value="formData.kcxz" dictCode="kcxz" placeholder="请选择课程性质" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="开课周次" v-bind="validateInfos.kkzc">
|
||||
<j-checkbox type="checkbox" v-model:value="formData.kkzc" dictCode="skzc" placeholder="请选择开课周次" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="开课单位" v-bind="validateInfos.kkdw">
|
||||
<j-dict-select-tag v-model:value="formData.kkdw" dictCode="" placeholder="请选择开课单位" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<template v-if="type == 'all' || type == 'pt'">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="授课平台" v-bind="validateInfos.zbfs">
|
||||
<j-dict-select-tag v-model:value="formData.zbfs" dictCode="skpt" placeholder="请选择授课平台" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
|
@ -67,18 +19,59 @@
|
|||
<a-input v-model:value="formData.hymm" placeholder="请输入会议密码" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="课程链接" v-bind="validateInfos.kclj">
|
||||
<a-input v-model:value="formData.kclj" placeholder="请输入课程链接" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
<template v-if="type == 'all' || type == 'js'">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="开课单位" v-bind="validateInfos.kkdw">
|
||||
<j-dict-select-tag v-model:value="formData.kkdw" dictCode="" placeholder="请选择开课单位" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="授课教师" v-bind="validateInfos.skjs">
|
||||
<a-input v-model:value="formData.skjs" placeholder="请输入授课教师" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
|
||||
<template v-if="type == 'all'">
|
||||
<a-col :span="12">
|
||||
<a-form-item label="课程名称" v-bind="validateInfos.kcmc">
|
||||
<a-input v-model:value="formData.kcmc" placeholder="请输入课程名称" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="上课时间" v-bind="validateInfos.sksj">
|
||||
<a-input v-model:value="formData.sksj" placeholder="请输入上课时间" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="节次" v-bind="validateInfos.hh">
|
||||
<j-dict-select-tag v-model:value="formData.hh" dictCode="skjc" placeholder="请选择节次" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="周几" v-bind="validateInfos.week">
|
||||
<j-dict-select-tag v-model:value="formData.week" dictCode="week" placeholder="请选择周几" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="开课周次" v-bind="validateInfos.kkzc">
|
||||
<j-checkbox type="checkbox" v-model:value="formData.kkzc" dictCode="skzc" placeholder="请选择开课周次" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</template>
|
||||
</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, watch } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
|
@ -86,25 +79,23 @@
|
|||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../KcKetangbiao.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
import { duplicateValidate } from '/@/utils/helper/validator'
|
||||
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: ()=>{} },
|
||||
formBpm: { type: Boolean, default: true }
|
||||
formBpm: { type: Boolean, default: true },
|
||||
type: { type: String },
|
||||
pFormData: { type: Object, default: ()=>{} },
|
||||
|
||||
});
|
||||
const formRef = ref();
|
||||
const useForm = Form.useForm;
|
||||
const emit = defineEmits(['register', 'ok']);
|
||||
const formData = reactive<Record<string, any>>({
|
||||
id: '',
|
||||
kcbh: '',
|
||||
kcmc: '',
|
||||
xf: '',
|
||||
skjs: '',
|
||||
xkrs: '',
|
||||
kkdw: '',
|
||||
kcxz: '',
|
||||
sksj: '',
|
||||
hh: '',
|
||||
week: '',
|
||||
zbfs: '',
|
||||
|
@ -112,20 +103,73 @@
|
|||
hymm: '',
|
||||
kclj: '',
|
||||
kkzc: '',
|
||||
|
||||
kkzc_dictText: '',
|
||||
kechengbiaoid: '',
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
sysOrgCode: null,
|
||||
kcbh: '',
|
||||
xf: null,
|
||||
zc: '',
|
||||
jzglb: null,
|
||||
xkrs: '',
|
||||
pkrs: null,
|
||||
rwbh: '',
|
||||
kkdw: '',
|
||||
kcxz: '',
|
||||
skdd: '',
|
||||
jkzc: '',
|
||||
hhks: '',
|
||||
hhjs: '',
|
||||
dsz: '',
|
||||
wwks: '',
|
||||
wwjs: '',
|
||||
hyid: null,
|
||||
beizhu: null,
|
||||
zbpx: '',
|
||||
kkdwid: null,
|
||||
skrq: '',
|
||||
tingkecishu: null,
|
||||
dijizhou: null,
|
||||
jkzc1: '',
|
||||
sftk: null,
|
||||
tkyy: null,
|
||||
bkjh: null,
|
||||
sfcj: null,
|
||||
skxs: null,
|
||||
kechengbiao1: null,
|
||||
sfxsk: '',
|
||||
jgh: null,
|
||||
bz: null,
|
||||
zt: null,
|
||||
kcxz_dictText: '',
|
||||
hh_dictText: '',
|
||||
week_dictText: '',
|
||||
zbfs_dictText: '',
|
||||
...props.pFormData
|
||||
});
|
||||
|
||||
watch(() => props.pFormData, async (pFormData) => {
|
||||
console.log('newRow =>',pFormData, formData,Object.keys(pFormData).length);
|
||||
if(Object.keys(pFormData).length){
|
||||
Object.keys(pFormData).forEach(key => formData[key] = pFormData[key]);
|
||||
console.log('formData =>',formData);
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const labelCol = ref<any>({ style: { width: '150px'} });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 24 } });
|
||||
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 = {
|
||||
kcbh: [{ required: true, message: '请输入课程编号!'}, { validator: kcbhDuplicatevalidate }],
|
||||
kcmc: [{ required: true, message: '请输入课程名称!'},],
|
||||
xf: [{ required: true, message: '请输入学分!'},],
|
||||
skjs: [{ required: true, message: '请输入授课教师!'},],
|
||||
xkrs: [{ required: true, message: '请输入选课人数!'},],
|
||||
kkdw: [{ required: true, message: '请输入开课单位!'},],
|
||||
kcxz: [{ required: true, message: '请输入课程性质!'},],
|
||||
hh: [{ required: true, message: '请输入节次!'},],
|
||||
week: [{ required: true, message: '请输入周几!'},],
|
||||
kkzc: [{ required: true, message: '请输入开课周次!'},],
|
||||
|
@ -202,9 +246,6 @@
|
|||
}
|
||||
|
||||
|
||||
async function kcbhDuplicatevalidate(_r, value) {
|
||||
return duplicateValidate('kc_ketangbiao', 'kcbh', value, formData.id || '')
|
||||
}
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
|
|
|
@ -1,17 +1,19 @@
|
|||
<template>
|
||||
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<KcKetangbiaoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></KcKetangbiaoForm>
|
||||
<KcKetangbiaoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false" :type="type" :pFormData="pFormData"></KcKetangbiaoForm>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import KcKetangbiaoForm from './KcKetangbiaoForm.vue'
|
||||
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<number>(800);
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const type = ref<string>('all');
|
||||
const pFormData = ref<Object>({});
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
|
@ -25,7 +27,7 @@
|
|||
registerForm.value.add();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
|
@ -37,7 +39,7 @@
|
|||
registerForm.value.edit(record);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
|
@ -63,7 +65,9 @@
|
|||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
type,
|
||||
disableSubmit,
|
||||
pFormData,
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -127,7 +127,7 @@
|
|||
line-height: 120px;
|
||||
background: #FFF
|
||||
}
|
||||
}s
|
||||
}
|
||||
/**暗黑模式特殊配色*/
|
||||
[data-theme='dark'] #siteMain {
|
||||
.ant-layout-header, .ant-layout-footer {
|
||||
|
|
Loading…
Reference in New Issue