TransFlow/src/views/SystemSettings/ImportSettings.vue

62 lines
1.8 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="content-box">
<div class="container">
<p>导入设置</p>
<!-- <div class="test-div">
<i class="el-icon-edit"></i>
<i class="el-icon-share"></i>
<i class="el-icon-delete"></i>
</div> -->
<el-upload class="upload-demo" ref="upload" action="https://jsonplaceholder.typicode.com/posts/"
:file-list="fileList" :auto-upload="false" @on-success="fileSuccess" @on-error="fileError" @on-progress="fileProgress">
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
<el-button style="margin-left: 10px;" size="small" type="success" @click="submitUpload">导入</el-button>
</el-upload>
<div class="warning">
<i class="el-icon-warning" style="color: #409EFF; margin: 0 3px 0 10px;"></i>范围1-8默认6
将一个保存好的系统设置文件导入本系统导入后将覆盖现有的所有分析和用户设置并重启系统未保存的数据可能会丢失请谨慎使用.
</div>
</div>
</div>
</template>
<script>
export default {
data() {
return {
fileList: [],
}
},
methods: {
submitUpload() {
this.$refs.upload.submit();
console.log(this.$refs.upload, '上传');
},
// 成功
fileSuccess(response, file, fileList) {
console.log(response, file, fileList, '成功');
},
// 失败
fileError(err, file, fileList){
console.log(err, file, fileList, '失败');
},
// 上传中
fileProgress(event, file, fileList){
console.log(event, file, fileList, '上传中');
}
}
}
</script>
<style>
.test-div i {
font-size: 25px;
}
.warning {
margin-top: 10px;
width: 35%;
}
</style>