修改上传文件

This commit is contained in:
qq787203167
2022-03-23 22:40:40 +08:00
parent c089041fb1
commit 48a9f4c7a4
3 changed files with 9 additions and 8 deletions
@@ -112,7 +112,7 @@
</div>
<a-form-model-item class="itemModel" :prop="item.db_field_name">
<a-button type="primary" class="button-text"
@click="clickButtonToUpload(item.db_field_name)">
@click="clickButtonToUpload(item)">
{{ (formInline[item.db_field_name] === 'null' || formInline[item.db_field_name] === '' ||
formInline[item.db_field_name] == null) ? $t('clickUpload') : $t('viewUploadedFiles')
}}
@@ -344,11 +344,12 @@
this.formInline[item] = dateOne ? [dateOne, dateTwo] : []
},
clickButtonToUpload(current) {
clickButtonToUpload(item) {
this.$refs.uploadFile.perentHandleFunc()
this.$refs.uploadFile.state = item.flag
this.$refs.uploadFile.visible = true
this.uploadName = current
getAction('sys/common/getFileInfos', { id: this.formInline[current] }).then((res) => {
this.uploadName = item.db_field_name
getAction('sys/common/getFileInfos', { id: this.formInline[item.db_field_name] }).then((res) => {
if (res.success) {
this.$refs.uploadFile.perentHandleFunc(res.result)
} else {
@@ -136,7 +136,7 @@
initWebSocket: function() {
// WebSocket与普通的请求所用协议有所不同,ws等同于http,wss等同于https
var userId = store.getters.userInfo.id
var url = window._CONFIG['domianWebSocketURL'].replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/'+userId
var url = window._CONFIG['domianWebSocketURL'].replace('https://', 'wss://').replace('http://', 'ws://') + '/websocket/' + userId
this.websock = new WebSocket(url)
this.websock.onopen = this.websocketOnopen
this.websock.onerror = this.websocketOnerror
@@ -149,7 +149,7 @@
this.timer = setInterval(() => {
try {
self.websock.send('test')
console.log('发送消息');
console.log('发送消息')
} catch (err) {
console.log('断开了:' + err)
self.connection()
@@ -161,7 +161,6 @@
this.reconnect()
},
websocketOnmessage: function(e) {
console.log('-----接收消息-------', e)
//系统通知
this.loadData()
},
+2 -1
View File
@@ -8,7 +8,7 @@
name="file"
:file-list="myfileList"
:multiple="true"
:action='uploadAction'
:action="uploadAction+'?state='+state"
:headers="headers"
@preview="preview"
:before-upload="beforeUpload"
@@ -37,6 +37,7 @@
visible: false,
title: this.$t('clickUpload'),
uploadAction: window._CONFIG['domianURL'] + '/sys/common/upload',
state:undefined,
myuploadAction: window._CONFIG['domianURL'] + this.thisFileUploadUrl,
upDataList: [],
downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download',