# Conflicts:
#	src/router/routes/modules/stuzy/stuzy.ts
#	src/views/site/studentWdkc/studentMenu.vue
This commit is contained in:
bai 2024-05-21 08:43:28 +08:00
commit cf370e32d5
32 changed files with 2109 additions and 29 deletions

View File

@ -3,7 +3,7 @@
<a-upload
:headers="headers"
:multiple="multiple"
:action="uploadUrl"
:action="uploadFn"
:fileList="fileList"
:disabled="disabled"
v-bind="bindProps"
@ -38,6 +38,7 @@
import { UploadTypeEnum } from './upload.data';
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
import UploadItemActions from './components/UploadItemActions.vue';
import { defHttp } from '/@/utils/http/axios';
const { createMessage, createConfirm } = useMessage();
const { prefixCls } = useDesign('j-upload');
@ -372,6 +373,21 @@
return path.substring(path.lastIndexOf('/') + 1);
}
function uploadFn(file){
let form = new FormData();
form.append('biz', props.bizPath);
form.append('file', file);
console.log(`🚀 -------------------------------------🚀`);
console.log(`🚀 ~ uploadFn ~ uploadUrl:`, uploadUrl);
console.log(`🚀 -------------------------------------🚀`);
// * * 60
defHttp.post({ url: '/sys/common/upload', formData: form }, { timeout: 60 * 60 * 1000, joinPrefix: false, apiUrl: 'http://localhost:8090/jeecg-boot'});//http://localhost:8090/jeecg-boot/sys/common/upload
}
defineExpose({
addActionsListener,
});

View File

@ -199,6 +199,14 @@ const site: AppRouteModule = {
title: '选择课程',
},
},
{
path: 'dqkcTlqjh',
name: 'dqkcTlqjh',
component: () => import('/@/views/zy/zyTlq/TlqJiaohuList.vue'),
meta: {
title: '讨论区',
},
},
],
};

View File

@ -70,6 +70,14 @@ const stuzy: AppRouteModule = {
title: '教学单元内容',
},
},
{
path: 'stuTlq',
name: 'stuTlq',
component: () => import('/@/views/zy/zyTlq/StuZyTlqList.vue'),
meta: {
title: '通知公告',
},
},
]
}

View File

@ -87,6 +87,14 @@ const zuoye: AppRouteModule = {
title: '调查问卷',
},
},
{
path: 'dqkcTlq',
name: 'dqkcTlq',
component: () => import('/@/views/zy/zyTlq/ZyTlqList.vue'),
meta: {
title: '讨论区',
},
},
]
}

View File

@ -17,8 +17,8 @@ export const getFileAccessHttpUrl = (fileUrl, prefix = 'http') => {
//判断是否是数组格式
let isArray = fileUrl.indexOf('[') != -1;
if (!isArray) {
// let prefix = `${baseApiUrl}/sys/common/static/`;
let prefix = `${baseApiUrl}/zyk/zykInfo/static/`;
let prefix = `${baseApiUrl}/sys/common/static/`;
// let prefix = `${baseApiUrl}/zyk/zykInfo/static/`;
// 判断是否已包含前缀
if (!fileUrl.startsWith(prefix)) {
result = `${prefix}${fileUrl}`;

View File

@ -39,7 +39,7 @@
</a-row>
<a-radio-group v-model:value="item.itemSelected" style="width: 100%" size="default" :disabled="!isShow">
<div style="width: 100%" v-for="(tmxx,index) in item.wjxWjxxTmxxList">
<a-radio :value="tmxx.itemIndex+``" style="width: 100%"><a-input placeholder="请填写标题" v-model:value="tmxx.itemTitle" :bordered="false" style="width:80%;"/>
<a-radio :value="tmxx.itemIndex+``" style="width: 100%"><a-input placeholder="请填写选项" v-model:value="tmxx.itemTitle" :bordered="false" style="width:80%;"/>
<a-tooltip placement="topLeft" title="在下方添加新的选项"><Icon icon="ant-design:plus-circle-outlined" style="cursor: pointer;margin:5px;font-size:20px;color: #1890ff;" @click="handleAddTmxx(tmxx,index,item.wjxWjxxTmxxList)" /></a-tooltip >
<a-tooltip placement="topLeft" title="删除选项" ><Icon icon="ant-design:minus-circle-outlined" style="cursor: pointer;margin:5px;font-size:20px;color: #1890ff;" @click="handleRemTmxx(tmxx,index,item.wjxWjxxTmxxList)" /></a-tooltip >
</a-radio>
@ -73,7 +73,7 @@
<a-checkbox-group v-model:value="item.itemSelected" style="width: 100%" :disabled="!isShow">
<a-row>
<a-col :span="24" v-for="(tmxx,index) in item.wjxWjxxTmxxList">
<a-checkbox :value="tmxx.itemIndex"><a-input placeholder="请填写标题" v-model:value="tmxx.itemTitle" :bordered="false" style="width:80%;"/></a-checkbox>
<a-checkbox :value="tmxx.itemIndex"><a-input placeholder="请填写选项" v-model:value="tmxx.itemTitle" :bordered="false" style="width:80%;"/></a-checkbox>
<a-tooltip placement="topLeft" title="在下方添加新的选项"><Icon icon="ant-design:plus-circle-outlined" style="cursor: pointer;margin:5px;font-size:20px;color: #1890ff;" @click="handleAddTmxx(tmxx,index,item.wjxWjxxTmxxList)"/></a-tooltip >
<a-tooltip placement="topLeft" title="删除选项" ><Icon icon="ant-design:minus-circle-outlined" style="cursor: pointer;margin:5px;font-size:20px;color: #1890ff;" @click="handleRemTmxx(tmxx,index,item.wjxWjxxTmxxList)"/></a-tooltip >
</a-col>

View File

@ -52,14 +52,11 @@
</a-col>
<a-col :xs="{ span: 0 }" :sm="{ span: 24 }" :lg="{ span: 24 }" v-if="getUserSf()=='S'">
<a-menu style="margin-top: 20px;" :selectable="false">
<a-menu-item key="1" >
<a class="abox" @click="toDom('ktsbDom')">听课笔记</a>
</a-menu-item>
<a-menu-item key="2" >
<a class="abox" @click="toDom('stujrkbDom')">今日课表</a>
</a-menu-item>
<a-menu-item key="3" >
<a class="abox" @click="toDom('stujlrkbDom')">六日课表</a>
<a class="abox" @click="toDom('stujlrkbDom')">六日课表</a>
</a-menu-item>
<a-menu-item key="4" >
<a class="abox" @click="toDom('stuwdkcDom')">我的课程</a>

View File

@ -55,7 +55,7 @@
</a-tabs>
</a-card>
<!-- 课堂随笔 -->
<ktsbPage v-if="getSysConfig().sfbmd=='n'"/>
<ktsbPage v-if="getSysConfig().sfbmd=='n'&&getUserSf()=='T'"/>
</a-layout-content>
<!-- 学生部分今日课表 -->

View File

@ -20,9 +20,18 @@
<a-button type="primary" style="margin-left:10px;" @click="openPdf(jxdgInfo)">预览</a-button>
</span>
</div>
<!-- <div>
<JeecgPdfView/>
</div> -->
</a-card>
<a-card>
<div>
<span style="float: left;line-height: 30px; font-size: 18px; font-weight: bold;">教学日历</span>
<span style="width:300px;float: left;">
<span style="float:left;"><j-upload v-model:value="jxdgInfo.jxrlFilePath" maxCount="1" accept=".doc,.docx,.pdf" :forceAcceptVerify="true"></j-upload></span>
</span>
<span style="float: right;">
<a-button type="primary" @click="addKcjsHandle(3)">提交</a-button>
<a-button type="primary" style="margin-left:10px;" @click="openJxrlPdf(jxdgInfo)">预览</a-button>
</span>
</div>
</a-card>
<a-card>
<div style="line-height: 30px; font-size: 18px; font-weight: bold;width:100%;">
@ -105,6 +114,7 @@ const baseApiUrl = globSetting.domainUrl;
const jxdgInfo = ref({
id:'',
filePath:null,
jxrlFilePath:null,
kcjs:''
});
@ -140,6 +150,14 @@ const baseApiUrl = globSetting.domainUrl;
let url = baseApiUrl+"/generic/web/viewer.html?file="+encodeURIComponent(url2);
window.open(url,"_blank")
}
function openJxrlPdf(record){
var url2 = getFileAccessHttpUrl(record.jxrlPdfPath)
console.log(`🚀 ~ openPdf ~ url2:`, url2)
let url = baseApiUrl+"/generic/web/viewer.html?file="+encodeURIComponent(url2);
window.open(url,"_blank")
}
//

View File

@ -14,7 +14,7 @@
<a-menu-item key="3" @click="gotoPageByName('jiaoXueDanYuanNeiRong')">教学单元内容</a-menu-item>
</a-sub-menu>
<a-sub-menu key="sub2">
<template #title>测验/作业</template>
<template #title>作业/测验</template>
<a-menu-item key="4" @click="getGzt('dqzy')">课程作业</a-menu-item>
<a-menu-item key="5" @click="getGzt('kcjc')">课程测验</a-menu-item>
</a-sub-menu>
@ -26,6 +26,9 @@
<a-menu-item key="sub4">
<span>教学资源库</span>
</a-menu-item>
<a-menu-item key="sub5">
<span @click="getGzt('tlq')">讨论区</span>
</a-menu-item>
<!-- <a-menu-item key="sub3">
<span @click="getGzt('dqwj')">问卷调查</span>
</a-menu-item> -->
@ -82,6 +85,8 @@
href = "/zy/ceshiWenjuan";
}else if(zytype=='gongju'){
href = "/zy/dqkcGongju";
}else if(zytype=='tlq'){
href = "/zy/dqkcTlq";
}
router.push({path:href,query: {rwbh,xqxn,type}});

View File

@ -14,7 +14,7 @@
<a-menu-item key="3" @click="getGzt('jxdynr')">教学单元内容</a-menu-item>
</a-sub-menu>
<a-sub-menu key="sub2">
<template #title>测验/作业</template>
<template #title>作业/测验</template>
<a-menu-item key="4" @click="getGzt('kczy')">课程作业</a-menu-item>
<a-menu-item key="5" @click="getGzt('kccy')">课程测验</a-menu-item>
</a-sub-menu>

View File

@ -1,7 +1,7 @@
<template>
<div class="indexBackClass" id="stujlrkbDom">
<div style="margin-top: 20px;">
<span style="margin-left: 30px;font-size: 24px;font-weight: 600;">六日课表</span>
<span style="margin-left: 30px;font-size: 24px;font-weight: 600;">六日课表</span>
<span style="margin-left: 10px;"><a href="javascript:void(0);" @click="openChangeKcPage">修改课程提醒</a></span>
</div>
<a-divider></a-divider>

View File

@ -14,13 +14,16 @@
<a-menu-item key="3" @click="getGzt('stuJiaoXueDanYuanNeiRong')">教学单元</a-menu-item>
</a-sub-menu>
<a-sub-menu key="sub4">
<template #title>测验/作业</template>
<template #title>作业/测验</template>
<a-menu-item key="4" @click="getGzt('dqzy')">课程作业</a-menu-item>
<a-menu-item key="5" @click="getGzt('kcjc')">课程测验</a-menu-item>
</a-sub-menu>
<a-menu-item key="sub5">
<span @click="getGzt('dcwj')">问卷调查</span>
</a-menu-item>
<a-menu-item key="sub6">
<span @click="getGzt('tlq')">讨论区</span>
</a-menu-item>
<!-- <a-menu-item key="sub6">
<span>讨论区</span>
</a-menu-item>
@ -65,7 +68,9 @@
href = "/stuzy/studentMain";
}else if(zytype=='tzgg'){//
href = "/stuzy/StudentGonggaoList";
}else if(zytype == 'stuJiaoXueDanYuanNeiRong'){
}else if(zytype=='tlq'){//
href = "/stuzy/stuTlq";
}else if(zytype == 'stuJiaoXueDanYuanNeiRong'){//
router.push({ name: 'stuJiaoXueDanYuanNeiRong', query: { rwbh,xqxn,type } });
return;
}

View File

@ -21,9 +21,20 @@
<a-button type="primary" style="margin-left:10px;" @click="openPdf(jxdgInfo)">预览</a-button>
</span>
</div>
<!-- <div>
<JeecgPdfView/>
</div> -->
</a-card>
<a-card>
<div>
<span style="float: left;line-height: 30px; font-size: 18px; font-weight: bold;">教学日历</span>
<span style="width:300px;float: left;margin-top: 3px;">
<span v-if="jxdgInfo.jxrlFilePath">
<a-button :ghost="true" type="primary" preIcon="ant-design:download" size="small" @click="downloadFile(jxdgInfo.jxrlFilePath)"> 下载 </a-button>
</span>
<span v-else>暂无内容</span>
</span>
<span style="float: right;" v-if="jxdgInfo.jxrlFilePath">
<a-button type="primary" style="margin-left:10px;" @click="openJxrlPdf(jxdgInfo)">预览</a-button>
</span>
</div>
</a-card>
<a-card>
<div style="line-height: 30px; font-size: 18px; font-weight: bold;width:100%;">
@ -131,11 +142,18 @@ const baseApiUrl = globSetting.domainUrl;
}
function openPdf(record){
var url2 = getFileAccessHttpUrl(record.filePath)
var url2 = getFileAccessHttpUrl(record.pdfPath)
console.log(`🚀 ~ openPdf ~ url2:`, url2)
let url = baseApiUrl+"/generic/web/viewer.html?file="+encodeURIComponent(url2);
window.open(url,"_blank")
}
function openJxrlPdf(record){
var url2 = getFileAccessHttpUrl(record.jxrlPdfPath)
console.log(`🚀 ~ openPdf ~ url2:`, url2)
let url = baseApiUrl+"/generic/web/viewer.html?file="+encodeURIComponent(url2);
window.open(url,"_blank")
}
//

View File

@ -158,7 +158,7 @@ export const formSchema: FormSchema[] = [
},
},
{
label: '网通过率',
label: '通过率',
field: 'wwtgl',
component: 'InputNumber',
dynamicRules: ({model,schema}) => {

View File

@ -6,7 +6,7 @@
<a-row :gutter="24">
<a-col :lg="8">
<a-form-item label="作业名称">
<a-input placeholder="请输入作业名称" v-model:value="queryParam.title"></a-input>
<j-input placeholder="请输入作业名称" v-model:value="queryParam.title"></j-input>
</a-form-item>
</a-col>
<a-col :lg="8">
@ -65,6 +65,7 @@
import { downloadFile } from '/@/utils/common/renderUtils';
import ZyInfoModal from './components/ZyInfoModal.vue'
import { useMessage } from "/@/hooks/web/useMessage";
import { JInput } from '/@/components/Form';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import ZyInfoStudentListModal from '/@/views/zy/zyInfoStudent/ZyInfoStudentListModal.vue';
import { defHttp } from '/@/utils/http/axios';

View File

@ -6,7 +6,7 @@
<a-row :gutter="24">
<a-col :lg="8">
<a-form-item label="作业名称">
<a-input placeholder="请输入作业名称" v-model:value="queryParam.title"></a-input>
<j-input placeholder="请输入作业名称" v-model:value="queryParam.title"></j-input>
</a-form-item>
</a-col>
<!-- <a-col :lg="8">
@ -84,6 +84,7 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
import { useRouter } from 'vue-router';
import { JInput } from '/@/components/Form';
import ZyInfoModal from './components/ZyInfoModal.vue';
import ZyInfoStudentListModal from '/@/views/zy/zyInfoStudent/ZyInfoStudentListModal.vue';
import ZyInfoStudentModal from '/@/views/zy/zyInfoStudent/components/ZyInfoStudentModal.vue';

View File

@ -40,7 +40,11 @@
</a-col>
<a-col :span="12">
<a-form-item label="网络通过率" v-bind="validateInfos.wwtgl">
<a-input-number v-model:value="formData.wwtgl" placeholder="请输入网络通过率" style="width: 100%" :disabled="disabled"/>
<a-input-number v-model:value="formData.wwtgl" placeholder="请输入网络通过率" style="width: 100%" :disabled="disabled">
<template #addonAfter>
%
</template>
</a-input-number>
</a-form-item>
</a-col>
@ -52,7 +56,11 @@
</a-col>
<a-col :span="12">
<a-form-item label="课程内通过率" v-bind="validateInfos.nwtgl">
<a-input-number v-model:value="formData.nwtgl" placeholder="请输入课程内通过率" style="width: 100%" :disabled="disabled"/>
<a-input-number v-model:value="formData.nwtgl" placeholder="请输入课程内通过率" style="width: 100%" :disabled="disabled">
<template #addonAfter>
%
</template>
</a-input-number>
</a-form-item>
</a-col>
<a-col :span="12">
@ -63,7 +71,11 @@
</a-col>
<a-col :span="12">
<a-form-item label="Aigc通过率" v-bind="validateInfos.aigctgl">
<a-input-number v-model:value="formData.aigctgl" placeholder="请输入Aigc通过率" style="width: 100%" :disabled="disabled"/>
<a-input-number v-model:value="formData.aigctgl" placeholder="请输入Aigc通过率" style="width: 100%" :disabled="disabled">
<template #addonAfter>
%
</template>
</a-input-number>
</a-form-item>
</a-col>
</a-row>
@ -189,7 +201,7 @@
if(model.wwcc=='1'){
if(!model.wwtgl){
createMessage.warning('网通过率不能为空');
createMessage.warning('通过率不能为空');
confirmLoading.value = false;
return;
}

View File

@ -0,0 +1,189 @@
<template>
<div style="margin-top:10px;background:#fff;">
<!--查询区域-->
<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" style="margin-top:10px;">
<a-form-item label="标题">
<j-input placeholder="请输入标题" v-model:value="queryParam.title"></j-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24" style="margin-top:10px;">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<a-row style="width:100%;display: block;padding:10px;min-height: 300px">
<a-col :span="24" v-for="(item,index) in dataSource" :key="index">
<!-- <a-card> -->
<a-row>
<a-col :span="24">
<span style="float: left;">{{index+1}}.{{item.title}}</span>
<span style="float: right;">
<a title="详情" @click="handleDetail(item)"><Icon icon="ant-design:snippets-outlined" /></a>
</span>
</a-col>
<a-col :span="24" v-if="item.picPath.length > 0">
<j-upload v-model:value="item.picPath" fileType="image" :isImageMode="false" :maxCount="1" :buttonVisible="false" disabled="true"></j-upload>
</a-col>
<a-col :span="24" v-if="item.filePath.length > 0">
<j-upload v-model:value="item.filePath" :maxCount="1" :buttonVisible="false" disabled="true"></j-upload>
</a-col>
</a-row>
<!-- <a-divider style="height: 1px; background-color: #7cb305" /> -->
<a-divider style="border-color: #7cb305" dashed />
<!-- </a-card> -->
</a-col>
<a-col :span="24" v-show="dataSource.length>0">
<a-pagination v-model="current" :total="total" @change="handlePageChange" :pageSize="pageSize" style="text-align: right;"/>
</a-col>
<a-col :span="24" v-show="dataSource.length==0">
<a-empty/>
</a-col>
</a-row>
<ZyTlqModal ref="registerModal" @success="handleSuccess" ></ZyTlqModal>
</div>
</template>
<script lang="ts" name="zyTlq-zyTlq" setup>
import { ref, reactive, onMounted, unref } from 'vue';
import { columns } from './ZyTlq.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ZyTlq.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ZyTlqModal from './components/ZyTlqModal.vue'
import { Pagination, Empty } from 'ant-design-vue';
import { defHttp } from '/@/utils/http/axios';
import { useRouter } from 'vue-router';
import { JInput } from '/@/components/Form';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const dataSource = ref<any>([]);
const current = ref<number>(0);
const total = ref<number>(0);
const pageNo = ref<number>(0);
const pageSize = ref<number>(3);
const APagination = Pagination;
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh,xqxn } = query;//
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 16 },
});
/**
* 发布
*/
function handleFabu(record) {
defHttp.post({ url: '/zyTlq/zyTlq/edit', params: { id: record.id,sffb: "6" } }).then(res => {
total.value = 1;
pageNo.value = 0;
loadData(1);
});
}
//
function handlePageChange(page: number) {
loadData(page);
}
/**
* 新增事件
*/
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) {
var url = "/site/dqkcTlqjh?id="+record.id;
window.open(url,"_blank")
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
loadData(1);
}
/**
* 查询
*/
function searchQuery() {
loadData(1);
}
/**
* 重置
*/
function searchReset() {
queryParam.value = {};
//
loadData(1);
}
function loadData(arg){
defHttp.get({ url: '/zyTlq/zyTlq/list', params: { pageSize: 3,pageNo:arg, rwbh:rwbh,xqxn:xqxn,sffb:'1',column:'createTime',order:'desc' } }).then((res) => {
console.log(`🚀 ~ defHttp.get ~ res:`, res)
dataSource.value = res.records;
total.value = res.total;
});
}
//
onMounted(() => {
loadData(1);
});
</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>

View File

@ -0,0 +1,230 @@
<template>
<div id="siteMain">
<div id="maxSite">
<a-layout style="height: calc(100vh - 30px)">
<headerPage/>
<div style="margin-top:10px;background:#fff;">
<div style="padding: 20px;width: 98%;">
<a-row>
<a-col :span="24"><span style="line-height:20px;font-size:18px;font-weight:bold;">{{tlqInfo.title}}</span></a-col>
<a-col :span="24" v-if="tlqInfo.picPath" style="margin-top:20px;">
<j-upload v-model:value="tlqInfo.picPath" fileType="image" :isImageMode="false" :maxCount="1" :buttonVisible="false" disabled="true" style="width:300px;"></j-upload>
</a-col>
<a-col :span="24" v-if="tlqInfo.filePath" style="margin-top:20px;">
<j-upload v-model:value="tlqInfo.filePath" :maxCount="1" :buttonVisible="false" disabled="true"></j-upload>
</a-col>
</a-row>
<a-divider style="border-color: #7cb305" dashed />
</div>
<div style="width:98%;" v-for="(item,index) in dataSource">
<a-comment style="padding: 20px;">
<template #author>{{item.studentName}}</template>
<template #datetime>
<span>{{item.createTime}}</span>
</template>
<template #content>
<p>
{{item.content}}
</p>
<p v-if="item.picPath" style="margin-top: 20px;">
<j-upload v-model:value="item.picPath" fileType="image" :isImageMode="false" :maxCount="1" :buttonVisible="false" disabled="true" style="width:300px;"></j-upload>
</p>
<p v-if="item.filePath" style="margin-top: 20px;">
<j-upload v-model:value="item.filePath" :maxCount="1" :buttonVisible="false" disabled="true" ></j-upload>
</p>
</template>
</a-comment>
<a-divider style="border-color: #7cb305" dashed />
</div>
<div style="padding: 40px;background: #fafafa">
<a-row>
<a-col :span="24">
<div style="font-size: 18px;font-weight: 700;">发表内容</div>
<div><a-textarea v-model:value="formData.content" style="height: 100px"></a-textarea></div>
</a-col>
<a-col :span="12">
<div style="font-size: 18px;font-weight: 700;">图片</div>
<div>
<j-upload v-model:value="formData.picPath" fileType="image" :maxCount="9" ></j-upload>
</div>
</a-col>
<a-col :span="12">
<div style="font-size: 18px;font-weight: 700;">附件</div>
<div><j-upload v-model:value="formData.filePath" :maxCount="9" ></j-upload></div>
</a-col>
<a-col :span="24">
<a-button type="primary" @click="submitForm">发表</a-button>
</a-col>
</a-row>
</div>
</div>
<footerPage style="margin-top:10px;"/>
</a-layout>
</div>
</div>
</template>
<script lang="ts" name="zyTlq-zyTlq" setup>
import { ref, reactive, onMounted, unref ,defineComponent } from 'vue';
import { Pagination, Empty } from 'ant-design-vue';
import { defHttp } from '/@/utils/http/axios';
import { useRouter } from 'vue-router';
import { LikeFilled, LikeOutlined, DislikeFilled, DislikeOutlined } from '@ant-design/icons-vue';
import headerPage from '/@/views/site/common/header.vue';
import footerPage from '/@/views/site/common/footer.vue';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import { Comment } from 'ant-design-vue';
dayjs.extend(relativeTime);
const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const dataSource = ref<any>([]);
const tlqInfo = ref<any>({});
const formData = ref<any>({});
const current = ref<number>(0);
const total = ref<number>(0);
const pageNo = ref<number>(0);
const pageSize = ref<number>(50);
const APagination = Pagination;
const AComment = Comment;
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { id } = query;//
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 4 },
});
const likes = ref<number>(0);
const dislikes = ref<number>(0);
const action = ref<string>();
const like = () => {
likes.value = 1;
dislikes.value = 0;
action.value = 'liked';
};
const dislike = () => {
likes.value = 0;
dislikes.value = 1;
action.value = 'disliked';
};
//
function handlePageChange(page: number) {
loadData(page);
}
async function getTlqInfo(){
await defHttp.get({ url: '/zyTlq/zyTlq/queryById', params: { id:id }}).then((res) => {
console.log(`🚀 ~ awaitdefHttp.get ~ res:`, res)
tlqInfo.value = res;
});
}
function loadData(arg){
defHttp.get({ url: '/zyTlqContent/zyTlqContent/list', params: { mainId:id+"",column:'createTime',order:'desc' } }).then((res) => {
console.log(`🚀 ~ defHttp.get ~ res:`, res)
dataSource.value = res.records;
total.value = res.total;
});
}
function submitForm(){
formData.value.mainId = id;
defHttp.post({ url: '/zyTlqContent/zyTlqContent/add', params: formData.value}).then((res) => {
loadData(1);
});
}
//
onMounted(() => {
getTlqInfo();
loadData(1);
});
</script>
<style lang="less" scoped>
#siteMain {
// font-size: ;
// height: 100%;
background: #f3f3f4;
#maxSite {
//
max-width: 1070px;
min-height: calc(100vh);
//
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;
}
}
}
.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
}
}
/deep/.ant-upload-list-picture-card-container {
display: inline-block;
width: 80px;
height: 80px;
margin: 0 8px 8px 0;
vertical-align: top;
}
/deep/.ant-upload.ant-upload-select-picture-card {
width: 80px;
height: 80px;
margin-right: 8px;
margin-bottom: 8px;
text-align: center;
vertical-align: top;
background-color: #fafafa;
border: 1px dashed #d9d9d9;
border-radius: 2px;
cursor: pointer;
transition: border-color 0.3s;
}
</style>

View File

@ -0,0 +1,230 @@
<template>
<div id="siteMain">
<div id="maxSite">
<a-layout style="height: calc(100vh - 30px)">
<headerPage/>
<div style="margin-top:10px;background:#fff;">
<div style="padding: 20px;width: 98%;">
<a-row>
<a-col :span="24"><span style="line-height:20px;font-size:18px;font-weight:bold;">{{tlqInfo.title}}</span></a-col>
<a-col :span="24" v-if="tlqInfo.picPath" style="margin-top:20px;">
<j-upload v-model:value="tlqInfo.picPath" fileType="image" :isImageMode="false" :maxCount="1" :buttonVisible="false" disabled="true" style="width:300px;"></j-upload>
</a-col>
<a-col :span="24" v-if="tlqInfo.filePath" style="margin-top:20px;">
<j-upload v-model:value="tlqInfo.filePath" :maxCount="1" :buttonVisible="false" disabled="true"></j-upload>
</a-col>
</a-row>
<a-divider style="border-color: #7cb305" dashed />
</div>
<div style="width:98%;" v-for="(item,index) in dataSource">
<a-comment style="padding: 20px;">
<template #author>{{item.studentName}}</template>
<template #datetime>
<span>{{item.createTime}}</span>
</template>
<template #content>
<p>
{{item.content}}
</p>
<p v-if="item.picPath" style="margin-top: 20px;">
<j-upload v-model:value="item.picPath" fileType="image" :isImageMode="false" :maxCount="1" :buttonVisible="false" disabled="true" style="width:300px;"></j-upload>
</p>
<p v-if="item.filePath" style="margin-top: 20px;">
<j-upload v-model:value="item.filePath" :maxCount="1" :buttonVisible="false" disabled="true" ></j-upload>
</p>
</template>
</a-comment>
<a-divider style="border-color: #7cb305" dashed />
</div>
<div style="padding: 40px;background: #fafafa">
<a-row>
<a-col :span="24">
<div style="font-size: 18px;font-weight: 700;">发表内容</div>
<div><a-textarea v-model:value="formData.content" style="height: 100px"></a-textarea></div>
</a-col>
<a-col :span="12">
<div style="font-size: 18px;font-weight: 700;">图片</div>
<div>
<j-upload v-model:value="formData.picPath" fileType="image" :maxCount="9" ></j-upload>
</div>
</a-col>
<a-col :span="12">
<div style="font-size: 18px;font-weight: 700;">附件</div>
<div><j-upload v-model:value="formData.filePath" :maxCount="9" ></j-upload></div>
</a-col>
<a-col :span="24">
<a-button type="primary" @click="submitForm">发表</a-button>
</a-col>
</a-row>
</div>
</div>
<footerPage style="margin-top:10px;"/>
</a-layout>
</div>
</div>
</template>
<script lang="ts" name="zyTlq-zyTlq" setup>
import { ref, reactive, onMounted, unref ,defineComponent } from 'vue';
import { Pagination, Empty } from 'ant-design-vue';
import { defHttp } from '/@/utils/http/axios';
import { useRouter } from 'vue-router';
import { LikeFilled, LikeOutlined, DislikeFilled, DislikeOutlined } from '@ant-design/icons-vue';
import headerPage from '/@/views/site/common/header.vue';
import footerPage from '/@/views/site/common/footer.vue';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
import { Comment } from 'ant-design-vue';
dayjs.extend(relativeTime);
const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const dataSource = ref<any>([]);
const tlqInfo = ref<any>({});
const formData = ref<any>({});
const current = ref<number>(0);
const total = ref<number>(0);
const pageNo = ref<number>(0);
const pageSize = ref<number>(50);
const APagination = Pagination;
const AComment = Comment;
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { id } = query;//
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 4 },
});
const likes = ref<number>(0);
const dislikes = ref<number>(0);
const action = ref<string>();
const like = () => {
likes.value = 1;
dislikes.value = 0;
action.value = 'liked';
};
const dislike = () => {
likes.value = 0;
dislikes.value = 1;
action.value = 'disliked';
};
//
function handlePageChange(page: number) {
loadData(page);
}
async function getTlqInfo(){
await defHttp.get({ url: '/zyTlq/zyTlq/queryById', params: { id:id }}).then((res) => {
console.log(`🚀 ~ awaitdefHttp.get ~ res:`, res)
tlqInfo.value = res;
});
}
function loadData(arg){
defHttp.get({ url: '/zyTlqContent/zyTlqContent/list', params: { mainId:id+"",column:'createTime',order:'desc' } }).then((res) => {
console.log(`🚀 ~ defHttp.get ~ res:`, res)
dataSource.value = res.records;
total.value = res.total;
});
}
function submitForm(){
formData.value.mainId = id;
defHttp.post({ url: '/zyTlqContent/zyTlqContent/add', params: formData.value}).then((res) => {
loadData(1);
});
}
//
onMounted(() => {
getTlqInfo();
loadData(1);
});
</script>
<style lang="less" scoped>
#siteMain {
// font-size: ;
// height: 100%;
background: #f3f3f4;
#maxSite {
//
max-width: 1070px;
min-height: calc(100vh);
//
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;
}
}
}
.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
}
}
/deep/.ant-upload-list-picture-card-container {
display: inline-block;
width: 80px;
height: 80px;
margin: 0 8px 8px 0;
vertical-align: top;
}
/deep/.ant-upload.ant-upload-select-picture-card {
width: 80px;
height: 80px;
margin-right: 8px;
margin-bottom: 8px;
text-align: center;
vertical-align: top;
background-color: #fafafa;
border: 1px dashed #d9d9d9;
border-radius: 2px;
cursor: pointer;
transition: border-color 0.3s;
}
</style>

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/zyTlq/zyTlq/list',
save='/zyTlq/zyTlq/add',
edit='/zyTlq/zyTlq/edit',
deleteOne = '/zyTlq/zyTlq/delete',
deleteBatch = '/zyTlq/zyTlq/deleteBatch',
importExcel = '/zyTlq/zyTlq/importExcel',
exportXls = '/zyTlq/zyTlq/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 });
}

View File

@ -0,0 +1,42 @@
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: 'mainId',
align: "center",
dataIndex: 'mainId'
},
{
title: '标题',
align: "center",
dataIndex: 'title'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: 'mainId',
field: 'mainId',
component: 'Input',
},
{
label: '标题',
field: 'title',
component: 'Input',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -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>
<!-- 表单区域 -->
<ZyTlqModal ref="registerModal" @success="handleSuccess"></ZyTlqModal>
</div>
</template>
<script lang="ts" name="zyTlq-zyTlq" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './ZyTlq.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ZyTlq.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ZyTlqModal from './components/ZyTlqModal.vue'
const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '讨论区',
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: "讨论区",
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>

View File

@ -0,0 +1,198 @@
<template>
<div style="margin-top:10px;background:#fff;">
<!--查询区域-->
<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" style="margin-top:10px;">
<a-form-item label="标题">
<j-input placeholder="请输入标题" v-model:value="queryParam.title"></j-input>
</a-form-item>
</a-col>
<a-col :xl="6" :lg="7" :md="8" :sm="24" style="margin-top:10px;">
<span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
<a-col :lg="6">
<a-button type="primary" preIcon="ant-design:search-outlined" @click="searchQuery">查询</a-button>
<a-button type="primary" preIcon="ant-design:plus-outlined" @click="handleAdd" style="margin-left: 8px"> 新增</a-button>
</a-col>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!--引用表格-->
<a-row style="width:100%;display: block;padding:10px;min-height: 300px">
<a-col :span="24" v-for="(item,index) in dataSource" :key="index">
<!-- <a-card> -->
<a-row>
<a-col :span="24">
<span style="float: left;">{{index+1}}.{{item.title}}</span>
<span style="float: right;">
<span v-if="item.sffb=='0'">未发布</span>
<span v-else>已发布</span>
<a title="修改" @click="handleEdit(item)" v-if="item.sffb=='0'"><Icon icon="ant-design:form-outlined"/></a>
<a-divider type="vertical" style="height: 30px; background-color: #7cb305" v-if="item.sffb=='0'"/>
<a title="删除" @click="handleDelete(item)"><Icon icon="ant-design:delete-outlined" v-if="item.sffb=='0'"/></a>
<a-divider type="vertical" style="height: 30px; background-color: #7cb305" v-if="item.sffb=='0'"/>
<a title="发布" @click="handleFabu(item)"><Icon icon="ant-design:check-circle-outlined" v-if="item.sffb=='0'"/></a>
<a-divider type="vertical" style="height: 30px; background-color: #7cb305" v-if="item.sffb=='0'"/>
<a title="详情" @click="handleDetail(item)"><Icon icon="ant-design:snippets-outlined" /></a>
</span>
</a-col>
<a-col :span="24" v-if="item.picPath.length > 0">
<j-upload v-model:value="item.picPath" fileType="image" :isImageMode="false" :maxCount="1" :buttonVisible="false" disabled="true"></j-upload>
</a-col>
<a-col :span="24" v-if="item.filePath.length > 0">
<j-upload v-model:value="item.filePath" :maxCount="1" :buttonVisible="false" disabled="true"></j-upload>
</a-col>
</a-row>
<!-- <a-divider style="height: 1px; background-color: #7cb305" /> -->
<a-divider style="border-color: #7cb305" dashed />
<!-- </a-card> -->
</a-col>
<a-col :span="24" v-show="dataSource.length>0">
<a-pagination v-model="current" :total="total" @change="handlePageChange" :pageSize="pageSize" style="text-align: right;"/>
</a-col>
<a-col :span="24" v-show="dataSource.length==0">
<a-empty/>
</a-col>
</a-row>
<ZyTlqModal ref="registerModal" @success="handleSuccess" ></ZyTlqModal>
</div>
</template>
<script lang="ts" name="zyTlq-zyTlq" setup>
import { ref, reactive, onMounted, unref } from 'vue';
import { columns } from './ZyTlq.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ZyTlq.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ZyTlqModal from './components/ZyTlqModal.vue'
import { Pagination, Empty } from 'ant-design-vue';
import { defHttp } from '/@/utils/http/axios';
import { useRouter } from 'vue-router';
import { JInput } from '/@/components/Form';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
const dataSource = ref<any>([]);
const current = ref<number>(0);
const total = ref<number>(0);
const pageNo = ref<number>(0);
const pageSize = ref<number>(3);
const APagination = Pagination;
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh,xqxn } = query;//
const labelCol = reactive({
xs: { span: 24 },
sm: { span: 7 },
});
const wrapperCol = reactive({
xs: { span: 24 },
sm: { span: 16 },
});
/**
* 发布
*/
function handleFabu(record) {
defHttp.post({ url: '/zyTlq/zyTlq/edit', params: { id: record.id,sffb: "1" } }).then(res => {
total.value = 1;
pageNo.value = 0;
loadData(1);
});
}
//
function handlePageChange(page: number) {
loadData(page);
}
/**
* 新增事件
*/
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) {
var url = "/site/dqkcTlqjh?id="+record.id;
window.open(url,"_blank")
}
/**
* 删除事件
*/
async function handleDelete(record) {
await deleteOne({ id: record.id }, handleSuccess);
}
/**
* 成功回调
*/
function handleSuccess() {
loadData(1);
}
/**
* 查询
*/
function searchQuery() {
loadData(1);
}
/**
* 重置
*/
function searchReset() {
queryParam.value = {};
//
loadData(1);
}
function loadData(arg){
defHttp.get({ url: '/zyTlq/zyTlq/list', params: { pageSize: 3,pageNo:arg, rwbh:rwbh,xqxn:xqxn,column:'createTime',order:'desc' } }).then((res) => {
console.log(`🚀 ~ defHttp.get ~ res:`, res)
dataSource.value = res.records;
total.value = res.total;
});
}
//
onMounted(() => {
loadData(1);
});
</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>

View File

@ -0,0 +1,147 @@
<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.title">
<a-input v-model:value="formData.title" placeholder="请输入标题" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="图片" v-bind="validateInfos.picPath" :labelCol="labelCol" :wrapperCol="wrapperCol2">
<j-upload v-model:value="formData.picPath" fileType="image" maxCount="9"></j-upload>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="附件" v-bind="validateInfos.title">
<j-upload v-model:value="formData.filePath"></j-upload>
</a-form-item>
</a-col>
</a-row>
</a-form>
</a-spin>
</template>
<script lang="ts" setup>
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted, unref } from 'vue';
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from '/@/hooks/web/useMessage';
import { getValueType } from '/@/utils';
import { saveOrUpdate } from '../ZyTlq.api';
import { Form } from 'ant-design-vue';
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
import { useRouter } from 'vue-router';
const { currentRoute } = useRouter();
const { query } = unref(currentRoute);
const { rwbh,xqxn } = query;//
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: '',
title: '',
picPath:'',
filePath:'',
rwbh,xqxn
});
const { createMessage } = useMessage();
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
const wrapperCol2 = ref<any>({ xs: { span: 24 }, sm: { span: 12 } });
const confirmLoading = ref<boolean>(false);
//
const validatorRules = {
};
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>

View File

@ -0,0 +1,75 @@
<template>
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<ZyTlqForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ZyTlqForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import ZyTlqForm from './ZyTlqForm.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>

View File

@ -0,0 +1,72 @@
import { defHttp } from '/@/utils/http/axios';
import { useMessage } from "/@/hooks/web/useMessage";
const { createConfirm } = useMessage();
enum Api {
list = '/zyTlqContent/zyTlqContent/list',
save='/zyTlqContent/zyTlqContent/add',
edit='/zyTlqContent/zyTlqContent/edit',
deleteOne = '/zyTlqContent/zyTlqContent/delete',
deleteBatch = '/zyTlqContent/zyTlqContent/deleteBatch',
importExcel = '/zyTlqContent/zyTlqContent/importExcel',
exportXls = '/zyTlqContent/zyTlqContent/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 });
}

View File

@ -0,0 +1,72 @@
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: 'mainId',
align: "center",
dataIndex: 'mainId'
},
{
title: '讨论信息',
align: "center",
dataIndex: 'content'
},
{
title: '图片',
align: "center",
dataIndex: 'picPath'
},
{
title: '附件',
align: "center",
dataIndex: 'filePath'
},
{
title: '点赞',
align: "center",
dataIndex: 'dianzan'
},
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
{
label: 'mainId',
field: 'mainId',
component: 'Input',
},
{
label: '讨论信息',
field: 'content',
component: 'InputTextArea',
},
{
label: '图片',
field: 'picPath',
component: 'InputTextArea',
},
{
label: '附件',
field: 'filePath',
component: 'InputTextArea',
},
{
label: '点赞',
field: 'dianzan',
component: 'InputNumber',
},
// TODO 主键隐藏字段目前写死为ID
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
];

View File

@ -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>
<!-- 表单区域 -->
<ZyTlqContentModal ref="registerModal" @success="handleSuccess"></ZyTlqContentModal>
</div>
</template>
<script lang="ts" name="zyTlqContent-zyTlqContent" setup>
import { ref, reactive } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import { columns } from './ZyTlqContent.data';
import { list, deleteOne, batchDelete, getImportUrl, getExportUrl } from './ZyTlqContent.api';
import { downloadFile } from '/@/utils/common/renderUtils';
import ZyTlqContentModal from './components/ZyTlqContentModal.vue'
const queryParam = ref<any>({});
const toggleSearchStatus = ref<boolean>(false);
const registerModal = ref();
//table
const { prefixCls, tableContext, onExportXls, onImportXls } = useListPage({
tableProps: {
title: '讨论内容',
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: "讨论内容",
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>

View File

@ -0,0 +1,151 @@
<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="mainId" v-bind="validateInfos.mainId">
<a-input v-model:value="formData.mainId" placeholder="请输入mainId" :disabled="disabled"></a-input>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="讨论信息" v-bind="validateInfos.content">
<a-textarea v-model:value="formData.content" rows="4" placeholder="请输入讨论信息" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="图片" v-bind="validateInfos.picPath">
<a-textarea v-model:value="formData.picPath" rows="4" placeholder="请输入图片" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="附件" v-bind="validateInfos.filePath">
<a-textarea v-model:value="formData.filePath" rows="4" placeholder="请输入附件" :disabled="disabled"/>
</a-form-item>
</a-col>
<a-col :span="24">
<a-form-item label="点赞" v-bind="validateInfos.dianzan">
<a-input-number v-model:value="formData.dianzan" placeholder="请输入点赞" style="width: 100%" :disabled="disabled"/>
</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 '../ZyTlqContent.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: '',
mainId: '',
content: '',
picPath: '',
filePath: '',
dianzan: undefined,
});
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 });
//
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>

View File

@ -0,0 +1,75 @@
<template>
<a-modal :title="title" :width="width" :visible="visible" @ok="handleOk" :okButtonProps="{ class: { 'jee-hidden': disableSubmit } }" @cancel="handleCancel" cancelText="关闭">
<ZyTlqContentForm ref="registerForm" @ok="submitCallback" :formDisabled="disableSubmit" :formBpm="false"></ZyTlqContentForm>
</a-modal>
</template>
<script lang="ts" setup>
import { ref, nextTick, defineExpose } from 'vue';
import ZyTlqContentForm from './ZyTlqContentForm.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>