沧州页面修改
This commit is contained in:
parent
5f72808271
commit
aabea6b51c
@ -10,8 +10,8 @@
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 7,
|
||||
"versionName": "1.0.7",
|
||||
"versionCode": 8,
|
||||
"versionName": "1.0.8",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
]
|
||||
|
@ -312,6 +312,7 @@ public class PathConfig {
|
||||
public static final String PATH_MODULE_OA_FRAGMENT_OA_FLOW_APPLY_LIST = "/oamodule/fragment/applyFlow";//发起流程列表
|
||||
public static final String PATH_MODULE_OA_FRAGMENT_OA_FLOW_APPLY = "/oamodule/fragment/oaFlowCenter";//发起流程
|
||||
public static final String PATH_MODULE_OA_FRAGMENT_OA_FLOW_MINE_TODO = "/oamodule/fragment/mineUpcoming";//我的待办、已办
|
||||
public static final String PATH_MODULE_OA_FRAGMENT_OA_FLOW_PUBLISH_RECEIVE_FILE = "/oamodule/fragment/publishReceiveFile";//收文发文
|
||||
public static final String PATH_MODULE_OA_FRAGMENT_OA_FLOW_MINE_READ = "/oamodule/fragment/mineRead";//我的待阅、已阅
|
||||
public static final String NOTICE_CONFIG_ID = "bce4ab73-45dc-41a1-ac9d-305e83300e49";//通知公告
|
||||
public static final String NOTICE_CONFIG_NEWS_MAIN_ID = "890b8792-86ea-453d-9c61-09399e4c3079";//平板首页新闻ID
|
||||
|
@ -45,7 +45,7 @@ public class NetworkChangeReceiver extends BroadcastReceiver {
|
||||
|
||||
private void notifyObservers(NetworkUtils.NetworkType networkType) {
|
||||
if (networkType == NetworkUtils.NetworkType.NETWORK_NO) {
|
||||
ToastUtils.show("网络断开,请检查网络");
|
||||
// ToastUtils.show("网络断开,请检查网络");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -7,9 +7,10 @@ package com.tenlionsoft.baselib.core.retrofit_net;
|
||||
*/
|
||||
public class BaseUrlApi {
|
||||
|
||||
// public static final String IP = "http://192.168.0.120:8082/";/* 测试IP */
|
||||
// public static final String IP = "http://192.168.0.120:8082/";/* 测试IP */
|
||||
// public static final String IP = "http://121.36.71.250/";/* 测试IP */
|
||||
public static final String IP = "http://106.12.218.237:8002/";/* 公司IP */
|
||||
// public static final String IP = "http://106.12.218.237:8002/";/* 公司IP */
|
||||
public static final String IP = "http://106.12.218.237:8003/";/* 公司IP */
|
||||
// public static final String IP = "https://www.xzszwhy.cn/";/* 公司IP */
|
||||
// public static final String IP = "http://www.wlcbsyzl.cn/";/* 正式IP */
|
||||
// public static final String SYS_USERCENTER = "xzszwhy/";//西藏统一用户
|
||||
|
@ -59,8 +59,8 @@ ext {
|
||||
gCompileSdkVersion = 30
|
||||
gMinSdkVersion = 19
|
||||
gTargetSdkVersion = 30
|
||||
gVersionCode = 7
|
||||
gVersionName = '1.0.7'
|
||||
gVersionCode = 8
|
||||
gVersionName = '1.0.8'
|
||||
gBuildToolsVersion = "29.0.2"
|
||||
// gVersionCode=26
|
||||
// gVersionName='1.3.0'
|
||||
|
@ -0,0 +1,40 @@
|
||||
package com.tenlionsoft.oamodule.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseRecyclerAdapter;
|
||||
import com.tenlionsoft.baselib.utils.TimeUtils;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.beans.MineTodoBean;
|
||||
import com.tenlionsoft.oamodule.holder.MinePublishFileHolder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2022/5/17 - 10:04
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class MinePublishFileAdapter extends BaseRecyclerAdapter<MineTodoBean.RowsBean, MinePublishFileHolder> {
|
||||
|
||||
public MinePublishFileAdapter(Context ctx, List<MineTodoBean.RowsBean> list) {
|
||||
super(ctx, list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MinePublishFileHolder createHolder(ViewGroup parent, int viewType) {
|
||||
View itemView = LayoutInflater.from(mContext).inflate(R.layout.item_publish_file, parent, false);
|
||||
return new MinePublishFileHolder(itemView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindHolder(MinePublishFileHolder h, int i) {
|
||||
MineTodoBean.RowsBean b = mData.get(i);
|
||||
h.mTvTitle.setText(b.getMainTitle());
|
||||
h.mTvTime.setText(TimeUtils.timeTranDate(b.getProcessStartTime()));
|
||||
}
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.tenlionsoft.oamodule.holder;
|
||||
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseViewHolder;
|
||||
import com.tenlionsoft.oamodule.R2;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import butterknife.BindView;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2022/5/17 - 10:00
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述:
|
||||
*/
|
||||
public class MinePublishFileHolder extends BaseViewHolder {
|
||||
@BindView(R2.id.tv_title)
|
||||
public TextView mTvTitle;
|
||||
@BindView(R2.id.tv_time)
|
||||
public TextView mTvTime;
|
||||
|
||||
public MinePublishFileHolder(@NonNull @NotNull View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
}
|
@ -979,6 +979,20 @@ public interface OAApi {
|
||||
@GET("app/oa/listpage-procdef")
|
||||
Observable<OaFlowApplyBean> getOaFLowList(@Query("keywords") String key, @Query("page") String page);
|
||||
|
||||
/**
|
||||
* 获取发文待办
|
||||
*/
|
||||
@Headers({"base_url_name:oa", "need_token:true", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("app/oataskbase/listpage/task/publish")
|
||||
Observable<MineTodoBean> getOaPublishFileList(@Query("keywords") String key, @Query("page") String page, @Query("rows") String rows);
|
||||
|
||||
/**
|
||||
* 获取收文待办
|
||||
*/
|
||||
@Headers({"base_url_name:oa", "need_token:true", "Content-Type: application/json", "Accept: application/json"})
|
||||
@GET("app/oataskbase/listpage/task/receive")
|
||||
Observable<MineTodoBean> getOaReceiveFileList(@Query("keywords") String key, @Query("page") String page, @Query("rows") String rows);
|
||||
|
||||
/**
|
||||
* 我的待阅
|
||||
*/
|
||||
|
@ -26,15 +26,12 @@ import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
|
||||
import com.bigkoo.pickerview.view.OptionsPickerView;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
|
||||
import com.tenlionsoft.baselib.constant.LionActions;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.beans.OperateBean;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseFragment;
|
||||
import com.tenlionsoft.baselib.core.widget.base.FragmentUtils;
|
||||
import com.tenlionsoft.baselib.core.widget.views.CustomStateView;
|
||||
import com.tenlionsoft.baselib.core.widget.views.TextViewDrawable;
|
||||
import com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||
@ -148,14 +145,17 @@ public class PadDocFragment extends BaseFragment {
|
||||
mSelCatalog.add(mRootPersonBean);
|
||||
mSelCatalogId = "0";
|
||||
mRlvSel.setVisibility(View.VISIBLE);
|
||||
mIvAdd.setVisibility(View.VISIBLE);
|
||||
} else if (checkedId == R.id.rb_share) {
|
||||
mType = "共享文档";//共享
|
||||
mRlvSel.setVisibility(View.GONE);
|
||||
mIvAdd.setVisibility(View.GONE);
|
||||
} else if (checkedId == R.id.rb_pub) {
|
||||
mType = "公共文档";//公共
|
||||
mSelCatalog.add(mRootPublicbean);
|
||||
mSelCatalogId = "0";
|
||||
mRlvSel.setVisibility(View.VISIBLE);
|
||||
mIvAdd.setVisibility(View.GONE);
|
||||
}
|
||||
mSelCatalogAdapter.setData(mSelCatalog);
|
||||
doRefresh();
|
||||
@ -252,6 +252,7 @@ public class PadDocFragment extends BaseFragment {
|
||||
// }
|
||||
//
|
||||
// /
|
||||
|
||||
/**
|
||||
* 刷新
|
||||
*/
|
||||
|
@ -24,8 +24,10 @@ import com.tenlionsoft.baselib.utils.LogUtils;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.R2;
|
||||
import com.tenlionsoft.oamodule.adapter.EmailAdapter;
|
||||
import com.tenlionsoft.oamodule.adapter.MinePublishFileAdapter;
|
||||
import com.tenlionsoft.oamodule.adapter.NoticeShowAdapter;
|
||||
import com.tenlionsoft.oamodule.beans.EmailInboxListBean;
|
||||
import com.tenlionsoft.oamodule.beans.MineTodoBean;
|
||||
import com.tenlionsoft.oamodule.beans.NoticeListBean;
|
||||
import com.tenlionsoft.oamodule.net.OAApi;
|
||||
import com.tenlionsoft.oamodule.pad.activitys.home.PadMainActivity;
|
||||
@ -34,10 +36,13 @@ import com.tenlionsoft.oamodule.pad.fragments.email.InDetailFragment;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
@ -87,6 +92,12 @@ public class PadOaMainChangzouFragment extends BaseFragment {
|
||||
private EmailAdapter mEmailAdapter;
|
||||
private List<Object> mEmailRows;
|
||||
|
||||
private MinePublishFileAdapter mPublishFileAdapter;
|
||||
private List<MineTodoBean.RowsBean> mPublishFileDatas;
|
||||
|
||||
private MinePublishFileAdapter mReceiveFileAdapter;
|
||||
private List<MineTodoBean.RowsBean> mReceiveFileDatas;
|
||||
|
||||
@Override
|
||||
protected int getContentViewId() {
|
||||
return R.layout.fragment_pad_oa_main_changzou;
|
||||
@ -108,6 +119,44 @@ public class PadOaMainChangzouFragment extends BaseFragment {
|
||||
mSrlView.setEnableRefresh(false);
|
||||
mSrlContent.setEnableLoadMore(false);
|
||||
mSrlContent.setOnRefreshListener(refreshLayout -> doRefresh());
|
||||
//收文
|
||||
mReceiveFileDatas = new ArrayList<>();
|
||||
mReceiveFileAdapter = new MinePublishFileAdapter(mActivity, mReceiveFileDatas);
|
||||
mRlvRecive.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvRecive.setAdapter(mReceiveFileAdapter);
|
||||
mReceiveFileAdapter.addOnItemClickListener(b -> {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("title", b.getMainTitle());
|
||||
params.put("bean", b);
|
||||
BaseFragment fragment = FragmentUtils.getFragmentMap(PathConfig.PATH_MODULE_OA_FRAGMENT_OA_FLOW_APPLY, params);
|
||||
mPadMainActivity.addFragment(1, fragment);
|
||||
});
|
||||
mTvReciveMore.setOnClickListener(v -> {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("title", "收文流转");
|
||||
params.put("type", 2);
|
||||
BaseFragment fragment = FragmentUtils.getFragmentMap(PathConfig.PATH_MODULE_OA_FRAGMENT_OA_FLOW_PUBLISH_RECEIVE_FILE, params);
|
||||
mPadMainActivity.addFragment(1, fragment);
|
||||
});
|
||||
//发文
|
||||
mPublishFileDatas = new ArrayList<>();
|
||||
mPublishFileAdapter = new MinePublishFileAdapter(mActivity, mPublishFileDatas);
|
||||
mRlvWait.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvWait.setAdapter(mPublishFileAdapter);
|
||||
mPublishFileAdapter.addOnItemClickListener(b -> {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("title", b.getMainTitle());
|
||||
params.put("bean", b);
|
||||
BaseFragment fragment = FragmentUtils.getFragmentMap(PathConfig.PATH_MODULE_OA_FRAGMENT_OA_FLOW_APPLY, params);
|
||||
mPadMainActivity.addFragment(1, fragment);
|
||||
});
|
||||
mTvWaitMore.setOnClickListener(v -> {
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("title", "待办公文");
|
||||
params.put("type", 1);
|
||||
BaseFragment fragment = FragmentUtils.getFragmentMap(PathConfig.PATH_MODULE_OA_FRAGMENT_OA_FLOW_PUBLISH_RECEIVE_FILE, params);
|
||||
mPadMainActivity.addFragment(1, fragment);
|
||||
});
|
||||
//通知公告
|
||||
mNoticeListBeanRows = new ArrayList<>();
|
||||
mNoticeShowAdapter = new NoticeShowAdapter(mActivity, mNoticeListBeanRows);
|
||||
@ -119,7 +168,7 @@ public class PadOaMainChangzouFragment extends BaseFragment {
|
||||
mPadMainActivity.addFragment(1, fragment);
|
||||
});
|
||||
mTvNoticeMore.setOnClickListener(v -> {
|
||||
BaseFragment fragment = FragmentUtils.getFragment(PathConfig.PATH_MODULE_PAD_OA_FRAGMENT_NOTICE_LIST);
|
||||
BaseFragment fragment = FragmentUtils.getFragmentOne(PathConfig.PATH_MODULE_PAD_OA_FRAGMENT_NOTICE_LIST, "isShow", "1");
|
||||
mPadMainActivity.addFragment(1, fragment);
|
||||
});
|
||||
//邮件
|
||||
@ -149,6 +198,10 @@ public class PadOaMainChangzouFragment extends BaseFragment {
|
||||
}
|
||||
});
|
||||
});
|
||||
mTvEmailMore.setOnClickListener(v -> {
|
||||
BaseFragment fragment = FragmentUtils.getFragmentOne(PathConfig.PATH_MODULE_PAD_OA_FRAGMENT_EMAIL_IN_BOX, "key", "search");
|
||||
mPadMainActivity.addFragment(3, fragment);
|
||||
});
|
||||
mSrlContent.autoRefresh();
|
||||
}
|
||||
|
||||
@ -198,7 +251,9 @@ public class PadOaMainChangzouFragment extends BaseFragment {
|
||||
mEmailRows.clear();
|
||||
mEmailAdapter.setData(mEmailRows);
|
||||
getNoticeList();//通知公告
|
||||
getEmailList();
|
||||
getEmailList();//邮件
|
||||
getPublishFile();//发文待办
|
||||
getReceiveFile();//收文待办
|
||||
mSrlContent.finishRefresh();
|
||||
}
|
||||
|
||||
@ -279,6 +334,82 @@ public class PadOaMainChangzouFragment extends BaseFragment {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 发文待办
|
||||
*/
|
||||
private void getPublishFile() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getOaPublishFileList("", "1", "15")
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<MineTodoBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull MineTodoBean oaFlowApplyBean) {
|
||||
if (oaFlowApplyBean.getRows().size() > 0) {
|
||||
mPublishFileDatas = oaFlowApplyBean.getRows();
|
||||
mPublishFileAdapter.setData(mPublishFileDatas);
|
||||
mCsvWait.setState(CustomStateView.STATE_SUCCESS);
|
||||
} else {
|
||||
mCsvWait.setState(CustomStateView.STATE_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
mCsvWait.setState(CustomStateView.STATE_ERROR);
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 收文待办
|
||||
*/
|
||||
private void getReceiveFile() {
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getOaReceiveFileList("", "1", "15")
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<MineTodoBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull MineTodoBean oaFlowApplyBean) {
|
||||
if (oaFlowApplyBean.getRows().size() > 0) {
|
||||
mReceiveFileDatas = oaFlowApplyBean.getRows();
|
||||
mReceiveFileAdapter.setData(mReceiveFileDatas);
|
||||
mCsvRecive.setState(CustomStateView.STATE_SUCCESS);
|
||||
} else {
|
||||
mCsvRecive.setState(CustomStateView.STATE_EMPTY);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
mCsvRecive.setState(CustomStateView.STATE_ERROR);
|
||||
ExceptionHandler.handleException(e);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void refreshView() {
|
||||
|
@ -102,6 +102,12 @@ public class NoticeListFragment extends BaseFragment {
|
||||
setStateView(STATE_SUCCESS);
|
||||
mSrlView.setEnableRefresh(false);
|
||||
mSrlView.setEnableLoadMore(false);
|
||||
String isShow = getArguments().getString("isShow");
|
||||
if (!TextUtils.isEmpty(isShow)) {
|
||||
mIvFragmentBack.setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
mIvFragmentBack.setVisibility(View.GONE);
|
||||
}
|
||||
initViews();
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,312 @@
|
||||
package com.tenlionsoft.oamodule.pad.fragments.home.oaflow;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.hjq.toast.ToastUtils;
|
||||
import com.scwang.smart.refresh.layout.SmartRefreshLayout;
|
||||
import com.tenlionsoft.baselib.constant.PathConfig;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
||||
import com.tenlionsoft.baselib.core.widget.base.BaseFragment;
|
||||
import com.tenlionsoft.baselib.core.widget.base.FragmentUtils;
|
||||
import com.tenlionsoft.baselib.core.widget.views.CustomStateView;
|
||||
import com.tenlionsoft.baselib.core.widget.views.ItemSplitDivider;
|
||||
import com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView;
|
||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||
import com.tenlionsoft.oamodule.R;
|
||||
import com.tenlionsoft.oamodule.R2;
|
||||
import com.tenlionsoft.oamodule.adapter.MinePublishFileAdapter;
|
||||
import com.tenlionsoft.oamodule.beans.MineTodoBean;
|
||||
import com.tenlionsoft.oamodule.net.OAApi;
|
||||
import com.tenlionsoft.oamodule.pad.activitys.home.PadMainActivity;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import butterknife.BindView;
|
||||
import butterknife.ButterKnife;
|
||||
import io.reactivex.rxjava3.annotations.NonNull;
|
||||
import io.reactivex.rxjava3.core.Observer;
|
||||
import io.reactivex.rxjava3.disposables.Disposable;
|
||||
|
||||
/**
|
||||
* 作者: adam
|
||||
* 日期: 2022/6/20 - 15:11
|
||||
* 邮箱: itgaojian@163.com
|
||||
* 描述: 平板---收文发文
|
||||
*/
|
||||
@Route(path = PathConfig.PATH_MODULE_OA_FRAGMENT_OA_FLOW_PUBLISH_RECEIVE_FILE)
|
||||
public class OaPublishReceiveFileFragment extends BaseFragment {
|
||||
@BindView(R2.id.iv_back)
|
||||
ImageView mIvBack;
|
||||
@BindView(R2.id.tv_title)
|
||||
TypeFaceTextView mTvTitle;
|
||||
@BindView(R2.id.rlv_content)
|
||||
RecyclerView mRlvContent;
|
||||
@BindView(R2.id.srl_content)
|
||||
SmartRefreshLayout mSrlContent;
|
||||
@BindView(R2.id.csv_state)
|
||||
CustomStateView mCsvState;
|
||||
private List<MineTodoBean.RowsBean> mDatas;
|
||||
private int mType = 1;//收文待办 2发文待办
|
||||
private MinePublishFileAdapter mAdapter;
|
||||
private int mCurrentPage = 1;
|
||||
private String mKeywords = "";
|
||||
private PadMainActivity mMainActivity;
|
||||
|
||||
@Override
|
||||
protected int getContentViewId() {
|
||||
return R.layout.fragment_oa_flow_publish_receive;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setDataToView(View dataView) {
|
||||
ButterKnife.bind(this, dataView);
|
||||
setStateView(STATE_SUCCESS);
|
||||
mSrlView.setEnableRefresh(false);
|
||||
mSrlView.setEnableLoadMore(false);
|
||||
mType = getArguments().getInt("type", 1);
|
||||
String title = getArguments().getString("title");
|
||||
mTvTitle.setText(title);
|
||||
initViews();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 初始化页面
|
||||
*/
|
||||
private void initViews() {
|
||||
mIvBack.setOnClickListener(v -> mMainActivity.backFragment(1, this));
|
||||
mDatas = new ArrayList<>();
|
||||
mAdapter = new MinePublishFileAdapter(mActivity, mDatas);
|
||||
mRlvContent.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||
mRlvContent.addItemDecoration(new ItemSplitDivider(mActivity, LinearLayoutManager.VERTICAL, 1, Color.parseColor("#F9F9F9")));
|
||||
mRlvContent.setAdapter(mAdapter);
|
||||
|
||||
mSrlContent.setOnRefreshListener(v -> doRefresh());
|
||||
mSrlContent.setOnLoadMoreListener(v -> doLoadMore());
|
||||
mAdapter.addOnItemClickListener(o -> {
|
||||
//我的待办
|
||||
MineTodoBean.RowsBean b = o;
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
params.put("title", b.getMainTitle());
|
||||
params.put("bean", b);
|
||||
BaseFragment fragment = FragmentUtils.getFragmentMap(PathConfig.PATH_MODULE_OA_FRAGMENT_OA_FLOW_APPLY, params);
|
||||
mMainActivity.addFragment(1, fragment);
|
||||
});
|
||||
doRefresh();
|
||||
}
|
||||
|
||||
|
||||
private void resetCondition() {
|
||||
mDatas.clear();
|
||||
mCsvState.setState(CustomStateView.STATE_LOAD);
|
||||
mAdapter.setData(mDatas);
|
||||
doRefresh();
|
||||
}
|
||||
|
||||
/**
|
||||
* 时间选择
|
||||
*/
|
||||
|
||||
/**
|
||||
* 加载更多
|
||||
*/
|
||||
private void doLoadMore() {
|
||||
if (mType == 1) {
|
||||
getPublishList(mCurrentPage);
|
||||
} else {
|
||||
getReceiveList(mCurrentPage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 刷新
|
||||
*/
|
||||
private void doRefresh() {
|
||||
mDatas.clear();
|
||||
mAdapter.setData(mDatas);
|
||||
if (mType == 1) {
|
||||
getPublishList(1);
|
||||
} else {
|
||||
getReceiveList(1);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 发文待办
|
||||
*
|
||||
* @param currentPage
|
||||
*/
|
||||
private void getPublishList(int currentPage) {
|
||||
mCurrentPage = currentPage;
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getOaPublishFileList(mKeywords, mCurrentPage + "", "15")
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<MineTodoBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull MineTodoBean listBean) {
|
||||
if (listBean.getRows() != null && listBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(listBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(listBean.getRows());
|
||||
}
|
||||
mCsvState.setState(CustomStateView.STATE_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mSrlContent.finishRefresh();
|
||||
if (mDatas.size() >= listBean.getTotal()) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(true);
|
||||
} else {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(false);
|
||||
}
|
||||
} else {
|
||||
mSrlContent.finishRefresh();
|
||||
mSrlContent.finishLoadMore();
|
||||
if (currentPage > 1) {
|
||||
mSrlContent.setNoMoreData(true);
|
||||
} else {
|
||||
if (TextUtils.isEmpty(mKeywords)) {
|
||||
//无数据
|
||||
mCsvState.setState(CustomStateView.STATE_EMPTY);
|
||||
} else {
|
||||
mCsvState.setState(CustomStateView.STATE_EMPTY);
|
||||
ToastUtils.show("未查询到相关内容");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.finishRefresh();
|
||||
ExceptionHandler.handleException(e);
|
||||
mCsvState.setState(CustomStateView.STATE_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 收文待办
|
||||
*/
|
||||
private void getReceiveList(int currentPage) {
|
||||
mCurrentPage = currentPage;
|
||||
RetrofitManager.getInstance()
|
||||
.create(OAApi.class)
|
||||
.getOaReceiveFileList(mKeywords, mCurrentPage + "", "15")
|
||||
.compose(RxTransformer.getTransformer())
|
||||
.subscribe(new Observer<MineTodoBean>() {
|
||||
@Override
|
||||
public void onSubscribe(@NonNull Disposable d) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNext(@NonNull MineTodoBean listBean) {
|
||||
if (listBean.getRows() != null && listBean.getRows().size() > 0) {
|
||||
++mCurrentPage;
|
||||
if (currentPage == 1) {
|
||||
mDatas.clear();
|
||||
mDatas.addAll(listBean.getRows());
|
||||
} else {
|
||||
mDatas.addAll(listBean.getRows());
|
||||
}
|
||||
mCsvState.setState(CustomStateView.STATE_SUCCESS);
|
||||
mAdapter.notifyDataSetChanged();
|
||||
mSrlContent.finishRefresh();
|
||||
if (mDatas.size() >= listBean.getTotal()) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(true);
|
||||
} else {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.setNoMoreData(false);
|
||||
}
|
||||
} else {
|
||||
mSrlContent.finishRefresh();
|
||||
mSrlContent.finishLoadMore();
|
||||
if (currentPage > 1) {
|
||||
mSrlContent.setNoMoreData(true);
|
||||
} else {
|
||||
if (TextUtils.isEmpty(mKeywords)) {
|
||||
//无数据
|
||||
mCsvState.setState(CustomStateView.STATE_EMPTY);
|
||||
} else {
|
||||
mCsvState.setState(CustomStateView.STATE_EMPTY);
|
||||
ToastUtils.show("未查询到相关内容");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(@NonNull Throwable e) {
|
||||
mSrlContent.finishLoadMore();
|
||||
mSrlContent.finishRefresh();
|
||||
ExceptionHandler.handleException(e);
|
||||
mCsvState.setState(CustomStateView.STATE_ERROR);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onComplete() {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onHiddenChanged(boolean hidden) {
|
||||
super.onHiddenChanged(hidden);
|
||||
if (!hidden) {
|
||||
if (mIsRefresh) {
|
||||
mIsRefresh = false;
|
||||
doRefresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttach(@androidx.annotation.NonNull @NotNull Context context) {
|
||||
super.onAttach(context);
|
||||
mMainActivity = (PadMainActivity) getActivity();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void refreshView() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadMoreData() {
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/gray_bg"
|
||||
android:orientation="vertical"
|
||||
tools:context=".activity.meeting.MeetingCenterActivity">
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl_content_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
android:background="@color/white"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingRight="5dp">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_back"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginLeft="5dp"
|
||||
android:background="@drawable/ic_back_black"
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:maxLength="8"
|
||||
android:paddingLeft="5dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:scaleType="fitXY"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="13sp"
|
||||
android:visibility="visible"
|
||||
tools:text=""
|
||||
tools:visibility="visible" />
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_centerVertical="true">
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="待办"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/text_16" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/srl_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_marginRight="10dp">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rlv_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@color/white" />
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.CustomStateView
|
||||
android:id="@+id/csv_state"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
44
oamodule/src/main/res/layout/item_publish_file.xml
Normal file
44
oamodule/src/main/res/layout/item_publish_file.xml
Normal file
@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_point"
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="8dp"
|
||||
android:background="@drawable/ic_nofify_point_red"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintLeft_toLeftOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintVertical_bias="0.5"
|
||||
tools:ignore="MissingConstraints" />
|
||||
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
android:id="@+id/tv_title"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:layout_weight="1"
|
||||
android:ellipsize="end"
|
||||
android:maxLines="1"
|
||||
android:textSize="@dimen/text_16"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:text="内容" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
tools:ignore="MissingConstraints"
|
||||
tools:text="2022-12-12" />
|
||||
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user