85 lines
2.9 KiB
Python
85 lines
2.9 KiB
Python
|
# coding: gb2312
|
|||
|
from PyQt5.QtWidgets import *
|
|||
|
|
|||
|
from LSZXPagesManagerLibrary.echarts_overview import EchartsOverview
|
|||
|
from LSZXPagesManagerLibrary.echarts_page_layout_define import EchartsPageLayoutDefine
|
|||
|
|
|||
|
|
|||
|
class EchartsPage(EchartsPageLayoutDefine):
|
|||
|
|
|||
|
def __init__(self):
|
|||
|
super(EchartsPage, self).__init__()
|
|||
|
|
|||
|
# <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD><EFBFBD>
|
|||
|
self.page1 = EchartsOverview()
|
|||
|
self.page2 = QWidget()
|
|||
|
self.page3 = QWidget()
|
|||
|
|
|||
|
layout2 = QVBoxLayout()
|
|||
|
label2 = QLabel("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD> 2")
|
|||
|
layout2.addWidget(label2)
|
|||
|
self.page2.setLayout(layout2)
|
|||
|
|
|||
|
layout3 = QVBoxLayout()
|
|||
|
label3 = QLabel("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ҳ<EFBFBD><EFBFBD> 3")
|
|||
|
layout3.addWidget(label3)
|
|||
|
self.page3.setLayout(layout3)
|
|||
|
|
|||
|
self.stacked_widget.addWidget(self.page1)
|
|||
|
self.stacked_widget.addWidget(self.page2)
|
|||
|
self.stacked_widget.addWidget(self.page3)
|
|||
|
|
|||
|
self.overview_button.clicked.connect(lambda: self.button_clicked(self.overview_button))
|
|||
|
self.team_button.clicked.connect(lambda: self.button_clicked(self.team_button))
|
|||
|
self.person_button.clicked.connect(lambda: self.button_clicked(self.person_button))
|
|||
|
|
|||
|
# <20><>ʼ<EFBFBD><CABC>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ٵ<EFBFBD>ǰѡ<C7B0>еİ<D0B5>ť
|
|||
|
self.selected_button = self.overview_button
|
|||
|
|
|||
|
def overview_button_action(self):
|
|||
|
self.stacked_widget.setCurrentWidget(self.page1)
|
|||
|
|
|||
|
def team_button_action(self):
|
|||
|
self.stacked_widget.setCurrentWidget(self.page2)
|
|||
|
|
|||
|
def person_button_action(self):
|
|||
|
self.stacked_widget.setCurrentWidget(self.page3)
|
|||
|
|
|||
|
def button_clicked(self, button):
|
|||
|
# <20>ָ<EFBFBD>֮ǰѡ<C7B0>а<EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD>ʽ
|
|||
|
if self.selected_button:
|
|||
|
self.selected_button.setStyleSheet(
|
|||
|
"font: 600 24px \"Microsoft YaHei UI\";"
|
|||
|
"color: #222222;"
|
|||
|
"letter-spacing: 6px;"
|
|||
|
"border-radius: 4px;"
|
|||
|
"border: none;"
|
|||
|
"height: 160%;"
|
|||
|
"border-top-left-radius: 6px;"
|
|||
|
"border-top-right-radius: 0px;"
|
|||
|
"border-bottom-left-radius: 6px;"
|
|||
|
"border-bottom-right-radius: 0px;"
|
|||
|
)
|
|||
|
|
|||
|
# <20><><EFBFBD>õ<EFBFBD>ǰѡ<C7B0>а<EFBFBD>ť<EFBFBD><C5A5><EFBFBD><EFBFBD>ʽΪ<CABD><CEAA><EFBFBD><EFBFBD>ɫ<EFBFBD><C9AB>ɫ
|
|||
|
button.setStyleSheet(
|
|||
|
"font: 600 24px \"Microsoft YaHei UI\";"
|
|||
|
"color: #ffffff;"
|
|||
|
"letter-spacing: 6px;"
|
|||
|
"border-radius: 4px;"
|
|||
|
"border: none;"
|
|||
|
"height: 160%;"
|
|||
|
"border-top-left-radius: 6px;"
|
|||
|
"border-top-right-radius: 0px;"
|
|||
|
"border-bottom-left-radius: 6px;"
|
|||
|
"border-bottom-right-radius: 0px;"
|
|||
|
"background-color: #409eff;"
|
|||
|
)
|
|||
|
self.selected_button = button
|
|||
|
if button == self.overview_button:
|
|||
|
self.overview_button_action()
|
|||
|
elif button == self.team_button:
|
|||
|
self.team_button_action()
|
|||
|
elif button == self.person_button:
|
|||
|
self.person_button_action()
|