wangmengwei 2 днів тому
батько
коміт
cfe29910d2

+ 44 - 0
ruoyi-ui/src/api/manage/algorithmSet.js

@@ -0,0 +1,44 @@
+import request from '@/utils/request'
+
+// 查询算法列表
+export function listAlgorithmSet(query) {
+  return request({
+    url: '/manage/algorithmSet/list',
+    method: 'get',
+    params: query
+  })
+}
+
+// 查询算法详细
+export function getAlgorithmSet(algorithmId) {
+  return request({
+    url: '/manage/algorithmSet/' + algorithmId,
+    method: 'get'
+  })
+}
+
+// 新增算法
+export function addAlgorithmSet(data) {
+  return request({
+    url: '/manage/algorithmSet',
+    method: 'post',
+    data: data
+  })
+}
+
+// 修改算法
+export function updateAlgorithmSet(data) {
+  return request({
+    url: '/manage/algorithmSet/put',
+    method: 'post',
+    data: data
+  })
+}
+
+// 删除算法
+export function delAlgorithmSet(algorithmId) {
+  return request({
+    url: '/manage/algorithmSet/delete/' + algorithmId,
+    method: 'get'
+  })
+}

BIN
ruoyi-ui/src/assets/images/yulan.png


+ 154 - 0
ruoyi-ui/src/components/Paginationsz/index.vue

@@ -0,0 +1,154 @@
+<template>
+  <div class="daba">
+    <div :class="{'hidden':hidden}" class="pagination-container ike">
+      <el-pagination
+        :background="background"
+        :current-page.sync="currentPage"
+        :page-size.sync="pageSize"
+        :layout="layout"
+        :page-sizes="pageSizes"
+        :pager-count="pagerCount"
+        :total="total"
+        v-bind="$attrs"
+        @size-change="handleSizeChange"
+        @current-change="handleCurrentChange"
+      />
+    </div>
+  </div>
+</template>
+
+<script>
+import { scrollTo } from '@/utils/scroll-to'
+
+export default {
+  name: 'Pagination',
+  props: {
+    total: {
+      required: true,
+      type: Number
+    },
+    page: {
+      type: Number,
+      default: 1
+    },
+    limit: {
+      type: Number,
+      default: 20
+    },
+    pageSizes: {
+      type: Array,
+      default() {
+        return [10, 20, 30, 40, 50]
+      }
+    },
+    // 移动端页码按钮的数量端默认值5
+    pagerCount: {
+      type: Number,
+      default: document.body.clientWidth < 992 ? 5 : 7
+    },
+    layout: {
+      type: String,
+      default: 'total, sizes, prev, pager, next, jumper'
+    },
+    background: {
+      type: Boolean,
+      default: true
+    },
+    autoScroll: {
+      type: Boolean,
+      default: true
+    },
+    hidden: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+    }
+  },
+  computed: {
+    currentPage: {
+      get() {
+        return this.page
+      },
+      set(val) {
+        this.$emit('update:page', val)
+      }
+    },
+    pageSize: {
+      get() {
+        return this.limit
+      },
+      set(val) {
+        this.$emit('update:limit', val)
+      }
+    }
+  },
+  methods: {
+    handleSizeChange(val) {
+      if (this.currentPage * val > this.total) {
+        this.currentPage = 1
+      }
+      this.$emit('pagination', { page: this.currentPage, limit: val })
+      if (this.autoScroll) {
+        scrollTo(0, 800)
+      }
+    },
+    handleCurrentChange(val) {
+      this.$emit('pagination', { page: val, limit: this.pageSize })
+      if (this.autoScroll) {
+        scrollTo(0, 800)
+      }
+    }
+  }
+}
+</script>
+
+<style scoped>
+.ike {
+  /* background: #fff; */
+  text-align: center;
+  height: 50px;
+}
+.daba{
+  .pagination-container .el-pagination{
+    left: 50%;
+    transform: translateX(-50%);
+  }
+  .el-input__inner{
+    border: 0;
+    background: #DDEBE7;
+  }
+  .el-pagination button:disabled{
+    background-color:#DDEBE7;
+    color: #4B5A6D;
+
+
+  }
+  .el-pagination .btn-prev, .el-pagination .btn-next{
+    background-color:#DDEBE7;
+    color: #4B5A6D;
+  }
+  .el-pager li{
+    /* margin-right: 5px; */
+    background-color:#DDEBE7;
+    color: #4B5A6D;
+  }
+  .el-pagination.is-background .el-pager li:not(.disabled).active{
+    background-color:#03BF8A;
+    color: #fff;
+  }
+  .el-pager li.active{
+    background-color:#DDEBE7;
+    color: #4B5A6D;
+  }
+  .el-pager li:nth-child(1){
+    /* margin-left: 5px; */
+  }
+}
+
+.pagination-container.hidden {
+  display: none;
+}
+</style>

+ 454 - 0
ruoyi-ui/src/views/shipinggaoj/algorithmSet/index.vue

@@ -0,0 +1,454 @@
+<template>
+  <div class="app-container inghse ">
+    <div style="background-color: #fff;padding: 20px;border-radius: 10px; padding-bottom: 0; padding-top: 10px;">
+                  <p style="margin: 0; font-weight: 800;font-size: 16px;color: #343434;display: flex;align-items: center;margin-bottom: 20px;border-left: 6px solid #03BF8A;margin-left: -20px;">
+                    <!-- <img src="../../../assets/images/icon_htgl_btzs.png" alt="" style="width: 16px;height: 20px;"> -->
+                   <span style="margin-left: 10px;">搜索条件</span>
+                  </p>
+                  <div style="padding-bottom: 0;margin-bottom: 20px;">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="算法名称" prop="algorithmName">
+        <el-input
+          v-model="queryParams.algorithmName"
+          placeholder="请输入算法名称"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item>
+         <el-button style="background-color: #03BF8A; border-color: #03BF8A;" type="primary" size="mini"  @click="handleQuery">查询 </el-button>
+        <el-button  size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+    </div>
+    </div>
+
+
+    <el-row :gutter="10" class="mb8">
+                <el-col :span="24">
+                  <div style="display: flex; justify-content: space-between;">
+                    <p style="margin: 0; font-weight: 800;font-size: 16px;color: #343434;display: flex;align-items: center;margin-bottom: 20px;border-left: 6px solid #03BF8A;">
+                      <!-- <img src="../../../assets/images/icon_htgl_btzs.png" alt="" style="width: 16px;height: 20px;"> -->
+                     <span style="margin-left: 10px;">算法列表</span>
+                    </p>
+                    <div>
+                      <el-button
+                        type="success"
+                        plain
+                        size="mini"
+                        @click="handleAdd"
+                        v-hasPermi="['manage:algorithmSet:add']"
+                      >新增</el-button>
+                     <el-button
+                       type="danger"
+                       plain
+                       size="mini"
+                       :disabled="multiple"
+                       @click="handleDelete"
+                       v-hasPermi="['manage:algorithmSet:remove']"
+                     >删除</el-button>
+                     <el-button
+                       type="warning"
+                       plain
+                       size="mini"
+                       @click="handleExport"
+                       v-hasPermi="['manage:algorithmSet:export']"
+                     >导出</el-button>
+                    </div>
+                  </div>
+                </el-col>
+              </el-row>
+
+    <div class="infinite-list" :style="dynamicStyle">
+      <el-row :gutter="10" style="margin: 0; " v-if="algorithmSetList.length !=0">
+        <el-col   :span="6" v-for="(item,index) in algorithmSetList" :key="index">
+          <div class="section_11 flex-col" style="position: relative; padding-left: 0; padding-right: 0; padding-bottom: 0;">
+                    <div class="section_12 flex-row" style="height: 30px;  justify-content:flex-start;padding: 0 10px;">
+                      <div  @click="handleSelectionChange(item)" style="">
+                        <img
+                          class="thumbnail_21"
+                          referrerpolicy="no-referrer"
+                          src="../../../assets/images/icon_lby_gx_normal.png"
+                           v-show="!item.isnum && isgsow"
+                        />
+                        <img
+                          class="thumbnail_21"
+                          referrerpolicy="no-referrer"
+                          src="../../../assets/images/icon_lby_gx_selcted.png"
+                          v-show="item.isnum && isgsow"
+                        />
+                      </div>
+                      <div style="display: flex;width: 82%; margin-top: 1px;">
+                        <div style="width: 84%; display: flex;">
+                          <el-tooltip class="item" effect="dark" :content="item.algorithmName" placement="top-start">
+                          <span class="text_26" style="margin-top: 0; height: 15px; line-height: 14px;">{{item.algorithmName}}</span>
+                          </el-tooltip>
+                          <!-- <img
+                           @click="handleUpdate(item)" v-hasPermi="['system:user:edit']"
+                            class="thumbnail_14"
+                            referrerpolicy="no-referrer"
+                            style="cursor: pointer;"
+                            src="../../../assets/images/icon_htgl_rylb_bjs.png"
+                          /> -->
+                        </div>
+                      </div>
+                      <div>
+                         <!-- <el-switch v-model="item.status" active-value="0" inactive-value="1" @change="handleStatusChange(item)"></el-switch> -->
+                      </div>
+
+                    </div>
+                    <div class="text-wrapper_15 ingsjlegsng " style="margin: 0; margin-top: 10px; padding: 0 10px; margin-top: 0; margin-bottom: 10px; margin-left: 25px;">
+                      <div style="display: flex">
+                        <p class="paragraph_5">参数阈值:</p>
+                        <!-- <el-tooltip class="item" effect="dark" :content="'视频地址:' + item.algorithmThreshold" placement="left-start"> -->
+                        <p class="paragraph_5" style="color: #03BF8A;">{{item.algorithmThreshold}}</p>
+                        <!-- </el-tooltip> -->
+                      </div>
+                      <div style="display: flex">
+                        <p class="paragraph_5">严格阈值:</p>
+                        <!-- <el-tooltip class="item" effect="dark" :content="'视频地址:' + item.algorithmThreshold" placement="left-start"> -->
+                        <p class="paragraph_5" style="color: #03BF8A;">{{item.algorithmThresholdStrict}}</p>
+                        <!-- </el-tooltip> -->
+                      </div>
+                    </div>
+                    <div style="display: flex;" class="njgsebott njgsebottinghe ">
+                      <p style="color: red;" @click="handleDelete(item)" v-hasPermi="['manage:algorithmSet:remove']">删除</p>
+                      <p style="border-right: none; color: #03BF8A;" @click="handleUpdate(item)" v-hasPermi="['manage:algorithmSet:edit']">编辑</p>
+                      <!-- <p @click="handleAuthRole(item)" v-hasPermi="['system:user:edit']">分配角色</p> -->
+                    </div>
+                  </div>
+        </el-col>
+      </el-row>
+      <div v-if='algorithmSetList.length == 0'>
+                  <el-empty :image-size="200"></el-empty>
+                </div>
+    </div>
+
+
+    <!-- <el-table v-loading="loading" :data="algorithmSetList" @selection-change="handleSelectionChange">
+      <el-table-column type="selection" width="55" align="center" />
+      <el-table-column label="算法ID" align="center" prop="algorithmId" />
+      <el-table-column label="算法编号" align="center" prop="algorithmNum" />
+      <el-table-column label="算法名称" align="center" prop="algorithmName" />
+      <el-table-column label="算法描述" align="center" prop="algorithmDescription" />
+      <el-table-column label="算法阈值严格" align="center" prop="algorithmThresholdStrict" />
+      <el-table-column label="算法阈值" align="center" prop="algorithmThreshold" />
+      <el-table-column label="备注" align="center" prop="remark" />
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
+        <template slot-scope="scope">
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-edit"
+            @click="handleUpdate(scope.row)"
+            v-hasPermi="['manage:algorithmSet:edit']"
+          >修改</el-button>
+          <el-button
+            size="mini"
+            type="text"
+            icon="el-icon-delete"
+            @click="handleDelete(scope.row)"
+            v-hasPermi="['manage:algorithmSet:remove']"
+          >删除</el-button>
+        </template>
+      </el-table-column>
+    </el-table> -->
+
+    <pagination
+      v-show="total>0"
+      :total="total"
+      :page.sync="queryParams.pageNum"
+      :limit.sync="queryParams.pageSize"
+      @pagination="getList"
+    />
+
+    <!-- 添加或修改算法对话框 -->
+    <el-drawer
+          :title="title"
+          :visible.sync="open"
+          direction="rtl"
+          custom-class="demo-drawer"
+          ref="drawer"
+          :size="380"
+          :modal="false"
+          >
+          <div class="demo-drawer__content">
+      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
+        <!-- <el-form-item label="算法编号" prop="algorithmNum">
+          <el-input v-model="form.algorithmNum" placeholder="请输入算法编号" />
+        </el-form-item> -->
+        <el-form-item label="算法名称" prop="algorithmName">
+          <el-input v-model="form.algorithmName" placeholder="请输入算法名称" />
+        </el-form-item>
+       <!-- <el-form-item label="算法描述" prop="algorithmDescription">
+          <el-input v-model="form.algorithmDescription" placeholder="请输入算法描述" />
+        </el-form-item> -->
+
+        <el-form-item label="算法阈值" prop="algorithmThreshold">
+          <el-input v-model="form.algorithmThreshold" placeholder="请输入算法阈值" />
+        </el-form-item>
+        <el-form-item label="严格阈值" prop="algorithmThresholdStrict">
+          <el-input v-model="form.algorithmThresholdStrict" placeholder="请输入算法阈值严格" />
+        </el-form-item>
+       <!-- <el-form-item label="删除标志" prop="delFlag">
+          <el-input v-model="form.delFlag" placeholder="请输入删除标志" />
+        </el-form-item> -->
+        <!-- <el-form-item label="备注" prop="remark">
+          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
+        </el-form-item> -->
+      </el-form>
+     <div slot="footer" class="dialog-footer" style="display: flex;justify-content: flex-end;">
+                <el-button style="background-color:#03BF8A ; border-color: #03BF8A;" type="primary" @click="submitForm">确 定</el-button>
+                <el-button style="background-color:#DDEBE7 ; border-color: #DDEBE7; color: #475669;" @click="cancel">取 消</el-button>
+              </div>
+      </div>
+    </el-drawer>
+  </div>
+</template>
+
+<script>
+import { listAlgorithmSet, getAlgorithmSet, delAlgorithmSet, addAlgorithmSet, updateAlgorithmSet } from "@/api/manage/algorithmSet"
+
+export default {
+  name: "AlgorithmSet",
+  data() {
+    return {
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 算法表格数据
+      algorithmSetList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 8,
+        algorithmNum: null,
+        algorithmName: null,
+        algorithmDescription: null,
+        algorithmThresholdStrict: null,
+        algorithmThreshold: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+        algorithmName: [
+                  { required: true, message: "不能为空", trigger: "blur" }
+                ],
+      },
+      tableMaxHeight:200,
+       isgsow:true,
+    }
+  },
+  created() {
+    this.getList()
+    window.onresize = () => {
+              this.changeTableMaxHeight()
+            }
+            this.changeTableMaxHeight()
+  },
+  computed: {
+    dynamicStyle() {
+      return {
+        overflow:'auto',
+        height:  this.tableMaxHeight + 'px',
+      }
+    }
+    },
+    mounted() {
+    	window.onresize = () => {
+    	          this.changeTableMaxHeight()
+    	        }
+    	        this.changeTableMaxHeight()
+    },
+  methods: {
+    /** 查询算法列表 */
+    getList() {
+      this.loading = true
+      listAlgorithmSet(this.queryParams).then(response => {
+        this.algorithmSetList = response.rows
+        this.algorithmSetList.filter(rou=>{
+          rou.isnum = false
+        })
+        this.total = response.total
+        this.loading = false
+      })
+    },
+    // 取消按钮
+    cancel() {
+      this.open = false
+      this.reset()
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        algorithmId: null,
+        algorithmNum: null,
+        algorithmName: null,
+        algorithmDescription: null,
+        algorithmThresholdStrict: 0.8,
+        algorithmThreshold: 0.5,
+        delFlag: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null,
+        remark: null
+      }
+      this.resetForm("form")
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1
+      this.getList()
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm")
+      this.handleQuery()
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      // console.log(selection)
+      this.isgsow = false
+      selection.isnum = !selection.isnum
+      this.isgsow = true
+      let nhseg= []
+      this.taskManageList.filter(rou=>{
+        if(rou.isnum == true){
+          nhseg.push(rou)
+        }
+      })
+      console.log(nhseg)
+      this.ids = nhseg.map(item => item.algorithmId)
+      console.log(this.ids,nhseg)
+      this.single = nhseg.length!==1
+      this.multiple = !nhseg.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset()
+      this.open = true
+      this.title = "添加算法"
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset()
+      const algorithmId = row.algorithmId || this.ids
+      getAlgorithmSet(algorithmId).then(response => {
+        this.form = response.data
+        this.open = true
+        this.title = "修改算法"
+      })
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.algorithmId != null) {
+            updateAlgorithmSet(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功")
+              this.open = false
+              this.getList()
+            })
+          } else {
+            addAlgorithmSet(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功")
+              this.open = false
+              this.getList()
+            })
+          }
+        }
+      })
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const algorithmIds = row.algorithmId || this.ids
+      delAlgorithmSet(algorithmIds).then(response => {
+        this.$modal.msgSuccess("删除成功")
+        this.getList()
+      })
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('manage/algorithmSet/export', {
+        ...this.queryParams
+      }, `algorithmSet_${new Date().getTime()}.xlsx`)
+    },
+    // 获取屏幕高度
+                showFilterForm () {
+                      this.filterActive = !this.filterActive
+                      this.changeTableMaxHeight()
+                    },
+                    changeTableMaxHeight () {
+                      let height = document.body.offsetHeight // 网页可视区域高度
+                      // if (this.filterActive) {
+                      //   this.tableMaxHeight = height - 320
+                      // } else {
+                        this.tableMaxHeight = height - 250
+                      // }
+                      console.log(height)
+                    }
+  }
+}
+</script>
+<style lang="scss">
+  .njgsebottinghe{
+    margin: 0 !important;
+    height: 40px;
+    p{
+      height: 40px !important;
+      line-height: 40px !important;
+    }
+  }
+  .ingsjlegsng{
+    .paragraph_5{
+     font-family: PingFang SC;
+     font-weight: 500;
+     font-size: 13px;
+     color: #222327;
+    }
+  }
+  .ngosie{
+    .el-form-item--medium .el-form-item__label{
+      line-height: 19px;
+    }
+  }
+  .renset{
+     margin-bottom: 0;
+  }
+  .el-table .el-table__header-wrapper th, .el-table .el-table__fixed-header-wrapper th{
+    background-color:#F5F6F8;
+  }
+  .el-checkbox__input.is-checked .el-checkbox__inner{
+    background-color: #03BF8A;
+    border-color: #03BF8A;
+  }
+  .el-checkbox__input.is-indeterminate .el-checkbox__inner{
+    background-color: #03BF8A;
+    border-color: #03BF8A;
+  }
+  .qucheu{
+    .el-form-item--small.el-form-item{
+      border: 1px  solid #E6E6E6;
+    }
+    .el-input__inner{
+      border:0;
+    }
+  }
+
+
+</style>