diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/function/ArithmeticFunction.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/function/ArithmeticFunction.java new file mode 100644 index 00000000..d69c45bf --- /dev/null +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/function/ArithmeticFunction.java @@ -0,0 +1,131 @@ +package io.sc.engine.rule.core.function; + +import java.math.BigDecimal; +import java.util.Random; + +/** + * 算数函数 + * @author wangshaoping + * + */ +public class ArithmeticFunction { + /** + * 获取一个 range 范围内的随机整数 + * @param range 随机数范围 + * @return 随机数 + */ + public static int randomInt(int range) { + Random random =new Random(); + return random.nextInt(range); + } + + /** + * 求最大可比较值 + * @param 参数类型 + * @param numbers 参数列表 + * @return 最大可比较值 + */ + @SafeVarargs + public static > 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;} + } + } + } + return max; + } + + /** + * 求最小可比较值 + * @param 参数类型 + * @param numbers 参数列表 + * @return 最小可比较值 + */ + @SafeVarargs + public static > 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;} + } + } + } + return min; + } + + /** + * 整数求和 + * @param numbers 其他参数列表 + * @return 和 + */ + public static Integer sum(Integer... numbers) { + Integer sum =null; + if(numbers!=null) { + for(Integer number : numbers) { + if(number!=null) { + if(sum!=null) { sum +=number;}else {sum =number;} + } + } + } + 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; + } + + /** + * 小数求和 + * @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; + } + + /** + * 小数求和 + * @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;} + } + } + } + return sum; + } + + public static Double transformSequencing(Double value,Double sourceMin,Double sourceMax,Double targetMin,Double targetMax) { + return targetMin + ((value-sourceMin)/(sourceMax-sourceMin))*(targetMax-targetMin); + } +} diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/lib/processor/ArithmeticIndicatorProcessor.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/lib/processor/ArithmeticIndicatorProcessor.java new file mode 100644 index 00000000..ce9f0932 --- /dev/null +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/lib/processor/ArithmeticIndicatorProcessor.java @@ -0,0 +1,31 @@ +package io.sc.engine.rule.core.po.lib.processor; + +import io.sc.engine.rule.core.enums.ProcessorType; +import io.sc.engine.rule.core.po.lib.IndicatorProcessor; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 指标处理器(算数运算操作) + * @author wangshaoping + * + */ +@JsonTypeName("ARITHMETIC") +@JsonIgnoreProperties(ignoreUnknown=true) +public class ArithmeticIndicatorProcessor extends IndicatorProcessor { + private String arithmetic;//算数表达式 + + @Override + public ProcessorType getType() { + return ProcessorType.ARITHMETIC; + } + + public String getArithmetic() { + return arithmetic; + } + + public void setArithmetic(String arithmetic) { + this.arithmetic = arithmetic; + } +} diff --git a/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/processor/ArithmeticParameterProcessor.java b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/processor/ArithmeticParameterProcessor.java new file mode 100644 index 00000000..e3b0afd6 --- /dev/null +++ b/io.sc.engine.rule.core/src/main/java/io/sc/engine/rule/core/po/model/processor/ArithmeticParameterProcessor.java @@ -0,0 +1,31 @@ +package io.sc.engine.rule.core.po.model.processor; + +import io.sc.engine.rule.core.enums.ProcessorType; +import io.sc.engine.rule.core.po.model.ParameterProcessor; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonTypeName; + +/** + * 模型参数处理器(算数运算操作) + * @author wangshaoping + * + */ +@JsonTypeName("ARITHMETIC") +@JsonIgnoreProperties(ignoreUnknown=true) +public class ArithmeticParameterProcessor extends ParameterProcessor { + private String arithmetic;//算数表达式 + + @Override + public ProcessorType getType() { + return ProcessorType.ARITHMETIC; + } + + public String getArithmetic() { + return arithmetic; + } + + public void setArithmetic(String arithmetic) { + this.arithmetic = arithmetic; + } +} diff --git a/io.sc.engine.rule.frontend/.browserslistrc b/io.sc.engine.rule.frontend/.browserslistrc new file mode 100644 index 00000000..1fff95c5 --- /dev/null +++ b/io.sc.engine.rule.frontend/.browserslistrc @@ -0,0 +1,5 @@ +chrome >=89 +edge >=88 +firefox >=89 +safari >=15 +ios_saf >=15 \ No newline at end of file diff --git a/io.sc.engine.rule.frontend/.editorconfig b/io.sc.engine.rule.frontend/.editorconfig new file mode 100644 index 00000000..2791f744 --- /dev/null +++ b/io.sc.engine.rule.frontend/.editorconfig @@ -0,0 +1,14 @@ +################################################################# +# 强制对使用该基本代码的所有人实施一致的编码样式 +################################################################# + +# 顶级配置(即不集成父配置) +root = true + +# 针对所有文件 +[*] +charset = utf-8 # 字符集: utf-8 +indent_size = 2 # 缩进大小: 2 +indent_style = space # 缩进风格: 空格 +insert_final_newline = true # 是否在文件的最后插入一个空行 +trim_trailing_whitespace = true # 是否删除行尾的空格 diff --git a/io.sc.engine.rule.frontend/.eslintrc.cjs b/io.sc.engine.rule.frontend/.eslintrc.cjs new file mode 100644 index 00000000..181a97a6 --- /dev/null +++ b/io.sc.engine.rule.frontend/.eslintrc.cjs @@ -0,0 +1,36 @@ +module.exports = { + root: true, + + env: { + browser: true, + es2022: true, + "vue/setup-compiler-macros": true, + }, + + parserOptions:{ + ecmaVersion: 2022, + sourceType:"module", + }, + + extends:[ + "eslint:recommended", + "plugin:vue/vue3-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:prettier/recommended", + ], + + parser: "vue-eslint-parser", + parserOptions: { + ecmaVersion: 2022, + parser: "@typescript-eslint/parser", + sourceType: "module", + }, + + rules:{ + 'semi':[1], + '@typescript-eslint/no-var-requires': 'off', + '@typescript-eslint/no-explicit-any': 'off', + "@typescript-eslint/no-unused-vars": 'off', + 'vue/multi-word-component-names': 'off', /* 禁用 vue 组件名称检查规则 */ + }, +}; diff --git a/io.sc.engine.rule.frontend/.gitignore b/io.sc.engine.rule.frontend/.gitignore new file mode 100644 index 00000000..719bf30c --- /dev/null +++ b/io.sc.engine.rule.frontend/.gitignore @@ -0,0 +1,31 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +coverage +*.local + +/cypress/videos/ +/cypress/screenshots/ + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +test-results/ +playwright-report/ diff --git a/io.sc.engine.rule.frontend/.npmignore b/io.sc.engine.rule.frontend/.npmignore new file mode 100644 index 00000000..e69de29b diff --git a/io.sc.engine.rule.frontend/.npmrc b/io.sc.engine.rule.frontend/.npmrc new file mode 100644 index 00000000..c1c0b295 --- /dev/null +++ b/io.sc.engine.rule.frontend/.npmrc @@ -0,0 +1,11 @@ +# npm 仓库地址, 在 npm install 时使用 +registry=http://nexus.sc.io:8000/repository/npm-public/ + +# 用户邮箱 +email= + +# 注意: 以下 // 不是注释,不能去掉哦 +# 登录 npm 仓库的用户认证信息, 在 npm publish 时使用, publish 的 npm registry 在 package.json 文件中 publishConfig 部分配置 +# _authToken 可通过以下命令获取 +# curl -X PUT -H "Content-Type:application/json" -d '{"_id":"org.couchdb.user:admin","name":"admin","password":"admin"}' http://nexus.sc.io:8000/repository/npm-releases/-/user/org.couchdb.user:admin +//nexus.sc.io:8000/repository/npm-releases/:_authToken=NpmToken.193db44c-7ca5-3cb6-a990-d24b93fb0d10 \ No newline at end of file diff --git a/io.sc.engine.rule.frontend/.prettierignore b/io.sc.engine.rule.frontend/.prettierignore new file mode 100644 index 00000000..b5c08636 --- /dev/null +++ b/io.sc.engine.rule.frontend/.prettierignore @@ -0,0 +1,3 @@ +build +dist +node_modules \ No newline at end of file diff --git a/io.sc.engine.rule.frontend/.prettierrc.json b/io.sc.engine.rule.frontend/.prettierrc.json new file mode 100644 index 00000000..f9e9ce41 --- /dev/null +++ b/io.sc.engine.rule.frontend/.prettierrc.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://json.schemastore.org/prettierrc", + "semi": true, + "tabWidth": 2, + "singleQuote": true, + "printWidth": 160, + "trailingComma": "all" +} \ No newline at end of file diff --git a/io.sc.engine.rule.frontend/public/webjars/luckysheet/2.1.13/assets/iconfont/Anton-Regular.ttf b/io.sc.engine.rule.frontend/public/webjars/luckysheet/2.1.13/assets/iconfont/Anton-Regular.ttf new file mode 100644 index 00000000..5a582b18 Binary files /dev/null and b/io.sc.engine.rule.frontend/public/webjars/luckysheet/2.1.13/assets/iconfont/Anton-Regular.ttf differ diff --git a/io.sc.engine.rule.frontend/public/webjars/luckysheet/2.1.13/assets/iconfont/demo_index.html b/io.sc.engine.rule.frontend/public/webjars/luckysheet/2.1.13/assets/iconfont/demo_index.html new file mode 100644 index 00000000..b24698ab --- /dev/null +++ b/io.sc.engine.rule.frontend/public/webjars/luckysheet/2.1.13/assets/iconfont/demo_index.html @@ -0,0 +1,2700 @@ + + + + + IconFont Demo + + + + + + + + + + + +
+

+ +
+
+
    + +
  • + +
    链接
    +
    &#xe7f8;
    +
  • + +
  • + +
    打印区域
    +
    &#xe7f5;
    +
  • + +
  • + +
    打印页面配置
    +
    &#xe7f6;
    +
  • + +
  • + +
    打印标题
    +
    &#xe7f7;
    +
  • + +
  • + +
    分页预览
    +
    &#xe7f2;
    +
  • + +
  • + +
    普通
    +
    &#xe7f3;
    +
  • + +
  • + +
    页面布局
    +
    &#xe7f4;
    +
  • + +
  • + +
    表格锁定
    +
    &#xe7ee;
    +
  • + +
  • + +
    转到
    +
    &#xe7f1;
    +
  • + +
  • + +
    右箭头
    +
    &#xe7ed;
    +
  • + +
  • + +
    菜单
    +
    &#xe7ef;
    +
  • + +
  • + +
    替换
    +
    &#xe7f0;
    +
  • + +
  • + +
    冻结
    +
    &#xe7e1;
    +
  • + +
  • + +
    +
    &#xe7e2;
    +
  • + +
  • + +
    +
    &#xe7e3;
    +
  • + +
  • + +
    溢出
    +
    &#xe7e4;
    +
  • + +
  • + +
    升序
    +
    &#xe7e5;
    +
  • + +
  • + +
    内框线
    +
    &#xe7e6;
    +
  • + +
  • + +
    清除筛选
    +
    &#xe7e7;
    +
  • + +
  • + +
    文本向上
    +
    &#xe7e8;
    +
  • + +
  • + +
    降序
    +
    &#xe7e9;
    +
  • + +
  • + +
    内框横线
    +
    &#xe7ea;
    +
  • + +
  • + +
    内框竖线
    +
    &#xe7eb;
    +
  • + +
  • + +
    自定义排序
    +
    &#xe7ec;
    +
  • + +
  • + +
    logo2
    +
    &#xe7df;
    +
  • + +
  • + +
    logo
    +
    &#xe7e0;
    +
  • + +
  • + +
    文本倾斜
    +
    &#xe7de;
    +
  • + +
  • + +
    加粗
    +
    &#xe7d9;
    +
  • + +
  • + +
    搜索
    +
    &#xe78a;
    +
  • + +
  • + +
    关闭
    +
    &#xe78b;
    +
  • + +
  • + +
    下一个
    +
    &#xe78c;
    +
  • + +
  • + +
    下拉
    +
    &#xe78d;
    +
  • + +
  • + +
    文本颜色
    +
    &#xe78e;
    +
  • + +
  • + +
    上一个
    +
    &#xe78f;
    +
  • + +
  • + +
    数据透视
    +
    &#xe790;
    +
  • + +
  • + +
    填充
    +
    &#xe791;
    +
  • + +
  • + +
    增加小数位
    +
    &#xe792;
    +
  • + +
  • + +
    编辑2
    +
    &#xe793;
    +
  • + +
  • + +
    截屏
    +
    &#xe794;
    +
  • + +
  • + +
    减小小数位
    +
    &#xe796;
    +
  • + +
  • + +
    菜单
    +
    &#xe797;
    +
  • + +
  • + +
    数据库
    +
    &#xe798;
    +
  • + +
  • + +
    无边框
    +
    &#xe799;
    +
  • + +
  • + +
    编辑
    +
    &#xe79a;
    +
  • + +
  • + +
    清除样式
    +
    &#xe79b;
    +
  • + +
  • + +
    删除
    +
    &#xe79c;
    +
  • + +
  • + +
    文本居中对齐
    +
    &#xe79d;
    +
  • + +
  • + +
    打印
    +
    &#xe79e;
    +
  • + +
  • + +
    文本分割
    +
    &#xe79f;
    +
  • + +
  • + +
    函数‘
    +
    &#xe7a0;
    +
  • + +
  • + +
    降序
    +
    &#xe7a1;
    +
  • + +
  • + +
    顶部对齐
    +
    &#xe7a2;
    +
  • + +
  • + +
    图片
    +
    &#xe7a3;
    +
  • + +
  • + +
    向下90
    +
    &#xe7a4;
    +
  • + +
  • + +
    竖排文字
    +
    &#xe7a5;
    +
  • + +
  • + +
    全加边框
    +
    &#xe7a6;
    +
  • + +
  • + +
    升序
    +
    &#xe7a7;
    +
  • + +
  • + +
    裁剪
    +
    &#xe7a8;
    +
  • + +
  • + +
    金额
    +
    &#xe7a9;
    +
  • + +
  • + +
    菜单1
    +
    &#xe7aa;
    +
  • + +
  • + +
    取消合并
    +
    &#xe7ab;
    +
  • + +
  • + +
    文本下划线
    +
    &#xe7ac;
    +
  • + +
  • + +
    上边框
    +
    &#xe7ad;
    +
  • + +
  • + +
    定位
    +
    &#xe7ae;
    +
  • + +
  • + +
    四周加边框
    +
    &#xe7af;
    +
  • + +
  • + +
    侧边栏收起
    +
    &#xe7b0;
    +
  • + +
  • + +
    合并
    +
    &#xe7b1;
    +
  • + +
  • + +
    向上倾斜
    +
    &#xe7b2;
    +
  • + +
  • + +
    水平对齐
    +
    &#xe7b3;
    +
  • + +
  • + +
    文本删除线
    +
    &#xe7b4;
    +
  • + +
  • + +
    文本右对齐
    +
    &#xe7b5;
    +
  • + +
  • + +
    前进
    +
    &#xe7b6;
    +
  • + +
  • + +
    图表
    +
    &#xe7b7;
    +
  • + +
  • + +
    右边框
    +
    &#xe7b8;
    +
  • + +
  • + +
    百分号
    +
    &#xe7b9;
    +
  • + +
  • + +
    格式刷
    +
    &#xe7ba;
    +
  • + +
  • + +
    保存
    +
    &#xe7bb;
    +
  • + +
  • + +
    数据验证
    +
    &#xe7bc;
    +
  • + +
  • + +
    截断
    +
    &#xe7bd;
    +
  • + +
  • + +
    格式条件
    +
    &#xe7be;
    +
  • + +
  • + +
    自动换行
    +
    &#xe7bf;
    +
  • + +
  • + +
    侧边栏展开
    +
    &#xe7c0;
    +
  • + +
  • + +
    筛选2
    +
    &#xe7c1;
    +
  • + +
  • + +
    向下倾斜
    +
    &#xe7c2;
    +
  • + +
  • + +
    溢出
    +
    &#xe7c3;
    +
  • + +
  • + +
    垂直合并
    +
    &#xe7c4;
    +
  • + +
  • + +
    文本分散对齐
    +
    &#xe7c5;
    +
  • + +
  • + +
    左边框
    +
    &#xe7c6;
    +
  • + +
  • + +
    分页查看
    +
    &#xe7c7;
    +
  • + +
  • + +
    运行
    +
    &#xe7c8;
    +
  • + +
  • + +
    +
    &#xe7c9;
    +
  • + +
  • + +
    全屏
    +
    &#xe7ca;
    +
  • + +
  • + +
    筛选
    +
    &#xe7cb;
    +
  • + +
  • + +
    更新
    +
    &#xe7cc;
    +
  • + +
  • + +
    清除
    +
    &#xe7cd;
    +
  • + +
  • + +
    +
    &#xe7ce;
    +
  • + +
  • + +
    注释
    +
    &#xe7cf;
    +
  • + +
  • + +
    +
    &#xe7d0;
    +
  • + +
  • + +
    计算
    +
    &#xe7d1;
    +
  • + +
  • + +
    +
    &#xe7d2;
    +
  • + +
  • + +
    底部对齐
    +
    &#xe7d3;
    +
  • + +
  • + +
    向上90
    +
    &#xe7d4;
    +
  • + +
  • + +
    无选装
    +
    &#xe7d5;
    +
  • + +
  • + +
    显示隐藏网格
    +
    &#xe7d6;
    +
  • + +
  • + +
    冻结
    +
    &#xe7d7;
    +
  • + +
  • + +
    文本左对齐
    +
    &#xe7d8;
    +
  • + +
  • + +
    后退
    +
    &#xe7da;
    +
  • + +
  • + +
    水平合并
    +
    &#xe7db;
    +
  • + +
  • + +
    下边框
    +
    &#xe7dc;
    +
  • + +
  • + +
    设置
    +
    &#xe7dd;
    +
  • + +
+
+

Unicode 引用

+
+ +

Unicode 是字体在网页端最原始的应用方式,特点是:

+
    +
  • 兼容性最好,支持 IE6+,及所有现代浏览器。
  • +
  • 支持按字体的方式去动态调整图标大小,颜色等等。
  • +
  • 但是因为是字体,所以不支持多色。只能使用平台里单色的图标,就算项目里有多色图标也会自动去色。
  • +
+
+

注意:新版 iconfont 支持多色图标,这些多色图标在 Unicode 模式下将不能使用,如果有需求建议使用symbol 的引用方式

+
+

Unicode 使用步骤如下:

+

第一步:拷贝项目下面生成的 @font-face

+
@font-face {
+  font-family: 'iconfont';
+  src: url('iconfont.eot');
+  src: url('iconfont.eot?#iefix') format('embedded-opentype'),
+      url('iconfont.woff2') format('woff2'),
+      url('iconfont.woff') format('woff'),
+      url('iconfont.ttf') format('truetype'),
+      url('iconfont.svg#iconfont') format('svg');
+}
+
+

第二步:定义使用 iconfont 的样式

+
.iconfont {
+  font-family: "iconfont" !important;
+  font-size: 16px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+

第三步:挑选相应图标并获取字体编码,应用于页面

+
+<span class="iconfont">&#x33;</span>
+
+
+

"iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。

+
+
+
+
+
    + +
  • + +
    + 链接 +
    +
    .luckysheet-iconfont-lianjie +
    +
  • + +
  • + +
    + 打印区域 +
    +
    .luckysheet-iconfont-dayinquyu +
    +
  • + +
  • + +
    + 打印页面配置 +
    +
    .luckysheet-iconfont-dayinyemianpeizhi +
    +
  • + +
  • + +
    + 打印标题 +
    +
    .luckysheet-iconfont-dayinbiaoti +
    +
  • + +
  • + +
    + 分页预览 +
    +
    .luckysheet-iconfont-fenyeyulan +
    +
  • + +
  • + +
    + 普通 +
    +
    .luckysheet-iconfont-putong +
    +
  • + +
  • + +
    + 页面布局 +
    +
    .luckysheet-iconfont-yemianbuju +
    +
  • + +
  • + +
    + 表格锁定 +
    +
    .luckysheet-iconfont-biaogesuoding +
    +
  • + +
  • + +
    + 转到 +
    +
    .luckysheet-iconfont-zhuandao1 +
    +
  • + +
  • + +
    + 右箭头 +
    +
    .luckysheet-iconfont-youjiantou +
    +
  • + +
  • + +
    + 菜单 +
    +
    .luckysheet-iconfont-caidan2 +
    +
  • + +
  • + +
    + 替换 +
    +
    .luckysheet-iconfont-tihuan +
    +
  • + +
  • + +
    + 冻结 +
    +
    .luckysheet-iconfont-dongjie1 +
    +
  • + +
  • + +
    + 剪 +
    +
    .luckysheet-iconfont-jian1 +
    +
  • + +
  • + +
    + 加 +
    +
    .luckysheet-iconfont-jia1 +
    +
  • + +
  • + +
    + 溢出 +
    +
    .luckysheet-iconfont-yichu1 +
    +
  • + +
  • + +
    + 升序 +
    +
    .luckysheet-iconfont-shengxu1 +
    +
  • + +
  • + +
    + 内框线 +
    +
    .luckysheet-iconfont-neikuangxian +
    +
  • + +
  • + +
    + 清除筛选 +
    +
    .luckysheet-iconfont-qingchushaixuan +
    +
  • + +
  • + +
    + 文本向上 +
    +
    .luckysheet-iconfont-wenbenxiangshang +
    +
  • + +
  • + +
    + 降序 +
    +
    .luckysheet-iconfont-jiangxu1 +
    +
  • + +
  • + +
    + 内框横线 +
    +
    .luckysheet-iconfont-neikuanghengxian +
    +
  • + +
  • + +
    + 内框竖线 +
    +
    .luckysheet-iconfont-neikuangshuxian +
    +
  • + +
  • + +
    + 自定义排序 +
    +
    .luckysheet-iconfont-zidingyipaixu +
    +
  • + +
  • + +
    + logo2 +
    +
    .luckysheet-iconfont-logo2 +
    +
  • + +
  • + +
    + logo +
    +
    .luckysheet-iconfont-logo +
    +
  • + +
  • + +
    + 文本倾斜 +
    +
    .luckysheet-iconfont-wenbenqingxie1 +
    +
  • + +
  • + +
    + 加粗 +
    +
    .luckysheet-iconfont-jiacu +
    +
  • + +
  • + +
    + 搜索 +
    +
    .luckysheet-iconfont-sousuo +
    +
  • + +
  • + +
    + 关闭 +
    +
    .luckysheet-iconfont-guanbi +
    +
  • + +
  • + +
    + 下一个 +
    +
    .luckysheet-iconfont-xiayige +
    +
  • + +
  • + +
    + 下拉 +
    +
    .luckysheet-iconfont-xiala +
    +
  • + +
  • + +
    + 文本颜色 +
    +
    .luckysheet-iconfont-wenbenyanse +
    +
  • + +
  • + +
    + 上一个 +
    +
    .luckysheet-iconfont-shangyige +
    +
  • + +
  • + +
    + 数据透视 +
    +
    .luckysheet-iconfont-shujutoushi +
    +
  • + +
  • + +
    + 填充 +
    +
    .luckysheet-iconfont-tianchong +
    +
  • + +
  • + +
    + 增加小数位 +
    +
    .luckysheet-iconfont-zengjiaxiaoshuwei +
    +
  • + +
  • + +
    + 编辑2 +
    +
    .luckysheet-iconfont-bianji2 +
    +
  • + +
  • + +
    + 截屏 +
    +
    .luckysheet-iconfont-jieping +
    +
  • + +
  • + +
    + 减小小数位 +
    +
    .luckysheet-iconfont-jianxiaoxiaoshuwei +
    +
  • + +
  • + +
    + 菜单 +
    +
    .luckysheet-iconfont-caidan +
    +
  • + +
  • + +
    + 数据库 +
    +
    .luckysheet-iconfont-shujuku +
    +
  • + +
  • + +
    + 无边框 +
    +
    .luckysheet-iconfont-wubiankuang +
    +
  • + +
  • + +
    + 编辑 +
    +
    .luckysheet-iconfont-bianji +
    +
  • + +
  • + +
    + 清除样式 +
    +
    .luckysheet-iconfont-qingchuyangshi +
    +
  • + +
  • + +
    + 删除 +
    +
    .luckysheet-iconfont-shanchu +
    +
  • + +
  • + +
    + 文本居中对齐 +
    +
    .luckysheet-iconfont-wenbenjuzhongduiqi +
    +
  • + +
  • + +
    + 打印 +
    +
    .luckysheet-iconfont-dayin +
    +
  • + +
  • + +
    + 文本分割 +
    +
    .luckysheet-iconfont-wenbenfenge +
    +
  • + +
  • + +
    + 函数‘ +
    +
    .luckysheet-iconfont-hanshu +
    +
  • + +
  • + +
    + 降序 +
    +
    .luckysheet-iconfont-jiangxu +
    +
  • + +
  • + +
    + 顶部对齐 +
    +
    .luckysheet-iconfont-dingbuduiqi +
    +
  • + +
  • + +
    + 图片 +
    +
    .luckysheet-iconfont-tupian +
    +
  • + +
  • + +
    + 向下90 +
    +
    .luckysheet-iconfont-xiangxia90 +
    +
  • + +
  • + +
    + 竖排文字 +
    +
    .luckysheet-iconfont-shupaiwenzi +
    +
  • + +
  • + +
    + 全加边框 +
    +
    .luckysheet-iconfont-quanjiabiankuang +
    +
  • + +
  • + +
    + 升序 +
    +
    .luckysheet-iconfont-shengxu +
    +
  • + +
  • + +
    + 裁剪 +
    +
    .luckysheet-iconfont-caijian +
    +
  • + +
  • + +
    + 金额 +
    +
    .luckysheet-iconfont-jine +
    +
  • + +
  • + +
    + 菜单1 +
    +
    .luckysheet-iconfont-caidan1 +
    +
  • + +
  • + +
    + 取消合并 +
    +
    .luckysheet-iconfont-quxiaohebing +
    +
  • + +
  • + +
    + 文本下划线 +
    +
    .luckysheet-iconfont-wenbenxiahuaxian +
    +
  • + +
  • + +
    + 上边框 +
    +
    .luckysheet-iconfont-shangbiankuang +
    +
  • + +
  • + +
    + 定位 +
    +
    .luckysheet-iconfont-dingwei +
    +
  • + +
  • + +
    + 四周加边框 +
    +
    .luckysheet-iconfont-sizhoujiabiankuang +
    +
  • + +
  • + +
    + 侧边栏收起 +
    +
    .luckysheet-iconfont-cebianlanshouqi +
    +
  • + +
  • + +
    + 合并 +
    +
    .luckysheet-iconfont-hebing +
    +
  • + +
  • + +
    + 向上倾斜 +
    +
    .luckysheet-iconfont-xiangshangqingxie +
    +
  • + +
  • + +
    + 水平对齐 +
    +
    .luckysheet-iconfont-shuipingduiqi +
    +
  • + +
  • + +
    + 文本删除线 +
    +
    .luckysheet-iconfont-wenbenshanchuxian +
    +
  • + +
  • + +
    + 文本右对齐 +
    +
    .luckysheet-iconfont-wenbenyouduiqi +
    +
  • + +
  • + +
    + 前进 +
    +
    .luckysheet-iconfont-qianjin +
    +
  • + +
  • + +
    + 图表 +
    +
    .luckysheet-iconfont-tubiao +
    +
  • + +
  • + +
    + 右边框 +
    +
    .luckysheet-iconfont-youbiankuang +
    +
  • + +
  • + +
    + 百分号 +
    +
    .luckysheet-iconfont-baifenhao +
    +
  • + +
  • + +
    + 格式刷 +
    +
    .luckysheet-iconfont-geshishua +
    +
  • + +
  • + +
    + 保存 +
    +
    .luckysheet-iconfont-baocun +
    +
  • + +
  • + +
    + 数据验证 +
    +
    .luckysheet-iconfont-shujuyanzheng +
    +
  • + +
  • + +
    + 截断 +
    +
    .luckysheet-iconfont-jieduan +
    +
  • + +
  • + +
    + 格式条件 +
    +
    .luckysheet-iconfont-geshitiaojian +
    +
  • + +
  • + +
    + 自动换行 +
    +
    .luckysheet-iconfont-zidonghuanhang +
    +
  • + +
  • + +
    + 侧边栏展开 +
    +
    .luckysheet-iconfont-cebianlanzhankai +
    +
  • + +
  • + +
    + 筛选2 +
    +
    .luckysheet-iconfont-shaixuan2 +
    +
  • + +
  • + +
    + 向下倾斜 +
    +
    .luckysheet-iconfont-xiangxiaqingxie +
    +
  • + +
  • + +
    + 溢出 +
    +
    .luckysheet-iconfont-yichu +
    +
  • + +
  • + +
    + 垂直合并 +
    +
    .luckysheet-iconfont-chuizhihebing +
    +
  • + +
  • + +
    + 文本分散对齐 +
    +
    .luckysheet-iconfont-wenbenfensanduiqi +
    +
  • + +
  • + +
    + 左边框 +
    +
    .luckysheet-iconfont-zuobiankuang +
    +
  • + +
  • + +
    + 分页查看 +
    +
    .luckysheet-iconfont-fenyechakan +
    +
  • + +
  • + +
    + 运行 +
    +
    .luckysheet-iconfont-yunhang +
    +
  • + +
  • + +
    + 列 +
    +
    .luckysheet-iconfont-lie +
    +
  • + +
  • + +
    + 全屏 +
    +
    .luckysheet-iconfont-quanping +
    +
  • + +
  • + +
    + 筛选 +
    +
    .luckysheet-iconfont-shaixuan +
    +
  • + +
  • + +
    + 更新 +
    +
    .luckysheet-iconfont-gengxin +
    +
  • + +
  • + +
    + 清除 +
    +
    .luckysheet-iconfont-qingchu +
    +
  • + +
  • + +
    + 行 +
    +
    .luckysheet-iconfont-hang +
    +
  • + +
  • + +
    + 注释 +
    +
    .luckysheet-iconfont-zhushi +
    +
  • + +
  • + +
    + 剪 +
    +
    .luckysheet-iconfont-jian +
    +
  • + +
  • + +
    + 计算 +
    +
    .luckysheet-iconfont-jisuan +
    +
  • + +
  • + +
    + 加 +
    +
    .luckysheet-iconfont-jia +
    +
  • + +
  • + +
    + 底部对齐 +
    +
    .luckysheet-iconfont-dibuduiqi +
    +
  • + +
  • + +
    + 向上90 +
    +
    .luckysheet-iconfont-xiangshang90 +
    +
  • + +
  • + +
    + 无选装 +
    +
    .luckysheet-iconfont-wuxuanzhuang +
    +
  • + +
  • + +
    + 显示隐藏网格 +
    +
    .luckysheet-iconfont-xianshiyincangwangge +
    +
  • + +
  • + +
    + 冻结 +
    +
    .luckysheet-iconfont-dongjie +
    +
  • + +
  • + +
    + 文本左对齐 +
    +
    .luckysheet-iconfont-wenbenzuoduiqi +
    +
  • + +
  • + +
    + 后退 +
    +
    .luckysheet-iconfont-houtui +
    +
  • + +
  • + +
    + 水平合并 +
    +
    .luckysheet-iconfont-shuipinghebing +
    +
  • + +
  • + +
    + 下边框 +
    +
    .luckysheet-iconfont-xiabiankuang +
    +
  • + +
  • + +
    + 设置 +
    +
    .luckysheet-iconfont-shezhi +
    +
  • + +
+
+

font-class 引用

+
+ +

font-class 是 Unicode 使用方式的一种变种,主要是解决 Unicode 书写不直观,语意不明确的问题。

+

与 Unicode 使用方式相比,具有如下特点:

+
    +
  • 兼容性良好,支持 IE8+,及所有现代浏览器。
  • +
  • 相比于 Unicode 语意明确,书写更直观。可以很容易分辨这个 icon 是什么。
  • +
  • 因为使用 class 来定义图标,所以当要替换图标时,只需要修改 class 里面的 Unicode 引用。
  • +
  • 不过因为本质上还是使用的字体,所以多色图标还是不支持的。
  • +
+

使用步骤如下:

+

第一步:引入项目下面生成的 fontclass 代码:

+
<link rel="stylesheet" href="./iconfont.css">
+
+

第二步:挑选相应图标并获取类名,应用于页面:

+
<span class="iconfont luckysheet-iconfont-xxx"></span>
+
+
+

" + iconfont" 是你项目下的 font-family。可以通过编辑项目查看,默认是 "iconfont"。

+
+
+
+
+
    + +
  • + +
    链接
    +
    #luckysheet-iconfont-lianjie
    +
  • + +
  • + +
    打印区域
    +
    #luckysheet-iconfont-dayinquyu
    +
  • + +
  • + +
    打印页面配置
    +
    #luckysheet-iconfont-dayinyemianpeizhi
    +
  • + +
  • + +
    打印标题
    +
    #luckysheet-iconfont-dayinbiaoti
    +
  • + +
  • + +
    分页预览
    +
    #luckysheet-iconfont-fenyeyulan
    +
  • + +
  • + +
    普通
    +
    #luckysheet-iconfont-putong
    +
  • + +
  • + +
    页面布局
    +
    #luckysheet-iconfont-yemianbuju
    +
  • + +
  • + +
    表格锁定
    +
    #luckysheet-iconfont-biaogesuoding
    +
  • + +
  • + +
    转到
    +
    #luckysheet-iconfont-zhuandao1
    +
  • + +
  • + +
    右箭头
    +
    #luckysheet-iconfont-youjiantou
    +
  • + +
  • + +
    菜单
    +
    #luckysheet-iconfont-caidan2
    +
  • + +
  • + +
    替换
    +
    #luckysheet-iconfont-tihuan
    +
  • + +
  • + +
    冻结
    +
    #luckysheet-iconfont-dongjie1
    +
  • + +
  • + +
    +
    #luckysheet-iconfont-jian1
    +
  • + +
  • + +
    +
    #luckysheet-iconfont-jia1
    +
  • + +
  • + +
    溢出
    +
    #luckysheet-iconfont-yichu1
    +
  • + +
  • + +
    升序
    +
    #luckysheet-iconfont-shengxu1
    +
  • + +
  • + +
    内框线
    +
    #luckysheet-iconfont-neikuangxian
    +
  • + +
  • + +
    清除筛选
    +
    #luckysheet-iconfont-qingchushaixuan
    +
  • + +
  • + +
    文本向上
    +
    #luckysheet-iconfont-wenbenxiangshang
    +
  • + +
  • + +
    降序
    +
    #luckysheet-iconfont-jiangxu1
    +
  • + +
  • + +
    内框横线
    +
    #luckysheet-iconfont-neikuanghengxian
    +
  • + +
  • + +
    内框竖线
    +
    #luckysheet-iconfont-neikuangshuxian
    +
  • + +
  • + +
    自定义排序
    +
    #luckysheet-iconfont-zidingyipaixu
    +
  • + +
  • + +
    logo2
    +
    #luckysheet-iconfont-logo2
    +
  • + +
  • + +
    logo
    +
    #luckysheet-iconfont-logo
    +
  • + +
  • + +
    文本倾斜
    +
    #luckysheet-iconfont-wenbenqingxie1
    +
  • + +
  • + +
    加粗
    +
    #luckysheet-iconfont-jiacu
    +
  • + +
  • + +
    搜索
    +
    #luckysheet-iconfont-sousuo
    +
  • + +
  • + +
    关闭
    +
    #luckysheet-iconfont-guanbi
    +
  • + +
  • + +
    下一个
    +
    #luckysheet-iconfont-xiayige
    +
  • + +
  • + +
    下拉
    +
    #luckysheet-iconfont-xiala
    +
  • + +
  • + +
    文本颜色
    +
    #luckysheet-iconfont-wenbenyanse
    +
  • + +
  • + +
    上一个
    +
    #luckysheet-iconfont-shangyige
    +
  • + +
  • + +
    数据透视
    +
    #luckysheet-iconfont-shujutoushi
    +
  • + +
  • + +
    填充
    +
    #luckysheet-iconfont-tianchong
    +
  • + +
  • + +
    增加小数位
    +
    #luckysheet-iconfont-zengjiaxiaoshuwei
    +
  • + +
  • + +
    编辑2
    +
    #luckysheet-iconfont-bianji2
    +
  • + +
  • + +
    截屏
    +
    #luckysheet-iconfont-jieping
    +
  • + +
  • + +
    减小小数位
    +
    #luckysheet-iconfont-jianxiaoxiaoshuwei
    +
  • + +
  • + +
    菜单
    +
    #luckysheet-iconfont-caidan
    +
  • + +
  • + +
    数据库
    +
    #luckysheet-iconfont-shujuku
    +
  • + +
  • + +
    无边框
    +
    #luckysheet-iconfont-wubiankuang
    +
  • + +
  • + +
    编辑
    +
    #luckysheet-iconfont-bianji
    +
  • + +
  • + +
    清除样式
    +
    #luckysheet-iconfont-qingchuyangshi
    +
  • + +
  • + +
    删除
    +
    #luckysheet-iconfont-shanchu
    +
  • + +
  • + +
    文本居中对齐
    +
    #luckysheet-iconfont-wenbenjuzhongduiqi
    +
  • + +
  • + +
    打印
    +
    #luckysheet-iconfont-dayin
    +
  • + +
  • + +
    文本分割
    +
    #luckysheet-iconfont-wenbenfenge
    +
  • + +
  • + +
    函数‘
    +
    #luckysheet-iconfont-hanshu
    +
  • + +
  • + +
    降序
    +
    #luckysheet-iconfont-jiangxu
    +
  • + +
  • + +
    顶部对齐
    +
    #luckysheet-iconfont-dingbuduiqi
    +
  • + +
  • + +
    图片
    +
    #luckysheet-iconfont-tupian
    +
  • + +
  • + +
    向下90
    +
    #luckysheet-iconfont-xiangxia90
    +
  • + +
  • + +
    竖排文字
    +
    #luckysheet-iconfont-shupaiwenzi
    +
  • + +
  • + +
    全加边框
    +
    #luckysheet-iconfont-quanjiabiankuang
    +
  • + +
  • + +
    升序
    +
    #luckysheet-iconfont-shengxu
    +
  • + +
  • + +
    裁剪
    +
    #luckysheet-iconfont-caijian
    +
  • + +
  • + +
    金额
    +
    #luckysheet-iconfont-jine
    +
  • + +
  • + +
    菜单1
    +
    #luckysheet-iconfont-caidan1
    +
  • + +
  • + +
    取消合并
    +
    #luckysheet-iconfont-quxiaohebing
    +
  • + +
  • + +
    文本下划线
    +
    #luckysheet-iconfont-wenbenxiahuaxian
    +
  • + +
  • + +
    上边框
    +
    #luckysheet-iconfont-shangbiankuang
    +
  • + +
  • + +
    定位
    +
    #luckysheet-iconfont-dingwei
    +
  • + +
  • + +
    四周加边框
    +
    #luckysheet-iconfont-sizhoujiabiankuang
    +
  • + +
  • + +
    侧边栏收起
    +
    #luckysheet-iconfont-cebianlanshouqi
    +
  • + +
  • + +
    合并
    +
    #luckysheet-iconfont-hebing
    +
  • + +
  • + +
    向上倾斜
    +
    #luckysheet-iconfont-xiangshangqingxie
    +
  • + +
  • + +
    水平对齐
    +
    #luckysheet-iconfont-shuipingduiqi
    +
  • + +
  • + +
    文本删除线
    +
    #luckysheet-iconfont-wenbenshanchuxian
    +
  • + +
  • + +
    文本右对齐
    +
    #luckysheet-iconfont-wenbenyouduiqi
    +
  • + +
  • + +
    前进
    +
    #luckysheet-iconfont-qianjin
    +
  • + +
  • + +
    图表
    +
    #luckysheet-iconfont-tubiao
    +
  • + +
  • + +
    右边框
    +
    #luckysheet-iconfont-youbiankuang
    +
  • + +
  • + +
    百分号
    +
    #luckysheet-iconfont-baifenhao
    +
  • + +
  • + +
    格式刷
    +
    #luckysheet-iconfont-geshishua
    +
  • + +
  • + +
    保存
    +
    #luckysheet-iconfont-baocun
    +
  • + +
  • + +
    数据验证
    +
    #luckysheet-iconfont-shujuyanzheng
    +
  • + +
  • + +
    截断
    +
    #luckysheet-iconfont-jieduan
    +
  • + +
  • + +
    格式条件
    +
    #luckysheet-iconfont-geshitiaojian
    +
  • + +
  • + +
    自动换行
    +
    #luckysheet-iconfont-zidonghuanhang
    +
  • + +
  • + +
    侧边栏展开
    +
    #luckysheet-iconfont-cebianlanzhankai
    +
  • + +
  • + +
    筛选2
    +
    #luckysheet-iconfont-shaixuan2
    +
  • + +
  • + +
    向下倾斜
    +
    #luckysheet-iconfont-xiangxiaqingxie
    +
  • + +
  • + +
    溢出
    +
    #luckysheet-iconfont-yichu
    +
  • + +
  • + +
    垂直合并
    +
    #luckysheet-iconfont-chuizhihebing
    +
  • + +
  • + +
    文本分散对齐
    +
    #luckysheet-iconfont-wenbenfensanduiqi
    +
  • + +
  • + +
    左边框
    +
    #luckysheet-iconfont-zuobiankuang
    +
  • + +
  • + +
    分页查看
    +
    #luckysheet-iconfont-fenyechakan
    +
  • + +
  • + +
    运行
    +
    #luckysheet-iconfont-yunhang
    +
  • + +
  • + +
    +
    #luckysheet-iconfont-lie
    +
  • + +
  • + +
    全屏
    +
    #luckysheet-iconfont-quanping
    +
  • + +
  • + +
    筛选
    +
    #luckysheet-iconfont-shaixuan
    +
  • + +
  • + +
    更新
    +
    #luckysheet-iconfont-gengxin
    +
  • + +
  • + +
    清除
    +
    #luckysheet-iconfont-qingchu
    +
  • + +
  • + +
    +
    #luckysheet-iconfont-hang
    +
  • + +
  • + +
    注释
    +
    #luckysheet-iconfont-zhushi
    +
  • + +
  • + +
    +
    #luckysheet-iconfont-jian
    +
  • + +
  • + +
    计算
    +
    #luckysheet-iconfont-jisuan
    +
  • + +
  • + +
    +
    #luckysheet-iconfont-jia
    +
  • + +
  • + +
    底部对齐
    +
    #luckysheet-iconfont-dibuduiqi
    +
  • + +
  • + +
    向上90
    +
    #luckysheet-iconfont-xiangshang90
    +
  • + +
  • + +
    无选装
    +
    #luckysheet-iconfont-wuxuanzhuang
    +
  • + +
  • + +
    显示隐藏网格
    +
    #luckysheet-iconfont-xianshiyincangwangge
    +
  • + +
  • + +
    冻结
    +
    #luckysheet-iconfont-dongjie
    +
  • + +
  • + +
    文本左对齐
    +
    #luckysheet-iconfont-wenbenzuoduiqi
    +
  • + +
  • + +
    后退
    +
    #luckysheet-iconfont-houtui
    +
  • + +
  • + +
    水平合并
    +
    #luckysheet-iconfont-shuipinghebing
    +
  • + +
  • + +
    下边框
    +
    #luckysheet-iconfont-xiabiankuang
    +
  • + +
  • + +
    设置
    +
    #luckysheet-iconfont-shezhi
    +
  • + +
+
+

Symbol 引用

+
+ +

这是一种全新的使用方式,应该说这才是未来的主流,也是平台目前推荐的用法。相关介绍可以参考这篇文章 + 这种用法其实是做了一个 SVG 的集合,与另外两种相比具有如下特点:

+
    +
  • 支持多色图标了,不再受单色限制。
  • +
  • 通过一些技巧,支持像字体那样,通过 font-size, color 来调整样式。
  • +
  • 兼容性较差,支持 IE9+,及现代浏览器。
  • +
  • 浏览器渲染 SVG 的性能一般,还不如 png。
  • +
+

使用步骤如下:

+

第一步:引入项目下面生成的 symbol 代码:

+
<script src="./iconfont.js"></script>
+
+

第二步:加入通用 CSS 代码(引入一次就行):

+
<style>
+.icon {
+  width: 1em;
+  height: 1em;
+  vertical-align: -0.15em;
+  fill: currentColor;
+  overflow: hidden;
+}
+</style>
+
+

第三步:挑选相应图标并获取类名,应用于页面:

+
<svg class="icon" aria-hidden="true">
+  <use xlink:href="#icon-xxx"></use>
+</svg>
+
+
+
+ +
+
+ + + diff --git a/io.sc.engine.rule.frontend/public/webjars/luckysheet/2.1.13/css/arrow-down.png b/io.sc.engine.rule.frontend/public/webjars/luckysheet/2.1.13/css/arrow-down.png new file mode 100644 index 00000000..89a612f6 Binary files /dev/null and b/io.sc.engine.rule.frontend/public/webjars/luckysheet/2.1.13/css/arrow-down.png differ diff --git a/io.sc.engine.rule.frontend/src/App.vue b/io.sc.engine.rule.frontend/src/App.vue new file mode 100644 index 00000000..9eec9c4b --- /dev/null +++ b/io.sc.engine.rule.frontend/src/App.vue @@ -0,0 +1,5 @@ + + + diff --git a/io.sc.engine.rule.frontend/src/views/authorization/Authorization.vue b/io.sc.engine.rule.frontend/src/views/authorization/Authorization.vue new file mode 100644 index 00000000..bc1844a1 --- /dev/null +++ b/io.sc.engine.rule.frontend/src/views/authorization/Authorization.vue @@ -0,0 +1,4 @@ + + diff --git a/io.sc.engine.rule.frontend/src/views/resources/AttachmentDialog.vue b/io.sc.engine.rule.frontend/src/views/resources/AttachmentDialog.vue new file mode 100644 index 00000000..7c32ebd3 --- /dev/null +++ b/io.sc.engine.rule.frontend/src/views/resources/AttachmentDialog.vue @@ -0,0 +1,83 @@ + + diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/entity/processor/ArithmeticIndicatorProcessorEntity.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/entity/processor/ArithmeticIndicatorProcessorEntity.java new file mode 100644 index 00000000..f686101a --- /dev/null +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/entity/processor/ArithmeticIndicatorProcessorEntity.java @@ -0,0 +1,58 @@ +package io.sc.engine.rule.server.lib.entity.processor; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.sc.engine.rule.core.enums.ProcessorType; +import io.sc.engine.rule.core.util.ExpressionReplacer; +import io.sc.engine.rule.server.lib.entity.IndicatorProcessorEntity; +import io.sc.engine.rule.server.lib.vo.processor.ArithmeticIndicatorProcessorVo; + +import javax.persistence.Column; +import javax.persistence.DiscriminatorValue; +import javax.persistence.Entity; +import java.util.Map; + +/** + * 指标处理器(算数运算操作)实体类 + */ +@Entity +@DiscriminatorValue("ARITHMETIC") +@JsonTypeName("ARITHMETIC") +public class ArithmeticIndicatorProcessorEntity extends IndicatorProcessorEntity { + //算数表达式 + @Column(name="ARITHMETIC_") + private String arithmetic; + + @Override + public ArithmeticIndicatorProcessorVo toVo() { + ArithmeticIndicatorProcessorVo vo =new ArithmeticIndicatorProcessorVo(); + super.toVo(vo); + vo.setType(this.getType()); + vo.setArithmetic(this.getArithmetic()); + return vo; + } + + @Override + public ProcessorType getType() { + return ProcessorType.ARITHMETIC; + } + + public String getArithmetic() { + return arithmetic; + } + + public void setArithmetic(String arithmetic) { + this.arithmetic = arithmetic; + } + + @Override + public boolean replace(Map mapping) { + String replaced =ExpressionReplacer.replace(this.arithmetic, mapping); + replaced =(replaced==null?"":replaced); + boolean result =false; + if(!replaced.equals(this.arithmetic)) { + result =true; + } + this.arithmetic =replaced; + return result; + } +} diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/vo/processor/ArithmeticIndicatorProcessorVo.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/vo/processor/ArithmeticIndicatorProcessorVo.java new file mode 100644 index 00000000..169cc2ba --- /dev/null +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/lib/vo/processor/ArithmeticIndicatorProcessorVo.java @@ -0,0 +1,26 @@ +package io.sc.engine.rule.server.lib.vo.processor; + +import io.sc.engine.rule.core.enums.ProcessorType; +import io.sc.engine.rule.server.lib.vo.IndicatorProcessorVo; + +/** + * 指标处理器(算数运算操作)Vo 类 + */ +public class ArithmeticIndicatorProcessorVo extends IndicatorProcessorVo { + //算数表达式 + private String arithmetic; + + @Override + public ProcessorType getType() { + return ProcessorType.ARITHMETIC; + } + + public String getArithmetic() { + return arithmetic; + } + + public void setArithmetic(String arithmetic) { + this.arithmetic = arithmetic; + } + +} diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/migration/support/AllInOne.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/migration/support/AllInOne.java new file mode 100644 index 00000000..795c305c --- /dev/null +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/migration/support/AllInOne.java @@ -0,0 +1,33 @@ +package io.sc.engine.rule.server.migration.support; + +import java.util.ArrayList; +import java.util.List; + +import io.sc.engine.rule.core.po.dictionary.Dictionary; +import io.sc.engine.rule.core.po.lib.Lib; +import io.sc.engine.rule.core.po.resource.Resource; + +public class AllInOne { + private List resources =new ArrayList(); + private List libs =new ArrayList(); + private List dictionaries =new ArrayList(); + + public List getResources() { + return resources; + } + public void setResources(List resources) { + this.resources = resources; + } + public List getLibs() { + return libs; + } + public void setLibs(List libs) { + this.libs = libs; + } + public List getDictionaries() { + return dictionaries; + } + public void setDictionaries(List dictionaries) { + this.dictionaries = dictionaries; + } +} diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/ArithmeticParameterProcessorEntity.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/ArithmeticParameterProcessorEntity.java new file mode 100644 index 00000000..1685d34b --- /dev/null +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/entity/processor/ArithmeticParameterProcessorEntity.java @@ -0,0 +1,57 @@ +package io.sc.engine.rule.server.model.entity.processor; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.sc.engine.rule.core.enums.ProcessorType; +import io.sc.engine.rule.core.util.ExpressionReplacer; +import io.sc.engine.rule.server.model.entity.ParameterProcessorEntity; +import io.sc.engine.rule.server.model.vo.processor.ArithmeticParameterProcessorVo; + +import javax.persistence.Column; +import javax.persistence.DiscriminatorValue; +import javax.persistence.Entity; +import java.util.Map; + +/** + * 模型参数处理器(算数运算操作)实体类 + */ +@Entity +@DiscriminatorValue("ARITHMETIC") +@JsonTypeName("ARITHMETIC") +public class ArithmeticParameterProcessorEntity extends ParameterProcessorEntity { + //算数表达式 + @Column(name="ARITHMETIC_") + private String arithmetic; + + @Override + public ArithmeticParameterProcessorVo toVo() { + ArithmeticParameterProcessorVo vo =new ArithmeticParameterProcessorVo(); + super.toVo(vo); + vo.setArithmetic(this.getArithmetic()); + return vo; + } + + @Override + public ProcessorType getType() { + return ProcessorType.ARITHMETIC; + } + + public String getArithmetic() { + return arithmetic; + } + + public void setArithmetic(String arithmetic) { + this.arithmetic = arithmetic; + } + + @Override + public boolean replace(Map mapping) { + String replaced =ExpressionReplacer.replace(this.arithmetic, mapping); + replaced =(replaced==null?"":replaced); + boolean result =false; + if(!replaced.equals(this.arithmetic)) { + result =true; + } + this.arithmetic =replaced; + return result; + } +} diff --git a/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/processor/ArithmeticParameterProcessorVo.java b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/processor/ArithmeticParameterProcessorVo.java new file mode 100644 index 00000000..fa5caeeb --- /dev/null +++ b/io.sc.engine.rule.server/src/main/java/io/sc/engine/rule/server/model/vo/processor/ArithmeticParameterProcessorVo.java @@ -0,0 +1,26 @@ +package io.sc.engine.rule.server.model.vo.processor; + +import io.sc.engine.rule.core.enums.ProcessorType; +import io.sc.engine.rule.server.model.vo.ParameterProcessorVo; + +/** + * 模型参数处理器(算数运算操作)Vo 类 + */ +public class ArithmeticParameterProcessorVo extends ParameterProcessorVo { + + //算数表达式 + private String arithmetic; + + @Override + public ProcessorType getType() { + return ProcessorType.ARITHMETIC; + } + + public String getArithmetic() { + return arithmetic; + } + + public void setArithmetic(String arithmetic) { + this.arithmetic = arithmetic; + } +} diff --git a/io.sc.platform.attachment.api/src/main/java/io/sc/platform/attachment/api/AttachmentVo.java b/io.sc.platform.attachment.api/src/main/java/io/sc/platform/attachment/api/AttachmentVo.java new file mode 100644 index 00000000..3b24b09a --- /dev/null +++ b/io.sc.platform.attachment.api/src/main/java/io/sc/platform/attachment/api/AttachmentVo.java @@ -0,0 +1,66 @@ +package io.sc.platform.attachment.api; + +import io.sc.platform.attachment.api.enums.PersistenceType; +import io.sc.platform.orm.api.vo.AuditorVo; + +public abstract class AttachmentVo extends AuditorVo { + protected String id; + //业务Key + protected String bussinessKey; + //附件持久化类型 + protected PersistenceType type; + //名称 + protected String name; + //扩展名 + protected String extName; + //描述 + protected String description; + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getBussinessKey() { + return bussinessKey; + } + + public void setBussinessKey(String bussinessKey) { + this.bussinessKey = bussinessKey; + } + + public PersistenceType getType() { + return type; + } + + public void setType(PersistenceType type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getExtName() { + return extName; + } + + public void setExtName(String extName) { + this.extName = extName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} diff --git a/io.sc.platform.attachment/src/main/java/io/sc/platform/attachment/controller/AttachmentWebController.java b/io.sc.platform.attachment/src/main/java/io/sc/platform/attachment/controller/AttachmentWebController.java new file mode 100644 index 00000000..eb6d55fc --- /dev/null +++ b/io.sc.platform.attachment/src/main/java/io/sc/platform/attachment/controller/AttachmentWebController.java @@ -0,0 +1,60 @@ +package io.sc.platform.attachment.controller; + +import java.io.ByteArrayInputStream; +import java.io.FileInputStream; +import java.io.InputStream; +import java.util.List; +import java.util.Locale; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import io.sc.platform.attachment.api.AttachmentVo; +import io.sc.platform.attachment.api.enums.PersistenceType; +import io.sc.platform.attachment.jpa.entity.AttachmentEntity; +import io.sc.platform.attachment.jpa.entity.DatabaseAttachmentEntity; +import io.sc.platform.attachment.jpa.entity.DiskAttachmentEntity; +import io.sc.platform.attachment.jpa.repository.AttachmentRepository; +import io.sc.platform.attachment.service.AttachmentService; +import io.sc.platform.mvc.controller.support.RestCrudController; +import io.sc.platform.mvc.support.FileDownloader; +import org.springframework.stereotype.Controller; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; + +@Controller +@RequestMapping("/api/system/attachment") +public class AttachmentWebController extends RestCrudController { + + @GetMapping("findByBussinessKey") + @ResponseBody + public List findByBussinessKey(@RequestParam("bussinessKey")String bussinessKey) throws Exception{ + return service.findByBussinessKey(bussinessKey); + } + + @RequestMapping(value="upload/{bussinessKey}",method = RequestMethod.POST) + @ResponseBody + public void add(HttpServletRequest request,@PathVariable("bussinessKey")String bussinessKey,@RequestParam("file") MultipartFile multipartFile,Locale locale) throws Exception{ + service.upload(bussinessKey, request.getParameter("name"), request.getParameter("description"), multipartFile, locale); + } + + @RequestMapping(value="download/{id}",method=RequestMethod.GET) + public void download(HttpServletRequest request,HttpServletResponse response, @PathVariable("id")String id) throws Exception { + AttachmentEntity entity =service.findById(id); + if(entity!=null) { + if(PersistenceType.DISK.equals(entity.getType())) { + DiskAttachmentEntity _entity =(DiskAttachmentEntity)entity; + String file =service.getDiskAttachmentFilePath(_entity); + if(StringUtils.hasText(file)) { + InputStream in =new FileInputStream(file); + FileDownloader.download(request, response, _entity.getName(), in); + } + }else { + DatabaseAttachmentEntity _entity =(DatabaseAttachmentEntity)entity; + InputStream in =new ByteArrayInputStream(_entity.getBytes()); + FileDownloader.download(request, response, _entity.getName(), in); + } + } + } +} \ No newline at end of file diff --git a/io.sc.platform.attachment/src/main/java/io/sc/platform/attachment/jpa/entity/AttachmentEntity.java b/io.sc.platform.attachment/src/main/java/io/sc/platform/attachment/jpa/entity/AttachmentEntity.java new file mode 100644 index 00000000..5ced5c49 --- /dev/null +++ b/io.sc.platform.attachment/src/main/java/io/sc/platform/attachment/jpa/entity/AttachmentEntity.java @@ -0,0 +1,118 @@ +package io.sc.platform.attachment.jpa.entity; + +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.sc.platform.attachment.api.AttachmentVo; +import io.sc.platform.attachment.api.enums.PersistenceType; +import io.sc.platform.orm.entity.AuditorEntity; +import org.hibernate.annotations.GenericGenerator; + +import javax.persistence.*; +import javax.validation.constraints.Size; + +/** + * 附件实体类 + */ +@Entity +@Table(name="SYS_ATTACHMENT") +@Inheritance(strategy = InheritanceType.SINGLE_TABLE) +@DiscriminatorColumn(name="PERSISTENCE_TYPE_",discriminatorType=DiscriminatorType.STRING,length=10) +@JsonTypeInfo(use=JsonTypeInfo.Id.NAME, include=JsonTypeInfo.As.PROPERTY, property="type",defaultImpl= DatabaseAttachmentEntity.class) +@JsonSubTypes({ + @JsonSubTypes.Type(value= DiskAttachmentEntity.class), //磁盘文件 + @JsonSubTypes.Type(value= DatabaseAttachmentEntity.class) //数据库 +}) +public abstract class AttachmentEntity extends AuditorEntity { + //ID,主键 + @Id + @GeneratedValue(generator = "system-uuid") + @GenericGenerator(name = "system-uuid", strategy = "uuid2") + @Column(name="ID_", length=36) + @Size(max=36) + protected String id; + + //业务Key + @Column(name="BUSSINESS_KEY_", length=256) + @Size(max=256) + protected String bussinessKey; + + //附件持久化类型 + @Column(name="PERSISTENCE_TYPE_", insertable=false,updatable=false) + @Enumerated(EnumType.STRING) + protected PersistenceType type; + + //名称 + @Column(name="NAME_", length=256) + @Size(max=256) + protected String name; + + //扩展名 + @Column(name="EXT_NAME_", length=10) + @Size(max=10) + protected String extName; + + //描述 + @Column(name="DESCRIPTION_", length=1024) + @Size(max=1024) + protected String description; + + public void toVo(AttachmentVo vo){ + if(vo!=null){ + super.toVo(vo); + vo.setId(this.getId()); + vo.setBussinessKey(this.getBussinessKey()); + vo.setType(this.getType()); + vo.setName(this.getName()); + vo.setExtName(this.getExtName()); + vo.setDescription(this.getDescription()); + } + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public String getBussinessKey() { + return bussinessKey; + } + + public void setBussinessKey(String bussinessKey) { + this.bussinessKey = bussinessKey; + } + + public PersistenceType getType() { + return type; + } + + public void setType(PersistenceType type) { + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getExtName() { + return extName; + } + + public void setExtName(String extName) { + this.extName = extName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } +} diff --git a/io.sc.platform.attachment/src/main/java/io/sc/platform/attachment/jpa/repository/AttachmentRepository.java b/io.sc.platform.attachment/src/main/java/io/sc/platform/attachment/jpa/repository/AttachmentRepository.java new file mode 100644 index 00000000..7e8c54d5 --- /dev/null +++ b/io.sc.platform.attachment/src/main/java/io/sc/platform/attachment/jpa/repository/AttachmentRepository.java @@ -0,0 +1,18 @@ +package io.sc.platform.attachment.jpa.repository; + +import io.sc.platform.attachment.jpa.entity.AttachmentEntity; +import io.sc.platform.orm.repository.DaoRepository; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; + +import java.util.List; +import java.util.Set; + +public interface AttachmentRepository extends DaoRepository { + + public List findByBussinessKeyOrderByName(String bussinessKey); + + + @Query("select e from AttachmentEntity e where e.bussinessKey in (:bussinessKeys)") + public List findByBussinessKeys(@Param("bussinessKeys")Set bussinessKeys); +} diff --git a/io.sc.platform.attachment/src/main/java/io/sc/platform/attachment/service/AttachmentService.java b/io.sc.platform.attachment/src/main/java/io/sc/platform/attachment/service/AttachmentService.java new file mode 100644 index 00000000..c4d543da --- /dev/null +++ b/io.sc.platform.attachment/src/main/java/io/sc/platform/attachment/service/AttachmentService.java @@ -0,0 +1,52 @@ +package io.sc.platform.attachment.service; + +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; + +import io.sc.platform.attachment.api.AttachmentVo; +import io.sc.platform.attachment.api.DiskAttachmentVo; +import io.sc.platform.attachment.jpa.entity.AttachmentEntity; +import io.sc.platform.attachment.jpa.entity.DiskAttachmentEntity; +import io.sc.platform.attachment.jpa.repository.AttachmentRepository; +import io.sc.platform.orm.service.DaoService; +import org.springframework.web.multipart.MultipartFile; + + +/** + * 附件服务接口 + */ +public interface AttachmentService extends DaoService { + /** + * 通过业务Key查找附件列表 + * @param bussinessKey 业务Key + * @return 附件列表 + */ + public List findByBussinessKey(String bussinessKey); + + /** + * 通过业务Key集合查找附件列表 + * @param bussinessKeys 业务Key集合 + * @return 附件列表Map(Key:bussinessKey,value:附件列表) + */ + public Map> findByBussinessKeys(Set bussinessKeys); + + /** + * 获取磁盘附件的文件路径 + * @param entity 附件对象 + * @return 磁盘附件的文件路径 + */ + public String getDiskAttachmentFilePath(DiskAttachmentEntity entity); + + /** + * + * 上传附件 + * @param bussinessKey 业务 Key + * @param name 附件名称 + * @param description 附件描述 + * @param multipartFile 附件 + * @param locale 区域 + */ + public void upload(String bussinessKey,String name,String description,MultipartFile multipartFile,Locale locale) throws Exception; +} diff --git a/io.sc.platform.attachment/src/main/java/io/sc/platform/attachment/service/impl/AttachmentServiceImpl.java b/io.sc.platform.attachment/src/main/java/io/sc/platform/attachment/service/impl/AttachmentServiceImpl.java new file mode 100644 index 00000000..1452020f --- /dev/null +++ b/io.sc.platform.attachment/src/main/java/io/sc/platform/attachment/service/impl/AttachmentServiceImpl.java @@ -0,0 +1,116 @@ +package io.sc.platform.attachment.service.impl; + +import io.sc.platform.attachment.api.AttachmentVo; +import io.sc.platform.attachment.api.enums.PersistenceType; +import io.sc.platform.attachment.jpa.entity.AttachmentEntity; +import io.sc.platform.attachment.jpa.entity.DatabaseAttachmentEntity; +import io.sc.platform.attachment.jpa.entity.DiskAttachmentEntity; +import io.sc.platform.attachment.jpa.repository.AttachmentRepository; +import io.sc.platform.attachment.service.AttachmentService; +import io.sc.platform.core.DirectoryManager; +import io.sc.platform.core.util.FileUtil; +import io.sc.platform.mvc.service.SystemParameterService; +import io.sc.platform.orm.service.impl.DaoServiceImpl; +import io.sc.platform.orm.util.EntityVoUtil; +import org.apache.commons.io.IOUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; +import org.springframework.web.multipart.MultipartFile; + +import java.io.*; +import java.util.*; + +@Service("frAttachmentService") +public class AttachmentServiceImpl extends DaoServiceImpl implements AttachmentService { + @Autowired private SystemParameterService systemParameterService; + + @Override + public List findByBussinessKey(String bussinessKey) { + return EntityVoUtil.toVo(repository.findByBussinessKeyOrderByName(bussinessKey)); + } + + + @Override + public Map> findByBussinessKeys(Set bussinessKeys) { + if(bussinessKeys!=null && bussinessKeys.size()>0) { + List entities =repository.findByBussinessKeys(bussinessKeys); + if(entities!=null && entities.size()>0) { + Map> result =new HashMap<>(); + for(AttachmentEntity entity : entities) { + List list =result.get(entity.getBussinessKey()); + if(list==null) { + list =new ArrayList(); + list.add(entity.toVo()); + result.put(entity.getBussinessKey(), list); + }else { + list.add(entity.toVo()); + } + } + return result; + } + } + return null; + } + + + + @Override + public String getDiskAttachmentFilePath(DiskAttachmentEntity entity) { + if(entity!=null) { + String path = DirectoryManager.getInstance().getByName("dir.work.web.upload"); + String attachmentPath =entity.getPath(); + if(StringUtils.hasText(attachmentPath)) { + if(attachmentPath.startsWith("/") || attachmentPath.startsWith("\\")) { + path =path + attachmentPath; + }else { + path =path + File.separator + attachmentPath; + } + } + if(path.endsWith("/") || path.endsWith("\\")) { + path =path + entity.getId() + entity.getExtName(); + }else { + path =path + File.separator + entity.getId() + entity.getExtName(); + } + return path; + } + return null; + } + + @Override + public void upload(String bussinessKey, String name, String description, MultipartFile multipartFile,Locale locale) throws Exception{ + if(multipartFile!=null) { + InputStream ins = multipartFile.getInputStream(); + byte[] bytes = new byte[ins.available()]; + ins.read(bytes); + ins.close(); + + String attachmentPersistenceType = systemParameterService.getParameter("attachmentPersistenceType"); + if (PersistenceType.DISK.equals(PersistenceType.valueOf(attachmentPersistenceType))) { + DiskAttachmentEntity _entity = new DiskAttachmentEntity(); + _entity.setPath("/"); + _entity.setBussinessKey(bussinessKey); + _entity.setName(name); + _entity.setExtName(FileUtil.getFileExtName(multipartFile.getOriginalFilename())); + _entity.setDescription(description); + AttachmentEntity entity = add(_entity); + persistence2Disk((DiskAttachmentEntity) entity, bytes); + } else { + DatabaseAttachmentEntity _entity = new DatabaseAttachmentEntity(); + _entity.setBussinessKey(bussinessKey); + _entity.setName(name); + _entity.setExtName(FileUtil.getFileExtName(multipartFile.getName())); + _entity.setDescription(description); + _entity.setBytes(bytes); + add(_entity); + } + } + } + + private void persistence2Disk(DiskAttachmentEntity entity,byte[] bytes) throws FileNotFoundException, IOException { + String file =getDiskAttachmentFilePath(entity); + if(StringUtils.hasText(file)) { + IOUtils.copy(new ByteArrayInputStream(bytes), new FileOutputStream(file)); + } + } +} diff --git a/io.sc.platform.orm/src/main/java/io/sc/platform/orm/entity/AuditorEntity.java b/io.sc.platform.orm/src/main/java/io/sc/platform/orm/entity/AuditorEntity.java index 09773243..bf001d4a 100644 --- a/io.sc.platform.orm/src/main/java/io/sc/platform/orm/entity/AuditorEntity.java +++ b/io.sc.platform.orm/src/main/java/io/sc/platform/orm/entity/AuditorEntity.java @@ -55,7 +55,7 @@ public abstract class AuditorEntity extends VersionEntity