|
@@ -954,36 +954,89 @@ static void obtainListItemData_BedListView(ZKListView *pListView,ZKListView::ZKL
|
|
|
|
|
|
// 护理项相关
|
|
|
Json::Value nurseConfigList = frameBedList[index]["nurse_config_dtos"];
|
|
|
- for (int i = 0; i < 6; i++) {
|
|
|
- int nurseOptionNumber = ID_MAIN_NurseOption1 + i * 2;
|
|
|
- if (i == 5) {
|
|
|
- nurseOptionNumber = ID_MAIN_NurseOption6;
|
|
|
- }
|
|
|
- if (StoragePreferences::getInt(STORE_TEMPLATE, defaultTemplateInt) == 3) {
|
|
|
- pListItem->findSubItemByID(nurseOptionNumber)->setVisible(true);
|
|
|
- if (nurseConfigList.size() > 0 && nurseConfigList.size() >= i && nurseConfigList[i]["nurse_option_name"].asString() != "") {
|
|
|
+
|
|
|
+
|
|
|
+ if (StoragePreferences::getInt(STORE_TEMPLATE, defaultTemplateInt) == 3) {
|
|
|
+ int count = 0;
|
|
|
+ for (const Json::Value& nurseConfig : nurseConfigList) {
|
|
|
+ int nurseOptionNumber = ID_MAIN_NurseOption1 + count * 2;
|
|
|
+ if (count == 5) {
|
|
|
+ nurseOptionNumber = ID_MAIN_NurseOption6;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (nurseConfig["nurse_option_name"].asString() != "" && count < 6) {
|
|
|
//颜色
|
|
|
- string nurseConfigColot = nurseConfigList[i]["nurse_color_rbg"].asString();
|
|
|
+ string nurseConfigColot = nurseConfig["nurse_color_rbg"].asString();
|
|
|
uint32_t bgColor = 0xFFF5F8FF;
|
|
|
if (nurseConfigColot != "") {
|
|
|
string rgbStr = "FF" + nurseConfigColot;
|
|
|
transform(rgbStr.begin(), rgbStr.end(), rgbStr.begin(), ::toupper);
|
|
|
bgColor = strtoul(("0x" + rgbStr).c_str(), NULL,16);
|
|
|
}
|
|
|
- string nurseOptionName = nurseConfigList[i]["nurse_option_name"].asString();
|
|
|
+ string nurseOptionName = nurseConfig["nurse_option_name"].asString();
|
|
|
pListItem->findSubItemByID(nurseOptionNumber)->setBackgroundColor(bgColor);
|
|
|
pListItem->findSubItemByID(nurseOptionNumber)->setText(nurseOptionName);
|
|
|
+
|
|
|
+ count++;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (count >= 6) {
|
|
|
+ break;
|
|
|
}
|
|
|
- else {
|
|
|
+ }
|
|
|
+
|
|
|
+ if (count < 5) {
|
|
|
+ for (int i = count; i < 6; i++) {
|
|
|
+ int nurseOptionNumber = ID_MAIN_NurseOption1 + i * 2;
|
|
|
+ if (i == 5) {
|
|
|
+ nurseOptionNumber = ID_MAIN_NurseOption6;
|
|
|
+ }
|
|
|
pListItem->findSubItemByID(nurseOptionNumber)->setBackgroundColor(0xFFF5F8FF);
|
|
|
pListItem->findSubItemByID(nurseOptionNumber)->setText(LANGUAGEMANAGER->getValue("None"));
|
|
|
}
|
|
|
}
|
|
|
- else {
|
|
|
+
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ for (int i = 0; i < 6; i++) {
|
|
|
+ int nurseOptionNumber = ID_MAIN_NurseOption1 + i * 2;
|
|
|
+ if (i == 5) {
|
|
|
+ nurseOptionNumber = ID_MAIN_NurseOption6;
|
|
|
+ }
|
|
|
pListItem->findSubItemByID(nurseOptionNumber)->setVisible(false);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+// for (int i = 0; i < 6; i++) {
|
|
|
+// int nurseOptionNumber = ID_MAIN_NurseOption1 + i * 2;
|
|
|
+// if (i == 5) {
|
|
|
+// nurseOptionNumber = ID_MAIN_NurseOption6;
|
|
|
+// }
|
|
|
+// if (StoragePreferences::getInt(STORE_TEMPLATE, defaultTemplateInt) == 3) {
|
|
|
+// pListItem->findSubItemByID(nurseOptionNumber)->setVisible(true);
|
|
|
+// if (nurseConfigList.size() > 0 && nurseConfigList.size() >= i && nurseConfigList[i]["nurse_option_name"].asString() != "") {
|
|
|
+// //颜色
|
|
|
+// string nurseConfigColot = nurseConfigList[i]["nurse_color_rbg"].asString();
|
|
|
+// uint32_t bgColor = 0xFFF5F8FF;
|
|
|
+// if (nurseConfigColot != "") {
|
|
|
+// string rgbStr = "FF" + nurseConfigColot;
|
|
|
+// transform(rgbStr.begin(), rgbStr.end(), rgbStr.begin(), ::toupper);
|
|
|
+// bgColor = strtoul(("0x" + rgbStr).c_str(), NULL,16);
|
|
|
+// }
|
|
|
+// string nurseOptionName = nurseConfigList[i]["nurse_option_name"].asString();
|
|
|
+// pListItem->findSubItemByID(nurseOptionNumber)->setBackgroundColor(bgColor);
|
|
|
+// pListItem->findSubItemByID(nurseOptionNumber)->setText(nurseOptionName);
|
|
|
+// }
|
|
|
+// else {
|
|
|
+// pListItem->findSubItemByID(nurseOptionNumber)->setBackgroundColor(0xFFF5F8FF);
|
|
|
+// pListItem->findSubItemByID(nurseOptionNumber)->setText(LANGUAGEMANAGER->getValue("None"));
|
|
|
+// }
|
|
|
+// }
|
|
|
+// else {
|
|
|
+// pListItem->findSubItemByID(nurseOptionNumber)->setVisible(false);
|
|
|
+// }
|
|
|
+// }
|
|
|
+
|
|
|
|
|
|
// Json::Value nurseConfigList = frameBedList[index]["nurse_config_dtos"];
|
|
|
// if (nurseConfigList.size() > 0) {
|