@flexem/fc-gui 3.0.0-alpha.72 → 3.0.0-alpha.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -105,6 +105,11 @@ export class AlarmElement extends ConditionalDisplayElement {
|
|
|
105
105
|
if (!result.error) {
|
|
106
106
|
this.totalCount = result.totalCount;
|
|
107
107
|
this.currentAlarmList = result.items;
|
|
108
|
+
if (!result.items.length && result.totalCount) {
|
|
109
|
+
this.page = 0;
|
|
110
|
+
this.init();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
108
113
|
this.alarmList = this.currentAlarmList.map(item => [
|
|
109
114
|
item.name,
|
|
110
115
|
item.message,
|
|
@@ -143,41 +148,41 @@ export class AlarmElement extends ConditionalDisplayElement {
|
|
|
143
148
|
text-align: ${this.model.generalSetting.headerFont.textAlign};
|
|
144
149
|
${this.model.generalSetting.headerFont.isUnderline ? 'text-decoration: underline' : ''};
|
|
145
150
|
vertical-align: middle;`;
|
|
146
|
-
for (let
|
|
151
|
+
for (let row = 0; row < 4; row++) {
|
|
147
152
|
const th = document.createElement('th');
|
|
148
|
-
th.innerHTML = this.model.columLabels[
|
|
149
|
-
th.style.cssText = `width: ${this.model.widths[
|
|
153
|
+
th.innerHTML = this.model.columLabels[row];
|
|
154
|
+
th.style.cssText = `width: ${this.model.widths[row] / this.model.size.width * 100}%;
|
|
150
155
|
border-style: solid;
|
|
151
156
|
border-color: ${this.model.generalSetting.splitLine};
|
|
152
|
-
border-left-width: ${!
|
|
157
|
+
border-left-width: ${!row || this.model.generalSetting.isHiddenColumnSplitLine ? 0 : 1}px;`;
|
|
153
158
|
tr.appendChild(th);
|
|
154
159
|
}
|
|
155
160
|
table.appendChild(tr);
|
|
156
161
|
const levelColors = ['#3695FF', '#FFE900', '#FFA800', '#E84F4F'];
|
|
157
|
-
for (let
|
|
162
|
+
for (let row = 0; row < this.pageSize; row++) {
|
|
158
163
|
tr = document.createElement('tr');
|
|
159
|
-
tr.style.cssText = `height: ${this.model.heights[
|
|
164
|
+
tr.style.cssText = `height: ${this.model.heights[row + 1]}px;
|
|
160
165
|
background: ${this.model.generalSetting.tableFillColor};
|
|
161
166
|
font: ${this.model.generalSetting.fontStyle};
|
|
162
167
|
color: ${this.model.generalSetting.fontColor};
|
|
163
168
|
text-align: ${this.model.generalSetting.textAlign};
|
|
164
169
|
vertical-align: middle;`;
|
|
165
|
-
for (let
|
|
170
|
+
for (let col = 0; col < 4; col++) {
|
|
166
171
|
const td = document.createElement('td');
|
|
167
172
|
td.style.cssText = `border-style: solid;
|
|
168
173
|
border-color: ${this.model.generalSetting.splitLine};
|
|
169
174
|
border-top-width: ${this.model.generalSetting.isHiddenColumnSplitLine ? 0 : 1}px;
|
|
170
|
-
border-left-width: ${!
|
|
171
|
-
if (this.alarmList[
|
|
172
|
-
if (
|
|
173
|
-
td.innerHTML = this.alarmList[
|
|
175
|
+
border-left-width: ${!col || this.model.generalSetting.isHiddenColumnSplitLine ? 0 : 1}px;`;
|
|
176
|
+
if (this.alarmList[row]) {
|
|
177
|
+
if (col !== 2) {
|
|
178
|
+
td.innerHTML = this.alarmList[row][col];
|
|
174
179
|
td.style.cssText += `${this.model.generalSetting.isUnderline ? 'text-decoration: underline' : ''};`;
|
|
175
180
|
}
|
|
176
181
|
else {
|
|
177
182
|
const alarmLevel = document.createElement('div');
|
|
178
183
|
let alarmHeight = parseInt(this.model.generalSetting.fontSize) + 15;
|
|
179
|
-
if (alarmHeight > this.model.heights[
|
|
180
|
-
alarmHeight = this.model.heights[
|
|
184
|
+
if (alarmHeight > this.model.heights[row + 1])
|
|
185
|
+
alarmHeight = this.model.heights[row + 1];
|
|
181
186
|
let margin = '0 15px';
|
|
182
187
|
if (this.model.generalSetting.textAlign === 'left') {
|
|
183
188
|
margin = '0 30px 0 0';
|
|
@@ -187,19 +192,32 @@ export class AlarmElement extends ConditionalDisplayElement {
|
|
|
187
192
|
}
|
|
188
193
|
alarmLevel.style.cssText = `margin: ${margin};
|
|
189
194
|
border-radius: 5px;
|
|
190
|
-
background: ${levelColors[this.alarmList[
|
|
195
|
+
background: ${levelColors[this.alarmList[row][col]]};
|
|
191
196
|
color: #ffffff;
|
|
192
|
-
width: ${this.model.widths[
|
|
197
|
+
width: ${this.model.widths[col] - 30}px;
|
|
193
198
|
height: ${alarmHeight}px;
|
|
194
|
-
max-height: ${this.model.heights[
|
|
199
|
+
max-height: ${this.model.heights[row + 1]}px;
|
|
195
200
|
display: flex;
|
|
196
201
|
justify-content: center;
|
|
197
202
|
align-items: center;
|
|
198
203
|
${this.model.generalSetting.isUnderline ? 'text-decoration: underline' : ''};`;
|
|
199
|
-
alarmLevel.innerHTML = this.model.levelText[this.alarmList[
|
|
204
|
+
alarmLevel.innerHTML = this.model.levelText[this.alarmList[row][col]];
|
|
200
205
|
td.appendChild(alarmLevel);
|
|
201
206
|
}
|
|
202
207
|
}
|
|
208
|
+
else if (col === 2) {
|
|
209
|
+
const alarmLevel = document.createElement('div');
|
|
210
|
+
let margin = '0 15px';
|
|
211
|
+
if (this.model.generalSetting.textAlign === 'left') {
|
|
212
|
+
margin = '0 30px 0 0';
|
|
213
|
+
}
|
|
214
|
+
else if (this.model.generalSetting.textAlign === 'right') {
|
|
215
|
+
margin = '0 0 0 30px';
|
|
216
|
+
}
|
|
217
|
+
alarmLevel.style.cssText = `margin: ${margin};
|
|
218
|
+
width: ${this.model.widths[col] - 30}px;`;
|
|
219
|
+
td.appendChild(alarmLevel);
|
|
220
|
+
}
|
|
203
221
|
tr.appendChild(td);
|
|
204
222
|
}
|
|
205
223
|
table.appendChild(tr);
|