Commit 73c1812e authored by 小费同学阿's avatar 小费同学阿 💬 Committed by 杨秀秀

诉求分配 部门选择 修复

parent 4fea9f06
......@@ -45,8 +45,9 @@ class AppealDeptListAdapter(context: Context?,val selectedTypes: MutableList<Tex
/*选择时的item 移除和添加*/
override fun itemClickCalBack(position: Int, data: TextListProvider?) {
if (data != null) {
if (selectedTypes.contains(data)) {
selectedTypes.remove(data)
val indexOf = selectedTypes.map { item -> item.ProviderId() }.indexOf(data.ProviderId())
if (indexOf != -1) {
selectedTypes.removeAt(indexOf)
} else {
selectedTypes.add(data)
}
......
......@@ -44,6 +44,7 @@ public class AppealAllocationViewModel extends BaseViewModel<AppealRequest> {
public ObservableField<Integer> imgsVisibility = new ObservableField<>(View.VISIBLE);
private List<TextListProvider> selectDept;
/*部门控件*/
public LiveData<Integer> getDeptVisibility() {
......@@ -79,8 +80,6 @@ public class AppealAllocationViewModel extends BaseViewModel<AppealRequest> {
public ObservableField<String> finalRejectionn = new ObservableField<>("");
/*上传图片*/
public AddImgAdapter appealPicsAdapter;
public List<TextListProvider> selectDept = new ArrayList<>();
//分配信息绑定
public ObservableField<String> allocation = new ObservableField<>("");
......@@ -148,7 +147,7 @@ public class AppealAllocationViewModel extends BaseViewModel<AppealRequest> {
}
String displayLabel = displayLabelList.toString();
if (displayLabel.endsWith("、")) {
displayLabel = displayLabel.substring(0, displayLabel.length() - 2);
displayLabel = displayLabel.substring(0, displayLabel.length() - 1);
}
/*label展示*/
label.set(displayLabel);
......@@ -159,20 +158,7 @@ public class AppealAllocationViewModel extends BaseViewModel<AppealRequest> {
idList.add(new DeptIdBean(Integer.parseInt(resultBean.getAllocations().get(i).getDeptId())));
}
selectDept = resultBean.getAllocations().stream()
.map(item -> new TextListProvider() {
@androidx.annotation.NonNull
@Override
public String providerText() {
return item.getDeptName();
}
@androidx.annotation.NonNull
@Override
public String ProviderId() {
return item.getDeptId();
}
})
.collect(Collectors.toList());
.map(item -> new DeptBean(new ArrayList<>(), Integer.parseInt(item.getDeptId()), false, item.getDeptName())).collect(Collectors.toList());
}
@Override
......
......@@ -167,19 +167,7 @@ public class AppealEditViewModel extends BaseViewModel<AppealRequest> {
idList.add(new DeptIdBean(Integer.parseInt(resultBean.getAllocations().get(i).getDeptId())));
}
selectDept = resultBean.getAllocations().stream()
.map(item -> new TextListProvider() {
@androidx.annotation.NonNull
@Override
public String providerText() {
return item.getDeptName();
}
@androidx.annotation.NonNull
@Override
public String ProviderId() {
return item.getDeptId();
}
})
.map(item -> new DeptBean(new ArrayList<>(), Integer.parseInt(item.getDeptId()), false, item.getDeptName()))
.collect(Collectors.toList());
}
......
......@@ -82,8 +82,7 @@ public class AppealViewModel extends BaseViewModel<AppealRequest> {
public ObservableField<String> appealDescribe = new ObservableField<>("");
/*上传图片*/
public AddImgAdapter appealPicsAdapter;
public List<TextListProvider> selectDept=new ArrayList<>();
private List<TextListProvider> selectDept = new ArrayList<>();
public AppealViewModel(@NonNull Application application) {
super(application);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment