|
|
@@ -219,10 +219,15 @@
|
|
|
content="跟PC端一致"
|
|
|
placement="bottom"
|
|
|
>
|
|
|
- <el-switch v-model="isSame" @change="changeSame" />
|
|
|
+ <el-switch
|
|
|
+ v-model="formDef.attrs.same"
|
|
|
+ active-value="Y"
|
|
|
+ inactive-value="N"
|
|
|
+ @change="changeSame"
|
|
|
+ />
|
|
|
</el-tooltip>
|
|
|
</div>
|
|
|
- <div v-if="!isSame" class="panel-body">
|
|
|
+ <div v-if="formDef.attrs.same === 'N'" class="panel-body">
|
|
|
<el-form-item label="标签宽度">
|
|
|
<el-row>
|
|
|
<el-col :span="12">
|
|
|
@@ -367,10 +372,6 @@ export default {
|
|
|
name: [{ required: true, message: this.$t('validate.required') }],
|
|
|
key: [{ required: true, message: this.$t('validate.required') }]
|
|
|
},
|
|
|
- same:
|
|
|
- this.formDef && this.formDef.attrs
|
|
|
- ? this.$utils.toBoolean(this.formDef.attrs.same, true)
|
|
|
- : true,
|
|
|
labelSuf:
|
|
|
this.formDef && this.formDef.attrs
|
|
|
? this.formDef.attrs.labelSuffix || ''
|
|
|
@@ -386,15 +387,6 @@ export default {
|
|
|
? this.formDef.attrs.mobile_script || ''
|
|
|
: this.formDef.attrs.script || ''
|
|
|
},
|
|
|
- isSame: {
|
|
|
- get() {
|
|
|
- return this.$utils.toBoolean(this.same, true)
|
|
|
- },
|
|
|
- set(val) {
|
|
|
- this.same = val
|
|
|
- this.$set(this.formDef.attrs, 'same', this.isSame)
|
|
|
- }
|
|
|
- },
|
|
|
labelSuffix: {
|
|
|
get() {
|
|
|
return this.labelSuf
|
|
|
@@ -409,6 +401,7 @@ export default {
|
|
|
data: {
|
|
|
handler: function (val, oldVal) {
|
|
|
this.formDef = this.data
|
|
|
+ this.$set(this.formDef.attrs, 'same', this.formDef.attrs.same || 'Y')
|
|
|
},
|
|
|
immediate: true,
|
|
|
deep: true
|
|
|
@@ -419,20 +412,6 @@ export default {
|
|
|
},
|
|
|
deep: true
|
|
|
},
|
|
|
- same: {
|
|
|
- handler(val, oldVal) {
|
|
|
- if (this.$utils.isEmpty(this.formDef.attrs.same)) {
|
|
|
- this.isSame = true
|
|
|
- this.$set(this.formDef.attrs, 'same', this.isSame)
|
|
|
- } else {
|
|
|
- if (val !== oldVal) {
|
|
|
- this.isSame = val
|
|
|
- this.$set(this.formDef.attrs, 'same', this.isSame)
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- immediate: true
|
|
|
- },
|
|
|
labelSuf: {
|
|
|
handler(val, oldVal) {
|
|
|
if (this.$utils.isEmpty(this.formDef.attrs.labelSuffix)) {
|
|
|
@@ -457,7 +436,7 @@ export default {
|
|
|
this.labelSuf = this.formDef.attrs.labelSuffix
|
|
|
},
|
|
|
changeSame(value) {
|
|
|
- if (!value) {
|
|
|
+ if (value === 'N' && !this.formDef.attrs.mobileLabelWidth) {
|
|
|
this.formDef.attrs = Object.assign({}, this.formDef.attrs, {
|
|
|
mobileLabelWidth: 100,
|
|
|
mobileLabelWidthUnit: 'px',
|