Merge branch 'master' of http://git.hzwlsoft.com/JeroBoot/jero-boot
This commit is contained in:
+3
-41
@@ -36,14 +36,9 @@ jero-boot 低代码开发平台
|
|||||||
|
|
||||||
## 技术文档
|
## 技术文档
|
||||||
|
|
||||||
|
- 在线文档: [http://doc.xxx.com](http://doc.xxx.com)
|
||||||
|
|
||||||
- 在线演示 : [http://boot.jeecg.com](http://boot.jeecg.com)
|
- 常见问题: [http://xxx.com/doc/qa](http://xxx.com/doc/qa)
|
||||||
|
|
||||||
- 在线文档: [http://doc.jeecg.com](http://doc.jeecg.com)
|
|
||||||
|
|
||||||
- 常见问题: [http://jeecg.com/doc/qa](http://jeecg.com/doc/qa)
|
|
||||||
|
|
||||||
- QQ交流群 : ③816531124、①284271917、②769925425
|
|
||||||
|
|
||||||
|
|
||||||
## 专项文档
|
## 专项文档
|
||||||
@@ -89,18 +84,12 @@ QueryWrapper<?> queryWrapper = QueryGenerator.initQueryWrapper(?, req.getParamet
|
|||||||
| 多选字段模糊查询 | 上述4 有一个特例,若某一查询字段前后都带逗号 则会将其视为走这种查询方式 ,该查询方式是将查询条件以逗号分割再遍历数组 将每个元素作like查询 用or拼接,例如 现在name传入值 ,a,b,c, 那么结果sql就是 name like '%a%' or name like '%b%' or name like '%c%' | |
|
| 多选字段模糊查询 | 上述4 有一个特例,若某一查询字段前后都带逗号 则会将其视为走这种查询方式 ,该查询方式是将查询条件以逗号分割再遍历数组 将每个元素作like查询 用or拼接,例如 现在name传入值 ,a,b,c, 那么结果sql就是 name like '%a%' or name like '%b%' or name like '%c%' | |
|
||||||
|
|
||||||
|
|
||||||
#### 二、AutoPoi(EXCEL工具类-EasyPOI衍变升级重构版本)
|
|
||||||
|
|
||||||
[在线文档](https://github.com/zhangdaiscott/autopoi)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#### 三、代码生成器
|
#### 三、代码生成器
|
||||||
|
|
||||||
> 功能说明: 一键生成的代码(包括:controller、service、dao、mapper、entity、vue)
|
> 功能说明: 一键生成的代码(包括:controller、service、dao、mapper、entity、vue)
|
||||||
|
|
||||||
- 模板位置: src/main/resources/jero/code-template
|
- 模板位置: src/main/resources/jero/code-template
|
||||||
- 技术文档: http://doc.jeecg.com/2043916
|
- 技术文档: http://doc.xxx.com/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -157,33 +146,6 @@ code: {
|
|||||||
},
|
},
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
## docker镜像用法
|
|
||||||
```
|
|
||||||
注意: 如果本地安装了mysql和redis,启动容器前先停掉本地服务,不然会端口冲突。
|
|
||||||
net stop redis
|
|
||||||
net stop mysql
|
|
||||||
|
|
||||||
# 1.修改项目配置文件 application.yml
|
|
||||||
active: docker
|
|
||||||
|
|
||||||
# 2.先进JAVA项目根路径 maven打包
|
|
||||||
mvn clean package
|
|
||||||
|
|
||||||
|
|
||||||
# 3.构建镜像__容器组(当你改变本地代码,也可重新构建镜像)
|
|
||||||
docker-compose build
|
|
||||||
|
|
||||||
# 4.配置host
|
|
||||||
|
|
||||||
# jeecgboot
|
|
||||||
127.0.0.1 jero-boot-redis
|
|
||||||
127.0.0.1 jero-boot-mysql
|
|
||||||
127.0.0.1 jero-boot-system
|
|
||||||
|
|
||||||
# 5.启动镜像__容器组(也可取代运行中的镜像)
|
|
||||||
docker-compose up -d
|
|
||||||
|
|
||||||
# 6.访问后台项目(注意要开启swagger)
|
# 6.访问后台项目(注意要开启swagger)
|
||||||
http://localhost:8080/jero-boot/doc.html
|
http://localhost:8080/jero-boot/doc.html
|
||||||
```
|
```
|
||||||
@@ -1789,7 +1789,6 @@ CREATE TABLE `sys_depart` (
|
|||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of sys_depart
|
-- Records of sys_depart
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
INSERT INTO `sys_depart` VALUES ('743ba9dbdc114af8953a11022ef3096a', 'f28c6f53abd841ac87ead43afc483433', '财务部', null, null, '0', null, '1', '2', 'A03A01', null, null, null, null, null, '0', 'admin', '2019-03-22 16:45:43', null, null);
|
|
||||||
INSERT INTO `sys_depart` VALUES ('c6d7cb4deeac411cb3384b1b31278596', '', '公司总部', null, null, '0', null, '1', '1', 'A01', null, null, null, null, null, '0', 'admin', '2019-02-11 14:21:51', 'admin', '2021-03-16 14:19:08');
|
INSERT INTO `sys_depart` VALUES ('c6d7cb4deeac411cb3384b1b31278596', '', '公司总部', null, null, '0', null, '1', '1', 'A01', null, null, null, null, null, '0', 'admin', '2019-02-11 14:21:51', 'admin', '2021-03-16 14:19:08');
|
||||||
|
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
|
|||||||
+28
-11
@@ -279,25 +279,42 @@ public class SysDictController {
|
|||||||
/**
|
/**
|
||||||
* 根据表名——显示字段-存储字段 pid 加载树形数据
|
* 根据表名——显示字段-存储字段 pid 加载树形数据
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@ApiOperation(value = "字典控制器-根据表名—显示字段-存储字段 pid 加载树形数据", notes = "字典控制器-根据表名—显示字段-存储字段 pid 加载树形数据")
|
||||||
@ApiOperation(value = "字典控制器-根据表名——显示字段-存储字段 pid 加载树形数据", notes = "字典控制器-根据表名——显示字段-存储字段 pid 加载树形数据")
|
|
||||||
@RequestMapping(value = "/loadTreeData", method = RequestMethod.GET)
|
@RequestMapping(value = "/loadTreeData", method = RequestMethod.GET)
|
||||||
public Result<List<TreeSelectModel>> loadTreeData(@RequestParam(name="pid") String pid, @RequestParam(name="pidField") String pidField,
|
public Result<List<TreeSelectModel>> loadTreeData(@RequestParam(name="pid") String pid, @RequestParam(name="pidField") String pidField,
|
||||||
@RequestParam(name="tableName") String tbname,
|
@RequestParam(name="tableName") String tbname,
|
||||||
@RequestParam(name="text") String text,
|
@RequestParam(name="text") String text,
|
||||||
@RequestParam(name="code") String code,
|
@RequestParam(name="code") String code,
|
||||||
@RequestParam(name="hasChildField") String hasChildField,
|
@RequestParam(name="hasChildField", required = false) String hasChildField,
|
||||||
@RequestParam(name="condition") String condition,
|
@RequestParam(value = "sign", required = false) String sign, HttpServletRequest request) {
|
||||||
@RequestParam(value = "sign",required = false) String sign, HttpServletRequest request) {
|
|
||||||
Result<List<TreeSelectModel>> result = new Result<List<TreeSelectModel>>();
|
Result<List<TreeSelectModel>> result = new Result<List<TreeSelectModel>>();
|
||||||
Map<String, String> query = null;
|
|
||||||
if(oConvertUtils.isNotEmpty(condition)) {
|
|
||||||
query = JSON.parseObject(condition, Map.class);
|
|
||||||
}
|
|
||||||
// SQL注入漏洞 sign签名校验(表名,label字段,val字段,条件)
|
// SQL注入漏洞 sign签名校验(表名,label字段,val字段,条件)
|
||||||
String dictCode = tbname+","+text+","+code+","+condition;
|
String dictCode = tbname +","+ text +","+ code;
|
||||||
SqlInjectionUtil.filterContent(dictCode);
|
SqlInjectionUtil.filterContent(dictCode);
|
||||||
List<TreeSelectModel> ls = sysDictService.queryTreeList(query,tbname, text, code, pidField, pid,hasChildField);
|
List<TreeSelectModel> ls = sysDictService.queryTreeList(null, tbname, text, code, pidField, pid, hasChildField);
|
||||||
|
result.setSuccess(true);
|
||||||
|
result.setResult(ls);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询后返回树型数据
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "字典控制器-根据表名—显示字段-存储字段 查询数据 加载树形数据", notes = "字典控制器-根据表名—显示字段-存储字段 pid 加载树形数据")
|
||||||
|
@RequestMapping(value = "/queryTreeDataByKeyword", method = RequestMethod.GET)
|
||||||
|
public Result<List<TreeSelectModel>> queryTreeDataByKeyword(@RequestParam(name="pidField") String pidField,
|
||||||
|
@RequestParam(name="tableName") String tbname,
|
||||||
|
@RequestParam(name="text") String text,
|
||||||
|
@RequestParam(name="code") String code,
|
||||||
|
@RequestParam(name="keyword") String keyword,
|
||||||
|
HttpServletRequest request) {
|
||||||
|
Result<List<TreeSelectModel>> result = new Result<List<TreeSelectModel>>();
|
||||||
|
|
||||||
|
// SQL注入漏洞 sign签名校验(表名,label字段,val字段,条件)
|
||||||
|
String dictCode = tbname +","+ text +","+ code + "," + keyword;
|
||||||
|
SqlInjectionUtil.filterContent(dictCode);
|
||||||
|
List<TreeSelectModel> ls = sysDictService.queryTreeDataByKeyword(keyword, tbname, text, code, pidField);
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
result.setResult(ls);
|
result.setResult(ls);
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
+22
-2
@@ -32,6 +32,7 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Long duplicateCheckCountSql(DuplicateCheckVo duplicateCheckVo);
|
public Long duplicateCheckCountSql(DuplicateCheckVo duplicateCheckVo);
|
||||||
|
|
||||||
public Long duplicateCheckCountSqlNoDataId(DuplicateCheckVo duplicateCheckVo);
|
public Long duplicateCheckCountSqlNoDataId(DuplicateCheckVo duplicateCheckVo);
|
||||||
|
|
||||||
public List<DictModel> queryDictItemsByCode(@Param("code") String code);
|
public List<DictModel> queryDictItemsByCode(@Param("code") String code);
|
||||||
@@ -98,8 +99,27 @@ public interface SysDictMapper extends BaseMapper<SysDict> {
|
|||||||
* @param hasChildField
|
* @param hasChildField
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
List<TreeSelectModel> queryTreeList(@Param("query") String query,@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("pidField") String pidField,@Param("pid") String pid,@Param("hasChildField") String hasChildField);
|
||||||
List<TreeSelectModel> queryTreeList(@Param("query") Map<String, String> query,@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("pidField") String pidField,@Param("pid") String pid,@Param("hasChildField") String hasChildField);
|
|
||||||
|
/**
|
||||||
|
* 根据表名、显示字段名、存储字段名 和查询条件拼接树结构
|
||||||
|
* @param query
|
||||||
|
* @param table
|
||||||
|
* @param text
|
||||||
|
* @param code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<TreeSelectModel> queryTreeDataByKeyword(@Param("query") String query,@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("pidField") String pidField);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据表名、显示字段名、存储字段名、自身ID查询
|
||||||
|
* @param id
|
||||||
|
* @param table
|
||||||
|
* @param text
|
||||||
|
* @param code
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
TreeSelectModel queryTreeDataItemById(@Param("id") String id,@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("pidField") String pidField);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
|
|||||||
+22
-3
@@ -87,12 +87,31 @@
|
|||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
<if test="query!= null">
|
<if test="query!= null">
|
||||||
<foreach collection="query.entrySet()" item="value" index="key" >
|
and ${text} like concat(concat('%',#{query}),'%')
|
||||||
and ${key} = #{value}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据表名、显示字段名、存储字段名、父ID查询树 -->
|
||||||
|
<select id="queryTreeDataByKeyword" parameterType="Object" resultType="com.jero.modules.system.model.TreeSelectModel">
|
||||||
|
select ${text} as "title",
|
||||||
|
${code} as "key",
|
||||||
|
${pidField} as parentId
|
||||||
|
from ${table}
|
||||||
|
where 1 = 1
|
||||||
|
<if test="query!= null">
|
||||||
|
and ${text} like concat(concat('%',#{query}),'%')
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据表名、显示字段名、存储字段名、自身ID查询 -->
|
||||||
|
<select id="queryTreeDataItemById" parameterType="Object" resultType="com.jero.modules.system.model.TreeSelectModel">
|
||||||
|
select ${text} as "title",
|
||||||
|
${code} as "key",
|
||||||
|
${pidField} as parentId
|
||||||
|
from ${table}
|
||||||
|
where
|
||||||
|
id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
<!-- 分页查询字典表数据 -->
|
<!-- 分页查询字典表数据 -->
|
||||||
<select id="queryDictTablePageList" parameterType="Object" resultType="com.jero.common.system.vo.DictModel">
|
<select id="queryDictTablePageList" parameterType="Object" resultType="com.jero.common.system.vo.DictModel">
|
||||||
|
|||||||
+3
-2
@@ -1,6 +1,7 @@
|
|||||||
package com.jero.modules.system.model;
|
package com.jero.modules.system.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -24,6 +25,8 @@ public class TreeSelectModel implements Serializable {
|
|||||||
|
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
|
private List<TreeSelectModel> children = new ArrayList<>();
|
||||||
|
|
||||||
public String getValue() {
|
public String getValue() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@@ -80,8 +83,6 @@ public class TreeSelectModel implements Serializable {
|
|||||||
this.code = code;
|
this.code = code;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<TreeSelectModel> children;
|
|
||||||
|
|
||||||
public List<TreeSelectModel> getChildren() {
|
public List<TreeSelectModel> getChildren() {
|
||||||
return children;
|
return children;
|
||||||
}
|
}
|
||||||
|
|||||||
+12
-2
@@ -83,6 +83,7 @@ public interface ISysDictService extends IService<SysDict> {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<DictModel> queryLittleTableDictItems(String table, String text, String code,String keyword, int pageSize);
|
public List<DictModel> queryLittleTableDictItems(String table, String text, String code,String keyword, int pageSize);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据表名、显示字段名、存储字段名 查询树
|
* 根据表名、显示字段名、存储字段名 查询树
|
||||||
* @param table
|
* @param table
|
||||||
@@ -93,8 +94,17 @@ public interface ISysDictService extends IService<SysDict> {
|
|||||||
* @param hasChildField
|
* @param hasChildField
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
List<TreeSelectModel> queryTreeList(String query,String table, String text, String code, String pidField,String pid,String hasChildField);
|
||||||
List<TreeSelectModel> queryTreeList(Map<String, String> query,String table, String text, String code, String pidField,String pid,String hasChildField);
|
|
||||||
|
/**
|
||||||
|
* 根据表名、显示字段名、存储字段名 和查询条件拼接树结构
|
||||||
|
* @param table
|
||||||
|
* @param text
|
||||||
|
* @param code
|
||||||
|
* @param pidField
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<TreeSelectModel> queryTreeDataByKeyword(String query,String table, String text, String code, String pidField);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 真实删除
|
* 真实删除
|
||||||
|
|||||||
+47
-2
@@ -1,6 +1,7 @@
|
|||||||
package com.jero.modules.system.service.impl;
|
package com.jero.modules.system.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@@ -16,6 +17,7 @@ import com.jero.modules.system.mapper.SysDictItemMapper;
|
|||||||
import com.jero.modules.system.mapper.SysDictMapper;
|
import com.jero.modules.system.mapper.SysDictMapper;
|
||||||
import com.jero.modules.system.model.TreeSelectModel;
|
import com.jero.modules.system.model.TreeSelectModel;
|
||||||
import com.jero.modules.system.service.ISysDictService;
|
import com.jero.modules.system.service.ISysDictService;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.cache.annotation.Cacheable;
|
import org.springframework.cache.annotation.Cacheable;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -212,8 +214,51 @@ public class SysDictServiceImpl extends ServiceImpl<SysDictMapper, SysDict> impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<TreeSelectModel> queryTreeList(Map<String, String> query,String table, String text, String code, String pidField,String pid,String hasChildField) {
|
public List<TreeSelectModel> queryTreeList(String query,String table, String text, String code, String pidField, String pid, String hasChildField) {
|
||||||
return baseMapper.queryTreeList(query,table, text, code, pidField, pid,hasChildField);
|
return baseMapper.queryTreeList(query, table, text, code, pidField, pid,hasChildField);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TreeSelectModel> queryTreeDataByKeyword(String query,String table, String text, String code, String pidField) {
|
||||||
|
// 先查出要查询的数据
|
||||||
|
List<TreeSelectModel> serachTreeNode = this.baseMapper.queryTreeDataByKeyword(query, table, text, code, pidField);
|
||||||
|
|
||||||
|
// 构建一个HashMap,按ID为key存储全部查询出的数据结构
|
||||||
|
HashMap<String, TreeSelectModel> resultMap = new HashMap<>();
|
||||||
|
for (TreeSelectModel treeSelectModel : serachTreeNode){
|
||||||
|
resultMap.put(treeSelectModel.getKey(), treeSelectModel);
|
||||||
|
|
||||||
|
TreeSelectModel copyTreeSelectModel = treeSelectModel;
|
||||||
|
// 叠加的查询父节点
|
||||||
|
while (StringUtils.isNotEmpty(copyTreeSelectModel.getParentId())){
|
||||||
|
if (resultMap.get(copyTreeSelectModel.getParentId()) != null){
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
TreeSelectModel newTreeSelectModel = this.baseMapper.queryTreeDataItemById(copyTreeSelectModel.getParentId(), table, text, code, pidField);
|
||||||
|
resultMap.put(newTreeSelectModel.getKey(), newTreeSelectModel);
|
||||||
|
|
||||||
|
copyTreeSelectModel = newTreeSelectModel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
System.out.println("aaa");
|
||||||
|
|
||||||
|
// 遍历map里全部的节点,取出父节点放入list,并循环添加他的子节点
|
||||||
|
List<TreeSelectModel> treeNodeList = new ArrayList<>();
|
||||||
|
for (String key : resultMap.keySet()){
|
||||||
|
TreeSelectModel curTreeSelectModel = resultMap.get(key);
|
||||||
|
if (StringUtils.isEmpty(curTreeSelectModel.getParentId())){
|
||||||
|
treeNodeList.add(curTreeSelectModel);
|
||||||
|
} else {
|
||||||
|
// 如果有父节点,则找出自己的父节点,把自己添加进父节点的children属性里
|
||||||
|
TreeSelectModel existParentNode = resultMap.get(curTreeSelectModel.getParentId());
|
||||||
|
if (existParentNode != null){
|
||||||
|
existParentNode.getChildren().add(curTreeSelectModel);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return treeNodeList;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ spring:
|
|||||||
# 初始化大小,最小,最大
|
# 初始化大小,最小,最大
|
||||||
initial-size: 5
|
initial-size: 5
|
||||||
min-idle: 5
|
min-idle: 5
|
||||||
maxActive: 1000
|
maxActive: 20
|
||||||
# 配置获取连接等待超时的时间
|
# 配置获取连接等待超时的时间
|
||||||
maxWait: 60000
|
maxWait: 60000
|
||||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||||
|
|||||||
Generated
+31
@@ -6878,6 +6878,22 @@
|
|||||||
"safer-buffer": "^2.1.0"
|
"safer-buffer": "^2.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"echarts": {
|
||||||
|
"version": "5.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/echarts/-/echarts-5.0.2.tgz",
|
||||||
|
"integrity": "sha512-En0VYpc96nw2/2AZoBWPHsGi471zMublttj50kfFpYAeR4geup0Tj9iVgEXh7QYZFPnRiruDJEjcB5PXZ+BYzQ==",
|
||||||
|
"requires": {
|
||||||
|
"tslib": "2.0.3",
|
||||||
|
"zrender": "5.0.4"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz",
|
||||||
|
"integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"ee-first": {
|
"ee-first": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
|
||||||
@@ -17368,6 +17384,21 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"zrender": {
|
||||||
|
"version": "5.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/zrender/-/zrender-5.0.4.tgz",
|
||||||
|
"integrity": "sha512-DJpy0yrHYY5CuH6vhb9IINWbjvBUe/56J8aH86Jb7O8rRPAYZ3M2E469Qf5B3EOIfM3o3aUrO5edRQfLJ+l1Qw==",
|
||||||
|
"requires": {
|
||||||
|
"tslib": "2.0.3"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.3.tgz",
|
||||||
|
"integrity": "sha512-uZtkfKblCEQtZKBF6EBXVZeQNl82yqtDQdv+eck8u7tdPxjLu2/lp5/uPW+um2tpuxINHWy3GhiccY7QgEaVHQ=="
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,19 +31,17 @@
|
|||||||
:value="momVal"
|
:value="momVal"
|
||||||
:disabled="disabled || readOnly"
|
:disabled="disabled || readOnly"
|
||||||
:format="dateFormat"
|
:format="dateFormat"
|
||||||
@change="handleMonthChange"
|
@change="handleMonthChange"/>
|
||||||
/>
|
|
||||||
<!--YYYY-->
|
<!--YYYY-->
|
||||||
<a-date-picker
|
<a-date-picker
|
||||||
v-if="showType === 'year'"
|
v-if="showType === 'year'"
|
||||||
mode="year"
|
|
||||||
:placeholder="placeholder"
|
:placeholder="placeholder"
|
||||||
|
mode="year"
|
||||||
:format="dateFormat"
|
:format="dateFormat"
|
||||||
v-model="addForm.all_plan_one"
|
:value="year"
|
||||||
:open='yearShowOne'
|
:open='yearShowOne'
|
||||||
@openChange="openChangeOne"
|
@openChange="openChangeOne"
|
||||||
@panelChange="panelChangeOne"
|
@panelChange="panelChangeOne"/>
|
||||||
@change="handleYearChange"/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
@@ -96,9 +94,7 @@
|
|||||||
let dateStr = this.value;
|
let dateStr = this.value;
|
||||||
return {
|
return {
|
||||||
yearShowOne:false, //控制年份模态框的显示与否
|
yearShowOne:false, //控制年份模态框的显示与否
|
||||||
addForm:{
|
year:'',
|
||||||
all_plan_one:null,//开始年限
|
|
||||||
},
|
|
||||||
decorator:"",
|
decorator:"",
|
||||||
momVal:!dateStr?null:moment(dateStr,this.dateFormat)
|
momVal:!dateStr?null:moment(dateStr,this.dateFormat)
|
||||||
}
|
}
|
||||||
@@ -132,13 +128,11 @@
|
|||||||
},
|
},
|
||||||
// 得到年份选择器的值
|
// 得到年份选择器的值
|
||||||
panelChangeOne(value){
|
panelChangeOne(value){
|
||||||
this.addForm.all_plan_one = value
|
let year = moment(value,this.dateFormat).year().toString() // 处理成字符串
|
||||||
|
this.year = value //组件显示的
|
||||||
|
this.$emit('change',year)
|
||||||
this.yearShowOne = false
|
this.yearShowOne = false
|
||||||
},
|
},
|
||||||
handleYearChange(mom,dateStr){
|
|
||||||
this.yearShowOne = false
|
|
||||||
this.$emit('change',dateStr)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
//2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 这个牛逼
|
//2.2新增 在组件内定义 指定父组件调用时候的传值属性和事件类型 这个牛逼
|
||||||
model: {
|
model: {
|
||||||
@@ -146,4 +140,9 @@
|
|||||||
event: 'change'
|
event: 'change'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// let bodyO = document.querySelector()
|
||||||
|
// bodyO.onclick = function (){
|
||||||
|
// console.log(0)
|
||||||
|
// }
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
:value="treeValue"
|
:value="treeValue"
|
||||||
:treeData="treeData"
|
:treeData="treeData"
|
||||||
:multiple="multiple"
|
:multiple="multiple"
|
||||||
|
:show-search="!multiple"
|
||||||
@change="onChange"
|
@change="onChange"
|
||||||
@search="onSearch">
|
@search="onSearch">
|
||||||
</a-tree-select>
|
</a-tree-select>
|
||||||
@@ -128,7 +129,7 @@
|
|||||||
this.$emit('change', this.value,text)
|
this.$emit('change', this.value,text)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
initDictInfo(){
|
initDictInfo(){ //取出父组件传过来的code,text,tableName
|
||||||
let arr = this.dict.split(",")
|
let arr = this.dict.split(",")
|
||||||
this.tableName = arr[0]
|
this.tableName = arr[0]
|
||||||
this.text = arr[1]
|
this.text = arr[1]
|
||||||
@@ -150,6 +151,7 @@
|
|||||||
hasChildField:this.hasChildField,
|
hasChildField:this.hasChildField,
|
||||||
condition:this.condition
|
condition:this.condition
|
||||||
}
|
}
|
||||||
|
console.log(param)
|
||||||
getAction(this.url,param).then(res=>{
|
getAction(this.url,param).then(res=>{
|
||||||
if(res.success){
|
if(res.success){
|
||||||
console.log(res)
|
console.log(res)
|
||||||
@@ -184,7 +186,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
loadRoot(){
|
loadRoot(){ // 初始化树
|
||||||
let param = {
|
let param = {
|
||||||
pid:this.pidValue,
|
pid:this.pidValue,
|
||||||
tableName:this.tableName,
|
tableName:this.tableName,
|
||||||
@@ -224,7 +226,31 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
onSearch(value){
|
onSearch(value){
|
||||||
console.log(value)
|
let param = {
|
||||||
|
code:this.code,
|
||||||
|
keyword:value,
|
||||||
|
pidField:this.pidField,
|
||||||
|
tableName:this.tableName,
|
||||||
|
text:this.text
|
||||||
|
}
|
||||||
|
getAction('/sys/dict/queryTreeDataByKeyword',param).then((res)=>{
|
||||||
|
if (res.success){
|
||||||
|
//设置是否是叶子节点(是否能展开)
|
||||||
|
for(let i of res.result){
|
||||||
|
i.value = i.key
|
||||||
|
if(i.leaf==false){
|
||||||
|
i.isLeaf=false
|
||||||
|
}else if(i.leaf==true){
|
||||||
|
i.isLeaf=true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//赋值树的数据
|
||||||
|
this.treeData = []
|
||||||
|
this.treeData = [...res.result]
|
||||||
|
// this.treeData = fn(res.result)
|
||||||
|
// fn(res.result)
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
getCurrTreeData(){
|
getCurrTreeData(){
|
||||||
return this.treeData
|
return this.treeData
|
||||||
|
|||||||
Reference in New Issue
Block a user