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
171fa8d1
Commit
171fa8d1
authored
Oct 19, 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
7361fe07
e8ed80a2
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
291 additions
and
184 deletions
+291
-184
DaoUtils.java
src/main/java/com/baosight/hggp/core/dao/DaoUtils.java
+19
-22
ServiceHGSC101.java
.../java/com/baosight/hggp/hg/sc/service/ServiceHGSC101.java
+6
-1
ServiceHGWD001.java
.../java/com/baosight/hggp/hg/wd/service/ServiceHGWD001.java
+2
-34
ServiceHGWD001C.java
...java/com/baosight/hggp/hg/wd/service/ServiceHGWD001C.java
+61
-10
ServiceHGWD005.java
.../java/com/baosight/hggp/hg/wd/service/ServiceHGWD005.java
+7
-1
HGSC010.js
src/main/webapp/HG/SC/HGSC010.js
+51
-27
HGSC010.jsp
src/main/webapp/HG/SC/HGSC010.jsp
+0
-7
HGWD001.js
src/main/webapp/HG/WD/HGWD001.js
+1
-1
HGWD002.js
src/main/webapp/HG/WD/HGWD002.js
+63
-42
HGWD002.jsp
src/main/webapp/HG/WD/HGWD002.jsp
+1
-28
HGWD002A.jsp
src/main/webapp/HG/WD/HGWD002A.jsp
+4
-4
HGWD002A1.css
src/main/webapp/HG/WD/HGWD002A1.css
+0
-0
HGWD002A1.js
src/main/webapp/HG/WD/HGWD002A1.js
+22
-4
HGWD002A1.jsp
src/main/webapp/HG/WD/HGWD002A1.jsp
+34
-0
common.js
src/main/webapp/common/js/common.js
+20
-3
No files found.
src/main/java/com/baosight/hggp/core/dao/DaoUtils.java
View file @
171fa8d1
...
...
@@ -179,24 +179,23 @@ public class DaoUtils {
log
.
warn
(
"写入创建人姓名失败"
,
e
);
}
// 创建人企业编码
String
accountCode
=
UserSessionUtils
.
getAccountCode
();
if
(!
"admin"
.
equals
(
userId
))
{
AssertUtils
.
isEmpty
(
accountCode
,
"当前用户未绑定公司,无法操作数据,请联系管理员!"
);
}
try
{
String
accountCode
=
BeanUtils
.
getProperty
(
bean
,
"accountCode"
);
if
(
StringUtils
.
isBlank
(
accountCode
))
{
accountCode
=
UserSessionUtils
.
getAccountCode
();
AssertUtils
.
isEmpty
(
accountCode
,
"当前用户未绑定公司,无法操作数据,请联系管理员!"
);
}
BeanUtils
.
setProperty
(
bean
,
"accountCode"
,
accountCode
);
}
catch
(
Exception
e
)
{
log
.
warn
(
"写入创建人企业编码失败"
,
e
);
}
// 创建人组织机构
List
<
String
>
orgIds
=
UserSessionUtils
.
getOrgId
();
if
(!
"admin"
.
equals
(
userId
))
{
AssertUtils
.
isEmpty
(
orgIds
,
"当前用户未绑定部门,无法操作数据,请联系管理员!"
);
}
try
{
String
depCode
=
BeanUtils
.
getProperty
(
bean
,
"depCode"
);
if
(
StringUtils
.
isBlank
(
depCode
)
&&
!
"admin"
.
equals
(
userId
))
{
List
<
String
>
orgIds
=
UserSessionUtils
.
getOrgId
();
AssertUtils
.
isEmpty
(
orgIds
,
"当前用户未绑定部门,无法操作数据,请联系管理员!"
);
depCode
=
orgIds
.
get
(
0
);
}
// 此处应该不支持自定义部门,否则写入的部门信息不准确
String
depCode
=
CollectionUtils
.
isEmpty
(
orgIds
)
?
""
:
orgIds
.
get
(
0
);
BeanUtils
.
setProperty
(
bean
,
"depCode"
,
depCode
);
}
catch
(
Exception
e
)
{
log
.
warn
(
"写入创建人部门编码失败"
,
e
);
...
...
@@ -247,24 +246,22 @@ public class DaoUtils {
map
.
put
(
"createdName"
,
userName
);
map
.
put
(
"updatedName"
,
""
);
// 创建人企业编码
String
accountCode
=
UserSessionUtils
.
getAccountCode
();
if
(!
"admin"
.
equals
(
userId
))
{
AssertUtils
.
isEmpty
(
accountCode
,
"当前用户未绑定公司,无法操作数据,请联系管理员!"
);
}
try
{
String
accountCode
=
MapUtils
.
getString
(
map
,
"accountCode"
);
if
(
ObjectUtils
.
isNullBlank
(
accountCode
))
{
accountCode
=
UserSessionUtils
.
getAccountCode
();
AssertUtils
.
isEmpty
(
accountCode
,
"当前用户未绑定公司,无法操作数据,请联系管理员!"
);
}
map
.
put
(
"accountCode"
,
accountCode
);
}
catch
(
Exception
e
)
{
log
.
warn
(
"写入创建人企业编码失败"
,
e
);
}
// 创建人部门编码
List
<
String
>
orgIds
=
UserSessionUtils
.
getOrgId
();
if
(!
"admin"
.
equals
(
userId
))
{
AssertUtils
.
isEmpty
(
orgIds
,
"当前用户未绑定部门,无法操作数据,请联系管理员!"
);
}
try
{
String
depCode
=
MapUtils
.
getString
(
map
,
"depCode"
);
if
(
ObjectUtils
.
isNullBlank
(
depCode
)
&&
!
"admin"
.
equals
(
userId
))
{
List
<
String
>
orgIds
=
UserSessionUtils
.
getOrgId
();
AssertUtils
.
isEmpty
(
orgIds
,
"当前用户未绑定部门,无法操作数据,请联系管理员!"
);
depCode
=
orgIds
.
get
(
0
);
}
String
depCode
=
CollectionUtils
.
isEmpty
(
orgIds
)
?
""
:
orgIds
.
get
(
0
);
map
.
put
(
"depCode"
,
depCode
);
}
catch
(
Exception
e
)
{
log
.
warn
(
"写入创建人企业编码失败"
,
e
);
...
...
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC101.java
View file @
171fa8d1
package
com
.
baosight
.
hggp
.
hg
.
sc
.
service
;
import
com.baosight.hggp.core.dao.DaoBase
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.core.extapp.decheng.api.DcOpenApi
;
import
com.baosight.hggp.core.extapp.decheng.model.DcContract
;
...
...
@@ -207,7 +208,11 @@ public class ServiceHGSC101 extends ServiceEPBase {
// 设计来源
dbSc001
.
setProjectSource
(
getProjectSource
(
dcContract
.
getDesignSource
()));
dbSc001
.
setContractNo
(
dcContract
.
getHtid
());
DaoUtils
.
insert
(
HGSC001
.
INSERT
,
dbSc001
);
dbSc001
.
setRecCreator
(
"System"
);
dbSc001
.
setRecCreateTime
(
DateUtils
.
shortDateTime
());
dbSc001
.
setRecRevisor
(
"System"
);
dbSc001
.
setRecReviseTime
(
DateUtils
.
shortDateTime
());
DaoBase
.
getInstance
().
insert
(
HGSC001
.
INSERT
,
dbSc001
);
}
/**
...
...
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD001.java
View file @
171fa8d1
...
...
@@ -5,6 +5,7 @@ import com.baosight.hggp.common.ChangeTypeEnum;
import
com.baosight.hggp.common.DdynamicEnum
;
import
com.baosight.hggp.core.constant.CommonConstant
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.core.enums.DeleteFlagEnum
;
import
com.baosight.hggp.core.enums.OrgTypeEnum
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
import
com.baosight.hggp.core.tools.FileTools
;
...
...
@@ -16,6 +17,7 @@ import com.baosight.hggp.hg.wd.constant.HgWdConstant;
import
com.baosight.hggp.hg.wd.constant.HgWdSqlConstant
;
import
com.baosight.hggp.hg.wd.domain.HGWD001
;
import
com.baosight.hggp.hg.wd.domain.HGWD001A
;
import
com.baosight.hggp.hg.wd.domain.HGWD001C
;
import
com.baosight.hggp.hg.wd.domain.HGWD003
;
import
com.baosight.hggp.hg.wd.domain.HGWD099
;
import
com.baosight.hggp.hg.wd.tools.HGWDTools
;
...
...
@@ -586,38 +588,4 @@ public class ServiceHGWD001 extends ServiceEPBase {
return
inInfo
;
}
/**
* 批量下载
*
* @param inInfo
* @return
*/
public
EiInfo
batchDownload
(
EiInfo
inInfo
)
{
try
{
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
fileName
=
MapUtils
.
getString
(
queryMap
,
HGWD001
.
FIELD_FILE_NAME
);
String
zipName
=
fileName
+
"_"
+
DateUtils
.
shortDateTime
();
List
<
String
>
docIds
=
ObjectUtils
.
listKey
(
inInfo
,
HGWD099
.
FIELD_DOC_ID
);
inInfo
.
set
(
"downloadUrl"
,
Iplat4jUtils
.
compressFile
(
docIds
,
zipName
));
}
catch
(
Exception
e
)
{
LogUtils
.
setMsg
(
inInfo
,
e
,
"批量下载失败"
);
}
return
inInfo
;
}
/**
* 清理下载的文件
*
* @param inInfo
* @return
*/
public
EiInfo
clearDownload
(
EiInfo
inInfo
)
{
try
{
FileTools
.
clearZip
();
}
catch
(
Exception
e
)
{
LogUtils
.
setMsg
(
inInfo
,
e
,
"清理下载的文件失败"
);
}
return
inInfo
;
}
}
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD001C.java
View file @
171fa8d1
...
...
@@ -3,14 +3,20 @@ package com.baosight.hggp.hg.wd.service;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.core.enums.DeleteFlagEnum
;
import
com.baosight.hggp.core.tools.FileTools
;
import
com.baosight.hggp.core.utils.Iplat4jUtils
;
import
com.baosight.hggp.hg.cw.tools.HGCWTools
;
import
com.baosight.hggp.hg.wd.domain.HGWD001
;
import
com.baosight.hggp.hg.wd.domain.HGWD001C
;
import
com.baosight.hggp.hg.wd.domain.HGWD002
;
import
com.baosight.hggp.hg.wd.domain.HGWD099
;
import
com.baosight.hggp.hg.wd.tools.HGWDTools
;
import
com.baosight.hggp.util.AssertUtils
;
import
com.baosight.hggp.util.DateUtils
;
import
com.baosight.hggp.util.EiInfoUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.MapUtils
;
import
com.baosight.hggp.util.ObjectUtils
;
import
com.baosight.hggp.util.StringUtils
;
import
com.baosight.iplat4j.core.ei.EiBlock
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
...
...
@@ -91,16 +97,8 @@ public class ServiceHGWD001C extends ServiceBase {
*/
public
EiInfo
add
(
EiInfo
inInfo
)
{
try
{
List
<
HGWD001C
>
fWd001cs
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HGWD001C
.
class
);
for
(
HGWD001C
fWd001c
:
fWd001cs
)
{
AssertUtils
.
isEmpty
(
fWd001c
.
getFileId
(),
"文件ID不能为空"
);
// 下载记录+1
HGWDTools
.
HgWd099
.
downloadIncr
(
fWd001c
.
getDocId
());
// 新增
fWd001c
.
setDeleteFlag
(
DeleteFlagEnum
.
UN_REMOVE
.
getCode
());
DaoUtils
.
insert
(
HGWD001C
.
INSERT
,
fWd001c
);
}
inInfo
.
setStatus
(
EiConstant
.
STATUS_SUCCESS
);
// 写入下载记录
this
.
saveData
(
inInfo
);
inInfo
.
setMsg
(
"操作成功"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"操作失败"
);
...
...
@@ -108,4 +106,57 @@ public class ServiceHGWD001C extends ServiceBase {
return
inInfo
;
}
/**
* 批量下载
*
* @param inInfo
* @return
*/
public
EiInfo
batchDownload
(
EiInfo
inInfo
)
{
try
{
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
fileName
=
MapUtils
.
getString
(
queryMap
,
HGWD001
.
FIELD_FILE_NAME
);
String
zipName
=
fileName
+
"_"
+
DateUtils
.
shortDateTime
();
List
<
String
>
docIds
=
ObjectUtils
.
listKey
(
inInfo
,
HGWD099
.
FIELD_DOC_ID
);
inInfo
.
set
(
"downloadUrl"
,
Iplat4jUtils
.
compressFile
(
docIds
,
zipName
));
// 写入下载记录
this
.
saveData
(
inInfo
);
}
catch
(
Exception
e
)
{
LogUtils
.
setMsg
(
inInfo
,
e
,
"批量下载失败"
);
}
return
inInfo
;
}
/**
* 保存数据
*
* @param inInfo
*/
private
void
saveData
(
EiInfo
inInfo
)
{
List
<
HGWD001C
>
fWd001cs
=
MapUtils
.
toDaoEPBases
(
inInfo
,
HGWD001C
.
class
);
for
(
HGWD001C
fWd001c
:
fWd001cs
)
{
AssertUtils
.
isEmpty
(
fWd001c
.
getFileId
(),
"文件ID不能为空"
);
// 下载记录+1
HGWDTools
.
HgWd099
.
downloadIncr
(
fWd001c
.
getDocId
());
// 新增
fWd001c
.
setDeleteFlag
(
DeleteFlagEnum
.
UN_REMOVE
.
getCode
());
DaoUtils
.
insert
(
HGWD001C
.
INSERT
,
fWd001c
);
}
}
/**
* 清理下载的文件
*
* @param inInfo
* @return
*/
public
EiInfo
clearDownload
(
EiInfo
inInfo
)
{
try
{
FileTools
.
clearZip
();
}
catch
(
Exception
e
)
{
LogUtils
.
setMsg
(
inInfo
,
e
,
"清理下载的文件失败"
);
}
return
inInfo
;
}
}
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD005.java
View file @
171fa8d1
package
com
.
baosight
.
hggp
.
hg
.
wd
.
service
;
import
com.baosight.hggp.aspect.annotation.OperationLogAnnotation
;
import
com.baosight.hggp.core.dao.DaoBase
;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.core.enums.DeleteFlagEnum
;
import
com.baosight.hggp.core.extapp.decheng.api.DcOpenApi
;
...
...
@@ -16,6 +17,7 @@ import com.baosight.hggp.hg.sc.tools.HGSCTools;
import
com.baosight.hggp.hg.wd.domain.HGWD005
;
import
com.baosight.hggp.hg.wd.tools.HGWDTools
;
import
com.baosight.hggp.util.AssertUtils
;
import
com.baosight.hggp.util.DateUtils
;
import
com.baosight.hggp.util.EiInfoUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.MapUtils
;
...
...
@@ -143,7 +145,11 @@ public class ServiceHGWD005 extends ServiceEPBase {
dbWd005
.
setUnit
(
dcProductList
.
getUnit
());
dbWd005
.
setClassify
(
dcProductList
.
getFenlei
());
dbWd005
.
setDeleteFlag
(
DeleteFlagEnum
.
UN_REMOVE
.
getCode
());
DaoUtils
.
insert
(
HGWD005
.
INSERT
,
dbWd005
);
dbWd005
.
setRecCreator
(
"System"
);
dbWd005
.
setRecCreateTime
(
DateUtils
.
shortDateTime
());
dbWd005
.
setRecRevisor
(
"System"
);
dbWd005
.
setRecReviseTime
(
DateUtils
.
shortDateTime
());
DaoBase
.
getInstance
().
insert
(
HGWD005
.
INSERT
,
dbWd005
);
}
else
{
Map
updateMap
=
new
HashMap
();
updateMap
.
put
(
HGWD005
.
FIELD_ID
,
dbWd005
.
getId
());
...
...
src/main/webapp/HG/SC/HGSC010.js
View file @
171fa8d1
...
...
@@ -6,34 +6,35 @@ $(function () {
resultGrid
.
dataSource
.
page
(
1
);
});
IPLATUI
.
EFGrid
.
result
=
{
pageable
:
{
pageSize
:
20
,
pageSizes
:
[
10
,
20
,
50
,
70
,
100
],
},
columns
:
[
{
field
:
"operator"
,
template
:
function
(
item
)
{
let
template
=
''
;
if
(
item
.
companyCode
)
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showFunc(
\'
'
+
item
.
companyCode
+
'
\'
,
\'
'
+
item
.
companyName
+
'
\'
,
\'
'
+
item
.
id
+
'
\'
,
\'
'
+
item
.
contractCode
+
'
\'
)" >详情</a>'
;
}
return
template
;
}
},
{
field
:
"contractDate"
,
attributes
:
{
class
:
"i-input-readonly"
},
defaultValue
:
function
()
{
return
currShortDate
();
}
},
],
beforeEdit
:
function
(
e
)
{
pageable
:
{
pageSize
:
20
,
pageSizes
:
[
10
,
20
,
50
,
70
,
100
],
},
columns
:
[{
field
:
"operator"
,
template
:
function
(
item
)
{
let
params
=
"'"
+
item
.
companyCode
+
"', '"
+
item
.
companyName
+
"', '"
+
item
.
id
+
"', '"
+
item
.
contractCode
+
"'"
;
let
template
=
''
;
if
(
item
.
companyCode
)
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showFunc('
+
params
+
')" >详情</a>'
;
}
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showDoc('
+
params
+
')" >附件</a>'
;
return
template
;
}
},
{
field
:
"contractDate"
,
attributes
:
{
class
:
"i-input-readonly"
},
defaultValue
:
function
()
{
return
currShortDate
();
}
}],
beforeEdit
:
function
(
e
)
{
let
item
=
e
.
model
;
if
(
item
.
subStatus
==
'1'
){
e
.
preventDefault
();
...
...
@@ -177,4 +178,27 @@ function updateStatus() {
}
}
/**
* 展示附件
*
* @param contractCode
* @param companyName
* @param parentId
* @param contractCode
*/
let
showDoc
=
function
(
companyCode
,
companyName
,
parentId
,
contractCode
){
let
params
=
{
"inqu_status-0-companyCode"
:
companyCode
,
"inqu_status-0-companyName"
:
companyName
,
"inqu_status-0-parentId"
:
parentId
,
"inqu_status-0-contractCode"
:
contractCode
}
JSColorbox
.
open
({
href
:
"HGWD002"
,
title
:
"<div style='text-align: center;'>文档管理</div>"
,
width
:
"100%"
,
height
:
"100%"
,
params
:
params
});
}
src/main/webapp/HG/SC/HGSC010.jsp
View file @
171fa8d1
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/9/29
Time: 15:49
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<
%@
page
import=
"com.baosight.iplat4j.core.web.threadlocal.UserSession"
%
>
<
%@
page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%
>
...
...
src/main/webapp/HG/WD/HGWD001.js
View file @
171fa8d1
...
...
@@ -1066,7 +1066,7 @@ let batchDownload = function () {
message
(
"请先勾选要下载的数据!"
);
return
;
}
JSUtils
.
submitGridsData
(
"result"
,
"HGWD001"
,
"batchDownload"
,
false
,
JSUtils
.
submitGridsData
(
"result"
,
"HGWD001
C
"
,
"batchDownload"
,
false
,
function
(
res
)
{
if
(
res
.
status
>
-
1
)
{
window
.
open
(
res
.
extAttr
.
downloadUrl
,
'_blank'
);
...
...
src/main/webapp/HG/WD/HGWD002.js
View file @
171fa8d1
...
...
@@ -31,7 +31,7 @@ $(function () {
if
(
document
.
getElementById
(
"splitter"
).
getElementsByClassName
(
"k-splitbar"
).
length
!==
1
)
{
$
(
"#splitter"
).
kendoSplitter
({
panes
:
[
{
size
:
"
30%"
,
min
:
"25%"
,
max
:
"75
%"
,
collapsible
:
true
},
{
size
:
"
25%"
,
min
:
"20%"
,
max
:
"80
%"
,
collapsible
:
true
},
{},
{
collapsible
:
true
}
]
...
...
@@ -251,40 +251,6 @@ let showDownloadRecord = function (fileId, docId) {
}
/**
* 预览
*/
let
preview
=
function
()
{
let
url
=
"HGWD002A?inqu_status-0-fileId="
+
$
(
"#inqu_status-0-fileId"
).
val
();
window
.
open
(
url
,
'_blank'
);
}
/**
* 下载
*/
let
download
=
function
()
{
let
rows
=
resultGrid
.
getCheckedRows
();
if
(
rows
.
length
<
1
)
{
message
(
"请选择数据"
);
return
;
}
JSUtils
.
confirm
(
"确定对勾选中的["
+
rows
.
length
+
"]条数据做
\"
下载
\"
操作? "
,
{
ok
:
function
()
{
JSUtils
.
submitGridsData
(
"result"
,
"HGWD001C"
,
"add"
,
false
,
function
(
res
)
{
if
(
res
.
status
>
-
1
)
{
for
(
let
i
=
0
;
i
<
rows
.
length
;
i
++
)
{
window
.
open
(
downloadHref
(
rows
[
i
][
'docId'
]),
'_blank'
);
}
}
else
{
message
(
res
.
msg
);
}
}
);
}
});
}
/**
* 设置树节点的值
*
* @param nodeData
...
...
@@ -307,15 +273,23 @@ let showAuthButton = function () {
// C:目录
if
(
leafType
&&
leafType
>
0
)
{
$
(
"#PREVIEW"
).
attr
(
"disabled"
,
false
);
//
$("#DOWNLOAD").attr("disabled", false);
$
(
"#DOWNLOAD"
).
attr
(
"disabled"
,
false
);
}
else
{
$
(
"#PREVIEW"
).
attr
(
"disabled"
,
true
);
//
$("#DOWNLOAD").attr("disabled", true);
$
(
"#DOWNLOAD"
).
attr
(
"disabled"
,
true
);
}
}
/**
* 预览
*/
let
preview
=
function
()
{
let
url
=
"HGWD002A?inqu_status-0-fileId="
+
$
(
"#inqu_status-0-fileId"
).
val
();
window
.
open
(
url
,
'_blank'
);
}
/**
* 预览
*
* @param fileId
* @param docId
...
...
@@ -323,11 +297,57 @@ let showAuthButton = function () {
* @param docName
*/
let
showPreview
=
function
(
fileId
,
docId
,
docType
,
docName
)
{
if
(
isBlank
(
docId
))
{
message
(
"附件类型或ID不能为空"
);
addRecordWindow
(
fileId
,
docId
,
docType
,
docName
);
}
/**
* 下载
*/
let
download
=
function
()
{
let
rows
=
resultGrid
.
getCheckedRows
();
if
(
rows
.
length
==
0
)
{
message
(
"请先勾选要下载的数据!"
);
return
;
}
$
(
"#previewFile"
).
data
(
"kendoWindow"
).
center
();
$
(
"#previewFile"
).
data
(
"kendoWindow"
).
open
();
addRecord
(
fileId
,
docId
,
docType
,
docName
);
if
(
rows
.
length
==
1
)
{
singleDownload
(
rows
[
0
]);
}
else
{
batchDownload
();
}
}
/**
* 单个下载
*
* @param row
*/
let
singleDownload
=
function
(
row
)
{
let
inInfo
=
new
EiInfo
();
inInfo
.
set
(
"result-0-fileId"
,
row
[
'fileId'
]);
inInfo
.
set
(
"result-0-docId"
,
row
[
'docId'
]);
EiCommunicator
.
send
(
"HGWD001C"
,
"add"
,
inInfo
,
{
onSuccess
(
res
)
{
if
(
res
.
status
>
-
1
)
{
window
.
open
(
CommonUtils
.
downloadFile
(
row
[
'docId'
],
false
),
'_blank'
);
}
else
{
message
(
res
.
msg
);
}
}
},
{
async
:
false
})
}
/**
* 批量下载
*
* @param fileId
* @param docId
*/
let
batchDownload
=
function
()
{
JSUtils
.
submitGridsData
(
"result"
,
"HGWD001C"
,
"batchDownload"
,
false
,
function
(
res
)
{
if
(
res
.
status
>
-
1
)
{
window
.
open
(
res
.
extAttr
.
downloadUrl
,
'_blank'
);
}
}
);
}
\ No newline at end of file
src/main/webapp/HG/WD/HGWD002.jsp
View file @
171fa8d1
...
...
@@ -5,12 +5,6 @@
<c:set
var=
"ctx"
value=
"${pageContext.request.contextPath}"
/>
<script
src=
"${ctx}/common/docxjs/jszip.min.js"
></script>
<script
src=
"${ctx}/common/docxjs/docx-preview.js"
></script>
<script
src=
"${ctx}/common/js/xlsx.full.min.js"
></script>
<script
src=
"${ctx}/HG/WD/HGWD002A1.js"
></script>
<link
rel=
"stylesheet"
href=
"${ctx}/HG/WD/HGWD002A.css"
>
<EF:EFPage
title=
"文档浏览"
>
<div
id=
"splitter"
class=
"i-fit-height"
>
<div
id=
"left-pane"
class=
"i-fit-height"
>
...
...
@@ -72,25 +66,4 @@
</EF:EFPage>
<
%
--
预览文件
--
%
>
<EF:EFWindow
id=
"previewFile"
title=
"附件预览"
height=
"100%"
width=
"100%"
>
<div
id=
"descDiv"
class=
"center-flex"
>
<span
id=
"descSpan"
style=
"font-weight: bold;font-size: 18px"
>
附件预览区域...
</span>
</div>
<
%
--
文本预览
--
%
>
<div
id=
"textContainer"
class=
"left-flex"
style=
"display: none;"
>
<pre
id=
"textSpan"
class=
"textSpan"
></pre>
</div>
<
%
--
docx
文件预览
--
%
>
<div
id=
"docxContainer"
style=
"display: none;"
></div>
<
%
--
IMAGE
文件预览
--
%
>
<div
id=
"imageContainer"
class=
"left-flex"
style=
"display: none;"
>
<img
id=
"image"
src=
""
style=
"border: 1px solid gray;width: 100%;height: 100%;"
/>
</div>
<
%
--
other
--
%
>
<iframe
id=
"previewFrame"
src=
""
style=
"display: none;"
></iframe>
</EF:EFWindow>
<
%
--
图片放大区域
--
%
>
<div
id=
"imageOuterDiv"
class=
"imageOuterDiv"
>
<img
id=
"bigImage"
src=
""
/>
</div>
<jsp:include
page=
"HGWD002A1.jsp"
/>
src/main/webapp/HG/WD/HGWD002A.jsp
View file @
171fa8d1
...
...
@@ -9,12 +9,12 @@
<script
src=
"${ctx}/common/docxjs/docx-preview.js"
></script>
<script
src=
"${ctx}/common/js/xlsx.full.min.js"
></script>
<script
src=
"${ctx}/HG/WD/HGWD002A1.js"
></script>
<link
rel=
"stylesheet"
href=
"${ctx}/HG/WD/HGWD002A.css"
>
<EF:EFPage
title=
"
附件
预览"
>
<link
rel=
"stylesheet"
href=
"${ctx}/HG/WD/HGWD002A
1
.css"
>
<EF:EFPage
title=
"
文档
预览"
>
<div
class=
"row"
style=
"margin: 0 -10px;"
>
<div
class=
"col-md-3"
>
<EF:EFRegion
title=
"文
件
目录树"
id=
"tree"
fitHeight=
"true"
>
<EF:EFInput
ename=
"fileId"
cname=
"
文件
ID"
blockId=
"inqu_status"
row=
"0"
type=
"hidden"
/>
<EF:EFRegion
title=
"文
档
目录树"
id=
"tree"
fitHeight=
"true"
>
<EF:EFInput
ename=
"fileId"
cname=
"
目录
ID"
blockId=
"inqu_status"
row=
"0"
type=
"hidden"
/>
<EF:EFInput
ename=
"source"
cname=
"来源"
blockId=
"inqu_status"
row=
"0"
type=
"hidden"
/>
<div
id=
"menu"
style=
"margin-top: 12px; margin-bottom: 8px"
>
<EF:EFTree
bindId=
"docTree"
ename=
"node"
textField=
"text"
valueField=
"label"
hasChildren=
"leaf"
...
...
src/main/webapp/HG/WD/HGWD002A.css
→
src/main/webapp/HG/WD/HGWD002A
1
.css
View file @
171fa8d1
File moved
src/main/webapp/HG/WD/HGWD002A1.js
View file @
171fa8d1
/**
* 弹窗预览
*
* @param fileId
* @param docId
* @param docType
* @param docName
*/
function
addRecordWindow
(
fileId
,
docId
,
docType
,
docName
)
{
$
(
"#previewFile"
).
data
(
"kendoWindow"
).
center
();
$
(
"#previewFile"
).
data
(
"kendoWindow"
).
open
();
addRecord
(
fileId
,
docId
,
docType
,
docName
);
}
/**
* 新增预览记录
*
* @param fileId
* @param docId
* @param docType
*/
function
addRecord
(
fileId
,
docId
,
docType
,
docName
){
function
addRecord
(
fileId
,
docId
,
docType
,
docName
)
{
if
(
isBlank
(
docId
))
{
message
(
"附件类型或ID不能为空"
);
return
;
}
// 隐藏预览区域
hideHtml
();
IPLAT
.
progress
(
$
(
"body"
),
true
);
...
...
@@ -43,12 +61,12 @@ function previewFile(docId, docType, docName) {
$
(
"#descDiv"
).
css
(
'display'
,
'none'
);
if
(
isXml
(
docType
))
{
previewXml
(
docId
);
}
else
if
(
isExcel
(
docType
))
{
previewExcel
(
docId
);
}
else
if
(
true
)
{
previewOnline
(
docId
,
docName
);
}
else
if
(
isText
(
docType
))
{
previewText
(
docId
);
}
else
if
(
isExcel
(
docType
))
{
previewExcel
(
docId
);
}
else
if
(
isWord
(
docType
))
{
previewDocx
(
docId
);
}
else
if
(
isImage
(
docType
))
{
...
...
@@ -149,7 +167,7 @@ function isExcel(docType) {
if
(
isBlank
(
docType
))
{
return
false
;
}
const
extensions
=
[
'xls'
,
'xlsx'
];
const
extensions
=
[
'xls'
];
return
extensions
.
includes
(
docType
.
toLowerCase
());
}
...
...
src/main/webapp/HG/WD/HGWD002A1.jsp
0 → 100644
View file @
171fa8d1
<!DOCTYPE html>
<
%@
page
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"
%
>
<script
src=
"${ctx}/common/docxjs/jszip.min.js"
></script>
<script
src=
"${ctx}/common/docxjs/docx-preview.js"
></script>
<script
src=
"${ctx}/common/js/xlsx.full.min.js"
></script>
<script
src=
"${ctx}/HG/WD/HGWD002A1.js"
></script>
<link
rel=
"stylesheet"
href=
"${ctx}/HG/WD/HGWD002A1.css"
>
<
%
--
预览文件
--
%
>
<EF:EFWindow
id=
"previewFile"
title=
"附件预览"
height=
"100%"
width=
"100%"
>
<div
id=
"descDiv"
class=
"center-flex"
>
<span
id=
"descSpan"
style=
"font-weight: bold;font-size: 18px"
>
附件预览区域...
</span>
</div>
<
%
--
文本预览
--
%
>
<div
id=
"textContainer"
class=
"left-flex"
style=
"display: none;"
>
<pre
id=
"textSpan"
class=
"textSpan"
></pre>
</div>
<
%
--
docx
文件预览
--
%
>
<div
id=
"docxContainer"
style=
"display: none;"
></div>
<
%
--
IMAGE
文件预览
--
%
>
<div
id=
"imageContainer"
class=
"left-flex"
style=
"display: none;"
>
<img
id=
"image"
src=
""
style=
"border: 1px solid gray;width: 100%;height: 100%;"
/>
</div>
<
%
--
other
--
%
>
<iframe
id=
"previewFrame"
src=
""
style=
"display: none;"
></iframe>
</EF:EFWindow>
<
%
--
图片放大区域
--
%
>
<div
id=
"imageOuterDiv"
class=
"imageOuterDiv"
>
<img
id=
"bigImage"
src=
""
/>
</div>
\ No newline at end of file
src/main/webapp/common/js/common.js
View file @
171fa8d1
...
...
@@ -628,7 +628,7 @@ function loadChange(grid,e,field) {
*
* @param bizType
* @param bizId
* @param
* @param
callback
*/
let
uploadFile
=
function
(
bizType
,
bizId
,
callback
)
{
let
params
=
{
...
...
@@ -650,14 +650,30 @@ function loadChange(grid,e,field) {
}
/**
* 文件下载路径
*
* @param docId
* @param isPreview 是否预览,true:预览
* @returns {string}
*/
let
downloadFile
=
function
(
docId
,
isPreview
)
{
if
(
isPreview
)
{
return
IPLATUI
.
CONTEXT_PATH
+
'/file/download/preview/'
+
docId
;
}
else
{
// S3地址必须支持公网
return
IPLATUI
.
CONTEXT_PATH
+
'/file/download/'
+
docId
;
}
}
/**
* 预览
*
* @param docId 文件ID
* @param docName 文件名称必须带后缀
*/
function
previewFile
(
docId
,
docName
)
{
let
previewFile
=
function
(
docId
,
docName
)
{
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
+
"?fullfilename="
;
// Base64转码
...
...
@@ -683,6 +699,7 @@ function loadChange(grid,e,field) {
$
.
extend
(
window
,
{
CommonUtils
:
{
uploadFile
:
uploadFile
,
downloadFile
:
downloadFile
,
previewFile
:
previewFile
,
}
});
...
...
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