19 changed files with 716 additions and 489 deletions
@ -0,0 +1,17 @@ |
|||||
|
@RELATION house |
||||
|
|
||||
|
@ATTRIBUTE houseSize NUMERIC |
||||
|
@ATTRIBUTE lotSize NUMERIC |
||||
|
@ATTRIBUTE bedrooms NUMERIC |
||||
|
@ATTRIBUTE granite NUMERIC |
||||
|
@ATTRIBUTE bathroom NUMERIC |
||||
|
@ATTRIBUTE sellingPrice NUMERIC |
||||
|
|
||||
|
@DATA |
||||
|
3529,9191,6,0,0,205000 |
||||
|
3247,10061,5,1,1,224900 |
||||
|
4032,10150,5,0,1,197900 |
||||
|
2397,14156,4,1,0,189900 |
||||
|
2200,9600,4,0,1,195000 |
||||
|
3536,19994,6,1,1,325000 |
||||
|
2983,9365,5,0,1,230000 |
@ -1,188 +0,0 @@ |
|||||
<template> |
|
||||
<q-splitter :model-value="60" class="w-full" style="height: 100%"> |
|
||||
<template #before> |
|
||||
<div class="pr-1" style="height: 100%"> |
|
||||
<w-grid |
|
||||
ref="factorTypeGridRef" |
|
||||
:title="$t('engine.st.factorType.grid.title')" |
|
||||
:checkbox-selection="true" |
|
||||
:data-url="Environment.apiContextPath('/api/st/factorType')" |
|
||||
:pageable="false" |
|
||||
:sort-by="['code']" |
|
||||
:query-form-cols-num="4" |
|
||||
:query-form-fields="[ |
|
||||
{ |
|
||||
name: 'periodType', |
|
||||
label: $t('period'), |
|
||||
type: 'select', |
|
||||
options: Options.enum(Enums.PeriodType), |
|
||||
queryOperator: 'equals', |
|
||||
}, |
|
||||
{ name: 'code', label: $t('code'), type: 'text' }, |
|
||||
{ name: 'name', label: $t('name'), type: 'text' }, |
|
||||
]" |
|
||||
:toolbar-actions="['query', 'separator', 'refresh', 'separator', 'add', 'clone', 'edit', 'remove', 'separator', 'view', 'separator', 'export']" |
|
||||
:columns="[ |
|
||||
{ width: 150, name: 'name', label: $t('name') }, |
|
||||
{ width: 100, name: 'code', label: $t('code') }, |
|
||||
{ width: 60, name: 'periodType', label: $t('engine.st.economicIndicator.grid.entity.periodType'), format: Formater.enum(Enums.PeriodType) }, |
|
||||
{ width: 100, name: 'description', label: $t('description') }, |
|
||||
{ width: 80, name: 'valueType', label: $t('valueType'), format: Formater.enum(Enums.ValueType) }, |
|
||||
]" |
|
||||
:editor="{ |
|
||||
dialog: { |
|
||||
width: '600px', |
|
||||
}, |
|
||||
form: { |
|
||||
colsNum: 1, |
|
||||
fields: [ |
|
||||
{ |
|
||||
name: 'periodType', |
|
||||
label: $t('period'), |
|
||||
required: true, |
|
||||
type: 'select', |
|
||||
options: Options.enum(Enums.PeriodType), |
|
||||
}, |
|
||||
{ name: 'code', label: $t('code'), type: 'text', required: true }, |
|
||||
{ name: 'name', label: $t('name'), type: 'text', required: true }, |
|
||||
{ name: 'valueType', label: $t('valueType'), required: true, type: 'select', options: Options.enum(Enums.ValueType) }, |
|
||||
{ name: 'description', label: $t('description'), type: 'text' }, |
|
||||
], |
|
||||
}, |
|
||||
}" |
|
||||
:viewer="{ |
|
||||
panel: { |
|
||||
columnNum: 1, |
|
||||
fields: [ |
|
||||
{ name: 'id', label: $t('id') }, |
|
||||
{ name: 'periodType', label: $t('period') }, |
|
||||
{ name: 'code', label: $t('code') }, |
|
||||
{ name: 'name', label: $t('name') }, |
|
||||
{ name: 'description', label: $t('description') }, |
|
||||
{ name: 'valueType', label: $t('valueType') }, |
|
||||
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
|
||||
{ name: 'creator', label: $t('creator') }, |
|
||||
{ name: 'createDate', label: $t('createDate') }, |
|
||||
{ name: 'lastModifier', label: $t('lastModifier') }, |
|
||||
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() }, |
|
||||
{ name: 'corporationCode', label: $t('corporationCode') }, |
|
||||
], |
|
||||
}, |
|
||||
}" |
|
||||
@row-click=" |
|
||||
(evt, row, index) => { |
|
||||
currentSelectedFactorType = row; |
|
||||
factorGridRef?.refresh(); |
|
||||
} |
|
||||
" |
|
||||
@before-request-data=" |
|
||||
() => { |
|
||||
currentSelectedFactorType = { id: '' }; |
|
||||
factorGridRef?.refresh(); |
|
||||
} |
|
||||
" |
|
||||
></w-grid> |
|
||||
</div> |
|
||||
</template> |
|
||||
<template #after> |
|
||||
<div class="pl-1" style="height: 100%"> |
|
||||
<w-grid |
|
||||
ref="factorGridRef" |
|
||||
title="" |
|
||||
:checkbox-selection="true" |
|
||||
:fetch-data-url="Environment.apiContextPath('/api/st/factor?factorType=' + currentSelectedFactorType.id)" |
|
||||
:data-url="Environment.apiContextPath('/api/st/factor')" |
|
||||
:pageable="false" |
|
||||
:sort-by="['year', 'quarter', 'month', 'day']" |
|
||||
:query-form-cols-num="4" |
|
||||
:query-form-fields="[]" |
|
||||
:toolbar-actions="['refresh', 'separator', 'add', 'clone', 'edit', 'remove', 'separator', 'view', 'separator', 'export']" |
|
||||
:columns="getFactorColumns" |
|
||||
:editor="{ |
|
||||
dialog: { |
|
||||
width: '600px', |
|
||||
}, |
|
||||
form: { |
|
||||
colsNum: 1, |
|
||||
fields: [ |
|
||||
{ |
|
||||
name: 'periodType', |
|
||||
label: $t('period'), |
|
||||
required: true, |
|
||||
type: 'select', |
|
||||
options: Options.enum(Enums.PeriodType), |
|
||||
}, |
|
||||
{ name: 'code', label: $t('code'), type: 'text', required: true }, |
|
||||
{ name: 'name', label: $t('name'), type: 'text', required: true }, |
|
||||
{ name: 'valueType', label: $t('valueType'), required: true, type: 'select', options: Options.enum(Enums.ValueType) }, |
|
||||
{ name: 'description', label: $t('description'), type: 'text' }, |
|
||||
], |
|
||||
}, |
|
||||
}" |
|
||||
:viewer="{ |
|
||||
panel: { |
|
||||
columnNum: 1, |
|
||||
fields: [ |
|
||||
{ name: 'id', label: $t('id') }, |
|
||||
{ name: 'periodType', label: $t('period') }, |
|
||||
{ name: 'code', label: $t('code') }, |
|
||||
{ name: 'name', label: $t('name') }, |
|
||||
{ name: 'description', label: $t('description') }, |
|
||||
{ name: 'valueType', label: $t('valueType') }, |
|
||||
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
|
||||
{ name: 'creator', label: $t('creator') }, |
|
||||
{ name: 'createDate', label: $t('createDate') }, |
|
||||
{ name: 'lastModifier', label: $t('lastModifier') }, |
|
||||
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() }, |
|
||||
{ name: 'corporationCode', label: $t('corporationCode') }, |
|
||||
], |
|
||||
}, |
|
||||
}" |
|
||||
></w-grid> |
|
||||
</div> |
|
||||
</template> |
|
||||
</q-splitter> |
|
||||
</template> |
|
||||
<script setup lang="ts"> |
|
||||
import { ref } from 'vue'; |
|
||||
import { useI18n } from 'vue-i18n'; |
|
||||
import { Environment, EnumTools, Formater, Options } from 'platform-core'; |
|
||||
import { computed } from 'vue'; |
|
||||
|
|
||||
const { t } = useI18n(); |
|
||||
const factorTypeGridRef = ref(); |
|
||||
const factorGridRef = ref(); |
|
||||
const currentSelectedFactorType = ref({}); |
|
||||
const Enums = await EnumTools.fetch(['io.sc.engine.st.enums.PeriodType', 'io.sc.engine.st.enums.ValueType']); |
|
||||
|
|
||||
const getFactorColumns = computed(() => { |
|
||||
let result = []; |
|
||||
if (currentSelectedFactorType.value.periodType === 'YEAR') { |
|
||||
result = [ |
|
||||
{ width: 60, name: 'year', label: t('year') }, |
|
||||
{ width: '100%', name: 'value', label: t('value') }, |
|
||||
]; |
|
||||
} else if (currentSelectedFactorType.value.periodType === 'QUARTER') { |
|
||||
result = [ |
|
||||
{ width: 60, name: 'year', label: t('year') }, |
|
||||
{ width: 60, name: 'quarter', label: t('quarter') }, |
|
||||
{ width: '100%', name: 'value', label: t('value') }, |
|
||||
]; |
|
||||
} else if (currentSelectedFactorType.value.periodType === 'MONTH') { |
|
||||
result = [ |
|
||||
{ width: 60, name: 'year', label: t('year') }, |
|
||||
{ width: 60, name: 'month', label: t('month') }, |
|
||||
{ width: '100%', name: 'value', label: t('value') }, |
|
||||
]; |
|
||||
} else if (currentSelectedFactorType.value.periodType === 'DAY') { |
|
||||
result = [ |
|
||||
{ width: 60, name: 'year', label: t('year') }, |
|
||||
{ width: 60, name: 'month', label: t('month') }, |
|
||||
{ width: 60, name: 'day', label: t('day') }, |
|
||||
{ width: '100%', name: 'value', label: t('value') }, |
|
||||
]; |
|
||||
} |
|
||||
console.log(result); |
|
||||
return result; |
|
||||
}); |
|
||||
</script> |
|
@ -1,15 +0,0 @@ |
|||||
package io.sc.engine.st.controller; |
|
||||
|
|
||||
import io.sc.engine.st.jpa.entity.FactorTypeEntity; |
|
||||
import io.sc.engine.st.jpa.repository.FactorTypeRepository; |
|
||||
import io.sc.engine.st.service.FactorTypeService; |
|
||||
import io.sc.engine.st.vo.FactorTypeVo; |
|
||||
import io.sc.platform.mvc.controller.support.RestCrudController; |
|
||||
import org.springframework.web.bind.annotation.RequestMapping; |
|
||||
import org.springframework.web.bind.annotation.RestController; |
|
||||
|
|
||||
@RestController("io.sc.engine.st.controller.FactorTypeWebController") |
|
||||
@RequestMapping("/api/st/factorType") |
|
||||
public class FactorTypeWebController extends RestCrudController<FactorTypeVo, FactorTypeEntity,String, FactorTypeRepository, FactorTypeService> { |
|
||||
|
|
||||
} |
|
@ -1,15 +0,0 @@ |
|||||
package io.sc.engine.st.controller; |
|
||||
|
|
||||
import io.sc.engine.st.jpa.entity.FactorEntity; |
|
||||
import io.sc.engine.st.jpa.repository.FactorRepository; |
|
||||
import io.sc.engine.st.service.FactorService; |
|
||||
import io.sc.engine.st.vo.FactorVo; |
|
||||
import io.sc.platform.mvc.controller.support.RestCrudController; |
|
||||
import org.springframework.web.bind.annotation.RequestMapping; |
|
||||
import org.springframework.web.bind.annotation.RestController; |
|
||||
|
|
||||
@RestController("io.sc.engine.st.controller.FactorWebController") |
|
||||
@RequestMapping("/api/st/factor") |
|
||||
public class FactorWebController extends RestCrudController<FactorVo, FactorEntity,String, FactorRepository, FactorService> { |
|
||||
|
|
||||
} |
|
@ -0,0 +1,42 @@ |
|||||
|
package io.sc.engine.st.jpa.entity.sub; |
||||
|
|
||||
|
import io.sc.engine.st.jpa.entity.IndepFactorDefineEntity; |
||||
|
import io.sc.engine.st.jpa.entity.IndepFactorEntity; |
||||
|
import io.sc.engine.st.vo.IndepFactorDefineVo; |
||||
|
import io.sc.engine.st.vo.sub.IndepArithmeticFactorDefineVo; |
||||
|
|
||||
|
import javax.persistence.Column; |
||||
|
import javax.persistence.DiscriminatorValue; |
||||
|
import javax.persistence.Entity; |
||||
|
|
||||
|
/** |
||||
|
* 算术运算自变量定义实体类 |
||||
|
*/ |
||||
|
@Entity |
||||
|
@DiscriminatorValue("EXTEND_ARITHMETIC") |
||||
|
public class IndepArithmeticFactorDefineEntity extends IndepFactorDefineEntity { |
||||
|
// 算术公式
|
||||
|
@Column(name="ARITHMETIC_FORMULA_", length=1024) |
||||
|
protected String formula; |
||||
|
|
||||
|
@Override |
||||
|
public IndepFactorDefineVo toVo() { |
||||
|
IndepArithmeticFactorDefineVo vo =new IndepArithmeticFactorDefineVo(); |
||||
|
super.toVo(vo); |
||||
|
vo.setFormula(this.getFormula()); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
public IndepArithmeticFactorDefineEntity(){} |
||||
|
public IndepArithmeticFactorDefineEntity(String id){ |
||||
|
this.id =id; |
||||
|
} |
||||
|
|
||||
|
public String getFormula() { |
||||
|
return formula; |
||||
|
} |
||||
|
|
||||
|
public void setFormula(String formula) { |
||||
|
this.formula = formula; |
||||
|
} |
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
package io.sc.engine.st.jpa.entity.sub; |
||||
|
|
||||
|
import io.sc.engine.st.jpa.entity.IndepFactorDefineEntity; |
||||
|
import io.sc.engine.st.vo.IndepFactorDefineVo; |
||||
|
import io.sc.engine.st.vo.sub.IndepDelayFactorDefineVo; |
||||
|
|
||||
|
import javax.persistence.*; |
||||
|
|
||||
|
/** |
||||
|
* 滞后运算自变量定义实体类 |
||||
|
*/ |
||||
|
@Entity |
||||
|
@DiscriminatorValue("EXTEND_DELAY") |
||||
|
public class IndepDelayFactorDefineEntity extends IndepFactorDefineEntity { |
||||
|
// 滞后自变量定义
|
||||
|
@ManyToOne(fetch = FetchType.LAZY) |
||||
|
@JoinColumn(name = "DELAY_FACTOR_DEF_ID_") |
||||
|
protected IndepFactorDefineEntity delayFactorDefine; |
||||
|
|
||||
|
// 滞后期数
|
||||
|
@Column(name="DELAY_ISSUE_") |
||||
|
protected Integer delayIssue; |
||||
|
|
||||
|
@Override |
||||
|
public IndepFactorDefineVo toVo() { |
||||
|
IndepDelayFactorDefineVo vo =new IndepDelayFactorDefineVo(); |
||||
|
super.toVo(vo); |
||||
|
vo.setDelayFactorDefine(this.getDelayFactorDefine()==null?null:this.getDelayFactorDefine().getId()); |
||||
|
vo.setDelayIssue(this.getDelayIssue()); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
public IndepDelayFactorDefineEntity(){} |
||||
|
public IndepDelayFactorDefineEntity(String id){ |
||||
|
this.id =id; |
||||
|
} |
||||
|
|
||||
|
public IndepFactorDefineEntity getDelayFactorDefine() { |
||||
|
return delayFactorDefine; |
||||
|
} |
||||
|
|
||||
|
public void setDelayFactorDefine(IndepFactorDefineEntity delayFactorDefine) { |
||||
|
this.delayFactorDefine = delayFactorDefine; |
||||
|
} |
||||
|
|
||||
|
public Integer getDelayIssue() { |
||||
|
return delayIssue; |
||||
|
} |
||||
|
|
||||
|
public void setDelayIssue(Integer delayIssue) { |
||||
|
this.delayIssue = delayIssue; |
||||
|
} |
||||
|
} |
@ -0,0 +1,53 @@ |
|||||
|
package io.sc.engine.st.jpa.entity.sub; |
||||
|
|
||||
|
import io.sc.engine.st.jpa.entity.IndepFactorDefineEntity; |
||||
|
import io.sc.engine.st.vo.IndepFactorDefineVo; |
||||
|
import io.sc.engine.st.vo.sub.IndepDifferentialFactorDefineVo; |
||||
|
|
||||
|
import javax.persistence.*; |
||||
|
|
||||
|
/** |
||||
|
* 差分运算自变量定义实体类 |
||||
|
*/ |
||||
|
@Entity |
||||
|
@DiscriminatorValue("EXTEND_DIFFERENTIAL") |
||||
|
public class IndepDifferentialFactorDefineEntity extends IndepFactorDefineEntity { |
||||
|
// 差分自变量定义
|
||||
|
@ManyToOne(fetch = FetchType.LAZY) |
||||
|
@JoinColumn(name = "DIFFERENTIAL_FACTOR_DEF_ID_") |
||||
|
protected IndepFactorDefineEntity differentialFactorDefine; |
||||
|
|
||||
|
// 差分阶数
|
||||
|
@Column(name="DIFFERENTIAL_DEGREE_") |
||||
|
protected Integer differentialDegree; |
||||
|
|
||||
|
@Override |
||||
|
public IndepFactorDefineVo toVo() { |
||||
|
IndepDifferentialFactorDefineVo vo =new IndepDifferentialFactorDefineVo(); |
||||
|
super.toVo(vo); |
||||
|
vo.setDifferentialFactorDefine(this.getDifferentialFactorDefine()==null?null:this.getDifferentialFactorDefine().getId()); |
||||
|
vo.setDifferentialDegree(this.getDifferentialDegree()); |
||||
|
return vo; |
||||
|
} |
||||
|
|
||||
|
public IndepDifferentialFactorDefineEntity(){} |
||||
|
public IndepDifferentialFactorDefineEntity(String id){ |
||||
|
this.id =id; |
||||
|
} |
||||
|
|
||||
|
public IndepFactorDefineEntity getDifferentialFactorDefine() { |
||||
|
return differentialFactorDefine; |
||||
|
} |
||||
|
|
||||
|
public void setDifferentialFactorDefine(IndepFactorDefineEntity differentialFactorDefine) { |
||||
|
this.differentialFactorDefine = differentialFactorDefine; |
||||
|
} |
||||
|
|
||||
|
public Integer getDifferentialDegree() { |
||||
|
return differentialDegree; |
||||
|
} |
||||
|
|
||||
|
public void setDifferentialDegree(Integer differentialDegree) { |
||||
|
this.differentialDegree = differentialDegree; |
||||
|
} |
||||
|
} |
@ -1,10 +0,0 @@ |
|||||
package io.sc.engine.st.jpa.repository; |
|
||||
|
|
||||
import io.sc.engine.st.jpa.entity.FactorTypeEntity; |
|
||||
import io.sc.platform.orm.repository.DaoRepository; |
|
||||
import org.springframework.stereotype.Service; |
|
||||
|
|
||||
@Service("io.sc.engine.st.jpa.repository.FactorTypeRepository") |
|
||||
public interface FactorTypeRepository extends DaoRepository<FactorTypeEntity,String>{ |
|
||||
|
|
||||
} |
|
@ -1,8 +0,0 @@ |
|||||
package io.sc.engine.st.service; |
|
||||
|
|
||||
import io.sc.engine.st.jpa.entity.FactorTypeEntity; |
|
||||
import io.sc.engine.st.jpa.repository.FactorTypeRepository; |
|
||||
import io.sc.platform.orm.service.DaoService; |
|
||||
|
|
||||
public interface FactorTypeService extends DaoService<FactorTypeEntity, String, FactorTypeRepository>{ |
|
||||
} |
|
@ -1,12 +0,0 @@ |
|||||
package io.sc.engine.st.service.impl; |
|
||||
|
|
||||
import io.sc.engine.st.jpa.entity.FactorTypeEntity; |
|
||||
import io.sc.engine.st.jpa.repository.FactorTypeRepository; |
|
||||
import io.sc.engine.st.service.FactorTypeService; |
|
||||
import io.sc.platform.orm.service.impl.DaoServiceImpl; |
|
||||
import org.springframework.stereotype.Service; |
|
||||
|
|
||||
@Service("io.sc.engine.st.service.impl.FactorTypeServiceImpl") |
|
||||
public class FactorTypeServiceImpl extends DaoServiceImpl<FactorTypeEntity, String, FactorTypeRepository> implements FactorTypeService { |
|
||||
|
|
||||
} |
|
@ -0,0 +1,14 @@ |
|||||
|
package io.sc.engine.st.support; |
||||
|
|
||||
|
import org.springframework.util.StringUtils; |
||||
|
|
||||
|
public class FormulaConverter { |
||||
|
public static String convert(String expression){ |
||||
|
if(!StringUtils.hasText(expression)){ |
||||
|
return null; |
||||
|
} |
||||
|
// Math. -> T(java.lang.Math).
|
||||
|
String r =expression.replaceAll("Math\\.","T(java.lang.Math)."); |
||||
|
return r; |
||||
|
} |
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
package io.sc.engine.st.support; |
||||
|
|
||||
|
|
||||
|
import org.springframework.util.StringUtils; |
||||
|
|
||||
|
import java.util.*; |
||||
|
import java.util.regex.Matcher; |
||||
|
import java.util.regex.Pattern; |
||||
|
|
||||
|
public class FormulaUtil { |
||||
|
private static final String PLACE_HOLDER_REGEX ="(\\$\\{(.+?)\\})"; //${xxxx}
|
||||
|
private static final Pattern PLACE_HOLDER_REGEX_PATTERN =Pattern.compile("(\\$\\{(.+?)\\})"); //${xxxx}
|
||||
|
|
||||
|
public static List<String> extractVariableNames(String expression){ |
||||
|
if(!StringUtils.hasText(expression)){ |
||||
|
return Collections.emptyList(); |
||||
|
} |
||||
|
Matcher matcher =PLACE_HOLDER_REGEX_PATTERN.matcher(expression); |
||||
|
List<String> names =new ArrayList<>(); |
||||
|
while (matcher.find()) { |
||||
|
names.add(matcher.group(2)); |
||||
|
} |
||||
|
return names; |
||||
|
} |
||||
|
|
||||
|
public static String getGroovyScript(String expression){ |
||||
|
if(!StringUtils.hasText(expression)){ |
||||
|
return null; |
||||
|
} |
||||
|
return expression.replaceAll(PLACE_HOLDER_REGEX,"$2"); |
||||
|
} |
||||
|
} |
@ -1,62 +0,0 @@ |
|||||
package io.sc.engine.st.vo; |
|
||||
|
|
||||
import io.sc.engine.st.enums.PeriodType; |
|
||||
import io.sc.engine.st.enums.ValueType; |
|
||||
import io.sc.platform.orm.api.vo.CorporationAuditorVo; |
|
||||
|
|
||||
public class FactorTypeVo extends CorporationAuditorVo { |
|
||||
protected String id; |
|
||||
protected String code; |
|
||||
protected String name; |
|
||||
protected String description; |
|
||||
protected PeriodType periodType; |
|
||||
protected ValueType valueType; |
|
||||
|
|
||||
public String getId() { |
|
||||
return id; |
|
||||
} |
|
||||
|
|
||||
public void setId(String id) { |
|
||||
this.id = id; |
|
||||
} |
|
||||
|
|
||||
public String getCode() { |
|
||||
return code; |
|
||||
} |
|
||||
|
|
||||
public void setCode(String code) { |
|
||||
this.code = code; |
|
||||
} |
|
||||
|
|
||||
public String getName() { |
|
||||
return name; |
|
||||
} |
|
||||
|
|
||||
public void setName(String name) { |
|
||||
this.name = name; |
|
||||
} |
|
||||
|
|
||||
public String getDescription() { |
|
||||
return description; |
|
||||
} |
|
||||
|
|
||||
public void setDescription(String description) { |
|
||||
this.description = description; |
|
||||
} |
|
||||
|
|
||||
public PeriodType getPeriodType() { |
|
||||
return periodType; |
|
||||
} |
|
||||
|
|
||||
public void setPeriodType(PeriodType periodType) { |
|
||||
this.periodType = periodType; |
|
||||
} |
|
||||
|
|
||||
public ValueType getValueType() { |
|
||||
return valueType; |
|
||||
} |
|
||||
|
|
||||
public void setValueType(ValueType valueType) { |
|
||||
this.valueType = valueType; |
|
||||
} |
|
||||
} |
|
@ -1,74 +0,0 @@ |
|||||
package io.sc.engine.st.vo; |
|
||||
|
|
||||
import io.sc.engine.st.enums.PeriodType; |
|
||||
import io.sc.engine.st.enums.ValueType; |
|
||||
import io.sc.platform.orm.api.vo.CorporationAuditorVo; |
|
||||
|
|
||||
import javax.persistence.Column; |
|
||||
import javax.validation.constraints.Size; |
|
||||
|
|
||||
public class FactorVo extends CorporationAuditorVo { |
|
||||
protected String id; |
|
||||
protected Integer year; |
|
||||
protected Integer quarter; |
|
||||
protected Integer month; |
|
||||
protected Integer day; |
|
||||
protected String value; |
|
||||
protected String factorType; |
|
||||
|
|
||||
public String getId() { |
|
||||
return id; |
|
||||
} |
|
||||
|
|
||||
public void setId(String id) { |
|
||||
this.id = id; |
|
||||
} |
|
||||
|
|
||||
public Integer getYear() { |
|
||||
return year; |
|
||||
} |
|
||||
|
|
||||
public void setYear(Integer year) { |
|
||||
this.year = year; |
|
||||
} |
|
||||
|
|
||||
public Integer getQuarter() { |
|
||||
return quarter; |
|
||||
} |
|
||||
|
|
||||
public void setQuarter(Integer quarter) { |
|
||||
this.quarter = quarter; |
|
||||
} |
|
||||
|
|
||||
public Integer getMonth() { |
|
||||
return month; |
|
||||
} |
|
||||
|
|
||||
public void setMonth(Integer month) { |
|
||||
this.month = month; |
|
||||
} |
|
||||
|
|
||||
public Integer getDay() { |
|
||||
return day; |
|
||||
} |
|
||||
|
|
||||
public void setDay(Integer day) { |
|
||||
this.day = day; |
|
||||
} |
|
||||
|
|
||||
public String getValue() { |
|
||||
return value; |
|
||||
} |
|
||||
|
|
||||
public void setValue(String value) { |
|
||||
this.value = value; |
|
||||
} |
|
||||
|
|
||||
public String getFactorType() { |
|
||||
return factorType; |
|
||||
} |
|
||||
|
|
||||
public void setFactorType(String factorType) { |
|
||||
this.factorType = factorType; |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,15 @@ |
|||||
|
package io.sc.engine.st.vo.sub; |
||||
|
|
||||
|
import io.sc.engine.st.vo.IndepFactorDefineVo; |
||||
|
|
||||
|
public class IndepArithmeticFactorDefineVo extends IndepFactorDefineVo { |
||||
|
protected String formula; |
||||
|
|
||||
|
public String getFormula() { |
||||
|
return formula; |
||||
|
} |
||||
|
|
||||
|
public void setFormula(String formula) { |
||||
|
this.formula = formula; |
||||
|
} |
||||
|
} |
@ -1,75 +1,250 @@ |
|||||
<template> |
<template> |
||||
<div style="height: 100%"> |
<q-splitter :model-value="60" class="w-full" style="height: 100%"> |
||||
<q-btn label="ok" @click="click"></q-btn> |
<template #before> |
||||
<WEcharts ref="echars" :option="option" style="width: 100%; height: 100%"></WEcharts> |
<div class="pr-1" style="height: 100%"> |
||||
</div> |
<w-grid |
||||
|
ref="factorTypeGridRef" |
||||
|
:title="$t('engine.st.factorType.grid.title')" |
||||
|
:checkbox-selection="true" |
||||
|
:data-url="Environment.apiContextPath('/api/st/factorType')" |
||||
|
:pageable="false" |
||||
|
:sort-by="['code']" |
||||
|
:query-form-cols-num="4" |
||||
|
:query-form-fields="[ |
||||
|
{ |
||||
|
name: 'periodType', |
||||
|
label: $t('period'), |
||||
|
type: 'select', |
||||
|
options: Options.enum(Enums.PeriodType), |
||||
|
queryOperator: 'equals', |
||||
|
}, |
||||
|
{ name: 'code', label: $t('code'), type: 'text' }, |
||||
|
{ name: 'name', label: $t('name'), type: 'text' }, |
||||
|
]" |
||||
|
:toolbar-actions="['query', 'separator', 'refresh', 'separator', 'add', 'clone', 'edit', 'remove', 'separator', 'view', 'separator', 'export']" |
||||
|
:columns="[ |
||||
|
{ width: 150, name: 'name', label: $t('name') }, |
||||
|
{ width: 100, name: 'code', label: $t('code') }, |
||||
|
{ width: 60, name: 'periodType', label: $t('engine.st.economicIndicator.grid.entity.periodType'), format: Formater.enum(Enums.PeriodType) }, |
||||
|
{ width: 100, name: 'description', label: $t('description') }, |
||||
|
{ width: 80, name: 'valueType', label: $t('valueType'), format: Formater.enum(Enums.ValueType) }, |
||||
|
]" |
||||
|
:editor="{ |
||||
|
dialog: { |
||||
|
width: '600px', |
||||
|
}, |
||||
|
form: { |
||||
|
colsNum: 1, |
||||
|
fields: [ |
||||
|
{ |
||||
|
name: 'periodType', |
||||
|
label: $t('period'), |
||||
|
required: true, |
||||
|
type: 'select', |
||||
|
options: Options.enum(Enums.PeriodType), |
||||
|
}, |
||||
|
{ name: 'code', label: $t('code'), type: 'text', required: true }, |
||||
|
{ name: 'name', label: $t('name'), type: 'text', required: true }, |
||||
|
{ name: 'valueType', label: $t('valueType'), required: true, type: 'select', options: Options.enum(Enums.ValueType) }, |
||||
|
{ name: 'description', label: $t('description'), type: 'text' }, |
||||
|
], |
||||
|
}, |
||||
|
}" |
||||
|
:viewer="{ |
||||
|
panel: { |
||||
|
columnNum: 1, |
||||
|
fields: [ |
||||
|
{ name: 'id', label: $t('id') }, |
||||
|
{ name: 'periodType', label: $t('period') }, |
||||
|
{ name: 'code', label: $t('code') }, |
||||
|
{ name: 'name', label: $t('name') }, |
||||
|
{ name: 'description', label: $t('description') }, |
||||
|
{ name: 'valueType', label: $t('valueType') }, |
||||
|
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
||||
|
{ name: 'creator', label: $t('creator') }, |
||||
|
{ name: 'createDate', label: $t('createDate') }, |
||||
|
{ name: 'lastModifier', label: $t('lastModifier') }, |
||||
|
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() }, |
||||
|
{ name: 'corporationCode', label: $t('corporationCode') }, |
||||
|
], |
||||
|
}, |
||||
|
}" |
||||
|
@row-click=" |
||||
|
(evt, row, index) => { |
||||
|
currentSelectedFactorType = row; |
||||
|
factorGridRef?.refresh(); |
||||
|
} |
||||
|
" |
||||
|
@before-request-data=" |
||||
|
() => { |
||||
|
currentSelectedFactorType = { id: '' }; |
||||
|
factorGridRef?.refresh(); |
||||
|
} |
||||
|
" |
||||
|
></w-grid> |
||||
|
</div> |
||||
|
</template> |
||||
|
<template #after> |
||||
|
<q-splitter :model-value="70" horizontal class="w-full" style="height: 100%"> |
||||
|
<template #before> |
||||
|
<div class="pl-1" style="height: 100%"> |
||||
|
<w-grid |
||||
|
ref="factorGridRef" |
||||
|
title="engine.st.factor.grid.title" |
||||
|
dense |
||||
|
:checkbox-selection="true" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/st/factor?factorType=' + currentSelectedFactorType.id)" |
||||
|
:data-url="Environment.apiContextPath('/api/st/factor')" |
||||
|
:pageable="false" |
||||
|
:sort-by="['year', 'quarter', 'month', 'day']" |
||||
|
:query-form-cols-num="4" |
||||
|
:query-form-fields="[]" |
||||
|
:toolbar-actions="['refresh', 'separator', 'add', 'clone', 'edit', 'remove', 'separator', 'view', 'separator', 'export']" |
||||
|
:columns="getFactorColumns" |
||||
|
:editor="{ |
||||
|
dialog: { |
||||
|
width: '600px', |
||||
|
}, |
||||
|
form: { |
||||
|
colsNum: 1, |
||||
|
fields: [ |
||||
|
{ |
||||
|
name: 'factorType', |
||||
|
label: $t('factorType'), |
||||
|
type: 'text', |
||||
|
defaultValue: currentSelectedFactorType.id, |
||||
|
}, |
||||
|
{ name: 'year', label: $t('year'), type: 'number', required: true }, |
||||
|
{ |
||||
|
name: 'quarter', |
||||
|
label: $t('quarter'), |
||||
|
type: 'number', |
||||
|
required: true, |
||||
|
showIf: () => { |
||||
|
return currentSelectedFactorType.periodType === 'QUARTER'; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
name: 'month', |
||||
|
label: $t('month'), |
||||
|
type: 'number', |
||||
|
required: true, |
||||
|
showIf: () => { |
||||
|
return currentSelectedFactorType.periodType === 'MONTH'; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
name: 'day', |
||||
|
label: $t('day'), |
||||
|
type: 'number', |
||||
|
required: true, |
||||
|
showIf: () => { |
||||
|
return currentSelectedFactorType.periodType === 'DAY'; |
||||
|
}, |
||||
|
}, |
||||
|
{ name: 'value', label: $t('value'), type: 'text', required: true }, |
||||
|
], |
||||
|
}, |
||||
|
}" |
||||
|
:viewer="{ |
||||
|
panel: { |
||||
|
columnNum: 1, |
||||
|
fields: [ |
||||
|
{ name: 'id', label: $t('id') }, |
||||
|
{ name: 'periodType', label: $t('period') }, |
||||
|
{ name: 'code', label: $t('code') }, |
||||
|
{ name: 'name', label: $t('name') }, |
||||
|
{ name: 'description', label: $t('description') }, |
||||
|
{ name: 'valueType', label: $t('valueType') }, |
||||
|
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
||||
|
{ name: 'creator', label: $t('creator') }, |
||||
|
{ name: 'createDate', label: $t('createDate') }, |
||||
|
{ name: 'lastModifier', label: $t('lastModifier') }, |
||||
|
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() }, |
||||
|
{ name: 'corporationCode', label: $t('corporationCode') }, |
||||
|
], |
||||
|
}, |
||||
|
}" |
||||
|
@after-request-data=" |
||||
|
() => { |
||||
|
const rows = factorGridRef.getRows(); |
||||
|
const xAxisData = []; |
||||
|
const seriesData = []; |
||||
|
for (const row of rows) { |
||||
|
xAxisData.push(row.year + '-' + row.month); |
||||
|
seriesData.push(row.value); |
||||
|
} |
||||
|
optionRef = { |
||||
|
xAxis: { |
||||
|
type: 'category', |
||||
|
data: xAxisData, |
||||
|
}, |
||||
|
yAxis: { |
||||
|
type: 'value', |
||||
|
}, |
||||
|
series: [ |
||||
|
{ |
||||
|
data: seriesData, |
||||
|
type: 'line', |
||||
|
smooth: true, |
||||
|
}, |
||||
|
], |
||||
|
}; |
||||
|
//factorEcharts.setOption(optionRef); |
||||
|
//console.log(optionRef); |
||||
|
} |
||||
|
" |
||||
|
></w-grid> |
||||
|
</div> |
||||
|
</template> |
||||
|
<template #after> |
||||
|
<w-echarts ref="factorEcharts" style="width: 100%; height: 100%" :option="optionRef"></w-echarts> |
||||
|
</template> |
||||
|
</q-splitter> |
||||
|
</template> |
||||
|
</q-splitter> |
||||
</template> |
</template> |
||||
<script setup lang="ts"> |
<script setup lang="ts"> |
||||
import { ref, reactive } from 'vue'; |
import { ref } from 'vue'; |
||||
import { axios, Environment, Downloader } from '@/platform'; |
import { useI18n } from 'vue-i18n'; |
||||
|
import { Environment, EnumTools, Formater, Options } from '@/platform'; |
||||
|
import { computed } from 'vue'; |
||||
|
|
||||
const echars = ref(); |
const { t } = useI18n(); |
||||
|
const factorTypeGridRef = ref(); |
||||
|
const factorGridRef = ref(); |
||||
|
const factorEcharts = ref(); |
||||
|
const currentSelectedFactorType = ref({}); |
||||
|
const optionRef = ref(); |
||||
|
const Enums = await EnumTools.fetch(['io.sc.engine.st.enums.Period', 'io.sc.engine.st.enums.ValueType']); |
||||
|
|
||||
const click = () => { |
const getFactorColumns = computed(() => { |
||||
option.title.text = 'OKKK'; |
let result = [{ width: '100%', name: 'value', label: t('value') }]; |
||||
echars.value.setOption(option); |
if (currentSelectedFactorType.value.periodType === 'YEAR') { |
||||
}; |
result = [ |
||||
|
{ width: 60, name: 'year', label: t('year'), align: 'right' }, |
||||
const option = { |
{ width: '100%', name: 'value', label: t('value') }, |
||||
animation: false, |
]; |
||||
title: { |
} else if (currentSelectedFactorType.value.periodType === 'QUARTER') { |
||||
text: 'KS 曲线', |
result = [ |
||||
left: 'center', |
{ width: 60, name: 'year', label: t('year'), align: 'right' }, |
||||
}, |
{ width: 60, name: 'quarter', label: t('quarter'), align: 'right' }, |
||||
grid: { |
{ width: '100%', name: 'value', label: t('value') }, |
||||
show: true, |
]; |
||||
containLabel: true, |
} else if (currentSelectedFactorType.value.periodType === 'MONTH') { |
||||
}, |
result = [ |
||||
legend: { |
{ width: 60, name: 'year', label: t('year'), align: 'right' }, |
||||
top: 30, |
{ width: 60, name: 'month', label: t('month'), align: 'right' }, |
||||
data: ['正常样本占比', '违约样本占比'], |
{ width: '100%', name: 'value', label: t('value') }, |
||||
}, |
]; |
||||
tooltip: {}, |
} else if (currentSelectedFactorType.value.periodType === 'DAY') { |
||||
xAxis: { |
result = [ |
||||
gridIndex: 0, |
{ width: 60, name: 'year', label: t('year'), align: 'right' }, |
||||
name: '评分', |
{ width: 60, name: 'month', label: t('month'), align: 'right' }, |
||||
nameLocation: 'middle', |
{ width: 60, name: 'day', label: t('day'), align: 'right' }, |
||||
nameGap: 30, |
{ width: '100%', name: 'value', label: t('value') }, |
||||
smooth: true, |
]; |
||||
boundaryGap: false, |
} |
||||
axisTick: { |
return result; |
||||
interval: 0, |
}); |
||||
}, |
|
||||
data: [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100], |
|
||||
}, |
|
||||
yAxis: { |
|
||||
gridIndex: 0, |
|
||||
name: '样本占比', |
|
||||
nameLocation: 'middle', |
|
||||
nameGap: 30, |
|
||||
smooth: false, |
|
||||
boundaryGap: false, |
|
||||
axisTick: { |
|
||||
interval: 0, |
|
||||
}, |
|
||||
data: null, |
|
||||
}, |
|
||||
series: [ |
|
||||
{ |
|
||||
name: '正常样本占比', |
|
||||
type: 'line', |
|
||||
barWidth: 0, |
|
||||
data: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.01, 0.15, 0.28, 0.36, 0.43, 0.49, 0.57, 0.66, 0.77, 0.91, 1.0], |
|
||||
}, |
|
||||
{ |
|
||||
name: '违约样本占比', |
|
||||
type: 'line', |
|
||||
barWidth: 0, |
|
||||
data: [ |
|
||||
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.037037, 0.08642, 0.609053, 0.662551, 0.707819, 0.720165, 0.769547, 0.814815, 0.855967, 0.897119, |
|
||||
0.962963, 1.0, |
|
||||
], |
|
||||
}, |
|
||||
], |
|
||||
}; |
|
||||
</script> |
</script> |
||||
|
@ -1,41 +1,250 @@ |
|||||
<template> |
<template> |
||||
<div> |
<q-splitter :model-value="60" class="w-full" style="height: 100%"> |
||||
<div class="fit row wrap justify-center items-start content-start q-pt-md q-gutter-md"> |
<template #before> |
||||
<q-input v-model="frontendWebContextPath" :label="$t('lcdp.frontend.export.frontendWebContextPath')" outlined dense style="width: 300px" /> |
<div class="pr-1" style="height: 100%"> |
||||
</div> |
<w-grid |
||||
<div class="fit row wrap justify-center items-start content-start q-pt-md q-gutter-md"> |
ref="factorTypeGridRef" |
||||
<q-input v-model="backendApiWebContextPath" :label="$t('lcdp.frontend.export.backendApiWebContextPath')" outlined dense style="width: 300px" /> |
:title="$t('engine.st.factorType.grid.title')" |
||||
</div> |
:checkbox-selection="true" |
||||
<div class="fit row wrap justify-center items-start content-start q-pt-md q-gutter-md"> |
:data-url="Environment.apiContextPath('/api/st/factorType')" |
||||
<q-btn :loading="loading" outlined :label="$t('lcdp.frontend.export')" @click="exportFrontend" /> |
:pageable="false" |
||||
</div> |
:sort-by="['code']" |
||||
</div> |
:query-form-cols-num="4" |
||||
|
:query-form-fields="[ |
||||
|
{ |
||||
|
name: 'periodType', |
||||
|
label: $t('period'), |
||||
|
type: 'select', |
||||
|
options: Options.enum(Enums.PeriodType), |
||||
|
queryOperator: 'equals', |
||||
|
}, |
||||
|
{ name: 'code', label: $t('code'), type: 'text' }, |
||||
|
{ name: 'name', label: $t('name'), type: 'text' }, |
||||
|
]" |
||||
|
:toolbar-actions="['query', 'separator', 'refresh', 'separator', 'add', 'clone', 'edit', 'remove', 'separator', 'view', 'separator', 'export']" |
||||
|
:columns="[ |
||||
|
{ width: 150, name: 'name', label: $t('name') }, |
||||
|
{ width: 100, name: 'code', label: $t('code') }, |
||||
|
{ width: 60, name: 'periodType', label: $t('engine.st.economicIndicator.grid.entity.periodType'), format: Formater.enum(Enums.PeriodType) }, |
||||
|
{ width: 100, name: 'description', label: $t('description') }, |
||||
|
{ width: 80, name: 'valueType', label: $t('valueType'), format: Formater.enum(Enums.ValueType) }, |
||||
|
]" |
||||
|
:editor="{ |
||||
|
dialog: { |
||||
|
width: '600px', |
||||
|
}, |
||||
|
form: { |
||||
|
colsNum: 1, |
||||
|
fields: [ |
||||
|
{ |
||||
|
name: 'periodType', |
||||
|
label: $t('period'), |
||||
|
required: true, |
||||
|
type: 'select', |
||||
|
options: Options.enum(Enums.PeriodType), |
||||
|
}, |
||||
|
{ name: 'code', label: $t('code'), type: 'text', required: true }, |
||||
|
{ name: 'name', label: $t('name'), type: 'text', required: true }, |
||||
|
{ name: 'valueType', label: $t('valueType'), required: true, type: 'select', options: Options.enum(Enums.ValueType) }, |
||||
|
{ name: 'description', label: $t('description'), type: 'text' }, |
||||
|
], |
||||
|
}, |
||||
|
}" |
||||
|
:viewer="{ |
||||
|
panel: { |
||||
|
columnNum: 1, |
||||
|
fields: [ |
||||
|
{ name: 'id', label: $t('id') }, |
||||
|
{ name: 'periodType', label: $t('period') }, |
||||
|
{ name: 'code', label: $t('code') }, |
||||
|
{ name: 'name', label: $t('name') }, |
||||
|
{ name: 'description', label: $t('description') }, |
||||
|
{ name: 'valueType', label: $t('valueType') }, |
||||
|
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
||||
|
{ name: 'creator', label: $t('creator') }, |
||||
|
{ name: 'createDate', label: $t('createDate') }, |
||||
|
{ name: 'lastModifier', label: $t('lastModifier') }, |
||||
|
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() }, |
||||
|
{ name: 'corporationCode', label: $t('corporationCode') }, |
||||
|
], |
||||
|
}, |
||||
|
}" |
||||
|
@row-click=" |
||||
|
(evt, row, index) => { |
||||
|
currentSelectedFactorType = row; |
||||
|
factorGridRef?.refresh(); |
||||
|
} |
||||
|
" |
||||
|
@before-request-data=" |
||||
|
() => { |
||||
|
currentSelectedFactorType = { id: '' }; |
||||
|
factorGridRef?.refresh(); |
||||
|
} |
||||
|
" |
||||
|
></w-grid> |
||||
|
</div> |
||||
|
</template> |
||||
|
<template #after> |
||||
|
<q-splitter :model-value="70" horizontal class="w-full" style="height: 100%"> |
||||
|
<template #before> |
||||
|
<div class="pl-1" style="height: 100%"> |
||||
|
<w-grid |
||||
|
ref="factorGridRef" |
||||
|
title="engine.st.factor.grid.title" |
||||
|
dense |
||||
|
:checkbox-selection="true" |
||||
|
:fetch-data-url="Environment.apiContextPath('/api/st/factor?factorType=' + currentSelectedFactorType.id)" |
||||
|
:data-url="Environment.apiContextPath('/api/st/factor')" |
||||
|
:pageable="false" |
||||
|
:sort-by="['year', 'quarter', 'month', 'day']" |
||||
|
:query-form-cols-num="4" |
||||
|
:query-form-fields="[]" |
||||
|
:toolbar-actions="['refresh', 'separator', 'add', 'clone', 'edit', 'remove', 'separator', 'view', 'separator', 'export']" |
||||
|
:columns="getFactorColumns" |
||||
|
:editor="{ |
||||
|
dialog: { |
||||
|
width: '600px', |
||||
|
}, |
||||
|
form: { |
||||
|
colsNum: 1, |
||||
|
fields: [ |
||||
|
{ |
||||
|
name: 'factorType', |
||||
|
label: $t('factorType'), |
||||
|
type: 'text', |
||||
|
defaultValue: currentSelectedFactorType.id, |
||||
|
}, |
||||
|
{ name: 'year', label: $t('year'), type: 'number', required: true }, |
||||
|
{ |
||||
|
name: 'quarter', |
||||
|
label: $t('quarter'), |
||||
|
type: 'number', |
||||
|
required: true, |
||||
|
showIf: () => { |
||||
|
return currentSelectedFactorType.periodType === 'QUARTER'; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
name: 'month', |
||||
|
label: $t('month'), |
||||
|
type: 'number', |
||||
|
required: true, |
||||
|
showIf: () => { |
||||
|
return currentSelectedFactorType.periodType === 'MONTH'; |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
name: 'day', |
||||
|
label: $t('day'), |
||||
|
type: 'number', |
||||
|
required: true, |
||||
|
showIf: () => { |
||||
|
return currentSelectedFactorType.periodType === 'DAY'; |
||||
|
}, |
||||
|
}, |
||||
|
{ name: 'value', label: $t('value'), type: 'text', required: true }, |
||||
|
], |
||||
|
}, |
||||
|
}" |
||||
|
:viewer="{ |
||||
|
panel: { |
||||
|
columnNum: 1, |
||||
|
fields: [ |
||||
|
{ name: 'id', label: $t('id') }, |
||||
|
{ name: 'periodType', label: $t('period') }, |
||||
|
{ name: 'code', label: $t('code') }, |
||||
|
{ name: 'name', label: $t('name') }, |
||||
|
{ name: 'description', label: $t('description') }, |
||||
|
{ name: 'valueType', label: $t('valueType') }, |
||||
|
{ name: 'dataComeFrom', label: $t('dataComeFrom') }, |
||||
|
{ name: 'creator', label: $t('creator') }, |
||||
|
{ name: 'createDate', label: $t('createDate') }, |
||||
|
{ name: 'lastModifier', label: $t('lastModifier') }, |
||||
|
{ name: 'lastModifyDate', label: $t('lastModifyDate'), format: Formater.none() }, |
||||
|
{ name: 'corporationCode', label: $t('corporationCode') }, |
||||
|
], |
||||
|
}, |
||||
|
}" |
||||
|
@after-request-data=" |
||||
|
() => { |
||||
|
const rows = factorGridRef.getRows(); |
||||
|
const xAxisData = []; |
||||
|
const seriesData = []; |
||||
|
for (const row of rows) { |
||||
|
xAxisData.push(row.year + '-' + row.month); |
||||
|
seriesData.push(row.value); |
||||
|
} |
||||
|
optionRef = { |
||||
|
xAxis: { |
||||
|
type: 'category', |
||||
|
data: xAxisData, |
||||
|
}, |
||||
|
yAxis: { |
||||
|
type: 'value', |
||||
|
}, |
||||
|
series: [ |
||||
|
{ |
||||
|
data: seriesData, |
||||
|
type: 'line', |
||||
|
smooth: true, |
||||
|
}, |
||||
|
], |
||||
|
}; |
||||
|
//factorEcharts.setOption(optionRef); |
||||
|
//console.log(optionRef); |
||||
|
} |
||||
|
" |
||||
|
></w-grid> |
||||
|
</div> |
||||
|
</template> |
||||
|
<template #after> |
||||
|
<w-echarts ref="factorEcharts" style="width: 100%; height: 100%" :option="optionRef"></w-echarts> |
||||
|
</template> |
||||
|
</q-splitter> |
||||
|
</template> |
||||
|
</q-splitter> |
||||
</template> |
</template> |
||||
<script setup lang="ts"> |
<script setup lang="ts"> |
||||
import { ref, reactive } from 'vue'; |
import { ref } from 'vue'; |
||||
import { axios, Environment, Downloader } from '@/platform'; |
import { useI18n } from 'vue-i18n'; |
||||
|
import { Environment, EnumTools, Formater, Options } from '@/platform'; |
||||
|
import { computed } from 'vue'; |
||||
|
|
||||
const frontendWebContextPath = ref('/'); |
const { t } = useI18n(); |
||||
const backendApiWebContextPath = ref('/'); |
const factorTypeGridRef = ref(); |
||||
const loading = ref(false); |
const factorGridRef = ref(); |
||||
const exportFileInfo = reactive({ filePath: '', exportName: '' }); |
const factorEcharts = ref(); |
||||
const exportFrontend = () => { |
const currentSelectedFactorType = ref({}); |
||||
loading.value = true; |
const optionRef = ref(); |
||||
axios |
const Enums = await EnumTools.fetch(['io.sc.engine.st.enums.Period', 'io.sc.engine.st.enums.ValueType']); |
||||
.post(Environment.apiContextPath('/api/mvc/frontend/export'), { |
|
||||
frontendWebContextPath: frontendWebContextPath.value, |
const getFactorColumns = computed(() => { |
||||
backendApiWebContextPath: backendApiWebContextPath.value, |
let result = [{ width: '100%', name: 'value', label: t('value') }]; |
||||
}) |
if (currentSelectedFactorType.value.periodType === 'YEAR') { |
||||
.then((response) => { |
result = [ |
||||
exportFileInfo.filePath = response.data.filePath; |
{ width: 60, name: 'year', label: t('year'), align: 'right' }, |
||||
exportFileInfo.exportName = response.data.exportName; |
{ width: '100%', name: 'value', label: t('value') }, |
||||
let url = Environment.apiContextPath('/api/mvc/download?'); |
]; |
||||
url += 'filePath=' + encodeURIComponent(exportFileInfo.filePath); |
} else if (currentSelectedFactorType.value.periodType === 'QUARTER') { |
||||
url += '&exportName=' + encodeURIComponent(exportFileInfo.exportName); |
result = [ |
||||
Downloader.get(url); |
{ width: 60, name: 'year', label: t('year'), align: 'right' }, |
||||
}) |
{ width: 60, name: 'quarter', label: t('quarter'), align: 'right' }, |
||||
.finally(() => { |
{ width: '100%', name: 'value', label: t('value') }, |
||||
loading.value = false; |
]; |
||||
}); |
} else if (currentSelectedFactorType.value.periodType === 'MONTH') { |
||||
}; |
result = [ |
||||
|
{ width: 60, name: 'year', label: t('year'), align: 'right' }, |
||||
|
{ width: 60, name: 'month', label: t('month'), align: 'right' }, |
||||
|
{ width: '100%', name: 'value', label: t('value') }, |
||||
|
]; |
||||
|
} else if (currentSelectedFactorType.value.periodType === 'DAY') { |
||||
|
result = [ |
||||
|
{ width: 60, name: 'year', label: t('year'), align: 'right' }, |
||||
|
{ width: 60, name: 'month', label: t('month'), align: 'right' }, |
||||
|
{ width: 60, name: 'day', label: t('day'), align: 'right' }, |
||||
|
{ width: '100%', name: 'value', label: t('value') }, |
||||
|
]; |
||||
|
} |
||||
|
return result; |
||||
|
}); |
||||
</script> |
</script> |
||||
|
Loading…
Reference in new issue