修改bug
This commit is contained in:
parent
0a662e42cb
commit
2e91c1599a
|
@ -19,10 +19,10 @@ VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE = false
|
|||
VITE_GLOB_API_URL=/jeecg-boot
|
||||
|
||||
#后台接口全路径地址(必填)
|
||||
VITE_GLOB_DOMAIN_URL=http://bylwcs.nenu.edu.cn/jeecg-boot
|
||||
VITE_GLOB_DOMAIN_URL=https://zxkccx.webvpn.nenu.edu.cn/jeecg-boot
|
||||
|
||||
#RTC服务器地址
|
||||
VITE_GLOB_RTC_SERVER = http://bylwcs.nenu.edu.cn:8081
|
||||
VITE_GLOB_RTC_SERVER = https://zxkccx.webvpn.nenu.edu.cn:8081
|
||||
|
||||
# 接口父路径前缀
|
||||
VITE_GLOB_API_URL_PREFIX=
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
import { defHttp } from '/@/utils/http/axios';
|
||||
import { useMessage } from "/@/hooks/web/useMessage";
|
||||
|
||||
const { createConfirm } = useMessage();
|
||||
|
||||
enum Api {
|
||||
list = '/kcGongkaikelog/kcGongkaikelog/list',
|
||||
save='/kcGongkaikelog/kcGongkaikelog/add',
|
||||
edit='/kcGongkaikelog/kcGongkaikelog/edit',
|
||||
deleteOne = '/kcGongkaikelog/kcGongkaikelog/delete',
|
||||
deleteBatch = '/kcGongkaikelog/kcGongkaikelog/deleteBatch',
|
||||
importExcel = '/kcGongkaikelog/kcGongkaikelog/importExcel',
|
||||
exportXls = '/kcGongkaikelog/kcGongkaikelog/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,82 @@
|
|||
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: 'usercode'
|
||||
},
|
||||
{
|
||||
title: '用户名',
|
||||
align: "center",
|
||||
dataIndex: 'username'
|
||||
},
|
||||
{
|
||||
title: '时间',
|
||||
align: "center",
|
||||
dataIndex: 'shijian'
|
||||
},
|
||||
{
|
||||
title: '公开课id',
|
||||
align: "center",
|
||||
dataIndex: 'gkkid'
|
||||
},
|
||||
];
|
||||
|
||||
//查询数据
|
||||
export const searchFormSchema: FormSchema[] = [
|
||||
];
|
||||
|
||||
//表单数据
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
label: '账号',
|
||||
field: 'usercode',
|
||||
component: 'Input',
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入账号!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '用户名',
|
||||
field: 'username',
|
||||
component: 'Input',
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入用户名!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '时间',
|
||||
field: 'shijian',
|
||||
component: 'Input',
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入时间!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '公开课id',
|
||||
field: 'gkkid',
|
||||
component: 'Input',
|
||||
dynamicRules: ({model,schema}) => {
|
||||
return [
|
||||
{ required: true, message: '请输入公开课id!'},
|
||||
];
|
||||
},
|
||||
},
|
||||
// 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>
|
||||
<!-- 表单区域 -->
|
||||
<KcGongkaikelogModal ref="registerModal" @success="handleSuccess"></KcGongkaikelogModal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" name="kcGongkaikelog-kcGongkaikelog" setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { BasicTable, useTable, TableAction } from '/@/components/Table';
|
||||
import { useListPage } from '/@/hooks/system/useListPage';
|
||||
import { columns } from './KcGongkaikelog.data';
|
||||
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './KcGongkaikelog.api';
|
||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||
import KcGongkaikelogModal from './components/KcGongkaikelogModal.vue'
|
||||
|
||||
const queryParam = ref<any>({});
|
||||
const toggleSearchStatus = ref<boolean>(false);
|
||||
const registerModal = ref();
|
||||
//注册table数据
|
||||
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
|
||||
tableProps: {
|
||||
title: 'kc_gongkaikelog',
|
||||
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_gongkaikelog",
|
||||
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,149 @@
|
|||
<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.usercode">
|
||||
<a-input v-model:value="formData.usercode" placeholder="请输入账号" :disabled="disabled"></a-input>
|
||||
</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.shijian">
|
||||
<a-input v-model:value="formData.shijian" placeholder="请输入时间" :disabled="disabled"></a-input>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="24">
|
||||
<a-form-item label="公开课id" v-bind="validateInfos.gkkid">
|
||||
<a-input v-model:value="formData.gkkid" placeholder="请输入公开课id" :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 { getValueType } from '/@/utils';
|
||||
import { saveOrUpdate } from '../KcGongkaikelog.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: '',
|
||||
usercode: '',
|
||||
username: '',
|
||||
shijian: '',
|
||||
gkkid: '',
|
||||
});
|
||||
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 = {
|
||||
usercode: [{ required: true, message: '请输入账号!'},],
|
||||
username: [{ required: true, message: '请输入用户名!'},],
|
||||
shijian: [{ required: true, message: '请输入时间!'},],
|
||||
gkkid: [{ required: true, message: '请输入公开课id!'},],
|
||||
};
|
||||
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="关闭">
|
||||
<KcGongkaikelogForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></KcGongkaikelogForm>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, nextTick, defineExpose } from 'vue';
|
||||
import KcGongkaikelogForm from './KcGongkaikelogForm.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>
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div id="siteMain">
|
||||
<div id="maxSite">
|
||||
<div id="maxSite" :style="maxClassName">
|
||||
<a-layout>
|
||||
<!-- 页头 -->
|
||||
<headerPage showRightButton/>
|
||||
|
@ -63,7 +63,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { ref, onMounted } from 'vue';
|
||||
|
||||
import headerPage from '/@/views/site/common/header.vue';
|
||||
import footerPage from '/@/views/site/common/footer.vue';
|
||||
|
@ -94,6 +94,38 @@
|
|||
const xyjkModeal = ref();
|
||||
const rkbModeal = ref();
|
||||
const yykcModeal = ref();
|
||||
const maxClassName = ref<any>({});
|
||||
|
||||
// 实时计算浏览器的宽度
|
||||
window.onresize = () => {
|
||||
return (() => {
|
||||
let fullWidth = document.documentElement.clientWidth;
|
||||
let width = fullWidth; // 宽
|
||||
if(width<600){
|
||||
maxClassName.value = {width:"100%"}
|
||||
}else if(width>=500&&width<1370){
|
||||
width = width-300
|
||||
maxClassName.value = {width:width+"px"}
|
||||
}else{
|
||||
width = 1370
|
||||
maxClassName.value = {width:width+"px"}
|
||||
}
|
||||
})()
|
||||
};
|
||||
|
||||
//进入就加载
|
||||
onMounted(() => {
|
||||
var width = window.screen.width * window.devicePixelRatio;
|
||||
console.log(`🚀 ~ file: index.vue:104 ~ onMounted ~ width:`, width)
|
||||
if(width<1370){
|
||||
width = width-200
|
||||
maxClassName.value = {width:width+"px"}
|
||||
}else{
|
||||
width = 1370
|
||||
maxClassName.value = {width:width+"px"}
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
/**
|
||||
* 刷新预约课程列表数据
|
||||
|
@ -131,7 +163,7 @@
|
|||
background: #f3f3f4;
|
||||
#maxSite {
|
||||
//最大宽度
|
||||
max-width: 1170px;
|
||||
// max-width: 1170px;
|
||||
//居中
|
||||
margin: 0 auto;
|
||||
.rowGutter{
|
||||
|
|
|
@ -12,27 +12,29 @@
|
|||
</div>
|
||||
<div>
|
||||
<a href="javascript:void(0)" @click="funGkk(item.jslj)">
|
||||
<div>
|
||||
<span style="position: absolute;top: 4rem;border-radius: 0 10px 10px 0;background: #1ab394;color: #FFF;padding: 3px 10px 3px 5px;z-index: 2;" v-if="item.dqztpx == 1">{{item.dqzt}}</span>
|
||||
<span style="position: absolute;top: 4rem;border-radius: 0 10px 10px 0;background: #1c84c6;color: #FFF;padding: 3px 10px 3px 5px;z-index: 2;" v-if="item.dqztpx == 2">{{item.dqzt}}</span>
|
||||
<span style="position: absolute;top: 4rem;border-radius: 0 10px 10px 0;background-color: rgba(0,0,0,0.46);color: #FFF;padding: 3px 10px 3px 5px;z-index: 2;" v-if="item.dqztpx == 3">{{item.dqzt}}</span>
|
||||
<div>
|
||||
<img style="border-radius: 10px 10px 0 0;margin-bottom: 8px;" :class="classFun(index)" @error="imgOnError($event)" :src="getFileAccessHttpUrl(item.tpmc)" height="170px"/>
|
||||
<!-- <img style="border-radius: 10px 10px 0 0;margin-bottom: 8px;" :class="classFun(index)" v-if="!item.tpmc" src="/resource/img/kc/moren.png" height="170px"/> -->
|
||||
<!-- <AImage style="border-radius: 10px 10px 0 0;" :class="classFun(index)" :onerror="'/resource/img/kc/moren.png'" :src="getFileAccessHttpUrl(item.tpmc)" :preview="false" :width="'100%'" height="170px"/> -->
|
||||
</div>
|
||||
<span style="position: absolute;top: 4rem;border-radius: 0 10px 10px 0;background: #1ab394;color: #FFF;padding: 3px 10px 3px 5px;z-index: 2;" v-if="item.dqztpx == 1">{{item.dqzt}}</span>
|
||||
<span style="position: absolute;top: 4rem;border-radius: 0 10px 10px 0;background: #1c84c6;color: #FFF;padding: 3px 10px 3px 5px;z-index: 2;" v-if="item.dqztpx == 2">{{item.dqzt}}</span>
|
||||
<span style="position: absolute;top: 4rem;border-radius: 0 10px 10px 0;background-color: rgba(0,0,0,0.46);color: #FFF;padding: 3px 10px 3px 5px;z-index: 2;" v-if="item.dqztpx == 3">{{item.dqzt}}</span>
|
||||
<div>
|
||||
<img style="border-radius: 10px 10px 0 0;margin-bottom: 8px;" :class="classFun(index)" @error="imgOnError($event)" :src="getFileAccessHttpUrl(item.tpmc)" height="170px"/>
|
||||
<!-- <img style="border-radius: 10px 10px 0 0;margin-bottom: 8px;" :class="classFun(index)" v-if="!item.tpmc" src="/resource/img/kc/moren.png" height="170px"/> -->
|
||||
<!-- <AImage style="border-radius: 10px 10px 0 0;" :class="classFun(index)" :onerror="'/resource/img/kc/moren.png'" :src="getFileAccessHttpUrl(item.tpmc)" :preview="false" :width="'100%'" height="170px"/> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
<div style="padding: 10px 1rem 1rem;background: #f3f3f3;">
|
||||
<a href="javascript:void(0)" @click="funGkk(item.jslj)">
|
||||
<div class="ggkTitle ggkCcxs" :title="item.hxr +`·`+item.hxrlb">{{item.hxr}} · {{item.hxrlb}}</div>
|
||||
<div class="ggkTwoTitle ggkCcxs" :title="item.zc +`·`+item.xy">{{item.zc}} {{item.xy}}</div>
|
||||
<div class="ggkThreeTitle ggkCcxs">{{item.ktzt}}</div>
|
||||
<div class="ggkFourTitle">0人听课</div>
|
||||
<div class="ggkFourTitle">{{item.logcount}}人听课</div>
|
||||
</a>
|
||||
<!-- -{{ item.kclj }}--{{ item.jslj }} -->
|
||||
<div v-if="item.type=='1'"><a-button type="primary" class="ggkButton" target="_blank" :href="item.kclj" @click.stop>进入课堂</a-button></div>
|
||||
<div v-if="item.type=='1'"><a-button type="primary" class="ggkButton" target="_blank" :href="item.kclj" @click="jrkt(item)">进入课堂</a-button></div>
|
||||
<div v-else><a-button type="primary" class="ggkButton" target="_blank" disabled :href="item.kclj" @click="false" style="background-color: rgb(197, 192, 192);">进入课堂</a-button></div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="25" style="line-height: 50px;">
|
||||
|
@ -58,6 +60,8 @@ import { dateFormat } from '/@/utils/common/compUtils';
|
|||
import { Image as AImage } from 'ant-design-vue';
|
||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||
import { useMessage } from '/@/hooks/web/useMessage';
|
||||
import { useUserStore } from '/@/store/modules/user';
|
||||
const userStore = useUserStore();
|
||||
let listData = ref<any>([]);
|
||||
const list = (params) => defHttp.get({ url: '/kcGongkaike/kcGongkaike/getIndexList', params });
|
||||
|
||||
|
@ -65,6 +69,16 @@ const { createMessage } = useMessage();
|
|||
const queryParam = ref<any>({});
|
||||
let pageNo = 1
|
||||
let current = 0
|
||||
|
||||
enum Api {
|
||||
list = '/kcGongkaikelog/kcGongkaikelog/list',
|
||||
save='/kcGongkaikelog/kcGongkaikelog/add',
|
||||
edit='/kcGongkaikelog/kcGongkaikelog/edit',
|
||||
deleteOne = '/kcGongkaikelog/kcGongkaikelog/delete',
|
||||
deleteBatch = '/kcGongkaikelog/kcGongkaikelog/deleteBatch',
|
||||
importExcel = '/kcGongkaikelog/kcGongkaikelog/importExcel',
|
||||
exportXls = '/kcGongkaikelog/kcGongkaikelog/exportXls',
|
||||
}
|
||||
/**
|
||||
* 公开课点击教师链接
|
||||
* @param jslj 教师链接
|
||||
|
@ -76,7 +90,6 @@ function funGkk(jslj){
|
|||
}
|
||||
|
||||
function imgOnError(event){
|
||||
console.log(`🚀 ~ file: index.vue:78 ~ imgOnError ~ event:`, event)
|
||||
let img = event.srcElement; //已经弃用
|
||||
img.src = '/resource/img/kc/moren.png'; //data中的图片
|
||||
img.onerror = null; //防止闪图,写了但是还是会疯狂回调onerror的注册事件
|
||||
|
@ -92,7 +105,15 @@ function classFun(index){
|
|||
}
|
||||
return stylecss;
|
||||
}
|
||||
|
||||
function jrkt(item){
|
||||
const format = 'yyyy-MM-dd hh:mm:ss';
|
||||
var par = {usercode:userStore?.getUserInfo?.username,username:userStore?.getUserInfo?.realname,shijian: dateFormat(new Date(), format),gkkid:item.id}
|
||||
saveOrUpdate(par, false) .then((res) => { })
|
||||
}
|
||||
const saveOrUpdate = (params, isUpdate) => {
|
||||
let url = isUpdate ? Api.edit : Api.save;
|
||||
return defHttp.post({ url: url, params }, { isTransformResponse: false });
|
||||
}
|
||||
/**
|
||||
* 公开课收起
|
||||
*/
|
||||
|
|
|
@ -158,13 +158,6 @@ function isNow(item){
|
|||
|
||||
|
||||
if(jssj.unix() < dqsj.unix()){
|
||||
console.log(`🚀 -------------------------------------------------🚀`);
|
||||
console.log(`🚀 ~ file: kclbList.vue:149 ~ isNow ~ jssj:`, jssj,item,item.skrq,item.jssj,dayjs);
|
||||
console.log(`🚀 -------------------------------------------------🚀`);
|
||||
|
||||
console.log(`🚀 -------------------------------------------------🚀`);
|
||||
console.log(`🚀 ~ file: kclbList.vue:155 ~ isNow ~ dqsj:`, dqsj, jssj<dqsj);
|
||||
console.log(`🚀 -------------------------------------------------🚀`);
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
|
|
|
@ -16,14 +16,11 @@ export const projectName = import.meta.env.VITE_GLOB_APP_TITLE;
|
|||
export const isOpenSSO = import.meta.env.VITE_GLOB_APP_OPEN_SSO == 'true'?true:false;
|
||||
|
||||
export const getUserId = () => {
|
||||
console.log(`🚀 ~ file: index.ts:17 ~ getUserId ~ isOpenSSO:`, isOpenSSO)
|
||||
if(isOpenSSO){
|
||||
console.log(`🚀 ~ file: index.ts:17 ~ getUserId ~ userInfo:`, isOpenSSO)
|
||||
const { userInfo } = useUserStore();
|
||||
//正常取用户
|
||||
return userInfo?.username;
|
||||
}else{
|
||||
console.log(`🚀 ~ file: index.ts:17 ~ getUserId ~ isOpenSSO2:`, isOpenSSO,getUserInfo())
|
||||
//固定某值
|
||||
return '2016900057';//教师//2016900057//2002900176//2001900153
|
||||
// return '2022010920';//学生
|
||||
|
|
Loading…
Reference in New Issue