Commit 6d9e8b1d by 潘建波

fix🐛 支持查看每个子节点的信息

1 parent 5754a06c
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -4,7 +4,7 @@ console.log(process.env.NODE_ENV); ...@@ -4,7 +4,7 @@ console.log(process.env.NODE_ENV);
switch (process.env.NODE_ENV) { switch (process.env.NODE_ENV) {
case "development": case "development":
// baseUrl = "http://192.168.9.234:20080"; // 测试环境url // baseUrl = "http://192.168.9.234:20080"; // 测试环境url
baseUrl = "http://192.168.9.149:20080"; // 测试环境url baseUrl = "http://192.168.9.62:20080"; // 测试环境url
// baseUrl = "http://192.168.9.82:8080"; // 测试环境url // baseUrl = "http://192.168.9.82:8080"; // 测试环境url
// baseUrl = "http://192.168.9.61:8086"; // baseUrl = "http://192.168.9.61:8086";
// baseUrl = 'http://vion-panda.51vip.biz:52510'; // baseUrl = 'http://vion-panda.51vip.biz:52510';
......
...@@ -361,7 +361,7 @@ export default { ...@@ -361,7 +361,7 @@ export default {
if (index == 0 && i == num - 1) { if (index == 0 && i == num - 1) {
var line = draw var line = draw
.polyline([ .polyline([
[linepoint.x, linepoint.y], [linepoint.x + 10, linepoint.y],
[point.x - 50, point.y - (index == 0 ? 30 : 58)] [point.x - 50, point.y - (index == 0 ? 30 : 58)]
]) ])
.stroke({ width: 1, color: "red" }); .stroke({ width: 1, color: "red" });
...@@ -423,7 +423,8 @@ export default { ...@@ -423,7 +423,8 @@ export default {
//事件点击 //事件点击
nested.click(function() { nested.click(function() {
let data = this.data("childsdv"); let data = this.data("childsdv");
this.curDevData = data; console.log("leval",data)
_this.curDevData = data;
}); });
}); });
} }
......
...@@ -510,10 +510,9 @@ export default { ...@@ -510,10 +510,9 @@ export default {
this.startTimer = setTimeout(() => { this.startTimer = setTimeout(() => {
this.startTimer = null; this.startTimer = null;
this.drawModel(data); this.drawModel(data);
}, 800); }, 100);
} }
}, },
//绘制模型线 //绘制模型线
drawModel(data) { drawModel(data) {
console.log(data); console.log(data);
......
<template> <template>
<div class="paramset-box"> <div class="paramset-box">
<el-dialog :title="curtype === 'export'?'配置导出':'配置导入'" :visible.sync="dialogVisible" width="30%" :before-close="handleClose"> <el-dialog
:title="curtype === 'export' ? '配置导出' : '配置导入'"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose"
>
<div class="setparams-box"> <div class="setparams-box">
<el-form label-width="80px" :model="paramform" v-show="curtype === 'upload'"> <el-form
label-width="80px"
:model="paramform"
v-show="curtype === 'upload'"
>
<el-form-item label="类型"> <el-form-item label="类型">
<el-select v-model="paramform.fileType"> <el-select v-model="paramform.fileType">
<el-option v-for="type in types" :key="type.type_code" :value="type.type_code" :label="type.conf_name"></el-option> <el-option
</el-select> v-for="type in types"
:key="type.type_code"
:value="type.type_code"
:label="type.conf_name"
></el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="名称"> <el-form-item label="名称">
<el-input v-model="paramform.name"></el-input> <el-input v-model="paramform.name"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="文件"> <el-form-item label="文件">
<el-upload <el-upload
class="upload-demo" class="upload-demo"
ref="paramsup" ref="paramsup"
action="" action=""
:on-change="handlePreview" :on-change="handlePreview"
multiple multiple
:limit="1" :limit="1"
:auto-upload="false" :auto-upload="false"
:on-success="sucessfile" :on-success="sucessfile"
:file-list="fileList"> :file-list="fileList"
<el-button size="small" slot="trigger" type="primary">点击上传</el-button> >
<div slot="tip" class="el-upload__tip">只能上传tar.gz文件.</div> <el-button size="small" slot="trigger" type="primary"
</el-upload> >点击上传</el-button
>
<div slot="tip" class="el-upload__tip">只能上传tar.gz文件.</div>
</el-upload>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-form label-width="80px" :model="exportform" v-show="curtype === 'export'"> <el-form
<el-form-item label="类型"> label-width="80px"
<el-select v-model="paramform.fileType"> :model="exportform"
<el-option v-for="type in types" :key="type.type_code" :value="type.type_code" :label="type.conf_name"></el-option> v-show="curtype === 'export'"
</el-select> >
<el-form-item label="类型">
<el-select v-model="paramform.fileType">
<el-option
v-for="type in types"
:key="type.type_code"
:value="type.type_code"
:label="type.conf_name"
></el-option>
</el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
...@@ -48,14 +74,14 @@ export default { ...@@ -48,14 +74,14 @@ export default {
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
paramform:{ paramform: {
fileType:'' fileType: ""
}, },
exportform:{}, exportform: {},
fileList:[], fileList: [],
types:[], types: [],
curtype:'', curtype: "",
upfile:'' upfile: ""
}; };
}, },
methods: { methods: {
...@@ -64,67 +90,61 @@ export default { ...@@ -64,67 +90,61 @@ export default {
this.dialogVisible = true; this.dialogVisible = true;
this.$store.commit("setocxstate", 1); this.$store.commit("setocxstate", 1);
}, },
handlePreview(file,fileList){ handlePreview(file, fileList) {
debugger if (this.uploadFile(file, "application/x-gzip")) {
if(this.uploadFile(file,'application/x-gzip')){ this.upfile = file;
this.upfile = file return false;
return false
} else { } else {
this.fileList = [] this.fileList = [];
return false return false;
} }
}, },
uploadparams(){ uploadparams() {
let render = new FileReader(); let render = new FileReader();
let file_text = ''; let file_text = "";
reader.readAsDataURL(this.upfile); reader.readAsDataURL(this.upfile);
reader.onloadend = ()=> { reader.onloadend = () => {
let dataURL = reader.result.split(';base64,'); let dataURL = reader.result.split(";base64,");
let file_ext = ''; let file_ext = "";
if((this.upfile.name).slice(-7) === ".tar.gz") { if (this.upfile.name.slice(-7) === ".tar.gz") {
file_ext = ".tar.gz"; file_ext = ".tar.gz";
} else if((this.upfile.name).slice(-3) === '.gz') { } else if (this.upfile.name.slice(-3) === ".gz") {
file_ext = '.gz' file_ext = ".gz";
} }
} };
let obj = { let obj = {
command: 'put /wsapi/v1/devconf_fx/conf_param', command: "put /wsapi/v1/devconf_fx/conf_param",
src_page: "", src_page: "",
params: { params: {
type_code: this.paramform.fileType, type_code: this.paramform.fileType,
subtask_id: this.subtask_id, subtask_id: this.subtask_id,
conf_name: this.paramform.name, conf_name: this.paramform.name,
file_ext: file_ext, file_ext: file_ext,
file_b64: dataURL[1], file_b64: dataURL[1],
is_temp: 1, is_temp: 1
} }
} };
this.globalWs.send(JSON.stringify(obj)) this.globalWs.send(JSON.stringify(obj));
console.log(this.upfile) console.log(this.upfile);
}, },
sucessfile(){ sucessfile() {},
}, submitParamSet() {},
submitParamSet(){
},
handleClose(done) { handleClose(done) {
this.dialogVisible = false, (this.dialogVisible = false), this.$store.commit("setocxstate", 0);
this.$store.commit("setocxstate", 0);
}, },
getTypes(){ getTypes() {
let params = { let params = {
offset: 0, offset: 0,
limit: '' limit: ""
} };
this.$api.device.getConfParam(params).then(res => { this.$api.device.getConfParam(params).then(res => {
this.types = res.list_data this.types = res.list_data;
}) });
} }
}, },
created(){ created() {
this.getTypes() this.getTypes();
} }
}; };
</script> </script>
...@@ -137,4 +157,4 @@ export default { ...@@ -137,4 +157,4 @@ export default {
.paramset-box{ .paramset-box{
overflow hidden overflow hidden
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -310,8 +310,15 @@ export default { ...@@ -310,8 +310,15 @@ export default {
"content-type": "multipart/form-data" "content-type": "multipart/form-data"
}) })
.then(res => { .then(res => {
this.setvisible = false; if (res.ecode && res.ecode != 500) {
this.$emit("refresh"); this.setvisible = false;
this.$emit("refresh");
} else {
this.$message({
message: res.enote,
type: "error"
});
}
}); });
} else { } else {
console.log("error submit!!"); console.log("error submit!!");
......
No preview for this file type
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!