导入传参
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<a-upload name="file" :showUploadList="false"
|
||||
class="upload-text"
|
||||
:multiple="false" :headers="tokenHeader"
|
||||
:action="importUrl"
|
||||
:action="importUrl+'?cut='+cut"
|
||||
@change="handleImportZip"
|
||||
accept=".zip">
|
||||
<a-icon type="import" :rotate="270"/>
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import {ACCESS_TOKEN} from '@/store/mutation-types'
|
||||
import eventBUs from '../../common/event'
|
||||
|
||||
export default {
|
||||
@@ -27,11 +27,19 @@
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
tokenHeader: { 'X-Access-Token': Vue.ls.get(ACCESS_TOKEN) },
|
||||
importUrl: window._CONFIG['domianURL'] + this.url.importZipUrl
|
||||
tokenHeader: {'X-Access-Token': Vue.ls.get(ACCESS_TOKEN)},
|
||||
importUrl: window._CONFIG['domianURL'] + this.url.importZipUrl,
|
||||
cut: '',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let long = localStorage.getItem('language')
|
||||
this.cut = ''
|
||||
if (long && long == 'zh-cn') {
|
||||
this.cut = 'cn'
|
||||
} else if (long && long == 'en-us') {
|
||||
this.cut = 'en'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleImportZip(info) {
|
||||
@@ -43,14 +51,14 @@
|
||||
if (info.file.status === 'done') {
|
||||
if (info.file.response.success) {
|
||||
if (info.file.response.code === 201) {
|
||||
let { message } = info.file.response
|
||||
let { name } = info.file
|
||||
let {message} = info.file.response
|
||||
let {name} = info.file
|
||||
let content = []
|
||||
if (message) {
|
||||
message = message.split('</br>')
|
||||
message.forEach(res => {
|
||||
if (res) {
|
||||
content.push( < div > { res } < /div>)
|
||||
content.push( < div > {res} < /div>)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -58,7 +66,7 @@
|
||||
title: name,
|
||||
content: (
|
||||
< div >
|
||||
{ content }
|
||||
{content}
|
||||
< /div>
|
||||
)
|
||||
})
|
||||
@@ -68,14 +76,14 @@
|
||||
}
|
||||
this.spinning = false
|
||||
} else {
|
||||
let { message } = info.file.response
|
||||
let { name } = info.file
|
||||
let {message} = info.file.response
|
||||
let {name} = info.file
|
||||
let content = []
|
||||
if (message) {
|
||||
message = message.split('</br>')
|
||||
message.forEach(res => {
|
||||
if (res) {
|
||||
content.push( < div > { res } < /div>)
|
||||
content.push( < div > {res} < /div>)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -83,7 +91,7 @@
|
||||
title: name,
|
||||
content: (
|
||||
< div >
|
||||
{ content }
|
||||
{content}
|
||||
< /div>
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user