Commit a1d4c276 authored by kaitly205422@163.com's avatar kaitly205422@163.com

风险巡查问题修改

parent 0797b5bf
......@@ -7,8 +7,8 @@ module.exports = {
'plugin:vue/essential'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
'no-console': 'off',
'no-debugger': 'off'
},
parserOptions: {
parser: 'babel-eslint'
......
......@@ -127,7 +127,6 @@ export default {
this.cachePage.push(roterFromName);
}
}
console.log(this.cachePage, 'cach')
},
},
watch: {
......@@ -150,6 +149,8 @@ export default {
this.handleCache("risk-confirme", to.name, "risk-affirm");
} else if (to.name == 'taskLedger' || from.name == 'taskLedger') {
this.handleCache("riskTaskList", to.name, "taskLedger");
} else if (to.name == 'riskView' || from.name == 'riskInherent') {
this.handleCache("addInherent", to.name, "riskInherent");
}
// 列表页面动态添加缓存
......
......@@ -96,6 +96,5 @@ export const rotateBase64Img = (src, edg, callback) => {
}
};
} catch (e) {
console.log(e);
}
};
......@@ -347,21 +347,23 @@ export default {
this.layoutData = res.data;
this.layoutDataStr = JSON.stringify(this.layoutData);
res.data.forEach((item) => {
item.position = JSON.parse(item.position);
item.position.i = item.id;
item.position.id = item.id;
if (!this.showHeader) {
item.position.isDraggable = false;
item.position.isResizable = false;
if (item.position) {
item.position = JSON.parse(item.position);
item.position.i = item.id;
item.position.id = item.id;
if (!this.showHeader) {
item.position.isDraggable = false;
item.position.isResizable = false;
}
if (!this.isViews) {
//添加页面不显示颜色
item.position.c = "#e6e5e5";
} else {
item.position.c = item.color;
}
this.layout.push(item.position);
this.updateLayoutHeight();
}
if (!this.isViews) {
//添加页面不显示颜色
item.position.c = "#e6e5e5";
} else {
item.position.c = item.color;
}
this.layout.push(item.position);
this.updateLayoutHeight();
});
// console.log(res.data);
}
......@@ -469,8 +471,8 @@ export default {
const max = Math.max(
...this.layoutData.map((x) => {
let data = x.position;
if (!data) return 0;
if (typeof x.position == "string") {
// x.position.y + x.position.h
data = JSON.parse(x.position);
}
return data.y + data.h;
......@@ -490,8 +492,8 @@ export default {
// 拖动时判断layoutHeight是否需要更新
item.x = (x / this.W) * 12;
item.y = y / 30;
item.x = (newX / this.W) * 12;
item.y = newY / 30;
item.x = (x / this.W) * 12;
item.y = y / 30;
debounce(this.updateLayoutHeight)();
// if (top > this.layoutHeight) {
// this.layoutHeight = top;
......@@ -555,11 +557,13 @@ export default {
});
//修改房间后返回清掉房间的值
var inherenForm = JSON.parse(sessionStorage.getItem("inherenForm"));
if (inherenForm) {
inherenForm.roomName = "";
inherenForm.roomId = "";
sessionStorage.setItem("inherenForm", JSON.stringify(inherenForm));
if (sessionStorage.getItem("inherenForm")) {
var inherenForm = JSON.parse(sessionStorage.getItem("inherenForm"));
if (inherenForm) {
inherenForm.roomName = "";
inherenForm.roomId = "";
sessionStorage.setItem("inherenForm", JSON.stringify(inherenForm));
}
}
//保存
let data = this.layoutData;
......@@ -757,7 +761,8 @@ export default {
}
.north {
position: fixed;
/* position: fixed; */
position: absolute;
display: inline-block;
top: 1.5rem;
right: 0.5rem;
......
......@@ -5,7 +5,7 @@
</van-sticky>
<!-- tab标签 -->
<template v-if="tabs.length">
<van-tabs v-model="active" color="#2980f7" animated @click="tabClick" :sticky="true" offset-top="1.5rem">
<van-tabs v-model="active" color="#2980f7" animated @change="tabClick" :sticky="true" offset-top="1.5rem">
<van-tab v-for="(i, key) in tabs" :key="key" :title="i.title">
<!-- 内容列表 -->
<div class="con-list">
......@@ -143,6 +143,9 @@ export default {
this.loadingTabs()
},
methods: {
tabClick() {
this.showIndex = null;
},
loadingTabs() {
getFun("/risk/currentRiskPatrolDetail/detailList", { projectId: this.id, patrolId: this.$route.query.patrolId }).then(res => {
const tabs = new Set(res.rows.map(x => x.type));
......
This diff is collapsed.
<!-- 新建项目/新建楼宇-->
<template>
<div class="project-component">
<LHeader text="新增楼层" :customBack="toCancel"></LHeader>
<van-form
@submit="onSubmit"
:scroll-to-error="true"
:show-error="false"
validate-trigger="onSubmit"
>
<van-form @submit="onSubmit" :scroll-to-error="true" :show-error="false" validate-trigger="onSubmit">
<van-field
label="楼层"
required
:rules="[{ required: true, message: '请填写楼层名称' }]"
>
<template #input>
<van-radio-group v-model="form.type" direction="horizontal">
<van-radio name="地上">地上</van-radio>
<van-radio name="地下">地下</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field
label="楼层名称"
v-model="form.name"
required
:rules="[{ required: true, message: '请填写楼层名称' }]"
><template #right-icon><span></span></template></van-field>
<van-field label="楼层" required :rules="[{ required: true, message: '请填写楼层名称' }]">
<template #input>
<van-radio-group v-model="form.type" direction="horizontal">
<van-radio name="地上">地上</van-radio>
<van-radio name="地下">地下</van-radio>
</van-radio-group>
</template>
</van-field>
<van-field label="楼层名称" v-model="form.name" required :rules="[{ required: true, message: '请填写楼层名称' }]"><template
#right-icon><span></span></template></van-field>
<div class="action-btns">
<van-button
class="confirm-btn"
:loading="loadingStatus"
:loading-text="loadingText"
round
block
type="info"
native-type="submit"
>
<van-button class="confirm-btn" :loading="loadingStatus" :loading-text="loadingText" round block type="info"
native-type="submit">
保存
</van-button>
......@@ -54,7 +33,6 @@
</van-form>
</div>
</template>
<script>
......@@ -65,11 +43,11 @@ export default {
LHeader,
},
props: {
buildingId:{
type:Number,
buildingId: {
type: String,
}
},
destroyed(){
destroyed() {
this.toCancel()
},
data() {
......@@ -80,26 +58,27 @@ export default {
};
},
methods: {
toCancel(data=null){
this.$emit('close',data)
toCancel(data = null) {
this.$emit('close', data)
},
onSubmit(values){
if(!this.buildingId){
return;
}
this.form.buildingId = this.buildingId
this.form.name = this.form.name+''
postFun('/risk/plan/floor', this.form)
onSubmit(values) {
console.log(this.buildingId)
if (!this.buildingId) {
return;
}
this.form.buildingId = this.buildingId
this.form.name = this.form.name + ''
postFun('/risk/plan/floor', this.form)
.then(res => {
this.$toast.clear();
this.$toast.success({
message: "提交成功",
duration: 2000
});
this.toCancel(res.data)
this.toCancel(res.data)
})
.catch(() => {
this.$emit('close')
this.$emit('close')
});
}
}
......@@ -107,7 +86,6 @@ export default {
</script>
<style lang="less" scoped>
.project-component {
position: fixed;
width: 100vw;
......@@ -116,16 +94,19 @@ export default {
left: 0;
z-index: 100;
background: #fff;
.van-form{
.van-form {
height: calc(100vh - 1.6rem);
overflow: auto;
}
.action-btns {
margin-top: 1rem;
padding: 0 0.5rem;
.cancel-btn {
margin-top: 0.3rem;
}
}
.action-btns {
margin-top: 1rem;
padding: 0 0.5rem;
.cancel-btn {
margin-top: 0.3rem;
}
}
}
</style>
This diff is collapsed.
......@@ -217,7 +217,7 @@
<van-popup v-model="measuresDept" position="bottom" :style="{ height: '100%' }">
<div class="van-picker__toolbar" style="position: absolute;width: 100%;top: 0;">
<button type="button" class="van-picker__cancel" v-on:click="
{
{
form.measuresDeptId = 0;
projectDept = false;
}
......@@ -726,7 +726,6 @@ export default {
performTasks() { },
// 点击预览图
clickPre(e) {
console.log(e);
if (e.filePath) {
this.videoUrl = e.filePath;
} else {
......
This diff is collapsed.
<template>
<div class="assess-model">
<div> <LHeader :text="title"></LHeader></div>
<div>
<LHeader :text="title"></LHeader>
</div>
<div class="assess-model-container">
<div class="assess-model-select-title"><span>选择影响因素</span></div>
<van-checkbox-group class="assess-model-select" v-model="effectValue">
<van-checkbox
v-for="(item) in effectList"
:key="item.dictLabel"
:name="item.dictLabel"
shape="square"
>
<van-icon slot="icon"
slot-scope="props" :name="props.checked?'success':''" />
<van-checkbox v-for="(item) in effectList" :key="item.dictLabel" :name="item.dictLabel" shape="square">
<van-icon slot="icon" slot-scope="props" :name="props.checked ? 'success' : ''" />
{{ item.dictLabel }}
</van-checkbox>
</van-checkbox-group>
</div>
<footer class="assess-model-footer">
<van-button round type="info" @click="toNext">下一步</van-button>
<footer class="assess-model-footer">
<van-button round type="info" @click="toNext">下一步</van-button>
</footer>
</div>
</template>
......@@ -25,86 +21,88 @@
<script>
import LHeader from "@/components/header.vue";
import { getFun, postFun } from "@/service/table";
export default {
components:{
LHeader
},
data(){
return {
title:'影响因素',
effectList: [],
effectValue:[]
export default {
components: {
LHeader
},
data() {
return {
title: '影响因素',
effectList: [],
effectValue: []
}
},
mounted() {
const present = localStorage.getItem('presentForm')
let presentForm = present ? JSON.parse(present) : null;
if (this.$store.state.assessModel.step1) {
this.effectValue = this.$store.state.assessModel.step1.split(",")
} else if (presentForm && presentForm.factorItems) { // 用户刷新
this.$store.commit('SET_ASSESS_STEP1', presentForm.factorItems);
this.$store.commit('SET_ASSESS_STEP2', presentForm.evaluationItemIds);
}
this.getData()
},
beforeRouteLeave(to, form, next) {
if (to.name === 'addPresent') {
this.$store.commit('SET_ASSESS_STEP1', '')
}
next()
},
methods: {
toNext() {
let effectValue = this.effectList.filter(x => this.effectValue.includes(x.dictLabel))
if (effectValue.length) {
effectValue = effectValue.map(x => x.dictLabel)
}
},
mounted(){
const present = localStorage.getItem('presentForm')
let presentForm =present ?JSON.parse(present):null;
if(this.$store.state.assessModel.step1){
this.effectValue = this.$store.state.assessModel.step1.split(",")
}else if(presentForm&&presentForm.factorItems){ // 用户刷新
this.$store.commit('SET_ASSESS_STEP1',presentForm.factorItems);
this.$store.commit('SET_ASSESS_STEP2',presentForm.evaluationItemIds);
if (this.effectValue.length == 0) {
this.$toast("请先选择影响因素")
return;
}
this.getData()
this.$store.commit('SET_ASSESS_STEP1', effectValue.join(','))
// 保存数据
this.$router.push({
path: '/assess/model/step2',
query: {
ids: effectValue.join(',')
}
})
},
beforeRouteLeave(to,form,next){
// console.log(e);
if(to.name==='addPresent'){
this.$store.commit('SET_ASSESS_STEP1','')
}
next()
getData() {
getFun('/risk/plan/dict/data/list', {
dictType: 'evaluation_model_classification'
}).then(res => {
// console.log(res);
if (res.code !== 200) return;
this.effectList = res.data;
}).catch(() => {
this.$toast('网络请求错误')
})
},
destroy() {
},
methods:{
toNext(){
let effectValue = this.effectList.filter(x=>this.effectValue.includes(x.dictLabel))
if(effectValue.length){
effectValue = effectValue.map(x=>x.dictLabel)
}
if(this.effectValue.length == 0){
this.$toast("请先选择影响因素")
return;
}
this.$store.commit('SET_ASSESS_STEP1',effectValue.join(','))
// 保存数据
this.$router.push({
path: '/assess/model/step2',
query:{
ids:effectValue.join(',')
}
})
},
getData(){
getFun('/risk/plan/dict/data/list',{
dictType:'evaluation_model_classification'
}).then(res=>{
// console.log(res);
if(res.code!==200) return;
this.effectList = res.data;
}).catch(()=>{
this.$toast('网络请求错误')
})
},
destroy(){
},
}
}
}
</script>
<style lang="less" scoped>
.assess-model{
.assess-model {
background: #fff;
z-index: 10;
.assess-model-select-title{
.assess-model-select-title {
font-weight: 400;
font-size: 14px;
color: rgba(69,90,100,.6);
color: rgba(69, 90, 100, .6);
padding: 0.6rem 0.7rem;
}
.assess-model-container{
.assess-model-container {
height: calc(100% - 1.5rem);
overflow: auto;
}
.assess-model-footer{
.assess-model-footer {
width: 100%;
height: 1.4rem;
z-index: 9;
......@@ -112,16 +110,19 @@ import { getFun, postFun } from "@/service/table";
bottom: 0px;
text-align: center;
line-height: 1rem;
.van-button{
.van-button {
width: 90%;
margin: 0 auto;
}
}
}
.van-checkbox-group{
.van-checkbox-group {
padding: 0 1rem;
box-sizing: border-box;
.van-checkbox{
.van-checkbox {
background: #fff;
margin-bottom: 0.4rem;
padding: 0.4rem;
......@@ -129,22 +130,24 @@ import { getFun, postFun } from "@/service/table";
box-shadow: 1px 1px 3px 1px #dddddd;
color: #1c1c1c;
text-align: center;
::v-deep .van-icon{
::v-deep .van-icon {
border-radius: 0.08rem;
border:none;
border: none;
background: transparent;
color: #1989fa;
}
::v-deep .van-checkbox__label{
::v-deep .van-checkbox__label {
flex: 1;
text-align: center;
font-size: 0.45rem;
transform: translateX(-20px);
}
}
.van-checkbox[aria-checked="true"]{
box-shadow: 1px 1px 3px 1px #38fc;
.van-checkbox[aria-checked="true"] {
box-shadow: 1px 1px 3px 1px #38fc;
}
}
</style>
\ No newline at end of file
}</style>
\ No newline at end of file
......@@ -229,7 +229,6 @@ export default {
});
})
.catch(err => {
console.log("err==>>", err);
});
},
workBenchList() {
......
......@@ -9,11 +9,11 @@ module.exports = {
proxy: {
//配置跨域
"/app-api": {
target: "http://192.168.4.232:8080/", //这里是后台的地址
// target: "http://192.168.4.232:8080/", //这里是后台的地址
// target: "http://localhost:8080/", //这里是后台的地址
// target: 'http://192.168.15.124:8080/', //这里是杨帆的地址
// target: "http://192.168.14.152:8080/", //这里是鲍德的地址
// target: "http://192.168.15.230:8080/", //这里是晓静的地址
target: "http://192.168.15.230:8080/", //这里是晓晋的地址
// target: 'http://localhost:8081/', //这里是后台的地址
// target: 'http://127.0.0.1:8080', //这里是后台的地址
ws: true,
......
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