工作报告页面调整
This commit is contained in:
parent
dd8fab4aa1
commit
d6d2914c1f
@ -325,7 +325,6 @@ public abstract class BaseActivity extends AppCompatActivity {
|
|||||||
intent.setData(Uri.parse("package:" + this.getPackageName()));
|
intent.setData(Uri.parse("package:" + this.getPackageName()));
|
||||||
mLauncher.launch(intent);
|
mLauncher.launch(intent);
|
||||||
} else {
|
} else {
|
||||||
//do some thing
|
|
||||||
hasManageFileManage();
|
hasManageFileManage();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
6
baselib/src/main/res/drawable/shape_status_gray.xml
Normal file
6
baselib/src/main/res/drawable/shape_status_gray.xml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<solid android:color="@color/gray_dd" />
|
||||||
|
<corners android:radius="2dp" />
|
||||||
|
</shape>
|
@ -1,42 +1,46 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="80dp"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="3dp"
|
android:layout_margin="3dp"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="2dp">
|
android:padding="5dp">
|
||||||
|
|
||||||
<ImageView
|
<LinearLayout
|
||||||
android:id="@+id/iv_photo"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="45dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="45dp"
|
android:orientation="horizontal">
|
||||||
android:layout_centerInParent="true"
|
|
||||||
android:layout_marginTop="10dp"
|
<ImageView
|
||||||
android:scaleType="fitXY"
|
android:id="@+id/iv_photo"
|
||||||
tools:background="@drawable/ic_ctype_file" />
|
android:layout_width="45dp"
|
||||||
|
android:layout_height="45dp"
|
||||||
|
android:scaleType="fitXY"
|
||||||
|
tools:background="@drawable/ic_ctype_file" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_file_name"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="16dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="left"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
android:textSize="@dimen/text_14"
|
||||||
|
tools:text="文件名称.doc" />
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/iv_delete"
|
android:id="@+id/iv_delete"
|
||||||
android:layout_width="25dp"
|
android:layout_width="15dp"
|
||||||
android:layout_height="25dp"
|
android:layout_height="15dp"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_alignParentRight="true"
|
android:layout_alignParentRight="true"
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitXY"
|
||||||
android:src="@drawable/ic_delete" />
|
android:src="@drawable/ic_delete" />
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:id="@+id/tv_file_name"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_below="@id/iv_photo"
|
|
||||||
android:layout_marginTop="5dp"
|
|
||||||
android:ellipsize="end"
|
|
||||||
android:gravity="center_horizontal"
|
|
||||||
android:maxLines="1"
|
|
||||||
android:textSize="12sp"
|
|
||||||
tools:text="文件名称.doc" />
|
|
||||||
|
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
@ -156,6 +156,10 @@ public class MainTabActivity extends BaseActivity {
|
|||||||
public void onNext(@NonNull UserInfoBean userInfoBean) {
|
public void onNext(@NonNull UserInfoBean userInfoBean) {
|
||||||
List<UserInfoBean.DepartmentsBean> departments = userInfoBean.getDepartments();
|
List<UserInfoBean.DepartmentsBean> departments = userInfoBean.getDepartments();
|
||||||
UserLgUtils.setUserDeptId(new Gson().toJson(departments));
|
UserLgUtils.setUserDeptId(new Gson().toJson(departments));
|
||||||
|
//通知fragment刷新
|
||||||
|
if (mFragments != null && mFragments.size() > 0) {
|
||||||
|
mFragments.get(0).refreshContentView("userInfo");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -32,8 +32,6 @@ import com.tenlionsoft.baselib.utils.UIUtil;
|
|||||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||||
import com.tenlionsoft.oamodule.R;
|
import com.tenlionsoft.oamodule.R;
|
||||||
import com.tenlionsoft.oamodule.R2;
|
import com.tenlionsoft.oamodule.R2;
|
||||||
import com.tenlionsoft.oamodule.beans.ChoosePersonListBean;
|
|
||||||
import com.tenlionsoft.oamodule.beans.PersonShowBean;
|
|
||||||
import com.tenlionsoft.oamodule.beans.SaveWorkReportBean;
|
import com.tenlionsoft.oamodule.beans.SaveWorkReportBean;
|
||||||
import com.tenlionsoft.oamodule.net.OAApi;
|
import com.tenlionsoft.oamodule.net.OAApi;
|
||||||
|
|
||||||
@ -44,7 +42,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
@ -128,22 +126,9 @@ public class AddWorkReportsActivity extends BaseActivity {
|
|||||||
mAddFileAdapter.addOnItemClickListener(addFileBean -> {
|
mAddFileAdapter.addOnItemClickListener(addFileBean -> {
|
||||||
LogUtils.e("添加文件");
|
LogUtils.e("添加文件");
|
||||||
if (TextUtils.isEmpty(addFileBean.getId())) {
|
if (TextUtils.isEmpty(addFileBean.getId())) {
|
||||||
//选择
|
checkManagePermission();
|
||||||
if (mFileMax == 0) {
|
|
||||||
ToastUtils.show("超过最大上传数量限制");
|
|
||||||
} else {
|
|
||||||
//TODO 校验是否有权限
|
|
||||||
new LFilePicker()
|
|
||||||
.withActivity(this)
|
|
||||||
.withRequestCode(LionActions.REQUEST_CODE_AC)
|
|
||||||
.withTitle("文件选择")
|
|
||||||
.withMaxNum(mFileMax)
|
|
||||||
.withFileFilter(fileFilter)
|
|
||||||
.start();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
//预览
|
//TODO 预览
|
||||||
//判断文件类型
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//删除上传的文件
|
//删除上传的文件
|
||||||
@ -153,11 +138,25 @@ public class AddWorkReportsActivity extends BaseActivity {
|
|||||||
mAddFileAdapter.notifyDataSetChanged();
|
mAddFileAdapter.notifyDataSetChanged();
|
||||||
++mFileMax;
|
++mFileMax;
|
||||||
});
|
});
|
||||||
mRlvFiles.setLayoutManager(new GridLayoutManager(mActivity, 4));
|
mRlvFiles.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||||
mRlvFiles.setAdapter(mAddFileAdapter);
|
mRlvFiles.setAdapter(mAddFileAdapter);
|
||||||
mBtnConfirm.setOnClickListener(v -> doConfirm());
|
mBtnConfirm.setOnClickListener(v -> doConfirm());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void hasManageFileManage() {
|
||||||
|
if (mFileMax == 0) {
|
||||||
|
ToastUtils.show("超过最大上传数量限制");
|
||||||
|
} else {
|
||||||
|
new LFilePicker()
|
||||||
|
.withActivity(this)
|
||||||
|
.withRequestCode(LionActions.REQUEST_CODE_AC)
|
||||||
|
.withTitle("文件选择")
|
||||||
|
.withMaxNum(mFileMax)
|
||||||
|
.withFileFilter(fileFilter)
|
||||||
|
.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 显示类型
|
* 显示类型
|
||||||
*/
|
*/
|
||||||
|
@ -24,10 +24,12 @@ import com.tenlionsoft.baselib.core.beans.DicBean;
|
|||||||
import com.tenlionsoft.baselib.core.retrofit_net.BaseUrlApi;
|
import com.tenlionsoft.baselib.core.retrofit_net.BaseUrlApi;
|
||||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||||
import com.tenlionsoft.baselib.core.retrofit_net.api.BaseApiService;
|
import com.tenlionsoft.baselib.core.retrofit_net.api.BaseApiService;
|
||||||
|
import com.tenlionsoft.baselib.core.retrofit_net.bean.FileInfoBean;
|
||||||
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
||||||
import com.tenlionsoft.baselib.core.widget.base.AddFileAdapter;
|
import com.tenlionsoft.baselib.core.widget.base.AddFileAdapter;
|
||||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||||
|
import com.tenlionsoft.baselib.utils.FileUtils;
|
||||||
import com.tenlionsoft.baselib.utils.LogUtils;
|
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||||
@ -44,7 +46,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
@ -151,20 +153,62 @@ public class EditWorkReportActivity extends BaseActivity {
|
|||||||
mEtContent.setText(Html.fromHtml(bean.getReportContent()));
|
mEtContent.setText(Html.fromHtml(bean.getReportContent()));
|
||||||
if (!TextUtils.isEmpty(bean.getReportFiles())) {
|
if (!TextUtils.isEmpty(bean.getReportFiles())) {
|
||||||
mFileBeans.clear();
|
mFileBeans.clear();
|
||||||
String[] split = bean.getReportFiles().split(",");
|
doGetFileInfo(bean.getReportFiles());
|
||||||
for (int i = 0; i < split.length; i++) {
|
|
||||||
AddFileBean fileBean = new AddFileBean();
|
|
||||||
fileBean.setId(split[i]);
|
|
||||||
fileBean.setPath(BaseUrlApi.BASE_IMG_URL + split[i]);
|
|
||||||
fileBean.setFileType(1);
|
|
||||||
mFileBeans.add(0, fileBean);
|
|
||||||
--mFileMax;
|
|
||||||
}
|
|
||||||
mFileBeans.add(new AddFileBean());
|
|
||||||
mAddFileAdapter.setData(mFileBeans);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取文件名称等信息
|
||||||
|
*/
|
||||||
|
private void doGetFileInfo(String fileId) {
|
||||||
|
ProgressDialog dialog = UIUtil.initDialog(mActivity, "获取中...");
|
||||||
|
dialog.show();
|
||||||
|
RetrofitManager.getInstance()
|
||||||
|
.create(BaseApiService.class)
|
||||||
|
.getFileInfoList(fileId, UserLgUtils.getToken())
|
||||||
|
.compose(RxTransformer.getTransformer())
|
||||||
|
.subscribe(new Observer<List<FileInfoBean>>() {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull List<FileInfoBean> fileInfoBeans) {
|
||||||
|
if (dialog.isShowing()) dialog.dismiss();
|
||||||
|
if (fileInfoBeans.size() > 0) {
|
||||||
|
for (int i = 0; i < fileInfoBeans.size(); i++) {
|
||||||
|
FileInfoBean infoBean = fileInfoBeans.get(i);
|
||||||
|
AddFileBean bean = new AddFileBean();
|
||||||
|
bean.setId(infoBean.getFileId());
|
||||||
|
bean.setPath(BaseUrlApi.BASE_IMG_URL + infoBean.getFileId());
|
||||||
|
bean.setFileType(FileUtils.getFileType(infoBean.getFileName()));
|
||||||
|
bean.setFileName(infoBean.getFileName());
|
||||||
|
mFileBeans.add(0, bean);
|
||||||
|
--mFileMax;
|
||||||
|
}
|
||||||
|
mAddFileAdapter.setData(mFileBeans);
|
||||||
|
} else {
|
||||||
|
ToastUtils.show("未找到文档信息");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
if (dialog.isShowing()) dialog.dismiss();
|
||||||
|
ExceptionHandler.handleException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
private void initViews() {
|
private void initViews() {
|
||||||
mTyps = new ArrayList<>();
|
mTyps = new ArrayList<>();
|
||||||
DicBean type1 = new DicBean();
|
DicBean type1 = new DicBean();
|
||||||
@ -189,22 +233,9 @@ public class EditWorkReportActivity extends BaseActivity {
|
|||||||
mAddFileAdapter.addOnItemClickListener(addFileBean -> {
|
mAddFileAdapter.addOnItemClickListener(addFileBean -> {
|
||||||
LogUtils.e("添加文件");
|
LogUtils.e("添加文件");
|
||||||
if (TextUtils.isEmpty(addFileBean.getId())) {
|
if (TextUtils.isEmpty(addFileBean.getId())) {
|
||||||
//选择
|
checkManagePermission();
|
||||||
if (mFileMax == 0) {
|
|
||||||
ToastUtils.show("超过最大上传数量限制");
|
|
||||||
} else {
|
|
||||||
//TODO 校验是否有权限
|
|
||||||
new LFilePicker()
|
|
||||||
.withActivity(this)
|
|
||||||
.withRequestCode(LionActions.REQUEST_CODE_AC)
|
|
||||||
.withTitle("文件选择")
|
|
||||||
.withMaxNum(mFileMax)
|
|
||||||
.withFileFilter(fileFilter)
|
|
||||||
.start();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
//预览
|
//TODO 预览
|
||||||
//判断文件类型
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//删除上传的文件
|
//删除上传的文件
|
||||||
@ -214,11 +245,26 @@ public class EditWorkReportActivity extends BaseActivity {
|
|||||||
mAddFileAdapter.notifyDataSetChanged();
|
mAddFileAdapter.notifyDataSetChanged();
|
||||||
++mFileMax;
|
++mFileMax;
|
||||||
});
|
});
|
||||||
mRlvFiles.setLayoutManager(new GridLayoutManager(mActivity, 4));
|
mRlvFiles.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||||
mRlvFiles.setAdapter(mAddFileAdapter);
|
mRlvFiles.setAdapter(mAddFileAdapter);
|
||||||
mBtnConfirm.setOnClickListener(v -> doConfirm());
|
mBtnConfirm.setOnClickListener(v -> doConfirm());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void hasManageFileManage() {
|
||||||
|
if (mFileMax == 0) {
|
||||||
|
ToastUtils.show("超过最大上传数量限制");
|
||||||
|
} else {
|
||||||
|
new LFilePicker()
|
||||||
|
.withActivity(this)
|
||||||
|
.withRequestCode(LionActions.REQUEST_CODE_AC)
|
||||||
|
.withTitle("文件选择")
|
||||||
|
.withMaxNum(mFileMax)
|
||||||
|
.withFileFilter(fileFilter)
|
||||||
|
.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示类型
|
* 显示类型
|
||||||
*/
|
*/
|
||||||
|
@ -17,10 +17,13 @@ import com.tenlionsoft.baselib.core.beans.AddFileBean;
|
|||||||
import com.tenlionsoft.baselib.core.beans.BaseSuccessBean;
|
import com.tenlionsoft.baselib.core.beans.BaseSuccessBean;
|
||||||
import com.tenlionsoft.baselib.core.retrofit_net.BaseUrlApi;
|
import com.tenlionsoft.baselib.core.retrofit_net.BaseUrlApi;
|
||||||
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
||||||
|
import com.tenlionsoft.baselib.core.retrofit_net.api.BaseApiService;
|
||||||
|
import com.tenlionsoft.baselib.core.retrofit_net.bean.FileInfoBean;
|
||||||
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
||||||
|
import com.tenlionsoft.baselib.core.widget.base.AddFileAdapter;
|
||||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||||
import com.tenlionsoft.baselib.core.widget.base.ShowFileAdapter;
|
|
||||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||||
|
import com.tenlionsoft.baselib.utils.FileUtils;
|
||||||
import com.tenlionsoft.baselib.utils.UIUtil;
|
import com.tenlionsoft.baselib.utils.UIUtil;
|
||||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||||
import com.tenlionsoft.oamodule.R;
|
import com.tenlionsoft.oamodule.R;
|
||||||
@ -32,7 +35,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.recyclerview.widget.GridLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
@ -40,6 +43,8 @@ import io.reactivex.rxjava3.annotations.NonNull;
|
|||||||
import io.reactivex.rxjava3.core.Observer;
|
import io.reactivex.rxjava3.core.Observer;
|
||||||
import io.reactivex.rxjava3.disposables.Disposable;
|
import io.reactivex.rxjava3.disposables.Disposable;
|
||||||
|
|
||||||
|
import static com.tenlionsoft.baselib.core.widget.PhotoActivity.TAG_IMGURL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 作者: Adam
|
* 作者: Adam
|
||||||
* 日期: 2022年04月19日15:21:37
|
* 日期: 2022年04月19日15:21:37
|
||||||
@ -187,24 +192,98 @@ public class WorkReportDetailActivity extends BaseActivity {
|
|||||||
if (!TextUtils.isEmpty(bean.getReportFiles())) {
|
if (!TextUtils.isEmpty(bean.getReportFiles())) {
|
||||||
mRlvFiles.setVisibility(View.VISIBLE);
|
mRlvFiles.setVisibility(View.VISIBLE);
|
||||||
mTvFileHint.setVisibility(View.GONE);
|
mTvFileHint.setVisibility(View.GONE);
|
||||||
List<AddFileBean> files = new ArrayList<>();
|
doGetFileInfo(bean.getReportFiles());
|
||||||
String[] split = bean.getReportFiles().split(",");
|
|
||||||
for (int i = 0; i < split.length; i++) {
|
|
||||||
AddFileBean fileBean = new AddFileBean();
|
|
||||||
fileBean.setId(split[i]);
|
|
||||||
fileBean.setPath(BaseUrlApi.BASE_IMG_URL + split[i]);
|
|
||||||
fileBean.setFileType(1);
|
|
||||||
files.add(fileBean);
|
|
||||||
}
|
|
||||||
ShowFileAdapter adapter = new ShowFileAdapter(mActivity, files);
|
|
||||||
mRlvFiles.setLayoutManager(new GridLayoutManager(mActivity, 4));
|
|
||||||
mRlvFiles.setAdapter(adapter);
|
|
||||||
} else {
|
} else {
|
||||||
mRlvFiles.setVisibility(View.GONE);
|
mRlvFiles.setVisibility(View.GONE);
|
||||||
mTvFileHint.setVisibility(View.VISIBLE);
|
mTvFileHint.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取文件名称等信息
|
||||||
|
*/
|
||||||
|
private void doGetFileInfo(String fileId) {
|
||||||
|
ProgressDialog dialog = UIUtil.initDialog(mActivity, "获取中...");
|
||||||
|
dialog.show();
|
||||||
|
RetrofitManager.getInstance()
|
||||||
|
.create(BaseApiService.class)
|
||||||
|
.getFileInfoList(fileId, UserLgUtils.getToken())
|
||||||
|
.compose(RxTransformer.getTransformer())
|
||||||
|
.subscribe(new Observer<List<FileInfoBean>>() {
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onSubscribe(@NonNull Disposable d) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNext(@NonNull List<FileInfoBean> fileInfoBeans) {
|
||||||
|
if (dialog.isShowing()) dialog.dismiss();
|
||||||
|
if (fileInfoBeans.size() > 0) {
|
||||||
|
List<AddFileBean> mFiles = new ArrayList<>();
|
||||||
|
for (int i = 0; i < fileInfoBeans.size(); i++) {
|
||||||
|
FileInfoBean infoBean = fileInfoBeans.get(i);
|
||||||
|
AddFileBean bean = new AddFileBean();
|
||||||
|
bean.setId(infoBean.getFileId());
|
||||||
|
bean.setPath(BaseUrlApi.BASE_IMG_URL + infoBean.getFileId());
|
||||||
|
bean.setFileType(FileUtils.getFileType(infoBean.getFileName()));
|
||||||
|
bean.setFileName(infoBean.getFileName());
|
||||||
|
mFiles.add(bean);
|
||||||
|
}
|
||||||
|
AddFileAdapter adapter = new AddFileAdapter(mActivity, mFiles);
|
||||||
|
mRlvFiles.setLayoutManager(new LinearLayoutManager(mActivity));
|
||||||
|
mRlvFiles.setAdapter(adapter);
|
||||||
|
adapter.addOnItemClickListener(addFileBean -> previewFile(addFileBean, mFiles));
|
||||||
|
} else {
|
||||||
|
ToastUtils.show("未找到文档信息");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onError(@NonNull Throwable e) {
|
||||||
|
if (dialog.isShowing()) dialog.dismiss();
|
||||||
|
ExceptionHandler.handleException(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onComplete() {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 预览文件
|
||||||
|
*/
|
||||||
|
private void previewFile(AddFileBean addFileBean, List<AddFileBean> mFiles) {
|
||||||
|
if (addFileBean.getFileType() == 1) {
|
||||||
|
//文档
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_ACTIVITY_PREVIEW_FILE)
|
||||||
|
.withString("fileName", addFileBean.getFileName())
|
||||||
|
.withString("fileId", addFileBean.getId())
|
||||||
|
.navigation();
|
||||||
|
} else if (2 == addFileBean.getFileType()) {
|
||||||
|
//图片预览
|
||||||
|
//遍历文件获取所有图片文件
|
||||||
|
ArrayList<String> imgUrls = new ArrayList<>();
|
||||||
|
for (int i = 0; i < mFiles.size(); i++) {
|
||||||
|
if (mFiles.get(i).getFileType() == 2) {
|
||||||
|
AddFileBean fileBean = mFiles.get(i);
|
||||||
|
String url = BaseUrlApi.BASE_IMG_URL + fileBean.getId();
|
||||||
|
imgUrls.add(url);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ARouter.getInstance()
|
||||||
|
.build(PathConfig.PATH_MODULE_BASELIB_SHOW_IMG)
|
||||||
|
.withStringArrayList(TAG_IMGURL, imgUrls)
|
||||||
|
.navigation();
|
||||||
|
} else if (3 == addFileBean.getFileType() || 4 == addFileBean.getFileType()) {
|
||||||
|
//TODO 视频或音频预览
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onActivityResult(int requestCode, int resultCode, @Nullable @org.jetbrains.annotations.Nullable Intent data) {
|
protected void onActivityResult(int requestCode, int resultCode, @Nullable @org.jetbrains.annotations.Nullable Intent data) {
|
||||||
super.onActivityResult(requestCode, resultCode, data);
|
super.onActivityResult(requestCode, resultCode, data);
|
||||||
|
@ -3,6 +3,7 @@ package com.tenlionsoft.oamodule.activity.workreports;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.view.inputmethod.EditorInfo;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
@ -19,6 +20,7 @@ import com.tenlionsoft.baselib.core.retrofit_net.RetrofitManager;
|
|||||||
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
import com.tenlionsoft.baselib.core.retrofit_net.conver.RxTransformer;
|
||||||
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
import com.tenlionsoft.baselib.core.widget.base.BaseActivity;
|
||||||
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
import com.tenlionsoft.baselib.utils.ExceptionHandler;
|
||||||
|
import com.tenlionsoft.baselib.utils.LogUtils;
|
||||||
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
import com.tenlionsoft.baselib.utils.UserLgUtils;
|
||||||
import com.tenlionsoft.oamodule.R;
|
import com.tenlionsoft.oamodule.R;
|
||||||
import com.tenlionsoft.oamodule.R2;
|
import com.tenlionsoft.oamodule.R2;
|
||||||
@ -99,6 +101,24 @@ public class WorkReportsActivity extends BaseActivity {
|
|||||||
.withString("id", workReportDetailBean.getWorkReportId())
|
.withString("id", workReportDetailBean.getWorkReportId())
|
||||||
.navigation(mActivity, 12));
|
.navigation(mActivity, 12));
|
||||||
doRefresh();
|
doRefresh();
|
||||||
|
mEtBaseSearchCancel.setOnEditorActionListener((v, actionId, event) -> {
|
||||||
|
LogUtils.e("搜索==" + actionId);
|
||||||
|
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
|
||||||
|
hideSoftKeyboard();
|
||||||
|
mEtBaseSearchCancel.clearFocus();
|
||||||
|
mKeywords = v.getText().toString();
|
||||||
|
doRefresh();
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mTvBaseSearchCancel.setOnClickListener(v -> {
|
||||||
|
mEtBaseSearchCancel.setText("");
|
||||||
|
mEtBaseSearchCancel.clearFocus();
|
||||||
|
mKeywords = "";
|
||||||
|
doRefresh();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doLoadMore() {
|
private void doLoadMore() {
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.tenlionsoft.oamodule.adapter;
|
package com.tenlionsoft.oamodule.adapter;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.text.TextUtils;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
@ -34,17 +35,22 @@ public class WorkReportAdapter extends BaseRecyclerAdapter<WorkReportDetailBean,
|
|||||||
public void bindHolder(WorkReportHolder h, int i) {
|
public void bindHolder(WorkReportHolder h, int i) {
|
||||||
h.mTvTitle.setText(mData.get(i).getReportTitle());
|
h.mTvTitle.setText(mData.get(i).getReportTitle());
|
||||||
h.mTvContent.setText(mData.get(i).getReportContent());
|
h.mTvContent.setText(mData.get(i).getReportContent());
|
||||||
h.mTvEgress.setText(mData.get(i).getReportEgress());
|
if (TextUtils.isEmpty(mData.get(i).getReportType())) {
|
||||||
switch (mData.get(i).getReportType()) {
|
h.mTvType.setVisibility(View.GONE);
|
||||||
case "1":
|
} else {
|
||||||
h.mTvType.setText("工作日报");
|
h.mTvType.setVisibility(View.VISIBLE);
|
||||||
break;
|
switch (mData.get(i).getReportType()) {
|
||||||
case "2":
|
case "1":
|
||||||
h.mTvType.setText("工作周报");
|
h.mTvType.setText("工作日报");
|
||||||
break;
|
break;
|
||||||
case "3":
|
case "2":
|
||||||
h.mTvType.setText("工作月报");
|
h.mTvType.setText("工作周报");
|
||||||
break;
|
break;
|
||||||
|
case "3":
|
||||||
|
h.mTvType.setText("工作月报");
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -374,6 +374,25 @@ public class OaMainFragment extends BaseFragment {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void refreshContentView(String... data) {
|
||||||
|
if (data != null && data.length > 0) {
|
||||||
|
String datum = data[0];
|
||||||
|
if ("userInfo".equals(datum)) {
|
||||||
|
//刷新部门数据
|
||||||
|
String userDeptId = UserLgUtils.getUserDeptId();
|
||||||
|
if (!TextUtils.isEmpty(userDeptId)) {
|
||||||
|
Gson gson = new Gson();
|
||||||
|
ArrayList<UserInfoBean.DepartmentsBean> depts = gson.fromJson(userDeptId, new TypeToken<ArrayList<UserInfoBean.DepartmentsBean>>() {
|
||||||
|
}.getType());
|
||||||
|
if (depts != null && depts.size() > 0) {
|
||||||
|
mTvDept.setText(depts.get(0).getDepartmentName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void refreshView() {
|
protected void refreshView() {
|
||||||
|
|
||||||
|
@ -24,8 +24,6 @@ public class WorkReportHolder extends BaseViewHolder {
|
|||||||
public TextView mTvTitle;
|
public TextView mTvTitle;
|
||||||
@BindView(R2.id.tv_type)
|
@BindView(R2.id.tv_type)
|
||||||
public TextView mTvType;
|
public TextView mTvType;
|
||||||
@BindView(R2.id.tv_egress)
|
|
||||||
public TextView mTvEgress;
|
|
||||||
@BindView(R2.id.tv_content)
|
@BindView(R2.id.tv_content)
|
||||||
public TextView mTvContent;
|
public TextView mTvContent;
|
||||||
|
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:orientation="vertical"
|
android:background="@color/gray_bg"
|
||||||
tools:context=".activity.car.ByCarAddActivity">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<androidx.core.widget.NestedScrollView
|
<androidx.core.widget.NestedScrollView
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@ -45,6 +45,7 @@
|
|||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:gravity="right"
|
android:gravity="right"
|
||||||
android:hint="未录入"
|
android:hint="未录入"
|
||||||
|
android:textColor="@color/black"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:background="@color/gray_bg"
|
android:background="@color/gray_bg"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical">
|
||||||
tools:context=".activity.meeting.MeetingCenterActivity">
|
|
||||||
|
|
||||||
<include layout="@layout/layout_base_search_cancel" />
|
<include layout="@layout/layout_base_search_cancel" />
|
||||||
|
|
||||||
@ -22,7 +21,11 @@
|
|||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/rlv_content"
|
android:id="@+id/rlv_content"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" />
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="10dp"
|
||||||
|
android:layout_marginRight="10dp"
|
||||||
|
android:background="@color/white"
|
||||||
|
tools:listitem="@layout/item_work_report" />
|
||||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
|
@ -3,29 +3,48 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_margin="3dp"
|
|
||||||
android:background="@color/white"
|
android:background="@color/white"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:padding="3dp">
|
android:paddingLeft="5dp"
|
||||||
|
android:paddingTop="10dp"
|
||||||
|
android:paddingRight="5dp"
|
||||||
|
android:paddingBottom="10dp">
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/tv_title"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
tools:text="上报标题" />
|
android:gravity="center_vertical"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_type"
|
android:id="@+id/tv_title"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="0dp"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textColor="@color/black"
|
||||||
|
tools:text="上报标题上报标题上报标题上报标题上报标题上报标题上报标题上报标题上报标题上报标题上报标题上报标题上报标题" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_egress"
|
android:id="@+id/tv_type"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@drawable/shape_status_gray"
|
||||||
|
android:padding="3dp"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="@dimen/text_12"
|
||||||
|
tools:text="工作月报" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/tv_content"
|
android:id="@+id/tv_content"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textSize="@dimen/text_12"
|
||||||
|
tools:text="工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容工作内容" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user