2023年4月8日 新增评价页,新增更多页

This commit is contained in:
bai 2023-04-08 18:44:10 +08:00
parent b50e10ab6f
commit c61a0fd476
9 changed files with 441 additions and 60 deletions

View File

@ -20,7 +20,7 @@ const site: AppRouteModule = {
component: () => import('/@/views/site/index.vue'),
meta: {
// affix: true,
title: t('routes.dashboard.analysis'),
title: '信息中心',
},
},
{
@ -29,9 +29,19 @@ const site: AppRouteModule = {
component: () => import('/@/views/site/index2.vue'),
meta: {
// affix: true,
title: t('routes.dashboard.analysis'),
title: '测试页',
},
},
{
path: 'tingKeZuJiMore',
name: 'tingKeZuJiMore',
component: () => import('/@/views/site/tingKeZuJi/more.vue'),
meta: {
// affix: true,
title: '更多',
},
},
],
};

View File

@ -31,7 +31,7 @@ const setting: ProjectConfig = {
// ROUTE_MAPPING: 前端模式(菜单由路由生成,默认)
// ROLE前端模式菜单路由分开
// BACK后台模式
permissionMode: PermissionModeEnum.BACK,
permissionMode: PermissionModeEnum.ROLE,
// 权限缓存存放位置。默认存放于localStorage
permissionCacheType: CacheTypeEnum.LOCAL,

View File

@ -3,7 +3,7 @@
<!-- --{{ list }}-- -->
<a-carousel autoplay>
<div v-for="(item,index) in list" :key="index">
<AImage style="marginRight: 5px" :src="getFileAccessHttpUrl(item.picPath)" :width="'100%'"/>
<AImage style="marginRight: 5px" :src="getFileAccessHttpUrl(item.picPath)" :width="'100%'" :preview="false"/>
<!-- <h3>{{ item.title }}-{{ item.picPath }}</h3> -->
</div>
</a-carousel>

View File

@ -32,7 +32,7 @@
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted, watch } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import JCheckbox from "/@/components/Form/src/jeecg/components/JCheckbox.vue";
// import JCheckbox from "/@/components/Form/src/jeecg/components/JCheckbox.vue";
import { getValueType } from '/@/utils';
import { Form } from 'ant-design-vue';

View File

@ -0,0 +1,150 @@
<template>
<a-spin :spinning="confirmLoading">
<a-card>
您可根据实际情况选择下面三个评价表中的一个或者两个给予评价
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
<a-row>
<a-col :span="24">
<!-- <a-form-item label="课前15分钟提醒"> -->
<a-checkbox-group v-model:value="formData.kqtx">
<a-checkbox value="1"/>
</a-checkbox-group>
课前15分钟提醒
<!-- <j-checkbox type="checkbox" v-model:value="formData.kqtx" dictCode="skzc" placeholder="请选择开课周次"/> -->
<!-- </a-form-item> -->
</a-col>
<a-col :span="24">
<!-- <a-form-item label="每天下午4点提醒明日课程"> -->
<a-checkbox-group v-model:value="formData.mrkctx">
<a-checkbox value="1"/>
</a-checkbox-group>
每天下午4点提醒明日课程
<!-- <j-checkbox type="checkbox" v-model:value="formData.mrkctx" dictCode="skzc" placeholder="请选择开课周次"/> -->
<!-- </a-form-item> -->
</a-col>
</a-row>
</a-form>
</a-card>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted, watch } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
// import JCheckbox from "/@/components/Form/src/jeecg/components/JCheckbox.vue";
import { getValueType } from '/@/utils';
import { Form } from 'ant-design-vue';
import { getUserId } from '/@/views/site/utils/index';
const formRef = ref();
const useForm = Form.useForm;
const emit = defineEmits(['register', 'ok']);
const formData = reactive<Record<string, any>>({
userid: '',
kqtx: '',
mrkctx: '',
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
};
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
/**
* 新增
*/
function add() {
edit({});
}
/**
* 编辑
*/
function edit( record ) {
nextTick(() => {
resetFields();
//
let recordData = {};
let params = { userid: getUserId(), pageSize: 1 };//IDlist
defHttp.get({ url: '/kcKechengtixingdingyue/kcKechengtixingdingyue/list', params }).then(res => {
recordData = ((res?.records) ?? [])[0]
// recordData = {} //DEBUG
Object.assign(formData, recordData);
})
//
});
}
/**
* 提交数据
*/
async function submitForm() {
//
await validate();
confirmLoading.value = true;
const isUpdate = ref<boolean>(false);
//
// let model = Object.assign({},formData);
let model = formData;
if (model.userid) {
isUpdate.value = true;
}
//
for (let data in model) {
//
if (model[data] instanceof Array) {
let valueType = getValueType(formRef.value.getProps, data);
//
if (valueType === 'string') {
model[data] = model[data].join(',');
}
}
}
model.kqtx = model.kqtx || 0;
model.mrkctx = model.mrkctx || 0;
let url = '';
if(isUpdate.value){
url = '/kcKechengtixingdingyue/kcKechengtixingdingyue/edit';
}else{
url = '/kcKechengtixingdingyue/kcKechengtixingdingyue/add';
//ID
model.userid = getUserId();
}
await defHttp.post({ url: url, params: model }, { isTransformResponse: false }).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>

View File

@ -0,0 +1,96 @@
<template>
<div class="renKeJiaoChengBase">
<a-modal :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" :getContainer="getPDom" cancelText="关闭">
<template #title>
<div style="text-align: center;">请选择评价表</div>
</template>
<KcKetangbiaoForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"/>
</a-modal>
</div>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import KcKetangbiaoForm from './addForm.vue'
const width = ref<number>(600);
const visible = ref<boolean>(false);
const disableSubmit = ref<boolean>(false);
const registerForm = ref();
function getPDom() {
return document.querySelector('.renKeJiaoChengBase')
}
/**
* 新增
*/
function add() {
visible.value = true;
nextTick(() => {
registerForm.value.add();
});
}
/**
* 编辑
* @param record
*/
function edit(record) {
visible.value = true;
nextTick(() => {
registerForm.value.edit(record);
});
}
/**
* 确定按钮点击事件
*/
function handleOk() {
registerForm.value.submitForm();
}
/**
* form保存回调事件
*/
function submitCallback() {
handleCancel();
}
/**
* 取消按钮回调事件
*/
function handleCancel() {
visible.value = false;
}
defineExpose({
add,
edit,
disableSubmit,
});
</script>
<style lang="less" scoped>
/**隐藏样式-modal确定按钮 */
// .renKeJiaoChengBaseModal :deep(.ant-modal-content) {
// text-align: center;
// background: red;
// }
.renKeJiaoChengBase {
.jee-hidden {
display: none !important;
}
// background: orange;
:deep(.ant-modal-content) {
// background: green;
.ant-modal-footer {
text-align: center;
// background: red;
}
}
}
</style>

View File

@ -4,64 +4,14 @@
<span style="font-size: 24px;font-weight: bold;">听课足迹</span>
<!-- <span style="margin-left: 10px;"><a href="javascript:void(0);">修改课程提醒</a></span> -->
</template>
<template #extra><a href="javascript:void(0);">查看更多</a></template>
<a-list item-layout="horizontal" :data-source="list">
<template #renderItem="{ item }">
<a-list-item>
<a-list-item-meta>
<template #title>
<div class="wenZiJiaCu">
听了&nbsp;&nbsp;&nbsp;&nbsp;{{ item.kkdw }}&nbsp;&nbsp;&nbsp;&nbsp;{{item.skjs}}&nbsp;&nbsp;&nbsp;&nbsp;{{ item.kcmc }}
</div>
</template>
<template #description>
<span v-if="item.score" style="color: #337ab7;">已评分{{ item.score }}</span>
<span v-else style="color: #337ab7;"><FormOutlined/>填写评价</span>
</template>
<template #avatar>
<div class="wenZiJuZhong">
<!-- <a-avatar style="marginRight: 5px" :src="getFileAccessHttpUrl(item.picPath)" shape="square" :size="25"/> -->
<!-- <a-avatar src="https://joeschmoe.io/api/v1/random" /> -->
<TeamOutlined/>
<div>{{ item.shijian }}</div>
<div style="color: #1ab394;">{{ item.tkrq }}</div>
</div>
</template>
</a-list-item-meta>
</a-list-item>
</template>
</a-list>
<template #extra>
<RouterLink target='_blank' to="/site/tingKeZuJiMore">查看更多</RouterLink>
</template>
<listPage/>
</a-card>
</template>
<script setup lang="ts">
import { ref, reactive, computed, onMounted } from 'vue';
import { TeamOutlined, FormOutlined } from '@ant-design/icons-vue';
// import { dateUtil, formatToDate } from '/@/utils/dateUtil';
import { getUserId } from '/@/views/site/utils/index';
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/kcTingke/kcTingke/findTingKeZuJiBytingketimeAndUserId'
}
/**
* 列表接口
* @param params
*/
const listApi = (params) => defHttp.get({ url: Api.list, params });
const list = ref<any>([]);
onMounted(() => {
listApi({ userid: getUserId(), tingketime: '2023-02-19' }).then(res => {
console.log(`🚀 ---------------------------------------------🚀`);
console.log(`🚀 ~ file: index.vue:57 ~ listApi ~ res:`, res);
console.log(`🚀 ---------------------------------------------🚀`);
list.value = res ?? [];
});
});
import listPage from '/@/views/site/tingKeZuJi/list.vue';
</script>
<style lang="less" scoped>
.wenZiJuZhong {

View File

@ -0,0 +1,64 @@
<template>
<a-list item-layout="horizontal" :data-source="list">
<template #renderItem="{ item }">
<a-list-item>
<a-list-item-meta>
<template #title>
<div class="wenZiJiaCu">
听了&nbsp;&nbsp;&nbsp;&nbsp;{{ item.kkdw }}&nbsp;&nbsp;&nbsp;&nbsp;{{item.skjs}}&nbsp;&nbsp;&nbsp;&nbsp;{{ item.kcmc }}
</div>
</template>
<template #description>
<span v-if="item.score" style="color: #337ab7;">已评分{{ item.score }}</span>
<span v-else style="color: #337ab7;"><FormOutlined/>填写评价</span>
</template>
<template #avatar>
<div class="wenZiJuZhong">
<TeamOutlined/>
<div>{{ item.shijian }}</div>
<div style="color: #1ab394;">{{ item.tkrq }}</div>
</div>
</template>
</a-list-item-meta>
</a-list-item>
</template>
</a-list>
</template>
<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { TeamOutlined, FormOutlined } from '@ant-design/icons-vue';
import { getUserId } from '/@/views/site/utils/index';
import { defHttp } from '/@/utils/http/axios';
enum Api {
list = '/kcTingke/kcTingke/findTingKeZuJiBytingketimeAndUserId'
}
/**
* 列表接口
* @param params
*/
const listApi = (params) => defHttp.get({ url: Api.list, params });
const list = ref<any>([]);
onMounted(() => {
listApi({ userid: getUserId(), tingketime: '2023-02-19' }).then(res => {
console.log(`🚀 ---------------------------------------------🚀`);
console.log(`🚀 ~ file: index.vue:57 ~ listApi ~ res:`, res);
console.log(`🚀 ---------------------------------------------🚀`);
list.value = res ?? [];
});
});
</script>
<style lang="less" scoped>
.wenZiJuZhong {
text-align: center;
}
.wenZiJiaCu {
font-weight: 700;
}
</style>

View File

@ -0,0 +1,111 @@
<template>
<div id="siteMain">
<div id="maxSite">
<a-layout>
<!-- 页头 -->
<headerPage/>
<!-- 主体部分 -->
<a-layout-content>
<span style="font-size: 24px;font-weight: bold;">听课足迹</span>
<a-card>
<a-row :gutter="[16,16]">
<a-col :xs="{ span: 24 }" :sm="{ span: 8 }" :lg="{ span: 4 }">
<a-date-picker placeholder="请选择开始日期" format="YYYY-MM-DD" valueFormat="YYYY-MM-DD" v-model:value="queryParam.startDate" style="width: 100%" />
</a-col>
<a-col :xs="{ span: 24 }" :sm="{ span: 8 }" :lg="{ span: 4 }">
<a-date-picker placeholder="请选择结束日期" format="YYYY-MM-DD" valueFormat="YYYY-MM-DD" v-model:value="queryParam.startDate" style="width: 100%" />
</a-col>
<a-col :xs="{ span: 24 }" :sm="{ span: 8 }" :lg="{ span: 4 }" class="dictBox">
<j-dict-select-tag v-model:value="queryParam.kkdw" dictCode="" placeholder="请选择院系" style="width: 100%;"/>
</a-col>
<a-col :xs="{ span: 24 }" :sm="{ span: 8 }" :lg="{ span: 4 }" class="dictBox">
<j-dict-select-tag v-model:value="queryParam.hh" dictCode="skjc" placeholder="请选择节次" style="width: 100%;"/>
</a-col>
<a-col :xs="{ span: 24 }" :sm="{ span: 8 }" :lg="{ span: 4 }">
<a-select style="width: 100%;" v-model:value="queryParam.pj">
<a-select-option value="">全部</a-select-option>
<a-select-option value="未评价">未评价</a-select-option>
<a-select-option value="已评价">已评价</a-select-option>
</a-select>
</a-col>
<a-col :xs="{ span: 24 }" :sm="{ span: 8 }" :lg="{ span: 4 }">
<a-input placeholder="输入课程名或教师名……" v-model:value="queryParam.searchInput" style="width: 100%" />
</a-col>
</a-row>
<a-divider class="divider"/>
<a-row>
<a-col :span="12">
<listPage/>
</a-col>
</a-row>
</a-card>
</a-layout-content>
<!-- 页尾 -->
<footerPage/>
</a-layout>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref, reactive, watch } from 'vue';
import headerPage from '/@/views/site/common/header.vue';
import footerPage from '/@/views/site/common/footer.vue';
import listPage from '/@/views/site/tingKeZuJi/list.vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
const queryParam = ref<any>({ startDate: '2023-02-19', endDate: '2023-02-19', pj: '' });
</script>
<style lang="less" scoped>
#siteMain {
// font-size: ;
// height: 100%;
background: #f3f3f4;
#maxSite {
//
max-width: 1170px;
//
margin: 0 auto;
.rowGutter{
margin-top: 1rem;
margin-bottom: 1rem;
}
.ant-layout-header {
color: #fff;
background: #1ab394;
}
.ant-layout-footer {
line-height: 1.5;
background: #FFF;
}
.ant-layout-sider {
color: #fff;
line-height: 120px;
background: #3ba0e9;
}
.ant-layout-content {
min-height: 120px;
color: #000;
line-height: 120px;
background: #f3f3f4;
}
.dictBox :deep(.ant-select) {
width: 100%;
}
}
}
/**暗黑模式特殊配色*/
[data-theme='dark'] #siteMain #maxSite {
.ant-layout-header, .ant-layout-footer {
background: #6aa0c7;
}
.ant-layout-content {
background: #107bcb;
}
.ant-layout-sider {
background: #3499ec;
}
}
</style>