预览文件
This commit is contained in:
parent
217d12f63e
commit
e4c5843c50
@ -5,7 +5,7 @@
|
||||
android:background="#ffffff">
|
||||
|
||||
|
||||
<com.tenlionsoft.baselib.core.widget.views.TypeFaceTextView
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
|
@ -10,8 +10,8 @@
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 3,
|
||||
"versionName": "1.0.3",
|
||||
"versionCode": 4,
|
||||
"versionName": "1.0.4",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
]
|
||||
|
@ -7,10 +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.74.34.13:8081/";//* 呼市玉泉区司法 */
|
||||
public static final String IP="http://106.74.34.13:8081/";//* 呼市玉泉区司法 */
|
||||
// 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/";//西藏统一用户
|
||||
@ -46,7 +46,7 @@ public class BaseUrlApi {
|
||||
public static final String UPDATE_URL = "version.json";
|
||||
|
||||
|
||||
public static final String PREVIEW_URL = BASE_OA + "approute/onlinefile/onlineFileView/";//文件预览地址
|
||||
public static final String PREVIEW_URL = BASE_OA + "approute/onlinefile/onlineFileView/";//文件预览地址 app/onlinefile/onlineFileView/{fileId}
|
||||
//请求码
|
||||
public static final int PHOTO_REQUEST = 0x2121;//相册图片
|
||||
public static final int CAMERA_REQUEST = 0x2222;//相机图片
|
||||
|
@ -161,6 +161,7 @@ public class PreviewFileActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
||||
LogUtils.e("重定向:" + url);
|
||||
view.loadUrl(url);
|
||||
return true;
|
||||
}
|
||||
|
@ -60,8 +60,8 @@ ext {
|
||||
gMinSdkVersion = 19
|
||||
gTargetSdkVersion = 30
|
||||
//玉泉区司法局
|
||||
gVersionCode = 3
|
||||
gVersionName = '1.0.3'
|
||||
gVersionCode = 4
|
||||
gVersionName = '1.0.4'
|
||||
//gVersionCode = 9
|
||||
//gVersionName = '1.0.9'
|
||||
gBuildToolsVersion = "29.0.2"
|
||||
|
@ -220,6 +220,7 @@ public class OaFlowCenterActivity extends BaseActivity {
|
||||
initView();
|
||||
Map<String, Object> params = buildWebParams();
|
||||
mUrl = (String) params.get("url");
|
||||
LogUtils.e(mUrl);
|
||||
mProcessId = (String) params.get("processId");
|
||||
mTaskId = (String) params.get("taskId");
|
||||
initWebView();
|
||||
@ -960,12 +961,14 @@ public class OaFlowCenterActivity extends BaseActivity {
|
||||
super.onPageFinished(view, url);
|
||||
mCsvWeb.setState(CustomStateView.STATE_SUCCESS);
|
||||
LogUtils.e("加载完成");
|
||||
int measuredHeight = view.getMeasuredHeight();
|
||||
runOnUiThread(() -> {
|
||||
WebView webView = mWebView.getWebCreator().getWebView();
|
||||
FrameLayout.LayoutParams params =
|
||||
new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
|
||||
FrameLayout.LayoutParams.WRAP_CONTENT);
|
||||
webView.setLayoutParams(params);
|
||||
// webView.post(() -> webView.measure(0, 0));
|
||||
});
|
||||
}
|
||||
|
||||
@ -990,8 +993,11 @@ public class OaFlowCenterActivity extends BaseActivity {
|
||||
iAgentWebSettings.getWebSettings().setAllowFileAccess(true);//允许选择文件
|
||||
iAgentWebSettings.getWebSettings().setAllowContentAccess(true);//允许选择文件
|
||||
iAgentWebSettings.getWebSettings().setAllowFileAccessFromFileURLs(true);//允许选择文件
|
||||
iAgentWebSettings.getWebSettings().setDomStorageEnabled(true);
|
||||
iAgentWebSettings.getWebSettings().setAllowUniversalAccessFromFileURLs(true);//允许选择文件
|
||||
iAgentWebSettings.getWebSettings().setSupportMultipleWindows(true);//是否允许多个窗口
|
||||
iAgentWebSettings.getWebSettings().setTextZoom(100);
|
||||
iAgentWebSettings.getWebSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN);
|
||||
return iAgentWebSettings;
|
||||
}
|
||||
})
|
||||
@ -1199,6 +1205,8 @@ public class OaFlowCenterActivity extends BaseActivity {
|
||||
.navigation(mActivity, 15);
|
||||
} else if ("chooseUser".equals(method)) {
|
||||
onShowChooseUserDialog(params);
|
||||
} else if ("androidAlert".equals(method)) {
|
||||
ToastUtils.show(params);
|
||||
}
|
||||
});
|
||||
|
||||
@ -1207,10 +1215,20 @@ public class OaFlowCenterActivity extends BaseActivity {
|
||||
|
||||
@JavascriptInterface
|
||||
public void invokeNative(String method) {
|
||||
LogUtils.e(method);
|
||||
if ("back".equals(method)) {
|
||||
LogUtils.e("关闭");
|
||||
mActivity.setResult(RESULT_OK);
|
||||
mActivity.finish();
|
||||
} else if ("refreshView".equals(method)) {
|
||||
runOnUiThread(() -> {
|
||||
WebView webView = mWebView.getWebCreator().getWebView();
|
||||
FrameLayout.LayoutParams params =
|
||||
new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT,
|
||||
FrameLayout.LayoutParams.WRAP_CONTENT);
|
||||
webView.setLayoutParams(params);
|
||||
webView.post(() -> webView.measure(0, 0));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -1221,6 +1239,8 @@ public class OaFlowCenterActivity extends BaseActivity {
|
||||
onShowTimePicker(type, callBack);
|
||||
} else if ("onShowPicker".equals(method)) {
|
||||
onShowPicker(type, callBack);
|
||||
} else if ("doConfirmNode".equals(method)) {
|
||||
onShowConfirmNode(type, callBack);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -1243,6 +1263,24 @@ public class OaFlowCenterActivity extends BaseActivity {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面弹出提示确认框
|
||||
*
|
||||
* @param hint
|
||||
* @param callBack
|
||||
*/
|
||||
private void onShowConfirmNode(String hint, String callBack) {
|
||||
new AlertDialog.Builder(mActivity)
|
||||
.setTitle("提示")
|
||||
.setMessage(hint)
|
||||
.setPositiveButton("确定", (dialog, which) -> {
|
||||
mWebView.getJsAccessEntrace().quickCallJs(callBack);
|
||||
})
|
||||
.setNegativeButton("取消", (dialog, which) -> dialog.dismiss())
|
||||
.create()
|
||||
.show();
|
||||
}
|
||||
|
||||
/**
|
||||
* 显示选择人员
|
||||
*/
|
||||
@ -1260,6 +1298,7 @@ public class OaFlowCenterActivity extends BaseActivity {
|
||||
|
||||
@Override
|
||||
public void doConfirmMulti(String ids, String names) {
|
||||
LogUtils.e(ids);
|
||||
chooseDir.dismiss();
|
||||
mWebView.getJsAccessEntrace().quickCallJs("addCheckUser", ids, names);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user