Commit 7eb7bf7f authored by 罗新东's avatar 罗新东

修复了视屏无法播放的bug

parent bf784c55
......@@ -16,7 +16,7 @@
</keep-alive>
</transition>
<div :style="{height:tabH}"></div>
<tab-bar :index="1" v-if="showTab"></tab-bar>
<tab-bar v-if="showTab"></tab-bar>
</div>
</template>
......@@ -94,6 +94,7 @@ export default {
overflow: hidden;
position: relative;
overflow: hidden;
// z-index:999999999999
}
.router-view {
......
<template>
<div class="player">
<van-icon name="close" size="1rem" color="red" style="top:27%" @click="$emit('close')"/>
<video-player
style="position: absolute;
top: 50%;
width: 100%;
transform: translateY(-50%);"
class="video-player vjs-custom-skin"
ref="videoPlayer"
:options="playerOptions"
:playsinline="true" >
</video-player>
</div>
</template>
<script>
import Vue from "vue";
import VideoPlayer from "vue-video-player";
require("video.js/dist/video-js.css");
require("vue-video-player/src/custom-theme.css");
Vue.use(VideoPlayer);
export default {
name: "customPlayer",
data() {
return {
playerOptions: {
height: "360",
autoplay: true, // true:浏览器准备好时开始回放。
muted: false, // true:默认情况下将会消除任何音频。
language: "zh-CN",
// aspectRatio: "16:9", // 将播放器置于流畅模式,并在计算播放器的动态大小时使用该值。值应该代表一个比例 - 用冒号分隔的两个数字(例如"16:9"或"4:3")
fluid: true, // 当true时,Video.js player将拥有流体大小。换句话说,它将按比例缩放以适应其容器。
preload: 'auto', // 建议浏览器在加载元素后是否应该开始下载视频数据。auto浏览器选择最佳行为,立即开始加载视频(如果浏览器支持)
playbackRates: [0.7, 1.0, 1.5, 2.0],
sources: [
{
type: "video/mp4",
src:this.videoUrl,
},
],
// poster: "https://surmon-china.github.io/vue-quill-editor/static/images/surmon-1.jpg", // 你的封面地址
poster:this.videoImg,
notSupportedMessage: "此视频暂无法播放,请稍后再试", // 允许覆盖Video.js无法播放媒体源时显示的默认信息。
controlBar: {
timeDivider: true, //当前时间和持续时间的分隔符
durationDisplay: true, //显示持续时间
remainingTimeDisplay: false, //是否显示剩余时间功能
fullscreenToggle: true, // 全屏按钮
},
},
};
},
props: {
"videoUrl": {
type: String,
required: true
},
"videoImg": {
type: String,
required: true,
default:"https://surmon-china.github.io/vue-quill-editor/static/images/surmon-1.jpg"
}
},
mounted() {},
methods: {},
};
</script>
<style lang="less">
.player{
height: 100vh;
position: fixed;
z-index: 1000000000;
width: 100vw;
background-color: rgba(0, 0, 0, 0.5);
text-align: center;
}
//播放按钮样式
.video-player.vjs-custom-skin > .video-js .vjs-big-play-button{
width: 60px !important;
height:35px !important;
line-height: 35px !important;
border-radius: 5px !important;
font-size: 2.5em !important;
}
.vjs-custom-skin > .video-js .vjs-big-play-button {
top: 53%;
}
.vjs-poster{
border-radius: 10px i !important;
}
</style>
\ No newline at end of file
......@@ -17,17 +17,20 @@ import './permission'
import Cookies from 'js-cookie'
import { prefix } from '@/common/js/utils'
import { Divider, Popup, Overlay, Loading, Dialog, ContactCard, Form, AddressEdit, AddressList, Field, CellGroup, Cell, SwipeCell, Icon, Stepper, Card, Checkbox, CheckboxGroup, Button, Swipe, SwipeItem, PullRefresh, List, Tab, Tabs, GoodsAction, GoodsActionIcon, GoodsActionButton, SubmitBar, Toast ,Search,Picker,Uploader,Notify ,ContactList,Calendar,Radio,RadioGroup,Tag,Tabbar,TabbarItem,Sticky, Grid, GridItem,Skeleton,Col,Row, Image as VanImage, Badge,NoticeBar,DatetimePicker,
Step, Steps } from 'vant'
Step, Steps, ImagePreview } from 'vant'
import 'lib-flexible/flexible'
import vueEsign from 'vue-esign'
import VideoPlayer from 'vue-video-player'
// 全局过滤器
import filters from "@/utils/filters.js"
Vue.use(vueEsign)
Vue.prototype.util = util
Vue.use(vueEsign)
Vue.use(VideoPlayer)
Vue.use(Divider).use(Popup).use(Overlay).use(Loading).use(Dialog).use(Toast).use(ContactCard).use(Form).use(AddressEdit).use(AddressList).use(Field).use(CellGroup).use(Cell).use(SwipeCell).use(Icon).use(Stepper).use(Card).use(Button).use(Swipe).use(SwipeItem).use(PullRefresh).use(List).use(Tab).use(Tabs).use(GoodsAction).use(GoodsActionIcon).use(GoodsActionButton).use(SubmitBar).use(Checkbox).use(CheckboxGroup).use(Search).use(Picker).use(Uploader).use(Notify)
.use(ContactList).use(Calendar).use(Radio).use(RadioGroup).use(Tag).use(Tabbar).use(TabbarItem).use(Sticky)
.use(Grid).use(GridItem).use(Skeleton).use(Col).use(Row).use(VanImage).use(Badge).use(NoticeBar).use(DatetimePicker)
.use(Step).use(Steps)
.use(Step).use(Steps).use(ImagePreview)
Vue.config.productionTip = false
new Vue({
router,
......
......@@ -605,7 +605,17 @@ const routes = [{
index:1
},
component:()=>import('@/views/danger/insertDanger/list')
}
},
{
path:'/video',
name:'video-play',
meta:{
title:'视屏播放',
index:1
},
component:()=>import('@/components/video')
},
]
......
......@@ -30,6 +30,7 @@ service.interceptors.request.use(config => {
return Promise.reject(error)
})
service.interceptors.response.use(response => {
// console.log(response,'这是接口返回数据')
const res = response.data//获取请求返回数据
const code = response.status//获取请求响应码
if(code == 200) {//请求响应码200 代表已经请求到接口
......@@ -47,8 +48,14 @@ service.interceptors.response.use(response => {
removeToken()
location.reload()
});
}else{
Toast.fail({
title: '提示',
message: res.msg||'数据异常请稍后再试',
})
}
}else{
console.log('11111111')
Promise.reject(new Error('Error'))
}
},err=>{
......
......@@ -19,6 +19,7 @@
/>
<van-field
required
readonly
clickable
name="proId"
......@@ -27,7 +28,7 @@
placeholder="请选择"
@click="showProjectName = true"
:rules="[{ required: true, message: '所属项目不能为空' }]"
:class="{gray:isShowreturnCause}"
:class="{ gray: isShowreturnCause }"
/>
<van-popup
v-model="showProjectName"
......@@ -44,6 +45,7 @@
</van-popup>
<van-field
required
readonly
clickable
name="hdRange"
......@@ -52,7 +54,7 @@
placeholder="请选择"
@click="showRange = true"
:rules="[{ required: true, message: '适用范围不能为空' }]"
:class="{gray:isShowreturnCause}"
:class="{ gray: isShowreturnCause }"
/>
<van-popup
v-model="showRange"
......@@ -69,6 +71,7 @@
</van-popup>
<van-field
required
readonly
clickable
name="hdType"
......@@ -77,7 +80,7 @@
placeholder="请选择"
@click="showType = true"
:rules="[{ required: true, message: '隐患类型不能为空' }]"
:class="{'gray':isShowreturnCause}"
:class="{ gray: isShowreturnCause }"
/>
<van-popup v-model="showType" position="bottom" v-if="!isShowreturnCause">
<van-picker
......@@ -90,6 +93,7 @@
</van-popup>
<van-field
required
readonly
clickable
name="hdProjectName"
......@@ -98,7 +102,7 @@
placeholder="请选择"
@click="showDangerName = true"
:rules="[{ required: true, message: '隐患项目名称不能为空' }]"
:class="{gray:isShowreturnCause}"
:class="{ gray: isShowreturnCause }"
/>
<van-popup
v-model="showDangerName"
......@@ -115,6 +119,7 @@
</van-popup>
<van-field
required
class="gray"
v-model="dangerNum"
readonly
......@@ -124,6 +129,7 @@
:rules="[{ required: true, message: '隐患项目编号不能为空' }]"
/>
<van-field
required
class="gray"
v-model="dangerLevel"
readonly
......@@ -134,6 +140,7 @@
/>
<van-field
required
readonly
clickable
name="hdDiscoveryTime"
......@@ -156,6 +163,7 @@
</van-popup>
<van-field
required
readonly
clickable
name="dangerId"
......@@ -219,6 +227,7 @@
/>
<van-field
required
v-model="describe"
rows="3"
label="隐患描述"
......@@ -231,6 +240,7 @@
<van-field name="hdPicture1" label="隐患照片">
<template #input>
<van-uploader
@delete="deleteFile(...arguments,'uploaderImg')"
multiple
:max-count="5"
upload-text="最多上传五个"
......@@ -265,6 +275,7 @@
<template #input>
<van-uploader
multiple
@delete="deleteFile(...arguments,'uploaderVideo')"
:max-count="5"
upload-text="最多上传五个"
v-model="uploaderVideo"
......@@ -368,7 +379,7 @@ export default {
},
activated() {
this.taskId =
this.$route.params.taskId || localStorage.getItem("dangerAddTaskId");
this.$route.params.taskId || localStorage.getItem("dangerAddTaskId");
console.log(this.taskId);
if (this.taskId) {
this.isShowreturnCause = true;
......@@ -475,6 +486,24 @@ export default {
},
methods: {
async deleteFile(val,detail,key){
// console.log(val,detail)
if(val.fileId){
let formdata= new FormData();
formdata.append('key',val['fileId'])
let res = await postFun('/mobile/remove',formdata);
if(res){
console.log(res);
this.$toast({
title:'提示',
message:'删除成功!'
})
} else {
console.log('删除失败');
this[key].splice(detail.index,0,val)
}
}
},
dangerType(danger) {
// 严重隐患 = A
......@@ -520,18 +549,18 @@ export default {
formdata.append("dangerSource", values.dangerSource);
formdata.append("hdPosition", values.hdPosition);
formdata.append("hdDescribe", values.hdDescribe);
formdata.append("hdExpirationTime", values.hdExpirationTime);
formdata.append("rectificationUser", values.rectificationUser);
console.log(values.hdPicture1,'这是要上传的文件')
formdata.append("hdExpirationTime", values.hdExpirationTime||'');
formdata.append("rectificationUser", values.rectificationUser||'');
console.log(values.hdPicture1, "这是要上传的文件");
// 放图片路径 因为formdat存数组会自动变成字符串所以次用这种追加字段的方式
values.hdPicture1.forEach((item) => {
if(item.file){
formdata.append("hdPicture1[]", item.file?item.file:item);
if (item.file) {
formdata.append("hdPicture1[]", item.file);
}
});
values.hdVideo1.forEach((item) => {
if(item.file){
formdata.append("hdVideo1[]", item.file);
if (item.file) {
formdata.append("hdVideo1[]", item.file);
}
});
this.$toast.loading({
......@@ -628,11 +657,9 @@ export default {
};
});
postHdShowPeople(`/hdreport/showPeople/${msg.proId}`).then(
(res) => {
this.columnsRecPeople = res.data;
}
);
postHdShowPeople(`/hdreport/showPeople/${msg.proId}`).then((res) => {
this.columnsRecPeople = res.data;
});
})
.catch((err) => {
console.log(err);
......@@ -769,9 +796,9 @@ export default {
</script>
<style scoped lang="less">
/* @import url(); 引入css类 */
.gray{
/deep/.van-field__control{
color:gray !important;
.gray {
/deep/.van-field__control {
color: gray !important;
}
}
</style>
......@@ -17,9 +17,9 @@
</van-sticky>
<!-- tab标签 -->
<van-tabs
color="#2980f7"
@click="onClickTab($event, searchValue)"
animated
color="#2980F7"
:sticky="true"
offset-top="3rem"
>
......@@ -123,6 +123,7 @@
<van-col span="6">适用范围:</van-col>
<van-col span="18">{{ item.hdRange }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">隐患类型:</van-col>
<van-col span="18">{{ item.hdType }}</van-col>
......@@ -136,7 +137,7 @@
<van-col span="18">{{ item.dueDate | formatTime }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">状态:</van-col>
<van-col span="6">工单状态:</van-col>
<van-col span="18">{{ item.taskName }}</van-col>
</van-row>
......@@ -152,9 +153,9 @@
<van-button round type="info" @click="goDelay(item)"
>延期</van-button
>
<van-button round type="warning" @click="goClose(item)"
<!-- <van-button round type="warning" @click="goClose(item)"
>关闭</van-button
>
> -->
</div>
</van-overlay>
</van-cell-group>
......
<template>
<div>
<van-sticky>
<LHeader :text="text"></LHeader>
</van-sticky>
<van-sticky offset-top="1.5rem">
<van-search
v-model="searchValue"
......@@ -12,84 +14,111 @@
<div @click="onSearch">搜索</div>
</template>
</van-search>
</van-sticky>
<!-- 内容列表 -->
<div class="con-list" @touchmove="showIndex = null">
<van-cell-group
inset
v-for="(item, index) in messageList"
:key="index"
@click="touchstart(index, item)"
>
<van-row gutter="">
<van-col span="6">隐患编号:</van-col>
<van-col span="18">{{ item.businessId }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">所属项目:</van-col>
<van-col span="18">{{ item.proId }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">隐患级别:</van-col>
<van-col span="18">{{ item.hdLev | dangerText }}</van-col>
</van-row>
<!-- <van-row gutter="">
<van-col span="6">发现时间:</van-col>
<van-col span="18">{{ item.hdDiscoveryTime }}</van-col>
</van-row> -->
<van-row gutter="">
<van-col span="6">适用范围:</van-col>
<van-col span="18">{{ item.hdRange }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">隐患类型:</van-col>
<van-col span="18">{{ item.hdType }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">超期标识:</van-col>
<van-col span="18">{{ item | formatTime }}</van-col>
</van-row>
<!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop ="showIndex = null">
<van-button round type="primary" @click="goDetail(item)"
>详情</van-button
>
</van-sticky>
<!-- tab标签 -->
<van-tabs v-model="active" @change="postList" color="#2980f7" animated
:sticky="true"
offset-top="3rem">
<van-tab v-for="(item, key) in tabs" :key="key" :title="item.title">
<div v-show="key == active">
<div class="con-list" @touchmove="showIndex = null">
<van-cell-group
inset
v-for="(item, index) in messageList"
:key="index"
@click="touchstart(index, item)"
>
<van-row gutter="">
<van-col span="6">隐患编号:</van-col>
<van-col span="18">{{ item.businessId }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">所属项目:</van-col>
<van-col span="18">{{ item.proId }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">隐患级别:</van-col>
<van-col span="18">{{ item.hdLev | dangerText }}</van-col>
</van-row>
<!--<van-row gutter="">
<van-col span="6">发现时间:</van-col>
<van-col span="18">{{ item.hdDiscoveryTime }}</van-col>
</van-row> -->
<van-row gutter="">
<van-col span="6">适用范围:</van-col>
<van-col span="18">{{ item.hdRange }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">隐患类型:</van-col>
<van-col span="18">{{ item.hdType }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">超期标识:</van-col>
<van-col span="18">{{ item | formatTime }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">工单状态</van-col>
<van-col span="18">{{ item | formatTime }}</van-col>
</van-row>
<!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop="showIndex = null">
<van-button round type="primary" @click="goDetail(item)"
>详情</van-button
>
</div>
</van-overlay>
</van-cell-group>
</div>
</div>
<div
v-if="messageList.length == 0"
style="
width: 100%;
text-align: center;
font-size: 0.48rem;
position: fixed;
top: 30%;
"
>
暂无数据
</div>
</van-overlay>
</van-cell-group>
</div>
<!-- 暂无数据 -->
<div
style="width: 100%;text-align: center; font-size: .48rem;position: fixed; top: 30%;"
v-if="isHaveNews"
>
暂无数据
</div>
<tab-bar :index="1"></tab-bar>
</van-tab>
</van-tabs>
</div>
</template>
<script>
import tabBar from "@/components/TabBar";
import LHeader from "@/components/header.vue";
import {getFun,postFun} from "@/service/table.js";
import { getFun, postFun } from "@/service/table.js";
import { dangerStandBook } from "@/service/danger";
export default {
components: {
LHeader,
tabBar
},
data() {
return {
text: "隐患历史台账",
active: 0,
searchValue: "",
isHaveNews: false,
messageList: [],
Loop: "", // 定时器
showIndex: null // 是否显示遮罩层
showIndex: null, // 是否显示遮罩层
tabs: [
{
title: "已完结",
api: "/hdreport/doneList",
},
{
title: "已挂账",
api: "/hdreport/doneListRectification",
},
{
title: "已整改",
api: "/hdreport/doneListReview",
},
],
};
},
created() {
......@@ -97,23 +126,22 @@ export default {
},
methods: {
onSearch(val) {
this.postList(this.searchValue)
this.postList(this.searchValue);
},
postList(select='') {
postList(select = "") {
this.$toast.loading({
message: "加载中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
duration: 0,
});
let formdata=new FormData();
formdata.append('select',select);
dangerStandBook("/hdreport/doneList",formdata)
.then(res => {
let formdata = new FormData();
formdata.append("select", select);
postFun(this.tabs[this.active * 1]["api"], formdata)
.then((res) => {
this.$toast.clear();
this.messageList = res.rows;
// 判断有无数据返回
// 判断有无数据返回
if (this.messageList.length == 0) {
this.isHaveNews = true;
}
......@@ -127,7 +155,7 @@ export default {
touchstart(index, item) {
if (this.showIndex != null) {
this.showIndex = null;
return
return;
}
this.showIndex = index;
},
......@@ -135,26 +163,29 @@ export default {
// 详情
goDetail(data) {
this.$router.push({
name: "normal-detail",
params:{
id: data.businessId
}
name: "normal-detail",
params: {
id: data.businessId,
},
});
this.showIndex = null;
},
},
filters: {
formatTime: function(row) {
if (row.dueDate <= row.rectificationTime) {
return "超期"
} else if (row.dueDate >= row.rectificationTime && row.dueDate - 259200000 <= row.rectificationTime) {
//三天
return "临期"
} else {
return "正常"
}
}
}
formatTime: function (row) {
if (row.dueDate <= row.rectificationTime) {
return "超期";
} else if (
row.dueDate >= row.rectificationTime &&
row.dueDate - 259200000 <= row.rectificationTime
) {
//三天
return "临期";
} else {
return "正常";
}
},
},
};
</script>
<style lang="less" scoped>
......@@ -168,14 +199,14 @@ export default {
background-color: #f0f1f5;
.van-cell-group--inset {
margin: 0;
margin-bottom: 0.26667rem;
padding: 0.25rem;
font-size: 0.4rem;
position: relative;
border-radius: 4%;
box-shadow: 0px 0px 10px 2px #f3f3f3;
width: 90%;
margin: 0.4rem auto;
margin-bottom: 0.26667rem;
padding: 0.25rem;
font-size: 0.4rem;
position: relative;
border-radius: 4%;
box-shadow: 0px 0px 10px 2px #f3f3f3;
width: 90%;
margin: 0.4rem auto;
.van-row {
font-size: 0.4rem;
line-height: 0.8rem;
......
<template>
<div>
<div v-if="videoUrl">
<custom-player :videoUrl="videoUrl" :videoImg="videoImg" @close="videoUrl=''"/>
</div>
<LHeader :text="text"></LHeader>
<!-- 内容列表 -->
<div class="con-list">
<div class="cell-wrap">
<p>隐患上报</p>
<van-cell-group inset>
<van-row gutter="">
<van-col span="7"
><span class="field-title">隐患编号</span></van-col
>
<van-col span="17">{{ hdReport.id }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7"
><span class="field-title">所属项目:</span></van-col
......@@ -14,43 +24,38 @@
</van-row>
<van-row gutter="">
<van-col span="7"
><span class="field-title">隐患项目名称</span></van-col
><span class="field-title">隐患级别</span></van-col
>
<van-col span="17">{{ hdReport.hdProjectName }}</van-col>
<van-col span="17">{{ hdReport.hdLev }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7"
><span class="field-title">隐患发现时间</span></van-col
><span class="field-title">适用范围</span></van-col
>
<van-col span="17">{{ hdReport.hdDiscoveryTime }}</van-col>
<van-col span="17">{{ hdReport.hdRange }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7"
><span class="field-title">隐患级别</span></van-col
><span class="field-title">隐患类型</span></van-col
>
<van-col span="17">{{ hdReport.hdLev }}</van-col>
<van-col span="17">{{ hdReport.hdType }}</van-col>
</van-row>
<!-- 隐藏的字段 -->
<div v-show="reportOpen">
<van-row gutter="">
<van-col span="7"
><span class="field-title">适用范围</span></van-col
><span class="field-title">隐患项目名称</span></van-col
>
<van-col span="17">{{ hdReport.hdRange }}</van-col>
<van-col span="17">{{ hdReport.hdProjectName }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7"
><span class="field-title">隐患类型</span></van-col
><span class="field-title">隐患发现时间</span></van-col
>
<van-col span="17">{{ hdReport.hdType }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7"
><span class="field-title">隐患项目编号</span></van-col
>
<van-col span="17">{{ hdReport.hdProjectId }}</van-col>
<van-col span="17">{{ hdReport.hdDiscoveryTime }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="7"
><span class="field-title">风险源:</span></van-col
......@@ -75,7 +80,7 @@
>
<van-col span="17">{{ hdReport.hdDescribe }}</van-col>
</van-row>
<van-row gutter="">
<van-row gutter="" v-if="hdReport.hdPictureList">
<van-col span="7"
><span class="field-title">隐患照片:</span></van-col
>
......@@ -85,7 +90,7 @@
v-for="(item, index) in hdReport.hdPictureList"
:key="index"
>
<van-image width="100" height="100" :src="item.filePath" />
<van-image width="100" height="100" :src="item.filePath" @click="imagePreview(item.filePath)"/>
</div>
</van-col>
</van-row>
......@@ -98,18 +103,20 @@
class="detail_video"
v-for="(item, index) in hdReport.hdVideoList"
:key="index"
style="position:relative"
>
<video :src="item.filePath"></video>
<van-icon name="play" size="1rem" style="border:solid 3px black;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)"/>
<video :src="item.filePath" @click="videoUrl=item.filePath"/>
</div>
</van-col>
</van-row>
<van-row gutter="">
<van-row gutter="" v-if="hdReport.hdExpirationTime">
<van-col span="7"
><span class="field-title">隐患到期时间:</span></van-col
>
<van-col span="17">{{ hdReport.hdExpirationTime }}</van-col>
</van-row>
<van-row gutter="">
<van-row gutter="" v-if="hdReport.rectificationUser">
<van-col span="7"
><span class="field-title">隐患整改人:</span></van-col
>
......@@ -138,7 +145,7 @@
<van-col span="7"
><span class="field-title">隐患整改人:</span></van-col
>
<van-col span="17">{{ item.rectificationUser}}</van-col>
<van-col span="17">{{ item.rectificationUser }}</van-col>
</van-row>
<van-row gutter="" v-if="item.rectificationReview">
<van-col span="7"
......@@ -162,9 +169,10 @@
<van-col span="9"
><span class="field-title">隐患确认信息:</span></van-col
>
<van-col span="15">{{item.confirmResult==0?'退回':'通过'}}</van-col>
<van-col span="15">{{
item.confirmResult == 0 ? "退回" : "通过"
}}</van-col>
</van-row>
</div>
</van-step>
</van-steps>
......@@ -266,7 +274,7 @@
v-for="(itemTwo, index) in item.hdPictureList"
:key="index"
>
<van-image width="100" height="100" :src="itemTwo.filePath" />
<van-image width="100" height="100" :src="itemTwo.filePath" @click="imagePreview(itemTwo.filePath)"/>
</div>
</van-col>
</van-row>
......@@ -280,7 +288,7 @@
v-for="(itemTwo, index) in item.hdVideoList"
:key="index"
>
<video :src="itemTwo.filePath"></video>
<video :src="itemTwo.filePath" @click="videoUrl=itemTwo.filePath"></video>
</div>
</van-col>
</van-row>
......@@ -300,7 +308,7 @@
v-for="(item, index) in hdReviewList"
:key="index"
>
<van-row gutter="" v-if="item.hdPictureList['length']">
<van-row gutter="" v-if="item.hdPictureList">
<van-col span="7"
><span class="field-title">隐患照片:</span></van-col
>
......@@ -310,7 +318,7 @@
v-for="(itemTwo, index) in item.hdPictureList"
:key="index"
>
<van-image width="100" height="100" :src="itemTwo.filePath" />
<van-image width="100" height="100" :src="itemTwo.filePath" @click="imagePreview(itemTwo.filePath)"/>
</div>
</van-col>
</van-row>
......@@ -449,14 +457,20 @@
<script>
import LHeader from "@/components/header.vue";
import {getFun,postFun} from "@/service/table.js";
import { standBookDetail,deal } from "@/service/danger";
import { getFun, postFun } from "@/service/table.js";
import {ImagePreview} from 'vant';
import { standBookDetail, deal } from "@/service/danger";
import customPlayer from "@/components/video"
export default {
components: {
LHeader,
customPlayer
},
data() {
return {
videoImg:'12',
// 视屏播放
videoUrl:'',
id: "",
text: "隐患详情",
reportOpen: false,
......@@ -492,6 +506,9 @@ export default {
}
},
methods: {
imagePreview(item){
ImagePreview({closeable:true,images:[item]})
},
// 请求台账信息
postDetail() {
this.$toast.loading({
......@@ -500,7 +517,13 @@ export default {
loadingType: "spinner",
duration: 0,
});
(this.$route.params.method=='get'?getFun:postFun)(`${this.$route.params.api?this.$route.params.api:'/hdreport/hdDetailsApp/'}${this.id}`)
(this.$route.params.method == "get" ? getFun : postFun)(
`${
this.$route.params.api
? this.$route.params.api
: "/hdreport/hdDetailsApp/"
}${this.id}`
)
.then((res) => {
this.$toast.clear();
this.hdReport = res.data.hdReport;
......@@ -516,7 +539,7 @@ export default {
this.instructionsList = this.beifeninstructionsList.slice(-1);
})
.catch((err) => {
console.log(err)
console.log(err);
this.$toast.clear();
this.$toast.fail("加载失败,请稍后再试");
});
......@@ -650,10 +673,22 @@ export default {
height: 2.666667rem;
margin-right: 0.266667rem;
float: left;
video {
width: 2.666667rem;
height: 2.666667rem;
}
overflow: hidden;
// video {
// width: 2.666667rem;
// height: 2.666667rem;
// }
}
}
// 调整播放器样式
.video-js .vjs-icon-placeholder {
width: 100%;
height: 100%;
overflow: hidden;
// display: block;
}
.vjs_video_1251-dimensions.vjs-fluid {
padding-top: 4.25%;
}
</style>
......@@ -172,6 +172,7 @@
upload-text="最多上传五个"
v-model="setRankModeImg"
accept="file"
@delete="deleteFile(...arguments,'setRankModeImg')"
>
<template slot="default">
<!-- 11111111111 -->
......@@ -285,6 +286,7 @@
upload-text="最多上传五个"
v-model="technologyImg"
accept="file"
@delete="deleteFile(...arguments,'technologyImg')"
>
<template slot="default">
<!-- 11111111111 -->
......@@ -328,6 +330,7 @@
upload-text="最多上传五个"
v-model="administrationImg"
accept="file"
@delete="deleteFile(...arguments,'administrationImg')"
>
<template slot="default">
<!-- 11111111111 -->
......@@ -372,6 +375,7 @@
upload-text="最多上传五个"
v-model="urgentImg"
accept="file"
@delete="deleteFile(...arguments,'urgentImg')"
>
<template slot="default">
<!-- 11111111111 -->
......@@ -438,7 +442,7 @@ export default {
this.postReturnEcho();
}
this.getList();
this.$bus.$on("riskLevelBus", (res) => {
this.showSetRank = false; // 再次关闭弹出层 以防万一
console.log(Boolean(res));
......@@ -564,6 +568,24 @@ export default {
this.getList();
},
methods: {
async deleteFile(val,detail,key){
// console.log(val,detail)
if(val.fileId){
let formdata= new FormData();
formdata.append('key',val['fileId'])
let res = await postFun('/mobile/remove',formdata);
if(res){
console.log(res);
this.$toast({
title:'提示',
message:'删除成功!'
})
} else {
console.log('删除失败');
this[key].splice(detail.index,0,val)
}
}
},
onSubmit(values) {
let formdata = new FormData();
formdata.append("pId", this.projectId);
......@@ -675,35 +697,40 @@ export default {
this.mainDutyPeopLe = data.mainDutyPeopLe;
this.mainDutyDept = data1.dept.deptName;
this.technology = data.technicalMeasures;
// urgentImg administrationImg technologyImg
data.riskFileList4 = data.riskFileList4 || [];
data.riskFileList3 = data.riskFileList3 || [];
data.riskFileList2 = data.riskFileList2 || [];
data.riskFileList1 = data.riskFileList1 || [];
this.technologyFile = data.riskFileList1.map(() => {
return {
...item,
url: item.filePath,
};
});
this.urgentImg = data.riskFileList4.map(() => {
return {
...item,
url: item.filePath,
};
});
this.administrationImg = data.riskFileList3.map(() => {
return {
...item,
url: item.filePath,
};
});
this.technologyImg = data.riskFileList2.map(() => {
return {
...item,
url: item.filePath,
};
});
// urgentImg administrationImg technologyImg setRankModeImg
// 定级方式
this.urgentImg = res.data.imgsysFiles3 || [];
this.administrationImg = res.data.imgsysFiles2 || [];
this.administrationImg = res.data.imgsysFiles1 || [];
this.technologyImg = res.data.imgsysFiles0 || [];
console.log(data.riskFileList4, data.riskFileList3, data.riskFileList2, data.riskFileList1,'测试测试测试')
// this.technologyFile = res.data.riskFileList1.map(() => {
// return {
// ...item,
// url: item.filePath,
// };
// });
// this.urgentImg = data.riskFileList4.map(() => {
// console.log(111)
// return {
// ...item,
// url: item.filePath,
// };
// });
// this.administrationImg = data.riskFileList3.map(() => {
// return {
// ...item,
// url: item.filePath,
// };
// });
// this.technologyImg = data.riskFileList2.map(() => {
// return {
// ...item,
// url: item.filePath,
// };
// });
console.log('结果')
// 请求人员列表
let formdata = new FormData();
formdata.append("organizationId", data.responsibilityDept);
......
<template>
<div>
<LHeader :text="text"></LHeader>
<van-cell-group
inset
v-for="(item, index) in messageList"
:key="index"
@click="goDetail(item.taskId)"
>
<van-row gutter="">
<van-col span="6">所属项目:</van-col>
<van-col span="18">{{ item.proId }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">风险等级:</van-col>
<van-col span="18">{{ item.riskLevel }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">风险源:</van-col>
<van-col span="18">{{ item.riskSource }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">事故类型:</van-col>
<van-col span="18">{{ item.accidentType }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">管控层级:</van-col>
<van-col span="18">{{ item.controllevel }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">主责部门:</van-col>
<van-col span="18">{{ item.responsibilityDept }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">主责人员:</van-col>
<van-col span="18">{{ item.responsibilityMember }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">工单状态:</van-col>
<van-col span="18">{{ item.taskName }}</van-col>
</van-row>
<!-- 详情 -->
<div class="detail">详情</div>
</van-cell-group>
<div class="con-list">
<van-cell-group
inset
v-for="(item, index) in messageList"
:key="index"
@click="goDetail(item.taskId)"
>
<van-row gutter="">
<van-col span="6">所属项目:</van-col>
<van-col span="18">{{ item.proId }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">风险等级:</van-col>
<van-col span="18">{{ item.riskLevel }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">风险源:</van-col>
<van-col span="18">{{ item.riskSource }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">事故类型:</van-col>
<van-col span="18">{{ item.accidentType }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">管控层级:</van-col>
<van-col span="18">{{ item.controllevel }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">主责部门:</van-col>
<van-col span="18">{{ item.responsibilityDept }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">主责人员:</van-col>
<van-col span="18">{{ item.responsibilityMember }}</van-col>
</van-row>
<van-row gutter="">
<van-col span="6">工单状态:</van-col>
<van-col span="18">{{ item.taskName }}</van-col>
</van-row>
<!-- 详情 -->
<div class="detail">详情</div>
</van-cell-group>
</div>
<van-form
@submit="onSubmit"
:show-error="false"
......@@ -89,13 +89,13 @@
/>
</div>
<div style="margin: 16px;">
<div style="margin: 16px">
<van-button round block type="info" native-type="submit"
>保存</van-button
>
</div>
</van-form>
<div style="margin:10px 16px 0px;padding-bottom:16px">
<div style="margin: 10px 16px 0px; padding-bottom: 16px">
<van-button round block type="warning" @click.native="cancel"
>取消</van-button
>
......@@ -105,13 +105,13 @@
<script>
import LHeader from "@/components/header.vue";
import {getFun,postFun} from "@/service/table.js";
import { getFun, postFun } from "@/service/table.js";
import { postriskConAdd } from "@/service/risk";
export default {
name: "risk-affirm",
components: {
LHeader
LHeader,
},
data() {
return {
......@@ -120,12 +120,12 @@ export default {
radio: "1",
text: "风险确认",
agreeIdea: "", // 同意意见
disagreeIdea: "" //退回意见
disagreeIdea: "", //退回意见
};
},
beforeRouteEnter(to, from, next) {
next(vm => {
next((vm) => {
if (from.name === "risk-confirme") {
vm.messageList = [];
let paramsData = to.params.data;
......@@ -153,14 +153,14 @@ export default {
message: "提交中...",
forbidClick: true,
loadingType: "spinner",
duration: 0
duration: 0,
});
postriskConAdd(`/riskConfirm/add/${this.taskId}`, formdata)
.then(res => {
.then((res) => {
this.$toast.clear();
this.$toast.success({
message: "提交成功",
duration: 2000
duration: 2000,
});
history.go(-1);
})
......@@ -174,44 +174,78 @@ export default {
this.$router.push({
name: "risk-big-detail",
params: {
id: taskId
}
id: taskId,
},
});
},
cancel() {
this.$router.go(-1);
}
}
},
},
};
</script>
<style lang="less" scoped>
/* @import url(); 引入css类 */
.van-cell-group--inset {
margin: 0;
margin-bottom: 10px;
padding: 10px;
font-size: 13px;
position: relative;
.van-row {
margin-bottom: 0.133333rem;
line-height: 0.64rem;
}
.van-overlay {
position: absolute;
.wrapper {
display: flex;
align-items: center;
justify-content: space-evenly;
height: 100%;
// .van-cell-group--inset {
// margin: 0;
// margin-bottom: 10px;
// padding: 10px;
// font-size: 13px;
// position: relative;
// .van-row {
// margin-bottom: 0.133333rem;
// line-height: 0.64rem;
// }
// .van-overlay {
// position: absolute;
// .wrapper {
// display: flex;
// align-items: center;
// justify-content: space-evenly;
// height: 100%;
// }
// }
// }
// .detail {
// position: absolute;
// bottom: 0.32rem;
// right: 15px;
// color: #2a80f7;
// font-weight: none;
// z-index: 99;
// }
#app {
font-family: "";
color: #2c3e50;
}
/deep/.con-list {
padding: 0;
background-color: #f0f1f5;
.van-cell-group--inset {
margin: 0;
margin-bottom: 0.26667rem;
padding: 0.25rem;
font-size: 0.4rem;
position: relative;
border-radius: 4%;
box-shadow: 0px 0px 10px 2px #f3f3f3;
width: 90%;
margin: 0.4rem auto;
.van-row {
font-size: 0.4rem;
line-height: 0.8rem;
margin-bottom: 0;
}
.van-overlay {
position: absolute;
.wrapper {
display: flex;
align-items: center;
justify-content: space-evenly;
height: 100%;
}
}
}
}
.detail {
position: absolute;
bottom: 0.32rem;
right: 15px;
color: #2a80f7;
font-weight: none;
z-index: 99;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment