|
|
@@ -1,64 +1,74 @@
|
|
|
<template>
|
|
|
- <div class='full-width'>
|
|
|
- <el-form v-for='item in option.column' :key='item.label' class='form' :class='option.detail ? "grey-fa-bg" : "white-bg" ' :label-width='option.hasOwnProperty("labelWidth") ? option.labelWidth : "150px" '>
|
|
|
-<!-- input-->
|
|
|
- <el-col v-if='item.type ==="input" ' class='full-width'>
|
|
|
+ <div class=' padding-bottom padding-right'>
|
|
|
+ <el-form v-for='item in option.column' :key='item.label' :class='option.detail ? "grey-fa-bg" : "white-bg" '
|
|
|
+ :label-width='option.hasOwnProperty("labelWidth") ? option.labelWidth : "150px" '
|
|
|
+ class='form'>
|
|
|
+ <!-- input-->
|
|
|
+ <el-col v-if='item.type ==="input" ' class='full-width'>
|
|
|
<div class='flex item full-width'>
|
|
|
<el-form-item class='full-width '>
|
|
|
<template v-slot:label>
|
|
|
<div class='label white-bg full-width padding-left text-left bold'>
|
|
|
- {{item.label}}
|
|
|
+ {{ item.label }}
|
|
|
</div>
|
|
|
</template>
|
|
|
<div class='full-width text-left flex full-width'>
|
|
|
- <input class='full-width' :placeholder= '`请输入` + item.label' :disabled='option.detail' v-model='form[item.prop]'/>
|
|
|
+ <input v-model='form[item.prop]' :disabled='option.detail' :placeholder='`请输入` + item.label'
|
|
|
+ class='full-width'/>
|
|
|
<el-icon v-if='!option.detail' class="padding-right">
|
|
|
- <edit />
|
|
|
+ <edit/>
|
|
|
</el-icon>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
-<!--textarea-->
|
|
|
- <el-col v-if='item.type ==="textarea" ' class='full-width' :style='`height:` + item.rows * 35 + `px`'>
|
|
|
+ <!--textarea-->
|
|
|
+ <el-col v-if='item.type ==="textarea" ' :style='`height:` + item.rows * 35 + `px`' class='full-width'>
|
|
|
<div class='flex item full-width'>
|
|
|
<el-form-item class='full-width '>
|
|
|
<template v-slot:label>
|
|
|
- <div class='label white-bg full-width text-left padding-left bold' :style='`height:` + item.rows * 35 + `px`'>
|
|
|
- {{item.label}}
|
|
|
+ <div :style='`height:` + item.rows * 35 + `px`'
|
|
|
+ class='label white-bg full-width text-left padding-left bold'>
|
|
|
+ {{ item.label }}
|
|
|
</div>
|
|
|
</template>
|
|
|
- <div class='full-width flex flex-align-start full-height text-left full-width' style='white-space: pre-wrap;text-overflow: ellipsis;'>
|
|
|
- <textarea :placeholder= '`请输入` + item.label' :disabled='option.detail' class='full-width padding-right full-height padding-top' style='line-height:20px;resize:none ' v-model='form[item.prop]'/>
|
|
|
+ <div class='full-width flex flex-align-start full-height text-left full-width'
|
|
|
+ style='white-space: pre-wrap;text-overflow: ellipsis;'>
|
|
|
+ <textarea v-model='form[item.prop]' :disabled='option.detail'
|
|
|
+ :placeholder='`请输入` + item.label'
|
|
|
+ :style='`height:` + item.rows * 35 + `px`'
|
|
|
+ class='full-width padding-right full-height padding-top'
|
|
|
+ style='line-height:20px;resize:none '/>
|
|
|
<el-icon v-if='!option.detail' class="padding-right padding-top">
|
|
|
- <edit />
|
|
|
+ <edit/>
|
|
|
</el-icon>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
-<!--row-->
|
|
|
- <el-col v-if='item.type === "row" ' :span='24' class='flex full-width '>
|
|
|
- <div class='flex full-width'>
|
|
|
- <div v-for='sub in item.column' :key='sub.label' class='full-width sub-item'>
|
|
|
- <el-col :span='24'>
|
|
|
- <div class='full-width item '>
|
|
|
- <el-form-item class='full-width'>
|
|
|
- <template v-slot:label>
|
|
|
- <div class='label white-bg full-width text-left padding-left bold'>
|
|
|
- {{sub.label}}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <div class='full-width flex flex-center'>
|
|
|
- <input class='full-width' :placeholder= '`请输入` + sub.label' :disabled='option.detail' v-model='form[sub.prop]'>
|
|
|
- <el-icon v-if='!option.detail' class="padding-left padding-right">
|
|
|
- <edit />
|
|
|
- </el-icon>
|
|
|
+ <!--row-->
|
|
|
+ <el-col v-if='item.type === "row" ' :span='24' class='flex full-width '>
|
|
|
+ <div class='flex full-width'>
|
|
|
+ <div v-for='sub in item.column' :key='sub.label' class='full-width sub-item'>
|
|
|
+ <el-col :span='24'>
|
|
|
+ <div class='full-width item '>
|
|
|
+ <el-form-item class='full-width'>
|
|
|
+ <template v-slot:label>
|
|
|
+ <div class='label white-bg full-width text-left padding-left bold'>
|
|
|
+ {{ sub.label }}
|
|
|
</div>
|
|
|
- </el-form-item>
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </div>
|
|
|
+ </template>
|
|
|
+ <div class='full-width flex flex-center'>
|
|
|
+ <input v-model='form[sub.prop]' :disabled='option.detail' :placeholder='`请输入` + sub.label'
|
|
|
+ class='full-width'>
|
|
|
+ <el-icon v-if='!option.detail' class="padding-left padding-right">
|
|
|
+ <edit/>
|
|
|
+ </el-icon>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
</el-form>
|
|
|
@@ -74,19 +84,19 @@ export default {
|
|
|
},
|
|
|
watch: {
|
|
|
data: {
|
|
|
- handler (val) {
|
|
|
+ handler(val) {
|
|
|
this.form = val
|
|
|
},
|
|
|
immediate: true
|
|
|
},
|
|
|
option: {
|
|
|
- handler (val) {
|
|
|
+ handler(val) {
|
|
|
this.$emit('change', this.form)
|
|
|
},
|
|
|
deep: true
|
|
|
}
|
|
|
},
|
|
|
- data () {
|
|
|
+ data() {
|
|
|
return {
|
|
|
form: {},
|
|
|
disable: true
|
|
|
@@ -100,25 +110,29 @@ export default {
|
|
|
border-right: #CCCFCE solid 1px;
|
|
|
border-left: #CCCFCE solid 1px;
|
|
|
border-bottom: #CCCFCE solid 1px;
|
|
|
+
|
|
|
.item {
|
|
|
- :deep(.el-form-item--default){
|
|
|
+ :deep(.el-form-item--default) {
|
|
|
margin-bottom: 0;
|
|
|
padding: 0;
|
|
|
}
|
|
|
}
|
|
|
- .label{
|
|
|
+
|
|
|
+ .label {
|
|
|
padding-right: 10px;
|
|
|
border-right: #CCCFCE solid 1px;
|
|
|
}
|
|
|
- .sub-item{
|
|
|
+
|
|
|
+ .sub-item {
|
|
|
border-left: #CCCFCE solid 1px;
|
|
|
}
|
|
|
- .sub-item:first-child{
|
|
|
+
|
|
|
+ .sub-item:first-child {
|
|
|
border-left: none;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-.form:first-child{
|
|
|
+.form:first-child {
|
|
|
padding: 0;
|
|
|
border: #CCCFCE solid 1px;
|
|
|
}
|