1
0

2 Коммиты 8c175c39ba ... 110debc207

Автор SHA1 Сообщение Дата
  liwei19941102 110debc207 Merge branch 'master' of http://git.xt.wenhq.top:8083/wenhongquan/iotc 2 лет назад
  liwei19941102 cc4ea6b876 页面修改 2 лет назад

+ 1 - 0
ruoyi-system/src/main/java/com/ruoyi/data/service/impl/TblVideoServiceImpl.java

@@ -61,6 +61,7 @@ public class TblVideoServiceImpl implements ITblVideoService {
     private LambdaQueryWrapper<TblVideo> buildQueryWrapper(TblVideoBo bo) {
         Map<String, Object> params = bo.getParams();
         LambdaQueryWrapper<TblVideo> lqw = Wrappers.lambdaQuery();
+        lqw.eq(bo.getId() != null, TblVideo::getId, bo.getId());
         lqw.like(StringUtils.isNotBlank(bo.getName()), TblVideo::getName, bo.getName());
         lqw.eq(StringUtils.isNotBlank(bo.getSn()), TblVideo::getSn, bo.getSn());
         lqw.eq(StringUtils.isNotBlank(bo.getType()), TblVideo::getType, bo.getType());

+ 35 - 4
ruoyi-ui-vue3/src/views/device/camera/add.vue

@@ -3,7 +3,11 @@
         <el-card class="box-card">
             <template #header>
                 <div class="card-header">
-                    <span>主设备信息-新增</span>
+                    <span>主设备信息-{{ title }}</span>
+                    <div>
+                        <el-button type="primary" @click="saveVideo()">保存</el-button>
+                        <el-button type="primary" plain @click="router.back();">返回</el-button>
+                    </div>
                 </div>
             </template>
             <el-row>
@@ -120,7 +124,7 @@
             </el-row>
 
         </el-card>
-        <el-card class="box-card" style="margin-top: 10px">
+        <el-card class="box-card" style="margin-top: 10px" v-show="objId != null">
             <template #header>
                 <div class="card-header">
                     <span>视频设备</span>
@@ -147,11 +151,11 @@
                                     <el-button link @click="openUpdateVideoDetail(scope.row)">
                                         <el-tooltip effect="dark" content="修改">
                                             <el-icon>
-                                                <Memo />
+                                                <Edit />
                                             </el-icon>
                                         </el-tooltip>
                                     </el-button>
-                                    <el-popconfirm title="确定删除该标签?">
+                                    <el-popconfirm title="确定删除该编码?" @confirm="godelVideoDetail(scope.row)">
                                         <template #reference>
                                             <el-button link><el-tooltip effect="dark" content="删除"><el-icon>
                                                         <Delete />
@@ -228,6 +232,8 @@ const { proxy } = getCurrentInstance();
 
 const tableData = ref([]);
 
+const title = ref("新增")
+
 const dialogTitle = ref("新增");
 
 const dialogFormVisible = ref(false);
@@ -274,6 +280,7 @@ const getVideoData = () => {
 
 if (objId != null) {
     getVideoData();
+    title.value = "修改"
 }
 
 const getVideoDetailList = () => {
@@ -333,6 +340,30 @@ const saveVideoDetail = () => {
     }
 }
 
+const godelVideoDetail = (item) => {
+    delVideoDetail(item.id).then(res => {
+        if(res.code == 200){
+            getVideoDetailList();
+        }
+    })
+}
+
+const saveVideo = () => {
+    if (objId != null) {
+        updateVideo(vidoeParams.value).then(res => {
+            if (res.code == 200) {
+                router.back()
+            }
+        })
+    } else {
+        addVideo(vidoeParams.value).then(res => {
+            if (res.code == 200) {
+                router.back()
+            }
+        })
+    }
+}
+
 const goUpdate = (item) => {
 
 }

+ 0 - 1
ruoyi-ui-vue3/src/views/device/camera/detail.vue

@@ -18,7 +18,6 @@
             <el-descriptions-item label-class-name="mylabel" label="视频制式">Suzhou</el-descriptions-item>
             <el-descriptions-item label-class-name="mylabel" label="设备提供商类型">Suzhou</el-descriptions-item>
             <el-descriptions-item label-class-name="mylabel" label="序列号">Suzhou</el-descriptions-item>
-
           </el-descriptions>
         </el-col>
       </el-row>

+ 62 - 6
ruoyi-ui-vue3/src/views/device/camera/index.vue

@@ -11,6 +11,11 @@
           <div class="tree">
             <LayTree :data="data" :tail-node-icon="false" :onlyIconControl="true" v-model:selectedKey="selectedKey"
               @node-click="handleClick">
+              <template #title="{ data }">
+                <div style="display: flex;flex-direction: row;justify-content: space-around;">
+                  <div>{{ data.name }}</div>
+                </div>
+              </template>
             </LayTree>
           </div>
         </el-card>
@@ -62,11 +67,11 @@
                       <el-button link @click="goUpdate(scope.row)">
                         <el-tooltip effect="dark" content="修改">
                           <el-icon>
-                            <Memo />
+                            <Edit />
                           </el-icon>
                         </el-tooltip>
                       </el-button>
-                      <el-popconfirm title="确定删除该标签?">
+                      <el-popconfirm title="确定删除该编码?" @confirm="godelVideo(scope.row)">
                         <template #reference>
                           <el-button link><el-tooltip effect="dark" content="删除"><el-icon>
                                 <Delete />
@@ -97,13 +102,21 @@ import { useRoute, useRouter } from "vue-router";
 import { LayTree } from "@layui/layui-vue";
 import "@layui/layui-vue/lib/index.css";
 import { listVideo, getVideo, delVideo, addVideo, updateVideo } from "@/api/data/video";
+import { listVideoDetail, getVideoDetail, delVideoDetail, addVideoDetail, updateVideoDetail } from "@/api/data/videoDetail";
 
 
 const route = useRoute();
 const router = useRouter();
 
+const treeList = ref([])
+
 const handleClick = (node) => {
-  console.log("Click Node:" + JSON.stringify(node));
+  if (node.videoId != null) {
+    searchform.value.id = node.videoId
+  } else {
+    searchform.value.id = node.id
+  }
+  getVideoList();
 };
 const selectedKey = ref(1);
 const data = ref([
@@ -142,6 +155,10 @@ const data = ref([
   },
 ]);
 
+const handleClickTitle = (data) => {
+  console.log(data)
+}
+
 const pagedata = ref({
   total: 0,
   size: 10,
@@ -153,6 +170,7 @@ const devicetabledata = ref([1]);
 
 const searchform = ref({
   name: "",
+  id: null,
 });
 
 const onchangepage = (page) => {
@@ -161,27 +179,65 @@ const onchangepage = (page) => {
 }
 
 const godetail = () => {
+  router.push("/device/camera/detail")
+}
 
+const godelVideo = (item) => {
+  console.log(item)
+  delVideo(item.id).then(res => {
+    if (res.code == 200) {
+      getVideoList();
+    }
+  })
+}
 
-  router.push("/device/camera/detail")
+async function getVideoDetailList() {
+  listVideoDetail({ pageSize: 10000 }).then(res => {
+    console.log(treeList.value);
+    treeList.value.forEach(video => {
+      video.children = [];
+      res.rows.forEach(detail => {
+        if (video.id == detail.videoId) {
+          detail.name = detail.cameraName
+          video.children.push(detail);
+        }
+      })
+    })
+    console.log(treeList.value);
+    data.value = treeList.value
+    return res
+  })
+}
+
+async function getVideoDeviceList() {
+  listVideo({ pageSize: 10000 }).then(res => {
+    treeList.value = res.rows;
+  })
+}
 
+async function videoTreeList() {
+  await getVideoDeviceList()
+  await getVideoDetailList()
 }
 
 const getVideoList = () => {
+  console.log(searchform.value);
   listVideo({ ...searchform.value, pageSize: pagedata.value.size, pageNum: pagedata.value.current }).then(res => {
     devicetabledata.value = res.rows
   })
 }
 
-const goAdd = () =>{
+const goAdd = () => {
   router.push("/device/camera/add")
 }
 
-const goUpdate = (item) =>{
+const goUpdate = (item) => {
   router.push({ path: '/device/camera/add', query: { id: item.id } })
 }
 
 getVideoList();
+const res = videoTreeList();
+console.log(res);
 </script>
 
 <style></style>

+ 3 - 4
ruoyi-ui-vue3/src/views/rules/add.vue

@@ -179,10 +179,9 @@
                         </el-icon>
                       </el-tooltip>
                     </el-button>
-                    <el-popconfirm title="确定删除该编码?" @confirm="">
+                    <el-popconfirm title="确定删除该编码?" @confirm="godelRuleExecute(scope.row)">
                       <template #reference>
-                        <el-button link><el-tooltip effect="dark" content="删除"><el-icon
-                              @click="godelRuleExecute(scope.row)">
+                        <el-button link><el-tooltip effect="dark" content="删除"><el-icon>
                               <Delete />
                             </el-icon></el-tooltip></el-button>
                       </template>
@@ -316,7 +315,7 @@ const ruleParam = ref({
 const getEquipmentSbookList = () => {
   listEquipmentSbook({ pageSize: 10000 }).then(res => {
     deviceList.value = res.rows
-    if(objId != null){
+    if (objId != null) {
       getDetail();
     }
   })

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

@@ -44,14 +44,6 @@
                     <el-button link @click="
                     ">
                       <el-tooltip effect="dark" content="编辑">
-                        <el-icon>
-                          <Memo />
-                        </el-icon>
-                      </el-tooltip>
-                    </el-button>
-                    <el-button link @click="
-                    ">
-                      <el-tooltip effect="dark" content="编辑">
                         <el-icon @click="goupdate(scope.row)">
                           <Edit />
                         </el-icon>