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