This commit is contained in:
2025-06-19 17:33:18 +08:00
commit f8f31dc4d9
437 changed files with 103080 additions and 0 deletions
@@ -0,0 +1,7 @@
{
"usingComponents": {
"van-dialog": "@vant/weapp/dialog/index",
"van-uploader": "@vant/weapp/uploader/index"
},
"navigationBarTitleText": "事件上报详情"
}
@@ -0,0 +1,223 @@
/* pages/eventReport/eventReportDetail/eventReportDetail.wxss */
.container {
height: 100vh;
padding-top: 2px;
box-sizing: border-box;
background: #EFF1F4;
overflow: hidden;
position: relative;
.bg {
width: 100%;
height: 250px;
position: absolute;
top: 0;
image {
width: 100%;
height: 100%;
display: block;
}
}
.top {
margin: 8px 8px 10px;
padding: 12px 10px;
margin-bottom: 8px;
background: #fff;
border-radius: 8px;
position: relative;
.row:first-child {
margin-bottom: 8px;
}
.row {
margin-bottom: 4px;
color: #2E3A4F;
font-size: 28rpx;
display: flex;
align-items: center;
justify-content: space-between;
.title {
font-size: 30rpx;
font-weight: bold;
}
.time {
color: #858CA0;
}
.type {
width: 104rpx;
height: 32rpx;
padding: 4rpx;
margin-left: 16rpx;
line-height: 32rpx;
// background: linear-gradient(270deg, #4CDBAD 0%, #2FCBAB 100%);
background: linear-gradient(90deg, #0D92FF 0%, #38B1FE 100%);
border-radius: 2px;
color: #fff;
text-align: center;
}
.type-g {
background: linear-gradient(270deg, #A1A8BB 0%, #838EAA 100%);
}
}
}
.detail-container {
height: calc(100vh - 72px - 80px - 40px);
box-sizing: border-box;
padding: 0px 8px 0px;
overflow: hidden;
position: relative;
.tabs-one {
background: transparent !important;
}
.tabs {
display: flex;
background: #E2F3FE;
border-radius: 8px 8px 0 0;
overflow: hidden;
.tab {
width: 50%;
height: 40px;
line-height: 40px;
color: #959595;
font-size: 16px;
font-weight: bold;
text-align: center;
position: relative;
.bg {
width: 100%;
height: 100%;
position: absolute;
image {
width: 100%;
height: 100%;
display: block;
}
}
.value {
position: relative;
}
}
.active {
// background: #fff;
color: #4381FC;
}
.active::after {
content: '';
width: 26px;
height: 4px;
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
border-radius: 2px;
position: absolute;
bottom: 2px;
left: 50%;
transform: translateX(-50%);
}
}
.content-borderall {
border-radius: 8px;
}
.content-nobtn{
max-height: calc(100vh - 76px - 40px - 136px) !important;
}
.content {
max-height: calc(100vh - 76px - 40px - 136px);
padding: 12px 10px;
// box-sizing: border-box;
border-radius: 0px 0px 8px 8px;
background: #fff;
overflow-y: auto;
.row {
margin-bottom: 8px;
display: flex;
justify-content: space-between;
// align-items: center;
.label {
width: 20%;
color: #858CA0;
font-size: 14px;
white-space: nowrap;
}
.val {
max-width: 80%;
color: #2E3A4F;
font-size: 14px;
}
.pic-box {
max-width: 70%;
display: flex;
justify-content: flex-end;
flex-wrap: wrap;
.item {
width: 84px;
height: 84px;
padding-left: 8px;
display: flex;
align-items: center;
image {
width: 100%;
height: 100%;
display: block;
}
}
}
}
.row2 {
margin-bottom: 8px;
font-size: 14px;
.label {
margin-bottom: 8px;
color: #858CA0;
}
.text-area {
width: 100%;
max-height: 100px;
overflow-y: auto;
}
}
}
}
.bottom {
width: 100%;
padding: 20px 12px;
background: #fff;
box-sizing: border-box;
border-radius: 8px 8px 0 0;
box-shadow: 0px -2px 12px 0px rgba(0,0,0,0.2);
position: absolute;
bottom: 0;
left: 0;
.btn-box {
width: 100%;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.btn {
width: 100%;
height: 40px;
line-height: 40px;
border-radius: 8px;
background: linear-gradient(90deg, #3B7CFC 0%, #548BFC 100%);
color: #fff;
font-size: 30rpx;
font-weight: bold;
text-align: center;
}
.btn-w100 {
width: 100% !important;
}
.btn1, .btn2, .btn3 {
width: calc((100% - 12px) / 2);
}
.btn1 {
background: #E4EDFF;
color: #4381FC;
}
.btn3 {
// margin-top: 14px;
box-sizing: border-box;
background: #FFFFFF;
border: 1px solid #D6D6D6;
color: #000;
}
}
}
}
@@ -0,0 +1,176 @@
// pages/eventReport/eventReportDetail/eventReportDetail.ts
import { getAction, deleteAction } from '../../../api/base';
import Dialog from '@vant/weapp/dialog/dialog';
Page({
/**
* 页面的初始数据
*/
data: {
tabActive: 0,
item: {} as any
},
// 变更tab
changeTab(e: any) {
console.log(e.currentTarget.dataset.tab);
this.setData({
tabActive: e.currentTarget.dataset.tab
});
},
getDetail(id: string) {
let params = { id: id };
getAction('api/event/info/getById', params).then((res: any) => {
if (res.code == 200) {
console.log(res.result);
res.result.fileUrlList = [];
if (res.result.fileUrl) {
for (let i = 0; i < res.result.fileUrl.split(',').length; i++) {
let pic = res.result.fileUrl.split(',')[i];
res.result.fileUrlList.push({
url: pic,
name: ''
});
}
}
if (res.result.isHandle == 1) {
res.result.eventProgress.handleFileList = [];
if (res.result.eventProgress.handleFile) {
for (
let i = 0;
i < res.result.eventProgress.handleFile.split(',').length;
i++
) {
let pic = res.result.eventProgress.handleFile.split(',')[i];
res.result.eventProgress.handleFileList.push({
url: pic,
name: ''
});
}
}
}
this.setData({
item: res.result
});
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
});
},
delItem() {
Dialog.confirm({
title: '提示',
message: '是否确认删除'
})
.then(() => {
// on confirm
let params = { id: this.data.item.id };
wx.showLoading({
title: '加载中'
});
deleteAction('api/event/info/delete', params).then((res: any) => {
wx.hideLoading();
if (res.code == 200) {
wx.showToast({
title: '删除成功',
icon: 'none'
});
setTimeout(() => {
wx.navigateBack({
delta: 1,
fail: e => {
console.log(e);
}
});
}, 500);
} else {
wx.showToast({
title: res.message,
icon: 'none'
});
}
});
})
.catch(() => {
// on cancel
});
},
toFeedback() {
let that = this;
wx.navigateTo({
url: '../eventReportFeedback/eventReportFeedback',
success: function (res) {
// 通过eventChannel向被打开页面传送数据
res.eventChannel.emit('eventName', { ...that.data.item });
},
fail: e => {
console.log(e);
}
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad() {
// // 接收传参
const eventChannel = this.getOpenerEventChannel();
eventChannel &&
eventChannel.on &&
eventChannel.on('eventName', data => {
console.log('接收参数', data);
// data.fileUrlList = [];
// if (data.fileUrl) {
// for (let i = 0; i < data.fileUrl.split(',').length; i++) {
// let pic = data.fileUrl.split(',')[i];
// data.fileUrlList.push({
// url: pic,
// name: ''
// });
// }
// }
// this.setData({
// item: data
// });
this.getDetail(data.id);
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {},
/**
* 生命周期函数--监听页面显示
*/
onShow() {},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {}
});
@@ -0,0 +1,102 @@
<!--pages/eventReport/eventReportDetail/eventReportDetail.wxml-->
<view class="container">
<view class="bg">
<image src="../../../images/bg_page_blue.png" mode=""/>
</view>
<view class="top">
<view class="row">
<view class="title">{{item.eventTheme ? item.eventTheme : '/'}}</view>
<view class="time">{{item.reportTime ? item.reportTime : '/'}}</view>
</view>
<view class="row">
<view class="val">{{item.projectId_dictText ? item.projectId_dictText : '/'}}</view>
<view class="type type-g" wx:if="{{item.isHandle == 1}}">已处理</view>
<view class="type" wx:else="">未处理</view>
</view>
</view>
<view class="detail-container">
<view class="tabs {{item.isHandle == 1 ? '' : 'tabs-one'}}">
<view class="tab {{tabActive == 0 ? 'active' : ''}}" data-tab="0" catch:tap="changeTab">
<view class="bg" wx:if="{{tabActive == 0}}"><image src="../../../images/btn_l.png" mode=""/></view>
<view class="value">事件详情</view>
</view>
<view class="tab {{tabActive == 1 ? 'active' : ''}}" wx:if="{{item.isHandle == 1}}" data-tab="1" catch:tap="changeTab">
<view class="bg" wx:if="{{tabActive == 1}}"><image src="../../../images/btn_r.png" mode=""/></view>
<view class="value">反馈详情</view>
</view>
</view>
<view class="content content-nobtn" wx:if="{{tabActive == 0}}">
<view class="row">
<view class="label">事件分类</view>
<view class="val">{{ item.eventCategory_dictText ? item.eventCategory_dictText : '/'}}</view>
</view>
<view class="row">
<view class="label">上报人</view>
<view class="val">{{ item.reportBy_dictText ? item.reportBy_dictText : '/'}}</view>
</view>
<view class="row">
<view class="label">联系电话</view>
<view class="val">{{ item.phoneNumber ? item.phoneNumber : '/'}}</view>
</view>
<view class="row">
<view class="label">上报时间</view>
<view class="val"> {{ item.reportTime ? item.reportTime : '/'}}</view>
</view>
<view class="row2">
<view class="label">事件内容</view>
<view class="text-area">
{{ item.eventText ? item.eventText : '/'}}
</view>
</view>
<view class="row">
<view class="label">备注</view>
<view class="val">{{ item.remark ? item.remark : '/'}}</view>
</view>
<view class="row">
<view class="label">附件</view>
<view class="val">
<!-- {{ item.fileUrl ? item.fileUrl : '/'}} -->
<van-uploader
file-list="{{ item.fileUrlList }}"
deletable="{{ false }}"
max-count="{{ item.fileUrlList.length }}" />
</view>
</view>
</view>
<view class="content" wx:if="{{item.isHandle == 1 && tabActive == 1}}">
<view class="row">
<view class="label">事件分类</view>
<view class="val">{{item.eventCategory_dictText ? item.eventCategory_dictText : '/'}}</view>
</view>
<view class="row">
<view class="label">实际处理人</view>
<view class="val">{{item.eventProgress.handleBy_dictText ? item.eventProgress.handleBy_dictText : '/'}}</view>
</view>
<view class="row">
<view class="label">上报时间</view>
<view class="val">{{item.eventProgress.handleTime ? item.eventProgress.handleTime : '/'}}</view>
</view>
<view class="row2">
<view class="label">处理结论</view>
<view class="text-area">{{item.eventProgress.handleResult ? item.eventProgress.handleResult : '/'}}</view>
</view>
<view class="row">
<view class="label">附件</view>
<view class="val">
<!-- {{item.eventProgress.handleFile ? item.eventProgress.handleFile : '/'}} -->
<van-uploader
file-list="{{ item.eventProgress.handleFileList }}"
deletable="{{ false }}"
max-count="{{ item.eventProgress.handleFileList.length }}" />
</view>
</view>
</view>
</view>
<view class="bottom" wx:if="{{item.canDelete || item.canHandle}}">
<view class="btn-box">
<view class="btn btn3 {{item.canDelete && !item.canHandle ? 'btn-w100' : ''}}" wx:if="{{item.canDelete}}" catch:tap="delItem">删除</view>
<view class="btn btn2 {{!item.canDelete && item.canHandle ? 'btn-w100' : ''}}" wx:if="{{item.canHandle}}" catch:tap="toFeedback">去处理</view>
</view>
<van-dialog id="van-dialog" />
</view>
</view>