Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
finance-manage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
finance-oa
finance-manage
Commits
b5da42f0
Commit
b5da42f0
authored
Nov 17, 2022
by
jianglingfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gitee.com/jlf1764/finance_oa
parents
e608090b
3e312830
Changes
24
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
1957 additions
and
942 deletions
+1957
-942
ruoyi-admin/src/main/java/com/ruoyi/web/controller/finance/FncSubjectTypeController.java
...uoyi/web/controller/finance/FncSubjectTypeController.java
+141
-0
ruoyi-admin/src/main/resources/application-druid.yml
ruoyi-admin/src/main/resources/application-druid.yml
+1
-1
ruoyi-common/pom.xml
ruoyi-common/pom.xml
+6
-0
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java
...rc/main/java/com/ruoyi/common/core/domain/BaseEntity.java
+2
-0
ruoyi-common/src/main/java/com/ruoyi/common/core/page/PagePlus.java
...on/src/main/java/com/ruoyi/common/core/page/PagePlus.java
+156
-0
ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java
...c/main/java/com/ruoyi/common/core/page/TableDataInfo.java
+33
-58
ruoyi-common/src/main/java/com/ruoyi/common/utils/EmptyUtil.java
...ommon/src/main/java/com/ruoyi/common/utils/EmptyUtil.java
+106
-0
ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java
...ommon/src/main/java/com/ruoyi/common/utils/PageUtils.java
+127
-7
ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java
...src/main/java/com/ruoyi/generator/util/VelocityUtils.java
+74
-124
ruoyi-generator/src/main/resources/vm/java/controller.java.vm
...i-generator/src/main/resources/vm/java/controller.java.vm
+58
-75
ruoyi-generator/src/main/resources/vm/js/api.js.vm
ruoyi-generator/src/main/resources/vm/js/api.js.vm
+15
-6
ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
+532
-529
ruoyi-system/src/main/java/com/ruoyi/system/domain/FncSubjectType.java
...src/main/java/com/ruoyi/system/domain/FncSubjectType.java
+52
-0
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/FncSubjectTypeVo.java
...ain/java/com/ruoyi/system/domain/vo/FncSubjectTypeVo.java
+23
-0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/FncSubjectTypeMapper.java
...in/java/com/ruoyi/system/mapper/FncSubjectTypeMapper.java
+25
-0
ruoyi-system/src/main/java/com/ruoyi/system/service/IFncSubjectTypeService.java
...java/com/ruoyi/system/service/IFncSubjectTypeService.java
+41
-0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FncSubjectTypeServiceImpl.java
.../ruoyi/system/service/impl/FncSubjectTypeServiceImpl.java
+37
-0
ruoyi-system/src/main/resources/mapper/finance/FncSubjectTypeMapper.xml
...rc/main/resources/mapper/finance/FncSubjectTypeMapper.xml
+40
-0
ruoyi-ui/src/api/finance/subjectType.js
ruoyi-ui/src/api/finance/subjectType.js
+60
-0
ruoyi-ui/src/utils/ruoyi.js
ruoyi-ui/src/utils/ruoyi.js
+3
-1
ruoyi-ui/src/views/finance/ledger/index.vue
ruoyi-ui/src/views/finance/ledger/index.vue
+3
-3
ruoyi-ui/src/views/finance/subjecttype/index.vue
ruoyi-ui/src/views/finance/subjecttype/index.vue
+254
-0
ruoyi-ui/src/views/system/dept/index.vue
ruoyi-ui/src/views/system/dept/index.vue
+22
-67
sql/ry-vue.sql
sql/ry-vue.sql
+146
-71
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/finance/FncSubjectTypeController.java
0 → 100644
View file @
b5da42f0
package
com.ruoyi.web.controller.finance
;
import
ch.qos.logback.core.pattern.ConverterUtil
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.entity.SysDept
;
import
com.ruoyi.common.enums.BusinessType
;
import
com.ruoyi.common.utils.EmptyUtil
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.poi.ExcelUtil
;
import
com.ruoyi.system.domain.FncSubjectType
;
import
com.ruoyi.system.domain.vo.FncSubjectTypeVo
;
import
com.ruoyi.system.service.IFncSubjectTypeService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
/**
* 科目类别Controller
*
* @author jlf
* @date 2022-11-17
*/
@Api
(
tags
=
"科目类别Controller"
)
@RestController
@RequestMapping
(
"/finance/subjectType"
)
//@RequiredArgsConstructor(onConstructor = @Autowired)
public
class
FncSubjectTypeController
extends
BaseController
{
@Autowired
private
IFncSubjectTypeService
fncSubjectTypeService
;
@ApiOperation
(
"查询科目类别列表"
)
@PreAuthorize
(
"@ss.hasPermi('finance:subjectType:list')"
)
@GetMapping
(
"/list"
)
public
TableDataInfo
<
FncSubjectTypeVo
>
list
(
FncSubjectTypeVo
entity
)
{
return
fncSubjectTypeService
.
queryList
(
entity
);
}
@ApiOperation
(
"查询科目类别所有列表"
)
@GetMapping
(
"/listAll"
)
public
AjaxResult
listAll
(
FncSubjectTypeVo
entity
)
{
return
AjaxResult
.
success
(
"查询成功"
,
fncSubjectTypeService
.
queryAll
(
entity
));
}
/**
* 查询部门列表(排除节点)
*/
@PreAuthorize
(
"@ss.hasPermi('finance:subjectType:list')"
)
@GetMapping
(
"/list/exclude/{id}"
)
public
AjaxResult
excludeChild
(
@PathVariable
(
value
=
"id"
,
required
=
false
)
Long
id
)
{
List
<
FncSubjectType
>
list
=
fncSubjectTypeService
.
list
();
List
<
Long
>
ids
=
new
ArrayList
<>();
//递归获取
if
(
EmptyUtil
.
isNotEmpty
(
list
)
&&
EmptyUtil
.
isNotEmpty
(
id
))
{
list
.
stream
().
filter
(
item
->
item
.
getParentId
()
==
0
).
forEach
(
item
->
{
if
(
item
.
getSubjectTypeId
().
equals
(
id
))
{
return
;
}
else
{
list
.
stream
().
filter
(
child
->
child
.
getParentId
()
==
item
.
getSubjectTypeId
()).
forEach
(
child
->
{
ids
.
add
(
child
.
getSubjectTypeId
());
excludeChild
(
list
,
child
,
id
,
ids
);
});
}
});
}
list
.
removeIf
(
d
->
d
.
getSubjectTypeId
().
intValue
()
==
id
||
ids
.
contains
(
d
.
getSubjectTypeId
()));
return
success
(
list
);
}
public
void
excludeChild
(
List
<
FncSubjectType
>
list
,
FncSubjectType
entity
,
Long
id
,
List
<
Long
>
ids
)
{
if
(
EmptyUtil
.
isNotEmpty
(
entity
))
{
if
(
entity
.
getSubjectTypeId
().
equals
(
id
))
{
return
;
}
else
{
list
.
stream
().
filter
(
item
->
item
.
getParentId
()
==
entity
.
getSubjectTypeId
()).
forEach
(
child
->
{
ids
.
add
(
child
.
getSubjectTypeId
());
excludeChild
(
list
,
child
,
id
,
ids
);
});
}
}
}
@ApiOperation
(
"导出科目类别列表"
)
@PreAuthorize
(
"@ss.hasPermi('finance:subjectType:export')"
)
@Log
(
title
=
"科目类别"
,
businessType
=
BusinessType
.
EXPORT
)
@PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
FncSubjectTypeVo
entity
)
{
List
<
FncSubjectTypeVo
>
list
=
fncSubjectTypeService
.
queryAll
(
entity
);
ExcelUtil
<
FncSubjectTypeVo
>
util
=
new
ExcelUtil
<>(
FncSubjectTypeVo
.
class
);
util
.
exportExcel
(
response
,
list
,
"科目类别数据"
);
}
@ApiOperation
(
"获取科目类别详细信息"
)
@PreAuthorize
(
"@ss.hasPermi('finance:subjectType:query')"
)
@GetMapping
(
value
=
"/getInfo/{subjectTypeId}"
)
public
AjaxResult
getInfo
(
@PathVariable
(
"subjectTypeId"
)
Long
subjectTypeId
)
{
return
AjaxResult
.
success
(
"查询成功"
,
fncSubjectTypeService
.
queryById
(
subjectTypeId
));
}
@ApiOperation
(
"新增科目类别"
)
@PreAuthorize
(
"@ss.hasPermi('finance:subjectType:add')"
)
@Log
(
title
=
"科目类别"
,
businessType
=
BusinessType
.
INSERT
)
@PostMapping
(
"add"
)
public
AjaxResult
add
(
@RequestBody
FncSubjectType
entity
)
{
return
toAjax
(
fncSubjectTypeService
.
save
(
entity
));
}
@ApiOperation
(
"修改科目类别"
)
@PreAuthorize
(
"@ss.hasPermi('finance:subjectType:edit')"
)
@Log
(
title
=
"科目类别"
,
businessType
=
BusinessType
.
UPDATE
)
@PostMapping
(
"edit"
)
public
AjaxResult
edit
(
@RequestBody
FncSubjectType
entity
)
{
return
toAjax
(
fncSubjectTypeService
.
updateById
(
entity
));
}
@ApiOperation
(
"删除科目类别"
)
@PreAuthorize
(
"@ss.hasPermi('finance:subjectType:remove')"
)
@Log
(
title
=
"科目类别"
,
businessType
=
BusinessType
.
DELETE
)
@GetMapping
(
"/remove/{subjectTypeIds}"
)
public
AjaxResult
remove
(
@PathVariable
Long
[]
subjectTypeIds
)
{
return
toAjax
(
fncSubjectTypeService
.
removeByIds
(
Arrays
.
asList
(
subjectTypeIds
))
?
1
:
0
);
}
}
ruoyi-admin/src/main/resources/application-druid.yml
View file @
b5da42f0
...
@@ -6,7 +6,7 @@ spring:
...
@@ -6,7 +6,7 @@ spring:
druid
:
druid
:
# 主库数据源
# 主库数据源
master
:
master
:
url
:
jdbc:mysql://
192.168.182.130
:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
url
:
jdbc:mysql://
localhost
:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username
:
root
username
:
root
password
:
root
password
:
root
# 从库数据源
# 从库数据源
...
...
ruoyi-common/pom.xml
View file @
b5da42f0
...
@@ -146,6 +146,12 @@
...
@@ -146,6 +146,12 @@
<groupId>
org.projectlombok
</groupId>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<artifactId>
lombok
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
io.swagger
</groupId>
<artifactId>
swagger-annotations
</artifactId>
<version>
1.6.2
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</dependencies>
...
...
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java
View file @
b5da42f0
...
@@ -49,6 +49,8 @@ public class BaseEntity implements Serializable {
...
@@ -49,6 +49,8 @@ public class BaseEntity implements Serializable {
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
@TableField
(
fill
=
FieldFill
.
INSERT_UPDATE
)
private
Date
updateTime
;
private
Date
updateTime
;
/**
/**
* 请求参数
* 请求参数
*/
*/
...
...
ruoyi-common/src/main/java/com/ruoyi/common/core/page/PagePlus.java
0 → 100644
View file @
b5da42f0
package
com.ruoyi.common.core.page
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.OrderItem
;
import
lombok.Data
;
import
lombok.experimental.Accessors
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.List
;
/**
* 分页 Page 增强对象
*
* @param <T> 数据库实体
* @param <K> vo实体
* @author Lion Li
*/
@Data
@Accessors
(
chain
=
true
)
public
class
PagePlus
<
T
,
K
>
implements
IPage
<
T
>
{
/**
* domain实体列表
*/
private
List
<
T
>
records
=
Collections
.
emptyList
();
/**
* vo实体列表
*/
private
List
<
K
>
recordsVo
=
Collections
.
emptyList
();
/**
* 总数
*/
private
long
total
=
0L
;
/**
* 页长度
*/
private
long
size
=
10L
;
/**
* 当前页
*/
private
long
current
=
1L
;
/**
* 排序字段信息
*/
private
List
<
OrderItem
>
orders
=
new
ArrayList
<>();
/**
* 自动优化 COUNT SQL
*/
private
boolean
optimizeCountSql
=
true
;
/**
* 是否进行 count 查询
*/
private
boolean
isSearchCount
=
true
;
/**
* 是否命中count缓存
*/
private
boolean
hitCount
=
false
;
/**
* countId
*/
private
String
countId
;
/**
* 最大limit
*/
private
Long
maxLimit
;
public
PagePlus
()
{
}
public
PagePlus
(
long
current
,
long
size
)
{
this
(
current
,
size
,
0L
);
}
public
PagePlus
(
long
current
,
long
size
,
long
total
)
{
this
(
current
,
size
,
total
,
true
);
}
public
PagePlus
(
long
current
,
long
size
,
boolean
isSearchCount
)
{
this
(
current
,
size
,
0L
,
isSearchCount
);
}
public
PagePlus
(
long
current
,
long
size
,
long
total
,
boolean
isSearchCount
)
{
if
(
current
>
1L
)
{
this
.
current
=
current
;
}
this
.
size
=
size
;
this
.
total
=
total
;
this
.
isSearchCount
=
isSearchCount
;
}
public
static
<
T
,
K
>
PagePlus
<
T
,
K
>
of
(
long
current
,
long
size
)
{
return
of
(
current
,
size
,
0
);
}
public
static
<
T
,
K
>
PagePlus
<
T
,
K
>
of
(
long
current
,
long
size
,
long
total
)
{
return
of
(
current
,
size
,
total
,
true
);
}
public
static
<
T
,
K
>
PagePlus
<
T
,
K
>
of
(
long
current
,
long
size
,
boolean
searchCount
)
{
return
of
(
current
,
size
,
0
,
searchCount
);
}
public
static
<
T
,
K
>
PagePlus
<
T
,
K
>
of
(
long
current
,
long
size
,
long
total
,
boolean
searchCount
)
{
return
new
PagePlus
<>(
current
,
size
,
total
,
searchCount
);
}
@Override
public
String
countId
()
{
return
this
.
getCountId
();
}
@Override
public
Long
maxLimit
()
{
return
this
.
getMaxLimit
();
}
public
PagePlus
<
T
,
K
>
addOrder
(
OrderItem
...
items
)
{
this
.
orders
.
addAll
(
Arrays
.
asList
(
items
));
return
this
;
}
public
PagePlus
<
T
,
K
>
addOrder
(
List
<
OrderItem
>
items
)
{
this
.
orders
.
addAll
(
items
);
return
this
;
}
@Override
public
List
<
OrderItem
>
orders
()
{
return
this
.
getOrders
();
}
@Override
public
boolean
optimizeCountSql
()
{
return
this
.
optimizeCountSql
;
}
@Override
public
long
getPages
()
{
// 解决 github issues/3208
return
IPage
.
super
.
getPages
();
}
}
ruoyi-common/src/main/java/com/ruoyi/common/core/page/TableDataInfo.java
View file @
b5da42f0
package
com.ruoyi.common.core.page
;
package
com.ruoyi.common.core.page
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
/**
/**
* 表格分页数据对象
* 表格分页数据对象
*
*
* @author
ruoy
i
* @author
Lion L
i
*/
*/
public
class
TableDataInfo
implements
Serializable
{
@Data
@NoArgsConstructor
@Accessors
(
chain
=
true
)
@ApiModel
(
"分页响应对象"
)
public
class
TableDataInfo
<
T
>
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
/** 总记录数 */
/**
* 总记录数
*/
@ApiModelProperty
(
"总记录数"
)
private
long
total
;
private
long
total
;
/** 列表数据 */
/**
private
List
<?>
rows
;
* 列表数据
*/
@ApiModelProperty
(
"列表数据"
)
private
List
<
T
>
rows
;
/** 消息状态码 */
/**
* 消息状态码
*/
@ApiModelProperty
(
"消息状态码"
)
private
int
code
;
private
int
code
;
/** 消息内容 */
private
String
msg
;
/**
/**
*
表格数据对象
*
消息内容
*/
*/
public
TableDataInfo
()
@ApiModelProperty
(
"消息内容"
)
{
private
String
msg
;
}
/**
/**
* 分页
* 分页
...
@@ -37,49 +52,9 @@ public class TableDataInfo implements Serializable
...
@@ -37,49 +52,9 @@ public class TableDataInfo implements Serializable
* @param list 列表数据
* @param list 列表数据
* @param total 总记录数
* @param total 总记录数
*/
*/
public
TableDataInfo
(
List
<?>
list
,
int
total
)
public
TableDataInfo
(
List
<
T
>
list
,
long
total
)
{
{
this
.
rows
=
list
;
this
.
rows
=
list
;
this
.
total
=
total
;
this
.
total
=
total
;
}
}
public
long
getTotal
()
{
return
total
;
}
public
void
setTotal
(
long
total
)
{
this
.
total
=
total
;
}
public
List
<?>
getRows
()
{
return
rows
;
}
public
void
setRows
(
List
<?>
rows
)
{
this
.
rows
=
rows
;
}
public
int
getCode
()
{
return
code
;
}
public
void
setCode
(
int
code
)
{
this
.
code
=
code
;
}
public
String
getMsg
()
{
return
msg
;
}
public
void
setMsg
(
String
msg
)
{
this
.
msg
=
msg
;
}
}
}
ruoyi-common/src/main/java/com/ruoyi/common/utils/EmptyUtil.java
0 → 100644
View file @
b5da42f0
package
com.ruoyi.common.utils
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* 一站式健全判空工具类(可判空 集合、字符串、对象 等各种特殊情况)
*
* @author daizhichao
* @date 2021/9/7
*/
public
class
EmptyUtil
{
/**
* 对象是否为空
*
* @param o String,List,Map,Object[],int[],long[]
* @return
*/
@SuppressWarnings
(
"rawtypes"
)
public
static
boolean
isEmpty
(
Object
o
)
{
if
(
o
==
null
)
{
return
true
;
}
if
(
o
instanceof
String
)
{
if
(
""
.
equals
(
o
.
toString
().
trim
()))
{
return
true
;
}
}
else
if
(
o
instanceof
List
)
{
if
(((
List
)
o
).
size
()
==
0
)
{
return
true
;
}
}
else
if
(
o
instanceof
Map
)
{
if
(((
Map
)
o
).
size
()
==
0
)
{
return
true
;
}
}
else
if
(
o
instanceof
Set
)
{
if
(((
Set
)
o
).
size
()
==
0
)
{
return
true
;
}
}
else
if
(
o
instanceof
Object
[])
{
if
(((
Object
[])
o
).
length
==
0
)
{
return
true
;
}
}
else
if
(
o
instanceof
int
[])
{
if
(((
int
[])
o
).
length
==
0
)
{
return
true
;
}
}
else
if
(
o
instanceof
long
[])
{
if
(((
long
[])
o
).
length
==
0
)
{
return
true
;
}
}
return
false
;
}
public
static
boolean
isEmpty
(
Object
...
o
)
{
boolean
empty
=
false
;
for
(
Object
o1
:
o
)
{
if
(
isEmpty
(
o1
))
{
empty
=
true
;
break
;
}
}
return
empty
;
}
/**
* 对象是否不为空
*
* @param o String,List,Map,Object[],int[],long[]
* @return
*/
public
static
boolean
isNotEmpty
(
Object
o
)
{
return
!
isEmpty
(
o
);
}
/**
* 对象组中是否存在 Empty Object
*
* @param os 对象组
* @return
*/
public
static
boolean
isOneEmpty
(
Object
...
os
)
{
for
(
Object
o
:
os
)
{
return
isEmpty
(
o
);
}
return
false
;
}
/**
* 对象组中是否全是 Empty Object
*
* @param os
* @return
*/
public
static
boolean
isAllEmpty
(
Object
...
os
)
{
for
(
Object
o
:
os
)
{
if
(!
isEmpty
(
o
))
{
return
false
;
}
}
return
true
;
}
}
ruoyi-common/src/main/java/com/ruoyi/common/utils/PageUtils.java
View file @
b5da42f0
package
com.ruoyi.common.utils
;
package
com.ruoyi.common.utils
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.http.HttpStatus
;
import
com.baomidou.mybatisplus.core.metadata.OrderItem
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.ruoyi.common.core.page.PageDomain
;
import
com.ruoyi.common.core.page.PageDomain
;
import
com.ruoyi.common.core.page.PagePlus
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.common.core.page.TableSupport
;
import
com.ruoyi.common.core.page.TableSupport
;
import
com.ruoyi.common.utils.sql.SqlUtil
;
import
com.ruoyi.common.utils.sql.SqlUtil
;
import
java.util.List
;
/**
/**
* 分页工具类
* 分页工具类
*
*
* @author ruoyi
* @author ruoyi
*/
*/
public
class
PageUtils
extends
PageHelper
public
class
PageUtils
extends
PageHelper
{
{
/**
/**
* 设置请求分页数据
* 设置请求分页数据
*/
*/
public
static
void
startPage
()
public
static
void
startPage
()
{
{
PageDomain
pageDomain
=
TableSupport
.
buildPageRequest
();
PageDomain
pageDomain
=
TableSupport
.
buildPageRequest
();
Integer
pageNum
=
pageDomain
.
getPageNum
();
Integer
pageNum
=
pageDomain
.
getPageNum
();
Integer
pageSize
=
pageDomain
.
getPageSize
();
Integer
pageSize
=
pageDomain
.
getPageSize
();
...
@@ -28,8 +34,122 @@ public class PageUtils extends PageHelper
...
@@ -28,8 +34,122 @@ public class PageUtils extends PageHelper
/**
/**
* 清理分页的线程变量
* 清理分页的线程变量
*/
*/
public
static
void
clearPage
()
public
static
void
clearPage
()
{
{
PageHelper
.
clearPage
();
PageHelper
.
clearPage
();
}
}
/**
* 当前记录起始索引
*/
public
static
final
String
PAGE_NUM
=
"pageNum"
;
/**
* 每页显示记录数
*/
public
static
final
String
PAGE_SIZE
=
"pageSize"
;
/**
* 排序列
*/
public
static
final
String
ORDER_BY_COLUMN
=
"orderByColumn"
;
/**
* 排序的方向 "desc" 或者 "asc".
*/
public
static
final
String
IS_ASC
=
"isAsc"
;
/**
* 当前记录起始索引 默认值
*/
public
static
final
int
DEFAULT_PAGE_NUM
=
1
;
/**
* 每页显示记录数 默认值 默认查全部
*/
public
static
final
int
DEFAULT_PAGE_SIZE
=
Integer
.
MAX_VALUE
;
/**
* 构建 plus 分页对象
*
* @param <T> domain 实体
* @param <K> vo 实体
* @return 分页对象
*/
public
static
<
T
,
K
>
PagePlus
<
T
,
K
>
buildPagePlus
()
{
Integer
pageNum
=
ServletUtils
.
getParameterToInt
(
PAGE_NUM
,
DEFAULT_PAGE_NUM
);
Integer
pageSize
=
ServletUtils
.
getParameterToInt
(
PAGE_SIZE
,
DEFAULT_PAGE_SIZE
);
String
orderByColumn
=
ServletUtils
.
getParameter
(
ORDER_BY_COLUMN
);
String
isAsc
=
ServletUtils
.
getParameter
(
IS_ASC
);
PagePlus
<
T
,
K
>
page
=
new
PagePlus
<>(
pageNum
,
pageSize
);
if
(
StrUtil
.
isNotBlank
(
orderByColumn
))
{
String
orderBy
=
SqlUtil
.
escapeOrderBySql
(
orderByColumn
);
if
(
"asc"
.
equals
(
isAsc
))
{
page
.
addOrder
(
OrderItem
.
asc
(
orderBy
));
}
else
if
(
"desc"
.
equals
(
isAsc
))
{
page
.
addOrder
(
OrderItem
.
desc
(
orderBy
));
}
}
return
page
;
}
public
static
<
T
>
Page
<
T
>
buildPage
()
{
return
buildPage
(
null
,
null
);
}
/**
* 构建 MP 普通分页对象
*
* @param <T> domain 实体
* @return 分页对象
*/
public
static
<
T
>
Page
<
T
>
buildPage
(
String
defaultOrderByColumn
,
String
defaultIsAsc
)
{
Integer
pageNum
=
ServletUtils
.
getParameterToInt
(
PAGE_NUM
,
DEFAULT_PAGE_NUM
);
Integer
pageSize
=
ServletUtils
.
getParameterToInt
(
PAGE_SIZE
,
DEFAULT_PAGE_SIZE
);
String
orderByColumn
=
ServletUtils
.
getParameter
(
ORDER_BY_COLUMN
,
defaultOrderByColumn
);
String
isAsc
=
ServletUtils
.
getParameter
(
IS_ASC
,
defaultIsAsc
);
// 兼容前端排序类型
if
(
"ascending"
.
equals
(
isAsc
))
{
isAsc
=
"asc"
;
}
else
if
(
"descending"
.
equals
(
isAsc
))
{
isAsc
=
"desc"
;
}
Page
<
T
>
page
=
new
Page
<>(
pageNum
,
pageSize
);
if
(
StrUtil
.
isNotBlank
(
orderByColumn
))
{
String
orderBy
=
SqlUtil
.
escapeOrderBySql
(
orderByColumn
);
orderBy
=
StrUtil
.
toUnderlineCase
(
orderBy
);
if
(
"asc"
.
equals
(
isAsc
))
{
page
.
addOrder
(
OrderItem
.
asc
(
orderBy
));
}
else
if
(
"desc"
.
equals
(
isAsc
))
{
page
.
addOrder
(
OrderItem
.
desc
(
orderBy
));
}
}
return
page
;
}
public
static
<
T
,
K
>
TableDataInfo
<
K
>
buildDataInfo
(
PagePlus
<
T
,
K
>
page
)
{
TableDataInfo
<
K
>
rspData
=
new
TableDataInfo
<>();
rspData
.
setCode
(
HttpStatus
.
HTTP_OK
);
rspData
.
setMsg
(
"查询成功"
);
rspData
.
setRows
(
page
.
getRecordsVo
());
rspData
.
setTotal
(
page
.
getTotal
());
return
rspData
;
}
public
static
<
T
>
TableDataInfo
<
T
>
buildDataInfo
(
Page
<
T
>
page
)
{
TableDataInfo
<
T
>
rspData
=
new
TableDataInfo
<>();
rspData
.
setCode
(
HttpStatus
.
HTTP_OK
);
rspData
.
setMsg
(
"查询成功"
);
rspData
.
setRows
(
page
.
getRecords
());
rspData
.
setTotal
(
page
.
getTotal
());
return
rspData
;
}
public
static
<
T
>
TableDataInfo
<
T
>
buildDataInfo
(
List
<
T
>
list
)
{
TableDataInfo
<
T
>
rspData
=
new
TableDataInfo
<>();
rspData
.
setCode
(
HttpStatus
.
HTTP_OK
);
rspData
.
setMsg
(
"查询成功"
);
rspData
.
setRows
(
list
);
rspData
.
setTotal
(
list
.
size
());
return
rspData
;
}
}
}
ruoyi-generator/src/main/java/com/ruoyi/generator/util/VelocityUtils.java
View file @
b5da42f0
This diff is collapsed.
Click to expand it.
ruoyi-generator/src/main/resources/vm/java/controller.java.vm
View file @
b5da42f0
package
${
packageName
}.
controller
;
package
${
packageName
}.
controller
;
import
java
.
util
.
List
;
import
javax
.
servlet
.
http
.
HttpServletResponse
;
import
org
.
springframework
.
security
.
access
.
prepost
.
PreAuthorize
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
web
.
bind
.
annotation
.
GetMapping
;
import
org
.
springframework
.
web
.
bind
.
annotation
.
PostMapping
;
import
org
.
springframework
.
web
.
bind
.
annotation
.
PutMapping
;
import
org
.
springframework
.
web
.
bind
.
annotation
.
DeleteMapping
;
import
org
.
springframework
.
web
.
bind
.
annotation
.
PathVariable
;
import
org
.
springframework
.
web
.
bind
.
annotation
.
RequestBody
;
import
org
.
springframework
.
web
.
bind
.
annotation
.
RequestMapping
;
import
org
.
springframework
.
web
.
bind
.
annotation
.
RestController
;
import
com
.
ruoyi
.
common
.
annotation
.
Log
;
import
com
.
ruoyi
.
common
.
annotation
.
Log
;
import
com
.
ruoyi
.
common
.
core
.
controller
.
BaseController
;
import
com
.
ruoyi
.
common
.
core
.
controller
.
BaseController
;
import
com
.
ruoyi
.
common
.
core
.
domain
.
AjaxResult
;
import
com
.
ruoyi
.
common
.
core
.
domain
.
AjaxResult
;
import
com
.
ruoyi
.
common
.
enums
.
BusinessType
;
import
com
.
ruoyi
.
common
.
enums
.
BusinessType
;
import
${
packageName
}.
domain
.${
ClassName
};
import
${
packageName
}.
service
.
I
${
ClassName
}
Service
;
import
com
.
ruoyi
.
common
.
utils
.
poi
.
ExcelUtil
;
import
com
.
ruoyi
.
common
.
utils
.
poi
.
ExcelUtil
;
#
if
($
table
.
crud
||
$
table
.
sub
)
import
${
packageName
}.
vo
.${
ClassName
}
Vo
;
import
com
.
ruoyi
.
common
.
core
.
page
.
TableDataInfo
;
import
${
packageName
}.
service
.
I
${
ClassName
}
Service
;
#
elseif
($
table
.
tree
)
import
io
.
swagger
.
annotations
.
Api
;
#
end
import
io
.
swagger
.
annotations
.
ApiOperation
;
import
lombok
.
RequiredArgsConstructor
;
import
org
.
springframework
.
beans
.
factory
.
annotation
.
Autowired
;
import
org
.
springframework
.
security
.
access
.
prepost
.
PreAuthorize
;
import
org
.
springframework
.
web
.
bind
.
annotation
.*;
#
if
($
table
.
crud
||
$
table
.
sub
)
import
com
.
ruoyi
.
common
.
core
.
page
.
TableDataInfo
;
#
elseif
($
table
.
tree
)
#
end
import
javax
.
servlet
.
http
.
HttpServletResponse
;
import
java
.
util
.
Arrays
;
import
java
.
util
.
List
;
/**
/**
*
${
functionName
}
Controller
*
${
functionName
}
Controller
...
@@ -30,86 +28,71 @@ import com.ruoyi.common.core.page.TableDataInfo;
...
@@ -30,86 +28,71 @@ import com.ruoyi.common.core.page.TableDataInfo;
*
@
author
${
author
}
*
@
author
${
author
}
*
@
date
${
datetime
}
*
@
date
${
datetime
}
*/
*/
@
Api
(
tags
=
"${functionName}Controller"
)
@
RestController
@
RestController
@
RequestMapping
(
"/${moduleName}/${businessName}"
)
@
RequestMapping
(
"/${moduleName}/${businessName}"
)
public
class
${
ClassName
}
Controller
extends
BaseController
@
RequiredArgsConstructor
(
onConstructor_
=
@
Autowired
)
{
public
class
${
ClassName
}
Controller
extends
BaseController
{
@
Autowired
private
I
${
ClassName
}
Service
${
className
}
Service
;
/**
private
final
I
${
ClassName
}
Service
${
className
}
Service
;
*
查询
${
functionName
}
列表
*/
@
ApiOperation
(
"查询${functionName}列表"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:list')"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:list')"
)
@
GetMapping
(
"/list"
)
@
GetMapping
(
"/list"
)
#
if
($
table
.
crud
||
$
table
.
sub
)
#
if
($
table
.
crud
||
$
table
.
sub
)
public
TableDataInfo
list
(${
ClassName
}
${
className
})
public
TableDataInfo
<${
ClassName
}
Vo
>
list
(${
ClassName
}
Vo
entity
)
{
{
return
${
className
}
Service
.
queryList
(
entity
);
startPage
();
List
<${
ClassName
}>
list
=
${
className
}
Service
.
select
${
ClassName
}
List
(${
className
});
return
getDataTable
(
list
);
}
}
#
elseif
($
table
.
tree
)
#
elseif
($
table
.
tree
)
public
AjaxResult
list
(${
ClassName
}
${
className
})
public
AjaxResult
list
(${
ClassName
}
Vo
entity
)
{
{
return
AjaxResult
.
success
(
"查询成功"
,
${
className
}
Service
.
queryAll
(
entity
));
List
<${
ClassName
}>
list
=
${
className
}
Service
.
select
${
ClassName
}
List
(${
className
});
return
success
(
list
);
}
}
#
end
#
end
/**
@
ApiOperation
(
"查询${functionName}所有列表"
)
*
导出
${
functionName
}
列表
@
GetMapping
(
"/listAll"
)
*/
public
AjaxResult
listAll
(${
ClassName
}
Vo
entity
)
{
return
AjaxResult
.
success
(
"查询成功"
,
${
className
}
Service
.
queryAll
(
entity
));
}
@
ApiOperation
(
"导出${functionName}列表"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:export')"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:export')"
)
@
Log
(
title
=
"${functionName}"
,
businessType
=
BusinessType
.
EXPORT
)
@
Log
(
title
=
"${functionName}"
,
businessType
=
BusinessType
.
EXPORT
)
@
PostMapping
(
"/export"
)
@
PostMapping
(
"/export"
)
public
void
export
(
HttpServletResponse
response
,
${
ClassName
}
${
className
})
public
void
export
(
HttpServletResponse
response
,
${
ClassName
}
Vo
entity
)
{
{
List
<${
ClassName
}
Vo
>
list
=
${
className
}
Service
.
queryAll
(
entity
);
List
<${
ClassName
}>
list
=
${
className
}
Service
.
select
${
ClassName
}
List
(${
className
});
ExcelUtil
<${
ClassName
}
Vo
>
util
=
new
ExcelUtil
<>(${
ClassName
}
Vo
.
class
);
ExcelUtil
<${
ClassName
}>
util
=
new
ExcelUtil
<${
ClassName
}>(${
ClassName
}.
class
);
util
.
exportExcel
(
response
,
list
,
"${functionName}数据"
);
util
.
exportExcel
(
response
,
list
,
"${functionName}数据"
);
}
}
/**
@
ApiOperation
(
"获取${functionName}详细信息"
)
*
获取
${
functionName
}
详细信息
*/
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:query')"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:query')"
)
@
GetMapping
(
value
=
"/{${pkColumn.javaField}}"
)
@
GetMapping
(
value
=
"/getInfo/{${pkColumn.javaField}}"
)
public
AjaxResult
getInfo
(@
PathVariable
(
"${pkColumn.javaField}"
)
${
pkColumn
.
javaType
}
${
pkColumn
.
javaField
})
public
AjaxResult
getInfo
(@
PathVariable
(
"${pkColumn.javaField}"
)
${
pkColumn
.
javaType
}
${
pkColumn
.
javaField
})
{
{
return
AjaxResult
.
success
(
"查询成功"
,
${
className
}
Service
.
queryById
(${
pkColumn
.
javaField
}));
return
success
(${
className
}
Service
.
select
${
ClassName
}
By
${
pkColumn
.
capJavaField
}(${
pkColumn
.
javaField
}));
}
}
/**
@
ApiOperation
(
"新增${functionName}"
)
*
新增
${
functionName
}
*/
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:add')"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:add')"
)
@
Log
(
title
=
"${functionName}"
,
businessType
=
BusinessType
.
INSERT
)
@
Log
(
title
=
"${functionName}"
,
businessType
=
BusinessType
.
INSERT
)
@
PostMapping
@
PostMapping
(
"add"
)
public
AjaxResult
add
(@
RequestBody
${
ClassName
}
${
className
})
public
AjaxResult
add
(@
RequestBody
${
ClassName
}
Vo
entity
)
{
{
return
toAjax
(${
className
}
Service
.
save
(
entity
));
return
toAjax
(${
className
}
Service
.
insert
${
ClassName
}(${
className
}));
}
}
/**
@
ApiOperation
(
"修改${functionName}"
)
*
修改
${
functionName
}
*/
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:edit')"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:edit')"
)
@
Log
(
title
=
"${functionName}"
,
businessType
=
BusinessType
.
UPDATE
)
@
Log
(
title
=
"${functionName}"
,
businessType
=
BusinessType
.
UPDATE
)
@
PutMapping
@
PostMapping
(
"edit"
)
public
AjaxResult
edit
(@
RequestBody
${
ClassName
}
${
className
})
public
AjaxResult
edit
(@
RequestBody
${
ClassName
}
Vo
entity
)
{
{
return
toAjax
(${
className
}
Service
.
updateById
(
entity
));
return
toAjax
(${
className
}
Service
.
update
${
ClassName
}(${
className
}));
}
}
/**
@
ApiOperation
(
"删除${functionName}"
)
*
删除
${
functionName
}
*/
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:remove')"
)
@
PreAuthorize
(
"@ss.hasPermi('${permissionPrefix}:remove')"
)
@
Log
(
title
=
"${functionName}"
,
businessType
=
BusinessType
.
DELETE
)
@
Log
(
title
=
"${functionName}"
,
businessType
=
BusinessType
.
DELETE
)
@
DeleteMapping
(
"/{${pkColumn.javaField}s}"
)
@
GetMapping
(
"/remove/{${pkColumn.javaField}s}"
)
public
AjaxResult
remove
(@
PathVariable
${
pkColumn
.
javaType
}[]
${
pkColumn
.
javaField
}
s
)
public
AjaxResult
remove
(@
PathVariable
${
pkColumn
.
javaType
}[]
${
pkColumn
.
javaField
}
s
)
{
{
return
toAjax
(${
className
}
Service
.
removeByIds
(
Arrays
.
asList
(
ids
))
?
1
:
0
);
return
toAjax
(${
className
}
Service
.
delete
${
ClassName
}
By
${
pkColumn
.
capJavaField
}
s
(${
pkColumn
.
javaField
}
s
));
}
}
}
}
ruoyi-generator/src/main/resources/vm/js/api.js.vm
View file @
b5da42f0
...
@@ -9,10 +9,19 @@ export function list${BusinessName}(query) {
...
@@ -9,10 +9,19 @@ export function list${BusinessName}(query) {
})
})
}
}
// 查询${functionName}所有列表
export function listAll${BusinessName}(query) {
return request({
url: '/${moduleName}/${businessName}/listAll',
method: 'get',
params: query
})
}
// 查询${functionName}详细
// 查询${functionName}详细
export function get${BusinessName}(${pkColumn.javaField}) {
export function get${BusinessName}(${pkColumn.javaField}) {
return request({
return request({
url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField},
url: '/${moduleName}/${businessName}/
getInfo/
' + ${pkColumn.javaField},
method: 'get'
method: 'get'
})
})
}
}
...
@@ -20,7 +29,7 @@ export function get${BusinessName}(${pkColumn.javaField}) {
...
@@ -20,7 +29,7 @@ export function get${BusinessName}(${pkColumn.javaField}) {
// 新增${functionName}
// 新增${functionName}
export function add${BusinessName}(data) {
export function add${BusinessName}(data) {
return request({
return request({
url: '/${moduleName}/${businessName}',
url: '/${moduleName}/${businessName}
/add
',
method: 'post',
method: 'post',
data: data
data: data
})
})
...
@@ -29,8 +38,8 @@ export function add${BusinessName}(data) {
...
@@ -29,8 +38,8 @@ export function add${BusinessName}(data) {
// 修改${functionName}
// 修改${functionName}
export function update${BusinessName}(data) {
export function update${BusinessName}(data) {
return request({
return request({
url: '/${moduleName}/${businessName}',
url: '/${moduleName}/${businessName}
/edit
',
method: 'p
u
t',
method: 'p
os
t',
data: data
data: data
})
})
}
}
...
@@ -38,7 +47,7 @@ export function update${BusinessName}(data) {
...
@@ -38,7 +47,7 @@ export function update${BusinessName}(data) {
// 删除${functionName}
// 删除${functionName}
export function del${BusinessName}(${pkColumn.javaField}) {
export function del${BusinessName}(${pkColumn.javaField}) {
return request({
return request({
url: '/${moduleName}/${businessName}/' + ${pkColumn.javaField},
url: '/${moduleName}/${businessName}/
remove/
' + ${pkColumn.javaField},
method: '
delete
'
method: '
get
'
})
})
}
}
ruoyi-generator/src/main/resources/vm/vue/index.vue.vm
View file @
b5da42f0
This diff is collapsed.
Click to expand it.
ruoyi-system/src/main/java/com/ruoyi/system/domain/FncSubjectType.java
0 → 100644
View file @
b5da42f0
package
com.ruoyi.system.domain
;
import
com.baomidou.mybatisplus.annotation.*
;
import
com.ruoyi.common.annotation.Excel
;
import
com.ruoyi.common.core.domain.BaseEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
import
lombok.experimental.Accessors
;
/**
* 科目类别对象 fnc_subject_type
*
* @author jlf
* @date 2022-11-17
*/
@Data
@Accessors
(
chain
=
true
)
@ToString
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
FncSubjectType
extends
BaseEntity
{
/**
* 科目类别id
*/
@TableId
(
value
=
"subject_type_id"
,
type
=
IdType
.
AUTO
)
private
Long
subjectTypeId
;
/**
* 上级id
*/
@Excel
(
name
=
"上级id"
)
private
Long
parentId
;
/**
* 科目类别名称
*/
@Excel
(
name
=
"科目类别名称"
)
private
String
subjectTypeName
;
/**
* 显示顺序
*/
@Excel
(
name
=
"显示顺序"
)
private
Integer
orderNum
;
// @TableLogic(value = "1",delval = "2")
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Integer
deleteStatus
;
}
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/FncSubjectTypeVo.java
0 → 100644
View file @
b5da42f0
package
com.ruoyi.system.domain.vo
;
import
com.ruoyi.common.core.domain.BaseEntity
;
import
com.ruoyi.system.domain.FncSubjectType
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.ToString
;
import
lombok.experimental.Accessors
;
/**
* 科目类别对象 fnc_subject_type
*
* @author jlf
* @date 2022-11-17
*/
@Data
@Accessors
(
chain
=
true
)
@ToString
(
callSuper
=
true
)
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
FncSubjectTypeVo
extends
FncSubjectType
{
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/FncSubjectTypeMapper.java
0 → 100644
View file @
b5da42f0
package
com.ruoyi.system.mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.ruoyi.system.domain.FncSubjectType
;
import
com.ruoyi.system.domain.vo.FncSubjectTypeVo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* 科目类别Mapper接口
*
* @author jlf
* @date 2022-11-17
*/
public
interface
FncSubjectTypeMapper
extends
BaseMapper
<
FncSubjectType
>
{
Page
<
FncSubjectTypeVo
>
queryList
(
Page
<?>
page
,
@Param
(
"entity"
)
FncSubjectTypeVo
entity
);
List
<
FncSubjectTypeVo
>
queryList
(
@Param
(
"entity"
)
FncSubjectTypeVo
entity
);
FncSubjectTypeVo
queryById
(
@Param
(
"id"
)
Long
subjectTypeId
);
}
ruoyi-system/src/main/java/com/ruoyi/system/service/IFncSubjectTypeService.java
0 → 100644
View file @
b5da42f0
package
com.ruoyi.system.service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.system.domain.FncSubjectType
;
import
com.ruoyi.system.domain.vo.FncSubjectTypeVo
;
import
java.util.List
;
/**
* 科目类别Service接口
*
* @author jlf
* @date 2022-11-17
*/
public
interface
IFncSubjectTypeService
extends
IService
<
FncSubjectType
>
{
/**
* 分页查询
*
* @param entity
* @return
*/
TableDataInfo
<
FncSubjectTypeVo
>
queryList
(
FncSubjectTypeVo
entity
);
/**
* 查询全部
*
* @param entity
* @return
*/
List
<
FncSubjectTypeVo
>
queryAll
(
FncSubjectTypeVo
entity
);
/**
* 根据ID查询
*
* @param subjectTypeId
* @return
*/
FncSubjectTypeVo
queryById
(
Long
subjectTypeId
);
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/FncSubjectTypeServiceImpl.java
0 → 100644
View file @
b5da42f0
package
com.ruoyi.system.service.impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.common.utils.PageUtils
;
import
com.ruoyi.system.domain.FncSubjectType
;
import
com.ruoyi.system.domain.vo.FncSubjectTypeVo
;
import
com.ruoyi.system.mapper.FncSubjectTypeMapper
;
import
com.ruoyi.system.service.IFncSubjectTypeService
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 科目类别Service业务层处理
*
* @author jlf
* @date 2022-11-17
*/
@Service
public
class
FncSubjectTypeServiceImpl
extends
ServiceImpl
<
FncSubjectTypeMapper
,
FncSubjectType
>
implements
IFncSubjectTypeService
{
@Override
public
TableDataInfo
<
FncSubjectTypeVo
>
queryList
(
FncSubjectTypeVo
entity
)
{
return
PageUtils
.
buildDataInfo
(
this
.
baseMapper
.
queryList
(
PageUtils
.
buildPage
(),
entity
));
}
@Override
public
List
<
FncSubjectTypeVo
>
queryAll
(
FncSubjectTypeVo
entity
)
{
return
this
.
baseMapper
.
queryList
(
entity
);
}
@Override
public
FncSubjectTypeVo
queryById
(
Long
subjectTypeId
)
{
return
this
.
baseMapper
.
queryById
(
subjectTypeId
);
}
}
ruoyi-system/src/main/resources/mapper/finance/FncSubjectTypeMapper.xml
0 → 100644
View file @
b5da42f0
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.ruoyi.system.mapper.FncSubjectTypeMapper"
>
<sql
id=
"querySql"
>
select
<include
refid=
"allField"
/>
from fnc_subject_type A
<include
refid=
"search"
/>
</sql>
<select
id=
"queryList"
resultType=
"com.ruoyi.system.domain.vo.FncSubjectTypeVo"
>
<include
refid=
"querySql"
/>
<if
test=
"entity.subjectTypeName != null and entity.subjectTypeName != ''"
>
and A.subject_type_name like concat('%', #{entity.subjectTypeName}, '%')
</if>
order by A.create_time desc
</select>
<select
id=
"queryById"
resultType=
"com.ruoyi.system.domain.vo.FncSubjectTypeVo"
>
<include
refid=
"querySql"
/>
and A.subject_type_id = #{id}
</select>
<sql
id=
"allField"
>
A.subject_type_id,
A.parent_id,
A.subject_type_name,
A.order_num,
A.create_by,
A.create_time,
A.update_by,
A.update_time
</sql>
<sql
id=
"search"
>
where A.delete_status = 1
</sql>
</mapper>
ruoyi-ui/src/api/finance/subjectType.js
0 → 100644
View file @
b5da42f0
import
request
from
'
@/utils/request
'
// 查询科目类别列表
export
function
listSubjectType
(
query
)
{
return
request
({
url
:
'
/finance/subjectType/list
'
,
method
:
'
get
'
,
params
:
query
})
}
// 查询上级科目类别列表(排除节点)
export
function
listExcludeChild
(
id
)
{
return
request
({
url
:
'
/finance/subjectType/list/exclude/
'
+
id
,
method
:
'
get
'
})
}
// 查询科目类别所有列表
export
function
listAllSubjectType
(
query
)
{
return
request
({
url
:
'
/finance/subjectType/listAll
'
,
method
:
'
get
'
,
params
:
query
})
}
// 查询科目类别详细
export
function
getSubjectType
(
subjectTypeId
)
{
return
request
({
url
:
'
/finance/subjectType/getInfo/
'
+
subjectTypeId
,
method
:
'
get
'
})
}
// 新增科目类别
export
function
addSubjectType
(
data
)
{
return
request
({
url
:
'
/finance/subjectType/add
'
,
method
:
'
post
'
,
data
:
data
})
}
// 修改科目类别
export
function
updateSubjectType
(
data
)
{
return
request
({
url
:
'
/finance/subjectType/edit
'
,
method
:
'
post
'
,
data
:
data
})
}
// 删除科目类别
export
function
delSubjectType
(
subjectTypeId
)
{
return
request
({
url
:
'
/finance/subjectType/remove/
'
+
subjectTypeId
,
method
:
'
get
'
})
}
ruoyi-ui/src/utils/ruoyi.js
View file @
b5da42f0
...
@@ -167,7 +167,9 @@ export function handleTree(data, id, parentId, children) {
...
@@ -167,7 +167,9 @@ export function handleTree(data, id, parentId, children) {
var
childrenListMap
=
{};
var
childrenListMap
=
{};
var
nodeIds
=
{};
var
nodeIds
=
{};
var
tree
=
[];
var
tree
=
[];
if
(
!
data
)
{
return
[];
}
for
(
let
d
of
data
)
{
for
(
let
d
of
data
)
{
let
parentId
=
d
[
config
.
parentId
];
let
parentId
=
d
[
config
.
parentId
];
if
(
childrenListMap
[
parentId
]
==
null
)
{
if
(
childrenListMap
[
parentId
]
==
null
)
{
...
...
ruoyi-ui/src/views/finance/ledger/index.vue
View file @
b5da42f0
...
@@ -35,8 +35,8 @@
...
@@ -35,8 +35,8 @@
<el-input
v-model=
"queryParams.saleEvaluation"
placeholder=
"请输入销售额评估"
clearable
<el-input
v-model=
"queryParams.saleEvaluation"
placeholder=
"请输入销售额评估"
clearable
@
keyup.enter.native=
"handleQuery"
/>
@
keyup.enter.native=
"handleQuery"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"创建人"
prop=
"create
b
y"
>
<el-form-item
label=
"创建人"
prop=
"create
B
y"
>
<el-input
v-model=
"queryParams.create
b
y"
placeholder=
"请输入创建人"
clearable
<el-input
v-model=
"queryParams.create
B
y"
placeholder=
"请输入创建人"
clearable
@
keyup.enter.native=
"handleQuery"
/>
@
keyup.enter.native=
"handleQuery"
/>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
...
@@ -110,7 +110,7 @@
...
@@ -110,7 +110,7 @@
<
el
-
table
-
column
label
=
"
客户单位
"
align
=
"
center
"
prop
=
"
customerCompany
"
/>
<
el
-
table
-
column
label
=
"
客户单位
"
align
=
"
center
"
prop
=
"
customerCompany
"
/>
<
el
-
table
-
column
label
=
"
业务性质
"
align
=
"
center
"
prop
=
"
businessType
"
/>
<
el
-
table
-
column
label
=
"
业务性质
"
align
=
"
center
"
prop
=
"
businessType
"
/>
<
el
-
table
-
column
label
=
"
销售额评估
"
align
=
"
center
"
prop
=
"
saleEvaluation
"
/>
<
el
-
table
-
column
label
=
"
销售额评估
"
align
=
"
center
"
prop
=
"
saleEvaluation
"
/>
<
el
-
table
-
column
label
=
"
创建人
"
align
=
"
center
"
prop
=
"
create
b
y
"
/>
<
el
-
table
-
column
label
=
"
创建人
"
align
=
"
center
"
prop
=
"
create
B
y
"
/>
<
el
-
table
-
column
label
=
"
操作
"
align
=
"
center
"
class
-
name
=
"
small-padding fixed-width
"
>
<
el
-
table
-
column
label
=
"
操作
"
align
=
"
center
"
class
-
name
=
"
small-padding fixed-width
"
>
<
template
slot
-
scope
=
"
scope
"
>
<
template
slot
-
scope
=
"
scope
"
>
<
el
-
button
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-edit
"
@
click
=
"
handleUpdate(scope.row)
"
<
el
-
button
size
=
"
mini
"
type
=
"
text
"
icon
=
"
el-icon-edit
"
@
click
=
"
handleUpdate(scope.row)
"
...
...
ruoyi-ui/src/views/finance/subjecttype/index.vue
0 → 100644
View file @
b5da42f0
<
template
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
label-width=
"68px"
>
<el-form-item
label=
"科目类别名称"
prop=
"subjectTypeName"
>
<el-input
v-model=
"queryParams.subjectTypeName"
placeholder=
"请输入科目类别名称"
clearable
@
keyup.enter.native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
size=
"mini"
@
click=
"handleQuery"
>
搜索
</el-button>
<el-button
icon=
"el-icon-refresh"
size=
"mini"
@
click=
"resetQuery"
>
重置
</el-button>
</el-form-item>
</el-form>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['finance:subjectType:add']"
>
新增
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
plain
icon=
"el-icon-edit"
size=
"mini"
:disabled=
"single"
@
click=
"handleUpdate"
v-hasPermi=
"['finance:subjectType:edit']"
>
修改
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
plain
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['finance:subjectType:remove']"
>
删除
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
v-hasPermi=
"['finance:subjectType:export']"
>
导出
</el-button>
</el-col>
<right-toolbar
:showSearch.sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
<el-table
v-if=
"refreshTable"
v-loading=
"loading"
row-key=
"subjectTypeId"
:data=
"subjectTypeList"
:default-expand-all=
"isExpandAll"
:tree-props=
"
{ children: 'children', hasChildren: 'hasChildren' }">
<el-table-column
label=
"科目类别名称"
align=
"center"
prop=
"subjectTypeName"
/>
<el-table-column
label=
"显示顺序"
align=
"center"
prop=
"orderNum"
/>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['finance:subjectType:edit']"
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['finance:subjectType:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<!-- 添加或修改科目类别对话框 -->
<el-dialog
:title=
"title"
:visible.sync=
"open"
width=
"500px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
<el-form-item
label=
"上级科目"
prop=
"parentId"
>
<treeselect
v-model=
"form.parentId"
:options=
"subjectTypeOptions"
:normalizer=
"normalizer"
placeholder=
"选择上级科目类别"
/>
</el-form-item>
<el-form-item
label=
"科目类别名称"
prop=
"subjectTypeName"
>
<el-input
v-model=
"form.subjectTypeName"
placeholder=
"请输入科目类别名称"
/>
</el-form-item>
<el-form-item
label=
"显示顺序"
prop=
"orderNum"
>
<el-input
v-model=
"form.orderNum"
placeholder=
"请输入显示顺序"
/>
</el-form-item>
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
确 定
</el-button>
<el-button
@
click=
"cancel"
>
取 消
</el-button>
</div>
</el-dialog>
</div>
</template>
<
script
>
import
{
listAllSubjectType
,
getSubjectType
,
delSubjectType
,
addSubjectType
,
updateSubjectType
,
listExcludeChild
}
from
"
@/api/finance/subjectType
"
;
import
Treeselect
from
"
@riophae/vue-treeselect
"
;
import
"
@riophae/vue-treeselect/dist/vue-treeselect.css
"
;
export
default
{
name
:
"
SubjectType
"
,
components
:
{
Treeselect
},
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 选中数组
ids
:
[],
// 非单个禁用
single
:
true
,
// 非多个禁用
multiple
:
true
,
// 显示搜索条件
showSearch
:
true
,
// 总条数
total
:
0
,
// 科目类别表格树数据
subjectTypeList
:
[],
// 科目类别树选项
subjectTypeOptions
:
[],
// 弹出层标题
title
:
""
,
// 是否显示弹出层
open
:
false
,
// 是否展开,默认全部展开
isExpandAll
:
true
,
// 重新渲染表格状态
refreshTable
:
true
,
// 查询参数
queryParams
:
{
subjectTypeName
:
null
,
},
// 表单参数
form
:
{},
// 表单校验
rules
:
{
parentId
:
[
{
required
:
true
,
message
:
"
上级id不能为空
"
,
trigger
:
"
blur
"
}
],
}
};
},
created
()
{
this
.
getList
();
},
methods
:
{
/** 查询科目类别列表 */
getList
()
{
this
.
loading
=
true
;
listAllSubjectType
(
this
.
queryParams
).
then
(
response
=>
{
// this.subjectTypeList = response.rows;
this
.
subjectTypeList
=
this
.
handleTree
(
response
.
data
,
"
subjectTypeId
"
);
this
.
loading
=
false
;
});
},
/** 转换科目类别数据结构 */
normalizer
(
node
)
{
if
(
node
.
children
&&
!
node
.
children
.
length
)
{
delete
node
.
children
;
}
return
{
id
:
node
.
subjectTypeId
,
label
:
node
.
subjectTypeName
,
children
:
node
.
children
};
},
// 取消按钮
cancel
()
{
this
.
open
=
false
;
this
.
reset
();
},
// 表单重置
reset
()
{
this
.
form
=
{
subjectTypeId
:
null
,
parentId
:
null
,
subjectTypeName
:
null
,
orderNum
:
null
,
createBy
:
null
,
createTime
:
null
,
updateBy
:
null
,
updateTime
:
null
};
this
.
resetForm
(
"
form
"
);
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
getList
();
},
/** 重置按钮操作 */
resetQuery
()
{
this
.
resetForm
(
"
queryForm
"
);
this
.
handleQuery
();
},
/** 新增按钮操作 */
handleAdd
(
row
)
{
this
.
reset
();
if
(
row
!=
undefined
)
{
this
.
form
.
parentId
=
row
.
subjectTypeId
;
}
this
.
open
=
true
;
this
.
title
=
"
添加科目类别
"
;
listAllSubjectType
().
then
(
response
=>
{
this
.
subjectTypeOptions
=
this
.
handleTree
(
response
.
data
,
"
subjectTypeId
"
);
if
(
this
.
subjectTypeOptions
.
length
==
0
)
{
}
const
noResultsOptions
=
{
subjectTypeId
:
this
.
form
.
parentId
||
0
,
subjectTypeName
:
this
.
form
.
parentName
||
"
根节点
"
,
children
:
[]
};
this
.
subjectTypeOptions
.
push
(
noResultsOptions
);
});
},
/** 展开/折叠操作 */
toggleExpandAll
()
{
this
.
refreshTable
=
false
;
this
.
isExpandAll
=
!
this
.
isExpandAll
;
this
.
$nextTick
(()
=>
{
this
.
refreshTable
=
true
;
});
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
this
.
reset
();
const
subjectTypeId
=
row
.
subjectTypeId
getSubjectType
(
subjectTypeId
).
then
(
response
=>
{
this
.
form
=
response
.
data
;
this
.
open
=
true
;
this
.
title
=
"
修改科目类别
"
;
listExcludeChild
(
row
.
subjectTypeId
).
then
(
response
=>
{
this
.
subjectTypeOptions
=
this
.
handleTree
(
response
.
data
,
"
subjectTypeId
"
);
if
(
this
.
subjectTypeOptions
.
length
==
0
)
{
}
const
noResultsOptions
=
{
subjectTypeId
:
this
.
form
.
parentId
||
0
,
subjectTypeName
:
this
.
form
.
parentName
||
"
根节点
"
,
children
:
[]
};
this
.
subjectTypeOptions
.
push
(
noResultsOptions
);
});
});
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"
form
"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
subjectTypeId
!=
null
)
{
updateSubjectType
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"
修改成功
"
);
this
.
open
=
false
;
this
.
getList
();
});
}
else
{
addSubjectType
(
this
.
form
).
then
(
response
=>
{
this
.
$modal
.
msgSuccess
(
"
新增成功
"
);
this
.
open
=
false
;
this
.
getList
();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
subjectTypeIds
=
row
.
subjectTypeId
||
this
.
ids
;
this
.
$modal
.
confirm
(
'
是否确认删除科目类别编号为"
'
+
subjectTypeIds
+
'
"的数据项?
'
).
then
(
function
()
{
return
delSubjectType
(
subjectTypeIds
);
}).
then
(()
=>
{
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"
删除成功
"
);
}).
catch
(()
=>
{
});
},
/** 导出按钮操作 */
handleExport
()
{
this
.
download
(
'
finance/subjectType/export
'
,
{
...
this
.
queryParams
},
`subjectType_
${
new
Date
().
getTime
()}
.xlsx`
)
}
}
};
</
script
>
ruoyi-ui/src/views/system/dept/index.vue
View file @
b5da42f0
...
@@ -2,21 +2,12 @@
...
@@ -2,21 +2,12 @@
<div
class=
"app-container"
>
<div
class=
"app-container"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
>
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
v-show=
"showSearch"
>
<el-form-item
label=
"部门名称"
prop=
"deptName"
>
<el-form-item
label=
"部门名称"
prop=
"deptName"
>
<el-input
<el-input
v-model=
"queryParams.deptName"
placeholder=
"请输入部门名称"
clearable
@
keyup.enter.native=
"handleQuery"
/>
v-model=
"queryParams.deptName"
placeholder=
"请输入部门名称"
clearable
@
keyup.enter.native=
"handleQuery"
/>
</el-form-item>
</el-form-item>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-form-item
label=
"状态"
prop=
"status"
>
<el-select
v-model=
"queryParams.status"
placeholder=
"部门状态"
clearable
>
<el-select
v-model=
"queryParams.status"
placeholder=
"部门状态"
clearable
>
<el-option
<el-option
v-for=
"dict in dict.type.sys_normal_disable"
:key=
"dict.value"
:label=
"dict.label"
v-for=
"dict in dict.type.sys_normal_disable"
:value=
"dict.value"
/>
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item>
<el-form-item>
...
@@ -27,40 +18,22 @@
...
@@ -27,40 +18,22 @@
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-row
:gutter=
"10"
class=
"mb8"
>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
<el-button
<el-button
type=
"primary"
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
type=
"primary"
v-hasPermi=
"['system:dept:add']"
>
新增
</el-button>
plain
icon=
"el-icon-plus"
size=
"mini"
@
click=
"handleAdd"
v-hasPermi=
"['system:dept:add']"
>
新增
</el-button>
</el-col>
</el-col>
<el-col
:span=
"1.5"
>
<el-col
:span=
"1.5"
>
<el-button
<el-button
type=
"info"
plain
icon=
"el-icon-sort"
size=
"mini"
@
click=
"toggleExpandAll"
>
展开/折叠
</el-button>
type=
"info"
plain
icon=
"el-icon-sort"
size=
"mini"
@
click=
"toggleExpandAll"
>
展开/折叠
</el-button>
</el-col>
</el-col>
<right-toolbar
:showSearch.sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
<right-toolbar
:showSearch.sync=
"showSearch"
@
queryTable=
"getList"
></right-toolbar>
</el-row>
</el-row>
<el-table
<el-table
v-if=
"refreshTable"
v-loading=
"loading"
:data=
"deptList"
row-key=
"deptId"
v-if=
"refreshTable"
:default-expand-all=
"isExpandAll"
:tree-props=
"
{ children: 'children', hasChildren: 'hasChildren' }">
v-loading=
"loading"
:data=
"deptList"
row-key=
"deptId"
:default-expand-all=
"isExpandAll"
:tree-props=
"
{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column
prop=
"deptName"
label=
"部门名称"
width=
"260"
></el-table-column>
<el-table-column
prop=
"deptName"
label=
"部门名称"
width=
"260"
></el-table-column>
<el-table-column
prop=
"orderNum"
label=
"排序"
width=
"200"
></el-table-column>
<el-table-column
prop=
"orderNum"
label=
"排序"
width=
"200"
></el-table-column>
<el-table-column
prop=
"status"
label=
"状态"
width=
"100"
>
<el-table-column
prop=
"status"
label=
"状态"
width=
"100"
>
<template
slot-scope=
"scope"
>
<template
slot-scope=
"scope"
>
<dict-tag
:options=
"dict.type.sys_normal_disable"
:value=
"scope.row.status"
/>
<dict-tag
:options=
"dict.type.sys_normal_disable"
:value=
"scope.row.status"
/>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
width=
"200"
>
<el-table-column
label=
"创建时间"
align=
"center"
prop=
"createTime"
width=
"200"
>
...
@@ -70,28 +43,12 @@
...
@@ -70,28 +43,12 @@
</el-table-column>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<el-table-column
label=
"操作"
align=
"center"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<
template
slot-scope=
"scope"
>
<el-button
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
size=
"mini"
v-hasPermi=
"['system:dept:edit']"
>
修改
</el-button>
type=
"text"
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-plus"
@
click=
"handleAdd(scope.row)"
icon=
"el-icon-edit"
v-hasPermi=
"['system:dept:add']"
>
新增
</el-button>
@
click=
"handleUpdate(scope.row)"
<el-button
v-if=
"scope.row.parentId != 0"
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
v-hasPermi=
"['system:dept:edit']"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['system:dept:remove']"
>
删除
</el-button>
>
修改
</el-button>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-plus"
@
click=
"handleAdd(scope.row)"
v-hasPermi=
"['system:dept:add']"
>
新增
</el-button>
<el-button
v-if=
"scope.row.parentId != 0"
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['system:dept:remove']"
>
删除
</el-button>
</
template
>
</
template
>
</el-table-column>
</el-table-column>
</el-table>
</el-table>
...
@@ -102,7 +59,8 @@
...
@@ -102,7 +59,8 @@
<el-row>
<el-row>
<el-col
:span=
"24"
v-if=
"form.parentId !== 0"
>
<el-col
:span=
"24"
v-if=
"form.parentId !== 0"
>
<el-form-item
label=
"上级部门"
prop=
"parentId"
>
<el-form-item
label=
"上级部门"
prop=
"parentId"
>
<treeselect
v-model=
"form.parentId"
:options=
"deptOptions"
:normalizer=
"normalizer"
placeholder=
"选择上级部门"
/>
<treeselect
v-model=
"form.parentId"
:options=
"deptOptions"
:normalizer=
"normalizer"
placeholder=
"选择上级部门"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
...
@@ -139,11 +97,8 @@
...
@@ -139,11 +97,8 @@
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"部门状态"
>
<el-form-item
label=
"部门状态"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio-group
v-model=
"form.status"
>
<el-radio
<el-radio
v-for=
"dict in dict.type.sys_normal_disable"
:key=
"dict.value"
:label=
"dict.value"
>
v-for=
"dict in dict.type.sys_normal_disable"
{{ dict.label }}
</el-radio>
:key=
"dict.value"
:label=
"dict.value"
>
{{dict.label}}
</el-radio>
</el-radio-group>
</el-radio-group>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
...
@@ -307,7 +262,7 @@ export default {
...
@@ -307,7 +262,7 @@ export default {
});
});
},
},
/** 提交按钮 */
/** 提交按钮 */
submitForm
:
function
()
{
submitForm
:
function
()
{
this
.
$refs
[
"
form
"
].
validate
(
valid
=>
{
this
.
$refs
[
"
form
"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
valid
)
{
if
(
this
.
form
.
deptId
!=
undefined
)
{
if
(
this
.
form
.
deptId
!=
undefined
)
{
...
@@ -328,12 +283,12 @@ export default {
...
@@ -328,12 +283,12 @@ export default {
},
},
/** 删除按钮操作 */
/** 删除按钮操作 */
handleDelete
(
row
)
{
handleDelete
(
row
)
{
this
.
$modal
.
confirm
(
'
是否确认删除名称为"
'
+
row
.
deptName
+
'
"的数据项?
'
).
then
(
function
()
{
this
.
$modal
.
confirm
(
'
是否确认删除名称为"
'
+
row
.
deptName
+
'
"的数据项?
'
).
then
(
function
()
{
return
delDept
(
row
.
deptId
);
return
delDept
(
row
.
deptId
);
}).
then
(()
=>
{
}).
then
(()
=>
{
this
.
getList
();
this
.
getList
();
this
.
$modal
.
msgSuccess
(
"
删除成功
"
);
this
.
$modal
.
msgSuccess
(
"
删除成功
"
);
}).
catch
(()
=>
{});
}).
catch
(()
=>
{
});
}
}
}
}
};
};
...
...
sql/ry-vue.sql
View file @
b5da42f0
This diff is collapsed.
Click to expand it.
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