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
3c230dce
Commit
3c230dce
authored
Oct 25, 2024
by
宋祥
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://129.211.46.84:8800/platform/hg-smart
into master-dc
parents
5a17a94f
a1e09350
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
29 deletions
+47
-29
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
No files found.
src/main/java/com/baosight/hggp/core/utils/Iplat4jUtils.java
View file @
3c230dce
...
...
@@ -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 @
3c230dce
...
...
@@ -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 @
3c230dce
...
...
@@ -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 @
3c230dce
...
...
@@ -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
();
});
}
;
}
/**
* 点击图片放大
...
...
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