Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
platform
hg-smart
Commits
2fcef0eb
Commit
2fcef0eb
authored
Oct 25, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://git.pseer.com:8800/platform/hg-smart
into dev-ly
parents
ee7ef098
a1e09350
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
47 additions
and
33 deletions
+47
-33
Iplat4jUtils.java
src/main/java/com/baosight/hggp/core/utils/Iplat4jUtils.java
+9
-5
ProjectSourceEnum.java
...java/com/baosight/hggp/hg/sc/enums/ProjectSourceEnum.java
+1
-1
HGWD001.js
src/main/webapp/HG/WD/HGWD001.js
+2
-2
HGWD002A1.js
src/main/webapp/HG/WD/HGWD002A1.js
+35
-21
common.js
src/main/webapp/common/js/common.js
+0
-4
No files found.
src/main/java/com/baosight/hggp/core/utils/Iplat4jUtils.java
View file @
2fcef0eb
...
...
@@ -14,6 +14,7 @@ import com.baosight.iplat4j.core.ioc.spring.PlatApplicationContext;
import
com.baosight.iplat4j.eu.dm.util.PlatFileUploader
;
import
org.apache.commons.collections.CollectionUtils
;
import
java.net.URLEncoder
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -133,7 +134,8 @@ public class Iplat4jUtils {
}
String
chgName
=
dbDm02Map
.
get
(
"chgName"
).
toString
();
String
realPath
=
dbDm02Map
.
get
(
"realPath"
).
toString
();
return
S3Constant
.
RESOURCE
+
"/"
+
OSConstant
.
FILE_DOWNLOAD
+
"/"
+
realPath
+
chgName
;
return
S3Constant
.
RESOURCE
+
"/"
+
OSConstant
.
FILE_DOWNLOAD
+
"/"
+
realPath
+
URLEncoder
.
encode
(
chgName
,
"UTF-8"
);
}
}
...
...
@@ -145,8 +147,8 @@ public class Iplat4jUtils {
* @return
*/
public
static
String
compressFile
(
List
<
String
>
docIds
,
String
zipName
)
throws
Exception
{
String
zipFolderPath
=
OSConstant
.
ZIP_DIR
+
OSConstant
.
SEPARATOR
+
DateUtils
.
shortDate
()
+
OSConstant
.
SEPARATOR
+
zipName
;
String
mainFolderPath
=
OSConstant
.
ZIP_DIR
+
OSConstant
.
SEPARATOR
+
DateUtils
.
shortDate
();
String
zipFolderPath
=
mainFolderPath
+
OSConstant
.
SEPARATOR
+
zipName
;
FileUtils
.
createDirs
(
zipFolderPath
);
String
zipFilePath
=
zipFolderPath
+
".zip"
;
if
(
CommonConstant
.
FileLocation
.
S3
.
equalsIgnoreCase
(
S3Constant
.
FILE_LOCATION
))
{
...
...
@@ -171,8 +173,10 @@ public class Iplat4jUtils {
// 压缩完删除本地文件
FileUtils
.
deleteFiles
(
zipFolderPath
);
// 替换成HTTP地址
return
S3Constant
.
RESOURCE
+
"/"
+
OSConstant
.
FILE_DOWNLOAD
+
zipFilePath
.
replace
(
OSConstant
.
DOC_ROOT_DIR
,
""
)
.
replace
(
OSConstant
.
SEPARATOR
,
"/"
);
return
S3Constant
.
RESOURCE
+
"/"
+
OSConstant
.
FILE_DOWNLOAD
+
mainFolderPath
.
replace
(
OSConstant
.
DOC_ROOT_DIR
,
""
)
.
replace
(
OSConstant
.
SEPARATOR
,
"/"
)
+
"/"
+
URLEncoder
.
encode
(
zipName
,
"UTF-8"
)
+
".zip"
;
}
}
src/main/java/com/baosight/hggp/hg/sc/enums/ProjectSourceEnum.java
View file @
2fcef0eb
...
...
@@ -7,7 +7,7 @@ package com.baosight.hggp.hg.sc.enums;
public
enum
ProjectSourceEnum
{
ENGINEERING
(
"engineering"
,
"工程设计图"
),
FOREIGN
(
"foreign"
,
"
外来涉密
图"
),
FOREIGN
(
"foreign"
,
"
生产制造
图"
),
SPARE
(
"spare"
,
"备件制造图"
),
OTHER
(
"other"
,
"其他"
),
;
...
...
src/main/webapp/HG/WD/HGWD001.js
View file @
2fcef0eb
...
...
@@ -320,8 +320,8 @@ $(function () {
if
(
e
.
button
!==
2
)
{
return
}
if
(
"
工程设计图"
===
e
.
target
.
textContent
||
"外来涉密图"
===
e
.
target
.
textContent
||
"
备件制造图"
===
e
.
target
.
textContent
||
"其他"
===
e
.
target
.
textContent
)
{
if
(
"
engineering"
===
e
.
target
.
title
||
"foreign"
===
e
.
target
.
title
||
"
spare"
===
e
.
target
.
title
||
"other"
===
e
.
target
.
title
)
{
$
(
"#isAdd"
).
css
(
'display'
,
'none'
);
$
(
"#isDel"
).
css
(
'display'
,
'none'
);
$
(
"#isEdit"
).
css
(
'display'
,
'none'
);
...
...
src/main/webapp/HG/WD/HGWD002A1.js
View file @
2fcef0eb
...
...
@@ -66,17 +66,18 @@ function previewFile(url, docType) {
previewExcel
(
url
);
}
else
if
(
isWord
(
docType
))
{
previewDocx
(
url
);
}
else
if
(
true
)
{
previewOnline
(
url
);
}
else
if
(
isText
(
docType
))
{
previewText
(
url
);
}
else
if
(
isImage
(
docType
))
{
previewImage
(
url
);
}
else
if
(
isFrame
(
docType
))
{
previewFrame
(
url
);
}
else
{
otherDownload
(
false
,
docId
);
previewOnline
(
url
);
}
// else if (isText(docType)) {
// previewText(url);
// } else if (isImage(docType)) {
// previewImage(url);
// } else if (isFrame(docType)) {
// previewFrame(url);
// } else {
// otherDownload(false, docId);
// }
}
/**
...
...
@@ -95,7 +96,7 @@ function hideHtml() {
/**
* 是否文本
*
* @param
fileNam
e
* @param
docTyp
e
* @returns {boolean}
*/
function
isText
(
docType
)
{
...
...
@@ -132,7 +133,7 @@ function previewText(docId) {
/**
* 是否文本
*
* @param
fileNam
e
* @param
docTyp
e
* @returns {boolean}
*/
function
isXml
(
docType
)
{
...
...
@@ -161,7 +162,7 @@ function previewXml(url) {
/**
* 是否excel
*
* @param
fileNam
e
* @param
docTyp
e
* @returns {boolean}
*/
function
isExcel
(
docType
)
{
...
...
@@ -210,7 +211,7 @@ function previewExcel(url) {
/**
* 是否WORD
*
* @param
fileNam
e
* @param
docTyp
e
* @returns {boolean}
*/
function
isWord
(
docType
)
{
...
...
@@ -241,7 +242,7 @@ function previewDocx(url) {
/**
* 判断是否是图片
*
* @param
fileNam
e
* @param
docTyp
e
* @returns {boolean}
*/
function
isImage
(
docType
)
{
...
...
@@ -263,12 +264,12 @@ function previewImage(docId) {
}
/**
*
判断是否frame
预览
*
PDF
预览
*
* @param
fileNam
e
* @param
docTyp
e
* @returns {boolean}
*/
function
is
Frame
(
docType
)
{
function
is
Pdf
(
docType
)
{
if
(
isBlank
(
docType
))
{
return
false
;
}
...
...
@@ -279,11 +280,13 @@ function isFrame(docType) {
/**
* frame预览
*
* @param
docId
* @param
url
*/
function
previewFrame
(
docId
)
{
function
previewFrame
(
url
)
{
// 替换地址中的file-download为file-preview
url
=
url
.
replace
(
"file-download"
,
"file-preview"
);
$
(
"#previewFrame"
).
css
(
'display'
,
''
);
$
(
"#previewFrame"
).
attr
(
"src"
,
downloadHref
(
docId
,
true
)
);
$
(
"#previewFrame"
).
attr
(
"src"
,
url
);
}
/**
...
...
@@ -363,6 +366,17 @@ let bigImage = null;
window
.
onload
=
function
()
{
// 监听iframe
// iframeLoad();
// 禁用鼠标右键
document
.
addEventListener
(
'contextmenu'
,
event
=>
event
.
preventDefault
());
document
.
addEventListener
(
'copy'
,
event
=>
event
.
preventDefault
());
// 图片预览初始化
// imageShowInit();
};
/**
* 图片预览初始化
*/
function
imageShowInit
(){
imageOuterDiv
=
document
.
querySelector
(
"#imageOuterDiv"
);
realImage
=
document
.
querySelector
(
"#image"
);
bigImage
=
document
.
querySelector
(
"#bigImage"
);
...
...
@@ -383,7 +397,7 @@ window.onload = function () {
// 拖转事件调用
imgDrag
();
});
}
;
}
/**
* 点击图片放大
...
...
src/main/webapp/common/js/common.js
View file @
2fcef0eb
...
...
@@ -671,10 +671,6 @@ function loadChange(grid,e,field) {
* @param url 文件URL
*/
let
previewFile
=
function
(
url
)
{
// let hostname = window.location.hostname;
// let domain = hostname === "localhost" ? "http://129.211.46.84:8085" : window.location.origin;
// let url = domain + IPLATUI.CONTEXT_PATH + '/file/download/preview/' + docId
// + "?fullfilename=";
// Base64转码
let
urlEncode
;
try
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment