Эх сурвалжийг харах

暂存,图片上传接口制作

kindring 2 жил өмнө
parent
commit
8ab18934ca

+ 0 - 2
src/main/java/com/genersoft/iot/vmp/gb28181/bean/AiConfig.java

@@ -102,8 +102,6 @@ public class AiConfig {
         this.configName = configName;
     }
 
-
-
     public String getLibraryName() {
         return libraryName;
     }

+ 6 - 5
src/main/java/com/genersoft/iot/vmp/storager/dao/HfyDevAiMapper.java

@@ -86,11 +86,12 @@ public interface HfyDevAiMapper {
 
     @Update(value = {"<script>" +
             "update ai_library" +
-            "set " +
-            "<if test=\"libraryName\">, libraryName='${name}'</if>" +
-            "<if test=\"version\">, version='${version}'</if>" +
-            "<if test=\"arithmetic\">, libraryName='${arithmetic}'</if>" +
-            "where libraryId = '${libraryId}'" +
+            " set" +
+            " version='${version}'"+
+            " <if test=\"libraryName\">, libraryName='${name}'</if>" +
+            " <if test=\"arithmetic\">, libraryName='${arithmetic}'</if>" +
+            " <if test=\"total\">, total='${total}'</if>" +
+            " where libraryId = '${libraryId}'" +
             "</script>" })
     int updateAiLibrary(AiLib aiLib);
 

+ 6 - 0
src/main/java/com/genersoft/iot/vmp/storager/impl/VideoManagerStorageImpl.java

@@ -318,6 +318,12 @@ public class VideoManagerStorageImpl implements IVideoManagerStorage {
 		aiLib.setCarNo(carNo);
 		// 存储图像
 		HfyDevAiMapper.addLibItem(aiLib);
+		// 添加完成,修改lib的子项
+		AiLib newAiLib = new AiLib();
+		newAiLib.setLibraryId(libraryId);
+		newAiLib.setTotal(libData.getTotal()+1);
+		newAiLib.setVersion(""+(libData.getTotal()+1));
+		HfyDevAiMapper.updateAiLibrary(newAiLib);
 		return fileName;
 	}
 	public int addAiConfig(String configName,

+ 103 - 0
web_src/src/components/AiLib.vue

@@ -0,0 +1,103 @@
+<template>
+  <div id="aiLib w-full" style="width:100%">
+    <div class="page-header">
+      <div class="page-title">
+        <el-button icon="el-icon-back" size="mini" style="font-size: 20px; color: #000;" type="text" @click="toBack" ></el-button>
+        <el-divider direction="vertical"></el-divider>
+        ai数据库
+        <el-select v-model="aiTypeVal" @change="getNowAiLib" placeholder="请选择ai类型">
+          <el-option
+            v-for="item in aiTypeArr"
+            :key="item.val"
+            :label="item.text"
+            :value="item.val"
+            :disabled="item.disabled">
+          </el-option>
+        </el-select>
+        <el-button icon="el-icon-search" type="primary" :loading="isLoading">搜索</el-button>
+      </div>
+      <div class="page-header-btn">
+      </div>
+    </div>
+    <el-table :data="libList" style="width: 100%;font-size: 12px;" :height="winHeight" header-row-class-name="table-header">
+      <el-table-column prop="libraryId" label="id" ></el-table-column>
+      <el-table-column prop="libraryName" label="数据库名称" min-width="160"></el-table-column>
+      <el-table-column prop="version" label="数据库版本号" ></el-table-column>
+      <el-table-column prop="arithmetic" label="对应算法" ></el-table-column>
+      <el-table-column prop="total" label="id" ></el-table-column>
+      <el-table-column label="操作" >
+        <template slot-scope="scope">
+          <el-button size="medium" @click="editLibHandle(scope.row)">编辑</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <el-pagination
+      style="float: right"
+      @size-change="handleSizeChange"
+      @current-change="currentChange"
+      :current-page="currentPage"
+      :page-size="count"
+      :page-sizes="[15, 25, 35, 50]"
+      layout="total, sizes, prev, pager, next"
+      :total="total"
+    ></el-pagination>
+  </div>
+</template>
+
+<script>
+import {toNumber} from "@/until/typeTool";
+import aiMap from "@/map/ai";
+
+export default {
+  name: "AiLib",
+  data(){return {
+    isLoading: false,
+    aiTypes: aiMap.aiTypes,
+    aiTypeArr: aiMap.getAITypeArr(),
+    triggerTypes: aiMap.triggerTypes,
+    triggerTypeArr: aiMap.getTriggerTypeArr(),
+    aiTypeVal: 0,
+    arithmetic: this.$route.params.arithmetic,
+    libList: [],
+    currentPage: 1,
+    count: 15,
+    total: 1,
+
+  }},
+  methods:{
+    toBack(){
+      this.$router.back();
+      if (this.deviceId === "" ) {
+        this.beforeUrl = "/deviceList"
+      }
+    },
+    getNowAiLib(){
+      this.nowAiLib = this.aiLibList.filter(aiLib=>toNumber(aiLib.libraryId)===toNumber(this.aiTypeVal));
+      this.libraryId = 0;
+      this.triggerType = this.triggerTypes.unlimited;
+    },
+    searchLibList(){
+
+    },
+    /**
+     * 编辑lib数据
+     * @param row
+     */
+    editLibHandle(row){
+      this.$router.push(`/libEdit/${row.libraryId}`);
+    },
+    currentChange: function (val) {
+      this.currentPage = val;
+      this.searchLibList();
+    },
+    handleSizeChange: function (val) {
+      this.count = val;
+      this.searchLibList();
+    },
+  }
+}
+</script>
+
+<style scoped>
+
+</style>