From b01759652e59c48cbe62ecd783edc904ee7b80ea Mon Sep 17 00:00:00 2001 From: Luo Fan <44999219+fannluo@users.noreply.github.com> Date: Tue, 16 Apr 2019 19:18:37 +0800 Subject: [PATCH] =?UTF-8?q?improvement:=20=E6=9B=B4=E6=96=B0elint=E8=A7=84?= =?UTF-8?q?=E5=88=99=E5=B7=B2=E7=BB=8F=E7=9B=B8=E5=85=B3=E5=90=88=E6=B3=95?= =?UTF-8?q?=E6=80=A7=E4=BF=AE=E6=94=B9=20(#149)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline/blueflow/.eslintrc.js | 498 ++++- pipeline/blueflow/builds/webpack.base.js | 15 +- .../blueflow/builds/webpack.prod.config.js | 2 +- pipeline/blueflow/package.json | 15 +- pipeline/blueflow/postcss.config.js | 2 +- pipeline/blueflow/src/App.vue | 177 +- pipeline/blueflow/src/api/fileDownload.js | 7 +- pipeline/blueflow/src/api/index.js | 94 +- pipeline/blueflow/src/api/interceptors.js | 8 +- .../common/Individualization/IpLogContent.vue | 166 +- .../common/PipelineCanvas/ConfigBar.vue | 165 +- .../common/PipelineCanvas/MenuBar.vue | 258 +-- .../common/PipelineCanvas/NodeCanvas.vue | 10 +- .../common/PipelineCanvas/NodeTemplate.vue | 304 ++- .../common/PipelineCanvas/index.vue | 996 +++++---- .../common/RenderForm/FormGroup.vue | 264 +-- .../components/common/RenderForm/FormItem.vue | 424 ++-- .../RenderForm/IpSelector/ConditionItem.vue | 144 +- .../RenderForm/IpSelector/DynamicIp.vue | 194 +- .../RenderForm/IpSelector/IpSearchInput.vue | 54 +- .../IpSelector/MultipleIpSelector.vue | 126 +- .../RenderForm/IpSelector/SelectCondition.vue | 98 +- .../IpSelector/SingleIpSelector.vue | 82 +- .../common/RenderForm/IpSelector/StaticIp.vue | 327 ++- .../IpSelector/StaticIpAddingPanel.vue | 188 +- .../common/RenderForm/IpSelector/index.vue | 276 ++- .../common/RenderForm/RenderForm.vue | 353 ++-- .../common/RenderForm/formMixins.js | 4 +- .../common/RenderForm/tags/TagCheckbox.vue | 80 +- .../common/RenderForm/tags/TagDatatable.vue | 483 +++-- .../common/RenderForm/tags/TagDatetime.vue | 51 +- .../common/RenderForm/tags/TagInput.vue | 165 +- .../common/RenderForm/tags/TagInt.vue | 52 +- .../common/RenderForm/tags/TagIpSelector.vue | 184 +- .../RenderForm/tags/TagMember_selector.vue | 41 +- .../common/RenderForm/tags/TagPassword.vue | 121 +- .../common/RenderForm/tags/TagRadio.vue | 72 +- .../common/RenderForm/tags/TagSelect.vue | 317 ++- .../common/RenderForm/tags/TagText.vue | 26 +- .../common/RenderForm/tags/TagTextarea.vue | 61 +- .../common/RenderForm/tags/TagTree.vue | 265 ++- .../common/RenderForm/tags/TagUpload.vue | 202 +- .../components/common/base/BaseCheckbox.vue | 40 +- .../components/common/base/BaseCollapse.vue | 50 +- .../src/components/common/base/BaseInput.vue | 48 +- .../src/components/common/base/BaseSearch.vue | 42 +- .../src/components/common/base/BaseTitle.vue | 10 +- .../src/components/common/base/NoData.vue | 31 +- .../common/dataTable/DataTablePagination.vue | 496 ++--- .../components/common/modal/ErrorCode401.vue | 28 +- .../components/common/modal/ErrorCode403.vue | 22 +- .../components/common/modal/ErrorCode405.vue | 41 +- .../components/common/modal/ErrorCode406.vue | 37 +- .../components/common/modal/ErrorCode407.vue | 22 +- .../components/common/modal/ErrorCode500.vue | 21 +- .../common/modal/ErrorCodeModal.vue | 116 +- .../common/modal/UserLoginModal.vue | 30 +- .../src/components/layout/BizSelector.vue | 188 +- .../src/components/layout/CopyrightFooter.vue | 39 +- .../src/components/layout/Navigator.vue | 461 ++-- .../components/layout/NotFoundComponent.vue | 38 +- .../src/components/tags/TagTestDatetime.vue | 40 +- pipeline/blueflow/src/config/setting.js | 14 +- pipeline/blueflow/src/constants/index.js | 2 +- pipeline/blueflow/src/directives/index.js | 2 +- pipeline/blueflow/src/main.js | 2 - .../blueflow/src/mixins/js/analysisMixins.js | 2 +- .../blueflow/src/pages/appmaker/AppCard.vue | 71 +- .../src/pages/appmaker/AppEditDialog.vue | 277 ++- .../src/pages/appmaker/AppTaskHome/index.vue | 349 ++-- .../blueflow/src/pages/appmaker/index.vue | 370 ++-- pipeline/blueflow/src/pages/audit/index.vue | 529 +++-- pipeline/blueflow/src/pages/config/index.vue | 146 +- pipeline/blueflow/src/pages/error/index.vue | 64 +- pipeline/blueflow/src/pages/functor/index.vue | 675 +++--- .../blueflow/src/pages/home/HomeSummary.vue | 28 +- .../src/pages/home/QuickCreateTask.vue | 250 ++- .../src/pages/home/SelectTemplateDialog.vue | 186 +- .../blueflow/src/pages/home/TaskFeeds.vue | 204 +- .../src/pages/home/TaskPercentChart.vue | 93 +- pipeline/blueflow/src/pages/home/index.vue | 411 ++-- .../PeriodicList/DeletePeriodicDialog.vue | 46 +- .../PeriodicList/ModifyPeriodicDialog.vue | 269 ++- .../src/pages/periodic/PeriodicList/index.vue | 452 ++-- .../blueflow/src/pages/periodic/index.vue | 8 +- .../src/pages/statistics/Appmaker/index.vue | 735 ++++--- .../src/pages/statistics/Atom/index.vue | 1104 +++++----- .../src/pages/statistics/Instance/index.vue | 1108 +++++----- .../src/pages/statistics/Template/index.vue | 959 +++++---- .../pages/statistics/dataStatistics/index.vue | 96 +- .../blueflow/src/pages/statistics/index.vue | 94 +- .../blueflow/src/pages/task/NodePreview.vue | 98 +- .../pages/task/TaskCreate/TaskParamFill.vue | 476 ++--- .../pages/task/TaskCreate/TaskSelectNode.vue | 1198 +++++------ .../src/pages/task/TaskCreate/index.vue | 234 +-- .../pages/task/TaskExecute/ExecuteInfo.vue | 334 ++- .../task/TaskExecute/GatewaySelectDialog.vue | 56 +- .../pages/task/TaskExecute/ModifyParams.vue | 188 +- .../src/pages/task/TaskExecute/ModifyTime.vue | 229 +- .../src/pages/task/TaskExecute/NodeTree.vue | 80 +- .../src/pages/task/TaskExecute/RetryNode.vue | 231 +- .../TaskExecute/TaskFunctionalization.vue | 271 +-- .../pages/task/TaskExecute/TaskOperation.vue | 1851 ++++++++--------- .../src/pages/task/TaskExecute/ViewParams.vue | 221 +- .../src/pages/task/TaskExecute/index.vue | 178 +- .../pages/task/TaskExecute/revokeDialog.vue | 34 +- .../pages/task/TaskList/TaskCloneDialog.vue | 71 +- .../src/pages/task/TaskList/index.vue | 744 ++++--- .../blueflow/src/pages/task/TaskParamEdit.vue | 277 ++- pipeline/blueflow/src/pages/task/TaskStep.vue | 119 +- pipeline/blueflow/src/pages/task/index.vue | 8 +- .../template/TemplateEdit/NodeConfig.vue | 1676 ++++++++------- .../template/TemplateEdit/ReuseVarDialog.vue | 206 +- .../TemplateSetting/TabGlobalVariables.vue | 410 ++-- .../TemplateSetting/TabLocalDraft.vue | 165 +- .../TemplateSetting/TabTemplateConfig.vue | 186 +- .../TemplateSetting/TemplateSetting.vue | 243 ++- .../TemplateSetting/VariableEdit.vue | 684 +++--- .../TemplateSetting/VariableEditDialog.vue | 58 +- .../src/pages/template/TemplateEdit/index.vue | 1560 +++++++------- .../TemplateList/AuthorityManageDialog.vue | 192 +- .../TemplateList/ExportTemplateDialog.vue | 301 ++- .../TemplateList/ImportTemplateDialog.vue | 1015 +++++---- .../src/pages/template/TemplateList/index.vue | 813 ++++---- .../blueflow/src/pages/template/index.vue | 8 +- pipeline/blueflow/src/routers/index.js | 7 +- pipeline/blueflow/src/store/index.js | 23 +- .../blueflow/src/store/modules/appmaker.js | 14 +- .../blueflow/src/store/modules/atomForm.js | 9 +- .../blueflow/src/store/modules/atomList.js | 12 +- pipeline/blueflow/src/store/modules/audit.js | 5 +- pipeline/blueflow/src/store/modules/config.js | 4 +- .../blueflow/src/store/modules/function.js | 9 +- .../blueflow/src/store/modules/periodic.js | 22 +- pipeline/blueflow/src/store/modules/task.js | 58 +- .../blueflow/src/store/modules/taskList.js | 10 +- .../blueflow/src/store/modules/template.js | 106 +- .../src/store/modules/templateList.js | 20 +- pipeline/blueflow/src/utils/atomFilter.js | 7 +- pipeline/blueflow/src/utils/bus.js | 2 +- pipeline/blueflow/src/utils/checkDataType.js | 2 +- pipeline/blueflow/src/utils/dom.js | 10 +- pipeline/blueflow/src/utils/draft.js | 60 +- pipeline/blueflow/src/utils/formatPosition.js | 123 +- pipeline/blueflow/src/utils/nodeFilter.js | 23 +- pipeline/blueflow/src/utils/tools.js | 5 +- pipeline/blueflow/src/utils/uuid.js | 2 +- .../blueflow/src/utils/validatePipeline.js | 61 +- 148 files changed, 16512 insertions(+), 16214 deletions(-) diff --git a/pipeline/blueflow/.eslintrc.js b/pipeline/blueflow/.eslintrc.js index e91a0b95f3..41c827c69c 100644 --- a/pipeline/blueflow/.eslintrc.js +++ b/pipeline/blueflow/.eslintrc.js @@ -12,44 +12,478 @@ module.exports = { root: true, parserOptions: { - parser: "babel-eslint", - ecmaVersion: 2017, + parser: 'babel-eslint', sourceType: 'module' }, env: { browser: true, }, + extends: [ + 'plugin:vue/recommended', + 'standard' + ], + // required to lint *.vue files + plugins: [ + 'vue' + ], + globals: { + // value 为 true 允许被重写,为 false 不允许被重写 + NODE_ENV: true, + SITE_URL: true, + gettext: true, + getCookie: true, + $: true + }, + // add your custom rules hered rules: { - "no-debugger": process.env.NODE_ENV === "production" ? 2 : 0, - "arrow-parens": 0, - "no-empty": "error", - "no-extra-semi": "error", - "semi": ["error", "never"], - "generator-star-spacing": 0, - "no-unused-vars": 0, - "indent": ["error", 4, { - "SwitchCase": 1 - }], - "space-before-function-paren": ["error", { - "anonymous": "always", - "named": "always", - "asyncArrow": "always" - }], - "no-trailing-spaces": ["error", { - "skipBlankLines": true - }], - "comma-dangle": ["error", "never"], - "key-spacing": ["error", { - "beforeColon": false - }], - "keyword-spacing": ["error", { - "before": true, - "after": true - }], - "space-infix-ops": "error", - "spaced-comment": ["error", "always"], + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/array-bracket-spacing.md + 'vue/array-bracket-spacing': ['error', 'never'], + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/arrow-spacing.md + 'vue/arrow-spacing': ['error', {'before': true, 'after': true}], + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/attribute-hyphenation.md + 'vue/attribute-hyphenation': ['error', 'always'], + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/attributes-order.md + // 属性顺序,不限制 + 'vue/attributes-order': 'off', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/block-spacing.md + 'vue/block-spacing': ['error', 'always'], + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/brace-style.md + 'vue/brace-style': ['error', '1tbs', {'allowSingleLine': false}], + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/camelcase.md + // 后端数据字段经常不是驼峰,所以不限制 properties,也不限制解构 + // 'vue/camelcase': ['error', {'properties': 'never', 'ignoreDestructuring': true}], + // @todo: 驼峰问题统一修改 + 'vue/camelcase': 'off', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/comma-dangle.md + // 禁止使用拖尾逗号,如 {demo: 'test',} + 'vue/comma-dangle': ['error', 'never'], + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/comment-directive.md + // vue 文件 template 中允许 eslint-disable eslint-enable eslint-disable-line eslint-disable-next-line + // 行内注释启用/禁用某些规则,配置为 1 即允许 + 'vue/comment-directive': 1, + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/component-name-in-template-casing.md + // 组件 html 标签的形式,连字符形式,所有 html 标签均会检测,如引入第三方不可避免,可通过 ignores 配置,支持正则,不限制 + 'vue/component-name-in-template-casing': 'off', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/dot-location.md + // 等待 https://github.com/vuejs/eslint-plugin-vue/pull/794 合入 + // 'vue/dot-location': ['error', 'property'], + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/eqeqeq.md + 'vue/eqeqeq': ['error', 'always', {'null': 'ignore'}], + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-closing-bracket-newline.md + // 单行写法不需要换行,多行需要,不限制 + 'vue/html-closing-bracket-newline': 'off', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-closing-bracket-spacing.md + 'vue/html-closing-bracket-spacing': ['error', { + 'startTag': 'never', + 'endTag': 'never', + 'selfClosingTag': 'always' + }], + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-end-tags.md + 'vue/html-end-tags': 'error', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-indent.md + 'vue/html-indent': ['error', 4, { + 'attribute': 1, + 'baseIndent': 1, + 'closeBracket': 0, + 'alignAttributesVertically': false, + 'ignores': [] + }], + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-quotes.md + 'vue/html-quotes': ['error', 'double'], + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/html-self-closing.md + // html tag 是否自闭和,不限制 + 'vue/html-self-closing': 'off', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/jsx-uses-vars.md + // 当变量在 `JSX` 中被使用了,那么 eslint 就不会报出 `no-unused-vars` 的错误。需要开启 eslint no-unused-vars 规则才适用 + 'vue/jsx-uses-vars': 1, + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/key-spacing.md + 'vue/key-spacing': ['error', {'beforeColon': false, 'afterColon': true}], + + // 关键字周围空格一致性,在关键字前后保留空格,如 if () else {} + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/keyword-spacing.md + // 等待 https://github.com/vuejs/eslint-plugin-vue/pull/795 合入 + // 'vue/keyword-spacing': ['error', {'before': true, 'after': true}], + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/match-component-file-name.md + // 组件名称属性与其文件名匹配,不限制 + 'vue/match-component-file-name': 'off', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/max-attributes-per-line.md + // 每行属性的最大个数,不限制 + 'vue/max-attributes-per-line': 'off', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/multiline-html-element-content-newline.md + // 在多行元素的内容前后需要换行符,不限制 + 'vue/multiline-html-element-content-newline': 'off', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/mustache-interpolation-spacing.md + // template 中 {{var}},不限制 + 'vue/mustache-interpolation-spacing': 'off', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/name-property-casing.md + 'vue/name-property-casing': 'off', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-async-in-computed-properties.md + 'vue/no-async-in-computed-properties': 'error', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-boolean-default.md + 'vue/no-boolean-default': 'off', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-confusing-v-for-v-if.md + 'vue/no-confusing-v-for-v-if': 'error', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-dupe-keys.md + // 二级属性名禁止重复 + 'vue/no-dupe-keys': 'error', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-duplicate-attributes.md + // 禁止 html 元素中出现重复的属性 + 'vue/no-duplicate-attributes': 'error', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-empty-pattern.md + // 等待 https://github.com/vuejs/eslint-plugin-vue/pull/798 合入 + // 禁止解构中出现空 {} 或 [] + // 'vue/no-empty-pattern': 'error', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-multi-spaces.md + // 删除 html 标签中连续多个不用于缩进的空格 + 'vue/no-multi-spaces': 'error', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-parsing-error.md + // 禁止语法错误 + 'vue/no-parsing-error': 'error', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-reserved-keys.md + // 禁止使用保留字 + 'vue/no-reserved-keys': 'error', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-restricted-syntax.md + // 禁止使用特定的语法 + 'vue/no-restricted-syntax': 'off', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-shared-component-data.md + // data 属性必须是函数 + 'vue/no-shared-component-data': 'error', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-side-effects-in-computed-properties.md + // 禁止在计算属性对属性进行修改,不限制 + 'vue/no-side-effects-in-computed-properties': 'off', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-spaces-around-equal-signs-in-attribute.md + 'vue/no-spaces-around-equal-signs-in-attribute': 'error', + + // https://github.com/vuejs/eslint-plugin-vue/blob/master/docs/rules/no-template-key.md + // 禁止在 - - diff --git a/pipeline/blueflow/src/components/common/PipelineCanvas/index.vue b/pipeline/blueflow/src/components/common/PipelineCanvas/index.vue index 4d860a3a47..ef5c09d847 100644 --- a/pipeline/blueflow/src/components/common/PipelineCanvas/index.vue +++ b/pipeline/blueflow/src/components/common/PipelineCanvas/index.vue @@ -11,7 +11,7 @@ */ - diff --git a/pipeline/blueflow/src/components/common/RenderForm/IpSelector/ConditionItem.vue b/pipeline/blueflow/src/components/common/RenderForm/IpSelector/ConditionItem.vue index 86bd693e80..acee801429 100644 --- a/pipeline/blueflow/src/components/common/RenderForm/IpSelector/ConditionItem.vue +++ b/pipeline/blueflow/src/components/common/RenderForm/IpSelector/ConditionItem.vue @@ -26,97 +26,97 @@ {{i18n.notEmpty}}
- - + +
- - - - diff --git a/pipeline/blueflow/src/components/common/RenderForm/IpSelector/DynamicIp.vue b/pipeline/blueflow/src/components/common/RenderForm/IpSelector/DynamicIp.vue index 380ed2cb8c..ff8d681387 100644 --- a/pipeline/blueflow/src/components/common/RenderForm/IpSelector/DynamicIp.vue +++ b/pipeline/blueflow/src/components/common/RenderForm/IpSelector/DynamicIp.vue @@ -41,114 +41,114 @@ - - diff --git a/pipeline/blueflow/src/components/common/RenderForm/IpSelector/IpSearchInput.vue b/pipeline/blueflow/src/components/common/RenderForm/IpSelector/IpSearchInput.vue index 0f95519136..2e191a0db1 100644 --- a/pipeline/blueflow/src/components/common/RenderForm/IpSelector/IpSearchInput.vue +++ b/pipeline/blueflow/src/components/common/RenderForm/IpSelector/IpSearchInput.vue @@ -16,41 +16,41 @@ class="search-input" :placeholder="placeholder" v-model="keyword" - @input="onInputChange"/> + @input="onInputChange" /> - - diff --git a/pipeline/blueflow/src/components/common/RenderForm/IpSelector/SelectCondition.vue b/pipeline/blueflow/src/components/common/RenderForm/IpSelector/SelectCondition.vue index 7de225feb4..a1bb8337da 100644 --- a/pipeline/blueflow/src/components/common/RenderForm/IpSelector/SelectCondition.vue +++ b/pipeline/blueflow/src/components/common/RenderForm/IpSelector/SelectCondition.vue @@ -20,7 +20,7 @@ - - diff --git a/pipeline/blueflow/src/components/common/RenderForm/IpSelector/SingleIpSelector.vue b/pipeline/blueflow/src/components/common/RenderForm/IpSelector/SingleIpSelector.vue index 3d16a99689..1c52577770 100644 --- a/pipeline/blueflow/src/components/common/RenderForm/IpSelector/SingleIpSelector.vue +++ b/pipeline/blueflow/src/components/common/RenderForm/IpSelector/SingleIpSelector.vue @@ -15,9 +15,9 @@
- + {{selector.name}}
@@ -26,62 +26,62 @@ v-show="activeSelector === 'ip'" ref="ip" :editable="editable" - :staticIpList="staticIpList" - :staticIps="staticIps" + :static-ip-list="staticIpList" + :static-ips="staticIps" @change="onStaticIpChange"> - - diff --git a/pipeline/blueflow/src/components/common/RenderForm/IpSelector/StaticIp.vue b/pipeline/blueflow/src/components/common/RenderForm/IpSelector/StaticIp.vue index d387febbe4..4614c36435 100644 --- a/pipeline/blueflow/src/components/common/RenderForm/IpSelector/StaticIp.vue +++ b/pipeline/blueflow/src/components/common/RenderForm/IpSelector/StaticIp.vue @@ -21,7 +21,7 @@ @hide="onDropdownHide"> {{i18n.moreOperations}} - +
{{item.agent ? 'Agent' + i18n.normal : 'Agent' + i18n.error}} {{i18n.remove}} @@ -91,186 +91,186 @@
- diff --git a/pipeline/blueflow/src/components/common/RenderForm/IpSelector/StaticIpAddingPanel.vue b/pipeline/blueflow/src/components/common/RenderForm/IpSelector/StaticIpAddingPanel.vue index 96957bd726..1d1796af5b 100644 --- a/pipeline/blueflow/src/components/common/RenderForm/IpSelector/StaticIpAddingPanel.vue +++ b/pipeline/blueflow/src/components/common/RenderForm/IpSelector/StaticIpAddingPanel.vue @@ -38,7 +38,7 @@ @@ -69,112 +69,112 @@ - diff --git a/pipeline/blueflow/src/components/common/RenderForm/tags/TagInput.vue b/pipeline/blueflow/src/components/common/RenderForm/tags/TagInput.vue index 8e9ff5eda6..cacfb745a5 100644 --- a/pipeline/blueflow/src/components/common/RenderForm/tags/TagInput.vue +++ b/pipeline/blueflow/src/components/common/RenderForm/tags/TagInput.vue @@ -40,100 +40,100 @@ - diff --git a/pipeline/blueflow/src/components/common/RenderForm/tags/TagInt.vue b/pipeline/blueflow/src/components/common/RenderForm/tags/TagInt.vue index 993d95f6b4..e72e52029b 100644 --- a/pipeline/blueflow/src/components/common/RenderForm/tags/TagInt.vue +++ b/pipeline/blueflow/src/components/common/RenderForm/tags/TagInt.vue @@ -24,37 +24,37 @@ - - - diff --git a/pipeline/blueflow/src/components/common/RenderForm/tags/TagTree.vue b/pipeline/blueflow/src/components/common/RenderForm/tags/TagTree.vue index b8af4fa0c3..87390cf38b 100644 --- a/pipeline/blueflow/src/components/common/RenderForm/tags/TagTree.vue +++ b/pipeline/blueflow/src/components/common/RenderForm/tags/TagTree.vue @@ -27,163 +27,162 @@ @check="_handleBoxCheck" @node-expand="nodeExpend" @node-collapse="nodeCollapse" - > + > {{validateInfo.message}} - - diff --git a/pipeline/blueflow/src/components/common/base/BaseSearch.vue b/pipeline/blueflow/src/components/common/base/BaseSearch.vue index 6b896c4369..2de3df221d 100644 --- a/pipeline/blueflow/src/components/common/base/BaseSearch.vue +++ b/pipeline/blueflow/src/components/common/base/BaseSearch.vue @@ -18,35 +18,35 @@ - + - diff --git a/pipeline/blueflow/src/components/common/dataTable/DataTablePagination.vue b/pipeline/blueflow/src/components/common/dataTable/DataTablePagination.vue index e07ee0c59e..0cadfa430b 100644 --- a/pipeline/blueflow/src/components/common/dataTable/DataTablePagination.vue +++ b/pipeline/blueflow/src/components/common/dataTable/DataTablePagination.vue @@ -11,279 +11,279 @@ */ - diff --git a/pipeline/blueflow/src/components/common/modal/ErrorCode406.vue b/pipeline/blueflow/src/components/common/modal/ErrorCode406.vue index 927b79ff11..046970e2b0 100644 --- a/pipeline/blueflow/src/components/common/modal/ErrorCode406.vue +++ b/pipeline/blueflow/src/components/common/modal/ErrorCode406.vue @@ -25,27 +25,27 @@ - diff --git a/pipeline/blueflow/src/components/common/modal/ErrorCode407.vue b/pipeline/blueflow/src/components/common/modal/ErrorCode407.vue index 94693ea565..8e2727cb8d 100644 --- a/pipeline/blueflow/src/components/common/modal/ErrorCode407.vue +++ b/pipeline/blueflow/src/components/common/modal/ErrorCode407.vue @@ -19,19 +19,19 @@ - - diff --git a/pipeline/blueflow/src/components/common/modal/ErrorCode500.vue b/pipeline/blueflow/src/components/common/modal/ErrorCode500.vue index bf8cad489b..bf3a357134 100644 --- a/pipeline/blueflow/src/components/common/modal/ErrorCode500.vue +++ b/pipeline/blueflow/src/components/common/modal/ErrorCode500.vue @@ -17,19 +17,19 @@ - diff --git a/pipeline/blueflow/src/components/common/modal/ErrorCodeModal.vue b/pipeline/blueflow/src/components/common/modal/ErrorCodeModal.vue index 91cad98d5a..70180d7a27 100644 --- a/pipeline/blueflow/src/components/common/modal/ErrorCodeModal.vue +++ b/pipeline/blueflow/src/components/common/modal/ErrorCodeModal.vue @@ -11,78 +11,81 @@ */ - diff --git a/pipeline/blueflow/src/components/common/modal/UserLoginModal.vue b/pipeline/blueflow/src/components/common/modal/UserLoginModal.vue index 7326d3ddb3..046391a01d 100644 --- a/pipeline/blueflow/src/components/common/modal/UserLoginModal.vue +++ b/pipeline/blueflow/src/components/common/modal/UserLoginModal.vue @@ -32,23 +32,22 @@ - diff --git a/pipeline/blueflow/src/components/layout/BizSelector.vue b/pipeline/blueflow/src/components/layout/BizSelector.vue index 6989de5fa3..aa02dae709 100644 --- a/pipeline/blueflow/src/components/layout/BizSelector.vue +++ b/pipeline/blueflow/src/components/layout/BizSelector.vue @@ -11,24 +11,24 @@ */ - diff --git a/pipeline/blueflow/src/components/layout/CopyrightFooter.vue b/pipeline/blueflow/src/components/layout/CopyrightFooter.vue index 2de9e0b3b2..8d5306a348 100644 --- a/pipeline/blueflow/src/components/layout/CopyrightFooter.vue +++ b/pipeline/blueflow/src/components/layout/CopyrightFooter.vue @@ -23,28 +23,28 @@ - diff --git a/pipeline/blueflow/src/components/layout/Navigator.vue b/pipeline/blueflow/src/components/layout/Navigator.vue index 88fbee234d..e3c62094fa 100644 --- a/pipeline/blueflow/src/components/layout/Navigator.vue +++ b/pipeline/blueflow/src/components/layout/Navigator.vue @@ -12,23 +12,23 @@ - - diff --git a/pipeline/blueflow/src/pages/appmaker/AppEditDialog.vue b/pipeline/blueflow/src/pages/appmaker/AppEditDialog.vue index a40ba2b7f7..7020fee355 100644 --- a/pipeline/blueflow/src/pages/appmaker/AppEditDialog.vue +++ b/pipeline/blueflow/src/pages/appmaker/AppEditDialog.vue @@ -10,7 +10,7 @@ * specific language governing permissions and limitations under the License. */ - diff --git a/pipeline/blueflow/src/pages/appmaker/index.vue b/pipeline/blueflow/src/pages/appmaker/index.vue index 94e345cdd9..9f0dba97e4 100644 --- a/pipeline/blueflow/src/pages/appmaker/index.vue +++ b/pipeline/blueflow/src/pages/appmaker/index.vue @@ -16,7 +16,7 @@ {{i18n.addApp}} @@ -26,17 +26,17 @@
{{i18n.creator}} - +
{{i18n.creatorTime}} - - + +
@@ -47,15 +47,15 @@
-
+
+ @onCardDelete="onCardDelete" />
@@ -66,10 +66,10 @@
@@ -83,194 +83,194 @@ :is-show.sync="isDeleteDialogShow" @confirm="onDeleteConfirm" @cancel="onDeleteCancel"> -
+
{{i18n.deleteTips}}
- - diff --git a/pipeline/blueflow/src/pages/audit/index.vue b/pipeline/blueflow/src/pages/audit/index.vue index 0804f3298a..5ce75f1010 100644 --- a/pipeline/blueflow/src/pages/audit/index.vue +++ b/pipeline/blueflow/src/pages/audit/index.vue @@ -15,7 +15,7 @@ @@ -64,11 +64,11 @@
{{i18n.creator}} - +
{{i18n.operator}} - +
{{i18n.status}} @@ -90,7 +90,7 @@
- +
@@ -135,7 +135,7 @@ @@ -156,278 +156,278 @@ - diff --git a/pipeline/blueflow/src/pages/config/index.vue b/pipeline/blueflow/src/pages/config/index.vue index 97e2f45434..3f09916a36 100644 --- a/pipeline/blueflow/src/pages/config/index.vue +++ b/pipeline/blueflow/src/pages/config/index.vue @@ -13,11 +13,11 @@

{{i18n.title}}

-
+
- +
@@ -50,85 +50,85 @@
- - diff --git a/pipeline/blueflow/src/pages/error/index.vue b/pipeline/blueflow/src/pages/error/index.vue index 2923e1a3e2..0af71ab789 100644 --- a/pipeline/blueflow/src/pages/error/index.vue +++ b/pipeline/blueflow/src/pages/error/index.vue @@ -18,41 +18,41 @@
- diff --git a/pipeline/blueflow/src/pages/home/HomeSummary.vue b/pipeline/blueflow/src/pages/home/HomeSummary.vue index 6366f2d20b..4a399fc5e3 100644 --- a/pipeline/blueflow/src/pages/home/HomeSummary.vue +++ b/pipeline/blueflow/src/pages/home/HomeSummary.vue @@ -81,23 +81,23 @@
- diff --git a/pipeline/blueflow/src/pages/home/SelectTemplateDialog.vue b/pipeline/blueflow/src/pages/home/SelectTemplateDialog.vue index d2542f0a3a..9938f99a2e 100644 --- a/pipeline/blueflow/src/pages/home/SelectTemplateDialog.vue +++ b/pipeline/blueflow/src/pages/home/SelectTemplateDialog.vue @@ -23,10 +23,10 @@
+ v-bkloading="{ isLoading: submitting || selectTemplateLoading, opacity: 1 }">
@@ -46,7 +46,7 @@ v-for="item in group.list" :key="item.id" @click="onSelectTemplate(item)"> - + {{item.name}} @@ -60,7 +60,7 @@ :key="item.id" @click="onSelectTemplate(item)" class="template-item"> - + {{item.name}} @@ -106,106 +106,105 @@ - diff --git a/pipeline/blueflow/src/pages/home/TaskFeeds.vue b/pipeline/blueflow/src/pages/home/TaskFeeds.vue index e31c8e984f..84ac66d937 100644 --- a/pipeline/blueflow/src/pages/home/TaskFeeds.vue +++ b/pipeline/blueflow/src/pages/home/TaskFeeds.vue @@ -13,9 +13,9 @@

{{i18n.feeds}}

{{i18n.viewMore}} -
+
    -
  • +
  • @@ -46,115 +46,115 @@
- - diff --git a/pipeline/blueflow/src/pages/home/TaskPercentChart.vue b/pipeline/blueflow/src/pages/home/TaskPercentChart.vue index 30717705cc..9b97580784 100644 --- a/pipeline/blueflow/src/pages/home/TaskPercentChart.vue +++ b/pipeline/blueflow/src/pages/home/TaskPercentChart.vue @@ -19,56 +19,56 @@
- diff --git a/pipeline/blueflow/src/pages/home/index.vue b/pipeline/blueflow/src/pages/home/index.vue index 798d4d751c..de38d6dfb8 100644 --- a/pipeline/blueflow/src/pages/home/index.vue +++ b/pipeline/blueflow/src/pages/home/index.vue @@ -10,31 +10,31 @@ * specific language governing permissions and limitations under the License. */ - - diff --git a/pipeline/blueflow/src/pages/periodic/PeriodicList/DeletePeriodicDialog.vue b/pipeline/blueflow/src/pages/periodic/PeriodicList/DeletePeriodicDialog.vue index b93aa0c95f..0c6b836d05 100644 --- a/pipeline/blueflow/src/pages/periodic/PeriodicList/DeletePeriodicDialog.vue +++ b/pipeline/blueflow/src/pages/periodic/PeriodicList/DeletePeriodicDialog.vue @@ -19,39 +19,38 @@ :is-show.sync="isDeleteDialogShow" @confirm="onDeletePeriodicConfrim" @cancel="onDeletePeriodicCancel"> -
+
{{deleteInfo}}
- diff --git a/pipeline/blueflow/src/pages/periodic/PeriodicList/ModifyPeriodicDialog.vue b/pipeline/blueflow/src/pages/periodic/PeriodicList/ModifyPeriodicDialog.vue index 8a9eaa03a9..11aa638ea0 100644 --- a/pipeline/blueflow/src/pages/periodic/PeriodicList/ModifyPeriodicDialog.vue +++ b/pipeline/blueflow/src/pages/periodic/PeriodicList/ModifyPeriodicDialog.vue @@ -19,7 +19,7 @@ :is-show.sync="isModifyDialogShow" @confirm="onModifyPeriodicConfirm" @cancel="onModifyPeriodicCancel"> -
+

{{ i18n.periodicInfo }}

@@ -28,7 +28,7 @@ + v-validate="periodicRule" /> {{ errors.first('periodicCron') }} @@ -55,150 +55,149 @@ - - diff --git a/pipeline/blueflow/src/pages/task/NodePreview.vue b/pipeline/blueflow/src/pages/task/NodePreview.vue index 133f48f853..32fa276533 100644 --- a/pipeline/blueflow/src/pages/task/NodePreview.vue +++ b/pipeline/blueflow/src/pages/task/NodePreview.vue @@ -14,10 +14,10 @@
-
+
- diff --git a/pipeline/blueflow/src/pages/task/TaskCreate/index.vue b/pipeline/blueflow/src/pages/task/TaskCreate/index.vue index 64116a04a2..896c56c451 100644 --- a/pipeline/blueflow/src/pages/task/TaskCreate/index.vue +++ b/pipeline/blueflow/src/pages/task/TaskCreate/index.vue @@ -16,17 +16,17 @@ }"> + :current-step="currentStep"> - - diff --git a/pipeline/blueflow/src/pages/task/TaskExecute/ModifyTime.vue b/pipeline/blueflow/src/pages/task/TaskExecute/ModifyTime.vue index 12dc11b534..e9e8026bd0 100644 --- a/pipeline/blueflow/src/pages/task/TaskExecute/ModifyTime.vue +++ b/pipeline/blueflow/src/pages/task/TaskExecute/ModifyTime.vue @@ -10,7 +10,7 @@ * specific language governing permissions and limitations under the License. */ - - diff --git a/pipeline/blueflow/src/pages/task/TaskExecute/RetryNode.vue b/pipeline/blueflow/src/pages/task/TaskExecute/RetryNode.vue index 41039c7e21..8e5f415343 100644 --- a/pipeline/blueflow/src/pages/task/TaskExecute/RetryNode.vue +++ b/pipeline/blueflow/src/pages/task/TaskExecute/RetryNode.vue @@ -10,7 +10,7 @@ * specific language governing permissions and limitations under the License. */ - - diff --git a/pipeline/blueflow/src/pages/task/TaskExecute/ViewParams.vue b/pipeline/blueflow/src/pages/task/TaskExecute/ViewParams.vue index 620b822e61..18d51bf83e 100644 --- a/pipeline/blueflow/src/pages/task/TaskExecute/ViewParams.vue +++ b/pipeline/blueflow/src/pages/task/TaskExecute/ViewParams.vue @@ -14,11 +14,11 @@
-
+

{{ i18n.atom_params }}

@@ -26,7 +26,7 @@ v-if="!loading" :key="currentNode" :scheme="renderConfig" - :formOption="renderOption" + :form-option="renderOption" v-model="renderData">
@@ -36,125 +36,125 @@
- diff --git a/pipeline/blueflow/src/pages/task/TaskExecute/index.vue b/pipeline/blueflow/src/pages/task/TaskExecute/index.vue index 9ca75c0fc3..8d1bb96047 100644 --- a/pipeline/blueflow/src/pages/task/TaskExecute/index.vue +++ b/pipeline/blueflow/src/pages/task/TaskExecute/index.vue @@ -10,121 +10,121 @@ * specific language governing permissions and limitations under the License. */ - diff --git a/pipeline/blueflow/src/pages/task/TaskList/index.vue b/pipeline/blueflow/src/pages/task/TaskList/index.vue index eeaa37b7aa..5a8e68154a 100644 --- a/pipeline/blueflow/src/pages/task/TaskList/index.vue +++ b/pipeline/blueflow/src/pages/task/TaskList/index.vue @@ -15,7 +15,7 @@ @@ -65,15 +65,15 @@
{{i18n.creator}} - +
{{i18n.executor}} - +
{{i18n.status}} -
-
ID
-
+
+
@@ -133,7 +133,7 @@ @@ -153,8 +153,8 @@ @@ -169,395 +169,393 @@ :is-show.sync="isDeleteDialogShow" @confirm="onDeleteConfirm" @cancel="onDeleteCancel"> -
+
{{i18n.deleleTip + '"' + theDeleteTaskName + '"?'}}
- diff --git a/pipeline/blueflow/src/pages/task/TaskStep.vue b/pipeline/blueflow/src/pages/task/TaskStep.vue index 28079bd3e5..117185008b 100644 --- a/pipeline/blueflow/src/pages/task/TaskStep.vue +++ b/pipeline/blueflow/src/pages/task/TaskStep.vue @@ -10,7 +10,7 @@ * specific language governing permissions and limitations under the License. */ - diff --git a/pipeline/blueflow/src/pages/task/index.vue b/pipeline/blueflow/src/pages/task/index.vue index adbebd58cc..25a08c5b89 100644 --- a/pipeline/blueflow/src/pages/task/index.vue +++ b/pipeline/blueflow/src/pages/task/index.vue @@ -13,8 +13,8 @@ diff --git a/pipeline/blueflow/src/pages/template/TemplateEdit/NodeConfig.vue b/pipeline/blueflow/src/pages/template/TemplateEdit/NodeConfig.vue index bd35a649a3..69d0afac53 100644 --- a/pipeline/blueflow/src/pages/template/TemplateEdit/NodeConfig.vue +++ b/pipeline/blueflow/src/pages/template/TemplateEdit/NodeConfig.vue @@ -12,7 +12,7 @@ - diff --git a/pipeline/blueflow/src/pages/template/TemplateEdit/TemplateSetting/TabGlobalVariables.vue b/pipeline/blueflow/src/pages/template/TemplateEdit/TemplateSetting/TabGlobalVariables.vue index 611e68a4c0..0f5bb8d996 100644 --- a/pipeline/blueflow/src/pages/template/TemplateEdit/TemplateSetting/TabGlobalVariables.vue +++ b/pipeline/blueflow/src/pages/template/TemplateEdit/TemplateSetting/TabGlobalVariables.vue @@ -39,14 +39,14 @@
    - +
  • @@ -92,8 +92,8 @@ :key="`${constant.key}-edit`"> @@ -103,8 +103,8 @@
  • @@ -131,220 +131,216 @@ +© 2019 GitHub, Inc. +Terms +Privacy +Security +Status +Help +Contact GitHub +Pricing +API +Training +Blog +About diff --git a/pipeline/blueflow/src/pages/template/TemplateEdit/TemplateSetting/VariableEditDialog.vue b/pipeline/blueflow/src/pages/template/TemplateEdit/TemplateSetting/VariableEditDialog.vue index fe7305b18f..e83df2ba26 100644 --- a/pipeline/blueflow/src/pages/template/TemplateEdit/TemplateSetting/VariableEditDialog.vue +++ b/pipeline/blueflow/src/pages/template/TemplateEdit/TemplateSetting/VariableEditDialog.vue @@ -23,7 +23,7 @@ @@ -31,37 +31,37 @@ - - diff --git a/pipeline/blueflow/src/pages/template/TemplateEdit/index.vue b/pipeline/blueflow/src/pages/template/TemplateEdit/index.vue index 0f612c7903..93e40cfc29 100644 --- a/pipeline/blueflow/src/pages/template/TemplateEdit/index.vue +++ b/pipeline/blueflow/src/pages/template/TemplateEdit/index.vue @@ -10,22 +10,22 @@ * specific language governing permissions and limitations under the License. */ - - diff --git a/pipeline/blueflow/src/pages/template/TemplateList/ExportTemplateDialog.vue b/pipeline/blueflow/src/pages/template/TemplateList/ExportTemplateDialog.vue index a95e36bb6c..7b2ceb2a83 100644 --- a/pipeline/blueflow/src/pages/template/TemplateList/ExportTemplateDialog.vue +++ b/pipeline/blueflow/src/pages/template/TemplateList/ExportTemplateDialog.vue @@ -23,10 +23,10 @@
    -
    +
      diff --git a/pipeline/blueflow/src/pages/template/TemplateList/index.vue b/pipeline/blueflow/src/pages/template/TemplateList/index.vue index 3c589ef500..6a993093c4 100644 --- a/pipeline/blueflow/src/pages/template/TemplateList/index.vue +++ b/pipeline/blueflow/src/pages/template/TemplateList/index.vue @@ -41,7 +41,7 @@ @@ -90,7 +90,7 @@
    {{i18n.creator}} - +
    {{i18n.query}} @@ -99,7 +99,7 @@
    -
    +
ID
-
+
@@ -126,7 +126,7 @@ - @@ -141,10 +141,10 @@ class="create-template-btn" :to="getEditTemplateUrl(item.id)"> {{ i18n.edit }} - - - - +
{{item.category_name}} {{item.edit_time}} + {{getSubflowContent(item)}} {{item.creator_name}} @@ -167,8 +167,8 @@ :to="getNewTaskUrl(item.id)"> {{ i18n.newTemplate }} - - + + - + @@ -218,16 +218,16 @@ - @@ -241,14 +241,14 @@ :is-show.sync="isDeleteDialogShow" @confirm="onDeleteConfirm" @cancel="onDeleteCancel"> -
+
{{i18n.deleleTip + '"' + deleteTemplateName + '"' + '?' }}
- diff --git a/pipeline/blueflow/src/pages/template/index.vue b/pipeline/blueflow/src/pages/template/index.vue index adbebd58cc..25a08c5b89 100644 --- a/pipeline/blueflow/src/pages/template/index.vue +++ b/pipeline/blueflow/src/pages/template/index.vue @@ -13,8 +13,8 @@ diff --git a/pipeline/blueflow/src/routers/index.js b/pipeline/blueflow/src/routers/index.js index 925d41d3a4..9b51262519 100644 --- a/pipeline/blueflow/src/routers/index.js +++ b/pipeline/blueflow/src/routers/index.js @@ -22,7 +22,7 @@ const Template = () => import('@/pages/template/index.vue') const TemplateEdit = () => import('@/pages/template/TemplateEdit/index.vue') const TemplateList = () => import('@/pages/template/TemplateList/index.vue') -const Task = () => import( '@/pages/task/index.vue') +const Task = () => import('@/pages/task/index.vue') const TaskList = () => import('@/pages/task/TaskList/index.vue') const TaskCreate = () => import('@/pages/task/TaskCreate/index.vue') const TaskExecute = () => import('@/pages/task/TaskExecute/index.vue') @@ -261,9 +261,9 @@ const routers = new VueRouter({ ] }) -routers.beforeEach ((to, from, next) => { +routers.beforeEach((to, from, next) => { // 生产环境 404 页面头部导航跳转统一设置为首页 - if (process.env.NODE_ENV === "production" && to.name === 'notFoundPage') { + if (process.env.NODE_ENV === 'production' && to.name === 'notFoundPage') { store.commit('setNotFoundPage', true) } else { store.commit('setNotFoundPage', false) @@ -275,5 +275,4 @@ routers.beforeEach ((to, from, next) => { next() }) - export default routers diff --git a/pipeline/blueflow/src/store/index.js b/pipeline/blueflow/src/store/index.js index 7b4015281b..9f6ea47738 100644 --- a/pipeline/blueflow/src/store/index.js +++ b/pipeline/blueflow/src/store/index.js @@ -12,7 +12,7 @@ import Vue from 'vue' import Vuex from 'vuex' import modules from './modules/index.js' -import api from "@/api" +import api from '@/api' Vue.use(Vuex) @@ -74,10 +74,10 @@ const store = new Vuex.Store({ setNotFoundPage (state, val) { state.notFoundPage = val }, - setCategorys (state,data) { + setCategorys (state, data) { state.categorys = data }, - setSingleAtomList (state,data) { + setSingleAtomList (state, data) { state.components = data }, setBusinessTimezone (state, data) { @@ -88,7 +88,7 @@ const store = new Vuex.Store({ } }, actions: { - getBizList ({commit}, isAll) { + getBizList ({ commit }, isAll) { api.getBizList(isAll).then(response => { if (isAll) { commit('setAllBusinessList', response.data.objects) @@ -97,20 +97,20 @@ const store = new Vuex.Store({ } }) }, - changeDefaultBiz ({commit}, ccId) { + changeDefaultBiz ({ commit }, ccId) { return api.changeDefaultBiz(ccId).then(response => response.data) }, - getCategorys ({commit}) { + getCategorys ({ commit }) { api.getCategorys().then(response => { commit('setCategorys', response.data.data) }) }, - getSingleAtomList ({commit}) { + getSingleAtomList ({ commit }) { api.getSingleAtomList().then(response => { commit('setSingleAtomList', response.data.objects) }) }, - getBusinessTimezone ({commit}) { + getBusinessTimezone ({ commit }) { api.getBusinessTimezone().then(response => { const data = response.data if (data.time_zone === undefined) { @@ -118,16 +118,15 @@ const store = new Vuex.Store({ } else { commit('setBusinessTimezone', data.time_zone) } - }) }, - getHostInCC ({commmit}, fields) { + getHostInCC ({ commmit }, fields) { return api.loadHostInCC(fields).then(response => response.data) }, - getTopoTreeInCC ({commmit}) { + getTopoTreeInCC ({ commmit }) { return api.loadTopoTreeInCC().then(response => response.data) }, - getTopoModelInCC ({commit}) { + getTopoModelInCC ({ commit }) { return api.loadTopoModelInCC().then(response => response.data) } }, diff --git a/pipeline/blueflow/src/store/modules/appmaker.js b/pipeline/blueflow/src/store/modules/appmaker.js index 836ca6eb91..228388a061 100644 --- a/pipeline/blueflow/src/store/modules/appmaker.js +++ b/pipeline/blueflow/src/store/modules/appmaker.js @@ -18,25 +18,25 @@ const appmaker = { mutations: { }, actions: { - loadAppmakerSummary ({commit}, data) { + loadAppmakerSummary ({ commit }, data) { return api.loadAppmakerSummary(data).then(response => response.data) }, - loadAppmakerDetail ({commit}, id) { + loadAppmakerDetail ({ commit }, id) { return api.loadAppmakerDetail(id).then(response => response.data) }, - appmakerEdit ({commit}, data) { + appmakerEdit ({ commit }, data) { return api.appmakerEdit(data).then(response => response.data) }, - appmakerDelete ({commit}, id) { + appmakerDelete ({ commit }, id) { return api.appmakerDelete(id).then(response => response.data) }, - queryAppmakerData ({commit}, data) { + queryAppmakerData ({ commit }, data) { return api.queryAppmaker(data).then(response => response.data) }, - loadAppmaker ({commit}, data) { + loadAppmaker ({ commit }, data) { return api.loadAppmaker(data).then(response => response.data) } } } -export default appmaker \ No newline at end of file +export default appmaker diff --git a/pipeline/blueflow/src/store/modules/atomForm.js b/pipeline/blueflow/src/store/modules/atomForm.js index a981db075a..b0463952bc 100644 --- a/pipeline/blueflow/src/store/modules/atomForm.js +++ b/pipeline/blueflow/src/store/modules/atomForm.js @@ -11,7 +11,6 @@ */ import Vue from 'vue' import api from '@/api/index.js' -import { debug } from 'util' const META_FORM_TYPE = { 'select': 'select_meta' @@ -30,7 +29,7 @@ const atomForm = { state.fetching = status }, setAtomForm (state, payload) { - let atomType = payload.isMeta ? META_FORM_TYPE[payload.atomType] : payload.atomType + const atomType = payload.isMeta ? META_FORM_TYPE[payload.atomType] : payload.atomType Vue.set(state.form, atomType, payload.data) }, setAtomConfig (state, payload) { @@ -47,7 +46,7 @@ const atomForm = { } }, actions: { - loadAtomConfig ({commit, state}, payload) { + loadAtomConfig ({ commit, state }, payload) { const { atomType, classify, isMeta } = payload const atomClassify = classify || 'component' return api.$getAtomForm(atomType, atomClassify, isMeta || 0).then( @@ -56,7 +55,7 @@ const atomForm = { Promise.reject(e) }) }, - loadSubflowConfig ({commit}, payload) { + loadSubflowConfig ({ commit }, payload) { const { templateId, version, common } = payload return api.getFormByTemplateId(templateId, version, common).then( response => response.data @@ -65,4 +64,4 @@ const atomForm = { } } -export default atomForm \ No newline at end of file +export default atomForm diff --git a/pipeline/blueflow/src/store/modules/atomList.js b/pipeline/blueflow/src/store/modules/atomList.js index be0e8aa68b..323e6da97c 100644 --- a/pipeline/blueflow/src/store/modules/atomList.js +++ b/pipeline/blueflow/src/store/modules/atomList.js @@ -19,10 +19,10 @@ const atomList = { searchAtomResult: [] }, mutations: { - setSingleAtom (state, data){ + setSingleAtom (state, data) { state.singleAtom = [...data] }, - setSubAtom (state, data){ + setSubAtom (state, data) { state.subAtom = [...data] }, searchAtom (state, payload) { @@ -38,13 +38,13 @@ const atomList = { } }, actions: { - loadSingleAtomList ({commit}) { + loadSingleAtomList ({ commit }) { return api.getSingleAtomList().then(response => response.data.objects) }, - loadSubAtomList ({commit}, data) { + loadSubAtomList ({ commit }, data) { return api.getSubAtomList(data).then(response => response.data.objects) }, - queryAtomData ({commit}, data) { + queryAtomData ({ commit }, data) { return api.queryAtom(data).then(response => response.data) } }, @@ -75,4 +75,4 @@ const atomList = { } } -export default atomList \ No newline at end of file +export default atomList diff --git a/pipeline/blueflow/src/store/modules/audit.js b/pipeline/blueflow/src/store/modules/audit.js index 252e0b70f7..afde6b870a 100644 --- a/pipeline/blueflow/src/store/modules/audit.js +++ b/pipeline/blueflow/src/store/modules/audit.js @@ -9,7 +9,6 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -import Vue from 'vue' import api from '@/api/index.js' const auditTask = { @@ -19,7 +18,7 @@ const auditTask = { mutations: { }, actions: { - loadAuditTaskList ({commit}, data) { + loadAuditTaskList ({ commit }, data) { return api.loadAuditTaskList(data).then( response => response.data ) @@ -27,4 +26,4 @@ const auditTask = { } } -export default auditTask \ No newline at end of file +export default auditTask diff --git a/pipeline/blueflow/src/store/modules/config.js b/pipeline/blueflow/src/store/modules/config.js index ae432d09bb..cc5077226d 100644 --- a/pipeline/blueflow/src/store/modules/config.js +++ b/pipeline/blueflow/src/store/modules/config.js @@ -14,7 +14,7 @@ import api from '@/api/index.js' const config = { namespaced: true, actions: { - configBizExecutor ({commit}, data) { + configBizExecutor ({ commit }, data) { return api.configBizExecutor(data).then(response => response.data) }, loadBizConfig () { @@ -25,4 +25,4 @@ const config = { } } -export default config \ No newline at end of file +export default config diff --git a/pipeline/blueflow/src/store/modules/function.js b/pipeline/blueflow/src/store/modules/function.js index 895e04d31e..02908474ed 100644 --- a/pipeline/blueflow/src/store/modules/function.js +++ b/pipeline/blueflow/src/store/modules/function.js @@ -9,7 +9,6 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -import Vue from 'vue' import api from '@/api/index.js' const functionTask = { @@ -19,17 +18,17 @@ const functionTask = { mutations: { }, actions: { - loadFunctionTaskList ({commit}, data) { + loadFunctionTaskList ({ commit }, data) { return api.getFunctionTaskList(data).then( response => response.data ) }, - loadFunctionBusinessList ({commit}) { + loadFunctionBusinessList ({ commit }) { return api.loadFunctionBusinessList().then( response => response.data ) }, - loadFunctionTemplateList ({commit},cc_id) { + loadFunctionTemplateList ({ commit }, cc_id) { return api.loadFunctionTemplateList(cc_id).then( response => response.data ) @@ -37,4 +36,4 @@ const functionTask = { } } -export default functionTask \ No newline at end of file +export default functionTask diff --git a/pipeline/blueflow/src/store/modules/periodic.js b/pipeline/blueflow/src/store/modules/periodic.js index 91d138808e..f95efd8182 100644 --- a/pipeline/blueflow/src/store/modules/periodic.js +++ b/pipeline/blueflow/src/store/modules/periodic.js @@ -9,37 +9,35 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -import api from "@/api/index.js" -import tools from '@/utils/tools.js' +import api from '@/api/index.js' const periodic = { namespaced: true, - mutations: { - }, + mutations: {}, actions: { - loadPeriodicList ({commit}, data) { + loadPeriodicList ({ commit }, data) { return api.getPeriodicList(data).then(response => response.data) }, - createPeriodic ({state},data) { + createPeriodic ({ state }, data) { return api.createPeriodic(data).then(response => response.data) }, - setPeriodicEnable ({commit}, data) { + setPeriodicEnable ({ commit }, data) { return api.setPeriodicEnable(data).then(response => response.data) }, - modifyPeriodicCron ({commit}, data) { + modifyPeriodicCron ({ commit }, data) { return api.modifyPeriodicCron(data).then(response => response.data) }, - getPeriodic ({commit}, data) { + getPeriodic ({ commit }, data) { return api.getPeriodic(data).then(response => response.data) }, - modifyPeriodicConstants ({commit}, data) { + modifyPeriodicConstants ({ commit }, data) { return api.modifyPeriodicConstants(data).then(response => response.data) }, - deletePeriodic ({commit}, taskId) { + deletePeriodic ({ commit }, taskId) { return api.deletePeriodic(taskId).then(response => response.data) } }, getters: {} } -export default periodic \ No newline at end of file +export default periodic diff --git a/pipeline/blueflow/src/store/modules/task.js b/pipeline/blueflow/src/store/modules/task.js index 78490d9439..4f0841aeb5 100644 --- a/pipeline/blueflow/src/store/modules/task.js +++ b/pipeline/blueflow/src/store/modules/task.js @@ -22,89 +22,89 @@ const task = { } }, actions: { - loadTaskScheme ({commit}, payload) { - const { cc_id, template_id} = payload - return api.getTaskScheme({cc_id, template_id}).then(response => response.data.objects) + loadTaskScheme ({ commit }, payload) { + const { cc_id, template_id } = payload + return api.getTaskScheme({ cc_id, template_id }).then(response => response.data.objects) }, - createTaskScheme ({commit}, payload) { + createTaskScheme ({ commit }, payload) { return api.createTaskScheme(payload).then(response => response.data) }, - deleteTaskScheme ({commit}, schemeId) { + deleteTaskScheme ({ commit }, schemeId) { return api.deleteTaskScheme(schemeId).then(response => response.data) }, - getSchemeDetail ({commit}, schemeId) { + getSchemeDetail ({ commit }, schemeId) { return api.getSchemeDetail(schemeId).then(response => response.data) }, - loadPreviewNodeData ({commit}, payload) { + loadPreviewNodeData ({ commit }, payload) { return api.getPreviewNodeData(payload).then(response => response.data) }, - createTask ({commit}, data) { + createTask ({ commit }, data) { return api.createTask(data).then(response => response.data) }, - getTaskInstanceData ({commit}, instance_id) { + getTaskInstanceData ({ commit }, instance_id) { return api.getTaskInstanceData(instance_id).then(response => response.data) }, - claimFuncTask ({commit}, data) { + claimFuncTask ({ commit }, data) { return api.claimFuncTask(data).then(response => response.data) }, - getInstanceStatus ({commit}, data) { + getInstanceStatus ({ commit }, data) { return api.getInstanceStatus(data).then(response => response.data) }, - instanceStart ({commit}, instance_id) { + instanceStart ({ commit }, instance_id) { return api.instanceStart(instance_id).then(response => response.data) }, - instancePause ({commit}, instance_id) { + instancePause ({ commit }, instance_id) { return api.instancePause(instance_id).then(response => response.data) }, - subInstancePause ({commit}, data) { + subInstancePause ({ commit }, data) { return api.subInstancePause(data).then(response => response.data) }, - instanceResume ({commit}, instance_id) { + instanceResume ({ commit }, instance_id) { return api.instanceResume(instance_id).then(response => response.data) }, - subInstanceResume ({commit}, data) { + subInstanceResume ({ commit }, data) { return api.subInstanceResume(data).then(response => response.data) }, - instanceRevoke ({commit}, instance_id) { + instanceRevoke ({ commit }, instance_id) { return api.instanceRevoke(instance_id).then(response => response.data) }, - instanceModifyParams ({commit}, data) { + instanceModifyParams ({ commit }, data) { return api.instanceModifyParams(data).then(response => response.data) }, - getNodeActDetail ({commit}, data) { + getNodeActDetail ({ commit }, data) { return api.getNodeActDetail(data).then(response => response.data) }, - getNodeActInfo ({commit}, data) { + getNodeActInfo ({ commit }, data) { return api.getNodeActInfo(data).then(response => response.data) }, - instanceRetry ({commit}, data) { + instanceRetry ({ commit }, data) { return api.instanceRetry(data).then(response => response.data) }, - setSleepNode ({commit}, data) { + setSleepNode ({ commit }, data) { return api.setSleepNode(data).then(response => response.data) }, - instanceNodeSkip ({commit}, data) { + instanceNodeSkip ({ commit }, data) { return api.instanceNodeSkip(data).then(response => response.data) }, - skipExclusiveGateway ({commit}, data) { + skipExclusiveGateway ({ commit }, data) { return api.instanceBranchSkip(data).then(response => response.data) }, - pauseNodeResume ({commit}, data) { + pauseNodeResume ({ commit }, data) { return api.pauseNodeResume(data).then(response => response.data) }, loadAppmakerSummary () { return api.loadAppmakerSummary().then(response => response.data) }, - loadTaskCount ({commit}, params) { + loadTaskCount ({ commit }, params) { return api.loadTaskCount(params).then(response => response.data) }, - queryInstanceData ({commit}, data) { + queryInstanceData ({ commit }, data) { return api.queryInstance(data).then(response => response.data) }, - loadCreateMethod ({commit}) { + loadCreateMethod ({ commit }) { return api.loadCreateMethod().then(response => response.data) }, - getJobInstanceLog ({commit}, data) { + getJobInstanceLog ({ commit }, data) { return api.getJobInstanceLog(data).then(response => response.data) } } diff --git a/pipeline/blueflow/src/store/modules/taskList.js b/pipeline/blueflow/src/store/modules/taskList.js index ef8703cc32..7acb8681b7 100644 --- a/pipeline/blueflow/src/store/modules/taskList.js +++ b/pipeline/blueflow/src/store/modules/taskList.js @@ -9,7 +9,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -import api from "@/api/index.js" +import api from '@/api/index.js' const taskList = { namespaced: true, @@ -22,17 +22,17 @@ const taskList = { } }, actions: { - loadTaskList ({commit}, data) { + loadTaskList ({ commit }, data) { return api.getTaskList(data).then(response => response.data) }, - deleteTask ({commit}, task_id) { + deleteTask ({ commit }, task_id) { return api.deleteTask(task_id).then(response => response.data.objects) }, - cloneTask ({commit}, data) { + cloneTask ({ commit }, data) { return api.cloneTask(data).then(response => response.data) } }, getters: {} } -export default taskList \ No newline at end of file +export default taskList diff --git a/pipeline/blueflow/src/store/modules/template.js b/pipeline/blueflow/src/store/modules/template.js index 58d598b96a..5662e2db3b 100644 --- a/pipeline/blueflow/src/store/modules/template.js +++ b/pipeline/blueflow/src/store/modules/template.js @@ -47,7 +47,6 @@ function generateInitLocation () { type: 'endpoint' } ] - } // 默认流程模板,activities 字段 function generateInitActivities (location, line) { @@ -174,8 +173,8 @@ const template = { setSubprocessUpdated (state, subflow) { state.subprocess_info.details.some(item => { if ( - subflow.template_id === item.template_id && - subflow.subprocess_node_id === item.subprocess_node_id + subflow.template_id === item.template_id + && subflow.subprocess_node_id === item.subprocess_node_id ) { item.expired = false subflow.version && (item.version = subflow.version) @@ -204,7 +203,7 @@ const template = { pipelineTreeOrder.forEach(key => { let val = pipelineData[key] - if (key !== 'constants'){ + if (key !== 'constants') { val = nodeFilter.convertInvalidIdData(key, val) // convert old invalid data =_=! } if (key === 'location') { @@ -226,7 +225,6 @@ const template = { } state[key] = val }) - }, setBusinessBaseInfo (state, data) { state.businessBaseInfo = data @@ -256,7 +254,7 @@ const template = { // 重置模板数据 resetTemplateData (state) { state.name = '' - state.activities = {} + state.activities = {} state.end_event = {} state.flows = {} state.gateways = {} @@ -287,7 +285,7 @@ const template = { const constant = state.constants[key] const { source_info } = constant - for (let id in source_info) { + for (const id in source_info) { if (state.activities[id]) { source_info[id].forEach(item => { let data @@ -310,7 +308,7 @@ const template = { }, // 配置全局变量 source_info 字段 setVariableSourceInfo (state, payload) { - const {type, id, key, tagCode} = payload + const { type, id, key, tagCode } = payload const constant = state.constants[key] if (!constant) return const sourceInfo = constant.source_info @@ -325,7 +323,7 @@ const template = { Vue.delete(sourceInfo, id) } else { let atomIndex - sourceInfo[id].some((item, index)=> { + sourceInfo[id].some((item, index) => { if (item === tagCode) { atomIndex = index return true @@ -337,7 +335,7 @@ const template = { }, // 配置分支网关条件 setBranchCondition (state, condition) { - const {id, nodeId, name} = condition + const { id, nodeId, name } = condition state.gateways[nodeId]['conditions'][id].evaluate = name }, // 节点增加、删除、编辑操作,数据更新 @@ -364,7 +362,7 @@ const template = { }, // 节点拖动,位置更新 setLocationXY (state, location) { - const {id, x, y} = location + const { id, x, y } = location state.location.some(item => { if (item.id === id) { item.x = x @@ -376,13 +374,11 @@ const template = { // 增加、删除节点连线操作,更新模板各相关字段数据 setLine (state, payload) { const { type, line } = payload - let lineIndex const isLineExist = state.line.some((item, index) => { if ( - item.source.id === line.source.id && - item.target.id === line.target.id + item.source.id === line.source.id + && item.target.id === line.target.id ) { - lineIndex = index return true } }) @@ -428,8 +424,8 @@ const template = { state.line.push(newLine) } else if (type === 'delete') { // async activities、flows、gateways、start_event、end_event let deletedLine - for (let item in state.flows) { - const flow = state.flows[item] + for (const item in state.flows) { + const flow = state.flows[item] if (flow.source === line.source.id && flow.target === line.target.id) { deletedLine = Object.assign({}, flow) } @@ -444,7 +440,9 @@ const template = { if (state.gateways[sourceNode]) { const gatewayNode = state.gateways[sourceNode] if (Array.isArray(gatewayNode.outgoing)) { - gatewayNode.outgoing = gatewayNode.outgoing.filter(item => { return item !== deletedLine.id}) + gatewayNode.outgoing = gatewayNode.outgoing.filter(item => { + return item !== deletedLine.id + }) if (gatewayNode.type === ATOM_TYPE_DICT['branchgateway']) { const conditions = gatewayNode.conditions conditions[deletedLine.id] && Vue.delete(conditions, deletedLine.id) @@ -456,7 +454,9 @@ const template = { if (state.gateways[targetNode]) { const gatewayNode = state.gateways[targetNode] if (Array.isArray(gatewayNode.incoming)) { - gatewayNode.incoming = gatewayNode.incoming.filter(item => { return item !== deletedLine.id}) + gatewayNode.incoming = gatewayNode.incoming.filter(item => { + return item !== deletedLine.id + }) } else { gatewayNode.incoming = '' } @@ -477,13 +477,13 @@ const template = { }, error_ignorable: false, id: location.id, - incoming: "", + incoming: '', loop: null, name: location.name, optional: false, - outgoing: "", + outgoing: '', stage_name: gettext('步骤1'), - type: "ServiceActivity", + type: 'ServiceActivity', can_retry: true, isSkipped: true } @@ -492,15 +492,15 @@ const template = { constants: {}, hooked_constants: [], id: location.id, - incoming: "", + incoming: '', loop: null, name: location.name, optional: false, - outgoing: "", + outgoing: '', stage_name: gettext('步骤1'), template_id: location.atomId, version: location.atomVersion, - type: "SubProcess" + type: 'SubProcess' } } } @@ -530,7 +530,9 @@ const template = { if (state.gateways[sourceNode]) { const gatewayNode = state.gateways[sourceNode] if (Array.isArray(gatewayNode.outgoing)) { - gatewayNode.outgoing = gatewayNode.outgoing.filter(item => { return item !== line}) + gatewayNode.outgoing = gatewayNode.outgoing.filter(item => { + return item !== line + }) if (gatewayNode.type === ATOM_TYPE_DICT['branchgateway']) { const conditions = gatewayNode.conditions conditions[line] && Vue.delete(conditions, line) @@ -542,7 +544,9 @@ const template = { if (state.gateways[targetNode]) { const gatewayNode = state.gateways[targetNode] if (Array.isArray(gatewayNode.incoming)) { - gatewayNode.incoming = gatewayNode.incoming.filter(item => { return item !== line}) + gatewayNode.incoming = gatewayNode.incoming.filter(item => { + return item !== line + }) } else { gatewayNode.incoming = '' } @@ -550,7 +554,7 @@ const template = { Vue.delete(state.flows, line) } }) - for (let cKey in state.constants) { + for (const cKey in state.constants) { const constant = state.constants[cKey] const sourceInfo = constant.source_info @@ -603,7 +607,6 @@ const template = { return item !== line }) } - } if (sourceGateway && sourceNode !== location.id) { if (typeof sourceGateway.outgoing === 'string') { @@ -630,16 +633,16 @@ const template = { if (!state.start_event.id) { state.start_event = { id: location.id, - incoming: "", + incoming: '', name: location.name, - outgoing: "", - type: "EmptyStartEvent" + outgoing: '', + type: 'EmptyStartEvent' } } } else if (type === 'delete') { let targetNode let lineId - for (let item in state.flows){ + for (const item in state.flows) { if (state.flows[item].source === location.id) { targetNode = state.flows[item].target lineId = state.flows[item].id @@ -668,16 +671,16 @@ const template = { if (!state.end_event.id) { state.end_event = { id: location.id, - incoming: "", + incoming: '', name: location.name, - outgoing: "", - type: "EmptyEndEvent" + outgoing: '', + type: 'EmptyEndEvent' } } } else if (type === 'delete') { let sourceNode let lineId - for (let item in state.flows){ + for (const item in state.flows) { if (state.flows[item].target === location.id) { sourceNode = state.flows[item].source lineId = state.flows[item].id @@ -717,7 +720,7 @@ const template = { // 修改state中的模板数据 replaceTemplate (state, template) { if (template !== undefined) { - for (let prop in template) { + for (const prop in template) { state[prop] = template[prop] } } @@ -725,7 +728,7 @@ const template = { // 修改lines和locations replaceLineAndLocation (state, payload) { // 需要做一次深层拷贝 - const {lines, locations} = tools.deepClone(payload) + const { lines, locations } = tools.deepClone(payload) state.line = lines state.location = locations } @@ -734,11 +737,11 @@ const template = { loadBusinessBaseInfo () { return api.getBusinessBaseInfo().then(response => response.data) }, - loadTemplateData ({commit}, data) { + loadTemplateData ({ commit }, data) { return api.getTemplateData(data).then(response => response.data) }, // 保存模板数据 - saveTemplateData ({state}, {templateId, ccId, common}) { + saveTemplateData ({ state }, { templateId, ccId, common }) { const { activities, constants, end_event, flows, gateways, line, location, outputs, start_event, notify_receivers, notify_type, time_out, category } = state @@ -756,8 +759,15 @@ const template = { }) // 完整的画布数据 const fullCanvasData = JSON.stringify({ - activities, constants, end_event, flows, gateways, line, - location: pureLocation, outputs, start_event + activities, + constants, + end_event, + flows, + gateways, + line, + location: pureLocation, + outputs, + start_event }) const data = { ccId, @@ -775,20 +785,20 @@ const template = { }) }, // 收藏模板,批量操作 - templateCollectSelect ({commit}, list) { + templateCollectSelect ({ commit }, list) { return api.templateCollectSelect(list).then(response => response.data) }, // 删除收藏模板,单个删除 - templateCollectDelete ({commit}, id) { + templateCollectDelete ({ commit }, id) { return api.templateCollectDelete(id).then(response => response.data) }, - queryTemplateData ({commit}, data) { + queryTemplateData ({ commit }, data) { return api.queryTemplate(data).then(response => response.data) }, - loadTemplateSummary ({commit}, data) { + loadTemplateSummary ({ commit }, data) { return api.loadTemplateSummary(data).then(response => response.data) }, - loadTemplateCollectList ({commit}) { + loadTemplateCollectList ({ commit }) { return api.loadTemplateCollectList().then(response => response.data) } }, diff --git a/pipeline/blueflow/src/store/modules/templateList.js b/pipeline/blueflow/src/store/modules/templateList.js index 4e6d3fcd9a..4ece5eb12c 100644 --- a/pipeline/blueflow/src/store/modules/templateList.js +++ b/pipeline/blueflow/src/store/modules/templateList.js @@ -9,7 +9,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -import api from "@/api" +import api from '@/api' const templateList = { namespaced: true, @@ -19,7 +19,7 @@ const templateList = { }, mutations: { setTemplateListData (state, payload) { - const {list, isCommon} = payload + const { list, isCommon } = payload if (isCommon) { state.commonTemplateData = list } else { @@ -28,32 +28,32 @@ const templateList = { } }, actions: { - loadTemplateList ({commit}, data) { + loadTemplateList ({ commit }, data) { return api.getTemplateList(data).then(response => response.data) }, - deleteTemplate ({commit}, template_id) { + deleteTemplate ({ commit }, template_id) { return api.deleteTemplate(template_id).then(response => response.data.objects) }, getBizPerson () { return api.getBizPerson().then(response => response.data) }, - getTemplatePersons ({commit}, data) { + getTemplatePersons ({ commit }, data) { return api.getTemplatePersons(data).then(response => response.data) }, - saveTemplatePersons ({commit}, data) { + saveTemplatePersons ({ commit }, data) { return api.saveTemplatePersons(data).then(response => response.data) }, - templateUploadCheck ({commit}, data) { + templateUploadCheck ({ commit }, data) { return api.templateUploadCheck(data).then(response => response.data) }, - templateImport ({commit}, data) { + templateImport ({ commit }, data) { return api.templateImport(data).then(response => response.data) }, - templateExport ({commit}, data) { + templateExport ({ commit }, data) { return api.templateExport(data).then(response => response.data) } }, getters: {} } -export default templateList \ No newline at end of file +export default templateList diff --git a/pipeline/blueflow/src/utils/atomFilter.js b/pipeline/blueflow/src/utils/atomFilter.js index 5df984e964..3d9e86dd99 100644 --- a/pipeline/blueflow/src/utils/atomFilter.js +++ b/pipeline/blueflow/src/utils/atomFilter.js @@ -14,7 +14,7 @@ import tools from './tools.js' const atomFilter = { formFilter (tag_code, config) { let formConfig - if (tag_code && config){ + if (tag_code && config) { config.some(item => { if (item.tag_code === tag_code) { formConfig = item @@ -33,7 +33,7 @@ const atomFilter = { return formConfig }, getFormItemDefaultValue (config) { - let value = {} + const value = {} config.forEach(item => { if (item.type === 'combine') { value[item.tag_code] = this.getFormItemDefaultValue(item.attrs.children) @@ -77,7 +77,6 @@ const atomFilter = { break default: val = '' - } } @@ -89,4 +88,4 @@ const atomFilter = { } } -export default atomFilter \ No newline at end of file +export default atomFilter diff --git a/pipeline/blueflow/src/utils/bus.js b/pipeline/blueflow/src/utils/bus.js index 8a8dbdc453..4aa4fe1766 100644 --- a/pipeline/blueflow/src/utils/bus.js +++ b/pipeline/blueflow/src/utils/bus.js @@ -13,4 +13,4 @@ import Vue from 'vue' const bus = new Vue() -export default bus \ No newline at end of file +export default bus diff --git a/pipeline/blueflow/src/utils/checkDataType.js b/pipeline/blueflow/src/utils/checkDataType.js index e3790ad939..129b29729b 100644 --- a/pipeline/blueflow/src/utils/checkDataType.js +++ b/pipeline/blueflow/src/utils/checkDataType.js @@ -12,4 +12,4 @@ export function checkDataType (data) { const typeString = Object.prototype.toString.call(data) return typeString.slice(8, -1) -} \ No newline at end of file +} diff --git a/pipeline/blueflow/src/utils/dom.js b/pipeline/blueflow/src/utils/dom.js index 6e439b8018..2ad52417f9 100644 --- a/pipeline/blueflow/src/utils/dom.js +++ b/pipeline/blueflow/src/utils/dom.js @@ -11,15 +11,17 @@ */ const dom = { nodeContains: function (root, el) { - if (root.compareDocumentPosition) + if (root.compareDocumentPosition) { return root === el || !!(root.compareDocumentPosition(el) & 16) - if (root.contains && el.nodeType === 1){ + } + if (root.contains && el.nodeType === 1) { return root.contains(el) && root !== el } - while ((el = el.parentNode)) + while ((el = el.parentNode)) { if (el === root) return true + } return false } } -export default dom \ No newline at end of file +export default dom diff --git a/pipeline/blueflow/src/utils/draft.js b/pipeline/blueflow/src/utils/draft.js index fc1ad44118..57d08bd1f2 100644 --- a/pipeline/blueflow/src/utils/draft.js +++ b/pipeline/blueflow/src/utils/draft.js @@ -21,8 +21,8 @@ const draft = { let index = 0 while (remainingLocalStorageSize < minDraftLength) { // 大小不足96KB时清除一部分本地缓存 从最早创建的本地缓存开始删除 - let key = localStorage.key(index++) - let keyArray = key.split('_') + const key = localStorage.key(index++) + const keyArray = key.split('_') if (keyArray.length !== 4) { continue } @@ -30,19 +30,19 @@ const draft = { remainingLocalStorageSize = 1024 * 1024 * 5 - unescape(encodeURIComponent(JSON.stringify(localStorage))).length } // 当前时间戳 - let timestamp = new Date().getTime() + const timestamp = new Date().getTime() // 当前年月日时分秒时间 - let localTime = moment.unix(timestamp / 1000).format('YYYY-MM-DD HH:mm:ss') + const localTime = moment.unix(timestamp / 1000).format('YYYY-MM-DD HH:mm:ss') // 数据 - let descriptionData = {'time': localTime , 'message': message} + const descriptionData = { 'time': localTime, 'message': message } // 存储数据 - let key = [username, ccId, templateId, timestamp].join('_') + const key = [username, ccId, templateId, timestamp].join('_') // 超过50个本地缓存需要进行删除 let draftNumber = 0 - let localStorageLength = localStorage.length + const localStorageLength = localStorage.length const regex = this.getKeyRegex(username, ccId, templateId) - for (let index = localStorageLength - 1; index >= 0 ; index--) { - let key = localStorage.key(index) + for (let index = localStorageLength - 1; index >= 0; index--) { + const key = localStorage.key(index) // 获取key字段的所有切割信息 if (regex.test(key)) { draftNumber++ @@ -52,7 +52,7 @@ const draft = { } } try { - localStorage[key] = JSON.stringify({'template': templateData , 'description': descriptionData}) + localStorage[key] = JSON.stringify({ 'template': templateData, 'description': descriptionData }) } catch (e) { // 用户浏览器不支持localStorage } @@ -69,19 +69,19 @@ const draft = { // 用于替换第一次创建模板id为 uuid 的id draftReplace (username, ccId, templateId, templateUUID) { const regex = this.getKeyRegex(username, ccId, templateUUID) - for (let key in localStorage) { + for (const key in localStorage) { // 获取key字段的所有切割信息 - let keyArray = key.split('_') + const keyArray = key.split('_') // 切割完的长度应该为4且原先的模板id uuid 时才需要使用 // username重复的几率比较大放置最后判断 if (regex.test(key)) { // 原先的模板数据 - let draftData = localStorage[key] + const draftData = localStorage[key] // 将原先信息删除 localStorage.removeItem(key) keyArray[2] = templateId // 重新创建key值 - let newKey = keyArray.join('_') + const newKey = keyArray.join('_') localStorage[newKey] = draftData } } @@ -89,12 +89,12 @@ const draft = { // 获取当前本地缓存 getDraftArray (username, ccId, templateId) { const regex = this.getKeyRegex(username, ccId, templateId) - let draftArray = [] - let localStorageLength = localStorage.length - for (let index = localStorageLength - 1; index >= 0 ; index--) { - let key = localStorage.key(index) + const draftArray = [] + const localStorageLength = localStorage.length + for (let index = localStorageLength - 1; index >= 0; index--) { + const key = localStorage.key(index) if (regex.test(key)) { - draftArray.push({'key': key,'data': JSON.parse(localStorage[key])}) + draftArray.push({ 'key': key, 'data': JSON.parse(localStorage[key]) }) } } return draftArray @@ -102,9 +102,9 @@ const draft = { // 删除没有template_id 的模板 deleteAllDraftByUUID (username, ccId, uuid) { const regex = this.getKeyRegex(username, ccId, uuid) - let localStorageLength = localStorage.length - for (let index = localStorageLength - 1; index >= 0 ; index--) { - let key = localStorage.key(index) + const localStorageLength = localStorage.length + for (let index = localStorageLength - 1; index >= 0; index--) { + const key = localStorage.key(index) // uuid 需要加上""变为字符串 if (regex.test(key)) { localStorage.removeItem(key) @@ -114,26 +114,26 @@ const draft = { // 复制并替换本地缓存(模板克隆时使用) copyAndReplaceDraft (username, ccId, templateId, uuid) { const regex = this.getKeyRegex(username, ccId, templateId) - for (let key in localStorage) { + for (const key in localStorage) { // 获取key字段的所有切割信息 - let keyArray = key.split('_') + const keyArray = key.split('_') if (regex.test(key)) { // 原先的模板数据 - let draftData = localStorage[key] + const draftData = localStorage[key] keyArray[2] = uuid // 重新创建key值并进行创建 - let newKey = keyArray.join('_') + const newKey = keyArray.join('_') localStorage[newKey] = draftData } } }, // 获取最近的一个本地缓存 getLastDraft (username, ccId, templateId) { - let localStorageLength = localStorage.length + const localStorageLength = localStorage.length // 动态生成正则表达式 const regex = this.getKeyRegex(username, ccId, templateId) - for (let index = localStorageLength - 1; index >= 0 ; index--) { - let key = localStorage.key(index) + for (let index = localStorageLength - 1; index >= 0; index--) { + const key = localStorage.key(index) if (regex.test(key)) { return localStorage[key] } @@ -145,4 +145,4 @@ const draft = { } } -export default draft \ No newline at end of file +export default draft diff --git a/pipeline/blueflow/src/utils/formatPosition.js b/pipeline/blueflow/src/utils/formatPosition.js index 5ffbb03715..d3625ab948 100644 --- a/pipeline/blueflow/src/utils/formatPosition.js +++ b/pipeline/blueflow/src/utils/formatPosition.js @@ -9,6 +9,8 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ +import tools from '@/utils/tools.js' + const gatewayShiftX = 210 // 起始位置 const startPointX = 40 @@ -75,17 +77,15 @@ let nowTier = -1 // 用于计算线段比例 let nextLineNodeY = 0 -import tools from '@/utils/tools.js' - const formatPositionUtils = { formatPosition (oldLines, oldLocations) { lastLocations = oldLocations lines = oldLines overBorderLine = [] // 分组信息 - for (let line of lines) { - let sourceId = line.source.id - let targetId = line.target.id + for (const line of lines) { + const sourceId = line.source.id + const targetId = line.target.id if (group[sourceId]) { group[sourceId].push(targetId) } else { @@ -93,19 +93,17 @@ const formatPositionUtils = { } } // 循环旧节点 - for (let location of oldLocations) { - let type = location['type'] + for (const location of oldLocations) { + const type = location['type'] if (type === 'startpoint') { // 用于放置至最开始 lastPoint = location nowId = location.id - } - else if (type === 'endpoint') { + } else if (type === 'endpoint') { // 用于放置至最后 endPoint = location - } - else { - let locationId = location.id + } else { + const locationId = location.id // 添加进入循环数组 newLocations[locationId] = location // 获取一一对应的网关关系 @@ -113,24 +111,24 @@ const formatPositionUtils = { gatewayCycleList[locationId] = {} gatewayCycleExecute[locationId] = {} // 递归获得分支或并行网关执行序列 - let [gatewayRecursionList] = this.recursionGateway(gatewayStack, locationId, oldLocations) - for (let x in gatewayRecursionList) { - for (let y in gatewayRecursionList[x]) { - let nodeId = gatewayRecursionList[x][y] + const [gatewayRecursionList] = this.recursionGateway(gatewayStack, locationId, oldLocations) + for (const x in gatewayRecursionList) { + for (const y in gatewayRecursionList[x]) { + const nodeId = gatewayRecursionList[x][y] gatewayCycleList[locationId][nodeId] = oldLocations.find(location => location.id === nodeId) } // 用于控制递归继续执行序列 // 需要减去最后的多余的结束节点数量 - gatewayCycleExecute[locationId][x] = gatewayRecursionList[x].length - 1 + gatewayCycleExecute[locationId][x] = gatewayRecursionList[x].length - 1 } } } } // 清除多余的locations中的相关节点 - for (let x in gatewayCycleList){ - for (let y in gatewayCycleList[x]) { - for (let z in gatewayCycleList[x][y]){ - let id = gatewayCycleList[x][y][z] + for (const x in gatewayCycleList) { + for (const y in gatewayCycleList[x]) { + for (const z in gatewayCycleList[x][y]) { + const id = gatewayCycleList[x][y][z] if (newLocations[id] === undefined) { continue } @@ -141,7 +139,7 @@ const formatPositionUtils = { // 重新赋值节点位置 locations = [] // 先添加起始节点 - let locationJson = tools.deepClone(lastPoint) + const locationJson = tools.deepClone(lastPoint) // 绘制开始节点 locationJson['x'] = startPointX locationJson['y'] = startPointY @@ -153,7 +151,7 @@ const formatPositionUtils = { // 结束节点最后绘制 this.computeAndDrawNode(endPoint) // 需要重新赋值全局变量 防止第二次点击编排按钮时出现问题 - const result = {'lines': lines, 'locations': locations, 'overBorderLine': overBorderLine} + const result = { 'lines': lines, 'locations': locations, 'overBorderLine': overBorderLine } this.initData() return result }, @@ -166,22 +164,22 @@ const formatPositionUtils = { */ recursionGateway (gatewayStack, locationId, oldLocations, tier = 0) { // 全部分支递归分支数组 - let gatewayRecursionList = [] + const gatewayRecursionList = [] // 获取网关的执行序列 - let groupLocationList = group[locationId] + const groupLocationList = group[locationId] // 某一条分支的递归数组 let recursionList = [] // 当前id let findId = null - for (let locationIndex in groupLocationList) { + for (const locationIndex in groupLocationList) { gatewayStack.push(locationId) // 获得网关的第一个节点 findId = groupLocationList[locationIndex] while (true) { // 获取节点 - let findLocation = oldLocations.find(location => location.id === findId) - let findType = findLocation['type'] + const findLocation = oldLocations.find(location => location.id === findId) + const findType = findLocation['type'] if (findType === 'convergegateway') { // 继续进行下一条分支 只有最后一次需要执行下面的逻辑 if (locationIndex + 1 !== groupLocationList.length) { @@ -189,16 +187,14 @@ const formatPositionUtils = { recursionList.push(findId) break } - } - else if (findType === 'parallelgateway' || findType === 'branchgateway') { + } else if (findType === 'parallelgateway' || findType === 'branchgateway') { tier++ recursionList.push(findId) // 进行递归 获取网关中最后节点 - let result = this.recursionGateway(gatewayStack, findId, oldLocations, tier) + const result = this.recursionGateway(gatewayStack, findId, oldLocations, tier) // 需要传递网关最后的节点 findId = result[1] - } - else { + } else { recursionList.push(findId) } // 继续找下一个节点 @@ -216,24 +212,26 @@ const formatPositionUtils = { * @param {*} newLastNodeX 当前x值 * @param {*} newLastNodeY 当前y值 */ - recursionData (newLocations, newLastNodeX = null , newLastNodeY = null) { + recursionData (newLocations, newLastNodeX = null, newLastNodeY = null) { // 循环执行节点 - for (let i in newLocations) { + /* eslint-disable */ + for (const i in newLocations) { + /* eslint-enable */ // 某个节点的下一个执行序列 - let lastList = group[nowId] + const lastList = group[nowId] // 出现undefined或空节点即可结束 if (lastList === undefined || newLocations[lastList[0]] === undefined) { break } // 上一个Id - let lastId = nowId + const lastId = nowId if (newLastNodeX === null) { newLastNodeX = lastNodeX } if (newLastNodeY === null) { newLastNodeY = lastNodeY } - let executeLength = lastList.length + const executeLength = lastList.length for (let executeNodeIndex = 0; executeNodeIndex < executeLength; executeNodeIndex++) { nowId = lastList[executeNodeIndex] let location = newLocations[nowId] @@ -298,18 +296,18 @@ const formatPositionUtils = { } // 绘制汇聚网关 if (executeNodeIndex + 1 === executeLength && executeNodeIndex > 0) { - let location = newLocations[gatewayGroup[lastId]] + const location = newLocations[gatewayGroup[lastId]] // 存储层级及最大高度 // 获得最大的X位置 const nowTierMaxWidth = convergegatewayMaxWidthTier[nowTier] - if (nowTierMaxWidth){ + if (nowTierMaxWidth) { convergegatewayMaxWidthTier[nowTier] = nowTierMaxWidth } else { convergegatewayMaxWidthTier[nowTier] = lastNodeX } const [resultNodeX] = this.computeAndDrawNode(location, executeLength, 0, convergegatewayMaxWidthTier[nowTier], newLastNodeY) - if (nowTierMaxWidth){ - convergegatewayMaxWidthTier[nowTier] = Math.max(resultNodeX, nowTierMaxWidth) + if (nowTierMaxWidth) { + convergegatewayMaxWidthTier[nowTier] = Math.max(resultNodeX, nowTierMaxWidth) } else { convergegatewayMaxWidthTier[nowTier] = resultNodeX } @@ -333,14 +331,14 @@ const formatPositionUtils = { * @param {*} gatewayIndex 节点所处网关节点的inex * @param {*} gatewayCycleExecuteLength 网关执行序列长度 */ - computeAndDrawNode (location, executeLength = null, executeNodeIndex = 0, newLastNodeX = null , newLastNodeY = null, gatewayIndex = 0, gatewayCycleExecuteLength = 0) { + computeAndDrawNode (location, executeLength = null, executeNodeIndex = 0, newLastNodeX = null, newLastNodeY = null, gatewayIndex = 0, gatewayCycleExecuteLength = 0) { if (location === undefined) { // 空节点不需要继续 return } // 拷贝一份location用于替换x,y值 - let locationJson = tools.deepClone(location) - let type = location['type'] + const locationJson = tools.deepClone(location) + const type = location['type'] if (type === 'tasknode' || type === 'subflow') { // 是否是在网关中的节点 let gatewayFlag = null @@ -352,15 +350,15 @@ const formatPositionUtils = { } // 在网关当中 if (gatewayFlag) { - let nodeY = newLastNodeY - deviationY + const nodeY = newLastNodeY - deviationY newLastNodeX += shiftX * 1.2 locationJson['x'] = newLastNodeX locationJson['y'] = nodeY locations.push(locationJson) gatewayShiftYList.push(nodeY + deviationY) - let sourceLine = lines.find(line => line.target.id === location.id) - let targetLine = lines.find(line => line.source.id === location.id) + const sourceLine = lines.find(line => line.target.id === location.id) + const targetLine = lines.find(line => line.source.id === location.id) // 入线模式尾箭头为左入 sourceLine.target.arrow = 'Left' if (executeNodeIndex === 0) { @@ -373,7 +371,7 @@ const formatPositionUtils = { // 网关第N行(N>2)第一个节点 sourceLine.source.arrow = 'Bottom' targetLine.source.arrow = 'Right' - if ( gatewayCycleExecuteLength === 1) { + if (gatewayCycleExecuteLength === 1) { // 只有一个节点 连线需要接到汇聚网关下方 targetLine.target.arrow = 'Bottom' } else { @@ -422,13 +420,13 @@ const formatPositionUtils = { // 添加网关信号 用于重置Y轴值 resetGatewayList.push(true) // 修改输出的箭头方向 - let targetLine = lines.find(line => line.target.id === location.id) + const targetLine = lines.find(line => line.target.id === location.id) targetLine.target.arrow = 'Left' if (executeNodeIndex === 0) { targetLine.source.arrow = 'Right' } else { // 上一个节点的type - const {type: lastNodeType} = this.getPreviousPoint(location.id) + const { type: lastNodeType } = this.getPreviousPoint(location.id) if (lastNodeType === 'parallelgateway' || lastNodeType === 'branchgateway') { targetLine.source.arrow = 'Bottom' } else { @@ -470,7 +468,7 @@ const formatPositionUtils = { newLastNodeX = lastNodeX isStartPoint = false const line = lines.find(line => line.target.id === location.id) - this.addOverBorderLine({'source': line.source.id, 'target': line.target.id}) + this.addOverBorderLine({ 'source': line.source.id, 'target': line.target.id }) } else { newLastNodeX += shiftX * 1.5 locationJson['x'] = newLastNodeX @@ -486,9 +484,9 @@ const formatPositionUtils = { locationJson['x'] = lastNodeX isStartPoint = false const line = lines.find(line => line.target.id === location.id) - this.addOverBorderLine({'source': line.source.id, 'target': line.target.id}) + this.addOverBorderLine({ 'source': line.source.id, 'target': line.target.id }) } else { - lastNodeX += shiftX / 1.2 + lastNodeX += shiftX / 1.2 locationJson['x'] = lastNodeX } locationJson['y'] = lastNodeY @@ -511,14 +509,13 @@ const formatPositionUtils = { delete convergegatewayMaxWidthTier[nowTier] nowTier-- return [lastNodeX, null] - } else if (type === 'convergegateway') { resetGatewayList.pop() // 更换分支网关连接线段箭头 const sourceLine = lines.find(line => line.target.id === location.id) const targetLine = lines.find(line => line.source.id === location.id) targetLine.source.arrow = 'Right' - if (lastLocations.find(location => sourceLine.source.id === location.id).type === 'convergegateway'){ + if (lastLocations.find(location => sourceLine.source.id === location.id).type === 'convergegateway') { // 设置连接分支网关的线在左部 sourceLine.target.arrow = 'Left' } @@ -541,17 +538,16 @@ const formatPositionUtils = { } else { return [lastNodeX, lastNodeY] } - } - else if (type === 'endpoint') { + } else if (type === 'endpoint') { // 需要切换箭头 - let line = lines.find(line => line.target.id === location.id) + const line = lines.find(line => line.target.id === location.id) line.target.arrow = 'Left' line.source.arrow = 'Right' if (isStartPoint) { lastNodeX = startPointX isStartPoint = false const line = lines.find(line => line.target.id === location.id) - this.addOverBorderLine({'source': line.source.id, 'target': line.target.id}) + this.addOverBorderLine({ 'source': line.source.id, 'target': line.target.id }) } else if (lastPointType === 'tasknode' || lastPointType === 'subflow' || lastPointType === 'startpoint') { // 结束节点前是个标准插件节点需要增加1.5倍距离 lastNodeX += shiftX * 1.5 @@ -562,7 +558,6 @@ const formatPositionUtils = { locationJson['x'] = lastNodeX locationJson['y'] = lastNodeY locations.push(locationJson) - return } }, isOverBorder () { @@ -629,12 +624,12 @@ const formatPositionUtils = { }, isLocationAllNode (locations) { const typeList = ['startpoint', 'endpoint', 'tasknode', 'subflow'] - return locations.every((location) =>{ + return locations.every((location) => { return typeList.includes(location.type) }) }, - addOverBorderLine ({source, target}) { - overBorderLine.push({'source': source, 'target': target ,'midpoint': Number(gatewayShiftY / nextLineNodeY).toFixed(2)}) + addOverBorderLine ({ source, target }) { + overBorderLine.push({ 'source': source, 'target': target, 'midpoint': Number(gatewayShiftY / nextLineNodeY).toFixed(2) }) gatewayShiftY = 0 } } diff --git a/pipeline/blueflow/src/utils/nodeFilter.js b/pipeline/blueflow/src/utils/nodeFilter.js index 4007c9df0d..a482e510c8 100644 --- a/pipeline/blueflow/src/utils/nodeFilter.js +++ b/pipeline/blueflow/src/utils/nodeFilter.js @@ -42,20 +42,22 @@ const nodeFilter = { case 'activities': case 'flows': case 'gateways': - for (let key in primaryData) { + for (const key in primaryData) { const newKey = this.getNewValidId(key) newData[newKey] = primaryData[key] keysOfIdRelated.forEach(item => { - let val = newData[newKey][item] - if (val != undefined && val !== '') { + const val = newData[newKey][item] + if (val !== undefined && val !== '') { if (typeof val === 'string') { newData[newKey][item] = this.getNewValidId(val) } else if (Array.isArray(val)) { - newData[newKey][item] = val.map(v => {return this.getNewValidId(v)}) + newData[newKey][item] = val.map(v => { + return this.getNewValidId(v) + }) } if (item === 'conditions') { const newVal = {} - for (let conditionId in val) { + for (const conditionId in val) { const newConditionId = this.getNewValidId(conditionId) newVal[newConditionId] = val[conditionId] newVal[newConditionId].tag = newVal[newConditionId].tag.split('_').map((id, index) => { @@ -68,18 +70,16 @@ const nodeFilter = { }) } return newData - break case 'end_event': case 'start_event': newData = Object.assign({}, primaryData) keysOfIdRelated.forEach(item => { - let val = newData[item] - if (val != undefined && val !== '') { + const val = newData[item] + if (val !== undefined && val !== '') { newData[item] = this.getNewValidId(val) } }) return newData - break case 'line': newData = [...primaryData] newData.forEach((item, index) => { @@ -88,19 +88,16 @@ const nodeFilter = { item.target.id = this.getNewValidId(item.target.id) }) return newData - break case 'location': newData = [...primaryData] newData.forEach((item) => { item.id = this.getNewValidId(item.id) }) return newData - break default: return primaryData - break } } } -export default nodeFilter \ No newline at end of file +export default nodeFilter diff --git a/pipeline/blueflow/src/utils/tools.js b/pipeline/blueflow/src/utils/tools.js index dc9c9c6e11..ae93541395 100644 --- a/pipeline/blueflow/src/utils/tools.js +++ b/pipeline/blueflow/src/utils/tools.js @@ -22,8 +22,8 @@ const tools = { let timer return function () { - let context = this - let args = arguments + const context = this + const args = arguments clearTimeout(timer) @@ -54,7 +54,6 @@ const tools = { last = now fn.apply(context, args) }, threshhold) - } else { last = now fn.apply(context, args) diff --git a/pipeline/blueflow/src/utils/uuid.js b/pipeline/blueflow/src/utils/uuid.js index 929f99396c..3b660db022 100644 --- a/pipeline/blueflow/src/utils/uuid.js +++ b/pipeline/blueflow/src/utils/uuid.js @@ -21,4 +21,4 @@ export function uuid () { id += random4() } return id -} \ No newline at end of file +} diff --git a/pipeline/blueflow/src/utils/validatePipeline.js b/pipeline/blueflow/src/utils/validatePipeline.js index 9cfc990154..2375cb0f4d 100644 --- a/pipeline/blueflow/src/utils/validatePipeline.js +++ b/pipeline/blueflow/src/utils/validatePipeline.js @@ -11,17 +11,16 @@ */ import { NODE_DICT } from '@/constants/index.js' - const NODE_RULE = { - "startpoint": { + 'startpoint': { min_in: 0, max_in: 0, min_out: 1, max_out: 1, - allowed_out: ["tasknode", "branchgateway", "parallelgateway", "endpoint", "subflow"], + allowed_out: ['tasknode', 'branchgateway', 'parallelgateway', 'endpoint', 'subflow'], unique: true }, - "endpoint": { + 'endpoint': { min_in: 1, max_in: 1, min_out: 0, @@ -29,44 +28,44 @@ const NODE_RULE = { allowed_out: [], unique: true }, - "tasknode": { + 'tasknode': { min_in: 1, max_in: 1, min_out: 1, max_out: 1, - allowed_out: ["tasknode", "subflow", "branchgateway", "parallelgateway", "convergegateway", "endpoint"], + allowed_out: ['tasknode', 'subflow', 'branchgateway', 'parallelgateway', 'convergegateway', 'endpoint'], unique: false }, - "branchgateway": { + 'branchgateway': { min_in: 1, max_in: 1, min_out: 2, max_out: 1000, - allowed_out: ["tasknode", "subflow", "branchgateway", "parallelgateway", "convergegateway"], + allowed_out: ['tasknode', 'subflow', 'branchgateway', 'parallelgateway', 'convergegateway'], unique: false }, - "parallelgateway": { + 'parallelgateway': { min_in: 1, max_in: 1, min_out: 2, max_out: 1000, - allowed_out: ["tasknode", "subflow", "branchgateway", "parallelgateway", "convergegateway"], + allowed_out: ['tasknode', 'subflow', 'branchgateway', 'parallelgateway', 'convergegateway'], unique: false }, - "convergegateway": { + 'convergegateway': { min_in: 2, max_in: 1000, min_out: 1, max_out: 1, - allowed_out: ["tasknode", "subflow", "branchgateway", "parallelgateway", "convergegateway", "endpoint"], + allowed_out: ['tasknode', 'subflow', 'branchgateway', 'parallelgateway', 'convergegateway', 'endpoint'], unique: false }, - "subflow": { + 'subflow': { min_in: 1, max_in: 1, min_out: 1, max_out: 1, - allowed_out: ["tasknode", "subflow", "branchgateway", "parallelgateway", "endpoint", "convergegateway"], + allowed_out: ['tasknode', 'subflow', 'branchgateway', 'parallelgateway', 'endpoint', 'convergegateway'], unique: false } } @@ -94,19 +93,19 @@ const validatePipeline = { let isLoop = false if (sourceRule.max_out === 0) { - const i18n_text = gettext("只能添加输入连线") + const i18n_text = gettext('只能添加输入连线') const message = `${NODE_DICT[sourceNode.type]}${i18n_text}` return this.getMessage(false, message) } if (targetRule.max_in === 0) { - const i18n_text = gettext("只能添加输出连线") + const i18n_text = gettext('只能添加输出连线') const message = `${NODE_DICT[targetNode.type]}${i18n_text}` return this.getMessage(false, message) } if (sourceRule.allowed_out.indexOf(targetNode.type) === -1) { - const i18n_text = gettext("不能连接") + const i18n_text = gettext('不能连接') const message = `${NODE_DICT[sourceNode.type]}${i18n_text}${NODE_DICT[targetNode.type]}` return this.getMessage(false, message) } @@ -126,22 +125,22 @@ const validatePipeline = { }) if (isLoop) { - const message = gettext("相同节点不能回连") + const message = gettext('相同节点不能回连') return this.getMessage(false, message) } if (isSameLine) { - const message = gettext("重复添加连线") + const message = gettext('重复添加连线') return this.getMessage(false, message) } else { - const i18n_text1 = gettext("已达到") + const i18n_text1 = gettext('已达到') if (sourceLinesLinked >= sourceRule.max_out) { - const i18n_text2 = gettext("最大输出连线条数") + const i18n_text2 = gettext('最大输出连线条数') const message = `${i18n_text1}${NODE_DICT[sourceNode.type]}${i18n_text2}` return this.getMessage(false, message) } if (targetLinesLinked >= targetRule.max_in) { - const i18n_text2 = gettext("最大输入连线条数") + const i18n_text2 = gettext('最大输入连线条数') const message = `${i18n_text1}${NODE_DICT[targetNode.type]}${i18n_text2}` return this.getMessage(false, message) } @@ -151,9 +150,11 @@ const validatePipeline = { isLocationValid (loc, data) { const rule = NODE_RULE[loc.type] if (rule.unique) { // 节点唯一性 - const isLocationOverMount = data.some(item => { return item.type === loc.type && item.id !== loc.id}) + const isLocationOverMount = data.some(item => { + return item.type === loc.type && item.id !== loc.id + }) if (isLocationOverMount) { - const i18n_text = gettext("在模板中只能添加一个") + const i18n_text = gettext('在模板中只能添加一个') const message = `${NODE_DICT[loc.type]}${i18n_text}` return this.getMessage(false, message) } @@ -185,21 +186,21 @@ const validatePipeline = { subflow += 1 } data.lines.forEach(line => { - if (line.source.id == loc.id) { + if (line.source.id === loc.id) { targetLinesLinked += 1 } if (line.target.id === loc.id) { sourceLinesLinked += 1 } }) - const i18n_text1 = gettext("至少需要") + const i18n_text1 = gettext('至少需要') if (sourceLinesLinked < rule.min_in) { - const i18n_text2 = gettext("条输入连线") + const i18n_text2 = gettext('条输入连线') message = `${name}${i18n_text1}${rule.min_in}${i18n_text2}` return false } if (targetLinesLinked < rule.min_out) { - const i18n_text2 = gettext("条输出连线") + const i18n_text2 = gettext('条输出连线') message = `${name}${i18n_text1}${rule.min_out}${i18n_text2}` return false } @@ -211,12 +212,12 @@ const validatePipeline = { } if ((tasknode + subflow) === 0) { - message = gettext("请添加任务节点") + message = gettext('请添加任务节点') return this.getMessage(false, message) } if (branchAndParallelGateways !== convergegateways) { - message = gettext("并行网关、分支网关个数和汇聚网关个数必须一致,并且必须配对使用") + message = gettext('并行网关、分支网关个数和汇聚网关个数必须一致,并且必须配对使用') return this.getMessage(false, message) }