Commit 12f84d52 authored by 王李辉's avatar 王李辉

风险新增模块页面搭建

parent dbd40972
......@@ -272,13 +272,13 @@ const routes = [
component: () => import(/* webpackChunkName: "SaveWorkbench" */ '../views/danger/addDanger/addDanger'),
},
{
path: '/confirm-danger',
name: 'confirm-danger',
path: '/confirme-danger',
name: 'confirme-danger',
meta: {
title:'隐患确认',
index: 1
},
component: () => import(/* webpackChunkName: "SaveWorkbench" */ '../views/danger/confirmDanger'),
component: () => import(/* webpackChunkName: "SaveWorkbench" */ '../views/danger/confirmeDanger'),
},
{
path: '/affirm-danger',
......@@ -287,7 +287,7 @@ const routes = [
title:'隐患确认表单',
index: 1
},
component: () => import(/* webpackChunkName: "SaveWorkbench" */ '../views/danger/confirmDanger/confirmDanger'),
component: () => import(/* webpackChunkName: "SaveWorkbench" */ '../views/danger/confirmeDanger/confirmeDanger'),
},
{
path: '/change-danger',
......@@ -325,7 +325,42 @@ const routes = [
},
component: () => import(/* webpackChunkName: "SaveWorkbench" */ '../views/danger/reviewDanger/reviewAdd'),
},
{
path: '/risk',
name: 'risk',
meta: {
title:'风险',
index: 1
},
component: () => import(/* webpackChunkName: "SaveWorkbench" */ '../views/risk'),
},
{
path: '/risk-add',
name: 'risk-add',
meta: {
title:'风险上报',
index: 1
},
component: () => import(/* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskAdd'),
},
{
path: '/risk-confirme',
name: 'risk-confirme',
meta: {
title:'风险确认',
index: 1
},
component: () => import(/* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskConfirme'),
},
{
path: '/risk-affirm',
name: 'risk-affirm',
meta: {
title:'风险确认',
index: 1
},
component: () => import(/* webpackChunkName: "SaveWorkbench" */ '../views/risk/riskConfirme/riskAffirm'),
},
]
......
import request from '@/utils/axios'
// 隐患上报模块
// 隐患上报已退回
export function dangerReturn(url,data) {
return request({
url: url,
method: 'post',
data
})
}
\ No newline at end of file
export function timestampToTime (time,type,zero,num) {
if(!time){return ''}
try{
var date = new Date(time)
if(num&&typeof parseInt(num)=="number"){
date = new Date(new Date(time).getTime()+num*60*60*24*1000)//时间戳以毫秒为单位,也可用其他日期格式
}
let yy = date.getFullYear();//年
let mm = date.getMonth()+1;//月
let dd = date.getDate();//日
let hh = date.getHours();//小时
let mf = date.getMinutes()<10 ? '0'+date.getMinutes() : date.getMinutes();//分钟
let ss = date.getSeconds()<10 ? '0'+date.getSeconds() : date.getSeconds();//秒
if(zero){
if(mm<10){mm='0'+mm}
if(dd<10){dd='0'+dd}
if(hh<10){hh='0'+hh}
}
if(type=="DT1"){
return yy+'-'+mm+'-'+dd+' '+hh+':'+mf+':'+ss;//yyyy-mm-dd hh:mf:ss
}else if(type=="DT2"){
return yy+'-'+mm+'-'+dd;//yyyy-mm-dd
}else if(type=="DT3"){
return yy+'/'+mm+'/'+dd+' '+hh+':'+mf+':'+ss;//yyyy/mm/dd hh:mf:ss
}else if(type=="DT4"){
return yy+'-'+mm+'-'+dd;//yyyy/mm/dd
}else if(type=="DT5"){
return date.getTime();//时间戳 秒数
}else if(type=="DT6"){
return yy+''+mm+''+dd+''+hh+''+mf+''+ss+'';//yyyy年mm月dd日 hh时mf分ss秒
}else if(type=="DT7"){
return yy+''+mm+''+dd+'';//yyyy年mm月dd日
}
}catch(e){
console.log("timestampToTime Error");return ""
}
}
\ No newline at end of file
......@@ -95,8 +95,8 @@ export default {
.login {
background-size: cover;
background-repeat: no-repeat;
background-position: center;
background-attachment: fixed;
// background-position: center;
// background-attachment: fixed;
.login-logo {
width: 120px;
margin: 22% auto 0px;
......
......@@ -3,8 +3,9 @@
<LHeader :text="text"></LHeader>
<van-form
@submit="onSubmit"
:show-error-message="false"
:scroll-to-error="true"
:show-error='false'
validate-trigger="onSubmit"
>
<van-field
v-model="gongcheng"
......@@ -180,6 +181,7 @@
<script>
import LHeader from "@/components/header.vue";
import { timestampToTime } from '@/utils/format'
export default {
components: {
LHeader
......@@ -217,12 +219,11 @@ export default {
console.log("submit", values);
},
onConfirmrili(date) {
this.timeval = this.format(date)
this.timeval = timestampToTime(date,'DT1',true)
this.showCalendar = false;
},
onConfirmdaoqi(date) {
this.daoqitimeval = this.format(date)
// this.daoqitimeval = `${date.getMonth() + 1}/${date.getDate()}`;
this.daoqitimeval = timestampToTime(date,'DT1',true)
this.daoqishowCalendar = false;
},
onConfirmfengxian(value) {
......@@ -237,16 +238,6 @@ export default {
cancel() {
this.$router.go(-1);
},
format(value){
let myDate
if (value.getMinutes() <= 9) {
myDate = value.getFullYear() + '-' + (value.getMonth() + 1) + '-' + value.getDate() + ' ' + value.getHours() + ':' + '0' + value.getMinutes();
} else {
myDate = value.getFullYear() + '-' + (value.getMonth() + 1) + '-' + value.getDate() + ' ' + value.getHours() + ':' + value.getMinutes();
};
return myDate
}
}
};
</script>
......
<template>
<div>
<!-- 内容列表 -->
<div class="con-list">
<van-cell-group
inset
v-for="(item, index) in messageList"
:key="index"
@click="read(item)"
@touchstart="touchstart(index, item)"
@touchend.prevent="touchend(index)"
>
<div class="messgae-title">{{ item.noticeTitle }}</div>
<div class="message-content">
{{ item.upcomingUserName }},您好!您有一条来自{{
item.createUserName
}}{{ item.noticeTitle }}相关的待处理任务...
</div>
<!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop>
<van-button round type="primary" @touchstart="goDetail(item)"
>详情</van-button
>
<van-button round type="info" @touchstart="goDelete(item)"
>修改</van-button
>
</div>
</van-overlay>
</van-cell-group>
</div>
<!-- 加号 -->
<div class="add" @click="goAdd">+</div>
</div>
</template>
<script>
export default {
data() {
return {
messageList: [
{
noticeTitle: "隐患上报消息",
upcomingUserName: "wang某某",
createUserName: "李某某",
noticeTitle: "重要任务"
}
],
Loop: "", // 定时器
showIndex: null // 是否显示遮罩层
};
},
mounted() {},
methods: {
goAdd(){
this.$router.push('/add-danger');
},
read(){},
touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if(this.showIndex != null){
this.showIndex = null;
return
}
this.Loop = setTimeout(() => {
this.showIndex = index
},300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
clearInterval(this.Loop);
},
// 详情
goDetail(data){
console.log(data);
this.showIndex = null
},
// 删除
goDelete(data){
console.log(data);
this.showIndex = null
},
}
};
</script>
<style lang="less" scoped>
/* @import url(); 引入css类 */
// 内容
.con-list {
padding: 10px 10px 0;
background-color: #f0f1f5;
.van-cell-group--inset {
margin: 0;
margin-bottom: 10px;
padding: 10px;
font-size: 13px;
position: relative;
.message-content {
margin-top: 10px;
}
.van-overlay{
position: absolute;
.wrapper {
display: flex;
align-items: center;
justify-content: space-evenly;
height: 100%;
}
}
}
}
.add{
width: 1.333333rem;
height: 1.333333rem;
color: white;
font-weight: bold;
font-size: 1.48rem;
background-color: #02a7f0;
text-align: center;
line-height: 1.333333rem;
border-radius: 50%;
position: fixed;
right: .533333rem;
bottom: 1.866667rem;
}
</style>
......@@ -12,19 +12,27 @@
<van-tab title="待提交">
<wait-submit></wait-submit>
</van-tab>
<van-tab title="已提交">已提交</van-tab>
<van-tab title="已退回">已退回</van-tab>
<van-tab title="已提交">
<committed></committed>
</van-tab>
<van-tab title="已退回">
<returned></returned>
</van-tab>
</van-tabs>
</div>
</template>
<script>
import LHeader from "@/components/header.vue";
import WaitSubmit from "./waitSubmit.vue";
import WaitSubmit from "./waitSubmit";
import Returned from "./returned";
import Committed from './committed';
export default {
components: {
LHeader: LHeader,
WaitSubmit
WaitSubmit,
Returned,
Committed
},
data() {
return {
......@@ -37,7 +45,7 @@ export default {
methods: {
onSearch(val) {
console.log(val);
}
},
}
};
</script>
......
<template>
<div>
<!-- 内容列表 -->
<div class="con-list">
<van-cell-group
inset
v-for="(item, index) in messageList"
:key="index"
@click="read(item)"
@touchstart="touchstart(index, item)"
@touchend.prevent="touchend(index)"
>
<div class="messgae-title">{{ item.noticeTitle }}</div>
<div class="message-content">
{{ item.upcomingUserName }},您好!您有一条来自{{
item.createUserName
}}{{ item.noticeTitle }}相关的待处理任务...
</div>
<!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop>
<van-button round type="primary" @touchstart="goDetail(item)"
>详情</van-button
>
<van-button round type="info" @touchstart="goDelete(item)"
>修改</van-button
>
</div>
</van-overlay>
</van-cell-group>
</div>
<!-- 加号 -->
<div class="add" @click="goAdd">+</div>
</div>
</template>
<script>
import { dangerReturn } from "@/service/danger";
export default {
data() {
return {
messageList: [
{
noticeTitle: "隐患上报消息",
upcomingUserName: "张某某",
createUserName: "李某某",
noticeTitle: "重要任务"
}
],
Loop: "", // 定时器
showIndex: null // 是否显示遮罩层
};
},
activated() {
this.postList()
},
methods: {
// 请求已退回列表数据
postList(){
dangerReturn('hdreport/list').then(res =>{
if(res.code == 0){
console.log(res);
}
})
},
goAdd(){
this.$router.push('/add-danger');
},
read(){},
touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if(this.showIndex != null){
this.showIndex = null;
return
}
this.Loop = setTimeout(() => {
this.showIndex = index
},300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
clearInterval(this.Loop);
},
// 详情
goDetail(data){
console.log(data);
this.showIndex = null
},
// 删除
goDelete(data){
console.log(data);
this.showIndex = null
},
}
};
</script>
<style lang="less" scoped>
/* @import url(); 引入css类 */
// 内容
.con-list {
padding: 10px 10px 0;
background-color: #f0f1f5;
.van-cell-group--inset {
margin: 0;
margin-bottom: 10px;
padding: 10px;
font-size: 13px;
position: relative;
.message-content {
margin-top: 10px;
}
.van-overlay{
position: absolute;
.wrapper {
display: flex;
align-items: center;
justify-content: space-evenly;
height: 100%;
}
}
}
}
.add{
width: 1.333333rem;
height: 1.333333rem;
color: white;
font-weight: bold;
font-size: 1.48rem;
background-color: #02a7f0;
text-align: center;
line-height: 1.333333rem;
border-radius: 50%;
position: fixed;
right: .533333rem;
bottom: 1.866667rem;
}
</style>
......@@ -3,8 +3,9 @@
<LHeader :text="text"></LHeader>
<van-form
@submit="onSubmit"
:show-error-message="false"
:show-error='false'
:scroll-to-error="true"
validate-trigger="onSubmit"
>
<van-field
v-model="value"
......
......@@ -3,8 +3,9 @@
<LHeader :text="text"></LHeader>
<van-form
@submit="onSubmit"
:show-error-message="false"
:show-error='false'
:scroll-to-error="true"
validate-trigger="onSubmit"
>
<van-field name="radio" label="隐患确认信息">
<template #input>
......@@ -126,6 +127,7 @@
<script>
import LHeader from "@/components/header.vue";
import { timestampToTime } from '@/utils/format'
export default {
components: {
LHeader
......@@ -154,7 +156,7 @@ export default {
this.radio = val;
},
onConfirm(date) {
this.value = this.format(date);
this.value = timestampToTime(date,'DT1',true)
this.showCalendar = false;
},
......@@ -177,16 +179,6 @@ export default {
cancel() {
this.$router.go(-1);
},
format(value){
let myDate
if (value.getMinutes() <= 9) {
myDate = value.getFullYear() + '-' + (value.getMonth() + 1) + '-' + value.getDate() + ' ' + value.getHours() + ':' + '0' + value.getMinutes();
} else {
myDate = value.getFullYear() + '-' + (value.getMonth() + 1) + '-' + value.getDate() + ' ' + value.getHours() + ':' + value.getMinutes();
};
return myDate
}
}
};
</script>
......
......@@ -11,7 +11,7 @@
<van-tab title="待确认">
<wait-con-list></wait-con-list>
</van-tab>
<van-tab title="已确定">已确定</van-tab>
<van-tab title="已确认">已确认</van-tab>
<van-tab title="已退回">已退回</van-tab>
</van-tabs>
</div>
......
......@@ -3,8 +3,9 @@
<LHeader :text="text"></LHeader>
<van-form
@submit="onSubmit"
:show-error-message="false"
:show-error='false'
:scroll-to-error="true"
validate-trigger="onSubmit"
>
<van-field name="radio" label="隐患复查结果">
<template #input>
......
<template>
<div>
<LHeader :text="text"></LHeader>
<van-form
@submit="onSubmit"
:scroll-to-error="true"
:show-error="false"
validate-trigger="onSubmit"
>
<van-field
readonly
clickable
name="所属工程名称"
:value="gongcheng"
label="所属工程名称"
placeholder="请选择"
@click="showGongcheng = true"
:rules="[{ required: true, message: '所属工程名称不能为空' }]"
/>
<van-popup v-model="showGongcheng" position="bottom">
<van-picker
show-toolbar
:columns="columnsGongcheng"
@confirm="onConGongcheng"
@cancel="showGongcheng = false"
/>
</van-popup>
<van-field
readonly
clickable
name="风险因素"
:value="factor"
label="风险因素"
placeholder="请选择"
@click="showFactor = true"
:rules="[{ required: true, message: '风险因素不能为空' }]"
/>
<van-popup v-model="showFactor" position="bottom">
<van-picker
show-toolbar
:columns="columnsFactor"
@confirm="onConFactor"
@cancel="showFactor = false"
/>
</van-popup>
<van-field
readonly
clickable
name="风险源"
:value="source"
label="风险源"
placeholder="请选择"
@click="showSource = true"
:rules="[{ required: true, message: '风险源不能为空' }]"
/>
<van-popup v-model="showSource" position="bottom">
<van-picker
show-toolbar
:columns="columnsSource"
@confirm="onConSource"
@cancel="showSource = false"
/>
</van-popup>
<van-field
readonly
clickable
name="事故类型"
:value="trouble"
label="事故类型"
placeholder="请选择"
@click="showTrouble = true"
:rules="[{ required: true, message: '事故类型不能为空' }]"
/>
<van-popup v-model="showTrouble" position="bottom">
<van-picker
show-toolbar
:columns="columnsTrouble"
@confirm="onConTrouble"
@cancel="showTrouble = false"
/>
</van-popup>
<van-field
readonly
clickable
name="风险定级"
:value="setRank"
label="风险定级"
placeholder="请选择"
@click="showSetRank = true"
:rules="[{ required: true, message: '风险定级不能为空' }]"
/>
<van-popup v-model="showSetRank" position="bottom">
<van-picker
show-toolbar
:columns="columnsSetRank"
@confirm="onConSetRank"
@cancel="showSetRank = false"
/>
</van-popup>
<van-field
v-model="riskRank"
readonly
name="风险等级"
label="风险等级"
placeholder="请选择"
:rules="[{ required: true, message: '风险等级不能为空' }]"
/>
<van-field
v-model="setRankMode"
name="定级方式"
label="定级方式"
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field
name="定级方式"
label=" "
>
<template #input>
<van-uploader v-model="setRankModeImg" />
</template>
</van-field>
<van-field
v-model="location"
name="风险部位"
label="风险部位"
type="textarea"
rows="1"
autosize
placeholder="请输入"
:rules="[{ required: true, message: '风险部位不能为空' }]"
/>
<van-field
readonly
clickable
name="管控层级"
:value="control"
label="管控层级"
placeholder="请选择"
@click="showControl = true"
:rules="[{ required: true, message: '管控层级不能为空' }]"
/>
<van-popup v-model="showControl" position="bottom">
<van-picker
show-toolbar
:columns="columnsControl"
@confirm="onConControl"
@cancel="showControl = false"
/>
</van-popup>
<van-field
readonly
clickable
name="主责部门"
:value="mainDutyDept"
label="主责部门"
placeholder="请选择"
@click="showMainDutyDept = true"
:rules="[{ required: true, message: '主责部门不能为空' }]"
/>
<van-popup v-model="showMainDutyDept" position="bottom">
<van-picker
show-toolbar
:columns="columnsMainDutyDept"
@confirm="onConMainDutyDept"
@cancel="showMainDutyDept = false"
/>
</van-popup>
<van-field
readonly
clickable
name="主责人员"
:value="mainDutyPeopLe"
label="主责人员"
placeholder="请选择"
@click="showMainDutyPeopLe = true"
:rules="[{ required: true, message: '主责人员不能为空' }]"
/>
<van-popup v-model="showMainDutyPeopLe" position="bottom">
<van-picker
show-toolbar
:columns="columnsMainDutyPeopLe"
@confirm="onConMainDutyPeopLe"
@cancel="showMainDutyPeopLe = false"
/>
</van-popup>
<van-field
v-model="technology"
name="技术措施"
label="技术措施"
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field
name="技术措施"
label=" "
>
<template #input>
<van-uploader v-model="technologyImg" />
</template>
</van-field>
<van-field
v-model="administration"
name="管理措施"
label="管理措施"
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field
name="管理措施"
label=" "
>
<template #input>
<van-uploader v-model="administrationImg" />
</template>
</van-field>
<van-field
v-model="urgent"
name="应急措施"
label="应急措施"
type="textarea"
rows="1"
autosize
placeholder="请输入"
/>
<van-field
name="应急措施"
label=" "
>
<template #input>
<van-uploader v-model="urgentImg" />
</template>
</van-field>
<div style="margin: 16px 16px 0">
<van-button round block type="info" native-type="submit"
>保存</van-button
>
</div>
</van-form>
<div style="margin:10px 16px 0px;padding-bottom:16px">
<van-button round block type="warning" @click.native="cancel"
>取消</van-button
>
</div>
</div>
</template>
<script>
import LHeader from "@/components/header.vue";
import { timestampToTime } from "@/utils/format";
export default {
components: {
LHeader
},
data() {
return {
text: "新增风险",
gongcheng: "", // 所属工程
showGongcheng: false,
columnsGongcheng: ["工程1", "工程2", "工程3", "工程4"],
factor: "", //风险因素
showFactor: false,
columnsFactor: ["风险因素1", "风险因素2", "风险因素3", "风险因素4"],
source: "", //风险源
showSource: false,
columnsSource: ["风险源1", "风险源2", "风险源3", "风险源4"],
trouble: "", //事故类型
showTrouble: false,
columnsTrouble: ["风险源1", "风险源2", "风险源3", "风险源4"],
setRank: "", //风险定级
showSetRank: false,
columnsSetRank: ["一般风险", "较小风险", "较大风险", "重大风险"],
riskRank: "", // 风险等级
setRankMode: "", // 定级方式文字
setRankModeImg: [], // 定级方式图片
location: "", //风险部位
control: "", //管控层级
showControl: false,
columnsControl: ["项目级", "企业级"],
mainDutyDept: "", // 主责部门
showMainDutyDept: false,
columnsMainDutyDept: ["首华建设项目部"],
mainDutyPeopLe: "", // 主责人员
showMainDutyPeopLe: false,
columnsMainDutyPeopLe: ["张三", "李四", "王五"],
technology:"", //技术措施文字
technologyImg:[],//技术措施图片
administration:"", //管理措施文字
administrationImg:[],//管理措施图片
urgent:"", //应急措施文字
urgentImg:[],//应急措施图片
};
},
mounted() {},
methods: {
onSubmit(values) {
console.log("submit", values);
},
// 所属工程名称
onConGongcheng(value) {
this.gongcheng = value;
this.showGongcheng = false;
},
// 风险因素
onConFactor(value) {
this.factor = value;
this.showFactor = false;
},
// 风险源
onConSource(value) {
this.source = value;
this.showSource = false;
},
// 事故类型
onConTrouble(value) {
this.trouble = value;
this.showTrouble = false;
},
// 风险定级
onConSetRank(value) {
this.setRank = value;
this.riskRank = value;
this.showSetRank = false;
},
// 管控层级
onConControl(value) {
this.control = value;
this.showControl = false;
},
// 主责部门
onConMainDutyDept(value) {
this.mainDutyDept = value;
this.showMainDutyDept = false;
},
// 主责人员
onConMainDutyPeopLe(value) {
this.mainDutyPeopLe = value;
this.showMainDutyPeopLe = false;
},
cancel() {
this.$router.go(-1);
}
}
};
</script>
<style scoped>
/* @import url(); 引入css类 */
</style>
<template>
<div>
<LHeader :text="text"></LHeader>
<van-search v-model="searchValue" placeholder="搜索" @search="onSearch" />
<van-tabs
v-model="active"
color="#247df7"
title-inactive-colo="#d0d1d1"
title-active-color="#000000"
>
<van-tab title="待确认">
<wait-confirme></wait-confirme>
</van-tab>
<van-tab title="已确认">
已确认
<!-- <committed></committed> -->
</van-tab>
<van-tab title="已退回">
已退回
<!-- <returned></returned> -->
</van-tab>
</van-tabs>
</div>
</template>
<script>
import LHeader from "@/components/header.vue";
import WaitConfirme from "./waitConfirme";
// import Returned from "./returned";
// import Committed from './committed';
export default {
components: {
LHeader: LHeader,
WaitConfirme
// Returned,
// Committed
},
data() {
return {
text: "风险确认",
active: "1",
searchValue: ""
};
},
mounted() {},
methods: {
onSearch(val) {
console.log(val);
}
}
};
</script>
<style scoped>
/* @import url(); 引入css类 */
</style>
<template>
<div>
<LHeader :text="text"></LHeader>
<van-form
@submit="onSubmit"
:show-error='false'
:scroll-to-error="true"
validate-trigger="onSubmit"
>
<van-field name="radio" label="风险确认信息">
<template #input>
<van-radio-group
v-model="radio"
direction="horizontal"
@change="selectResult"
>
<van-radio name="1">同意</van-radio>
<van-radio name="2">退回</van-radio>
</van-radio-group>
</template>
</van-field>
<!-- 同意时的选项 -->
<div class="agree" v-if="radio == 1">
<van-field
v-model="agreeIdea"
label="意见"
name ="意见"
rows="3"
type="textarea"
placeholder="请输入"
:rules="[{ required: true, message: '意见不能为空' }]"
/>
</div>
<!-- 退回是的选项 -->
<div class="disagree" v-else>
<van-field
v-model="disagreeIdea"
label="退回原因"
name ="退回原因"
rows="3"
type="textarea"
placeholder="请输入"
:rules="[{ required: true, message: '退回原因不能为空' }]"
/>
</div>
<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">
<van-button round block type="warning" @click.native="cancel"
>取消</van-button
>
</div>
</div>
</template>
<script>
import LHeader from "@/components/header.vue";
import { timestampToTime } from '@/utils/format'
export default {
components: {
LHeader
},
data() {
return {
radio: "1",
text: "风险确认",
agreeIdea:"", // 同意意见
disagreeIdea: "", //退回意见
};
},
mounted() {},
methods: {
selectResult(val) {
this.radio = val;
},
onSubmit(values) {
console.log("submit", values);
},
cancel() {
this.$router.go(-1);
},
}
};
</script>
<style lang="less" scoped>
/* @import url(); 引入css类 */
</style>
<template>
<div>
<!-- 内容列表 -->
<div class="con-list">
<van-cell-group
inset
v-for="(item, index) in messageList"
:key="index"
@click="read(item)"
@touchstart="touchstart(index, item)"
@touchend.prevent="touchend(index)"
>
<div class="messgae-title">{{ item.noticeTitle }}</div>
<div class="message-content">
{{ item.upcomingUserName }},您好!您有一条来自{{
item.createUserName
}}{{ item.noticeTitle }}相关的待处理任务...
</div>
<!-- 长按显示遮罩层 -->
<van-overlay :show="showIndex == index">
<div class="wrapper" @click.stop>
<van-button round type="primary" @touchstart="goDetail(item)"
>详情</van-button
>
<van-button round type="info" @touchstart="goConfirm(item)"
>确认</van-button
>
</div>
</van-overlay>
</van-cell-group>
</div>
</div>
</template>
<script>
export default {
data() {
return {
messageList: [
{
noticeTitle: "隐患上报消息",
upcomingUserName: "张某某",
createUserName: "李某某",
noticeTitle: "重要任务"
}
],
Loop: "", // 定时器
showIndex: null // 是否显示遮罩层
};
},
mounted() {},
methods: {
read(){},
touchstart(index, item) {
clearTimeout(this.Loop); //再次清空延时器,防止重复注册定时器
if(this.showIndex != null){
this.showIndex = null;
return
}
this.Loop = setTimeout(() => {
this.showIndex = index
},300); // 这里的1000是指需要长按的时间,单位为ms
},
touchend(index) {
// 这个方法主要是用来将每次手指移出之后将计时器清零
clearInterval(this.Loop);
},
// 详情
goDetail(data){
console.log(data);
this.showIndex = null
},
// 确认
goConfirm(data){
this.$router.push("/risk-affirm")
this.showIndex = null
},
}
};
</script>
<style lang="less" scoped>
/* @import url(); 引入css类 */
// 内容
.con-list {
padding: 10px 10px 0;
background-color: #f0f1f5;
.van-cell-group--inset {
margin: 0;
margin-bottom: 10px;
padding: 10px;
font-size: 13px;
position: relative;
.message-content {
margin-top: 10px;
}
.van-overlay{
position: absolute;
.wrapper {
display: flex;
align-items: center;
justify-content: space-evenly;
height: 100%;
}
}
}
}
.add{
width: 1.333333rem;
height: 1.333333rem;
color: white;
font-weight: bold;
font-size: 1.48rem;
background-color: #02a7f0;
text-align: center;
line-height: 1.333333rem;
border-radius: 50%;
position: fixed;
right: .533333rem;
bottom: 1.866667rem;
}
</style>
......@@ -46,6 +46,7 @@
<van-cell value="风控分级管控" />
<van-grid :column-num="5">
<van-grid-item
@click="riskJump(item.path)"
v-for="item in finalRiskList"
:key="item.key"
:icon="item.imgUrl"
......@@ -125,11 +126,13 @@ export default {
// 风控分级管控
{
key: "1",
path: "/risk-add",
imgUrl: require("@/assets/workbench/risk-report.png"),
text: "风险上报"
},
{
key: "2",
path:"/risk-confirme",
imgUrl: require("@/assets/workbench/risk-confirm.png"),
text: "风险确认"
},
......@@ -144,12 +147,13 @@ export default {
{
key: "1",
path: "/danger",
// path: "/add-danger",
imgUrl: require("@/assets/workbench/danger-report.png"),
text: "隐患上报"
},
{
key: "2",
path: "/confirm-danger",
path: "/confirme-danger",
imgUrl: require("@/assets/workbench/danger-confirm.png"),
text: "隐患确认"
},
......@@ -244,6 +248,11 @@ export default {
this.$router.push(path);
}
},
riskJump(path){
if (path) {
this.$router.push(path);
}
},
// 搜索事件
onSearch(val) {
console.log(val);
......
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