|
|
@@ -0,0 +1,125 @@
|
|
|
+<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='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}}
|
|
|
+ </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]'/>
|
|
|
+ <el-icon v-if='!option.detail' class="padding-right">
|
|
|
+ <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`'>
|
|
|
+ <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>
|
|
|
+ </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]'/>
|
|
|
+ <el-icon v-if='!option.detail' class="padding-right padding-top">
|
|
|
+ <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>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-col>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: 'index',
|
|
|
+ props: {
|
|
|
+ option: Object,
|
|
|
+ data: Object
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ data: {
|
|
|
+ handler (val) {
|
|
|
+ this.form = val
|
|
|
+ },
|
|
|
+ immediate: true
|
|
|
+ },
|
|
|
+ option: {
|
|
|
+ handler (val) {
|
|
|
+ this.$emit('change', this.form)
|
|
|
+ },
|
|
|
+ deep: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ form: {},
|
|
|
+ disable: true
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang='scss' scoped>
|
|
|
+.form {
|
|
|
+ border-right: #CCCFCE solid 1px;
|
|
|
+ border-left: #CCCFCE solid 1px;
|
|
|
+ border-bottom: #CCCFCE solid 1px;
|
|
|
+ .item {
|
|
|
+ :deep(.el-form-item--default){
|
|
|
+ margin-bottom: 0;
|
|
|
+ padding: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .label{
|
|
|
+ padding-right: 10px;
|
|
|
+ border-right: #CCCFCE solid 1px;
|
|
|
+ }
|
|
|
+ .sub-item{
|
|
|
+ border-left: #CCCFCE solid 1px;
|
|
|
+ }
|
|
|
+ .sub-item:first-child{
|
|
|
+ border-left: none;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.form:first-child{
|
|
|
+ padding: 0;
|
|
|
+ border: #CCCFCE solid 1px;
|
|
|
+}
|
|
|
+</style>
|