提交 23938f3a 编写于 作者: ibizdev's avatar ibizdev

zhujiamin 发布系统代码 [TrainSys,网页端]

上级 ea9eda78
......@@ -4,6 +4,10 @@
<meta charset="UTF-8" />
<link id="favicon" rel="icon" type="image/svg+xml" href="/assets/img/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Cache" content="no-cache">
<link type="text/css" href="/assets/css/app-loading.css" rel="stylesheet" />
<link
type="text/css"
......
......@@ -12,6 +12,7 @@
},
"dependencies": {
"@floating-ui/dom": "^1.0.11",
"@ibiz-template-plugin/jsjcy-kq-web": "^0.0.1-beta.1",
"@ibiz-template/command": "^0.0.1-beta.50",
"@ibiz-template/controller": "^0.0.1-beta.69",
"@ibiz-template/core": "^0.0.1-beta.69",
......
.am-pie-threed-echarts {
width: 100%;
height: 600px;
/* stylelint-disable-next-line selector-id-pattern */
#myChart {
width: 100%;
height: 100%;
}
}
import { defineComponent, ref, onMounted } from 'vue';
import * as am4core from '@amcharts/amcharts4/core';
import * as am4charts from '@amcharts/amcharts4/charts';
// eslint-disable-next-line camelcase
import am4themes_animated from '@amcharts/amcharts4/themes/animated';
import './am-pie-threed-echarts.scss';
export const AmPie3D = defineComponent({
name: 'Pie3D',
props: {
pieData: {
type: Array<IData>,
default: () => [],
},
},
setup(_props) {
const pieChart = ref(null);
onMounted(() => {
// Set theme
am4core.useTheme(am4themes_animated);
// Create chart instance
const chart = am4core.create('myChart', am4charts.PieChart3D);
// 角度
chart.angle = 50;
// 厚度
chart.depth = 20;
// Add data
chart.data = [
{
category: 'Lithuania',
value: 501.9,
sliced: true,
color: am4core.color('#F44336'),
},
{
category: 'Czechia',
value: 301.9,
sliced: true,
color: am4core.color('#4CAF50'),
},
{
category: 'Ireland',
value: 201.1,
sliced: true,
color: am4core.color('#2196F3'),
},
{
category: 'Germany',
value: 165.8,
sliced: true,
color: am4core.color('#FFC107'),
},
{
category: 'Australia',
value: 139.9,
sliced: true,
color: am4core.color('#9C27B0'),
},
{
category: 'Austria',
value: 128.3,
sliced: true,
},
{
category: 'UK',
value: 99,
sliced: true,
},
{
category: 'Belgium',
value: 60,
sliced: true,
},
{
category: 'The Netherlands',
value: 50,
sliced: true,
},
];
// Add and configure Series
const pieSeries = chart.series.push(new am4charts.PieSeries3D());
pieSeries.dataFields.value = 'value';
pieSeries.dataFields.category = 'category';
pieSeries.slices.template.stroke = am4core.color('#fff');
pieSeries.slices.template.strokeWidth = 2;
pieSeries.slices.template.strokeOpacity = 1;
// 设置图例
chart.legend = new am4charts.Legend();
chart.legend.position = 'right';
// 设置 isActive 属性为数据项的 sliced 属性
pieSeries.slices.template.propertyFields.isActive = 'sliced';
// 设置颜色字段为 "color"
pieSeries.slices.template.propertyFields.fill = 'color';
});
return {
pieChart,
};
},
render() {
return (
<div class='am-pie-threed-echarts'>
<div id='myChart' ref='pieChart' />
</div>
);
},
});
.chart-wrapper {
width: 100%;
height: 600px;
/* stylelint-disable-next-line selector-id-pattern */
#myChart {
width: 100%;
height: 100%;
}
}
......@@ -53,6 +53,8 @@
top: -50px;
right: 0;
z-index: 500;
width: auto;
background-color: transparent;
border: 0;
.#{bem('view-layout-header-content', 'caption')} {
display: none;
......
......@@ -4,7 +4,11 @@ import {
AppMenuItemModel,
IPSAppMenuItem,
} from '@ibiz-template/model';
import { useAppMenuController, useNamespace } from '@ibiz-template/vue-util';
import {
useAppMenuController,
useNamespace,
useRouter,
} from '@ibiz-template/vue-util';
import {
defineComponent,
getCurrentInstance,
......@@ -176,12 +180,12 @@ export const AppMenu = defineComponent({
menus.value = getMenus(c.model.items);
});
let menuClickDoing = false;
let cacheFullPath = '';
const onClick = async (key: string) => {
menuClickDoing = true;
cacheFullPath = proxy.$route.fullPath;
await c.onClickMenuItem(key);
menuClickDoing = false;
cacheFullPath = '';
};
const ns = useNamespace('app-menu');
......@@ -197,15 +201,21 @@ export const AppMenu = defineComponent({
}, 500);
};
const router = useRouter(proxy);
router.beforeEach((to, from, next) => {
if (from.fullPath === cacheFullPath) {
emit('menuRouteChange');
console.log('菜单点击', from);
}
next();
});
// 菜单选中回显,监听视图传进来的currentPath
watch(
() => props.currentPath,
(newVal, oldVal) => {
// 新旧值不一样,且新值不为空时变更
if (newVal !== oldVal && newVal) {
if (menuClickDoing === true) {
emit('menuRouteChange');
}
const findItem = c.model.allItems.find(item => {
return item.viewModelPath === newVal;
});
......
......@@ -66,6 +66,25 @@ export function useIndexRouteManage(
});
};
// 监听当前的key,维护数据
watch(
currentKey,
(newVal, oldVal) => {
if (newVal !== oldVal && newVal) {
const index = keyHistory.value.indexOf(newVal);
// 历史记录里没有的新建信息,放入开头
if (index === -1) {
keyHistory.value.unshift(newVal);
} else {
// 已存在的调整顺序至开头
keyHistory.value.splice(index, 1);
keyHistory.value.unshift(newVal);
}
}
},
{ immediate: true },
);
// 监听路由
watch(
() => proxy.$route.path,
......@@ -98,25 +117,6 @@ export function useIndexRouteManage(
{ deep: true, immediate: true },
);
// 监听当前的key,维护数据
watch(
currentKey,
(newVal, oldVal) => {
if (newVal !== oldVal && newVal) {
const index = keyHistory.value.indexOf(newVal);
// 历史记录里没有的新建信息,放入开头
if (index === -1) {
keyHistory.value.unshift(newVal);
} else {
// 已存在的调整顺序至开头
keyHistory.value.splice(index, 1);
keyHistory.value.unshift(newVal);
}
}
},
{ immediate: true },
);
/**
* 更新路由信息
*
......
<script setup lang="ts">
import { ViewNeuron } from '@ibiz-template/controller';
import { useIndexViewController } from '@ibiz-template/vue-util';
import { computed, getCurrentInstance, onMounted } from 'vue';
import { computed, getCurrentInstance, onMounted, ref } from 'vue';
import { createUUID } from 'qx-util';
import { useIndexRouteManage } from './index-view';
interface IndexViewProps {
......@@ -27,6 +28,8 @@ const {
deleteRouteCache,
} = useIndexRouteManage(proxy, c);
const appKeepAliveKey = ref(createUUID());
// 视图初始化,监听事件
const onCreated = (neuron: ViewNeuron) => {
const key = currentKey.value;
......@@ -37,6 +40,7 @@ const onCreated = (neuron: ViewNeuron) => {
updateRouteMsg(key, { caption: title });
});
};
// dfsdfds
onMounted(() => {
setTimeout(() => {
......@@ -57,7 +61,8 @@ const collapseChange = (collapse: boolean) => {
};
const onMenuRouteChange = () => {
deleteRouteCache(keyHistory.value.slice(1));
deleteRouteCache(keyHistory.value.slice(0));
appKeepAliveKey.value = createUUID();
};
// 后退按钮触发事件,删除上一个路由的缓存
......@@ -87,7 +92,7 @@ const currentPath = computed(() => {
:collapse-change="c.collapseChange"
@menuRouteChange="onMenuRouteChange"
></AppMenu>
<AppKeepAlive :key-list="keyHistory">
<AppKeepAlive :key="appKeepAliveKey" :key-list="keyHistory">
<router-view
:key="currentKey"
@neuronInit="onCreated"
......
......@@ -1224,16 +1224,16 @@
"mOSFilePath" : "pssysapps/TemplatePublish/psappviewmsggroups/VMGroup2",
"name" : "视图消息组2",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "视图消息2",
"name" : "视图消息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg3"
"id" : "ViewMsg2"
}
}, {
"name" : "视图消息",
"name" : "视图消息2",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg2"
"id" : "ViewMsg3"
}
} ],
"rTMOSFilePath" : "pssysapps/TemplatePublish/psappviewmsggroups/VMGroup2"
......
......@@ -2451,16 +2451,16 @@
"mOSFilePath" : "pssysapps/Web/psappviewmsggroups/VMGroup2",
"name" : "视图消息组2",
"getPSAppViewMsgGroupDetails" : [ {
"name" : "视图消息2",
"name" : "视图消息",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg3"
"id" : "ViewMsg2"
}
}, {
"name" : "视图消息",
"name" : "视图消息2",
"getPSAppViewMsg" : {
"modelref" : true,
"id" : "ViewMsg2"
"id" : "ViewMsg3"
}
} ],
"rTMOSFilePath" : "pssysapps/Web/psappviewmsggroups/VMGroup2"
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册