Commit 74008034 authored by 赵啸非's avatar 赵啸非

添加检测是否首次安装

parent fdb46f26
......@@ -58,20 +58,20 @@
<!-- 项目引导导入对话框 -->
<el-dialog
:title="upload.title"
:visible.sync="upload.open"
:title="guide.title"
:visible.sync="guide.open"
width="400px"
append-to-body
>
<el-upload
ref="upload"
ref="guide"
:limit="1"
accept=".zip,.tar.gz"
:headers="upload.headers"
:action="upload.url"
:disabled="upload.isUploading"
:on-progress="handleFileUploadProgress"
:on-success="handleFileSuccess"
:headers="guide.headers"
:action="guide.url"
:disabled="guide.isUploading"
:on-progress="handleGuideFileUploadProgress"
:on-success="handleGuideFileSuccess"
:auto-upload="false"
drag
>
......@@ -85,10 +85,10 @@
</div>
</el-upload>
<div slot="footer" class="dialog-footer">
<el-button type="primary" class="addclass" @click="submitFileForm"
<el-button type="primary" class="addclass" @click="submitGuideFileForm"
>确 定</el-button
>
<el-button @click="upload.open = false">取 消</el-button>
<el-button @click="guide.open = false">取 消</el-button>
</div>
</el-dialog>
......@@ -107,6 +107,26 @@
mixins: [table],
created() {
//检测是否初始安装
this.$get("/setup/project/check")
.then((res) => {
if (res.code == 1) {
console.log(res)
let bool=res.data
if(bool){
}else{
//弹框引导页面
this.upload.open = true;
}
//this.$message.success("项目部署成功!");
// this.getData();
}
})
.catch((error) => {
this.$message.error(error.message);
});
},
methods: {
/** 导入 */
......@@ -306,6 +326,23 @@
this.$refs.upload.submit();
},
/** 文件上传中处理 */
handleGuideFileUploadProgress(event, file, fileList) {
this.guide.isUploading = true;
},
/** 文件上传成功处理 */
handleGuideFileSuccess(response, file, fileList) {
this.guide.open = false;
this.guide.isUploading = false;
this.$refs.guide.clearFiles();
this.$alert(response.msg, "导入结果", { dangerouslyUseHTMLString: true });
},
/** 提交上传文件 */
submitGuideFileForm() {
this.$refs.guide.submit();
},
},
data() {
return {
......@@ -324,6 +361,18 @@
// 上传的地址
url: "/m/setup/project/importProjectData",
},
guide: {
// 是否显示弹出层(设备导入)
open: false,
// 弹出层标题(设备导入)
title: "上传项目工程包",
// 是否禁用上传
isUploading: false,
// 上传的地址
url: "/m/setup/project/importProjectData",
},
config: {
search: [
],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment