运营平台个人中心-我的品牌页面开发,菜单图标添加样式调整
Before Width: | Height: | Size: 600 B After Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 669 B After Width: | Height: | Size: 2.9 KiB |
Before Width: | Height: | Size: 804 B After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 964 B After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 772 B After Width: | Height: | Size: 4.4 KiB |
BIN
sub-operation-service/src/assets/images/userCenter/menu4-1.png
Normal file
After Width: | Height: | Size: 5.5 KiB |
BIN
sub-operation-service/src/assets/images/userCenter/menu4.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
sub-operation-service/src/assets/images/userCenter/menu5-1.png
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
sub-operation-service/src/assets/images/userCenter/menu5.png
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
sub-operation-service/src/assets/images/userCenter/menu6-1.png
Normal file
After Width: | Height: | Size: 3.7 KiB |
BIN
sub-operation-service/src/assets/images/userCenter/menu6.png
Normal file
After Width: | Height: | Size: 4.9 KiB |
@ -85,6 +85,12 @@ export const constantRoutes = [
|
||||
name: 'myFinance',
|
||||
meta: { title: '我的金融' },
|
||||
},
|
||||
{
|
||||
path: '/sub-operation-service/myBrand',
|
||||
component: () => import('@/views/userCenter/myBrand.vue'),
|
||||
name: 'myBrand',
|
||||
meta: { title: '我的品牌' },
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
|
@ -34,8 +34,9 @@ const leftMenu = reactive([
|
||||
{ name: 'agricultural', title: '我的购物车', icon: 'menu1.png', path: '/sub-operation-service/userCenter' },
|
||||
{ name: 'supplier', title: '我的订单', icon: 'menu2-1.png', path: '/sub-operation-service/userOrders' },
|
||||
// { name: 'purchaser', title: '我的土地', icon: 'menu3-1.png', path: '/sub-operation-service/userLands' },
|
||||
{ name: 'mySource', title: '我的溯源', icon: 'menu3-1.png', path: '/sub-operation-service/mySource' },
|
||||
{ name: 'myFinance', title: '我的金融', icon: 'menu3-1.png', path: '/sub-operation-service/myFinance' },
|
||||
{ name: 'mySource', title: '我的溯源', icon: 'menu4-1.png', path: '/sub-operation-service/mySource' },
|
||||
{ name: 'myFinance', title: '我的金融', icon: 'menu5-1.png', path: '/sub-operation-service/myFinance' },
|
||||
{ name: 'myBrand', title: '我的品牌', icon: 'menu6-1.png', path: '/sub-operation-service/myBrand' },
|
||||
]);
|
||||
|
||||
let currentIndex = ref(0);
|
||||
@ -114,15 +115,20 @@ const toLink = (n, index) => {
|
||||
}
|
||||
.item-img {
|
||||
display: inline-block;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
.item-title {
|
||||
display: -webkit-inline-box;
|
||||
font-size: 20px;
|
||||
font-weight: 400;
|
||||
line-height: 40px;
|
||||
padding-left: 20px;
|
||||
padding-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@
|
||||
:prop="column.prop"
|
||||
:label="column.label"
|
||||
:width="column.width"
|
||||
:align="column.align || 'center'"
|
||||
:align="column.align || 'left'"
|
||||
:sortable="column.sortable"
|
||||
:header-class-name="column.headerClassName"
|
||||
>
|
||||
|
407
sub-operation-service/src/views/userCenter/myBrand.vue
Normal file
@ -0,0 +1,407 @@
|
||||
<template>
|
||||
<div>
|
||||
<common current-name="myBrand">
|
||||
<template #main>
|
||||
<div class="container">
|
||||
<userHeader ref="titleRef" :title="'我的金融'"></userHeader>
|
||||
<!-- 搜索栏 -->
|
||||
<div ref="searchBarRef" class="search-box">
|
||||
<div class="search-bar">
|
||||
<div class="search-bar-left">
|
||||
<el-form ref="searchForm" :inline="true" :model="formInline" class="demo-form-inline" :label-width="'auto'">
|
||||
<el-form-item label="品牌名称" prop="brandName">
|
||||
<el-input v-model="formInline.brandName" placeholder="请输入品牌名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人" prop="applicant">
|
||||
<el-input v-model="formInline.applicant" placeholder="请输入申请人" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请状态" prop="applyStatus">
|
||||
<el-select v-model="formInline.applyStatus" placeholder="请选择">
|
||||
<el-option label="全部" value="99" />
|
||||
<el-option label="未申请" value="0" />
|
||||
<el-option label="已申请" value="1" />
|
||||
<el-option label="已通过" value="2" />
|
||||
<el-option label="未通过" value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="使用状态" prop="useStatus">
|
||||
<el-select v-model="formInline.useStatus" placeholder="请选择">
|
||||
<el-option label="全部" value="99" />
|
||||
<el-option label="无法使用" value="0" />
|
||||
<el-option label="正常使用" value="1" />
|
||||
<el-option label="暂未使用" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请日期" prop="startDate" style="margin-right: 0">
|
||||
<el-date-picker v-model="formInline.startDate" type="date" placeholder="请选择起始日期" clearable style="width: 160px" />
|
||||
</el-form-item>
|
||||
<el-form-item style="margin-right: 0">
|
||||
<span style="width: 30px; text-align: center; display: inline-block"> - </span>
|
||||
</el-form-item>
|
||||
<el-form-item prop="endDate">
|
||||
<el-date-picker v-model="formInline.endDate" type="date" placeholder="请选择截止日期" clearable style="width: 160px" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="search-bar-right">
|
||||
<el-button type="primary" icon="Search" @click="onSubmit">查询</el-button>
|
||||
<el-button icon="Refresh" style="margin: 24px 0 0 0" @click="resetForm">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 表格 -->
|
||||
<div class="table-cont" :style="{ height: tableViewportHeight + 'px' }">
|
||||
<tableComponent
|
||||
:table-data="tableData"
|
||||
:columns="columns"
|
||||
:show-border="false"
|
||||
:show-selection="true"
|
||||
:header-cell-class-name="getHeaderClass"
|
||||
@page-change="handlePaginationChange"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<!-- 自定义-状态 -->
|
||||
<template #applyStatus="slotProps">
|
||||
<span v-if="slotProps.row.applyStatus == 0" class="color-gray">未申请</span>
|
||||
<span v-else-if="slotProps.row.applyStatus == 1" class="color-orange">已申请</span>
|
||||
<span v-else-if="slotProps.row.applyStatus == 2" class="color-green">已通过</span>
|
||||
<span v-else-if="slotProps.row.applyStatus == 3" class="color-red">未通过</span>
|
||||
</template>
|
||||
|
||||
<!-- 自定义-状态 -->
|
||||
<template #useStatus="slotProps">
|
||||
<span v-if="slotProps.row.useStatus == 0" class="color-red">无法使用</span>
|
||||
<span v-else-if="slotProps.row.useStatus == 1" class="color-green">正常通过</span>
|
||||
<span v-else-if="slotProps.row.useStatus == 2" class="color-orange">暂未使用</span>
|
||||
</template>
|
||||
|
||||
<!-- 自定义-操作 -->
|
||||
<template #action="slotProps">
|
||||
<el-dropdown>
|
||||
<span class="el-dropdown-link">
|
||||
<el-icon><More /></el-icon>
|
||||
</span>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item @click="handleEdit(slotProps.row, 1)">Action 1</el-dropdown-item>
|
||||
<el-dropdown-item @click="handleEdit(slotProps.row, 2)">Action 2</el-dropdown-item>
|
||||
<el-dropdown-item @click="handleEdit(slotProps.row, 3)">Action 3</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</template>
|
||||
</tableComponent>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</common>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import common from './components/common.vue';
|
||||
import { ref, reactive, computed, onMounted, onBeforeUnmount } from 'vue';
|
||||
import userHeader from './components/userHeader.vue';
|
||||
import tableComponent from './components/tableComponent.vue';
|
||||
import Mock from 'mockjs';
|
||||
|
||||
const formInline = reactive({
|
||||
brandName: '',
|
||||
applicant: '',
|
||||
guarantor: '',
|
||||
applyStatus: '99',
|
||||
useStatus: '99',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
});
|
||||
|
||||
const searchForm = ref(null);
|
||||
const onSubmit = () => {
|
||||
console.log('submit!');
|
||||
};
|
||||
const resetForm = () => {
|
||||
searchForm.value.resetFields();
|
||||
};
|
||||
|
||||
// 表格数据
|
||||
const tableData = ref([]);
|
||||
// 列配置
|
||||
const columns = ref([
|
||||
{ prop: 'brandName', label: '品牌名称' },
|
||||
{ prop: 'applicant', label: '申请人' },
|
||||
{ prop: 'applyStatus', label: '申请状态', slotName: 'applyStatus' },
|
||||
{ prop: 'useStatus', label: '使用状态', slotName: 'useStatus' },
|
||||
{ prop: 'applyTime', label: '申请日期', width: '180px' },
|
||||
{ prop: 'action', label: '操作', slotName: 'action', width: '180' },
|
||||
]);
|
||||
// 生成模拟数据
|
||||
const generateMockData = () => {
|
||||
return Mock.mock({
|
||||
'list|30': [
|
||||
{
|
||||
'id|+1': 1,
|
||||
brandName: '耿马生态果蔬', //产品名称 水果 蔬菜
|
||||
applyTime: '@datetime',
|
||||
'applyStatus|1': [0, 1, 2, 3], //0未申请 1已申请 2已通过 3未通过
|
||||
'useStatus|1': [0, 1, 2], //0无法使用 1正常使用 2暂未使用
|
||||
guarantor: '@cname',
|
||||
applicant: '@cname',
|
||||
},
|
||||
],
|
||||
}).list;
|
||||
};
|
||||
// 加载数据
|
||||
const loadData = () => {
|
||||
// 模拟API请求延迟
|
||||
setTimeout(() => {
|
||||
tableData.value = generateMockData();
|
||||
}, 500);
|
||||
};
|
||||
// 自定义表头类名,也可以在columns指定列中添加headerClassName: 'custom-header'
|
||||
const getHeaderClass = ({ column }) => {
|
||||
return 'custom-header';
|
||||
};
|
||||
// 分页变化
|
||||
const handlePaginationChange = ({ page, pageSize }) => {
|
||||
console.log('分页变化:', page, pageSize);
|
||||
// 这里可以调用API获取新数据
|
||||
// fetchData(page, limit,pageSize)
|
||||
};
|
||||
// 多选框变化
|
||||
const handleSelectionChange = (selection) => {
|
||||
console.log('选中项:', selection);
|
||||
};
|
||||
|
||||
let nowClickRow = ref(null);
|
||||
// 编辑操作
|
||||
const handleEdit = (row, num) => {
|
||||
nowClickRow.value = row;
|
||||
console.log('编辑的行:', row);
|
||||
console.log('第几个按钮:', num);
|
||||
};
|
||||
|
||||
const titleRef = ref(null);
|
||||
const searchBarRef = ref(null);
|
||||
const tableViewportHeight = ref(0);
|
||||
// 精确计算可用高度
|
||||
const calculateTableHeight = () => {
|
||||
// 获取窗口总高度
|
||||
const windowHeight = window.innerHeight;
|
||||
|
||||
// 获取各组件高度
|
||||
const headerHeight = titleRef.value?.$el?.offsetHeight || 0;
|
||||
const searchBarHeight = searchBarRef.value?.offsetHeight || 0;
|
||||
|
||||
// 计算容器内边距补偿(根据实际样式调整)
|
||||
const paddingCompensation = 60;
|
||||
|
||||
// 最终计算
|
||||
tableViewportHeight.value = windowHeight - headerHeight - searchBarHeight - paddingCompensation;
|
||||
// console.log(tableViewportHeight.value);
|
||||
};
|
||||
// 组件挂载时加载数据
|
||||
onMounted(() => {
|
||||
loadData();
|
||||
|
||||
calculateTableHeight();
|
||||
|
||||
// 添加响应式监听
|
||||
window.addEventListener('resize', calculateTableHeight);
|
||||
|
||||
// 监听DOM变化(适用于动态变化的header/searchbar)
|
||||
const observer = new ResizeObserver(calculateTableHeight);
|
||||
if (titleRef.value?.$el) observer.observe(titleRef.value.$el);
|
||||
if (searchBarRef.value) observer.observe(searchBarRef.value);
|
||||
});
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener('resize', calculateTableHeight);
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.container {
|
||||
width: 100%;
|
||||
overflow: hidden; /* 防止全局滚动条 */
|
||||
|
||||
.search-box {
|
||||
overflow: hidden;
|
||||
margin: 16px 0;
|
||||
padding: 16px 8px 0 16px;
|
||||
border-radius: 16px;
|
||||
background: #fff;
|
||||
.order-tab {
|
||||
width: 100%;
|
||||
::v-deep() {
|
||||
.el-tabs__nav-wrap::after {
|
||||
background: transparent !important;
|
||||
}
|
||||
.el-tabs__active-bar {
|
||||
height: 3px !important;
|
||||
border-radius: 4px;
|
||||
}
|
||||
.el-descriptions__label,
|
||||
.el-descriptions__content {
|
||||
font-size: 16px !important;
|
||||
}
|
||||
.cell-item {
|
||||
display: inline-flex;
|
||||
}
|
||||
.el-descriptions__label {
|
||||
color: $color-999;
|
||||
}
|
||||
.el-descriptions__content {
|
||||
color: $color-333;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.search-bar {
|
||||
display: flex;
|
||||
flex-shrink: 0; /* 禁止收缩 */
|
||||
min-height: 100px;
|
||||
|
||||
.search-bar-left {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.search-bar-right {
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.demo-form-inline {
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.el-form--inline .el-form-item {
|
||||
margin-right: 30px;
|
||||
}
|
||||
|
||||
.demo-form-inline .el-input {
|
||||
--el-input-width: 160px;
|
||||
}
|
||||
|
||||
.demo-form-inline .el-select {
|
||||
--el-select-width: 160px;
|
||||
}
|
||||
|
||||
.demo-form-inline .el-date-picker {
|
||||
--el-select-width: 160px;
|
||||
}
|
||||
}
|
||||
.table-cont {
|
||||
min-height: 300px;
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
background-color: #fff;
|
||||
position: relative;
|
||||
.el-icon-custom {
|
||||
vertical-align: middle;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
/* 自定义弹窗样式 */
|
||||
.traceability-dialog {
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
border-radius: 16px !important;
|
||||
}
|
||||
|
||||
/* 主要内容区域 */
|
||||
.dialog-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background: white;
|
||||
border-radius: 8px;
|
||||
padding: 0 0 20px 0;
|
||||
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* 产品信息 */
|
||||
.product-info {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 20px;
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.product-name {
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
/* 二维码图片 */
|
||||
.qrcode-image {
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* 下载区域 */
|
||||
.download-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 0 0 10px 0;
|
||||
color: #25bf82;
|
||||
cursor: pointer;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.download-icon {
|
||||
margin-left: 8px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/* 遗传编码区域 */
|
||||
.code-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 10px 0;
|
||||
background: rgba(37, 191, 130, 0.1);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.genetic-code {
|
||||
font-family: monospace;
|
||||
font-size: 14px;
|
||||
color: #25bf82;
|
||||
display: inline-block;
|
||||
max-width: 250px;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
.copy-icon {
|
||||
margin-left: 10px;
|
||||
color: #409eff;
|
||||
cursor: pointer;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
/* 关闭按钮 */
|
||||
.close-button {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
bottom: -60px;
|
||||
color: white;
|
||||
font-size: 30px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
// 表格中文本的颜色
|
||||
.color-gray {
|
||||
color: $color-5a;
|
||||
}
|
||||
.color-orange {
|
||||
color: $color-warning;
|
||||
}
|
||||
.color-green {
|
||||
color: $color-success;
|
||||
}
|
||||
.color-red {
|
||||
color: $color-danger;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<common current-name="agricultural">
|
||||
<common current-name="myFinance">
|
||||
<template #main>
|
||||
<div class="container">
|
||||
<userHeader ref="titleRef" :title="'我的金融'"></userHeader>
|
||||
@ -23,11 +23,13 @@
|
||||
<el-form-item label="申请人" prop="applicant">
|
||||
<el-input v-model="formInline.applicant" placeholder="请输入申请人" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请状态" prop="status">
|
||||
<el-select v-model="formInline.status" placeholder="请选择">
|
||||
<el-form-item label="申请状态" prop="applyStatus">
|
||||
<el-select v-model="formInline.applyStatus" placeholder="请选择">
|
||||
<el-option label="全部" value="99" />
|
||||
<el-option label="待检测" value="0" />
|
||||
<el-option label="已检测" value="1" />
|
||||
<el-option label="未申请" value="0" />
|
||||
<el-option label="已申请" value="1" />
|
||||
<el-option label="已通过" value="2" />
|
||||
<el-option label="未通过" value="3" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="申请日期" prop="startDate" style="margin-right: 0">
|
||||
@ -59,10 +61,11 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<!-- 自定义-状态 -->
|
||||
<template #status="slotProps">
|
||||
<span :style="{ color: slotProps.row.status == 1 ? 'green' : '#FFB345' }">
|
||||
{{ slotProps.row.status === 1 ? '已通过' : '已申请' }}
|
||||
</span>
|
||||
<template #applyStatus="slotProps">
|
||||
<span v-if="slotProps.row.applyStatus == 0" class="color-gray">未申请</span>
|
||||
<span v-else-if="slotProps.row.applyStatus == 1" class="color-orange">已申请</span>
|
||||
<span v-else-if="slotProps.row.applyStatus == 2" class="color-green">已通过</span>
|
||||
<span v-else-if="slotProps.row.applyStatus == 3" class="color-red">未通过</span>
|
||||
</template>
|
||||
|
||||
<!-- 自定义-操作 -->
|
||||
@ -98,7 +101,7 @@ const formInline = reactive({
|
||||
productName: '',
|
||||
applicant: '',
|
||||
guarantor: '',
|
||||
status: '99',
|
||||
applyStatus: '99',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
});
|
||||
@ -111,6 +114,11 @@ let bottomList = reactive([
|
||||
]);
|
||||
const tabChange = () => {
|
||||
console.log(activeCurrent.value);
|
||||
if (activeCurrent.value == '3') {
|
||||
columns.value = columns2.value;
|
||||
} else {
|
||||
columns.value = columns1.value;
|
||||
}
|
||||
};
|
||||
|
||||
const searchForm = ref(null);
|
||||
@ -124,12 +132,19 @@ const resetForm = () => {
|
||||
// 表格数据
|
||||
const tableData = ref([]);
|
||||
// 列配置
|
||||
const columns = ref([
|
||||
{ prop: 'id', label: 'ID', width: '80' },
|
||||
const columns = ref([]);
|
||||
const columns1 = ref([
|
||||
{ prop: 'productName', label: '产品名称' },
|
||||
{ prop: 'applicant', label: '申请人' },
|
||||
{ prop: 'applyStatus', label: '申请状态', slotName: 'applyStatus' },
|
||||
{ prop: 'applyTime', label: '申请日期', width: '180px' },
|
||||
{ prop: 'action', label: '操作', slotName: 'action', width: '180' },
|
||||
]);
|
||||
const columns2 = ref([
|
||||
{ prop: 'productName', label: '产品名称' },
|
||||
{ prop: 'guarantor', label: '担保人' },
|
||||
{ prop: 'applicant', label: '申请人' },
|
||||
{ prop: 'status', label: '申请状态', slotName: 'status' },
|
||||
{ prop: 'applyStatus', label: '申请状态', slotName: 'applyStatus' },
|
||||
{ prop: 'applyTime', label: '申请日期', width: '180px' },
|
||||
{ prop: 'action', label: '操作', slotName: 'action', width: '180' },
|
||||
]);
|
||||
@ -141,8 +156,8 @@ const generateMockData = () => {
|
||||
'id|+1': 1,
|
||||
productName: '惠农e贷', //产品名称 水果 蔬菜
|
||||
applyTime: '@datetime',
|
||||
'status|1': [1, 1, 1, 0], //0待检测 1已检测
|
||||
guarantor: '@cname',
|
||||
'applyStatus|1': [0, 1, 2, 3], //0未申请 1已申请 2已通过 3未通过
|
||||
guarantor: '惠农有限公司',
|
||||
applicant: '@cname',
|
||||
},
|
||||
],
|
||||
@ -199,6 +214,7 @@ const calculateTableHeight = () => {
|
||||
};
|
||||
// 组件挂载时加载数据
|
||||
onMounted(() => {
|
||||
columns.value = columns1.value;
|
||||
loadData();
|
||||
|
||||
calculateTableHeight();
|
||||
@ -389,5 +405,18 @@ onBeforeUnmount(() => {
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
// 表格中文本的颜色
|
||||
.color-gray {
|
||||
color: $color-5a;
|
||||
}
|
||||
.color-orange {
|
||||
color: $color-warning;
|
||||
}
|
||||
.color-green {
|
||||
color: $color-success;
|
||||
}
|
||||
.color-red {
|
||||
color: $color-danger;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<common current-name="agricultural">
|
||||
<common current-name="mySource">
|
||||
<template #main>
|
||||
<div class="container">
|
||||
<userHeader ref="titleRef" :title="'我的溯源'"></userHeader>
|
||||
@ -50,9 +50,8 @@
|
||||
>
|
||||
<!-- 自定义-状态 -->
|
||||
<template #status="slotProps">
|
||||
<span :style="{ color: slotProps.row.status == 1 ? 'green' : 'red' }">
|
||||
{{ slotProps.row.status === 1 ? '已检测' : '待检测' }}
|
||||
</span>
|
||||
<span v-if="slotProps.row.status == 0" class="color-red">待检测</span>
|
||||
<span v-else-if="slotProps.row.status == 1" class="color-green">已检测</span>
|
||||
</template>
|
||||
|
||||
<!-- 自定义-检测报告 -->
|
||||
@ -154,7 +153,6 @@ const resetForm = () => {
|
||||
const tableData = ref([]);
|
||||
// 列配置
|
||||
const columns = ref([
|
||||
{ prop: 'id', label: 'ID', width: '80' },
|
||||
{ prop: 'productName', label: '产品名称', width: '180px' },
|
||||
{ prop: 'applyTime', label: '申请时间', width: '180px' },
|
||||
{ prop: 'status', label: '申请状态', slotName: 'status' },
|
||||
@ -483,5 +481,15 @@ onBeforeUnmount(() => {
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
// 表格中文本的颜色
|
||||
.color-gray {
|
||||
color: $color-5a;
|
||||
}
|
||||
.color-green {
|
||||
color: $color-success;
|
||||
}
|
||||
.color-red {
|
||||
color: $color-danger;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|