Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Springboot Plus
Commits
18144407
Commit
18144407
authored
Sep 04, 2019
by
trumansdo
Browse files
应用codestyle
千万千万要用vscode打开前端项目,或者关闭eslint,移除它 Signed-off-by:
trumansdo
<
1012243881@qq.com
>
parent
9b3d96a6
Changes
178
Show whitespace changes
Inline
Side-by-side
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/web/ControllerNotFound.java
View file @
18144407
...
...
@@ -11,21 +11,18 @@ import org.springframework.stereotype.Controller;
import
org.springframework.web.bind.annotation.RequestMapping
;
/**
* 没有找到匹配的Controller
* @author xiandafu
*
* @author xiandafu
*/
@Controller
public
class
ControllerNotFound
{
@Autowired
WebSimulate
webSimulate
;
@Autowired
WebSimulate
webSimulate
;
Log
log
=
LogFactory
.
getLog
(
ControllerNotFound
.
class
);
@RequestMapping
(
"/**/*.do"
)
public
void
error
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
response
.
setContentType
(
"text/html;charset=UTF-8"
);
log
.
info
(
"没有配置 url "
+
request
.
getRequestURI
()
+
",确认所访问Controller是否存在,是否被Spring Boot管理"
);
throw
new
RuntimeException
(
"未找到Controller类处理此请求 "
+
request
.
getRequestURI
());
log
.
info
(
"没有配置 url "
+
request
.
getRequestURI
()
+
",确认所访问Controller是否存在,是否被Spring Boot管理"
);
throw
new
RuntimeException
(
"未找到Controller类处理此请求 "
+
request
.
getRequestURI
());
}
}
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/web/CoreCodeGenController.java
View file @
18144407
...
...
@@ -44,14 +44,12 @@ public class CoreCodeGenController {
private
final
Log
log
=
LogFactory
.
getLog
(
this
.
getClass
());
private
static
final
String
MODEL
=
"/core/codeGen"
;
@Autowired
CoreCodeGenService
codeGenService
;
@Autowired
CoreCodeGenService
codeGenService
;
@GetMapping
(
MODEL
+
"/index.do"
)
public
ModelAndView
index
()
{
ModelAndView
view
=
new
ModelAndView
(
"/core/codeGen/index.html"
);
return
view
;
}
@PostMapping
(
MODEL
+
"/refresh.json"
)
...
...
@@ -61,14 +59,12 @@ public class CoreCodeGenController {
return
JsonResult
.
success
();
}
@GetMapping
(
MODEL
+
"/tableDetail.do"
)
public
ModelAndView
tableDetail
(
String
table
)
{
ModelAndView
view
=
new
ModelAndView
(
"/core/codeGen/edit.html"
);
Entity
entity
=
codeGenService
.
getEntityInfo
(
table
);
view
.
addObject
(
"entity"
,
entity
);
return
view
;
}
@GetMapping
(
MODEL
+
"/project.do"
)
...
...
@@ -76,83 +72,82 @@ public class CoreCodeGenController {
ModelAndView
view
=
new
ModelAndView
(
"/core/codeGen/project.html"
);
File
file
=
new
File
(
MavenProjectTarget
.
detectRootPath
());
String
root
=
file
.
getParent
();
//设置生成项目为当前运行项目的上一级项目
view
.
addObject
(
"path"
,
root
+
File
.
separator
+
"sample"
);
view
.
addObject
(
"basePackage"
,
"com.corp.xxx"
);
//
设置生成项目为当前运行项目的上一级项目
view
.
addObject
(
"path"
,
root
+
File
.
separator
+
"sample"
);
view
.
addObject
(
"basePackage"
,
"com.corp.xxx"
);
return
view
;
}
@PostMapping
(
MODEL
+
"/projectGen.json"
)
@ResponseBody
public
JsonResult
project
(
String
path
,
String
basePackage
,
String
includeConsole
)
throws
IOException
{
//includeConsole 当前版本忽略,总是添加一个系统管理功能,可以在pom中移除console
public
JsonResult
project
(
String
path
,
String
basePackage
,
String
includeConsole
)
throws
IOException
{
// includeConsole 当前版本忽略,总是添加一个系统管理功能,可以在pom中移除console
//生成maven项目结构
//
生成maven项目结构
File
maven
=
new
File
(
path
);
maven
.
mkdirs
();
File
src
=
new
File
(
maven
,
"src"
);
File
src
=
new
File
(
maven
,
"src"
);
src
.
mkdirs
();
File
main
=
new
File
(
src
,
"main"
);
File
main
=
new
File
(
src
,
"main"
);
main
.
mkdir
();
File
test
=
new
File
(
src
,
"test"
);
File
test
=
new
File
(
src
,
"test"
);
test
.
mkdir
();
File
javsSource
=
new
File
(
main
,
"java"
);
File
javsSource
=
new
File
(
main
,
"java"
);
javsSource
.
mkdir
();
File
resource
=
new
File
(
main
,
"resources"
);
File
resource
=
new
File
(
main
,
"resources"
);
resource
.
mkdir
();
File
sql
=
new
File
(
resource
,
"sql"
);
File
sql
=
new
File
(
resource
,
"sql"
);
sql
.
mkdir
();
File
staticFile
=
new
File
(
resource
,
"static"
);
File
staticFile
=
new
File
(
resource
,
"static"
);
staticFile
.
mkdir
();
File
templatesFile
=
new
File
(
resource
,
"templates"
);
File
templatesFile
=
new
File
(
resource
,
"templates"
);
templatesFile
.
mkdir
();
String
codePath
=
basePackage
.
replace
(
"."
,
"/"
);
File
codeFile
=
new
File
(
javsSource
,
codePath
);
File
codeFile
=
new
File
(
javsSource
,
codePath
);
codeFile
.
mkdirs
();
Configuration
conf
=
Configuration
.
defaultConfiguration
();
String
tempalteRoot
=
"codeTemplate/maven/"
;
ClasspathResourceLoader
loader
=
new
ClasspathResourceLoader
(
Thread
.
currentThread
().
getContextClassLoader
(),
tempalteRoot
);
GroupTemplate
gt
=
new
GroupTemplate
(
loader
,
conf
);
ClasspathResourceLoader
loader
=
new
ClasspathResourceLoader
(
Thread
.
currentThread
().
getContextClassLoader
(),
tempalteRoot
);
GroupTemplate
gt
=
new
GroupTemplate
(
loader
,
conf
);
FileWriter
fw
=
null
;
//先生成入口程序
//
先生成入口程序
Template
mainJavaTempalte
=
gt
.
getTemplate
(
"/main.java"
);
mainJavaTempalte
.
binding
(
"basePackage"
,
basePackage
);
fw
=
new
FileWriter
(
new
File
(
codeFile
,
"MainApplication.java"
));
fw
=
new
FileWriter
(
new
File
(
codeFile
,
"MainApplication.java"
));
mainJavaTempalte
.
renderTo
(
fw
);
//生成pom文件
// 生成pom文件
Template
pomTemplate
=
gt
.
getTemplate
(
"/pomTemplate.xml"
);
int
index
=
basePackage
.
lastIndexOf
(
"."
);
String
projectGrop
=
basePackage
.
substring
(
0
,
index
);
String
projectName
=
basePackage
.
substring
(
index
+
1
);
String
projectName
=
basePackage
.
substring
(
index
+
1
);
pomTemplate
.
binding
(
"group"
,
projectGrop
);
pomTemplate
.
binding
(
"project"
,
projectName
);
fw
=
new
FileWriter
(
new
File
(
maven
,
"pom.xml"
));
fw
=
new
FileWriter
(
new
File
(
maven
,
"pom.xml"
));
pomTemplate
.
renderTo
(
fw
);
//复制当前项目的配置文件
File
config
=
copy
(
resource
,
"application.properties"
);
copy
(
resource
,
"beetl.properties"
);
copy
(
resource
,
"btsql-ext.properties"
);
copy
(
resource
,
"banner.txt"
);
//
复制当前项目的配置文件
File
config
=
copy
(
resource
,
"application.properties"
);
copy
(
resource
,
"beetl.properties"
);
copy
(
resource
,
"btsql-ext.properties"
);
copy
(
resource
,
"banner.txt"
);
return
JsonResult
.
success
();
}
private
File
copy
(
File
root
,
String
fileName
)
throws
IOException
{
private
File
copy
(
File
root
,
String
fileName
)
throws
IOException
{
ClassLoader
loader
=
Thread
.
currentThread
().
getContextClassLoader
();
InputStream
input
=
loader
.
getResourceAsStream
(
fileName
);
if
(
input
==
null
)
{
log
.
info
(
"copy "
+
fileName
+
" error,不存在"
);
if
(
input
==
null
)
{
log
.
info
(
"copy "
+
fileName
+
" error,不存在"
);
return
null
;
}
File
target
=
new
File
(
root
,
fileName
);
File
target
=
new
File
(
root
,
fileName
);
FileOutputStream
output
=
new
FileOutputStream
(
target
);
try
{
...
...
@@ -168,9 +163,6 @@ public class CoreCodeGenController {
return
target
;
}
@PostMapping
(
MODEL
+
"/table.json"
)
@ResponseBody
public
JsonResult
<
List
<
Entity
>>
getTable
()
{
...
...
@@ -186,21 +178,20 @@ public class CoreCodeGenController {
JsonResult
.
failMessage
(
"表不存在"
);
}
return
JsonResult
.
success
(
entity
);
}
@PostMapping
(
MODEL
+
"/gen.json"
)
@ResponseBody
public
JsonResult
gen
(
EntityInfo
data
,
String
path
)
{
public
JsonResult
gen
(
EntityInfo
data
,
String
path
)
{
Entity
entity
=
getEntitiyInfo
(
data
);
String
urlBase
=
data
.
getUrlBase
();
String
basePackage
=
data
.
getBasePackage
();
MavenProjectTarget
target
=
new
MavenProjectTarget
(
entity
,
basePackage
);
//生成到path目录下,按照maven工程解构生成
//
生成到path目录下,按照maven工程解构生成
File
file
=
new
File
(
path
);
if
(!
file
.
exists
())
{
throw
new
PlatformException
(
"路径不存在 "
+
path
);
if
(!
file
.
exists
())
{
throw
new
PlatformException
(
"路径不存在 "
+
path
);
}
target
.
setTargetPath
(
path
);
target
.
setUrlBase
(
urlBase
);
...
...
@@ -211,24 +202,21 @@ public class CoreCodeGenController {
HtmlGen
htmlGen
=
new
HtmlGen
();
htmlGen
.
make
(
target
,
entity
);
String
preffix
=
urlBase
.
replace
(
'/'
,
'.'
);
String
basicFunctionCode
=
preffix
+
"."
+
entity
.
getCode
();
JavaCodeGen
javaGen
=
new
JavaCodeGen
(
basePackage
,
entity
,
basicFunctionCode
);
String
basicFunctionCode
=
preffix
+
"."
+
entity
.
getCode
();
JavaCodeGen
javaGen
=
new
JavaCodeGen
(
basePackage
,
entity
,
basicFunctionCode
);
javaGen
.
make
(
target
,
entity
);
MdGen
mdGen
=
new
MdGen
();
mdGen
.
make
(
target
,
entity
);
if
(
entity
.
isAutoAddMenu
()||
entity
.
isAutoAddFunction
())
{
//自动增加功能点
if
(
entity
.
isAutoAddMenu
()
||
entity
.
isAutoAddFunction
())
{
//
自动增加功能点
long
functionId
=
this
.
codeGenService
.
insertFunction
(
entity
,
urlBase
);
if
(
entity
.
isAutoAddMenu
())
{
if
(
entity
.
isAutoAddMenu
())
{
this
.
codeGenService
.
insertMenu
(
functionId
,
entity
,
urlBase
);
}
}
return
JsonResult
.
success
();
}
@PostMapping
(
MODEL
+
"/getPath.json"
)
...
...
@@ -256,7 +244,6 @@ public class CoreCodeGenController {
content
.
put
(
gen
.
getName
(),
code
);
}
return
JsonResult
.
success
(
content
);
}
@PostMapping
(
MODEL
+
"/js.json"
)
...
...
@@ -277,7 +264,6 @@ public class CoreCodeGenController {
content
.
put
(
gen
.
getName
(),
code
);
}
return
JsonResult
.
success
(
content
);
}
@PostMapping
(
MODEL
+
"/java.json"
)
...
...
@@ -291,8 +277,8 @@ public class CoreCodeGenController {
webTarget
.
setUrlBase
(
urlBase
);
String
preffix
=
urlBase
.
replace
(
'/'
,
'.'
);
String
basicFunctionCode
=
preffix
+
"."
+
entity
.
getCode
();
JavaCodeGen
javaGen
=
new
JavaCodeGen
(
basePackage
,
entity
,
basicFunctionCode
);
String
basicFunctionCode
=
preffix
+
"."
+
entity
.
getCode
();
JavaCodeGen
javaGen
=
new
JavaCodeGen
(
basePackage
,
entity
,
basicFunctionCode
);
javaGen
.
make
(
webTarget
,
entity
);
Map
<
String
,
String
>
content
=
new
HashMap
<
String
,
String
>();
for
(
Entry
<
Object
,
String
>
entry
:
webTarget
.
map
.
entrySet
())
{
...
...
@@ -301,9 +287,7 @@ public class CoreCodeGenController {
content
.
put
(
gen
.
getName
(),
code
);
}
return
JsonResult
.
success
(
content
);
}
@PostMapping
(
MODEL
+
"/sql.json"
)
...
...
@@ -324,7 +308,6 @@ public class CoreCodeGenController {
content
.
put
(
gen
.
getName
(),
code
);
}
return
JsonResult
.
success
(
content
);
}
private
Entity
getEntitiyInfo
(
EntityInfo
data
)
{
...
...
@@ -346,7 +329,7 @@ public class CoreCodeGenController {
attr
.
setShowInQuery
(
info
.
getList
().
get
(
i
).
isShowInQuery
());
attr
.
setDictType
(
info
.
getList
().
get
(
i
).
getDictType
());
attr
.
setVerifyList
(
info
.
getList
().
get
(
i
).
getVerifyList
());
if
(
attr
.
getName
().
equals
(
data
.
getNameAttr
()))
{
if
(
attr
.
getName
().
equals
(
data
.
getNameAttr
()))
{
entity
.
setNameAttribute
(
attr
);
}
}
...
...
@@ -355,13 +338,9 @@ public class CoreCodeGenController {
throw
new
PlatformException
(
"code,system不能为空"
);
}
return
entity
;
}
@GetMapping
(
MODEL
+
"/{table}/test.json"
)
@ResponseBody
public
void
test
(
@PathVariable
String
table
)
{
...
...
@@ -373,7 +352,6 @@ public class CoreCodeGenController {
entity
.
setTableName
(
"CMS_BLOG"
);
entity
.
setSystem
(
"console"
);
Attribute
idAttr
=
new
Attribute
();
idAttr
.
setColName
(
"id"
);
idAttr
.
setJavaType
(
"Long"
);
...
...
@@ -438,15 +416,13 @@ public class CoreCodeGenController {
HtmlGen
htmlGen
=
new
HtmlGen
();
htmlGen
.
make
(
target
,
entity
);
String
preffix
=
urlBase
.
replace
(
'/'
,
'.'
);
String
basicFunctionCode
=
preffix
+
"."
+
entity
.
getCode
();
JavaCodeGen
javaGen
=
new
JavaCodeGen
(
basePackage
,
entity
,
basicFunctionCode
);
String
basicFunctionCode
=
preffix
+
"."
+
entity
.
getCode
();
JavaCodeGen
javaGen
=
new
JavaCodeGen
(
basePackage
,
entity
,
basicFunctionCode
);
javaGen
.
make
(
target
,
entity
);
MdGen
mdGen
=
new
MdGen
();
mdGen
.
make
(
target
,
entity
);
}
}
class
EntityInfo
{
...
...
@@ -455,7 +431,6 @@ class EntityInfo {
String
basePackage
;
String
nameAttr
;
public
Entity
getEntity
()
{
return
entity
;
}
...
...
@@ -487,7 +462,4 @@ class EntityInfo {
public
void
setNameAttr
(
String
nameAttr
)
{
this
.
nameAttr
=
nameAttr
;
}
}
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/web/CoreDictController.java
View file @
18144407
package
com.ibeetl.admin.core.web
;
import
java.util.List
;
import
org.apache.commons.logging.Log
;
...
...
@@ -20,16 +19,13 @@ public class CoreDictController {
private
final
Log
log
=
LogFactory
.
getLog
(
this
.
getClass
());
private
static
final
String
MODEL
=
"/core/dict"
;
@Autowired
CorePlatformService
platformService
;
@Autowired
CoreDictService
dictService
;
@Autowired
CorePlatformService
platformService
;
@Autowired
CoreDictService
dictService
;
/**
* 查看字典类型对应的列表
*
* @param type
* @return
*/
...
...
@@ -42,18 +38,15 @@ public class CoreDictController {
/**
* 查看字典值的子字典
*
* @param value
* @return
*/
@RequestMapping
(
MODEL
+
"/viewChildren.json"
)
@ResponseBody
public
JsonResult
<
List
<
CoreDict
>>
viewChild
(
String
group
,
String
value
)
{
CoreDict
dict
=
dictService
.
findCoreDict
(
group
,
value
);
public
JsonResult
<
List
<
CoreDict
>>
viewChild
(
String
group
,
String
value
)
{
CoreDict
dict
=
dictService
.
findCoreDict
(
group
,
value
);
List
<
CoreDict
>
list
=
dictService
.
findChildByParent
(
dict
.
getId
());
return
JsonResult
.
success
(
list
);
}
}
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/web/CoreUserController.java
View file @
18144407
...
...
@@ -31,20 +31,13 @@ public class CoreUserController {
private
final
Log
log
=
LogFactory
.
getLog
(
this
.
getClass
());
private
static
final
String
MODEL
=
"/core/user"
;
@Autowired
CorePlatformService
platformService
;
@Autowired
CorePlatformService
platformService
;
@Autowired
CoreUserService
userService
;
@Autowired
CoreUserService
userService
;
@Autowired
HttpRequestLocal
httpRequestLocal
;
@Autowired
HttpRequestLocal
httpRequestLocal
;
@Autowired
PasswordEncryptService
passwordEncryptService
;
@Autowired
PasswordEncryptService
passwordEncryptService
;
@PostMapping
(
MODEL
+
"/login.json"
)
@ResponseBody
...
...
@@ -77,9 +70,9 @@ public class CoreUserController {
@PostMapping
(
MODEL
+
"/myOrgs.json"
)
@ResponseBody
public
JsonResult
<
List
<
CoreOrg
>>
myOrgs
()
{
List
<
CoreOrg
>
orgs
=
(
List
<
CoreOrg
>)
httpRequestLocal
.
getSessionValue
(
CorePlatformService
.
ACCESS_USER_ORGS
);
List
<
CoreOrg
>
orgs
=
(
List
<
CoreOrg
>)
httpRequestLocal
.
getSessionValue
(
CorePlatformService
.
ACCESS_USER_ORGS
);
return
JsonResult
.
success
(
orgs
);
}
/**
...
...
@@ -127,7 +120,6 @@ public class CoreUserController {
}
else
{
return
JsonResult
.
failMessage
(
"密码错误"
);
}
}
/**
...
...
@@ -159,7 +151,8 @@ public class CoreUserController {
List
<
MenuItem
>
list
=
menuItem
.
getChildren
();
List
<
SystemMenuView
>
systems
=
new
ArrayList
<
SystemMenuView
>();
for
(
MenuItem
item
:
list
)
{
systems
.
add
(
new
SystemMenuView
(
item
.
getId
(),
item
.
getData
().
getCode
(),
item
.
getData
().
getName
()));
systems
.
add
(
new
SystemMenuView
(
item
.
getId
(),
item
.
getData
().
getCode
(),
item
.
getData
().
getName
()));
}
return
JsonResult
.
success
(
systems
);
}
...
...
@@ -206,18 +199,17 @@ public class CoreUserController {
}
/**
* 获取功能点树
*
* @return
*/
@PostMapping
(
MODEL
+
"/function/tree.json"
)
@ResponseBody
public
JsonResult
<
List
<
FunctionNodeView
>
>
getFunctionTree
()
{
public
JsonResult
<
List
<
FunctionNodeView
>>
getFunctionTree
()
{
FunctionItem
root
=
this
.
platformService
.
buildFunction
();
List
<
FunctionNodeView
>
tree
=
buildFunctionTree
(
root
);
return
JsonResult
.
success
(
tree
);
}
private
List
<
MenuNodeView
>
build
(
MenuItem
node
)
{
List
<
MenuItem
>
list
=
node
.
getChildren
();
if
(
list
.
size
()
==
0
)
{
...
...
@@ -240,13 +232,13 @@ public class CoreUserController {
return
views
;
}
private
List
<
FunctionNodeView
>
buildFunctionTree
(
FunctionItem
node
){
private
List
<
FunctionNodeView
>
buildFunctionTree
(
FunctionItem
node
)
{
List
<
FunctionItem
>
list
=
node
.
getChildren
();
if
(
list
.
size
()==
0
){
if
(
list
.
size
()
==
0
)
{
return
Collections
.
EMPTY_LIST
;
}
List
<
FunctionNodeView
>
views
=
new
ArrayList
<
FunctionNodeView
>(
list
.
size
());
for
(
FunctionItem
item
:
list
){
for
(
FunctionItem
item
:
list
)
{
FunctionNodeView
view
=
new
FunctionNodeView
();
view
.
setCode
(
item
.
getData
().
getCode
());
view
.
setName
(
item
.
getData
().
getName
());
...
...
@@ -258,5 +250,4 @@ public class CoreUserController {
}
return
views
;
}
}
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/web/FileSystemContorller.java
View file @
18144407
...
...
@@ -30,21 +30,30 @@ import com.ibeetl.admin.core.util.FileUtil;
public
class
FileSystemContorller
{
private
final
Log
log
=
LogFactory
.
getLog
(
this
.
getClass
());
@Autowired
CorePlatformService
platformService
;
@Autowired
CorePlatformService
platformService
;
private
static
final
String
MODEL
=
"/core/file"
;
/*附件类操作*/
@PostMapping
(
MODEL
+
"/uploadAttachment.json"
)
@ResponseBody
public
JsonResult
uploadFile
(
@RequestParam
(
"file"
)
MultipartFile
file
,
String
batchFileUUID
,
String
bizType
,
String
bizId
)
throws
IOException
{
if
(
file
.
isEmpty
())
{
public
JsonResult
uploadFile
(
@RequestParam
(
"file"
)
MultipartFile
file
,
String
batchFileUUID
,
String
bizType
,
String
bizId
)
throws
IOException
{
if
(
file
.
isEmpty
())
{
return
JsonResult
.
fail
();
}
CoreUser
user
=
platformService
.
getCurrentUser
();
CoreOrg
org
=
platformService
.
getCurrentOrg
();
FileItem
fileItem
=
fileService
.
createFileItem
(
file
.
getOriginalFilename
(),
bizType
,
bizId
,
user
.
getId
(),
org
.
getId
(),
batchFileUUID
,
null
);
FileItem
fileItem
=
fileService
.
createFileItem
(
file
.
getOriginalFilename
(),
bizType
,
bizId
,
user
.
getId
(),
org
.
getId
(),
batchFileUUID
,
null
);
OutputStream
os
=
fileItem
.
openOutpuStream
();
FileUtil
.
copy
(
file
.
getInputStream
(),
os
);
return
JsonResult
.
success
(
fileItem
);
...
...
@@ -52,58 +61,69 @@ public class FileSystemContorller {
@PostMapping
(
MODEL
+
"/deleteAttachment.json"
)
@ResponseBody
public
JsonResult
deleteFile
(
Long
fileId
,
String
batchFileUUID
)
throws
IOException
{
public
JsonResult
deleteFile
(
Long
fileId
,
String
batchFileUUID
)
throws
IOException
{
fileService
.
removeFile
(
fileId
,
batchFileUUID
);
return
JsonResult
.
success
();
}
@GetMapping
(
MODEL
+
"/download/{fileId}/{batchFileUUID}/{name}"
)
public
ModelAndView
download
(
HttpServletResponse
response
,
@PathVariable
Long
fileId
,
@PathVariable
String
batchFileUUID
)
throws
IOException
{
FileItem
item
=
fileService
.
getFileItemById
(
fileId
,
batchFileUUID
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
URLEncoder
.
encode
(
item
.
getName
(),
"UTF-8"
));
public
ModelAndView
download
(
HttpServletResponse
response
,
@PathVariable
Long
fileId
,
@PathVariable
String
batchFileUUID
)
throws
IOException
{
FileItem
item
=
fileService
.
getFileItemById
(
fileId
,
batchFileUUID
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
URLEncoder
.
encode
(
item
.
getName
(),
"UTF-8"
));
item
.
copy
(
response
.
getOutputStream
());
return
null
;
}
/*execl 导入导出*/
@Autowired
FileService
fileService
;
@Autowired
FileService
fileService
;
@GetMapping
(
MODEL
+
"/get.do"
)
public
ModelAndView
index
(
HttpServletResponse
response
,
String
id
)
throws
IOException
{
public
ModelAndView
index
(
HttpServletResponse
response
,
String
id
)
throws
IOException
{
String
path
=
id
;
response
.
setContentType
(
"text/html; charset = UTF-8"
);
FileItem
fileItem
=
fileService
.
loadFileItemByPath
(
path
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
java
.
net
.
URLEncoder
.
encode
(
fileItem
.
getName
(),
"UTF-8"
));
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
java
.
net
.
URLEncoder
.
encode
(
fileItem
.
getName
(),
"UTF-8"
));
fileItem
.
copy
(
response
.
getOutputStream
());
if
(
fileItem
.
isTemp
())
{
if
(
fileItem
.
isTemp
())
{
fileItem
.
delete
();
}
return
null
;
}
@GetMapping
(
MODEL
+
"/downloadTemplate.do"
)
public
ModelAndView
dowloadTemplate
(
HttpServletResponse
response
,
String
path
)
throws
IOException
{
public
ModelAndView
dowloadTemplate
(
HttpServletResponse
response
,
String
path
)
throws
IOException
{
response
.
setContentType
(
"text/html; charset = UTF-8"
);
int
start1
=
path
.
lastIndexOf
(
"\\"
);
int
start2
=
path
.
lastIndexOf
(
"/"
);
if
(
start2
>
start1
)
{
if
(
start2
>
start1
)
{
start1
=
start2
;
}
String
file
=
path
.
substring
(
start1
+
1
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
java
.
net
.
URLEncoder
.
encode
(
file
,
"UTF-8"
));
InputStream
input
=
Thread
.
currentThread
().
getContextClassLoader
().
getResourceAsStream
(
"excelTemplates/"
+
path
);
String
file
=
path
.
substring
(
start1
+
1
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment; filename="
+
java
.
net
.
URLEncoder
.
encode
(
file
,
"UTF-8"
));
InputStream
input
=
Thread
.
currentThread
()
.
getContextClassLoader
()
.
getResourceAsStream
(
"excelTemplates/"
+
path
);
FileUtil
.
copy
(
input
,
response
.
getOutputStream
());
return
null
;
}
@GetMapping
(
MODEL
+
"/simpleUpload.do"
)
public
ModelAndView
simpleUploadPage
(
String
uploadUrl
,
String
templatePath
,
String
fileType
)
throws
IOException
{
public
ModelAndView
simpleUploadPage
(
String
uploadUrl
,
String
templatePath
,
String
fileType
)
throws
IOException
{
ModelAndView
view
=
new
ModelAndView
(
"/common/simpleUpload.html"
);
view
.
addObject
(
"uploadUrl"
,
uploadUrl
);
view
.
addObject
(
"templatePath"
,
templatePath
);
view
.
addObject
(
"fileType"
,
fileType
);
view
.
addObject
(
"uploadUrl"
,
uploadUrl
);
view
.
addObject
(
"templatePath"
,
templatePath
);
view
.
addObject
(
"fileType"
,
fileType
);
return
view
;
}
...
...
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/web/IndexController.java
View file @
18144407
...
...
@@ -23,14 +23,11 @@ import com.ibeetl.admin.core.util.PlatformException;
@Controller
public
class
IndexController
{
@Autowired
CorePlatformService
platformService
;
@Autowired
CorePlatformService
platformService
;
@Autowired
CoreUserService
userService
;
@Autowired
CoreUserService
userService
;
@Autowired
HttpRequestLocal
httpRequestLocal
;
@Autowired
HttpRequestLocal
httpRequestLocal
;
@RequestMapping
(
"/"
)
public
ModelAndView
login
()
{
...
...
@@ -38,9 +35,7 @@ public class IndexController {
return
view
;
}
@PostMapping
(
"/user/login"
)
@PostMapping
(
"/login.do"
)
public
ModelAndView
login
(
String
code
,
String
password
)
{
UserLoginInfo
info
=
userService
.
login
(
code
,
password
);
if
(
info
==
null
)
{
...
...
@@ -76,18 +71,18 @@ public class IndexController {
public
ModelAndView
logout
(
HttpServletRequest
request
)
{
HttpSession
session
=
request
.
getSession
();
Enumeration
eum
=
session
.
getAttributeNames
();
while
(
eum
.
hasMoreElements
())
{
String
key
=
(
String
)
eum
.
nextElement
();
while
(
eum
.
hasMoreElements
())
{
String
key
=
(
String
)
eum
.
nextElement
();
session
.
removeAttribute
(
key
);
}
ModelAndView
view
=
new
ModelAndView
(
"redirect:/"
);
return
view
;
}
@RequestMapping
(
"/changeOrg.do"
)
public
ModelAndView
changeOrg
(
HttpServletRequest
request
,
Long
orgId
)
{
public
ModelAndView
changeOrg
(
HttpServletRequest
request
,
Long
orgId
)
{
platformService
.
changeOrg
(
orgId
);
ModelAndView
view
=
new
ModelAndView
(
"redirect:/index.do"
);
return
view
;
}
}
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/web/JsonResult.java
View file @
18144407
...
...
@@ -2,6 +2,7 @@ package com.ibeetl.admin.core.web;
/**
* 描述: json格式数据返回对象,使用CustomJsonResultSerializer 来序列化
*
* @author : lijiazhi
*/
public
class
JsonResult
<
T
>
{
...
...
@@ -34,7 +35,6 @@ public class JsonResult<T> {
this
.
data
=
data
;
}
@Override
public
String
toString
()
{
return
"code="
+
code
+
" message="
+
msg
+
" data="
+
data
;
...
...
@@ -58,14 +58,13 @@ public class JsonResult<T> {
ret
.
setMsg
(
msg
);
return
ret
;
}
public
static
<
T
>
JsonResult
<
T
>
successMessage
(
String
msg
)
{
JsonResult
<
T
>
ret
=
JsonResult
.
success
();
ret
.
setMsg
(
msg
);
return
ret
;
}
public
static
<
T
>
JsonResult
<
T
>
success
()
{
JsonResult
<
T
>
ret
=
new
JsonResult
<
T
>();
ret
.
setCode
(
JsonReturnCode
.
SUCCESS
.
getCode
());
...
...
@@ -73,8 +72,6 @@ public class JsonResult<T> {
return
ret
;
}
public
static
<
T
>
JsonResult
<
T
>
success
(
T
data
)
{
JsonResult
<
T
>
ret
=
JsonResult
.
success
();
ret
.
setData
(
data
);
...
...
@@ -96,6 +93,4 @@ public class JsonResult<T> {
ret
.
setData
(
data
);
return
ret
;
}
}
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/web/JsonReturnCode.java
View file @
18144407
...
...
@@ -2,20 +2,21 @@ package com.ibeetl.admin.core.web;
/**
* 描述: json格式数据返回码
*<ul>
* <li>100 : 用户未登录 </li>
* <li>200 : 成功 </li>
* <li>300 : 失败 </li>
*
* <ul>
* <li>100 : 用户未登录
* <li>200 : 成功
* <li>300 : 失败
* </ul>
*
* @author : Administrator
*/
public
enum
JsonReturnCode
{
NOT_LOGIN
(
"401"
,
"未登录"
),
SUCCESS
(
"200"
,
"成功"
),
FAIL
(
"500"
,
"内部失败"
),
ACCESS_ERROR
(
"403"
,
"禁止访问"
),
NOT_FOUND
(
"404"
,
"页面未发现"
);
NOT_LOGIN
(
"401"
,
"未登录"
),
SUCCESS
(
"200"
,
"成功"
),
FAIL
(
"500"
,
"内部失败"
),
ACCESS_ERROR
(
"403"
,
"禁止访问"
),
NOT_FOUND
(
"404"
,
"页面未发现"
);
private
String
code
;
private
String
desc
;
...
...
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/web/dto/FunctionNodeView.java
View file @
18144407
...
...
@@ -11,29 +11,36 @@ public class FunctionNodeView {
private
Long
id
;
String
icon
;
List
<
FunctionNodeView
>
children
=
new
ArrayList
<
FunctionNodeView
>();
List
<
FunctionNodeView
>
children
=
new
ArrayList
<
FunctionNodeView
>();
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
List
<
FunctionNodeView
>
getChildren
()
{
return
children
;
}
public
void
setChildren
(
List
<
FunctionNodeView
>
children
)
{
this
.
children
=
children
;
}
...
...
@@ -41,14 +48,16 @@ public class FunctionNodeView {
public
String
getIcon
()
{
return
icon
;
}
public
void
setIcon
(
String
icon
)
{
this
.
icon
=
icon
;
}
public
String
getAccessUrl
()
{
return
accessUrl
;
}
public
void
setAccessUrl
(
String
accessUrl
)
{
this
.
accessUrl
=
accessUrl
;
}
}
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/web/dto/MenuNodeView.java
View file @
18144407
...
...
@@ -59,5 +59,4 @@ public class MenuNodeView {
public
void
setIcon
(
String
icon
)
{
this
.
icon
=
icon
;
}
}
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/web/dto/SystemMenuView.java
View file @
18144407
...
...
@@ -44,5 +44,4 @@ public class SystemMenuView {
public
void
setIcon
(
String
icon
)
{
this
.
icon
=
icon
;
}
}
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/web/query/PageParam.java
View file @
18144407
...
...
@@ -8,6 +8,7 @@ import java.lang.reflect.Field;
/**
* 子类继承此类获得翻页功能
*
* @author lijiazhi
*/
public
class
PageParam
{
...
...
@@ -24,19 +25,19 @@ public class PageParam {
@JsonIgnore
public
PageQuery
getPageQuery
()
{
Field
[]
fs
=
this
.
getClass
().
getDeclaredFields
();
for
(
Field
f
:
fs
){
Field
[]
fs
=
this
.
getClass
().
getDeclaredFields
();
for
(
Field
f
:
fs
)
{
Query
query
=
f
.
getAnnotation
(
Query
.
class
);
if
(
query
==
null
){
continue
;
if
(
query
==
null
)
{
continue
;
}
if
(
query
.
fuzzy
())
{
try
{
if
(
f
.
getType
()
==
String
.
class
)
{
if
(
f
.
getType
()
==
String
.
class
)
{
f
.
setAccessible
(
true
);
Object
o
=
f
.
get
(
this
);
if
(
o
!=
null
&&
!
o
.
toString
().
isEmpty
())
{
f
.
set
(
this
,
"%"
+
o
.
toString
()
+
"%"
);
f
.
set
(
this
,
"%"
+
o
.
toString
()
+
"%"
);
}
}
}
catch
(
IllegalAccessException
e
)
{
...
...
@@ -60,6 +61,4 @@ public class PageParam {
public
void
setLimit
(
Integer
limit
)
{
this
.
limit
=
limit
;
}
}
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/web/query/QueryData.java
View file @
18144407
...
...
@@ -6,17 +6,18 @@ import java.util.List;
public
class
QueryData
{
List
<
QueryItem
>
all
=
new
ArrayList
<>();
List
<
QueryItem
>
defaultItems
=
new
ArrayList
<>();
public
List
<
QueryItem
>
getQueryItems
(){
public
List
<
QueryItem
>
getQueryItems
()
{
return
all
;
}
public
List
<
QueryItem
>
getDefaultItems
(){
public
List
<
QueryItem
>
getDefaultItems
()
{
return
defaultItems
;
}
public
void
addQueryItem
(
QueryItem
item
){
public
void
addQueryItem
(
QueryItem
item
)
{
all
.
add
(
item
);
if
(
item
.
isShow
()){
if
(
item
.
isShow
())
{
defaultItems
.
add
(
item
);
}
}
...
...
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/web/query/QueryItem.java
View file @
18144407
...
...
@@ -2,42 +2,50 @@ package com.ibeetl.admin.core.web.query;
/**
* 查询选项
* @author lijiazhi
*
* @author lijiazhi
*/
public
class
QueryItem
{
private
String
fieldName
;
private
String
name
;
private
int
type
=
1
;
private
boolean
show
=
false
;
private
String
dictName
=
""
;
private
int
type
=
1
;
private
boolean
show
=
false
;
private
String
dictName
=
""
;
private
boolean
fuzzy
=
false
;
private
String
group
=
null
;
public
String
getFieldName
()
{
return
fieldName
;
}
public
void
setFieldName
(
String
fieldName
)
{
this
.
fieldName
=
fieldName
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
public
int
getType
()
{
return
type
;
}
public
void
setType
(
int
type
)
{
this
.
type
=
type
;
}
public
boolean
isShow
()
{
return
show
;
}
public
void
setShow
(
boolean
show
)
{
this
.
show
=
show
;
}
public
String
getDictName
()
{
return
dictName
;
}
...
...
@@ -45,18 +53,20 @@ public class QueryItem {
public
void
setDictName
(
String
dictName
)
{
this
.
dictName
=
dictName
;
}
public
boolean
isFuzzy
()
{
return
fuzzy
;
}
public
void
setFuzzy
(
boolean
fuzzy
)
{
this
.
fuzzy
=
fuzzy
;
}
public
String
getGroup
()
{
return
group
;
}
public
void
setGroup
(
String
group
)
{
this
.
group
=
group
;
}
}
plus-admin/admin-core/src/main/java/com/ibeetl/admin/core/web/query/QueryParser.java
View file @
18144407
...
...
@@ -8,24 +8,25 @@ import com.ibeetl.admin.core.util.ClassLoaderUtil;
/**
* 页面查询条件
* @author lijiazhi
*
* @author lijiazhi
*/
public
class
QueryParser
{
ConcurrentHashMap
<
String
,
QueryData
>
cache
=
new
ConcurrentHashMap
<>
();
public
QueryData
getData
(
String
querClass
){
if
(
cache
.
containsKey
(
querClass
)){
ConcurrentHashMap
<
String
,
QueryData
>
cache
=
new
ConcurrentHashMap
<>();
public
QueryData
getData
(
String
querClass
)
{
if
(
cache
.
containsKey
(
querClass
))
{
return
cache
.
get
(
querClass
);
}
Class
cls
=
ClassLoaderUtil
.
loadClass
(
querClass
);
Field
[]
fs
=
cls
.
getDeclaredFields
();
Field
[]
fs
=
cls
.
getDeclaredFields
();
QueryData
data
=
new
QueryData
();
for
(
Field
f
:
fs
){
for
(
Field
f
:
fs
)
{
Query
query
=
f
.
getAnnotation
(
Query
.
class
);
if
(
query
==
null
){
continue
;
if
(
query
==
null
)
{
continue
;
}
QueryItem
item
=
new
QueryItem
();
item
.
setFieldName
(
f
.
getName
());
...
...
@@ -40,6 +41,5 @@ public class QueryParser {
cache
.
put
(
querClass
,
data
);
return
data
;
}
}
plus-admin/admin-core/src/main/resources/templates/login.html
View file @
18144407
...
...
@@ -33,7 +33,8 @@
<div
class=
"layui-form-item"
>
<label
class=
"layui-form-label"
>
密码
</label>
<div
class=
"layui-input-block"
>
<input
type=
"password"
name=
"password"
lay-verify=
"required"
name=
""
placeholder=
"请输入密码"
autocomplete=
"off"
<input
type=
"password"
name=
"password"
lay-verify=
"required"
name=
""
placeholder=
"请输入密码"
autocomplete=
"off"
class=
"layui-input"
value=
"123456"
>
</div>
</div>
...
...
@@ -42,6 +43,6 @@
<button
class=
"layui-btn"
lay-submit=
""
lay-filter=
"demo1"
>
立即登录
</button>
</div>
</div>
</form>
</form>
</body>
</html>
\ No newline at end of file
plus-admin/intellij-java-google-style.xml
0 → 100644
View file @
18144407
<?xml version="1.0" encoding="UTF-8"?>
<code_scheme
name=
"GoogleStyle"
>
<option
name=
"OTHER_INDENT_OPTIONS"
>
<value>
<option
name=
"INDENT_SIZE"
value=
"2"
/>
<option
name=
"CONTINUATION_INDENT_SIZE"
value=
"4"
/>
<option
name=
"TAB_SIZE"
value=
"2"
/>
<option
name=
"USE_TAB_CHARACTER"
value=
"false"
/>
<option
name=
"SMART_TABS"
value=
"false"
/>
<option
name=
"LABEL_INDENT_SIZE"
value=
"0"
/>
<option
name=
"LABEL_INDENT_ABSOLUTE"
value=
"false"
/>
<option
name=
"USE_RELATIVE_INDENTS"
value=
"false"
/>
</value>
</option>
<option
name=
"INSERT_INNER_CLASS_IMPORTS"
value=
"true"
/>
<option
name=
"CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND"
value=
"999"
/>
<option
name=
"NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND"
value=
"999"
/>
<option
name=
"PACKAGES_TO_USE_IMPORT_ON_DEMAND"
>
<value
/>
</option>
<option
name=
"IMPORT_LAYOUT_TABLE"
>
<value>
<package
name=
""
withSubpackages=
"true"
static=
"true"
/>
<emptyLine
/>
<package
name=
""
withSubpackages=
"true"
static=
"false"
/>
</value>
</option>
<option
name=
"RIGHT_MARGIN"
value=
"100"
/>
<option
name=
"JD_ALIGN_PARAM_COMMENTS"
value=
"false"
/>
<option
name=
"JD_ALIGN_EXCEPTION_COMMENTS"
value=
"false"
/>
<option
name=
"JD_P_AT_EMPTY_LINES"
value=
"false"
/>
<option
name=
"JD_KEEP_EMPTY_PARAMETER"
value=
"false"
/>
<option
name=
"JD_KEEP_EMPTY_EXCEPTION"
value=
"false"
/>
<option
name=
"JD_KEEP_EMPTY_RETURN"
value=
"false"
/>
<option
name=
"KEEP_CONTROL_STATEMENT_IN_ONE_LINE"
value=
"false"
/>
<option
name=
"KEEP_BLANK_LINES_BEFORE_RBRACE"
value=
"0"
/>
<option
name=
"KEEP_BLANK_LINES_IN_CODE"
value=
"1"
/>
<option
name=
"BLANK_LINES_AFTER_CLASS_HEADER"
value=
"0"
/>
<option
name=
"ALIGN_MULTILINE_PARAMETERS"
value=
"false"
/>
<option
name=
"ALIGN_MULTILINE_FOR"
value=
"false"
/>
<option
name=
"CALL_PARAMETERS_WRAP"
value=
"1"
/>
<option
name=
"METHOD_PARAMETERS_WRAP"
value=
"1"
/>
<option
name=
"EXTENDS_LIST_WRAP"
value=
"1"
/>
<option
name=
"THROWS_KEYWORD_WRAP"
value=
"1"
/>
<option
name=
"METHOD_CALL_CHAIN_WRAP"
value=
"1"
/>
<option
name=
"BINARY_OPERATION_WRAP"
value=
"1"
/>
<option
name=
"BINARY_OPERATION_SIGN_ON_NEXT_LINE"
value=
"true"
/>
<option
name=
"TERNARY_OPERATION_WRAP"
value=
"1"
/>
<option
name=
"TERNARY_OPERATION_SIGNS_ON_NEXT_LINE"
value=
"true"
/>
<option
name=
"FOR_STATEMENT_WRAP"
value=
"1"
/>
<option
name=
"ARRAY_INITIALIZER_WRAP"
value=
"1"
/>
<option
name=
"WRAP_COMMENTS"
value=
"true"
/>
<option
name=
"IF_BRACE_FORCE"
value=
"3"
/>
<option
name=
"DOWHILE_BRACE_FORCE"
value=
"3"
/>
<option
name=
"WHILE_BRACE_FORCE"
value=
"3"
/>
<option
name=
"FOR_BRACE_FORCE"
value=
"3"
/>
<option
name=
"SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE"
value=
"true"
/>
<AndroidXmlCodeStyleSettings>
<option
name=
"USE_CUSTOM_SETTINGS"
value=
"true"
/>
<option
name=
"LAYOUT_SETTINGS"
>
<value>
<option
name=
"INSERT_BLANK_LINE_BEFORE_TAG"
value=
"false"
/>
</value>
</option>
</AndroidXmlCodeStyleSettings>
<JSCodeStyleSettings>
<option
name=
"INDENT_CHAINED_CALLS"
value=
"false"
/>
</JSCodeStyleSettings>
<Python>
<option
name=
"USE_CONTINUATION_INDENT_FOR_ARGUMENTS"
value=
"true"
/>
</Python>
<TypeScriptCodeStyleSettings>
<option
name=
"INDENT_CHAINED_CALLS"
value=
"false"
/>
</TypeScriptCodeStyleSettings>
<XML>
<option
name=
"XML_ALIGN_ATTRIBUTES"
value=
"false"
/>
<option
name=
"XML_LEGACY_SETTINGS_IMPORTED"
value=
"true"
/>
</XML>
<codeStyleSettings
language=
"CSS"
>
<indentOptions>
<option
name=
"INDENT_SIZE"
value=
"2"
/>
<option
name=
"CONTINUATION_INDENT_SIZE"
value=
"4"
/>
<option
name=
"TAB_SIZE"
value=
"2"
/>
</indentOptions>
</codeStyleSettings>
<codeStyleSettings
language=
"ECMA Script Level 4"
>
<option
name=
"KEEP_BLANK_LINES_IN_CODE"
value=
"1"
/>
<option
name=
"ALIGN_MULTILINE_PARAMETERS"
value=
"false"
/>
<option
name=
"ALIGN_MULTILINE_FOR"
value=
"false"
/>
<option
name=
"CALL_PARAMETERS_WRAP"
value=
"1"
/>
<option
name=
"METHOD_PARAMETERS_WRAP"
value=
"1"
/>
<option
name=
"EXTENDS_LIST_WRAP"
value=
"1"
/>
<option
name=
"BINARY_OPERATION_WRAP"
value=
"1"
/>
<option
name=
"BINARY_OPERATION_SIGN_ON_NEXT_LINE"
value=
"true"
/>
<option
name=
"TERNARY_OPERATION_WRAP"
value=
"1"
/>
<option
name=
"TERNARY_OPERATION_SIGNS_ON_NEXT_LINE"
value=
"true"
/>
<option
name=
"FOR_STATEMENT_WRAP"
value=
"1"
/>
<option
name=
"ARRAY_INITIALIZER_WRAP"
value=
"1"
/>
<option
name=
"IF_BRACE_FORCE"
value=
"3"
/>
<option
name=
"DOWHILE_BRACE_FORCE"
value=
"3"
/>
<option
name=
"WHILE_BRACE_FORCE"
value=
"3"
/>
<option
name=
"FOR_BRACE_FORCE"
value=
"3"
/>
<option
name=
"PARENT_SETTINGS_INSTALLED"
value=
"true"
/>
</codeStyleSettings>
<codeStyleSettings
language=
"HTML"
>
<indentOptions>
<option
name=
"INDENT_SIZE"
value=
"2"
/>
<option
name=
"CONTINUATION_INDENT_SIZE"
value=
"4"
/>
<option
name=
"TAB_SIZE"
value=
"2"
/>
</indentOptions>
</codeStyleSettings>
<codeStyleSettings
language=
"JAVA"
>
<option
name=
"KEEP_CONTROL_STATEMENT_IN_ONE_LINE"
value=
"false"
/>
<option
name=
"KEEP_BLANK_LINES_IN_CODE"
value=
"1"
/>
<option
name=
"BLANK_LINES_AFTER_CLASS_HEADER"
value=
"1"
/>
<option
name=
"ALIGN_MULTILINE_PARAMETERS"
value=
"false"
/>
<option
name=
"ALIGN_MULTILINE_RESOURCES"
value=
"false"
/>
<option
name=
"ALIGN_MULTILINE_FOR"
value=
"false"
/>
<option
name=
"CALL_PARAMETERS_WRAP"
value=
"1"
/>
<option
name=
"METHOD_PARAMETERS_WRAP"
value=
"1"
/>
<option
name=
"EXTENDS_LIST_WRAP"
value=
"1"
/>
<option
name=
"THROWS_KEYWORD_WRAP"
value=
"1"
/>
<option
name=
"METHOD_CALL_CHAIN_WRAP"
value=
"1"
/>
<option
name=
"BINARY_OPERATION_WRAP"
value=
"1"
/>
<option
name=
"BINARY_OPERATION_SIGN_ON_NEXT_LINE"
value=
"true"
/>
<option
name=
"TERNARY_OPERATION_WRAP"
value=
"1"
/>
<option
name=
"TERNARY_OPERATION_SIGNS_ON_NEXT_LINE"
value=
"true"
/>
<option
name=
"FOR_STATEMENT_WRAP"
value=
"1"
/>
<option
name=
"ARRAY_INITIALIZER_WRAP"
value=
"1"
/>
<option
name=
"WRAP_COMMENTS"
value=
"true"
/>
<option
name=
"IF_BRACE_FORCE"
value=
"3"
/>
<option
name=
"DOWHILE_BRACE_FORCE"
value=
"3"
/>
<option
name=
"WHILE_BRACE_FORCE"
value=
"3"
/>
<option
name=
"FOR_BRACE_FORCE"
value=
"3"
/>
<option
name=
"PARENT_SETTINGS_INSTALLED"
value=
"true"
/>
<indentOptions>
<option
name=
"INDENT_SIZE"
value=
"2"
/>
<option
name=
"CONTINUATION_INDENT_SIZE"
value=
"4"
/>
<option
name=
"TAB_SIZE"
value=
"2"
/>
</indentOptions>
</codeStyleSettings>
<codeStyleSettings
language=
"JSON"
>
<indentOptions>
<option
name=
"CONTINUATION_INDENT_SIZE"
value=
"4"
/>
<option
name=
"TAB_SIZE"
value=
"2"
/>
</indentOptions>
</codeStyleSettings>
<codeStyleSettings
language=
"JavaScript"
>
<option
name=
"RIGHT_MARGIN"
value=
"80"
/>
<option
name=
"KEEP_BLANK_LINES_IN_CODE"
value=
"1"
/>
<option
name=
"ALIGN_MULTILINE_PARAMETERS"
value=
"false"
/>
<option
name=
"ALIGN_MULTILINE_FOR"
value=
"false"
/>
<option
name=
"CALL_PARAMETERS_WRAP"
value=
"1"
/>
<option
name=
"METHOD_PARAMETERS_WRAP"
value=
"1"
/>
<option
name=
"BINARY_OPERATION_WRAP"
value=
"1"
/>
<option
name=
"BINARY_OPERATION_SIGN_ON_NEXT_LINE"
value=
"true"
/>
<option
name=
"TERNARY_OPERATION_WRAP"
value=
"1"
/>
<option
name=
"TERNARY_OPERATION_SIGNS_ON_NEXT_LINE"
value=
"true"
/>
<option
name=
"FOR_STATEMENT_WRAP"
value=
"1"
/>
<option
name=
"ARRAY_INITIALIZER_WRAP"
value=
"1"
/>
<option
name=
"IF_BRACE_FORCE"
value=
"3"
/>
<option
name=
"DOWHILE_BRACE_FORCE"
value=
"3"
/>
<option
name=
"WHILE_BRACE_FORCE"
value=
"3"
/>
<option
name=
"FOR_BRACE_FORCE"
value=
"3"
/>
<option
name=
"PARENT_SETTINGS_INSTALLED"
value=
"true"
/>
<indentOptions>
<option
name=
"INDENT_SIZE"
value=
"2"
/>
<option
name=
"TAB_SIZE"
value=
"2"
/>
</indentOptions>
</codeStyleSettings>
<codeStyleSettings
language=
"PROTO"
>
<option
name=
"RIGHT_MARGIN"
value=
"80"
/>
<indentOptions>
<option
name=
"INDENT_SIZE"
value=
"2"
/>
<option
name=
"CONTINUATION_INDENT_SIZE"
value=
"2"
/>
<option
name=
"TAB_SIZE"
value=
"2"
/>
</indentOptions>
</codeStyleSettings>
<codeStyleSettings
language=
"protobuf"
>
<option
name=
"RIGHT_MARGIN"
value=
"80"
/>
<indentOptions>
<option
name=
"INDENT_SIZE"
value=
"2"
/>
<option
name=
"CONTINUATION_INDENT_SIZE"
value=
"2"
/>
<option
name=
"TAB_SIZE"
value=
"2"
/>
</indentOptions>
</codeStyleSettings>
<codeStyleSettings
language=
"Python"
>
<option
name=
"KEEP_BLANK_LINES_IN_CODE"
value=
"1"
/>
<option
name=
"RIGHT_MARGIN"
value=
"80"
/>
<option
name=
"ALIGN_MULTILINE_PARAMETERS"
value=
"false"
/>
<option
name=
"PARENT_SETTINGS_INSTALLED"
value=
"true"
/>
<indentOptions>
<option
name=
"INDENT_SIZE"
value=
"2"
/>
<option
name=
"CONTINUATION_INDENT_SIZE"
value=
"4"
/>
<option
name=
"TAB_SIZE"
value=
"2"
/>
</indentOptions>
</codeStyleSettings>
<codeStyleSettings
language=
"SASS"
>
<indentOptions>
<option
name=
"CONTINUATION_INDENT_SIZE"
value=
"4"
/>
<option
name=
"TAB_SIZE"
value=
"2"
/>
</indentOptions>
</codeStyleSettings>
<codeStyleSettings
language=
"SCSS"
>
<indentOptions>
<option
name=
"CONTINUATION_INDENT_SIZE"
value=
"4"
/>
<option
name=
"TAB_SIZE"
value=
"2"
/>
</indentOptions>
</codeStyleSettings>
<codeStyleSettings
language=
"TypeScript"
>
<indentOptions>
<option
name=
"INDENT_SIZE"
value=
"2"
/>
<option
name=
"TAB_SIZE"
value=
"2"
/>
</indentOptions>
</codeStyleSettings>
<codeStyleSettings
language=
"XML"
>
<indentOptions>
<option
name=
"INDENT_SIZE"
value=
"2"
/>
<option
name=
"CONTINUATION_INDENT_SIZE"
value=
"2"
/>
<option
name=
"TAB_SIZE"
value=
"2"
/>
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>
xmlns:android
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
^$
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
xmlns:.*
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
^$
</XML_NAMESPACE>
</AND>
</match>
<order>
BY_NAME
</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:id
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
style
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
^$
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
^$
</XML_NAMESPACE>
</AND>
</match>
<order>
BY_NAME
</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:.*Style
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
<order>
BY_NAME
</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:layout_width
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:layout_height
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:layout_weight
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:layout_margin
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:layout_marginTop
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:layout_marginBottom
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:layout_marginStart
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:layout_marginEnd
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:layout_marginLeft
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:layout_marginRight
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:layout_.*
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
<order>
BY_NAME
</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:padding
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:paddingTop
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:paddingBottom
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:paddingStart
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:paddingEnd
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:paddingLeft
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*:paddingRight
</NAME>
<XML_ATTRIBUTE
/>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*
</NAME>
<XML_NAMESPACE>
http://schemas.android.com/apk/res/android
</XML_NAMESPACE>
</AND>
</match>
<order>
BY_NAME
</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*
</NAME>
<XML_NAMESPACE>
http://schemas.android.com/apk/res-auto
</XML_NAMESPACE>
</AND>
</match>
<order>
BY_NAME
</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*
</NAME>
<XML_NAMESPACE>
http://schemas.android.com/tools
</XML_NAMESPACE>
</AND>
</match>
<order>
BY_NAME
</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>
.*
</NAME>
<XML_NAMESPACE>
.*
</XML_NAMESPACE>
</AND>
</match>
<order>
BY_NAME
</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
<Objective-C>
<option
name=
"INDENT_NAMESPACE_MEMBERS"
value=
"0"
/>
<option
name=
"INDENT_C_STRUCT_MEMBERS"
value=
"2"
/>
<option
name=
"INDENT_CLASS_MEMBERS"
value=
"2"
/>
<option
name=
"INDENT_VISIBILITY_KEYWORDS"
value=
"1"
/>
<option
name=
"INDENT_INSIDE_CODE_BLOCK"
value=
"2"
/>
<option
name=
"KEEP_STRUCTURES_IN_ONE_LINE"
value=
"true"
/>
<option
name=
"FUNCTION_PARAMETERS_WRAP"
value=
"5"
/>
<option
name=
"FUNCTION_CALL_ARGUMENTS_WRAP"
value=
"5"
/>
<option
name=
"TEMPLATE_CALL_ARGUMENTS_WRAP"
value=
"5"
/>
<option
name=
"TEMPLATE_CALL_ARGUMENTS_ALIGN_MULTILINE"
value=
"true"
/>
<option
name=
"ALIGN_INIT_LIST_IN_COLUMNS"
value=
"false"
/>
<option
name=
"SPACE_BEFORE_SUPERCLASS_COLON"
value=
"false"
/>
</Objective-C>
<Objective-C-extensions>
<option
name=
"GENERATE_INSTANCE_VARIABLES_FOR_PROPERTIES"
value=
"ASK"
/>
<option
name=
"RELEASE_STYLE"
value=
"IVAR"
/>
<option
name=
"TYPE_QUALIFIERS_PLACEMENT"
value=
"BEFORE"
/>
<file>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Import"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Macro"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Typedef"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Enum"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Constant"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Global"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Struct"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"FunctionPredecl"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Function"
/>
</file>
<class>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Property"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"Synthesize"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"InitMethod"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"StaticMethod"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"InstanceMethod"
/>
<option
name=
"com.jetbrains.cidr.lang.util.OCDeclarationKind"
value=
"DeallocMethod"
/>
</class>
<extensions>
<pair
source=
"cc"
header=
"h"
/>
<pair
source=
"c"
header=
"h"
/>
</extensions>
</Objective-C-extensions>
<codeStyleSettings
language=
"ObjectiveC"
>
<option
name=
"RIGHT_MARGIN"
value=
"80"
/>
<option
name=
"KEEP_BLANK_LINES_BEFORE_RBRACE"
value=
"1"
/>
<option
name=
"BLANK_LINES_BEFORE_IMPORTS"
value=
"0"
/>
<option
name=
"BLANK_LINES_AFTER_IMPORTS"
value=
"0"
/>
<option
name=
"BLANK_LINES_AROUND_CLASS"
value=
"0"
/>
<option
name=
"BLANK_LINES_AROUND_METHOD"
value=
"0"
/>
<option
name=
"BLANK_LINES_AROUND_METHOD_IN_INTERFACE"
value=
"0"
/>
<option
name=
"ALIGN_MULTILINE_BINARY_OPERATION"
value=
"false"
/>
<option
name=
"BINARY_OPERATION_SIGN_ON_NEXT_LINE"
value=
"true"
/>
<option
name=
"FOR_STATEMENT_WRAP"
value=
"1"
/>
<option
name=
"ASSIGNMENT_WRAP"
value=
"1"
/>
<indentOptions>
<option
name=
"INDENT_SIZE"
value=
"2"
/>
<option
name=
"CONTINUATION_INDENT_SIZE"
value=
"4"
/>
</indentOptions>
</codeStyleSettings>
</code_scheme>
ve-admin/admin-web/src/directive/waves/waves.js
View file @
18144407
...
...
@@ -5,7 +5,8 @@ const context = '@@wavesContext'
function
handleClick
(
el
,
binding
)
{
function
handle
(
e
)
{
const
customOpts
=
Object
.
assign
({},
binding
.
value
)
const
opts
=
Object
.
assign
({
const
opts
=
Object
.
assign
(
{
ele
:
el
,
// 波纹作用元素
type
:
'
hit
'
,
// hit 点击位置扩散 center中心点扩展
color
:
'
rgba(0, 0, 0, 0.15)
'
// 波纹颜色
...
...
@@ -21,7 +22,8 @@ function handleClick(el, binding) {
if
(
!
ripple
)
{
ripple
=
document
.
createElement
(
'
span
'
)
ripple
.
className
=
'
waves-ripple
'
ripple
.
style
.
height
=
ripple
.
style
.
width
=
Math
.
max
(
rect
.
width
,
rect
.
height
)
+
'
px
'
ripple
.
style
.
height
=
ripple
.
style
.
width
=
Math
.
max
(
rect
.
width
,
rect
.
height
)
+
'
px
'
target
.
appendChild
(
ripple
)
}
else
{
ripple
.
className
=
'
waves-ripple
'
...
...
@@ -33,11 +35,17 @@ function handleClick(el, binding) {
break
default
:
ripple
.
style
.
top
=
(
e
.
pageY
-
rect
.
top
-
ripple
.
offsetHeight
/
2
-
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
)
+
'
px
'
(
e
.
pageY
-
rect
.
top
-
ripple
.
offsetHeight
/
2
-
document
.
documentElement
.
scrollTop
||
document
.
body
.
scrollTop
)
+
'
px
'
ripple
.
style
.
left
=
(
e
.
pageX
-
rect
.
left
-
ripple
.
offsetWidth
/
2
-
document
.
documentElement
.
scrollLeft
||
document
.
body
.
scrollLeft
)
+
'
px
'
(
e
.
pageX
-
rect
.
left
-
ripple
.
offsetWidth
/
2
-
document
.
documentElement
.
scrollLeft
||
document
.
body
.
scrollLeft
)
+
'
px
'
}
ripple
.
style
.
backgroundColor
=
opts
.
color
ripple
.
className
=
'
waves-ripple z-active
'
...
...
Prev
1
…
5
6
7
8
9
Next
Write
Preview
Supports
Markdown
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