This commit is contained in:
胥林川 2025-08-22 13:16:47 +08:00
commit ab511f863e
35 changed files with 183 additions and 50 deletions

View File

@ -1,7 +1,7 @@
# 开发环境 # 开发环境
VITE_PORT = 9000 VITE_PORT = 9000
VITE_APP_NAME = 'daimp-front-main' VITE_APP_NAME = 'daimp-front-main'
VITE_APP_TITLE = '全域数字农业产业管理平台' VITE_APP_TITLE = '全域数字农业产业运营管理平台'
VITE_APP_SUB_OS = '//localhost:9526/sub-operation-service/' VITE_APP_SUB_OS = '//localhost:9526/sub-operation-service/'
VITE_APP_SUB_OA = '//localhost:9527/sub-operation-admin/' VITE_APP_SUB_OA = '//localhost:9527/sub-operation-admin/'
# VITE_APP_SUB_GAS = 'http://192.168.18.128:9528/sub-government-affairs-service/' # VITE_APP_SUB_GAS = 'http://192.168.18.128:9528/sub-government-affairs-service/'

View File

@ -1,6 +1,6 @@
# 本地环境 # 本地环境
VITE_APP_NAME = 'daimp-front-main' VITE_APP_NAME = 'daimp-front-main'
VITE_APP_TITLE = '全域数字农业产业管理平台' VITE_APP_TITLE = '全域数字农业产业运营管理平台'
VITE_APP_SUB_OS = '//localhost:8090/sub-operation-service/' VITE_APP_SUB_OS = '//localhost:8090/sub-operation-service/'
VITE_APP_SUB_OA = '//localhost:8090/sub-operation-admin/' VITE_APP_SUB_OA = '//localhost:8090/sub-operation-admin/'
VITE_APP_SUB_GAS = '//localhost:8090/sub-government-affairs-service/' VITE_APP_SUB_GAS = '//localhost:8090/sub-government-affairs-service/'

View File

@ -1,6 +1,6 @@
# 正式环境 # 正式环境
VITE_APP_NAME = 'daimp-front-main' VITE_APP_NAME = 'daimp-front-main'
VITE_APP_TITLE = '全域数字农业产业管理平台' VITE_APP_TITLE = '全域数字农业产业运营管理平台'
VITE_APP_SUB_OS = '//http://47.109.205.240/sub-operation-service/' VITE_APP_SUB_OS = '//http://47.109.205.240/sub-operation-service/'
VITE_APP_SUB_OA = '//http://47.109.205.240/sub-operation-admin/' VITE_APP_SUB_OA = '//http://47.109.205.240/sub-operation-admin/'
VITE_APP_SUB_GAS = '//http://47.109.205.240/sub-government-affairs-service/' VITE_APP_SUB_GAS = '//http://47.109.205.240/sub-government-affairs-service/'

View File

@ -1,15 +1,15 @@
# 测试环境 # 测试环境
VITE_APP_NAME = 'daimp-front-main' VITE_APP_NAME = 'daimp-front-main'
VITE_APP_TITLE = '全域数字农业产业管理平台' VITE_APP_TITLE = '全域数字农业产业管理平台'
VITE_APP_SUB_OS = '//192.168.18.99/sub-operation-service/' VITE_APP_SUB_OS = '//192.168.18.88/sub-operation-service/'
VITE_APP_SUB_OA = '//192.168.18.99/sub-operation-admin/' VITE_APP_SUB_OA = '//192.168.18.88/sub-operation-admin/'
VITE_APP_SUB_GAS = '//192.168.18.99/sub-government-affairs-service/' VITE_APP_SUB_GAS = '//192.168.18.88/sub-government-affairs-service/'
VITE_APP_SUB_GAA = '//192.168.18.99/sub-government-admin/' VITE_APP_SUB_GAA = '//192.168.18.88/sub-government-admin/'
VITE_APP_SUB_GSS = '//192.168.18.99/sub-government-screen-service/' VITE_APP_SUB_GSS = '//192.168.18.88/sub-government-screen-service/'
VITE_APP_SUB_GSR = '//192.168.18.99/new-digital-agriculture-screen/' VITE_APP_SUB_GSR = '//192.168.18.88/new-digital-agriculture-screen/'
# 接口 # 接口
VITE_APP_BASE_API = '/apis' VITE_APP_BASE_API = '/apis'
VITE_APP_BASE_URL = '' VITE_APP_BASE_URL = ''
VITE_APP_UPLOAD_API = '/uploadApis' VITE_APP_UPLOAD_API = '/uploadApis'
VITE_APP_UPLOAD_URL = '' VITE_APP_UPLOAD_URL = ''
VITE_APP_VIST_URL = 'http://192.168.18.99' VITE_APP_VIST_URL = 'http://192.168.18.88'

127
main/src/micro/app copy.js Normal file
View File

@ -0,0 +1,127 @@
import actions from './actions';
const { VITE_APP_SUB_OS, VITE_APP_SUB_OA, VITE_APP_SUB_ADMIN, VITE_APP_SUB_GAS, VITE_APP_SUB_GSS, VITE_APP_SUB_GSR, VITE_APP_VIST_URL } = import.meta.env;
export const leftApps = [
{
name: 'sub-operation-service',
entry: VITE_APP_SUB_OS,
activeRule: '/sub-operation-service',
title: '运营服务',
icon: 'images/platform/icon-home.png',
},
{
name: 'sub-operation-admin',
entry: VITE_APP_SUB_OA,
activeRule: `/sub-operation-admin`,
title: '管理后台',
icon: 'images/platform/icon-admin.png',
},
{
name: 'sub-app2',
entry: VITE_APP_SUB_GAS,
activeRule: '/operation-app',
title: 'APP',
icon: 'images/platform/icon-app.png',
},
{
name: 'sub-government-screen-service',
entry: VITE_APP_SUB_GSS,
activeRule: '/sub-government-screen-service',
title: '数据大屏',
icon: 'images/platform/icon-screen.png',
},
];
export const rightApps = [
{
name: 'sub-government-affairs-service',
entry: VITE_APP_SUB_GAS,
activeRule: '/sub-government-affairs-service',
title: '政务服务',
icon: 'images/platform/icon-home.png',
},
{
name: 'sub-government-admin',
entry: VITE_APP_SUB_GAS,
activeRule: `/sub-government-admin`,
title: '管理后台',
icon: 'images/platform/icon-admin.png',
},
{
name: 'sub-app1',
entry: VITE_APP_SUB_GAS,
activeRule: '/government-affairs-app',
title: 'APP',
icon: 'images/platform/icon-app.png',
},
{
// name: 'sub-government-screen-service',
name: 'new-digital-agriculture-screen/v2/land',
// entry: VITE_APP_SUB_GSS,
entry: VITE_APP_SUB_GSR,
// activeRule: '/sub-government-screen-service',
activeRule: '/new-digital-agriculture-screen',
title: '数据大屏',
icon: 'images/platform/icon-screen.png',
},
];
export const defaultApps = [
{
name: 'sub-operation-service',
entry: VITE_APP_SUB_OS,
activeRule: '/sub-operation-service',
title: '运营服务',
icon: 'images/platform/icon-home.png',
},
{
name: 'sub-operation-admin',
entry: VITE_APP_SUB_OA,
activeRule: '/sub-operation-admin',
title: '运营管理后台',
icon: 'images/platform/icon-admin.png',
},
{
name: 'sub-government-affairs-service',
entry: VITE_APP_SUB_GAS,
activeRule: '/sub-government-affairs-service',
title: '政务服务',
icon: 'images/platform/icon-home.png',
},
{
name: 'sub-government-screen-service',
// name: 'new-digital-agriculture-screen',
entry: VITE_APP_SUB_GSS,
// entry: VITE_APP_SUB_GSR,
activeRule: '/sub-government-screen-service',
// activeRule: '/new-digital-agriculture-screen',
title: '数据大屏',
icon: 'images/platform/icon-screen.png',
},
{
// name: 'sub-government-screen-service',
name: 'new-digital-agriculture-screen',
// entry: VITE_APP_SUB_GSS,
entry: VITE_APP_SUB_GSR,
// activeRule: '/sub-government-screen-service',
activeRule: '/new-digital-agriculture-screen',
title: '数据大屏',
icon: 'images/platform/icon-screen.png',
},
];
export const microApps = [...defaultApps];
console.log(microApps);
const apps = microApps.map((item) => {
return {
...item,
container: '#app',
props: {
routerBase: item.activeRule,
globalState: actions.getGlobalState(),
},
};
});
export default apps;

View File

@ -39,6 +39,8 @@ export const constantRoutes = [
}, },
], ],
}, },
{ path: '/sub-operation-admin*', redirect: '/' }, // 避免乾坤劫持该路径
{ path: '/sub-government-admin*', redirect: '/' }, // 避免乾坤劫持该路径
]; ];
const router = createRouter({ const router = createRouter({

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="platform"> <div class="platform">
<h2 class="platform-title">全域数字农业产业管理平台</h2> <h2 class="platform-title">全域数字农业产业运营管理平台</h2>
<div class="platform-panel"> <div class="platform-panel">
<div class="platform-panel-item"> <div class="platform-panel-item">
<div class="icon"><img src="https://gov-cloud.oss-cn-chengdu.aliyuncs.com/frontend/main/icon-zw.png" /></div> <div class="icon"><img src="https://gov-cloud.oss-cn-chengdu.aliyuncs.com/frontend/main/icon-zw.png" /></div>
@ -35,18 +35,7 @@ import { leftApps, rightApps } from '@/micro/app';
import { getAssetsFile } from '@/utils'; import { getAssetsFile } from '@/utils';
const gotoPage = (row) => { const gotoPage = (row) => {
// window.history.pushState({}, row.name, row.activeRule); window.location.href = row.activeRule;
if (row.name == 'sub-app1') {
// app
// window.location.href = 'https://www.pgyer.com/MXd3uUrO';
window.location.href = row.activeRule;
} else if (row.name == 'sub-app2') {
// app
// window.location.href = 'https://www.pgyer.com/4SVVtpob';
window.location.href = row.activeRule;
} else {
window.location.href = row.activeRule;
}
}; };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="login"> <div class="login">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form"> <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
<h3 class="title">全域数字农业产业管理平台</h3> <h3 class="title">全域数字农业产业运营管理平台</h3>
<el-form-item prop="username"> <el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号"> <el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
<template #prefix> <template #prefix>
@ -169,7 +169,7 @@ export default {
.login-form { .login-form {
border-radius: 6px; border-radius: 6px;
background: #ffffff; background: #ffffff;
width: 400px; width: 450px;
padding: 25px 25px 5px 25px; padding: 25px 25px 5px 25px;
.el-input { .el-input {
height: 38px; height: 38px;

View File

@ -12,7 +12,6 @@ declare module 'vue' {
'CenterMap copy': typeof import('./src/components/centerMap copy.vue')['default'] 'CenterMap copy': typeof import('./src/components/centerMap copy.vue')['default']
CodeDialog: typeof import('./src/components/code-dialog/index.vue')['default'] CodeDialog: typeof import('./src/components/code-dialog/index.vue')['default']
Components: typeof import('./src/components/index.js')['default'] Components: typeof import('./src/components/index.js')['default']
copy: typeof import('./src/components/centerMap copy.vue')['default']
CurrentTime: typeof import('./src/components/currentTime.vue')['default'] CurrentTime: typeof import('./src/components/currentTime.vue')['default']
CustomBack: typeof import('./src/components/customBack.vue')['default'] CustomBack: typeof import('./src/components/customBack.vue')['default']
CustomCarouselPicture: typeof import('./src/components/custom-carousel-picture/index.vue')['default'] CustomCarouselPicture: typeof import('./src/components/custom-carousel-picture/index.vue')['default']

Binary file not shown.

Before

Width:  |  Height:  |  Size: 311 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 KiB

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

After

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 41 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 87 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

View File

@ -12,12 +12,12 @@ import router from './router';
import pinia from './store'; import pinia from './store';
import ElementPlus from 'element-plus'; import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css'; import 'element-plus/dist/index.css';
import Avue from '@smallwei/avue'; // import Avue from '@smallwei/avue';
import '@smallwei/avue/lib/index.css'; // import '@smallwei/avue/lib/index.css';
import './utils/permission'; import './utils/permission';
import VueAMap, { initAMapApiLoader } from '@vuemap/vue-amap'; import VueAMap, { initAMapApiLoader } from '@vuemap/vue-amap';
import { registerDirective } from './directives'; import { registerDirective } from './directives';
import { registerGlobalComponents } from './plugins/globalComponents'; // import { registerGlobalComponents } from './plugins/globalComponents';
import { registerElIcons } from './plugins/icon'; import { registerElIcons } from './plugins/icon';
import { registerMicroApps } from './plugins/micro'; import { registerMicroApps } from './plugins/micro';
@ -25,9 +25,9 @@ const app = createApp(App);
// 注册 Vue3 Scroll Seamless 组件 // 注册 Vue3 Scroll Seamless 组件
// app.component('Vue3ScrollSeamless', vue3ScrollSeamless); // app.component('Vue3ScrollSeamless', vue3ScrollSeamless);
// app.use(pinia).use(router).use(ElementPlus).use(Avue); // app.use(pinia).use(router).use(ElementPlus).use(Avue);
app.use(pinia).use(router).use(ElementPlus).use(Avue).use(VueAMap); app.use(pinia).use(router).use(ElementPlus).use(VueAMap);
nextTick(() => { nextTick(() => {
registerGlobalComponents(app); // registerGlobalComponents(app);
registerElIcons(app); registerElIcons(app);
registerDirective(app); registerDirective(app);
registerMicroApps(app); registerMicroApps(app);

View File

@ -40,7 +40,6 @@ router.beforeEach(async (to, from, next) => {
return; return;
} }
next(); next();
next();
} }
} catch (error) { } catch (error) {
next(`/login?redirect=${to.path}`); next(`/login?redirect=${to.path}`);

View File

@ -5,7 +5,7 @@
<div class="name" :style="n.nameStyle"> <div class="name" :style="n.nameStyle">
<span :style="n.spanStyle">{{ n.title || '--' }}</span> <span :style="n.spanStyle">{{ n.title || '--' }}</span>
</div> </div>
<div class="img-icon" :style="n.imgstyle"><img :src="getAssetsFile(n.img)" /></div> <div class="img-icon" :style="n.imgstyle"><img :src="n.img" /></div>
</div> </div>
</template> </template>
</div> </div>
@ -31,7 +31,7 @@ let homeList = reactive([
name: 'operationM', name: 'operationM',
linkType: 0, linkType: 0,
url: '', url: '',
img: 'images/vsualized/home1.png', img: 'https://gov-cloud.oss-cn-chengdu.aliyuncs.com/frontend/zhengwu/home1.png',
style: 'left: 21%;bottom:300px;', style: 'left: 21%;bottom:300px;',
imgstyle: 'width:100px;height:100px', imgstyle: 'width:100px;height:100px',
nameStyle: 'padding: 0 16px;margin: 16px 0;', nameStyle: 'padding: 0 16px;margin: 16px 0;',
@ -42,7 +42,7 @@ let homeList = reactive([
name: 'operation', name: 'operation',
linkType: 0, linkType: 0,
url: '', url: '',
img: 'images/vsualized/home2.png', img: 'https://gov-cloud.oss-cn-chengdu.aliyuncs.com/frontend/zhengwu/home2.png',
style: 'left: 22%;bottom: 24px;', style: 'left: 22%;bottom: 24px;',
imgstyle: 'width:160px;height:160px', imgstyle: 'width:160px;height:160px',
nameStyle: 'padding: 0 22px;margin: 24px 0;border-radius: 16px;', nameStyle: 'padding: 0 22px;margin: 24px 0;border-radius: 16px;',
@ -53,7 +53,7 @@ let homeList = reactive([
name: 'dataV', name: 'dataV',
linkType: 1, linkType: 1,
url: '/new-digital-agriculture-screen/v2/land', url: '/new-digital-agriculture-screen/v2/land',
img: 'images/vsualized/home3.png', img: 'https://gov-cloud.oss-cn-chengdu.aliyuncs.com/frontend/zhengwu/home3.png',
style: 'right: 23%;bottom:300px;', style: 'right: 23%;bottom:300px;',
imgstyle: 'width:100px;height:100px', imgstyle: 'width:100px;height:100px',
nameStyle: 'padding: 0 16px;margin: 16px 0;', nameStyle: 'padding: 0 16px;margin: 16px 0;',
@ -64,7 +64,7 @@ let homeList = reactive([
name: 'gov', name: 'gov',
linkType: 0, linkType: 0,
url: '', url: '',
img: 'images/vsualized/home4.png', img: 'https://gov-cloud.oss-cn-chengdu.aliyuncs.com/frontend/zhengwu/home4.png',
style: 'right: 24%;bottom: 24px;', style: 'right: 24%;bottom: 24px;',
imgstyle: 'width:160px;height:160px', imgstyle: 'width:160px;height:160px',
nameStyle: 'padding: 0 22px;margin: 24px 0;border-radius: 16px;', nameStyle: 'padding: 0 22px;margin: 24px 0;border-radius: 16px;',

View File

@ -65,19 +65,26 @@
</el-row> </el-row>
</template> </template>
<script setup> <script setup>
import { nextTick, reactive, onMounted } from 'vue'; import { nextTick, reactive, onMounted, defineAsyncComponent } from 'vue';
import landMap from './components/landMap.vue'; const landMap = defineAsyncComponent(() => import('./components/landMap.vue'));
import landOne from './components/landOne.vue'; const landOne = defineAsyncComponent(() => import('./components/landOne.vue'));
import landTwo from './components/landTwo.vue'; const landTwo = defineAsyncComponent(() => import('./components/landTwo.vue'));
import landThere from './components/landThere.vue'; const landThere = defineAsyncComponent(() => import('./components/landThere.vue'));
import landFour from './components/landFour.vue'; const landFour = defineAsyncComponent(() => import('./components/landFour.vue'));
import landFive from './components/landFive.vue'; const landFive = defineAsyncComponent(() => import('./components/landFive.vue'));
import landSix from './components/landSix.vue'; const landSix = defineAsyncComponent(() => import('./components/landSix.vue'));
import { useApp } from '@/hooks'; const BasicInfo = defineAsyncComponent(() => import('./components/basicInfo.vue'));
const Warning = defineAsyncComponent(() => import('@/views/land/components/warning.vue'));
// import landMap from './components/landMap.vue';
// import landOne from './components/landOne.vue';
// import landTwo from './components/landTwo.vue';
// import landThere from './components/landThere.vue';
// import landFour from './components/landFour.vue';
// import landFive from './components/landFive.vue';
// import landSix from './components/landSix.vue';
import { sleep } from '@/utils'; import { sleep } from '@/utils';
import { GetLandInfo } from '@/apis/land'; // import Warning from '@/views/land/components/warning.vue';
import BasicInfo from './components/basicInfo.vue'; // import BasicInfo from './components/basicInfo.vue';
import Warning from '@/views/land/components/warning.vue';
const state = reactive({ const state = reactive({
loading: false, loading: false,

View File

@ -33,6 +33,16 @@ export default defineConfig(({ command, mode }) => {
target: 'ESNext', target: 'ESNext',
outDir: 'dist', outDir: 'dist',
minify: 'terser', minify: 'terser',
rollupOptions: {
output: {
manualChunks: {
// 手动分块示例
vue: ['vue', 'vue-router', 'pinia'],
echarts: ['echarts'],
vendor: ['lodash', 'axios'],
},
},
},
}, },
server: { server: {
host: '0.0.0.0', host: '0.0.0.0',

View File

@ -1,7 +1,7 @@
{ {
"name": "daimp-front", "name": "daimp-front",
"version": "1.0.0", "version": "1.0.0",
"description": "全域数字农业产业管理平台(Digital-Agriculture-Industry-Management-Platform)", "description": "全域数字农业产业运营管理平台(Digital-Agriculture-Industry-Management-Platform)",
"scripts": { "scripts": {
"install:all": "npm-run-all install:* ", "install:all": "npm-run-all install:* ",
"install": "npm-run-all --serial install:*", "install": "npm-run-all --serial install:*",