113 lines
2.8 KiB
Vue
113 lines
2.8 KiB
Vue
<template>
|
|
<div class="search">
|
|
<div class="search-bar">
|
|
<el-input v-model="code" placeholder="请输入溯源码" size="large" clearable />
|
|
<el-button type="primary" icon="Search" size="large" class="search-bar-btn" @click="onSearch">搜索</el-button>
|
|
</div>
|
|
<h2 class="search-title">农产品全生命周期管理</h2>
|
|
<div class="search-panel">
|
|
<el-card class="search-card" shadow="hover">
|
|
<div class="search-card-item">
|
|
<span class="icon"><img :src="getAssetsFile('images/trace/search-1.png')" /></span>
|
|
<span class="text">种养植档案管理</span>
|
|
</div>
|
|
</el-card>
|
|
<div class="search-card-connector"></div>
|
|
<el-card class="search-card" shadow="hover">
|
|
<div class="search-card-item">
|
|
<span class="icon"><img :src="getAssetsFile('images/trace/search-2.png')" /></span>
|
|
<span class="text">农事管理</span>
|
|
</div>
|
|
</el-card>
|
|
<div class="search-card-connector"></div>
|
|
<el-card class="search-card" shadow="hover">
|
|
<div class="search-card-item">
|
|
<span class="icon"><img :src="getAssetsFile('images/trace/search-3.png')" /></span>
|
|
<span class="text">质量监管</span>
|
|
</div>
|
|
</el-card>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
<script setup>
|
|
import { ref } from 'vue';
|
|
import { useRouter } from 'vue-router';
|
|
import { useApp } from '@/hooks';
|
|
import { isEmpty, getAssetsFile } from '@/utils';
|
|
|
|
const { VITE_APP_NAME } = import.meta.env;
|
|
const router = useRouter();
|
|
const app = useApp();
|
|
const code = ref('');
|
|
|
|
const onSearch = () => {
|
|
if (isEmpty(code.value)) {
|
|
app.$message.error('请输入溯源码进行查询!');
|
|
return;
|
|
}
|
|
router.push({ path: `/${VITE_APP_NAME}/trace-info`, query: { code: code.value } });
|
|
};
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
.search {
|
|
@include flex-column;
|
|
|
|
align-items: center;
|
|
padding: 80px 20px 20px;
|
|
box-sizing: border-box;
|
|
&-bar {
|
|
margin-bottom: 80px;
|
|
width: 600px;
|
|
@include flex-row;
|
|
&-btn {
|
|
margin-left: -5px;
|
|
}
|
|
}
|
|
&-title {
|
|
margin-bottom: 80px;
|
|
font-size: 30px;
|
|
text-align: center;
|
|
color: $color-primary;
|
|
}
|
|
&-panel {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
width: 100%;
|
|
gap: 20px;
|
|
}
|
|
&-card {
|
|
flex: 1;
|
|
max-width: 200px;
|
|
cursor: pointer;
|
|
transition: transform 0.3s;
|
|
&-item {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
gap: 15px;
|
|
padding: 20px;
|
|
}
|
|
.icon {
|
|
display: block;
|
|
width: 80px;
|
|
height: 80px;
|
|
img {
|
|
width: 100%;
|
|
}
|
|
}
|
|
.text {
|
|
font-size: 16px;
|
|
color: $color-primary;
|
|
}
|
|
&-connector {
|
|
width: 160px;
|
|
height: 3px;
|
|
border-radius: 2px;
|
|
background-color: $color-success;
|
|
flex-shrink: 0;
|
|
}
|
|
}
|
|
}
|
|
</style>
|