mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-06-10 18:30:02 +08:00
update
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
# 项目相关配置
|
||||||
|
jsowell:
|
||||||
|
# 文件路径 示例( Windows配置D:/jsowell/uploadPath,Linux配置 /home/jsowell/uploadPath)
|
||||||
|
profile: D:/jsowell/uploadPath
|
||||||
|
|
||||||
|
|
||||||
# 数据源配置
|
# 数据源配置
|
||||||
spring:
|
spring:
|
||||||
# redis 配置
|
# redis 配置
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
# 项目相关配置
|
||||||
|
jsowell:
|
||||||
|
# 文件路径 示例( Windows配置D:/jsowell/uploadPath,Linux配置 /home/jsowell/uploadPath)
|
||||||
|
profile: /var/ftp/firmware
|
||||||
|
|
||||||
# 数据源配置
|
# 数据源配置
|
||||||
spring:
|
spring:
|
||||||
# redis 配置
|
# redis 配置
|
||||||
|
|||||||
@@ -105,7 +105,20 @@
|
|||||||
<el-input v-model="form.desc" placeholder="请输入固件描述" />
|
<el-input v-model="form.desc" placeholder="请输入固件描述" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="路径" prop="filePath">
|
<el-form-item label="路径" prop="filePath">
|
||||||
<el-input v-model="form.filePath" placeholder="请输入路径" />
|
<el-upload
|
||||||
|
ref="upload"
|
||||||
|
:limit="1"
|
||||||
|
accept=".bin"
|
||||||
|
:action="upload.url"
|
||||||
|
:headers="upload.headers"
|
||||||
|
:file-list="upload.fileList"
|
||||||
|
:on-progress="handleFileUploadProgress"
|
||||||
|
:on-success="handleFileSuccess"
|
||||||
|
:auto-upload="false">
|
||||||
|
<el-button slot="trigger" size="small" type="primary">选取文件</el-button>
|
||||||
|
<el-button style="margin-left: 10px;" size="small" type="success" :loading="upload.isUploading" @click="submitUpload">上传到服务器</el-button>
|
||||||
|
<div slot="tip" class="el-upload__tip">只能上传bin文件,且不超过5000kb</div>
|
||||||
|
</el-upload>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
@@ -118,6 +131,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listFirmware, getFirmware, delFirmware, addFirmware, updateFirmware } from "@/api/pile/firmware";
|
import { listFirmware, getFirmware, delFirmware, addFirmware, updateFirmware } from "@/api/pile/firmware";
|
||||||
|
import { getToken } from "@/utils/auth";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Firmware",
|
name: "Firmware",
|
||||||
@@ -151,7 +165,18 @@ export default {
|
|||||||
form: {},
|
form: {},
|
||||||
// 表单校验
|
// 表单校验
|
||||||
rules: {
|
rules: {
|
||||||
}
|
},
|
||||||
|
// 上传参数
|
||||||
|
upload: {
|
||||||
|
// 是否禁用上传
|
||||||
|
isUploading: false,
|
||||||
|
// 设置上传的请求头部
|
||||||
|
headers: { Authorization: "Bearer " + getToken() },
|
||||||
|
// 上传的地址
|
||||||
|
url: process.env.VUE_APP_BASE_API + "/common/upload",
|
||||||
|
// 上传的文件列表
|
||||||
|
fileList: []
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -254,6 +279,20 @@ export default {
|
|||||||
this.download('pile/firmware/export', {
|
this.download('pile/firmware/export', {
|
||||||
...this.queryParams
|
...this.queryParams
|
||||||
}, `firmware_${new Date().getTime()}.xlsx`)
|
}, `firmware_${new Date().getTime()}.xlsx`)
|
||||||
|
},
|
||||||
|
// 文件提交处理
|
||||||
|
submitUpload() {
|
||||||
|
this.$refs.upload.submit();
|
||||||
|
},
|
||||||
|
// 文件上传中处理
|
||||||
|
handleFileUploadProgress(event, file, fileList) {
|
||||||
|
this.upload.isUploading = true;
|
||||||
|
},
|
||||||
|
// 文件上传成功处理
|
||||||
|
handleFileSuccess(response, file, fileList) {
|
||||||
|
this.upload.isUploading = false;
|
||||||
|
this.form.filePath = response.url;
|
||||||
|
this.msgSuccess(response.msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user