[参数项列表] 编辑

This commit is contained in:
zhaomeijing
2022-04-28 16:37:07 +08:00
parent a4e20ba82b
commit 145a9468b5
2 changed files with 214 additions and 193 deletions
@@ -1,4 +1,5 @@
<template>
<div>
<a-drawer
:title="title"
:maskClosable="false"
@@ -31,7 +32,7 @@
<span class="title-text-text" :title="$t('Required')">{{$t('Required')}}</span>
</div>
<a-form-model-item class="itemModel" prop="state">
<a-select :placeholder="$t('PleaseSelect')+$t('Required')" v-model="formInline.isMust">
<a-select :placeholder="$t('PleaseSelect')+$t('Required')" v-model='formInline.isMust'>
<a-select-option v-for="(item, key) in isRequired" :key="key" :value="item.value">
<span style="display: inline-block;width: 100%" :title=" item.label ">
{{ item.label }}
@@ -202,11 +203,9 @@
</div>
<a-form-model-item class="itemModel" prop="paramsTemplateName">
<a-button type="primary" class="button-text"
@click="clickButtonToUpload(item)">
<!-- {{ (formInline[item.db_field_name] === 'null' || formInline[item.db_field_name] === '' ||-->
<!-- formInline[item.db_field_name] == null) ? $t('clickUpload') : $t('viewUploadedFiles')-->
<!-- }}-->
{{ $t('clickUpload') }}
@click="clickButtonToUpload()">
{{ (formInline.fileTemplateConnectId === 'null' || formInline.fileTemplateConnectId === '' ||
formInline.fileTemplateConnectId == null) ? $t('clickUpload') : $t('viewUploadedFiles')}}
</a-button>
</a-form-model-item>
</div>
@@ -272,14 +271,18 @@
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
</div>
</a-drawer>
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFile>
</div>
</template>
<script>
import PersonnelSelection from '@/components/PersonnelSelection/index'
import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
import uploadFile from '@/components/uploadFile/file'
export default {
name: 'addModel',
components: {
uploadFile,
PersonnelSelection
},
props: ['url'],
@@ -348,10 +351,22 @@ export default {
this.getSysCategoryTree()
},
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.perentHandleFunc()
// this.$refs.uploadFile.state = item.flag
// this.$refs.uploadFile.visible = true
this.$refs.uploadFile.visible = true
// this.uploadName = item.db_field_name
// getAction('sys/common/getFileInfos', { id: this.formInline[item.db_field_name] }).then((res) => {
// if (res.success) {
@@ -113,6 +113,7 @@ export default {
dataSource: [],
confirmLoading: false,
url: {
queryById: 'params/paramsInfo/queryById',
list: 'params/paramsInfo/page',
add: 'params/paramsInfo/add',
edit: 'params/paramsInfo/edit',
@@ -227,7 +228,12 @@ export default {
},
//编辑
edit(item) {
this.$refs.addModelRef.editModel(JSON.parse(JSON.stringify(item)))
let _this = this
getAction(_this.url.queryById, { id: item.id }).then((res) => {
if (res.success) {
this.$refs.addModelRef.editModel(JSON.parse(JSON.stringify(res.result)))
}
})
},
//删除
deleteLib(val) {