添加功能
This commit is contained in:
parent
b3ff97dbe9
commit
ff0ab13d12
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/kcErrorreport/kcErrorreport/list',
|
||||
save='/kcErrorreport/kcErrorreport/add',
|
||||
edit='/kcErrorreport/kcErrorreport/edit',
|
||||
deleteOne = '/kcErrorreport/kcErrorreport/delete',
|
||||
deleteBatch = '/kcErrorreport/kcErrorreport/deleteBatch',
|
||||
importExcel = '/kcErrorreport/kcErrorreport/importExcel',
|
||||
exportXls = '/kcErrorreport/kcErrorreport/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 });
|
||||
}
|
|
@ -0,0 +1,123 @@
|
|||
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: 'subper'
|
||||
},
|
||||
{
|
||||
title: '错误类型',
|
||||
align: "center",
|
||||
dataIndex: 'optionsradios_dictText'
|
||||
},
|
||||
{
|
||||
title: '会议号',
|
||||
align: "center",
|
||||
dataIndex: 'meetingnum'
|
||||
},
|
||||
{
|
||||
title: '会议密码',
|
||||
align: "center",
|
||||
dataIndex: 'meetingpsw'
|
||||
},
|
||||
{
|
||||
title: '会议邀请链接',
|
||||
align: "center",
|
||||
dataIndex: 'meetinglink'
|
||||
},
|
||||
{
|
||||
title: '修改类型:0-本堂课修改,1-',
|
||||
align: "center",
|
||||
dataIndex: 'edittype_dictText'
|
||||
},
|
||||
{
|
||||
title: '是否修改:0-未修改,1-已修改',
|
||||
align: "center",
|
||||
dataIndex: 'ismodified'
|
||||
},
|
||||
{
|
||||
title: '课程的上课日期',
|
||||
align: "center",
|
||||
dataIndex: 'skrq'
|
||||
},
|
||||
{
|
||||
title: '是否出镜,0-出镜,1-不出镜',
|
||||
align: "center",
|
||||
dataIndex: 'sfcj'
|
||||
},
|
||||
];
|
||||
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
];
|
||||
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '错误类型',
|
||||
field: 'optionsradios',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: "optionsradios"
|
||||
},
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入错误类型!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '会议号',
|
||||
field: 'meetingnum',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '会议密码',
|
||||
field: 'meetingpsw',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '会议邀请链接',
|
||||
field: 'meetinglink',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '修改类型:0-本堂课修改,1-',
|
||||
field: 'edittype',
|
||||
component: 'JDictSelectTag',
|
||||
componentProps:{
|
||||
dictCode: "edittype"
|
||||
},
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入修改类型:0-本堂课修改,1-!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '是否修改:0-未修改,1-已修改',
|
||||
field: 'ismodified',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
{
|
||||
label: '课程的上课日期',
|
||||
field: 'skrq',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '是否出镜,0-出镜,1-不出镜',
|
||||
field: 'sfcj',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
];
|
|
@ -0,0 +1,215 @@
|
|||
<template>
|
||||
<div>
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template #htmlSlot="{text}">
|
||||
<div v-html="text"></div>
|
||||
</template>
|
||||
<!--省市区字段回显插槽-->
|
||||
<!--<template #pcaSlot="{text}">
|
||||
{{ getAreaTextByCode(text) }}
|
||||
</template>-->
|
||||
<template #fileSlot="{text}">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<KcErrorreportModal ref="registerModal" @success="handleSuccess"></KcErrorreportModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="kcErrorreport-kcErrorreport" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns } from './KcErrorreport.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './KcErrorreport.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import KcErrorreportModal from './components/KcErrorreportModal.vue'
|
||||
|
||||
const queryParam = ref<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: 'kc_errorreport',
|
||||
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: "kc_errorreport",
|
||||
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>
|
|
@ -0,0 +1,172 @@
|
|||
<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.optionsradios">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.optionsradios" dictCode="optionsradios" placeholder="请选择错误类型" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="会议号" v-bind="validateInfos.meetingnum">
|
||||
<a-input v-model:value="formData.meetingnum" placeholder="请输入会议号" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="会议密码" v-bind="validateInfos.meetingpsw">
|
||||
<a-input v-model:value="formData.meetingpsw" placeholder="请输入会议密码" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="会议邀请链接" v-bind="validateInfos.meetinglink">
|
||||
<a-input v-model:value="formData.meetinglink" placeholder="请输入会议邀请链接" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="修改类型:0-本堂课修改,1-" v-bind="validateInfos.edittype">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.edittype" dictCode="edittype" placeholder="请选择修改类型:0-本堂课修改,1-" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="是否修改:0-未修改,1-已修改" v-bind="validateInfos.ismodified">
|
||||
<a-input-number v-model:value="formData.ismodified" placeholder="请输入是否修改:0-未修改,1-已修改" style="width: 100%" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="课程的上课日期" v-bind="validateInfos.skrq">
|
||||
<a-input v-model:value="formData.skrq" placeholder="请输入课程的上课日期" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<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-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 '../KcErrorreport.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: '',
|
||||
optionsradios: '',
|
||||
meetingnum: '',
|
||||
meetingpsw: '',
|
||||
meetinglink: '',
|
||||
edittype: undefined,
|
||||
ismodified: undefined,
|
||||
skrq: '',
|
||||
sfcj: 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 confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = {
|
||||
optionsradios: [{ required: true, message: '请输入错误类型!'},],
|
||||
edittype: [{ required: true, message: '请输入修改类型:0-本堂课修改,1-!'},],
|
||||
};
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
//赋值
|
||||
Object.assign(formData, record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
async function submitForm() {
|
||||
// 触发表单验证
|
||||
await validate();
|
||||
confirmLoading.value = true;
|
||||
const isUpdate = ref<boolean>(false);
|
||||
//时间格式化
|
||||
let model = formData;
|
||||
if (model.id) {
|
||||
isUpdate.value = true;
|
||||
}
|
||||
//循环数据
|
||||
for (let data in model) {
|
||||
//如果该数据是数组并且是字符串类型
|
||||
if (model[data] instanceof Array) {
|
||||
let valueType = getValueType(formRef.value.getProps, data);
|
||||
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||
if (valueType === 'string') {
|
||||
model[data] = model[data].join(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
await saveOrUpdate(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success(res.message);
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
min-height: 500px !important;
|
||||
overflow-y: auto;
|
||||
padding: 24px 24px 24px 24px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,167 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" style="font-weight: 600;">
|
||||
<a-row>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="错误类型" v-bind="validateInfos.optionsradios">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.optionsradios" dictCode="optionsradios" placeholder="请选择错误类型" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="修改类型" v-bind="validateInfos.edittype">
|
||||
<j-dict-select-tag type='radio' v-model:value="formData.edittype" dictCode="edittype" placeholder="请选择修改类型" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<div style="color:red;margin-left: 90px;margin-bottom: 30px;">如果您知道正确的信息请在下方填写</div>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="会议号" v-bind="validateInfos.meetingnum">
|
||||
<a-input v-model:value="formData.meetingnum" placeholder="请输入会议号" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="会议密码" v-bind="validateInfos.meetingpsw">
|
||||
<a-input v-model:value="formData.meetingpsw" placeholder="请输入会议密码" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="会议邀请链接" v-bind="validateInfos.meetinglink">
|
||||
<a-input v-model:value="formData.meetinglink" placeholder="请输入会议邀请链接" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
|
||||
import { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../KcErrorreport.api';
|
||||
import { Form } from 'ant-design-vue';
|
||||
|
||||
//用户相关
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
const userStore = useUserStore();
|
||||
|
||||
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: '',
|
||||
optionsradios: '',
|
||||
meetingnum: '',
|
||||
meetingpsw: '',
|
||||
meetinglink: '',
|
||||
edittype: undefined,
|
||||
ismodified: undefined,
|
||||
skrq: '',
|
||||
sfcj: 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 confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = {
|
||||
optionsradios: [{ required: true, message: '请输入错误类型!'},],
|
||||
edittype: [{ required: true, message: '请输入修改类型!'},],
|
||||
};
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add(record) {
|
||||
console.log(`🚀 ~ file: KcErrorreportIndexForm.vue:106 ~ add ~ record:`, record)
|
||||
var param = {kechengbiaoid:record.id}
|
||||
edit(param);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
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(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
model.subper = userStore?.getUserInfo?.realname
|
||||
await saveOrUpdate(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success(res.message);
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
min-height: 500px !important;
|
||||
overflow-y: auto;
|
||||
padding: 24px 24px 24px 24px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,78 @@
|
|||
<template>
|
||||
<a-modal :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<template #title>
|
||||
<div style="text-align: center;font-size: 22px;">{{title}}</div>
|
||||
</template>
|
||||
<KcErrorreportForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></KcErrorreportForm>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import KcErrorreportForm from './KcErrorreportIndexForm.vue'
|
||||
|
||||
const title = ref<string>('');
|
||||
const width = ref<number>(800);
|
||||
const visible = ref<boolean>(false);
|
||||
const disableSubmit = ref<boolean>(false);
|
||||
const registerForm = ref();
|
||||
const emit = defineEmits(['register', 'success']);
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add(record) {
|
||||
title.value = '错误报告提交';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.add(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param record
|
||||
*/
|
||||
function edit(record) {
|
||||
title.value = disableSubmit.value ? '详情' : '编辑';
|
||||
visible.value = true;
|
||||
nextTick(() => {
|
||||
registerForm.value.edit(record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 确定按钮点击事件
|
||||
*/
|
||||
function handleOk() {
|
||||
registerForm.value.submitForm();
|
||||
}
|
||||
|
||||
/**
|
||||
* form保存回调事件
|
||||
*/
|
||||
function submitCallback() {
|
||||
handleCancel();
|
||||
emit('success');
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消按钮回调事件
|
||||
*/
|
||||
function handleCancel() {
|
||||
visible.value = false;
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
disableSubmit,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
/**隐藏样式-modal确定按钮 */
|
||||
.jee-hidden {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,75 @@
|
|||
<template>
|
||||
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<KcErrorreportForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></KcErrorreportForm>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import KcErrorreportForm from './KcErrorreportForm.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>
|
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/kcYuyue/kcYuyue/list',
|
||||
save='/kcYuyue/kcYuyue/add',
|
||||
edit='/kcYuyue/kcYuyue/edit',
|
||||
deleteOne = '/kcYuyue/kcYuyue/delete',
|
||||
deleteBatch = '/kcYuyue/kcYuyue/deleteBatch',
|
||||
importExcel = '/kcYuyue/kcYuyue/importExcel',
|
||||
exportXls = '/kcYuyue/kcYuyue/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 });
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
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: '课堂表id',
|
||||
align: "center",
|
||||
dataIndex: 'ketangbiaoid'
|
||||
},
|
||||
{
|
||||
title: '账号',
|
||||
align: "center",
|
||||
dataIndex: 'userid'
|
||||
},
|
||||
{
|
||||
title: '用户名',
|
||||
align: "center",
|
||||
dataIndex: 'username'
|
||||
},
|
||||
{
|
||||
title: '授课日期',
|
||||
align: "center",
|
||||
dataIndex: 'skrq'
|
||||
},
|
||||
{
|
||||
title: '节次',
|
||||
align: "center",
|
||||
dataIndex: 'hh'
|
||||
},
|
||||
{
|
||||
title: '直播平台',
|
||||
align: "center",
|
||||
dataIndex: 'zbpx'
|
||||
},
|
||||
{
|
||||
title: '链接',
|
||||
align: "center",
|
||||
dataIndex: 'link'
|
||||
},
|
||||
{
|
||||
title: '是否删除',
|
||||
align: "center",
|
||||
dataIndex: 'isdeleted'
|
||||
},
|
||||
];
|
||||
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
];
|
||||
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '课堂表id',
|
||||
field: 'ketangbiaoid',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
{
|
||||
label: '账号',
|
||||
field: 'userid',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
{
|
||||
label: '用户名',
|
||||
field: 'username',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '授课日期',
|
||||
field: 'skrq',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '节次',
|
||||
field: 'hh',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '直播平台',
|
||||
field: 'zbpx',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '链接',
|
||||
field: 'link',
|
||||
component: 'Input',
|
||||
},
|
||||
{
|
||||
label: '是否删除',
|
||||
field: 'isdeleted',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
// TODO 主键隐藏字段,目前写死为ID
|
||||
{
|
||||
label: '',
|
||||
field: 'id',
|
||||
component: 'Input',
|
||||
show: false,
|
||||
},
|
||||
];
|
|
@ -0,0 +1,215 @@
|
|||
<template>
|
||||
<div>
|
||||
<!--查询区域-->
|
||||
<div class="jeecg-basic-table-form-container">
|
||||
<a-form @keyup.enter.native="searchQuery" :model="queryParam" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-row :gutter="24">
|
||||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||
<j-upload-button type="primary" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<template #overlay>
|
||||
<a-menu>
|
||||
<a-menu-item key="1" @click="batchHandleDelete">
|
||||
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||
删除
|
||||
</a-menu-item>
|
||||
</a-menu>
|
||||
</template>
|
||||
<a-button>批量操作
|
||||
<Icon icon="mdi:chevron-down"></Icon>
|
||||
</a-button>
|
||||
</a-dropdown>
|
||||
</template>
|
||||
<!--操作栏-->
|
||||
<template #action="{ record }">
|
||||
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||
</template>
|
||||
<!--字段回显插槽-->
|
||||
<template #htmlSlot="{text}">
|
||||
<div v-html="text"></div>
|
||||
</template>
|
||||
<!--省市区字段回显插槽-->
|
||||
<!--<template #pcaSlot="{text}">
|
||||
{{ getAreaTextByCode(text) }}
|
||||
</template>-->
|
||||
<template #fileSlot="{text}">
|
||||
<span v-if="!text" style="font-size: 12px;font-style: italic;">无文件</span>
|
||||
<a-button v-else :ghost="true" type="primary" preIcon="ant-design:download-outlined" size="small" @click="downloadFile(text)">下载</a-button>
|
||||
</template>
|
||||
</BasicTable>
|
||||
<!-- 表单区域 -->
|
||||
<KcYuyueModal ref="registerModal" @success="handleSuccess"></KcYuyueModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="kcYuyue-kcYuyue" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns } from './KcYuyue.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './KcYuyue.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import KcYuyueModal from './components/KcYuyueModal.vue'
|
||||
|
||||
const queryParam = ref<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: 'kc_yuyue',
|
||||
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: "kc_yuyue",
|
||||
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>
|
|
@ -0,0 +1,169 @@
|
|||
<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="课堂表id" v-bind="validateInfos.ketangbiaoid">
|
||||
<a-input-number v-model:value="formData.ketangbiaoid" placeholder="请输入课堂表id" style="width: 100%" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="账号" v-bind="validateInfos.userid">
|
||||
<a-input-number v-model:value="formData.userid" placeholder="请输入账号" style="width: 100%" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="用户名" v-bind="validateInfos.username">
|
||||
<a-input v-model:value="formData.username" placeholder="请输入用户名" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="授课日期" v-bind="validateInfos.skrq">
|
||||
<a-input v-model:value="formData.skrq" 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-form-item label="直播平台" v-bind="validateInfos.zbpx">
|
||||
<a-input v-model:value="formData.zbpx" placeholder="请输入直播平台" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="链接" v-bind="validateInfos.link">
|
||||
<a-input v-model:value="formData.link" placeholder="请输入链接" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="是否删除" v-bind="validateInfos.isdeleted">
|
||||
<a-input-number v-model:value="formData.isdeleted" placeholder="请输入是否删除" 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 { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../KcYuyue.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: '',
|
||||
ketangbiaoid: undefined,
|
||||
userid: undefined,
|
||||
username: '',
|
||||
skrq: '',
|
||||
hh: '',
|
||||
zbpx: '',
|
||||
link: '',
|
||||
isdeleted: 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 confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = {
|
||||
};
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||
|
||||
// 表单禁用
|
||||
const disabled = computed(()=>{
|
||||
if(props.formBpm === true){
|
||||
if(props.formData.disabled === false){
|
||||
return false;
|
||||
}else{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return props.formDisabled;
|
||||
});
|
||||
|
||||
|
||||
/**
|
||||
* 新增
|
||||
*/
|
||||
function add() {
|
||||
edit({});
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*/
|
||||
function edit(record) {
|
||||
nextTick(() => {
|
||||
resetFields();
|
||||
//赋值
|
||||
Object.assign(formData, record);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
*/
|
||||
async function submitForm() {
|
||||
// 触发表单验证
|
||||
await validate();
|
||||
confirmLoading.value = true;
|
||||
const isUpdate = ref<boolean>(false);
|
||||
//时间格式化
|
||||
let model = formData;
|
||||
if (model.id) {
|
||||
isUpdate.value = true;
|
||||
}
|
||||
//循环数据
|
||||
for (let data in model) {
|
||||
//如果该数据是数组并且是字符串类型
|
||||
if (model[data] instanceof Array) {
|
||||
let valueType = getValueType(formRef.value.getProps, data);
|
||||
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||
if (valueType === 'string') {
|
||||
model[data] = model[data].join(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
await saveOrUpdate(model, isUpdate.value)
|
||||
.then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success(res.message);
|
||||
emit('ok');
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
defineExpose({
|
||||
add,
|
||||
edit,
|
||||
submitForm,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.antd-modal-form {
|
||||
min-height: 500px !important;
|
||||
overflow-y: auto;
|
||||
padding: 24px 24px 24px 24px;
|
||||
}
|
||||
</style>
|
|
@ -0,0 +1,75 @@
|
|||
<template>
|
||||
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
|
||||
<KcYuyueForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></KcYuyueForm>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import KcYuyueForm from './KcYuyueForm.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>
|
|
@ -15,7 +15,7 @@
|
|||
<a-row>
|
||||
<a-col :span="16">
|
||||
<div style="height: 30px;font-size: 16px;">{{ item.skjs }}</div>
|
||||
<div style="height: 30px;font-size: 14px;">{{ item.kcxz }}</div>
|
||||
<div style="height: 30px;font-size: 14px;">{{ item.kkdw }}</div>
|
||||
</a-col>
|
||||
<a-col :span="8" style="text-align: center;height: 70px;">
|
||||
<div style="color: #1c84c6;font-size: 24px;font-weight: 600;">{{ item.xkrs }}</div>
|
||||
|
@ -35,41 +35,109 @@
|
|||
<div style="height: 60px;">
|
||||
{{ item.skdd }}
|
||||
</div>
|
||||
</a-col>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-button type="primary" style="background-color: #1c84c6;float: left;font-weight: 600;">预约</a-button>
|
||||
<a-button type="primary" style="background-color: #1c84c6;float: right;font-weight: 600;">报错</a-button>
|
||||
|
||||
<a-button type="primary" class="yyyClass" disabled v-if="item.sfyy==1">已预约</a-button>
|
||||
<a-button type="primary" class="yyClass" @click="funYuyue(item)" v-if="item.sfyy==0">预约</a-button>
|
||||
<a-button type="primary" class="bcClass" @click="handleBaocuo(item)">报错</a-button>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</div>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<!-- 报错列表 -->
|
||||
<KcErrorreportIndexModal ref="kcErrorreportIndexModal"></KcErrorreportIndexModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref,watch,reactive } from 'vue';
|
||||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import KcErrorreportIndexModal from '/@/views/kc/kcErrorreport/components/KcErrorreportIndexModal.vue'
|
||||
|
||||
//用户相关
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
const userStore = useUserStore();
|
||||
const kcErrorreportIndexModal = ref();
|
||||
|
||||
|
||||
const emit = defineEmits(['setTotal']);
|
||||
|
||||
const { createMessage } = useMessage();
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
let listData = ref<any>([]);
|
||||
const list = (params) => defHttp.get({ url: '/ktgl/kcKetangbiao/list', params });
|
||||
const list = (params) => defHttp.get({ url: '/ktgl/kcKetangbiao/getKclblist', params });
|
||||
const props = defineProps({
|
||||
queryParam:{type:Object}
|
||||
});
|
||||
|
||||
//监听条件变化
|
||||
watch(() => props.queryParam, async (newRow, oldRow) => {
|
||||
rkbLoadData(newRow)
|
||||
},{ deep: true });
|
||||
|
||||
//查询数据
|
||||
function rkbLoadData(newRow) {
|
||||
console.log(`🚀 ~ file: kclbList.vue:62 ~ rkbLoadData ~ newRow2:`, newRow)
|
||||
|
||||
newRow.pageSize = '8'
|
||||
list(newRow).then(res => {
|
||||
console.log(`🚀 ~ file: kclbList.vue:71 ~ list ~ res:`, res)
|
||||
console.log(`🚀 ~ file: kclbList.vue:76 ~ list ~ res:`, res)
|
||||
listData.value = res.records;
|
||||
emit('setTotal', res.total);
|
||||
})
|
||||
}
|
||||
//预约事件
|
||||
async function funYuyue(record){
|
||||
var params = {ketangbiaoid:record.id,userid:userStore?.getUserInfo?.username,username:userStore?.getUserInfo?.realname,skrq:record.skrq,hh:record.hh,zbpx:record.zbpx,link:'',isdeleted:0};
|
||||
const isUpdate = ref<boolean>(false);
|
||||
await saveOrUpdate(params, isUpdate.value).then((res) => {
|
||||
if (res.success) {
|
||||
createMessage.success("预约成功");
|
||||
//加载数据
|
||||
} else {
|
||||
createMessage.warning(res.message);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 报错事件
|
||||
*/
|
||||
function handleBaocuo(item) {
|
||||
kcErrorreportIndexModal.value.disableSubmit = false;
|
||||
kcErrorreportIndexModal.value.add(item);
|
||||
}
|
||||
|
||||
enum Api {
|
||||
list = '/kcYuyue/kcYuyue/list',
|
||||
save='/kcYuyue/kcYuyue/add',
|
||||
edit='/kcYuyue/kcYuyue/edit',
|
||||
deleteOne = '/kcYuyue/kcYuyue/delete',
|
||||
deleteBatch = '/kcYuyue/kcYuyue/deleteBatch',
|
||||
importExcel = '/kcYuyue/kcYuyue/importExcel',
|
||||
exportXls = '/kcYuyue/kcYuyue/exportXls',
|
||||
}
|
||||
//提交报错信息
|
||||
const saveOrUpdate = (params, isUpdate) => {
|
||||
let url = isUpdate ? Api.edit : Api.save;
|
||||
console.log(`🚀 ~ file: kclbList.vue:107 ~ saveOrUpdate ~ url:`, url)
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.yyyClass{
|
||||
background: #6cafda;float: left;font-weight: 600;color:#fff;border-radius: 5px;line-height: 23px;
|
||||
}
|
||||
.yyClass{
|
||||
background-color: #1c84c6;float: left;font-weight: 600;color:#fff;border-radius: 5px;line-height: 23px;
|
||||
}
|
||||
.bcClass{
|
||||
background-color: #1c84c6;float: right;font-weight: 600;border-radius: 5px;line-height: 23px;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -10,13 +10,13 @@
|
|||
</a-col>
|
||||
<a-col :span="4">
|
||||
<a-form-item label="" style="padding: 10px;">
|
||||
<JDictSelectTag placeholder="请选择院系" v-model:value="queryParam.szdw"
|
||||
<JDictSelectTag placeholder="请选择院系" v-model:value="queryParam.kkdw"
|
||||
:dictCode="`tkrszdw_view,college,college`" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="4">
|
||||
<a-form-item label="" style="padding: 10px;">
|
||||
<JDictSelectTag placeholder="请选择节次" v-model:value="queryParam.kkdw" :dictCode="`kc_kkdw_view,kkdw,kkdw`" />
|
||||
<JDictSelectTag placeholder="请选择节次" v-model:value="queryParam.jieci" :dictCode="`kc_jieci_view,jieciname,jieci`" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="4">
|
||||
|
@ -39,7 +39,7 @@
|
|||
<template #tab>
|
||||
<div>
|
||||
<div style="float: left;">完全线下课程</div>
|
||||
<div style="background-color: rgb(26, 179, 148);color: rgb(255, 255, 255);border-radius: 18px;width: 22px;text-align: center;float: left;margin-left: 10px;">
|
||||
<div style="background-color: rgb(26, 179, 148);color: rgb(255, 255, 255);border-radius: 18px;min-width: 22px;text-align: center;float: left;margin-left: 10px;">
|
||||
{{xxkcTotal}}</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -69,24 +69,31 @@ import { defHttp } from '/@/utils/http/axios';
|
|||
const rkbActiveKey = ref('1');
|
||||
const jclist = (queryParam) => defHttp.get({ url: '/kcJieci/kcJieci/getIndexJcList', params:queryParam });
|
||||
const queryParam = ref<any>({});
|
||||
const xxkcqueryParam = ref<any>({});
|
||||
const txhyqueryParam = ref<any>({});
|
||||
const xxkcqueryParam = ref<any>({skxs:1});
|
||||
const txhyqueryParam = ref<any>({zbpx:1});
|
||||
const xxkcTotal = ref<any>(0);
|
||||
const txhyTotal = ref<any>(0);
|
||||
function rkbLoadData() {
|
||||
//----------------------线下课程-------------------
|
||||
xxkcqueryParam.value.skrq = queryParam.value.ywTime
|
||||
xxkcqueryParam.value.hh = queryParam.value.jieci+","+queryParam.value.jieci.split("、").join(',')
|
||||
if(queryParam.value.jieci){
|
||||
console.log(`🚀 ~ file: kclbRkb.vue:80 ~ rkbLoadData ~ queryParam.value.jieci:`, queryParam.value.jieci)
|
||||
xxkcqueryParam.value.hh = queryParam.value.jieci+","+queryParam.value.jieci.split("、").join(',')
|
||||
}
|
||||
xxkcqueryParam.value.kkdw = queryParam.value.kkdw
|
||||
xxkcqueryParam.value.ywmc = queryParam.value.ywmc
|
||||
xxkcqueryParam.value.skxs = 1
|
||||
xxkcqueryParam.value.kcxz = queryParam.value.kcxz
|
||||
xxkcqueryParam.value.skxs = '1'
|
||||
|
||||
//----------------------腾讯会议-------------------
|
||||
txhyqueryParam.value.skrq = queryParam.value.ywTime
|
||||
txhyqueryParam.value.hh = queryParam.value.jieci+","+queryParam.value.jieci.split("、").join(',')
|
||||
if(queryParam.value.jieci){
|
||||
txhyqueryParam.value.hh = queryParam.value.jieci+","+queryParam.value.jieci.split("、").join(',')
|
||||
}
|
||||
txhyqueryParam.value.kkdw = queryParam.value.kkdw
|
||||
txhyqueryParam.value.ywmc = queryParam.value.ywmc
|
||||
txhyqueryParam.value.zbpx = 1
|
||||
txhyqueryParam.value.kcxz = queryParam.value.kcxz
|
||||
txhyqueryParam.value.zbpx ='1'
|
||||
txhyqueryParam.value.ywskxs = '1'
|
||||
}
|
||||
//进入就加载
|
||||
|
@ -94,8 +101,10 @@ onMounted(() => {
|
|||
jclist(queryParam.value).then(res=>{
|
||||
var list = res
|
||||
queryParam.value.ywTime = list[1].kssj
|
||||
// queryParam.value.jieci = list[1].jieci
|
||||
console.log(`🚀 ~ file: kclbZzsk.vue:64 ~ list ~ queryParam:`, queryParam)
|
||||
rkbLoadData()
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ function rkbLoadData() {
|
|||
txhyqueryParam.value.kkdw = queryParam.value.kkdw
|
||||
txhyqueryParam.value.ywmc = queryParam.value.ywmc
|
||||
txhyqueryParam.value.zbpx ='1'
|
||||
txhyqueryParam.value.skxs = '!1'
|
||||
txhyqueryParam.value.ywskxs = '1'
|
||||
}
|
||||
//进入就加载
|
||||
onMounted(() => {
|
||||
|
|
Loading…
Reference in New Issue