diff --git a/src/components/SimpleMenu/src/components/MenuItem.vue b/src/components/SimpleMenu/src/components/MenuItem.vue index 0b7afc7..195bc71 100644 --- a/src/components/SimpleMenu/src/components/MenuItem.vue +++ b/src/components/SimpleMenu/src/components/MenuItem.vue @@ -107,7 +107,7 @@ //update-begin-author:taoyan date:2022-6-1 for: VUEN-1144 online 配置成菜单后,打开菜单,显示名称未展示为菜单名称 function storePathTitle(path) { - console.log('storePathTitle', path); + // console.log('storePathTitle', path); let title = ''; if (instance!.attrs) { let item: any = instance!.attrs.item; diff --git a/src/router/routes/index.ts b/src/router/routes/index.ts index de2e3bc..4276420 100644 --- a/src/router/routes/index.ts +++ b/src/router/routes/index.ts @@ -70,7 +70,7 @@ export const TokenLoginRoute: AppRouteRecordRaw = { }, }; -console.log('NoTokenSiteRoute =>', NoTokenSiteRoute, modules, Oauth2LoginRoute); +// console.log('NoTokenSiteRoute =>', NoTokenSiteRoute, modules, Oauth2LoginRoute); /** * 门户页 */ diff --git a/src/settings/localeSetting.ts b/src/settings/localeSetting.ts index 304f807..d6dcbd3 100644 --- a/src/settings/localeSetting.ts +++ b/src/settings/localeSetting.ts @@ -8,7 +8,7 @@ export const LOCALE: { [key: string]: LocaleType } = { export const localeSetting: LocaleSetting = { // 是否显示语言选择器 - showPicker: true, + showPicker: false, // 当前语言 locale: LOCALE.ZH_CN, // 默认语言 diff --git a/src/views/kc/ktgl/KcKechengbiao.api.ts b/src/views/kc/ktgl/KcKechengbiao.api.ts index e683e38..9b5ee7e 100644 --- a/src/views/kc/ktgl/KcKechengbiao.api.ts +++ b/src/views/kc/ktgl/KcKechengbiao.api.ts @@ -28,8 +28,7 @@ export const getImportUrl = Api.importExcel; * 列表接口 * @param params */ -// export const list = (params) => defHttp.get({ url: Api.list, params: { pageSize: -1, ...params } }); -export const list = (params) => defHttp.get({ url: Api.list, params: { ...params } }); +export const list = (params) => defHttp.get({ url: Api.list, params }); /** * 删除单个 diff --git a/src/views/kc/ktgl/KcKechengbiao.data.ts b/src/views/kc/ktgl/KcKechengbiao.data.ts index e8e8ae1..29893a7 100644 --- a/src/views/kc/ktgl/KcKechengbiao.data.ts +++ b/src/views/kc/ktgl/KcKechengbiao.data.ts @@ -4,6 +4,19 @@ import { rules} from '/@/utils/helper/validator'; import { render } from '/@/utils/common/renderUtils'; //列表数据 export const columns: BasicColumn[] = [ + { + title: 'id', + align: "center", + width: '0', + dataIndex: 'id', + // ifShow: false, + }, + { + title: '课程编号', + align: "center", + width: '300px', + dataIndex: 'kcbh' + }, { title: '课程名称', align: "center", @@ -12,85 +25,275 @@ export const columns: BasicColumn[] = [ { title: '授课教师', align: "center", - dataIndex: 'skjs' + dataIndex: 'skjs_dictText' }, { - title: '授课时间', + title: '学科人数', align: "center", - dataIndex: 'sksj' + width: '80px', + dataIndex: 'xkrs' + }, + { + title: '开课单位', + align: "center", + width: '100px', + dataIndex: 'kkdw_dictText' + }, + { + title: '课程性质', + align: "center", + width: '105px', + dataIndex: 'kcxz_dictText' + }, + { + title: '上课地点', + align: "center", + width: '100px', + dataIndex: 'skdd' + }, + { + title: '上课周次', + align: "center", + width: '100px', + dataIndex: 'jkzc_dictText' }, { title: '节次', align: "center", - dataIndex: 'hh' + width: '70px', + dataIndex: 'hh_dictText' }, { title: '星期几', align: "center", - dataIndex: 'week' + width: '70px', + dataIndex: 'week_dictText' }, { - title: '直播方式', + title: '学分', align: "center", - dataIndex: 'zbfs' + width: '50px', + dataIndex: 'xf' }, { - title: '会议号', + title: '是否出镜', align: "center", - dataIndex: 'hyh' + dataIndex: 'sfcj', + edit: true, + editComponent: 'Select', + // editComponentProps: { + // // //选中 + // checkedChildren: "是-", + // // checkedValue: 0, + // // //未选中 + // unCheckedChildren:'否-', + // // unCheckedValue: 1, + // // onClick: (checked: boolean | string | number, event: Event) => { + // // event.stopPropagation(); + // // console.log('选择后回调',checked,event); + + // // } + // }, + // editValueMap: (value) => value == '0'?'是':'否', + // editValueMap: (value) => value?'0':'1', + // format: (text) => ,C + editComponentProps: { + options: [ + { label: '是', value: 0, }, + { label: '否', value: 1, }, + ], + }, + // customRender: (r) => r.text == 0?'是':'否' }, + + { - title: '会议密码', + title: '上课形式', align: "center", - dataIndex: 'hymm' + dataIndex: 'skxs', + edit: true, + editComponent: 'Select', + editComponentProps: { + options: [ + { label: '线上', value: 0, }, + { label: '线下', value: 1, }, + { label: '线上线下混合', value: 2, }, + ], + }, + // customRender: (r) => r.text == 0?'线上':r.text == 1?'线下':'线上线下混合' }, - { - title: '课程链接', - align: "center", - dataIndex: 'kclj' - }, - // { - // title: '直播平台', - // align: "center", - // dataIndex: 'zbpx' - // }, ]; //查询数据 export const searchFormSchema: FormSchema[] = [ + { + label: "课程名称", + field: 'kcmc', + component: 'Input', + colProps: {span: 6}, + }, + { + label: "授课教师", + field: 'skjs', + component: 'JDictSelectTag', + componentProps:{ + }, + colProps: {span: 6}, + }, + { + label: "开课单位", + field: 'kkdw', + component: 'JDictSelectTag', + componentProps:{ + }, + colProps: {span: 6}, + }, + { + label: "课程性质", + field: 'kcxz', + component: 'Input', + colProps: {span: 6}, + }, + { + label: "节次", + field: 'hh', + component: 'JDictSelectTag', + componentProps:{ + dictCode: "skjc" + }, + colProps: {span: 6}, + }, + { + label: "星期几", + field: 'week', + component: 'JDictSelectTag', + componentProps:{ + dictCode: "week" + }, + colProps: {span: 6}, + }, ]; //表单数据 export const formSchema: FormSchema[] = [ + { + label: '课程编号', + field: 'kcbh', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入课程编号!'}, + {...rules.duplicateCheckRule('kc_kechengbiao', 'kcbh',model,schema)[0]}, + ]; + }, + }, { label: '课程名称', field: 'kcmc', component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入课程名称!'}, + ]; + }, }, { label: '授课教师', field: 'skjs', + component: 'JDictSelectTag', + componentProps:{ + dictCode: "" + }, + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入授课教师!'}, + ]; + }, + }, + { + label: '学科人数', + field: 'xkrs', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入学科人数!'}, + ]; + }, + }, + { + label: '开课单位', + field: 'kkdw', + component: 'JDictSelectTag', + componentProps:{ + dictCode: "" + }, + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入开课单位!'}, + ]; + }, + }, + { + label: '课程性质', + field: 'kcxz', + component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入课程性质!'}, + ]; + }, + }, + { + label: '上课地点', + field: 'skdd', component: 'Input', }, { - label: '授课时间', - field: 'sksj', - component: 'Input', + label: '上课周次', + field: 'jkzc', + component: 'JSelectMultiple', + componentProps:{ + dictCode: "skzc" + }, + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入上课周次!'}, + ]; + }, }, { label: '节次', field: 'hh', - component: 'Input', + component: 'JDictSelectTag', + componentProps:{ + dictCode: "skjc" + }, + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入节次!'}, + ]; + }, }, { label: '星期几', field: 'week', - component: 'Input', + component: 'JDictSelectTag', + componentProps:{ + dictCode: "week" + }, + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入星期几!'}, + ]; + }, }, { label: '直播方式', field: 'zbfs', - component: 'Input', + component: 'JDictSelectTag', + componentProps:{ + dictCode: "skpt" + }, }, { label: '会议号', @@ -108,9 +311,24 @@ export const formSchema: FormSchema[] = [ component: 'Input', }, { - label: '直播平台', - field: 'zbpx', + label: '学分', + field: 'xf', component: 'Input', + dynamicRules: ({model,schema}) => { + return [ + { required: true, message: '请输入学分!'}, + ]; + }, + }, + { + label: '是否出镜,0-出镜,1-不出镜', + field: 'sfcj', + component: 'InputNumber', + }, + { + label: '上课形式,0-线上,1-线下,2-线上线下混合', + field: 'skxs', + component: 'InputNumber', }, // TODO 主键隐藏字段,目前写死为ID { diff --git a/src/views/kc/ktgl/KcKechengbiaoList.vue b/src/views/kc/ktgl/KcKechengbiaoList.vue index 3d37640..9cd6147 100644 --- a/src/views/kc/ktgl/KcKechengbiaoList.vue +++ b/src/views/kc/ktgl/KcKechengbiaoList.vue @@ -4,15 +4,60 @@
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 查询 + 重置 + + + +
- + + + @@ -54,35 +103,47 @@ import { ref, reactive } from 'vue'; import { BasicTable, useTable, TableAction } from '/@/components/Table'; import { useListPage } from '/@/hooks/system/useListPage'; + import { useMessage } from '/@/hooks/web/useMessage'; import { columns } from './KcKechengbiao.data'; - import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './KcKechengbiao.api'; + import { list, deleteOne, batchDelete, getImportUrl, getExportUrl, saveOrUpdate } from './KcKechengbiao.api'; import { downloadFile } from '/@/utils/common/renderUtils'; import KcKechengbiaoModal from './components/KcKechengbiaoModal.vue' + import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue'; + import KcKetangbiaoList from './KcKetangbiaoList.vue' - const queryParam = ref({}); + const queryParam = ref({ }); + const filterInfo = ref({ xnxq: '2022-2023-2' }); + //kkdwid, week, hh, kcbh const toggleSearchStatus = ref(false); const registerModal = ref(); //注册table数据 const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({ tableProps: { - title: '课程管理', + title: '课程管理-主表', api: list, columns, canResize:false, useSearchForm: false, + showIndexColumn: true, + showActionColumn: false, + clickToRowSelect: true, + rowSelection: { + type: 'radio' + }, + pagination: { + pageSize: 5 + }, actionColumn: { width: 120, fixed: 'right', }, beforeFetch: (params) => { params.column = '',params.order = '';//新生成的默认不带排序 - return Object.assign(params, queryParam.value); + return Object.assign(params, { ...queryParam.value, ...filterInfo.value}); }, - showActionColumn: false, - pagination: false, }, exportConfig: { - name: "课程管理", + name: "课程管理-主表", url: getExportUrl, }, importConfig: { @@ -90,7 +151,7 @@ success: handleSuccess }, }); - const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys }] = tableContext; + const [registerTable, { reload, collapseAll, updateTableDataRecord, findTableDataRecord, getDataSource }, { rowSelection, selectedRowKeys, selectedRows }] = tableContext; const labelCol = reactive({ xs: { span: 24 }, sm: { span: 7 }, @@ -100,6 +161,8 @@ sm: { span: 16 }, }); + const { createMessage } = useMessage(); + /** * 新增事件 */ @@ -193,6 +256,92 @@ } + function handleEditEnd({ record, index, key, value }: Recordable) { + console.log(record, index, key, value); + return false; + } + + // 模拟将指定数据保存 + function feakSave({ value, key, id }) { + createMessage.loading({ + content: `正在保存!`, + key: '_save_fake_data', + duration: 0, + }); + const params = { + id, + }; + params[key] = value; + return new Promise((resolve) => { + saveOrUpdate(params ,true).then(res => { + if (res.success) { + createMessage.success({ + content: `记录已保存`, + key: '_save_fake_data', + duration: 2, + }); + resolve(true); + } else { + createMessage.error({ + content: `保存失败:${res.message}`, + key: '_save_fake_data', + duration: 2, + }); + resolve(false); + } + }); + }); + } + + async function beforeEditSubmit({ record, index, key, value }) { + console.log('单元格数据正在准备提交', { record, index, key, value }); + return await feakSave({ id: record.id, key, value }); + } + + function handleEditCancel() { + console.log('cancel'); + } + + + // function handleEditEnd({ record, index, key, value }: Recordable) { + // console.log(record, index, key, value); + // return false; + // } + + // async function beforeEditSubmit({ record, index, key, value }) { + // console.log('编辑后回调', record, index, key, value ); + // createMessage.loading({ + // content: `正在模拟保存${key}`, + // key: '_save_fake_data', + // duration: 0, + // }); + // return await new Promise((resolve) => { + // setTimeout(() => { + // if (value === '') { + // createMessage.error({ + // content: '保存失败:不能为空', + // key: '_save_fake_data', + // duration: 2, + // }); + // resolve(false); + // } else { + // createMessage.success({ + // content: `记录的${key}已保存`, + // key: '_save_fake_data', + // duration: 2, + // }); + // resolve(true); + // } + // }, 2000); + // }); + // } + + // function handleEditCancel() { + // console.log('cancel'); + // } + + + diff --git a/src/views/kc/ktgl/KcKetangbiao.api.ts b/src/views/kc/ktgl/KcKetangbiao.api.ts index 4a7a9bb..9365570 100644 --- a/src/views/kc/ktgl/KcKetangbiao.api.ts +++ b/src/views/kc/ktgl/KcKetangbiao.api.ts @@ -67,6 +67,6 @@ export const batchDelete = (params, handleSuccess) => { * @param isUpdate */ export const saveOrUpdate = (params, isUpdate) => { - const url = isUpdate ? Api.edit : Api.save; + let url = isUpdate ? Api.edit : Api.save; return defHttp.post({ url: url, params }, { isTransformResponse: false }); } diff --git a/src/views/kc/ktgl/KcKetangbiao.data.ts b/src/views/kc/ktgl/KcKetangbiao.data.ts index f8390da..2cf55ed 100644 --- a/src/views/kc/ktgl/KcKetangbiao.data.ts +++ b/src/views/kc/ktgl/KcKetangbiao.data.ts @@ -4,40 +4,20 @@ import { rules} from '/@/utils/helper/validator'; import { render } from '/@/utils/common/renderUtils'; //列表数据 export const columns: BasicColumn[] = [ - { - title: '课程编号', - align: "center", - dataIndex: 'kcbh' - }, { title: '课程名称', align: "center", dataIndex: 'kcmc' }, - { - title: '学分', - align: "center", - dataIndex: 'xf' - }, { title: '授课教师', align: "center", dataIndex: 'skjs' }, { - title: '选课人数', + title: '上课时间', align: "center", - dataIndex: 'xkrs' - }, - { - title: '开课单位', - align: "center", - dataIndex: 'kkdw_dictText' - }, - { - title: '课程性质', - align: "center", - dataIndex: 'kcxz_dictText' + dataIndex: 'sksj' }, { title: '节次', @@ -49,6 +29,26 @@ export const columns: BasicColumn[] = [ align: "center", dataIndex: 'week_dictText' }, + { + title: '直播方式', + align: "center", + dataIndex: 'zbfs_dictText' + }, + { + title: '会议号', + align: "center", + dataIndex: 'hyh' + }, + { + title: '会议密码', + align: "center", + dataIndex: 'hymm' + }, + { + title: '课程链接', + align: "center", + dataIndex: 'kclj' + }, { title: '开课周次', align: "center", @@ -58,29 +58,6 @@ export const columns: BasicColumn[] = [ //查询数据 export const searchFormSchema: FormSchema[] = [ - { - label: "课程名称", - field: 'kcmc', - component: 'Input', - colProps: {span: 6}, - }, - { - label: "开课单位", - field: 'kkdw', - component: 'JDictSelectTag', - componentProps:{ - }, - colProps: {span: 6}, - }, - { - label: "课程性质", - field: 'kcxz', - component: 'JDictSelectTag', - componentProps:{ - dictCode: "kcxz" - }, - colProps: {span: 6}, - }, { label: "节次", field: 'hh', @@ -103,17 +80,6 @@ export const searchFormSchema: FormSchema[] = [ //表单数据 export const formSchema: FormSchema[] = [ - { - label: '课程编号', - field: 'kcbh', - component: 'Input', - dynamicRules: ({model,schema}) => { - return [ - { required: true, message: '请输入课程编号!'}, - {...rules.duplicateCheckRule('kc_ketangbiao', 'kcbh',model,schema)[0]}, - ]; - }, - }, { label: '课程名称', field: 'kcmc', @@ -124,16 +90,6 @@ export const formSchema: FormSchema[] = [ ]; }, }, - { - label: '学分', - field: 'xf', - component: 'Input', - dynamicRules: ({model,schema}) => { - return [ - { required: true, message: '请输入学分!'}, - ]; - }, - }, { label: '授课教师', field: 'skjs', @@ -145,40 +101,9 @@ export const formSchema: FormSchema[] = [ }, }, { - label: '选课人数', - field: 'xkrs', + label: '上课时间', + field: 'sksj', component: 'Input', - dynamicRules: ({model,schema}) => { - return [ - { required: true, message: '请输入选课人数!'}, - ]; - }, - }, - { - label: '开课单位', - field: 'kkdw', - component: 'JDictSelectTag', - componentProps:{ - dictCode: "" - }, - dynamicRules: ({model,schema}) => { - return [ - { required: true, message: '请输入开课单位!'}, - ]; - }, - }, - { - label: '课程性质', - field: 'kcxz', - component: 'JDictSelectTag', - componentProps:{ - dictCode: "kcxz" - }, - dynamicRules: ({model,schema}) => { - return [ - { required: true, message: '请输入课程性质!'}, - ]; - }, }, { label: '节次', diff --git a/src/views/kc/ktgl/KcKetangbiaoList.vue b/src/views/kc/ktgl/KcKetangbiaoList.vue index 98d123b..f08e5fe 100644 --- a/src/views/kc/ktgl/KcKetangbiaoList.vue +++ b/src/views/kc/ktgl/KcKetangbiaoList.vue @@ -4,22 +4,7 @@
- - - - - - - - - - - - - - - - + + --> - 查询 - 重置 - + + --> @@ -51,6 +34,8 @@ + + + - -
diff --git a/src/views/site/index.vue b/src/views/site/index.vue index bac8d7b..2ce24c5 100644 --- a/src/views/site/index.vue +++ b/src/views/site/index.vue @@ -127,7 +127,7 @@ line-height: 120px; background: #FFF } -}s +} /**暗黑模式特殊配色*/ [data-theme='dark'] #siteMain { .ant-layout-header, .ant-layout-footer {