修改样式

This commit is contained in:
yangjun 2024-09-02 08:38:15 +08:00
parent f456795b3c
commit e47dd2c79e
3 changed files with 448 additions and 70 deletions

View File

@ -156,19 +156,6 @@
>
<a-button type="primary" class="bcClass" @click="funpingjia(item)" v-else style="color: white">评价</a-button>
</span>
<span style="margin-left: 10px;">
<a-button type="primary" class="yyyClass" disabled v-if="item.sfyy == 1 && item.isdeleted == 0">已预约</a-button>
<a-button
type="primary"
class="yyClass"
@click="funYuyue(item)"
v-if="item.sfyy == 0 || (item.sfyy == 1 && item.isdeleted == 1)"
:disabled="item.sftkb == '1'"
style="color: white"
>预约</a-button
>
</span>
</div>
<!-- <a-col :span="24"> -->
<!-- <a-button type="primary" class="bcClass" @click="handleBaocuo(item)">报错</a-button> -->
@ -177,18 +164,6 @@
</div>
</div>
</a-col>
<a-col :span="24" style="line-height: 50px">
<div v-show="1 == pageNo && current > 0 && total > 4">
<div style="text-align: center"><a @click="funMore">更多...</a></div>
</div>
<div v-show="current == 0">
<div style="text-align: center"><a @click="funMore">暂无课堂</a></div>
</div>
<div v-show="1 < pageNo && pageNo < current">
<div style="text-align: center"><a @click="funMore">更多...</a></div>
<div style="text-align: right; margin-top: -51px"><a @click="funShouqi">收起</a></div>
</div>
</a-col>
</a-row>
<!-- 报错列表 -->
<KcErrorreportIndexModal ref="kcErrorreportIndexModal"></KcErrorreportIndexModal>
@ -215,11 +190,6 @@ const kcErrorreportIndexModal = ref();
const tingKeZuJiAddModal = ref();
const route = useRouter();
const pageNo = ref<number>(1);
const pageSize = ref<number>(1);
const current = ref<number>(0);
const total = ref<number>(0);
const emit = defineEmits(['setTotal']);
const { createMessage } = useMessage();
@ -251,37 +221,29 @@ function rkbLoadData() {
var newRow = ref<any>({});
newRow = props.queryParam;
newRow.userid = getUserId();
if (!props.queryParam.pageSize) {
// if (!props.queryParam.pageSize) {
// newRow.pageSize = -1;
// // }else{
// // newRow.pageSize = 20
// }
newRow.pageSize = -1;
} else {
newRow.pageNo = pageNo.value;
newRow.pageSize = 20;
}
if(pageNo.value == 0){
pageNo.value = 1;
}
newRow.sftkb = '1';
console.log(`🚀 ~ file: kclbList.vue:109 ~ rkbLoadData ~ newRow:`, newRow);
if (newRow.hh != ',') {
// listType.value = newRow.type
// console.log(`🚀 ~ file: kclbList.vue:111 ~ rkbLoadData ~ listType:`, listType)
list(newRow).then((res) => {
console.log('🙅‍♀️', res);
// listData.value = res.records;
listData.value.push(...res.records)
console.log('🧢', res);
listData.value = res.records;
var bxqkssj = new Date(getSysConfig().bxqkssj);
var bxqjssj = new Date(getSysConfig().bxqjssj);
var nowDate = new Date();
if (bxqkssj.getTime() > nowDate.getTime() && bxqjssj.getTime() < nowDate.getTime()) {
if (bxqkssj.getTime() > nowDate.getTime() || bxqjssj.getTime() < nowDate.getTime()) {
pjDisabled.value = true;
console.log(`🚀 ~ file: kclbList.vue:148 ~ rkbLoadData ~ pjDisabled:`, pjDisabled);
}
// current.value = res.current;
// total.value = res.total;
current.value = res.pages
total.value = res.total
emit('setTotal', res.total);
emit('setTotal', res.records.length);
});
}
}
@ -305,6 +267,11 @@ async function funYuyue(record) {
zbpx: record.zbpx,
link: '',
isdeleted: 0,
kcmc:record.kcmc,
rwbh:record.rwbh,
xqxn:record.xnxq,
skjs:record.skjs,
};
const isUpdate = ref<boolean>(false);
await saveOrUpdate(params, isUpdate.value)
@ -322,26 +289,6 @@ async function funYuyue(record) {
});
}
/**
* 收起
*/
function funShouqi() {
listData.value = [];
pageNo.value = 1;
rkbLoadData();
}
/**
* 加载更多
*/
function funMore() {
console.log(`🚀 ~ file: index.vue:83 ~ funMore ~ current>pageNo:`, current, pageNo);
if (current.value > pageNo.value) {
pageNo.value++;
rkbLoadData();
} else {
createMessage.error('没有更多数据了!');
}
}
function isNow(item) {
const jssj = dayjs(item.skrq + ' ' + item.jssj, 'YYYY-MM-DD hh:mm:ss');

View File

@ -0,0 +1,428 @@
<template>
<div>
<a-row class="rowGutter" :gutter="[16, 16]">
<a-col :xs="{ span: 24 }" :sm="{ span: 8 }" :lg="{ span: 6 }" v-for="(item, index) in listData" :key="index" style="margin-bottom: 40px">
<div style="border: 2px #eef1f2 solid">
<div>
<div style="width: 100%; height: 20px; background-color: #1c84c6"></div>
<div
style="
width: 100%;
white-space: normal;
word-break: break-all;
overflow: hidden;
padding: 10px;
height: 70px;
font-weight: 600;
font-size: 16px;
"
>
{{ item.kcmc }} <span v-if="item.szkc == '1'" title="思政课程"></span>
</div>
</div>
<a-divider style="margin: 0px; color: #eef1f2" />
<div style="padding: 20px; font-weight: 600">
<a-row>
<a-col :span="16">
<div style="height: 38px; font-size: 16px; font-weight: 700">{{ item.skjs }}</div>
<div style="font-size: 14px; font-weight: 700; height: 50px">{{ 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>
<div style="font-size: 14px; font-weight: 700">选课人数</div>
</a-col>
<a-col :span="24" style="margin-top: 0px; font-weight: 700">
<div>
<span>{{ item.hh }}</span
>
</div>
</a-col>
<a-col :span="24">
<div style="width: 100%; text-align: center; font-weight: 700"> 线下上课地点 </div>
</a-col>
<a-col :span="24">
<div style="height: 50px; font-weight: 700">
{{ item.skdd }}
</div>
</a-col>
<a-col :span="24" v-if="listType == 1 || listType == '1'">
<a-row style="text-align: center" v-if="getSysConfig().flag9 == '1'">
<a-col :span="12">
<a-button
type="primary"
:class="handleZhjs(item.sfyzhjs)"
@click="toLivePage(item)"
:disabled="item.sfyzhjs == '0'"
v-if="item.sftkb != '1'"
style="color: white"
>听课</a-button
>
<a-button
type="primary"
class="yyyClass"
@click="toLivePage(item)"
:disabled="true"
v-else
style="color: white"
:title="`停课事由:` + item.tksy"
>停课</a-button
>
</a-col>
<a-col :span="12" v-if="item.sftkb == '1'">
<a-button
type="primary"
class="bcClass"
@click="funpingjia(item)"
:disabled="true"
style="color: white"
:title="`停课事由:` + item.tksy"
>评价</a-button
>
</a-col>
<a-col :span="12" v-else>
<a-button type="primary" class="bcClass" @click="funpingjia(item)" style="color: white">评价</a-button>
</a-col>
<!-- <a-col :span="8">
<a-button type="primary" class="bcClass" @click="handleBaocuo(item)">报错</a-button>
</a-col> -->
</a-row>
<a-row style="text-align: center" v-else>
<a-col :span="24" v-if="item.sftkb == '1'">
<a-button
type="primary"
class="bcClass"
@click="funpingjia(item)"
:disabled="true"
style="color: white"
:title="`停课事由:` + item.tksy"
>评价</a-button
>
</a-col>
<a-col :span="24" v-else>
<a-button type="primary" class="bcClass" @click="funpingjia(item)" style="color: white">评价</a-button>
</a-col>
</a-row>
</a-col>
<!-- <a-col :span="24" style="text-align: center;"> -->
<a-col :span="24" v-else style="text-align: center">
<div v-show="!isNow(item)">
<span v-if="props.type == 'zzsk'">
<!-- 正在上课的就给个评价 -->
<!-- <a-button type="primary" class="bcClass" @click="funpingjia(item)" >评价</a-button> -->
<span v-if="pjDisabled">
<a-button type="primary" class="bcClass" @click="funpingjia(item)" style="background-color: #dfdfdf" disabled>评价</a-button>
</span>
<span v-else>
<a-button
type="primary"
class="bcClass"
@click="funpingjia(item)"
v-if="item.sftkb == '1'"
style="color: white"
:disabled="true"
:title="`停课事由:` + item.tksy"
>评价</a-button
>
<a-button type="primary" class="bcClass" @click="funpingjia(item)" v-else style="color: white">评价</a-button>
</span>
</span>
<span v-else>
<a-button type="primary" class="yyyClass" disabled v-if="item.sfyy == 1 && item.isdeleted == 0">已预约</a-button>
<a-button
type="primary"
class="yyClass"
@click="funYuyue(item)"
v-if="item.sfyy == 0 || (item.sfyy == 1 && item.isdeleted == 1)"
:disabled="item.sftkb == '1'"
style="color: white"
>预约</a-button
>
</span>
</div>
<div v-show="isNow(item)">
<span v-if="pjDisabled">
<a-button type="primary" class="bcClass" @click="funpingjia(item)" style="background-color: #dfdfdf" disabled>评价</a-button>
</span>
<span v-else>
<a-button
type="primary"
class="bcClass"
@click="funpingjia(item)"
v-if="item.sftkb == '1'"
:disabled="true"
style="color: white"
:title="`停课事由:` + item.tksy"
>评价</a-button
>
<a-button type="primary" class="bcClass" @click="funpingjia(item)" v-else style="color: white">评价</a-button>
</span>
</div>
<!-- <a-col :span="24"> -->
<!-- <a-button type="primary" class="bcClass" @click="handleBaocuo(item)">报错</a-button> -->
</a-col>
</a-row>
</div>
</div>
</a-col>
<a-col :span="24" style="line-height: 50px">
<div v-show="1 == pageNo && current > 0 && total > 20">
<div style="text-align: center"><a @click="funMore">更多...</a></div>
</div>
<div v-show="current == 0">
<div style="text-align: center"><a @click="funMore">暂无课堂</a></div>
</div>
<div v-show="1 < pageNo && pageNo < current">
<div style="text-align: center"><a @click="funMore">更多...</a></div>
<!-- <div style="text-align: right; margin-top: -51px"><a @click="funShouqi">收起</a></div> -->
</div>
</a-col>
</a-row>
<!-- 报错列表 -->
<KcErrorreportIndexModal ref="kcErrorreportIndexModal"></KcErrorreportIndexModal>
<addModalPage ref="tingKeZuJiAddModal" />
</div>
</template>
<script lang="ts" setup>
import { ref, watch, reactive, defineExpose, createVNode, h } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import KcErrorreportIndexModal from '/@/views/kc/kcErrorreport/components/KcErrorreportIndexModal.vue';
import { getUserId, addTingKeLog, getSysConfig } from '/@/views/site/utils/index';
import addModalPage from '/@/views/site/tingKeZuJi/components/addModal.vue';
import { useRouter } from 'vue-router';
import dayjs from 'dayjs';
import { Modal } from 'ant-design-vue';
import { CloseOutlined } from '@ant-design/icons-vue';
//
import { useUserStore } from '/@/store/modules/user';
const userStore = useUserStore();
const kcErrorreportIndexModal = ref();
const tingKeZuJiAddModal = ref();
const route = useRouter();
const emit = defineEmits(['setTotal']);
const { createMessage } = useMessage();
const confirmLoading = ref<boolean>(false);
const pjDisabled = ref<boolean>(false);
const pageNo = ref<number>(1);
const pageSize = ref<number>(1);
const current = ref<number>(0);
const total = ref<number>(0);
let listData = ref<any>([]);
let listType = ref<any>(String);
const list = (params) => defHttp.get({ url: '/ktgl/kcKetangbiao/getKclblist', params });
const listTkjlApi = (params) => defHttp.get({ url: '/kcTingke/kcTingke/findTingKeZuJiBytingketimeAndUserId', params });
const props = defineProps({
queryParam: { type: Object },
type: { type: String },
});
/**
* 收起
*/
function funShouqi() {
listData.value = [];
pageNo.value = 1;
rkbLoadData();
}
/**
* 加载更多
*/
function funMore() {
console.log(`🚀 ~ file: index.vue:83 ~ funMore ~ current>pageNo:`, current, pageNo.value);
if (current.value > pageNo.value) {
pageNo.value++;
rkbLoadData();
} else {
createMessage.error('没有更多数据了!');
}
}
//
watch(
() => props.queryParam,
async (newRow, oldRow) => {
var newRowa = ref<any>({});
newRowa = newRow;
listType = newRowa.type;
},
{ deep: true }
);
//
function rkbLoadData() {
var newRow = ref<any>({});
newRow = props.queryParam;
newRow.userid = getUserId();
newRow.pageSize = 20;
console.log('👨🔬2222222', newRow);
if (newRow.pageNo == 1 && pageNo.value == 1) {
listData.value = [];
console.log('3333333');
} else {
newRow.pageNo = pageNo.value;
console.log('44444444');
}
newRow.sftkb = '1';
console.log(`🚀 ~ file: kclbList.vue:109 ~ rkbLoadData ~ newRow:`, newRow);
if (newRow.hh != ',') {
// listType.value = newRow.type
// console.log(`🚀 ~ file: kclbList.vue:111 ~ rkbLoadData ~ listType:`, listType)
list(newRow).then((res) => {
listData.value = [...res.records];
console.log('👱11111111', listData.value);
var bxqkssj = new Date(getSysConfig().bxqkssj);
var bxqjssj = new Date(getSysConfig().bxqjssj);
var nowDate = new Date();
if (bxqkssj.getTime() > nowDate.getTime() || bxqjssj.getTime() < nowDate.getTime()) {
pjDisabled.value = true;
}
current.value = res.pages;
total.value = res.total;
emit('setTotal', res.total);
});
}
}
function handleZhjs(sfyzhjs) {
if (sfyzhjs == '0') {
return 'yyyClass';
} else {
return 'yyClass';
}
}
//
async function funYuyue(record) {
var params = {
ketangbiaoid: record.id,
userid: getUserId(),
username: userStore?.getUserInfo?.realname,
skrq: record.skrq,
hh: record.hh,
zbpx: record.zbpx,
link: '',
isdeleted: 0,
kcmc:record.kcmc,
rwbh:record.rwbh,
xqxn:record.xnxq,
skjs:record.skjs,
};
const isUpdate = ref<boolean>(false);
await saveOrUpdate(params, isUpdate.value)
.then((res) => {
if (res.success) {
createMessage.success('预约成功');
rkbLoadData();
//
} else {
createMessage.warning(res.message);
}
})
.finally(() => {
confirmLoading.value = false;
});
}
function isNow(item) {
const jssj = dayjs(item.skrq + ' ' + item.jssj, 'YYYY-MM-DD hh:mm:ss');
const dqsj = dayjs(new Date());
if (jssj.unix() < dqsj.unix()) {
return true;
} else {
return false;
}
}
function funpingjia(record) {
var item = { ketangbiaoid: record.id };
let userid = getUserId();
listTkjlApi({ userid: userid, ketangbiaoid: item.ketangbiaoid }).then((res) => {
var list = res;
console.log(`🚀 ~ file: list.vue:106 ~ listTkjlApi ~ list:`, list);
if (list.length > 0) {
var score = list[0].score;
if (score) {
Modal.error({
icon: createVNode({}),
content: h('div', { style: 'height:200px;text-align:center;' }, [
h('icon', { style: 'font-size:80px;font-weight:600;color:red;' }, createVNode(CloseOutlined)),
h('p', { style: 'font-size:22px;font-weight:600;color:black;' }, '已经对此课程进行评价,不可重复评价!'),
]),
okText: 'OK',
width: '500px',
});
} else {
tingKeZuJiAddModal.value.view(item);
}
} else {
tingKeZuJiAddModal.value.view(item);
}
});
}
/**
* 报错事件
*/
function handleBaocuo(item) {
kcErrorreportIndexModal.value.disableSubmit = false;
kcErrorreportIndexModal.value.add(item);
}
function toLivePage(item) {
// route.push({ path:'/site/liveRoom',query:{ id: item.jsbh } })
addTingKeLog(getUserId(), item.id);
let routeData = route.resolve({ path: '/site/liveRoom', query: { id: item.jsbh, ktId: item.id } });
window.open(routeData.href, '_blank');
}
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',
}
defineExpose({
rkbLoadData,
});
//
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;
font-weight: 600;
color: #fff;
border-radius: 5px;
line-height: 23px;
}
.yyClass {
background-color: #1c84c6;
font-weight: 600;
color: #fff;
border-radius: 5px;
line-height: 23px;
}
.bcClass {
background-color: #1c84c6;
font-weight: 600;
border-radius: 5px;
line-height: 23px;
}
</style>

View File

@ -53,6 +53,7 @@
{{xxkcTotal}}</div>
</div>
</template>
<div style="width: 100%; margin-top: -40px; text-align: right; margin-bottom: 30px; color: #9d9d9d;">说明日课表默认展示20条数据请根据自行的需求进行按条件检索</div>
<kclbList ref="wqxxkcModeal" :queryParam="xxkcqueryParam" @setTotal="xxkcTotal = $event;jzzyload()"></kclbList>
</a-tab-pane>
@ -74,7 +75,7 @@
<script lang="ts" setup>
import { ref,onMounted,defineExpose } from 'vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import kclbList from '/@/views/site/jrkclb/kclbList.vue';
import kclbList from '/@/views/site/jrkclb/kclbList2.vue';
import { defHttp } from '/@/utils/http/axios';
import {getSysConfig } from '/@/views/site/utils/index';
//
@ -104,6 +105,8 @@ function zbLoadData() {
xxkcqueryParam.value.jzwh = queryParam.value.jzwh
xxkcqueryParam.value.zhjs = queryParam.value.zhjs
xxkcqueryParam.value.pageSize = 20
xxkcqueryParam.value.pageNo = 1
//-----------------------------------------
txhyqueryParam.value.skrq = queryParam.value.ywTime