diff --git a/main/.env.development b/main/.env.development
index eeee949..c23115e 100644
--- a/main/.env.development
+++ b/main/.env.development
@@ -1,9 +1,10 @@
# 开发环境
VITE_PORT = 9000
VITE_APP_NAME = 'daimp-front-main'
+VITE_APP_TITLE = '数字农业产业管理平台'
VITE_APP_BASE_API = "https://mock.mengxuegu.com/mock/664ef7fee45d2156fa209ee4/api-qiankun"
VITE_APP_BASE_URL = 'http://192.168.18.158:9080'
-VITE_APP_SUB_VUE = '//localhost:9526/sub-vue/'
+VITE_APP_SUB_VUE = '//localhost:9526/sub-operation-service/'
VITE_APP_SUB_ADMIN = '//localhost:9527/sub-admin/'
VITE_APP_SUB_GAS = '//localhost:9528/suv-government-affairs-service/'
diff --git a/main/.env.production b/main/.env.production
index acc3426..0e98be6 100644
--- a/main/.env.production
+++ b/main/.env.production
@@ -1,5 +1,6 @@
# 正式环境
VITE_APP_NAME = 'daimp-front-main'
+VITE_APP_TITLE = '数字农业产业管理平台'
VITE_APP_BASE_API = ""
VITE_APP_BASE_URL = ''
VITE_APP_SUB_VUE = '//localhost:9526/sub-vue/'
diff --git a/main/src/App.vue b/main/src/App.vue
index 7032c14..7c2462b 100644
--- a/main/src/App.vue
+++ b/main/src/App.vue
@@ -1,34 +1,16 @@
-
-
+
+
+
+
diff --git a/main/src/components/index.js b/main/src/components/index.js
index 019eefa..e0d4830 100644
--- a/main/src/components/index.js
+++ b/main/src/components/index.js
@@ -1,5 +1,6 @@
import SvgIcon from './svg-icon';
+import CustomTableOperate from './custom-table-operate';
import CustomRichEditor from './custom-rich-editor';
import CustomEchartBar from './custom-echart-bar';
-export { SvgIcon, CustomEchartBar, CustomRichEditor };
+export { SvgIcon, CustomTableOperate, CustomEchartBar, CustomRichEditor };
diff --git a/main/src/hooks/useBreakpoint.js b/main/src/hooks/useBreakpoint.js
index cf0e081..32311f2 100644
--- a/main/src/hooks/useBreakpoint.js
+++ b/main/src/hooks/useBreakpoint.js
@@ -1,9 +1,9 @@
import { ref, computed, unref } from 'vue';
import { useEventListener } from './useEventListener';
-let globalScreenRef;
-let globalWidthRef;
-let globalRealWidthRef;
+let globalScreenRef = 0;
+let globalWidthRef = 0;
+let globalRealWidthRef = 0;
const screenMap = new Map();
screenMap.set('XS', 480);
diff --git a/main/src/hooks/useEcharts.js b/main/src/hooks/useEcharts.js
index 8d14d5d..19c989f 100644
--- a/main/src/hooks/useEcharts.js
+++ b/main/src/hooks/useEcharts.js
@@ -12,7 +12,7 @@ export const useEcharts = (elRef, theme = 'default') => {
let chartInstance = null;
let resizeFn = resize;
const cacheOptions = ref({});
- let removeResizeFn = () => {};
+ let removeResizeFn = null;
resizeFn = useDebounceFn(resize, 200);
diff --git a/main/src/hooks/useWrapComponents.js b/main/src/hooks/useWrapComponents.js
index 7862e73..0be12f0 100644
--- a/main/src/hooks/useWrapComponents.js
+++ b/main/src/hooks/useWrapComponents.js
@@ -12,7 +12,7 @@ export const useWrapComponents = (Component, route) => {
wrapper = {
name: wrapperName,
render() {
- return h('div', { className: 'layout-main' }, Component);
+ return h('div', { className: 'layout' }, Component);
},
};
wrapperMap.set(wrapperName, wrapper);
diff --git a/main/src/layouts/Link.vue b/main/src/layouts/Link.vue
deleted file mode 100644
index 257ed94..0000000
--- a/main/src/layouts/Link.vue
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/main/src/layouts/index-bak.vue b/main/src/layouts/index-bak.vue
new file mode 100644
index 0000000..37a1d4d
--- /dev/null
+++ b/main/src/layouts/index-bak.vue
@@ -0,0 +1,223 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/main/src/layouts/index.vue b/main/src/layouts/index.vue
index dbbecbe..8fd1567 100644
--- a/main/src/layouts/index.vue
+++ b/main/src/layouts/index.vue
@@ -2,113 +2,29 @@
* @Description:
* @Author: zenghua.wang
* @Date: 2023-06-20 14:29:45
- * @LastEditors: zenghua.wang “1048523306@qq.com”
- * @LastEditTime: 2025-01-17 16:36:25
+ * @LastEditors: zenghua.wang
+ * @LastEditTime: 2025-01-25 09:28:53
-->
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/main/src/main.js b/main/src/main.js
index 7ac7581..9105699 100644
--- a/main/src/main.js
+++ b/main/src/main.js
@@ -5,9 +5,11 @@ import router from './router';
import pinia from './store';
import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
+import { registerGlobalMicroApps } from './micro';
import { registerElIcons } from './plugins/icon';
import './utils/permission';
const app = createApp(App);
app.use(pinia).use(router).use(ElementPlus).mount('#root');
registerElIcons(app);
+registerGlobalMicroApps();
diff --git a/main/src/micro/app.js b/main/src/micro/app.js
index 0a7bf91..18c6793 100644
--- a/main/src/micro/app.js
+++ b/main/src/micro/app.js
@@ -4,9 +4,9 @@ const { VITE_APP_SUB_VUE, VITE_APP_SUB_ADMIN, VITE_APP_SUB_GAS } = import.meta.e
export const leftApps = [
{
- name: 'sub-vue',
+ name: 'sub-operation-service',
entry: VITE_APP_SUB_VUE,
- activeRule: '/sub-vue/',
+ activeRule: '/sub-operation-service/',
title: '运营服务',
icon: 'platform/icon-home.png',
},
@@ -69,7 +69,7 @@ export const microApps = [...leftApps, ...rightApps];
const apps = microApps.map((item) => {
return {
...item,
- container: '#sub-app',
+ container: '#app',
props: {
routerBase: item.activeRule,
getGlobalState: actions.getGlobalState,
diff --git a/main/src/micro/index.js b/main/src/micro/index.js
index 2e71ae1..dc1cf12 100644
--- a/main/src/micro/index.js
+++ b/main/src/micro/index.js
@@ -2,9 +2,7 @@ import { registerMicroApps, setDefaultMountApp, start, addGlobalUncaughtErrorHan
import microApps from './app';
const registerGlobalMicroApps = () => {
- // 给子应用配置加上loader方法
const apps = microApps.map((item) => {
- // console.log('registerGlobalMicroApps==', item);
return {
...item,
};
@@ -12,25 +10,22 @@ const registerGlobalMicroApps = () => {
registerMicroApps(apps, {
beforeLoad: (app) => {
- console.log('before load', app);
- switch (app.name) {
- case 'sub-vue':
- document.title = 'sub-vue';
- break;
- case 'sub-admin':
- document.title = 'sub-admin';
- break;
- }
+ console.log('before load=', app);
},
beforeMount: [
(app) => {
- console.log('before mount', app.name);
+ console.log('before mount=', app);
+ },
+ ],
+ afterUnmount: [
+ (app) => {
+ console.log('after unmount=', app);
},
],
});
start({
- prefetch: false, // 取消预加载
+ prefetch: true, // 取消预加载
sandbox: { experimentalStyleIsolation: true },
});
diff --git a/main/src/router/index.js b/main/src/router/index.js
index 323502d..0ec93ba 100644
--- a/main/src/router/index.js
+++ b/main/src/router/index.js
@@ -1,4 +1,4 @@
-import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router';
+import { createRouter, createWebHistory } from 'vue-router';
import Layout from '@/layouts/index.vue';
export const constantRoutes = [
@@ -12,12 +12,6 @@ export const constantRoutes = [
icon: 'Login',
},
},
- {
- path: '/platform',
- component: () => import('@/views/index.vue'),
- name: 'platform',
- meta: { title: '平台入口', icon: 'House' },
- },
{
path: '/',
name: 'layout',
@@ -26,28 +20,15 @@ export const constantRoutes = [
meta: { title: '平台入口', icon: 'House' },
children: [
{
- path: '/home',
- component: () => import('@/views/home.vue'),
- name: 'home',
+ path: '/platform',
+ component: () => import('@/views/index.vue'),
+ name: 'platform',
meta: { title: '平台入口', icon: 'House' },
},
- {
- path: '/sub-admin/:pathMatch(.*)*',
- component: () => import('@/views/subApp.vue'),
- name: 'sub-admin',
- hidden: true,
- meta: { title: '子应用入口', icon: 'House' },
- },
],
},
];
-export const notFoundRouter = {
- path: '/:pathMatch(.*)',
- name: 'notFound',
- redirect: '/404',
-};
-
const router = createRouter({
history: createWebHistory(),
routes: constantRoutes,
diff --git a/main/src/store/modules/permission.js b/main/src/store/modules/permission.js
index 6691180..9d95a93 100644
--- a/main/src/store/modules/permission.js
+++ b/main/src/store/modules/permission.js
@@ -1,5 +1,5 @@
import { defineStore } from 'pinia';
-import { constantRoutes, notFoundRouter } from '@/router';
+import { constantRoutes } from '@/router';
import { createAsyncRoutes, filterAsyncRoutes, filterKeepAlive } from '@/utils/router';
import { useUserStore } from '@/store/modules/user';
import { getTree } from '@/utils';
@@ -34,7 +34,6 @@ export const usePermissionStore = defineStore({
} else {
accessedRoutes = this.asyncRoutes || [];
}
- accessedRoutes = accessedRoutes.concat(notFoundRouter);
this.routes = constantRoutes.concat(accessedRoutes);
resolve(accessedRoutes);
});
diff --git a/main/src/utils/permission.js b/main/src/utils/permission.js
index 2bb80bf..8501768 100644
--- a/main/src/utils/permission.js
+++ b/main/src/utils/permission.js
@@ -13,23 +13,13 @@ import { usePermissionStore } from '@/store/modules/permission';
NProgress.configure({ showSpinner: false });
-const { VITE_APP_NAME } = import.meta.env;
+const { VITE_APP_TITLE } = import.meta.env;
const whiteList = ['/login'];
router.beforeEach(async (to, from, next) => {
- // 解决三级菜单页面缓存问题
- // if (to.matched && to.matched.length > 1) {
- // for (let i = 0; i < to.matched.length; i++) {
- // const element = to.matched[i];
- // if (element.components.default.name === 'ViewBox') {
- // to.matched.splice(i, 1);
- // }
- // }
- // }
-
NProgress.start();
if (typeof to.meta.title === 'string') {
- document.title = VITE_APP_NAME + ' | ' + to.meta.title;
+ document.title = VITE_APP_TITLE + ' | ' + to.meta.title;
}
const userStore = useUserStore();
@@ -46,6 +36,11 @@ router.beforeEach(async (to, from, next) => {
accessRoutes.forEach((item) => router.addRoute(item));
next({ ...to, replace: true });
} else {
+ // 子应用跳转回主应用时判断#app是否还有渲染的子应用,如若没有则重新渲染主应用
+ if (from.path.includes('/sub') && !to.path.includes('/sub')) {
+ window.location.reload();
+ return;
+ }
next();
}
} catch (error) {
@@ -59,26 +54,8 @@ router.beforeEach(async (to, from, next) => {
next(`/login?redirect=${to.path}`);
}
}
-
- // const PermissionStore = usePermissionStore();
- // console.log('===', PermissionStore.routes);
- // if (!PermissionStore.routes.length) {
- // const accessRoutes = await PermissionStore.getRoutes();
- // accessRoutes.forEach((item) => router.addRoute(item));
- // next({ ...to, replace: true });
- // } else {
- // next();
- // }
});
-router.afterEach((to) => {
- // qiankun子应用跳转回主应用时判断#app是否还有渲染的子应用,如若没有则重新渲染主应用
- // setTimeout(() => {
- // if (to.path === '/') {
- // if (window.wocwin_qiankun) {
- // window.wocwin_qiankun = null;
- // }
- // }
- // }, 300);
+router.afterEach(() => {
NProgress.done();
});
diff --git a/main/src/views/home.vue b/main/src/views/home.vue
deleted file mode 100644
index 312b8bb..0000000
--- a/main/src/views/home.vue
+++ /dev/null
@@ -1,7 +0,0 @@
-
- home
-
-
-
-
-
diff --git a/sub-admin/src/layouts/component/Breadcrumb/index.vue b/sub-admin/src/layouts/component/Breadcrumb/index.vue
index c01ea2e..2a42b29 100644
--- a/sub-admin/src/layouts/component/Breadcrumb/index.vue
+++ b/sub-admin/src/layouts/component/Breadcrumb/index.vue
@@ -3,7 +3,7 @@
* @Author: zenghua.wang
* @Date: 2023-06-20 14:29:45
* @LastEditors: zenghua.wang
- * @LastEditTime: 2024-01-26 23:04:14
+ * @LastEditTime: 2025-01-24 15:13:25
-->
@@ -36,3 +36,9 @@ const handleLink = (item) => {
const matched = computed(() => route.matched.filter((item) => item.meta && item.meta.title && item.meta.breadcrumb !== false));
+
\ No newline at end of file
diff --git a/sub-admin/src/layouts/component/Header/index.vue b/sub-admin/src/layouts/component/Header/index.vue
index 5876534..0cc91e9 100644
--- a/sub-admin/src/layouts/component/Header/index.vue
+++ b/sub-admin/src/layouts/component/Header/index.vue
@@ -3,7 +3,7 @@
* @Author: zenghua.wang
* @Date: 2023-06-20 14:29:45
* @LastEditors: zenghua.wang
- * @LastEditTime: 2024-02-19 21:11:20
+ * @LastEditTime: 2025-01-24 15:12:54
-->
@@ -21,7 +21,6 @@
@@ -36,7 +35,6 @@ import { useSettingStore } from '@/store/modules/setting';
import { setPx } from '@/utils';
import Hamburger from '../Hamburger';
import Breadcrumb from '../Breadcrumb';
-import Size from '../Size';
import ScreenFull from '../ScreenFull';
import Avatar from '../Avatar';
import TagsView from '../TagsView';
diff --git a/sub-admin/src/layouts/component/Size/index.vue b/sub-admin/src/layouts/component/Size/index.vue
deleted file mode 100644
index 79e11e8..0000000
--- a/sub-admin/src/layouts/component/Size/index.vue
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
- {{ assemblySizeListCh[item] }}
-
-
-
-
-
-
-
diff --git a/sub-government-affairs-service/src/config/index.js b/sub-government-affairs-service/src/config/index.js
index 0e4f584..a3a7dd5 100644
--- a/sub-government-affairs-service/src/config/index.js
+++ b/sub-government-affairs-service/src/config/index.js
@@ -8,3 +8,22 @@ export const CONSTANTS = {
PREFIX: `${VITE_APP_NAME}_`,
PRIMARY: '#409eff',
};
+
+export const CRUD_OPTIONS = {
+ index: true,
+ indexLabel: '序号',
+ indexWidth: 80,
+ selection: true,
+ align: 'center',
+ headerAlign: 'center',
+ gridBtn: false,
+ addBtn: true,
+ viewBtn: false,
+ editBtn: false,
+ delBtn: false,
+ gutter: 20,
+ labelWidth: 150,
+ column: [],
+ menuWidth: 100,
+ actions: [],
+};
diff --git a/sub-government-affairs-service/src/layouts/component/Header/index.vue b/sub-government-affairs-service/src/layouts/component/Header/index.vue
index 5876534..2392b50 100644
--- a/sub-government-affairs-service/src/layouts/component/Header/index.vue
+++ b/sub-government-affairs-service/src/layouts/component/Header/index.vue
@@ -3,7 +3,7 @@
* @Author: zenghua.wang
* @Date: 2023-06-20 14:29:45
* @LastEditors: zenghua.wang
- * @LastEditTime: 2024-02-19 21:11:20
+ * @LastEditTime: 2025-01-24 15:11:22
-->
@@ -21,7 +21,6 @@
@@ -36,7 +35,6 @@ import { useSettingStore } from '@/store/modules/setting';
import { setPx } from '@/utils';
import Hamburger from '../Hamburger';
import Breadcrumb from '../Breadcrumb';
-import Size from '../Size';
import ScreenFull from '../ScreenFull';
import Avatar from '../Avatar';
import TagsView from '../TagsView';
diff --git a/sub-government-affairs-service/src/layouts/component/Size/index.vue b/sub-government-affairs-service/src/layouts/component/Size/index.vue
deleted file mode 100644
index 79e11e8..0000000
--- a/sub-government-affairs-service/src/layouts/component/Size/index.vue
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
-
-
-
-
- {{ assemblySizeListCh[item] }}
-
-
-
-
-
-
-
diff --git a/sub-government-affairs-service/src/router/modules/plantingAndBreeding.js b/sub-government-affairs-service/src/router/modules/plantingAndBreeding.js
index 98ddf66..bfa4bce 100644
--- a/sub-government-affairs-service/src/router/modules/plantingAndBreeding.js
+++ b/sub-government-affairs-service/src/router/modules/plantingAndBreeding.js
@@ -23,9 +23,9 @@ export default [
meta: { title: '基地档案', icon: 'Document' },
},
{
- path: '/planting-land2',
- component: () => import('@/views/index.vue'),
- name: 'planting-land2',
+ path: '/planting-seed',
+ component: () => import('@/views/trace/planting/seed.vue'),
+ name: 'planting-seed',
meta: { title: '种子档案', icon: 'Document' },
},
],
diff --git a/sub-government-affairs-service/src/styles/common/define.scss b/sub-government-affairs-service/src/styles/common/define.scss
index b4a4bf9..c2ba1fb 100644
--- a/sub-government-affairs-service/src/styles/common/define.scss
+++ b/sub-government-affairs-service/src/styles/common/define.scss
@@ -124,3 +124,16 @@
color: $color-danger;
}
}
+
+// fix
+.avue-form {
+ .el-form-item__label {
+ display: flex;
+ flex-direction: row;
+ align-items: center;
+
+ .el-tooltip__trigger {
+ margin: 0 3px;
+ }
+ }
+}
diff --git a/sub-government-affairs-service/src/views/resource/land/index.vue b/sub-government-affairs-service/src/views/resource/land/index.vue
index 6cb3a5b..66caafe 100644
--- a/sub-government-affairs-service/src/views/resource/land/index.vue
+++ b/sub-government-affairs-service/src/views/resource/land/index.vue
@@ -1,6 +1,7 @@
diff --git a/sub-government-affairs-service/src/views/trace/planting/archives.vue b/sub-government-affairs-service/src/views/trace/planting/archives.vue
index 1a2e654..828652b 100644
--- a/sub-government-affairs-service/src/views/trace/planting/archives.vue
+++ b/sub-government-affairs-service/src/views/trace/planting/archives.vue
@@ -1,6 +1,7 @@