diff --git a/main/.env.development b/main/.env.development
index 1454701..a332768 100644
--- a/main/.env.development
+++ b/main/.env.development
@@ -4,8 +4,9 @@ VITE_APP_NAME = 'daimp-front-main'
VITE_APP_TITLE = '数字农业产业管理平台'
VITE_APP_SUB_OS = '//localhost:9526/sub-operation-service/'
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 = '//localhost:9528/sub-government-affairs-service/'
-VITE_APP_SUB_GAA = '//localhost:9525/sub-government-affairs-admin/'
+VITE_APP_SUB_GAA = '//localhost:9525/sub-government-admin/'
VITE_APP_SUB_GSS = '//localhost:9529/sub-government-screen-service/'
VITE_APP_SUB_GSR = '//localhost:9530/new-digital-agriculture-screen/'
# 接口
diff --git a/main/.env.pre b/main/.env.pre
new file mode 100644
index 0000000..896c31f
--- /dev/null
+++ b/main/.env.pre
@@ -0,0 +1,13 @@
+# 本地环境
+VITE_APP_NAME = 'daimp-front-main'
+VITE_APP_TITLE = '数字农业产业管理平台'
+VITE_APP_SUB_OS = '//localhost:8090/sub-operation-service/'
+VITE_APP_SUB_OA = '//localhost:8090/sub-operation-admin/'
+VITE_APP_SUB_GAS = '//localhost:8090/sub-government-affairs-service/'
+VITE_APP_SUB_GAA = '//localhost:8090/sub-government-admin/'
+VITE_APP_SUB_GSS = '//localhost:8090/sub-government-screen-service/'
+# 接口
+VITE_APP_BASE_API = '/apis'
+VITE_APP_BASE_URL = ''
+VITE_APP_UPLOAD_API = '/uploadApis'
+VITE_APP_UPLOAD_URL = ''
\ No newline at end of file
diff --git a/main/.env.production b/main/.env.production
index fe0fac2..7ab9499 100644
--- a/main/.env.production
+++ b/main/.env.production
@@ -1,12 +1,20 @@
# 正式环境
VITE_APP_NAME = 'daimp-front-main'
VITE_APP_TITLE = '数字农业产业管理平台'
+<<<<<<< HEAD
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_SUB_GSR = '//http://47.109.205.240:88/new-digital-agriculture-screen/'
+=======
+VITE_APP_SUB_OS = '//47.109.205.240:80/sub-operation-service/'
+VITE_APP_SUB_OA = '//47.109.205.240:80/sub-operation-admin/'
+VITE_APP_SUB_GAS = '//47.109.205.240:80/sub-government-affairs-service/'
+VITE_APP_SUB_GAA = '//47.109.205.240:80/sub-government-admin/'
+VITE_APP_SUB_GSS = '//47.109.205.240:80/sub-government-screen-service/'
+>>>>>>> dev
# 接口
VITE_APP_BASE_API = '/apis'
VITE_APP_BASE_URL = ''
diff --git a/main/.env.test b/main/.env.test
index 53b6341..f22cfe4 100644
--- a/main/.env.test
+++ b/main/.env.test
@@ -4,7 +4,7 @@ VITE_APP_TITLE = '数字农业产业管理平台'
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_GAA = '//192.168.18.99:88/sub-government-admin/'
VITE_APP_SUB_GSS = '//192.168.18.99:88/sub-government-screen-service/'
VITE_APP_SUB_GSR = '//192.168.18.99:88/new-digital-agriculture-screen/'
# 接口
diff --git a/main/index.html b/main/index.html
index 211ab8e..4004ee8 100644
--- a/main/index.html
+++ b/main/index.html
@@ -7,13 +7,13 @@
-
-
+ -->
diff --git a/main/src/components/custom-echart-bar/index.vue b/main/src/components/custom-echart-bar/index.vue
index 9c8f82a..c2b5e78 100644
--- a/main/src/components/custom-echart-bar/index.vue
+++ b/main/src/components/custom-echart-bar/index.vue
@@ -37,10 +37,20 @@ export default {
emits: ['click'],
setup(props, { emit }) {
const chartRef = ref(null);
- const { setOptions, getInstance } = useEcharts(chartRef);
+ const { setOptions, getInstance, startAutoPlay } = useEcharts(chartRef);
const option = reactive({
tooltip: {
trigger: 'axis',
+ tooltip: {
+ backgroundColor: 'rgba(12, 36, 56, 0.9)', // 背景颜色(支持RGBA格式)
+ borderColor: '#2cf4fd', // 边框颜色
+ borderWidth: 1, // 边框宽度
+ textStyle: {
+ color: '#fff', // 文字颜色
+ fontSize: 12,
+ },
+ formatter: '{b}:{c}',
+ },
axisPointer: {
type: 'shadow',
label: {
@@ -97,6 +107,11 @@ export default {
option.series = props.isSeries && option.series.length > 0 ? option.series : seriesData;
option.xAxis.data = xAxisData;
setOptions(option);
+ startAutoPlay({
+ interval: 2000,
+ seriesIndex: 0,
+ showTooltip: true,
+ });
getInstance()?.off('click', onClick);
getInstance()?.on('click', onClick);
}
diff --git a/main/src/components/custom-echart-line-line/index.vue b/main/src/components/custom-echart-line-line/index.vue
index cf0ae9e..d647ab1 100644
--- a/main/src/components/custom-echart-line-line/index.vue
+++ b/main/src/components/custom-echart-line-line/index.vue
@@ -33,7 +33,7 @@ export default {
emits: ['click'],
setup(props, { emit }) {
const chartRef = ref(null);
- const { setOptions, getInstance, resize } = useEcharts(chartRef);
+ const { setOptions, getInstance, resize, startAutoPlay } = useEcharts(chartRef);
const optionVal = reactive({});
watchEffect(() => {
@@ -55,6 +55,11 @@ export default {
Object.assign(optionVal, cloneDeep(props.option));
}
setOptions(props.option);
+ startAutoPlay({
+ interval: 2000,
+ seriesIndex: 0,
+ showTooltip: true,
+ });
resize();
getInstance()?.off('click', onClick);
getInstance()?.on('click', onClick);
diff --git a/main/src/components/custom-echart-line/index.vue b/main/src/components/custom-echart-line/index.vue
index 00d47fd..4ec7c45 100644
--- a/main/src/components/custom-echart-line/index.vue
+++ b/main/src/components/custom-echart-line/index.vue
@@ -34,7 +34,7 @@ export default {
emits: ['click'],
setup(props, { emit }) {
const chartRef = ref(null);
- const { setOptions, getInstance } = useEcharts(chartRef);
+ const { setOptions, getInstance, startAutoPlay } = useEcharts(chartRef);
const option = reactive({
tooltip: {
trigger: 'axis',
@@ -138,6 +138,11 @@ export default {
option.series = seriesData;
option.xAxis.data = xAxisData;
setOptions(option);
+ startAutoPlay({
+ interval: 2000,
+ seriesIndex: 0,
+ showTooltip: true,
+ });
getInstance()?.off('click', onClick);
getInstance()?.on('click', onClick);
}
diff --git a/main/src/components/custom-echart-mixin/index.vue b/main/src/components/custom-echart-mixin/index.vue
index 3660351..e8e3aa0 100644
--- a/main/src/components/custom-echart-mixin/index.vue
+++ b/main/src/components/custom-echart-mixin/index.vue
@@ -29,10 +29,17 @@ export default {
},
setup(props) {
const chartRef = ref(null);
- const { setOptions } = useEcharts(chartRef);
+ const { setOptions, startAutoPlay } = useEcharts(chartRef);
const option = reactive({
tooltip: {
trigger: 'axis',
+ backgroundColor: 'rgba(12, 36, 56, 0.9)', // 背景颜色(支持RGBA格式)
+ borderColor: '#2cf4fd', // 边框颜色
+ borderWidth: 1, // 边框宽度
+ textStyle: {
+ color: '#fff', // 文字颜色
+ fontSize: 12,
+ },
axisPointer: {
type: 'shadow',
label: {
@@ -84,6 +91,11 @@ export default {
option.series = seriesData;
option.xAxis.data = xAxisData;
setOptions(option);
+ startAutoPlay({
+ interval: 2000,
+ seriesIndex: 0,
+ showTooltip: true,
+ });
}
return { chartRef };
},
diff --git a/main/src/components/custom-echart-pictorial-bar/index.vue b/main/src/components/custom-echart-pictorial-bar/index.vue
index 693ea50..9f8ab69 100644
--- a/main/src/components/custom-echart-pictorial-bar/index.vue
+++ b/main/src/components/custom-echart-pictorial-bar/index.vue
@@ -33,7 +33,7 @@ export default {
emits: ['click'],
setup(props, { emit }) {
const chartRef = ref(null);
- const { setOptions, getInstance, resize } = useEcharts(chartRef);
+ const { setOptions, getInstance, resize, startAutoPlay } = useEcharts(chartRef);
const option = reactive({
grid: {
left: '3%',
@@ -42,9 +42,6 @@ export default {
top: '11%',
containLabel: true,
},
- tooltip: {
- formatter: '{b}',
- },
series: [
{
type: 'pictorialBar',
@@ -104,6 +101,11 @@ export default {
Object.assign(option, cloneDeep(props.option));
}
setOptions(option);
+ startAutoPlay({
+ interval: 2000,
+ seriesIndex: 0,
+ showTooltip: true,
+ });
resize();
getInstance()?.off('click', onClick);
getInstance()?.on('click', onClick);
diff --git a/main/src/components/custom-echart-pie/index.vue b/main/src/components/custom-echart-pie/index.vue
index 95c85da..dc75bd3 100644
--- a/main/src/components/custom-echart-pie/index.vue
+++ b/main/src/components/custom-echart-pie/index.vue
@@ -33,9 +33,16 @@ export default {
emits: ['click'],
setup(props, { emit }) {
const chartRef = ref(null);
- const { setOptions, getInstance, resize } = useEcharts(chartRef);
+ const { setOptions, getInstance, resize, startAutoPlay } = useEcharts(chartRef);
const option = reactive({
tooltip: {
+ backgroundColor: 'rgba(12, 36, 56, 0.9)', // 背景颜色(支持RGBA格式)
+ borderColor: '#2cf4fd', // 边框颜色
+ borderWidth: 1, // 边框宽度
+ textStyle: {
+ color: '#fff', // 文字颜色
+ fontSize: 12,
+ },
formatter: '{b} ({c})',
},
series: [
@@ -74,6 +81,11 @@ export default {
}
option.series[0].data = props.chartData;
setOptions(option);
+ startAutoPlay({
+ interval: 2000,
+ seriesIndex: 0,
+ showTooltip: true,
+ });
resize();
getInstance()?.off('click', onClick);
getInstance()?.on('click', onClick);
diff --git a/main/src/components/custom-import-excel/index.vue b/main/src/components/custom-import-excel/index.vue
index 7529540..e90047f 100644
--- a/main/src/components/custom-import-excel/index.vue
+++ b/main/src/components/custom-import-excel/index.vue
@@ -2,7 +2,8 @@
将文件放在此处或单击上传
- excel文件大小小于500kb
+ 仅允许导入xls、xlsx格式文件,excel文件大小小于500kb
@@ -29,6 +30,10 @@
import { reactive, ref, shallowRef } from 'vue';
import { isEmpty } from '@/utils';
const props = defineProps({
+ title: {
+ type: String,
+ default: '文件导入',
+ },
tips: {
type: String,
default: '提示:导入前请先下载模板填写信息,然后再导入!',
diff --git a/main/src/components/custom-number-select-double/index.vue b/main/src/components/custom-number-select-double/index.vue
new file mode 100644
index 0000000..6d06426
--- /dev/null
+++ b/main/src/components/custom-number-select-double/index.vue
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+
diff --git a/main/src/components/custom-number-select/index.vue b/main/src/components/custom-number-select/index.vue
new file mode 100644
index 0000000..57a506e
--- /dev/null
+++ b/main/src/components/custom-number-select/index.vue
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+
diff --git a/main/src/components/index.js b/main/src/components/index.js
index 565cf38..c376aa2 100644
--- a/main/src/components/index.js
+++ b/main/src/components/index.js
@@ -19,6 +19,8 @@ import CustomEchartPieGauge from './custom-echart-pie-gauge';
import CustomEchartWordCloud from './custom-echart-word-cloud';
import customEchartScatterBlister from './custom-echart-scatter-blister';
import customEchartMaps from './custom-echart-maps';
+import customNumberSelect from './custom-number-select';
+import customNumberSelectDouble from './custom-number-select-double';
export {
SvgIcon,
@@ -42,4 +44,6 @@ export {
CustomEchartWordCloud,
customEchartScatterBlister,
customEchartMaps,
+ customNumberSelect,
+ customNumberSelectDouble,
};
diff --git a/main/src/hooks/useEcharts.js b/main/src/hooks/useEcharts.js
index 7a78abd..cc00ec0 100644
--- a/main/src/hooks/useEcharts.js
+++ b/main/src/hooks/useEcharts.js
@@ -6,6 +6,57 @@ import { useBreakpoint } from './useBreakpoint';
import echarts from '../utils/echarts';
export const useEcharts = (elRef, theme = 'default') => {
+ // 新增轮播相关状态
+ const autoPlayTimer = ref(null);
+ const currentIndex = ref(-1);
+ const dataLength = ref(0);
+
+ // 新增方法 - 启动轮播
+ const startAutoPlay = (options = {}) => {
+ const {
+ interval = 2000, // 轮播间隔(ms)
+ seriesIndex = 0, // 默认操作第一个系列
+ showTooltip = true, // 是否显示提示框
+ } = options;
+
+ stopAutoPlay(); // 先停止已有轮播
+
+ // 获取数据长度
+ const seriesData = unref(getOptions).series?.[seriesIndex]?.data;
+ dataLength.value = seriesData?.length || 0;
+ if (dataLength.value === 0) return;
+
+ autoPlayTimer.value = setInterval(() => {
+ currentIndex.value = (currentIndex.value + 1) % dataLength.value;
+
+ // 执行轮播动作
+ chartInstance?.dispatchAction({
+ type: 'downplay',
+ seriesIndex: seriesIndex,
+ });
+ chartInstance?.dispatchAction({
+ type: 'highlight',
+ seriesIndex: seriesIndex,
+ dataIndex: currentIndex.value,
+ });
+ if (showTooltip) {
+ chartInstance?.dispatchAction({
+ type: 'showTip',
+ seriesIndex: seriesIndex,
+ dataIndex: currentIndex.value,
+ });
+ }
+ }, interval);
+ };
+
+ // 新增方法 - 停止轮播
+ const stopAutoPlay = () => {
+ if (autoPlayTimer.value) {
+ clearInterval(autoPlayTimer.value);
+ autoPlayTimer.value = null;
+ }
+ };
+
const getDarkMode = computed(() => {
return theme === 'default' ? 'dark' : theme;
});
@@ -31,23 +82,39 @@ export const useEcharts = (elRef, theme = 'default') => {
if (!el || !unref(el)) {
return;
}
+ nextTick(() => {
+ if (el.offsetWidth === 0 || el.offsetHeight === 0) {
+ // console.warn('图表容器不可见,延迟初始化');
+ useTimeoutFn(() => initCharts(t), 100);
+ return;
+ }
- chartInstance = echarts.init(el, t);
- const { removeEvent } = useEventListener({
- el: window,
- name: 'resize',
- listener: resizeFn,
+ chartInstance = echarts.init(el, t);
+ const { removeEvent } = useEventListener({
+ el: window,
+ name: 'resize',
+ listener: resizeFn,
+ });
+ removeResizeFn = removeEvent;
+ const { widthRef } = useBreakpoint();
+ if (unref(widthRef) <= 768 || el.offsetHeight === 0) {
+ useTimeoutFn(() => {
+ resizeFn();
+ }, 30);
+ }
});
- removeResizeFn = removeEvent;
- const { widthRef } = useBreakpoint();
- if (unref(widthRef) <= 768 || el.offsetHeight === 0) {
- useTimeoutFn(() => {
- resizeFn();
- }, 30);
- }
}
function setOptions(options = {}, clear = true) {
+ const mergedOptions = {
+ animation: true,
+ animationDuration: 3000,
+ animationEasing: 'cubicOut',
+ ...unref(options),
+ animationThreshold: 2000, // 数据量超过2000自动关闭动画
+ animationDelayUpdate: (idx) => idx * 50, // 数据项延迟
+ };
+ cacheOptions.value = mergedOptions;
cacheOptions.value = options;
if (unref(elRef)?.offsetHeight === 0) {
useTimeoutFn(() => {
@@ -98,6 +165,7 @@ export const useEcharts = (elRef, theme = 'default') => {
);
tryOnUnmounted(() => {
+ stopAutoPlay(); // 清理定时器
if (!chartInstance) return;
removeResizeFn();
chartInstance.dispose();
@@ -115,7 +183,9 @@ export const useEcharts = (elRef, theme = 'default') => {
setOptions,
resize,
echarts,
- getInstance,
+ getInstance: () => chartInstance,
registerMap,
+ startAutoPlay, // 暴露轮播方法
+ stopAutoPlay,
};
};
diff --git a/main/src/micro/app.js b/main/src/micro/app.js
index 934bcf2..fede9a2 100644
--- a/main/src/micro/app.js
+++ b/main/src/micro/app.js
@@ -1,6 +1,10 @@
import actions from './actions';
+<<<<<<< HEAD
const { VITE_APP_SUB_OS, VITE_APP_SUB_ADMIN, VITE_APP_SUB_GAS, VITE_APP_SUB_GSS, VITE_APP_SUB_GSR } = import.meta.env;
+=======
+const { VITE_APP_SUB_OS, VITE_APP_SUB_OA, VITE_APP_SUB_APP, VITE_APP_SUB_GAA, VITE_APP_SUB_GAS, VITE_APP_SUB_GSS } = import.meta.env;
+>>>>>>> dev
export const leftApps = [
{
@@ -11,23 +15,23 @@ export const leftApps = [
icon: 'images/platform/icon-home.png',
},
{
- name: 'sub-admin',
- entry: VITE_APP_SUB_ADMIN,
- activeRule: '/sub-admin',
+ name: 'sub-operation-admin',
+ entry: VITE_APP_SUB_OA,
+ activeRule: '/sub-operation-admin',
title: '管理后台',
icon: 'images/platform/icon-admin.png',
},
{
name: 'sub-app',
- entry: VITE_APP_SUB_ADMIN,
+ entry: VITE_APP_SUB_APP,
activeRule: '/sub-app',
title: 'APP',
icon: 'images/platform/icon-app.png',
},
{
- name: 'sub-screen',
- entry: VITE_APP_SUB_ADMIN,
- activeRule: '/sub-screen',
+ name: 'sub-government-screen-service',
+ entry: VITE_APP_SUB_GSS,
+ activeRule: '/sub-government-screen-service',
title: '数据大屏',
icon: 'images/platform/icon-screen.png',
},
@@ -43,15 +47,15 @@ export const rightApps = [
},
{
name: 'sub-government-admin',
- entry: VITE_APP_SUB_ADMIN,
- activeRule: '/sub-government-admin',
+ entry: VITE_APP_SUB_GAA,
+ activeRule: '/sub-government-affairs-service',
title: '管理后台',
icon: 'images/platform/icon-admin.png',
},
{
- name: 'sub-government-app',
- entry: VITE_APP_SUB_ADMIN,
- activeRule: '/sub-government-app',
+ name: 'sub-app',
+ entry: VITE_APP_SUB_APP,
+ activeRule: '/sub-app',
title: 'APP',
icon: 'images/platform/icon-app.png',
},
@@ -68,6 +72,20 @@ export const rightApps = [
];
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,
@@ -85,16 +103,8 @@ export const defaultApps = [
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];
export const microApps = [...defaultApps];
console.log(microApps);
const apps = microApps.map((item) => {
diff --git a/main/src/views/index.vue b/main/src/views/index.vue
index 68f153c..65ff74a 100644
--- a/main/src/views/index.vue
+++ b/main/src/views/index.vue
@@ -31,8 +31,7 @@
-
-
-
-
-
-
-
-