bug 78379
This commit is contained in:
@@ -172,17 +172,25 @@
|
||||
<div class="clause-item" v-for="(clause, index) in contentList" :key="index + 'clause'">
|
||||
<div class="clause-item-content">
|
||||
<!--文本-->
|
||||
<a-input type="textarea" :maxLength="500" v-model="clause.itemContent" v-if="clause.type === TypeOfClauseItem.TEXT.value" />
|
||||
<a-input type="textarea"
|
||||
:maxLength="500"
|
||||
v-model="clause.itemContent"
|
||||
v-if="clause.type === TypeOfClauseItem.TEXT.value" />
|
||||
<!--图片-->
|
||||
<viewer>
|
||||
<img v-if="clause.type === TypeOfClauseItem.IMG.value" :src="clause.thumbUrl?clause.thumbUrl:clause.itemContent" alt="">
|
||||
<img v-if="clause.type === TypeOfClauseItem.IMG.value"
|
||||
:src="clause.thumbUrl?clause.thumbUrl:clause.itemContent"
|
||||
alt="">
|
||||
</viewer>
|
||||
<!--表格-->
|
||||
<div v-if="clause.type === TypeOfClauseItem.TABLE.value" v-html="clause.itemContent"></div>
|
||||
</div>
|
||||
<div class="clause-item-operate">
|
||||
<a-button @click="handleAddClauseContent(index)">{{ $t('newlyAdded') }}</a-button>
|
||||
<a-button v-if="clause.type === TypeOfClauseItem.TABLE.value" @click="splitEdit(index,clause)">{{ $t('edit') }}</a-button>
|
||||
<a-button v-if="clause.type === TypeOfClauseItem.TABLE.value" @click="splitEdit(index,clause)">{{
|
||||
$t('edit')
|
||||
}}
|
||||
</a-button>
|
||||
<a-button @click="handleDeleteClauseContent(index, clause)">{{ $t('delete') }}</a-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -382,62 +390,47 @@ export default {
|
||||
*/
|
||||
integrateData () {
|
||||
this.isFormInline = false
|
||||
const ruleList = JSON.parse(JSON.stringify(this.ruleList))
|
||||
console.log(this.ruleList)
|
||||
const rules = {}
|
||||
this.ruleList.forEach((res, index) => {
|
||||
ruleList.forEach((res, index) => {
|
||||
const rule = []
|
||||
if (res.field_must_input === 1) {
|
||||
if (res.field_show_type === '1') {
|
||||
if (res.fieldMustInput === '1') {
|
||||
if ([FieldType.TEXT_BOX.value, FieldType.TEXTAREA.value].includes(res.fieldShowType)) {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.db_field_txt + this.$t('cannotEmpty'),
|
||||
message: res.dbFieldTxt + this.$t('cannotEmpty'),
|
||||
trigger: 'blur'
|
||||
})
|
||||
} else if (res.field_show_type === '4' || res.field_show_type === '6' ||
|
||||
res.field_show_type === '5' || res.field_show_type === '7'
|
||||
) {
|
||||
} else {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.db_field_txt + this.$t('cannotEmpty'),
|
||||
message: res.dbFieldTxt + this.$t('cannotEmpty'),
|
||||
trigger: 'change'
|
||||
})
|
||||
} else if (res.field_show_type === '2') {
|
||||
}
|
||||
} else {
|
||||
if ([FieldType.TEXT_BOX.value, FieldType.TEXTAREA.value].includes(res.fieldShowType)) {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.db_field_txt + this.$t('cannotEmpty'),
|
||||
required: false,
|
||||
message: res.dbFieldTxt + this.$t('cannotEmpty'),
|
||||
trigger: 'blur'
|
||||
})
|
||||
} else if (res.field_show_type === '8' || res.field_show_type === '9' || res.field_show_type === '10' || res.field_show_type === '11') {
|
||||
} else {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.db_field_txt + this.$t('cannotEmpty'),
|
||||
trigger: 'blur'
|
||||
})
|
||||
} else if (res.field_show_type === '3') {
|
||||
rule.push({
|
||||
required: true,
|
||||
message: res.db_field_txt + this.$t('cannotEmpty'),
|
||||
required: false,
|
||||
message: res.dbFieldTxt + this.$t('cannotEmpty'),
|
||||
trigger: 'change'
|
||||
})
|
||||
}
|
||||
}
|
||||
if (res.field_show_type === '1' ||
|
||||
res.field_show_type === '8' || res.field_show_type === '9' || res.field_show_type === '10' ||
|
||||
res.field_show_type === '11') {
|
||||
rule.push({
|
||||
max: res.db_length,
|
||||
message: res.db_field_txt + this.$t('cantExeed') + res.db_length + this.$t('characters'),
|
||||
trigger: 'blur'
|
||||
})
|
||||
}
|
||||
if (rule.length > 0) {
|
||||
rules[res.db_field_name] = rule
|
||||
rules[res.dbFieldName] = rule
|
||||
}
|
||||
})
|
||||
this.$set(this, 'rules', rules)
|
||||
// console.log('rules',this.rules)
|
||||
this.rules = rules
|
||||
this.isFormInline = true
|
||||
this.loading = false
|
||||
// console.log('this.column',this.column)
|
||||
},
|
||||
/**
|
||||
* 获取表单信息
|
||||
@@ -475,7 +468,7 @@ export default {
|
||||
if (!data.interpretation_articles) {
|
||||
data.interpretation_articles = ''
|
||||
}
|
||||
this.formInline = Object.assign({}, {...data})
|
||||
this.formInline = Object.assign({}, { ...data })
|
||||
}
|
||||
})
|
||||
},
|
||||
@@ -564,8 +557,8 @@ export default {
|
||||
},
|
||||
// 点击点击上传按钮
|
||||
clickButtonToUpload (item) {
|
||||
this.$refs.uploadFile.open(this.formInline[item.db_field_name])
|
||||
this.uploadName = item.db_field_name
|
||||
this.$refs.uploadFile.open(this.formInline[item.dbFieldName])
|
||||
this.uploadName = item.dbFieldName
|
||||
},
|
||||
// 文件上传改变后的回调
|
||||
uploadFileChange (data) {
|
||||
@@ -697,7 +690,7 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
updateDom() {
|
||||
updateDom () {
|
||||
this.$forceUpdate()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user