2023年4月16日 修复问题
This commit is contained in:
parent
652b47d5d0
commit
4b34fa8293
|
@ -49,6 +49,9 @@ export function useMethods(props: JVxeTableProps, { emit }, data: JVxeDataProps,
|
|||
isDisabledRow,
|
||||
recalcDisableRows,
|
||||
rowResort,
|
||||
toggleCheckboxRow,
|
||||
clearCheckboxRow,
|
||||
setCheckboxRow,
|
||||
};
|
||||
|
||||
// 多级联动
|
||||
|
@ -157,6 +160,22 @@ export function useMethods(props: JVxeTableProps, { emit }, data: JVxeDataProps,
|
|||
}
|
||||
}
|
||||
|
||||
// 后补的,变更选择
|
||||
function toggleCheckboxRow(row){
|
||||
let xTable = getXTable();
|
||||
return xTable.toggleCheckboxRow(row);
|
||||
}
|
||||
|
||||
function clearCheckboxRow(){
|
||||
let xTable = getXTable();
|
||||
return xTable.clearCheckboxRow();
|
||||
}
|
||||
|
||||
function setCheckboxRow(row,isCheck){
|
||||
let xTable = getXTable();
|
||||
return xTable.setCheckboxRow(row,isCheck);
|
||||
}
|
||||
|
||||
// 单元格被激活编辑时会触发该事件
|
||||
function handleEditActived({ column }) {
|
||||
// 执行增强
|
||||
|
|
|
@ -532,6 +532,10 @@ export function usePopBiz(props, tableRef?) {
|
|||
if (arg == 1) {
|
||||
pagination.current = 1;
|
||||
}
|
||||
if(!unref(cgRpConfigId)){//最初始没有这个ID,查询会报404,添加这个避免报错
|
||||
console.log(`未找到cgRpConfigId!`);
|
||||
return;
|
||||
}
|
||||
let params = getQueryParams(); //查询条件
|
||||
console.log('params', params);
|
||||
loading.value = true;
|
||||
|
@ -560,7 +564,7 @@ export function usePopBiz(props, tableRef?) {
|
|||
}
|
||||
dataSource.value = data.records;
|
||||
//update-begin-author:taoyan date:2023-2-11 for:issues/356 在线报表分页有问题
|
||||
tableRef.value && tableRef.value.setPagination({
|
||||
tableRef?.value && tableRef.value.setPagination({
|
||||
total: Number(data.total)
|
||||
})
|
||||
//update-end-author:taoyan date:2023-2-11 for:issues/356 在线报表分页有问题
|
||||
|
|
|
@ -12,7 +12,7 @@ export const columns: BasicColumn[] = [
|
|||
// ifShow: false,
|
||||
},
|
||||
{
|
||||
title: '课程编号',
|
||||
title: '课程号',
|
||||
align: "center",
|
||||
width: '300px',
|
||||
dataIndex: 'kcbh'
|
||||
|
|
|
@ -4,20 +4,20 @@
|
|||
<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-input placeholder="请输入开课单位" v-model:value="queryParam.kkdw"></a-input> -->
|
||||
<j-dict-select-tag placeholder="请选择开课单位" v-model:value="queryParam.kkdw" dictCode="kc_kkdw_view,kkdw,id"/>
|
||||
</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>
|
||||
<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">
|
||||
|
@ -27,15 +27,16 @@
|
|||
</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 label="课程名称或教师名">
|
||||
<a-input placeholder="请输入课程名称或教师名" v-model:value="queryParam.searchInput"></a-input>
|
||||
</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-col :lg="8">
|
||||
<a-form-item label="授课教师">
|
||||
<a-input placeholder="请输入授课教师" v-model:value="queryParam.skjs"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
</a-col> -->
|
||||
<!--<template v-if="toggleSearchStatus">-->
|
||||
<!--</template>-->
|
||||
<a-col :xl="6" :lg="7" :md="8" :sm="24">
|
||||
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
|
||||
|
@ -52,13 +53,43 @@
|
|||
</a-row>
|
||||
</a-form>
|
||||
</div>
|
||||
<!--引用表格-->
|
||||
<BasicTable @register="registerTable" :rowSelection="rowSelection" :beforeEditSubmit="beforeEditSubmit">
|
||||
<!--插槽:table标题-->
|
||||
<template #tableTitle>
|
||||
<a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
|
||||
<vxe-toolbar>
|
||||
<template #buttons>
|
||||
<a-button type="primary" class="pl1r" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" class="pl1r" @click="handleEdit" preIcon="ant-design:plus-outlined"> 修改</a-button>
|
||||
<a-button type="danger" class="pl1r" @click="batchHandleDelete" preIcon="ant-design:delete-outlined">删除</a-button>
|
||||
<!-- <vxe-button @click="insertEvent">新增</vxe-button>
|
||||
<vxe-button @click="$refs.xTable.removeCheckboxRow()">删除选中</vxe-button>
|
||||
<vxe-button @click="saveEvent">保存</vxe-button> -->
|
||||
</template>
|
||||
</vxe-toolbar>
|
||||
<JVxeTable
|
||||
ref="tableRef"
|
||||
row-number
|
||||
row-selection
|
||||
keep-source
|
||||
clickSelectRow
|
||||
bordered
|
||||
rowSelectionType="radio"
|
||||
:loading="loading"
|
||||
:dataSource="dataSource"
|
||||
:columns="columns"
|
||||
:pagination="pagination"
|
||||
style="margin-top: 8px"
|
||||
@pageChange="handlePageChange"
|
||||
@valueChange="valueChange"
|
||||
@selectRowChange="selectRowChange"
|
||||
>
|
||||
<!-- @save="save"
|
||||
@added="added"
|
||||
@removed="removed"
|
||||
@inserted="inserted"
|
||||
@dragged="dragged" -->
|
||||
<template #toolbarSuffix>
|
||||
<!-- <a-button type="primary" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||
<a-button type="primary" @click="handleEdit" preIcon="ant-design:plus-outlined"> 修改</a-button>
|
||||
<a-button type="danger" @click="batchHandleDelete" preIcon="ant-design:delete-outlined">删除</a-button>
|
||||
<a-button type="danger" @click="batchHandleDelete" preIcon="ant-design:delete-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">
|
||||
|
@ -75,85 +106,414 @@
|
|||
</a-button>
|
||||
</a-dropdown> -->
|
||||
</template>
|
||||
<!-- 不显示【未选中任何数据】栏 -->
|
||||
<template #tableTop><span></span></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>
|
||||
</JVxeTable>
|
||||
<!--引用表格-->
|
||||
|
||||
<!-- 表单区域 -->
|
||||
<KcKechengbiaoModal ref="registerModal" @success="handleSuccess"></KcKechengbiaoModal>
|
||||
|
||||
<!-- -{{ selectedRows }}- -->
|
||||
<KcKetangbiaoList v-show="selectedRows[0]" :currentRowKey="selectedRows[0]"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="ktgl-kcKechengbiao" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { ref, reactive, onMounted } from 'vue';
|
||||
// import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
// import { useListPage } from '/@/ho oks/system/useListPage';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { columns } from './KcKechengbiao.data';
|
||||
// import { columns } from './KcKechengbiao.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, saveOrUpdate } from './KcKechengbiao.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
// 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'
|
||||
|
||||
import { JVxeColumn, JVxeTableInstance, JVxeTypes } from '/@/components/jeecg/JVxeTable/types';
|
||||
import { filterObj } from '/@/utils/common/compUtils';
|
||||
// import { random } from 'lodash-es';
|
||||
// import { buildUUID } from '/@/utils/uuid';
|
||||
// import { uploadUrl } from '/@/api/common/api';
|
||||
|
||||
const tableRef = ref<JVxeTableInstance>();
|
||||
// const { createMessage } = useMessage();
|
||||
const loading = ref(false);
|
||||
const columns = ref<JVxeColumn[]>([
|
||||
// {
|
||||
// title: '下拉框_字典表搜索',
|
||||
// key: 'select_dict_search',
|
||||
// type: JVxeTypes.selectDictSearch,
|
||||
// width: 200,
|
||||
// async: true, // 异步搜索,默认为 true
|
||||
// // 字典表配置信息:数据库表名,显示字段名,存储字段名
|
||||
// dict: 'sys_user,realname,username',
|
||||
// tipsContent: '请输入查询条件',
|
||||
// },
|
||||
// {
|
||||
// title: '单选',
|
||||
// key: 'radio',
|
||||
// type: JVxeTypes.radio,
|
||||
// width: 130,
|
||||
// options: [
|
||||
// { text: '男', value: '1' },
|
||||
// { text: '女', value: '2' },
|
||||
// ],
|
||||
// // 允许清除选择(再点一次取消选择)
|
||||
// allowClear: false,
|
||||
// },
|
||||
|
||||
{
|
||||
title: '课程编号',
|
||||
align: "left",
|
||||
width: '300px',
|
||||
key: 'kcbh',
|
||||
},
|
||||
{
|
||||
title: '课程名称',
|
||||
align: "left",
|
||||
key: 'kcmc'
|
||||
},
|
||||
{
|
||||
title: '授课教师',
|
||||
align: "left",
|
||||
key: 'skjs'
|
||||
},
|
||||
{
|
||||
title: '学科人数',
|
||||
align: "left",
|
||||
width: '80px',
|
||||
key: 'xkrs'
|
||||
},
|
||||
{
|
||||
title: '开课单位',
|
||||
align: "left",
|
||||
width: '100px',
|
||||
key: 'kkdw_dictText'
|
||||
},
|
||||
{
|
||||
title: '课程性质',
|
||||
align: "left",
|
||||
width: '105px',
|
||||
key: 'kcxz_dictText'
|
||||
},
|
||||
{
|
||||
title: '上课地点',
|
||||
align: "left",
|
||||
width: '100px',
|
||||
key: 'skdd'
|
||||
},
|
||||
{
|
||||
title: '上课周次',
|
||||
align: "left",
|
||||
width: '100px',
|
||||
key: 'jkzc_dictText'
|
||||
},
|
||||
{
|
||||
title: '节次',
|
||||
align: "left",
|
||||
width: '70px',
|
||||
key: 'hh_dictText'
|
||||
},
|
||||
{
|
||||
title: '星期',
|
||||
align: "left",
|
||||
width: '70px',
|
||||
key: 'week_dictText'
|
||||
},
|
||||
{
|
||||
title: '学分',
|
||||
align: "left",
|
||||
width: '50px',
|
||||
key: 'xf'
|
||||
},
|
||||
|
||||
{
|
||||
title: '是否出镜',
|
||||
key: 'sfcj',
|
||||
type: JVxeTypes.selectSearch,
|
||||
width: 100,
|
||||
options: [
|
||||
{ label: '是', value: 0, },
|
||||
{ label: '否', value: 1, },
|
||||
],
|
||||
},
|
||||
{
|
||||
title: '上课形式',
|
||||
key: 'skxs',
|
||||
type: JVxeTypes.selectSearch,
|
||||
width: 100,
|
||||
options: [
|
||||
{ label: '线上', value: 0, },
|
||||
{ label: '线下', value: 1, },
|
||||
{ label: '线上线下混合', value: 2, },
|
||||
],
|
||||
},
|
||||
|
||||
// {
|
||||
// title: '是否出镜',
|
||||
// align: "center",
|
||||
// dataIndex: 'sfcj',
|
||||
// edit: true,
|
||||
// editComponent: 'Select',
|
||||
// editComponentProps: {
|
||||
// options: [
|
||||
// { label: '是', value: 0, },
|
||||
// { label: '否', value: 1, },
|
||||
// ],
|
||||
// },
|
||||
// },
|
||||
|
||||
|
||||
// {
|
||||
// title: '上课形式',
|
||||
// align: "center",
|
||||
// dataIndex: 'skxs',
|
||||
// edit: true,
|
||||
// editComponent: 'Select',
|
||||
// editComponentProps: {
|
||||
// options: [
|
||||
// { label: '线上', value: 0, },
|
||||
// { label: '线下', value: 1, },
|
||||
// { label: '线上线下混合', value: 2, },
|
||||
// ],
|
||||
// },
|
||||
// },
|
||||
|
||||
]);
|
||||
const dataSource = ref<any[]>([]);
|
||||
const pagination = reactive({
|
||||
current: 1,
|
||||
pageSize: 5,
|
||||
pageSizeOptions: ['10', '20', '30', '100', '200'],
|
||||
total: 0,
|
||||
});
|
||||
|
||||
// randomPage(pagination.current, pagination.pageSize, true);
|
||||
|
||||
// 当分页参数变化时触发的事件
|
||||
// function handlePageChange(...e) {
|
||||
// alert('????')
|
||||
// console.log('handlePageChange','?????????');
|
||||
// //{current, pageSize }
|
||||
// console.log('handlePageChange',e);
|
||||
|
||||
// 重新赋值
|
||||
// pagination.current = current;
|
||||
// pagination.pageSize = pageSize;
|
||||
// 查询数据
|
||||
// loadData(1);
|
||||
// randomPage(event.current, event.pageSize, true);
|
||||
// }
|
||||
|
||||
// function save() {
|
||||
// console.log('save',...data);
|
||||
// }
|
||||
// function added(...data) {
|
||||
// console.log('added',...data);
|
||||
// }
|
||||
// function removed(...data) {
|
||||
// console.log('removed',...data);
|
||||
// }
|
||||
// function inserted(...data) {
|
||||
// console.log('inserted',...data);
|
||||
// }
|
||||
// function dragged(...data) {
|
||||
// console.log('dragged',...data);
|
||||
// }
|
||||
function selectRowChange({ selectedRowIds, selectedRows: rows, $table }) {
|
||||
|
||||
console.log(`🚀 --------------------------------------------------------------------🚀`);
|
||||
console.log(`🚀 ~ file: KcKechengbiaoList.vue:323 ~ selectRowChange ~ rows:`, rows,selectedRows);
|
||||
console.log(`🚀 --------------------------------------------------------------------🚀`);
|
||||
|
||||
if(rows && rows[0]){
|
||||
selectedRows.value = Array<never>(rows[0])
|
||||
}else{
|
||||
selectedRows.value = [];
|
||||
}
|
||||
// console.log('selectRowChange',selectedRowIds,rows, tableRef);
|
||||
// //action == selected
|
||||
|
||||
// if(rows && rows.length){
|
||||
// let id = rows[0]?.id
|
||||
// // let { row } = tableRef.value!.getIfRowById(id)
|
||||
// let row = dataSource.value.filter(x => x.id == id);
|
||||
|
||||
// console.log(`🚀 ------------------------------------------------------------------🚀`);
|
||||
// console.log(`🚀 ~ file: KcKechengbiaoList.vue:330 ~ selectRowChange ~ row:`, row);
|
||||
// console.log(`🚀 ------------------------------------------------------------------🚀`);
|
||||
|
||||
// $table.clearCheckboxRow().then(() => {
|
||||
// $table.setCheckboxRow(row,true);
|
||||
// })
|
||||
|
||||
// console.log(`🚀 ------------------------------------------------------------------🚀`);
|
||||
// console.log(`🚀 ~ file: KcKechengbiaoList.vue:329 ~ selectRowChange ~ row:`, row);
|
||||
// console.log(`🚀 ------------------------------------------------------------------🚀`);
|
||||
|
||||
// }
|
||||
// tableRef.value!.toggleCheckboxRow(rows[0])
|
||||
|
||||
// if(selectedRowIds.length == 2){
|
||||
// selectedRowKeys.value = Array<never>(selectedRowIds[0]);
|
||||
// selectedRows.value = Array<never>(rows[0]);
|
||||
// }else{
|
||||
// selectedRowKeys.value = selectedRowIds[0];
|
||||
// selectedRows.value = rows[0];
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
function handlePageChange(event) {
|
||||
console.log('pageChange',event);
|
||||
// 重新赋值
|
||||
pagination.current = event.current;
|
||||
pagination.pageSize = event.pageSize;
|
||||
//查询数据
|
||||
loadData(null);
|
||||
}
|
||||
function valueChange({ value, col, row }) {
|
||||
// console.log('valueChange',...data);
|
||||
//异步改数据
|
||||
// temp1.value
|
||||
let key = col?.key
|
||||
let id = row?.id
|
||||
saveByCell({ value, key, id })
|
||||
}
|
||||
|
||||
/** 获取值,忽略表单验证 */
|
||||
function handleTableGet() {
|
||||
const values = tableRef.value!.getTableData();
|
||||
console.log('获取值:', { values });
|
||||
createMessage.success('获取值成功,请看控制台输出');
|
||||
}
|
||||
|
||||
/* 随机生成分页数据 */
|
||||
// function randomPage(current, pageSize, $loading = false) {
|
||||
// if ($loading) {
|
||||
// loading.value = true;
|
||||
// }
|
||||
// let begin = Date.now();
|
||||
// let values: any[] = [];
|
||||
// for (let i = 0; i < pageSize; i++) {
|
||||
// let radio = random(0, 2);
|
||||
// values.push({
|
||||
// id: buildUUID(),
|
||||
// select_dict_search: ['admin', '', 'jeecg'][random(0, 2)],
|
||||
// progress: random(0, 100),
|
||||
// radio: radio ? radio.toString() : null,
|
||||
// });
|
||||
// }
|
||||
// dataSource.value = values;
|
||||
// let end = Date.now();
|
||||
// let diff = end - begin;
|
||||
// if ($loading && diff < pageSize) {
|
||||
// setTimeout(() => (loading.value = false), pageSize - diff);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
const selectedRows = ref([]);
|
||||
const selectedRowKeys = ref([]);
|
||||
// const reload = () => {}
|
||||
onMounted(() => {
|
||||
loadData(1);
|
||||
})
|
||||
function reload() {
|
||||
//自己写吧。。
|
||||
loadData(1);
|
||||
}
|
||||
function loadData(pageNo:any | null | undefined){
|
||||
loading.value = true;
|
||||
if(pageNo == 1){
|
||||
pagination.current = 1;
|
||||
}
|
||||
//参数
|
||||
let { current, pageSize } = pagination;
|
||||
let param = { column: 'createTime', order: 'desc', pageNo: current, pageSize, ...queryParam.value, ...filterInfo.value }
|
||||
// let param = Object.assign({ column: 'createTime', order: 'desc', current, pageSize },filterObj(queryParam.value));
|
||||
list(param).then(res => {
|
||||
console.log(`🚀 -------------------------------------------------------🚀`);
|
||||
console.log(`🚀 ~ file: KcKechengbiaoList.vue:323 ~ list ~ res:`, res);
|
||||
console.log(`🚀 -------------------------------------------------------🚀`);
|
||||
dataSource.value = res?.records??[]
|
||||
pagination.total = res?.total??0
|
||||
}).finally(() => {
|
||||
// 这里是无论成功或失败都会执行的方法,在这里关闭loading
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// async function loadData() {
|
||||
// loading.value = true;
|
||||
// // 调用查询数据接口
|
||||
// await defHttp
|
||||
// .get({
|
||||
// // 请求地址
|
||||
// url: Api.getData,
|
||||
// // 封装查询条件
|
||||
// params: {
|
||||
// pageNo: pagination.current,
|
||||
// pageSize: pagination.pageSize,
|
||||
// },
|
||||
// })
|
||||
// .then((result) => {
|
||||
// // 后台查询回来的 total,数据总数量
|
||||
// pagination.total = result.total;
|
||||
// // 将查询的数据赋值给 dataSource
|
||||
// dataSource.value = result.records;
|
||||
// // 重置选择
|
||||
// selectedRows.value = [];
|
||||
// })
|
||||
// .finally(() => {
|
||||
// // 这里是无论成功或失败都会执行的方法,在这里关闭loading
|
||||
// loading.value = false;
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
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: '课程管理-主表',
|
||||
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, ...filterInfo.value});
|
||||
},
|
||||
},
|
||||
exportConfig: {
|
||||
name: "课程管理-主表",
|
||||
url: getExportUrl,
|
||||
},
|
||||
importConfig: {
|
||||
url: getImportUrl,
|
||||
success: handleSuccess
|
||||
},
|
||||
});
|
||||
const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys, selectedRows }] = tableContext;
|
||||
// const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
// tableProps: {
|
||||
// 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, ...filterInfo.value});
|
||||
// },
|
||||
// },
|
||||
// exportConfig: {
|
||||
// name: "课程管理-主表",
|
||||
// url: getExportUrl,
|
||||
// },
|
||||
// importConfig: {
|
||||
// url: getImportUrl,
|
||||
// success: handleSuccess
|
||||
// },
|
||||
// });
|
||||
// const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys, selectedRows }] = tableContext;
|
||||
const labelCol = reactive({
|
||||
xs: { span: 24 },
|
||||
sm: { span: 7 },
|
||||
|
@ -274,7 +634,7 @@
|
|||
}
|
||||
|
||||
// 模拟将指定数据保存
|
||||
function feakSave({ value, key, id }) {
|
||||
function saveByCell({ value, key, id }) {
|
||||
createMessage.loading({
|
||||
content: `正在保存!`,
|
||||
key: '_save_fake_data',
|
||||
|
@ -307,7 +667,7 @@
|
|||
|
||||
async function beforeEditSubmit({ record, index, key, value }) {
|
||||
console.log('单元格数据正在准备提交', { record, index, key, value });
|
||||
return await feakSave({ id: record.id, key, value });
|
||||
return await saveByCell({ id: record.id, key, value });
|
||||
}
|
||||
|
||||
function handleEditCancel() {
|
||||
|
@ -375,4 +735,7 @@
|
|||
text-align: center
|
||||
}
|
||||
}
|
||||
.pl1r {
|
||||
margin-left: 1rem;
|
||||
}
|
||||
</style>
|
||||
|
|
|
@ -4,7 +4,12 @@
|
|||
<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-col :span="24">
|
||||
<strong style="font-size: 1.5rem;color:#676a6c;">
|
||||
课堂管理:{{props.currentRowKey?.kcmc}}-{{props.currentRowKey?.skjs}}-星期{{props.currentRowKey?.week}}-{{props.currentRowKey?.hh_dictText}}节
|
||||
</strong>
|
||||
</a-col>
|
||||
<!-- <a-col :lg="8">kcmc skjs hh_dictText week
|
||||
<a-form-item label="节次">
|
||||
<j-dict-select-tag placeholder="请选择节次" v-model:value="queryParam.hh" dictCode="skjc"/>
|
||||
</a-form-item>
|
||||
|
@ -150,6 +155,8 @@
|
|||
if(queryParam.value.kechengbiaoid != '-1'){
|
||||
reload();
|
||||
}
|
||||
selectedRows.value = [];
|
||||
selectedRowKeys.value = [];
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
<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 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">
|
||||
|
@ -19,12 +19,31 @@
|
|||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item label="授课教师" v-bind="validateInfos.skjs">
|
||||
<j-dict-select-tag v-model:value="formData.skjs" dictCode="" placeholder="请选择授课教师" :disabled="disabled"/>
|
||||
<!-- <j-dict-select-tag v-model:value="formData.skjs" dictCode="" placeholder="请选择授课教师" :disabled="disabled"/> -->
|
||||
<!-- :formElRef="formRef" -->
|
||||
<JPopup
|
||||
placeholder="请选择授课教师"
|
||||
v-model:value="formData.skjs"
|
||||
code="selectTeacherLilst"
|
||||
:param="{}"
|
||||
:field-config="[
|
||||
{ source: 'id', target: 'id' },
|
||||
{ source: 'user', target: 'user' },
|
||||
{ source: 'cn', target: 'cn' },
|
||||
{ source: 'collegecode', target: 'collegecode' },
|
||||
{ source: 'college', target: 'college' },
|
||||
{ source: 'csrq', target: 'csrq' },
|
||||
{ source: 'sfzxm', target: 'sfzxm' },
|
||||
{ source: 'zdxms', target: 'zdxms' },
|
||||
]"
|
||||
:setFieldsValue="updateSkjsFn"
|
||||
:multi="false"
|
||||
/>
|
||||
</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 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">
|
||||
|
@ -105,6 +124,10 @@
|
|||
import { Form } from 'ant-design-vue';
|
||||
import { duplicateValidate } from '/@/utils/helper/validator'
|
||||
|
||||
// import JPopup from '/@/components/Form/src/jeecg/components/JPopup.vue'
|
||||
import { JPopup } from '/@/components/Form';
|
||||
|
||||
|
||||
const props = defineProps({
|
||||
formDisabled: { type: Boolean, default: false },
|
||||
formData: { type: Object, default: ()=>{} },
|
||||
|
@ -139,7 +162,7 @@
|
|||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = {
|
||||
kcbh: [{ required: true, message: '请输入课程编号!'}, { validator: kcbhDuplicatevalidate }],
|
||||
kcbh: [{ required: true, message: '请输入课程号!'}, { validator: kcbhDuplicatevalidate }],
|
||||
kcmc: [{ required: true, message: '请输入课程名称!'},],
|
||||
skjs: [{ required: true, message: '请输入授课教师!'},],
|
||||
xkrs: [{ required: true, message: '请输入学科人数!'},],
|
||||
|
@ -147,7 +170,7 @@
|
|||
kcxz: [{ required: true, message: '请输入课程性质!'},],
|
||||
jkzc: [{ required: true, message: '请输入上课周次!'},],
|
||||
hh: [{ required: true, message: '请输入节次!'},],
|
||||
week: [{ required: true, message: '请输入星期几!'},],
|
||||
week: [{ required: true, message: '请输入星期!'},],
|
||||
xf: [{ required: true, message: '请输入学分!'},],
|
||||
};
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||
|
@ -220,6 +243,33 @@
|
|||
confirmLoading.value = false;
|
||||
});
|
||||
}
|
||||
function updateSkjsFn(selectRow) {
|
||||
console.log(`🚀 -----------------------------------------------------------------🚀`);
|
||||
console.log(`🚀 ~ file: KcKechengbiaoForm.vue:249 ~ updateSkjsFn ~ ...d:`, selectRow);
|
||||
console.log(`🚀 -----------------------------------------------------------------🚀`);
|
||||
|
||||
let { id, user, cn, collegecode, college, csrq, sfzxm, zdxms } = selectRow;
|
||||
formData.skjs = cn;
|
||||
formData.zc = zdxms;
|
||||
formData.jgh = user;
|
||||
// formData.skjs
|
||||
// cn
|
||||
// "白成国"
|
||||
// college
|
||||
// "历史文化学院"
|
||||
// collegecode
|
||||
// "166000"
|
||||
// csrq
|
||||
// "19561115"
|
||||
// id
|
||||
// "114135"
|
||||
// sfzxm
|
||||
// "1"
|
||||
// user
|
||||
// "1000900003"
|
||||
// zdxms
|
||||
// "讲师(高校)"
|
||||
}
|
||||
|
||||
|
||||
async function kcbhDuplicatevalidate(_r, value) {
|
||||
|
|
|
@ -1,66 +1,89 @@
|
|||
<template>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol" layout="vertical">
|
||||
<a-row>
|
||||
<template v-if="type == 'all' || type == 'pt'">
|
||||
<a-col :span="12">
|
||||
<template v-if="type == 'pt'">
|
||||
<a-col :span="24">
|
||||
<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-col :span="24">
|
||||
<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="12">
|
||||
<a-col :span="24">
|
||||
<a-form-item label="会议密码" v-bind="validateInfos.hymm">
|
||||
<a-input v-model:value="formData.hymm" placeholder="请输入会议密码" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-col :span="24">
|
||||
<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">
|
||||
<template v-if="type == 'js'">
|
||||
<a-col :span="24">
|
||||
<a-form-item label="开课单位" v-bind="validateInfos.kkdw">
|
||||
<j-dict-select-tag v-model:value="formData.kkdw" dictCode="kc_kkdw_view,kkdw,id" placeholder="请选择开课单位" :disabled="disabled"/>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-col :span="24">
|
||||
<a-form-item label="授课教师" v-bind="validateInfos.skjs">
|
||||
<a-input v-model:value="formData.skjs" placeholder="请输入授课教师" :disabled="disabled"></a-input>
|
||||
<!-- <a-input v-model:value="formData.skjs" placeholder="请输入授课教师" :disabled="disabled"></a-input> -->
|
||||
<JPopup
|
||||
placeholder="请选择授课教师"
|
||||
v-model:value="formData.skjs"
|
||||
code="selectTeacherLilst"
|
||||
:param="{}"
|
||||
:field-config="[
|
||||
{ source: 'id', target: 'id' },
|
||||
{ source: 'user', target: 'user' },
|
||||
{ source: 'cn', target: 'cn' },
|
||||
{ source: 'collegecode', target: 'collegecode' },
|
||||
{ source: 'college', target: 'college' },
|
||||
{ source: 'csrq', target: 'csrq' },
|
||||
{ source: 'sfzxm', target: 'sfzxm' },
|
||||
{ source: 'zdxms', target: 'zdxms' },
|
||||
]"
|
||||
:setFieldsValue="updateSkjsFn"
|
||||
:multi="false"
|
||||
/>
|
||||
</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-col :span="24">
|
||||
<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.sksj">
|
||||
<a-input v-model:value="formData.sksj" placeholder="请输入上课时间" :disabled="disabled"></a-input>
|
||||
<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.hh">
|
||||
<j-dict-select-tag v-model:value="formData.hh" dictCode="skjc" placeholder="请选择节次" :disabled="disabled"/>
|
||||
<a-col :span="24">
|
||||
<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.week">
|
||||
<j-dict-select-tag v-model:value="formData.week" dictCode="week" placeholder="请选择周几" :disabled="disabled"/>
|
||||
<a-col :span="24">
|
||||
<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="12">
|
||||
<a-form-item label="开课周次" v-bind="validateInfos.kkzc">
|
||||
<j-checkbox type="checkbox" v-model:value="formData.kkzc" dictCode="skzc" placeholder="请选择开课周次" :disabled="disabled"/>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="会议密码" v-bind="validateInfos.hymm">
|
||||
<a-input v-model:value="formData.hymm" placeholder="请输入会议密码" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<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>
|
||||
|
@ -162,15 +185,17 @@
|
|||
|
||||
|
||||
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>({ xs: { span: 24 }, sm: { span: 24 } });
|
||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 24 } });
|
||||
// const labelCol = ref<any>({ style: { width: '150px' } });
|
||||
// const wrapperCol = ref<any>({ style: { width: '100%' } });
|
||||
const confirmLoading = ref<boolean>(false);
|
||||
//表单验证
|
||||
const validatorRules = {
|
||||
kcmc: [{ required: true, message: '请输入课程名称!'},],
|
||||
skjs: [{ required: true, message: '请输入授课教师!'},],
|
||||
hh: [{ required: true, message: '请输入节次!'},],
|
||||
week: [{ required: true, message: '请输入周几!'},],
|
||||
week: [{ required: true, message: '请输入星期!'},],
|
||||
kkzc: [{ required: true, message: '请输入开课周次!'},],
|
||||
};
|
||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||
|
@ -205,6 +230,33 @@
|
|||
Object.assign(formData, record);
|
||||
});
|
||||
}
|
||||
function updateSkjsFn(selectRow) {
|
||||
console.log(`🚀 -----------------------------------------------------------------🚀`);
|
||||
console.log(`🚀 ~ file: KcKechengbiaoForm.vue:249 ~ updateSkjsFn ~ ...d:`, selectRow);
|
||||
console.log(`🚀 -----------------------------------------------------------------🚀`);
|
||||
|
||||
let { id, user, cn, collegecode, college, csrq, sfzxm, zdxms } = selectRow;
|
||||
formData.skjs = cn;
|
||||
formData.zc = zdxms;
|
||||
formData.jgh = user;
|
||||
// formData.skjs
|
||||
// cn
|
||||
// "白成国"
|
||||
// college
|
||||
// "历史文化学院"
|
||||
// collegecode
|
||||
// "166000"
|
||||
// csrq
|
||||
// "19561115"
|
||||
// id
|
||||
// "114135"
|
||||
// sfzxm
|
||||
// "1"
|
||||
// user
|
||||
// "1000900003"
|
||||
// zdxms
|
||||
// "讲师(高校)"
|
||||
}
|
||||
|
||||
/**
|
||||
* 提交数据
|
||||
|
|
Loading…
Reference in New Issue