Compare commits
49 Commits
1bd5754c12
...
fibo-rule-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
589fe19fd8 | ||
|
|
ace5561ca5 | ||
|
|
dd3fcae3cc | ||
|
|
4510f058c3 | ||
|
|
ccef07e8e7 | ||
|
|
0441b56424 | ||
|
|
0bb5cec9a4 | ||
| 86f41c849f | |||
| 7eaa7de140 | |||
|
|
afcf60ef4b | ||
|
|
7cf69bb30c | ||
| c35000738c | |||
| 74103d4663 | |||
| 97059278e1 | |||
| 25f51b1293 | |||
| 54da4065db | |||
| 034b9c6ed5 | |||
| 9d034fb303 | |||
| e87eab5460 | |||
| 5b41070529 | |||
| 2d4ddc2857 | |||
| 2480af577b | |||
| 16cf3dcd2d | |||
| 3f42770cd6 | |||
| 5044b3106b | |||
| 2e59537866 | |||
| 3667ff7715 | |||
| f537ec0588 | |||
| 217b499c26 | |||
| 49644c99a9 | |||
| 58204692a6 | |||
| 554286c88c | |||
| a8aece404d | |||
| 36184d8cc2 | |||
| a84ec9dff5 | |||
|
|
f9f00ea4bd | ||
|
|
ca6466d59a | ||
|
|
0430e8d010 | ||
|
|
9dde3cf3c2 | ||
|
|
35e92433e3 | ||
|
|
3ba4f8a341 | ||
|
|
a5bc7208cd | ||
|
|
d558598066 | ||
|
|
69f11309fb | ||
|
|
a41e6b1a62 | ||
|
|
f2af0e874e | ||
|
|
2f87a91d59 | ||
|
|
abbee93cbf | ||
|
|
34f868b21b |
0
ddp/.gitignore → .gitignore
vendored
33
README.md
@@ -15,18 +15,7 @@ h5-datax-manager --- 指标中心前端代码
|
||||
h5-enginex-manager -- 规则引擎前端代码
|
||||
sql --- sql初始化脚本
|
||||
|
||||
## 开源交流
|
||||
加官方微信号,进开源交流群。
|
||||
|
||||
|
||||

|
||||
|
||||
扫描二维码,添加WhatsApp。
|
||||
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||
## FiboRule整体功能架构介绍
|
||||
|
||||
FiboRule整体功能架构如下图所示
|
||||
@@ -160,3 +149,23 @@ https://docs.qq.com/sheet/DSnpRV1JWdkNvaG9u
|
||||
### 9 视频demo
|
||||
https://www.bilibili.com/video/BV12N4y1L7Kt
|
||||
|
||||
### 10 使用者列表
|
||||
|
||||
至今,多家公司的线上产品已接入FiboRule,接入场景如银行信用卡,保险理赔业务和政府大数据部门等。
|
||||
|
||||
<!--  -->
|
||||
|
||||
> 更多接入的公司,欢迎在 [登记地址](https://github.com/FiboAI/FiboRule/issues/19 ) 登记,登记仅仅为了产品推广。
|
||||
|
||||
|
||||
### 11 开源交流
|
||||
|
||||
加官方微信号,进开源交流群
|
||||
|
||||

|
||||
|
||||
扫描二维码,添加WhatsApp
|
||||
|
||||

|
||||
|
||||
欢迎大家的关注和使用,FiboRule也将拥抱变化,持续发展。
|
||||
|
||||
17
bugs/note.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
BUG:
|
||||
基础指标模版下载报错
|
||||
数据源指标编辑 , 这些变量值 没有绑定到界面上,接口返回是ok的 ,前端需要改一下
|
||||
引擎列表 点名称 一直加载中
|
||||
决策复制版本 ,报错
|
||||
|
||||
|
||||
|
||||
t_machine_learning_models model_field (模型解析字段) 字段长度太小
|
||||
ALTER TABLE t_machine_learning_models MODIFY COLUMN model_field varchar(4096) NOT NULL DEFAULT '' COMMENT '模型解析字段';
|
||||
|
||||
|
||||
|
||||
优化点:
|
||||
数据中心 / 接口源 / 接口新建 修改 查看 请求地址 输入框加长
|
||||
|
||||
@@ -167,4 +167,6 @@ public interface FieldMapper extends BaseMapper<Field> {
|
||||
public Field findByFieldCnbyorganId(Map<String, Object> paramMap);
|
||||
|
||||
List<Field> selectFieldListByEns(@Param("ens")List<String> ens);
|
||||
|
||||
List<Field> getAllFieldList();
|
||||
}
|
||||
|
||||
@@ -367,6 +367,12 @@
|
||||
<!-- )-->
|
||||
</update>
|
||||
|
||||
<select id="getAllFieldList" resultType="com.fibo.ddp.common.model.datax.datamanage.Field">
|
||||
select
|
||||
<include refid="Base_Column"></include>
|
||||
from t_field
|
||||
</select>
|
||||
|
||||
<select id="getFieldList" parameterType="map" resultType="com.fibo.ddp.common.model.datax.datamanage.Field">
|
||||
select
|
||||
t.id,
|
||||
|
||||
@@ -16,4 +16,7 @@ public interface MachineLearningModelsMapper extends BaseMapper<MachineLearningM
|
||||
* @return
|
||||
*/
|
||||
List<MachineLearningModels> getModelsListByOrganId(@Param("organId") Integer organId, @Param("searchString") String searchString);
|
||||
List<MachineLearningModels> getAllModelList();
|
||||
|
||||
|
||||
}
|
||||
@@ -15,4 +15,12 @@
|
||||
and (model_name like CONCAT('%',TRIM('${searchString}'),'%' ) or description like CONCAT('%',TRIM('${searchString}'),'%' ))
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getAllModelList" resultType="com.fibo.ddp.common.model.strategyx.aimodel.MachineLearningModels">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from t_machine_learning_models
|
||||
where status = 1
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -66,6 +66,11 @@ public class FieldCallLog implements Serializable {
|
||||
*/
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
public FieldCallLog(){
|
||||
|
||||
}
|
||||
|
||||
public FieldCallLog(Long fieldId, String fieldType,String sourceType,Long sourceId, String inputParam, String fieldValue, Long duration, Long organId) {
|
||||
this.fieldId = fieldId;
|
||||
this.fieldType = fieldType;
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.fibo.ddp.common.model.strategyx.aimodel;
|
||||
|
||||
import org.jpmml.evaluator.Evaluator;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class ModelDTO {
|
||||
|
||||
public String createTime = LocalDateTime.now().toString();
|
||||
private MachineLearningModels model;
|
||||
private String errorMsg;
|
||||
|
||||
private String text;
|
||||
|
||||
private Evaluator evaluator;
|
||||
|
||||
public String getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(String createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public MachineLearningModels getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
public void setModel(MachineLearningModels model) {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
public String getErrorMsg() {
|
||||
return errorMsg;
|
||||
}
|
||||
|
||||
public void setErrorMsg(String errorMsg) {
|
||||
this.errorMsg = errorMsg;
|
||||
}
|
||||
|
||||
public Evaluator fetchEvaluator() {
|
||||
return evaluator;
|
||||
}
|
||||
|
||||
public String getEvaluatorInfo() {
|
||||
return evaluator+"";
|
||||
}
|
||||
|
||||
|
||||
public String getText() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
this.text = text;
|
||||
}
|
||||
|
||||
public void setEvaluator(Evaluator evaluator) {
|
||||
this.evaluator = evaluator;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.fibo.ddp.common.model.strategyx.decisiontable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -29,9 +30,11 @@ public class DecisionTablesResult implements Serializable {
|
||||
|
||||
private Long versionId;//决策表版本id
|
||||
|
||||
private Integer rows;//行数
|
||||
@TableField(value = "rowss")
|
||||
private Integer ro;//行数
|
||||
|
||||
private Integer columns;//列数
|
||||
@TableField(value = "columnss")
|
||||
private Integer colum;//列数
|
||||
|
||||
private String resultValue;//结果集二维数组
|
||||
|
||||
|
||||
214
ddp/ddp-common/ddp-service/src/main/java/com/fibo/ddp/common/service/cache/LocalCacheService.java
vendored
Normal file
@@ -0,0 +1,214 @@
|
||||
package com.fibo.ddp.common.service.cache;
|
||||
|
||||
|
||||
import com.fibo.ddp.common.dao.datax.datamanage.FieldMapper;
|
||||
import com.fibo.ddp.common.dao.strategyx.aimodel.MachineLearningModelsMapper;
|
||||
import com.fibo.ddp.common.model.datax.datamanage.Field;
|
||||
import com.fibo.ddp.common.model.strategyx.aimodel.MachineLearningModels;
|
||||
import com.fibo.ddp.common.model.strategyx.aimodel.ModelDTO;
|
||||
import com.fibo.ddp.common.service.strategyx.aimodel.PMMLExecutor.PMMLExecutor;
|
||||
import com.fibo.ddp.common.utils.util.CommUtil;
|
||||
import org.jpmml.evaluator.Evaluator;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import javax.annotation.PreDestroy;
|
||||
import javax.annotation.Resource;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
|
||||
@Service
|
||||
public class LocalCacheService {
|
||||
|
||||
private static final Logger logger = LoggerFactory.getLogger(LocalCacheService.class);
|
||||
|
||||
|
||||
//
|
||||
private static final long ONE_SECOND_MS = 1000L;
|
||||
|
||||
// 10s
|
||||
private static final long UPDATE_SLEEP_TIME_MS = 10 * ONE_SECOND_MS;
|
||||
|
||||
|
||||
|
||||
//
|
||||
|
||||
private final AtomicLong runCount = new AtomicLong(0);
|
||||
// key is id
|
||||
private volatile Map<String, Field> fieldsMap = new ConcurrentHashMap<>();
|
||||
private volatile Map<String, ModelDTO> modelMap = new ConcurrentHashMap<>();
|
||||
|
||||
private final Map<String, String> infoMap = new ConcurrentHashMap<>();
|
||||
|
||||
private volatile boolean stop = false;
|
||||
|
||||
//
|
||||
|
||||
@Resource
|
||||
FieldMapper fieldMapper;
|
||||
|
||||
@Autowired
|
||||
MachineLearningModelsMapper machineLearningModelsMapper;
|
||||
|
||||
@Resource
|
||||
PMMLExecutor pmmlExecutor;
|
||||
|
||||
private final String startTime = LocalDateTime.now().toString();
|
||||
|
||||
|
||||
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
|
||||
|
||||
logger.info("LocalCacheService_init_start");
|
||||
// 这里先不抛异常,后面会定时刷新缓存
|
||||
updateAllCache(false);
|
||||
|
||||
// CommUtil.doSleep(UPDATE_SLEEP_TIME_MS);
|
||||
|
||||
Thread t = new LocalCacheUpdateThread();
|
||||
t.start();
|
||||
logger.info("LocalCacheService_init_done");
|
||||
|
||||
|
||||
}
|
||||
|
||||
@PreDestroy
|
||||
public void preDestroy(){
|
||||
stop = true;
|
||||
}
|
||||
|
||||
public Map<String,Object> getInfo(){
|
||||
Map<String,Object> info = new HashMap<>();
|
||||
info.put("VERSION",CommUtil.getVersion());
|
||||
info.put("startTime",startTime);
|
||||
|
||||
info.put("runCount",runCount.longValue());
|
||||
info.put("info",infoMap);
|
||||
|
||||
Map fieldsMapTmp = fieldsMap;
|
||||
Map modelMapTmp = modelMap;
|
||||
|
||||
if(fieldsMapTmp!=null){
|
||||
info.put("fieldsNum",fieldsMapTmp.size());
|
||||
}
|
||||
|
||||
if(modelMapTmp!=null){
|
||||
info.put("modelNum",modelMapTmp.size());
|
||||
}
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
public Map<String, Field> getFieldsMap(){
|
||||
return fieldsMap;
|
||||
}
|
||||
|
||||
public Map<String, ModelDTO> getModelMap(){
|
||||
return modelMap;
|
||||
}
|
||||
|
||||
public void updateModelCache()throws Exception{
|
||||
|
||||
Map<String, ModelDTO> modelMapTmp = new ConcurrentHashMap<>();
|
||||
List<MachineLearningModels> models = machineLearningModelsMapper.getAllModelList();
|
||||
|
||||
if(models!=null){
|
||||
for(MachineLearningModels item:models){
|
||||
Integer id = item.getId();
|
||||
if(id==null){
|
||||
continue;
|
||||
}
|
||||
String filePath = item.getFilePath();
|
||||
// ModelDTO modelDTOOld = modelMap.get(id+"");
|
||||
ModelDTO modelDTO = new ModelDTO();
|
||||
modelDTO.setModel(item);
|
||||
try {
|
||||
Evaluator evaluator = pmmlExecutor.loadPmml(filePath);
|
||||
modelDTO.setEvaluator(evaluator);
|
||||
if (evaluator == null) {
|
||||
modelDTO.setErrorMsg("evaluator_null");
|
||||
}
|
||||
}catch(Throwable e){
|
||||
modelDTO.setErrorMsg("loadPmml_error,"+e);
|
||||
}
|
||||
modelMapTmp.put(id+"",modelDTO);
|
||||
}
|
||||
}
|
||||
|
||||
modelMap = modelMapTmp;
|
||||
|
||||
}
|
||||
|
||||
public void updateAllCache(boolean throwsError){
|
||||
boolean error = false;
|
||||
try{
|
||||
updateFieldsCache();
|
||||
}catch(Throwable e){
|
||||
error = true;
|
||||
infoMap.put("updateFieldsCache_error",LocalDateTime.now()+":"+e);
|
||||
logger.error("updateFieldsCache_error",e);
|
||||
}
|
||||
|
||||
try{
|
||||
updateModelCache();
|
||||
}catch(Throwable e){
|
||||
error = true;
|
||||
infoMap.put("updateModelCache_error",LocalDateTime.now()+":"+e);
|
||||
logger.error("updateModelCache_error",e);
|
||||
}
|
||||
if(throwsError && error){
|
||||
throw new RuntimeException("updateAllCacheError");
|
||||
}
|
||||
}
|
||||
|
||||
public void updateFieldsCache(){
|
||||
Map<String, Field> fieldsMapTmp = new ConcurrentHashMap<>();
|
||||
List<Field> fields = fieldMapper.getAllFieldList();
|
||||
if(fields!=null) {
|
||||
for(Field item:fields){
|
||||
Long id = item.getId();
|
||||
if(id!=null){
|
||||
fieldsMapTmp.put(id+"",item);
|
||||
}
|
||||
}
|
||||
}
|
||||
fieldsMap = fieldsMapTmp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private class LocalCacheUpdateThread extends Thread{
|
||||
public void run(){
|
||||
while(true) {
|
||||
if(stop){
|
||||
logger.info("LocalCacheUpdateThread_exit_for_stop");
|
||||
break;
|
||||
}
|
||||
CommUtil.doSleep(UPDATE_SLEEP_TIME_MS);
|
||||
runCount.getAndIncrement();
|
||||
long start = System.currentTimeMillis();
|
||||
updateAllCache(false);
|
||||
long end = System.currentTimeMillis();
|
||||
long time = end - start;
|
||||
infoMap.put("updateAllCache_use_time",time+"MS");
|
||||
infoMap.put("updateAllCache_time",LocalDateTime.now().toString());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -12,4 +12,5 @@ public class SessionData {
|
||||
private Long organId; // 组织id
|
||||
private Long engineId; // 引擎id
|
||||
private Integer reqType;//请求类型
|
||||
private Integer ruleHitRspConfig; // 规则命中返回配置,默认1(0:未命中不返回,1:未命中返回)
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.util.concurrent.ListenableFuture;
|
||||
import org.springframework.util.concurrent.ListenableFutureCallback;
|
||||
import org.springframework.web.client.AsyncRestTemplate;
|
||||
@@ -244,20 +246,49 @@ public class InterfaceServiceImpl extends ServiceImpl<InterfaceMapper, Interface
|
||||
// 请求参数中的变量赋值
|
||||
String requestBody = setRequestBodyParams(interfaceInfo.getRequestBody(), inputParam);
|
||||
if(HttpMethod.POST.name().equals(interfaceInfo.getMethod())){
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
// 设置请求头
|
||||
httpHeaders.setAll(JSONObject.parseObject(interfaceInfo.getRequestHeaders(), Map.class));
|
||||
// 封装请求体
|
||||
JSONObject body = JSONObject.parseObject(requestBody);
|
||||
// 封装参数和头信息
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity(body, httpHeaders);
|
||||
// 发送请求
|
||||
if(callType == 2){
|
||||
responseEntity = restTemplate.postForEntity(url, httpEntity, String.class);
|
||||
} else {
|
||||
listenableFuture = asyncRestTemplate.postForEntity(url, httpEntity, String.class);
|
||||
|
||||
final String requestHeaders = interfaceInfo.getRequestHeaders();
|
||||
|
||||
if(requestHeaders!=null && requestHeaders.contains(MediaType.APPLICATION_JSON_VALUE)) {
|
||||
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
// 设置请求头
|
||||
httpHeaders.setAll(JSONObject.parseObject(requestHeaders, Map.class));
|
||||
// 封装请求体
|
||||
JSONObject body = JSONObject.parseObject(requestBody);
|
||||
// 封装参数和头信息
|
||||
HttpEntity<JSONObject> httpEntity = new HttpEntity(body, httpHeaders);
|
||||
// 发送请求
|
||||
if (callType == 2) {
|
||||
responseEntity = restTemplate.postForEntity(url, httpEntity, String.class);
|
||||
} else {
|
||||
listenableFuture = asyncRestTemplate.postForEntity(url, httpEntity, String.class);
|
||||
}
|
||||
}else{
|
||||
|
||||
HttpHeaders httpHeaders = new HttpHeaders();
|
||||
// 设置请求头
|
||||
httpHeaders.setAll(JSONObject.parseObject(interfaceInfo.getRequestHeaders(), Map.class));
|
||||
// 封装请求体
|
||||
|
||||
JSONObject body = JSONObject.parseObject(requestBody);
|
||||
MultiValueMap<String, Object> bodyMap = new LinkedMultiValueMap<>();
|
||||
bodyMap.setAll(body);
|
||||
|
||||
// 封装参数和头信息
|
||||
HttpEntity<MultiValueMap<String, Object>> httpEntity = new HttpEntity(bodyMap, httpHeaders);
|
||||
// 发送请求
|
||||
if (callType == 2) {
|
||||
// 这里调用还是报错 ,已修复
|
||||
// post http://47.99.93.74:8090/mockapi/hello2?name={name} 会报错
|
||||
// java.lang.IllegalArgumentException: Not enough variable values available to expand 'name'
|
||||
responseEntity = restTemplate.postForEntity(url, httpEntity, String.class);
|
||||
} else {
|
||||
listenableFuture = asyncRestTemplate.postForEntity(url, httpEntity, String.class);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else if(HttpMethod.GET.name().equals(interfaceInfo.getMethod())){
|
||||
// 封装uri地址路径变量
|
||||
Map<String, Object> uriVariables = new HashMap<>();
|
||||
|
||||
@@ -75,14 +75,22 @@ public class CommonServiceImpl implements CommonService {
|
||||
}
|
||||
SessionData sessionData = RunnerSessionManager.getSession();
|
||||
Long organId = sessionData.getOrganId();
|
||||
|
||||
List<Field> fieldList = fieldService.findFieldByIdsbyorganId(organId, ids);
|
||||
|
||||
List<Field> list = new ArrayList<>();
|
||||
|
||||
ids = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < fieldList.size(); i++) {
|
||||
if (fieldList.get(i).getIsDerivative() == 1) {
|
||||
ids.addAll(StringUtil.toLongList(fieldList.get(i).getOrigFieldId()));
|
||||
} else
|
||||
list.add(fieldList.get(i));
|
||||
}
|
||||
|
||||
// 20250214 bugfix , 这个不能放在 else分支里 !!!
|
||||
// 否则后面取不到值 !!!!!!
|
||||
list.add(fieldList.get(i));
|
||||
|
||||
}
|
||||
if (ids.size() > 0) {
|
||||
List<Field> lists = fieldService.findFieldByIdsbyorganId(organId, ids);
|
||||
@@ -140,17 +148,22 @@ public class CommonServiceImpl implements CommonService {
|
||||
// 常量指标
|
||||
// 常量JOSN指标直接获取定义好的常量的value
|
||||
String value = field.getJsonValue();
|
||||
inputParam.put(field.getFieldEn(), JSONObject.parseObject(value));
|
||||
// inputParam.put(field.getFieldEn(), JSONObject.parseObject(value));
|
||||
putValue(inputParam,field.getFieldEn(), value);
|
||||
|
||||
remainFields.remove(field);
|
||||
} else if (field.getIsUseSql()) {
|
||||
// 通过sql方式获取指标
|
||||
Object value = getFieldValueBySql(field, inputParam);
|
||||
inputParam.put(field.getFieldEn(), value);
|
||||
// inputParam.put(field.getFieldEn(), value);
|
||||
putValue(inputParam,field.getFieldEn(), value);
|
||||
|
||||
remainFields.remove(field);
|
||||
} else if (field.getIsInterface()) {
|
||||
// 解析接口指标
|
||||
String value = getFieldValueByInterface(field, inputParam);
|
||||
inputParam.put(field.getFieldEn(), value);
|
||||
// inputParam.put(field.getFieldEn(), value);
|
||||
putValue(inputParam,field.getFieldEn(), value);
|
||||
remainFields.remove(field);
|
||||
}
|
||||
}
|
||||
@@ -169,6 +182,17 @@ public class CommonServiceImpl implements CommonService {
|
||||
return false;
|
||||
}
|
||||
|
||||
private void putValue(Map map,String key,Object value){
|
||||
// ConcurrentHashMap key value 不能为 null
|
||||
if(key==null || value==null){
|
||||
return;
|
||||
}
|
||||
map.put(key,value);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 决策选项 测试时 ,这个方法 没被调用
|
||||
@Override
|
||||
public Map<String, Object> getFields(List<Field> fields, Map<String, Object> inputParam) {
|
||||
logger.info("start getEngineField, fields:{},inputParam:{}", JSONObject.toJSONString(fields), JSONObject.toJSONString(inputParam));
|
||||
@@ -355,9 +379,12 @@ public class CommonServiceImpl implements CommonService {
|
||||
} else if (jedis != null) {
|
||||
resultValue = jedis.eval(parameterMap.get("sqlStr").toString());
|
||||
}
|
||||
if (resultValue == null) {
|
||||
throw new ApiException(ErrorCodeEnum.GET_DATABASE_FIELD_ERROR.getCode(), ErrorCodeEnum.GET_DATABASE_FIELD_ERROR.getMessage());
|
||||
}
|
||||
|
||||
// 20250213 获取不到值 不报错 !!
|
||||
// com.fibo.ddp.common.utils.exception.ApiException: 获取数据库指标失败
|
||||
// if (resultValue == null) {
|
||||
// throw new ApiException(ErrorCodeEnum.GET_DATABASE_FIELD_ERROR.getCode(), ErrorCodeEnum.GET_DATABASE_FIELD_ERROR.getMessage());
|
||||
// }
|
||||
} finally {
|
||||
// 执行完成后切换到系统数据源
|
||||
DataSourceContextHolder.setDBType("default");
|
||||
@@ -367,12 +394,24 @@ public class CommonServiceImpl implements CommonService {
|
||||
}
|
||||
long end = System.currentTimeMillis();
|
||||
fieldCallLogService.save(new FieldCallLog(field.getId(), FieldTypeConsts.DATABASE,dataSource.getType(),dataSource.getId().longValue(),JSON.toJSONString(parameterMap),
|
||||
JSON.toJSONString(resultValue),(end - start),field.getOrganId()));
|
||||
toJSONString(resultValue),(end - start),field.getOrganId()));
|
||||
logger.info("【获取数据库指标】fieldEn:{}, 耗时:{}, result:{}, parameterMap:{}", field.getFieldEn(), (end - start), resultValue, parameterMap);
|
||||
return resultValue;
|
||||
|
||||
}
|
||||
|
||||
private String toJSONString(Object resultValue){
|
||||
if(resultValue==null){
|
||||
return null;
|
||||
}
|
||||
try{
|
||||
return JSON.toJSONString(resultValue);
|
||||
}catch(Throwable e){
|
||||
logger.error("toJSONString_error,"+e);
|
||||
return resultValue.toString();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析接口指标
|
||||
*
|
||||
|
||||
@@ -24,6 +24,7 @@ public class PMMLExecutorRFImpl implements PMMLExecutor {
|
||||
@Override
|
||||
public Evaluator loadPmml(String filePath) {
|
||||
// String filePath = "D:\\models\\model_RF.pmml";
|
||||
Evaluator modelEvaluator = null;
|
||||
PMML pmml = new PMML();
|
||||
InputStream inputStream = null;
|
||||
|
||||
@@ -52,10 +53,15 @@ public class PMMLExecutorRFImpl implements PMMLExecutor {
|
||||
}
|
||||
}
|
||||
|
||||
/*ModelEvaluatorFactory modelEvaluatorFactory = ModelEvaluatorFactory.newInstance();
|
||||
Evaluator evaluator = modelEvaluatorFactory.newModelEvaluator(pmml,pmml.getModels().get(0));
|
||||
pmml = null;*/
|
||||
ModelEvaluatorBuilder modelEvaluatorBuilder = new ModelEvaluatorBuilder(pmml);
|
||||
ModelEvaluatorFactory modelEvaluatorFactory = ModelEvaluatorFactory.newInstance();
|
||||
Evaluator evaluator = modelEvaluatorFactory.newModelEvaluator(pmml);
|
||||
pmml = null;
|
||||
return evaluator;
|
||||
modelEvaluatorBuilder.setModelEvaluatorFactory(modelEvaluatorFactory);
|
||||
modelEvaluator = modelEvaluatorBuilder.build();
|
||||
modelEvaluator.verify();
|
||||
return modelEvaluator;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -70,18 +76,33 @@ public class PMMLExecutorRFImpl implements PMMLExecutor {
|
||||
}
|
||||
|
||||
Map<FieldName, ?> results = evaluator.evaluate(arguments);
|
||||
|
||||
System.out.println("pmml_predict_results: " + results);
|
||||
|
||||
List<TargetField> targetFields = evaluator.getTargetFields();
|
||||
|
||||
TargetField targetField = targetFields.get(0);
|
||||
FieldName targetFieldName = targetField.getName();
|
||||
|
||||
Object targetFieldValue = results.get(targetFieldName);
|
||||
System.out.println("target: " + targetFieldName.getValue() + ", value: " + targetFieldValue);
|
||||
System.out.println("target: " + targetFieldName.getValue() + ", value: " + targetFieldValue+",valueType="+targetFieldValue.getClass());
|
||||
|
||||
double value_1 = 0.0f;
|
||||
|
||||
// 2025-02-11 新增
|
||||
if(targetFieldValue instanceof Number){
|
||||
Number tmpnum = (Number)targetFieldValue;
|
||||
value_1 = tmpnum.doubleValue();
|
||||
}
|
||||
|
||||
// TODO 模型取值逻辑待确认
|
||||
if (targetFieldValue instanceof ProbabilityDistribution) {
|
||||
value_1 = ((ProbabilityDistribution) targetFieldValue).getValue("1");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return value_1;
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,8 @@ public class ModelsServiceImpl extends ServiceImpl<MachineLearningModelsMapper,
|
||||
String key = RedisUtils.getPrimaryKey(TableEnum.T_MACHINE_LEARNING_MODELS, id);
|
||||
machineLearningModels = redisManager.getByPrimaryKey(key, MachineLearningModels.class);
|
||||
} else {
|
||||
machineLearningModels = this.selectById(id);
|
||||
// machineLearningModels = this.selectById(id);
|
||||
machineLearningModels = machineLearningModelsMapper.selectById(id);
|
||||
}
|
||||
|
||||
return machineLearningModels;
|
||||
|
||||
@@ -116,9 +116,9 @@ public class DecisionTablesResultServiceImpl extends ServiceImpl<DecisionTablesR
|
||||
DecisionTablesResult resultInfo = new DecisionTablesResult();
|
||||
BeanUtils.copyProperties(vo,resultInfo);
|
||||
JSONArray resultList = vo.getResultList();
|
||||
resultInfo.setRows(resultList.size());
|
||||
resultInfo.setRo(resultList.size());
|
||||
JSONArray childList = JSON.parseArray(JSON.toJSONString(resultList.get(0)));
|
||||
resultInfo.setColumns(childList.size());
|
||||
resultInfo.setColum(childList.size());
|
||||
String resultValue = JSON.toJSONString(resultList);
|
||||
resultInfo.setResultValue(resultValue);
|
||||
return resultInfo;
|
||||
|
||||
@@ -272,10 +272,7 @@ public class RuleServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo> imple
|
||||
|
||||
@Override
|
||||
public List<JSONObject> setComplexRuleOutput(Long versionId, Map<String,Object> temp, Map<String, Object> input, String outType) {
|
||||
List<JSONObject> jsonObjectList = outputService.setOutput(new StrategyOutput(versionId, StrategyType.COMPLEX_RULE,outType), temp);
|
||||
// for (JSONObject jsonObject : jsonObjectList) {
|
||||
// input.putAll(jsonObject);
|
||||
// }
|
||||
List<JSONObject> jsonObjectList = outputService.setOutput(new StrategyOutput(versionId, StrategyType.COMPLEX_RULE,outType), input, temp);
|
||||
return jsonObjectList;
|
||||
}
|
||||
|
||||
|
||||
@@ -231,7 +231,7 @@ public class ListDbServiceImp extends ServiceImpl<ListDbMapper, ListDb> implemen
|
||||
ListDb listDb = listDbMapper.selectById(id);
|
||||
String tableName = "organ" + "_" + listDb.getOrganId() + "_" + listDb.getListType() + "_" + id;
|
||||
// 插入多行数据 insertOne into user_info (user_account,user_name,user_age,user_class) values ('00001', '张三 ','20','计算机系'), ('00002', '李四','19','计算机系');
|
||||
String sqlStr = "insertOne into " + tableName + "(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, user_id) values ";
|
||||
String sqlStr = "insert into " + tableName + "(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19, user_id) values ";
|
||||
|
||||
// 只取第一个Sheet页
|
||||
sheet = workbook.getSheetAt(0);
|
||||
|
||||
@@ -304,10 +304,10 @@ public class ScorecardVersionServiceImpl extends ServiceImpl<ScorecardVersionMap
|
||||
}
|
||||
scorecardDetailVo.setChildren(children);
|
||||
|
||||
Long userId = SessionManager.getLoginAccount().getUserId();
|
||||
//Long userId = SessionManager.getLoginAccount().getUserId();
|
||||
HashMap<String, Object> param = new HashMap<>();
|
||||
param.put("userId", scorecardDetail.getFieldId());
|
||||
param.put("userId", userId);
|
||||
//param.put("userId", userId);
|
||||
param.put("engineId", null);
|
||||
Field field = fieldService.findByFieldId(param);
|
||||
if (field != null) {
|
||||
|
||||
@@ -24,5 +24,7 @@ public interface StrategyOutputService extends IService<StrategyOutput> {
|
||||
|
||||
List<JSONObject> setOutput(StrategyOutput entity, Map<String,Object> input);
|
||||
|
||||
List<JSONObject> setOutput(StrategyOutput entity, Map<String,Object> input, Map<String,Object> temp);
|
||||
|
||||
boolean judgeOutCondition(String condition,Map<String,Object> input);
|
||||
}
|
||||
|
||||
@@ -130,6 +130,11 @@ public class StrategyOutputServiceImpl extends ServiceImpl<StrategyOutputMapper,
|
||||
//设置输出,传入map向map中放入输出并且返回输出列表
|
||||
@Override
|
||||
public List<JSONObject> setOutput(StrategyOutput entity, Map<String, Object> input) {
|
||||
return setOutput(entity, input, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<JSONObject> setOutput(StrategyOutput entity, Map<String, Object> input, Map<String,Object> temp) {
|
||||
List<StrategyOutput> strategyOutputList = this.queryByTactics(entity);
|
||||
List<JSONObject> jsonList = new ArrayList<>();
|
||||
if (strategyOutputList != null && strategyOutputList.size() > 0) {
|
||||
@@ -161,6 +166,9 @@ public class StrategyOutputServiceImpl extends ServiceImpl<StrategyOutputMapper,
|
||||
if(!field.getIsLocalVariable()){
|
||||
input.put(fieldEn, value);
|
||||
}
|
||||
if(temp != null){
|
||||
temp.put(fieldEn, value);
|
||||
}
|
||||
jsonList.add(json);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ public class ServiceFilterConstant {
|
||||
uriSet.add("/Riskmanage/v2/datamanage/datamanage/downTemplate");// 指标模板下载
|
||||
uriSet.add("/Riskmanage/v2/datamanage/listmanage/downTemplate");// 名单库模板下载
|
||||
uriSet.add("/Riskmanage/v3/analyse/decision");
|
||||
uriSet.add("/Riskmanage/info/status");
|
||||
}
|
||||
|
||||
public static boolean isSessionFilter(String uri) {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.fibo.ddp.common.utils.util;
|
||||
|
||||
public class CommUtil {
|
||||
|
||||
private static final String VERSION = "2025-02-14 17:00";
|
||||
|
||||
|
||||
|
||||
public static String getVersion(){
|
||||
return VERSION;
|
||||
}
|
||||
public static void doSleep(long time){
|
||||
if(time<=0){
|
||||
return;
|
||||
}
|
||||
try{
|
||||
Thread.sleep(time);
|
||||
}catch(Throwable e){
|
||||
// do nothing
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -157,8 +157,17 @@ public class JevalUtil {
|
||||
}
|
||||
//2代表字符串
|
||||
if(value == 2){
|
||||
String variableValue = CommonConst.SYMBOL_SINGLE_QUOTA+variablesMap.get(key).toString()+CommonConst.SYMBOL_SINGLE_QUOTA;
|
||||
variablesMap.put(key, variableValue);
|
||||
// 20250213 空指针修复
|
||||
// String variableValue = CommonConst.SYMBOL_SINGLE_QUOTA+variablesMap.get(key).toString()+CommonConst.SYMBOL_SINGLE_QUOTA;
|
||||
Object v = variablesMap.get(key);
|
||||
if(v!=null) {
|
||||
String variableValue = CommonConst.SYMBOL_SINGLE_QUOTA+v.toString()+CommonConst.SYMBOL_SINGLE_QUOTA;
|
||||
variablesMap.put(key, variableValue);
|
||||
}else{
|
||||
String variableValue = CommonConst.SYMBOL_SINGLE_QUOTA+CommonConst.SYMBOL_SINGLE_QUOTA;
|
||||
|
||||
variablesMap.put(key, variableValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.fibo.ddp.enginex.riskengine.runner.api;
|
||||
|
||||
import com.fibo.ddp.common.service.cache.LocalCacheService;
|
||||
import com.fibo.ddp.common.service.common.runner.RunnerSessionManager;
|
||||
import com.fibo.ddp.common.service.common.runner.SessionData;
|
||||
import com.fibo.ddp.enginex.riskengine.runner.business.DecisionApiBizData;
|
||||
@@ -27,6 +28,9 @@ public class RiskEngineApi {
|
||||
@Autowired
|
||||
public RiskEngineBusiness riskEngineBusiness;
|
||||
|
||||
@Autowired
|
||||
LocalCacheService localCacheService;
|
||||
|
||||
@RequestMapping(value = "/decision", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
|
||||
public String decision(@RequestBody DecisionApiRequest apiRequest) {
|
||||
long start = System.currentTimeMillis();
|
||||
@@ -42,6 +46,7 @@ public class RiskEngineApi {
|
||||
sessionData.setOrganId(bizData.getOrganId());
|
||||
sessionData.setEngineId(bizData.getEngineId());
|
||||
sessionData.setReqType(1);
|
||||
sessionData.setRuleHitRspConfig(bizData.getRuleHitRspConfig());
|
||||
RunnerSessionManager.setSession(sessionData);
|
||||
|
||||
if(bizData.getFields() != null){
|
||||
@@ -64,4 +69,21 @@ public class RiskEngineApi {
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/getLocalCacheInfo")
|
||||
public Object getLocalCacheInfo(){
|
||||
return localCacheService.getInfo();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/getFieldCache")
|
||||
public Object getFieldCache(){
|
||||
return localCacheService.getFieldsMap();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/getModelCache")
|
||||
public Object getModelCache(){
|
||||
return localCacheService.getModelMap();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -15,4 +15,5 @@ public class DecisionApiBizData {
|
||||
private Long organId; // 组织id
|
||||
private Long engineId; // 引擎id
|
||||
private Map<String, Object> fields; // 指标字段键值对
|
||||
private Integer ruleHitRspConfig; // 规则命中返回配置(0:未命中不返回,1:未命中返回)
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ public class RiskEngineBusinessImpl implements RiskEngineBusiness {
|
||||
logger.info("请求参数,paramJson: {}", JSONObject.toJSONString(paramJson));
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
JSONArray resultJson = new JSONArray();
|
||||
Map<String, Map<String, Object>> featureMaps = new ConcurrentHashMap<>();
|
||||
// Map<String, Map<String, Object>> featureMaps = new ConcurrentHashMap<>();
|
||||
Long organId = Long.valueOf(paramJson.get("organId").toString());
|
||||
Long engineId = Long.valueOf(paramJson.get("engineId").toString());
|
||||
//获取引擎信息
|
||||
@@ -124,13 +124,18 @@ public class RiskEngineBusinessImpl implements RiskEngineBusiness {
|
||||
//返回输出结果
|
||||
Map<String, Object> outMap = new ConcurrentHashMap<>();
|
||||
// 记录执行前全量指标
|
||||
featureMaps.put("before", inputParam);
|
||||
// featureMaps.put("before", inputParam);
|
||||
logger.info("recursionEngineNode_before_inputParam="+inputParam);
|
||||
|
||||
//节点执行方法
|
||||
recursionEngineNode(inputParam, engineNodeMap.get(engineNode.getNextNodes()), engineNodeMap, outMap);
|
||||
|
||||
logger.info("recursionEngineNode_after_inputParam="+inputParam);
|
||||
|
||||
jsonObject.put("status", "0x0000");
|
||||
jsonObject.put("msg", "执行成功");
|
||||
//记录执行后的全量指标
|
||||
featureMaps.put("after", inputParam);
|
||||
// featureMaps.put("after", inputParam);
|
||||
paramJson.put("versionId", engineNode.getVersionId());
|
||||
// featureRecordService.recordAllFeature(featureMaps, engine, paramJson);
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.Optional;
|
||||
* Canal数据同步
|
||||
* 实现ApplicationRunner接口,springboot启动成功后会执行run方法
|
||||
*/
|
||||
@Component
|
||||
|
||||
public class CanalClient implements ApplicationRunner {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
@@ -210,7 +210,7 @@ public class DecisionTablesNode implements EngineRunnerNode {
|
||||
if (row >= 0 && column >= 0) {
|
||||
//根据行列去结果集中找结果返回
|
||||
DecisionTablesResultVo resultSet = versionVo.getResultSet();
|
||||
if (row < resultSet.getRows() && column < resultSet.getColumns()) {
|
||||
if (row < resultSet.getRo() && column < resultSet.getColum()) {
|
||||
String resultValue = resultSet.getResultValue();
|
||||
JSONArray array = JSON.parseArray(resultValue);
|
||||
JSONArray rowArray = JSON.parseArray(JSON.toJSONString(array.get(row)));
|
||||
|
||||
@@ -2,9 +2,11 @@ package com.fibo.ddp.enginex.runner.node.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fibo.ddp.common.model.datax.datamanage.Field;
|
||||
import com.fibo.ddp.common.model.enginex.risk.EngineNode;
|
||||
import com.fibo.ddp.common.model.strategyx.aimodel.MachineLearningModels;
|
||||
import com.fibo.ddp.common.model.strategyx.strategyout.StrategyOutput;
|
||||
import com.fibo.ddp.common.service.cache.LocalCacheService;
|
||||
import com.fibo.ddp.common.service.datax.runner.CommonService;
|
||||
import com.fibo.ddp.common.service.datax.runner.ExecuteUtils;
|
||||
import com.fibo.ddp.common.service.strategyx.aimodel.ModelsService;
|
||||
@@ -37,6 +39,9 @@ public class ModelNode implements EngineRunnerNode {
|
||||
@Resource
|
||||
private StrategyOutputService outputService;
|
||||
|
||||
@Autowired
|
||||
LocalCacheService localCacheService;
|
||||
|
||||
private List<Long> getExecuteVersionIdList(EngineNode engineNode) {
|
||||
return ExecuteUtils.getExecuteIdList(engineNode, "modelId");
|
||||
}
|
||||
@@ -82,16 +87,26 @@ public class ModelNode implements EngineRunnerNode {
|
||||
|
||||
Map<String, Object> input = new HashMap<>();
|
||||
String[] modelFieldArr = models.getModelField().split(",");
|
||||
// mappingFieldArr 是 字段id t_field.id ,需要根据 id 取出 field_en
|
||||
String[] mappingFieldArr = models.getMappingField().split(",");
|
||||
|
||||
// 获取字段缓存信息
|
||||
Map<String, Field> fieldMap = localCacheService.getFieldsMap();
|
||||
|
||||
for (int i = 0; i < modelFieldArr.length; i++) {
|
||||
input.put(modelFieldArr[i], inputParam.get(mappingFieldArr[i]));
|
||||
String fieldId = mappingFieldArr[i];
|
||||
// 根据字段id 获取字段英文名
|
||||
String fieldEn = getFieldEnById(fieldMap,fieldId);
|
||||
if(fieldEn!=null) {
|
||||
input.put(modelFieldArr[i], inputParam.get(fieldEn));
|
||||
}
|
||||
}
|
||||
// 调用模型
|
||||
double modelResult = 0d;
|
||||
try {
|
||||
modelResult =pmmlExecutor.predict(evaluator, input);
|
||||
}catch (Exception e){
|
||||
logger.error("模型节点执行异常,node:{}",engineNode);
|
||||
logger.error("模型节点执行异常,node:{}",engineNode,e);
|
||||
}
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("nodeId", engineNode.getNodeId());
|
||||
@@ -125,4 +140,17 @@ public class ModelNode implements EngineRunnerNode {
|
||||
map.put(resultKey, executeResult);
|
||||
ExecuteUtils.terminalCondition(engineNode, inputParam, outMap, map);
|
||||
}
|
||||
|
||||
|
||||
// 根据字段id 获取字段英文名
|
||||
private static String getFieldEnById(Map<String, Field> fieldMap,String id){
|
||||
if(fieldMap==null || id==null){
|
||||
return null;
|
||||
}
|
||||
Field f = fieldMap.get(id);
|
||||
if(f==null){
|
||||
return null;
|
||||
}
|
||||
return f.getFieldEn();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ import com.fibo.ddp.common.model.strategyx.guiderule.vo.RuleBlockVo;
|
||||
import com.fibo.ddp.common.model.strategyx.guiderule.vo.RuleConditionVo;
|
||||
import com.fibo.ddp.common.model.strategyx.guiderule.vo.RuleVersionVo;
|
||||
import com.fibo.ddp.common.model.strategyx.scriptrule.RuleScriptVersion;
|
||||
import com.fibo.ddp.common.service.common.runner.RunnerSessionManager;
|
||||
import com.fibo.ddp.common.service.common.runner.SessionData;
|
||||
import com.fibo.ddp.common.service.datax.datamanage.FieldService;
|
||||
import com.fibo.ddp.common.service.datax.runner.CommonService;
|
||||
import com.fibo.ddp.common.service.datax.runner.ExecuteUtils;
|
||||
@@ -346,12 +348,16 @@ public class RuleSetNode implements EngineRunnerNode {
|
||||
}
|
||||
|
||||
String resultFieldEn = hitRuleBlock.getResultFieldEn();
|
||||
String outputFieldEn = hitRuleBlock.getResultFieldEn();
|
||||
if (resultFieldEn == null || "".equals(resultFieldEn)) {
|
||||
resultFieldEn = "rule_" + rule.getId() + "_" + ruleVersion.getId() + "_" + hitRuleBlock.getId() + "_hitResult";
|
||||
outputFieldEn = "ruleResult";
|
||||
}
|
||||
String scoreFieldEn = hitRuleBlock.getScoreFieldEn();
|
||||
String outputScoreEn = hitRuleBlock.getScoreFieldEn();
|
||||
if (StringUtils.isBlank(scoreFieldEn)) {
|
||||
scoreFieldEn = "rule_" + rule.getId() + "_" + ruleVersion.getId() + "_" + hitRuleBlock.getId() + "_score";
|
||||
outputScoreEn = "ruleScore";
|
||||
}
|
||||
input.put(resultFieldEn, "未命中");
|
||||
//根据执行的最终结果处理此规则输出内容
|
||||
@@ -361,27 +367,30 @@ public class RuleSetNode implements EngineRunnerNode {
|
||||
ruleMap.put("ruleResult", "命中");
|
||||
ruleMap.put("ruleScore", hitRuleBlock.getScore());
|
||||
JSONObject scoreJson = new JSONObject();
|
||||
resultJson.put(resultFieldEn, "命中");
|
||||
resultJson.put(outputFieldEn, "命中");
|
||||
fieldList.add(resultJson);
|
||||
// if (StringUtils.isNotBlank(ruleVersion.getScoreFieldEn())) {
|
||||
scoreJson.put(scoreFieldEn, hitRuleBlock.getScore());
|
||||
scoreJson.put(outputScoreEn, hitRuleBlock.getScore());
|
||||
fieldList.add(scoreJson);
|
||||
input.put(scoreFieldEn, hitRuleBlock.getScore());
|
||||
// }
|
||||
input.put(resultFieldEn, "命中");
|
||||
//处理此规则需要输出的内容
|
||||
fieldList.addAll(ruleService.setComplexRuleOutput(hitRuleBlock.getId(), temp, input, StrategyType.OutType.SUCCESS_OUT));
|
||||
ruleMap.put("fieldList", fieldList);
|
||||
hitFlag = true;
|
||||
ruleResultList.add(ruleMap);
|
||||
} else {
|
||||
resultJson.put(resultFieldEn, "未命中");
|
||||
resultJson.put(outputFieldEn, "未命中");
|
||||
ruleMap.put("ruleScore", 0);
|
||||
input.put(scoreFieldEn, 0);
|
||||
fieldList.add(resultJson);
|
||||
fieldList.addAll(ruleService.setComplexRuleOutput(hitRuleBlock.getId(), temp, input, StrategyType.OutType.FAIL_OUT));
|
||||
ruleMap.put("fieldList", fieldList);
|
||||
SessionData sessionData = RunnerSessionManager.getSession();
|
||||
if(sessionData.getRuleHitRspConfig() == null || sessionData.getRuleHitRspConfig() == 1){
|
||||
ruleResultList.add(ruleMap);
|
||||
}
|
||||
}
|
||||
ruleResultList.add(ruleMap);
|
||||
|
||||
return hitFlag;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ public class ConfigHolder {
|
||||
private String redisHost;
|
||||
@Value("${redis.port}")
|
||||
private int redisPort;
|
||||
@Value("${redis.db}")
|
||||
|
||||
private int redisDb;
|
||||
@Value("${redis.password}")
|
||||
|
||||
private String redisPwd;
|
||||
@Value("${redis.pool.maxTotal}")
|
||||
private int redisMaxTotal;
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.fibo.ddp.manager.web.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.fibo.ddp.common.model.common.ResponseEntityBuilder;
|
||||
import com.fibo.ddp.common.model.common.ResponseEntityDto;
|
||||
import com.fibo.ddp.common.model.common.message.template.entity.AppTemplate;
|
||||
import com.fibo.ddp.common.model.common.message.template.vo.AppTemplateReqVo;
|
||||
import com.fibo.ddp.common.service.common.SessionManager;
|
||||
import com.fibo.ddp.common.service.common.message.template.AppTemplateService;
|
||||
import com.fibo.ddp.common.utils.util.CommUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("info")
|
||||
public class InfoController {
|
||||
|
||||
@Autowired
|
||||
private AppTemplateService appTemplateService;
|
||||
|
||||
@RequestMapping("status")
|
||||
public Object status(HttpServletRequest request){
|
||||
Map map = new HashMap();
|
||||
map.put("version", CommUtil.getVersion());
|
||||
map.put("now", LocalDateTime.now().toString());
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
server.port=8080
|
||||
server.port=8082
|
||||
server.servlet.context-path=/Riskmanage
|
||||
|
||||
logging.config=classpath:logging-config.xml
|
||||
|
||||
# mysql
|
||||
spring.datasource.druid.url=jdbc:mysql://ip:3306/riskmanage?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
|
||||
spring.datasource.druid.username=<EFBFBD>˺<EFBFBD>
|
||||
spring.datasource.druid.password=<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
spring.datasource.druid.url=jdbc:mysql://127.0.0.1:3306/riskmanage?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
|
||||
spring.datasource.druid.username=root
|
||||
spring.datasource.druid.password=root123123
|
||||
spring.datasource.druid.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.druid.initialSize=20
|
||||
spring.datasource.druid.minIdle=20
|
||||
@@ -24,10 +24,10 @@ spring.datasource.druid.validation-query-timeout=500
|
||||
spring.datasource.druid.filters=stat
|
||||
|
||||
# redis
|
||||
redis.host=ip
|
||||
redis.port=<EFBFBD>˿<EFBFBD>
|
||||
redis.db=<EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD>
|
||||
redis.password=<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
redis.host=127.0.0.1
|
||||
redis.port=6379
|
||||
redis.db=
|
||||
redis.password=
|
||||
redis.pool.maxTotal=3000
|
||||
redis.pool.maxIdle=100
|
||||
redis.pool.maxWait=1000
|
||||
@@ -35,8 +35,8 @@ redis.pool.timeout=100000
|
||||
|
||||
# mail <20><>ѡ
|
||||
spring.mail.host=smtp.exmail.qq.com
|
||||
spring.mail.username=xxx
|
||||
spring.mail.password=xxx
|
||||
spring.mail.username=1404823045@qq.com
|
||||
spring.mail.password=lt520111111
|
||||
spring.mail.port=465
|
||||
spring.mail.properties.mail.smtp.auth=true
|
||||
spring.mail.properties.mail.smtp.timeout=50000
|
||||
|
||||
@@ -1 +1,68 @@
|
||||
spring.profiles.active=dev
|
||||
# spring.profiles.active=dev
|
||||
|
||||
server.port=8070
|
||||
server.servlet.context-path=/Riskmanage
|
||||
|
||||
logging.config=classpath:logging-config.xml
|
||||
|
||||
# mysql
|
||||
spring.datasource.druid.url=jdbc:mysql://120.27.225.67:9609/riskmanage?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
|
||||
spring.datasource.druid.username=riskmanage
|
||||
spring.datasource.druid.password=riskmanage@Farben2023
|
||||
spring.datasource.druid.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.druid.initialSize=20
|
||||
spring.datasource.druid.minIdle=20
|
||||
spring.datasource.druid.maxActive=100
|
||||
spring.datasource.druid.maxWait=60000
|
||||
spring.datasource.druid.timeBetweenEvictionRunsMillis=60000
|
||||
spring.datasource.druid.minEvictableIdleTimeMillis=300000
|
||||
spring.datasource.druid.testWhileIdle=true
|
||||
spring.datasource.druid.testOnBorrow=true
|
||||
spring.datasource.druid.testOnReturn=false
|
||||
spring.datasource.druid.poolPreparedStatements=true
|
||||
spring.datasource.druid.maxOpenPreparedStatements=20
|
||||
spring.datasource.druid.validationQuery=SELECT 1
|
||||
spring.datasource.druid.validation-query-timeout=500
|
||||
spring.datasource.druid.filters=stat
|
||||
|
||||
# redis
|
||||
redis.host=127.0.0.1
|
||||
redis.port=6379
|
||||
redis.db=0
|
||||
redis.password=
|
||||
redis.pool.maxTotal=3000
|
||||
redis.pool.maxIdle=100
|
||||
redis.pool.maxWait=1000
|
||||
redis.pool.timeout=100000
|
||||
|
||||
# mail
|
||||
spring.mail.host=smtp.exmail.qq.com
|
||||
spring.mail.username=xxx
|
||||
spring.mail.password=xxx
|
||||
spring.mail.port=465
|
||||
spring.mail.properties.mail.smtp.auth=true
|
||||
spring.mail.properties.mail.smtp.timeout=50000
|
||||
spring.mail.properties.mail.smtp.starttls.enable=true
|
||||
spring.mail.properties.mail.smtp.socketFactory.port=465
|
||||
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
|
||||
spring.mail.properties.mail.smtp.socketFactory.fallback=false
|
||||
|
||||
## hbase
|
||||
spring.data.hbase.quorum: ip:2181
|
||||
spring.data.hbase.rootDir: /usr/local/hbase/datatest
|
||||
spring.data.hbase.nodeParent: /hbase
|
||||
|
||||
runner.url: http://localhost:8071
|
||||
|
||||
# hbase
|
||||
monitor.data.storage.type=mysql
|
||||
|
||||
# canal
|
||||
switch.use.cache=off
|
||||
switch.canal.cache=off
|
||||
canal.hostname=127.0.0.1
|
||||
canal.port=11111
|
||||
|
||||
model.uploadDir=/tmp/model/upload/
|
||||
|
||||
|
||||
|
||||
@@ -13,9 +13,9 @@ public class ConfigHolder {
|
||||
private String redisHost;
|
||||
@Value("${redis.port}")
|
||||
private int redisPort;
|
||||
@Value("${redis.db}")
|
||||
|
||||
private int redisDb;
|
||||
@Value("${redis.password}")
|
||||
|
||||
private String redisPwd;
|
||||
@Value("${redis.pool.maxTotal}")
|
||||
private int redisMaxTotal;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
server.port=8081
|
||||
server.port=8083
|
||||
|
||||
logging.config=classpath:logging-config.xml
|
||||
|
||||
# mysql
|
||||
spring.datasource.druid.url=jdbc:mysql://ip:3306/riskmanage?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
|
||||
spring.datasource.druid.username=<EFBFBD>˺<EFBFBD>
|
||||
spring.datasource.druid.password=<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
spring.datasource.druid.url=jdbc:mysql://127.0.0.1:3306/riskmanage?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
|
||||
spring.datasource.druid.username=root
|
||||
spring.datasource.druid.password=root123123
|
||||
spring.datasource.druid.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.druid.initialSize=20
|
||||
spring.datasource.druid.minIdle=20
|
||||
@@ -23,10 +23,10 @@ spring.datasource.druid.validation-query-timeout=500
|
||||
spring.datasource.druid.filters=stat
|
||||
|
||||
# redis
|
||||
redis.host=ip
|
||||
redis.port=<EFBFBD>˿<EFBFBD>
|
||||
redis.db=1
|
||||
redis.password=<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
redis.host=127.0.0.1
|
||||
redis.port=6379
|
||||
redis.db=
|
||||
redis.password=
|
||||
redis.pool.maxTotal=3000
|
||||
redis.pool.maxIdle=100
|
||||
redis.pool.maxWait=1000
|
||||
@@ -34,8 +34,8 @@ redis.pool.timeout=100000
|
||||
|
||||
# mail
|
||||
spring.mail.host=smtp.exmail.qq.com
|
||||
spring.mail.username=xxx
|
||||
spring.mail.password=xxx
|
||||
spring.mail.username=1404823045@qq.com
|
||||
spring.mail.password=lt520111111
|
||||
spring.mail.port=465
|
||||
spring.mail.properties.mail.smtp.auth=true
|
||||
spring.mail.properties.mail.smtp.timeout=50000
|
||||
|
||||
@@ -1 +1,66 @@
|
||||
spring.profiles.active=dev
|
||||
# spring.profiles.active=dev
|
||||
|
||||
server.port=8071
|
||||
|
||||
logging.config=classpath:logging-config.xml
|
||||
|
||||
# mysql
|
||||
spring.datasource.druid.url=jdbc:mysql://120.27.225.67:9609/riskmanage?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8&allowMultiQueries=true
|
||||
spring.datasource.druid.username=riskmanage
|
||||
spring.datasource.druid.password=riskmanage@Farben2023
|
||||
spring.datasource.druid.driver-class-name=com.mysql.cj.jdbc.Driver
|
||||
spring.datasource.druid.initialSize=20
|
||||
spring.datasource.druid.minIdle=20
|
||||
spring.datasource.druid.maxActive=100
|
||||
spring.datasource.druid.maxWait=60000
|
||||
spring.datasource.druid.timeBetweenEvictionRunsMillis=60000
|
||||
spring.datasource.druid.minEvictableIdleTimeMillis=300000
|
||||
spring.datasource.druid.testWhileIdle=true
|
||||
spring.datasource.druid.testOnBorrow=true
|
||||
spring.datasource.druid.testOnReturn=false
|
||||
spring.datasource.druid.poolPreparedStatements=true
|
||||
spring.datasource.druid.maxOpenPreparedStatements=20
|
||||
spring.datasource.druid.validationQuery=SELECT 1
|
||||
spring.datasource.druid.validation-query-timeout=500
|
||||
spring.datasource.druid.filters=stat
|
||||
|
||||
# redis
|
||||
redis.host=127.0.0.1
|
||||
redis.port=6379
|
||||
redis.db=0
|
||||
redis.password=
|
||||
redis.pool.maxTotal=3000
|
||||
redis.pool.maxIdle=100
|
||||
redis.pool.maxWait=1000
|
||||
redis.pool.timeout=100000
|
||||
|
||||
# mail
|
||||
spring.mail.host=smtp.exmail.qq.com
|
||||
spring.mail.username=xxx
|
||||
spring.mail.password=xxx
|
||||
spring.mail.port=465
|
||||
spring.mail.properties.mail.smtp.auth=true
|
||||
spring.mail.properties.mail.smtp.timeout=50000
|
||||
spring.mail.properties.mail.smtp.starttls.enable=true
|
||||
spring.mail.properties.mail.smtp.socketFactory.port=465
|
||||
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
|
||||
spring.mail.properties.mail.smtp.socketFactory.fallback=false
|
||||
|
||||
# hbase no use
|
||||
spring.data.hbase.quorum:127.0.0.1
|
||||
spring.data.hbase.rootDir: /usr/local/hbase/datatest
|
||||
spring.data.hbase.nodeParent: /hbase
|
||||
|
||||
# canal
|
||||
switch.use.cache=off
|
||||
switch.canal.cache=off
|
||||
canal.hostname=127.0.0.1
|
||||
canal.port=11111
|
||||
|
||||
# monitor
|
||||
monitor.data.storage.type=mysql
|
||||
|
||||
model.uploadDir=/tmp/model/upload/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
<loggers>
|
||||
|
||||
<!--过滤掉spring和mybatis的一些无用的DEBUG信息-->
|
||||
<logger name="org.mybatis" level="info" additivity="false">
|
||||
<logger name="org.mybatis" level="debug" additivity="false">
|
||||
<AppenderRef ref="Console"/>
|
||||
</logger>
|
||||
<!--监控系统信息-->
|
||||
@@ -86,7 +86,7 @@
|
||||
<AppenderRef ref="Console"/>
|
||||
</Logger>
|
||||
|
||||
<root level="info">
|
||||
<root level="debug">
|
||||
<appender-ref ref="Console"/>
|
||||
<appender-ref ref="Filelog"/>
|
||||
<appender-ref ref="RollingFileInfo"/>
|
||||
|
||||
74
ddp/ddp-runner-api/src/test/java/pmml/PmmlTest.java
Normal file
@@ -0,0 +1,74 @@
|
||||
package pmml;
|
||||
|
||||
import com.fibo.ddp.common.service.strategyx.aimodel.PMMLExecutor.PMMLExecutor;
|
||||
import com.fibo.ddp.common.service.strategyx.aimodel.PMMLExecutor.impl.PMMLExecutorRFImpl;
|
||||
import org.jpmml.evaluator.InputField;
|
||||
import org.jpmml.evaluator.OutputField;
|
||||
import org.jpmml.evaluator.TargetField;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class PmmlTest {
|
||||
|
||||
public static void main(String[] args)throws Exception{
|
||||
|
||||
PMMLExecutor pmmlExecutor = new PMMLExecutorRFImpl();
|
||||
String file = "/Users/dugang/work/2025/risk/fibo-rule/ddp/ddp-runner-api/src/test/resources/demo001.pmml";
|
||||
// 加载模型文件
|
||||
org.jpmml.evaluator.Evaluator evaluator = pmmlExecutor.loadPmml(file);
|
||||
|
||||
|
||||
System.out.println("summary="+ evaluator.getSummary());
|
||||
|
||||
List<InputField> inputFields = evaluator.getInputFields();
|
||||
System.out.println("inputFields.size="+inputFields.size());
|
||||
for(InputField item:inputFields){
|
||||
System.out.println(item);
|
||||
}
|
||||
List<InputField> activeFields = evaluator.getActiveFields();
|
||||
System.out.println("activeFields.size="+activeFields.size());
|
||||
for(InputField item:activeFields){
|
||||
System.out.println(item);
|
||||
}
|
||||
|
||||
List<TargetField> targetFields = evaluator.getTargetFields();
|
||||
System.out.println("targetFields.size="+targetFields.size());
|
||||
for(TargetField item:targetFields){
|
||||
System.out.println(item);
|
||||
}
|
||||
List<OutputField> outputFields = evaluator.getOutputFields();
|
||||
System.out.println("outputFields.size="+outputFields.size());
|
||||
for(OutputField item:outputFields){
|
||||
System.out.println(item);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Map<String, Object> input = new HashMap<>();
|
||||
input.put("x1",1.0);
|
||||
input.put("x2",2.0);
|
||||
|
||||
double modelResult = pmmlExecutor.predict(evaluator, input);
|
||||
|
||||
System.out.println("modelResult="+modelResult);
|
||||
|
||||
|
||||
input.put("x1","1.0");
|
||||
input.put("x2","2.0");
|
||||
modelResult = pmmlExecutor.predict(evaluator, input);
|
||||
System.out.println("modelResult="+modelResult);
|
||||
|
||||
input.put("x1","1.7");
|
||||
input.put("x2","2.1");
|
||||
modelResult = pmmlExecutor.predict(evaluator, input);
|
||||
System.out.println("modelResult="+modelResult);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
46
ddp/ddp-runner-api/src/test/java/pmml/RestTemplateTest.java
Normal file
@@ -0,0 +1,46 @@
|
||||
package pmml;
|
||||
|
||||
|
||||
import org.springframework.http.HttpEntity;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.util.LinkedMultiValueMap;
|
||||
import org.springframework.util.MultiValueMap;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
public class RestTemplateTest {
|
||||
|
||||
public static void main(String[] args)throws Exception{
|
||||
|
||||
RestTemplate rt = new RestTemplate();
|
||||
|
||||
MultiValueMap<String, Object> map= new LinkedMultiValueMap<>();
|
||||
map.add("name", "tiger");
|
||||
|
||||
// 设置请求头
|
||||
HttpHeaders headers = new HttpHeaders();
|
||||
headers.setContentType(MediaType.APPLICATION_FORM_URLENCODED);
|
||||
|
||||
// 创建HTTP实体
|
||||
HttpEntity<MultiValueMap<String, Object>> request = new HttpEntity<>(map, headers);
|
||||
|
||||
// 发送POST请求
|
||||
String url = "http://47.99.93.74:8090/mockapi/hello2";
|
||||
String response = rt.postForObject(url, request, String.class);
|
||||
|
||||
System.out.println(response);
|
||||
|
||||
|
||||
ResponseEntity<String> responseEntity = rt.postForEntity(url, request, String.class);
|
||||
System.out.println(responseEntity.getBody());
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
22
ddp/ddp-runner-api/src/test/resources/demo001.pmml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<PMML xmlns="http://www.dmg.org/PMML-4_4" version="4.4">
|
||||
<Header copyright="Example Corp" description="Simple Linear Regression Model">
|
||||
<Application name="Example App" version="1.0"/>
|
||||
</Header>
|
||||
<DataDictionary numberOfFields="3">
|
||||
<DataField name="x1" optype="continuous" dataType="double"/>
|
||||
<DataField name="x2" optype="continuous" dataType="double"/>
|
||||
<DataField name="y" optype="continuous" dataType="double"/>
|
||||
</DataDictionary>
|
||||
<RegressionModel modelName="SimpleLinearRegression" functionName="regression">
|
||||
<MiningSchema>
|
||||
<MiningField name="x1" usageType="active"/>
|
||||
<MiningField name="x2" usageType="active"/>
|
||||
<MiningField name="y" usageType="predicted"/>
|
||||
</MiningSchema>
|
||||
<RegressionTable intercept="1.0">
|
||||
<NumericPredictor name="x1" exponent="1" coefficient="0.5"/>
|
||||
<NumericPredictor name="x2" exponent="1" coefficient="0.3"/>
|
||||
</RegressionTable>
|
||||
</RegressionModel>
|
||||
</PMML>
|
||||
@@ -21,6 +21,7 @@ import org.jpmml.evaluator.Evaluator;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
@@ -50,6 +51,13 @@ public class ModelsController {
|
||||
@Autowired
|
||||
private MachineLearningModelsMapper machineLearningModelsMapper;
|
||||
|
||||
@Value("${model.uploadDir}")
|
||||
private String modelUploadDir;
|
||||
|
||||
private static final String SLASH = "/";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取模型列表信息
|
||||
* @return
|
||||
@@ -110,13 +118,16 @@ public class ModelsController {
|
||||
while (iter.hasNext()) {
|
||||
MultipartFile file = multiRequest.getFile(iter.next().toString());
|
||||
if (file != null) {
|
||||
String uploadDir = request.getSession().getServletContext().getRealPath("/") + "upload/models/fieldUpload/";
|
||||
// String uploadDir = request.getSession().getServletContext().getRealPath("/") + "upload/models/fieldUpload/";
|
||||
final String uploadDir = modelUploadDir;
|
||||
logger.info("modelUploadDir="+modelUploadDir);
|
||||
if (!new File(uploadDir).exists()) {
|
||||
File dir = new File(uploadDir);
|
||||
dir.mkdirs();
|
||||
}
|
||||
fileName = System.currentTimeMillis() + "_" + file.getOriginalFilename();
|
||||
String path = uploadDir + fileName;
|
||||
final String path = buildPath(uploadDir,fileName);
|
||||
logger.info("modelFilePath"+path);
|
||||
//上传
|
||||
file.transferTo(new File(path));
|
||||
accessUrl = path;
|
||||
@@ -138,6 +149,18 @@ public class ModelsController {
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping(value = "getModelUploadDir")
|
||||
public String getModelUploadDir(){
|
||||
return modelUploadDir;
|
||||
}
|
||||
|
||||
private String buildPath(String dir,String fileName){
|
||||
if(dir.endsWith(SLASH)){
|
||||
return dir + fileName;
|
||||
}
|
||||
return dir + SLASH + fileName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加模型
|
||||
* @param models
|
||||
|
||||
@@ -247,13 +247,18 @@
|
||||
<dependency>
|
||||
<groupId>org.jpmml</groupId>
|
||||
<artifactId>pmml-evaluator</artifactId>
|
||||
<version>1.4.1</version>
|
||||
<version>1.5.11</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jpmml</groupId>
|
||||
<artifactId>pmml-evaluator-extension</artifactId>
|
||||
<version>1.4.1</version>
|
||||
<version>1.5.11</version>
|
||||
</dependency>
|
||||
<!--<dependency>
|
||||
<groupId>org.jpmml</groupId>
|
||||
<artifactId>pmml-model</artifactId>
|
||||
<version>1.7.1</version>
|
||||
</dependency>-->
|
||||
|
||||
<!-- swagger -->
|
||||
<dependency>
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
> 1%
|
||||
last 2 versions
|
||||
not ie <= 8
|
||||
@@ -1,3 +0,0 @@
|
||||
NODE_ENV = 'jia'
|
||||
VUE_CURRENTMODE = 'jia'
|
||||
VUE_PROXY = true
|
||||
@@ -1,3 +0,0 @@
|
||||
NODE_ENV = 'niu'
|
||||
VUE_CURRENTMODE = 'niu'
|
||||
VUE_PROXY = true
|
||||
@@ -1,3 +0,0 @@
|
||||
NODE_ENV = 'produce'
|
||||
VUE_CURRENTMODE = 'produce'
|
||||
VUE_PROXY = true
|
||||
@@ -1,3 +0,0 @@
|
||||
NODE_ENV = 'release'
|
||||
VUE_CURRENTMODE = 'release'
|
||||
VUE_PROXY = true
|
||||
@@ -1,3 +0,0 @@
|
||||
NODE_ENV = 'test'
|
||||
VUE_CURRENTMODE = 'test'
|
||||
VUE_PROXY = true
|
||||
@@ -1,3 +0,0 @@
|
||||
NODE_ENV = 'wang'
|
||||
VUE_CURRENTMODE = 'wang'
|
||||
VUE_PROXY = true
|
||||
@@ -1,12 +0,0 @@
|
||||
// {
|
||||
// "presets": [
|
||||
// ["env", {
|
||||
// "modules": false,
|
||||
// "targets": {
|
||||
// "browsers": ["> 1%", "last 2 versions", "not ie <= 8"]
|
||||
// }
|
||||
// }],
|
||||
// "stage-2"
|
||||
// ],
|
||||
// "plugins": ["transform-remove-strict-mode"]
|
||||
// }
|
||||
22
h5-auth-manager/.gitignore
vendored
@@ -1,22 +0,0 @@
|
||||
.DS_Store
|
||||
node_modules
|
||||
/dist
|
||||
example.html
|
||||
favicon.ico
|
||||
# local env files
|
||||
.env.local
|
||||
.env.*.local
|
||||
|
||||
# Log files
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
# Editor directories and files
|
||||
.idea
|
||||
.vscode
|
||||
*.suo
|
||||
*.ntvs*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw*
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"tabWidth": 4,
|
||||
"singleQuote": true,
|
||||
"trailingComma": "none",
|
||||
"printWidth": 140
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2016-2019 vue-manage-system
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,6 +0,0 @@
|
||||
module.exports = {
|
||||
presets: [
|
||||
'@vue/app'
|
||||
],
|
||||
|
||||
}
|
||||
@@ -1,89 +0,0 @@
|
||||
// console.log(process.env)
|
||||
var proxyObj = {}
|
||||
// console.log(process.env.VUE_PROXY)
|
||||
switch (process.env.NODE_ENV) {
|
||||
case 'development': // 开发环境代理地址
|
||||
proxyObj = {
|
||||
'/Riskmanage': {
|
||||
target: 'http://47.102.125.25:80', // 开发环境
|
||||
changeOrigin: true, // 是否跨域
|
||||
pathRewrite: {
|
||||
'^/Riskmanage': '/Riskmanage'
|
||||
},
|
||||
|
||||
},
|
||||
'/trading': {
|
||||
target: 'http://47.242.85.45:80', // 开发环境
|
||||
changeOrigin: true, // 是否跨域
|
||||
pathRewrite: {
|
||||
'^/trading': '/trading'
|
||||
},
|
||||
|
||||
},
|
||||
}
|
||||
break
|
||||
case 'test': // 测试环境代理地址
|
||||
proxyObj = {
|
||||
'/Riskmanage': {
|
||||
target: 'http://localhost:8080', // 测试环境
|
||||
changeOrigin: true, // 是否跨域
|
||||
pathRewrite: {
|
||||
'^/Riskmanage': '/Riskmanage'
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
case 'release': // 军环境
|
||||
proxyObj = {
|
||||
'/Riskmanage': {
|
||||
target: 'http://192.168.3.155:8080', // 谭环境
|
||||
changeOrigin: true, // 是否跨域
|
||||
pathRewrite: {
|
||||
'^/Riskmanage': '/Riskmanage'
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
case 'niu': // 牛环境
|
||||
proxyObj = {
|
||||
'/Riskmanage': {
|
||||
target: 'http://192.168.50.3:8080', // 生产环境
|
||||
changeOrigin: true, // 是否跨域
|
||||
pathRewrite: {
|
||||
'^/Riskmanage': '/Riskmanage'
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
case 'jia': // 贾环境
|
||||
proxyObj = {
|
||||
'/Riskmanage': {
|
||||
target: 'http://192.168.50.188:8080', // 生产环境
|
||||
changeOrigin: true, // 是否跨域
|
||||
pathRewrite: {
|
||||
'^/Riskmanage': '/Riskmanage'
|
||||
}
|
||||
}
|
||||
// '/list': {
|
||||
// target: 'http://127.0.0.1:8888', // 生产环境
|
||||
// changeOrigin: true, // 是否跨域
|
||||
// pathRewrite: {
|
||||
// '^/list': '/list'
|
||||
// }
|
||||
// },
|
||||
}
|
||||
break
|
||||
case 'wang': // 汪环境
|
||||
proxyObj = {
|
||||
'/Riskmanage': {
|
||||
target: 'http://192.168.50.228:8080', // 生产环境
|
||||
changeOrigin: true, // 是否跨域
|
||||
pathRewrite: {
|
||||
'^/Riskmanage': '/Riskmanage'
|
||||
}
|
||||
}
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
module.exports = proxyObj
|
||||
|
Before Width: | Height: | Size: 2.4 KiB |
@@ -1,9 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
||||
<exclude-output />
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -1,14 +0,0 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="favicon.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Vite App</title>
|
||||
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="./src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
Before Width: | Height: | Size: 2.4 KiB |
13833
h5-auth-manager/package-lock.json
generated
@@ -1,57 +0,0 @@
|
||||
{
|
||||
"name": "vue-manage-system",
|
||||
"version": "4.2.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"serve:test": "vue-cli-service serve --mode test",
|
||||
"serve:jia": "vue-cli-service serve --mode jia",
|
||||
"serve:niu": "vue-cli-service serve --mode niu",
|
||||
"serve:wang": "vue-cli-service serve --mode wang",
|
||||
"serve:release": "vue-cli-service serve --mode release",
|
||||
"serve:produce": "vue-cli-service serve --mode produce",
|
||||
"build": "vue-cli-service build",
|
||||
"lint": "vue-cli-service lint",
|
||||
"eslint": "eslint --fix --ext .js,.vue src",
|
||||
"stylelint": "stylelint **/*.{vue,css,scss,less} --fix",
|
||||
"standard": "standard",
|
||||
"standfix": "standard --fix",
|
||||
"dev": "vite",
|
||||
"start": "vite",
|
||||
"preview": "vite preview",
|
||||
"vite-build": "vite build"
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.18.1",
|
||||
"babel-polyfill": "^6.26.0",
|
||||
"echarts": "^5.1.2",
|
||||
"element-ui": "^2.11.0",
|
||||
"js-cookie": "^2.2.1",
|
||||
"less": "^4.1.1",
|
||||
"less-loader": "^5.0.0",
|
||||
"mavon-editor": "^2.6.17",
|
||||
"node-sass": "^4.14.1",
|
||||
"vue": "^2.6.10",
|
||||
"vue-codemirror": "^4.0.6",
|
||||
"vue-cropperjs": "^3.0.0",
|
||||
"vue-i18n": "^8.10.0",
|
||||
"vue-quill-editor": "^3.0.6",
|
||||
"vue-router": "^3.0.3",
|
||||
"vuedraggable": "^2.17.0",
|
||||
"vuex": "^3.6.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^3.9.0",
|
||||
"@vue/cli-service": "^3.9.0",
|
||||
"babel-plugin-transform-remove-strict-mode": "0.0.2",
|
||||
"mockjs": "^1.1.0",
|
||||
"sass-loader": "^7.3.1",
|
||||
"sass-resources-loader": "^2.1.1",
|
||||
"style-loader": "^2.0.0",
|
||||
"vue-template-compiler": "^2.6.10",
|
||||
"vite": "2",
|
||||
"@vitejs/plugin-legacy": "^1.4.4",
|
||||
"vite-plugin-mock": "2",
|
||||
"vite-plugin-vue2": "latest"
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
module.exports = {
|
||||
plugins: {
|
||||
autoprefixer: {}
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.4 KiB |
@@ -1,85 +0,0 @@
|
||||
<template>
|
||||
<div id="app">
|
||||
|
||||
<!-- <keep-alive include="history"> -->
|
||||
<router-view></router-view>
|
||||
<!-- </keep-alive> -->
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// import {
|
||||
// fieldusing
|
||||
// } from '@/api/index.js'
|
||||
import {
|
||||
getByKey,
|
||||
refreshCache
|
||||
} from '@/api/index.js';
|
||||
export default {
|
||||
name: 'App',
|
||||
created() {
|
||||
if(localStorage.getItem('setsystemList')){
|
||||
this.$store.commit('setsystemList',JSON.parse(localStorage.getItem('setsystemList')))
|
||||
}
|
||||
getByKey({
|
||||
dictKey:'holdSystemList'
|
||||
}).then(res=>{
|
||||
if(res.status=='1'){
|
||||
let arr = res.data.dictValue.split(',').map(value=>{
|
||||
return {
|
||||
value : value,
|
||||
label : value,
|
||||
data:null
|
||||
}
|
||||
})
|
||||
localStorage.setItem('setsystemList',JSON.stringify(arr))
|
||||
this.$store.commit('setsystemList',arr)
|
||||
|
||||
}
|
||||
})
|
||||
// getV({page:2}).then(res=>{
|
||||
|
||||
// console.log(String(res))
|
||||
// })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
@import "./assets/css/main.css";
|
||||
@import "./assets/css/color-dark.css";
|
||||
|
||||
/*深色主题*/
|
||||
/*@import "./assets/css/theme-green/color-green.css"; 浅绿色主题*/
|
||||
.setting-wrapper {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.setting-wrapper .line {
|
||||
margin: 0 10px;
|
||||
}
|
||||
|
||||
.call-mode-wrapper,
|
||||
.setting-wrapper {
|
||||
width: 100%;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.conditions-wrapper {
|
||||
/* display: flex; */
|
||||
margin: 15px 0;
|
||||
/* align-items: center; */
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.type3_submit_home {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
left: 80%;
|
||||
margin-top: 30px;
|
||||
top: 74.5vh;
|
||||
z-index: 999;
|
||||
}
|
||||
</style>
|
||||
@@ -1,80 +0,0 @@
|
||||
import request from '../utils/request';
|
||||
// console.log(request)
|
||||
|
||||
// export const getV = (params) => request.get(`${window.location.origin}/index.html?time=${new Date().getTime()}`)
|
||||
|
||||
|
||||
|
||||
export const fetchData = (params) => request.get('./table.json',{params})
|
||||
// 登录接口
|
||||
export const getLogin = (params) => request.post('Riskmanage/v2/login/login',params)
|
||||
// 登出接口
|
||||
export const getLogout = (params) => request.post('Riskmanage/v2/login/logout',params)
|
||||
// 查询菜单权限接口
|
||||
export const getMenus = (params) => request.post('Riskmanage/v2/sysMenu/getMenus',params)
|
||||
// 查询首页统计信息
|
||||
export const getIndexInfo = (params) => request.post('Riskmanage/v2/engine/getIndexInfo',params)
|
||||
// 查询首页统计信息
|
||||
export const getByKey = (params) => request.post('Riskmanage/dictionary/getByKey',params)
|
||||
// 查询首页统计信息
|
||||
export const refreshCache = (params) => request.post('Riskmanage/dictionary/refreshCache',params)
|
||||
|
||||
|
||||
// ================================== 系统管理 ===================================
|
||||
// ---------------------用户管理
|
||||
// 获取用户列表
|
||||
export const getUserList = (params) => request.post('/Riskmanage/v2/sysUser/getUserList',params)
|
||||
// 创建用户
|
||||
export const saveUser = (params) => request.post('/Riskmanage/v2/sysUser/save',params)
|
||||
// 编辑修改
|
||||
export const updateUser = (params) => request.post('/Riskmanage/v2/sysUser/update',params)
|
||||
// 启用、停用、删除
|
||||
export const userUpdateStatus = (params) => request.post('/Riskmanage/v2/sysUser/updateStatus',params)
|
||||
// 获取组织列表
|
||||
export const getOrganList = (params) => request.post('/Riskmanage/v2/sysOrganization/getOrganList',params)
|
||||
// 获取已启用的组织列表
|
||||
export const getAllValidOrgan = (params) => request.post('/Riskmanage/v2/sysOrganization/getAllValidOrgan',params)
|
||||
// 获取角色
|
||||
export const getAllValidRole = (params) => request.post('/Riskmanage/v2/sysRole/getAllValidRole',params)
|
||||
// 修改密码
|
||||
export const updateUserPassword = (params) => request.post('/Riskmanage/v2/sysUser/updatePassword',params)
|
||||
|
||||
//----------------------- 角色管理
|
||||
// 获取角色列表
|
||||
export const getRoleList = (params) => request.post('/Riskmanage/v2/sysRole/getRoleList',params)
|
||||
// 修改批量操作
|
||||
export const roleUpdateStatus = (params) => request.post('/Riskmanage/v2/sysRole/updateStatus',params)
|
||||
// 创建角色
|
||||
export const saveRole = (params) => request.post('/Riskmanage/v2/sysRole/save',params)
|
||||
// 修改角色
|
||||
export const updateRole = (params) => request.post('/Riskmanage/v2/sysRole/update',params)
|
||||
// 获取资源树
|
||||
export const getFindtreeList = (params) => request.post('/Riskmanage/v2/sysMenu/findTreeList',params)
|
||||
// 获取引擎树
|
||||
export const getEngineTree = (params) => request.post('/Riskmanage/v2/sysMenu/getEngineTree',params)
|
||||
// 权限分配资源树保存
|
||||
export const insertRoleMenu = (params) => request.post('/Riskmanage/v2/sysMenu/insertRoleMenu',params)
|
||||
// 权限分配引擎树保存
|
||||
export const insertRoleEngine = (params) => request.post('/Riskmanage/v2/sysMenu/insertRoleEngine',params)
|
||||
// -----------------------资源管理
|
||||
// 获取资源列表
|
||||
export const getRsourceMenuList = (params) => request.post('/Riskmanage/v2/sysMenu/getMenuList',params)
|
||||
// 删除资源
|
||||
export const resourceUpdateStatus = (params) => request.post('/Riskmanage/v2/sysMenu/updateStatus',params)
|
||||
// 新增/修改资源获取的父节点树
|
||||
export const getResourceTreeMenu = (params) => request.post('/Riskmanage/v2/sysMenu/getTreeMenu',params)
|
||||
// 编辑资源
|
||||
export const resourceUpdate = (params) => request.post('/Riskmanage/v2/sysMenu/update',params)
|
||||
// 新增资源
|
||||
export const resourceSave = (params) => request.post('/Riskmanage/v2/sysMenu/save',params)
|
||||
// -----------------------组织管理
|
||||
// 创建组织
|
||||
export const saveOrgan = (params) => request.post('/Riskmanage/v2/sysOrganization/save',params)
|
||||
// 修改组织
|
||||
export const updateOrgan = (params) => request.post('/Riskmanage/v2/sysOrganization/update',params)
|
||||
// 更新状态
|
||||
export const updateStatusOrgan = (params) => request.post('/Riskmanage/v2/sysOrganization/updateStatus',params)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,159 +0,0 @@
|
||||
.dataManageRedact {
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
height: 100%;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.MR_header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
padding:20px;
|
||||
box-sizing: border-box;
|
||||
border-bottom: 1px solid #ddd;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.MR_header>div:nth-of-type(1) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 12%;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.MR_input {
|
||||
|
||||
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: flex-start;
|
||||
border-bottom: 1px solid #ddd;
|
||||
transition: all 0.2s;
|
||||
|
||||
padding: 20px 0 20px 0;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.MR_input input {
|
||||
|
||||
|
||||
transition: all 0.2s;
|
||||
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.MR_scope {
|
||||
border-bottom: 1px solid #ddd;
|
||||
transition: all 0.2s;
|
||||
padding: 20px 0 20px 0;
|
||||
font-size: 16px;
|
||||
/* display: flex; */
|
||||
}
|
||||
|
||||
.MR_scope input {
|
||||
height: 40px;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.MR_headerSmall {
|
||||
padding:8px 20px 8px 20px;
|
||||
|
||||
}
|
||||
.MR_inputSmall {
|
||||
padding: 0;
|
||||
font-size: 14px;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.MR_inputSmall input {
|
||||
height: 25px;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.MR_scopeSmall input {
|
||||
height: 25px;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.MR_scopeSmall {
|
||||
padding:0;
|
||||
font-size: 14px;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.MR_input>div {
|
||||
width: 30%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-around;
|
||||
margin-left: 2%;
|
||||
}
|
||||
|
||||
.MR_input>div>p {
|
||||
width: 30%;
|
||||
}
|
||||
|
||||
.MR_checkbox {
|
||||
padding: 20px;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.MR_scope>div {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-left: 2%;
|
||||
}
|
||||
|
||||
.MR_scope>div>p {
|
||||
width: 7.6%;
|
||||
}
|
||||
|
||||
.MR_derive {
|
||||
|
||||
margin: 0 40px 0 40px;
|
||||
|
||||
}
|
||||
|
||||
.MR_rule_home {
|
||||
overflow: scroll;
|
||||
overflow-x: hidden;
|
||||
height: 350px;
|
||||
}
|
||||
|
||||
.MR_rule_home::-webkit-scrollbar {
|
||||
display: none;
|
||||
/* Chrome Safari */
|
||||
}
|
||||
|
||||
.MR_toolbar {
|
||||
background-color: #F0F0F0;
|
||||
height: 40px;
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
font-weight: bold;
|
||||
font-size: 18px;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
user-select: none;
|
||||
|
||||
}
|
||||
|
||||
.MR_toolbar>p:hover {
|
||||
color: #fff;
|
||||
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
.header{
|
||||
background-color: #242f42;
|
||||
}
|
||||
.login-wrap{
|
||||
background: #324157;
|
||||
}
|
||||
.plugins-tips{
|
||||
background: #eef1f6;
|
||||
}
|
||||
.plugins-tips a{
|
||||
color: #20a0ff;
|
||||
}
|
||||
.el-upload--text em {
|
||||
color: #20a0ff;
|
||||
}
|
||||
.pure-button{
|
||||
background: #20a0ff;
|
||||
}
|
||||
.tags-li.active {
|
||||
border: 1px solid #409EFF;
|
||||
background-color: #409EFF;
|
||||
}
|
||||
.message-title{
|
||||
color: #20a0ff;
|
||||
}
|
||||
.collapse-btn:hover{
|
||||
background: rgb(40,52,70);
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
.cont_cont {
|
||||
display: flex;
|
||||
border-radius: 20px;
|
||||
height: 85vh;
|
||||
}
|
||||
|
||||
.cont_left {
|
||||
width: 200px;
|
||||
flex-shrink: 0;
|
||||
background-color: #fff;
|
||||
border-radius: 10px 0 0 10px;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.cont_list {
|
||||
height: 70vh;
|
||||
overflow: scroll;
|
||||
scrollbar-width: none;
|
||||
/* Firefox */
|
||||
-ms-overflow-style: none;
|
||||
/* IE 10+ */
|
||||
overflow-x: hidden;
|
||||
/* position: relative; */
|
||||
}
|
||||
|
||||
.cont_list::-webkit-scrollbar {
|
||||
display: none;
|
||||
/* Chrome Safari */
|
||||
}
|
||||
|
||||
.cont_left::-webkit-scrollbar-track {
|
||||
-webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
||||
border-radius: 10px;
|
||||
background-color: #F5F5F5;
|
||||
}
|
||||
|
||||
.cont_header {
|
||||
margin-left: 20px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.cont_header_title {
|
||||
color: #444;
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.cont_header_subtitle {
|
||||
color: #999;
|
||||
font-size: 14px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.cont_new_file {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
font-size: 16px;
|
||||
border-top: 1px solid #ddd;
|
||||
border-bottom: 1px solid #ddd;
|
||||
padding: 10px 0 10px 15px;
|
||||
box-sizing: border-box;
|
||||
margin-top: 15px;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
.cont_new_file>div{
|
||||
margin-left: 10px;
|
||||
}
|
||||
.file_select {
|
||||
border: #409EFF 2px solid;
|
||||
border-radius: 2px;
|
||||
color: #409EFF;
|
||||
}
|
||||
|
||||
.cont_right {
|
||||
flex-grow: 1;
|
||||
overflow: hidden;
|
||||
background-color: #fafafa;
|
||||
border-radius: 10px 10px 10px 10px;
|
||||
}
|
||||
|
||||
.cont_right_hint {
|
||||
font-size: 100px;
|
||||
color: #00000011;
|
||||
text-align: center;
|
||||
line-height: 80vh;
|
||||
-moz-user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-ms-user-select: none;
|
||||
-khtml-user-select: none;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.cont_right_top {
|
||||
padding: 21px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 2px solid #eee;
|
||||
}
|
||||
.contText{
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: block;
|
||||
}
|
||||
.contText:hover{
|
||||
white-space:inherit !important
|
||||
}
|
||||
.fileHint{
|
||||
position: fixed;
|
||||
background-color: #fafafa;
|
||||
padding: 5px;
|
||||
|
||||
}
|
||||
.fileHint>p{
|
||||
border-bottom: 1px solid #000;
|
||||
}
|
||||
.fileHint>p:hover{
|
||||
color: #409EFF;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
|
||||
[class*=" el-icon-lx"], [class^=el-icon-lx] {
|
||||
font-family: lx-iconfont!important;
|
||||
}
|
||||
@@ -1,185 +0,0 @@
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html,
|
||||
body,
|
||||
#app,
|
||||
.wrapper {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif;
|
||||
}
|
||||
|
||||
a {
|
||||
text-decoration: none
|
||||
}
|
||||
|
||||
|
||||
.content-box {
|
||||
position: absolute;
|
||||
left: 250px;
|
||||
right: 0;
|
||||
top: 70px;
|
||||
bottom: 0;
|
||||
padding-bottom: 30px;
|
||||
-webkit-transition: left .3s ease-in-out;
|
||||
transition: left .3s ease-in-out;
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
.content {
|
||||
width: auto;
|
||||
height: 100%;
|
||||
padding: 10px;
|
||||
/* overflow-y: scroll; */
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.content-collapse {
|
||||
left: 65px;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 30px;
|
||||
background: #fff;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 5px;
|
||||
}
|
||||
|
||||
.crumbs {
|
||||
margin: 10px 0;
|
||||
}
|
||||
|
||||
.el-table th {
|
||||
background-color: #f5f7fa !important;
|
||||
}
|
||||
|
||||
.pagination {
|
||||
margin: 20px 0;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.plugins-tips {
|
||||
padding: 20px 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.el-button+.el-tooltip {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.el-table tr:hover {
|
||||
background: #f6faff;
|
||||
}
|
||||
|
||||
.mgb20 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.move-enter-active,
|
||||
.move-leave-active {
|
||||
transition: opacity .5s;
|
||||
}
|
||||
|
||||
.move-enter,
|
||||
.move-leave {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
/*BaseForm*/
|
||||
|
||||
.form-box {
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
.form-box .line {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.el-time-panel__content::after,
|
||||
.el-time-panel__content::before {
|
||||
margin-top: -7px;
|
||||
}
|
||||
|
||||
.el-time-spinner__wrapper .el-scrollbar__wrap:not(.el-scrollbar__wrap--hidden-default) {
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
/*Upload*/
|
||||
|
||||
.pure-button {
|
||||
width: 150px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
.g-core-image-corp-container .info-aside {
|
||||
height: 45px;
|
||||
}
|
||||
|
||||
.el-upload--text {
|
||||
background-color: #fff;
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
box-sizing: border-box;
|
||||
width: 360px;
|
||||
height: 180px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.el-upload--text .el-icon-upload {
|
||||
font-size: 67px;
|
||||
color: #97a8be;
|
||||
margin: 40px 0 16px;
|
||||
line-height: 50px;
|
||||
}
|
||||
|
||||
.el-upload--text {
|
||||
color: #97a8be;
|
||||
font-size: 14px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.el-upload--text em {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
/*VueEditor*/
|
||||
|
||||
.ql-container {
|
||||
min-height: 400px;
|
||||
}
|
||||
|
||||
.ql-snow .ql-tooltip {
|
||||
transform: translateX(117.5px) translateY(10px) !important;
|
||||
}
|
||||
|
||||
.editor-btn {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
/*markdown*/
|
||||
|
||||
.v-note-wrapper .v-note-panel {
|
||||
min-height: 500px;
|
||||
}
|
||||
|
||||
.content-wrapper{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
padding: 21px;
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
.header{
|
||||
background-color: #07c4a8;
|
||||
}
|
||||
.login-wrap{
|
||||
background: rgba(56, 157, 170, 0.82);;
|
||||
}
|
||||
.plugins-tips{
|
||||
background: #f2f2f2;
|
||||
}
|
||||
.plugins-tips a{
|
||||
color: #00d1b2;
|
||||
}
|
||||
.el-upload--text em {
|
||||
color: #00d1b2;
|
||||
}
|
||||
.pure-button{
|
||||
background: #00d1b2;
|
||||
}
|
||||
.pagination > .active > a, .pagination > .active > a:hover, .pagination > .active > a:focus, .pagination > .active > span, .pagination > .active > span:hover, .pagination > .active > span:focus {
|
||||
background-color: #00d1b2 !important;
|
||||
border-color: #00d1b2 !important;
|
||||
}
|
||||
.tags-li.active {
|
||||
border: 1px solid #00d1b2;
|
||||
background-color: #00d1b2;
|
||||
}
|
||||
.collapse-btn:hover{
|
||||
background: #00d1b2;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 6.0 KiB |
|
Before Width: | Height: | Size: 69 KiB |
|
Before Width: | Height: | Size: 2.4 KiB |
@@ -1,24 +0,0 @@
|
||||
|
||||
export function formatDate (date, fmt) {
|
||||
if (/(y+)/.test(fmt)) {
|
||||
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
|
||||
}
|
||||
let o = {
|
||||
'M+': date.getMonth() + 1,
|
||||
'd+': date.getDate(),
|
||||
'h+': date.getHours(),
|
||||
'm+': date.getMinutes(),
|
||||
's+': date.getSeconds()
|
||||
};
|
||||
for (let k in o) {
|
||||
if (new RegExp(`(${k})`).test(fmt)) {
|
||||
let str = o[k] + '';
|
||||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
|
||||
}
|
||||
}
|
||||
return fmt;
|
||||
};
|
||||
|
||||
function padLeftZero (str) {
|
||||
return ('00' + str).substr(str.length);
|
||||
};
|
||||
@@ -1,51 +0,0 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<v-head></v-head>
|
||||
<v-sidebar></v-sidebar>
|
||||
<div class="content-box" :class="{'content-collapse':collapse}">
|
||||
<v-tags></v-tags>
|
||||
<div class="content" >
|
||||
<transition name="move" mode="out-in">
|
||||
<keep-alive :include="tagsList">
|
||||
<router-view></router-view>
|
||||
</keep-alive>
|
||||
</transition>
|
||||
<el-backtop target=".content"></el-backtop>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import vHead from './Header.vue';
|
||||
import vSidebar from './Sidebar.vue';
|
||||
import vTags from './Tags.vue';
|
||||
import bus from './bus';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tagsList: [],
|
||||
collapse: false
|
||||
};
|
||||
},
|
||||
components: {
|
||||
vHead,
|
||||
vSidebar,
|
||||
vTags
|
||||
},
|
||||
created() {
|
||||
bus.$on('collapse-content', msg => {
|
||||
this.collapse = msg;
|
||||
});
|
||||
|
||||
// 只有在标签页列表里的页面才使用keep-alive,即关闭标签之后就不保存到内存中了。
|
||||
bus.$on('tags', msg => {
|
||||
let arr = [];
|
||||
for (let i = 0, len = msg.length; i < len; i++) {
|
||||
msg[i].name && arr.push(msg[i].name);
|
||||
}
|
||||
this.tagsList = arr;
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -1,107 +0,0 @@
|
||||
<template>
|
||||
<div class="sidebar">
|
||||
<el-menu class="sidebar-el-menu" :default-active="onRoutes" :collapse="collapse" background-color="#324157"
|
||||
text-color="#bfcbd9" active-text-color="#20a0ff" unique-opened :router="true">
|
||||
<template v-for="item in items">
|
||||
<template v-if="item.subs">
|
||||
<el-submenu :index="item.index" :key="item.index">
|
||||
<template slot="title">
|
||||
<i :class="item.icon"></i>
|
||||
<span slot="title">{{ item.title }}</span>
|
||||
</template>
|
||||
<template v-for="subItem in item.subs">
|
||||
<el-submenu v-if="subItem.subs" :index="subItem.index" :key="subItem.index">
|
||||
<template slot="title">{{ subItem.title }}</template>
|
||||
<el-menu-item v-for="(threeItem,i) in subItem.subs" :key="i" :index="threeItem.index">{{ threeItem.title }}</el-menu-item>
|
||||
</el-submenu>
|
||||
<el-menu-item v-else :index="subItem.index" :key="subItem.index">{{ subItem.title }}</el-menu-item>
|
||||
</template>
|
||||
</el-submenu>
|
||||
</template>
|
||||
<template v-else>
|
||||
<el-menu-item :index="item.index" :key="item.index">
|
||||
<i :class="item.icon"></i>
|
||||
<span slot="title">{{ item.title }}</span>
|
||||
</el-menu-item>
|
||||
</template>
|
||||
</template>
|
||||
</el-menu>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import bus from './bus';
|
||||
import {
|
||||
getMenus,
|
||||
|
||||
} from '../../api/index';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
collapse: false,
|
||||
items: [],
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
onRoutes() {
|
||||
return this.$route.path
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// 通过 Event Bus 进行组件间通信,来折叠侧边栏
|
||||
bus.$on('collapse', msg => {
|
||||
this.collapse = msg;
|
||||
// bus.$emit('setcanvasn',msg)
|
||||
bus.$emit('collapse-content', msg);
|
||||
});
|
||||
|
||||
// 获取菜单接口
|
||||
this.getMenus()
|
||||
// refreshCache()
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
async getMenus() {
|
||||
const data = await getMenus({entity:{resourceSystem:'Auth'}});
|
||||
// console.log('菜单接口返回的数据',data);
|
||||
if (data.status === "0") {
|
||||
this.$message.error(data.msg);
|
||||
if (data.error === "01000103") {
|
||||
this.$router.push('/login')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.items = data.data;
|
||||
if(this.items.length == 0){
|
||||
this.$message.error('您没有导航权限,请联系管理员');
|
||||
}
|
||||
// console.log("items", this.items);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.sidebar {
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 70px;
|
||||
bottom: 0;
|
||||
overflow-y: scroll;
|
||||
}
|
||||
|
||||
.sidebar::-webkit-scrollbar {
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.sidebar-el-menu:not(.el-menu--collapse) {
|
||||
width: 250px;
|
||||
}
|
||||
|
||||
.sidebar>ul {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
@@ -1,186 +0,0 @@
|
||||
<template>
|
||||
<div class="tags" v-if="showTags">
|
||||
<ul>
|
||||
<li class="tags-li" v-for="(item,index) in tagsList" :class="{'active': isActive(item.path)}" :key="index">
|
||||
<router-link :to="item.path" class="tags-li-title">
|
||||
{{item.title}}
|
||||
</router-link>
|
||||
<span class="tags-li-icon" @click="closeTags(index)"><i class="el-icon-close"></i></span>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="tags-close-box">
|
||||
<el-dropdown @command="handleTags">
|
||||
<el-button size="mini" type="primary">
|
||||
标签选项<i class="el-icon-arrow-down el-icon--right"></i>
|
||||
</el-button>
|
||||
<el-dropdown-menu size="small" slot="dropdown">
|
||||
<el-dropdown-item command="other">关闭其他</el-dropdown-item>
|
||||
<el-dropdown-item command="all">关闭所有</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</el-dropdown>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import bus from './bus';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tagsList: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isActive(path) {
|
||||
return path === this.$route.fullPath;
|
||||
},
|
||||
// 关闭单个标签
|
||||
closeTags(index) {
|
||||
const delItem = this.tagsList.splice(index, 1)[0];
|
||||
const item = this.tagsList[index] ? this.tagsList[index] : this.tagsList[index - 1];
|
||||
if (item) {
|
||||
delItem.path === this.$route.fullPath && this.$router.push(item.path);
|
||||
}else{
|
||||
this.$router.push('/');
|
||||
}
|
||||
},
|
||||
// 关闭全部标签
|
||||
closeAll(){
|
||||
this.tagsList = [];
|
||||
this.$router.push('/');
|
||||
},
|
||||
// 关闭其他标签
|
||||
closeOther(){
|
||||
const curItem = this.tagsList.filter(item => {
|
||||
return item.path === this.$route.fullPath;
|
||||
})
|
||||
this.tagsList = curItem;
|
||||
},
|
||||
// 设置标签
|
||||
setTags(route){
|
||||
const isExist = this.tagsList.some(item => {
|
||||
return item.path === route.fullPath;
|
||||
})
|
||||
if(!isExist){
|
||||
if(this.tagsList.length >= 8){
|
||||
this.tagsList.shift();
|
||||
}
|
||||
this.tagsList.push({
|
||||
title: route.meta.title,
|
||||
path: route.fullPath,
|
||||
name: route.matched[1].components.default.name
|
||||
})
|
||||
}
|
||||
bus.$emit('tags', this.tagsList);
|
||||
},
|
||||
handleTags(command){
|
||||
command === 'other' ? this.closeOther() : this.closeAll();
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
showTags() {
|
||||
return this.tagsList.length > 0;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
$route(newValue, oldValue){
|
||||
this.setTags(newValue);
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.setTags(this.$route);
|
||||
// 监听关闭当前页面的标签页
|
||||
bus.$on('close_current_tags', () => {
|
||||
for (let i = 0, len = this.tagsList.length; i < len; i++) {
|
||||
const item = this.tagsList[i];
|
||||
if(item.path === this.$route.fullPath){
|
||||
if(i < len - 1){
|
||||
this.$router.push(this.tagsList[i+1].path);
|
||||
}else if(i > 0){
|
||||
this.$router.push(this.tagsList[i-1].path);
|
||||
}else{
|
||||
this.$router.push('/');
|
||||
}
|
||||
this.tagsList.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
<style>
|
||||
.tags {
|
||||
position: relative;
|
||||
height: 30px;
|
||||
overflow: hidden;
|
||||
background: #fff;
|
||||
padding-right: 120px;
|
||||
box-shadow: 0 5px 10px #ddd;
|
||||
}
|
||||
|
||||
.tags ul {
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.tags-li {
|
||||
float: left;
|
||||
margin: 3px 5px 2px 3px;
|
||||
border-radius: 3px;
|
||||
font-size: 12px;
|
||||
overflow: hidden;
|
||||
cursor: pointer;
|
||||
height: 23px;
|
||||
line-height: 23px;
|
||||
border: 1px solid #e9eaec;
|
||||
background: #fff;
|
||||
padding: 0 5px 0 12px;
|
||||
vertical-align: middle;
|
||||
color: #666;
|
||||
-webkit-transition: all .3s ease-in;
|
||||
-moz-transition: all .3s ease-in;
|
||||
transition: all .3s ease-in;
|
||||
}
|
||||
|
||||
.tags-li:not(.active):hover {
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.tags-li.active {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.tags-li-title {
|
||||
float: left;
|
||||
max-width: 80px;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
margin-right: 5px;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.tags-li.active .tags-li-title {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.tags-close-box {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
box-sizing: border-box;
|
||||
padding-top: 1px;
|
||||
text-align: center;
|
||||
width: 110px;
|
||||
height: 30px;
|
||||
background: #fff;
|
||||
box-shadow: -3px 0 15px 3px rgba(0, 0, 0, .1);
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -1,6 +0,0 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
// 使用 Event Bus
|
||||
const bus = new Vue();
|
||||
|
||||
export default bus;
|
||||
@@ -1,55 +0,0 @@
|
||||
<template>
|
||||
<div :id="sid" :style="{height: height,width:width}">
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import * as echarts from 'echarts';
|
||||
export default {
|
||||
props: {
|
||||
sid: {
|
||||
type: String,
|
||||
default: 'echartsId'
|
||||
},
|
||||
height: {
|
||||
type: String,
|
||||
default: '300px'
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: '300px'
|
||||
},
|
||||
option: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
chartDom: null,
|
||||
myChart: null
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.chartDom = document.getElementById(this.sid);
|
||||
this.myChart = echarts.init(this.chartDom);
|
||||
this.myChart.setOption(this.option);
|
||||
},
|
||||
watch: {
|
||||
option: {
|
||||
handler: function() {
|
||||
this.myChart.clear()
|
||||
this.myChart.setOption(this.option);
|
||||
},
|
||||
// 开启深度监听:只要obj中的任何一个属性发生改变,都会触发相应的代码
|
||||
deep: true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -1,378 +0,0 @@
|
||||
<template>
|
||||
<div class="user-edit-wrapper">
|
||||
<el-dialog title="资源配置" :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
|
||||
<el-form ref="myform" :model="form" :rules="rules" label-width="80px" label-position="left">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="grid-conten">
|
||||
<el-form-item label="资源编号" prop="code">
|
||||
<el-input v-model="form.code" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="grid-conten">
|
||||
<el-form-item label="资源名" prop="name">
|
||||
<el-input v-model="form.name" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="grid-conten">
|
||||
<el-form-item label="icon" prop="icon">
|
||||
<el-input v-model="form.icon" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<div class="grid-conten">
|
||||
<el-form-item label="资源描述" prop="des">
|
||||
<el-input v-model="form.des" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="grid-conten">
|
||||
<el-form-item label="访问路径" prop="url">
|
||||
<el-input v-model="form.url" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="grid-conten">
|
||||
<el-form-item label="菜单排序" prop="sort">
|
||||
<el-input v-model="form.sort" autocomplete="off" minlength="1" maxlength="3"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="grid-conten">
|
||||
<el-form-item label="系统分类" prop="sort">
|
||||
|
||||
<el-select v-model="form.resourceSystem" placeholder="请选择" @change="gettreeList(parentId)">
|
||||
<el-option :label="value.label" :value="value.value" v-for="value in systemList" :key="value.value"></el-option>
|
||||
|
||||
</el-select>
|
||||
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="grid-conten">
|
||||
<h3 style="margin-bottom:30px">
|
||||
父类资源:
|
||||
</h3>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="24">
|
||||
<div class="grid-conten">
|
||||
<el-tree ref="tree" :props="props" node-key="resourceId" :data="systemList.find(x=>x.value==this.form.resourceSystem)?systemList.find(x=>x.value==this.form.resourceSystem).data:[]" :key="num"
|
||||
:current-node-key="checkedKeys" :highlight-current="true" @node-click="handleNodeClick">
|
||||
</el-tree>
|
||||
<div style="padding: 20px;display: flex;justify-content: flex-end;">
|
||||
<el-button type="primary" @click="stick" size="mini">置为顶层目录</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-form-item class="btn-group">
|
||||
<el-button type="primary" @click="onSubmit('myform')">确认</el-button>
|
||||
<el-button @click="handleClose()">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
getResourceTreeMenu,
|
||||
resourceUpdate,
|
||||
resourceSave
|
||||
} from '@/api/index.js'
|
||||
import mixin from '@/utils/mixin.js'
|
||||
export default {
|
||||
name: 'resourceDialog',
|
||||
mixins:[mixin],
|
||||
props: {
|
||||
dialogVisible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
dataItem: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dataItem(newVal) {
|
||||
console.log(newVal)
|
||||
|
||||
},
|
||||
dialogVisible: function(val, oldVla) {
|
||||
if (this.$refs['myform'] != undefined) {
|
||||
this.$refs["myform"].resetFields();
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.form.resourceSystem =this.systemList[0]?this.systemList[0].value:''
|
||||
|
||||
if(this.dataItem.name){
|
||||
// this.dataItem = newVal;
|
||||
if (JSON.stringify(this.dataItem) !== '{}') {
|
||||
this.form = {
|
||||
"name": this.dataItem.name,
|
||||
"code": this.dataItem.code,
|
||||
"url": this.dataItem.url,
|
||||
"parentId": this.dataItem.parentId,
|
||||
"des": this.dataItem.des,
|
||||
"icon": this.dataItem.icon,
|
||||
"sort": this.dataItem.sort,
|
||||
"resourceSystem": this.dataItem.resourceSystem,
|
||||
}
|
||||
this.parentId = this.dataItem.parentId;
|
||||
this.checkedKeys = this.dataItem.parentId;
|
||||
console.log(this.dataItem,this.form)
|
||||
// this.resourceSystem = this.dataItem.resourceSystem
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.gettreeList(this.parentId);
|
||||
},
|
||||
|
||||
data() {
|
||||
let checkSort = (rule, value, callback) => {
|
||||
console.log(value)
|
||||
if (value === 0) {
|
||||
return callback(new Error('超出可选范围(1-100)'));
|
||||
}
|
||||
if (!value) {
|
||||
return callback(new Error('菜单排序不能为空'));
|
||||
} else {
|
||||
if (value > 0 && value <= 100) {
|
||||
callback();
|
||||
} else {
|
||||
return callback(new Error('超出可选范围(1-100)'));
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
return {
|
||||
num:0,
|
||||
form: {
|
||||
name: "",
|
||||
code: "",
|
||||
url: "",
|
||||
parentId: 0,
|
||||
des: "",
|
||||
icon: "",
|
||||
sort: 1,
|
||||
resourceSystem: ""
|
||||
},
|
||||
parentId: 0,
|
||||
rules: {
|
||||
name: [{
|
||||
required: true,
|
||||
message: '请输入资源名称',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
code: [{
|
||||
required: true,
|
||||
message: '请输入资源编号',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
des: [{
|
||||
required: true,
|
||||
message: '请输入资源描述',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
sort: [{
|
||||
validator: checkSort,
|
||||
required: true,
|
||||
trigger: 'blur'
|
||||
}],
|
||||
resourceSystem: [{
|
||||
required: true,
|
||||
message: '请选择系统分类',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
},
|
||||
props: {
|
||||
label: 'name',
|
||||
children: 'children'
|
||||
},
|
||||
|
||||
// 默认选中节点
|
||||
checkedKeys: ""
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
stick(){
|
||||
this.parentId = 0
|
||||
this.form.parentId = 0
|
||||
this.checkedKeys = 0
|
||||
this.num++
|
||||
|
||||
console.log(this.parentId,this.form.parentId,this.checkedKeys)
|
||||
},
|
||||
handleNodeClick(data) {
|
||||
this.form.parentId = data.resourceId;
|
||||
},
|
||||
getTreeData(data) {
|
||||
let treeArr = data;
|
||||
let result = []
|
||||
for (let i = 0; i < treeArr.length; i++) {
|
||||
let item = treeArr[i];
|
||||
if (item.parentId === 0) {
|
||||
result.push(item);
|
||||
}
|
||||
}
|
||||
this.data2treeDG(treeArr, result);
|
||||
},
|
||||
data2treeDG(datas, dataArray, type) {
|
||||
for (let j = 0; j < dataArray.length; j++) {
|
||||
let dataArrayIndex = dataArray[j];
|
||||
let childrenArray = [];
|
||||
let Id = dataArrayIndex.resourceId;
|
||||
if (dataArrayIndex.checked) {
|
||||
this.checkedKeys = dataArrayIndex.resourceId
|
||||
}
|
||||
for (let i = 0; i < datas.length; i++) {
|
||||
let data = datas[i];
|
||||
let parentId = data.parentId;
|
||||
if (parentId == Id) { //判断是否为儿子节点
|
||||
childrenArray.push(data);
|
||||
}
|
||||
}
|
||||
dataArrayIndex.children = childrenArray;
|
||||
if (childrenArray.length > 0) { //有儿子节点则递归
|
||||
this.data2treeDG(datas, childrenArray)
|
||||
}
|
||||
}
|
||||
|
||||
this.systemList.find(x=>x.value==this.form.resourceSystem).data = dataArray;
|
||||
// console.log(this.systemList)
|
||||
},
|
||||
// 新增或编辑
|
||||
onSubmit(myForm) {
|
||||
let form = this.form;
|
||||
this.$refs[myForm].validate((valid) => {
|
||||
if (valid) {
|
||||
if (JSON.stringify(this.dataItem) == '{}') {
|
||||
// 新增
|
||||
this.saveResource(form);
|
||||
} else {
|
||||
// 编辑
|
||||
form.resourceId = this.dataItem.resourceId
|
||||
this.updateResource(form);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
async updateResource(form) {
|
||||
const data = await resourceUpdate(form)
|
||||
if (data.status != "0") {
|
||||
if (data.data) {
|
||||
this.$message({
|
||||
message: '修改成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.handleClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
async saveResource(form) {
|
||||
const data = await resourceSave(form)
|
||||
if (data.status != "0") {
|
||||
if (data.data) {
|
||||
this.$message({
|
||||
message: '添加成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.handleClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
async gettreeList(id) {
|
||||
if(this.systemList.find(x=>x.value==this.form.resourceSystem).data) return
|
||||
const data = await getResourceTreeMenu({
|
||||
"parentId": id,
|
||||
entity:{
|
||||
"resourceSystem":this.form.resourceSystem
|
||||
}
|
||||
})
|
||||
if (data.status != "0") {
|
||||
this.getTreeData(data.data);
|
||||
this.$nextTick(() => {
|
||||
if (this.parentId != 0) {
|
||||
this.$refs.tree.setCurrentKey(this.checkedKeys)
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
this.form = {
|
||||
"name": "",
|
||||
"code": "",
|
||||
"url": "",
|
||||
"parentId": null,
|
||||
"des": "",
|
||||
"icon": "",
|
||||
"sort": 1,
|
||||
"resourceSystem": "EngineX"
|
||||
}
|
||||
this.systemList.forEach(value=>{
|
||||
value.data = null
|
||||
})
|
||||
|
||||
|
||||
this.$refs["myform"].resetFields();
|
||||
this.$emit('closeEvent');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-dialog__body {
|
||||
padding: 20px 40px;
|
||||
}
|
||||
|
||||
.user-edit-wrapper .el-input {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.user-edit-wrapper .btn-group {
|
||||
margin-top: 30px;
|
||||
}
|
||||
|
||||
.user-edit-wrapper .el-tree--highlight-current .el-tree-node.is-current>.el-tree-node__content {
|
||||
background: #409EFF;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.user-edit-wrapper .is-checked {
|
||||
background: #F5F7FA;
|
||||
}
|
||||
</style>
|
||||
@@ -1,275 +0,0 @@
|
||||
<template>
|
||||
<div class="user-edit-wrapper">
|
||||
<el-dialog title="配置账号" :visible.sync="dialogVisible" width="50%" @open="open" :before-close="handleClose">
|
||||
<el-form ref="myform" :model="form" :rules="rules" label-width="80px" label-position="left">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="grid-conten">
|
||||
<el-form-item label="账号" prop="account">
|
||||
<el-input v-model="form.account"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="grid-conten">
|
||||
<el-form-item label="组织" prop="organId">
|
||||
<el-select v-model="form.organId" :disabled="listOrganArr.length==1?true:false" placeholder="" @change="organChange">
|
||||
<el-option v-for="item in listOrganArr" :key="item.organId" :label="item.name" :value="item.organId"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="grid-conten">
|
||||
<el-form-item label="角色">
|
||||
<el-select v-model="form.sysRole" placeholder="">
|
||||
<el-option v-for="item in validRoleArr" :key="item.roleId" :label="item.roleName" :value="item.roleId"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider></el-divider>
|
||||
<h3 style="margin-bottom:40px">
|
||||
使用人信息:
|
||||
</h3>
|
||||
|
||||
<el-row>
|
||||
|
||||
<el-col :span="12">
|
||||
<div class="grid-conten">
|
||||
<el-form-item label="姓名" prop="nickName">
|
||||
<el-input v-model="form.nickName"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="grid-conten">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<div class="grid-conten">
|
||||
<el-form-item label="手机号" prop="cellphone">
|
||||
<el-input v-model="form.cellphone"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="grid-conten">
|
||||
<el-form-item label="邮箱" prop="email">
|
||||
<el-input v-model="form.email"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
||||
<el-form-item class="btn-group">
|
||||
<el-button type="primary" @click="onSubmit('myform')">确认</el-button>
|
||||
<el-button @click="handleClose()">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
getAllValidRole,
|
||||
saveUser,
|
||||
updateUser
|
||||
} from '@/api/index.js'
|
||||
export default {
|
||||
name: 'userDialog',
|
||||
props: {
|
||||
dialogVisible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
dataItem: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
listOrganArr: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
watch: {
|
||||
dataItem(newVal) {
|
||||
this.dataItem = newVal;
|
||||
if (JSON.stringify(newVal) !== '{}') {
|
||||
this.validRole(newVal.sysOrgan.organId);
|
||||
this.disabled = true;
|
||||
this.form = {
|
||||
organId: newVal.organId,
|
||||
remark: newVal.remark,
|
||||
account: newVal.account,
|
||||
nickName: newVal.nickName,
|
||||
cellphone: newVal.cellphone,
|
||||
email: newVal.email,
|
||||
sysRole: newVal.sysRole.roleId
|
||||
}
|
||||
}else{
|
||||
this.form = {
|
||||
organId: '',
|
||||
remark: '',
|
||||
account: '',
|
||||
nickName: '',
|
||||
cellphone: '',
|
||||
email: '',
|
||||
sysRole: ''
|
||||
}
|
||||
}
|
||||
},
|
||||
dialogVisible: function(val, oldVla) {
|
||||
console.log(1)
|
||||
if (this.$refs['myform'] != undefined) {
|
||||
this.$refs["myform"].resetFields();
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
|
||||
return {
|
||||
text: "text",
|
||||
form: {
|
||||
organId: '',
|
||||
remark: '',
|
||||
account: '',
|
||||
nickName: '',
|
||||
cellphone: '',
|
||||
email: '',
|
||||
sysRole: ''
|
||||
},
|
||||
disabled: false,
|
||||
validRoleArr: [],
|
||||
rules: {
|
||||
account: [{
|
||||
required: true,
|
||||
message: '请输入账号',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
nickName: [{
|
||||
required: true,
|
||||
message: '请输入姓名',
|
||||
trigger: 'blur'
|
||||
}],
|
||||
|
||||
organId: [{
|
||||
required: true,
|
||||
message: '请选择组织',
|
||||
trigger: 'change'
|
||||
}]
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
open() {
|
||||
if (this.listOrganArr.length == 1) {
|
||||
this.form.organId = this.listOrganArr[0].id
|
||||
this.organChange(this.listOrganArr[0].id)
|
||||
}
|
||||
},
|
||||
organChange(e) {
|
||||
this.validRoleArr = [];
|
||||
this.form.sysRole = "";
|
||||
this.validRole(e);
|
||||
},
|
||||
// 新增或编辑名单库
|
||||
onSubmit(myForm) {
|
||||
let form = JSON.parse(JSON.stringify(this.form));
|
||||
form.sysRole = {
|
||||
roleId: form.sysRole
|
||||
}
|
||||
this.$refs[myForm].validate((valid) => {
|
||||
if (valid) {
|
||||
if (JSON.stringify(this.dataItem) == '{}') {
|
||||
// 新增
|
||||
this.save(form);
|
||||
} else {
|
||||
// 编辑
|
||||
form.userId = this.dataItem.userId
|
||||
this.update(form);
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
async save(form) {
|
||||
const data = await saveUser(form)
|
||||
if (data.status != "0") {
|
||||
this.$message({
|
||||
message: '添加成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.handleClose();
|
||||
}
|
||||
|
||||
},
|
||||
async update(form) {
|
||||
const data = await updateUser(form)
|
||||
if (data.status != "0") {
|
||||
if (data.data) {
|
||||
this.$message({
|
||||
message: '修改成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.handleClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
async validRole(id) {
|
||||
const data = await getAllValidRole({
|
||||
"organId": id
|
||||
})
|
||||
if (data.status != "0") {
|
||||
this.validRoleArr = data.data
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
this.form = {
|
||||
organId: '',
|
||||
remark: '',
|
||||
account: '',
|
||||
nickName: '',
|
||||
cellphone: '',
|
||||
email: '',
|
||||
sysRole: ''
|
||||
}
|
||||
this.validRoleArr = [];
|
||||
this.disabled = false;
|
||||
this.$emit('closeEvent');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-dialog__body {
|
||||
padding: 20px 40px;
|
||||
}
|
||||
|
||||
.user-edit-wrapper .el-input {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.user-edit-wrapper .btn-group {
|
||||
margin-top: 30px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,365 +0,0 @@
|
||||
<template>
|
||||
<div class="user-edit-wrapper">
|
||||
<el-dialog title="角色配置" :visible.sync="dialogVisible" width="50%" :before-close="handleClose">
|
||||
<el-form ref="myform" :model="form" label-width="80px" label-position="left">
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<div class="grid-conten">
|
||||
<el-form-item label="角色名">
|
||||
<el-input v-model="form.roleName" autocomplete="off" :disabled="disabled"></el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<div class="grid-conten">
|
||||
<el-form-item label="所属组织">
|
||||
<el-select v-model="form.organId" :disabled="disabled">
|
||||
<el-option v-for="item in listOrganArr" :key="item.organId" :label="item.name" :value="item.organId"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-divider></el-divider>
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<div class="grid-conten">
|
||||
<h3 style="margin-bottom:30px">
|
||||
功能权限:
|
||||
</h3>
|
||||
</div>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="grid-conten">
|
||||
<!-- <h3 style="margin-bottom:30px">
|
||||
搜索引擎子权限:
|
||||
</h3> -->
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row>
|
||||
<el-col :span="12">
|
||||
<el-tabs v-model="tabs" >
|
||||
<el-tab-pane :label="value.value" :name="value.value" v-for="value in systemList"></el-tab-pane>
|
||||
|
||||
</el-tabs>
|
||||
|
||||
|
||||
<div class="grid-conten">
|
||||
<el-tree ref="tree" :props="props" :data="treeList[tabs]" show-checkbox node-key="resourceId" :default-checked-keys="checkedKeys[tabs]"
|
||||
@check-change="findTreeChange">
|
||||
</el-tree>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<div class="grid-conten">
|
||||
<!-- <el-tree
|
||||
ref="engineTree"
|
||||
:props="props"
|
||||
:data="engineList"
|
||||
show-checkbox
|
||||
node-key="id"
|
||||
:default-checked-keys="engineCheckedKeys"
|
||||
@check-change="engineTreeChange"
|
||||
>
|
||||
</el-tree> -->
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
</el-row>
|
||||
|
||||
<el-form-item class="btn-group">
|
||||
|
||||
<el-button @click="handleClose()">取消</el-button>
|
||||
<el-button type="primary" @click="onSubmit()">确认</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
getFindtreeList,
|
||||
getEngineTree,
|
||||
insertRoleMenu,
|
||||
insertRoleEngine
|
||||
} from '@/api/index.js'
|
||||
import mixin from '@/utils/mixin.js'
|
||||
export default {
|
||||
name: 'authorityAssignmentDialog',
|
||||
mixins:[mixin],
|
||||
props: {
|
||||
dialogVisible: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
dataItem: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {}
|
||||
}
|
||||
},
|
||||
listOrganArr: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dataItem(newVal) {
|
||||
this.dataItem = newVal;
|
||||
if (JSON.stringify(newVal) !== '{}') {
|
||||
|
||||
this.tabs = this.systemList[0].value
|
||||
// console.log(this.systemList[0].value)
|
||||
this.systemList.forEach(value=>{
|
||||
|
||||
this.$set(this.treeList,value.value,null)
|
||||
this.$set(this.checkedKeys,value.value,[])
|
||||
|
||||
this.gettreeList(newVal.roleId,value.value);
|
||||
})
|
||||
// this.getEnginetreeList(newVal.id);
|
||||
this.form = {
|
||||
roleId: newVal.roleId,
|
||||
organId: newVal.organId,
|
||||
roleName: newVal.roleName
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
roleId: '',
|
||||
organId: '',
|
||||
roleName: ''
|
||||
},
|
||||
tabs:"",
|
||||
disabled: true,
|
||||
props: {
|
||||
label: 'name',
|
||||
children: 'children'
|
||||
},
|
||||
count: 1,
|
||||
treeList: {
|
||||
|
||||
},
|
||||
engineList: [],
|
||||
// 默认选中节点
|
||||
checkedKeys: {
|
||||
|
||||
},
|
||||
engineCheckedKeys: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
findTreeChange(data, checked, indeterminate) {
|
||||
let nodes = this.$refs.tree.getCheckedNodes()
|
||||
this.checkedKeys[this.tabs] = nodes.map(item => {
|
||||
return item.resourceId
|
||||
})
|
||||
|
||||
},
|
||||
// 搜索引擎子权限:
|
||||
// engineTreeChange(data,checked,indeterminate){
|
||||
// let nodes = this.$refs.engineTree.getCheckedNodes()
|
||||
// this.engineCheckedKeys = nodes.map(item => {
|
||||
// return item.id
|
||||
// })
|
||||
// },
|
||||
getTreeData(data, type,str) {
|
||||
|
||||
let treeArr = data;
|
||||
let result = []
|
||||
for (let i = 0; i < treeArr.length; i++) {
|
||||
let item = treeArr[i];
|
||||
if (item.parentId == 0) {
|
||||
result.push(item);
|
||||
}
|
||||
}
|
||||
this.data2treeDG(treeArr, result, type,str);
|
||||
},
|
||||
data2treeDG(datas, dataArray, type,str) {
|
||||
// console.log(datas, dataArray, type)
|
||||
|
||||
|
||||
for (let j = 0; j < dataArray.length; j++) {
|
||||
let dataArrayIndex = dataArray[j];
|
||||
let childrenArray = [];
|
||||
let Id = dataArrayIndex.resourceId;
|
||||
if (dataArrayIndex.checked) {
|
||||
(type == 1) ? this.checkedKeys[str].push(dataArrayIndex.resourceId): this.engineCheckedKeys.push(dataArrayIndex.resourceId)
|
||||
}
|
||||
for (let i = 0; i < datas.length; i++) {
|
||||
let data = datas[i];
|
||||
let parentId = data.parentId;
|
||||
if (parentId == Id) { //判断是否为儿子节点
|
||||
childrenArray.push(data);
|
||||
if (data.checked) {
|
||||
(type == 1) ? this.checkedKeys[str].push(data.resourceId): this.engineCheckedKeys.push(data.resourceId)
|
||||
}
|
||||
}
|
||||
}
|
||||
dataArrayIndex.children = childrenArray;
|
||||
if (childrenArray.length > 0) { //有儿子节点则递归
|
||||
this.data2treeDG(datas, childrenArray)
|
||||
}
|
||||
}
|
||||
if (type == 1) {
|
||||
this.treeList[str] = dataArray;
|
||||
console.log(this.treeList)
|
||||
} else {
|
||||
this.engineList = dataArray;
|
||||
}
|
||||
},
|
||||
// 新增或编辑
|
||||
onSubmit() {
|
||||
|
||||
console.log(this.checkedKeys)
|
||||
|
||||
this.checkedKeys.EngineX.forEach(value => {
|
||||
if (this.deepparentId(value,'EngineX')) {
|
||||
this.checkedKeys.EngineX.push(this.deepparentId(value,'EngineX'))
|
||||
}
|
||||
|
||||
})
|
||||
this.checkedKeys.DataX.forEach(value => {
|
||||
if (this.deepparentId(value,'DataX')) {
|
||||
this.checkedKeys.DataX.push(this.deepparentId(value,'DataX'))
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
let arr = []
|
||||
this.systemList.forEach(value=>{
|
||||
arr.push(...this.checkedKeys[value.value])
|
||||
})
|
||||
console.log(arr)
|
||||
arr = this.unique(arr)
|
||||
this.updateInsertRoleMenu({
|
||||
roleId: this.dataItem.roleId,
|
||||
ids: arr.join(',')
|
||||
})
|
||||
// 搜索引擎子权限:
|
||||
// this.updateInsertRoleEngine({
|
||||
// roleId:this.dataItem.id,
|
||||
// ids:this.engineCheckedKeys.join(',')
|
||||
// })
|
||||
},
|
||||
unique(arr) {
|
||||
return Array.from(new Set(arr))
|
||||
},
|
||||
deepparentId(id,str) {
|
||||
let num
|
||||
this.treeList[str].forEach(value => {
|
||||
if (value.resourceId == id) {
|
||||
num = value.parentId
|
||||
}
|
||||
if (value.children.length > 0) {
|
||||
value.children.forEach(item => {
|
||||
if (item.resourceId == id) {
|
||||
num = item.parentId
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
return num
|
||||
|
||||
|
||||
|
||||
},
|
||||
async updateInsertRoleMenu(form) {
|
||||
const data = await insertRoleMenu(form)
|
||||
if (data.status != "0") {
|
||||
if (data.data) {
|
||||
this.$message({
|
||||
message: '修改成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.handleClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
async updateInsertRoleEngine(form) {
|
||||
const data = await insertRoleEngine(form)
|
||||
if (data.status != "0") {
|
||||
if (data.data) {
|
||||
this.$message({
|
||||
message: '修改成功!',
|
||||
type: 'success'
|
||||
});
|
||||
this.handleClose();
|
||||
}
|
||||
}
|
||||
},
|
||||
async gettreeList(id,str) {
|
||||
if(this.treeList[str]) return
|
||||
const data = await getFindtreeList({
|
||||
"roleId": id,
|
||||
"entity":{
|
||||
"resourceSystem":str
|
||||
}
|
||||
})
|
||||
if (data.status != "0") {
|
||||
data.data.forEach(value=>{
|
||||
if(!value.checked){
|
||||
data.data.forEach(item=>{
|
||||
if(item.resourceId==value.parentId){
|
||||
item.checked = false
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
this.getTreeData(data.data, 1,str);
|
||||
}
|
||||
},
|
||||
async getEnginetreeList(id) {
|
||||
const data = await getEngineTree({
|
||||
"roleId": id,
|
||||
|
||||
})
|
||||
if (data.status != "0") {
|
||||
|
||||
this.getTreeData(data.data, 2);
|
||||
}
|
||||
},
|
||||
handleClose() {
|
||||
this.form = {
|
||||
roleId: '',
|
||||
organId: '',
|
||||
roleName: ''
|
||||
}
|
||||
this.checkedKeys.EngineX = []
|
||||
this.checkedKeys.DataX = []
|
||||
|
||||
this.treeList.EngineX=null
|
||||
this.treeList.DataX=null
|
||||
|
||||
this.tabs = 'EngineX'
|
||||
this.$emit('closeEvent');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.el-dialog__body {
|
||||
padding: 20px 40px;
|
||||
}
|
||||
|
||||
.user-edit-wrapper .el-input {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.user-edit-wrapper .btn-group {
|
||||
margin-top: 30px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,56 +0,0 @@
|
||||
<template>
|
||||
<div class="error-page">
|
||||
<div class="error-code">4<span>0</span>3</div>
|
||||
<div class="error-desc">啊哦~ 你没有权限访问该页面哦</div>
|
||||
<div class="error-handle">
|
||||
<router-link to="/">
|
||||
<el-button type="primary" size="large">返回首页</el-button>
|
||||
</router-link>
|
||||
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
goBack(){
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.error-page{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f3f3f3;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.error-code{
|
||||
line-height: 1;
|
||||
font-size: 250px;
|
||||
font-weight: bolder;
|
||||
color: #f02d2d;
|
||||
}
|
||||
.error-code span{
|
||||
color: #00a854;
|
||||
}
|
||||
.error-desc{
|
||||
font-size: 30px;
|
||||
color: #777;
|
||||
}
|
||||
.error-handle{
|
||||
margin-top: 30px;
|
||||
padding-bottom: 200px;
|
||||
}
|
||||
.error-btn{
|
||||
margin-left: 100px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,56 +0,0 @@
|
||||
<template>
|
||||
<div class="error-page">
|
||||
<div class="error-code">4<span>0</span>4</div>
|
||||
<div class="error-desc">啊哦~ 你所访问的页面不存在</div>
|
||||
<div class="error-handle">
|
||||
<router-link to="/">
|
||||
<el-button type="primary" size="large">返回首页</el-button>
|
||||
</router-link>
|
||||
<el-button class="error-btn" type="primary" size="large" @click="goBack">返回上一页</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
goBack(){
|
||||
this.$router.go(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.error-page{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #f3f3f3;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.error-code{
|
||||
line-height: 1;
|
||||
font-size: 250px;
|
||||
font-weight: bolder;
|
||||
color: #2d8cf0;
|
||||
}
|
||||
.error-code span{
|
||||
color: #00a854;
|
||||
}
|
||||
.error-desc{
|
||||
font-size: 30px;
|
||||
color: #777;
|
||||
}
|
||||
.error-handle{
|
||||
margin-top: 30px;
|
||||
padding-bottom: 200px;
|
||||
}
|
||||
.error-btn{
|
||||
margin-left: 100px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,420 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover" class="mgb20" style="height:252px;">
|
||||
<div class="user-info">
|
||||
<img src="../../assets/img/img.jpg" class="user-avator" alt />
|
||||
<div class="user-info-cont">
|
||||
<div class="user-info-name">{{name}}</div>
|
||||
<!-- <div>{{role}}</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="user-info-list">
|
||||
上次登录时间:
|
||||
<span>{{lastLoginTime | formatDate}}</span>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-card shadow="hover" style="height:252px;">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>引擎详情</span>
|
||||
</div>
|
||||
<span v-if="engineRatio1">{{engineRatio1.engineName}}
|
||||
<el-progress :percentage="engineRatio1.useRatio" color="#42b983"></el-progress>
|
||||
</span>
|
||||
<span v-if="engineRatio2">{{engineRatio2.engineName}}
|
||||
<el-progress :percentage="engineRatio2.useRatio" color="#f1e05a"></el-progress>
|
||||
</span>
|
||||
<span v-if="engineRatio3">{{engineRatio3.engineName}}
|
||||
<el-progress :percentage="engineRatio3.useRatio"></el-progress>
|
||||
</span>
|
||||
<span v-if="engineRatio4">{{engineRatio4.engineName}}
|
||||
<el-progress :percentage="engineRatio4.useRatio" color="#f56c6c"></el-progress>
|
||||
</span>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-row :gutter="20" class="mgb20">
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover" :body-style="{padding: '0px'}">
|
||||
<div class="grid-content grid-con-1">
|
||||
<i class="el-icon-lx-people grid-con-icon"></i>
|
||||
<div class="grid-cont-right">
|
||||
<div class="grid-num">{{engineNum}}</div>
|
||||
<div>引擎</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover" :body-style="{padding: '0px'}">
|
||||
<div class="grid-content grid-con-2">
|
||||
<i class="el-icon-lx-notice grid-con-icon"></i>
|
||||
<div class="grid-cont-right">
|
||||
<div class="grid-num">{{engineNodeNum}}</div>
|
||||
<div>决策节点</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-card shadow="hover" :body-style="{padding: '0px'}">
|
||||
<div class="grid-content grid-con-3">
|
||||
<i class="el-icon-lx-goods grid-con-icon"></i>
|
||||
<div class="grid-cont-right">
|
||||
<div class="grid-num">{{engineResultNum}}</div>
|
||||
<div>决策结果</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-card shadow="hover" style="height:403px;">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>活动日志</span>
|
||||
</div>
|
||||
<el-table :show-header="false" :data="todoList" style="width:100%;">
|
||||
<el-table-column>
|
||||
<template slot-scope="scope">
|
||||
<div class="todo-item">{{scope.row.opUserName}} {{scope.row.ip}} 在{{scope.row.startTime | formatDate}}
|
||||
{{scope.row.opName}}</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-card shadow="hover">
|
||||
<charts sid="dashboardLeft" height='250px' width='100%' :option="options"></charts>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-card shadow="hover">
|
||||
<charts sid="dashboardRight" height='250px' width='100%' :option="options2"></charts>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import charts from '@/components/common/charts.vue'
|
||||
import bus from '../common/bus';
|
||||
import {
|
||||
getIndexInfo
|
||||
} from '../../api/index';
|
||||
export default {
|
||||
name: 'dashboard',
|
||||
components: {
|
||||
// Schart,
|
||||
charts
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
name: localStorage.getItem('ms_username'),
|
||||
lastLoginTime: null,
|
||||
engineNum: null,
|
||||
engineNodeNum: null,
|
||||
engineResultNum: null,
|
||||
engineRatio1: {},
|
||||
engineRatio2: {},
|
||||
engineRatio3: {},
|
||||
engineRatio4: {},
|
||||
|
||||
todoList: [],
|
||||
options: {
|
||||
title: {
|
||||
text: '最近几天引擎使用情况',
|
||||
left: 'center'
|
||||
},
|
||||
grid: {
|
||||
bottom: '10% '
|
||||
},
|
||||
xAxis: [{
|
||||
type: 'category',
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
data: []
|
||||
}],
|
||||
yAxis: [{
|
||||
type: 'value'
|
||||
}],
|
||||
tooltip: {
|
||||
trigger: 'axis'
|
||||
},
|
||||
legend: {
|
||||
orient: 'vertical',
|
||||
left: 'left',
|
||||
},
|
||||
series: []
|
||||
|
||||
},
|
||||
options2: {
|
||||
title: {
|
||||
text: '最近几个月引擎使用趋势图',
|
||||
left: 'center'
|
||||
},
|
||||
grid: {
|
||||
bottom: '10% '
|
||||
},
|
||||
xAxis: [{
|
||||
type: 'category',
|
||||
axisTick: {
|
||||
show: false
|
||||
},
|
||||
data: []
|
||||
}],
|
||||
yAxis: [{
|
||||
type: 'value'
|
||||
}],
|
||||
tooltip: {
|
||||
trigger: 'item'
|
||||
},
|
||||
series: []
|
||||
|
||||
},
|
||||
};
|
||||
},
|
||||
|
||||
computed: {
|
||||
role() {
|
||||
return this.name === 'admin' ? '超级管理员' : '普通用户';
|
||||
}
|
||||
},
|
||||
// created() {
|
||||
// this.handleListener();
|
||||
// this.changeDate();
|
||||
// },
|
||||
// activated() {
|
||||
// this.handleListener();
|
||||
// },
|
||||
// deactivated() {
|
||||
// window.removeEventListener('resize', this.renderChart);
|
||||
// bus.$off('collapse', this.handleBus);
|
||||
// },
|
||||
|
||||
created() {
|
||||
// this.getIndexInfos();
|
||||
},
|
||||
|
||||
methods: {
|
||||
changeDate() {
|
||||
const now = new Date().getTime();
|
||||
this.data.forEach((item, index) => {
|
||||
const date = new Date(now - (6 - index) * 86400000);
|
||||
item.name = `${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()}`;
|
||||
});
|
||||
},
|
||||
|
||||
async getIndexInfos() {
|
||||
const result = await getIndexInfo();
|
||||
const data = result.data;
|
||||
|
||||
|
||||
// 引擎基本信息
|
||||
this.engineNum = data.engineBaseInfo.engineNum;
|
||||
this.engineNodeNum = data.engineBaseInfo.engineNodeNum;
|
||||
this.engineResultNum = data.engineBaseInfo.engineResultNum;
|
||||
|
||||
// 引擎使用占比
|
||||
this.engineRatio1 = data.engineUseRatio[0];
|
||||
this.engineRatio2 = data.engineUseRatio[1];
|
||||
this.engineRatio3 = data.engineUseRatio[2];
|
||||
this.engineRatio4 = data.engineUseRatio[3];
|
||||
|
||||
// 最近几天引擎使用情况
|
||||
|
||||
|
||||
|
||||
var labelOption = {
|
||||
show: true,
|
||||
position: 'insideBottomRight',
|
||||
distance: 10,
|
||||
align: 'left',
|
||||
verticalAlign: 'middle',
|
||||
rotate: 90,
|
||||
// formatter: '{c} {name|{a}}',
|
||||
fontSize: 12,
|
||||
rich: {
|
||||
name: {}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
this.options.xAxis[0].data = data.recentDayMap.labels;
|
||||
let arr = data.recentDayMap.datasets.map(value => {
|
||||
return {
|
||||
name: value.label,
|
||||
type: 'bar',
|
||||
barGap: 0,
|
||||
label: labelOption,
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: value.data
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
this.options.series = arr.filter((value,index)=>{
|
||||
return index<5
|
||||
})
|
||||
|
||||
// 最近几个月引擎使用情况
|
||||
this.options2.xAxis[0].data = data.recentMonthMap.labels;
|
||||
this.options2.series = data.recentMonthMap.datasets.map(value => {
|
||||
return {
|
||||
name: value.label,
|
||||
type: 'line',
|
||||
barGap: 0,
|
||||
label: labelOption,
|
||||
emphasis: {
|
||||
focus: 'series'
|
||||
},
|
||||
data: value.data
|
||||
}
|
||||
})
|
||||
|
||||
// 上次登录时间
|
||||
this.lastLoginTime = data.lastLoginTime;
|
||||
|
||||
// 活动日志
|
||||
this.todoList = data.logList;
|
||||
}
|
||||
},
|
||||
|
||||
filters: {
|
||||
formatDate: function(value) {
|
||||
let date = new Date(value);
|
||||
let y = date.getFullYear();
|
||||
let MM = date.getMonth() + 1;
|
||||
MM = MM < 10 ? ('0' + MM) : MM;
|
||||
let d = date.getDate();
|
||||
d = d < 10 ? ('0' + d) : d;
|
||||
let h = date.getHours();
|
||||
h = h < 10 ? ('0' + h) : h;
|
||||
let m = date.getMinutes();
|
||||
m = m < 10 ? ('0' + m) : m;
|
||||
let s = date.getSeconds();
|
||||
s = s < 10 ? ('0' + s) : s;
|
||||
return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<style scoped>
|
||||
.el-row {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.grid-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
.grid-cont-right {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.grid-num {
|
||||
font-size: 30px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.grid-con-icon {
|
||||
font-size: 50px;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
text-align: center;
|
||||
line-height: 100px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.grid-con-1 .grid-con-icon {
|
||||
background: rgb(45, 140, 240);
|
||||
}
|
||||
|
||||
.grid-con-1 .grid-num {
|
||||
color: rgb(45, 140, 240);
|
||||
}
|
||||
|
||||
.grid-con-2 .grid-con-icon {
|
||||
background: rgb(100, 213, 114);
|
||||
}
|
||||
|
||||
.grid-con-2 .grid-num {
|
||||
color: rgb(45, 140, 240);
|
||||
}
|
||||
|
||||
.grid-con-3 .grid-con-icon {
|
||||
background: rgb(242, 94, 67);
|
||||
}
|
||||
|
||||
.grid-con-3 .grid-num {
|
||||
color: rgb(242, 94, 67);
|
||||
}
|
||||
|
||||
.user-info {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-bottom: 20px;
|
||||
border-bottom: 2px solid #ccc;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.user-avator {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.user-info-cont {
|
||||
padding-left: 50px;
|
||||
flex: 1;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.user-info-cont div:first-child {
|
||||
font-size: 30px;
|
||||
color: #222;
|
||||
}
|
||||
|
||||
.user-info-list {
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
line-height: 25px;
|
||||
}
|
||||
|
||||
.user-info-list span {
|
||||
margin-left: 70px;
|
||||
}
|
||||
|
||||
.mgb20 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.todo-item {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.todo-item-del {
|
||||
text-decoration: line-through;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.schart {
|
||||
width: 100%;
|
||||
height: 300px;
|
||||
}
|
||||
</style>
|
||||
@@ -1,47 +0,0 @@
|
||||
<template>
|
||||
<section class="main">
|
||||
<div class="crumbs">
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item><i class="el-icon-lx-global"></i> {{$t('i18n.breadcrumb')}}</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</div>
|
||||
<div class="container">
|
||||
<span>{{$t('i18n.tips')}}</span>
|
||||
<el-button type="primary" @click="$i18n.locale = $i18n.locale === 'zh'?'en':'zh';">{{$t('i18n.btn')}}</el-button>
|
||||
<div class="list">
|
||||
<h2>{{$t('i18n.title1')}}</h2>
|
||||
<p>{{$t('i18n.p1')}}</p>
|
||||
<p>{{$t('i18n.p2')}}</p>
|
||||
<p>{{$t('i18n.p3')}}</p>
|
||||
</div>
|
||||
<h2>{{$t('i18n.title2')}}</h2>
|
||||
<div>
|
||||
<i18n path="i18n.info" tag="p">
|
||||
<a place="action" href="https://element.eleme.cn/2.0/#/zh-CN/component/i18n">{{ $t('i18n.value') }}</a>
|
||||
</i18n>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
|
||||
data(){
|
||||
return {
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.list{
|
||||
padding: 30px 0;
|
||||
}
|
||||
.list p{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
a{
|
||||
color: #409eff;
|
||||
}
|
||||
</style>
|
||||
@@ -1,225 +0,0 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="crumbs">
|
||||
<el-breadcrumb separator="/">
|
||||
<el-breadcrumb-item><i class="el-icon-lx-emoji"></i> 自定义图标</el-breadcrumb-item>
|
||||
</el-breadcrumb>
|
||||
</div>
|
||||
<div class="container">
|
||||
<h2>使用方法</h2>
|
||||
<p style="line-height: 50px;">
|
||||
直接通过设置类名为 el-icon-lx-iconName 来使用即可。例如:(共{{iconList.length}}个图标)
|
||||
</p>
|
||||
<p class="example-p">
|
||||
<i class="el-icon-lx-redpacket_fill" style="font-size: 30px;color: #ff5900"></i>
|
||||
<span><i class="el-icon-lx-redpacket_fill"></i></span>
|
||||
</p>
|
||||
<p class="example-p">
|
||||
<i class="el-icon-lx-weibo" style="font-size: 30px;color:#fd5656"></i>
|
||||
<span><i class="el-icon-lx-weibo"></i></span>
|
||||
</p>
|
||||
<p class="example-p">
|
||||
<i class="el-icon-lx-emojifill" style="font-size: 30px;color: #ffc300"></i>
|
||||
<span><i class="el-icon-lx-emojifill"></i></span>
|
||||
</p>
|
||||
<br>
|
||||
<h2>图标</h2>
|
||||
<div class="search-box">
|
||||
<el-input class="search" size="large" v-model="keyword" clearable placeholder="请输入图标名称"></el-input>
|
||||
</div>
|
||||
<ul>
|
||||
<li class="icon-li" v-for="(item,index) in list" :key="index">
|
||||
<div class="icon-li-content">
|
||||
<i :class="`el-icon-lx-${item}`"></i>
|
||||
<span>{{item}}</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data: function(){
|
||||
return {
|
||||
keyword: '',
|
||||
iconList: [
|
||||
'attentionforbid',
|
||||
'attentionforbidfill',
|
||||
'attention',
|
||||
'attentionfill',
|
||||
'tag',
|
||||
'tagfill',
|
||||
'people',
|
||||
'peoplefill',
|
||||
'notice',
|
||||
'noticefill',
|
||||
'mobile',
|
||||
'mobilefill',
|
||||
'voice',
|
||||
'voicefill',
|
||||
'unlock',
|
||||
'lock',
|
||||
'home',
|
||||
'homefill',
|
||||
'delete',
|
||||
'deletefill',
|
||||
'notification',
|
||||
'notificationfill',
|
||||
'notificationforbidfill',
|
||||
'like',
|
||||
'likefill',
|
||||
'comment',
|
||||
'commentfill',
|
||||
'camera',
|
||||
'camerafill',
|
||||
'warn',
|
||||
'warnfill',
|
||||
'time',
|
||||
'timefill',
|
||||
'location',
|
||||
'locationfill',
|
||||
'favor',
|
||||
'favorfill',
|
||||
'skin',
|
||||
'skinfill',
|
||||
'news',
|
||||
'newsfill',
|
||||
'record',
|
||||
'recordfill',
|
||||
'emoji',
|
||||
'emojifill',
|
||||
'message',
|
||||
'messagefill',
|
||||
'goods',
|
||||
'goodsfill',
|
||||
'crown',
|
||||
'crownfill',
|
||||
'move',
|
||||
'add',
|
||||
'hot',
|
||||
'hotfill',
|
||||
'service',
|
||||
'servicefill',
|
||||
'present',
|
||||
'presentfill',
|
||||
'pic',
|
||||
'picfill',
|
||||
'rank',
|
||||
'rankfill',
|
||||
'male',
|
||||
'female',
|
||||
'down',
|
||||
'top',
|
||||
'recharge',
|
||||
'rechargefill',
|
||||
'forward',
|
||||
'forwardfill',
|
||||
'info',
|
||||
'infofill',
|
||||
'redpacket',
|
||||
'redpacket_fill',
|
||||
'roundadd',
|
||||
'roundaddfill',
|
||||
'friendadd',
|
||||
'friendaddfill',
|
||||
'cart',
|
||||
'cartfill',
|
||||
'more',
|
||||
'moreandroid',
|
||||
'back',
|
||||
'right',
|
||||
'shop',
|
||||
'shopfill',
|
||||
'question',
|
||||
'questionfill',
|
||||
'roundclose',
|
||||
'roundclosefill',
|
||||
'roundcheck',
|
||||
'roundcheckfill',
|
||||
'global',
|
||||
'mail',
|
||||
'punch',
|
||||
'exit',
|
||||
'upload',
|
||||
'read',
|
||||
'file',
|
||||
'link',
|
||||
'full',
|
||||
'group',
|
||||
'friend',
|
||||
'profile',
|
||||
'addressbook',
|
||||
'calendar',
|
||||
'text',
|
||||
'copy',
|
||||
'share',
|
||||
'wifi',
|
||||
'vipcard',
|
||||
'weibo',
|
||||
'remind',
|
||||
'refresh',
|
||||
'filter',
|
||||
'settings',
|
||||
'scan',
|
||||
'qrcode',
|
||||
'cascades',
|
||||
'apps',
|
||||
'sort',
|
||||
'searchlist',
|
||||
'search',
|
||||
'edit'
|
||||
]
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
list(){
|
||||
return this.iconList.filter((item) => {
|
||||
return item.indexOf(this.keyword) !== -1;
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.example-p{
|
||||
height: 45px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.search-box{
|
||||
text-align: center;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.search{
|
||||
width: 300px;
|
||||
}
|
||||
ul,li{
|
||||
list-style: none;
|
||||
}
|
||||
.icon-li{
|
||||
display: inline-block;
|
||||
padding: 10px;
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
}
|
||||
.icon-li-content{
|
||||
display: flex;
|
||||
height: 100%;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
}
|
||||
.icon-li-content i{
|
||||
font-size: 36px;
|
||||
color: #606266;
|
||||
}
|
||||
.icon-li-content span{
|
||||
margin-top: 10px;
|
||||
color: #787878;
|
||||
}
|
||||
</style>
|
||||
@@ -1,133 +0,0 @@
|
||||
<template>
|
||||
<div class="login-wrap">
|
||||
<div class="ms-login">
|
||||
<div class="ms-title">权限系统</div>
|
||||
<el-form :model="param" :rules="rules" ref="login" label-width="0px" class="ms-content">
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="param.username" placeholder="username">
|
||||
<el-button slot="prepend" icon="el-icon-lx-people"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="password">
|
||||
<el-input
|
||||
type="password"
|
||||
placeholder="password"
|
||||
v-model="param.password"
|
||||
@keyup.enter.native="submitForm()"
|
||||
>
|
||||
<el-button slot="prepend" icon="el-icon-lx-lock"></el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<div class="login-btn">
|
||||
<el-button type="primary" @click="submitForm()">登录</el-button>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getLogin } from '../../api/index';
|
||||
export default {
|
||||
created() {
|
||||
// if(this.$route.query.type=="token"){
|
||||
// this.$message.error('登陆授权码已过期')
|
||||
// this.$route.query.type=""
|
||||
// }
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
param: {
|
||||
username: '',
|
||||
password: '',
|
||||
},
|
||||
rules: {
|
||||
username: [{ required: true, message: '请输入用户名', trigger: 'blur' }],
|
||||
password: [{ required: true, message: '请输入密码', trigger: 'blur' }],
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
submitForm() {
|
||||
this.$refs.login.validate(valid => {
|
||||
if (valid) {
|
||||
// 调用登录接口
|
||||
this.getLogins();
|
||||
|
||||
} else {
|
||||
this.$message.error('请输入账号和密码');
|
||||
console.log('error submit!!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
async getLogins() {
|
||||
// var formdata = new FormData();
|
||||
// formdata.append('account', this.param.username);
|
||||
// formdata.append('password', this.param.password);
|
||||
var params ={
|
||||
account:this.param.username,
|
||||
password:this.param.password
|
||||
}
|
||||
|
||||
const data = await getLogin(params);
|
||||
console.log('登录接口返回的数据',data);
|
||||
const code = data.code;
|
||||
|
||||
if(data.status==="1"){
|
||||
this.$message.success('登录成功,即将跳转');
|
||||
localStorage.setItem('ms_username', this.param.username);
|
||||
localStorage.setItem('token', data.data.token);
|
||||
this.$router.push('/');
|
||||
}
|
||||
else{
|
||||
this.$message.error(data.msg);
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.login-wrap {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url(../../assets/img/login-bg.jpg);
|
||||
background-size: 100%;
|
||||
}
|
||||
.ms-title {
|
||||
width: 100%;
|
||||
line-height: 50px;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
color: #fff;
|
||||
border-bottom: 1px solid #ddd;
|
||||
}
|
||||
.ms-login {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
width: 350px;
|
||||
margin: -190px 0 0 -175px;
|
||||
border-radius: 5px;
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
overflow: hidden;
|
||||
}
|
||||
.ms-content {
|
||||
padding: 30px 30px;
|
||||
}
|
||||
.login-btn {
|
||||
text-align: center;
|
||||
}
|
||||
.login-btn button {
|
||||
width: 100%;
|
||||
height: 36px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.login-tips {
|
||||
font-size: 12px;
|
||||
line-height: 30px;
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
@@ -1,6 +0,0 @@
|
||||
import Vue from 'vue';
|
||||
|
||||
// 使用 Event Bus
|
||||
const bus = new Vue();
|
||||
|
||||
export default bus;
|
||||