78 lines
2.3 KiB
Vue
78 lines
2.3 KiB
Vue
<template>
|
|
<a-modal
|
|
:title="$t('docTool.comparison.fullTextComments')"
|
|
:width="600"
|
|
:visible="visible"
|
|
:confirm-loading="confirmLoading"
|
|
:maskClosable="false"
|
|
@cancel="visible = false"
|
|
>
|
|
<template slot="footer">
|
|
<a-button type="primary" :loading="confirmLoading" @click="fullTextCommentsSubmit">
|
|
{{$t('submit')}}
|
|
</a-button>
|
|
</template>
|
|
<a-form-model :model="formInlineText" class="formAdd" :rules="rulesText" ref="ruleFormText">
|
|
<div class="box-title-text-remarks">
|
|
<div class="title-text-remarks" :title="$t('docTool.comparison.fullTextComments')">
|
|
<span>{{$t('docTool.comparison.fullTextComments')}}</span>
|
|
</div>
|
|
<a-form-model-item class="item-model" style="width: calc(100% - 113px)" prop="comment">
|
|
<a-textarea :placeholder="$t('pleaseEnter')+' '+$t('docTool.comparison.fullTextComments')"
|
|
v-model.trim="formInlineText.comment"
|
|
:maxLength="500"
|
|
:rows="4"/>
|
|
</a-form-model-item>
|
|
</div>
|
|
</a-form-model>
|
|
</a-modal>
|
|
</template>
|
|
|
|
<script>
|
|
import { putAction } from '@/api/manage'
|
|
|
|
export default {
|
|
name: 'ComparisonAddFullComment',
|
|
data () {
|
|
return {
|
|
visible: false, // 全文评论弹框是否显示
|
|
confirmLoading: false,
|
|
formInlineText: {},
|
|
rulesText: {}
|
|
}
|
|
},
|
|
methods: {
|
|
open (comments) {
|
|
this.formInlineText.comment = comments
|
|
},
|
|
// 添加全文评论弹框的提交按钮
|
|
fullTextCommentsSubmit () {
|
|
this.$refs.ruleFormText.validate(valid => {
|
|
if (valid) {
|
|
const formInlineText = Object.assign({}, this.formInlineText)
|
|
this.confirmLoading = true
|
|
const query = {
|
|
id: this.$route.query.id,
|
|
comments: formInlineText.comment
|
|
}
|
|
putAction('/compare/sarFileCompareInfo/editComments', query).then((res) => {
|
|
if (res.success) {
|
|
this.$message.success(this.$t('operationSuccessful'))
|
|
this.visible = false
|
|
} else {
|
|
this.$message.warning(this.$t('operationFailed'))
|
|
}
|
|
}).finally(() => {
|
|
this.confirmLoading = false
|
|
})
|
|
}
|
|
})
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
|
|
</style>
|