Ver código fonte

`规则定义、传感器台账`

wenhongquan 2 anos atrás
pai
commit
7a425845e1

+ 26 - 0
ruoyi-ui-vue3/src/router/index.js

@@ -110,6 +110,32 @@ export const constantRoutes = [
       },
     ],
   },
+  {
+    path: "/device/sensordash/add",
+    hidden: true,
+    component: Layout,
+    children: [
+      {
+        path: "",
+        component: () => import("@/views/device/sensordash/add"),
+        name: "SensorDashAdd" ,
+        meta: { title: "新增传感器台账", activeMenu: "/device/sensordash" },
+      },
+    ],
+  },
+  {
+    path: "/rules/add",
+    hidden: true,
+    component: Layout,
+    children: [
+      {
+        path: "",
+        component: () => import("@/views/rules/add"),
+        name: "RulesAdd" ,
+        meta: { title: "新增规则", activeMenu: "/rules/add" },
+      },
+    ],
+  }
 ];
 
 // 动态路由,基于用户权限动态去加载

+ 1 - 1
ruoyi-ui-vue3/src/views/device/equipmentdash/add.vue

@@ -378,7 +378,7 @@
 <script setup lang="ts">
 import {ref} from "vue";
 import {useRoute, useRouter} from "vue-router";
-import {Search} from "@element-plus/icons-vue";
+
 
 
 const route = useRoute();

+ 2 - 2
ruoyi-ui-vue3/src/views/device/equipmentdash/index.vue

@@ -7,7 +7,7 @@
         <div class="card-header">
           <span>东门立柱摄像-详情</span>
           <div>
-            <el-button type="primary" plain @click="goadd">
+            <el-button type="primary" plain >
 
               添加
             </el-button>
@@ -72,7 +72,7 @@
             <div class="card-header">
               <span>设备台账</span>
               <div>
-                <el-button type="primary">添加</el-button>
+                <el-button type="primary" @click="goadd">添加</el-button>
                 <el-button type="danger">批量删除</el-button>
                 <el-button type="primary" plain>显示字段</el-button>
               </div>

+ 185 - 0
ruoyi-ui-vue3/src/views/device/sensordash/add.vue

@@ -0,0 +1,185 @@
+<template>
+  <div style="padding: 10px 15px">
+    <el-card class="box-card">
+      <template #header>
+        <div class="card-header">
+          <span>传感器台账-新增</span>
+          <div>
+            <el-button type="warning" @click="">复位</el-button>
+            <el-button type="primary" @click="">保存</el-button>
+            <el-button type="primary" plain @click="router.back();">返回</el-button>
+          </div>
+        </div>
+
+      </template>
+      <el-row>
+        <el-col :span="24">
+          <el-descriptions :column="4">
+            <el-descriptions-item>
+              <template #label>
+                <div style="display: inline-block;min-width: 100px;text-align: right">
+                  <span style="color: red">*</span> 传感器编码
+                </div>
+
+              </template>
+              <div class="content-w">
+                <el-input placeholder="请输入传感器编码"/>
+              </div>
+            </el-descriptions-item>
+            <el-descriptions-item>
+              <template #label>
+                <div style="display: inline-block;min-width: 100px;text-align: right">
+                  <span style="color: red">*</span> 传感器名称
+                </div>
+              </template>
+              <div class="content-w">
+                <el-input placeholder="请输入传感器名称"/>
+              </div>
+            </el-descriptions-item>
+            <el-descriptions-item>
+              <template #label>
+                <div style="display: inline-block;min-width: 100px;text-align: right">
+                  <span style="color: red">*</span> 类型
+                </div>
+              </template>
+              <div class="content-w">
+                <el-select-v2
+                  v-model="value"
+                  :options="options"
+                  placeholder="请选择"
+                />
+              </div>
+            </el-descriptions-item>
+            <el-descriptions-item>
+              <template #label>
+                <div style="display: inline-block;min-width: 100px;text-align: right">
+                  <span style="color: red">*</span> 协议
+                </div>
+              </template>
+              <div class="content-w">
+                <el-select-v2
+                  v-model="value"
+                  :options="options"
+                  placeholder="请选择"
+                  filterable
+                  remote
+                />
+              </div>
+            </el-descriptions-item>
+            <el-descriptions-item>
+              <template #label>
+                <div style="display: inline-block;min-width: 100px;text-align: right">
+                  配置信息
+                </div>
+              </template>
+              <div class="content-w">
+                <el-select-v2
+                  v-model="value"
+                  :options="options"
+                  placeholder="请选择"
+                  filterable
+                  remote
+                />
+              </div>
+            </el-descriptions-item>
+            <el-descriptions-item>
+              <template #label>
+                <div style="display: inline-block;min-width: 100px;text-align: right">
+                  点表
+                </div>
+              </template>
+              <div class="content-w">
+                <el-input placeholder="请输入"/>
+              </div>
+            </el-descriptions-item>
+            <el-descriptions-item span="2">
+              <template #label>
+                <div style="display: inline-block;min-width: 100px;text-align: right">
+                  <span style="color: red">*</span> 原表名
+                </div>
+              </template>
+              <div class="content-w">
+                <el-input placeholder="请输入原表名"/>
+              </div>
+            </el-descriptions-item>
+            <el-descriptions-item span="4">
+              <template #label>
+                <div style="display: inline-block;min-width: 100px;text-align: right">
+                  <span style="color: red">*</span> 表字段类型
+                </div>
+              </template>
+              <div class="content-w">
+                <el-select-v2
+                  v-model="value"
+                  :options="options"
+                  placeholder="请选择"
+                  filterable
+                  remote
+                />
+              </div>
+            </el-descriptions-item>
+
+            <el-descriptions-item :span="2">
+              <template #label>
+                <div style="display: inline-block;min-width: 100px;text-align: right;    vertical-align: top;">
+                  描述
+                </div>
+              </template>
+              <div class="content-w" style="min-width: 400px">
+                <el-input type="textarea" :line-count="5" maxlength="200" placeholder="请输入描述"/>
+              </div>
+            </el-descriptions-item>
+            <el-descriptions-item :span="2">
+              <template #label>
+                <div style="display: inline-block;min-width: 100px;text-align: right;    vertical-align: top;">
+                  备注
+                </div>
+              </template>
+              <div class="content-w" style="min-width: 400px">
+                <el-input type="textarea" :line-count="5" maxlength="200" placeholder="请输入备注"/>
+              </div>
+            </el-descriptions-item>
+
+          </el-descriptions>
+
+        </el-col>
+
+      </el-row>
+    </el-card>
+
+
+  </div>
+</template>
+
+<script setup lang="ts">
+import {ref} from "vue";
+import {useRoute, useRouter} from "vue-router";
+
+
+
+const route = useRoute();
+const router = useRouter();
+
+
+const value = ref("1");
+const options = ref([
+  {
+    value: '1',
+    label: '黄金糕'
+  }]);
+
+
+</script>
+
+<style lang="scss" scoped>
+.card-header {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+}
+
+.content-w {
+  display: inline-flex;
+  max-width: 160px;
+}
+</style>

+ 260 - 98
ruoyi-ui-vue3/src/views/device/sensordash/index.vue

@@ -1,119 +1,273 @@
 <template>
   <div style="padding: 10px 15px">
-    <el-card class="box-card">
-      <template #header>
-        <div class="card-header">
-          <span>设备标签管理</span>
-
-          <el-button
-            type="primary"
-            @click="
-              detailshow = true;
-              edittype = 1;
-            "
-            >添加</el-button
-          >
-        </div>
-      </template>
-      <el-row>
-
-        <el-col :span="24" style="padding-left: 10px">
-          <el-table :data="dwtabledata" :border="true" :height="gettbheight()">
-            <el-table-column label="编码"></el-table-column>
-            <el-table-column label="名称"></el-table-column>
-            <el-table-column label="备注"></el-table-column>
-            <el-table-column label="操作">
-              <template #default="scope">
-                <div>
-                  <el-button
-                    link
-                    @click="
-                      detailshow = true;
-                      edittype = 2;
-                    "
-                  >
-                    <el-tooltip effect="dark" content="编辑">
-                      <el-icon>
-                        <Edit />
-                      </el-icon>
-                    </el-tooltip>
-                  </el-button>
-                  <el-popconfirm title="确定删除该标签?">
-                    <template #reference>
-                      <el-button link
-                        ><el-tooltip effect="dark" content="删除"
+    <el-row>
+      <el-col :span="6" style="padding-right: 10px">
+        <el-card class="box-card">
+          <template #header>
+            <div class="card-header">
+              <span>设备区域</span>
+              <div>
+                <el-button type="primary" >
+                  添加
+                </el-button>
+              </div>
+            </div>
+          </template>
+          <div class="tree">
+            <LayTree
+              :data="data"
+              :tail-node-icon="false"
+              :onlyIconControl="true"
+              v-model:selectedKey="selectedKey"
+              @node-click="handleClick"
+            >
+            </LayTree>
+          </div>
+        </el-card>
+      </el-col>
+
+      <el-col :span="18">
+        <el-card class="box-card">
+          <div style="display: flex; flex-direction: row; justify-content: space-between">
+            <div style="display: flex; flex-direction: row;">
+              <div
+                style="
+                  display: flex;
+                  flex-direction: row;
+                  flex-wrap: nowrap;
+                  align-items: center;
+                "
+              >
+                <div style="font-size: 12px; width: 100px;">监测点编号:</div>
+                <el-input
+                  v-model="searchform.devicename"
+                  placeholder="请输入"
+                ></el-input>
+              </div>
+              <div
+                style="
+                  display: flex;
+                  flex-direction: row;
+                  flex-wrap: nowrap;
+                  align-items: center;
+                "
+              >
+                <div style="font-size: 12px; width: 80px;margin-right: 10px;text-align: right;">描述:</div>
+                <el-input
+                  v-model="searchform.devicename"
+                  placeholder="请输入"
+                ></el-input>
+              </div>
+            </div>
+            <div>
+              <el-button type="primary" plain>重置</el-button>
+              <el-button type="primary">搜索</el-button>
+            </div>
+          </div>
+        </el-card>
+
+        <el-card class="box-card" style="margin-top: 10px;">
+          <template #header>
+            <div class="card-header">
+              <span>传感器台账</span>
+              <div>
+                <el-button type="primary" @click="goadd">添加</el-button>
+                <el-button type="danger">批量删除</el-button>
+                <el-button type="primary" plain>显示字段</el-button>
+              </div>
+            </div></template>
+
+          <el-row>
+            <el-col :span="24" style="padding-left: 10px">
+              <el-table :data="devicetabledata" :border="true">
+                <el-table-column label="传感器编号"></el-table-column>
+                <el-table-column label="传感器名称"></el-table-column>
+                <el-table-column label="描述"></el-table-column>
+                <el-table-column label="状态"></el-table-column>
+                <el-table-column label="类型"></el-table-column>
+
+                <el-table-column label="操作">
+                  <template #default="scope">
+                    <div>
+                      <el-button link >
+                        <el-tooltip effect="dark" content="详情">
+                          <el-icon>
+                            <Memo />
+                          </el-icon>
+                        </el-tooltip>
+                      </el-button>
+                      <el-button link >
+                        <el-tooltip effect="dark" content="编辑">
+                          <el-icon>
+                            <Edit />
+                          </el-icon>
+                        </el-tooltip>
+                      </el-button>
+                      <el-button link @click="cdbd" >
+                        <el-tooltip effect="dark" content="测点绑定" >
+                          <el-icon><VideoPlay /></el-icon>
+                        </el-tooltip>
+                      </el-button>
+                      <el-popconfirm title="确定删除该标签?">
+                        <template #reference>
+                          <el-button link
+                          ><el-tooltip effect="dark" content="删除"
                           ><el-icon><Delete /></el-icon></el-tooltip
-                      ></el-button>
-                    </template>
-                  </el-popconfirm>
-                </div>
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-col>
-      </el-row>
-    </el-card>
+                          ></el-button>
+                        </template>
+                      </el-popconfirm>
+                    </div>
+                  </template>
+                </el-table-column>
+              </el-table>
+
+
+            </el-col>
+            <el-col :span="24" style="margin-top: 10px;">
+              <el-pagination style="float: right;"
+                             small
+                             background
+                             layout="prev, pager, next"
+                             :total="50"
+                             class="mt-4"
+              />
+            </el-col>
+          </el-row>
+        </el-card>
+      </el-col>
+    </el-row>
+
 
     <el-dialog
-      :title="`${edittype == 1 ? '新增' : edittype == 2 ? '编辑' : '查看'}设备标签`"
-      v-model="detailshow"
+      title="选择测点"
+      v-model="cdbdshow"
     >
-      <el-form  :model="dwform" label-width="120px">
-        <el-form-item label="编码">
-          <el-input v-model="dwform.name"  :disabled="edittype==3"/>
-        </el-form-item>
-        <el-form-item label="名称">
-          <el-input v-model="dwform.name"  :disabled="edittype==3"/>
-        </el-form-item>
-        <el-form-item label="备注">
-          <el-input type="textarea" v-model="dwform.name" :disabled="edittype==3"/>
-        </el-form-item>
-      </el-form>
-      <template #footer>
-      <div class="dialog-footer">
-         <el-button @click="detailshow=false;"> 取消 </el-button>
-          <el-button type="primary" @click="dosavedw"> 保存 </el-button>
+
+      <div style="display: flex; flex-direction: row; justify-content: space-between">
+        <div style="display: flex; flex-direction: row;">
+          <div
+            style="
+                  display: flex;
+                  flex-direction: row;
+                  flex-wrap: nowrap;
+                  align-items: center;
+                "
+          >
+            <div style="font-size: 12px; width: 100px;">监测点编号:</div>
+            <el-input
+              v-model="searchform.devicename"
+              placeholder="请输入"
+            ></el-input>
+          </div>
+          <div
+            style="
+                  display: flex;
+                  flex-direction: row;
+                  flex-wrap: nowrap;
+                  align-items: center;
+                "
+          >
+            <div style="font-size: 12px; width: 80px;margin-right: 10px;text-align: right;">描述:</div>
+            <el-input
+              v-model="searchform.devicename"
+              placeholder="请输入"
+            ></el-input>
+          </div>
+        </div>
+        <div>
+          <el-button type="primary" plain>重置</el-button>
+          <el-button type="primary">搜索</el-button>
+        </div>
       </div>
-    </template>
+
+      <el-table :data="devicetabledata" style="margin-top: 15px" height="400px">
+        <el-table-column label="传感器编号"></el-table-column>
+        <el-table-column label="服务"></el-table-column>
+        <el-table-column label="描述"></el-table-column>
+        <el-table-column label="类型"></el-table-column>
+        <el-table-column label="单位"></el-table-column>
+      </el-table>
+
+
+      <template #footer>
+        <div class="dialog-footer">
+          <el-button @click="cdbdshow=false;"> 取消 </el-button>
+          <el-button type="primary" @click="cdbdshow=false"> 保存 </el-button>
+        </div>
+      </template>
     </el-dialog>
+
+
   </div>
 </template>
 
 <script setup lang="ts" name="Units">
-import { ref } from "vue";
-
-const dwtypetabledata = ref([]);
-const dwtabledata = ref([1,1,1,1,1,1]);
-
-const edittype = ref(1);
-const detailshow = ref(false);
-
-const dwform = ref({
-  id: 0,
-  name: "",
-  unitSymbol: "",
-  unitName: "",
-  isStandard: "",
-  unitType: "",
-  toStandardRatio: 0,
-  toOffset: 0,
-  remark: "",
-  creator: "",
-  ctime: "",
-  modifier: "",
-  utime: "",
-});
+import {ref} from "vue";
+import { LayTree } from "@layui/layui-vue";
+import "@layui/layui-vue/lib/index.css";
+import {useRoute, useRouter} from "vue-router";
 
-const gettbheight = () => {
 
-  return window.innerHeight - 200;
-}
+const route = useRoute();
+const router = useRouter();
 
-const dosavedw = () => {
 
-  detailshow.value = false;
+const goadd = ()=>{
+  router.push("/device/sensordash/add")
+}
 
+const handleClick = (node) => {
+  console.log("Click Node:" + JSON.stringify(node));
 };
+const selectedKey = ref(4);
+const data = ref([
+  {
+    title: "集团公司",
+    id: 1,
+    checked: true,
+    spread: true,
+    children: [
+      {
+        title: "示范项目",
+        id: 2,
+        spread: true,
+        children: [
+          {
+            title: "监测站",
+            id: 4,
+            href: "https://www.layui.com/",
+          },
+          {
+            title: "用能区域",
+            id: 5,
+            href: "https://www.layui.com/",
+          },
+
+        ],
+      },
+      {
+        title: "虚拟项目",
+        id: 3,
+        href: "https://www.layui.com/",
+      },
+
+    ],
+  },
+]);
+
+const devicetabledata = ref([1]);
+const searchform = ref({
+  devicename: "",
+  devicesn:""
+});
+
+
+const cdbdshow = ref(false);
+const cdbd = ()=>{
+  cdbdshow.value = true;
+}
+
+
 
 </script>
 
@@ -123,4 +277,12 @@ const dosavedw = () => {
   flex-direction: row;
   justify-content: space-between;
 }
+
+.tree {
+  *,
+  *:before,
+  *:after {
+    box-sizing: content-box !important;
+  }
+}
 </style>

+ 157 - 0
ruoyi-ui-vue3/src/views/rules/add.vue

@@ -0,0 +1,157 @@
+<template>
+  <div style="padding: 10px 15px">
+    <el-card class="box-card">
+      <template #header>
+        <div class="card-header">
+          <span>规则定义-新增</span>
+          <div>
+            <el-button type="warning" @click="">复位</el-button>
+            <el-button type="primary" @click="">保存</el-button>
+            <el-button type="primary" plain @click="router.back();">返回</el-button>
+          </div>
+        </div>
+      </template>
+      <el-row>
+        <el-col :span="24">
+          <el-card>
+
+            <el-descriptions :column="3">
+              <el-descriptions-item>
+                <template #label>
+                  <div style="display: inline-block;min-width: 100px;text-align: right">
+                    <span style="color: red">*</span> 规则编码
+                  </div>
+
+                </template>
+                <div class="content-w">
+                  <el-input placeholder="请输入规则编码"/>
+                </div>
+              </el-descriptions-item>
+              <el-descriptions-item>
+                <template #label>
+                  <div style="display: inline-block;min-width: 100px;text-align: right">
+                    <span style="color: red">*</span> 规则名称
+                  </div>
+                </template>
+                <div class="content-w">
+                  <el-input placeholder="请输入规则名称"/>
+                </div>
+              </el-descriptions-item>
+
+            <el-descriptions-item>
+              <template #label>
+                <div style="display: inline-block;min-width: 100px;text-align: right">
+                  <span style="color: red">*</span> 触发类型
+                </div>
+              </template>
+              <div class="content-w">
+                <el-input placeholder="请输入"/>
+              </div>
+            </el-descriptions-item>
+              <el-descriptions-item >
+                <template #label>
+                  <div style="display: inline-block;min-width: 100px;text-align: right">
+                    <span style="color: red">*</span> 价值成本单位
+                  </div>
+                </template>
+                <div class="content-w">
+                  <el-input placeholder="请输入"/>
+                </div>
+              </el-descriptions-item>
+
+              <el-descriptions-item >
+
+                <div class="content-w">
+                  <el-input placeholder="请输入"/>
+                </div>
+              </el-descriptions-item>
+
+              <el-descriptions-item >
+                <template #label>
+                  <div style="display: inline-block;min-width: 100px;text-align: right">
+                    边界控制
+                  </div>
+                </template>
+                <div class="content-w">
+                  <el-switch
+                    active-text="上限"
+                    inactive-text="下限"
+                  />
+                </div>
+              </el-descriptions-item>
+            </el-descriptions>
+          </el-card>
+        </el-col>
+        <el-col :span="12" style="padding-right: 5px;margin-top: 10px">
+          <el-card>
+            <template #header>
+            <div class="card-header">
+              <span>条件</span>
+              <div>
+                <el-button type="primary" plain >添加</el-button>
+              </div>
+            </div>
+            </template>
+            <el-table :data="tjdata">
+              <el-table-column label="过滤方式" ></el-table-column>
+              <el-table-column label="过滤算法" ></el-table-column>
+              <el-table-column label="操作" ></el-table-column>
+            </el-table>
+
+          </el-card>
+        </el-col>
+        <el-col :span="12" style="padding-left: 5px;margin-top: 10px">
+          <el-card>
+            <template #header>
+            <div class="card-header">
+              <span>执行</span>
+              <div>
+                <el-button type="primary" plain >添加</el-button>
+              </div>
+            </div>
+            </template>
+            <el-table :data="zxdata">
+              <el-table-column label="设备" ></el-table-column>
+              <el-table-column label="执行动作" ></el-table-column>
+              <el-table-column label="操作" ></el-table-column>
+            </el-table>
+
+          </el-card>
+        </el-col>
+      </el-row>
+
+
+
+
+    </el-card>
+
+
+  </div>
+</template>
+
+<script setup lang="ts" name="Units">
+import {ref} from "vue";
+import {useRoute, useRouter} from "vue-router";
+
+
+const route = useRoute();
+const router = useRouter();
+
+const tjdata = ref([]);
+const zxdata = ref([]);
+
+
+</script>
+
+<style lang="scss" scoped>
+.card-header {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+}
+
+.content-w {
+  display: inline-flex;
+  max-width: 160px;
+}
+</style>

+ 88 - 0
ruoyi-ui-vue3/src/views/rules/index.vue

@@ -0,0 +1,88 @@
+<template>
+  <div style="padding: 10px 15px">
+    <el-card class="box-card">
+      <div style="display: flex; flex-direction: row; justify-content: space-between">
+        <div>
+          <div
+            style="
+                  display: flex;
+                  flex-direction: row;
+                  flex-wrap: nowrap;
+                  align-items: center;
+                "
+          >
+            <div style="font-size: 12px; width: 80px">规则名称:</div>
+            <el-input
+              v-model="searchform.rulename"
+              placeholder="规则名称"
+            ></el-input>
+          </div>
+        </div>
+        <div>
+          <el-button type="primary" plain>重置</el-button>
+          <el-button type="primary">搜索</el-button>
+        </div>
+      </div>
+    </el-card>
+
+    <el-card class="box-card" style="margin-top: 10px">
+      <template #header>
+        <div class="card-header">
+          <span>规则定义</span>
+          <div>
+            <el-button type="primary" @click="goadd">添加</el-button>
+            <el-button type="danger">批量删除</el-button>
+            <el-button type="primary" plain>显示字段</el-button>
+          </div>
+        </div>
+      </template>
+      <div>
+        <el-table :data="tabledata" border>
+          <el-table-column type="selection" width="55" />
+          <el-table-column label="规则编号"></el-table-column>
+          <el-table-column label="规则名称"></el-table-column>
+          <el-table-column label="触发类型"></el-table-column>
+          <el-table-column label="设备"></el-table-column>
+          <el-table-column label="传感器"></el-table-column>
+          <el-table-column label="触发条件值"></el-table-column>
+          <el-table-column label="描述"></el-table-column>
+          <el-table-column label="操作"></el-table-column>
+
+        </el-table>
+
+      </div>
+
+
+    </el-card>
+
+
+  </div>
+</template>
+
+<script setup lang="ts" name="Units">
+import {ref} from "vue";
+import {useRoute, useRouter} from "vue-router";
+import data from "@/views/system/dict/data.vue";
+
+
+const route = useRoute();
+const router = useRouter();
+
+const searchform = ref({rulename:""})
+const tabledata = ref([1,2,3])
+
+const goadd = ()=>{
+  router.push("/rules/add")
+}
+
+
+
+</script>
+
+<style lang="scss" scoped>
+.card-header {
+  display: flex;
+  flex-direction: row;
+  justify-content: space-between;
+}
+</style>