多语言

This commit is contained in:
czz
2025-07-30 16:48:48 +08:00
parent 92b6896176
commit 300e3b31f6
96 changed files with 3741 additions and 2710 deletions

View File

@@ -44,7 +44,7 @@ class DeviceListController extends GetControllerEx<DeviceListModel> {
String search = (model.keyword != null && model.keyword!.isNotEmpty)
? "?key=${model.keyword}&ncs=1"
: "?ncs=1";
ApiResponse apiResponse = ApiResponse(code: -1, msg: "设备.设备列表请求失败".tr);
ApiResponse apiResponse = ApiResponse(code: -1, msg: "设备列表请求失败".tr);
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.device_list;
@@ -55,7 +55,7 @@ class DeviceListController extends GetControllerEx<DeviceListModel> {
response.data is String ? jsonDecode(response.data) : response.data;
ApiResponse res =
ApiResponse.fromJson(responseData, (object) => object);
MyUtils.formatResponse(res, "设备.设备列表请求成功".tr, "设备.设备列表请求失败".tr);
MyUtils.formatResponse(res, "设备列表请求成功".tr, "设备列表请求失败".tr);
if (res.code == HttpStatusCodes.ok) {
// bindDeviceNum.value = res.total!;
model.deviceList = res.data;
@@ -64,7 +64,7 @@ class DeviceListController extends GetControllerEx<DeviceListModel> {
return res;
}
} else {
return ApiResponse(code: -1, msg: "服务器.失败".tr);
return ApiResponse(code: -1, msg: "失败".tr);
}
return apiResponse;
} catch (e) {
@@ -77,7 +77,7 @@ class DeviceListController extends GetControllerEx<DeviceListModel> {
//体征传感器
getVitalList(String mac) async {
try {
ApiResponse apiResponse = ApiResponse(code: -1, msg: "设备.设备列表请求失败".tr);
ApiResponse apiResponse = ApiResponse(code: -1, msg: "设备列表请求失败".tr);
String serviceAddress = ServiceConstant.service_address;
String serviceName = ServiceConstant.server_service;
String serviceApi = ServiceConstant.device_list;
@@ -89,14 +89,14 @@ class DeviceListController extends GetControllerEx<DeviceListModel> {
response.data is String ? jsonDecode(response.data) : response.data;
ApiResponse res =
ApiResponse.fromJson(responseData, (object) => object);
MyUtils.formatResponse(res, "设备.设备列表请求成功".tr, "设备.设备列表请求失败".tr);
MyUtils.formatResponse(res, "设备列表请求成功".tr, "设备列表请求失败".tr);
if (res.code == HttpStatusCodes.ok) {
// bindDeviceNum.value = res.total!;
model.vitalList = res.data;
updateAll();
}
} else {
return ApiResponse(code: -1, msg: "服务器.失败".tr);
return ApiResponse(code: -1, msg: "失败".tr);
}
return apiResponse;
} catch (e) {