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
bc9119ef
Commit
bc9119ef
authored
Oct 12, 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
f49bd947
9a4be616
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
351 additions
and
57 deletions
+351
-57
HggpApplication.java
src/main/java/com/baosight/hggp/HggpApplication.java
+0
-1
FileTools.java
src/main/java/com/baosight/hggp/core/tools/FileTools.java
+37
-0
ServiceHGKC008.java
.../java/com/baosight/hggp/hg/kc/service/ServiceHGKC008.java
+1
-1
ServiceHGKC008A.java
...java/com/baosight/hggp/hg/kc/service/ServiceHGKC008A.java
+13
-8
ServiceHGKC008B.java
...java/com/baosight/hggp/hg/kc/service/ServiceHGKC008B.java
+2
-0
ServiceHGSC101A.java
...java/com/baosight/hggp/hg/sc/service/ServiceHGSC101A.java
+4
-0
HgWdSqlConstant.java
...ava/com/baosight/hggp/hg/wd/constant/HgWdSqlConstant.java
+2
-0
ServiceHGWD001.java
.../java/com/baosight/hggp/hg/wd/service/ServiceHGWD001.java
+16
-0
HGWD001.xml
src/main/java/com/baosight/hggp/hg/wd/sql/HGWD001.xml
+10
-0
ClearZipJob.java
src/main/java/com/baosight/hggp/job/ClearZipJob.java
+7
-15
HGKC008.js
src/main/webapp/HG/KC/HGKC008.js
+4
-2
HGKC008A.js
src/main/webapp/HG/KC/HGKC008A.js
+0
-3
HGKC008A.jsp
src/main/webapp/HG/KC/HGKC008A.jsp
+1
-0
HGKC008B.jsp
src/main/webapp/HG/KC/HGKC008B.jsp
+3
-0
HGWD002.jsp
src/main/webapp/HG/WD/HGWD002.jsp
+7
-9
HGWD002A.css
src/main/webapp/HG/WD/HGWD002A.css
+11
-0
HGWD002A.js
src/main/webapp/HG/WD/HGWD002A.js
+1
-1
HGWD002A.jsp
src/main/webapp/HG/WD/HGWD002A.jsp
+5
-7
HGWD002A1.js
src/main/webapp/HG/WD/HGWD002A1.js
+219
-3
XS40.js
src/main/webapp/XS/XS40.js
+2
-3
XS40.jsp
src/main/webapp/XS/XS40.jsp
+6
-4
No files found.
src/main/java/com/baosight/hggp/HggpApplication.java
View file @
bc9119ef
...
...
@@ -13,7 +13,6 @@ import org.springframework.context.annotation.ImportResource;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.web.multipart.commons.CommonsMultipartResolver
;
@EnableScheduling
@SpringBootApplication
(
scanBasePackages
=
"com.baosight"
)
@ServletComponentScan
(
"com.baosight.iplat4j.core.web.servlet"
)
@ImportResource
(
locations
=
{
"classpath*:spring/framework/platApplicationContext*.xml"
,
...
...
src/main/java/com/baosight/hggp/core/tools/FileTools.java
0 → 100644
View file @
bc9119ef
package
com
.
baosight
.
hggp
.
core
.
tools
;
import
com.baosight.hggp.core.constant.OSConstant
;
import
com.baosight.hggp.util.DateUtils
;
import
com.baosight.hggp.util.FileUtils
;
import
java.io.File
;
import
java.time.LocalDate
;
import
lombok.extern.slf4j.Slf4j
;
/**
* @author:songx
* @date:2024/10/12,10:27
*/
@Slf4j
public
class
FileTools
{
/**
* 清理ZIP文件
*/
public
static
void
clearZip
()
{
File
zipFolder
=
new
File
(
OSConstant
.
ZIP_DIR
);
File
[]
zipFolderFiles
=
zipFolder
.
listFiles
();
if
(
zipFolderFiles
.
length
==
0
)
{
log
.
warn
(
"清理ZIP文件:无有效的文件"
);
}
for
(
File
zipFolderFile
:
zipFolderFiles
)
{
String
folderName
=
zipFolderFile
.
getName
();
// 当天以前的文件夹全部删除
if
(
LocalDate
.
parse
(
folderName
,
DateUtils
.
SHORT_DATE
).
isBefore
(
LocalDate
.
now
()))
{
FileUtils
.
deleteFiles
(
zipFolderFile
);
}
}
log
.
info
(
"清理ZIP文件成功!!!"
);
}
}
src/main/java/com/baosight/hggp/hg/kc/service/ServiceHGKC008.java
View file @
bc9119ef
...
...
@@ -193,7 +193,7 @@ public class ServiceHGKC008 extends ServiceBase {
//查看是否能获取到账期,获取不到就提示
HGKC008
getKc008
=
HGKCTools
.
HgKc008
.
getById
(
hgkc008
.
getId
());
HGCWTools
.
HgCw001
.
getAccountPeriod
(
getKc008
.
getCompanyCode
(),
getKc008
.
getReceiptDate
());
DaoUtils
.
update
(
HGKC008
.
UPDATE_STATUS
,
hgkc008
);
DaoUtils
.
update
(
HGKC008
.
UPDATE_STATUS
,
hgkc008
.
toMap
()
);
}
List
<
HGKC008A
>
hgkc008AList
=
HGKCTools
.
HgKc008A
.
getHgkc008aList
(
hgkc008
.
getId
());
if
(!
CollectionUtils
.
isEmpty
(
hgkc008AList
)){
...
...
src/main/java/com/baosight/hggp/hg/kc/service/ServiceHGKC008A.java
View file @
bc9119ef
...
...
@@ -16,11 +16,13 @@ import com.baosight.hggp.util.CommonMethod;
import
com.baosight.hggp.util.EiInfoUtils
;
import
com.baosight.hggp.util.LogUtils
;
import
com.baosight.hggp.util.MapUtils
;
import
com.baosight.hggp.util.StringUtils
;
import
com.baosight.hggp.util.contants.ACConstants
;
import
com.baosight.iplat4j.core.ei.EiConstant
;
import
com.baosight.iplat4j.core.ei.EiInfo
;
import
com.baosight.iplat4j.core.exception.PlatException
;
import
com.baosight.iplat4j.core.service.impl.ServiceBase
;
import
com.baosight.iplat4j.ed.util.SequenceGenerator
;
import
java.math.BigDecimal
;
import
java.util.Arrays
;
...
...
@@ -71,7 +73,6 @@ public class ServiceHGKC008A extends ServiceBase {
public
EiInfo
query
(
EiInfo
inInfo
)
{
try
{
inInfo
=
super
.
query
(
inInfo
,
HGKC008A
.
QUERY
,
new
HGKC008A
());
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
}
catch
(
PlatException
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"查询失败"
);
}
...
...
@@ -128,9 +129,8 @@ public class ServiceHGKC008A extends ServiceBase {
*/
public
EiInfo
save
(
EiInfo
inInfo
)
{
try
{
// 查询领料单
Map
queryMap
=
EiInfoUtils
.
getFirstRow
(
inInfo
);
String
applyCode
=
MapUtils
.
getString
(
queryMap
,
HGKC008A
.
FIELD_
RECEIVE_ID
);
String
applyCode
=
MapUtils
.
getString
(
queryMap
,
HGKC008A
.
FIELD_
APPLY_CODE
);
HGKC008
dbKc008
=
HGKCTools
.
HgKc008
.
getByApplyCode
(
applyCode
);
AssertUtils
.
isNull
(
dbKc008
,
String
.
format
(
"领料单【%s】不存在"
,
applyCode
));
AssertUtils
.
isNotEquals
(
HgKcConst
.
HgKc008
.
Status
.
S0
,
dbKc008
.
getStatus
(),
...
...
@@ -141,8 +141,8 @@ public class ServiceHGKC008A extends ServiceBase {
// 数据校验
this
.
checkSaveData
(
dbKc008
,
fKc008As
,
dbKc008AMap
);
this
.
setData
(
dbKc008
,
fKc008As
);
inInfo
.
setStatus
(
EiConstant
.
STATUS_DEFAULT
);
inInfo
.
setMsg
(
"保存成功!"
);
inInfo
=
this
.
query
(
inInfo
);
inInfo
.
setMsg
(
"
操作成功!本次对["
+
fKc008As
.
size
()
+
"]条数据
保存成功!"
);
}
catch
(
Exception
e
)
{
LogUtils
.
setDetailMsg
(
inInfo
,
e
,
"保存失败"
);
}
...
...
@@ -166,6 +166,9 @@ public class ServiceHGKC008A extends ServiceBase {
if
(
Objects
.
nonNull
(
fKc008A
.
getId
())
&&
fKc008A
.
getId
()
!=
0
)
{
DaoUtils
.
update
(
HGKC008A
.
UPDATE
,
fKc008A
);
}
else
{
fKc008A
.
setApplyCode
(
dbKc008
.
getApplyCode
());
fKc008A
.
setApplyLineCode
(
SequenceGenerator
.
getNextSequence
(
HGConstant
.
SequenceId
.
SC_APPLY_LINE_CODE
,
new
String
[]{
dbKc008
.
getApplyCode
()}));
DaoUtils
.
insert
(
HGKC008A
.
INSERT
,
fKc008A
);
}
if
(
dbKc008
.
getReceiveType
().
compareTo
(
HGConstant
.
ReceiveType
.
DEFAULT
)
==
0
)
{
...
...
@@ -190,7 +193,7 @@ public class ServiceHGKC008A extends ServiceBase {
private
void
checkSaveData
(
HGKC008
dbKc008
,
List
<
HGKC008A
>
fKc008As
,
Map
<
String
,
HGKC008A
>
dbKc008AMap
)
{
for
(
HGKC008A
fKc008A
:
fKc008As
)
{
String
applyLineCode
=
fKc008A
.
getApplyLineCode
();
HGKC008A
dbKc008A
=
dbKc008AMap
.
get
(
applyLineCode
);
HGKC008A
dbKc008A
=
StringUtils
.
isBlank
(
applyLineCode
)
?
null
:
dbKc008AMap
.
get
(
applyLineCode
);
this
.
checkData
(
applyLineCode
,
dbKc008A
);
AssertUtils
.
isGe
(
BigDecimal
.
ZERO
,
fKc008A
.
getInvWeight
(),
"重量必须大于0"
);
if
(
Objects
.
nonNull
(
fKc008A
.
getId
())
&&
fKc008A
.
getId
()
!=
0
)
{
...
...
@@ -212,11 +215,13 @@ public class ServiceHGKC008A extends ServiceBase {
* @param dbKc008A
*/
private
void
checkData
(
String
applyLineCode
,
HGKC008A
dbKc008A
)
{
AssertUtils
.
isNull
(
dbKc008A
,
String
.
format
(
"领料单行【%s】不存在"
,
applyLineCode
));
if
(
dbKc008A
==
null
)
{
return
;
}
AssertUtils
.
isNotEquals
(
CommonConstant
.
YesNo
.
NO_0
,
dbKc008A
.
getDeleteFlag
(),
String
.
format
(
"领料单行【%s】不是\"未删除\"状态,不允许操作"
,
applyLineCode
));
AssertUtils
.
isNotEquals
(
HgKcConst
.
HgKc008
.
Status
.
S0
,
dbKc008A
.
getStatus
(),
String
.
format
(
"领料单行【%s】不是\"未提交\"状态,不允许操作"
,
applyLineCode
));
}
}
}
src/main/java/com/baosight/hggp/hg/kc/service/ServiceHGKC008B.java
View file @
bc9119ef
...
...
@@ -140,6 +140,8 @@ public class ServiceHGKC008B extends ServiceBase {
newKc008A
.
setInvSpec
(
dbKc010
.
getSpec
());
newKc008A
.
setInvSpecId
(
dbKc010
.
getSpecId
());
newKc008A
.
setDeleteFlag
(
DeleteFlagEnum
.
UN_REMOVE
.
getCode
());
newKc008A
.
setAccountCode
(
""
);
newKc008A
.
setDepCode
(
""
);
DaoUtils
.
insert
(
HGKC008A
.
INSERT
,
newKc008A
);
}
}
...
...
src/main/java/com/baosight/hggp/hg/sc/service/ServiceHGSC101A.java
View file @
bc9119ef
...
...
@@ -6,6 +6,8 @@ import com.baosight.hggp.hg.constant.HGConstant;
import
com.baosight.hggp.hg.sc.constant.HgScSqlConstant
;
import
com.baosight.hggp.hg.sc.domain.HGSC001
;
import
com.baosight.hggp.hg.sc.tools.HGSCTools
;
import
com.baosight.hggp.hg.wd.constant.HgWdSqlConstant
;
import
com.baosight.hggp.hg.wd.tools.HGWDTools
;
import
com.baosight.hggp.util.AssertUtils
;
import
com.baosight.hggp.util.CommonMethod
;
import
com.baosight.hggp.util.EiInfoUtils
;
...
...
@@ -100,6 +102,8 @@ public class ServiceHGSC101A extends ServiceEPBase {
private
void
modifyData
(
HGSC001
fSc001
)
{
Map
map
=
fSc001
.
toMap
();
DaoUtils
.
update
(
HgScSqlConstant
.
HgSc001
.
UPDATE_FOR_DC
,
map
);
// 同步更新文档库
DaoUtils
.
update
(
HgWdSqlConstant
.
HgWd001
.
UPDATE_PROJECT
,
map
);
}
/**
...
...
src/main/java/com/baosight/hggp/hg/wd/constant/HgWdSqlConstant.java
View file @
bc9119ef
...
...
@@ -20,6 +20,8 @@ public class HgWdSqlConstant {
public
static
final
String
COUNT_BY_TYPE
=
"HGWD001.countByType"
;
// 搜索树节点
public
static
final
String
SEARCH_TREE_NODE
=
"HGWD001.searchTreeNode"
;
// 修改项目
public
static
final
String
UPDATE_PROJECT
=
"HGWD001.updateProject"
;
}
/**
...
...
src/main/java/com/baosight/hggp/hg/wd/service/ServiceHGWD001.java
View file @
bc9119ef
...
...
@@ -7,6 +7,7 @@ import com.baosight.hggp.core.constant.CommonConstant;
import
com.baosight.hggp.core.dao.DaoUtils
;
import
com.baosight.hggp.core.enums.OrgTypeEnum
;
import
com.baosight.hggp.core.security.UserSessionUtils
;
import
com.baosight.hggp.core.tools.FileTools
;
import
com.baosight.hggp.core.tools.Iplat4jTools
;
import
com.baosight.hggp.core.utils.Iplat4jUtils
;
import
com.baosight.hggp.hg.constant.HGConstant
;
...
...
@@ -581,4 +582,19 @@ public class ServiceHGWD001 extends ServiceEPBase {
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/sql/HGWD001.xml
View file @
bc9119ef
...
...
@@ -360,4 +360,14 @@
ORDER BY T3.FILE_ID ASC
</select>
<!-- 修改项目信息 -->
<update
id=
"updateProject"
>
UPDATE ${hggpSchema}.HGWD001
SET
PROJ_NAME = #projName#,
PROJ_TYPE = #projType#,
<include
refid=
"SqlBase.updateRevise"
/>
WHERE PROJ_CODE = #projCode#
</update>
</sqlMap>
src/main/java/com/baosight/hggp/job/ClearZipJob.java
View file @
bc9119ef
package
com
.
baosight
.
hggp
.
job
;
import
com.baosight.hggp.core.constant.OSConstant
;
import
com.baosight.hggp.core.tools.FileTools
;
import
com.baosight.hggp.util.DateUtil
;
import
com.baosight.hggp.util.DateUtils
;
import
com.baosight.hggp.util.FileUtils
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
import
org.springframework.scheduling.annotation.Scheduled
;
import
org.springframework.stereotype.Component
;
...
...
@@ -17,28 +20,17 @@ import lombok.extern.slf4j.Slf4j;
* @date:2024/10/11,12:26
*/
@Slf4j
@Component
@Configuration
@EnableScheduling
public
class
ClearZipJob
{
/**
* 清理ZIP文件
*/
@Scheduled
(
cron
=
"0
15 3 * * ?
"
)
@Scheduled
(
cron
=
"0
45 0/3 * * ?
"
)
public
void
clearZipFile
()
{
try
{
File
zipFolder
=
new
File
(
OSConstant
.
ZIP_DIR
);
File
[]
zipFolderFiles
=
zipFolder
.
listFiles
();
if
(
zipFolderFiles
.
length
==
0
)
{
log
.
warn
(
"清理ZIP文件:无有效的文件"
);
}
for
(
File
zipFolderFile
:
zipFolderFiles
)
{
String
folderName
=
zipFolderFile
.
getName
();
// 当天以前的文件夹全部删除
if
(
LocalDate
.
parse
(
folderName
,
DateUtils
.
SHORT_DATE
).
isBefore
(
LocalDate
.
now
()))
{
FileUtils
.
deleteFiles
(
zipFolderFile
);
}
}
log
.
info
(
"清理ZIP文件成功!!!"
);
FileTools
.
clearZip
();
}
catch
(
Exception
e
)
{
log
.
error
(
"清理ZIP文件失败:{}"
,
e
.
getMessage
(),
e
);
}
...
...
src/main/webapp/HG/KC/HGKC008.js
View file @
bc9119ef
...
...
@@ -31,7 +31,8 @@ $(function (){
if
(
item
.
id
)
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="showDetail('
+
item
.
id
+
',
\'
'
+
item
.
whCode
+
'
\'
,
\'
'
+
item
.
companyCode
+
'
\'
,
\'
'
+
item
.
status
+
'
\'
)" >领料详情</a>'
;
+
item
.
companyCode
+
'
\'
,
\'
'
+
item
.
status
+
'
\'
,
\'
'
+
item
.
applyCode
+
'
\'
)" >领料详情</a>'
;
if
(
status
==
0
)
{
template
+=
'<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+
'onclick="updateStatus('
+
item
.
id
+
',1)" >提交</a>'
;
...
...
@@ -267,9 +268,10 @@ function updateStatus(id,status) {
/**
* 显示详情
*/
function
showDetail
(
id
,
whCode
,
companyCode
,
status
)
{
function
showDetail
(
id
,
whCode
,
companyCode
,
status
,
applyCode
)
{
let
params
=
{
"inqu_status-0-receiveId"
:
id
,
"inqu_status-0-applyCode"
:
applyCode
,
}
JSColorbox
.
open
({
href
:
"HGKC008A"
,
...
...
src/main/webapp/HG/KC/HGKC008A.js
View file @
bc9119ef
...
...
@@ -128,9 +128,6 @@ $(function (){
//deleteFunc();
},
onSuccess
:
function
(
e
)
{
if
(
e
.
eiInfo
.
extAttr
.
methodName
==
'save'
||
e
.
eiInfo
.
extAttr
.
methodName
==
'delete'
)
{
query
();
}
},
onRowClick
:
function
(
e
)
{
//选中
...
...
src/main/webapp/HG/KC/HGKC008A.jsp
View file @
bc9119ef
...
...
@@ -12,6 +12,7 @@
<EF:EFInput
ename=
"main-0-applyCode"
cname=
"领料单号"
colWidth=
"3"
type=
"hidden"
/>
<EF:EFInput
ename=
"main-0-status"
cname=
"状态"
colWidth=
"3"
type=
"hidden"
/>
<EF:EFRegion
id=
"inqu"
title=
"查询条件"
>
<EF:EFInput
ename=
"inqu_status-0-applyCode"
cname=
"申请编码"
colWidth=
"3"
type=
"hidden"
/>
<EF:EFInput
ename=
"inqu_status-0-receiveId"
cname=
"领料单id"
colWidth=
"3"
type=
"hidden"
/>
<EF:EFInput
ename=
"inqu_status-0-whCode"
cname=
"仓库编码"
colWidth=
"3"
type=
"hidden"
/>
<EF:EFInput
ename=
"inqu_status-0-companyCode"
cname=
"公司编码"
colWidth=
"3"
type=
"hidden"
/>
...
...
src/main/webapp/HG/KC/HGKC008B.jsp
View file @
bc9119ef
...
...
@@ -45,6 +45,9 @@
<EF:EFColumn
ename=
"invWeight"
cname=
"库存总重(KG)"
enable=
"false"
width=
"120"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"material"
cname=
"材质"
enable=
"false"
width=
"80"
align=
"center"
/>
<EF:EFColumn
ename=
"unit"
cname=
"单位"
enable=
"false"
width=
"80"
align=
"center"
/>
<EF:EFColumn
ename=
"length"
cname=
"长(MM)"
width=
"80"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"width"
cname=
"宽(MM)"
width=
"80"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"thick"
cname=
"厚(MM)"
width=
"80"
align=
"right"
format=
"{0:N3}"
/>
<EF:EFColumn
ename=
"createdName"
cname=
"创建人"
enable=
"false"
width=
"100"
align=
"center"
/>
<EF:EFColumn
ename=
"createdTime"
cname=
"创建时刻"
enable=
"false"
width=
"140"
align=
"center"
editType=
"datetime"
parseFormats=
"['yyyyMMddHHmmss']"
/>
...
...
src/main/webapp/HG/WD/HGWD002.jsp
View file @
bc9119ef
...
...
@@ -61,8 +61,8 @@
<EF:EFColumn
ename=
"updatedTime"
cname=
"上传时间"
parseFormats=
"['yyyyMMddHHmmss']"
editType=
"datetime"
dateFormat=
"yyyy-MM-dd HH:mm:ss"
align=
"center"
width=
"140"
readonly=
"true"
required=
"false"
enable=
"false"
sort=
"true"
/>
<EF:EFColumn
ename=
"previewNum"
cname=
"预览次数"
enable=
"false"
width=
"100"
align=
"right"
sort=
"true"
/
>
<EF:EFColumn
ename=
"downloadNum"
cname=
"下载次数"
enable=
"false"
width=
"100"
align=
"right"
sort=
"true"
/
>
<
%
--
<
EF:EFColumn
ename=
"previewNum"
cname=
"预览次数"
enable=
"false"
width=
"100"
align=
"right"
sort=
"true"
/>
--%
>
<
%
--
<
EF:EFColumn
ename=
"downloadNum"
cname=
"下载次数"
enable=
"false"
width=
"100"
align=
"right"
sort=
"true"
/>
--%
>
</EF:EFGrid>
</EF:EFRegion>
</div>
...
...
@@ -83,14 +83,12 @@
<div
id=
"docxContainer"
style=
"display: none;"
></div>
<
%
--
IMAGE
文件预览
--
%
>
<div
id=
"imageContainer"
class=
"left-flex"
style=
"display: none;"
>
<
%
--
<
div
class=
"wide-div"
>
--%>
<img
id=
"image"
src=
""
style=
"border: 1px solid gray;"
/>
<
%
--
</
div
>
--%>
<
%
--
<
div
class=
"narrow-div"
>
--%>
<
%
--
<
input
type=
"range"
id=
"zoom-slider"
class=
"zoom-slider"
min=
"10"
max=
"300"
value=
"100"
--
%
>
<
%
--
oninput=
"zoomImage(this.value)"
>
--%>
<
%
--
</
div
>
--%>
<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>
src/main/webapp/HG/WD/HGWD002A.css
View file @
bc9119ef
...
...
@@ -43,3 +43,14 @@ img:hover {
.textSpan
table
td
{
border
:
1px
solid
black
;
}
.imageOuterDiv
{
position
:
fixed
;
top
:
0
;
left
:
0
;
background
:
rgba
(
0
,
0
,
0
,
0.7
);
z-index
:
9999999
;
width
:
100%
;
height
:
100%
;
display
:
none
;
}
src/main/webapp/HG/WD/HGWD002A.js
View file @
bc9119ef
...
...
@@ -52,7 +52,7 @@ $(function () {
*/
$
(
window
).
load
(
function
()
{
// 鼠标滚动
imageMouseListener
();
//
imageMouseListener();
});
/**
...
...
src/main/webapp/HG/WD/HGWD002A.jsp
View file @
bc9119ef
...
...
@@ -36,13 +36,7 @@
<div
id=
"docxContainer"
style=
"display: none;"
></div>
<
%
--
IMAGE
文件预览
--
%
>
<div
id=
"imageContainer"
class=
"left-flex"
style=
"display: none;"
>
<
%
--
<
div
class=
"wide-div"
>
--%>
<img
id=
"image"
src=
""
style=
"border: 1px solid gray;"
/>
<
%
--
</
div
>
--%>
<
%
--
<
div
class=
"narrow-div"
>
--%>
<
%
--
<
input
type=
"range"
id=
"zoom-slider"
class=
"zoom-slider"
min=
"10"
max=
"300"
value=
"100"
--
%
>
<
%
--
oninput=
"zoomImage(this.value)"
>
--%>
<
%
--
</
div
>
--%>
<img
id=
"image"
src=
""
style=
"border: 1px solid gray;width: 100%;height: 100%;"
/>
</div>
<
%
--
other
--
%
>
<iframe
id=
"previewFrame"
src=
""
style=
"display: none;"
></iframe>
...
...
@@ -50,3 +44,7 @@
</div>
</div>
</EF:EFPage>
<
%
--
图片放大区域
--
%
>
<div
id=
"imageOuterDiv"
class=
"imageOuterDiv"
>
<img
id=
"bigImage"
src=
""
/>
</div>
src/main/webapp/HG/WD/HGWD002A1.js
View file @
bc9119ef
...
...
@@ -49,7 +49,7 @@ function previewFile(docId, docType) {
}
else
if
(
isWord
(
docType
))
{
previewDocx
(
docId
);
}
else
if
(
isImage
(
docType
))
{
preview
Fram
e
(
docId
);
preview
Imag
e
(
docId
);
}
else
if
(
isFrame
(
docType
))
{
previewFrame
(
docId
);
}
else
{
...
...
@@ -96,8 +96,13 @@ function previewText(docId) {
let
container
=
document
.
getElementById
(
"textContainer"
);
container
.
style
.
display
=
'block'
;
// 使用new TextDecoder()指定编码
// const utf8Decoder = new TextDecoder('UTF-8', {ignoreBOM: true});
// const decodedText = utf8Decoder.decode(arrayBuffer);
// let textDecoder;
// try {
// textDecoder = new TextDecoder('GBK', {ignoreBOM: true});
// } catch (e) {
// textDecoder = new TextDecoder('UTF-8', {ignoreBOM: true});
// }
// let dataDecoder = textDecoder.decode(data);
$
(
"#textSpan"
).
text
(
data
);
});
}
...
...
@@ -277,3 +282,214 @@ function otherDownload(isRoot, docId) {
// + "' target='_blank'>下载</a>");
}
}
/**
* 实现图片点击放大、拖拽、滚轴滚动焦点缩放功能,相关参数、函数声明
*/
let
imgWidth
,
imgHeight
;
// 图片点击放大初始尺寸参数
let
maxZoom
=
4
;
//最大缩放倍数
let
minReduce
=
0.5
;
// 最小缩放倍数
let
initScale
=
1
;
//滚动缩放初始倍数,并不是图片点击放大的倍数
let
isPointerdown
=
false
;
//鼠标按下的标识
//记录鼠标按下坐标和按下移动时坐标
let
lastPointermove
=
{
x
:
0
,
y
:
0
,
};
//移动过程从上一个坐标到下一个坐标之间的差值
let
diff
=
{
x
:
0
,
y
:
0
,
};
//图片放大后左上角的坐标,主要结合diff参数用于鼠标焦点缩放时图片偏移坐标
let
x
=
0
;
let
y
=
0
;
// 记录节点
let
imageOuterDiv
=
null
;
let
realImage
=
null
;
let
bigImage
=
null
;
window
.
onload
=
function
()
{
imageOuterDiv
=
document
.
querySelector
(
"#imageOuterDiv"
);
realImage
=
document
.
querySelector
(
"#image"
);
bigImage
=
document
.
querySelector
(
"#bigImage"
);
// 添加事件监听器来拦截右键点击事件
document
.
addEventListener
(
'contextmenu'
,
function
(
e
)
{
// 阻止默认的右键菜单
e
.
preventDefault
();
});
document
.
getElementById
(
"image"
).
addEventListener
(
"click"
,
(
e
)
=>
{
const
that
=
e
.
target
;
bigImage
.
style
.
transform
=
"scale(1)"
;
// 图片放大展示函数调用
clickImageShow
(
that
);
// 监听鼠标滚动事件
window
.
addEventListener
(
"wheel"
,
handleStopWheel
,
{
passive
:
false
,
});
// 拖转事件调用
imgDrag
();
});
};
/**
* 点击图片放大
*/
function
clickImageShow
(
that
)
{
let
src
=
that
.
getAttribute
(
"src"
);
fetch
(
src
).
then
(
response
=>
{
if
(
!
response
.
ok
)
{
throw
new
Error
(
'Network response was not ok '
+
response
.
statusText
);
}
return
response
.
blob
();
}).
then
(
blob
=>
{
// 创建一个指向Blob的URL
bigImage
.
setAttribute
(
"src"
,
URL
.
createObjectURL
(
blob
));
// 展示大图
imageShow
();
}).
catch
(
error
=>
{
console
.
error
(
'There has been a problem with your fetch operation:'
,
error
);
});
}
/**
* 放大图片展示
*/
function
imageShow
()
{
// 设置尺寸和调整比例
let
windowW
=
document
.
documentElement
.
clientWidth
;
let
windowH
=
document
.
documentElement
.
clientHeight
;
let
realWidth
=
realImage
.
naturalWidth
;
//获取图片的原始宽度
let
realHeight
=
realImage
.
naturalHeight
;
//获取图片的原始高度
let
outsideScale
=
0.8
;
let
belowScale
=
1.4
;
let
realRatio
=
realWidth
/
realHeight
;
let
windowRatio
=
windowW
/
windowH
;
// 说明:下面是我自己的一些判断逻辑,大致意思就是图片的真实尺寸大于屏幕尺寸则使用屏幕尺寸,如果小于屏幕尺寸就使用自己本身的尺寸;并根据大于或者小于的比例对图片的尺寸进一步调整。coder可以根据自己的要求进行修改。
if
(
realRatio
>=
windowRatio
)
{
if
(
realWidth
>
windowW
)
{
imgWidth
=
windowH
*
outsideScale
;
imgHeight
=
(
imgWidth
/
realWidth
)
*
realHeight
;
}
else
{
if
(
realWidth
*
belowScale
<
windowW
)
{
imgWidth
=
realWidth
*
(
belowScale
-
0.2
);
imgHeight
=
(
imgWidth
/
realWidth
)
*
realHeight
;
}
else
{
imgWidth
=
realWidth
;
imgHeight
=
realHeight
;
}
}
}
else
{
if
(
realHeight
>
windowH
)
{
imgHeight
=
windowH
*
outsideScale
;
imgWidth
=
(
imgHeight
/
realHeight
)
*
realWidth
;
}
else
{
if
(
realHeight
*
belowScale
<
windowW
)
{
imgHeight
=
realHeight
*
(
belowScale
-
0.2
);
imgWidth
=
(
imgHeight
/
realHeight
)
*
realWidth
;
}
else
{
imgWidth
=
realWidth
;
imgHeight
=
realHeight
;
}
}
}
//设置放大图片的尺寸、偏移量并展示
bigImage
.
style
.
width
=
imgWidth
+
"px"
;
bigImage
.
style
.
height
=
imgHeight
+
"px"
;
x
=
(
windowW
-
imgWidth
)
*
0.5
;
y
=
(
windowH
-
imgHeight
)
*
0.5
;
bigImage
.
style
.
transform
=
`translate3d(
${
x
}
px,
${
y
}
px, 0)`
;
imageOuterDiv
.
style
.
display
=
"block"
;
// 点击蒙版及外面区域放大图片关闭
imageOuterDiv
.
onclick
=
()
=>
{
imageOuterDiv
.
style
.
display
=
"none"
;
initScale
=
1
;
window
.
removeEventListener
(
"wheel"
,
handleStopWheel
);
};
// 阻止事件冒泡
bigImage
.
onclick
=
(
e
)
=>
{
e
.
stopPropagation
();
};
}
/**
* 鼠标滚轮
*
* @param e
*/
function
handleStopWheel
(
e
)
{
let
itemSizeChange
=
1.1
;
//每一次滚动放大的倍数
if
(
e
.
target
.
id
==
"bigImage"
)
{
// 说明:e.dataY如果大于0则表示鼠标向下滚动,反之则向上滚动,这里设计为向上滚动为放大,向下滚动为缩小
if
(
e
.
deltaY
>
0
)
{
itemSizeChange
=
1
/
1.1
;
}
let
_initScale
=
initScale
*
itemSizeChange
;
// 说明:在超过或低于临界值时,虽然让initScale等于maxZoom或minreduce,但是在后续的判断中放大图片的最终倍数并没有达到maxZoom或minreduce,而是跳过。
if
(
_initScale
>
maxZoom
)
{
initScale
=
maxZoom
;
}
else
if
(
_initScale
<
minReduce
)
{
initScale
=
minReduce
;
}
else
{
initScale
=
_initScale
;
}
const
origin
=
{
x
:
(
itemSizeChange
-
1
)
*
imgWidth
*
0.5
,
y
:
(
itemSizeChange
-
1
)
*
imgHeight
*
0.5
,
};
// 计算偏移量
if
(
_initScale
<
maxZoom
&&
_initScale
>
minReduce
)
{
x
-=
(
itemSizeChange
-
1
)
*
(
e
.
clientX
-
x
)
-
origin
.
x
;
y
-=
(
itemSizeChange
-
1
)
*
(
e
.
clientY
-
y
)
-
origin
.
y
;
e
.
target
.
style
.
transform
=
`translate3d(
${
x
}
px,
${
y
}
px, 0) scale(
${
initScale
}
)`
;
}
}
// 阻止默认事件
e
.
preventDefault
();
}
function
imgDrag
()
{
// 绑定 鼠标按下事件
bigImage
.
addEventListener
(
"pointerdown"
,
pointerdown
);
// 绑定 鼠标移动事件
bigImage
.
addEventListener
(
"pointermove"
,
pointermove
);
bigImage
.
addEventListener
(
"pointerup"
,
function
(
e
)
{
if
(
isPointerdown
)
{
isPointerdown
=
false
;
}
});
bigImage
.
addEventListener
(
"pointercancel"
,
function
(
e
)
{
if
(
isPointerdown
)
{
isPointerdown
=
false
;
}
});
}
function
pointerdown
(
e
)
{
isPointerdown
=
true
;
// 说明:Element.setPointerCapture()将特定元素指定为未来指针事件的捕获目标。指针的后续事件将以捕获元素为目标,直到捕获被释放。可以理解为:在窗口不是全屏情况下,我在拖动放大图片时即使鼠标移出可窗口之外,此时事件还是捕获在该放大图片上。
bigImage
.
setPointerCapture
(
e
.
pointerId
);
lastPointermove
=
{
x
:
e
.
clientX
,
y
:
e
.
clientY
,
};
}
function
pointermove
(
e
)
{
if
(
isPointerdown
)
{
const
current1
=
{
x
:
e
.
clientX
,
y
:
e
.
clientY
,
};
diff
.
x
=
current1
.
x
-
lastPointermove
.
x
;
diff
.
y
=
current1
.
y
-
lastPointermove
.
y
;
lastPointermove
=
{
x
:
current1
.
x
,
y
:
current1
.
y
,
};
x
+=
diff
.
x
;
y
+=
diff
.
y
;
bigImage
.
style
.
transform
=
`translate3d(
${
x
}
px,
${
y
}
px, 0) scale(
${
initScale
}
)`
;
}
e
.
preventDefault
();
}
src/main/webapp/XS/XS40.js
View file @
bc9119ef
...
...
@@ -259,7 +259,7 @@ $(function () {
EiCommunicator
.
send
(
"XS03"
,
"queryParentGroups"
,
eiInfo
,
{
onSuccess
:
function
(
ei
)
{
var
message
=
ei
.
getMsg
();
IPLAT
.
confirm
(
message
+
"确认要
删除["
+
data
.
text
+
"]的信息
吗?"
,
function
(
e
)
{
IPLAT
.
confirm
(
message
+
"确认要
从角色树中移除["
+
data
.
text
+
"]
吗?"
,
function
(
e
)
{
var
eiInfo
=
new
EiInfo
();
eiInfo
.
set
(
"groupId"
,
groupId
);
eiInfo
.
set
(
"groupEname"
,
groupEname
);
...
...
@@ -673,4 +673,4 @@ window.onload = () => {
}
resetGridHeight
()
}
\ No newline at end of file
}
src/main/webapp/XS/XS40.jsp
View file @
bc9119ef
...
...
@@ -71,14 +71,16 @@
<li data-type="create">
<span style="font-size: 16px; width: 16px; vertical-align: middle;" class="fa fa-plus"></span>新增
</li>
<li data-type="edit" id="isEdit">
<span style="font-size: 16px; width: 16px; vertical-align: middle;" class="fa fa-pencil"></span>编辑
</li>
<li data-type="delete" id="isDel">
<span style="font-size: 16px; width: 16px; vertical-align: middle;"
class="fa fa-minus-circle"></span>删除
</li>
<li data-type="edit" id="isEdit">
<span style="font-size: 16px; width: 16px; vertical-align: middle;" class="fa fa-pencil"></span>编辑
class="fa fa-minus-circle"></span>移除
</li>
</ul>
<br/>
<span style="color: red; ">说明:"删除角色"需要到用户信息管理->角色管理界面进行操作</span><br>
</EF:EFRegion>
</div>
<div id="right-pane" class="i-fit-height">
...
...
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