设备 预约接口
This commit is contained in:
@@ -36,33 +36,6 @@ class DeviceListController extends GetControllerEx<DeviceListModel> {
|
||||
attr = GetModel(DeviceListModel()).obs;
|
||||
}
|
||||
|
||||
// @override
|
||||
// void onInit() {
|
||||
// super.onInit();
|
||||
// model.keyword = "";
|
||||
// getDeviceList(); // 正确的初始化数据调用
|
||||
// }
|
||||
|
||||
// getDeviceList({int time = 1}) async {
|
||||
// String search = (model.keyword != null && model.keyword!.isNotEmpty)
|
||||
// ? "?key=${model.keyword}"
|
||||
// : "";
|
||||
// var data = await ApiService.request.get("/api/device/info/list$search");
|
||||
// if (data.data["data"] != null) {
|
||||
// try {
|
||||
// List<dynamic> tmp = data.data["data"] as List<dynamic>;
|
||||
// model.deviceList = tmp.map((obj) => DeviceModel.fromJson(obj)).toList();
|
||||
// model.deviceListWyf = tmp;
|
||||
// } catch (e) {
|
||||
// print(e);
|
||||
// }
|
||||
// } else {
|
||||
// model.deviceList = [];
|
||||
// model.deviceListWyf = [];
|
||||
// }
|
||||
// updateAll();
|
||||
// }
|
||||
|
||||
getDeviceList() async {
|
||||
try {
|
||||
String search = (model.keyword != null && model.keyword!.isNotEmpty)
|
||||
@@ -82,8 +55,8 @@ class DeviceListController extends GetControllerEx<DeviceListModel> {
|
||||
MyUtils.formatResponse(res, "设备.设备列表请求成功".tr, "设备.设备列表请求失败".tr);
|
||||
if (res.code == HttpStatusCodes.ok) {
|
||||
// bindDeviceNum.value = res.total!;
|
||||
model.deviceList =res.data;
|
||||
|
||||
model.deviceList = res.data;
|
||||
|
||||
updateAll();
|
||||
return res;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user