-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWorkGround.qml
186 lines (159 loc) · 3.84 KB
/
WorkGround.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
import QtQuick 2.0
import QtQuick.Dialogs 1.2
import "operating"
import "userManage"
import "logManger"
import "listener.js" as Logic
Rectangle {
id: root
width: 1200
height: 800
color:"#bbc5cc"
property var target
property bool running: false
signal logout()
function setTarget(tgt)
{
target = tgt
}
function start()
{
running = true;
var handlers = {
onTimeout: function (req){
console.log("continuousQuery timeout");
},
onRequestSuccess: onNotify,
onRequestError: function (req){
console.log("ContinuousQuery Error");
},
isWorkRunning: isWorkRunning
};
Logic.startListen(target, handlers);
}
function stop()
{
running = false;
}
function onNotify(resp)
{
var detail = null;
//console.log("resp:", Logic.serialize(resp, 5));
if (resp && resp.result && resp.result.detail)
{
detail = resp.result.detail;
}
var objectNodes = [];
if (!detail)
{
return;
}
if (detail.o)
{
Logic.parseAttendeeJsonObject(detail.o, objectNodes)
for (var i = 0; i < objectNodes.length; i++)
{
operate.onNotify(objectNodes[i]);
}
//console.log("resp:", Logic.serialize(detail.o, 6));
}
var objectVioceNodes = [];
if (detail.r)
{
Logic.parseVoiceJsonObject(detail.r, objectVioceNodes)
for (var i = 0; i < objectVioceNodes.length; i++)
{
operate.onNotify(objectVioceNodes[i]);
}
}
var objectSystemNodes=[]
if(detail.n)
{
Logic.parseSystemNoticeJsonObject(detail.n,objectSystemNodes)
for (var i=0;i<objectSystemNodes.length;i++)
{
if(objectSystemNodes[i].module==="system")
{
if(objectSystemNodes[i].text)
{
warningDialog.text=objectSystemNodes[i].text;
warningDialog.open();
warningtime.running=true
}
else
{
}
}
else
{
}
}
}
}
function isWorkRunning()
{
return running;
}
function load()
{
operate.load();
}
function showUserManagePage()
{
operate.visible = false;
manage.visible = true;
manage.load();
}
function showOperateView()
{
manage.visible = false;
operate.visible = true;
operate.load();
}
function showlogMangerPage()
{
logmanger.quaryTodayLog("0")
operate.visible = false;
logmanger.visible=true
}
MessageDialog{
id:warningDialog
modality: Qt.ApplicationModal
title: "提示信息"
// standardButtons: StandardButton.Ok
// onAccepted: {
// warningDialog.close();
// }
}
BorderImage {
id: topImages
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
source: "../images/top.png"
}
OperateView {
id: operate
anchors.fill: parent
}
UserManagePage {
id: manage
anchors.fill: parent
}
LogQueryPage{
id:logmanger
anchors.fill: parent
}
Timer{
id:warningtime
interval: 2500
running: false
repeat: true
onTriggered:{
warningDialog.close()
}
}
Component.onCompleted: {
manage.visible = false;
}
}