将看板功能独立,方便独立维护功能。
This commit is contained in:
@@ -97,17 +97,53 @@
|
||||
</el-container>
|
||||
</div>
|
||||
|
||||
<!-- Vue.js -->
|
||||
<!-- 先加载基础库 -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
|
||||
<!-- Element UI JS -->
|
||||
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
||||
<!-- Axios -->
|
||||
<!-- 然后加载依赖库 -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
|
||||
<!-- 图表库 -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.9.1/dist/chart.min.js"></script>
|
||||
<!-- 最后加载Element UI -->
|
||||
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
||||
|
||||
<!-- 添加基础样式 -->
|
||||
<style>
|
||||
.el-header {
|
||||
background-color: #409EFF;
|
||||
color: white;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 20px;
|
||||
}
|
||||
.el-footer {
|
||||
background-color: #f5f7fa;
|
||||
color: #606266;
|
||||
text-align: center;
|
||||
line-height: 60px;
|
||||
}
|
||||
.logo {
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
text-align: center;
|
||||
color: white;
|
||||
font-size: 20px;
|
||||
font-weight: bold;
|
||||
}
|
||||
.el-dropdown-link {
|
||||
color: white;
|
||||
cursor: pointer;
|
||||
}
|
||||
.footer-content {
|
||||
font-size: 14px;
|
||||
}
|
||||
.header-title {
|
||||
font-size: 18px;
|
||||
font-weight: bold;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
@@ -122,10 +158,20 @@
|
||||
},
|
||||
loadData() {
|
||||
// 由子组件实现
|
||||
this.$emit('load-data', this.timeRange);
|
||||
console.log('父组件loadData被调用,时间范围:', this.timeRange);
|
||||
// 不使用事件发射,而是直接调用子组件方法
|
||||
if (window.pageComponent && typeof window.pageComponent.loadData === 'function') {
|
||||
window.pageComponent.loadData(this.timeRange);
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
console.log('基础Vue实例已挂载');
|
||||
}
|
||||
});
|
||||
|
||||
// 导出Vue实例供子组件使用
|
||||
window.baseApp = app;
|
||||
</script>
|
||||
{% block scripts %}{% endblock %}
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user