|
@@ -8,6 +8,9 @@
|
|
|
#include "../global.h"
|
|
|
#include "ui_blastprojectpage.h"
|
|
|
|
|
|
+#define BLATSTER_ROLE_ID 4
|
|
|
+#define OPERATOR_ROLE_ID 7
|
|
|
+
|
|
|
BlastProjectPage::BlastProjectPage(QWidget *parent)
|
|
|
: QWidget(parent), ui(new Ui::BlastProjectPage), dao(DatabaseManager::getInstance().getDatabase()) {
|
|
|
ui->setupUi(this);
|
|
@@ -145,10 +148,11 @@ void BlastProjectPage::personOptionsByType(const QJsonArray &dataArray) {
|
|
|
QJsonObject obj = value.toObject();
|
|
|
if (obj.contains("roleIds")) {
|
|
|
QJsonArray roleIdsArray = obj["roleIds"].toArray();
|
|
|
- // TODO: 角色ID改成常量
|
|
|
- if (roleIdsArray.contains(4)) { // 爆破员
|
|
|
+ // Note: 一个用户可能存在多个角色
|
|
|
+ if (roleIdsArray.contains(BLATSTER_ROLE_ID)) { // 爆破员
|
|
|
blasterDeployerArray.append(obj);
|
|
|
- } else if (roleIdsArray.contains(7)) { // 操作员
|
|
|
+ }
|
|
|
+ if (roleIdsArray.contains(OPERATOR_ROLE_ID)) { // 操作员
|
|
|
operatorArray.append(obj);
|
|
|
}
|
|
|
}
|