From 96248d52583ff8dc0c3a50e79e75b2842fef73b9 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Tue, 06 May 2025 13:49:10 +0800
Subject: [PATCH] 算法仓库
---
.env.development | 2
src/api/algorithm.js | 19 +++
index.html | 2
src/views/algorithmRepository/algorithmRepository.vue | 303 ++++++++++++++++++++++++++++++++++++++++++++++++++
src/assets/images/ht-sfbg.png | 0
5 files changed, 325 insertions(+), 1 deletions(-)
diff --git a/.env.development b/.env.development
index 030ebc6..75b715c 100644
--- a/.env.development
+++ b/.env.development
@@ -16,3 +16,5 @@
# 航线文件地址
VITE_APP_AIRLINE_URL = https://wrj.shuixiongit.com/minio/cloud-bucket
+# 图片存放地址
+VITE_APP_TERRAIN_URL = https://wrj.shuixiongit.com/aiskyminio/cloud-bucket
\ No newline at end of file
diff --git a/index.html b/index.html
index 2c07141..7528eae 100644
--- a/index.html
+++ b/index.html
@@ -8,7 +8,7 @@
<meta http-equiv="X-UA-Compatible" content="chrome=1" />
<meta name="renderer" content="webkit" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
- <meta name="apple-mobile-web-app-capable" content="yes" />
+ <meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="format-detection" content="telephone=no" />
<link rel="icon" href="/img/bg/index_logo.png" />
diff --git a/src/api/algorithm.js b/src/api/algorithm.js
new file mode 100644
index 0000000..0543cdf
--- /dev/null
+++ b/src/api/algorithm.js
@@ -0,0 +1,19 @@
+// 算法仓库
+import request from '@/axios'
+// 图片列表
+export const getalgorithmList = (data, params) => {
+ return request({
+ url: `/drone-device-core/aiTmp/list`,
+ method: 'post',
+ data,
+ params
+ })
+ }
+//机巢查询
+export const selectDeviceList = data => {
+ return request({
+ url: `/drone-device-core/aiTmp/devices`,
+ method: 'get',
+ data: data,
+ })
+}
\ No newline at end of file
diff --git a/src/assets/images/ht-sfbg.png b/src/assets/images/ht-sfbg.png
new file mode 100644
index 0000000..39fa6fa
--- /dev/null
+++ b/src/assets/images/ht-sfbg.png
Binary files differ
diff --git a/src/views/algorithmRepository/algorithmRepository.vue b/src/views/algorithmRepository/algorithmRepository.vue
new file mode 100644
index 0000000..928ee07
--- /dev/null
+++ b/src/views/algorithmRepository/algorithmRepository.vue
@@ -0,0 +1,303 @@
+<template>
+ <basic-container>
+ <div class="algorithContainer">
+ <div class="algorithItem" v-if="!showDetail">
+ <div class="item" v-for="(item, index) in AlgorithmData" :key="index">
+ <img class="imgicon" :src="`${baseUrl}/后台-算法仓库/${item.dictValue}.png`" alt="" />
+ <div>{{ item.dictValue }}</div>
+ <div
+ :class="item.dictValue === '病虫害识别' ? 'stopStatus' : 'normalStatus'"
+ @click="jumpDatail(item)"
+ >
+ {{ item.dictValue === '病虫害识别' ? '停用状态' : '正常状态' }}
+ </div>
+ </div>
+ </div>
+ <!-- 详情页 -->
+ <div class="algorithItemDetail" v-else>
+ <div class="search">
+ <div class="searchBox">
+ <div class="item">
+ <div class="itemchild">模糊查询:</div>
+ <el-input v-model="params.name" class="filter-item" placeholder="请输入事件名称" clearable></el-input>
+ </div>
+ <div class="item">
+ <el-date-picker
+ type="daterange"
+ range-separator="至"
+ start-placeholder="开始日期"
+ end-placeholder="结束日期"
+ value-format="YYYY-MM-DD"
+ v-model="taskData"
+ placeholder="请选择日期"
+ @change="changeselect"
+ />
+ </div>
+ <div class="item">
+ <div class="itemchild">机巢查询:</div>
+ <el-select v-model="params.device_name" placeholder="请选择" class="filter-item">
+ <el-option v-for="item in jcoptions" :key="item" :label="item" :value="item" />
+ </el-select>
+ </div>
+ </div>
+ <div class="search-btn">
+ <el-button type="primary" icon="el-icon-search" @click="handleSearch">搜索</el-button>
+ <el-button icon="el-icon-delete" @click="handleReset">清空</el-button>
+ </div>
+ </div>
+
+ <div class="pictureitem" v-if="detailData.length > 0" v-loading="loading" element-loading-text="加载中">
+ <div class="imgitem" v-for="(item, index) in detailData" :key="index">
+ <img :src="item.url" alt=""/>
+ <div class="info">
+ <div class="name">{{ item.name }}</div>
+ <div class="time">{{ item.create_time.slice(5, 16).replace("-", "/", 1) }}</div>
+ </div>
+ </div>
+ </div>
+ <el-empty class="custom-empty" v-else>
+ <template #description>
+ <span class="custom-text">暂无数据</span>
+ </template>
+ </el-empty>
+ <!-- 分页 -->
+ <el-pagination
+ class="pageStyle"
+ background
+ :page-sizes="[10, 20, 30, 50]"
+ v-model:current-page="params.current"
+ v-model:page-size="params.size"
+ layout="total, prev, pager, next,sizes, jumper"
+ :total="total"
+ @size-change="handleSizeChange"
+ @current-change="handleCurrentChange"
+ />
+ </div>
+ </div>
+ </basic-container>
+</template>
+
+<script setup>
+defineOptions({
+ name: 'algorithmRepository',
+});
+import { getDictionaryByCode } from '@/api/system/dictbiz';
+import { getalgorithmList, selectDeviceList } from '@/api/algorithm';
+
+import { useRouter } from 'vue-router';
+const router = useRouter();
+const baseUrl = import.meta.env.VITE_APP_TERRAIN_URL;
+const showDetail = ref(false);
+const taskData = ref('');
+const jcvalue = ref('');
+const jcoptions = ref([]);
+const total = ref(0);
+const loading = ref(true);
+const params = ref({
+ ai_type_key: '',
+ start_date: null,
+ end_date: null,
+ device_name: '',
+ name: '',
+ current: 1,
+ size: 10,
+});
+// 请求字典字段
+let AlgorithmData = ref([]);
+const detailData = ref([]);
+const requestDictionary = () => {
+ getDictionaryByCode('SF').then(res => {
+ if (res.code !== 0) {
+ // 处理数据
+ AlgorithmData.value = res.data.data['SF'];
+ }
+ });
+};
+const jumpDatail = val => {
+ if (val.dictValue === '病虫害识别') {
+ showDetail.value = false;
+ } else {
+ showDetail.value = true;
+ params.value.ai_type_key = val.dictKey;
+ }
+
+ getList();
+};
+// 详情
+const getList = () => {
+ getalgorithmList(params.value).then(res => {
+ loading.value = true;
+ // console.log('详情', res.data.data);
+ detailData.value = res.data.data.records;
+ total.value=res.data.data.total
+ setTimeout(() =>{
+ loading.value = false
+ },1000)
+ });
+};
+// 机巢查询
+const getDeviceList = () => {
+ selectDeviceList().then(res => {
+ jcoptions.value = res.data.data;
+ });
+};
+// 日期选择
+const changeselect = () => {
+ params.value.start_date = taskData.value.length ? `${taskData.value[0]} 00:00:00` : null;
+ params.value.end_date = taskData.value.length ? `${taskData.value[1]} 23:59:59` : null;
+};
+const handleSearch = () => {
+ getList();
+};
+const handleReset = () => {
+ params.value.start_date = null;
+ params.value.end_date = null;
+ params.value.device_name = '';
+ params.value.name = '';
+ getList();
+};
+// 分页大小改变
+const handleSizeChange = val => {
+ params.size = val;
+ getList();
+};
+// 页码改变
+const handleCurrentChange = val => {
+ params.current = val;
+ getList();
+};
+onMounted(() => {
+ requestDictionary();
+ getDeviceList();
+});
+</script>
+
+<style scoped lang="scss">
+.algorithItem {
+ padding: 20px;
+ display: grid;
+ grid-template-columns: repeat(5, 1fr);
+ gap: 53px;
+ text-align: center;
+ vertical-align: middle;
+ .item {
+ height: 300px;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+ background: url('/src/assets/images/ht-sfbg.png') no-repeat center;
+ background-size: 100% 100%;
+ .imgicon {
+ width: 100px;
+ height: 100px;
+ margin-bottom: 47px;
+ }
+ .normalStatus {
+ width: 116px;
+ height: 43px;
+ background: #ebfbee;
+ border-radius: 50px;
+ text-align: center;
+ line-height: 43px;
+ font-weight: 400;
+ font-size: 16px;
+ color: #029d36;
+ margin-top: 23px;
+ cursor: pointer;
+ }
+ .stopStatus {
+ width: 116px;
+ height: 43px;
+ background: #e8e8e8;
+ border-radius: 50px 50px 50px 50px;
+ text-align: center;
+ line-height: 43px;
+ font-weight: 400;
+ font-size: 16px;
+ color: #464747;
+ margin-top: 23px;
+ }
+ .normalStatus:hover {
+ background: rgba(6, 217, 87, 0.2);
+ }
+ }
+}
+.algorithItemDetail {
+ padding: 20px;
+
+ .pictureitem {
+ display: grid;
+ grid-template-columns: repeat(5, 1fr);
+ gap: 24px;
+
+ .imgitem {
+ border-radius: 12px 12px 0 0;
+ overflow: hidden;
+ img {
+ width: 100%;
+ height: 200px;
+ display: block;
+ margin: 0;
+ padding: 0;
+ }
+ .info {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ height: 42px;
+ border-radius: 0 0 12px 12px;
+ overflow: hidden;
+ background: linear-gradient(180deg, #ffffff 0%, #e5edff 100%);
+ border: 1px solid #1c5cff;
+ border-top: none !important;
+
+ .name {
+ margin-left: 12px;
+ font-weight: 500;
+ font-size: 16px;
+ color: #363636;
+ }
+ .time {
+ margin-right: 12px;
+ font-weight: 500;
+ font-size: 14px;
+ color: #595959;
+ }
+ }
+ }
+ }
+ .search {
+ display: flex;
+ justify-content: space-between;
+ }
+ .searchBox {
+ display: flex;
+ align-items: center;
+ margin-bottom: 27px;
+ .itemchild {
+ white-space: nowrap;
+ margin-right: 5px;
+ font-weight: 400;
+font-size: 14px;
+color: #363636;
+ }
+ .item {
+ display: flex;
+ align-items: center;
+ margin-right: 49px;
+ }
+ }
+ .search-btn {
+ display: flex;
+ }
+ .filter-item {
+ width: 218px;
+ }
+}
+.pageStyle {
+ margin-top: 32px;
+ display: flex;
+ justify-content: right;
+}
+</style>
--
Gitblit v1.9.3