123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227 |
- import QtQuick 2.15
- import QtQuick.Window 2.15
- import QtQuick.Layouts 1.3
- import QtQuick.Controls 2.14
- import QtQuick.Dialogs 1.3
- import QtQuick.Controls.Styles 1.4
- import QtQuick.VirtualKeyboard 2.15
- import TService 1.0
- import BackendLogic 1.0
- Window {
- id:main_window
- width: 1280
- height: 760
- visible: true
- title: qsTr("油气回收测试装备")
- flags:Qt.FramelessWindowHint
- Image {
- id: bg_img
- anchors.horizontalCenter: parent.horizontalCenter
- fillMode: Image.PreserveAspectFit
- //source: "img/main_zjtj_bj.jpg"
- //source: "img/main_jl_bj.jpg"
- }
- BackendLogic {
- id: backend
- }
- Rectangle{
- id: logo
- x: 20
- y: 20
- width:300
- height:100
- color:"transparent"
- Image {
- id:logo_img
- anchors.fill:parent
- fillMode: Image.PreserveAspectFit
- //source:"img/zjtj_logo.png"
- //source:"img/jl_logo.png"
- }
- }
- UserButton {
- text: "登 录"
- font.bold: true
- font.pixelSize: 24
- width:180
- height:60
- anchors.centerIn: parent
- /*
- background: Image {
- anchors.fill:parent
- fillMode: Image.PreserveAspectFit
- source:"img/blue_button.png"
- }
- */
- //icon.source: "img/blue_button.png"
- //icon.color: "transparent"
- onClicked: myLoder.sourceComponent = mainpage // 切换显示主页面
- }
- Button {
- //text: "点击进入"
- width:80
- height:80
- anchors.right: parent.right
- anchors.rightMargin: 40;
- anchors.bottom: parent.bottom
- anchors.bottomMargin: 40;
- //color:"transparent"
- background:Image {
- anchors.fill:parent
- fillMode: Image.PreserveAspectFit
- source:"img/shutdown_red.png"
- }
- onClicked: {
- backend.shutdown()
- }
- }
- Rectangle{
- id: info
- x: 30
- y: 650
- width:500
- height:400
- color:"transparent"
- Column{
- spacing: 2
- Text {
- id: ver_text
- text: qsTr("软件版本: V2.1.2")
- font.bold: true
- }
- Text {
- id: model_text
- text: qsTr("")
- font.bold: true
- }
- Text {
- id: devid_text
- text: qsTr("")
- font.bold: true
- }
- Text {
- id: manufacture_text
- text: qsTr("")
- font.bold: true
- }
- }
- }
- Item {
- id: cornerItem
- x: 0
- y: 0
- }
- property int activeFocusItemBottom : activeFocusItem == null ? 0 : Math.min(height, cornerItem.mapFromItem(activeFocusItem, 0, activeFocusItem.height).y + 50)
- Loader{
- id:myLoder
- anchors.centerIn: parent
- }
- Component.onCompleted:{
- var jsonobj = backend.getDeviceInfo()
- model_text.text = "设备型号:"+jsonobj.model
- devid_text.text = "设备ID:"+jsonobj.id
- //manufacture_text.text = "制造商:"+jsonobj.manufacture
- if("JL-VRST-2000" === jsonobj.model){
- bg_img.source = "img/main_jl_bj.jpg"
- logo_img.source = "img/jl_logo.png"
- manufacture_text.text = "制造商:"+jsonobj.manufacture
- }else if("JL-VRST-2001" === jsonobj.model){
- bg_img.source = "img/main_zjtj_bj.jpg"
- logo_img.source = "img/zjtj_logo.png"
- }
- }
- Component{
- id:firstpage
- PageFirst{
- width:300
- height: 200
- anchors.centerIn: parent
- }
- }
- Component{
- id:mainpage
- PageMain{
- width: 1280
- height: 760
- anchors.centerIn: parent
- }
- }
- InputPanel {
- id: inputPanel
- z: 99
- x: 0
- y: main_window.height
- width: main_window.width
- states: State {
- name: "visible"
- when: inputPanel.active
- PropertyChanges {
- target: inputPanel
- y: main_window.height - inputPanel.height
- }
- }
- transitions: Transition {
- from: ""
- to: "visible"
- reversible: true
- ParallelAnimation {
- NumberAnimation {
- properties: "y"
- duration: 250
- easing.type: Easing.InOutQuad
- }
- }
- }
- }
- }
|