explanation.vue
2.19 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<template>
<div>
<Card title="案件补充说明">
<div class="explanation">
<div class="explanation-list" v-for="(item, idx) in supplementList" :key="idx">
<label class="label" for="">{{ `说明${idx + 1}:` }}</label>
<el-input :disabled="isCheck || isDisabled" :placeholder="`请输入说明${idx + 1}`" v-model="item.content" maxlength="200" type="textarea" :rows="3"></el-input>
<i class="el-icon-delete del" v-if="!isCheck&&supplementList.length > 1" @click="handleDel(idx)"></i>
</div>
</div>
<div v-if="!isCheck &&!isDisabled" class="add-explanation" @click="addExplanation">
<i class="el-icon-circle-plus-outline"></i>
<span>新增说明</span>
</div>
</Card>
</div>
</template>
<script type="text/ecmascript-6">
import Card from './card.vue'
export default {
name: 'explanation',
data() {
return {}
},
components: {
Card
},
props: {
supplementList: {
type: Array,
default: function () {
return [{ content: '' }]
}
},
isCheck:Boolean,
isDisabled:Boolean,
},
mounted() {},
methods: {
handleDel(idx) {
this.$delete(this.supplementList, idx)
},
addExplanation() {
const idx = this.supplementList.length
const newObj = { claimsId: this.supplementList[idx - 1].claimsId, content: '' }
this.$set(this.supplementList, idx, newObj)
}
}
}
</script>
<style lang="scss" scoped>
.explanation {
.explanation-list {
display: flex;
// align-items: center;
margin-bottom: 20px;
&:last-child {
margin-bottom: 10px;
}
/deep/ .el-textarea {
width: 580px;
}
.label {
width: 154px;
font-size: 14px;
font-weight: 400;
line-height: 32px;
color: #333;
text-align: right;
flex-shrink: 0;
}
}
.del {
color: #c6c6c6;
font-size: 16px;
margin-left: 10px;
cursor: pointer;
margin-top: 28px;
}
}
.add-explanation {
color: #5850FF;
display: flex;
align-items: center;
margin-left: 154px;
cursor: pointer;
.el-icon-circle-plus-outline {
font-size: 20px;
margin-right: 6px;
}
span {
font-size: 12px;
}
}
</style>