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

添加检测是否首次安装

parent fdb46f26
...@@ -58,20 +58,20 @@ ...@@ -58,20 +58,20 @@
<!-- 项目引导导入对话框 --> <!-- 项目引导导入对话框 -->
<el-dialog <el-dialog
:title="upload.title" :title="guide.title"
:visible.sync="upload.open" :visible.sync="guide.open"
width="400px" width="400px"
append-to-body append-to-body
> >
<el-upload <el-upload
ref="upload" ref="guide"
:limit="1" :limit="1"
accept=".zip,.tar.gz" accept=".zip,.tar.gz"
:headers="upload.headers" :headers="guide.headers"
:action="upload.url" :action="guide.url"
:disabled="upload.isUploading" :disabled="guide.isUploading"
:on-progress="handleFileUploadProgress" :on-progress="handleGuideFileUploadProgress"
:on-success="handleFileSuccess" :on-success="handleGuideFileSuccess"
:auto-upload="false" :auto-upload="false"
drag drag
> >
...@@ -85,10 +85,10 @@ ...@@ -85,10 +85,10 @@
</div> </div>
</el-upload> </el-upload>
<div slot="footer" class="dialog-footer"> <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
> >
<el-button @click="upload.open = false">取 消</el-button> <el-button @click="guide.open = false">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -107,6 +107,26 @@ ...@@ -107,6 +107,26 @@
mixins: [table], mixins: [table],
created() { 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: { methods: {
/** 导入 */ /** 导入 */
...@@ -306,6 +326,23 @@ ...@@ -306,6 +326,23 @@
this.$refs.upload.submit(); 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() { data() {
return { return {
...@@ -324,6 +361,18 @@ ...@@ -324,6 +361,18 @@
// 上传的地址 // 上传的地址
url: "/m/setup/project/importProjectData", url: "/m/setup/project/importProjectData",
}, },
guide: {
// 是否显示弹出层(设备导入)
open: false,
// 弹出层标题(设备导入)
title: "上传项目工程包",
// 是否禁用上传
isUploading: false,
// 上传的地址
url: "/m/setup/project/importProjectData",
},
config: { config: {
search: [ 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