Commit 36ec01f3 authored by 赵啸非's avatar 赵啸非

添加检测是否首次安装

parent 6b181946
...@@ -26,10 +26,13 @@ export default { ...@@ -26,10 +26,13 @@ export default {
}, },
renderContent: function (h, { node, data, store }) { renderContent: function (h, { node, data, store }) {
console.log("node~~~~~~",node)
return ( return (
<span> <span>
<i style="font-size:16px;color:#409EFF" class={data.icon}></i> <i style="font-size:16px;color:#409EFF" class={data.icon}></i>
<span style="padding-left: 2px;font-size:14px">{node.label}({data.siteCount})</span> <span style="padding-left: 2px;font-size:14px">{node.label}</span>
</span> </span>
); );
}, },
......
...@@ -54,13 +54,11 @@ ...@@ -54,13 +54,11 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 项目引导导入对话框 --> <!-- 项目引导导入对话框 -->
<el-dialog <el-dialog
:title="guide.title" :title="guide.title"
:visible.sync="guide.open" :visible.sync="guide.open"
width="800px" width="400px"
show-close=false show-close=false
close-on-click-modal=false close-on-click-modal=false
append-to-body append-to-body
...@@ -94,6 +92,62 @@ ...@@ -94,6 +92,62 @@
</div> </div>
</el-dialog> </el-dialog>
<el-dialog
:title="tree.title"
:visible.sync="tree.open"
width="40%"
append-to-body
>
<span style="font-size: 14px"
><b>当前选择区域:</b> (<el-link
style="margin-left: 10px;margin-bottom: 5px"
type="primary"
class="addclass"
:underline="false"
>{{ areaName }}</el-link
>
区域编码:{{ areaCode }} )</span
>
<el-divider></el-divider>
<div>
<el-input placeholder="请输入内容" v-model="siteName">
<template slot="prepend">站点名称</template>
</el-input>
</div>
<el-divider></el-divider>
<el-scrollbar style="height: 100%">
<el-tree
size="mini"
ref="areaTree"
:data="areaData"
id="el-tree"
node-key="id"
indent="4"
:props="treeProps"
:load="loadNode"
lazy
highlight-current
:expand-on-click-node="false"
:render-content="renderContent"
@node-click="handleNodeClick"
>
</el-tree>
</el-scrollbar>
<div slot="footer" class="dialog-footer">
<el-button type="primary" class="addclass" @click="updateSiteConform"
>确 定</el-button
>
<el-button @click="tree.open = false">取 消</el-button>
</div>
</el-dialog>
</div> </div>
</template> </template>
...@@ -101,14 +155,14 @@ ...@@ -101,14 +155,14 @@
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import drawerShow from "./drawershow"; import drawerShow from "./drawershow";
import table from "@/assets/mixins/table"; import table from "@/assets/mixins/table";
import tree from "@/assets/mixins/tree";
export default { export default {
name: "SetupProjectList", name: "SetupProjectList",
components: { components: {
drawerShow drawerShow
}, },
mixins: [table], mixins: [table,tree],
created() { created() {
//检测是否初始安装 //检测是否初始安装
this.$get("/setup/project/check") this.$get("/setup/project/check")
.then((res) => { .then((res) => {
...@@ -133,12 +187,71 @@ ...@@ -133,12 +187,71 @@
this.$message.error(error.message); this.$message.error(error.message);
}); });
//获取区域树
this.$get("/base/area/getListByParentId", {
parentId: "0",
})
.then((res) => {
if (res.code == 1) {
//this.info=res.data
this.areaData=res.data.result
console.log(this.areaData)
// this.tree.open=true
}
})
.catch((error) => {
this.$message.error(error.message);
});
}, },
methods: { methods: {
handleNodeClick(node) {
this.currentNode = node;
this.areaCode=node.areaCode
this.areaName=node.label
console.log("node:",node)
},
updateSiteConform() {
if(this.areaCode===''||this.areaCode==='undefined'){
this.$message.error("请选择需要创建站点的区域!");
return;
}
if(this.siteName===''||this.siteName==='undefined'){
this.$message.error("请选择需要创建站点的名称!");
return;
}
return; //todo
this.loading = true;
this.$post("/setup/project/site/updateSite", {
areaCode: this.areaCode,
siteName: this.siteName,
})
.then((res) => {
if (res.code == 1) {
this.$message.success("创建站点成功!");
this.tree.open = false;
//todo
// this.getData();
}
})
.catch((error) => {
this.loading = false;
this.$message.error(error.message);
});
},
/** 导入 */ /** 导入 */
handleImport() { handleImport() {
this.upload.title = "项目文件包导入"; this.upload.title = "项目文件包导入";
this.upload.open = true; //this.upload.open = true;
this.tree.open=true
console.log(this.areaData)
}, },
/** 重写新增方法 */ /** 重写新增方法 */
toAdd(row) { toAdd(row) {
...@@ -347,8 +460,18 @@ ...@@ -347,8 +460,18 @@
/** 提交上传文件 */ /** 提交上传文件 */
submitGuideFileForm() { submitGuideFileForm() {
this.$refs.guide.submit(); this.$refs.guide.submit();
},
async loadNode(node, resolve) {
console.log(11111111111,node)
if (node.areaLevel === 0) {
return;
}
this.$get("/base/area/getListByParentId", {
parentId: node.data.id,
}).then(({ data }) => {
resolve(data.result);
});
}, },
}, },
...@@ -380,6 +503,20 @@ ...@@ -380,6 +503,20 @@
// 上传的地址 // 上传的地址
url: "/m/setup/project/importProjectData", url: "/m/setup/project/importProjectData",
}, },
tree: {
// 是否显示弹出层(设备导入)
open: false,
// 弹出层标题(设备导入)
title: "选择区域创建站点"
},
areaName: "",
areaCode: "",
siteName: "",
siteCode: "",
siteInfo: {},
updateSiteId: null,
updateSiteName: "",
updateSiteCode: "",
config: { config: {
search: [ search: [
...@@ -534,3 +671,5 @@ ...@@ -534,3 +671,5 @@
} }
}; };
</script> </script>
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