增加问题主动上报内容

This commit is contained in:
xuli
2026-01-21 17:50:38 +08:00
parent 5aa7498225
commit 04356796fa
7 changed files with 117 additions and 156 deletions

View File

@@ -125,4 +125,50 @@ export function querytodaytasknum(data) {
}
/**主动上报 begin */
// 详情
export function patrolBugDetail(data) {
return request.post({
url: '/patrol/patrolBug/detail',
data
})
}
// 查询异常上报表列表
export function patrolBugList(data) {
return request.post({
url: '/patrol/patrolBug/list',
data
})
}
// 添加问题上报
export function patrolBugAdd(data) {
return request.post({
url: '/patrol/patrolBug/addBug',
data
})
}
// 编辑问题
export function patrolBugEdit(data) {
return request.post({
url: '/patrol/patrolBug/editBug',
data
})
}
// 删除问题
export function patrolBugDel(data) {
return request.post({
url: '/patrol/patrolBug/delBug',
data
})
}
// 添加追踪记录
export function patrolBugAddLog(data) {
return request.post({
url: '/patrol/patrolBug/addBuglog',
data
})
}
//
/**主动上报 end */

View File

@@ -68,7 +68,7 @@ const props = defineProps({
searchKeywords:{//搜索文本
type:String
},
searchType:{//哪种类型显示对象 typeId:1-首页2-业务首页3-消息 之后可以自动添加
searchType:{//哪种类型显示对象 typeId:1-首页2-业务首页3-消息, 4-问题,5-上报问题 之后可以自动添加
type:Object
},
searchTypeList:{//类型列表

View File

@@ -17,7 +17,7 @@
<view class="red-title">
问题名称
<view class="report-list">
<input class="r-input uni-input" v-model="optionObj.problemName" placeholder="请输入问题" placeholder-class="place-input" />
<input class="r-input uni-input" v-model="optionObj.bugName" placeholder="请输入问题" placeholder-class="place-input" />
</view>
</view>
<view class="report-border"></view>
@@ -28,7 +28,7 @@
<view class="report-border"></view>
<view class="report-list" style="display:block;">
问题描述
<textarea class="r-input textarea" v-model="optionObj.problemDesc" auto-height
<textarea class="r-input textarea" v-model="optionObj.bugDesc" auto-height
placeholder="请输入问题项描述" placeholder-class="place-input"
></textarea>
</view>
@@ -97,29 +97,25 @@ import chooseMediaVue from '@/components/chooseMedia.vue'
import mediaPreview from "@/components/mediaPreview.vue"
import DomVideoPlayer from 'uniapp-video-player'
import { getUserInfo } from '@/api/auth.js'
import { problemDetail,problemAdd,problemEdit,minioUpload } from '@/api/polling.js'
import { patrolBugDetail,patrolBugAdd,patrolBugEdit,minioUpload } from '@/api/polling.js'
import {compressImageUni,getFileType} from '@/utils/common.js'
import {showAlert,showLoading,hideLoading} from '@/utils/message.js'
import { MINIO_KEY } from '@/enums/cacheEnums';
const { proxy } = getCurrentInstance();
let taskId = ref('');//任务id
let groupId = ref('');//组id
let problemId = ref('');//问题id
let bugId = ref('');//问题id
let realname = ref('');
let desc = ref('');//描述
let minioObj = {};
onLoad(async option => {
// console.log(option)
taskId.value = option.taskId;
groupId.value = option.groupId;
problemId.value = option.problemId;
bugId.value = option.bugId;
minioObj = JSON.parse(uni.getStorageSync(MINIO_KEY) || "\{\}")
let userinfo = await getUserInfo({});
realname.value = userinfo.realname;
getList();
if(bugId.value)
getList();
})
onShow(()=>{
@@ -156,29 +152,16 @@ const downCallback = async (mescroll) => {
// 获取数据列表
const getList = async () => {
let param = {
taskId:problemId.value?undefined:taskId.value,
groupId:problemId.value?undefined:groupId.value,
problemId:problemId.value
bugId:bugId.value
}
let res = await problemDetail(param);
let res = await patrolBugDetail(param);
let data = res||{};
let pointIds = data.pointId?.split(",") || [];
data.pointList.forEach(item2=>{
item2.active=false;
for (let i = 0; i < pointIds.length; i++) {
if(item2.pointId == pointIds[i]){
item2.active=true;
break;
}
}
})
// 视频回显
imgArr.value = [];
mediaArr.value=[];
videoArr.value=[];
let fileList =data.problemVedio?.split(",") || [];
let fileList =data.bugVedio?.split(",") || [];
fileList.forEach(item=>{
mediaArr.value.push(item)
if(getFileType(item)=='image'){
@@ -204,60 +187,8 @@ let imgArr=ref([]);//图片 后台返回的
let videoArr = ref([]);//视频 后台返回的
let imgLoading = ref(false)
const chooseMedia = () => {
// console.log("chooseMedia=>")
proxy.$refs["chooseMediaRef"].openPicker();
imgLoading.value=true;
// uni.chooseMedia({
// count: 9,
// mediaType: ['image', 'video'], // 指定可选择图片和视频
// sourceType: ['album', 'camera'],
// maxDuration: 60, // 拍摄视频最长拍摄时间
// camera: 'back',
// success: (res) => {
// // console.log("chooseMedia=>",res)
// res.tempFiles.forEach(async file => {
// // console.log(`文件类型: ${file.fileType}, 文件路径: ${file.tempFilePath}`);
// let compressImg = file.tempFilePath;
// // 图片进行压缩
// if (file.fileType === 'image') {
// // #ifdef APP-PLUS
// // 压缩图片
// compressImg = await compressImageUni(file.tempFilePath);
// // #endif
// }
// // 执行上传
// let param = {
// filePath: compressImg,
// name: 'file',
// formData: {
// directory:'polling'
// },
// }
// imgLoading.value=true;
// minioUpload(param).then(res=>{
// let data = res.data;//console.log("上传成功后=>",res)
// mediaArr.value.push(data.fileName);
// if (file.fileType === 'image') {// 图片
// imgArr.value.push({
// shortUrl:minioObj.minioThumbUrl +"/"+data.fileName,
// url:minioObj.minioUrl +"/"+data.fileName,
// name:data.fileName
// })
// } else if (file.fileType === 'video') {// 视频
// videoArr.value.push({
// shortUrl:minioObj.minioThumbUrl +"/"+data.fileName,
// url:minioObj.minioUrl +"/"+data.fileName,
// name:data.fileName
// })
// }
// }).finally(()=>{
// imgLoading.value=false;
// })
// });
// }
// });
}
const closeMedia = ()=>{
imgLoading.value=false;
@@ -315,31 +246,19 @@ const handlePreviewClose=()=>{
videoShow.value = true;
}
// 红点点击
const handleRound=(item)=>{
item.active=!item.active
}
// 提交
const handleSubmit=()=>{
let pointIds = [];
optionObj.value.pointList.forEach(item => {
if(item.active){
pointIds.push(item.pointId)
}
});
showLoading("加载中...")
if(problemId.value){
if(bugId.value){
let param = {
problemId:problemId.value,
pointId:pointIds.join(","),
problemVedio:mediaArr.value.join(","),
problemDesc:optionObj.value.problemDesc
bugId:bugId.value,
bugName:optionObj.value.bugName,
bugVedio:mediaArr.value.join(","),
bugDesc:optionObj.value.bugDesc
}
// console.log("problemEdit=>",param)
problemEdit(param).then(res=>{
// console.log("patrolBugEdit=>",param)
patrolBugEdit(param).then(res=>{
// showAlert = (content, title = '提示',showCancel=false,succFun)
showAlert("修改问题上报成功!","提示",false,()=>{
uni.navigateBack()
@@ -349,16 +268,14 @@ const handleSubmit=()=>{
})
}else{
let param = {
taskId:taskId.value,
groupId:groupId.value,
pointId:pointIds.join(","),
problemVedio:mediaArr.value.join(","),
problemDesc:optionObj.value.problemDesc
bugName:optionObj.value.bugName,
bugVedio:mediaArr.value.join(","),
bugDesc:optionObj.value.bugDesc
}
// console.log("problemAdd=>",param)
problemAdd(param).then(res=>{
// console.log("patrolBugAdd=>",param)
patrolBugAdd(param).then(res=>{
showAlert("新建问题上报成功!","提示",false,()=>{
problemId.value = res;
bugId.value = res;
uni.navigateBack()
})
}).finally(()=>{

View File

@@ -6,7 +6,7 @@
:leftFlag="true" :rightFlag="true"
>
<template #right>
<view class="head-right" @click="handleQuestion" v-if="problemObj.problemStatus==1">
<view class="head-right" @click="handleQuestion" v-if="problemObj.bugStatus==1">
<view class="btn-yellow">
<uni-icons type="plus" size="20" color="#4C2D11"></uni-icons> 新增跟踪信息
</view>
@@ -22,7 +22,7 @@
:fixed="false" class="scroll-h"
>
<view class="white-bg">
<view class="red-title">问题{{problemObj.groupName}}</view>
<view class="red-title">问题{{problemObj.bugName}}</view>
<view class="report-border"></view>
<view class="report-list">
<view style="width:45%;display:flex;">
@@ -36,7 +36,7 @@
</view>
<view class="report-border"></view>
<view class="report-list">问题描述</view>
<view class="report-list report-gray">{{problemObj.problemDesc}}</view>
<view class="report-list report-gray">{{problemObj.bugDesc}}</view>
<view class="report-border"></view>
<view class="report-list">问题点位照片或视频</view>
<view class="report-list">
@@ -57,7 +57,7 @@
</view>
<!-- 当天提的 增加按钮 修改和删除 -->
<view class="btn-con" v-if="isToday && problemObj.problemStatus==1">
<view class="btn-con" v-if="isToday && problemObj.bugStatus==1">
<button type="primary" @click="handleUpdate" size="mini" style="margin-right:50rpx;" class="btn-primary">修改</button>
<button type="primary" @click="handleDelete" size="mini">删除</button>
</view>
@@ -111,17 +111,17 @@ import mediaPreview from "@/components/mediaPreview.vue"
import DomVideoPlayer from 'uniapp-video-player'
import { parseTime } from '@/utils/datetime.js';
import {getFileType} from '@/utils/common.js';
import { problemDetail,problemDel } from '@/api/polling.js'
import { patrolBugDetail,patrolBugDel } from '@/api/polling.js'
import { MINIO_KEY } from '@/enums/cacheEnums';
import {showAlert,showLoading,hideLoading} from '@/utils/message.js'
let problemId=ref('');
let bugId=ref('');
let problemObj = ref({});
let isToday = ref(false);
let minioObj = {};
onLoad(option => {
// console.log(option)
problemId.value = option.problemId;
bugId.value = option.bugId;
minioObj = JSON.parse(uni.getStorageSync(MINIO_KEY) || "\{\}")
})
@@ -155,9 +155,9 @@ const downCallback = async (mescroll) => {
// 获取数据列表
const getList = async() => {
isToday.value = false;
let data = await problemDetail({problemId:problemId.value});
data.list = data.pointName?.split(",") || [];
data.listFile=data.problemVedio?.split(",") || [];
let data = await patrolBugDetail({bugId:bugId.value});
// data.list = data.pointName?.split(",") || [];
data.listFile=data.bugVedio?.split(",") || [];
data.logList.forEach(item => {
item.listFile = item.logVedio?.split(",")||[]
});
@@ -188,21 +188,21 @@ const handlePreviewClose=()=>{
// 跳转问题上报页面
const handleQuestion=()=>{
uni.navigateTo({
url: '/pages/business/polling/problemInitiativeLog?problemId='+problemId.value
url: '/pages/business/polling/problemInitiativeLog?bugId='+bugId.value
});
}
// 修改
const handleUpdate=()=>{
uni.navigateTo({
url: '/pages/business/polling/problemInitiative?problemId='+problemId.value
url: '/pages/business/polling/problemInitiative?bugId='+bugId.value
});
}
// 删除
const handleDelete=()=>{
showLoading("加载中...")
problemDel({problemId:problemId.value}).then(res=>{
patrolBugDel({bugId:bugId.value}).then(res=>{
// content, title = '提示',showCancel=false,succFun
showAlert("删除成功!",'提示',false,()=>{
uni.navigateBack()

View File

@@ -19,22 +19,20 @@
<!-- 高度来避免头部遮挡 -->
<view class="top-height"></view>
<!-- 搜索处理 -->
<!-- 搜索处理 -->
<customSearch v-if="searchShow"
:searchKeywords="searchText"
:searchType="searchTypeObj"
:checkTypeObj="notictTypeCheck"
:searchTypeList="noticeTypeList"
@confirm="handleSearchConfirm"
></customSearch>
<view class="search" v-else @click="handleSearchFocus">
<view class="search-bg">
<view class="search-left">{{ notictTypeCheck.name?notictTypeCheck.name:'全部' }}</view>
<view class="search-right">
<uni-icons type="search" size="20" color="#ffffff"></uni-icons>
<input class="uni-input" v-model="searchText" placeholder="搜索" placeholder-class="search-color" />
</view>
</view>
<view class="search" v-else>
<uni-search-bar class="custom-search" radius="28"
placeholder="请输入搜索条件"
clearButton="auto" cancelButton="none"
bgColor="#6FA2F8" textColor="#ffffff"
@focus="handleSearchFocus"
v-model="searchText"
/>
</view>
<!-- 列表 -->
@@ -44,11 +42,11 @@
<block v-if="list.length>0">
<view class="report-list" v-for="(item, index) in list" :key="index" @click="handleDetail(item)">
<view class="r-list" style="padding-bottom:0">
<view class="r-name">{{ item.groupName }}</view>
<view class="r-name">{{ item.bugName }}</view>
<view class="r-right">
<!-- 问题状态 1=追踪2=关闭 -->
<view v-if="item.problemStatus==1" class="btn-red">进行中</view>
<view v-if="item.problemStatus==2" class="btn-green">已解决</view>
<view v-if="item.bugStatus==1" class="btn-red">进行中</view>
<view v-if="item.bugStatus==2" class="btn-green">已解决</view>
</view>
</view>
<view class="r-list">
@@ -77,7 +75,7 @@ import customSearch from '@/components/customSearch.vue'
import MescrollUni from 'mescroll-uni/mescroll-uni.vue';
import { getNavBarPaddingTop } from '@/utils/system.js'
import { parseTime } from '@/utils/datetime.js'
import { problemList } from '@/api/polling.js'
import { patrolBugList } from '@/api/polling.js'
onLoad(async(opt) => {
uni.setStorageSync('page_cache',true);
@@ -92,12 +90,7 @@ onMounted(() => {
// 搜索处理
let searchShow = ref(false);
let searchText = ref(undefined);
let searchTypeObj = ref({typeId:3,typeName:'巡检类型'});
let noticeTypeList=ref([
{id:1,name:'日常巡检'},
{id:2,name:'临时巡检'},
]);
let notictTypeCheck = ref({});//选中类型
let searchTypeObj = ref({typeId:5});
onHide(()=>{
searchShow.value=false;
@@ -115,7 +108,6 @@ const handleSearchFocus=()=>{
// 搜索完返回处理
const handleSearchConfirm = (param1,param2)=>{
// console.log(param1,param2)
notictTypeCheck.value=param1.value;
searchText.value=param2.value;;
searchShow.value=false;
}
@@ -192,9 +184,8 @@ const getList = (pageIndex, pageSize) => {
pageIndex,
pageSize,
key:searchText.value?searchText.value:undefined,
taskType:notictTypeCheck.value.id
}
let res = await problemList(param);
let res = await patrolBugList(param);
let list = res.list || [];
resolve({
list,
@@ -213,7 +204,7 @@ const handleQuestion=()=>{
// 查看详情
const handleDetail = (item) =>{
let url= '/pages/business/polling/problemInitiativeDetail?problemId='+item.problemId;
let url= '/pages/business/polling/problemInitiativeDetail?bugId='+item.bugId;
uni.navigateTo({
url
});
@@ -325,4 +316,8 @@ const handleDetail = (item) =>{
:deep(.mescroll-upwarp){
display: none !important;
}
:deep(.mescroll-empty){
display: none !important;
}
</style>

View File

@@ -14,7 +14,7 @@
:fixed="false" class="scroll-h"
>
<view class="white-bg">
<view class="red-title">问题{{optionObj.groupName}}</view>
<view class="red-title">问题{{optionObj.bugName}}</view>
<view class="report-border"></view>
<view class="report-list">
<view class="report-pro">提交人</view>
@@ -92,19 +92,19 @@ import mediaPreview from "@/components/mediaPreview.vue"
import chooseMediaVue from '@/components/chooseMedia.vue'
import DomVideoPlayer from 'uniapp-video-player'
import { getUserInfo } from '@/api/auth.js'
import { problemDetail,problemAddLog,minioUpload } from '@/api/polling.js'
import { patrolBugDetail,patrolBugAddLog,minioUpload } from '@/api/polling.js'
import { MINIO_KEY } from '@/enums/cacheEnums';
import {showAlert,showLoading,hideLoading} from '@/utils/message.js'
import {compressImageUni} from '@/utils/common.js'
const { proxy } = getCurrentInstance();
let problemId = ref('');
let bugId = ref('');
let realname = ref('');
let desc = ref('');//描述
let minioObj = {};
onLoad(async option => {
// console.log(option)
problemId.value = option.problemId;
bugId.value = option.bugId;
minioObj = JSON.parse(uni.getStorageSync(MINIO_KEY) || "\{\}")
let userinfo = await getUserInfo({});
@@ -145,9 +145,9 @@ const downCallback = async (mescroll) => {
// 获取数据列表
const getList = async () => {
let res = await problemDetail({problemId:problemId.value});
let res = await patrolBugDetail({bugId:bugId.value});
let data = res || {};
data.list = data.pointName.split(",") || [];
// data.list = data.pointName.split(",") || [];
optionObj.value = data;
}
@@ -269,12 +269,12 @@ const handlePreviewClose=()=>{
// 提交
const handleSubmit=()=>{
let param = {
problemId:problemId.value,
bugId:bugId.value,
logVedio:mediaArr.value.join(","),
logDesc:desc.value
}
// console.log("problemAddLog=>",param)
problemAddLog(param).then(res=>{
// console.log("patrolBugAddLog=>",param)
patrolBugAddLog(param).then(res=>{
showAlert("新建问题跟踪成功!");
uni.navigateBack();
}).finally(()=>{

View File

@@ -84,7 +84,7 @@ onMounted(() => {
// 搜索处理
let searchShow = ref(false);
let searchText = ref(undefined);
let searchTypeObj = ref({typeId:3,typeName:'巡检类型'});
let searchTypeObj = ref({typeId:4,typeName:'巡检类型'});
let noticeTypeList=ref([
{id:1,name:'日常巡检'},
{id:2,name:'临时巡检'},
@@ -295,4 +295,7 @@ const handleDetail = (item) =>{
:deep(.mescroll-upwarp){
display: none !important;
}
:deep(.mescroll-empty){
display: none !important;
}
</style>