参数模板管理-参数列表-新增-附件控件上传附件模板的文件类型
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
name="file"
|
||||
:file-list="myfileList"
|
||||
:multiple="true"
|
||||
:action="uploadAction+'?state='+2+'&cut='+cut"
|
||||
:action="actionUrl"
|
||||
:headers="headers"
|
||||
@preview="preview"
|
||||
:before-upload="beforeUpload"
|
||||
@@ -26,15 +26,15 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import { getAction, postAction, downFile, downloadFile } from '@/api/manage'
|
||||
import { Base64 } from 'js-base64'
|
||||
import { mapGetters } from 'vuex'
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import { getAction, postAction, downFile, downloadFile } from '@/api/manage'
|
||||
import { Base64 } from 'js-base64'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
export default {
|
||||
name: 'file',
|
||||
props: ['disableds', 'disabled', 'thisFileUploadUrl', 'readonly', 'thisFileType', 'isUploadFile','detailDate','accept'],
|
||||
props: ['disableds', 'disabled', 'thisFileUploadUrl', 'readonly', 'thisFileType', 'isUploadFile', 'detailDate', 'accept', 'isParameter'],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
@@ -50,6 +50,15 @@ export default {
|
||||
cut: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
actionUrl() {
|
||||
if (this.isParameter) {
|
||||
return this.uploadAction + '?state=' + 3 + '&cut=' + this.cut
|
||||
} else {
|
||||
return this.uploadAction + '?state=' + 2 + '&cut=' + this.cut
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
const token = Vue.ls.get(ACCESS_TOKEN)
|
||||
this.headers = { 'X-Access-Token': token }
|
||||
@@ -110,7 +119,7 @@ export default {
|
||||
window.open(url, '_blank')
|
||||
},
|
||||
handleChange(info) {
|
||||
if(info.fileList.length > 1) {
|
||||
if (info.fileList.length > 1) {
|
||||
this.$message.warning(this.$t('onlyOnefileUploaded'))
|
||||
return
|
||||
}
|
||||
@@ -201,20 +210,20 @@ export default {
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.ant-upload-list-item-name {
|
||||
.ant-upload-list-item-name {
|
||||
color: rgba(0, 0, 0, 0.65) !important;
|
||||
}
|
||||
}
|
||||
|
||||
.action-upload {
|
||||
.action-upload {
|
||||
font-size: 67px;
|
||||
color: #c0c4cc;
|
||||
}
|
||||
}
|
||||
|
||||
.uploadFile {
|
||||
.uploadFile {
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -317,7 +317,7 @@
|
||||
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
|
||||
</div>
|
||||
</a-drawer>
|
||||
<uploadFileChange ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFileChange>
|
||||
<uploadFileChange :isParameter="true" ref="uploadFile" @uploadSuccess="uploadSuccess"></uploadFileChange>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user