Compare commits

...

22 Commits

Author SHA1 Message Date
ed819e5d99 fix 2025-04-08 02:40:58 +01:00
0d7dee0909 Merge branch 'dev' of http://192.168.18.88:8077/sznyb/daimp-front into dev 2025-04-08 09:28:28 +08:00
0a8586b97e feat 2025-04-08 09:27:53 +08:00
76c9ea7d06 feat:打包环境分类 2025-04-07 10:28:47 +01:00
475c327116 fix:优化 2025-04-07 08:38:37 +01:00
725267388e fix:优化 2025-04-07 07:59:59 +01:00
bf0b232f66 fix:修改投入品删除函数映入路径 2025-04-07 09:19:32 +08:00
fbde781c7c fix 2025-04-03 10:25:49 +01:00
86cacd8316 Merge branch 'dev' of http://192.168.18.88:8077/sznyb/daimp-front into dev 2025-04-03 17:24:08 +08:00
9f09d313ee feat:经销商管理模块完成 2025-04-03 17:23:48 +08:00
lzc
89a2cb8809 样式修改 2025-04-03 17:23:37 +08:00
lzc
3e683f11f3 Merge branch 'dev' of http://192.168.18.88:8077/sznyb/daimp-front into dev 2025-04-03 17:20:52 +08:00
lzc
f1d68543bd 土地交易 2025-04-03 17:20:49 +08:00
008520ac7e 优化 2025-04-03 09:00:49 +01:00
lzc
8fc195de39 Merge branch 'dev' of http://192.168.18.88:8077/sznyb/daimp-front into dev 2025-04-02 17:32:17 +08:00
lzc
33c0c01ff2 采购商服务 2025-04-02 17:32:13 +08:00
b204de0dc7 unit 2025-04-02 10:13:20 +01:00
edf016b1c7 优化 2025-04-02 07:42:19 +01:00
lzc
f637bec8f5 Merge branch 'dev' of http://192.168.18.88:8077/sznyb/daimp-front into dev 2025-04-02 13:46:53 +08:00
lzc
74419b2f97 数据大屏路由404修改和运营平台电商交易 2025-04-02 13:46:49 +08:00
6c013883b3 fix 2025-04-02 02:52:41 +01:00
553b872003 fix:unit 2025-04-02 02:35:01 +01:00
97 changed files with 4562 additions and 738 deletions

View File

@ -3,8 +3,9 @@ VITE_PORT = 9000
VITE_APP_NAME = 'daimp-front-main'
VITE_APP_TITLE = '数字农业产业管理平台'
VITE_APP_SUB_OS = '//localhost:9526/sub-operation-service/'
VITE_APP_SUB_ADMIN = '//localhost:9527/sub-admin/'
VITE_APP_SUB_OA = '//localhost:9527/sub-operation-admin/'
VITE_APP_SUB_GAS = '//localhost:9528/sub-government-affairs-service/'
VITE_APP_SUB_GAA = '//localhost:9525/sub-government-affairs-admin/'
VITE_APP_SUB_GSS = '//localhost:9529/sub-government-screen-service/'
# 接口
VITE_APP_BASE_API = '/apis'

View File

@ -1,12 +1,14 @@
# 正式环境
VITE_APP_NAME = 'daimp-front-main'
VITE_APP_TITLE = '数字农业产业管理平台'
VITE_APP_SUB_OS = '//192.168.18.99:88/sub-operation-service/'
VITE_APP_SUB_ADMIN = '//192.168.18.99:88/sub-admin/'
VITE_APP_SUB_GAS = '//192.168.18.99:88/sub-government-affairs-service/'
VITE_APP_SUB_GSS = '//192.168.18.99:88/sub-government-screen-service/'
VITE_APP_SUB_OS = '//http://47.109.205.240:88/sub-operation-service/'
VITE_APP_SUB_OA = '//http://47.109.205.240:88/sub-operation-admin/'
VITE_APP_SUB_GAS = '//http://47.109.205.240:88/sub-government-affairs-service/'
VITE_APP_SUB_GAA = '//http://47.109.205.240:88/sub-government-affairs-admin/'
VITE_APP_SUB_GSS = '//http://47.109.205.240:88/sub-government-screen-service/'
# 接口
VITE_APP_BASE_API = '/apis'
VITE_APP_BASE_URL = ''
VITE_APP_UPLOAD_API = '/uploadApis'
VITE_APP_UPLOAD_URL = ''

View File

@ -1,10 +1,11 @@
# 开发环境
# 测试环境
VITE_APP_NAME = 'daimp-front-main'
VITE_APP_TITLE = '数字农业产业管理平台'
VITE_APP_SUB_OS = '//localhost:8090/sub-operation-service/'
VITE_APP_SUB_ADMIN = '//localhost:8090/sub-admin/'
VITE_APP_SUB_GAS = '//localhost:8090/sub-government-affairs-service/'
VITE_APP_SUB_GSS = '//localhost:8090/sub-government-screen-service/'
VITE_APP_SUB_OS = '//192.168.18.99:88/sub-operation-service/'
VITE_APP_SUB_OA = '//192.168.18.99:88/sub-operation-admin/'
VITE_APP_SUB_GAS = '//192.168.18.99:88/sub-government-affairs-service/'
VITE_APP_SUB_GAA = '//192.168.18.99:88/sub-government-affairs-admin/'
VITE_APP_SUB_GSS = '//192.168.18.99:88/sub-government-screen-service/'
# 接口
VITE_APP_BASE_API = '/apis'
VITE_APP_BASE_URL = ''

View File

@ -7,6 +7,7 @@
"dev": "vite --mode development",
"build": "vite build --mode production",
"test": "vite build --mode test",
"local": "vite build --mode local",
"preview": "vite preview",
"format": "prettier --write 'src/**/*.{vue,ts,tsx,js,jsx,css,less,scss,json,md}'",
"eslint": "npx eslint --init",

View File

@ -1,7 +1,11 @@
<template>
<el-dropdown popper-class="custom-table-operate">
<el-icon class="custom-table-operate__more"><More /></el-icon>
<template #dropdown>
<el-icon class="custom-table-operate__more">
<template v-if="show">
<More />
</template>
</el-icon>
<template v-if="show" #dropdown>
<el-dropdown-menu v-if="!isEmpty(actions)">
<template v-for="item in actions" :key="item.name">
<el-dropdown-item v-if="onPermission(item)" @click="item.event(data)">
@ -20,6 +24,7 @@ import { isEmpty } from '@/utils';
const props = defineProps({
actions: { type: Array, default: () => [] },
data: { type: Object, default: () => {} },
show: { type: Boolean, default: true },
});
const onPermission = (row) => {

View File

@ -58,7 +58,7 @@ export const rightApps = [
{
name: 'sub-government-screen-service',
entry: VITE_APP_SUB_GSS,
activeRule: '/sub-government-screen-service/',
activeRule: '/sub-government-screen-service',
title: '数据大屏',
icon: 'images/platform/icon-screen.png',
},
@ -75,10 +75,17 @@ export const defaultApps = [
{
name: 'sub-government-screen-service',
entry: VITE_APP_SUB_GSS,
activeRule: '/sub-government-screen-service/',
activeRule: '/sub-government-screen-service',
title: '数据大屏',
icon: 'images/platform/icon-screen.png',
},
{
name: 'sub-operation-service',
entry: VITE_APP_SUB_OS,
activeRule: '/sub-operation-service',
title: '运营服务',
icon: 'images/platform/icon-home.png',
},
];
// export const microApps = [...defaultApps, ...leftApps, ...rightApps];

View File

@ -1,7 +1,7 @@
# 生产环境
VITE_MODE = 'PRO'
VITE_APP_MIAN = 'daimp-front-main'
VITE_APP_MIAN_URL = 'http://192.168.18.99:88'
VITE_APP_MIAN_URL = 'http://47.109.205.240:88'
VITE_APP_NAME = 'sub-government-affairs-service'
# 接口
VITE_APP_BASE_API = '/apis'

View File

@ -7,6 +7,7 @@
"dev": "vite --mode development",
"build": "vite build --mode production",
"test": "vite build --mode test",
"local": "vite build --mode local",
"preview": "vite preview",
"format": "prettier --write 'src/**/*.{vue,ts,tsx,js,jsx,css,less,scss,json,md}'",
"eslint": "npx eslint --init",

View File

@ -2,10 +2,12 @@ import * as redBlackApi from './redAndBlank';
import * as materialApi from './material';
import * as knowledgeApi from './knowledge';
import * as leaseSuperviseApi from './leaseSupervise';
import * as productionDealerApi from './productionDealer';
export default {
...materialApi,
...redBlackApi,
...knowledgeApi,
...leaseSuperviseApi,
...productionDealerApi,
};

View File

@ -92,4 +92,28 @@ export function delSeed(ids) {
return request(`/inputGoods/provenance/delete/${ids}`);
}
// #endregion
//
/* ------ 农机 ------ */
// #region
export function getMachineryList(params) {
return request('/inputGoods/farmMachine/page', {
params,
});
}
export function addMachinery(data) {
return request('/inputGoods/farmMachine/save', {
method: 'POST',
data,
});
}
export function delMachinery(ids) {
return request(`/inputGoods/farmMachine/delete/${ids}`);
}
export function machineryReport(data) {
return request(`/inputGoods/farmMachine/uploadReport`, {
method: 'PUT',
data,
});
}
// #endregion

View File

@ -0,0 +1,23 @@
import request from '@/utils/axios';
export function getProductionDealerList(params) {
return request('/inputGoods/distributor/page', {
params,
});
}
export function addProductionDealer(data) {
return request('/inputGoods/distributor/save', {
method: 'POST',
data,
});
}
export function delProductionDealer(ids) {
return request(`/inputGoods/distributor/delete/${ids}`);
}
export function editProductionDealer(data) {
return request('/inputGoods/distributor/edit', {
method: 'PUT',
data,
});
}

View File

@ -1,6 +1,8 @@
import request from '@/utils/axios';
/* 土地列表 */
/* ------ 土地信息 ------ */
// #region
export function getLandsList(params = {}) {
return request('land-resource/landManage/page', {
method: 'GET',
@ -14,6 +16,7 @@ export function saveLand(data = {}) {
data,
});
}
/* 导出土地 */
export function exportLands(params = {}) {
return request('/land-resource/landManage/export', {
method: 'GET',
@ -21,6 +24,32 @@ export function exportLands(params = {}) {
responseType: 'blob',
});
}
/* 编辑土地 */
export function editLand(data = {}) {
return request('/land-resource/landManage/edit', {
method: 'POST',
data,
});
}
/* 导入土地 */
export function importLands(data) {
return request('land-resource/landManage/import', {
method: 'POST',
data,
Headers: {
'Content-Type': 'multipart/form-data',
},
});
}
/* 删除土地 */
export function delLand(id) {
return request('land-resource/landManage/delete/' + id, {
method: 'DELETE',
});
}
// #endregion
/* 土地列表 */
//年度计划相关
export function getAnnualList(params = {}) {
@ -133,12 +162,6 @@ export function delPlantingStage(params) {
method: 'DELETE',
});
}
/* 删除土地 */
export function delLand(id) {
return request('land-resource/landManage/delete/' + id, {
method: 'DELETE',
});
}
//作业记录相关
export function getOperationRecord(params = {}) {
@ -190,16 +213,6 @@ export function getAddrCropByLand(landId) {
method: 'GET',
});
}
/* 导入土地 */
export function importLands(data) {
return request('land-resource/landManage/import', {
method: 'POST',
data,
Headers: {
'Content-Type': 'multipart/form-data',
},
});
}
//土地巡查相关
export function getlandInspection(params = {}) {

View File

@ -1,61 +0,0 @@
import request from '@/utils/axios';
/**
* @Title: 列表
*/
export function GetEntityList(params = {}) {
return request('/land-resource/annualManage/page', {
method: 'GET',
params,
});
}
/**
* @Title: 新增
*/
export function AddEntity(data = {}) {
return request('/land-resource/annualManage/save', {
method: 'POST',
data,
});
}
/**
* @Title: 修改
*/
export function UpdateEntity(data = {}) {
return request('/land-resource/annualManage/edit', {
method: 'PUT',
data,
});
}
/**
* @Title: 审核
*/
export function AuditEntity(data = {}) {
return request('/land-resource/annualManage/exam', {
method: 'PUT',
data,
});
}
/**
* @Title: 删除
*/
export function DeleteEntity(params = {}) {
return request(`/land-resource/annualManage/delete/${params.id}`, {
method: 'DELETE',
});
}
/**
* @Title: 导出
*/
export function ExportEntity(params = {}) {
return request('/land-resource/annualManage/export', {
method: 'GET',
params,
responseType: 'blob',
});
}

View File

@ -47,7 +47,6 @@ export function GetMenu(dictType) {
}
// 查询菜单下拉树结构
// 返回parentId
export function GetMenuTree() {
return request('/system/menu/treeselect', {
method: 'GET',

View File

@ -1,53 +0,0 @@
import request from '@/utils/axios';
/**
* @Title: 列表
*/
export function GetEntityList(data, params) {
return request('/store/user/query-user', {
method: 'POST',
data: data,
params: params,
});
}
/**
* @Title: 新增
*/
export function AddEntity(data, params = {}) {
return request('/store/user/add-user', {
method: 'POST',
data: data,
params: params,
});
}
/**
* @Title: 修改
*/
export function UpdateEntity(data, params = {}) {
return request('/store/user/update-user', {
method: 'PUT',
data: data,
params: params,
});
}
/**
* @Title: 删除
*/
export function DeleteEntity(data, params) {
return request('/store/user/del-user', {
method: 'DELETE',
data: data,
params: params,
});
}
export function UploadAvatar(data, params) {
return request('/store/self/generate-avatar-pic-upload-url', {
method: 'POST',
data: data,
params: params,
});
}

View File

@ -13,10 +13,11 @@ export const CONSTANTS = {
};
export const CRUD_OPTIONS = {
rowKey: 'id',
index: true,
indexLabel: '序号',
indexWidth: 80,
selection: true,
selection: false,
align: 'center',
headerAlign: 'center',
gridBtn: false,

View File

@ -72,12 +72,12 @@ const inputSuppliesRoutes = [
// component: () => import('@/views/inputSuppliesManage/enterpriseDealerCheck/index.vue'),
// meta: { title: '企业经销商抽检', icon: 'Document' },
// },
// {
// path: '/sub-government-affairs-service/useSupervise',
// name: 'useSupervise',
// component: () => import('@/views/inputSuppliesManage/useSupervise/index.vue'),
// meta: { title: '使用监管', icon: 'Document' },
// },
{
path: '/sub-government-affairs-service/useSupervise',
name: 'useSupervise',
component: () => import('@/views/inputSuppliesManage/useSupervise/index.vue'),
meta: { title: '使用监管', icon: 'Document' },
},
{
path: '/sub-government-affairs-service/leaseSupervise',
name: 'leaseSupervise',

View File

@ -3,7 +3,7 @@
* @Author: zenghua.wang
* @Date: 2022-02-23 21:12:37
* @LastEditors: zenghua.wang
* @LastEditTime: 2025-03-28 14:18:58
* @LastEditTime: 2025-04-02 14:21:56
*/
import lodash from 'lodash';
import dayjs from 'dayjs';
@ -138,12 +138,12 @@ export const setPropDisplay = (column, fields) => {
* @param {*} tree
* @returns
*/
export const flattenTree = (tree) => {
export const flattenTree = (tree, children = 'children') => {
const result = [];
function traverse(node) {
result.push(node);
if (node.children && node.children.length > 0) {
node.children.forEach((child) => traverse(child));
if (node[children] && node[children].length > 0) {
node[children].forEach((child) => traverse(child));
}
}
if (Array.isArray(tree)) {
@ -276,6 +276,7 @@ export const getTree = (data, id = 'id', parentId = 'parentId', children = 'chil
const map = {};
data.forEach((item) => {
item.level = 0;
map[item[id]] = item;
});
@ -283,9 +284,11 @@ export const getTree = (data, id = 'id', parentId = 'parentId', children = 'chil
data.forEach((item) => {
const parent = map[item[parentId]];
if (parent) {
item.level = parent.level + 1;
parent[children] = parent[children] || [];
parent[children].push(item);
} else {
item.level = 0;
tree.push(item);
}
});

View File

@ -30,7 +30,6 @@
<script setup>
import { ref, reactive, onMounted } from 'vue';
import { CRUD_OPTIONS } from '@/config';
import { size } from 'lodash';
onMounted(getData);

View File

@ -0,0 +1,19 @@
import { ElMessage, ElMessageBox } from 'element-plus';
export default class assistFn {
deleteFn(ids = '', _fetch, _callback) {
ElMessageBox.confirm('确定删除该数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
if (!_fetch) return;
let res = await _fetch(ids);
if (res.code == 200) {
ElMessage.success('删除成功');
_callback && _callback();
}
});
}
}
// export

View File

@ -1,6 +1,5 @@
import { ref, onMounted, reactive } from 'vue';
import inputSuppliesApis from '@/apis/inputSuppliesApi';
import { ElMessage, ElMessageBox } from 'element-plus';
const { getMaterailTypes } = inputSuppliesApis;
export function useBasicInfo(set = {}) {
@ -50,8 +49,8 @@ export function useBasicInfo(set = {}) {
materialTypes[moduleType].push(...handleTypes(children));
handleTwoLevel();
});
console.log('materialTypes --- ', materialTypes);
console.log('materialTwoLevel --- ', materialTwoLevel);
// console.log('materialTypes --- ', materialTypes);
// console.log('materialTwoLevel --- ', materialTwoLevel);
}
loadFinish.value = true;
let t = setInterval(() => {
@ -163,19 +162,6 @@ export function useBasicInfo(set = {}) {
});
return _t;
}
function handleDelFn(ids, _fetch, _callback) {
ElMessageBox.confirm('确定删除该数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}).then(async () => {
let res = await _fetch(ids);
if (res.code == 200) {
ElMessage.success('删除成功');
_callback();
}
});
}
// #endregion
onMounted(getmaterialType);
@ -191,6 +177,5 @@ export function useBasicInfo(set = {}) {
filterTypes,
handleShowName,
handleNumUnit,
handleDelFn,
};
}

View File

@ -30,10 +30,27 @@
<template #photoUrl-form="{ type }">
<Attrs v-model:attrs="attrs" :type="type == 'add' ? 'add' : 'view'" :limit="2" />
</template>
<template #checkUnitStamp-form="{ type }">
<section style="display: flex">
<el-input v-model="checkUnitStamp" style="width: 40%"></el-input>
<Attrs v-model:attrs="attrs" style="width: 40%" type="add" :limit="1" />
<template #detectionUnit-form="{ type }">
<section v-if="type == 'edit'" style="display: flex; width: 100%">
<span style="width: calc(50% - 85px); height: 32px">
<el-input v-model="checkUnitStamp" placeholder="请输入 检测单位"></el-input>
</span>
&emsp;
<Attrs v-model:attrs="checkAttrs" style="flex: 1" type="add" :up-btn="checkAttrs < 1" :file-num="2" :limit="1" />
</section>
<section v-if="type == 'view'" style="position: relative">
{{ checkUnitStamp }}
<img :src="checkAttrs[0]?.url ?? ''" alt="" style="position: absolute; bottom: -10px; right: -10px" />
</section>
</template>
<template #viewReport-form>
<section style="text-align: center; line-height: 58px">
<el-button type="primary" @click="handleCheckInfo(true)">查看报告</el-button>
</section>
</template>
<template #closeReport-form="{ type }">
<section v-if="type == 'view'" style="text-align: center; line-height: 58px">
<el-button type="primary" @click="handleCheckInfo()">关闭</el-button>
</section>
</template>
</avue-crud>
@ -46,11 +63,14 @@ import TypeMenu from '../../common/TypeMenu.vue';
import { CRUD_OPTIONS, pageData, customRules } from '@/config';
import { useBasicInfo } from '@/views/inputSuppliesManage/hooks/useBasicInfo';
import Attrs from '@/views/inputSuppliesManage/common/Attrs.vue';
import NumberSelect from '@/views/inputSuppliesManage/common/NumberSelect.vue';
const { defaultGet, loadFinish, materialTypes, goodsUnitOptions, handleNumUnit, handleShowName, targetName } = useBasicInfo({
import inputSuppliesApi from '@/apis/inputSuppliesApi';
import { ElMessage } from 'element-plus';
import assistFn from '@/views/inputSuppliesManage/hooks/useAssistFn';
const { deleteFn } = new assistFn();
const { loadFinish, materialTypes, targetName } = useBasicInfo({
moduleType: '5',
});
const { getMachineryList, addMachinery, delMachinery, machineryReport } = inputSuppliesApi;
const _allTypes = ref([]);
watch(
() => loadFinish.value,
@ -59,7 +79,6 @@ watch(
option.value.column.forEach((v) => {
if (v.prop === '_classifyId') {
_allTypes.value = materialTypes['5'].filter((v, i) => i > 0) ?? [];
console.log('_allTypes', _allTypes.value);
v.dicData = _allTypes.value;
}
});
@ -75,7 +94,7 @@ const _loading = ref(true);
const searchCondition = ref({
keywords: '',
});
const processCustomized = reactive([
const customize = reactive([
{
label: '可定制',
value: '0',
@ -85,46 +104,47 @@ const processCustomized = reactive([
value: '1',
},
]);
const afterSales = reactive([
const afterService = reactive([
{
label: '全国联保',
value: '0',
},
{
label: '国家三包规定',
value: '1',
},
{
label: '品牌官方售后',
label: '国家三包规定',
value: '2',
},
{
label: '上门服务',
label: '品牌官方售后',
value: '3',
},
{
label: '远程技术支持',
label: '上门服务',
value: '4',
},
{
label: '依旧换新',
label: '远程技术支持',
value: '5',
},
{
label: '依旧换新',
value: '6',
},
]);
const subsidy = reactive([
{
label: '有补贴',
value: '0',
value: '1',
},
{
label: '无补贴',
value: '1',
value: '0',
},
]);
const data = ref([{}]);
const option = ref({
...CRUD_OPTIONS,
dialogWidth: '50%',
selection: false,
column: [
{
label: '农机名称',
@ -136,35 +156,41 @@ const option = ref({
editDisplay: false,
},
{
_customKey: 1,
label: '农机名称',
prop: 'animalMedicineName',
prop: 'njName',
rules: customRules({ msg: '请输入农机名称' }),
editDisplay: false,
},
{
_customKey: 1,
label: '品牌',
prop: 'animalMedicineVariety',
prop: 'brand',
rules: customRules({ msg: '请输入品牌' }),
editDisplay: false,
},
{
_customKey: 1,
hide: true,
label: '农机图片',
prop: 'photoUrl',
editDisplay: false,
},
{
_customKey: 1,
prop: 'manufacturer',
label: '厂家',
rules: customRules({ msg: '请输入厂家名称' }),
editDisplay: false,
},
{
_customKey: 1,
prop: 'distributor',
label: '经销商',
editDisplay: false,
},
{
hide: true,
label: '分类',
prop: '_classifyId',
type: 'cascader',
@ -172,22 +198,34 @@ const option = ref({
dicData: [],
rules: customRules({ msg: '请选择分类' }),
editDisplay: false,
viewDisplay: false,
render: ({ row }) => row.classifyName,
},
{
_customKey: 1,
label: '分类',
prop: 'classifyName',
addDisplay: false,
editDisplay: false,
},
{
_customKey: 1,
hide: true,
label: '驱动方式',
prop: 'driveMode',
prop: 'powerType',
editDisplay: false,
},
{
_customKey: 1,
hide: true,
label: '加工定制',
prop: 'processCustomized',
prop: 'customize',
type: 'select',
dicData: processCustomized,
dicData: customize,
editDisplay: false,
},
{
_customKey: 1,
hide: true,
label: '农机补贴',
prop: 'subsidy',
@ -196,45 +234,59 @@ const option = ref({
editDisplay: false,
},
{
hide: true,
label: '售后服务',
prop: 'afterSales',
type: 'select',
dicData: afterSales,
multiple: true,
value: [],
editDisplay: false,
},
{
_customKey: 1,
hide: true,
label: '质保期',
prop: 'expiryDate',
editDisplay: false,
},
{
_customKey: 1,
hide: true,
label: '水分管理',
prop: 'mainCharacteristic',
label: '售后服务',
prop: 'afterService',
type: 'select',
dicData: afterService,
multiple: true,
value: [],
editDisplay: false,
},
{
_customKey: 1,
hide: true,
label: '主要特点',
prop: 'mainFeature',
span: 24,
type: 'textarea',
editDisplay: false,
},
{
_customKey: 1,
hide: true,
label: '病虫害防治',
label: '功能配置',
prop: 'functionConfig',
span: 24,
type: 'textarea',
editDisplay: false,
},
{
_customKey: 1,
hide: true,
label: '注意事项',
prop: 'useRange',
label: '适用范围',
prop: 'adaptScope',
span: 24,
type: 'textarea',
editDisplay: false,
},
{
_customKey: 1,
hide: true,
labelWidth: 0,
prop: 'viewReport',
addDisplay: false,
editDisplay: false,
span: 24,
},
],
group: [
{
@ -245,27 +297,27 @@ const option = ref({
column: [
{
label: '农机型号',
prop: 'specification',
prop: 'njModel',
rules: customRules({ msg: '请输入农机型号' }),
},
{
label: '农机牌照号',
prop: 'specification',
prop: 'licenseNumber',
rules: customRules({ msg: '请输入农机牌照号' }),
},
{
label: '权属人',
prop: 'specification',
prop: 'owner',
rules: customRules({ msg: '请输入权属人' }),
},
{
label: '联系电话',
prop: 'specification',
prop: 'phone',
rules: customRules({ msg: '请输入联系电话' }),
},
{
label: '联系地址',
prop: 'specification',
prop: 'address',
rules: customRules({ msg: '请输入联系地址' }),
},
],
@ -278,31 +330,37 @@ const option = ref({
column: [
{
label: '年检地点',
prop: 'address',
prop: 'detectionAddress',
rules: customRules({ msg: '请输入年检地点' }),
},
{
label: '年检时间',
prop: 'checkDate',
prop: 'detectionTime',
type: 'date',
valueFormat: 'YYYY-MM-DD',
format: 'YYYY-MM-DD',
rules: customRules({ msg: '请输入年检时间' }),
},
{
label: '外观检查',
prop: 'appearanceCheck',
prop: 'inspection',
span: 24,
type: 'textarea',
rules: customRules({ msg: '请输入外观检查' }),
},
{
label: '技术检测',
prop: 'technologyCheck',
prop: 'technicalDetection',
span: 24,
type: 'textarea',
rules: customRules({ msg: '请输入技术检测' }),
},
{
label: '安全装置检查',
prop: 'safetyDeviceCheck',
prop: 'safetyDetector',
span: 24,
type: 'textarea',
rules: customRules({ msg: '请输入安全装置检' }),
},
],
},
@ -314,15 +372,24 @@ const option = ref({
column: [
{
label: '结论',
prop: 'result',
prop: 'conclusion',
rules: customRules({ msg: '请输入结论' }),
},
{
label: '检测员签名',
prop: 'checkPersonSign',
prop: 'signature',
rules: customRules({ msg: '请输入检测员签名' }),
},
{
label: '检测单位盖章',
prop: 'checkUnitStamp',
prop: 'detectionUnit',
span: 24,
rules: customRules({ disabled: true, otherRules: [{ required: true, message: '', validator: handleDetection }] }),
},
{
labelWidth: 0,
label: '',
prop: 'closeReport',
span: 24,
},
],
@ -344,50 +411,117 @@ const actions = reactive([
type: 'danger',
name: '删除',
icon: 'delete',
// event: ({ row }) => handleDelFn(row.id, delPesticide, getData),
event: ({ row }) => deleteFn(row.id, delMachinery, getData),
},
]);
const attrs = ref([]);
const checkUnitStamp = ref('');
const checkAttrs = ref([]);
// #endregion
/* --------------- methods --------------- */
// #region
function getData(reset) {
function handleDetection(rule, value, callback) {
if (!checkUnitStamp.value || !checkAttrs.value.length) {
callback(new Error());
} else {
callback();
}
}
async function getData(reset) {
_loading.value = true;
reset == 1 && (pageData.value.currentPage = 1);
let params = {
current: pageData.value.currentPage,
size: pageData.value.size,
animalName: searchCondition.value.keywords,
njName: searchCondition.value.keywords,
};
console.log('getData', params);
_type.value != '0' && (params.classifyId = _type.value);
let res = await getMachineryList(params);
_loading.value = false;
if (res.code == 200) {
data.value = res.data.records;
pageData.value.total = res.data.total;
}
}
function handleCheck(row) {
handleAttrs(row);
handleOtherInfo(row);
handleReportSpan(24);
crudRef.value.rowEdit(row);
}
function handleInfo(row) {
handleAttrs(row);
handleSpanChange(true);
handleOtherInfo(row);
crudRef.value.rowView(row);
}
function handleRowUpdate(row, index, done, loading) {
console.log('update', row);
async function handleRowUpdate(form, index, done, loading) {
let data = {
id: form.id,
njModel: form.njModel,
licenseNumber: form.licenseNumber,
owner: form.owner,
phone: form.phone,
address: form.address,
detectionAddress: form.detectionAddress,
detectionTime: form.detectionTime,
inspection: form.inspection,
technicalDetection: form.technicalDetection,
safetyDetector: form.safetyDetector,
conclusion: form.conclusion,
signature: form.signature,
detectionUnit: checkUnitStamp.value,
sealUrl: checkAttrs.value[0].url,
};
let res = await machineryReport(data);
loading();
// done();
if (res.code == 200) {
ElMessage.success('报告上传成功');
done();
}
function handleRowSave(row, done, loading) {
console.log('save', row);
}
async function handleRowSave(form, done, loading) {
let data = {
njName: form.njName,
brand: form.brand,
photoUrl: attrs.value.map((v) => v.url).join(','),
powerType: form.powerType,
manufacturer: form.manufacturer,
distributor: form.distributor,
customize: form.customize,
afterService: form.afterService.join(),
expiryDate: form.expiryDate,
subsidy: form.subsidy,
mainFeature: form.mainFeature,
functionConfig: form.functionConfig,
adaptScope: form.adaptScope,
};
data.classifyId = JSON.stringify(form._classifyId);
data.classifyName = targetName(_allTypes.value, form._classifyId, '');
let res = await addMachinery(data);
loading();
if (res.code == 200) {
ElMessage.success('新增成功');
getData();
clearAttrs();
done();
}
}
function handleCheckInfo(open = false) {
option.value.column.forEach((v) => {
if (v._customKey == 1) v.viewDisplay = !open;
});
option.value.group.forEach((v) => {
v.viewDisplay = open;
});
}
/* 处理展示附件 */
function handleAttrs(row = {}) {
function handleOtherInfo(row = {}) {
if (!row) {
return;
}
checkUnitStamp.value = row.detectionUnit;
if (row.photoUrl) {
attrs.value = row.photoUrl.split(',').map((v, i) => {
return {
@ -396,11 +530,36 @@ function handleAttrs(row = {}) {
};
});
}
if (row.sealUrl) {
checkAttrs.value = [
{
url: row.sealUrl,
uid: `seal_${Date.now()}`,
},
];
}
}
function clearAttrs() {
attrs.value = [];
handleReportSpan(12);
}
function handleCloseDialog(done) {
attrs.value = [];
done();
}
function handleSpanChange(bol = false) {
let arr1 = ['photoUrl', 'afterService'];
option.value.column.forEach((v) => {
if (arr1.includes(v.prop)) {
if (bol) v.span = 24;
else delete v.span;
}
});
}
function handleReportSpan(s = 12) {
option.value.group[2].column[0].span = s;
option.value.group[2].column[1].span = s;
}
// #endregion
</script>

View File

@ -25,7 +25,7 @@
>
<template #menu="{ row }">
<el-button type="primary" @click="handleInfo(row)">详情</el-button>
<el-button @click="handleDelFn(row.id, delFretilize, getData)">删除</el-button>
<el-button @click="deleteFn(row.id, delFretilize, getData)">删除</el-button>
</template>
<template #photoUrl-form="{ type }">
<Attrs v-model:attrs="attrs" :type="type == 'add' ? 'add' : 'view'" :limit="2" />
@ -51,10 +51,11 @@ import inputSuppliesApi from '@/apis/inputSuppliesApi';
import Attrs from '@/views/inputSuppliesManage/common/Attrs.vue';
import NumberSelect from '@/views/inputSuppliesManage/common/NumberSelect.vue';
import { ElMessage } from 'element-plus';
import assistFn from '@/views/inputSuppliesManage/hooks/useAssistFn';
const { deleteFn } = new assistFn();
const { getFertilizreList, addFertilizer, delFretilize } = inputSuppliesApi;
const { loadFinish, materialTypes, materialTwoLevel, targetName, goodsUnitOptions, useDosageUnit, handleShowName, handleNumUnit, handleDelFn } =
useBasicInfo();
const { loadFinish, materialTypes, materialTwoLevel, targetName, goodsUnitOptions, useDosageUnit, handleShowName, handleNumUnit } = useBasicInfo();
onMounted(getData);
watch(

View File

@ -1,19 +0,0 @@
<template>
<section class="custom-page"> 物资信息 </section>
</template>
<script setup>
import { ref } from 'vue';
/* --------------- data --------------- */
// #region
// #endregion
/* --------------- methods --------------- */
// #region
// #endregion
</script>
<style lang="scss" scoped></style>

View File

@ -64,19 +64,11 @@ import Attrs from '@/views/inputSuppliesManage/common/Attrs.vue';
import NumberSelect from '@/views/inputSuppliesManage/common/NumberSelect.vue';
import inputSuppliesApi from '@/apis/inputSuppliesApi';
import { ElMessage, ElMessageBox } from 'element-plus';
import assistFn from '@/views/inputSuppliesManage/hooks/useAssistFn';
const { deleteFn } = new assistFn();
const {
defaultGet,
loadFinish,
materialTypes,
materialTwoLevel,
goodsUnitOptions,
useDosageUnit,
handleNumUnit,
handleShowName,
targetName,
handleDelFn,
} = useBasicInfo({
const { defaultGet, loadFinish, materialTypes, materialTwoLevel, goodsUnitOptions, useDosageUnit, handleNumUnit, handleShowName, targetName } =
useBasicInfo({
moduleType: '1',
});
const { getPesticideList, addPesticide, pesticideReportSave, delPesticide } = inputSuppliesApi;
@ -442,7 +434,7 @@ const actions = ref([
type: 'danger',
name: '删除',
icon: 'delete',
event: ({ row }) => handleDelFn(row.id, delPesticide, getData),
event: ({ row }) => deleteFn(row.id, delPesticide, getData),
},
]);
// #endregion

View File

@ -25,7 +25,7 @@
>
<template #menu="{ row }">
<el-button type="primary" @click="handleInfo(row)">详情</el-button>
<el-button @click="handleDelFn(row.id, delAnimalMedicine, getData)">删除</el-button>
<el-button @click="deleteFn(row.id, delAnimalMedicine, getData)">删除</el-button>
</template>
<template #photoUrl-form="{ type }">
<Attrs v-model:attrs="attrs" :type="type == 'add' ? 'add' : 'view'" :limit="2" />
@ -47,9 +47,10 @@ import Attrs from '@/views/inputSuppliesManage/common/Attrs.vue';
import NumberSelect from '@/views/inputSuppliesManage/common/NumberSelect.vue';
import inputSuppliesApi from '@/apis/inputSuppliesApi';
import { ElMessage } from 'element-plus';
import assistFn from '@/views/inputSuppliesManage/hooks/useAssistFn';
const { deleteFn } = new assistFn();
const { defaultGet, loadFinish, materialTypes, materialTwoLevel, goodsUnitOptions, handleNumUnit, handleShowName, targetName, handleDelFn } =
useBasicInfo();
const { defaultGet, loadFinish, materialTypes, materialTwoLevel, goodsUnitOptions, handleNumUnit, handleShowName, targetName } = useBasicInfo();
const { getAnimalMedicineList, addAnimalMedicine, delAnimalMedicine } = inputSuppliesApi;
/* --------------- data --------------- */

View File

@ -25,7 +25,7 @@
>
<template #menu="{ row }">
<el-button type="primary" @click="handleInfo(row)">详情</el-button>
<el-button @click="handleDelFn(row.id, delSeed, getData)">删除</el-button>
<el-button @click="deleteFn(row.id, delSeed, getData)">删除</el-button>
</template>
<template #photoUrl-form="{ type }"> <Attrs v-model:attrs="attrs" :type="type == 'add' ? 'add' : 'view'" :limit="2" /> </template>
</avue-crud>
@ -40,9 +40,10 @@ import { useBasicInfo } from '@/views/inputSuppliesManage/hooks/useBasicInfo';
import Attrs from '@/views/inputSuppliesManage/common/Attrs.vue';
import inputSuppliesapi from '@/apis/inputSuppliesApi';
import { ElMessage } from 'element-plus';
import assistFn from '@/views/inputSuppliesManage/hooks/useAssistFn';
const { deleteFn } = new assistFn();
const { getSeedList, seedSave, delSeed } = inputSuppliesapi;
const { loadFinish, materialTypes, targetName, handleDelFn } = useBasicInfo({
const { loadFinish, materialTypes, targetName } = useBasicInfo({
moduleType: '4',
});
const _allTypes = ref([]);

View File

@ -7,39 +7,72 @@
:table-loading="_loading"
:data="data"
:option="option"
></avue-crud>
:before-close="
(done) => {
handOtherInfo({}, true);
done();
}
"
@search-change="
(form, done) => {
getData(1);
done();
}
"
@search-reset="getData"
@refresh-change="getData"
@current-change="getData"
@size-change="getData(1)"
@row-save="handleRowSave"
@row-update="handleRowUpdate"
>
<template #businessLicense-form="{ type }">
<Attrs v-model:attrs="attrs1" :type="type" />
</template>
<template #productLicense-form="{ type }">
<Attrs v-model:attrs="attrs2" :type="type" />
</template>
<template #registerCertificate-form="{ type }">
<Attrs v-model:attrs="attrs3" :type="type" />
</template>
<template #menu="scope">
<custom-table-operate :actions="actions" :data="scope" />
</template>
</avue-crud>
</section>
</template>
<script setup>
import { ref, onMounted } from 'vue';
import { CRUD_OPTIONS, pageData } from '@/config';
import { ref, onMounted, reactive, render } from 'vue';
import { CRUD_OPTIONS, pageData, customRules } from '@/config';
import inputSuppliesApi from '@/apis/inputSuppliesApi';
import Attrs from '../common/Attrs.vue';
import { ElMessage } from 'element-plus';
import assistFn from '../hooks/useAssistFn';
const { getProductionDealerList, addProductionDealer, delProductionDealer, editProductionDealer } = inputSuppliesApi;
const { deleteFn } = new assistFn();
onMounted(() => {
minitor.value?.currentUav?.videoUrl[0] ?? false;
console.log('test', minitor.value?.currentUav?.videoUrl[0] ?? false);
});
onMounted(getData);
/* --------------- data --------------- */
// #region
const crudRef = ref(null);
const _loading = ref(false);
const dealerTypes = reactive([
{ label: '农药生产经销商', value: '1' },
{ label: '肥料生产经销商', value: '2' },
{ label: '兽药生产经销商', value: '3' },
{ label: '种源生产经销商', value: '4' },
{ label: '农机生产经销商', value: '5' },
]);
const searchCondition = ref({
_dealerType: '',
keywords: '',
});
let minitor = ref({
currentUav: { videoUrl: ['12312'] },
});
const data = ref([{}]);
const option = ref({
const option = reactive({
...CRUD_OPTIONS,
dialogWidth: '50%',
column: [
{
hide: true,
search: true,
label: '经销商名称',
prop: 'keywords',
searchLabelWidth: 120,
},
{
hide: true,
search: true,
@ -47,30 +80,335 @@ const option = ref({
prop: '_dealerType',
searchLabelWidth: 120,
type: 'select',
dicData: [
{ label: '农药生产经销商', value: '1' },
{ label: '肥料生产经销商', value: '2' },
{ label: '兽药生产经销商', value: '3' },
{ label: '种源生产经销商', value: '4' },
{ label: '农机生产经销商', value: '5' },
],
dicData: dealerTypes,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
},
{
search: true,
label: '经销商名称',
prop: 'dealerName',
prop: 'keywords',
searchLabelWidth: 120,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
render: ({ row }) => row.companyName,
},
{
label: '经销商类型',
prop: 'dealerType',
prop: 'text1',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
render: ({ row }) => dealerTypes.find((v) => v.value == row.dataType)?.label ?? '',
},
{
label: '地址',
prop: 'text2',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
render: ({ row }) => row.address,
},
{
label: '证件资料',
prop: 'text3',
width: 280,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
render: ({ row }) => handleText3(row.dataType),
},
{
label: '信息录入时间',
prop: 'text4',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
render: ({ row }) => row.createTime || '',
},
{
label: '信息更新时间',
prop: 'text5',
addDisplay: false,
editDisplay: false,
viewDisplay: false,
render: ({ row }) => row.updateTime || '',
},
],
group: [
{
label: '企业信息',
prop: 'dealerInfo',
column: [
{
label: '企业类型',
type: 'select',
prop: 'dataType',
dicData: dealerTypes,
value: '1',
clearable: false,
change: (val) => handleShowColumn(val.value),
},
{
label: '企业名称',
prop: 'companyName',
rules: customRules({ msg: '请输入企业名称' }),
},
{
label: '地址',
prop: 'address',
rules: customRules({ msg: '请输入地址' }),
},
{
label: '负责人',
prop: 'chargePerson',
rules: customRules({ msg: '请输入负责人' }),
},
{
label: '联系方式',
prop: 'phone',
rules: customRules({ msg: '请输入联系方式' }),
},
{
label: '经营产品',
prop: 'operateProduct',
rules: customRules({ msg: '请输入经营产品' }),
},
{
label: '营业执照',
prop: 'businessLicense',
rules: [
{
required: true,
message: '请上传营业执照',
trigger: ['change', 'blur'],
validator: (rule, value, callback) => {
if (attrs1.value.length === 0) {
callback(new Error());
} else {
callback();
}
},
},
],
},
{
label: '生产许可证',
prop: 'productLicense',
rules: [
{
required: true,
message: '请上传生产许可证',
trigger: ['change', 'blur'],
validator: (rule, value, callback) => {
if (attrs2.value.length === 0) {
callback(new Error());
} else {
callback();
}
},
},
],
},
{
label: '登记证',
prop: 'registerCertificate',
rules: [
{
required: true,
message: '请上传登记证',
trigger: ['change', 'blur'],
validator: (rule, value, callback) => {
if (attrs3.value.length === 0) {
callback(new Error());
} else {
callback();
}
},
},
],
},
],
},
{
label: '巡查信息',
prop: 'checkInfo',
column: [
{
label: '单位',
prop: 'unit',
rules: customRules({ msg: '请输入巡查单位' }),
},
{
label: '部门',
prop: 'dept',
rules: customRules({ msg: '请输入巡查部门' }),
},
{
label: '巡查人',
prop: 'inspector',
rules: customRules({ msg: '请输入巡查人' }),
},
{
label: '巡查时间',
prop: 'inspectTime',
type: 'date',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
rules: customRules({ msg: '请输入巡查时间' }),
},
{
label: '巡查事件',
prop: 'inspectIncident',
rules: customRules({ msg: '请输入巡查事件' }),
},
{
label: '产品是否违规',
prop: 'isViolation',
type: 'select',
dicData: [
{ label: '否', value: '0' },
{ label: '是', value: '1' },
],
value: '0',
rules: customRules({ msg: '请选择' }),
},
{
label: '备注',
prop: 'remark',
type: 'textarea',
span: 24,
rules: customRules({ msg: '请输入备注' }),
},
],
},
],
});
const actions = reactive([
{
name: '编辑',
icon: 'edit',
event: ({ row }) => {
handOtherInfo(row);
crudRef.value.rowEdit(row);
},
},
{
name: '详情',
icon: 'view',
event: ({ row }) => {
handOtherInfo(row);
crudRef.value.rowView(row);
},
},
{
name: '删除',
icon: 'delete',
event: ({ row }) => {
deleteFn(row.id, delProductionDealer, getData);
},
},
]);
const text3Names = reactive({
1: '农药登记证',
2: '肥料登记证',
3: '兽药GMP证书',
5: '3C认证证书',
});
const attrs1 = ref([]);
const attrs2 = ref([]);
const attrs3 = ref([]);
// #endregion
/* --------------- methods --------------- */
// #region
function handleShowColumn(t = '1') {
option.group[0].column[8].addDisplay = t != '4';
option.group[0].column[8].label = text3Names[t];
}
async function getData(reset) {
_loading.value = true;
reset == 1 && (pageData.value.currentPage = 1);
let params = {
current: pageData.value.currentPage,
size: pageData.value.size,
companyName: searchCondition.value.keywords,
dataType: searchCondition.value._dealerType,
};
let res = await getProductionDealerList(params);
if (res.code == 200) {
data.value = res.data.records;
pageData.value.total = res.data.total;
}
_loading.value = false;
}
function handleData(row) {
let arr = ['text1', 'text2', 'text3', 'text4', 'text5', 'keywords', '_dealerType', 'createTime', 'updateTime'];
let data = Object.assign({}, row);
arr.forEach((v) => {
delete data[v];
});
data.businessLicense = attrs1.value.map((v) => v.url).join();
data.productLicense = attrs2.value.map((v) => v.url).join();
data.registerCertificate = attrs3.value.map((v) => v.url).join();
return data;
}
function handOtherInfo(row, reset = false) {
if (reset) {
attrs1.value = [];
attrs2.value = [];
attrs3.value = [];
return;
}
attrs1.value = row.businessLicense
? row.businessLicense.split(',').map((v, i) => {
return {
url: v,
uid: `businessLicense_${i}_${Date.now()}`,
};
})
: [];
attrs2.value = row.productLicense
? row.productLicense.split(',').map((v, i) => {
return {
url: v,
uid: `productLicense_${i}_${Date.now()}`,
};
})
: [];
attrs3.value = row.registerCertificate
? row.registerCertificate.split(',').map((v, i) => {
return {
url: v,
uid: `registerCertificate_${i}_${Date.now()}`,
};
})
: [];
}
async function handleRowSave(row, done, loading) {
let res = await addProductionDealer(handleData(row));
loading();
if (res.code == 200) {
ElMessage.success('保存成功');
getData();
done();
}
}
async function handleRowUpdate(row, index, done, loading) {
let res = await editProductionDealer(handleData(row));
loading();
if (res.code == 200) {
ElMessage.success('修改成功');
getData();
done();
}
}
function handleText3(t = '1') {
let s = '营业执照、生产许可证';
if (t != '4') s += `${text3Names[t]}`;
return s;
}
// #endregion
</script>
<style lang="scss" scoped></style>

View File

@ -1,18 +1,198 @@
<template>
<section class="custom-page">使用监管 </section>
<section class="custom-page">
<avue-crud
ref="crudRef"
v-model:search="searchCondition"
v-model:page="pageData"
:table-loading="_loading"
:option="option"
:data="data"
@search-change="
(form, done) => {
getData(1);
done();
}
"
@search-reset="getData(1)"
@refresh-change="getData"
@current-change="getData"
@size-change="getData(1)"
@row-save="handleRowSave"
@row-update="handleRowUpdate"
>
<template #land-form="{ type }">
<section if="type == 'add'">地块</section>
</template>
</avue-crud>
</section>
</template>
<script setup>
import { ref } from 'vue';
import { reactive, ref, watch } from 'vue';
import { CRUD_OPTIONS, pageData } from '@/config';
import { useBasicInfo } from '@/views/inputSuppliesManage/hooks/useBasicInfo';
const { loadFinish, materialTwoLevel, materialTypes } = useBasicInfo();
watch(
() => loadFinish.value,
(bol) => {
if (loadFinish.value) {
console.log('material', materialTypes);
}
}
);
/* --------------- data --------------- */
// #region
const crudRef = ref(null);
const _loading = ref(true);
const searchCondition = ref({
searchType: '',
keywords: '',
});
const types = reactive([
{ label: '农药监管', value: '1' },
{ label: '肥料监管', value: '2' },
{ label: '兽药监管', value: '3' },
]);
const data = ref([{}]);
const option = ref({
...CRUD_OPTIONS,
selection: false,
dialogWidth: '50%',
column: [
{
hide: true,
search: true,
addDisplay: false,
editDisplay: false,
label: '物资类型',
prop: 'searchType',
type: 'select',
dicData: types,
},
{
hide: true,
search: true,
addDisplay: false,
editDisplay: false,
label: '关键字',
prop: 'keywords',
},
{
editDisabled: true,
label: '物资类型',
prop: 'dataType',
type: 'select',
dicData: types,
clearable: false,
value: '1',
change: handleTypeChange,
},
{
label: '姓名',
prop: 'name',
},
{
label: '联系方式',
prop: 'phone',
},
{
label: '投入品名称',
prop: 'materialName',
},
{
label: '分类',
prop: 'type',
type: 'cascader',
dicData: [],
},
{
label: '购买量',
prop: 't1',
},
{
label: '购买时间',
prop: 't2',
},
{
label: '使用量',
prop: 't3',
},
{
label: '使用时间',
prop: 't4',
},
{
label: '使用对象',
prop: 't5',
},
{
label: '关联地块',
prop: 'land',
},
],
group: [
{
label: '农药检测',
prop: 'pesticide',
// addDisplay: false,
// editDisplay: false,
column: [
{
label: '检测时间',
prop: 'checkTime',
span: 24,
type: 'date',
valueFormat: 'yyyy-MM-dd',
format: 'yyyy-MM-dd',
},
{
label: '检测结果',
prop: 'result',
span: 24,
},
{
label: '投入品名称',
prop: 'unit',
span: 24,
},
{
label: '检测报告',
prop: 'report',
span: 24,
},
],
},
],
});
// #endregion
/* --------------- methods --------------- */
// #region
function getData(reset = 1) {
reset == 1 && (pageData.value.currentPage = 1);
console.log('get data');
}
function handleTypeChange(val) {
console.log(
'dicData',
materialTypes[val.value].filter((v) => v.value != '0')
);
option.value.column[6].dicData = materialTypes[val.value].filter((v) => v.value != '0');
}
function handleData(val) {
console.log('handleData', val);
}
function handleRowSave(row, done, laoding) {
handleData(row);
laoding();
}
function handleRowUpdate(row, index, done, loading) {
handleData(row);
loading();
}
// #endregion
</script>

View File

@ -1,24 +1,31 @@
<template>
<section class="custom-page">
<el-radio-group v-model="landType" class="lands_types" style="margin-bottom: 30px" @change="getList()">
<el-radio-button v-for="item in landsType" :key="'landsType_' + item.value" :value="item.value">
{{ item.label }}
</el-radio-button>
</el-radio-group>
<avue-crud
ref="crudRef"
v-model:page="pageData"
v-model:search="searchData"
v-model:search="searchCondition"
class="custon_create_land_"
:data="data"
:option="option"
:before-close="handleCloseFrom"
:table-loading="loading"
@current-change="handlePageChange"
@refresh-change="getList()"
@current-change="getList()"
@size-change="handleSizeChange"
@search-reset="handleResetSearch"
@search-change="handleSearch"
@search-reset="
() => {
resetLandType();
getList(1);
}
"
@search-change="
(form, done) => {
getList(1);
done();
}
"
@row-save="handleRowSave"
@row-update="handleRowUpdate"
>
<template #landTransfer="{ row }">
{{ row.landTransfer == '1' ? '是' : '否' }}
@ -30,19 +37,11 @@
<el-button type="success" icon="download" @click="handleExport">导出</el-button>
<el-button type="success" icon="upload" @click="onUpload">导入</el-button>
</template>
<!-- <template #menu="{ row }">
<el-button type="info" link @click="handleView(row)">查看</el-button>
<el-popconfirm title="确定删除该土地?" @confirm="() => handleDelete(row.id)">
<template #reference>
<el-button type="danger" link>删除</el-button>
</template>
</el-popconfirm>
</template> -->
<template #area-form>
<section class="area_form_">
<el-input-number v-model="landArea" :precision="2" :step="1" :min="1" controls-position="right"></el-input-number>
<el-select v-model="unitValue">
<el-option v-for="item in unitOptions" :key="'unitOptions_' + item.value" :label="item.label" :value="item.value" />
<el-option v-for="item in unitOptions" :key="'unitOptions_' + item.value" :label="item.label" :value="item.label" />
</el-select>
</section>
</template>
@ -63,7 +62,6 @@
<custom-table-operate :actions="option.actions" :data="scope" />
</template>
</avue-crud>
<custom-import-excel
ref="importExcelRef"
:template-url="getAssetsFile('template/土地模版表.xlsx')"
@ -74,11 +72,11 @@
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue';
import { ref, reactive, onMounted, watch } from 'vue';
import { CRUD_OPTIONS } from '@/config';
import { useUserStore } from '@/store/modules/user';
import { getLandsList, exportLands, delLand, saveLand, importLands } from '@/apis/land.js';
import { getLandTypeTree } from '@/apis/baseInfo';
import { getLandsList, exportLands, delLand, saveLand, importLands, editLand } from '@/apis/land.js';
import { getRegion } from '@/apis';
import { ElMessage } from 'element-plus';
import useLandHook from './useLandHook';
import Attrs from './common/Attrs.vue';
@ -86,27 +84,27 @@ import { getAssetsFile, downloadFile } from '@/utils';
import { useApp } from '@/hooks';
const app = useApp();
const { landType, landsType } = useLandHook();
const { loadFinish, resetLandType, searchCondition, unitOptions, unitValue, landTreeDic } = useLandHook();
const { VITE_APP_BASE_API } = import.meta.env;
const UserStore = useUserStore();
onMounted(() => {
watch(
() => loadFinish.value,
() => {
if (loadFinish.value == 2) {
getList();
getLandTree();
});
handleGetRegion();
}
}
);
const params = ref({
zoom: 10,
});
const local_ = ref([102.833669, 24.88149, '昆明市']);
const local = ref(JSON.parse(JSON.stringify(local_.value)));
const landTreeDic = ref([]);
const landArea = ref(1);
const unitValue = ref('0');
const unitOptions = reactive([
{ label: '平方米', value: '0' },
{ label: '亩', value: '1' },
{ label: '公顷', value: '2' },
]);
/* --------------- data --------------- */
// #region
const loading = ref(false);
@ -122,6 +120,19 @@ const option = reactive({
menuWidth: 120,
selection: false,
column: [
{
hide: true,
label: '用地分类',
prop: 'landType',
search: true,
type: 'cascader',
dicData: landTreeDic,
clearable: false,
value: [],
addDisplay: false,
display: false,
editDisplay: false,
},
{
label: '地块名',
prop: 'landName',
@ -129,6 +140,7 @@ const option = reactive({
addDisplay: false,
display: false,
editDisplay: false,
width: 200,
},
{
label: '地址',
@ -136,6 +148,7 @@ const option = reactive({
addDisplay: false,
display: false,
editDisplay: false,
width: 300,
},
{
label: '产权人',
@ -162,6 +175,7 @@ const option = reactive({
addDisplay: false,
display: false,
editDisplay: false,
width: 300,
},
{
label: '面积',
@ -172,7 +186,7 @@ const option = reactive({
render: ({ row }) => {
let s = '';
if (row.area && row.landUnit) {
s = row.area + unitOptions.find((v) => v.value == row.landUnit).label;
s = row.area + row.landUnit;
}
return s;
},
@ -183,6 +197,7 @@ const option = reactive({
addDisplay: false,
display: false,
editDisplay: false,
width: 300,
},
{
label: '是否流转土地',
@ -190,6 +205,7 @@ const option = reactive({
addDisplay: false,
display: false,
editDisplay: false,
width: 140,
},
{
label: '产权编号',
@ -200,13 +216,9 @@ const option = reactive({
},
{
label: '土壤类型',
prop: 'soilType',
prop: 'soilTypeName',
addDisplay: false,
display: false,
editDisplay: false,
render: ({ row }) => {
return row.soilType;
},
},
{
label: '是否上传附件',
@ -214,6 +226,7 @@ const option = reactive({
addDisplay: false,
display: false,
editDisplay: false,
width: 140,
},
],
group: [
@ -245,11 +258,10 @@ const option = reactive({
value: 'id',
label: 'gridName',
},
dicMethod: 'get',
dicHeaders: {
authorization: UserStore.token,
},
dicFormatter: (res) => res?.data?.records ?? [],
dicFormatter: handleGetGrid,
rules: [
{
required: true,
@ -259,7 +271,7 @@ const option = reactive({
],
},
{
label: '用地分类',
label: '用地分类1',
prop: 'landTypeId',
type: 'cascader',
dicData: landTreeDic,
@ -276,22 +288,17 @@ const option = reactive({
label: '用地分类',
prop: 'landClassificationType',
addDisplay: false,
editDisplay: false,
},
{
label: '位置',
prop: 'villageCode',
prop: '_villageCode',
type: 'cascader',
props: {
label: 'areaName',
value: 'areaCode',
children: 'areaChildVOS',
},
dicUrl: `${VITE_APP_BASE_API}/system/area/region?areaCode=530000`,
dicHeaders: {
authorization: UserStore.token,
},
dicFormatter: (res) => res.data ?? [],
// change: (o) => setCityChange(o),
rules: [
{
required: true,
@ -317,9 +324,10 @@ const option = reactive({
],
},
{
label: '是否土地流转1',
label: '是否土地流转',
prop: 'isTransferView',
addDisplay: false,
editDisplay: false,
},
{
label: '面积',
@ -348,11 +356,6 @@ const option = reactive({
label: 'soilType',
},
},
{
label: '土壤类型',
prop: 'soilType',
addDisplay: false,
},
],
},
{
@ -426,11 +429,11 @@ const option = reactive({
icon: 'view',
event: ({ row }) => handleView(row),
},
// {
// name: '',
// icon: 'edit',
// event: ({ row }) => rowEdit(row),
// },
{
name: '编辑',
icon: 'edit',
event: ({ row }) => rowEdit(row),
},
{
type: 'danger',
name: '删除',
@ -439,74 +442,79 @@ const option = reactive({
},
],
});
const searchData = reactive({
landName: '',
gridName: '',
owner: '',
});
const attrs = ref([]);
const landOwnerAttrs = ref([]);
const landAttrs = ref([]);
const rowData = ref([]);
const importExcelRef = ref();
const regionData = ref([]);
// #endregion
/* --------------- methods --------------- */
// #region
async function getList() {
async function getList(reset = 1) {
reset == 1 && (pageData.value.currentPage = 1);
loading.value = true;
const params = {
let params = Object.assign(
{},
{
current: pageData.value.currentPage,
size: pageData.value.pageSize,
landType: landType.value,
...searchData,
};
...searchCondition.value,
}
);
params.landType = searchCondition.value.landType[searchCondition.value.landType.length - 1];
let res = await getLandsList(params);
loading.value = false;
if (res.code == 200) {
const { total, records } = res.data;
data.value = records;
data.value.forEach((v) => {
v.isTransfer = v.landTransfer || 1;
v.isTransferView = v.landTransfer == 1 ? '否' : '是';
v.isTransfer = v.landTransfer || '1';
v.isTransferView = v.landTransfer == '1' ? '否' : '是';
v.coordinateView = v.coordinate;
v.soilTypeName = v.soilType;
v.soilTypeId = v.soilId;
v._villageCode = handleArea(v);
v.landTypeId = [v.pid, v.landType];
console.log('vvv', v);
});
pageData.value.total = total;
}
}
function handlePageChange(val) {
pageData.value.currentPage = val;
getList();
function handleGetGrid(res) {
console.log('res', res);
return res.records ?? [];
}
async function handleGetRegion() {
let res = await getRegion();
if (res.code == 200) {
option.group[0].column[5];
}
console.log('region', res);
}
function handleArea(v) {
const { provinceCode, cityCode, county, townCode, villageCode } = v;
let _area = [provinceCode, cityCode, county, townCode, villageCode];
let _arr = [];
for (let i = 0; i < _area.length; i++) {
if (!_area[i]) return;
_arr.push(_area[i]);
}
return _arr;
}
function handleSizeChange(val) {
pageData.value.pageSize = val;
getList();
}
async function handleSearch(form, done) {
for (let key in form) {
searchData[key] = form[key];
}
await getList();
done();
}
async function handleResetSearch() {
for (let key in searchData) {
searchData[key] = '';
}
pageData.value.currentPage = 1;
pageData.value.pageSize = 10;
pageData.value.total = 0;
await getList();
}
const attrNames = reactive(landsType.map((v) => v.label));
async function handleExport() {
let res = await exportLands({
landType: landType.value,
landType: searchCondition.value.landType[searchCondition.value.landType.length - 1],
});
if (res) {
let a = document.createElement('a');
a.download = attrNames.value[Number(landType.value)] + '.xlsx';
a.download = 'test.xlsx';
let blob = new Blob([res.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
let link = window.URL.createObjectURL(blob);
@ -539,34 +547,8 @@ function handleDelete(id) {
.catch(() => {});
}
function handleView(obj) {
handleOtherInfo(obj);
rowData.value = obj;
if (obj.propertyCertificateUrl) {
attrs.value = obj.propertyCertificateUrl.split(',').map((v, i) => {
return {
name: `产权附件_${i}`,
url: v,
uid: 'id_' + Date.now(),
};
});
}
if (obj.landCertificateUrl) {
landOwnerAttrs.value = obj.landCertificateUrl.split(',').map((v, i) => {
return {
name: `使用信息附件_${i}`,
url: v,
uid: 'id_' + Date.now(),
};
});
if (obj.landUrl) {
landAttrs.value = obj.landUrl.split(',').map((v, i) => {
return {
name: `位置附件_${i}`,
url: v,
uid: 'id_' + Date.now(),
};
});
}
}
crudRef.value.rowView(obj);
}
function handleCloseFrom(done) {
@ -574,14 +556,14 @@ function handleCloseFrom(done) {
attrs.value = [];
landAttrs.value = [];
landArea.value = 1;
unitValue.value = '0';
unitValue.value = unitOptions[0].label || '';
local.value = JSON.parse(JSON.stringify(local_.value));
done();
}
async function handleRowSave(val, done, loading) {
function handleData(val) {
let data = JSON.parse(JSON.stringify(val));
data.isDraftsSave = 0;
data.landType = landType.value;
data.landType = searchCondition.value.landType[searchCondition.value.landType.length - 1];
let urls = [];
let landOwnerUrls = [];
let landUrls = [];
@ -599,11 +581,21 @@ async function handleRowSave(val, done, loading) {
data.propertyCertificateUrl = urls.join();
data.landCertificateUrl = landOwnerUrls.join();
data.landUrl = landUrls.join();
data.villageCode = data.villageCode[data.villageCode.length - 1] || '';
data.villageCode = data._villageCode[data._villageCode.length - 1] || '';
data.landTypeId = data.landTypeId[data.landTypeId.length - 1];
data.soilType = data.soilTypeId;
if (local.value.length != 0) {
data.coordinate = `${local.value[0]}E,${local.value[1]}N`;
}
delete data.address;
delete data.provinceCode;
delete data.cityCode;
delete data.county;
delete data.townCode;
return data;
}
async function handleRowSave(val, done, loading) {
let data = handleData(val);
const res = await saveLand(data);
loading();
if (res.code == 200) {
@ -614,6 +606,53 @@ async function handleRowSave(val, done, loading) {
done();
}
}
async function handleRowUpdate(form, index, done, loading) {
let data = handleData(form);
let res = await editLand(data);
loading();
if (res.code == 200) {
ElMessage.success('编辑成功');
done();
}
}
async function rowEdit(row) {
console.log('rowEdit', row);
handleOtherInfo(row);
crudRef.value.rowEdit(row);
}
function handleOtherInfo(obj) {
landArea.value = obj.area;
unitValue.value = obj.landUnit;
console.log('option', obj._villageCode, option.group[0].column[4]);
if (obj.propertyCertificateUrl) {
attrs.value = obj.propertyCertificateUrl.split(',').map((v, i) => {
return {
name: `产权附件_${i}`,
url: v,
uid: 'id_' + Date.now(),
};
});
}
if (obj.landCertificateUrl) {
landOwnerAttrs.value = obj.landCertificateUrl.split(',').map((v, i) => {
return {
name: `使用信息附件_${i}`,
url: v,
uid: 'id_' + Date.now(),
};
});
}
if (obj.landUrl) {
landAttrs.value = obj.landUrl.split(',').map((v, i) => {
return {
name: `位置附件_${i}`,
url: v,
uid: 'id_' + Date.now(),
};
});
}
}
//
const onUpload = () => {
importExcelRef?.value && importExcelRef.value.show();
@ -622,7 +661,7 @@ const onDownloadExcel = (url) => {
downloadFile(url, `土地模版表.xlsx`);
};
const onUploadExcel = (formData) => {
formData.append('landType', landType.value);
formData.append('landType', searchCondition.value.landType[searchCondition.value.landType.length - 1]);
importLands(formData)
.then((res) => {
if (res.status === 200) {
@ -637,43 +676,11 @@ const onUploadExcel = (formData) => {
importExcelRef.value.hide();
});
};
async function getLandTree() {
let res = await getLandTypeTree();
if (res.code == 200) {
landTreeDic.value = newTree(res.data, 0);
console.log('landTreeDic', landTreeDic.value);
}
}
function newTree(arr, i) {
arr.forEach((v) => {
if (i == 0) {
v.value = v.id;
v.label = v.landType;
v.disabled = !v.children || !v.children.length;
} else {
v.value = v.id;
v.label = v.landType;
}
if (v.children) v.children = newTree(v.children, i + 1);
});
return arr;
}
// #endregion
</script>
<style lang="scss" scoped>
.lands_types {
justify-content: center;
width: 100%;
> label {
width: 12%;
::v-deep() {
.el-radio-button__inner {
width: 100%;
}
}
}
}
.area_form_ {
display: grid;
grid-template-columns: 75% 25%;

View File

@ -1,5 +1,9 @@
import { ref, reactive } from 'vue';
import { ref, reactive, onMounted } from 'vue';
import { GetEntityList } from '@/apis/system/dict';
import { getLandTypeTree } from '@/apis/baseInfo';
export default function useLandHook() {
const loadFinish = ref(0);
const landType = ref('0');
const landsType = reactive([
{
@ -15,8 +19,82 @@ export default function useLandHook() {
label: '园林',
},
]);
const _landType = ref([]);
const searchCondition = ref({
landName: '',
gridName: '',
owner: '',
landType: [],
});
const landTreeDic = ref([]);
const unitOptions = reactive([]);
const unitValue = ref('');
async function getAreaUnit() {
let res = await GetEntityList({
current: 1,
size: 1000,
dictType: 'sys_area_unit',
});
loadFinish.value += 1;
if (res.code == 200) {
res.data.records.forEach((v) => {
unitOptions.push({
label: v.dictLabel,
value: v.dictValue,
});
if (unitOptions.length) unitValue.value = unitOptions[0].label;
});
}
}
async function getLandTree() {
let res = await getLandTypeTree();
if (res.code == 200) {
landTreeDic.value = newTree(res.data, 0);
_landType.value = defaultLandType(landTreeDic.value);
resetLandType();
loadFinish.value += 1;
}
}
function resetLandType() {
searchCondition.value.landType = JSON.parse(JSON.stringify(_landType.value));
}
function defaultLandType(_data = []) {
let _arr = [];
if (_data.length > 0) {
_arr.push(_data[0].value);
if (_data[0]?.children?.length ?? false) {
_arr.push(...defaultLandType(_data[0].children));
}
}
return _arr;
}
function newTree(arr, i) {
arr.forEach((v) => {
if (i == 0) {
v.value = v.id;
v.label = v.landType;
// v.disabled = !v.children || !v.children.length;
} else {
v.value = v.id;
v.label = v.landType;
}
if (v.children) v.children = newTree(v.children, i + 1);
});
return arr;
}
onMounted(() => {
getAreaUnit();
getLandTree();
});
return {
loadFinish,
landType,
landsType,
searchCondition,
unitOptions,
unitValue,
landTreeDic,
resetLandType,
};
}

View File

@ -23,8 +23,8 @@
</template>
<template #status="{ row }">
<el-tag v-if="row.status == 1" type="success" size="small">启用</el-tag>
<el-tag v-if="row.status == 0" type="danger" size="small">禁用</el-tag>
<el-tag v-if="row.status == 1" type="success">启用</el-tag>
<el-tag v-if="row.status == 0" type="danger">禁用</el-tag>
</template>
<template #menu="scope">
@ -35,18 +35,17 @@
</template>
<script setup>
import { ref, reactive } from 'vue';
import { useRouter } from 'vue-router';
import { useApp } from '@/hooks';
import { useUserStore } from '@/store/modules/user';
import { CRUD_OPTIONS } from '@/config';
import { isEmpty, setDicData, debounce } from '@/utils';
// import { CommonDicData } from '@/apis';
import { getLandsList } from '@/apis/land';
import { GetEntityList, AddEntity, UpdateEntity, DeleteEntity, UpdateStatus } from '@/apis/plantingAndBreeding/base';
const { VITE_APP_BASE_API } = import.meta.env;
const app = useApp();
const UserStore = useUserStore();
const router = useRouter();
const crudRef = ref(null);
const state = reactive({
loading: false,
@ -141,9 +140,15 @@ const state = reactive({
{
label: '区域面积',
prop: 'area',
width: 100,
width: 150,
overHidden: true,
disabled: true,
labelTip: '请先选择地块!',
formatter: (row) => {
// const item = state.unitList.find((v) => v.dictValue == row.unit);
// return row.area + (!isEmpty(item) ? item.dictLabel : '');
return row.area + (!isEmpty(row.unit) ? row.unit : '平方米');
},
},
{
label: '状态',
@ -233,10 +238,23 @@ const state = reactive({
pageSize: 10,
},
data: [],
currentRow: {},
unitList: [],
});
//
// const getUnit = async () => {
// CommonDicData('sys_unit_type')
// .then((res) => {
// console.log(250, res);
// if (res.code === 200) {
// state.unitList = res.data;
// }
// })
// .catch((err) => {
// app.$message.error(err.msg);
// });
// };
const loadData = async () => {
state.loading = true;
GetEntityList(state.query)
@ -262,6 +280,10 @@ const loadData = async () => {
loadData();
// onMounted(() => {
// getUnit();
// });
//
const currentChange = (current) => {
state.query.current = current;
@ -384,7 +406,6 @@ const rowDel = (row, index, done) => {
//
const remoteLandList = async (val) => {
if (!isEmpty(val)) return;
const query = { landName: val, current: 1, size: 20 };
const res = await getLandsList(query);
if (res.code === 200) {
@ -395,12 +416,12 @@ const remoteLandList = async (val) => {
//
const selectedChange = ({ item, value, dic }) => {
// console.log(390, value, item);
crudRef.value.tableForm.landId = item?.id;
crudRef.value.tableForm.landId = value;
crudRef.value.tableForm.landName = item?.landName;
crudRef.value.tableForm.address = item?.address;
crudRef.value.tableForm.area = item?.area;
crudRef.value.tableForm.unit = item?.landUnit;
crudRef.value.tableForm.provinceCode = item?.provinceCode;
// crudRef.value.tableForm.provinceName = item?.provinceName;
crudRef.value.tableForm.cityCode = item?.cityCode;
crudRef.value.tableForm.districtCode = item?.county;
crudRef.value.tableForm.townCode = item?.townCode;

View File

@ -35,7 +35,7 @@ import { CRUD_OPTIONS } from '@/config';
import { isEmpty, downloadFile } from '@/utils';
import { useUserStore } from '@/store/modules/user';
import { compact } from 'lodash';
import { GetEntityList, AddEntity, UpdateEntity, DeleteEntity, ExportEntity } from '@/apis/grid';
import { GetEntityList, AddEntity, UpdateEntity, DeleteEntity, ExportEntity } from '@/apis/resource/grid';
const { VITE_APP_BASE_API } = import.meta.env;
const app = useApp();
@ -51,13 +51,16 @@ const state = reactive({
selection: [],
options: {
...CRUD_OPTIONS,
addBtnText: '添加网格',
// addBtnText: '',
column: [
{
label: '网格区',
prop: 'gridArea',
search: true,
width: 200,
addDisplay: false,
editDisplay: false,
viewDisplay: true,
rules: {
required: true,
message: '请输入',
@ -93,6 +96,11 @@ const state = reactive({
addDisplay: true,
editDisplay: true,
viewDisplay: false,
// multiple: true,
// checkStrictly: true,
// collapseTags: true,
// emitPath: false,
// checkDescendants: false,
props: {
label: 'areaName',
value: 'areaCode',
@ -261,7 +269,6 @@ const selectionChange = (rows) => {
//
const rowView = (row) => {
// state.currentRow = row;
crudRef.value.rowView(row);
};
@ -271,7 +278,8 @@ const setCity = (row) => {
row.cityCode = row?.cities[1] ?? null;
row.gridAreaCode = row?.cities[2] ?? null;
row.townCode = row?.cities[3] ?? null;
row.village = row?.cities[3] ?? null;
row.village = row?.cities[4] ?? null;
// row.village = row?.cities.join(',');
}
};
@ -296,7 +304,8 @@ const rowSave = (row, done, loading) => {
//
const rowEdit = (row) => {
row.cities = compact([row.provinceCode, row.cityCode, row.gridAreaCode ?? '', row.townCode ?? '', row.village ?? '']);
const village = !isEmpty(row.village) ? row.village : [];
row.cities = compact([row.provinceCode, row.cityCode, row.gridAreaCode ?? '', row.townCode ?? '', ...village]);
crudRef.value.rowEdit(row);
};
const rowUpdate = (row, index, done, loading) => {
@ -331,7 +340,6 @@ const rowDel = (row, index, done) => {
.then((res) => {
if (res.code === 200) {
app.$message.success('删除成功!');
done();
loadData();
}
})

View File

@ -26,7 +26,7 @@
<script setup>
import { reactive } from 'vue';
import { useApp } from '@/hooks';
import { GetCropData, GetLandData } from '@/apis/statisticAnalysis';
import { GetCropData, GetLandData } from '@/apis/resource/statisticAnalysis';
const app = useApp();
const state = reactive({

View File

@ -16,8 +16,8 @@
@row-del="rowDel"
>
<template #status="{ row }">
<el-tag v-if="row.status == 0" type="success" size="small">启用</el-tag>
<el-tag v-if="row.status == 1" type="danger" size="small">禁用</el-tag>
<el-tag v-if="row.status == 0" type="success">启用</el-tag>
<el-tag v-if="row.status == 1" type="danger">禁用</el-tag>
</template>
<template #menu="scope">

View File

@ -19,8 +19,8 @@
@row-del="rowDel"
>
<template #status="{ row }">
<el-tag v-if="row.status == 0" type="success" size="small">启用</el-tag>
<el-tag v-if="row.status == 1" type="danger" size="small">禁用</el-tag>
<el-tag v-if="row.status == 0" type="success">启用</el-tag>
<el-tag v-if="row.status == 1" type="danger">禁用</el-tag>
</template>
<template #menu="scope">

View File

@ -19,8 +19,8 @@
@row-del="rowDel"
>
<template #status="{ row }">
<el-tag v-if="row.status == 0" type="success" size="small">启用</el-tag>
<el-tag v-if="row.status == 1" type="danger" size="small">禁用</el-tag>
<el-tag v-if="row.status == 0" type="success">启用</el-tag>
<el-tag v-if="row.status == 1" type="danger">禁用</el-tag>
</template>
<template #menu="scope">

View File

@ -63,7 +63,7 @@ import { isEmpty, imageToBase64, getAssetsFile, downloadFile } from '@/utils';
import { useUserStore } from '@/store/modules/user';
import { CommonUpload } from '@/apis';
import { compact } from 'lodash';
import { GetEntityList, AddEntity, UpdateEntity, DeleteEntity, ImportEntity, ExportEntity } from '@/apis/coding';
import { GetEntityList, AddEntity, UpdateEntity, DeleteEntity, ImportEntity, ExportEntity } from '@/apis/trace/coding';
import CustomInfo from './info.vue';
import CustomQualityAdd from '../quality/form.vue';
@ -84,7 +84,8 @@ const state = reactive({
selection: [],
options: {
...CRUD_OPTIONS,
addBtnText: '添加信息',
// addBtnText: '',
selection: true,
column: [
{
label: '溯源码',
@ -156,7 +157,7 @@ const state = reactive({
dicHeaders: {
authorization: UserStore.token,
},
dicFormatter: (res) => res?.data?.records ?? [],
dicFormatter: (res) => res?.data ?? [],
rules: {
required: true,
message: '请选择',
@ -236,6 +237,12 @@ const state = reactive({
},
{
label: '乡镇',
prop: 'town',
hide: true,
display: false,
},
{
label: '村',
prop: 'village',
hide: true,
display: false,
@ -455,7 +462,8 @@ const setCity = (row) => {
row.province = row?.cities[0] ?? null;
row.city = row?.cities[1] ?? null;
row.county = row?.cities[2] ?? null;
row.village = row?.cities[3] ?? null;
row.town = row?.cities[3] ?? null;
row.village = row?.cities[4] ?? null;
}
};
@ -509,11 +517,12 @@ const rowSave = (row, done, loading) => {
//
const rowEdit = (row) => {
row.base64 = row.productUrl;
row.cities = compact([row.province, row.city, row.county ?? '', row.village ?? '']);
row.cities = compact([row.province, row.city, row.county ?? '', row.town ?? '', row.village ?? '']);
crudRef.value.rowEdit(row);
};
const rowUpdate = (row, index, done, loading) => {
delete row.base64;
console.log('row', row);
setCity(row);
UpdateEntity(row)
.then((res) => {

View File

@ -23,7 +23,7 @@ import { reactive, ref, watch } from 'vue';
import { useApp } from '@/hooks';
import { CRUD_VIEW_OPTIONS } from '@/config';
import { downloadFile } from '@/utils';
import { GetEntity } from '@/apis/coding';
import { GetEntity } from '@/apis/trace/coding';
const props = defineProps({
row: {

View File

@ -26,7 +26,7 @@ import { reactive, ref, watch } from 'vue';
import { isEmpty, imageToBase64, setUploadField } from '@/utils';
import { useApp } from '@/hooks';
import { CommonUpload } from '@/apis';
import { AddEntity } from '@/apis/quality';
import { AddEntity } from '@/apis/trace/quality';
const props = defineProps({
row: {

View File

@ -59,7 +59,7 @@ import { useApp } from '@/hooks';
import { CRUD_OPTIONS } from '@/config';
import { isEmpty, imageToBase64, setUploadField, downloadFile } from '@/utils';
import { CommonUpload } from '@/apis';
import { GetEntityList, AddEntity, UpdateEntity, DeleteEntity } from '@/apis/quality';
import { GetEntityList, AddEntity, UpdateEntity, DeleteEntity } from '@/apis/trace/quality';
const app = useApp();
const crudRef = ref(null);
@ -75,6 +75,7 @@ const state = reactive({
options: {
...CRUD_OPTIONS,
addBtn: false,
selection: true,
column: [
{
label: '溯源码',

View File

@ -103,7 +103,7 @@ import { useRouter, useRoute } from 'vue-router';
import { useApp } from '@/hooks';
import { CRUD_VIEW_OPTIONS } from '@/config';
import { isEmpty } from '@/utils';
import { GetTraceDetail } from '@/apis/coding';
import { GetTraceDetail } from '@/apis/trace/coding';
const { VITE_APP_NAME } = import.meta.env;
const router = useRouter();

View File

@ -1,7 +1,6 @@
# 生产环境
VITE_MODE = 'PRO'
VITE_APP_MIAN = 'daimp-front-main'
VITE_APP_MIAN_URL = 'http://192.168.18.99:88'
VITE_APP_MIAN_URL = 'http://47.109.205.240:88'
VITE_APP_NAME = 'sub-government-screen-service'
# 接口
VITE_APP_BASE_API = '/apis'

View File

@ -1,5 +1,5 @@
{
"name": "government-affairs-service",
"name": "government-sceen-service",
"private": true,
"version": "0.0.1",
"type": "module",
@ -7,6 +7,7 @@
"dev": "vite --mode development",
"build": "vite build --mode production",
"test": "vite build --mode test",
"local": "vite build --mode local",
"preview": "vite preview",
"format": "prettier --write 'src/**/*.{vue,ts,tsx,js,jsx,css,less,scss,json,md}'",
"eslint": "npx eslint --init",

View File

@ -1,5 +1,6 @@
<template>
<div class="data-warp" :style="{ 'background-image': 'url(' + getAssetsFile('images/vsualized/screenbg.png') + ')' }">
<!-- :style="{ 'background-image': 'url(' + getAssetsFile('images/vsualized/screenbg.png') + ')' }" -->
<div class="data-warp">
<div class="chart-content">
<div class="top">
<slot v-if="$slots.top" name="top"></slot>
@ -14,27 +15,6 @@
<div class="content">
<slot name="center"></slot>
</div>
<div class="bottom" :style="{ 'background-image': 'url(' + getAssetsFile('images/vsualized/bottombg.jpg') + ')' }">
<div class="b-nav">
<div
v-for="n in navlist"
:key="n.name"
class="b-nav-item"
:style="{
'background-image':
'url(' +
(currentName == n.name ? getAssetsFile('images/vsualized/home/nav-on.png') : getAssetsFile('images/vsualized/home/nav.png')) +
')',
}"
:class="currentName == n.name ? 'nav-act' : 'nav-normal'"
@click="itemAct(n.name)"
>
<!-- <router-link :to="n.name"> -->
<span>{{ n.title }}</span>
<!-- </router-link> -->
</div>
</div>
</div>
</div>
</div>
</template>

View File

@ -42,11 +42,11 @@ const chearTime = () => {
};
onMounted(() => {
// startTime();
startTime();
});
onUnmounted(() => {
// chearTime();
chearTime();
});
defineExpose({

View File

@ -0,0 +1,110 @@
<template>
<div class="layout-bottom">
<div class="bottom" :style="{ 'background-image': 'url(' + getAssetsFile('images/vsualized/bottombg.jpg') + ')' }">
<div class="b-nav">
<div
v-for="n in navlist"
:key="n.name"
class="b-nav-item"
:style="{
'background-image':
'url(' +
(currentName == n.name ? getAssetsFile('images/vsualized/home/nav-on.png') : getAssetsFile('images/vsualized/home/nav.png')) +
')',
}"
:class="currentName == n.name ? 'nav-act' : 'nav-normal'"
@click="itemAct(n.name)"
>
<!-- <router-link :to="n.name"> -->
<span>{{ n.title }}</span>
<!-- </router-link> -->
</div>
</div>
</div>
</div>
</template>
<script setup name="layout-bottom">
import { computed, ref } from 'vue';
import { useSettingStore } from '@/store/modules/setting';
import { setPx } from '@/utils';
import { getAssetsFile } from '@/utils';
import { useRoute, useRouter } from 'vue-router';
const route = useRoute();
const router = useRouter();
const SettingStore = useSettingStore();
//
const themeConfig = computed(() => SettingStore.themeConfig);
const isCollapse = computed(() => !SettingStore.isCollapse);
const stylePlaceholder = () => {
return { height: themeConfig.value.showTag ? setPx(90) : setPx(50) };
};
const navlist = ref([
{ title: '首页', name: 'home' },
{ title: '土地资源', name: 'land' },
{ title: '投入品', name: 'inputs' },
{ title: '生产经营主体', name: 'entities' },
{ title: '智慧种植检测', name: 'plant' },
{ title: '智慧养殖检测', name: 'breed' },
{ title: '全流程溯源', name: 'trace' },
{ title: '产业预警决策', name: 'early' },
]);
let currentName = ref(route.name);
const itemAct = (name) => {
console.info('itemAct', name);
currentName.value = name;
router.push({ name: name });
};
</script>
<style lang="scss" scoped>
.layout-bottom {
width: 100%;
text-align: center;
position: absolute;
left: 0;
bottom: 0;
z-index: 100;
.bottom {
height: 98px;
text-align: center;
.b-nav {
margin: auto;
display: inline-flex;
gap: 20px;
.b-nav-item {
display: inline-block;
cursor: pointer;
min-width: 132px;
height: 42px;
text-align: center;
line-height: 38px;
span {
font-size: 14px;
font-weight: bold;
display: inline-flex;
transform: skewX(-8deg);
background: linear-gradient(to bottom, '#ff7e5f', '#548fff');
-webkit-background-clip: text;
letter-spacing: 4px;
text-shadow: -2px 0 0 1px #add8f1;
}
&.nav-act {
color: rgba(255, 255, 255, 1);
}
&.nav-normal {
color: rgba(255, 255, 255, 0.6);
}
}
}
}
}
</style>

View File

@ -31,18 +31,5 @@ const isReload = computed(() => SettingStore.isReload);
<style lang="scss" scoped>
.layout-main {
flex: 1;
display: flex;
width: 100%;
height: 100%;
@include scrollable;
box-sizing: border-box;
&-inner {
padding: 10px;
width: 100%;
background-color: #f5f5f5;
box-sizing: border-box;
}
}
</style>

View File

@ -6,34 +6,36 @@
* @LastEditTime: 2024-02-05 16:03:31
-->
<template>
<div
class="basic-layout"
:class="{
hideSider: !SettingStore.isCollapse,
}"
>
<Sider />
<div class="basic-layout" :style="{ 'background-image': 'url(' + getAssetsFile('images/vsualized/screenbg.png') + ')' }">
<div class="basic-layout-container">
<Header />
<Main />
<Bottom :name-val="route.name"></Bottom>
</div>
</div>
</template>
<script setup name="layout">
import { getAssetsFile } from '@/utils';
import { useSettingStore } from '@/store/modules/setting';
import Sider from './component/Sider';
import Header from './component/Header';
import Bottom from './component/Bottom';
import Main from './component/Main';
import { useRoute, useRouter } from 'vue-router';
import { onMounted } from 'vue';
const route = useRoute();
const SettingStore = useSettingStore();
onMounted(() => {
console.info('route', route);
});
</script>
<style lang="scss" scoped>
.basic-layout {
width: 100%;
min-width: 1200px;
height: 100%;
height: 100vh;
&.hideSider {
:deep(.layout-sider) {
width: 60px !important;
@ -44,7 +46,6 @@ const SettingStore = useSettingStore();
}
&-container {
position: relative;
margin-left: 210px;
height: 100%;
transition: margin-left 0.28s;
box-sizing: border-box;

View File

@ -20,16 +20,24 @@ export const constantRoutes = [
component: () => import('@/views/error/403.vue'),
hidden: true,
},
{
path: '/sub-government-screen-service',
name: 'layout',
component: Layout,
redirect: '/sub-government-screen-service/home',
meta: { title: '首页', icon: 'House' },
children: [
{
path: '/sub-government-screen-service/home',
name: 'home',
component: () => import('@/views/home/index.vue'),
name: 'home',
meta: { title: '首页', icon: 'House' },
},
{
path: '/sub-government-screen-service/land',
name: 'land',
component: () => import('@/views/land/index.vue'),
hidden: true,
name: 'land',
meta: { title: '土地资源', icon: 'House' },
},
{
path: '/sub-government-screen-service/inputs',
@ -67,6 +75,55 @@ export const constantRoutes = [
component: () => import('@/views/early/index.vue'),
hidden: true,
},
],
},
// {
// path: '/sub-government-screen-service/home',
// name: 'home',
// component: () => import('@/views/home/index.vue'),
// },
// {
// path: '/sub-government-screen-service/land',
// name: 'land',
// component: () => import('@/views/land/index.vue'),
// hidden: true,
// },
// {
// path: '/sub-government-screen-service/inputs',
// name: 'inputs',
// component: () => import('@/views/inputs/index.vue'),
// hidden: true,
// },
// {
// path: '/sub-government-screen-service/entities',
// name: 'entities',
// component: () => import('@/views/entities/index.vue'),
// hidden: true,
// },
// {
// path: '/sub-government-screen-service/breed',
// name: 'breed',
// component: () => import('@/views/breed/index.vue'),
// hidden: true,
// },
// {
// path: '/sub-government-screen-service/plant',
// name: 'plant',
// component: () => import('@/views/plant/index.vue'),
// hidden: true,
// },
// {
// path: '/sub-government-screen-service/trace',
// name: 'trace',
// component: () => import('@/views/trace/index.vue'),
// hidden: true,
// },
// {
// path: '/sub-government-screen-service/early',
// name: 'early',
// component: () => import('@/views/early/index.vue'),
// hidden: true,
// },
];
/**
@ -75,7 +132,7 @@ export const constantRoutes = [
export const notFoundRouter = {
path: '/sub-government-screen-service/:pathMatch(.*)',
name: 'notFound',
redirect: '/sub-government-screen-service/home',
redirect: '/sub-government-screen-service/404',
};
const router = createRouter({

View File

@ -17,9 +17,11 @@ NProgress.configure({ showSpinner: false });
const { VITE_APP_MIAN_URL } = import.meta.env;
const whiteList = [];
router.beforeEach(async (to, from, next) => {
console.info('beforeEach************to', to);
console.info('beforeEach**********from', from);
NProgress.start();
if (typeof to.meta.title === 'string') {
document.title = '政务服务 | ' + to.meta.title;
document.title = '数据大屏 | ' + to.meta.title;
}
const userStore = useUserStore();

View File

@ -1,6 +1,10 @@
# 开发环境
VITE_PORT = 9526
VITE_MODE = 'DEV'
VITE_APP_MIAN = 'daimp-front-main'
VITE_APP_MIAN_URL = 'http://localhost:9000'
VITE_APP_NAME = 'sub-operation-service'
VITE_APP_BASE_API = '/apis'
VITE_APP_BASE_URL = 'http://localhost:8080/'
VITE_APP_BASE_URL = 'http://192.168.18.99:8080'
VITE_APP_UPLOAD_API = '/uploadApis'
VITE_APP_UPLOAD_URL = 'http://192.168.18.99:9300'

View File

@ -1,5 +1,9 @@
# 生产环境
VITE_MODE = 'PRO'
VITE_APP_MIAN = 'daimp-front-main'
VITE_APP_MIAN_URL = 'http://47.109.205.240:88'
VITE_APP_NAME = 'sub-operation-service'
VITE_APP_BASE_API = 'https://www.localhost.com/8080/api/'
VITE_APP_BASE_URL = 'https://www.localhost.com/8080/'
# 接口
VITE_APP_BASE_API = '/apis'
VITE_APP_BASE_URL = ''
VITE_APP_UPLOAD_API = '/uploadApis'
VITE_APP_UPLOAD_URL = ''

View File

@ -1,13 +1,13 @@
{
"name": "sub-admin",
"name": "sub-operation-service",
"private": true,
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite --mode development",
"build": "vite build --mode production",
"build:dev": "vite build --mode dev",
"build:qa": "vite build --mode qa",
"test": "vite build --mode test",
"local": "vite build --mode local",
"preview": "vite preview",
"format": "prettier --write 'src/**/*.{vue,ts,tsx,js,jsx,css,less,scss,json,md}'",
"eslint": "npx eslint --init",

View File

@ -24,4 +24,44 @@ const size = computed(() => SettingStore.themeConfig.globalComSize);
<style lang="scss">
@import './styles/style.scss';
@import './styles/global.scss';
@import '@/styles/iconfont.css';
body {
div {
box-sizing: border-box;
}
--el-color-primary: #25bf82;
--el-color-primary-light-3: #45dda1;
--el-color-primary-light-5: #8cddbd;
--el-color-primary-light-9: rgba(37, 191, 130, 0.1);
--el-color-primary-light-8: rgba(37, 191, 130, 0.5);
.el-input {
--el-input-focus-border-color: #25bf82;
--el-input-focus-border: #25bf82;
::v-deep() {
.el-input__wrapper:focus,
.el-input__wrapper:hover,
.el-input__wrapper .is-focus {
box-shadow: 0 0 0 1px $color-main !important;
}
}
}
.el-button--primary {
--el-button-bg-color: #25bf82;
--el-button-border-color: #25bf82;
--el-button-outline-color: #45dda1;
--el-button-active-color: #158b5c;
--el-button-hover-bg-color: #45dda1;
--el-button-hover-border-color: #45dda1;
--el-button-active-bg-color: #158b5c;
--el-button-active-border-color: #158b5c;
--el-button-disabled-text-color: var(--el-color-white);
--el-button-disabled-bg-color: #45dda1;
--el-button-disabled-border-color: #45dda1;
}
--el-menu-hover-text-color: #25bf82;
--el-menu-hover-bg-color: fff;
}
</style>

View File

@ -0,0 +1,9 @@
import request from '@/utils/axios';
//云南省所有区域信息
export function getRegion(code) {
let codeVal = code ? code : '530000';
return request('/system/area/region?areaCode=' + codeVal, {
method: 'GET',
});
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 638 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 579 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,7 +1,9 @@
const { VITE_APP_NAME } = import.meta.env;
import { qiankunWindow } from 'vite-plugin-qiankun/dist/helper';
const { VITE_APP_MIAN, VITE_APP_NAME } = import.meta.env;
export const GenKey = (key, prefix = `${VITE_APP_NAME}_`) => {
return prefix ? prefix + key : key;
export const GenKey = (key, prefix = VITE_APP_NAME) => {
prefix = qiankunWindow.__POWERED_BY_QIANKUN__ ? VITE_APP_MIAN : VITE_APP_MIAN;
return prefix ? `${prefix}_` + key : key;
};
export const CONSTANTS = {

View File

@ -1,30 +1,38 @@
<template>
<div class="layout-header-warp">
<div class="layout-header">
<div class="layout-header-top">
<div class="layout-header-top-left">
<span>您好欢迎来到农业产业服务平台</span>
<el-tag>运营大屏</el-tag>
<el-tag>产业服务APP</el-tag>
<el-tag>产业运营管理</el-tag>
<span class="welcome-msg">您好欢迎来到农业产业服务平台</span>
<div class="left-link">
<div class="iconfont icon-bigScreen"></div>
<span>数据大屏</span>
</div>
<div class="left-link">
<div class="iconfont icon-operation" style="font-size: 12px"></div>
<span>产业运营管理</span>
</div>
</div>
<div class="layout-header-top-right">
<span>商家中心</span>
<span>个人中心</span>
<span @click="toHome" class="back-home">
<div class="iconfont icon-home" style="font-size: 12px"></div>
<span>返回首页</span>
</span>
</div>
</div>
<div class="layout-header-bottom">
<div class="layout-header-bottom-left">
<div class="layout-header-bottom-search">
<div class="title">农业产业服务平台</div>
<div class="title">
<img :src="getAssetsFile('images/logo.png')" />
</div>
<div class="search-warp">
<el-input v-model="keyword" placeholder="请输入关键词进行搜索"></el-input>
<el-button type="primary" @click="Search">搜索</el-button>
</div>
<el-menu ellipsis class="layout-header-bottom-menu" mode="horizontal">
<app-link v-for="(item, index) in meuns" :key="index" :to="item.path">
<el-menu-item>{{ item.label }}</el-menu-item>
</app-link>
</el-menu>
</div>
</div>
<div class="layout-header-bottom-right">
<div class="layout-header-bottom-right-qr">
@ -37,7 +45,14 @@
<p>打开数农小程序</p>
</div>
</div>
<p>使用数农手机服务更方便</p>
</div>
</div>
<div class="layout-header-menu">
<el-menu ellipsis class="layout-header-bottom-menu" mode="horizontal">
<app-link v-for="(item, index) in meuns" :key="index" :to="item.path">
<el-menu-item active-text-color="#25BF82">{{ item.label }}</el-menu-item>
</app-link>
</el-menu>
</div>
</div>
</div>
@ -49,9 +64,11 @@ import { useSettingStore } from '@/store/modules/setting';
import { usePermissionStore } from '@/store/modules/permission';
import { qrImg } from './base64img';
import AppLink from '../Menu/Link.vue';
import { useRoute } from 'vue-router';
import { useRoute, useRouter } from 'vue-router';
import { isEmpty, getAssetsFile } from '@/utils';
const route = useRoute();
const router = useRouter();
const SettingStore = useSettingStore();
const PermissionStore = usePermissionStore();
const cacheRoutes = computed(() => PermissionStore.keepAliveRoutes);
@ -75,6 +92,7 @@ const meuns = ref([
},
{
label: '电商交易',
path: '/sub-operation-service/ecommerce',
},
{
label: '分拣包装',
@ -90,47 +108,105 @@ const meuns = ref([
function Search() {
console.log(keyword.value, 'search');
}
const toHome = () => {
console.info('toHome', router);
router.push('/');
};
</script>
<style lang="scss" scoped>
div {
box-sizing: border-box;
}
.layout-header-warp {
width: 100%;
text-align: center;
background: $color-fff;
.layout-header-menu {
width: 100%;
::v-deep() {
.el-menu {
justify-content: space-around;
border: none !important;
}
.el-menu-item {
font-size: 24px;
}
.el-menu-item:hover {
background: none !important;
color: $color-main;
}
.el-menu-item:active {
background: none !important;
color: $color-main;
}
}
}
}
.layout {
// width: 100%;
// height: 100%;
// box-sizing: border-box;
&-header {
width: 100%;
width: 1200px;
height: 206px;
overflow: hidden;
margin: auto;
&-top {
display: flex;
height: 44px;
justify-content: space-between;
align-items: center;
background-color: #f8f8f8;
padding: 0 32px;
&-left {
line-height: 36px;
font-size: 16px;
.el-tag {
color: #fff;
background-color: #a4adb3;
margin-left: 12px;
border-color: #a4adb3;
.welcome-msg {
font-size: 12px;
color: $color-5a;
}
.left-link {
color: $color-main;
margin: 0 10px;
font-size: 12px;
cursor: pointer;
font-size: 18px;
display: inline-block;
.iconfont {
color: $color-main;
display: inline-block;
margin-right: 2px;
}
.iconfont,
span {
vertical-align: middle;
}
}
}
&-right {
span {
color: #000;
color: $color-000;
margin-left: 25px;
line-height: 36px;
font-size: 16px;
font-size: 12px;
text-align: center;
cursor: pointer;
&:nth-child(1) {
margin-left: 0;
font-weight: bold;
}
&.back-home {
.iconfont {
display: inline-block;
vertical-align: middle;
color: $color-main;
}
span {
margin-left: 6px;
display: inline-block;
vertical-align: middle;
}
color: $color-main;
}
}
}
@ -151,18 +227,31 @@ function Search() {
font-size: 45px;
white-space: nowrap;
}
.search-warp {
width: 100%;
padding-left: 36px;
position: relative;
.el-input {
flex-grow: 1;
max-width: 460px;
margin-left: 40px;
height: 50px;
font-size: 18px;
width: 100%;
::v-deep() {
.el-input__wrapper {
padding-right: 100px;
}
}
}
.el-button {
margin-left: 40px;
position: absolute;
right: 8px;
top: 50%;
transform: translateY(-50%);
font-size: 18px;
height: 45px;
padding: 8px 24px;
padding: 0 24px;
height: 42px;
}
}
}
.layout-header-bottom-menu {
@ -185,8 +274,8 @@ function Search() {
justify-content: space-between;
&-img {
img {
width: 110px;
height: 110px;
width: 48px;
height: 48px;
}
p {
text-align: center;

View File

@ -3,41 +3,101 @@
* @Author: zenghua.wang
* @Date: 2023-06-20 11:48:41
* @LastEditors: zenghua.wang
* @LastEditTime: 2025-01-25 10:20:40
* @LastEditTime: 2025-04-07 17:24:45
*/
import { createRouter, createWebHistory } from 'vue-router';
import { qiankunWindow } from 'vite-plugin-qiankun/dist/helper';
import Layout from '@/layouts/index.vue';
import demo from './modules/demo';
const { VITE_APP_NAME } = import.meta.env;
import Views from '@/layouts/Views.vue';
export const constantRoutes = [
{
path: '/404',
path: '/sub-operation-service/404',
name: '404',
component: () => import('@/views/error/404.vue'),
hidden: true,
},
{
path: '/403',
path: '/sub-operation-service/403',
name: '403',
component: () => import('@/views/error/403.vue'),
hidden: true,
},
{
path: '/',
path: '/sub-operation-service',
name: 'layout',
component: Layout,
redirect: '/home',
meta: { title: '首页', icon: 'House' },
redirect: '/sub-operation-service/home',
meta: { title: '首页' },
children: [
{
path: '/home',
path: '/sub-operation-service/home',
component: () => import('@/views/home/index.vue'),
name: 'home',
meta: { title: '首页', icon: 'House' },
meta: { title: '首页' },
},
],
},
{
path: '/ecommerce',
name: 'ecommerce',
component: Layout,
redirect: '/sub-operation-service/ecommerce',
meta: { title: '电商交易' },
children: [
{
path: '/sub-operation-service/ecommerce',
component: () => import('@/views/ecommerce/index.vue'),
name: 'agricultural',
meta: { title: '农资交易' },
},
{
path: '/purchaser',
component: Views,
redirect: '/sub-operation-service/purchaser',
name: 'purchaserParent',
meta: { title: '采购商服务' },
children: [
{
path: '/sub-operation-service/purchaser',
component: () => import('@/views/ecommerce/purchaser.vue'),
name: 'purchaser',
meta: { title: '采购商服务' },
},
{
path: '/sub-operation-service/purchaserDetail',
component: () => import('@/views/ecommerce/purchaserDetail.vue'),
name: 'purchaserDetail',
meta: { title: '采购详情' },
},
],
},
{
path: '/sub-operation-service/supplier',
component: () => import('@/views/ecommerce/supplier.vue'),
name: 'supplier',
meta: { title: '供应商服务' },
},
{
path: '/land',
component: Views,
redirect: '/sub-operation-service/land',
name: 'landParent',
meta: { title: '土地交易' },
children: [
{
path: '/sub-operation-service/land',
component: () => import('@/views/ecommerce/land.vue'),
name: 'land',
meta: { title: '土地交易' },
},
{
path: '/sub-operation-service/landDetail',
component: () => import('@/views/ecommerce/landDetail.vue'),
name: 'landDetail',
meta: { title: '土地详情' },
},
],
},
],
},
@ -48,13 +108,13 @@ export const constantRoutes = [
* @Title notFoundRouter(找不到路由)
*/
export const notFoundRouter = {
path: '/:pathMatch(.*)',
path: '/sub-operation-service/:pathMatch(.*)',
name: 'notFound',
redirect: '/404',
redirect: '/sub-operation-service/404',
};
const router = createRouter({
history: createWebHistory(qiankunWindow.__POWERED_BY_QIANKUN__ ? `/${VITE_APP_NAME}/` : '/'), // history
history: createWebHistory(), // history
routes: constantRoutes,
});

View File

@ -1,19 +0,0 @@
import Layout from '@/layouts/index.vue';
export default [
// {
// path: '/demo',
// name: 'demo',
// component: Layout,
// redirect: '/demo-table',
// meta: { title: '案例管理', icon: 'icon-test' },
// children: [
// {
// path: '/demo-table',
// component: () => import('@/views/demo/table.vue'),
// name: 'table',
// meta: { title: '列表', icon: 'Document' },
// },
// ],
// },
];

View File

@ -3,7 +3,7 @@ import { GenKey } from '@/config';
import { isEmpty, encode, decode } from '@/utils';
export const useUserStore = defineStore({
id: GenKey('USER_STATE'),
id: GenKey('userStore'),
state: () => ({
token: null,
userInfo: {},
@ -52,14 +52,14 @@ export const useUserStore = defineStore({
this.currentOrg = null;
this.orgList = [];
this.menus = [];
localStorage.removeItem(GenKey('USER_STATE'));
localStorage.removeItem(GenKey('userStore'));
},
clear() {
localStorage.removeItem(GenKey('USER_STATE'));
localStorage.removeItem(GenKey('userStore'));
},
},
persist: {
key: GenKey('USER_STATE'),
key: GenKey('userStore'),
storage: window.localStorage,
},
});

View File

@ -1,5 +1,11 @@
// color
$legacy-ie: 10;
$color-main:#25BF82;
$color-main-table-header:rgba(37,191,130,0.1);
$color-main-border:rgba(37, 191, 130, 0.5);
$color-5a:#5A5A5A;
$color-000:#000;
$color-fff:#fff;
$color-primary: #20a0ff;
$color-success: #13ce66;
$color-warning: #f7ba2a;
@ -20,11 +26,13 @@ $color-gray: #d3dce6;
$color-gray-light: #e5e9f2;
$color-gray-lighter: #eff2f7;
$color-333: #333333;
$color-666: #333333;
$color-666: #666;
$color-999: #999999;
$color-border-gray: #d1dbe5;
$color-input-border: #dcdfe6;
$color-border: $color-border-gray;
$width-main:1200px;
$color-types: (
primary: (
$color-primary,
@ -58,4 +66,5 @@ $color-types: (
),
);
@import 'utils/utils';

View File

@ -0,0 +1,78 @@
@font-face {
font-family: "iconfont"; /* Project id 4879313 */
src:
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAwEAAsAAAAAFRwAAAu3AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHFQGYACEUgqaYJYOATYCJANECyQABCAFhGcHgSob4hEjEbaCsXIl++sEbsAQrAb6GyLWKCra1s4arx2+okU9xXa4WH6+Mzz9My4jvICK4jflu0Mp4f9tbzt3Zn7ru0tztaou/CpUacYi8eAsxhGPJLx4gv6Xa5n5pISyKsI8qgKyy+X2gHKT24fqqirZ8YSKfR2wUe30tGn/NhtpVjBbyCd42pIGQs2JKVpRzZ92t/XdO0cCyZ2nCSROxKkbcOIegtzd1i+ztgQyDDDKssQDjyiwGiCAwGye+5kV4Hr1vc+3n6szSVtoiF+jl7v/bxs384/5xw9RazQykUgy8cgjRLGUSZRWca6mjvtvUhIr6FpbLlcFVjNMpPb3PA0CuWP9Um18dpU0d4ER6cDgkUJVXt21Bam9uQSGRlJrzLtqVPogglvuNsB79vr6zKXgRAm8p/nHTHL9M822J0fgH0pfI5jdgQh4sO+ZR5Md94oWZD8z5TQ6mCOkZCqH3y4rtj2Op8BOs7amG1VuKreomZNw/RcvEkukMrlCqVJrtIgy2FSC9MvRmksc4RnGkIxADAABNgfgYfPoE48tAEAMWwRIYEsAKWwZIIOtAOSwNYACtg5QwjYAKtgmQA3bAmhg2y5aEHdzryKcIWEQEu1A+lZWAifaGcQh4hNIU6BxobZ4C32kSMZnazFpVnq6HsPw2RgHCzZhIiQ4juFcIRfiztfwMCWCcHi6SJwi/AtxDDXrw4N0v2Ftk6Q2IGxA0SSy8w6KwkGx34+ijFfoBW6UuReBYJTR++tkwQ3MA5DkPoLRDyGYeoRymz+3xOElBXYPLXL6KLHLz6xkUTUsurup/leldQBlM33NLz3i2gbt3ExsXiDiFDrg0PO95AHaFwxCEMo0NAxkhUZCAQAWeQMCg0fgFPtnqw0NoZWM2I7Rg6NtUArVHh1CcUC+oJhGk+x+iBo1mjtMjqBwwuFMtDPpIrEranPYBQKP5/WGonxif52YULRETRhhiYJ3EYSuJQOoOV7oWBS4I8E1U2Ed050TydYw94gldS/u1cRcrXhOamaJ80PQMKZAWHR/C0jVOSDk8Iv8XpqKTBhKZLdBryUS23EmRDbpyQ1TzQ60EiExdtvQ39KHnM2RjGCbDvL5EBEtQDxeMsgK5ZDLALJVa/e8LqCbACBD3iETU4YRiD5Xg6XizL1L8xB/8a5bF+pnNVcF2+nb50GyC4vrSltqE99746xIjboiiO6crnfGwHsJ3XgfLTBoXtf0T7tu7VZarAkkccSQlnElHJDTHzRF5Zy+IFUnXsBJvAFACjx7mMkw0cTEDoPkVUhti0MUv2O1/+QO1c5H0iIPYnpwrcuLNXD68WMyFmMSCSoed2ytlGZGOPtRJETW0PbHMzkgTZ2zHa5oAqKccRzITd8c7XotEr3F3BjpJDuGryMHwPQy01GDCa27/5iOVyuJG4mhA2DFdKooqc3f2BDYyHYEMWOtcrC5UVgWhKhEK5jYtOTjQyx6sE2WUtc+5CInBIFBeRqic32SgVZpcm1L/2rI5afCtMDu9NFNpNDhZZajm4kg9cRQTdwWIjPHYlUObwhlxK5YwhU4qa3jZ66DNWihHaSGhiBbpmQyO/2QesQ8IO+viTfq5e0CYaxqYZjrpI9c4pW0M1591xypeLeWYByxqjumjtL79sc1mHvTFrvb8/roHIt9KyZqEDbiGbWRa8uC8yCdsKtmZKhGkl1lBUJ7QBLvgLfsh2DKt5IZUZBeMcpA1MU4Qj8GgJzalMQliIIqHlA/jNBxaAp/tXOqrh5/jvfI8jHv2HPhUs2d0KSM6VPU3+1TN9iBMP0G5xj7hjSFC2wN6n3/qadMV0wauGMpBUftaq4aREVf+Le7+5bm1pU0rBkuhn0W4fqC6dWIRbB8+FdBUD76FfFaauZXd3uhVMi96sh2bgqXjBzh+jhl8Yb6Z9OYiF4W+PIC+p/HmnYkKR3eTpzsh1JzUjmNHxjEYSg30+l4e//CoYvjD67eKv76yl2ZIL73JWm/KFsQEp8h+cPegwqvjXmmXSDLI44SkyfnJkLL87ZOziOgsacVK4f22R3nL4SbbFfONu6rvHCISHWVbpjBXwammzsPqVcq5k5U6rEfJD9gepRNyBvNm+bKlV9jQAKwCFs2+wO1kpibzdE0WqqkvByeSZWjelpyIqba44Bcc8r9B89+g/ymiP6jeFLxT1QhUXT8rehN3ZRSxZ+c+VdXvsg2xZUN5dhtpo3XMvhBbYCvSgFtkBdJ8AJU8hL+gPR9Ovlb+hA8WTC38itj4wdR0vXLRmj1xbSOdAqm9ih3r+WuWQ+c+dx8fdLUcZA0XR79v7FpvPxl4TuiXOG7QiiaNFf0jhDC5MBkm0f2HtSvytWH1fJXsRkChhfjMYL9mXfu5f4dqknS8bQDVxMq3MHiEXy8zYGr5DW1nKck1I/EJ3hg5qt32Dpcv+vDz0PzDle1HJE/55F6VLIjrbadC8PrOTqWmH2q1FChKysqnDe/VFuk2W+6RDt/fkm+rucqyx8Fvv7GnsYTW/cczFvJW2X9Tv2erfrW7W/V79pXpfNSssDdn8fTQmI94YyOMiBfR1h7FUvNzvGFWfn5WYXjXxk5w3qKZUZVCa2SH47UshZkdjNO3oxmRk5WLhULipZbdy1YsOuMYWxnik3NunH27EHJGav1gARITo8hHpACHEoJy5eVG0uNE0uzK5blt9d//8OPP/w0lsu6LLviv1SpscK45NuM/cEDqCu8f1ammL3+ETLAM9K6Opwj5eEDuAobwJRSDtRsZ6bW0lOqz0i40jM39xrnuYrHFxrG508oCE0oLLjwa2l/XE6hXaDRHSQnic8uXXOWlaSEsdPrF/vHQaSf4PGLp53aupGZFjDMvUw/5Zl+Gph/KF4uu1Gf/jC9/obMhHHQ2WlKyUJSJZ2Oc3ELdRH7Z+DG5XCG9X/h9ubF7ifbnhHeu0vVbNvexTVKDX5eRAtmVy/VOZ88vki9XHPXV7FYXbDAOk/nzHKDVcA9/9V7ossKEwvZ+7zdJetPdWQuVuWzptA6DO4rbwfEYxkyKr3yrWITInY22ziWKQL/igwL9fqFlQUTU8UYXQl12YbvdXmlI3BU9mxQFp7a1TU3Khi4i5cUK+a9MX+mU7VMewcs1zhVZzNvKOYVR++7qxRF8me29fZsI4sJkM6HgHjMnt5tzxTLKxUgO1J05zvrmwXXFn4HX1JoUxHu7UuS+iU9N7qXtv107rel3dd7lwAlPO/whllrZ85cO2vDL4aBC6v7Xx6Tp71mWec023JybGbnTcOMbctxmm+iqffONCdbYBK2JJtha/a0ViJH85cKtuRYUpINR6yqiWX2VU6T076ybKI1s0afnGJJzoVzPtcaTfNmmWeb5oOjYwgAY8fYOJgKqDD9AF4J8AywpG4Axo4yI41/E26B9SiApr/BBwKi1AfPDyDpIKz8UNw1vWtS73SNKjilhHB/kHPgn/UlOtL8f5TUqbmOyT3zD9OUjPAGH+pm4/vQDy2z/lP072/UT3udmd4PfKjC3OyBbWK3a4bxf8ZbTegGhPzFUedSNQu9ODRWY1BnT8w7kJNMGAlO6r3YtQzc+HhnGaoQJ7FC/MeyCsIg3Q2JFE5JTJNeh+T2jK1dGMQoRQZs2oUQae2HOLVP4kF6SwJIn0MiM78kBulfSO4mfHOFzV5GNAgEkxs73JUqsmzFbLzLYBcDofuy10EnLjN5PpNrF0xABFrFEknJLiBa3NIq5OOXvUEQKB5r5YHEjIMYd2ezFm2JjFQhGaEBAZOIJs6wE90lKRGre2y+v2XAVhQQNKdwndOSE4PGz+Vl5DiEE6aIq1lPqiZKbAWIOAuPiEb5IW78BkmCa67CxXTeA+Q7LsOR4GPdsqQ7i9eUsW8JN7yJbdcivtYuJ6+gSLESpcqUq1CpSrUaterUMzZHhVCn4pVA63OpdYZrr0gNEDEwXWRSaGSJa0fMUMqvCqAEQbXlRm7i1MIk+a+BoRtCtZASYqwx7LR0BNIEgIkiOinpEg==') format('woff2'),
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-home:before {
content: "\e639";
}
.icon-operation:before {
content: "\e638";
}
.icon-bigScreen:before {
content: "\e74d";
}
.icon-edit:before {
content: "\e74c";
}
.icon-cart:before {
content: "\e74e";
}
.icon-sign:before {
content: "\e74f";
}
.icon-book:before {
content: "\e750";
}
.icon-level:before {
content: "\e751";
}
.icon-finish:before {
content: "\e752";
}
.icon-location:before {
content: "\e753";
}
.icon-time:before {
content: "\e755";
}
.icon-accept:before {
content: "\e756";
}
.icon-bg-chat:before {
content: "\e757";
}
.icon-see:before {
content: "\e758";
}
.icon-auth:before {
content: "\e759";
}
.icon-ci:before {
content: "\e75a";
}

View File

@ -17,3 +17,22 @@
height: auto;
max-height: calc(100vh - 130px);
}
.txt-ellipsis{
display: -webkit-inline-box;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.clamp1{
-webkit-line-clamp: 1;
line-height: 1.5;
max-height: calc(1.5em * 1);
}
.clamp2{
-webkit-line-clamp: 2;
line-height: 1.5;
max-height: calc(1.5em * 2);
}

View File

@ -45,15 +45,20 @@ const errorHandler = async (error) => {
*/
publicAxios.interceptors.request.use(async (config) => {
const UserStore = useUserStore();
config.baseURL = config.isUpload ? VITE_APP_UPLOAD_API : VITE_APP_BASE_API;
switch (config.apisType) {
case 'upload': {
config.baseURL = VITE_APP_UPLOAD_API;
config.headers['Content-Type'] = config.uploadType;
break;
}
default: {
config.baseURL = VITE_APP_BASE_API;
}
}
if (UserStore.hasToken()) {
config.headers['fairies-auth-token'] = config.headers['fairies-auth-token'] ?? UserStore.token;
config.headers['fairies-org-id'] = UserStore.currentOrg;
config.headers['authorization'] = config.headers['authorization'] ?? UserStore.token;
config.headers['cache-control'] = 'no-cache';
config.headers.Pragma = 'no-cache';
if (config?.isUpload) {
config.headers['Content-Type'] = config.uploadType;
}
}
if (config.method === 'POST' || config.method === 'DELETE') {
config.headers.Accept = 'application/json';

View File

@ -18,7 +18,7 @@ const whiteList = ['/login', '/auth-redirect']; // 设置白名单
router.beforeEach(async (to, from, next) => {
NProgress.start();
if (typeof to.meta.title === 'string') {
document.title = 'SUB-ADMIN | ' + to.meta.title || '管理系统';
document.title = '运营服务 | ' + to.meta.title || '管理系统';
}
const userStore = useUserStore();
@ -31,14 +31,16 @@ router.beforeEach(async (to, from, next) => {
} else {
try {
const PermissionStore = usePermissionStore();
// 路由添加进去了没有及时更新 需要重新进去一次拦截
if (!PermissionStore.routes.length) {
// 获取权限列表进行接口访问 因为这里页面要切换权限
const accessRoutes = await PermissionStore.generateRoutes(userStore.roles);
accessRoutes.forEach((item) => router.addRoute(item)); // 动态添加访问路由表
next({ ...to, replace: true }); // 这里相当于push到一个页面 不在进入路由拦截
accessRoutes.forEach((item) => router.addRoute(item));
return next({ ...to, replace: true });
} else {
next(); // 如果不传参数就会重新执行路由拦截,重新进到这里
if (from.path.includes('/sub') && to.path.includes('/platform')) {
window.location.reload();
return;
}
next();
}
} catch (error) {
next(`/login?redirect=${to.path}`);

View File

@ -0,0 +1,48 @@
<template>
<div class="ecommerce-banner" :style="{ height: height }">
<el-carousel height="height" motion-blur>
<el-carousel-item v-for="(item, index) in list" :key="index">
<img :src="getAssetsFile(item)" />
</el-carousel-item>
</el-carousel>
</div>
</template>
<script setup>
import { ref, reactive, onMounted, watch } from 'vue';
import { isEmpty, getAssetsFile } from '@/utils';
const props = defineProps({
height: { type: String, default: '320px' },
name: { type: String, default: 'agricultural' },
imglist: {
type: Array,
default: () => {
return [];
},
},
});
let nameVal = ref(props.name);
let list = reactive(props.imglist);
watch(
() => (props.list, props.imglist),
() => {
nameVal.value = props.name;
list = props.imglist;
},
{
immediate: true,
}
);
</script>
<style lang="scss" scoped>
.ecommerce-banner {
width: 100%;
::v-deep() {
.el-carousel__item {
border-radius: 16px !important;
}
}
}
</style>

View File

@ -0,0 +1,55 @@
<template>
<div class="ecommerce-common-warp">
<div class="ecommerce-common-content">
<div class="left-menu">
<slot v-if="$slots.left" name="left"></slot>
<template v-else>
<leftMenu :current-name="currentName"></leftMenu>
</template>
</div>
<div class="common-content">
<slot v-if="$slots.main" name="main"></slot>
<template v-else></template>
</div>
</div>
</div>
</template>
<script setup>
import { ref, reactive, onMounted, watch } from 'vue';
import leftMenu from './leftMenu.vue';
const props = defineProps({
currentName: { type: String, default: 'agricultural' },
});
</script>
<style lang="scss" scoped>
.ecommerce-common-warp {
width: 100%;
height: calc(100vh - 230px);
text-align: center;
.ecommerce-common-content {
width: $width-main;
margin: auto;
height: 100%;
display: inline-flex;
justify-content: space-between;
.left-menu,
.common-content {
height: 100%;
min-height: 100%;
border-radius: 8px;
padding: 8px;
overflow-y: auto;
}
.left-menu {
width: 240px;
background: $color-fff;
}
.common-content {
width: calc(100% - 240px);
margin-left: 16px;
}
}
}
</style>

View File

@ -0,0 +1,162 @@
<template>
<div class="filter-top-warp">
<div v-for="(n, index) in maxLevelAndNodes.LevelKey" :key="index" class="filter-item">
<div class="single-item">
<div class="single-li all" :class="maxLevelAndNodes.LevelVal[n].id == '' ? 'li-act' : ''" @click="selectAll(n)">全部</div>
<div class="not-all">
<div
v-for="(m, indexm) in handlelist(n)"
:key="indexm"
class="single-li"
:class="select[n].id == m.id && ((m.pId && select[n].pId == m.pId) || !m.pId) ? 'li-act' : ''"
@click="selectItem(index, n, m)"
>
{{ m.title }}
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref, reactive, onMounted, watch, computed } from 'vue';
import { isEmpty, getAssetsFile } from '@/utils';
const props = defineProps({
list: {
type: Array,
default: () => {
return [];
},
},
});
let treeList = reactive([]);
watch(
() => props.list,
() => {
treeList = props.list;
},
{
immediate: true,
}
);
const currentLevel = ref(null);
//
const maxLevelAndNodes = computed(() => {
let maxLevel = 0;
const levelMap = {}; //
let LevelKey = [];
let LevelVal = {};
// 使
const stack = [];
// 1
for (const node of treeList) {
stack.push({ node, level: 1 });
}
//
while (stack.length > 0) {
const { node, level } = stack.pop(); //
//
maxLevel = Math.max(maxLevel, level);
//
if (!levelMap[level]) {
levelMap[level] = [];
}
levelMap[level].push(node);
LevelVal[level] = { id: '', pId: node.pId ? node.pId : '' };
//
if (node.children) {
for (const child of node.children) {
stack.push({ node: child, level: level + 1 });
}
}
}
LevelKey = Object.keys(levelMap);
return { maxLevel, levelMap, LevelKey, LevelVal };
});
const select = reactive(maxLevelAndNodes.value.LevelVal);
const handlelist = (key) => {
if (!key || !maxLevelAndNodes.value.levelMap[key]) return [];
let LevelKey = maxLevelAndNodes.value.LevelKey || [];
const originalList = maxLevelAndNodes.value.levelMap[key];
const parentKey = String(Number(key) - 1); // key
const parentVal = select[parentKey]; //
//
if (LevelKey[0] === key || !parentVal || parentVal.id === '') {
return originalList;
}
// pId
if (parentVal && parentVal.id) {
return originalList.filter((m) => m.pId === parentVal.id);
}
//
return [];
};
const selectItem = (index, key, item) => {
if (key && item.id) {
currentLevel.value = index || 0;
select[key] = { id: item.id, pId: item.pId ? item.pId : null };
emit('select', select);
}
};
const selectAll = (key) => {
select[key].id = '';
emit('select', select);
};
const emit = defineEmits(['select']);
</script>
<style lang="scss" scoped>
.filter-top-warp {
width: 100%;
border-radius: 16px;
background: $color-fff;
padding: 16px;
text-align: left;
.filter-item {
width: 100%;
}
.single-item {
width: 100%;
display: inline-flex;
justify-content: flex-start;
.single-li {
display: inline-block;
cursor: pointer;
margin: 10px;
font-size: 18px;
&.all {
width: 60px;
}
&.li-act {
color: $color-main;
}
}
.not-all {
display: inline-flex;
justify-content: flex-start;
width: calc(100% - 60px);
flex-wrap: wrap;
.single-li {
}
}
}
}
</style>

View File

@ -0,0 +1,76 @@
<template>
<div class="c-goods-item-warp">
<div class="goods-img">
<el-image :src="getAssetsFile('images/ecommerce/' + 'pic.png')" fit="cover" />
</div>
<div class="goods-name txt-ellipsis clamp2">{{ '遇合堂新款禽泰克家禽通用药250遇合堂新款禽泰克家禽通用药250' }}</div>
<div class="goods-do">
<div class="price txt-ellipsis clamp">25.00</div>
<div class="do">
<div class="iconfont icon-cart"></div>
</div>
</div>
</div>
</template>
<script setup>
import { isEmpty, getAssetsFile } from '@/utils';
</script>
<style lang="scss" scoped>
.c-goods-item-warp {
width: 100%;
padding: 8px;
.goods-img {
width: 100%;
height: 168px;
border-radius: 16px;
overflow: hidden;
::v-deep() {
.el-image {
width: 100%;
height: 168px;
}
}
}
.goods-name {
margin-top: 8px;
font-size: 16px;
color: $color-666;
}
.goods-do {
display: inline-flex;
width: 100%;
justify-content: space-between;
.price {
width: calc(100% - 32px);
text-align: left;
font-size: 22px;
padding-right: 8px;
color: $color-main;
font-weight: 700;
}
.price::before {
content: ' ¥';
font-size: 16px !important;
font-weight: normal !important;
}
.do {
display: inline-block;
width: 32px;
height: 32px;
border-radius: 50%;
text-align: center;
background: $color-main;
position: relative;
cursor: pointer;
.iconfont {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
color: $color-fff;
font-size: 20px;
}
}
}
}
</style>

View File

@ -0,0 +1,97 @@
<template>
<div class="hot-goods-word-clould" :style="{ height: height }">
<custom-echart-word-cloud :chart-data="chartsData.valData" height="100%" :option="chartsData.option" />
</div>
</template>
<script setup>
import { ref, reactive, onMounted } from 'vue';
const props = defineProps({
height: {
type: String,
default: '200px',
},
});
const chartsData = reactive({
option: {
backgroundColor: 'transparent',
tooltip: {
show: true,
textStyle: {
fontSize: '16',
color: '#3c3c3c',
},
backgroundColor: '#fff',
borderColor: '#ddd',
borderWidth: 1,
},
series: [],
},
valData: [
{
type: 'wordCloud',
//
gridSize: 22,
// circle cardioid diamond
// triangle-forward triangle star
shape: 'circle',
//
sizeRange: [10, 30],
//
rotationRange: [0, 0],
//
rotationStep: 90,
//
// maskImage: maskImage,
left: 'center',
top: 'center',
right: null,
bottom: null,
//
width: '90%',
//
height: '90%',
//
drawOutOfBound: false,
textStyle: {
color: function () {
const colors = ['#165DFF', '#6aca37', '#05a4b6', '#f93920', '#f0b114', '#ab1489', '#149cab', '#ab1414', '#27b30f', '#7e11b3', '#11b32e'];
return colors[parseInt(Math.random() * colors.length)];
},
emphasis: {
shadowBlur: 10,
shadowColor: '#2ac',
},
},
data: [
{ value: 11.7392043070835, name: '有机白菜' },
{ value: 9.23723855786, name: '土鸡蛋' },
{ value: 7.75434839431, name: '猪肉' },
{ value: 11.3865516372, name: '牛肉' },
{ value: 7.75434839431, name: '零添加' },
{ value: 5.83541244308, name: '原产地' },
{ value: 15.83541244308, name: '菠萝' },
{ value: 2.83541244308, name: '甘蔗' },
{ value: 5.83541244308, name: '土豆' },
{ value: 10.83541244308, name: '绿色' },
{ value: 5.83541244308, name: '美味' },
{ value: 5.83541244308, name: '特产' },
],
},
],
});
onMounted(() => {
if (chartsData.valData && chartsData.valData.length) {
chartsData.valData.forEach((m, index) => {
let num = 100;
m.value = (Number(m.value) + Math.random() + num).toFixed(2);
});
}
});
</script>
<style lang="scss" scoped>
.hot-goods-word-clould {
height: 100%;
}
</style>

View File

@ -0,0 +1,142 @@
<template>
<div class="c-land-item-warp" @click="toDetail">
<div class="land-img">
<el-image :src="getAssetsFile('images/ecommerce/' + 'pic.png')" fit="cover" />
</div>
<div class="land-info">
<div class="land-info-pos">
<div class="land-info-c">
<div class="land-name txt-ellipsis clamp2">{{ '遇合堂新款禽泰克家禽通用药250遇合堂新款禽泰克家禽通用药250' }}</div>
<div class="tag-list">
<el-tag type="primary" size="small">现场核实</el-tag>
<el-tag type="primary" size="small">官方发布</el-tag>
<el-tag type="primary" size="small">优质地源</el-tag>
</div>
<div class="type-list">
<div class="type-val">100</div>
<div class="type-val">耕地</div>
<div class="type-val">蔬菜瓜果类</div>
<div class="type-val">水浇地</div>
<div class="type-val">10年起租</div>
</div>
<div class="addr">
<div class="iconfont icon-location"></div>
{{ '临沧市·耿马县' }}
</div>
<div class="land-do">
<div class="price txt-ellipsis clamp">25.00</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { isEmpty, getAssetsFile } from '@/utils';
import { useRoute, useRouter } from 'vue-router';
const route = useRoute();
const router = useRouter();
const toDetail = () => {
let id = '01';
router.push('/sub-operation-service/landDetail?id' + id);
};
</script>
<style lang="scss" scoped>
.c-land-item-warp {
width: 100%;
padding: 8px;
background: $color-fff;
border-radius: 16px;
margin-bottom: 16px;
cursor: pointer;
.land-img,
.land-info {
display: inline-block;
vertical-align: top;
}
.land-img {
width: 200px;
height: 200px;
border-radius: 16px;
overflow: hidden;
::v-deep() {
.el-image {
width: 100%;
height: 100%;
}
}
}
.land-info {
width: calc(100% - 200px);
padding-left: 16px;
height: 200px;
.land-info-pos {
width: 100%;
height: 100%;
display: inline-flex;
justify-content: space-around;
flex-direction: column;
.land-info-c {
width: 100%;
}
}
}
.land-name {
margin-bottom: 3px;
font-size: 16px;
color: $color-666;
}
.tag-list {
width: 100%;
text-align: left;
.el-tag {
margin-right: 5px;
}
}
.type-list {
width: 100%;
text-align: left;
.type-val {
display: inline-block;
margin: 3px 8px 0 0;
font-size: 14px;
color: $color-999;
}
}
.addr {
width: 100%;
text-align: left;
font-size: 14px;
margin-top: 8px;
.iconfont {
display: inline-block;
margin-right: 3px;
font-size: 20px;
color: $color-666;
vertical-align: middle;
}
}
.land-do {
display: inline-flex;
width: 100%;
justify-content: space-between;
.price {
width: calc(100% - 0px);
text-align: left;
font-size: 22px;
padding-right: 8px;
color: $color-main;
font-weight: 700;
}
.price::before {
content: '¥';
font-size: 16px !important;
font-weight: normal !important;
}
.price::after {
content: '/年';
}
}
}
</style>

View File

@ -0,0 +1,84 @@
<template>
<div class="ecommerce-left-menu-warp">
<div class="left-menu">
<view v-for="(n, index) in leftMenu" :key="index" class="left-menu-item" :class="currentIndex == index ? 'active' : ''" @click="toLink(index)">
<div class="item-img">
<img :src="getAssetsFile('images/ecommerce/' + n.icon)" />
</div>
<span class="item-title">{{ n.title }}</span>
</view>
</div>
</div>
</template>
<script setup name="home">
import { ref, reactive, onMounted, watch } from 'vue';
import { isEmpty, getAssetsFile } from '@/utils';
import { useRoute, useRouter } from 'vue-router';
const route = useRoute();
const router = useRouter();
const props = defineProps({
currentName: { type: String, default: 'agricultural' },
});
const leftMenu = reactive([
{ name: 'agricultural', title: '农资交易', icon: 'menu2.png', path: '/sub-operation-service/ecommerce' },
{ name: 'supplier', title: '供应商服务', icon: 'menu1.png', path: '/sub-operation-service/supplier' },
{ name: 'purchaser', title: '采购商服务', icon: 'menu3.png', path: '/sub-operation-service/purchaser' },
{ name: 'land', title: '土地交易', icon: 'menu4.png', path: '/sub-operation-service/land' },
]);
let currentIndex = ref(0);
watch(
() => props.currentName,
() => {
console.info('currentName', props.currentName);
currentIndex.value = leftMenu.findIndex((m) => {
return m.name == props.currentName;
});
},
{ deep: true, immediate: true }
);
const toLink = (index) => {
currentIndex.value = index;
let path = index != undefined ? leftMenu[index].path : null;
if (path) {
router.push(path);
}
};
</script>
<style lang="scss" scoped>
.ecommerce-left-menu-warp {
width: 100%;
height: 100%;
.left-menu {
.left-menu-item {
width: 100%;
display: inline-flex;
justify-content: flex-start;
padding: 16px 0;
cursor: pointer;
&.active {
color: $color-main;
}
.item-img,
.item-title {
vertical-align: middle;
}
.item-img {
display: inline-block;
width: 32px;
height: 32px;
}
.item-title {
display: -webkit-inline-box;
font-size: 20px;
font-weight: 400;
padding-left: 8px;
}
}
}
}
</style>

View File

@ -0,0 +1,235 @@
<template>
<div class="market-charts" :style="{ height: height }">
<custom-echart-line-line :chart-data="chartsData.valData" height="100%" :option="chartsData.option" />
</div>
</template>
<script setup>
import { ref, reactive, onMounted, computed } from 'vue';
const props = defineProps({
height: {
type: String,
default: '200px',
},
});
const legendData = reactive(['苹果', '小麦', '白菜']);
let linearColors = reactive([
[
{ offset: 0, color: 'rgba(15, 155, 179,0.1)' },
{ offset: 0.6, color: 'rgba(15, 155, 179,0.5)' },
{ offset: 1, color: 'rgba(15, 155, 179,1)' },
],
[
{ offset: 0, color: 'rgba(106, 202, 55,0.1)' },
{ offset: 0.6, color: 'rgba(106, 202, 55,0.5)' },
{ offset: 1, color: 'rgba(106, 202, 55,1)' },
],
[
{ offset: 0, color: 'rgba(141, 76, 181,0.1)' },
{ offset: 0.6, color: 'rgba(141, 76, 181,0.5)' },
{ offset: 1, color: 'rgba(141, 76, 181,1)' },
],
]);
const lineColors = reactive(['#0f9bb3', '#6aca37', '#8d4cb5']);
const currentYear = ref(new Date().getFullYear() + 1);
const xPoint = computed(() => {
let list = [];
console.info('111', currentYear.value);
let minYear = currentYear.value - 10;
for (let i = minYear; i < currentYear.value; i++) {
list.push(i);
}
return list;
});
let numList = reactive([10, 100, 80]);
const dataNum = (num) => {
let data = [];
if (xPoint.value && xPoint.value.length && xPoint.value.length > 0 && num) {
xPoint.value.forEach((n) => {
let numVal = Number(Number(n) * 0.1 + num + Math.random() * 100).toFixed(2);
data.push(numVal);
});
}
return data;
};
const series = () => {
let list = [];
if (legendData && legendData.length && legendData.length > 0) {
// console.info('legendData', legendData);
legendData.forEach((m, index) => {
let val = {
name: m,
type: 'line',
symbol: 'none', //
smooth: true,
lineStyle: {
normal: {
width: 1,
color: lineColors[index], // 线
},
},
areaStyle: {
normal: {
//线4x0,y0,x2,y2(0~1);true
color: {
type: 'linear', // 线
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: linearColors[index],
global: false, // false
},
},
},
data: [],
};
val.data = dataNum(numList[index]);
list.push(val);
});
}
return list;
};
const chartsData = reactive({
option: {
backgroundColor: 'transparent',
grid: {
left: 20,
right: 20,
bottom: '5%',
top: '20%',
containLabel: true,
},
tooltip: {
trigger: 'axis',
borderWidth: 1,
borderColor: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [
{
offset: 0,
color: 'rgba(85, 149, 233, .6)', // 0%
},
{
offset: 1,
color: 'rgba(85, 149, 233, 0)', // 100%
},
],
global: false, // false
},
padding: [0, 8, 0, 8],
textStyle: {
color: '#fff',
},
axisPointer: {
lineStyle: {
type: 'dashed',
color: 'rgba(255, 255, 255, .6)',
},
},
extraCssText: 'box-shadow: 2px 2px 16px 1px rgba(0, 39, 102, 0.16)',
formatter: function (params) {
let content = `<div style='font-size: 14px; color: #666;text-align:left'>${params[0].name}</div>`;
if (Array.isArray(params)) {
for (let i = 0; i < params.length; i++) {
content += `
<div style='display: flex; align-items: center;color: #666;'>
<div style='width: 10px; height: 10px;border-radius:4px;background: ${params[i].color}; margin-right: 8px;'></div>
<div style='font-size: 12px; margin-right: 8px;'>${params[i].seriesName}</div>
<div style='font-size: 14px;'>${params[i].value}</div>
</div>
`;
}
}
return content;
},
},
legend: {
show: true,
data: Array.from(legendData),
left: 'center', // 10%
top: '0', //
itemWidth: 15, //
itemHeight: 8, //
textStyle: {
fontSize: 10, //
color: '#333', //
},
},
xAxis: {
type: 'category',
boundaryGap: false,
axisLabel: {
interval: 0, // 1
textStyle: {
color: '#666',
fontStyle: 'normal',
fontSize: 10,
},
},
axisTick: {
show: false,
},
axisLine: {
// 线
lineStyle: {
color: 'rgba(77, 128, 254, 1)',
},
},
splitLine: {
show: false,
},
data: xPoint.value,
},
yAxis: {
type: 'value',
name: ' ',
nameTextStyle: {
color: '#666',
fontSize: 14,
padding: [0, 0, 0, -30],
},
axisLabel: {
interval: 0, // 1
textStyle: {
color: '#666',
fontStyle: 'normal',
fontSize: 12,
},
},
axisTick: {
show: false,
},
axisLine: {
// 线
lineStyle: {
color: 'rgba(77, 128, 254, 0.2)',
},
},
splitLine: {
show: false,
},
},
series: series(),
},
});
onMounted(() => {});
</script>
<style lang="scss" scoped>
.market-charts-charts {
height: 100%;
}
</style>

View File

@ -0,0 +1,151 @@
<template>
<div class="purchaser-popup-warp">
<el-dialog v-model="isShow" title="采购报价" width="800" :before-close="doCancel">
<el-form ref="ruleFormRef" :model="ruleForm" status-icon :rules="rules" label-width="auto" class="custom-form">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="商品分类" prop="typeId">
<el-cascader v-model="ruleForm.typeId" :options="treeList" :props="treeOption" clearable :placeholder="'请选择分类'" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="收购价格" prop="price">
<el-input-number v-model="ruleForm.price" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="采购商品" prop="goods">
<el-input v-model="ruleForm.goods" style="width: 200px" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="收购数量" prop="num">
<el-input-number v-model="ruleForm.num" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="收货地址" prop="addr">
<el-input v-model="ruleForm.addr" :rows="2" type="textarea" :placeholder="'收货地址'" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label=" " prop="isPickup">
<el-radio-group v-model="ruleForm.isPickup">
<el-radio v-for="(n, index) in pickupOptions" :key="index" :value="n.value">{{ n.label }}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="采购说明" prop="remark">
<el-input v-model="ruleForm.remark" :rows="2" type="textarea" :placeholder="'采购说明'" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="doCancel">取消</el-button>
<el-button type="primary" @click="doSure"> 确定 </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup>
import { ref, reactive, onMounted, watch } from 'vue';
import { isEmpty, getAssetsFile } from '@/utils';
import { useRoute, useRouter } from 'vue-router';
import { fa } from 'element-plus/es/locale/index.mjs';
const route = useRoute();
const router = useRouter();
const props = defineProps({
list: {
type: Array,
default: () => {
return [];
},
},
});
let treeList = reactive([]);
let ruleForm = reactive({
typeId: '',
price: '',
goods: '',
num: '',
addr: '',
isPickup: 1,
remark: '',
});
const pickupOptions = reactive([
{ label: '可上门收货', value: 1 },
{ label: '不上门收货', value: 0 },
]);
let ruleFormRef = ref(null);
const treeOption = ref({
children: 'children',
label: 'title',
});
watch(
() => props.list,
() => {
treeList = props.list;
},
{
immediate: true,
}
);
let isShow = ref(false);
const doShow = () => {
isShow.value = true;
};
const doHide = () => {
isShow.value = false;
};
const doCancel = () => {
doHide();
};
const doSure = () => {
doHide();
};
const rules = reactive({
typeId: [{ required: true, message: '请选择商品分类', trigger: ['blur', 'change'] }],
price: [{ required: true, message: '请输入采购价格', trigger: ['blur', 'change'] }],
goods: [{ required: true, message: '请输入采购商品', trigger: ['blur', 'change'] }],
num: [{ required: true, message: '请输入采购数量', trigger: ['blur', 'change'] }],
addr: [{ required: true, message: '请填入详细地址', trigger: ['blur', 'change'] }],
isPickup: [{ required: true, message: '请选择是否上门取货', trigger: ['blur', 'change'] }],
remark: [{ required: false, message: '请输入补充说明', trigger: ['blur', 'change'] }],
});
defineExpose({
doShow,
doHide,
});
</script>
<style lang="scss" scoped>
.purchaser-popup-warp {
}
.custom-form {
::v-deep() {
.el-form-item__label {
font-size: 18px !important;
color: $color-999 !important;
font-weight: 400 !important;
}
.el-radio__label {
font-size: 18px;
color: $color-333;
}
}
}
</style>

View File

@ -0,0 +1,125 @@
<template>
<div class="type-top-warp">
<div class="filter-item">
<div class="single-item">
<div class="item-title">{{ titleVal || ' ' }}</div>
<div class="single-li all" :class="!select ? 'li-act' : ''" @click="selectAll()">全部</div>
<div class="not-all">
<div
v-for="(m, indexm) in listVal"
:key="indexm"
class="single-li"
:class="select && select.id == m.id ? 'li-act' : ''"
@click="selectItem(m)"
>
{{ m.title }}
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import { ref, reactive, onMounted, watch, computed } from 'vue';
import { isEmpty, getAssetsFile } from '@/utils';
const props = defineProps({
list: {
type: Array,
default: () => {
return [];
},
},
//
name: {
type: String,
default: '',
},
title: {
type: String,
default: '选择分类',
},
});
const emit = defineEmits(['select']);
let listVal = reactive([]);
let titleVal = ref(props.title);
let nameVal = ref(props.name);
let select = ref(null);
watch(
() => (props.list, props.title, props.name),
() => {
listVal = props.list;
titleVal.value = props.title;
nameVal.value = props.name;
},
{
immediate: true,
}
);
const selectItem = (item) => {
select.value = item || null;
emit('select', { select: select.value, nameVal: nameVal.value });
};
const selectAll = (key) => {
select.value = null;
emit('select', { select: select.value, nameVal: nameVal.value });
};
const clearSelect = () => {
select.value = null;
};
defineExpose({
clearSelect,
});
</script>
<style lang="scss" scoped>
.type-top-warp {
width: 100%;
text-align: left;
.filter-item {
width: 100%;
}
.single-item {
width: 100%;
display: inline-flex;
justify-content: flex-start;
.item-title {
display: -webkit-inline-box;
color: $color-999;
font-size: 20px;
width: 120px;
vertical-align: top;
font-weight: 500;
line-height: 40px;
}
.single-li {
display: inline-block;
cursor: pointer;
margin: 10px;
font-size: 18px;
&.all {
width: 60px;
}
&.li-act {
color: $color-main;
}
}
.not-all {
display: inline-flex;
justify-content: flex-start;
width: calc(100% - 180px);
flex-wrap: wrap;
.single-li {
}
}
}
}
</style>

View File

@ -0,0 +1,85 @@
<template>
<div>
<common current-name="agricultural">
<template #main>
<banner :imglist="bannerList"></banner>
<filtertop :list="treeList"></filtertop>
<div class="goods-list-warp">
<div class="goods-list">
<template v-for="(n, index) in 16" :key="index">
<div class="goods-item">
<goodsItem></goodsItem>
</div>
</template>
</div>
</div>
</template>
</common>
</div>
</template>
<script setup name="ecommerce">
import common from './components/common.vue';
import banner from './components/banner.vue';
import filtertop from './components/filtertop.vue';
import goodsItem from './components/goodsItem.vue';
import { ref, reactive, onMounted, watch, computed } from 'vue';
let treeList = reactive([
{
id: '01',
title: '农用百货',
children: [
{ pId: '01', id: '0101', title: '农具' },
{ pId: '01', id: '0102', title: '农机' },
{ pId: '01', id: '0103', title: '灌溉设备' },
{ pId: '01', id: '0104', title: '防护用品' },
],
},
{
id: '02',
title: '肥料',
children: [
{ pId: '02', id: '0101', title: '有机肥' },
{ pId: '02', id: '0102', title: '水溶肥' },
{ pId: '02', id: '0103', title: '天然肥料' },
],
},
{
id: '03',
title: '农药',
children: [
{ pId: '03', id: '0101', title: '杀虫剂' },
{ pId: '03', id: '0102', title: '杀菌剂' },
{ pId: '03', id: '0103', title: '除草剂' },
{ pId: '03', id: '0104', title: '杀螨剂' },
],
},
]);
let bannerList = reactive(['images/ecommerce/' + 'banner.png', 'images/ecommerce/' + 'banner.png']);
</script>
<style lang="scss" scoped>
.goods-list-warp {
width: 100%;
margin-top: 16px;
.goods-list {
width: 100%;
display: inline-flex;
flex-wrap: wrap;
justify-content: space-around;
gap: 10px;
.goods-item {
display: inline-block;
width: calc((100% - 50px) / 5);
background: $color-fff;
border-radius: 16px;
overflow: hidden;
margin-bottom: 16px;
}
}
/* 添加伪元素占位 */
.goods-list::after {
content: '';
flex: auto;
}
}
</style>

View File

@ -0,0 +1,328 @@
<template>
<div class="land-index-warp">
<common current-name="land">
<template #main>
<banner :imglist="bannerList"></banner>
<div class="land-filter-top">
<div v-if="!isHide">
<typetop ref="arearef" :list="LevelOne" :name="'area'" title="选择地区" @select="doSelect"></typetop>
<typetop ref="uesdref" :list="landUse" :name="'uesd'" title="选择土地" @select="doSelect"></typetop>
<typetop ref="typeref" :list="landType" :name="'type'" title="土地用途" @select="doSelect"></typetop>
<typetop ref="productref" :list="landProduct" :name="'product'" title="种养殖产物" @select="doSelect"></typetop>
<typetop ref="circulationref" :list="landCirculation" :name="'circulation'" title="土地流转" @select="doSelect"></typetop>
<div class="more-filter">
<div class="more-title">更多</div>
<div class="filter-r">
<el-row :gutter="16">
<el-col :span="8">
<el-select v-model="fliter.area" placeholder="请选择面积范围" style="width: 200px">
<el-option v-for="item in areaRange" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-col>
<el-col :span="8">
<el-select v-model="fliter.year" placeholder="请选择流转年限" style="width: 200px">
<el-option v-for="m in yearList" :key="m.value" :label="m.label" :value="m.value" />
</el-select>
</el-col>
<el-col :span="8">
<el-select v-model="fliter.lookType" placeholder="请选择预约带看" style="width: 200px">
<el-option v-for="n in lookType" :key="n.value" :label="n.label" :value="n.value" />
</el-select>
</el-col>
<el-col :span="24" style="margin: 16px 0">
<el-radio-group v-model="fliter.other">
<el-radio v-for="(k, index) in radioList" :key="index" :value="k.value">{{ k.label }}</el-radio>
</el-radio-group>
</el-col>
</el-row>
</div>
</div>
</div>
<div class="select-result">
<div class="title">所选分类</div>
<div class="result-list">
<template v-for="(r, indexr) in selectkeylist" :key="indexr">
<div class="result-item">
<el-tag closable :type="'info'" @close="handleClose(r)">
{{ selectAll[r] && selectAll[r].title ? selectAll[r].title : '' }}
</el-tag>
</div>
</template>
<div class="show-hide" @click="doShowHide">
<el-icon v-if="!isHide"><ArrowUpBold /></el-icon>
<el-icon v-else><ArrowDownBold /></el-icon>
<span>{{ isHide ? '展开' : '收起' }}</span>
</div>
</div>
</div>
<div class="filter-bottom">
<el-row :gutter="16">
<el-col :span="12" align="left">
<div class="result-count">
共匹配到
<span class="count">{{ '0' }}</span>
个结果
</div>
</el-col>
<el-col :span="12" align="right">
<div class="do-set">
<el-icon><Refresh /></el-icon>
<span>重置</span>
</div>
</el-col>
</el-row>
</div>
</div>
<div class="land-reuslt-list">
<el-row class="land-item-warp" :gutter="24">
<template v-for="(land, indexl) in 11" :key="indexl">
<el-col :span="12">
<landItem></landItem>
</el-col>
</template>
</el-row>
</div>
</template>
</common>
</div>
</template>
<script setup name="ecommerce">
import common from './components/common.vue';
import banner from './components/banner.vue';
import typetop from './components/typetop.vue';
import landItem from './components/landItem.vue';
import { ref, reactive, onMounted, watch, computed } from 'vue';
let LevelOne = reactive([
{ id: '01', title: '耿马镇' },
{ id: '02', title: '孟定镇' },
{ id: '03', title: '孟永镇' },
{ id: '04', title: '孟撒镇' },
{ id: '05', title: '勐简乡' },
{ id: '06', title: '大兴乡' },
{ id: '07', title: '四排山乡' },
{ id: '08', title: '贺派乡' },
]);
let landUse = reactive([
{ id: '01', title: '耕地' },
{ id: '02', title: '林地' },
{ id: '03', title: '园地' },
{ id: '04', title: '草地' },
{ id: '05', title: '交通运输用地' },
{ id: '06', title: '水域水利设施用地' },
{ id: '07', title: '其他用地' },
]);
let landType = reactive([
{ id: '01', title: '水田' },
{ id: '02', title: '水浇地' },
{ id: '03', title: '旱地' },
]);
let landProduct = reactive([
{ id: '01', title: '水果坚果类' },
{ id: '02', title: '蔬菜瓜果类' },
{ id: '03', title: '粮食油料类' },
{ id: '04', title: '养殖类' },
{ id: '05', title: '其他' },
]);
let landCirculation = reactive([
{ id: '01', title: '经营权出租' },
{ id: '02', title: '经营权合作' },
{ id: '03', title: '经营权入股' },
{ id: '04', title: '经营权转让' },
{ id: '05', title: '经营权互换' },
{ id: '06', title: '经营权转包' },
{ id: '07', title: '使用权出租' },
{ id: '08', title: '使用权转让' },
{ id: '09', title: '使用权入股' },
{ id: '10', title: '使用权合作' },
]);
let radioList = reactive([
{ value: '01', label: '电话核实' },
{ value: '02', label: '现场核实' },
{ value: '03', label: '现场视频' },
{ value: '04', label: '官方发布' },
{ value: '05', label: '金牌地源' },
{ value: '06', label: '优质地源' },
{ value: '07', label: '地区商家' },
]);
let areaRange = reactive([
{ value: '0', label: '10亩以下' },
{ value: '10', label: '10 ~ 100亩' },
{ value: '100', label: '101 ~ 1000亩' },
{ value: '1000', label: '1001 ~ 5000亩' },
{ value: '5000', label: '5000亩以上' },
]);
let yearList = reactive([
{ value: '0', label: '5年以下' },
{ value: '5', label: '6 ~ 10年' },
{ value: '10', label: '11 ~ 15年' },
{ value: '15', label: '16 ~ 20年' },
{ value: '20', label: '21 ~ 30年' },
{ value: '30', label: '30年以上' },
]);
let lookType = reactive([
{ value: 'reservation', babel: '可预约带看' },
{ value: 'pay', babel: '单词付费带看' },
{ value: 'bond', babel: '保证金带看' },
]);
let bannerList = reactive(['images/ecommerce/' + 'banner3.png', 'images/ecommerce/' + 'banner3.png']);
let isHide = ref(false);
let fliter = reactive({
area: null,
year: null,
lookType: null,
other: null,
});
let selectAll = reactive({});
const doSelect = (data) => {
let { select, nameVal } = data;
selectAll[nameVal] = select;
console.info('doSelect', data);
};
let selectkeylist = computed(() => {
let list = Object.keys(selectAll);
return list;
});
let arearef = ref(null);
let uesdref = ref(null);
let typeref = ref(null);
let productref = ref(null);
let circulationref = ref(null);
const refs = {
arearef,
uesdref,
typeref,
productref,
circulationref,
};
const handleClose = (name) => {
if (name) {
let refName = name + 'ref';
const componentRef = refs[refName];
console.info(' componentRef.value', componentRef.value);
componentRef.value && componentRef.value.clearSelect();
delete selectAll[name];
}
};
const doShowHide = () => {
isHide.value = !isHide.value;
};
</script>
<style lang="scss" scoped>
.land-index-warp {
width: 100%;
.land-filter-top {
width: 100%;
border-radius: 16px;
background: $color-fff;
padding: 16px;
.more-filter {
display: inline-flex;
justify-content: flex-start;
width: 100%;
.filter-r,
.more-title {
display: -webkit-inline-box;
vertical-align: top;
}
.more-title {
color: $color-999;
font-size: 20px;
width: 120px;
vertical-align: top;
font-weight: 500;
line-height: 40px;
}
.filter-r {
}
}
.select-result {
display: inline-flex;
justify-content: flex-start;
width: 100%;
text-align: left;
.title,
.result-list {
display: inline-block;
vertical-align: top;
}
.title {
display: -webkit-inline-box;
color: $color-999;
font-size: 20px;
width: 120px;
vertical-align: top;
font-weight: 500;
line-height: 40px;
}
.result-list {
width: calc(100% - 120px);
padding-right: 30px;
position: relative;
.result-item {
display: inline-block;
margin: 8px;
}
.show-hide {
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
cursor: pointer;
font-size: 16px;
.el-icon {
display: inline-block;
vertical-align: middle;
}
}
}
}
}
.filter-bottom {
width: 100%;
text-align: center;
.result-count {
font-size: 18px;
color: $color-666;
.count {
color: $color-main;
padding: 0 2px;
}
}
.do-set {
font-size: 16px;
color: $color-666;
.el-icon {
display: inline-block;
vertical-align: middle;
font-size: 20px;
}
}
}
.land-reuslt-list {
width: 100%;
margin-top: 24px;
.land-item-warp {
}
}
}
</style>

View File

@ -0,0 +1,113 @@
<template>
<div class="land-detail-warp">
<common current-name="land">
<template #main> </template>
</common>
</div>
</template>
<script setup name="ecommerce">
import common from './components/common.vue';
import { ref, reactive, onMounted, watch, computed } from 'vue';
</script>
<style lang="scss" scoped>
.land-detail-warp {
width: 100%;
.land-filter-top {
width: 100%;
border-radius: 16px;
background: $color-fff;
padding: 16px;
.more-filter {
display: inline-flex;
justify-content: flex-start;
width: 100%;
.filter-r,
.more-title {
display: -webkit-inline-box;
vertical-align: top;
}
.more-title {
color: $color-999;
font-size: 20px;
width: 120px;
vertical-align: top;
font-weight: 500;
line-height: 40px;
}
.filter-r {
}
}
.select-result {
display: inline-flex;
justify-content: flex-start;
width: 100%;
text-align: left;
.title,
.result-list {
display: inline-block;
vertical-align: top;
}
.title {
display: -webkit-inline-box;
color: $color-999;
font-size: 20px;
width: 120px;
vertical-align: top;
font-weight: 500;
line-height: 40px;
}
.result-list {
width: calc(100% - 120px);
padding-right: 30px;
position: relative;
.result-item {
display: inline-block;
margin: 8px;
}
.show-hide {
position: absolute;
right: 0;
top: 50%;
transform: translateY(-50%);
cursor: pointer;
font-size: 16px;
.el-icon {
display: inline-block;
vertical-align: middle;
}
}
}
}
}
.filter-bottom {
width: 100%;
text-align: center;
.result-count {
font-size: 18px;
color: $color-666;
.count {
color: $color-main;
padding: 0 2px;
}
}
.do-set {
font-size: 16px;
color: $color-666;
.el-icon {
display: inline-block;
vertical-align: middle;
font-size: 20px;
}
}
}
.land-reuslt-list {
width: 100%;
margin-top: 24px;
.land-item-warp {
}
}
}
</style>

View File

@ -0,0 +1,286 @@
<template>
<div class="purchaser-index-warp">
<common current-name="purchaser">
<template #main>
<el-row class="purchaser-top">
<el-col :span="12">
<div class="purchaser-top-title">行情动态</div>
<div class="purchaser-charts">
<marketCharts></marketCharts>
</div>
</el-col>
<el-col :span="12">
<div class="purchaser-top-title">近7天热门产品</div>
<div class="purchaser-charts">
<hotGoodsWordClould></hotGoodsWordClould>
</div>
</el-col>
</el-row>
<filtertop :list="treeList"></filtertop>
<div class="hot-list-warp">
<el-row :gutter="10">
<el-col :span="8" align="left">
<el-cascader :options="typeTree" :props="treeOption" clearable :placeholder="'请选择地区'" />
</el-col>
<el-col :span="16" align="left">
<el-radio-group v-model="filter.time">
<el-radio v-for="(n, index) in dateList" :key="index" :value="n.value">{{ n.label }}</el-radio>
</el-radio-group>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-table :data="tableData" style="width: 100%" height="320" @row-click="rowClick">
<el-table-column prop="title" label="采购品种" />
<el-table-column prop="region" label="收货地" />
<el-table-column prop="buyer" label="采购方" />
<el-table-column prop="buyNum" label="采购量(kg)" />
<el-table-column prop="buyer" label="采购时间" />
<el-table-column fixed="right" label="操作">
<template #default>
<el-button link type="primary" size="small" @click.stop="handleClick"> 去报价 </el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</div>
</template>
</common>
<purchaserPopup ref="popupQuote" :list="treeList"></purchaserPopup>
</div>
</template>
<script setup name="ecommerce">
import common from './components/common.vue';
import filtertop from './components/filtertop.vue';
import hotGoodsWordClould from './components/hotGoodsWordClould.vue';
import marketCharts from './components/marketCharts.vue';
import purchaserPopup from './components/purchaserPopup.vue';
import { ref, reactive, onMounted, watch, computed } from 'vue';
import { getRegion } from '@/apis/index';
import { useRoute, useRouter } from 'vue-router';
const route = useRoute();
const router = useRouter();
let treeList = reactive([
{
id: '01',
title: '农产品',
children: [
{
pId: '01',
id: '0101',
title: '植物性农产品',
children: [
{ pId: '0101', id: '010101', title: '谷物' },
{ pId: '0101', id: '010102', title: '蔬菜' },
{ pId: '0101', id: '010103', title: '水果' },
{ pId: '0101', id: '010104', title: '坚果与油料作物' },
{ pId: '0101', id: '010105', title: '糖料作物' },
{ pId: '0101', id: '010106', title: '纤维作物' },
{ pId: '0101', id: '010107', title: '茶叶' },
{ pId: '0101', id: '010108', title: '咖啡' },
{ pId: '0101', id: '010109', title: '香料' },
],
},
{
pId: '01',
id: '0102',
title: '动物性农产品',
children: [
{ pId: '0102', id: '010201', title: '肉类' },
{ pId: '0102', id: '010202', title: '奶制品' },
{ pId: '0102', id: '010203', title: '蛋类' },
{ pId: '0102', id: '010204', title: '蜂蜜' },
{ pId: '0102', id: '010205', title: '水产品' },
],
},
{
pId: '01',
id: '0103',
title: '特殊农产品',
children: [
{ pId: '0103', id: '010301', title: '花卉与苗木' },
{ pId: '0103', id: '010302', title: '药材' },
{ pId: '0103', id: '010303', title: '菌类' },
],
},
{
pId: '01',
id: '0104',
title: '其他',
children: [{ pId: '0104', id: '010401', title: '饲料' }],
},
],
},
{
id: '02',
title: '种子种苗',
children: [
{
pId: '02',
id: '0101',
title: '花卉种子种苗',
children: [
{ pId: '0101', id: '010101', title: '草本花卉' },
{ pId: '0101', id: '010102', title: '木本花卉' },
{ pId: '0101', id: '010103', title: '野生花卉' },
],
},
{
pId: '02',
id: '0102',
title: '蔬菜种子种苗',
children: [
{ pId: '0102', id: '010201', title: '叶菜类' },
{ pId: '0102', id: '010202', title: '根茎类' },
{ pId: '0102', id: '010203', title: '果实类' },
{ pId: '0102', id: '010204', title: '豆类' },
{ pId: '0102', id: '010205', title: '瓜类' },
],
},
{
pId: '02',
id: '0103',
title: '果树种苗',
children: [
{ pId: '0103', id: '010301', title: '柑橘类' },
{ pId: '0103', id: '010302', title: '仁果类' },
{ pId: '0103', id: '010303', title: '核果类' },
{ pId: '0103', id: '010304', title: '浆果类' },
],
},
{
pId: '02',
id: '0104',
title: '药材种子与种苗',
children: [
{ pId: '0104', id: '010401', title: '寒地龙药' },
{ pId: '0104', id: '010402', title: '常见中药材' },
],
},
{
pId: '02',
id: '0105',
title: '其他作物',
children: [
{ pId: '0105', id: '010501', title: '牧草' },
{ pId: '0105', id: '010502', title: '经济作物' },
{ pId: '0105', id: '010503', title: '观赏树木' },
],
},
],
},
]);
let popupQuote = ref(null);
const typeTree = ref([]);
const treeOption = ref({
children: 'areaChildVOS',
label: 'areaName',
});
const getTree = () => {
console.info('getTree');
getRegion().then((res) => {
if (res.code === 200) {
const { code, data } = res;
typeTree.value = data;
console.info('区域信息', typeTree.value);
}
});
};
const handleClick = () => {
popupQuote.value && popupQuote.value.doShow();
};
const dateList = reactive([
{ label: '近7天发布', value: 7 },
{ label: '近30天发布', value: 30 },
]);
let filter = ref({
region: '',
time: 7,
});
let tableData = reactive([
{ id: '01', title: '西红柿', region: '耿马镇', buyer: '盛源农业', buyNum: 5000, time: '2025-04-02 12:25:36' },
{ id: '02', title: '白菜', region: '孟定镇', buyer: '星悦农业', buyNum: 6000, time: '2025-04-01 12:25:36' },
{ id: '03', title: '西蓝花', region: '孟勇镇', buyer: '盛源农业', buyNum: 7000, time: '2025-04-02 13:25:36' },
{ id: '04', title: '鸡蛋', region: '勐简乡', buyer: '上好佳农业', buyNum: 8000, time: '2025-04-02 12:25:36' },
{ id: '05', title: '牛肉', region: '四排山乡', buyer: '尚嘉农业', buyNum: 5000, time: '2025-03-31 12:25:36' },
{ id: '06', title: '氮肥', region: '大兴乡', buyer: '信誉农资', buyNum: 6000, time: '2025-04-02 12:25:36' },
{ id: '07', title: '白菜种子', region: '贺派乡', buyer: '佳佳农业', buyNum: 5000, time: '2025-04-02 12:25:36' },
{ id: '08', title: '西红柿种子', region: '勐撒镇', buyer: '佳佳农业', buyNum: 8000, time: '2025-04-02 12:25:36' },
]);
const rowClick = (data) => {
router.push('/sub-operation-service/purchaserDetail?id=' + data.id);
};
onMounted(() => {
console.info('onMounted');
getTree();
});
</script>
<style lang="scss" scoped>
.purchaser-index-warp {
width: 100%;
.purchaser-top {
width: 100%;
margin-bottom: 16px;
background: $color-fff;
border-radius: 16px;
overflow: hidden;
padding: 10px;
.purchaser-top-title {
width: 100%;
text-align: left;
font-size: 18px;
}
.purchaser-charts {
width: 100%;
}
}
.hot-list-warp {
background: $color-fff;
padding: 16px;
border-radius: 16px;
margin: 16px 0;
::v-deep() {
thead {
border-radius: 16px;
overflow: hidden;
}
thead th {
background: $color-main-table-header;
color: $color-999 !important;
border: none !important;
padding: 16px 0;
}
thead th:first-child {
border-top-left-radius: 16px;
border-bottom-left-radius: 16px;
}
thead th:last-child {
border-top-right-radius: 16px;
border-bottom-right-radius: 16px;
}
table {
margin-top: 16px !important;
}
tbody td {
border: none !important;
}
.el-table__inner-wrapper::before {
display: none !important;
}
}
}
}
</style>

View File

@ -0,0 +1,485 @@
<template>
<div class="purchaser-detail-warp">
<common current-name="purchaser">
<template #main>
<div class="purchaser-detail-top">
<div class="top-title">
<div class="father-title">采购商服务</div>
<div class="current-title">采购详情</div>
</div>
<div class="purchaser-info">
<el-row :gutter="16">
<el-col :span="16">
<div class="purchaser-info-l">
<div class="img">
<el-image :src="getAssetsFile('images/ecommerce/' + 'test01.png')" fit="cover" />
</div>
<div class="content">
<div class="title-warp">
<div class="txt txt-ellipsis clamp2">耿马县勐简乡飘云生态农业耿马县勐简乡飘云生态农业</div>
<div class="icon-warp">
<div class="iconfont icon-level"></div>
<div class="iconfont icon-auth"></div>
</div>
</div>
<div class="is-auth">
<span>已实名认证</span>
</div>
<div class="settled-time">
<span>入驻时间37</span>
</div>
</div>
</div>
</el-col>
<el-col :span="8">
<div class="purchaser-info-r">
<div class="addr">
{{ '南省临沧市耿马傣族佤族自治县耿马县勐简乡' }}
<div class="iconfont icon-location"></div>
</div>
</div>
</el-col>
</el-row>
<el-row :gutter="56" class="purchase-info-total">
<el-col :span="12">
<div class="info-total-item">
<div class="label">采购品种</div>
<div class="val">西红柿</div>
</div>
</el-col>
<el-col :span="12">
<div class="info-total-item">
<div class="label">采购数量</div>
<div class="val">5000kg</div>
</div>
</el-col>
<el-col :span="12">
<div class="info-total-item">
<div class="label">期望货源地</div>
<div class="val">耿马县·贺派乡</div>
</div>
</el-col>
<el-col :span="12">
<div class="info-total-item">
<div class="label">浏览次数</div>
<div class="val">188</div>
</div>
</el-col>
<el-col :span="12">
<div class="info-total-item">
<div class="label">期望货源地</div>
<div class="val">耿马县·贺派乡</div>
</div>
</el-col>
<el-col :span="12">
<div class="info-total-item">
<div class="label">更新时间</div>
<div class="val">2025.01.01 12:15:18</div>
</div>
</el-col>
</el-row>
<el-row class="contant-wrap">
<el-col :span="24">
<div class="contant-btn">
<div class="iconfont icon-bg-chat"></div>
<span>在线联系</span>
</div>
</el-col>
</el-row>
</div>
</div>
<div class="hot-list-warp">
<div class="block-title">热门采购</div>
<el-row>
<el-col :span="24">
<el-table :data="tableData" style="width: 100%" height="320">
<el-table-column prop="title" label="采购品种" />
<el-table-column prop="region" label="收货地" />
<el-table-column prop="buyer" label="采购方" />
<el-table-column prop="buyNum" label="采购量(kg)" />
<el-table-column prop="buyer" label="采购时间" />
<el-table-column fixed="right" label="操作">
<template #default>
<el-button link type="primary" size="small" @click.stop="handleClick"> 去报价 </el-button>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</div>
</template>
</common>
<purchaserPopup ref="popupQuote" :list="treeList"></purchaserPopup>
</div>
</template>
<script setup name="ecommerce">
import common from './components/common.vue';
import purchaserPopup from './components/purchaserPopup.vue';
import { ref, reactive, onMounted, watch, computed } from 'vue';
import { isEmpty, getAssetsFile } from '@/utils';
let popupQuote = ref(null);
let treeList = reactive([
{
id: '01',
title: '农产品',
children: [
{
pId: '01',
id: '0101',
title: '植物性农产品',
children: [
{ pId: '0101', id: '010101', title: '谷物' },
{ pId: '0101', id: '010102', title: '蔬菜' },
{ pId: '0101', id: '010103', title: '水果' },
{ pId: '0101', id: '010104', title: '坚果与油料作物' },
{ pId: '0101', id: '010105', title: '糖料作物' },
{ pId: '0101', id: '010106', title: '纤维作物' },
{ pId: '0101', id: '010107', title: '茶叶' },
{ pId: '0101', id: '010108', title: '咖啡' },
{ pId: '0101', id: '010109', title: '香料' },
],
},
{
pId: '01',
id: '0102',
title: '动物性农产品',
children: [
{ pId: '0102', id: '010201', title: '肉类' },
{ pId: '0102', id: '010202', title: '奶制品' },
{ pId: '0102', id: '010203', title: '蛋类' },
{ pId: '0102', id: '010204', title: '蜂蜜' },
{ pId: '0102', id: '010205', title: '水产品' },
],
},
{
pId: '01',
id: '0103',
title: '特殊农产品',
children: [
{ pId: '0103', id: '010301', title: '花卉与苗木' },
{ pId: '0103', id: '010302', title: '药材' },
{ pId: '0103', id: '010303', title: '菌类' },
],
},
{
pId: '01',
id: '0104',
title: '其他',
children: [{ pId: '0104', id: '010401', title: '饲料' }],
},
],
},
{
id: '02',
title: '种子种苗',
children: [
{
pId: '02',
id: '0101',
title: '花卉种子种苗',
children: [
{ pId: '0101', id: '010101', title: '草本花卉' },
{ pId: '0101', id: '010102', title: '木本花卉' },
{ pId: '0101', id: '010103', title: '野生花卉' },
],
},
{
pId: '02',
id: '0102',
title: '蔬菜种子种苗',
children: [
{ pId: '0102', id: '010201', title: '叶菜类' },
{ pId: '0102', id: '010202', title: '根茎类' },
{ pId: '0102', id: '010203', title: '果实类' },
{ pId: '0102', id: '010204', title: '豆类' },
{ pId: '0102', id: '010205', title: '瓜类' },
],
},
{
pId: '02',
id: '0103',
title: '果树种苗',
children: [
{ pId: '0103', id: '010301', title: '柑橘类' },
{ pId: '0103', id: '010302', title: '仁果类' },
{ pId: '0103', id: '010303', title: '核果类' },
{ pId: '0103', id: '010304', title: '浆果类' },
],
},
{
pId: '02',
id: '0104',
title: '药材种子与种苗',
children: [
{ pId: '0104', id: '010401', title: '寒地龙药' },
{ pId: '0104', id: '010402', title: '常见中药材' },
],
},
{
pId: '02',
id: '0105',
title: '其他作物',
children: [
{ pId: '0105', id: '010501', title: '牧草' },
{ pId: '0105', id: '010502', title: '经济作物' },
{ pId: '0105', id: '010503', title: '观赏树木' },
],
},
],
},
]);
let tableData = reactive([
{ title: '西红柿', region: '耿马镇', buyer: '盛源农业', buyNum: 5000, time: '2025-04-02 12:25:36' },
{ title: '白菜', region: '孟定镇', buyer: '星悦农业', buyNum: 6000, time: '2025-04-01 12:25:36' },
{ title: '西蓝花', region: '孟勇镇', buyer: '盛源农业', buyNum: 7000, time: '2025-04-02 13:25:36' },
{ title: '鸡蛋', region: '勐简乡', buyer: '上好佳农业', buyNum: 8000, time: '2025-04-02 12:25:36' },
// { title: '', region: '', buyer: '', buyNum: 5000, time: '2025-03-31 12:25:36' },
// { title: '', region: '', buyer: '', buyNum: 6000, time: '2025-04-02 12:25:36' },
// { title: '', region: '', buyer: '', buyNum: 5000, time: '2025-04-02 12:25:36' },
// { title: '西', region: '', buyer: '', buyNum: 8000, time: '2025-04-02 12:25:36' },
]);
const handleClick = () => {
popupQuote.value && popupQuote.value.doShow();
};
onMounted(() => {
console.info('onMounted');
});
</script>
<style lang="scss" scoped>
.purchaser-detail-warp {
width: 100%;
.block-title {
font-size: 20px;
font-weight: 700;
text-align: left;
padding: 8px 0;
}
.purchaser-detail-top {
width: 100%;
margin-bottom: 16px;
background: $color-fff;
border-radius: 16px;
overflow: hidden;
padding: 10px;
.top-title {
width: 100%;
text-align: left;
.father-title,
.current-title {
display: inline-block;
vertical-align: middle;
font-weight: 700;
}
.father-title {
font-size: 18px;
}
.current-title {
font-size: 16px;
color: $color-main;
position: relative;
padding: 0 8px;
margin-left: 8px;
}
.current-title::before {
content: '.';
position: absolute;
left: 0;
top: 30%;
transform: translateY(-50%);
}
}
.purchaser-info {
margin: 16px 0;
.purchaser-info-l {
display: inline-flex;
justify-content: flex-start;
width: 100%;
text-align: left;
.img,
.content {
display: inline-block;
vertical-align: top;
}
.img {
width: 160px;
height: 160px;
border-radius: 8px;
overflow: hidden;
img {
width: 100%;
height: 100%;
}
}
.content {
width: calc(100% - 160px);
padding-left: 16px;
.title-warp {
width: 100%;
.txt,
.icon-warp {
vertical-align: top;
}
.txt {
width: calc(100% - 80px);
font-size: 24px;
font-weight: 500;
}
.icon-warp {
display: inline-block;
width: 80px;
.iconfont {
display: inline-block;
margin-top: 6px;
&.icon-level {
font-size: 26px;
color: $color-main;
}
&.icon-auth {
font-size: 28px;
color: $color-warning;
}
}
}
}
.is-auth {
width: 100%;
margin: 16px 0;
span {
background: $color-main-table-header;
border: 1px solid $color-main-border;
border-radius: 8px;
padding: 0 16px;
color: $color-main;
line-height: 32px;
height: 32px;
display: inline-block;
font-size: 16px;
font-weight: 400;
}
}
.settled-time {
width: 100%;
span {
font-size: 20px;
color: $color-999;
font-weight: 500;
}
}
}
}
.purchaser-info-r {
.addr {
text-align: left;
width: 100%;
font-size: 18px;
font-weight: 500;
color: $color-666;
.iconfont {
display: inline-block;
font-size: 26px;
vertical-align: middle;
}
}
}
.purchase-info-total {
.info-total-item {
display: inline-flex;
width: 100%;
justify-content: space-between;
margin: 8px 0;
.label,
.val {
display: -webkit-inline-box;
vertical-align: top;
}
.label {
color: $color-999;
font-size: 18px;
max-width: 180px;
}
.val {
font-size: 20px;
max-width: calc(100% - 180px);
color: $color-666;
text-align: right;
}
}
}
.contant-wrap {
width: 100%;
text-align: center;
margin-top: 16px;
.contant-btn {
background: $color-main;
padding: 0 16px;
line-height: 48px;
height: 48px;
border-radius: 16px;
color: $color-fff;
display: inline-block;
.iconfont,
span {
display: inline-block;
vertical-align: middle;
}
.iconfont {
font-size: 26px;
}
span {
padding-left: 8px;
font-size: 20px;
}
}
}
}
}
.hot-list-warp {
background: $color-fff;
padding: 16px;
border-radius: 16px;
margin: 16px 0;
::v-deep() {
thead {
border-radius: 16px;
overflow: hidden;
}
thead th {
background: $color-main-table-header;
color: $color-999 !important;
border: none !important;
padding: 16px 0;
}
thead th:first-child {
border-top-left-radius: 16px;
border-bottom-left-radius: 16px;
}
thead th:last-child {
border-top-right-radius: 16px;
border-bottom-right-radius: 16px;
}
table {
margin-top: 16px !important;
}
tbody td {
border: none !important;
}
.el-table__inner-wrapper::before {
display: none !important;
}
}
}
}
</style>

View File

@ -0,0 +1,164 @@
<template>
<div>
<common current-name="supplier">
<template #main>
<banner name="supplier" :imglist="bannerList"></banner>
<filtertop :list="treeList"></filtertop>
<div class="goods-list-warp">
<div class="goods-list">
<template v-for="(n, index) in 16" :key="index">
<div class="goods-item">
<goodsItem></goodsItem>
</div>
</template>
</div>
</div>
</template>
</common>
</div>
</template>
<script setup name="ecommerce">
import common from './components/common.vue';
import banner from './components/banner.vue';
import filtertop from './components/filtertop.vue';
import goodsItem from './components/goodsItem.vue';
import { ref, reactive, onMounted, watch, computed } from 'vue';
let treeList = reactive([
{
id: '01',
title: '农产品',
children: [
{
pId: '01',
id: '0101',
title: '植物性农产品',
children: [
{ pId: '0101', id: '010101', title: '谷物' },
{ pId: '0101', id: '010102', title: '蔬菜' },
{ pId: '0101', id: '010103', title: '水果' },
{ pId: '0101', id: '010104', title: '坚果与油料作物' },
{ pId: '0101', id: '010105', title: '糖料作物' },
{ pId: '0101', id: '010106', title: '纤维作物' },
{ pId: '0101', id: '010107', title: '茶叶' },
{ pId: '0101', id: '010108', title: '咖啡' },
{ pId: '0101', id: '010109', title: '香料' },
],
},
{
pId: '01',
id: '0102',
title: '动物性农产品',
children: [
{ pId: '0102', id: '010201', title: '肉类' },
{ pId: '0102', id: '010202', title: '奶制品' },
{ pId: '0102', id: '010203', title: '蛋类' },
{ pId: '0102', id: '010204', title: '蜂蜜' },
{ pId: '0102', id: '010205', title: '水产品' },
],
},
{
pId: '01',
id: '0103',
title: '特殊农产品',
children: [
{ pId: '0103', id: '010301', title: '花卉与苗木' },
{ pId: '0103', id: '010302', title: '药材' },
{ pId: '0103', id: '010303', title: '菌类' },
],
},
{
pId: '01',
id: '0104',
title: '其他',
children: [{ pId: '0104', id: '010401', title: '饲料' }],
},
],
},
{
id: '02',
title: '种子种苗',
children: [
{
pId: '02',
id: '0101',
title: '花卉种子种苗',
children: [
{ pId: '0101', id: '010101', title: '草本花卉' },
{ pId: '0101', id: '010102', title: '木本花卉' },
{ pId: '0101', id: '010103', title: '野生花卉' },
],
},
{
pId: '02',
id: '0102',
title: '蔬菜种子种苗',
children: [
{ pId: '0102', id: '010201', title: '叶菜类' },
{ pId: '0102', id: '010202', title: '根茎类' },
{ pId: '0102', id: '010203', title: '果实类' },
{ pId: '0102', id: '010204', title: '豆类' },
{ pId: '0102', id: '010205', title: '瓜类' },
],
},
{
pId: '02',
id: '0103',
title: '果树种苗',
children: [
{ pId: '0103', id: '010301', title: '柑橘类' },
{ pId: '0103', id: '010302', title: '仁果类' },
{ pId: '0103', id: '010303', title: '核果类' },
{ pId: '0103', id: '010304', title: '浆果类' },
],
},
{
pId: '02',
id: '0104',
title: '药材种子与种苗',
children: [
{ pId: '0104', id: '010401', title: '寒地龙药' },
{ pId: '0104', id: '010402', title: '常见中药材' },
],
},
{
pId: '02',
id: '0105',
title: '其他作物',
children: [
{ pId: '0105', id: '010501', title: '牧草' },
{ pId: '0105', id: '010502', title: '经济作物' },
{ pId: '0105', id: '010503', title: '观赏树木' },
],
},
],
},
]);
let bannerList = reactive(['images/ecommerce/' + 'banner1.png', 'images/ecommerce/' + 'banner1.png']);
</script>
<style lang="scss" scoped>
.goods-list-warp {
width: 100%;
margin-top: 16px;
.goods-list {
width: 100%;
display: inline-flex;
flex-wrap: wrap;
justify-content: space-around;
gap: 10px;
.goods-item {
display: inline-block;
width: calc((100% - 50px) / 5);
background: $color-fff;
border-radius: 16px;
overflow: hidden;
margin-bottom: 16px;
}
}
/* 添加伪元素占位 */
.goods-list::after {
content: '';
flex: auto;
}
}
</style>

View File

@ -25,7 +25,7 @@ const useDevMode = true;
export default defineConfig(({ command, mode }) => {
const { VITE_PORT, VITE_APP_NAME, VITE_APP_BASE_API, VITE_APP_BASE_URL, VITE_APP_UPLOAD_API, VITE_APP_UPLOAD_URL } = loadEnv(mode, process.cwd());
const config = {
base: './',
base: '/sub-operation-service/',
build: {
target: 'ESNext',
outDir: 'dist',