├── packages ├── rule │ ├── designer │ │ ├── style │ │ │ ├── rule-attr.scss │ │ │ ├── rule-tools.scss │ │ │ ├── rule-designer.scss │ │ │ ├── rule-area.scss │ │ │ └── rule-node.scss │ │ ├── assets │ │ │ ├── remark.png │ │ │ ├── search.png │ │ │ └── multip-pointer.png │ │ ├── modules │ │ │ ├── UsingDocModal.vue │ │ │ ├── edittable │ │ │ │ ├── EditableCell.vue │ │ │ │ ├── TestCell.vue │ │ │ │ ├── TestRow.vue │ │ │ │ ├── DatasRow.vue │ │ │ │ └── ParamsRow.vue │ │ │ ├── attrs │ │ │ │ ├── EndAttr.vue │ │ │ │ ├── BlockAttr.vue │ │ │ │ ├── ChildAttr.vue │ │ │ │ ├── StartAttr.vue │ │ │ │ ├── DesiAttr.vue │ │ │ │ ├── LineAttr.vue │ │ │ │ ├── OtherAttr.vue │ │ │ │ ├── CommonAttr.vue │ │ │ │ └── DataAttr.vue │ │ │ ├── ShortcutModal.vue │ │ │ ├── TestModal.vue │ │ │ ├── RuleAttr.vue │ │ │ ├── SettingModal.vue │ │ │ ├── RuleNode.vue │ │ │ ├── RuleTools.vue │ │ │ └── RuleArea.vue │ │ ├── config │ │ │ ├── basic-node-config.js │ │ │ ├── node-config-ext.js │ │ │ ├── args-config.js │ │ │ └── basic-icon-config.js │ │ ├── util │ │ │ └── RDUtils.js │ │ └── RuleDesigner.vue │ └── index.js └── index.js ├── public ├── favicon.ico └── index.html ├── babel.config.js ├── examples ├── assets │ └── logo.png ├── components │ └── HelloWorld.vue ├── main.js └── App.vue ├── .gitignore ├── .npmignore ├── README.md ├── vue.config.js ├── package.json └── LICENSE /packages/rule/designer/style/rule-attr.scss: -------------------------------------------------------------------------------- 1 | .ant-form-item { 2 | margin-bottom: 6px; 3 | } 4 | -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deliverer-spec/rule-designer/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | '@vue/cli-plugin-babel/preset' 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /examples/assets/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deliverer-spec/rule-designer/HEAD/examples/assets/logo.png -------------------------------------------------------------------------------- /packages/rule/designer/assets/remark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deliverer-spec/rule-designer/HEAD/packages/rule/designer/assets/remark.png -------------------------------------------------------------------------------- /packages/rule/designer/assets/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deliverer-spec/rule-designer/HEAD/packages/rule/designer/assets/search.png -------------------------------------------------------------------------------- /packages/rule/designer/modules/UsingDocModal.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 7 | 8 | -------------------------------------------------------------------------------- /packages/rule/designer/assets/multip-pointer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/deliverer-spec/rule-designer/HEAD/packages/rule/designer/assets/multip-pointer.png -------------------------------------------------------------------------------- /packages/rule/index.js: -------------------------------------------------------------------------------- 1 | // 用于导出单个组件,如果要做按需引入,也需要在这里配置 2 | // 导入组件,组件必须声明 name 3 | import RuleDesigner from './designer/RuleDesigner' 4 | 5 | // 为组件添加 install 方法,用于按需引入 6 | RuleDesigner.install = function (Vue) { 7 | Vue.component(RuleDesigner.name, RuleDesigner) 8 | } 9 | 10 | export default RuleDesigner -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules 3 | /dist 4 | 5 | # local env files 6 | .env.local 7 | .env.*.local 8 | 9 | # Log files 10 | npm-debug.log* 11 | yarn-debug.log* 12 | yarn-error.log* 13 | 14 | # Editor directories and files 15 | .idea 16 | .vscode 17 | *.suo 18 | *.ntvs* 19 | *.njsproj 20 | *.sln 21 | *.sw? 22 | -------------------------------------------------------------------------------- /examples/components/HelloWorld.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 15 | 16 | 17 | 19 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | node_modules/ 3 | examples/ 4 | packages/ 5 | public/ 6 | vue.config.js 7 | babel.config.js 8 | *.map 9 | *.html 10 | 11 | # local env files 12 | .env.local 13 | .env.*.local 14 | 15 | # Log files 16 | npm-debug.log* 17 | yarn-debug.log* 18 | yarn-error.log* 19 | 20 | # Editor directories and files 21 | .idea 22 | .vscode 23 | *.suo 24 | *.ntvs* 25 | *.njsproj 26 | *.sln 27 | *.sw* -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rule-designer 2 | 3 | ## Project setup 4 | ``` 5 | npm install 6 | ``` 7 | 8 | ### Compiles and hot-reloads for development 9 | ``` 10 | npm run serve 11 | ``` 12 | 13 | ### Compiles and minifies for production 14 | ``` 15 | npm run build 16 | ``` 17 | 18 | ### Lints and fixes files 19 | ``` 20 | npm run lint 21 | ``` 22 | 23 | ### Customize configuration 24 | See [Configuration Reference](https://cli.vuejs.org/config/). 25 | 26 | -------------------------------------------------------------------------------- /examples/main.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import App from './App.vue' 3 | import RuleDesigner from '../packages/index' 4 | 5 | import Antd from 'ant-design-vue' 6 | import 'ant-design-vue/dist/antd.css' 7 | import VueContextMenu from 'vue-contextmenu' 8 | import vcolorpicker from 'vcolorpicker' 9 | 10 | Vue.use(Antd) 11 | Vue.use(VueContextMenu) 12 | Vue.use(vcolorpicker) 13 | Vue.config.productionTip = false 14 | 15 | Vue.use(RuleDesigner) 16 | 17 | new Vue({ 18 | render: h => h(App), 19 | }).$mount('#app') 20 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | rule-designer 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /packages/rule/designer/style/rule-tools.scss: -------------------------------------------------------------------------------- 1 | $primary-color: #409EFF; 2 | 3 | .container { 4 | border: 2px solid #e4e7ed; 5 | height: 100%; 6 | 7 | moz-user-select: -moz-none; 8 | -moz-user-select: none; 9 | -o-user-select:none; 10 | -khtml-user-select:none; 11 | -webkit-user-select:none; 12 | -ms-user-select:none; 13 | user-select:none; 14 | } 15 | 16 | .select-area { 17 | border-right: 1px solid #e4e7ed; 18 | } 19 | 20 | .header-option { 21 | background: white; 22 | height: 36px; 23 | line-height: 36px; 24 | border-bottom: 2px solid #e4e7ed; 25 | text-align: right; 26 | } 27 | 28 | .header-option-button { 29 | border: 0; 30 | margin-left: 8px; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /examples/App.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 19 | 20 | 30 | -------------------------------------------------------------------------------- /packages/index.js: -------------------------------------------------------------------------------- 1 | //实现组件的全局注册 2 | // 导入单个组件 3 | import RuleDesigner from './rule/index' 4 | // import Antd from 'ant-design-vue' 5 | // import 'ant-design-vue/dist/antd.css' 6 | // import VueContextMenu from 'vue-contextmenu' 7 | // import vcolorpicker from 'vcolorpicker' 8 | 9 | // 以数组的结构保存组件,便于遍历 10 | const components = [ 11 | // Antd,VueContextMenu,vcolorpicker, 12 | RuleDesigner 13 | ] 14 | 15 | // 定义 install 方法 16 | const install = function (Vue) { 17 | if (install.installed) return 18 | install.installed = true 19 | // 遍历并注册全局组件 20 | components.map(component => { 21 | Vue.component(component.name, component) 22 | }) 23 | } 24 | 25 | // 判断是否是直接引入文件 26 | if (typeof window !== 'undefined' && window.Vue) { 27 | install(window.Vue) 28 | } 29 | 30 | export default { 31 | // 导出的对象必须具有 install,才能被 Vue.use() 方法安装 32 | install, 33 | // 组件列表 34 | // ...components 35 | RuleDesigner 36 | } -------------------------------------------------------------------------------- /packages/rule/designer/config/basic-node-config.js: -------------------------------------------------------------------------------- 1 | export const commonNodes = [ 2 | { 3 | type: 'start', 4 | nodeName: '开始', 5 | icon: 'StartIcon' 6 | }, 7 | // { 8 | // type: 'end', 9 | // nodeName: '结束', 10 | // icon: 'EndIcon' 11 | // }, 12 | { 13 | type: 'common', 14 | nodeName: '规则', 15 | icon: 'CommonIcon' 16 | }, 17 | { 18 | type: 'block', 19 | nodeName: '代码块', 20 | icon: 'EventIcon' 21 | }, 22 | { 23 | type: 'data', 24 | nodeName: '数据', 25 | icon: 'FreedomIcon' 26 | }, 27 | // { 28 | // type: 'freedom', 29 | // nodeName: '规则集', 30 | // icon: 'FreedomIcon' 31 | // }, 32 | // { 33 | // type: 'gateway', 34 | // nodeName: '评分卡', 35 | // icon: 'GatewayIcon' 36 | // }, 37 | { 38 | type: 'child', 39 | nodeName: '子规则', 40 | icon: 'ChildRuleIcon' 41 | } 42 | ]; 43 | 44 | export const laneNodes = [ 45 | { 46 | type: 'x-lane', 47 | nodeName: '横向泳道', 48 | icon: 'XLaneIcon' 49 | }, 50 | { 51 | type: 'y-lane', 52 | nodeName: '纵向泳道', 53 | icon: 'YLaneIcon' 54 | } 55 | ]; 56 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/edittable/EditableCell.vue: -------------------------------------------------------------------------------- 1 | 16 | 42 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/attrs/EndAttr.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | // baseUrl: process.env.NODE_ENV === 'production' ? '' : './', 3 | publicPath: '/dr/', 4 | outputDir: 'dist', 5 | assetsDir: 'static', 6 | filenameHashing: true, 7 | 8 | // 修改 src 为 examples 将 examples 目录添加为新的页面 9 | pages: { 10 | index: { 11 | // page 的入口 12 | entry: 'examples/main.js', 13 | // 模板来源 14 | template: 'public/index.html', 15 | // 输出文件名 16 | filename: 'index.html' 17 | } 18 | }, 19 | configureWebpack: { 20 | }, 21 | devServer: { 22 | open: false, //是否自动弹出浏览器页面 23 | host: "localhost", 24 | port: '8087', 25 | https: false, 26 | hotOnly: false, 27 | proxy: { 28 | '/api': { 29 | target: 'http://localhost:8799', //API服务器的地址 30 | ws: true, //代理websockets 31 | changeOrigin: true, // 虚拟的站点需要更管origin 32 | pathRewrite: {//重写路径 33 | '^/api': '' 34 | } 35 | } 36 | } 37 | }, 38 | // 强制内联CSS 39 | css: { extract: false }, 40 | //性能有关,编译时构建优化 41 | runtimeCompiler: true, 42 | //关闭eslint规范 43 | lintOnSave: false 44 | 45 | } -------------------------------------------------------------------------------- /packages/rule/designer/modules/attrs/BlockAttr.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/ShortcutModal.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 67 | 68 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/TestModal.vue: -------------------------------------------------------------------------------- 1 | 26 | 27 | 61 | 62 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/attrs/ChildAttr.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rule-designer", 3 | "version": "0.1.0", 4 | "main": "lib/rule-designer.umd.min.js", 5 | "private": false, 6 | "author": "yinbo <278253683@qq.com>", 7 | "scripts": { 8 | "serve": "vue-cli-service serve --mode dev", 9 | "build": "vue-cli-service build --mode prod", 10 | "lint": "vue-cli-service lint", 11 | "lib": "vue-cli-service build --target lib --name rule-designer --dest lib packages/index.js" 12 | }, 13 | "dependencies": { 14 | "acorn": "^7.1.1", 15 | "ant-design-vue": "^1.4.12", 16 | "axios": "^0.19.0", 17 | "babel-plugin-transform-remove-strict-mode": "0.0.2", 18 | "canvas": "^2.6.0", 19 | "canvg": "^2.0.0", 20 | "core-js": "^3.1.2", 21 | "html2canvas": "^1.0.0-rc.5", 22 | "jquery": "^3.4.1", 23 | "jquery-ui": "^1.13.0", 24 | "js-cookie": "^2.2.1", 25 | "jsdom": "^13.0.0", 26 | "jsplumb": "^2.12.3", 27 | "minimist": "^1.2.5", 28 | "vcolorpicker": "^0.1.8", 29 | "vue": "^2.6.10", 30 | "vue-contextmenu": "^1.5.10", 31 | "vue-json-viewer": "^2.2.6", 32 | "vue-router": "^3.1.3" 33 | }, 34 | "devDependencies": { 35 | "@vue/cli-plugin-babel": "^4.0.0", 36 | "@vue/cli-plugin-eslint": "^4.0.0", 37 | "@vue/cli-service": "^4.0.0", 38 | "babel-eslint": "^10.0.1", 39 | "eslint": "^5.16.0", 40 | "eslint-plugin-vue": "^5.0.0", 41 | "node-sass": "^4.13.1", 42 | "sass-loader": "^8.0.0", 43 | "vue-template-compiler": "^2.6.10" 44 | }, 45 | "eslintConfig": { 46 | "root": true, 47 | "env": { 48 | "node": true 49 | }, 50 | "extends": [ 51 | "plugin:vue/essential", 52 | "eslint:recommended" 53 | ], 54 | "rules": {}, 55 | "parserOptions": { 56 | "parser": "babel-eslint" 57 | } 58 | }, 59 | "postcss": { 60 | "plugins": { 61 | "autoprefixer": {} 62 | } 63 | }, 64 | "browserslist": [ 65 | "> 1%", 66 | "last 2 versions" 67 | ] 68 | } 69 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/attrs/StartAttr.vue: -------------------------------------------------------------------------------- 1 | 27 | 28 | -------------------------------------------------------------------------------- /packages/rule/designer/style/rule-designer.scss: -------------------------------------------------------------------------------- 1 | $primary-color: #409EFF; 2 | 3 | .container { 4 | border: 2px solid #e4e7ed; 5 | height: 100%; 6 | 7 | moz-user-select: -moz-none; 8 | -moz-user-select: none; 9 | -o-user-select:none; 10 | -khtml-user-select:none; 11 | -webkit-user-select:none; 12 | -ms-user-select:none; 13 | user-select:none; 14 | } 15 | 16 | .select-area { 17 | border-right: 1px solid #e4e7ed; 18 | } 19 | 20 | .header-option { 21 | background: white; 22 | height: 36px; 23 | line-height: 36px; 24 | border-bottom: 2px solid #e4e7ed; 25 | text-align: right; 26 | } 27 | 28 | .header-option-button { 29 | border: 0; 30 | margin-left: 8px; 31 | } 32 | 33 | .content { 34 | background: #fafafa; 35 | height: 100%; 36 | border: 2px dashed rgba(170,170,170,0.7); 37 | } 38 | 39 | .ant-layout-footer { 40 | padding: 4px 8px; 41 | } 42 | .foot { 43 | height: auto; 44 | text-align: center; 45 | } 46 | 47 | .attr-area { 48 | border-left: 1px solid #e4e7ed; 49 | } 50 | 51 | .tag { 52 | margin: 6px; 53 | } 54 | 55 | .tool-item { 56 | background: #f4f6fc; 57 | height: 32px; 58 | line-height: 32px; 59 | margin: 5px; 60 | padding-left: 8px; 61 | text-align: center; 62 | cursor: pointer; 63 | 64 | &:hover{ 65 | background: #d2d3d6; 66 | } 67 | 68 | &.active { 69 | background: black; 70 | } 71 | } 72 | 73 | .node-item { 74 | background: #f4f6fc; 75 | height: 32px; 76 | line-height: 32px; 77 | margin: 5px; 78 | padding-left: 8px; 79 | text-align: left; 80 | cursor: move; 81 | min-width: 120px; 82 | 83 | &:hover{ 84 | color: $primary-color; 85 | outline: 1px dashed $primary-color; 86 | } 87 | } 88 | 89 | .ant-list-grid .ant-list-item { 90 | margin-bottom: 8px; 91 | } 92 | 93 | .linkLabel { 94 | background-color: white; 95 | padding: 1px; 96 | border: 1px solid #346789; 97 | border-radius: 5px; 98 | opacity: 0.8; 99 | z-index: 3; 100 | } 101 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/attrs/DesiAttr.vue: -------------------------------------------------------------------------------- 1 | 30 | 31 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/attrs/LineAttr.vue: -------------------------------------------------------------------------------- 1 | 26 | -------------------------------------------------------------------------------- /packages/rule/designer/style/rule-area.scss: -------------------------------------------------------------------------------- 1 | $active-color: #409EFF; 2 | 3 | .btn-wrapper-simple { 4 | height: 24px !important; 5 | line-height: 24px !important; 6 | } 7 | .vue-contextmenu-listWrapper { 8 | padding-left: 1px !important; 9 | } 10 | .child-ul-wrapper { 11 | padding-left: 1px !important; 12 | } 13 | 14 | .rule-container { 15 | width: 500%;//这两个参数是画板缩放比例 16 | height: 300%; 17 | position: relative; 18 | transition: transform 0.5s ease 0s,transform-origin 0.5s ease 0s; 19 | 20 | &.grid { 21 | background-image: -webkit-linear-gradient(90deg, rgba(235, 235, 235, 1) 5%, rgba(0, 0, 0, 0) 5%); 22 | background-image: -moz-linear-gradient(90deg, rgba(235, 235, 235, 1) 5%, rgba(0, 0, 0, 0) 5%); 23 | background-image: -o-linear-gradient(90deg, rgba(235, 235, 235, 1) 5%, rgba(0, 0, 0, 0) 5%); 24 | background-image: -webkit-gradient(linear, 0 100%, 0 0, color-stop(0.05, rgba(235, 235, 235, 1)), color-stop(0.05, rgba(0, 0, 0, 0))); 25 | background-image: linear-gradient(90deg, rgba(235, 235, 235, 1) 5%, rgba(0, 0, 0, 0) 5%),linear-gradient(rgba(235, 235, 235, 1) 5%, rgba(0, 0, 0, 0) 5%); 26 | background-size: 1rem 1rem; 27 | } 28 | 29 | &.zoomIn { 30 | cursor: zoom-in; 31 | } 32 | &.zoomOut { 33 | cursor: zoom-out; 34 | } 35 | &.canScale { 36 | cursor: url(../assets/search.png), default; 37 | } 38 | &.canDrag { 39 | cursor: grab; 40 | } 41 | &.canMultiple { 42 | cursor: url(../assets/multip-pointer.png), default; 43 | } 44 | } 45 | 46 | .rectangle-multiple { 47 | position: absolute; 48 | border: 1px dashed #31676f; 49 | background-color: #0cceea29; 50 | } 51 | 52 | .rule-container-active { 53 | background-color: #e4e4e438; 54 | cursor: crosshair; 55 | } 56 | 57 | .auxiliary-line-x { 58 | position: absolute; 59 | border: 0.5px solid $active-color; 60 | width: 100%; 61 | z-index: 9999; 62 | } 63 | .auxiliary-line-y { 64 | position: absolute; 65 | border: 0.5px solid $active-color; 66 | height: 100%; 67 | z-index: 9999; 68 | } 69 | 70 | .link-active { 71 | outline: 2px dashed $active-color; 72 | } 73 | 74 | .container-scale { 75 | position: absolute; 76 | top: 0; 77 | left: 5px; 78 | } 79 | 80 | .mouse-position { 81 | position: absolute; 82 | bottom: 0; 83 | right: 5px; 84 | } 85 | 86 | .common-remarks { 87 | width: 100px; 88 | height: 150px; 89 | position: absolute; 90 | background-color: #ffffaa; 91 | } 92 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/attrs/OtherAttr.vue: -------------------------------------------------------------------------------- 1 | 46 | 47 | -------------------------------------------------------------------------------- /packages/rule/designer/config/node-config-ext.js: -------------------------------------------------------------------------------- 1 | export const nodesExtends = [ 2 | { 3 | type: 'start', 4 | total_score: '', 5 | params: [] 6 | }, 7 | { 8 | type: 'common', 9 | detail: '', 10 | model: '1', 11 | match_condition: '', 12 | rule_content: '', 13 | action: '0', 14 | level: '1', 15 | has_special_rule: '0', 16 | card_node_type: '', 17 | status: '0' 18 | }, 19 | { 20 | type: 'block', 21 | classname: '' 22 | }, 23 | { 24 | type: 'data', 25 | datatype: '', 26 | sql: '', 27 | datasource: '', 28 | resturl: '', 29 | cachekey: '', 30 | intfname: '', 31 | datas: [] 32 | }, 33 | { 34 | type: 'child', 35 | childcode: '', 36 | childname: '', 37 | version: '' 38 | }, 39 | { 40 | type: 'temp', 41 | name: "defaultvalue", 42 | desc: null, 43 | detail:{ 44 | name: '', 45 | id: undefined,//生成时会被忽略该字段 46 | desc: '测试数据结构' 47 | } 48 | }, 49 | ]; 50 | 51 | export const paramColumns = [ 52 | { 53 | title: '字段', 54 | dataIndex: 'colum', 55 | width: '25%', 56 | scopedSlots: { customRender: 'colum' }, 57 | }, 58 | { 59 | title: '字段名', 60 | dataIndex: 'colname', 61 | width: '25%', 62 | scopedSlots: { customRender: 'colname' }, 63 | }, 64 | { 65 | title: '数据类型', 66 | dataIndex: 'coltype', 67 | width: '25%', 68 | scopedSlots: { customRender: 'coltype' }, 69 | }, 70 | { 71 | title: '默认值', 72 | dataIndex: 'defvaule', 73 | width: '20%', 74 | scopedSlots: { customRender: 'defvaule' }, 75 | }, 76 | { 77 | title: '操作', 78 | dataIndex: 'operation', 79 | scopedSlots: { customRender: 'operation' }, 80 | }, 81 | ]; 82 | 83 | export const paramColumnsList = ['colum', 'colname', 'coltype', 'defvaule']; 84 | 85 | 86 | export const datasColumns = [ 87 | { 88 | title: '字段', 89 | dataIndex: 'colum', 90 | width: '25%', 91 | scopedSlots: { customRender: 'colum' }, 92 | }, 93 | { 94 | title: '字段名', 95 | dataIndex: 'colname', 96 | width: '25%', 97 | scopedSlots: { customRender: 'colname' }, 98 | }, 99 | { 100 | title: '数据类型', 101 | dataIndex: 'coltype', 102 | width: '25%', 103 | scopedSlots: { customRender: 'coltype' }, 104 | }, 105 | { 106 | title: '默认值', 107 | dataIndex: 'defvaule', 108 | width: '20%', 109 | scopedSlots: { customRender: 'defvaule' }, 110 | }, 111 | { 112 | title: '操作', 113 | dataIndex: 'operation', 114 | scopedSlots: { customRender: 'operation' }, 115 | }, 116 | ]; 117 | 118 | export const datasColumnsList = ['colum', 'colname', 'coltype', 'defvaule']; 119 | //撤销数组 120 | export const UNDOARR = []; 121 | //UNDOARR.push(parent.getCurrentFlowDoc()); 122 | //做法是每一个动作都存储一遍数据 123 | 124 | //重做数组 125 | export const REDOARR = []; 126 | //initFlowCharts(REDOARR.pop()); 127 | //重做是弹出数据重新完整绘制 128 | -------------------------------------------------------------------------------- /packages/rule/designer/util/RDUtils.js: -------------------------------------------------------------------------------- 1 | import { ruleConfig } from '../config/args-config.js' 2 | import Cookies from 'js-cookie' 3 | 4 | const TokenKey = 'Admin-Token' 5 | 6 | export let RDUtils = { 7 | seqNo: 1, 8 | consoleLog: function(strArr) { 9 | let log = ''; 10 | for (let i = 0, len = strArr.length; i < len; i++) { 11 | log += strArr[i] + '\n'; 12 | } 13 | console.log('%c' + log, 'color: red; font-weight: bold;'); 14 | }, 15 | getId: function() { 16 | let idType = ruleConfig.idType; 17 | if (typeof idType == 'string') { 18 | if (idType == 'uuid') { 19 | return this.getUUID(); 20 | } else if (idType == 'time_stamp') { 21 | return this.getTimeStamp(); 22 | } 23 | } else if (idType instanceof Array) { 24 | if (idType[0] == 'time_stamp_and_sequence') { 25 | return this.getSequence(idType[1]); 26 | } else if (idType[0] == 'time_stamp_and_sequence') { 27 | return this.getTimeStampAndSequence(idType[1]); 28 | } else if (idType[0] == 'custom') { 29 | return idType[1](); 30 | } 31 | } 32 | }, 33 | getUUID: function() { 34 | let s = []; 35 | let hexDigits = "0123456789abcdef"; 36 | for(let i = 0; i < 36; i++) { 37 | s[i] = hexDigits.substr(Math.floor(Math.random() * 0x10), 1); 38 | } 39 | s[14] = "4"; 40 | s[19] = hexDigits.substr((s[19] & 0x3) | 0x8, 1); 41 | s[8] = s[13] = s[18] = s[23] = "-"; 42 | 43 | let uuid = s.join(""); 44 | return uuid.replace(/-/g, ''); 45 | }, 46 | getTimeStamp: function() { 47 | return new Date().getTime(); 48 | }, 49 | getSequence: function(seqNoLength) { 50 | let zeroStr = new Array(seqNoLength).fill('0').join(''); 51 | return (zeroStr + (this.seqNo++)).slice(-seqNoLength); 52 | }, 53 | getTimeStampAndSequence: function(seqNoLength) { 54 | return this.getTimeStamp() + this.getSequence(seqNoLength); 55 | }, 56 | add: function(a, b) { 57 | let c, d, e; 58 | try { 59 | c = a.toString().split(".")[1].length; 60 | } catch (f) { 61 | c = 0; 62 | } 63 | try { 64 | d = b.toString().split(".")[1].length; 65 | } catch (f) { 66 | d = 0; 67 | } 68 | return e = Math.pow(10, Math.max(c, d)), (this.mul(a, e) + this.mul(b, e)) / e; 69 | }, 70 | sub: function(a, b) { 71 | let c, d, e; 72 | try { 73 | c = a.toString().split(".")[1].length; 74 | } catch (f) { 75 | c = 0; 76 | } 77 | try { 78 | d = b.toString().split(".")[1].length; 79 | } catch (f) { 80 | d = 0; 81 | } 82 | return e = Math.pow(10, Math.max(c, d)), (this.mul(a, e) - this.mul(b, e)) / e; 83 | }, 84 | mul: function(a, b) { 85 | let c = 0, d = a.toString(), e = b.toString(); 86 | try { 87 | c += d.split(".")[1].length; 88 | } catch (f) {} 89 | try { 90 | c += e.split(".")[1].length; 91 | } catch (f) {} 92 | return Number(d.replace(".", "")) * Number(e.replace(".", "")) / Math.pow(10, c); 93 | }, 94 | div: function(a, b) { 95 | let c, d, e = 0, f = 0; 96 | try { 97 | e = a.toString().split(".")[1].length; 98 | } catch (g) {} 99 | try { 100 | f = b.toString().split(".")[1].length; 101 | } catch (g) {} 102 | return c = Number(a.toString().replace(".", "")), d = Number(b.toString().replace(".", "")), this.mul(c / d, Math.pow(10, f - e)); 103 | }, 104 | getUrlParam(name){ 105 |   return decodeURIComponent((new RegExp('[?|&]'+name+'='+'([^&;]+?)(&|#|;|$)').exec(location.href)||[,""])[1].replace(/\+/g,'%20'))||null; 106 | }, 107 | getToken(){ 108 | return Cookies.get(TokenKey); 109 | } 110 | }; 111 | -------------------------------------------------------------------------------- /packages/rule/designer/style/rule-node.scss: -------------------------------------------------------------------------------- 1 | $common-node-bg: #f4f6fc; 2 | $common-node-bg-hover: #f4f6fcb0; 3 | $common-node-active: #409EFF; 4 | 5 | .common-circle-node { 6 | position: absolute; 7 | height: 50px; 8 | width: 50px; 9 | line-height: 50px; 10 | text-align: center; 11 | border: 1px solid #777; 12 | border-radius: 50%; 13 | background-color: $common-node-bg; 14 | white-space: nowrap; 15 | 16 | &:hover { 17 | background-color: $common-node-bg-hover; 18 | z-index: 2; 19 | } 20 | 21 | &.active { 22 | outline: 2px dashed $common-node-active; 23 | outline-offset: 0px; 24 | } 25 | } 26 | 27 | .common-rectangle-node { 28 | position: absolute; 29 | height: 40px; 30 | width: 120px; 31 | line-height: 40px; 32 | text-align: center; 33 | border: 1px solid #777; 34 | border-radius: 5px; 35 | background-color: $common-node-bg; 36 | white-space: nowrap; 37 | 38 | &:hover { 39 | background-color: $common-node-bg-hover; 40 | z-index: 2; 41 | } 42 | 43 | &.active { 44 | outline: 2px dashed $common-node-active; 45 | outline-offset: 0px; 46 | } 47 | } 48 | 49 | .common-diamond-node { 50 | position: absolute; 51 | height: 50px; 52 | width: 50px; 53 | line-height: 50px; 54 | text-align: center; 55 | border: 1px solid #777; 56 | border-radius: 3px; 57 | background-color: $common-node-bg; 58 | transform: rotate(45deg); 59 | white-space: nowrap; 60 | 61 | &:before { 62 | position: absolute; 63 | content: '评分卡'; 64 | transform: rotate(-45deg); 65 | top: 0; 66 | left: 0; 67 | right: 0; 68 | bottom: 0; 69 | } 70 | 71 | &:hover { 72 | background-color: $common-node-bg-hover; 73 | z-index: 2; 74 | } 75 | 76 | &.active { 77 | outline: 2px dashed $common-node-active; 78 | outline-offset: 0px; 79 | } 80 | } 81 | 82 | .common-x-lane-node { 83 | position: absolute; 84 | text-align: center; 85 | border: 1px solid #777; 86 | border-radius: 2px; 87 | z-index: -1; 88 | 89 | &.active { 90 | outline: 2px dashed $common-node-active; 91 | outline-offset: 0px; 92 | } 93 | 94 | .lane-text-div { 95 | width: 18px; 96 | height: 100%; 97 | position: absolute; 98 | display: table; 99 | border-right: 1px solid #777; 100 | background-color: $common-node-bg; 101 | 102 | &:hover { 103 | z-index: 2; 104 | } 105 | 106 | .lane-text { 107 | word-wrap: break-word; 108 | display: table-cell; 109 | vertical-align: middle; 110 | font-size: 0.8em; 111 | } 112 | } 113 | } 114 | 115 | .common-y-lane-node { 116 | position: absolute; 117 | text-align: center; 118 | border: 1px solid #777; 119 | border-radius: 2px; 120 | z-index: -1; 121 | 122 | &.active { 123 | outline: 2px dashed $common-node-active; 124 | outline-offset: 0px; 125 | } 126 | 127 | .lane-text-div { 128 | width: 100%; 129 | height: 18px; 130 | position: absolute; 131 | display: table; 132 | border-bottom: 1px solid #777; 133 | background-color: $common-node-bg; 134 | 135 | &:hover { 136 | z-index: 2; 137 | } 138 | 139 | .lane-text { 140 | word-wrap: break-word; 141 | display: table-cell; 142 | font-size: 0.8em; 143 | } 144 | } 145 | } 146 | 147 | .node-icon { 148 | position: absolute; 149 | top: 3px; 150 | left: 3px; 151 | } 152 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/edittable/TestCell.vue: -------------------------------------------------------------------------------- 1 | 3 | 22 | 98 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/attrs/CommonAttr.vue: -------------------------------------------------------------------------------- 1 | 54 | 55 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/edittable/TestRow.vue: -------------------------------------------------------------------------------- 1 | 3 | 38 | 137 | 142 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/edittable/DatasRow.vue: -------------------------------------------------------------------------------- 1 | 36 | 124 | 129 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/edittable/ParamsRow.vue: -------------------------------------------------------------------------------- 1 | 36 | 124 | 129 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/attrs/DataAttr.vue: -------------------------------------------------------------------------------- 1 | 44 | 45 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/RuleAttr.vue: -------------------------------------------------------------------------------- 1 | 86 | 87 | 174 | 175 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/SettingModal.vue: -------------------------------------------------------------------------------- 1 | 89 | 90 | 170 | 171 | -------------------------------------------------------------------------------- /packages/rule/designer/config/args-config.js: -------------------------------------------------------------------------------- 1 | export let ruleConfig = { 2 | jsPlumbInsConfig: { 3 | Connector: [ 4 | "Flowchart", 5 | { 6 | gap: 5, 7 | cornerRadius: 8, 8 | alwaysRespectStubs: true 9 | } 10 | ], 11 | ConnectionOverlays: [ 12 | [ 13 | 'Arrow', 14 | { 15 | width: 10, 16 | length: 10, 17 | location: 1 18 | } 19 | ] 20 | ], 21 | PaintStyle: { 22 | stroke: "#2a2929", 23 | strokeWidth: 2 24 | }, 25 | HoverPaintStyle: { 26 | stroke: "#409EFF", 27 | strokeWidth: 3 28 | }, 29 | EndpointStyle: { 30 | fill: "#456", 31 | stroke: "#2a2929", 32 | strokeWidth: 1, 33 | radius: 3 34 | }, 35 | EndpointHoverStyle: { 36 | fill: "pink" 37 | } 38 | }, 39 | jsPlumbConfig: { 40 | anchor: { 41 | default: ["Bottom", "Right", "Top", "Left"] 42 | }, 43 | conn: { 44 | isDetachable: false 45 | }, 46 | makeSourceConfig: { 47 | filter: "a", 48 | filterExclude: true, 49 | maxConnections: -1, 50 | endpoint: [ "Dot", { radius: 7 } ], 51 | anchor: ["Bottom", "Right", "Top", "Left"] 52 | }, 53 | makeTargetConfig: { 54 | filter: "a", 55 | filterExclude: true, 56 | maxConnections: -1, 57 | endpoint: [ "Dot", { radius: 7 } ], 58 | anchor: ["Bottom", "Right", "Top", "Left"] 59 | } 60 | }, 61 | jsPlumbConfigCard: { 62 | anchor: { 63 | default: ["Right", "Left"] 64 | }, 65 | conn: { 66 | isDetachable: false 67 | }, 68 | makeSourceConfig: { 69 | filter: "a", 70 | filterExclude: true, 71 | maxConnections: -1, 72 | endpoint: [ "Dot", { radius: 7 } ], 73 | anchor: ["Right", "Left"] 74 | }, 75 | makeTargetConfig: { 76 | filter: "a", 77 | filterExclude: true, 78 | maxConnections: -1, 79 | endpoint: [ "Dot", { radius: 7 } ], 80 | anchor: ["Right", "Left"] 81 | } 82 | }, 83 | defaultStyle: { 84 | dragOpacity: 0.7, 85 | alignGridPX: [5, 5], 86 | alignSpacing: { 87 | level: 100, 88 | vertical: 100 89 | }, 90 | alignDuration: 300, 91 | containerScale: { 92 | init: 1, 93 | min: 0.5, 94 | max: 3, 95 | onceNarrow: 0.1, 96 | onceEnlarge: 0.1 97 | }, 98 | isOpenAuxiliaryLine: true, 99 | showAuxiliaryLineDistance: 20, 100 | movePx: 5, 101 | photoBlankDistance: 200 102 | }, 103 | // ID的生成类型。1.uuid uuid 2.time_stamp 时间戳 3.sequence 序列 4.time_stamp_and_sequence 时间戳加序列 5.custom 自定义 104 | idType: 'uuid', 105 | ruleStatus: { 106 | CREATE: '0', 107 | SAVE: '1', 108 | MODIFY: '2', 109 | LOADING: '3' 110 | }, 111 | shortcut: { 112 | multiple: { 113 | code: 17, 114 | codeName: 'CTRL', 115 | shortcutName: '多选', 116 | }, 117 | dragContainer: { 118 | code: 32, 119 | codeName: 'SPACE', 120 | shortcutName: '画布拖拽', 121 | }, 122 | scaleContainer: { 123 | code: 18, 124 | codeName: 'ALT(firefox下为SHIFT)', 125 | shortcutName: '画布缩放', 126 | }, 127 | dragTool: { 128 | code: 68, 129 | codeName: 'D', 130 | shortcutName: '拖拽工具', 131 | }, 132 | connTool: { 133 | code: 76, 134 | codeName: 'L', 135 | shortcutName: '连线工具', 136 | }, 137 | zoomInTool: { 138 | code: 190, 139 | codeName: '<', 140 | shortcutName: '放大工具', 141 | }, 142 | zoomOutTool: { 143 | code: 188, 144 | codeName: '>', 145 | shortcutName: '缩小工具', 146 | }, 147 | leftMove: { 148 | code: 37, 149 | codeName: '←', 150 | shortcutName: '左移', 151 | }, 152 | upMove: { 153 | code: 38, 154 | codeName: '↑', 155 | shortcutName: '上移', 156 | }, 157 | rightMove: { 158 | code: 39, 159 | codeName: '→', 160 | shortcutName: '右移', 161 | }, 162 | downMove: { 163 | code: 40, 164 | codeName: '↓', 165 | shortcutName: '下移', 166 | }, 167 | settingModal: { 168 | code: 83, 169 | codeName: 'CTRL+ALT+S', 170 | shortcutName: '打开设置页面' 171 | }, 172 | testModal: { 173 | code: 84, 174 | codeName: 'CTRL+ALT+T', 175 | shortcutName: '打开测试页面', 176 | } 177 | }, 178 | contextMenu: { 179 | container: { 180 | menuName: 'rule-menu', 181 | axis: { 182 | x: null, 183 | y: null 184 | }, 185 | menulists: [ 186 | { 187 | fnHandler: 'ruleInfo', 188 | icoName: 'edit', 189 | btnName: '规则图信息' 190 | }, 191 | { 192 | fnHandler: 'paste', 193 | icoName: 'edit', 194 | btnName: '粘贴' 195 | }, 196 | { 197 | fnHandler: 'selectAll', 198 | icoName: 'edit', 199 | btnName: '全选' 200 | }, 201 | { 202 | fnHandler: 'saveRule', 203 | icoName: 'edit', 204 | btnName: '保存规则' 205 | }, 206 | { 207 | iconName: 'edit', 208 | fnHandler: 'addRemark', 209 | btnName: '添加备注' 210 | }, 211 | { 212 | icoName: 'edit', 213 | btnName: '对齐方式', 214 | children: [ 215 | { 216 | icoName: 'edit', 217 | fnHandler: 'verticaLeft', 218 | btnName: '垂直左对齐' 219 | }, 220 | { 221 | icoName: 'edit', 222 | fnHandler: 'verticalCenter', 223 | btnName: '垂直居中' 224 | }, 225 | { 226 | icoName: 'edit', 227 | fnHandler: 'verticalRight', 228 | btnName: '垂直右对齐' 229 | }, 230 | { 231 | icoName: 'edit', 232 | fnHandler: 'levelUp', 233 | btnName: '水平上对齐' 234 | }, 235 | { 236 | icoName: 'edit', 237 | fnHandler: 'levelCenter', 238 | btnName: '水平居中' 239 | }, 240 | { 241 | icoName: 'edit', 242 | fnHandler: 'levelDown', 243 | btnName: '水平下对齐' 244 | } 245 | ] 246 | } 247 | ] 248 | }, 249 | node: { 250 | menuName: 'node-menu', 251 | axis: { 252 | x: null, 253 | y: null 254 | }, 255 | menulists: [ 256 | { 257 | fnHandler: 'copyNode', 258 | icoName: 'edit', 259 | btnName: '复制节点' 260 | }, 261 | { 262 | fnHandler: 'deleteNode', 263 | icoName: 'edit', 264 | btnName: '删除节点' 265 | } 266 | ] 267 | }, 268 | link: { 269 | menuName: 'link-menu', 270 | axis: { 271 | x: null, 272 | y: null 273 | }, 274 | menulists: [ 275 | { 276 | fnHandler: 'deleteLink', 277 | icoName: 'edit', 278 | btnName: '删除连线' 279 | } 280 | ] 281 | } 282 | } 283 | }; 284 | -------------------------------------------------------------------------------- /packages/rule/designer/config/basic-icon-config.js: -------------------------------------------------------------------------------- 1 | export const startSvg = ` 2 | 3 | 4 | 5 | 6 | `; 7 | 8 | export const endSvg = ` 9 | 10 | 11 | 12 | 13 | ` 14 | 15 | export const commonSvg = ` 16 | 17 | 18 | 19 | 20 | ` 21 | 22 | export const freedomSvg = ` 23 | 24 | 25 | 26 | 27 | 28 | ` 29 | 30 | export const gatewaySvg = ` 31 | 32 | 33 | 34 | 35 | ` 36 | 37 | export const eventSvg = ` 38 | 39 | 40 | 41 | ` 42 | 43 | export const childRuleSvg = ` 44 | 45 | 46 | 47 | ` 48 | 49 | export const xLaneSvg = ` 50 | 51 | 52 | 53 | ` 54 | 55 | export const yLaneSvg = ` 56 | 57 | 58 | 59 | ` 60 | 61 | export const lanePoolSvg = ` 62 | 63 | 64 | 65 | ` 66 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/RuleNode.vue: -------------------------------------------------------------------------------- 1 | 140 | 141 | 142 | 259 | 260 | 263 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/RuleTools.vue: -------------------------------------------------------------------------------- 1 | 88 | 89 | 424 | 425 | -------------------------------------------------------------------------------- /packages/rule/designer/modules/RuleArea.vue: -------------------------------------------------------------------------------- 1 | 66 | 67 | 685 | 686 | 689 | -------------------------------------------------------------------------------- /packages/rule/designer/RuleDesigner.vue: -------------------------------------------------------------------------------- 1 | 90 | 659 | --------------------------------------------------------------------------------