安全通知能能修改->企业公告,通知公告部分

dev
WenShiJun 2024-02-28 19:33:03 +08:00
parent f80b00bd8c
commit c36e88fba1
6 changed files with 177 additions and 77 deletions

View File

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="ProjectRootManager" version="2" default="true"> <component name="ProjectRootManager" version="2" default="true">
<output url="file://$PROJECT_DIR$/classes" /> <output url="file://$PROJECT_DIR$/classes" />

View File

@ -1,5 +1,5 @@
// export var basePath = "http://192.168.0.42:8099/"; // export var basePath = "http://192.168.0.42:8099/";
export var basePath = "http://192.168.0.49:8091"; export var basePath = "http://192.168.0.49:8093/";
// export var basePath = "https://gateway.qhdsafety.com/"; // export var basePath = "https://gateway.qhdsafety.com/";
export const baseImgPath = "https://file.zcloudchina.com/YTHFile"; export const baseImgPath = "https://file.zcloudchina.com/YTHFile";
export const adminPath = "http://192.168.0.18:8085"; export const adminPath = "http://192.168.0.18:8085";

View File

@ -24,7 +24,6 @@
<view v-if="mesCount>0" class="cu-tag badge">{{mesCount}}</view> <view v-if="mesCount>0" class="cu-tag badge">{{mesCount}}</view>
</view> </view>
<view :class="PageCur=='works'?'text-blue':'text-gray'">通知</view> <view :class="PageCur=='works'?'text-blue':'text-gray'">通知</view>
</view> </view>
<view class="action" @click="NavChange" data-cur="my"> <view class="action" @click="NavChange" data-cur="my">
<view class='cuIcon-cu-image'> <view class='cuIcon-cu-image'>
@ -166,7 +165,7 @@
title: '请稍候' title: '请稍候'
}) })
uni.request({ uni.request({
url: basePath + '/app/notice/getRedPoint', url: basePath + '/app/trafficNotice/getRedPoint',
method: 'POST', method: 'POST',
dataType: 'json', dataType: 'json',
header: { header: {
@ -177,7 +176,6 @@
USER_ID:loginUser.USER_ID, USER_ID:loginUser.USER_ID,
}, },
success: (res) => { success: (res) => {
if("success" == res.data.result){ if("success" == res.data.result){
uni.hideLoading(); uni.hideLoading();
_this.mesCount = res.data.count; _this.mesCount = res.data.count;

View File

@ -189,7 +189,7 @@
title: '请稍候' title: '请稍候'
}) })
uni.request({ uni.request({
url: basePath + '/app/notice/listForCp', url: basePath + '/app/trafficNotice/getRedPoint',
method: 'POST', method: 'POST',
dataType: 'json', dataType: 'json',
header: { header: {

View File

@ -41,7 +41,7 @@
<scroll-view class="dy-scroll-nobg" scroll-y :style="'top:'+sTop+'px;height:calc(100vh - '+totalHeight+'px)'"> <scroll-view class="dy-scroll-nobg" scroll-y :style="'top:'+sTop+'px;height:calc(100vh - '+totalHeight+'px)'">
<view v-if="list.length>0" > <view v-if="list.length>0" >
<view class="news-list"> <view class="news-list">
<view class="news-item" v-for="item in list" :key="item.NOTICE_ID" @click="$noMultipleClicks(goToDetail,item.NOTICE_ID)"> <view class="news-item" v-for="item in pclist" :key="item.NOTIFICATION_ID" @click="$noMultipleClicks(goToPcDetail, item.NOTIFICATION_ID)">
<view class="news-media-list"> <view class="news-media-list">
<!-- <image src="https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg" mode="aspectFill" class="news-media-logo"></image>--> <!-- <image src="https://ossweb-img.qq.com/images/lol/web201310/skin/big10006.jpg" mode="aspectFill" class="news-media-logo"></image>-->
<view class="news-media-body"> <view class="news-media-body">
@ -75,17 +75,17 @@
<view class="news-item" v-for="item in pclist" :key="item.NOTICECORP_ID" > <view class="news-item" v-for="item in pclist" :key="item.NOTICECORP_ID" >
<view class="news-media-list"> <view class="news-media-list">
<view class="news-media-body"> <view class="news-media-body">
<view class="news-media-title" @click="$noMultipleClicks(goToPcDetail,item.NOTICECORPUSERID_ID)"> <view class="news-media-title" @click="$noMultipleClicks(goToPcDetail,item.NOTIFICATION_ID)">
{{item.SYNOPSIS}} {{item.LEVEL}}
<text style="float:right;"> <text style="float:right;">
<template v-if="item.TYPE=='0'"></template> <template v-if="item.TYPE=='0'"></template>
<template v-else-if="item.TYPE=='1'">已读</template> <template v-else-if="item.TYPE=='1'">已读</template>
</text> </text>
</view> </view>
<view class="news-media-text"> <view class="news-media-text">
<text>{{item.CREATTIME}}</text> <text>{{item.CREATETIME}}</text>
<view v-if="item.TYPE=='1'" style="float:right;"> <view v-if="item.TYPE=='1'" style="float:right;">
<button class="cu-btn round bg-red" style="height:40upx;" @click="deleteNotice(item.NOTICECORPUSERID_ID)"></button> <button class="cu-btn round bg-red" style="height:40upx;" @click="deleteNotice(item.NOTIFICATION_ID)"></button>
</view> </view>
</view> </view>
</view> </view>
@ -232,7 +232,7 @@
title: '请稍候' title: '请稍候'
}) })
uni.request({ uni.request({
url: basePath + '/app/notice/listForCp', url: basePath + '/app/trafficNotice/listForCp',
method: 'POST', method: 'POST',
dataType: 'json', dataType: 'json',
header: { header: {
@ -241,7 +241,7 @@
data: { data: {
showCount : _this.showCount, showCount : _this.showCount,
currentPage : _this.currentPage, currentPage : _this.currentPage,
KEYWORDS:_this.KEYWORDS, KEYWORDS:_this.KEYWORDS,
loginUserId :loginUserId, loginUserId :loginUserId,
CORPINFO_ID:loginUser.CORPINFO_ID, CORPINFO_ID:loginUser.CORPINFO_ID,
USER_ID:loginUser.USER_ID, USER_ID:loginUser.USER_ID,
@ -285,14 +285,14 @@
title: '处理中' title: '处理中'
}) })
uni.request({ uni.request({
url: basePath+'/app/notice/delete', url: basePath+'/app/trafficNotice/delete',
method: 'POST', method: 'POST',
dataType: 'json', dataType: 'json',
header: { header: {
'Content-type':'application/x-www-form-urlencoded' 'Content-type':'application/x-www-form-urlencoded'
}, },
data: { data: {
NOTICECORPUSERID_ID: ID NOTIFICATION_ID: ID
}, },
success: (res) => { success: (res) => {
uni.hideLoading(); uni.hideLoading();

View File

@ -6,24 +6,38 @@
</cu-custom> </cu-custom>
<scroll-view scroll-y> <scroll-view scroll-y>
<view class="message-warp"> <view class="message-warp">
<view class="title"> <view class="title">
{{pd.SYNOPSIS}} 通知标题
</view> </view>
<view class="info"> <view class="info">
<!-- <text>双控平台</text>--> {{pd.TITLE}}
<text>{{pd.CREATTIME}}</text>
</view>
<view class="content">
<rich-text :nodes="content"></rich-text>
</view>
<view class="message-warp" v-if="pd.FILEPATH">
<view class="cu-item" @click="$noMultipleClicks(goStuToOpen,pd.FILEPATH)">
<view class="content">
<text class="cuIcon-read text-blue"></text>
<text class="text-grey">附件</text>
</view>
</view>
</view> </view>
<view class="title">
通知内容
</view>
<view class="info">
{{pd.NOTIFICATIONCONTENT}}
</view>
<view class="info">
<text>{{pd.CREATETIME}}</text>
</view>
<view class="message-warp" v-if="pd.VIDEO_ROUTE">
<video :src="pd.VIDEO_ROUTE" controls="true"></video>
</view>
<view class="message-warp" v-if="pd.ATTACHMENT_ROUTE">
<view class="cu-item" @click="$noMultipleClicks(goStuToOpen,pd.ATTACHMENT_ROUTE)">
<view class="content">
<text class="cuIcon-read text-blue"></text>
<text class="text-grey">附件</text>
</view>
</view>
</view>
<view v-if="pd.REPLYSTATUS === '1'">
<view class="reply-title">回复内容</view>
<input type="text" class="reply-input" v-model="replyContent" placeholder="请输入回复内容" />
<button class="submit-btn" @click="confirmReply" v-show="pd.REPLYSTATUS === '1'"></button>
</view>
</view> </view>
<view class="cu-tabbar-height"></view> <view class="cu-tabbar-height"></view>
</scroll-view> </scroll-view>
@ -32,68 +46,133 @@
<script> <script>
import { import {
basePath,loginUserId,corpinfoId,loginUser,baseImgPath basePath,loginUser,baseImgPath
} from '@/common/tool.js'; } from '@/common/tool.js';
import HTMLParser from "@/components/html-parser.js" import HTMLParser from "@/components/html-parser.js"
export default { export default {
data() { data() {
return { return {
id:'', id:'',
content:'', content:'',
pd:[], pd: {},
type:'', type:'',
noClick:true, noClick:true,
isConfirmed: false,
replyContent: '',
} }
}, },
onLoad(e){ onLoad(e){
this.type =e.type; this.type =e.type;
this.id=e.id; this.id=e.id;
this.getData(); this.getData();
this.sendEditRequest();
this.markAsRead();
console.log(e) console.log(e)
}, },
methods: { methods: {
getData() { confirmReply() {
var _this = this; this.isConfirmed = true;
uni.showLoading({ this.sendEditRequest();
title: '请稍候' },
}) getData() {
var url = basePath + '/app/notice/goEdit' var _this = this;
if("1"==_this.type){ uni.showLoading({
url = basePath + '/app/notice/goEditForPc' title: '请稍候'
} });
console.log(_this.id)
uni.request({ var requestData = {
url:url, NOTIFICATION_ID: _this.id,
method: 'POST', USER_ID: loginUser.USER_ID,
dataType: 'json', };
header: {
'Content-type':'application/x-www-form-urlencoded' uni.request({
}, url: basePath + '/app/trafficNotice/listForCp',
data: { method: 'POST',
NOTICECORPUSERID_ID:_this.id, dataType: 'json',
loginUserId:loginUserId, header: {
corpinfoId:corpinfoId, 'Content-type': 'application/x-www-form-urlencoded'
ISMAIN:loginUser.ISMAIN, },
CORPINFO_ID:loginUser.CORPINFO_ID, data: requestData,
USER_ID:loginUser.USER_ID, success: (res) => {
}, if ("success" == res.data.result && res.data.varList && res.data.varList.length > 0) {
success: (res) => { _this.pd = res.data.varList[0];
if("success" == res.data.result){ _this.content = new HTMLParser(_this.pd.NOTIFICATIONCONTENT.trim());
uni.hideLoading(); if (_this.pd.REPLYCONTENT && _this.pd.REPLYCONTENT.trim() !== '') {
_this.pd = res.data.pd; _this.replyContent = _this.pd.REPLYCONTENT;
_this.content= new HTMLParser(res.data.pd.CONTENT.trim()); }
var pages = getCurrentPages(); // uni.hideLoading();
var prePage = pages[pages.length - 2]; // } else {
prePage.$vm.initflag = true; // A init true uni.showToast({
} else { title: '数据加载失败',
uni.showToast({ duration: 2000
title: res.data.message, });
duration: 2000 uni.hideLoading();
}); }
} },
} fail: () => {
}); uni.showToast({
}, title: '请求失败',
icon: 'none',
duration: 2000
});
uni.hideLoading();
}
});
},
markAsRead() {
const _this = this;
uni.request({
url: basePath + '/app/trafficNotice/edit',
method: 'POST',
header: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: {
NOTIFICATION_ID: _this.id,
USER_ID: loginUser.USER_ID,
TYPE: _this.type,
},
});
},
sendEditRequest() {
if (!this.isConfirmed) {
return;
}
var _this = this;
var requestData = {
NOTIFICATION_ID: _this.id,
USER_ID: loginUser.USER_ID,
REPLYCONTENT: _this.replyContent
};
if (!_this.replyContent) {
uni.showToast({
title: '回复内容不能为空',
icon: 'none',
duration: 2000
});
return;
}
uni.request({
url: basePath + '/app/trafficNotice/edit',
method: 'POST',
dataType: 'json',
header: {
'Content-type': 'application/x-www-form-urlencoded'
},
data: requestData,
success: (res) => {
if (res.data.result === "success") {
uni.showToast({
title: '回复成功',
duration: 2000
});
_this.replyContent = ''; //
this.isConfirmed = false; //
}
},
});
},
goStuToOpen(e) { goStuToOpen(e) {
var url=baseImgPath + e ; var url=baseImgPath + e ;
var url2 = encodeURI(url); var url2 = encodeURI(url);
@ -113,7 +192,31 @@
font-size: 34upx; font-size: 34upx;
margin-bottom: 20upx; margin-bottom: 20upx;
} }
.submit-btn {
background-color: #007AFF; /* 蓝色背景 */
color: white; /* 白色文字 */
border: none; /* 无边框 */
padding: 5upx 10upx; /* 内边距 */
font-size: 18upx; /* 字体大小 */
margin-top: 10upx; /* 上边距 */
border-radius: 5upx; /* 圆角 */
width: auto; /* 修改处:宽度自动,取决于内容和内边距 */
max-width: 100upx; /* 修改处:最大宽度,可以根据需要调整 */
display: block; /* 块级元素 */
margin-left: auto; /* 水平居中 */
margin-right: auto; /* 水平居中 */
}
.reply-input {
box-sizing: border-box;
border: 1px solid #dcdfe6; /* 设置边框颜色和宽度 */
border-radius: 4px; /* 轻微圆角效果 */
padding: 10px; /* 设置一些内边距*/
font-size: 16px; /* 设置适当的字体大小 */
color: #606266; /* 设置字体颜色 */
margin: 10px 0; /* 设置上下外边距 */
width: 100%; /* 宽度设置为100% */
height: 40px; /* 设置一个固定的高度 */
}
.info { .info {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;