Browse Source

前端核心发布: 8.2.82

1) 增加 math 组件的数值函数和字符串函数,包括:乘法、除法、字符串替换、子串

基础框架发布: 8.2.19
  1) 规则引擎中,增加 math 组件的数值函数和字符串函数,包括:乘法、除法、字符串替换、子串
main
wangshaoping 4 days ago
parent
commit
4527f348ac
  1. 2
      cips.frontend/package.json
  2. 2
      erm.frontend/package.json
  3. 7
      gradle.properties
  4. 2
      io.sc.engine.mv.frontend/package.json
  5. 1
      io.sc.engine.rule.core/build.gradle
  6. 265
      io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/function/ArithmeticFunction.java
  7. 60
      io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/function/StringFunction.java
  8. 10
      io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/code/template/import_render.tpl
  9. 2
      io.sc.engine.rule.frontend/package.json
  10. 2905
      io.sc.engine.rule.server/src/main/resources/io/sc/engine/rule/server/sample/引擎示例(元数据).json
  11. 5962
      io.sc.engine.rule.server/src/main/resources/io/sc/engine/rule/server/sample/引擎示例.json
  12. 2
      io.sc.engine.st.frontend/package.json
  13. 2
      io.sc.platform.ai.frontend/package.json
  14. 2
      io.sc.platform.core.frontend/package.json
  15. 24
      io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/Digit.vue
  16. 24
      io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/String.vue
  17. 54
      io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/digit/Divide.vue
  18. 54
      io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/digit/Multiply.vue
  19. 4
      io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/digit/Pow.vue
  20. 6
      io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/digit/Root.vue
  21. 58
      io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/string/Replace.vue
  22. 52
      io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/string/Substring.vue
  23. 15
      io.sc.platform.core.frontend/src/platform/i18n/messages.json
  24. 15
      io.sc.platform.core.frontend/src/platform/i18n/messages_tw_CN.json
  25. 15
      io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json
  26. 4
      io.sc.platform.core.frontend/template-project/package.json
  27. 2
      io.sc.platform.developer.doc/package.json
  28. 2
      io.sc.platform.developer.frontend/package.json
  29. 2
      io.sc.platform.lcdp.frontend/package.json
  30. 2
      io.sc.platform.license.keygen.frontend/package.json
  31. 2
      io.sc.platform.mvc.frontend/package.json
  32. 2
      io.sc.platform.scheduler.manager.frontend/package.json
  33. 2
      io.sc.platform.system.frontend/package.json
  34. 2
      io.sc.standard.frontend/package.json
  35. 2
      io.sc.website/package.json
  36. 2
      wra.report.frontend/package.json

2
cips.frontend/package.json

@ -112,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.80",
"platform-core": "8.2.82",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
erm.frontend/package.json

@ -112,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.80",
"platform-core": "8.2.82",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

7
gradle.properties

@ -6,7 +6,7 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
org.gradle.configureondemand=true
systemProp.org.gradle.internal.publish.checksums.insecure=true
org.gradle.parallel=true
org.gradle.workers.max=4
org.gradle.workers.max=2
###########################################################
# Maven private repository configuration
@ -37,9 +37,9 @@ application_version=1.0.0
# platform
###########################################################
platform_group=io.sc
platform_version=8.2.18
platform_version=8.2.19
platform_plugin_version=8.2.10
platform_core_frontend_version=8.2.80
platform_core_frontend_version=8.2.82
###########################################################
# dependencies version
@ -47,6 +47,7 @@ platform_core_frontend_version=8.2.80
ai4j_version=1.2.0
asciidoctor_version=3.3.2
asm_version=9.7.1
big_math_version=2.3.2
checker_version=3.43.0
commons_compress_version=1.25.0
commons_fileupload_version=1.4

2
io.sc.engine.mv.frontend/package.json

@ -112,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.80",
"platform-core": "8.2.82",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

1
io.sc.engine.rule.core/build.gradle

@ -13,6 +13,7 @@ dependencies {
"org.slf4j:slf4j-api",
"org.freemarker:freemarker",
"com.jfinal:enjoy:${enjoy_version}",
"ch.obermuhlner:big-math:${big_math_version}",
"org.codehaus.groovy:groovy",
"org.codehaus.groovy:groovy-jsr223",

265
io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/function/ArithmeticFunction.java

@ -1,6 +1,11 @@
package io.sc.engine.rule.core.function;
import ch.obermuhlner.math.big.BigDecimalMath;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.util.Date;
import java.util.Random;
/**
@ -9,6 +14,16 @@ import java.util.Random;
*
*/
public class ArithmeticFunction {
/**
* 求余数
* @param x 被除数
* @param y 除数
* @return 余数
*/
public static Long mod(Number x, Number y){
return x.longValue() % y.longValue();
}
/**
* 获取一个 range 范围内的随机整数
* @param range 随机数范围
@ -18,20 +33,25 @@ public class ArithmeticFunction {
Random random =new Random();
return random.nextInt(range);
}
/**
* 求最大可比较值
* @param <T> 参数类型
* @param numbers 参数列表
* @return 最大可比较值
*/
@SafeVarargs
public static <T extends Comparable<T>> T max(T... numbers) {
public static <T extends Number> T max(T... numbers) {
T max =null;
if(numbers!=null) {
for(T number : numbers) {
if(number!=null) {
if(max!=null) {if(number.compareTo(max)>0) {max =number;} }else {max =number;}
if(max!=null) {
if(number.doubleValue()>max.doubleValue()) {
max =number;
}
}else {
max =number;
}
}
}
}
@ -45,12 +65,18 @@ public class ArithmeticFunction {
* @return 最小可比较值
*/
@SafeVarargs
public static <T extends Comparable<T>> T min(T... numbers) {
public static <T extends Number> T min(T... numbers) {
T min =null;
if(numbers!=null) {
for(T number : numbers) {
if(number!=null) {
if(min!=null) {if(number.compareTo(min)<0) {min =number;} }else {min =number;}
if(min!=null) {
if(number.doubleValue()<min.doubleValue()) {
min =number;
}
}else {
min =number;
}
}
}
}
@ -58,98 +84,193 @@ public class ArithmeticFunction {
}
/**
* 整数求和
* 求和
* @param numbers 其他参数列表
* @return
*/
public static Integer sum(Integer... numbers) {
Integer sum =null;
public static <T extends Number> BigDecimal sum(T... numbers) {
BigDecimal sum =new BigDecimal(0);
if(numbers!=null) {
for(Integer number : numbers) {
for(Number number : numbers) {
if(number!=null) {
if(sum!=null) { sum +=number;}else {sum =number;}
sum =sum.add(new BigDecimal(number.doubleValue()));
}
}
}
return sum;
}
/**
* 小数求和
* @param numbers 其他参数列表
* @return
*/
public static Long sum(Long... numbers) {
Long sum =null;
if(numbers!=null) {
for(Long number : numbers) {
if(number!=null) {
if(sum!=null) { sum +=number;}else {sum =number;}
}
}
}
return sum;
public static Double transformSequencing(Double value,Double sourceMin,Double sourceMax,Double targetMin,Double targetMax) {
return targetMin + ((value-sourceMin)/(sourceMax-sourceMin))*(targetMax-targetMin);
}
/**
* 小数求和
* @param numbers 其他参数列表
* @return
*/
public static Double sum(Double... numbers) {
Double sum =null;
if(numbers!=null) {
for(Double number : numbers) {
if(number!=null) {
if(sum!=null) { sum +=number;}else {sum =number;}
}
}
}
return sum;
public static BigDecimal multiply(Number x,Number y) {
return multiply(x,y,8,RoundingMode.HALF_UP);
}
/**
* 小数求和
* @param numbers 其他参数列表
* @return
*/
public static BigDecimal sum(BigDecimal... numbers) {
BigDecimal sum =null;
if(numbers!=null) {
for(BigDecimal number : numbers) {
if(number!=null) {
if(sum!=null) { sum=sum.add(number);}else {sum =number;}
}
}
public static BigDecimal multiply(Number x, Number y,int scale) {
return multiply(x,y,scale,RoundingMode.HALF_UP);
}
public static BigDecimal multiply(Number x, Number y, int scale, RoundingMode roundingMode) {
BigDecimal xx =new BigDecimal(x.toString());
BigDecimal yy =new BigDecimal(x.toString());
return xx.multiply(yy,new MathContext(scale,roundingMode));
}
public static BigDecimal divide(Number x,Number y) {
return divide(x,y,8,RoundingMode.HALF_UP);
}
public static BigDecimal divide(Number x, Number y,int scale) {
return divide(x,y,scale,RoundingMode.HALF_UP);
}
public static BigDecimal divide(Number x, Number y, int scale, RoundingMode roundingMode) {
BigDecimal xx =new BigDecimal(x.toString());
BigDecimal yy =new BigDecimal(x.toString());
return xx.divide(yy,scale,roundingMode);
}
public static BigDecimal pow(Number x, Number y) {
return pow(x,y,8,RoundingMode.HALF_UP);
}
public static BigDecimal pow(Number x, Number y, int scale) {
return pow(x,y,scale,RoundingMode.HALF_UP);
}
public static BigDecimal pow(Number x, Number y, int scale, RoundingMode roundingMode) {
BigDecimal xx =new BigDecimal(x.toString());
if(Long.class.isAssignableFrom(y.getClass())){
Long yy =Long.parseLong(y.toString());
return BigDecimalMath.pow(xx,yy,new MathContext(scale,roundingMode));
}else {
BigDecimal yy = new BigDecimal(y.toString());
return BigDecimalMath.pow(xx,yy,new MathContext(scale,roundingMode));
}
return sum;
}
public static Double transformSequencing(Double value,Double sourceMin,Double sourceMax,Double targetMin,Double targetMax) {
return targetMin + ((value-sourceMin)/(sourceMax-sourceMin))*(targetMax-targetMin);
public static BigDecimal exp(Number x) {
return exp(x,8,RoundingMode.HALF_UP);
}
public static BigDecimal exp(Number x, int scale) {
return exp(x,scale,RoundingMode.HALF_UP);
}
public static BigDecimal exp(Number x, int scale, RoundingMode roundingMode) {
BigDecimal xx =new BigDecimal(x.toString());
return BigDecimalMath.exp(xx,new MathContext(scale,roundingMode));
}
public static BigDecimal log(Number x, Number y) {
return log(x,y,8,RoundingMode.HALF_UP);
}
public static Double log(Double x, Double y){
return Math.log(y)/Math.log(x);
public static BigDecimal log(Number x, Number y, int scale) {
return log(x,y,scale,RoundingMode.HALF_UP);
}
public static Double lg(Double x){
return Math.log10(x);
public static BigDecimal log(Number x, Number y, int scale, RoundingMode roundingMode) {
BigDecimal xx =new BigDecimal(x.toString());
BigDecimal yy =new BigDecimal(y.toString());
BigDecimal numerator =BigDecimalMath.log(yy,new MathContext(scale + 6,roundingMode));
BigDecimal denominator =BigDecimalMath.log(xx,new MathContext(scale + 6,roundingMode));
return divide(numerator,denominator,scale,roundingMode);
}
public static Double ln(Double x){
return Math.log(x);
public static BigDecimal lg(Number x) {
return lg(x,8,RoundingMode.HALF_UP);
}
public static Double square(Double x) { return Math.pow(x,2); }
public static BigDecimal lg(Number x, int scale) {
return lg(x,scale,RoundingMode.HALF_UP);
}
public static BigDecimal lg(Number x, int scale, RoundingMode roundingMode) {
BigDecimal xx =new BigDecimal(x.toString());
return BigDecimalMath.log10(xx,new MathContext(scale,roundingMode));
}
public static BigDecimal ln(Number x) {
return ln(x,8,RoundingMode.HALF_UP);
}
public static BigDecimal ln(Number x, int scale) {
return ln(x,scale,RoundingMode.HALF_UP);
}
public static BigDecimal ln(Number x, int scale, RoundingMode roundingMode) {
BigDecimal xx =new BigDecimal(x.toString());
return BigDecimalMath.log(xx,new MathContext(scale,roundingMode));
}
public static BigDecimal square(Number x) {
return square(x,8,RoundingMode.HALF_UP);
}
public static Double root(Double x,Double y){
return Math.pow(x,1/y);
public static BigDecimal square(Number x, int scale) {
return square(x,scale,RoundingMode.HALF_UP);
}
public static Double div(Double x, Double y){
return x/y;
public static BigDecimal square(Number x, int scale, RoundingMode roundingMode) {
BigDecimal xx =new BigDecimal(x.toString());
return BigDecimalMath.pow(xx,2,new MathContext(scale,roundingMode));
}
public static Integer mod(Integer x, Integer y) { return x % y;}
public static BigDecimal root(Number x,Number y) {
return root(x,y,8,RoundingMode.HALF_UP);
}
public static BigDecimal root(Number x, Number y,int scale) {
return root(x,y,scale,RoundingMode.HALF_UP);
}
public static BigDecimal root(Number x, Number y, int scale, RoundingMode roundingMode) {
BigDecimal xx =new BigDecimal(x.toString());
BigDecimal yy =new BigDecimal(x.toString());
return BigDecimalMath.root(xx,yy,new MathContext(scale,roundingMode));
}
// public static Double log(Double x, Double y){
// return Math.log(y)/Math.log(x);
// }
// public static Double lg(Double x){
// return Math.log10(x);
// }
// public static Double ln(Double x){
// return Math.log(x);
// }
// public static Double square(Double x) { return Math.pow(x,2); }
//
// public static Double root(Double x,Double y){
// return Math.pow(x,1/y);
// }
//
// public static Double div(Double x, Double y){
// return x/y;
// }
//
// public static BigDecimal div(BigDecimal x, BigDecimal y){
// return x.divide(y,20, RoundingMode.HALF_UP);
// }
//
// public static BigDecimal div(BigDecimal x, BigDecimal y,int scale){
// return x.divide(y,scale, RoundingMode.HALF_UP);
// }
//
// public static BigDecimal div(BigDecimal x, BigDecimal y,int scale, RoundingMode roundingMode){
// return x.divide(y,scale, roundingMode);
// }
// public static Integer mod(Integer x, Integer y) { return x % y;}
//
// public static Long mod(Long x, Long y){
// return x % y;
// }
}

60
io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/function/StringFunction.java

@ -92,24 +92,60 @@ public class StringFunction {
return s1.endsWith(s2);
}
/**
* 返回字符串的子串
* @param string 字符串
* @param start 起始位置
* @return 字符串的子串
*/
public static String substring(String string, int start){
if(string==null){
return null;
}
return string.substring(start);
}
/**
* 返回字符串的子串
* @param string 字符串
* @param start 起始位置
* @param end 结束位置
* @return 字符串的子串
*/
public static String substring(String string, int start, int end){
if(string==null){
return null;
}
return string.substring(start,end);
}
/**
* 连接多个字符串
* @param join 连接符
* @param delimiter 连接符
* @param strings 需要连接的字符串数组
* @return 连接后的字符串
*/
public static String join(String join,String...strings) {
if(join==null) {
join ="";
public static String join(String delimiter,String...strings) {
if(strings==null || strings.length==0) {
return "";
}
StringBuilder sb =new StringBuilder();
if(strings!=null && strings.length>0) {
for(String s : strings) {
if(s!=null) {
sb.append(s).append(join);
}
}
if(delimiter==null) {
delimiter ="";
}
return String.join(delimiter,strings);
}
/**
* 字符串替换
* @param string 字符串
* @param target 需要被替换的子串
* @param replacement 替换字符串
* @return 替换后的字符串
*/
public static String replace(String string, CharSequence target, CharSequence replacement){
if(string==null){
return null;
}
return sb.toString();
return string.replace(target,replacement);
}
}

10
io.sc.engine.rule.core/src/main/resources/io/sc/engine/rule/core/code/template/import_render.tpl

@ -24,7 +24,10 @@ import java.util.Map;
import java.util.Random;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static io.sc.engine.rule.core.function.ArithmeticFunction.div;
import static io.sc.engine.rule.core.function.ArithmeticFunction.multiply;
import static io.sc.engine.rule.core.function.ArithmeticFunction.divide;
import static io.sc.engine.rule.core.function.ArithmeticFunction.exp;
import static io.sc.engine.rule.core.function.ArithmeticFunction.pow;
import static io.sc.engine.rule.core.function.ArithmeticFunction.lg;
import static io.sc.engine.rule.core.function.ArithmeticFunction.ln;
import static io.sc.engine.rule.core.function.ArithmeticFunction.log;
@ -54,7 +57,9 @@ import static io.sc.engine.rule.core.function.StringFunction.endsWith;
import static io.sc.engine.rule.core.function.StringFunction.join;
import static io.sc.engine.rule.core.function.StringFunction.length;
import static io.sc.engine.rule.core.function.StringFunction.lowerCase;
import static io.sc.engine.rule.core.function.StringFunction.replace;
import static io.sc.engine.rule.core.function.StringFunction.startsWith;
import static io.sc.engine.rule.core.function.StringFunction.substring;
import static io.sc.engine.rule.core.function.StringFunction.trim;
import static io.sc.engine.rule.core.function.StringFunction.upperCase;
import static io.sc.platform.util.CollectionUtil.hasElements;
@ -81,10 +86,7 @@ import static java.lang.Math.cbrt;
import static java.lang.Math.ceil;
import static java.lang.Math.cos;
import static java.lang.Math.cosh;
import static java.lang.Math.exp;
import static java.lang.Math.expm1;
import static java.lang.Math.floor;
import static java.lang.Math.pow;
import static java.lang.Math.random;
import static java.lang.Math.rint;
import static java.lang.Math.round;

2
io.sc.engine.rule.frontend/package.json

@ -112,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.80",
"platform-core": "8.2.82",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2905
io.sc.engine.rule.server/src/main/resources/io/sc/engine/rule/server/sample/引擎示例(元数据).json

File diff suppressed because it is too large

5962
io.sc.engine.rule.server/src/main/resources/io/sc/engine/rule/server/sample/引擎示例.json

File diff suppressed because one or more lines are too long

2
io.sc.engine.st.frontend/package.json

@ -112,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.80",
"platform-core": "8.2.82",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.platform.ai.frontend/package.json

@ -112,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.80",
"platform-core": "8.2.82",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.platform.core.frontend/package.json

@ -1,6 +1,6 @@
{
"name": "platform-core",
"version": "8.2.80",
"version": "8.2.82",
"description": "前端核心包,用于快速构建前端的脚手架",
"//main": "库的主文件",
"main": "dist/platform-core.js",

24
io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/Digit.vue

@ -19,6 +19,26 @@
<q-item-section><Abs ref="absRef" v-model="modelValueRef" :source-code-editor="sourceCodeEditor"></Abs></q-item-section>
</q-item>
<q-separator inset spaced />
<q-item
v-close-popup
clickable
:title="$t('math.toolbar.functions.number.multiply')"
draggable="true"
@dragstart="multiplyRef?.dragstart"
@click="multiplyRef?.append"
>
<q-item-section><Multiply ref="multiplyRef" v-model="modelValueRef" :source-code-editor="sourceCodeEditor"></Multiply></q-item-section>
</q-item>
<q-item
v-close-popup
clickable
:title="$t('math.toolbar.functions.number.divide')"
draggable="true"
@dragstart="divideRef?.dragstart"
@click="divideRef?.append"
>
<q-item-section><Divide ref="divideRef" v-model="modelValueRef" :source-code-editor="sourceCodeEditor"></Divide></q-item-section>
</q-item>
<q-item
v-close-popup
clickable
@ -190,6 +210,8 @@
<script setup lang="ts">
import { ref } from 'vue';
import Abs from './digit/Abs.vue';
import Multiply from './digit/Multiply.vue';
import Divide from './digit/Divide.vue';
import Square from './digit/Square.vue';
import Pow from './digit/Pow.vue';
import Exp from './digit/Exp.vue';
@ -213,6 +235,8 @@ const props = defineProps({
});
const absRef = ref();
const multiplyRef = ref();
const divideRef = ref();
const squareRef = ref();
const powRef = ref();
const expRef = ref();

24
io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/String.vue

@ -90,6 +90,26 @@
>
<q-item-section><Join ref="joinRef" v-model="modelValueRef" :source-code-editor="sourceCodeEditor"></Join></q-item-section>
</q-item>
<q-item
v-close-popup
clickable
:title="$t('math.toolbar.functions.string.substring')"
draggable="true"
@dragstart="substringRef?.dragstart"
@click="substringRef?.append"
>
<q-item-section><Substring ref="substringRef" v-model="modelValueRef" :source-code-editor="sourceCodeEditor"></Substring></q-item-section>
</q-item>
<q-item
v-close-popup
clickable
:title="$t('math.toolbar.functions.string.replace')"
draggable="true"
@dragstart="replaceRef?.dragstart"
@click="replaceRef?.append"
>
<q-item-section><Replace ref="replaceRef" v-model="modelValueRef" :source-code-editor="sourceCodeEditor"></Replace></q-item-section>
</q-item>
</q-list>
</q-menu>
</q-item>
@ -104,6 +124,8 @@ import Contains from './string/Contains.vue';
import StartsWith from './string/StartsWith.vue';
import EndsWith from './string/EndsWith.vue';
import Join from './string/Join.vue';
import Substring from './string/Substring.vue';
import Replace from './string/Replace.vue';
const modelValueRef = defineModel({ type: String, default: '' });
const props = defineProps({
@ -118,4 +140,6 @@ const containsRef = ref();
const startsWithRef = ref();
const endsWithRef = ref();
const joinRef = ref();
const substringRef = ref();
const replaceRef = ref();
</script>

54
io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/digit/Divide.vue

@ -0,0 +1,54 @@
<template>
<span>
<math display="inline">
<mspace></mspace>
<mrow>
<mo>divide</mo>
<mi>(</mi>
<mi>x</mi>
<mo>,</mo>
<mi>y</mi>
<mi>)</mi>
</mrow>
<mspace></mspace>
</math>
</span>
</template>
<script setup lang="ts">
const xmlData = `
<mspace></mspace>
<mrow>
<mo>divide</mo>
<mi>(</mi>
<mspace></mspace>
<mi>x</mi>
<mspace></mspace>
<mo>,</mo>
<mspace></mspace>
<mi>y</mi>
<mspace></mspace>
<mi>)</mi>
</mrow>
<mspace></mspace>
`;
const modelValueRef = defineModel({ type: String, default: '' });
const props = defineProps({
sourceCodeEditor: { type: Object, default: undefined },
});
const dragstart = (event) => {
event.dataTransfer.setData('math', xmlData);
event.dataTransfer.setDragImage(event.srcElement, 0, 0);
};
const append = () => {
props.sourceCodeEditor?.dispatch(props.sourceCodeEditor?.state?.replaceSelection('divide(x,y)'));
modelValueRef.value = modelValueRef.value + xmlData.replace('<mspace></mspace>', '');
};
defineExpose({
dragstart,
append,
});
</script>

54
io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/digit/Multiply.vue

@ -0,0 +1,54 @@
<template>
<span>
<math display="inline">
<mspace></mspace>
<mrow>
<mo>multiply</mo>
<mi>(</mi>
<mi>x</mi>
<mo>,</mo>
<mi>y</mi>
<mi>)</mi>
</mrow>
<mspace></mspace>
</math>
</span>
</template>
<script setup lang="ts">
const xmlData = `
<mspace></mspace>
<mrow>
<mo>multiply</mo>
<mi>(</mi>
<mspace></mspace>
<mi>x</mi>
<mspace></mspace>
<mo>,</mo>
<mspace></mspace>
<mi>y</mi>
<mspace></mspace>
<mi>)</mi>
</mrow>
<mspace></mspace>
`;
const modelValueRef = defineModel({ type: String, default: '' });
const props = defineProps({
sourceCodeEditor: { type: Object, default: undefined },
});
const dragstart = (event) => {
event.dataTransfer.setData('math', xmlData);
event.dataTransfer.setDragImage(event.srcElement, 0, 0);
};
const append = () => {
props.sourceCodeEditor?.dispatch(props.sourceCodeEditor?.state?.replaceSelection('multiply(x,y)'));
modelValueRef.value = modelValueRef.value + xmlData.replace('<mspace></mspace>', '');
};
defineExpose({
dragstart,
append,
});
</script>

4
io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/digit/Pow.vue

@ -20,9 +20,13 @@ const xmlData = `
<mrow>
<mo>pow</mo>
<mi>(</mi>
<mspace></mspace>
<mi>x</mi>
<mspace></mspace>
<mo>,</mo>
<mspace></mspace>
<mi>y</mi>
<mspace></mspace>
<mi>)</mi>
</mrow>
<mspace></mspace>

6
io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/digit/Root.vue

@ -20,9 +20,13 @@ const xmlData = `
<mrow>
<mo>root</mo>
<mi>(</mi>
<mspace></mspace>
<mi>x</mi>
<mspace></mspace>
<mo>,</mo>
<mspace></mspace>
<mi>y</mi>
<mspace></mspace>
<mi>)</mi>
</mrow>
<mspace></mspace>
@ -39,7 +43,7 @@ const dragstart = (event) => {
};
const append = () => {
props.sourceCodeEditor?.dispatch(props.sourceCodeEditor?.state?.replaceSelection('root(x)'));
props.sourceCodeEditor?.dispatch(props.sourceCodeEditor?.state?.replaceSelection('root(x,y)'));
modelValueRef.value = modelValueRef.value + xmlData.replace('<mspace></mspace>', '');
};

58
io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/string/Replace.vue

@ -0,0 +1,58 @@
<template>
<span>
<math display="inline">
<mrow>
<mo>replace</mo>
<mi>(</mi>
<mi>x</mi>
<mo>,</mo>
<mi>t</mi>
<mo>,</mo>
<mi>r</mi>
<mi>)</mi>
</mrow>
</math>
</span>
</template>
<script setup lang="ts">
const xmlData = `
<mspace></mspace>
<mrow>
<mo>replace</mo>
<mi>(</mi>
<mspace></mspace>
<mi>x</mi>
<mspace></mspace>
<mo>,</mo>
<mspace></mspace>
<mi>t</mi>
<mspace></mspace>
<mo>,</mo>
<mspace></mspace>
<mi>r</mi>
<mspace></mspace>
<mi>)</mi>
</mrow>
<mspace></mspace>
`;
const modelValueRef = defineModel({ type: String, default: '' });
const props = defineProps({
sourceCodeEditor: { type: Object, default: undefined },
});
const dragstart = (event) => {
event.dataTransfer.setData('math', xmlData);
event.dataTransfer.setDragImage(event.srcElement, 0, 0);
};
const append = () => {
props.sourceCodeEditor?.dispatch(props.sourceCodeEditor?.state?.replaceSelection('replace(x,t,r)'));
modelValueRef.value = modelValueRef.value + xmlData.replace('<mspace></mspace>', '');
};
defineExpose({
dragstart,
append,
});
</script>

52
io.sc.platform.core.frontend/src/platform/components/math/toolbar/functions/string/Substring.vue

@ -0,0 +1,52 @@
<template>
<span>
<math display="inline">
<mrow>
<mo>substring</mo>
<mi>(</mi>
<mi>x</mi>
<mo>,</mo>
<mi>start</mi>
<mi>)</mi>
</mrow>
</math>
</span>
</template>
<script setup lang="ts">
const xmlData = `
<mspace></mspace>
<mrow>
<mo>substring</mo>
<mi>(</mi>
<mspace></mspace>
<mi>x</mi>
<mspace></mspace>
<mo>,</mo>
<mspace></mspace>
<mi>start</mi>
<mspace></mspace>
<mi>)</mi>
</mrow>
<mspace></mspace>
`;
const modelValueRef = defineModel({ type: String, default: '' });
const props = defineProps({
sourceCodeEditor: { type: Object, default: undefined },
});
const dragstart = (event) => {
event.dataTransfer.setData('math', xmlData);
event.dataTransfer.setDragImage(event.srcElement, 0, 0);
};
const append = () => {
props.sourceCodeEditor?.dispatch(props.sourceCodeEditor?.state?.replaceSelection('substring(x,start)'));
modelValueRef.value = modelValueRef.value + xmlData.replace('<mspace></mspace>', '');
};
defineExpose({
dragstart,
append,
});
</script>

15
io.sc.platform.core.frontend/src/platform/i18n/messages.json

@ -202,11 +202,13 @@
"math.toolbar.functions.specialValue.infinite": "Infinite, when x is infinite, return y; else return x",
"math.toolbar.functions.number": "Number",
"math.toolbar.functions.number.abs": "Absolute value",
"math.toolbar.functions.number.square": "square to x",
"math.toolbar.functions.number.pow": "(y)th power of x",
"math.toolbar.functions.number.exp": "(x)th power of e",
"math.toolbar.functions.number.sqrt": "square root of x",
"math.toolbar.functions.number.root": "(y)th root of x",
"math.toolbar.functions.number.multiply": "x multiply y. default scale is 8, you can set scale like multiply(x,y,scale) or multiply(x,y,scale,RoundingMode)",
"math.toolbar.functions.number.divide": "x divide y. default scale is 8, you can set scale like divide(x,y,scale) or divide(x,y,scale,RoundingMode)",
"math.toolbar.functions.number.square": "square to x. default scale is 8, you can set scale like square(x,scale) or square(x,scale,RoundingMode)",
"math.toolbar.functions.number.pow": "(y)th power of x. default scale is 8, you can set scale like pow(x,y,scale) or pow(x,y,scale,RoundingMode)",
"math.toolbar.functions.number.exp": "(x)th power of e. default scale is 8, you can set scale like exp(x,scale) or exp(x,scale,RoundingMode)",
"math.toolbar.functions.number.sqrt": "square root of x. default scale is 8, you can set scale like sqrt(x,scale) or sqrt(x,scale,RoundingMode)",
"math.toolbar.functions.number.root": "(y)th root of x. default scale is 8, you can set scale like root(x,y,scale) or root(x,y,scale,RoundingMode)",
"math.toolbar.functions.number.max": "Maximum",
"math.toolbar.functions.number.min": "Minimum",
"math.toolbar.functions.number.sum": "Summation",
@ -226,6 +228,9 @@
"math.toolbar.functions.string.contains": "x contains y",
"math.toolbar.functions.string.startsWith": "x start with y",
"math.toolbar.functions.string.endsWith": "x end with y",
"math.toolbar.functions.string.substring": "Sub string of x. substring(x,start) 或 substring(x,start,end)",
"math.toolbar.functions.string.join": "concat a,b...n with x. join('-','a'): 'a'; join('-','a','b'): 'a-b'; join('-','a','b','c'): 'a-b-c'",
"math.toolbar.functions.string.replace": "replace t with r in x. replace('abc','a','x'): 'xbc'; join('abc','ab','de'): 'dec';",
"math.toolbar.functions.date": "Date",
"math.toolbar.functions.date.now": "Now",
"math.toolbar.functions.date.between": "Between",

15
io.sc.platform.core.frontend/src/platform/i18n/messages_tw_CN.json

@ -202,11 +202,13 @@
"math.toolbar.functions.specialValue.infinite": "無窮處理, 當 x 為無窮時, 返回 y; 否則返回 x",
"math.toolbar.functions.number": "數值處理函數",
"math.toolbar.functions.number.abs": "絕對值",
"math.toolbar.functions.number.square": "x 的平方",
"math.toolbar.functions.number.pow": "x 的 y 次冪",
"math.toolbar.functions.number.exp": "e 的 x 冪",
"math.toolbar.functions.number.sqrt": "x 的平方根",
"math.toolbar.functions.number.root": "x 的 y 次方根",
"math.toolbar.functions.number.multiply": "x 乘以 y. 默認精度為 8 位, 可自定義精度: multiply(x,y,scale) 或 multiply(x,y,scale,RoundingMode)",
"math.toolbar.functions.number.divide": "x 除以 y. 默認精度為 8 位, 可自定義精度: divide(x,y,scale) 或 divide(x,y,scale,RoundingMode)",
"math.toolbar.functions.number.square": "x 的平方. 默認精度為 8 位, 可自定義精度: square(x,scale) 或 square(x,scale,RoundingMode)",
"math.toolbar.functions.number.pow": "x 的 y 次冪. 默認精度為 8 位, 可自定義精度: pow(x,y,scale) 或 pow(x,y,scale,RoundingMode)",
"math.toolbar.functions.number.exp": "e 的 x 冪. 默認精度為 8 位, 可自定義精度: exp(x,scale) 或 exp(x,scale,RoundingMode)",
"math.toolbar.functions.number.sqrt": "x 的平方根. 默認精度為 8 位, 可自定義精度: sqrt(x,scale) 或 sqrt(x,scale,RoundingMode)",
"math.toolbar.functions.number.root": "x 的 y 次方根. 默認精度為 8 位, 可自定義精度: root(x,y,scale) 或 root(x,y,scale,RoundingMode)",
"math.toolbar.functions.number.max": "最大值",
"math.toolbar.functions.number.min": "最小值",
"math.toolbar.functions.number.sum": "求和",
@ -226,6 +228,9 @@
"math.toolbar.functions.string.contains": "是否 x 包含 y",
"math.toolbar.functions.string.startsWith": "x 是否以 y 開頭",
"math.toolbar.functions.string.endsWith": "x 是否以 y 結尾",
"math.toolbar.functions.string.substring": "x 的子串. substring(x,start) 或 substring(x,start,end)",
"math.toolbar.functions.string.join": "採用 x 連接 a,b...n. join('-','a'): 'a'; join('-','a','b'): 'a-b'; join('-','a','b','c'): 'a-b-c'",
"math.toolbar.functions.string.replace": "用 r 替換 x 中的 t. replace('abc','a','x'): 'xbc'; join('abc','ab','de'): 'dec';",
"math.toolbar.functions.date": "日期函數",
"math.toolbar.functions.date.now": "當前日期",
"math.toolbar.functions.date.between": "日期間隔",

15
io.sc.platform.core.frontend/src/platform/i18n/messages_zh_CN.json

@ -202,11 +202,13 @@
"math.toolbar.functions.specialValue.infinite": "无穷处理, 当 x 为无穷时, 返回 y; 否则返回 x",
"math.toolbar.functions.number": "数值处理函数",
"math.toolbar.functions.number.abs": "绝对值",
"math.toolbar.functions.number.square": "x 的平方",
"math.toolbar.functions.number.pow": "x 的 y 次幂",
"math.toolbar.functions.number.exp": "e 的 x 幂",
"math.toolbar.functions.number.sqrt": "x 的平方根",
"math.toolbar.functions.number.root": "x 的 y 次方根",
"math.toolbar.functions.number.multiply": "x 乘以 y. 默认精度为 8 位, 可自定义精度: multiply(x,y,scale) 或 multiply(x,y,scale,RoundingMode)",
"math.toolbar.functions.number.divide": "x 除以 y. 默认精度为 8 位, 可自定义精度: divide(x,y,scale) 或 divide(x,y,scale,RoundingMode)",
"math.toolbar.functions.number.square": "x 的平方. 默认精度为 8 位, 可自定义精度: square(x,scale) 或 square(x,scale,RoundingMode)",
"math.toolbar.functions.number.pow": "x 的 y 次幂. 默认精度为 8 位, 可自定义精度: pow(x,y,scale) 或 pow(x,y,scale,RoundingMode)",
"math.toolbar.functions.number.exp": "e 的 x 幂. 默认精度为 8 位, 可自定义精度: exp(x,scale) 或 exp(x,scale,RoundingMode)",
"math.toolbar.functions.number.sqrt": "x 的平方根. 默认精度为 8 位, 可自定义精度: sqrt(x,scale) 或 sqrt(x,scale,RoundingMode)",
"math.toolbar.functions.number.root": "x 的 y 次方根. 默认精度为 8 位, 可自定义精度: root(x,y,scale) 或 root(x,y,scale,RoundingMode)",
"math.toolbar.functions.number.max": "最大值",
"math.toolbar.functions.number.min": "最小值",
"math.toolbar.functions.number.sum": "求和",
@ -226,6 +228,9 @@
"math.toolbar.functions.string.contains": "是否 x 包含 y",
"math.toolbar.functions.string.startsWith": "x 是否以 y 开头",
"math.toolbar.functions.string.endsWith": "x 是否以 y 结尾",
"math.toolbar.functions.string.substring": "x 的子串. substring(x,start) 或 substring(x,start,end)",
"math.toolbar.functions.string.join": "采用 x 连接 a,b...n. join('-','a'): 'a'; join('-','a','b'): 'a-b'; join('-','a','b','c'): 'a-b-c'",
"math.toolbar.functions.string.replace": "用 r 替换 x 中的 t. replace('abc','a','x'): 'xbc'; join('abc','ab','de'): 'dec';",
"math.toolbar.functions.date": "日期函数",
"math.toolbar.functions.date.now": "当前日期",
"math.toolbar.functions.date.between": "日期间隔",

4
io.sc.platform.core.frontend/template-project/package.json

@ -1,6 +1,6 @@
{
"name": "platform-core",
"version": "8.2.80",
"version": "8.2.82",
"description": "前端核心包,用于快速构建前端的脚手架",
"private": false,
"keywords": [],
@ -111,7 +111,7 @@
"mockjs": "1.1.0",
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"platform-core": "8.2.80",
"platform-core": "8.2.82",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.platform.developer.doc/package.json

@ -28,7 +28,7 @@
"vuepress": "2.0.0-rc.15"
},
"dependencies": {
"platform-core": "8.2.80",
"platform-core": "8.2.82",
"quasar": "2.17.6",
"vue": "3.5.13",
"vue-i18n": "11.0.1"

2
io.sc.platform.developer.frontend/package.json

@ -112,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.80",
"platform-core": "8.2.82",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.platform.lcdp.frontend/package.json

@ -112,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.80",
"platform-core": "8.2.82",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.platform.license.keygen.frontend/package.json

@ -112,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.80",
"platform-core": "8.2.82",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.platform.mvc.frontend/package.json

@ -112,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.80",
"platform-core": "8.2.82",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.platform.scheduler.manager.frontend/package.json

@ -112,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.80",
"platform-core": "8.2.82",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.platform.system.frontend/package.json

@ -111,7 +111,7 @@
"mockjs": "1.1.0",
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"platform-core": "8.2.80",
"platform-core": "8.2.82",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.standard.frontend/package.json

@ -112,7 +112,7 @@
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"pinia-undo": "0.2.4",
"platform-core": "8.2.80",
"platform-core": "8.2.82",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

2
io.sc.website/package.json

@ -28,6 +28,6 @@
},
"dependencies": {
"vue": "3.5.13",
"platform-core": "8.2.80"
"platform-core": "8.2.82"
}
}

2
wra.report.frontend/package.json

@ -111,7 +111,7 @@
"mockjs": "1.1.0",
"node-sql-parser": "5.3.6",
"pinia": "2.3.0",
"platform-core": "8.2.80",
"platform-core": "8.2.82",
"quasar": "2.17.6",
"sort-array": "5.0.0",
"svg-path-commander": "2.1.7",

Loading…
Cancel
Save