Commit 869a34f3 by 宋祥

1.中文名称解码错误问题修复

parent 74a6fdc5
...@@ -157,7 +157,8 @@ $(function () { ...@@ -157,7 +157,8 @@ $(function () {
field: "operator", field: "operator",
title: "操作", title: "操作",
template: function (model) { template: function (model) {
let param = "'" + model.fileId + "', '" + model.docId + "', '" + model.docType + "'"; let param = "'" + model.fileId + "', '" + model.docId + "', '" + model.docType
+ "', '" + model.docName + "'";
let template = ''; let template = '';
// template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" ' // template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
// + 'onclick="showQueryRecord(' + param + ')" >预览记录</a>'; // + 'onclick="showQueryRecord(' + param + ')" >预览记录</a>';
...@@ -319,13 +320,14 @@ let showAuthButton = function () { ...@@ -319,13 +320,14 @@ let showAuthButton = function () {
* @param fileId * @param fileId
* @param docId * @param docId
* @param docType * @param docType
* @param docName
*/ */
let showPreview = function (fileId, docId, docType) { let showPreview = function (fileId, docId, docType, docName) {
if (isBlank(docId)) { if (isBlank(docId)) {
message("附件类型或ID不能为空"); message("附件类型或ID不能为空");
return; return;
} }
$("#previewFile").data("kendoWindow").center(); $("#previewFile").data("kendoWindow").center();
$("#previewFile").data("kendoWindow").open(); $("#previewFile").data("kendoWindow").open();
addRecord(fileId, docId, docType); addRecord(fileId, docId, docType, docName);
} }
...@@ -14,7 +14,7 @@ $(function () { ...@@ -14,7 +14,7 @@ $(function () {
IPLATUI.EFTree.docTree.selectNode.leaf = nodeData.leaf; IPLATUI.EFTree.docTree.selectNode.leaf = nodeData.leaf;
IPLATUI.EFTree.docTree.selectNode.leafType = leafType; IPLATUI.EFTree.docTree.selectNode.leafType = leafType;
// 添加预览记录 // 添加预览记录
add(label, leafType, nodeData.docType); add(label, leafType, nodeData.docType, nodeData.text);
}, },
template: function (node) { template: function (node) {
var item = node.item; var item = node.item;
...@@ -95,8 +95,9 @@ function expandTreeNode(tree, node) { ...@@ -95,8 +95,9 @@ function expandTreeNode(tree, node) {
* @param label docId * @param label docId
* @param leafType 节点类型:C=目录,F=文件 * @param leafType 节点类型:C=目录,F=文件
* @param docType * @param docType
* @param docName
*/ */
function add(docId, leafType, docType) { function add(docId, leafType, docType, docName) {
if (isBlank(leafType) || isBlank(docId)) { if (isBlank(leafType) || isBlank(docId)) {
message("文件类型或ID不能为空"); message("文件类型或ID不能为空");
return; return;
...@@ -107,7 +108,7 @@ function add(docId, leafType, docType) { ...@@ -107,7 +108,7 @@ function add(docId, leafType, docType) {
return; return;
} }
let fileId = $("#inqu_status-0-fileId").val() let fileId = $("#inqu_status-0-fileId").val()
addRecord(fileId, docId, docType); addRecord(fileId, docId, docType, docName);
} }
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* @param docId * @param docId
* @param docType * @param docType
*/ */
function addRecord(fileId, docId, docType){ function addRecord(fileId, docId, docType, docName){
// 隐藏预览区域 // 隐藏预览区域
hideHtml(); hideHtml();
IPLAT.progress($("body"), true); IPLAT.progress($("body"), true);
...@@ -16,7 +16,7 @@ function addRecord(fileId, docId, docType){ ...@@ -16,7 +16,7 @@ function addRecord(fileId, docId, docType){
onSuccess: function (res) { onSuccess: function (res) {
if (res.getStatus() >= 0) { if (res.getStatus() >= 0) {
try { try {
previewFile(docId, docType); previewFile(docId, docType, docName);
} catch (e) { } catch (e) {
} }
} else { } else {
...@@ -36,16 +36,17 @@ function addRecord(fileId, docId, docType){ ...@@ -36,16 +36,17 @@ function addRecord(fileId, docId, docType){
* *
* @param docId * @param docId
* @param docType * @param docType
* @param docName
*/ */
function previewFile(docId, docType) { function previewFile(docId, docType, docName) {
// 隐藏文本描述 // 隐藏文本描述
$("#descDiv").css('display', 'none'); $("#descDiv").css('display', 'none');
if (true) { if (isXml(docType)) {
previewOnline(docId, "xxxxx." + docType); previewXml(docId);
} else if (true) {
previewOnline(docId, docName);
} else if (isText(docType)) { } else if (isText(docType)) {
previewText(docId); previewText(docId);
} else if (isXml(docType)) {
previewXml(docId);
} else if (isExcel(docType)) { } else if (isExcel(docType)) {
previewExcel(docId); previewExcel(docId);
} else if (isWord(docType)) { } else if (isWord(docType)) {
......
$(function () {
$("#QUERY").on("click", function () {
var loginName = $("#inqu_status-0-loginName").val();
var eiInfo = new EiInfo();
eiInfo.set("loginName", loginName);
EiCommunicator.send("XS0105", "query", eiInfo, {
onSuccess: function (ei) {
if (-1 == ei.getStatus()) {
IPLAT.alert(ei.getMsg());
} else {
$("#loginName").val(ei.get("loginName"));
$("#userName").val(ei.get("userName"));
$("#mobile").val(ei.get("mobile"));
$("#email").val(ei.get("email"));
}
}, onFail: function (ei) {
IPLAT.alert("请输入正确的登录账号!");
}
});
});
$("#RESET_PASSWORD").on("click", function () {
var loginName = $("#loginName").val();
if (loginName == "" || loginName == null) {
IPLAT.alert("请先输入登录账号查询,再进行重置!!");
return;
} else {
IPLAT.confirm("确定重置" + loginName + "的密码吗?",function (e) {
var eiInfo = new EiInfo();
eiInfo.set("loginName", loginName);
EiCommunicator.send("XS0105", "resetPassword", eiInfo, {
onSuccess: function (ei) {
if (-1 == ei.getStatus()) {
IPLAT.alert(ei.getMsg());
} else {
IPLAT.alert(ei.getMsg());
}
}, onFail: function (ei) {
IPLAT.alert(ei.getMsg());
}
});
},'')
}
});
});
<!DOCTYPE html>
<%@page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage>
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput blockId="inqu_status" cname="登录账号" ename="loginName" row="0" placeholder="请输入登录账号"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="用户信息">
<div class="row">
<EF:EFInput cname="登录账号" ename="loginName" readonly="true"/>
</div>
<div class="row">
<EF:EFInput cname="用户姓名" ename="userName" readonly="true"/>
</div>
<div class="row">
<EF:EFInput cname="手机号码" ename="mobile" readonly="true"/>
</div>
<div class="row">
<EF:EFInput cname="电子邮箱" ename="email" readonly="true"/>
</div>
</EF:EFRegion>
</EF:EFPage>
...@@ -653,15 +653,25 @@ function loadChange(grid,e,field) { ...@@ -653,15 +653,25 @@ function loadChange(grid,e,field) {
* 预览 * 预览
* *
* @param docId 文件ID * @param docId 文件ID
* @param fileName 文件名称必须带后缀 * @param docName 文件名称必须带后缀
*/ */
function previewFile(docId, fileName) { function previewFile(docId, docName) {
let hostname = window.location.hostname; let hostname = window.location.hostname;
let domain = hostname === "localhost" ? "http://129.211.46.84:8085": window.location.origin; let domain = hostname === "localhost" ? "http://129.211.46.84:8085": window.location.origin;
let url = domain + IPLATUI.CONTEXT_PATH + '/file/download/preview/' + docId let url = domain + IPLATUI.CONTEXT_PATH + '/file/download/preview/' + docId
+ "?fullfilename=" + fileName; + "?fullfilename=";
// Base64转码 // Base64转码
let urlEncode = encodeURIComponent(btoa(url)); let urlEncode;
try {
urlEncode = encodeURIComponent(btoa(url + docName));
} catch (e) {
console.error("encodeURIComponent fail:", e)
let newDocName = docId + docName.substring(docName.lastIndexOf("."))
urlEncode = encodeURIComponent(btoa(url + newDocName));
}
if (urlEncode === "") {
return;
}
if (PROJECT_ENV === "run" || PROJECT_ENV === "RUN") { if (PROJECT_ENV === "run" || PROJECT_ENV === "RUN") {
return "https://www.eis-paas.com/preview/onlinePreview?url=" + urlEncode return "https://www.eis-paas.com/preview/onlinePreview?url=" + urlEncode
} else { } else {
......
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