专家-通知公告
This commit is contained in:
parent
bb2fb88c07
commit
ce912d3bfb
|
@ -125,6 +125,30 @@ public class SysAnnouncementController {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 专家分页列表查询
|
||||||
|
* @param sysAnnouncement
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequestMapping(value = "/expertList", method = RequestMethod.GET)
|
||||||
|
public Result<IPage<SysAnnouncement>> queryExpertPageList(SysAnnouncement sysAnnouncement,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
Result<IPage<SysAnnouncement>> result = new Result<IPage<SysAnnouncement>>();
|
||||||
|
LoginUser sysUser = (LoginUser)SecurityUtils.getSubject().getPrincipal();
|
||||||
|
String userId = sysUser.getId();
|
||||||
|
String title = req.getParameter("title");
|
||||||
|
Page<SysAnnouncement> page = new Page<SysAnnouncement>(pageNo,pageSize);
|
||||||
|
IPage<SysAnnouncement> pageList = sysAnnouncementService.queryExpertPageList(page,userId,title,"1");
|
||||||
|
result.setSuccess(true);
|
||||||
|
result.setResult(pageList);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加
|
* 添加
|
||||||
* @param sysAnnouncement
|
* @param sysAnnouncement
|
||||||
|
|
|
@ -55,4 +55,13 @@ public interface SysAnnouncementMapper extends BaseMapper<SysAnnouncement> {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<String> getNotSendedAnnouncementlist(@Param("currDate") Date currDate, @Param("userId")String userId);
|
List<String> getNotSendedAnnouncementlist(@Param("currDate") Date currDate, @Param("userId")String userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过消息类型和专家id获取通告
|
||||||
|
* @param page
|
||||||
|
* @param userId 用户id
|
||||||
|
* @param msgCategory 消息类型
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<SysAnnouncement> queryExpertPageList(Page<SysAnnouncement> page, @Param("userId")String userId, @Param("title")String title,@Param("msgCategory")String msgCategory);
|
||||||
}
|
}
|
||||||
|
|
|
@ -112,4 +112,18 @@
|
||||||
user_id = #{userId}
|
user_id = #{userId}
|
||||||
)
|
)
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="queryExpertPageList" parameterType="String" resultMap="SysAnnouncement">
|
||||||
|
select id,titile,send_time,msg_content
|
||||||
|
from sys_announcement
|
||||||
|
where send_status = '1'
|
||||||
|
and del_flag = '0'
|
||||||
|
and msg_category = #{msgCategory}
|
||||||
|
<if test="title!=null and title!=''">
|
||||||
|
<bind name="bindtitle" value="'%'+title+'%'"/>
|
||||||
|
and username like #{bindtitle}
|
||||||
|
</if>
|
||||||
|
and id IN ( select annt_id from sys_announcement_send where user_id = #{userId})
|
||||||
|
order by send_time DESC
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
|
@ -91,4 +91,6 @@ public interface ISysAnnouncementService extends IService<SysAnnouncement> {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<String> getNotSendedAnnouncementlist(String userId);
|
public List<String> getNotSendedAnnouncementlist(String userId);
|
||||||
|
|
||||||
|
Page<SysAnnouncement> queryExpertPageList(Page<SysAnnouncement> page, String userId, String title, String msgCategory);
|
||||||
}
|
}
|
||||||
|
|
|
@ -235,4 +235,9 @@ public class SysAnnouncementServiceImpl extends ServiceImpl<SysAnnouncementMappe
|
||||||
return sysAnnouncementMapper.getNotSendedAnnouncementlist(new Date(), userId);
|
return sysAnnouncementMapper.getNotSendedAnnouncementlist(new Date(), userId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<SysAnnouncement> queryExpertPageList(Page<SysAnnouncement> page, String userId, String title, String msgCategory){
|
||||||
|
return page.setRecords(sysAnnouncementMapper.queryExpertPageList(page, userId, title, msgCategory));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,39 @@
|
||||||
|
<template>
|
||||||
|
<BasicModal v-bind="$attrs" @register="registerModal" title="查看详情" :showCancelBtn="false" :showOkBtn="false" width="900px">
|
||||||
|
<BasicForm @register="registerForm" disabled />
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, computed, unref } from 'vue';
|
||||||
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
||||||
|
import { BasicForm, useForm } from '/@/components/Form/index';
|
||||||
|
import { formSchema } from './notice.data';
|
||||||
|
|
||||||
|
//表单配置
|
||||||
|
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
||||||
|
schemas: formSchema,
|
||||||
|
showActionButtonGroup: false,
|
||||||
|
});
|
||||||
|
//表单赋值
|
||||||
|
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
|
||||||
|
//重置表单
|
||||||
|
await resetFields();
|
||||||
|
setModalProps({ confirmLoading: false });
|
||||||
|
if (data.record.userIds) {
|
||||||
|
data.record.userIds = data.record.userIds.substring(0, data.record.userIds.length - 1);
|
||||||
|
}
|
||||||
|
//表单赋值
|
||||||
|
await setFieldsValue({
|
||||||
|
...data.record,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="less">
|
||||||
|
.detail-iframe {
|
||||||
|
border: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
min-height: 500px;
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -0,0 +1,214 @@
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="table-container">
|
||||||
|
<div class="title-form">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="2" class="item-text-right">标题:</a-col>
|
||||||
|
<a-col :span="6">
|
||||||
|
<a-input style="width: 80%;!important;" placeholder="请输入标题" v-model:value="titile"></a-input>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="10">
|
||||||
|
<a-button style="margin-left: 8px" preIcon="ant-design:search-outlined" type="primary" @click="handleSelect">查询</a-button>
|
||||||
|
<a-button style="margin-left: 8px" preIcon="ic:baseline-restart-alt" @click="handleClear">重置</a-button>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</div>
|
||||||
|
<div class="item-table" v-loading="tableDataLoading">
|
||||||
|
<div v-if="noticeList.length > 0">
|
||||||
|
<div v-for="notice in noticeList">
|
||||||
|
<a-row class="item-header-border">
|
||||||
|
<a-col :span="22">
|
||||||
|
<span class="item-title">{{notice.titile}}</span>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="2" class="item-text-right">
|
||||||
|
<a-button class="item-button-border" type="link" @click="handleDetail(notice)">详情</a-button>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row class="item-content-border">
|
||||||
|
<a-col :span="24">
|
||||||
|
<div class="item-content" v-html="notice.msgContent"></div>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row class="item-bottom-border">
|
||||||
|
<a-col :span="24">
|
||||||
|
<div class="item-text-right item-padding-right item-bottom">{{notice.sendTime}}</div>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</div>
|
||||||
|
<div class="item-text-right item-padding-right">
|
||||||
|
<a-pagination
|
||||||
|
v-model:current="pageNo"
|
||||||
|
v-model:page-size-options="pageSizeOptions"
|
||||||
|
v-model:pageSize="pageSize"
|
||||||
|
v-model:total="total"
|
||||||
|
size="small"
|
||||||
|
show-size-changer
|
||||||
|
show-quick-jumper
|
||||||
|
:show-total="total => `共 ${total} 条数据`"
|
||||||
|
@change="onChange"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="noticeList.length == 0">
|
||||||
|
<a-empty style="padding-top: 100px;">
|
||||||
|
<template #description>
|
||||||
|
<p>
|
||||||
|
通知通告空空如也
|
||||||
|
</p>
|
||||||
|
</template>
|
||||||
|
</a-empty>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<DetailModal @register="detailModal"/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script lang="ts" name="system-notice" setup>
|
||||||
|
import {onMounted, ref} from 'vue';
|
||||||
|
import {defHttp} from "@/utils/http/axios";
|
||||||
|
import { Pagination } from 'ant-design-vue';
|
||||||
|
import {getToken} from "@/utils/auth";
|
||||||
|
import {useModal} from "@/components/Modal";
|
||||||
|
import DetailModal from './DetailModal.vue';
|
||||||
|
import {useGlobSetting} from "@/hooks/setting";
|
||||||
|
const glob = useGlobSetting();
|
||||||
|
const [detailModal, { openModal: openDetail }] = useModal();
|
||||||
|
const APagination = Pagination;
|
||||||
|
|
||||||
|
onMounted(()=>{
|
||||||
|
handleClear();
|
||||||
|
})
|
||||||
|
|
||||||
|
const statusData = ref([{id:'0',value:'草稿'},{id:'1',value:'已发布'},{id:'2',value:'已撤销'}]);
|
||||||
|
|
||||||
|
//页数
|
||||||
|
const pageNo = ref<number>(1);
|
||||||
|
//每页条数
|
||||||
|
const pageSize = ref<number>(10);
|
||||||
|
//下拉分页显示
|
||||||
|
const pageSizeOptions = ref<any>(['10', '20', '50', '100']);
|
||||||
|
//总数
|
||||||
|
const total = ref<number>(1);
|
||||||
|
|
||||||
|
let titile = ref('');
|
||||||
|
const noticeList = ref<any>([]);
|
||||||
|
const tableDataLoading = ref(false);
|
||||||
|
|
||||||
|
const onChange = (pageNumber: number) => {
|
||||||
|
handleSelect();
|
||||||
|
};
|
||||||
|
|
||||||
|
function showDictValue(data, datas){
|
||||||
|
const dictItem = datas.find(item => data === item.id);
|
||||||
|
return dictItem ? dictItem.value : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleSelect() {
|
||||||
|
tableDataLoading.value = true;
|
||||||
|
noticeList.value = [];
|
||||||
|
let params = {
|
||||||
|
"titile":titile.value,
|
||||||
|
"pageNo":pageNo.value,
|
||||||
|
"pageSize":pageSize.value,
|
||||||
|
}
|
||||||
|
defHttp.get({ url: "/sys/annountCement/expertList", params:params}).then((res)=>{
|
||||||
|
noticeList.value = res.records;
|
||||||
|
total.value = res.total;
|
||||||
|
});
|
||||||
|
tableDataLoading.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
function handleClear() {
|
||||||
|
titile.value = '';
|
||||||
|
pageNo.value = 1;
|
||||||
|
pageSize.value = 10;
|
||||||
|
handleSelect();
|
||||||
|
}
|
||||||
|
|
||||||
|
//详情
|
||||||
|
function handleDetail(record){
|
||||||
|
openDetail(true,{
|
||||||
|
record,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less">
|
||||||
|
|
||||||
|
.table-container {
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title-form{
|
||||||
|
padding: 8px 10px 8px 10px;
|
||||||
|
margin-bottom: 8px;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 2px;
|
||||||
|
line-height: 46px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-table{
|
||||||
|
padding: 6px;
|
||||||
|
background-color: #ffffff;
|
||||||
|
border-radius: 2px;
|
||||||
|
min-height: 600px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-header-border{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-width: 1px;
|
||||||
|
border-bottom-width: 0px;
|
||||||
|
border-left-width: 1px;
|
||||||
|
border-right-width: 1px;
|
||||||
|
border-color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-content-border{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-width: 1px;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-left-width: 1px;
|
||||||
|
border-right-width: 1px;
|
||||||
|
border-color: #333333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-bottom-border{
|
||||||
|
border-style: solid;
|
||||||
|
border-top-width: 0px;
|
||||||
|
border-bottom-width: 1px;
|
||||||
|
border-left-width: 1px;
|
||||||
|
border-right-width: 1px;
|
||||||
|
border-color: #333333;
|
||||||
|
margin-bottom: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-button-border{
|
||||||
|
border-style: solid;
|
||||||
|
border-left-width: 1px;
|
||||||
|
border-color: #e5e7eb;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-text-right{
|
||||||
|
text-align: right;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-title{
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 16px;
|
||||||
|
padding-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-content{
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-bottom{
|
||||||
|
line-height: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-padding-right{
|
||||||
|
padding-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
|
@ -0,0 +1,35 @@
|
||||||
|
import { BasicColumn, FormSchema } from '/@/components/Table';
|
||||||
|
import { rules } from '/@/utils/helper/validator';
|
||||||
|
import { render } from '/@/utils/common/renderUtils';
|
||||||
|
|
||||||
|
export const formSchema: FormSchema[] = [
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
label: 'id',
|
||||||
|
component: 'Input',
|
||||||
|
show: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'titile',
|
||||||
|
label: '标题',
|
||||||
|
component: 'Input',
|
||||||
|
required: true,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'sendTime',
|
||||||
|
label: '发布时间',
|
||||||
|
component: 'Input',
|
||||||
|
required: true,
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'msgContent',
|
||||||
|
label: '内容',
|
||||||
|
component: 'JEditor',
|
||||||
|
},
|
||||||
|
];
|
|
@ -92,7 +92,6 @@ import {ExclamationCircleOutlined} from "@ant-design/icons-vue";
|
||||||
const glob = useGlobSetting();
|
const glob = useGlobSetting();
|
||||||
const [detailModal, { openModal: openDetail }] = useModal();
|
const [detailModal, { openModal: openDetail }] = useModal();
|
||||||
const [noticeModal, { openModal }] = useModal();
|
const [noticeModal, { openModal }] = useModal();
|
||||||
const iframeUrl = ref('');
|
|
||||||
const APagination = Pagination;
|
const APagination = Pagination;
|
||||||
|
|
||||||
onMounted(()=>{
|
onMounted(()=>{
|
||||||
|
@ -149,8 +148,6 @@ function handleClear() {
|
||||||
function handleDetail(record){
|
function handleDetail(record){
|
||||||
openDetail(true,{
|
openDetail(true,{
|
||||||
record,
|
record,
|
||||||
isUpdate: true,
|
|
||||||
showFooter: true,
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue