修改bug

This commit is contained in:
yangjun 2023-08-11 08:10:12 +08:00
parent 505b486089
commit 39d2ade4b4
4 changed files with 259 additions and 109 deletions

View File

@ -0,0 +1,228 @@
<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.flag7">
<JDictSelectTag type="radio" v-model:value="formData.flag7" dictCode="yn" placeholder="请选择" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="是否开启任教课程" v-bind="validateInfos.flag2">
<JDictSelectTag type="radio" v-model:value="formData.flag2" dictCode="yn" placeholder="请选择" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="是否开启预约课程" v-bind="validateInfos.flag3">
<JDictSelectTag type="radio" v-model:value="formData.flag3" dictCode="yn" placeholder="请选择" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="是否开启公开课" v-bind="validateInfos.flag4">
<JDictSelectTag type="radio" v-model:value="formData.flag4" dictCode="yn" placeholder="请选择" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="是否开启线上听课" v-bind="validateInfos.flag5">
<JDictSelectTag type="radio" v-model:value="formData.flag5" dictCode="yn" placeholder="请选择" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="是否开启今日课程" v-bind="validateInfos.flag6">
<JDictSelectTag type="radio" v-model:value="formData.flag6" dictCode="yn" placeholder="请选择" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="线上课堂-说明文字" v-bind="validateInfos.xsktTitle">
<a-input v-model:value="formData.xsktTitle" placeholder="请输入线上课堂-说明文字" ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="今日课堂-说明文字" v-bind="validateInfos.jrktTitle">
<a-input v-model:value="formData.jrktTitle" placeholder="请输入今日课堂-说明文字" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24" style="text-align: center;">
<a-button type="primary" @click="submitForm">保存</a-button>
<a-button type="primary" @click="ketangFun" style="margin-left: 10px;">生成本学期课堂数据</a-button>
</a-col>
</a-row>
</a-form>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../KcSysConfig.api';
import { Form } from 'ant-design-vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import { getSysConfig } from '/@/views/site/utils/index';
const queryParam = ref<any>({});
const tencentHtml = ref<any>("");
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 txhy = reactive<Record<string, any>>({
startTime:'',
endTime:'',
});
const formData = reactive<Record<string, any>>({
id: '',
flag2: '',
flag3: '',
flag4: '',
flag5: '',
flag6: '',
flag7: '',
xsktTitle:'',
jrktTitle:'',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 8 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 13 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
//
const disabled = computed(()=>{
if(props.formBpm === true){
if(props.formData.disabled === false){
return false;
}else{
return true;
}
}
return props.formDisabled;
});
const list = (queryParam) => defHttp.get({ url: '/kcSysConfig/kcSysConfig/queryById', params:queryParam });
const listKcxx = (queryParam) => defHttp.get({ url: '/kcSysConfig/kcSysConfig/listKcxx', params:queryParam });
//
onMounted(() => {
queryParam.value.id = '1';
// console.log(`🚀 ~ file: KcSysConfigMain.vue:106 ~ onMounted ~ sysInfo:`,getSysConfig().bxqkssj)
// loadData()`
edit(getSysConfig())
});
function loadData(){
list(queryParam.value).then(res=>{
edit(res)
})
}
/**
* 新增
*/
function add() {
edit({});
}
function ketangFun(){
let startTime = new Date(getSysConfig().bxqkssj);
let nowDate = new Date();
if(nowDate.getTime()<startTime.getTime()){
listKcxx(null).then(res=>{
createMessage.success(res);
})
}else{
createMessage.error("本学期已经开始,不能重复生成课程数据");
}
}
/**
* 编辑
*/
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;
});
}
/**
* 开始执行生产腾讯会议
*/
function txhyKszx(){
tencentHtml.value = '生成腾讯会议中。。。'
// console.log(txhy);
const url = '/tencentUtil/addTencent';
const params = txhy
defHttp.post({ url: url, params, timeout: 999999 }, { isTransformResponse: false }).then(res => {
console.log(`🚀 ~ file: KcSysConfigMain.vue:202 ~ defHttp.post ~ res:`, res)
tencentHtml.value = res.message;
});
}
defineExpose({
add,
edit,
submitForm,
});
</script>
<style lang="less" scoped>
.antd-modal-form {
min-height: auto !important;
overflow-y: auto;
padding: 24px 24px 24px 24px;
}
</style>

View File

@ -1,90 +1,36 @@
<template>
<a-spin :spinning="confirmLoading">
<div class="jeecg-basic-table-form-container">
<div class="divTitle">
当前学期
</div>
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24">
<a-col :span="6">
<a-form-item label="本学期名称" v-bind="validateInfos.flag1">
<a-input v-model:value="formData.flag1" placeholder="请输入本学期名称" ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="本学期课程开始时间" v-bind="validateInfos.bxqkssj">
<a-col :span="6">
<a-form-item label="开始时间" v-bind="validateInfos.bxqkssj">
<a-input v-model:value="formData.bxqkssj" placeholder="请输入本学期课程开始时间" ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="本学期课程结束时间" v-bind="validateInfos.bxqjssj">
<a-col :span="6">
<a-form-item label="程结束时间" v-bind="validateInfos.bxqjssj">
<a-input v-model:value="formData.bxqjssj" placeholder="请输入本学期课程结束时间" ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="是否开启听课足迹" v-bind="validateInfos.flag7">
<JDictSelectTag type="radio" v-model:value="formData.flag7" dictCode="yn" placeholder="请选择" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="是否开启任教课程" v-bind="validateInfos.flag2">
<JDictSelectTag type="radio" v-model:value="formData.flag2" dictCode="yn" placeholder="请选择" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="是否开启预约课程" v-bind="validateInfos.flag3">
<JDictSelectTag type="radio" v-model:value="formData.flag3" dictCode="yn" placeholder="请选择" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="是否开启公开课" v-bind="validateInfos.flag4">
<JDictSelectTag type="radio" v-model:value="formData.flag4" dictCode="yn" placeholder="请选择" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="是否开启线上听课" v-bind="validateInfos.flag5">
<JDictSelectTag type="radio" v-model:value="formData.flag5" dictCode="yn" placeholder="请选择" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="是否开启今日课程" v-bind="validateInfos.flag6">
<JDictSelectTag type="radio" v-model:value="formData.flag6" dictCode="yn" placeholder="请选择" />
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="线上课堂-说明文字" v-bind="validateInfos.xsktTitle">
<a-input v-model:value="formData.xsktTitle" placeholder="请输入线上课堂-说明文字" ></a-input>
</a-form-item>
</a-col>
<a-col :span="12">
<a-form-item label="今日课堂-说明文字" v-bind="validateInfos.jrktTitle">
<a-input v-model:value="formData.jrktTitle" placeholder="请输入今日课堂-说明文字" ></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="" style="text-align: center;">
<a-col :span="6">
<a-button type="primary" @click="submitForm">保存</a-button>
</a-form-item>
</a-col>
</a-row>
</a-form>
<!-- <a-form ref="formRef2" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" hidden>
<a-row>
<a-col :span="8">
<a-form-item label="开始时间" v-bind="validateInfos.flag3">
<a-date-picker placeholder="请选择日期" format="YYYY-MM-DD" valueFormat="YYYY-MM-DD" v-model:value="txhy.startTime" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-form-item label="开始时间" v-bind="validateInfos.flag3">
<a-date-picker placeholder="请选择日期" format="YYYY-MM-DD" valueFormat="YYYY-MM-DD" v-model:value="txhy.endTime" style="width: 100%" />
</a-form-item>
</a-col>
<a-col :span="8">
<a-button type="primary" @click="txhyKszx" disabled>开始执行</a-button>
</a-col>
<a-col :span="24">
<div v-html="tencentHtml"></div>
</a-col>
</a-row>
</a-form> -->
</div>
<KcXqxnHistoryList ref="KcXqxnHistoryListModel" ></KcXqxnHistoryList>
</a-spin>
</template>
@ -96,9 +42,12 @@
import { saveOrUpdate } from '../KcSysConfig.api';
import { Form } from 'ant-design-vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import KcXqxnHistoryList from '/@/views/kc/kcXqxnHistory/KcXqxnHistoryList.vue';
import { getSysConfig } from '/@/views/site/utils/index';
const KcXqxnHistoryListModel = ref();
const queryParam = ref<any>({});
const tencentHtml = ref<any>("");
@ -219,6 +168,7 @@ const queryParam = ref<any>({});
})
.finally(() => {
confirmLoading.value = false;
KcXqxnHistoryListModel.value.searchQuery()
});
}
@ -250,4 +200,9 @@ const queryParam = ref<any>({});
overflow-y: auto;
padding: 24px 24px 24px 24px;
}
.divTitle{
background: #fff;
padding: 10px 0 0 10px;
font-size: 16px;
}
</style>

View File

@ -1,50 +1,12 @@
<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="学期学年">
<j-input placeholder="请输入学期学年" v-model:value="queryParam.title"></j-input>
</a-form-item>
</a-col>
<!-- <a-col :lg="8">
<a-form-item label="开始时间">
<a-date-picker value-format="YYYY-MM-DD" placeholder="请选择开始时间" v-model:value="queryParam.startTime_begin" class="query-group-cust"/>
<span class="query-group-split-cust">~</span>
<a-date-picker value-format="YYYY-MM-DD" placeholder="请选择结束日期" v-model:value="queryParam.startTime_end" class="query-group-cust"/>
</a-form-item>
</a-col> -->
<!--<template v-if="toggleSearchStatus">-->
<!-- <a-col :lg="8">
<a-form-item label="结束时间">
<a-date-picker value-format="YYYY-MM-DD" placeholder="请选择开始时间" v-model:value="queryParam.endTime_begin" class="query-group-cust"/>
<span class="query-group-split-cust">~</span>
<a-date-picker value-format="YYYY-MM-DD" placeholder="请选择结束日期" v-model:value="queryParam.endTime_end" class="query-group-cust"/>
</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" >
<!--插槽:table标题-->
<template #tableTitle>
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
历史学期
<!-- <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button> -->
</template>
<!--操作栏-->
<template #action="{ record }">
@ -69,7 +31,7 @@
</template>
<script lang="ts" name="kcXqxnHistory-kcXqxnHistory" setup>
import { ref, reactive } from 'vue';
import { ref, reactive, defineExpose } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './KcXqxnHistory.data';
@ -203,6 +165,9 @@
reload();
}
defineExpose({
searchQuery,
});

View File

@ -101,7 +101,9 @@
</span>
</template>
</a-table-column>
<a-table-column width="200px" title="课程性质" data-index="kcxz"/>
<a-table-column width="200px" title="开课单位" data-index="kkdw"/>
<a-table-column width="200px" title="思政课程" data-index="szkc"/>
<a-table-column width="100px" title="授课教师" data-index="skjs"/>
<a-table-column width="110px" title="授课教师工号" data-index="skjgh"/>
<a-table-column width="110px" title="授课日期" data-index="skrq"/>