1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<template>
<div @click="handleClick" :id="id" :class="{'c-highlight-content': true, 'highlight': highlight, 'change-light': highlightChanges}">
<slot></slot>
</div>
</template>
<script>
export default {
props: ['id', 'path'],
data: function () {
return {
process: '0'
}
},
computed: {
showHighlight: {
get () {
return this.process == '1' || this.process == '2'
}
},
highlight () {
return this.$store.state.Status.highlights.indexOf(this.id) !== -1
},
highlightChanges () {
let flag = false
this.$store.state.Status.highlightChanges.forEach(item => {
if (item == this.path || item.indexOf(this.path) == 0) {
flag = true
}
})
return flag
}
},
created: function () {
if (this.$route.query.routeParams) {
this.process = this.$route.query.routeParams.process;
this.busiTempInfoSriNo = this.$route.query.routeParams.busiTempInfoSriNo;
}
// this.process = '1'
},
methods: {
handleClick: function () {
if (this.showHighlight) {
this.updateHighlights(this.id)
}
},
updateHighlights(id) {
let list = this.$store.state.Status.highlights;
if (list.indexOf(id) == -1) {
list.push(id)
this.$store.commit('updateRemark', id)
} else {
let index = list.indexOf(id)
list.splice(index, 1)
}
this.$store.commit('setHighlights', list)
},
}
}
</script>
<style>
.c-highlight-content {
/* overflow: hidden; */
}
.c-highlight-content.change-light {
border: 1px solid rgb(201, 171, 1);
}
.c-highlight-content.highlight {
border: 1px solid red;
}
</style>