Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
test
Project
Project
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
邬友楠
test
Commits
ff6207f9
Commit
ff6207f9
authored
May 20, 2020
by
雍欢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、添加/编辑功能的时候通过easy-search来选择菜单图标;
2、菜单图片改为可以为空
parent
4f599381
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
241 additions
and
7 deletions
+241
-7
IconApplication.java
.../com/huigou/uasp/bmp/opm/application/IconApplication.java
+11
-0
Icon.java
...a/com/huigou/uasp/bmp/opm/domain/model/resource/Icon.java
+43
-0
IconRepository.java
...om/huigou/uasp/bmp/opm/repository/org/IconRepository.java
+10
-0
IconApplicationImpl.java
...ava/com/huigou/uasp/bmp/opm/impl/IconApplicationImpl.java
+27
-0
IconApplicationProxy.java
...a/com/huigou/uasp/bmp/opm/proxy/IconApplicationProxy.java
+40
-0
pom.xml
huigou-uasp/pom.xml
+4
-0
IconController.java
...va/com/huigou/uasp/bmp/opm/controller/IconController.java
+56
-0
JstyleparserTest.java
huigou-uasp/src/test/java/test/JstyleparserTest.java
+29
-0
pom.xml
huigou-xt/pom.xml
+4
-1
application.properties
huigou-xt/src/main/resources/application.properties
+14
-3
easySearch.jsp
huigou-xt/src/main/webapp/common/easySearch.jsp
+1
-1
FunctionDetail.jsp
.../src/main/webapp/system/opm/permission/FunctionDetail.jsp
+2
-2
No files found.
huigou-core-api/src/main/java/com/huigou/uasp/bmp/opm/application/IconApplication.java
0 → 100644
View file @
ff6207f9
package
com
.
huigou
.
uasp
.
bmp
.
opm
.
application
;
import
com.huigou.uasp.bmp.opm.domain.model.resource.Icon
;
import
java.util.List
;
public
interface
IconApplication
{
void
syncIcons
(
List
<
Icon
>
icons
);
}
huigou-core-api/src/main/java/com/huigou/uasp/bmp/opm/domain/model/resource/Icon.java
0 → 100644
View file @
ff6207f9
package
com
.
huigou
.
uasp
.
bmp
.
opm
.
domain
.
model
.
resource
;
import
com.huigou.data.domain.model.AbstractEntity
;
import
javax.persistence.Entity
;
import
javax.persistence.Table
;
/**
* 菜单图标。
*
* @author yonghuan
*/
@Table
(
name
=
"sa_opicon"
)
@Entity
public
class
Icon
extends
AbstractEntity
{
private
String
code
;
private
String
html
;
public
Icon
()
{
}
public
Icon
(
String
code
,
String
html
)
{
this
.
code
=
code
;
this
.
html
=
html
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
String
getHtml
()
{
return
html
;
}
public
void
setHtml
(
String
html
)
{
this
.
html
=
html
;
}
}
huigou-core-api/src/main/java/com/huigou/uasp/bmp/opm/repository/org/IconRepository.java
0 → 100644
View file @
ff6207f9
package
com
.
huigou
.
uasp
.
bmp
.
opm
.
repository
.
org
;
import
com.huigou.uasp.bmp.opm.domain.model.resource.Icon
;
import
org.springframework.data.jpa.repository.JpaRepository
;
/**
* @author yonghuan
*/
public
interface
IconRepository
extends
JpaRepository
<
Icon
,
String
>
{
}
huigou-core-impl/src/main/java/com/huigou/uasp/bmp/opm/impl/IconApplicationImpl.java
0 → 100644
View file @
ff6207f9
package
com
.
huigou
.
uasp
.
bmp
.
opm
.
impl
;
import
com.huigou.uasp.bmp.opm.application.IconApplication
;
import
com.huigou.uasp.bmp.opm.domain.model.resource.Icon
;
import
com.huigou.uasp.bmp.opm.repository.org.IconRepository
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
/**
* @author yonghuan
*/
public
class
IconApplicationImpl
implements
IconApplication
{
private
IconRepository
iconRepository
;
public
void
setIconRepository
(
IconRepository
iconRepository
)
{
this
.
iconRepository
=
iconRepository
;
}
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Override
public
void
syncIcons
(
List
<
Icon
>
icons
)
{
iconRepository
.
deleteAll
();
iconRepository
.
save
(
icons
);
}
}
huigou-core-proxy/src/main/java/com/huigou/uasp/bmp/opm/proxy/IconApplicationProxy.java
0 → 100644
View file @
ff6207f9
package
com
.
huigou
.
uasp
.
bmp
.
opm
.
proxy
;
import
com.huigou.uasp.bmp.opm.application.IconApplication
;
import
com.huigou.uasp.bmp.opm.domain.model.resource.Icon
;
import
com.huigou.uasp.bmp.opm.impl.IconApplicationImpl
;
import
com.huigou.uasp.bmp.opm.repository.org.IconRepository
;
import
org.springframework.beans.factory.InitializingBean
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.List
;
/**
* @author yonghuan
*/
@Service
public
class
IconApplicationProxy
implements
IconApplication
,
InitializingBean
{
private
IconRepository
iconRepository
;
private
IconApplication
iconApplication
;
@Autowired
public
void
setIconRepository
(
IconRepository
iconRepository
)
{
this
.
iconRepository
=
iconRepository
;
}
@Override
public
void
afterPropertiesSet
()
throws
Exception
{
IconApplicationImpl
impl
=
new
IconApplicationImpl
();
impl
.
setIconRepository
(
iconRepository
);
this
.
iconApplication
=
impl
;
}
@Transactional
(
rollbackFor
=
RuntimeException
.
class
)
@Override
public
void
syncIcons
(
List
<
Icon
>
icons
)
{
iconApplication
.
syncIcons
(
icons
);
}
}
huigou-uasp/pom.xml
View file @
ff6207f9
...
...
@@ -350,6 +350,10 @@
<artifactId>
query-spring
</artifactId>
<version>
1.2.7
</version>
</dependency>
<dependency>
<groupId>
net.sf.cssbox
</groupId>
<artifactId>
jstyleparser
</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
...
...
huigou-uasp/src/main/java/com/huigou/uasp/bmp/opm/controller/IconController.java
0 → 100644
View file @
ff6207f9
package
com
.
huigou
.
uasp
.
bmp
.
opm
.
controller
;
import
com.huigou.uasp.annotation.ControllerMapping
;
import
com.huigou.uasp.bmp.opm.application.IconApplication
;
import
com.huigou.uasp.bmp.opm.domain.model.resource.Icon
;
import
com.huigou.uasp.client.CommonController
;
import
cz.vutbr.web.css.CSSException
;
import
cz.vutbr.web.css.CSSFactory
;
import
cz.vutbr.web.css.RuleSet
;
import
cz.vutbr.web.css.StyleSheet
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Controller
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 图标。
*
* @author yonghuan
*/
@ControllerMapping
(
"icon"
)
@Controller
public
class
IconController
extends
CommonController
{
@Autowired
private
IconApplication
iconApplication
;
@Value
(
"${icon.cssFile}"
)
private
String
iconCssFile
;
/**
* 同步图标
*/
public
String
syncIcons
()
throws
IOException
,
CSSException
{
String
cssFile
=
getRequest
().
getRealPath
(
iconCssFile
);
String
css
=
Files
.
readAllLines
(
Paths
.
get
(
cssFile
))
.
stream
()
.
collect
(
Collectors
.
joining
(
"\n"
));
StyleSheet
sheet
=
CSSFactory
.
parseString
(
css
,
null
);
List
<
Icon
>
icons
=
sheet
.
stream
().
filter
(
block
->
block
instanceof
RuleSet
)
.
map
(
RuleSet
.
class
::
cast
)
.
filter
(
rule
->
rule
.
getSelectors
().
length
==
1
)
.
filter
(
rule
->
rule
.
size
()
==
1
)
.
filter
(
rule
->
"content"
.
equals
(
rule
.
get
(
0
).
getProperty
()))
.
map
(
rule
->
rule
.
getSelectors
()[
0
].
get
(
0
).
getClassName
())
.
map
(
className
->
new
Icon
(
className
,
String
.
format
(
"<i class='fa %s'></i>"
,
className
)))
.
collect
(
Collectors
.
toList
());
iconApplication
.
syncIcons
(
icons
);
return
success
();
}
}
huigou-uasp/src/test/java/test/JstyleparserTest.java
0 → 100644
View file @
ff6207f9
package
test
;
import
cz.vutbr.web.css.*
;
import
org.junit.Test
;
import
java.io.IOException
;
import
java.nio.file.Files
;
import
java.nio.file.Paths
;
import
java.util.List
;
import
java.util.stream.Collectors
;
public
class
JstyleparserTest
{
@Test
public
void
test
()
throws
IOException
,
CSSException
{
String
css
=
Files
.
readAllLines
(
Paths
.
get
(
"E:\\work\\topsunit\\IdeaProjects\\huigou\\huigou-xt\\src\\main\\webapp\\themes\\fontawesome\\css\\font-awesome.min.css"
))
.
stream
()
.
collect
(
Collectors
.
joining
(
"\n"
));
StyleSheet
sheet
=
CSSFactory
.
parseString
(
css
,
null
);
List
<
String
>
icons
=
sheet
.
stream
().
filter
(
block
->
block
instanceof
RuleSet
)
.
map
(
RuleSet
.
class
::
cast
)
.
filter
(
rule
->
rule
.
getSelectors
().
length
==
1
)
.
filter
(
rule
->
rule
.
size
()
==
1
)
.
filter
(
rule
->
"content"
.
equals
(
rule
.
get
(
0
).
getProperty
()))
.
map
(
rule
->
rule
.
getSelectors
()[
0
].
get
(
0
).
getClassName
())
.
collect
(
Collectors
.
toList
());
}
}
huigou-xt/pom.xml
View file @
ff6207f9
...
...
@@ -453,7 +453,10 @@
<artifactId>
mssql-jdbc
</artifactId>
<version>
7.4.1.jre8
</version>
</dependency>
<dependency>
<groupId>
net.sf.cssbox
</groupId>
<artifactId>
jstyleparser
</artifactId>
</dependency>
</dependencies>
<build>
<finalName>
huigou-xt
</finalName>
...
...
huigou-xt/src/main/resources/application.properties
View file @
ff6207f9
...
...
@@ -38,6 +38,17 @@ sys.server.ip=127.0.0.1:8080/is/
corpId
=
wxafae524e350f2298
corpSecret
=
FwcIKKl8AcVp6xlaXYxfMF0KSTFmyWGP9ZSt0iaCFNf-1GQcLU29ulmk4mVax1QB
email.host
=
xx
email.username
=
xx
email.password
=
xx
\ No newline at end of file
# �Ƿ���ҵ��ڵ㳬ʱ������
bpm.bizTask.timeoutCheck.enabled
=
true
# BPMҵ��ڵ㳬ʱ����������
bpm.bizTask.timeoutCheck.cron
=
0/10 * * * * ?
email.host
=
https://mail.topsunit.com/EWS/Exchange.asmx
email.username
=
portal@topsunit.com
email.password
=
20180101
activemq.brokerURL
=
tcp://127.0.0.1:61616
activemq.userName
=
admin
activemq.password
=
admin
icon.cssFile
=
themes/fontawesome/css/font-awesome.min.css
\ No newline at end of file
huigou-xt/src/main/webapp/common/easySearch.jsp
View file @
ff6207f9
...
...
@@ -38,7 +38,7 @@
<c:forEach
items=
"
${
requestScope
.
EASY_SEARCH_DATA
.
headList
}
"
var=
"obj"
>
<c:if
test=
"
${
obj
.
type
!=
'hidden'
}
"
>
<td
style=
'text-align:
<c:out
value=
"
${
obj
.
align
}
"
/>
'
title=
'
<c:out
value=
"
${
data
[
obj
.
code
]
}
"
/>
'
width=
'
<c:out
value=
"
${
obj
.
width
}
"
/>
px'
>
<c:out
value=
"
${
f:
format
(
data
[
obj
.
code
],
obj
.
type
)
}
"
/>
<c:out
value=
"
${
f:
format
(
data
[
obj
.
code
],
obj
.
type
)
}
"
escapeXml=
"false"
/>
</td>
</c:if>
<input
type=
'hidden'
flag=
'
<c:out
value=
"
${
obj
.
type
!=
'hidden'
?
'1'
:
'0'
}
"
/>
'
name=
'
<c:out
value=
"
${
obj
.
code
}
"
/>
'
...
...
huigou-xt/src/main/webapp/system/opm/permission/FunctionDetail.jsp
View file @
ff6207f9
...
...
@@ -11,10 +11,10 @@
<x:inputC
name=
"url"
label=
"Url"
readonly=
"false"
maxlength=
"128"
fieldCol=
"10"
wrapper=
"select"
/>
<x:hidden
name=
"urlSelector"
/>
<div
class=
"col-xs-2 col-md-2"
>
<label
class=
"hg-form-label
required
"
id=
"code_label"
>
图标
:
</label>
<label
class=
"hg-form-label"
id=
"code_label"
>
图标
:
</label>
</div>
<div
class=
"col-xs-8 col-md-8"
>
<x:input
name=
"icon"
label=
"图标"
required=
"true"
/>
<x:input
name=
"icon"
label=
"图标"
/>
</div>
<div
class=
"col-xs-2 col-md-2"
>
<span
style=
"padding:10px;font-size:26px;"
class=
"show-icon"
></span>
...
...
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