zyh 11-2 thrid
|
|
@ -0,0 +1,614 @@
|
|||
<!-- 斥候MQTT云 -->
|
||||
<template>
|
||||
<div class="Clone">
|
||||
<!-- 设置树形控件 -->
|
||||
<div v-click-outside="closeMenu">
|
||||
<!-- <el-button type="info" plain @click="dialogVisible = true">斥侯MQTT云</el-button> -->
|
||||
<div v-show="dialogVisible" class="tree_menu">
|
||||
<el-tree
|
||||
:data="datas"
|
||||
:props="defaultProps"
|
||||
@node-click="treeNodeClick"
|
||||
></el-tree>
|
||||
<!-- 树形控件右键组件 -->
|
||||
</div>
|
||||
<<<<<<< HEAD
|
||||
</div>
|
||||
<div class="pas_params" v-show="add_passage">
|
||||
<div class="content">
|
||||
<div class="con_left">
|
||||
<el-form
|
||||
:label-position="labelPosition"
|
||||
:rules="rules"
|
||||
ref="ruleForm"
|
||||
=======
|
||||
<div>
|
||||
<div class="con_right">
|
||||
<el-menu
|
||||
class="el-menu-demo"
|
||||
mode="horizontal"
|
||||
@select="handleSelect"
|
||||
>>>>>>> f93587abd4370fe372609d70c64615a4f632f8d8
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="mqtt_qiyong">启用</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="服务器IP:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_ip"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input
|
||||
v-model="mqtt_ip1"
|
||||
style="width: 43px; height: 30px"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input
|
||||
v-model="mqtt_ip2"
|
||||
style="width: 43px; height: 30px"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input
|
||||
v-model="mqtt_ip3"
|
||||
style="width: 43px; height: 30px"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input
|
||||
v-model="mqtt_ip4"
|
||||
style="width: 43px; height: 30px"
|
||||
></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
label="网关SN:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_wgsn"
|
||||
>
|
||||
<el-input
|
||||
v-model="mqtt_wgsn"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
label="端口:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_port"
|
||||
>
|
||||
<el-input
|
||||
v-model="mqtt_port"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="Keep Alive(s):"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_keepalive"
|
||||
>
|
||||
<el-input
|
||||
v-model="mqtt_keepalive"
|
||||
placeholder="64"
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
<div class="infos">2-60000</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="TLS加密:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_tls"
|
||||
>
|
||||
<el-switch v-model="mqtt_tls"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="清除Session:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_clearsession"
|
||||
>
|
||||
<el-switch v-model="mqtt_clearsession"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<h3 class="info_play">信息发布</h3>
|
||||
<el-divider></el-divider>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="Qos(MQTT):"
|
||||
:label-width="formLabelWidth"
|
||||
prop="upload_week"
|
||||
>
|
||||
<el-select
|
||||
v-model="mqtt_qos"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="retained:" :label-width="formLabelWidth" prop="retained">
|
||||
<el-switch v-model="value1"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<!-- <el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="入口函数:" :label-width="formLabelWidth" prop="upload_week">
|
||||
<el-input v-model="input1" placeholder="64" style="width: 200px;height:30px"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
<!-- <el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="函数代码:" :label-width="formLabelWidth" prop="upload_week">
|
||||
<prism-editor class="my-editor height-300" v-model="code" :highlight="highlighter"
|
||||
:line-numbers="lineNumbers"></prism-editor>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
<div class="con_left_footer">
|
||||
<el-button type="primary" @click="add_passage = false"
|
||||
>保 存</el-button
|
||||
>
|
||||
<el-button @click="add_passage = false">取 消</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
<div>
|
||||
<div class="con_right">
|
||||
<el-menu
|
||||
class="el-menu-demo"
|
||||
mode="horizontal"
|
||||
@select="handleSelect"
|
||||
>
|
||||
<el-menu-item index="1">添加</el-menu-item>
|
||||
<el-menu-item index="2">保存</el-menu-item>
|
||||
<el-menu-item index="3">删除</el-menu-item>
|
||||
</el-menu>
|
||||
</div>
|
||||
<el-table ref="singleTable" :data="tableData" style="width: 100%">
|
||||
<el-table-column type="index"> </el-table-column>
|
||||
<el-table-column property="mqtt_cjd_sbmc" label="设备名称">
|
||||
</el-table-column>
|
||||
<el-table-column property="mqtt_cjd_tagid" label="TagID">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加按钮下显示出来的弹框信息 -->
|
||||
<div>
|
||||
<el-dialog title="选择点" :visible.sync="choose_point" width="30%">
|
||||
<el-tree
|
||||
:data="points"
|
||||
show-checkbox
|
||||
node-key="id"
|
||||
:default-expanded-keys="[1, 2]"
|
||||
:default-checked-keys="[3, 4, 5, 6]"
|
||||
:props="defaultProps"
|
||||
>
|
||||
</el-tree>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="savePoint"
|
||||
>保 存</el-button
|
||||
>
|
||||
<el-button @click="choose_point = false">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { PrismEditor } from "vue-prism-editor";
|
||||
import "vue-prism-editor/dist/prismeditor.min.css"; // import the styles somewhere
|
||||
// import highlighting library (you can use any library you want just return html string)
|
||||
import { highlight, languages } from "prismjs/components/prism-core";
|
||||
import "prismjs/components/prism-clike";
|
||||
import "prismjs/components/prism-javascript";
|
||||
import "prismjs/themes/prism-tomorrow.css"; // import syntax highlighting styles
|
||||
|
||||
export default {
|
||||
name: "ChiClone",
|
||||
components: {
|
||||
PrismEditor,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mqtt_qiyong: true,
|
||||
mqtt_ip: "",
|
||||
mqtt_ip1: "",
|
||||
mqtt_ip2: "",
|
||||
mqtt_ip3: "",
|
||||
mqtt_ip4: "",
|
||||
mqtt_wgsn: "",
|
||||
mqtt_port: "",
|
||||
mqtt_keepalive: "",
|
||||
mqtt_tls: false,
|
||||
mqtt_clearsession: false,
|
||||
// mqtt_sssjfbzt:"",
|
||||
mqtt_qos: "0",
|
||||
// code: 'console.log("Hello World")',
|
||||
// lineNumbers: true, // true为编辑模式, false只展示不可编辑
|
||||
points: [
|
||||
{
|
||||
id: 1,
|
||||
label: "Device1",
|
||||
children: [
|
||||
{
|
||||
id: 3,
|
||||
label: "tag0001",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
label: "tag0002",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
label: "Device1",
|
||||
children: [
|
||||
{
|
||||
id: 5,
|
||||
label: "tag0003",
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
label: "tag0004",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
choose_point: false,
|
||||
options1: [
|
||||
{
|
||||
value: "0",
|
||||
label: "0",
|
||||
},
|
||||
{
|
||||
value: "1",
|
||||
label: "1",
|
||||
},
|
||||
{
|
||||
value: "2",
|
||||
label: "2",
|
||||
},
|
||||
],
|
||||
labelPosition: "left",
|
||||
formLabelWidth: "114px",
|
||||
input1: 192,
|
||||
add_passage: false,
|
||||
rightMenu: "",
|
||||
dialogVisible: true,
|
||||
isAdd: false,
|
||||
datas: [
|
||||
{
|
||||
label: "Gateway",
|
||||
children: [
|
||||
{
|
||||
label: "数据采集",
|
||||
children: [
|
||||
{
|
||||
label: "I/O点",
|
||||
},
|
||||
{
|
||||
label: "用户点",
|
||||
},
|
||||
{
|
||||
label: "计算点",
|
||||
},
|
||||
{
|
||||
label: "系统点",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "上云服务",
|
||||
children: [
|
||||
{
|
||||
label: "标准 MQTT",
|
||||
},
|
||||
{
|
||||
label: "AWS loT",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
defaultProps: {
|
||||
children: "children",
|
||||
label: "label",
|
||||
},
|
||||
tableData: [
|
||||
{
|
||||
mqtt_cjd_sbmc: "Device1",
|
||||
mqtt_cjd_tagid: "Device1.tag0001",
|
||||
},
|
||||
],
|
||||
rules: {
|
||||
server_ip: [
|
||||
{ required: true, message: "请输入服务器IP", trigger: "blur" },
|
||||
],
|
||||
port_number: [
|
||||
{ required: true, message: "请输入端口", trigger: "blur" },
|
||||
],
|
||||
gateway_id: [
|
||||
{ required: true, message: "请输入网关ID", trigger: "blur" },
|
||||
],
|
||||
data_theme: [
|
||||
{ required: true, message: "请输入主题", trigger: "blur" },
|
||||
],
|
||||
upload_mode: [
|
||||
{ required: true, message: "请输入上传模式", trigger: "blur" },
|
||||
],
|
||||
upload_week: [
|
||||
{ required: true, message: "请输入上传周期", trigger: "blur" },
|
||||
],
|
||||
data_filter: [
|
||||
{ required: true, message: "请输入数据过滤", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
treeNodeClick() {
|
||||
this.add_passage = true;
|
||||
},
|
||||
getDriveName() {
|
||||
this.diag_drive = true;
|
||||
},
|
||||
handleSelect(key) {
|
||||
console.log(key);
|
||||
if (key == 1 && this.isAdd == false) {
|
||||
this.choose_point = true;
|
||||
} else if (key == 1 && this.isAdd == true) {
|
||||
this.$message({
|
||||
message: '添加失败,只能添加一条数据',
|
||||
type: 'error'
|
||||
});
|
||||
return false
|
||||
}
|
||||
},
|
||||
highlighter(code) {
|
||||
return highlight(code, languages.js); //returns html
|
||||
},
|
||||
closeMenu(ev) {
|
||||
console.log({ ev });
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
savePoint() {
|
||||
this.choose_point = false;
|
||||
this.isAdd = true;
|
||||
this.$message({
|
||||
message: '添加成功',
|
||||
type: 'success'
|
||||
});
|
||||
},
|
||||
},
|
||||
directives: {
|
||||
"click-outside": {
|
||||
bind: function (el, binding, vnode) {
|
||||
console.log("el", el);
|
||||
console.log("binding", binding);
|
||||
el.event = function (event) {
|
||||
// 检查点击是否发生在节点之内(包括子节点)
|
||||
if (!(el == event.target || el.contains(event.target))) {
|
||||
// 如果没有,则触发调用
|
||||
// 若绑定值为函数,则执行
|
||||
// 这里我们可以通过钩子函数中的 vnode.context,来获取当前组件的作用域
|
||||
if (typeof vnode.context[binding.expression] == "function") {
|
||||
vnode.context[binding.expression](event);
|
||||
}
|
||||
}
|
||||
};
|
||||
// 绑定事件
|
||||
// 设置为true,代表在DOM树中,注册了该listener的元素,会先于它下方的任何事件目标,接收到该事件。
|
||||
document.body.addEventListener("click", el.event, true);
|
||||
},
|
||||
unbind: function (el) {
|
||||
// 解绑事件
|
||||
document.body.removeEventListener("click", el.event, true);
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.tree_menu {
|
||||
position: absolute;
|
||||
width: 286px;
|
||||
height: 753px;
|
||||
left: 64px;
|
||||
top: 104px;
|
||||
width: 286px;
|
||||
height: 753px;
|
||||
line-height: 20px;
|
||||
border-radius: 3px;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
text-align: center;
|
||||
border: 1px solid rgba(220, 220, 220, 1);
|
||||
}
|
||||
|
||||
/deep/ .pas_params {
|
||||
.info_play {
|
||||
width: 56px;
|
||||
height: 20px;
|
||||
color: rgba(16, 16, 16, 1);
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.el-divider--horizontal {
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
.el-button {
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
line-height: 0.5;
|
||||
}
|
||||
|
||||
.el-col-12:last-child {
|
||||
padding-right: 150px;
|
||||
}
|
||||
|
||||
.el-col-12:first-child {
|
||||
padding-right: 28px;
|
||||
}
|
||||
|
||||
.el-row {
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
|
||||
.el-col-1 {
|
||||
text-align: center;
|
||||
line-height: 52px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.el-col-9 {
|
||||
padding-left: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
height: 30px;
|
||||
text-align: left;
|
||||
padding: 0px 8px;
|
||||
}
|
||||
|
||||
.content {
|
||||
position: absolute;
|
||||
left: 362px;
|
||||
top: 104px;
|
||||
width: 1220px;
|
||||
height: 836px;
|
||||
line-height: 20px;
|
||||
padding-left: 36px;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
color: rgba(16, 16, 16, 1);
|
||||
font-size: 14px;
|
||||
border: 1px solid rgba(187, 187, 187, 1);
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
/deep/ .con_left {
|
||||
.el-con-5 {
|
||||
width: 43px;
|
||||
}
|
||||
}
|
||||
|
||||
.con_left {
|
||||
width: 709px;
|
||||
position: relative;
|
||||
|
||||
.my-editor {
|
||||
background: #2d2d2d;
|
||||
color: #ccc;
|
||||
|
||||
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
/* optional */
|
||||
.prism-editor__textarea:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* not required: */
|
||||
.height-300 {
|
||||
width: 491px;
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
.infos {
|
||||
width: 60px;
|
||||
position: absolute;
|
||||
left: 208px;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.con_left_footer {
|
||||
position: absolute;
|
||||
left: 499px;
|
||||
top: 720px;
|
||||
}
|
||||
}
|
||||
|
||||
.con_right {
|
||||
width: 480px;
|
||||
|
||||
.dialog-footer {
|
||||
.el-button {
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
line-height: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
|
@ -0,0 +1,605 @@
|
|||
<!-- 斥候MQTT云 -->
|
||||
<template>
|
||||
<div class="Clone">
|
||||
<!-- 设置树形控件 -->
|
||||
<div v-click-outside="closeMenu">
|
||||
<!-- <el-button type="info" plain @click="dialogVisible = true">斥侯MQTT云</el-button> -->
|
||||
<div v-show="dialogVisible" class="tree_menu">
|
||||
<el-tree
|
||||
:data="datas"
|
||||
:props="defaultProps"
|
||||
@node-click="treeNodeClick"
|
||||
></el-tree>
|
||||
<!-- 树形控件右键组件 -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="pas_params" v-show="add_passage">
|
||||
<div class="content">
|
||||
<div class="con_left">
|
||||
<el-form
|
||||
:label-position="labelPosition"
|
||||
:rules="rules"
|
||||
ref="ruleForm"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item>
|
||||
<el-checkbox v-model="mqtt_qiyong">启用</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="服务器IP:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_ip"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :span="5">
|
||||
<el-input
|
||||
v-model="mqtt_ip1"
|
||||
style="width: 43px; height: 30px"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">. </el-col>
|
||||
<el-col :span="5">
|
||||
<el-input
|
||||
v-model="mqtt_ip2"
|
||||
style="width: 43px; height: 30px"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input
|
||||
v-model="mqtt_ip3"
|
||||
style="width: 43px; height: 30px"
|
||||
></el-input>
|
||||
</el-col>
|
||||
<el-col :span="1">.</el-col>
|
||||
<el-col :span="5">
|
||||
<el-input
|
||||
v-model="mqtt_ip4"
|
||||
style="width: 43px; height: 30px"
|
||||
></el-input>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
label="网关SN:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_wgsn"
|
||||
>
|
||||
<el-input
|
||||
v-model="mqtt_wgsn"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<el-form-item
|
||||
label="端口:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_port"
|
||||
>
|
||||
<el-input
|
||||
v-model="mqtt_port"
|
||||
placeholder=""
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="Keep Alive(s):"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_keepalive"
|
||||
>
|
||||
<el-input
|
||||
v-model="mqtt_keepalive"
|
||||
placeholder="64"
|
||||
style="width: 200px; height: 30px"
|
||||
></el-input>
|
||||
<div class="infos">2-60000</div>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="TLS加密:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_tls"
|
||||
>
|
||||
<el-switch v-model="mqtt_tls"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="清除Session:"
|
||||
:label-width="formLabelWidth"
|
||||
prop="mqtt_clearsession"
|
||||
>
|
||||
<el-switch v-model="mqtt_clearsession"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<h3 class="info_play">信息发布</h3>
|
||||
<el-divider></el-divider>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item
|
||||
label="Qos(MQTT):"
|
||||
:label-width="formLabelWidth"
|
||||
prop="upload_week"
|
||||
>
|
||||
<el-select
|
||||
v-model="mqtt_qos"
|
||||
placeholder="请选择"
|
||||
style="width: 200px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in options1"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!-- <el-col :span="12">
|
||||
<el-form-item label="retained:" :label-width="formLabelWidth" prop="retained">
|
||||
<el-switch v-model="value1"></el-switch>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
</el-row>
|
||||
<!-- <el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="入口函数:" :label-width="formLabelWidth" prop="upload_week">
|
||||
<el-input v-model="input1" placeholder="64" style="width: 200px;height:30px"></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
<!-- <el-row>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="函数代码:" :label-width="formLabelWidth" prop="upload_week">
|
||||
<prism-editor class="my-editor height-300" v-model="code" :highlight="highlighter"
|
||||
:line-numbers="lineNumbers"></prism-editor>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row> -->
|
||||
<div class="con_left_footer">
|
||||
<el-button type="primary" @click="add_passage = false"
|
||||
>保 存</el-button
|
||||
>
|
||||
<el-button @click="add_passage = false">取 消</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
<div>
|
||||
<div class="con_right">
|
||||
<el-menu
|
||||
class="el-menu-demo"
|
||||
mode="horizontal"
|
||||
@select="handleSelect"
|
||||
>
|
||||
<el-menu-item index="1">添加</el-menu-item>
|
||||
<el-menu-item index="2">保存</el-menu-item>
|
||||
<el-menu-item index="3">删除</el-menu-item>
|
||||
</el-menu>
|
||||
</div>
|
||||
<el-table ref="singleTable" :data="tableData" style="width: 100%">
|
||||
<el-table-column type="index"> </el-table-column>
|
||||
<el-table-column property="mqtt_cjd_sbmc" label="设备名称">
|
||||
</el-table-column>
|
||||
<el-table-column property="mqtt_cjd_tagid" label="TagID">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 添加按钮下显示出来的弹框信息 -->
|
||||
<div>
|
||||
<el-dialog title="选择点" :visible.sync="choose_point" width="30%">
|
||||
<el-tree
|
||||
:data="points"
|
||||
show-checkbox
|
||||
node-key="id"
|
||||
:default-expanded-keys="[1, 2]"
|
||||
:default-checked-keys="[3, 4, 5, 6]"
|
||||
:props="defaultProps"
|
||||
>
|
||||
</el-tree>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="savePoint"
|
||||
>保 存</el-button
|
||||
>
|
||||
<el-button @click="choose_point = false">取 消</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { PrismEditor } from "vue-prism-editor";
|
||||
import "vue-prism-editor/dist/prismeditor.min.css"; // import the styles somewhere
|
||||
// import highlighting library (you can use any library you want just return html string)
|
||||
import { highlight, languages } from "prismjs/components/prism-core";
|
||||
import "prismjs/components/prism-clike";
|
||||
import "prismjs/components/prism-javascript";
|
||||
import "prismjs/themes/prism-tomorrow.css"; // import syntax highlighting styles
|
||||
|
||||
export default {
|
||||
name: "ChiClone",
|
||||
components: {
|
||||
PrismEditor,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
mqtt_qiyong: true,
|
||||
mqtt_ip: "",
|
||||
mqtt_ip1: "",
|
||||
mqtt_ip2: "",
|
||||
mqtt_ip3: "",
|
||||
mqtt_ip4: "",
|
||||
mqtt_wgsn: "",
|
||||
mqtt_port: "",
|
||||
mqtt_keepalive: "",
|
||||
mqtt_tls: false,
|
||||
mqtt_clearsession: false,
|
||||
// mqtt_sssjfbzt:"",
|
||||
mqtt_qos: "0",
|
||||
// code: 'console.log("Hello World")',
|
||||
// lineNumbers: true, // true为编辑模式, false只展示不可编辑
|
||||
points: [
|
||||
{
|
||||
id: 1,
|
||||
label: "Device1",
|
||||
children: [
|
||||
{
|
||||
id: 3,
|
||||
label: "tag0001",
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
label: "tag0002",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
label: "Device1",
|
||||
children: [
|
||||
{
|
||||
id: 5,
|
||||
label: "tag0003",
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
label: "tag0004",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
choose_point: false,
|
||||
options1: [
|
||||
{
|
||||
value: "0",
|
||||
label: "0",
|
||||
},
|
||||
{
|
||||
value: "1",
|
||||
label: "1",
|
||||
},
|
||||
{
|
||||
value: "2",
|
||||
label: "2",
|
||||
},
|
||||
],
|
||||
labelPosition: "left",
|
||||
formLabelWidth: "114px",
|
||||
input1: 192,
|
||||
add_passage: false,
|
||||
rightMenu: "",
|
||||
dialogVisible: true,
|
||||
isAdd: false,
|
||||
datas: [
|
||||
{
|
||||
label: "Gateway",
|
||||
children: [
|
||||
{
|
||||
label: "数据采集",
|
||||
children: [
|
||||
{
|
||||
label: "I/O点",
|
||||
},
|
||||
{
|
||||
label: "用户点",
|
||||
},
|
||||
{
|
||||
label: "计算点",
|
||||
},
|
||||
{
|
||||
label: "系统点",
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: "上云服务",
|
||||
children: [
|
||||
{
|
||||
label: "标准 MQTT",
|
||||
},
|
||||
{
|
||||
label: "AWS loT",
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
defaultProps: {
|
||||
children: "children",
|
||||
label: "label",
|
||||
},
|
||||
tableData: [
|
||||
{
|
||||
mqtt_cjd_sbmc: "Device1",
|
||||
mqtt_cjd_tagid: "Device1.tag0001",
|
||||
},
|
||||
],
|
||||
rules: {
|
||||
server_ip: [
|
||||
{ required: true, message: "请输入服务器IP", trigger: "blur" },
|
||||
],
|
||||
port_number: [
|
||||
{ required: true, message: "请输入端口", trigger: "blur" },
|
||||
],
|
||||
gateway_id: [
|
||||
{ required: true, message: "请输入网关ID", trigger: "blur" },
|
||||
],
|
||||
data_theme: [
|
||||
{ required: true, message: "请输入主题", trigger: "blur" },
|
||||
],
|
||||
upload_mode: [
|
||||
{ required: true, message: "请输入上传模式", trigger: "blur" },
|
||||
],
|
||||
upload_week: [
|
||||
{ required: true, message: "请输入上传周期", trigger: "blur" },
|
||||
],
|
||||
data_filter: [
|
||||
{ required: true, message: "请输入数据过滤", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
treeNodeClick() {
|
||||
this.add_passage = true;
|
||||
},
|
||||
getDriveName() {
|
||||
this.diag_drive = true;
|
||||
},
|
||||
handleSelect(key) {
|
||||
console.log(key);
|
||||
if (key == 1 && this.isAdd == false) {
|
||||
this.choose_point = true;
|
||||
} else if (key == 1 && this.isAdd == true) {
|
||||
this.$message({
|
||||
message: '添加失败,只能添加一条数据',
|
||||
type: 'error'
|
||||
});
|
||||
return false
|
||||
}
|
||||
},
|
||||
highlighter(code) {
|
||||
return highlight(code, languages.js); //returns html
|
||||
},
|
||||
closeMenu(ev) {
|
||||
console.log({ ev });
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
savePoint() {
|
||||
this.choose_point = false;
|
||||
this.isAdd = true;
|
||||
this.$message({
|
||||
message: '添加成功',
|
||||
type: 'success'
|
||||
});
|
||||
},
|
||||
},
|
||||
directives: {
|
||||
"click-outside": {
|
||||
bind: function (el, binding, vnode) {
|
||||
console.log("el", el);
|
||||
console.log("binding", binding);
|
||||
el.event = function (event) {
|
||||
// 检查点击是否发生在节点之内(包括子节点)
|
||||
if (!(el == event.target || el.contains(event.target))) {
|
||||
// 如果没有,则触发调用
|
||||
// 若绑定值为函数,则执行
|
||||
// 这里我们可以通过钩子函数中的 vnode.context,来获取当前组件的作用域
|
||||
if (typeof vnode.context[binding.expression] == "function") {
|
||||
vnode.context[binding.expression](event);
|
||||
}
|
||||
}
|
||||
};
|
||||
// 绑定事件
|
||||
// 设置为true,代表在DOM树中,注册了该listener的元素,会先于它下方的任何事件目标,接收到该事件。
|
||||
document.body.addEventListener("click", el.event, true);
|
||||
},
|
||||
unbind: function (el) {
|
||||
// 解绑事件
|
||||
document.body.removeEventListener("click", el.event, true);
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.tree_menu {
|
||||
position: absolute;
|
||||
width: 286px;
|
||||
height: 753px;
|
||||
left: 64px;
|
||||
top: 104px;
|
||||
width: 286px;
|
||||
height: 753px;
|
||||
line-height: 20px;
|
||||
border-radius: 3px;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
text-align: center;
|
||||
border: 1px solid rgba(220, 220, 220, 1);
|
||||
}
|
||||
|
||||
/deep/ .pas_params {
|
||||
.info_play {
|
||||
width: 56px;
|
||||
height: 20px;
|
||||
color: rgba(16, 16, 16, 1);
|
||||
font-size: 14px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.el-divider--horizontal {
|
||||
margin: 8px 0;
|
||||
}
|
||||
|
||||
.el-button {
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
line-height: 0.5;
|
||||
}
|
||||
|
||||
.el-col-12:last-child {
|
||||
padding-right: 150px;
|
||||
}
|
||||
|
||||
.el-col-12:first-child {
|
||||
padding-right: 28px;
|
||||
}
|
||||
|
||||
.el-row {
|
||||
height: 40px;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
|
||||
.el-col-1 {
|
||||
text-align: center;
|
||||
line-height: 52px;
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
.el-col-9 {
|
||||
padding-left: 30px;
|
||||
}
|
||||
}
|
||||
|
||||
.el-input__inner {
|
||||
height: 30px;
|
||||
text-align: left;
|
||||
padding: 0px 8px;
|
||||
}
|
||||
|
||||
.content {
|
||||
position: absolute;
|
||||
left: 362px;
|
||||
top: 104px;
|
||||
width: 1220px;
|
||||
height: 836px;
|
||||
line-height: 20px;
|
||||
padding-left: 36px;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
color: rgba(16, 16, 16, 1);
|
||||
font-size: 14px;
|
||||
border: 1px solid rgba(187, 187, 187, 1);
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
/deep/ .con_left {
|
||||
.el-con-5 {
|
||||
width: 43px;
|
||||
}
|
||||
}
|
||||
|
||||
.con_left {
|
||||
width: 709px;
|
||||
position: relative;
|
||||
|
||||
.my-editor {
|
||||
background: #2d2d2d;
|
||||
color: #ccc;
|
||||
|
||||
font-family: Fira code, Fira Mono, Consolas, Menlo, Courier, monospace;
|
||||
font-size: 14px;
|
||||
line-height: 1.5;
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
/* optional */
|
||||
.prism-editor__textarea:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
/* not required: */
|
||||
.height-300 {
|
||||
width: 491px;
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
.infos {
|
||||
width: 60px;
|
||||
position: absolute;
|
||||
left: 208px;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.con_left_footer {
|
||||
position: absolute;
|
||||
left: 499px;
|
||||
top: 720px;
|
||||
}
|
||||
}
|
||||
|
||||
.con_right {
|
||||
width: 480px;
|
||||
|
||||
.dialog-footer {
|
||||
.el-button {
|
||||
width: 80px;
|
||||
height: 30px;
|
||||
line-height: 0.5;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
|
Before Width: | Height: | Size: 153 B |
|
Before Width: | Height: | Size: 146 B |
|
Before Width: | Height: | Size: 155 B |
|
|
@ -1,6 +0,0 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 24 24" width="30" height="30" style="border-color: rgba(0,0,0,0);border-width: bpx;border-style: undefined" filter="none">
|
||||
|
||||
<g>
|
||||
<path d="M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" fill="rgba(2.04,205.02,230.01000000000002,1)"></path>
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 364 B |
|
Before Width: | Height: | Size: 147 B |
|
Before Width: | Height: | Size: 96 B |
|
Before Width: | Height: | Size: 102 KiB |
|
|
@ -238,6 +238,11 @@ export let ratedChart = {
|
|||
//悬浮框
|
||||
show: true, // 是否显示
|
||||
trigger: "item", //
|
||||
extraCssText: "max-height: 20px;",
|
||||
position: function (point, params, dom, rect, size) {
|
||||
// 您可以在此自定义 Tooltip 的位置
|
||||
return [point[0], "10%"];
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
|
|
@ -391,7 +396,11 @@ export let stopChart = {
|
|||
tooltip: {
|
||||
//悬浮框
|
||||
show: true, // 是否显示
|
||||
// trigger: "item", //
|
||||
extraCssText: "max-height: 20px;",
|
||||
position: function (point, params, dom, rect, size) {
|
||||
// 您可以在此自定义 Tooltip 的位置
|
||||
return [point[0], "10%"];
|
||||
},
|
||||
},
|
||||
xAxis: {
|
||||
type: "category",
|
||||
|
|
|
|||