[update] 上报库

This commit is contained in:
zhaomeijing
2022-06-22 15:19:33 +08:00
parent 92c74ba970
commit c72b322cfa
@@ -1,4 +1,5 @@
<template> <template>
<div>
<a-drawer <a-drawer
:title="title" :title="title"
:maskClosable="false" :maskClosable="false"
@@ -65,15 +66,15 @@
<a-col :span="12"> <a-col :span="12">
<div class="box-title-text"> <div class="box-title-text">
<div class="title-text"> <div class="title-text">
<span class="Required">*</span>
<span class="title-text-text" <span class="title-text-text"
:title="$t('parameterTemplate')">{{$t('parameterTemplate')}}</span> :title="$t('attachmentTemplate')">{{$t('attachmentTemplate')}}</span>
</div> </div>
<a-form-model-item class="itemModel" prop="templateName"> <a-form-model-item class="itemModel" prop="paramsTemplateName">
<a-input class="box-input" <a-button type="primary" class="button-text"
:disabled="disabled" @click="clickButtonToUpload('fileTemplateConnectId')">
v-model="formInline.templateName" {{ (formInline.fileTemplateConnectId === 'null' || formInline.fileTemplateConnectId === '' ||
:placeholder="$t('PleaseEnter')+$t('templateName')"/> formInline.fileTemplateConnectId == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
</a-button>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
@@ -86,15 +87,19 @@
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button> <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div> </div>
</a-drawer> </a-drawer>
<uploadFileChange ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFileChange>
</div>
</template> </template>
<script> <script>
import PersonnelSelection from '@/components/PersonnelSelection/index' import PersonnelSelection from '@/components/PersonnelSelection/index'
import { getAction, postAction, downloadFile, putAction } from '@/api/manage' import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
import uploadFileChange from '@/components/uploadFileChange/file'
export default { export default {
name: 'addModel', name: 'addModel',
components: { components: {
uploadFileChange,
PersonnelSelection PersonnelSelection
}, },
props: ['url'], props: ['url'],
@@ -124,6 +129,28 @@ export default {
this.getNameList() this.getNameList()
}, },
methods: { methods: {
uploadSuccess(data) {
let attIdList = []
if (data && data.length > 0) {
data.map(item => {
attIdList.push(item.id || data.name)
})
}
this.$refs.uploadFile.visible = false
/** 赋值给当前对应的表单文件 */
this.formInline.fileTemplateConnectId = attIdList.join(',')
this.formInline = { ...this.formInline }
},
clickButtonToUpload(item) {
this.$refs.uploadFile.visible = true
getAction('sys/common/getFileInfos', { id: this.formInline[item] }).then((res) => {
if (res.success) {
this.$refs.uploadFile.perentHandleFunc(res.result)
} else {
this.$refs.uploadFile.perentHandleFunc()
}
})
},
getNameList() { getNameList() {
getAction('project/projectNameInfoEO/list', {}).then((res) => { getAction('project/projectNameInfoEO/list', {}).then((res) => {
if (res.success) { if (res.success) {