Browse Source

Merge pull request #4214 from chengshiwen/ui-eslint

[Improvement][UI] UI eslint support for better code quality and fewer bugs
pull/3/MERGE
xingchun-chen 4 years ago committed by GitHub
parent
commit
95d320d7da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      dolphinscheduler-ui/.eslintignore
  2. 11
      dolphinscheduler-ui/.eslintrc.yml
  3. 10
      dolphinscheduler-ui/build/config.js
  4. 43
      dolphinscheduler-ui/build/webpack.config.dev.js
  5. 9
      dolphinscheduler-ui/package.json
  6. 46
      dolphinscheduler-ui/src/components/Counter.vue
  7. 14
      dolphinscheduler-ui/src/components/Message.vue
  8. 142
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue
  9. 36
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/dependentTimeout.vue
  10. 12
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/selectInput.vue
  11. 2
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue
  12. 7
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/workerGroups.vue
  13. 54
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formLineModel.vue
  14. 88
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
  15. 12
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/log.vue
  16. 2
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue
  17. 11
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue
  18. 9
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/httpParams.vue
  19. 11
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/jsonBox.vue
  20. 10
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/nodeStatus.vue
  21. 11
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/scriptBox.vue
  22. 3
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/sqlType.vue
  23. 4
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/udfs.vue
  24. 18
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/conditions.vue
  25. 44
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/datax.vue
  26. 13
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue
  27. 248
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue
  28. 59
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/http.vue
  29. 232
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue
  30. 14
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/pre_tasks.vue
  31. 4
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue
  32. 138
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue
  33. 144
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue
  34. 240
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue
  35. 29
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue
  36. 394
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sqoop.vue
  37. 4
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sub_process.vue
  38. 189
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/waterdrop.vue
  39. 13
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/startingParam/index.vue
  40. 19
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/_source/selectTenant.vue
  41. 7
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue
  42. 2
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/variable/index.vue
  43. 6
      dolphinscheduler-ui/src/js/conf/home/pages/dag/definitionDetails.vue
  44. 6
      dolphinscheduler-ui/src/js/conf/home/pages/dag/index.vue
  45. 6
      dolphinscheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue
  46. 67
      dolphinscheduler-ui/src/js/conf/home/pages/datasource/pages/list/_source/createDataSource.vue
  47. 12
      dolphinscheduler-ui/src/js/conf/home/pages/datasource/pages/list/index.vue
  48. 17
      dolphinscheduler-ui/src/js/conf/home/pages/home/index.vue
  49. 6
      dolphinscheduler-ui/src/js/conf/home/pages/monitor/index.vue
  50. 6
      dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/zookeeperList.vue
  51. 68
      dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/db.vue
  52. 5
      dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/master.vue
  53. 26
      dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/statistics.vue
  54. 5
      dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/worker.vue
  55. 4
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/conditions/instance/processInstance.vue
  56. 6
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/conditions/instance/taskInstance.vue
  57. 18
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/taskRecordList/_source/conditions.vue
  58. 2
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/taskRecordList/_source/list.vue
  59. 3
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/taskRecordList/index.vue
  60. 3
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/create/index.vue
  61. 3
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/details/index.vue
  62. 28
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue
  63. 71
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue
  64. 37
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/relatedItems.vue
  65. 15
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue
  66. 77
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue
  67. 17
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/index.vue
  68. 6
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/tree/index.vue
  69. 4
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue
  70. 7
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/index.vue
  71. 4
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/commandStateCount.vue
  72. 6
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/defineUserCount.vue
  73. 11
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/processStateCount.vue
  74. 6
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/queueCount.vue
  75. 150
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskCtatusCount.vue
  76. 6
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskStatusCount.vue
  77. 10
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/index.vue
  78. 2
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/index.vue
  79. 5
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/details/index.vue
  80. 4
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/gantt/index.vue
  81. 12
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue
  82. 19
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/index.vue
  83. 12
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/_source/graphGrid.vue
  84. 48
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/index.vue
  85. 8
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/createProject.vue
  86. 4
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/list.vue
  87. 5
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/list/index.vue
  88. 6
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/_source/list.vue
  89. 17
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/index.vue
  90. 2
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/timing/index.vue
  91. 4
      dolphinscheduler-ui/src/js/conf/home/pages/resource/index.vue
  92. 4
      dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/index.vue
  93. 6
      dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/create/index.vue
  94. 10
      dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/createFolder/index.vue
  95. 10
      dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/createUdfFolder/index.vue
  96. 8
      dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/details/index.vue
  97. 6
      dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue
  98. 6
      dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue
  99. 13
      dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/rename.vue
  100. 10
      dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/index.vue
  101. Some files were not shown because too many files have changed in this diff Show More

7
dolphinscheduler-ui/.eslintignore

@ -0,0 +1,7 @@
/_test_/
/build/
/dist/
/node/
/node_modules/
/target/
/*.js

11
dolphinscheduler-ui/.eslintrc.yml

@ -26,9 +26,18 @@ globals:
Atomics: readonly Atomics: readonly
SharedArrayBuffer: readonly SharedArrayBuffer: readonly
PUBLIC_PATH: readonly PUBLIC_PATH: readonly
$t: readonly
parserOptions: parserOptions:
ecmaVersion: 2018 ecmaVersion: 2018
sourceType: module sourceType: module
plugins: plugins:
- vue - vue
rules: {} rules:
vue/script-indent: ['error', 2, { 'baseIndent': 1, 'switchCase': 1 }]
prefer-promise-reject-errors: 'off'
no-prototype-builtins: 'off'
no-mixed-operators: 'off'
no-extend-native: 'off'
prefer-const: 'off'
overrides:
- { 'files': ['*.vue'], 'rules': { 'indent': 'off' }}

10
dolphinscheduler-ui/build/config.js

@ -125,6 +125,16 @@ const baseConfig = {
}, },
module: { module: {
rules: [ rules: [
{
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
include: [resolve('src')],
options: {
formatter: require('eslint-friendly-formatter'),
emitWarning: true
}
},
{ {
test: /\.vue$/, test: /\.vue$/,
loader: 'vue-loader', loader: 'vue-loader',

43
dolphinscheduler-ui/build/webpack.config.dev.js

@ -19,6 +19,8 @@ const merge = require('webpack-merge')
const { assetsDir, baseConfig } = require('./config') const { assetsDir, baseConfig } = require('./config')
const MiniCssExtractPlugin = require('mini-css-extract-plugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const ProgressPlugin = require('progress-bar-webpack-plugin') const ProgressPlugin = require('progress-bar-webpack-plugin')
const FriendlyErrorsPlugin = require('friendly-errors-webpack-plugin')
const portfinder = require('portfinder')
const getEnv = require('env-parse').getEnv const getEnv = require('env-parse').getEnv
const config = merge.smart(baseConfig, { const config = merge.smart(baseConfig, {
@ -33,6 +35,7 @@ const config = merge.smart(baseConfig, {
port: getEnv('DEV_PORT', 8888), port: getEnv('DEV_PORT', 8888),
host: getEnv('DEV_HOST', 'localhost'), host: getEnv('DEV_HOST', 'localhost'),
noInfo: false, noInfo: false,
overlay: { warnings: false, errors: true },
historyApiFallback: true, historyApiFallback: true,
disableHostCheck: true, disableHostCheck: true,
proxy: { proxy: {
@ -42,12 +45,12 @@ const config = merge.smart(baseConfig, {
changeOrigin: true changeOrigin: true
} }
}, },
progress: false, progress: true,
quiet: false, quiet: true,
stats: { stats: {
colors: true colors: true
}, },
clientLogLevel: 'none' clientLogLevel: 'warning'
}, },
plugins: [ plugins: [
new ProgressPlugin(), new ProgressPlugin(),
@ -57,4 +60,36 @@ const config = merge.smart(baseConfig, {
mode: 'development' mode: 'development'
}) })
module.exports = config module.exports = new Promise((resolve, reject) => {
portfinder.basePort = process.env.PORT || config.devServer.port
portfinder.getPort((err, port) => {
if (err) {
reject(err)
} else {
// publish the new Port, necessary for e2e tests
process.env.PORT = port
// add port to devServer config
config.devServer.port = port
// Add FriendlyErrorsPlugin
config.plugins.push(new FriendlyErrorsPlugin({
compilationSuccessInfo: {
messages: [`Your application is running here: http://${config.devServer.host}:${port}`],
},
onErrors: () => {
const notifier = require('node-notifier')
return (severity, errors) => {
if (severity !== 'error') return
const error = errors[0]
const filename = error.file && error.file.split('!').pop()
notifier.notify({
title: packageConfig.name,
message: severity + ': ' + error.name,
subtitle: filename || ''
})
}
}
}))
resolve(config)
}
})
})

9
dolphinscheduler-ui/package.json

@ -8,7 +8,7 @@
"dev": "cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.dev.js", "dev": "cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.dev.js",
"clean": "rimraf dist", "clean": "rimraf dist",
"start": "npm run dev", "start": "npm run dev",
"lint": "eslint ./src --fix", "lint": "eslint ./src --ext .js,.vue --fix",
"build:release": "npm run clean && cross-env NODE_ENV=production PUBLIC_PATH=/dolphinscheduler/ui webpack --config ./build/webpack.config.release.js" "build:release": "npm run clean && cross-env NODE_ENV=production PUBLIC_PATH=/dolphinscheduler/ui webpack --config ./build/webpack.config.release.js"
}, },
"dependencies": { "dependencies": {
@ -55,18 +55,23 @@
"env-parse": "^1.0.5", "env-parse": "^1.0.5",
"eslint": "^6.8.0", "eslint": "^6.8.0",
"eslint-config-standard": "^14.1.1", "eslint-config-standard": "^14.1.1",
"eslint-friendly-formatter": "^4.0.1",
"eslint-loader": "^4.0.2",
"eslint-plugin-import": "^2.20.2", "eslint-plugin-import": "^2.20.2",
"eslint-plugin-node": "^11.1.0", "eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^4.2.1", "eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1", "eslint-plugin-standard": "^4.0.1",
"eslint-plugin-vue": "^6.2.2", "eslint-plugin-vue": "^7.2.0",
"file-loader": "^5.0.2", "file-loader": "^5.0.2",
"friendly-errors-webpack-plugin": "^1.7.0",
"globby": "^8.0.1", "globby": "^8.0.1",
"html-loader": "^0.5.5", "html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0", "html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.8.2", "mini-css-extract-plugin": "^0.8.2",
"node-notifier": "^8.0.0",
"node-sass": "^4.14.1", "node-sass": "^4.14.1",
"pack": "^2.2.0", "pack": "^2.2.0",
"portfinder": "^1.0.28",
"postcss-loader": "^3.0.0", "postcss-loader": "^3.0.0",
"progress-bar-webpack-plugin": "^1.12.1", "progress-bar-webpack-plugin": "^1.12.1",
"rimraf": "^2.6.2", "rimraf": "^2.6.2",

46
dolphinscheduler-ui/src/components/Counter.vue

@ -24,30 +24,30 @@
</template> </template>
<script> <script>
export default { export default {
props: { props: {
factor: { type: Number, default: 1 } factor: { type: Number, default: 1 }
},
data() {
return {
count: 0
};
},
methods: {
inc() {
this.count++;
}, },
dec() { data () {
this.count--; return {
count: 0
}
}, },
reset() { methods: {
this.count = 0; inc () {
} this.count++
}, },
computed: { dec () {
computedCount: function() { this.count--
return this.count * this.factor; },
reset () {
this.count = 0
}
},
computed: {
computedCount: function () {
return this.count * this.factor
}
} }
} }
}; </script>
</script>

14
dolphinscheduler-ui/src/components/Message.vue

@ -19,10 +19,10 @@
</template> </template>
<script> <script>
export default { export default {
name: 'message', name: 'message',
props: [ props: [
'msg' 'msg'
] ]
} }
</script> </script>

142
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue

@ -156,7 +156,7 @@
:visible.sync="nodeDrawer" :visible.sync="nodeDrawer"
size="50%" size="50%"
:with-header="false"> :with-header="false">
<m-form-model v-if="nodeDrawer" :nodeData = nodeData @addTaskInfo="addTaskInfo" @cacheTaskInfo="cacheTaskInfo" @close="close" @onSubProcess="onSubProcess"></m-form-model> <m-form-model v-if="nodeDrawer" :nodeData=nodeData @seeHistory="seeHistory" @addTaskInfo="addTaskInfo" @cacheTaskInfo="cacheTaskInfo" @close="close" @onSubProcess="onSubProcess"></m-form-model>
</el-drawer> </el-drawer>
<el-drawer <el-drawer
:visible.sync="lineDrawer" :visible.sync="lineDrawer"
@ -203,8 +203,8 @@
import { findComponentDownward } from '@/module/util/' import { findComponentDownward } from '@/module/util/'
import disabledState from '@/module/mixin/disabledState' import disabledState from '@/module/mixin/disabledState'
import { mapActions, mapState, mapMutations } from 'vuex' import { mapActions, mapState, mapMutations } from 'vuex'
import mVersions from '../../projects/pages/definition/pages/list/_source/versions'
import mStart from '../../projects/pages/definition/pages/list/_source/start' import mStart from '../../projects/pages/definition/pages/list/_source/start'
import mVersions from '../../projects/pages/definition/pages/list/_source/versions'
let eventModel let eventModel
@ -268,54 +268,54 @@
methods: { methods: {
...mapActions('dag', ['saveDAGchart', 'updateInstance', 'updateDefinition', 'getTaskState', 'switchProcessDefinitionVersion', 'getProcessDefinitionVersionsPage', 'deleteProcessDefinitionVersion']), ...mapActions('dag', ['saveDAGchart', 'updateInstance', 'updateDefinition', 'getTaskState', 'switchProcessDefinitionVersion', 'getProcessDefinitionVersionsPage', 'deleteProcessDefinitionVersion']),
...mapMutations('dag', ['addTasks', 'cacheTasks', 'resetParams', 'setIsEditDag', 'setName', 'addConnects']), ...mapMutations('dag', ['addTasks', 'cacheTasks', 'resetParams', 'setIsEditDag', 'setName', 'addConnects']),
startRunning(item,startNodeList,sourceType) { startRunning (item, startNodeList, sourceType) {
this.startData = item this.startData = item
this.startNodeList.startNodeList this.startNodeList = startNodeList
this.sourceType = sourceType this.sourceType = sourceType
this.startDialog = true this.startDialog = true
}, },
onUpdateStart() { onUpdateStart () {
this.startDialog = false this.startDialog = false
}, },
closeStart() { closeStart () {
this.startDialog = false this.startDialog = false
}, },
// DAG automatic layout // DAG automatic layout
dagAutomaticLayout() { dagAutomaticLayout () {
if(this.store.state.dag.isEditDag) { if (this.store.state.dag.isEditDag) {
this.$message.warning(`${i18n.$t('Please save the DAG before formatting')}`) this.$message.warning(`${i18n.$t('Please save the DAG before formatting')}`)
return false return false
} }
$('#canvas').html('') $('#canvas').html('')
// Destroy round robin // Destroy round robin
Dag.init({ Dag.init({
dag: this, dag: this,
instance: jsPlumb.getInstance({ instance: jsPlumb.getInstance({
Endpoint: [ Endpoint: [
'Dot', { radius: 1, cssClass: 'dot-style' } 'Dot', { radius: 1, cssClass: 'dot-style' }
],
Connector: 'Bezier',
PaintStyle: { lineWidth: 2, stroke: '#456' }, // Connection style
ConnectionOverlays: [
[
'Arrow',
{
location: 1,
id: 'arrow',
length: 12,
foldback: 0.8
}
], ],
['Label', { Connector: 'Bezier',
PaintStyle: { lineWidth: 2, stroke: '#456' }, // Connection style
ConnectionOverlays: [
[
'Arrow',
{
location: 1,
id: 'arrow',
length: 12,
foldback: 0.8
}
],
['Label', {
location: 0.5, location: 0.5,
id: 'label' id: 'label'
}] }]
], ],
Container: 'canvas', Container: 'canvas',
ConnectionsDetachable: true ConnectionsDetachable: true
})
}) })
})
if (this.tasks.length) { if (this.tasks.length) {
Dag.backfill(true) Dag.backfill(true)
if (this.type === 'instance') { if (this.type === 'instance') {
@ -344,8 +344,8 @@
/** /**
* copy name * copy name
*/ */
_copyName(){ _copyName () {
let clipboard = new Clipboard(`.copy-name`) let clipboard = new Clipboard('.copy-name')
clipboard.on('success', e => { clipboard.on('success', e => {
this.$message.success(`${i18n.$t('Copy success')}`) this.$message.success(`${i18n.$t('Copy success')}`)
// Free memory // Free memory
@ -383,8 +383,8 @@
let dom = $(`#${v2.id}`) let dom = $(`#${v2.id}`)
let state = dom.find('.state-p') let state = dom.find('.state-p')
let depState = '' let depState = ''
taskList.forEach(item=>{ taskList.forEach(item => {
if(item.name==v1.name) { if (item.name === v1.name) {
depState = item.state depState = item.state
} }
}) })
@ -460,7 +460,7 @@
this.spinnerLoading = true this.spinnerLoading = true
// Storage store // Storage store
Dag.saveStore().then(res => { Dag.saveStore().then(res => {
if(this._verifConditions(res.tasks)) { if (this._verifConditions(res.tasks)) {
if (this.urlParam.id) { if (this.urlParam.id) {
/** /**
* Edit * Edit
@ -509,24 +509,24 @@
}) })
}) })
}, },
_closeDAG(){ _closeDAG () {
let $name = this.$route.name let $name = this.$route.name
if($name && $name.indexOf("definition") != -1){ if ($name && $name.indexOf('definition') !== -1) {
this.$router.push({ name: 'projects-definition-list'}) this.$router.push({ name: 'projects-definition-list' })
}else{ } else {
this.$router.push({ name: 'projects-instance-list'}) this.$router.push({ name: 'projects-instance-list' })
} }
}, },
_verifConditions (value) { _verifConditions (value) {
let tasks = value let tasks = value
let bool = true let bool = true
tasks.map(v=>{ tasks.map(v => {
if(v.type == 'CONDITIONS' && (v.conditionResult.successNode[0] =='' || v.conditionResult.successNode[0] == null || v.conditionResult.failedNode[0] =='' || v.conditionResult.failedNode[0] == null)) { if (v.type === 'CONDITIONS' && (v.conditionResult.successNode[0] === '' || v.conditionResult.successNode[0] === null || v.conditionResult.failedNode[0] === '' || v.conditionResult.failedNode[0] === null)) {
bool = false bool = false
return false return false
} }
}) })
if(!bool) { if (!bool) {
this.$message.warning(`${i18n.$t('Successful branch flow and failed branch flow are required')}`) this.$message.warning(`${i18n.$t('Successful branch flow and failed branch flow are required')}`)
this.spinnerLoading = false this.spinnerLoading = false
return false return false
@ -600,20 +600,20 @@
* View variables * View variables
*/ */
_toggleView () { _toggleView () {
findComponentDownward(this.$root, `assist-dag-index`)._toggleView() findComponentDownward(this.$root, 'assist-dag-index')._toggleView()
}, },
/** /**
* Starting parameters * Starting parameters
*/ */
_toggleParam () { _toggleParam () {
findComponentDownward(this.$root, `starting-params-dag-index`)._toggleParam() findComponentDownward(this.$root, 'starting-params-dag-index')._toggleParam()
}, },
addLineInfo ({ item, fromThis }) { addLineInfo ({ item, fromThis }) {
this.addConnects(item) this.addConnects(item)
this.lineDrawer = false this.lineDrawer = false
}, },
cancel ({fromThis}) { cancel ({ fromThis }) {
this.lineDrawer = false this.lineDrawer = false
}, },
@ -621,23 +621,33 @@
* Create a node popup layer * Create a node popup layer
* @param Object id * @param Object id
*/ */
_createLineLabel({id, sourceId, targetId}) { _createLineLabel ({ id, sourceId, targetId }) {
this.lineData.id = id this.lineData.id = id
this.lineData.sourceId = sourceId this.lineData.sourceId = sourceId
this.lineData.targetId = targetId this.lineData.targetId = targetId
this.lineDrawer = true this.lineDrawer = true
}, },
seeHistory (taskName) {
this.nodeData.self.$router.push({
name: 'task-instance',
query: {
processInstanceId: this.nodeData.self.$route.params.id,
taskName: taskName
}
})
},
addTaskInfo ({ item, fromThis }) { addTaskInfo ({ item, fromThis }) {
this.addTasks(item) this.addTasks(item)
this.nodeDrawer = false this.nodeDrawer = false
}, },
cacheTaskInfo({item, fromThis}) { cacheTaskInfo ({ item, fromThis }) {
this.cacheTasks(item) this.cacheTasks(item)
}, },
close ({ item,flag, fromThis }) { close ({ item, flag, fromThis }) {
this.addTasks(item) this.addTasks(item)
// Edit status does not allow deletion of nodes // Edit status does not allow deletion of nodes
if (flag) { if (flag) {
@ -654,11 +664,11 @@
let preNode = [] let preNode = []
let rearNode = [] let rearNode = []
let rearList = [] let rearList = []
$('div[data-targetarr*="' + id + '"]').each(function(){ $('div[data-targetarr*="' + id + '"]').each(function () {
rearNode.push($(this).attr("id")) rearNode.push($(this).attr('id'))
}) })
if (rearNode.length>0) { if (rearNode.length > 0) {
rearNode.forEach(v => { rearNode.forEach(v => {
let rearobj = {} let rearobj = {}
rearobj.value = $(`#${v}`).find('.name-p').text() rearobj.value = $(`#${v}`).find('.name-p').text()
@ -690,12 +700,11 @@
this.nodeData.preNode = preNode this.nodeData.preNode = preNode
this.nodeData.rearList = rearList this.nodeData.rearList = rearList
this.nodeData.instanceId = this.$route.params.id this.nodeData.instanceId = this.$route.params.id
this.nodeDrawer = true this.nodeDrawer = true
}, },
removeEventModelById ($id) { removeEventModelById ($id) {
if(eventModel && this.taskId == $id){ if (eventModel && this.taskId === $id) {
eventModel.remove() eventModel.remove()
} }
}, },
@ -707,12 +716,12 @@
* @param processDefinitionId the process definition id * @param processDefinitionId the process definition id
* @param fromThis fromThis * @param fromThis fromThis
*/ */
mVersionSwitchProcessDefinitionVersion({ version, processDefinitionId, fromThis }) { mVersionSwitchProcessDefinitionVersion ({ version, processDefinitionId, fromThis }) {
this.$store.state.dag.isSwitchVersion = true this.$store.state.dag.isSwitchVersion = true
this.switchProcessDefinitionVersion({ this.switchProcessDefinitionVersion({
version: version, version: version,
processDefinitionId: processDefinitionId processDefinitionId: processDefinitionId
}).then(res=>{ }).then(res => {
this.$message.success($t('Switch Version Successfully')) this.$message.success($t('Switch Version Successfully'))
this.$router.push({ path: `/projects/definition/list/${processDefinitionId}?_t=${new Date().getTime()}` }) this.$router.push({ path: `/projects/definition/list/${processDefinitionId}?_t=${new Date().getTime()}` })
}).catch(e => { }).catch(e => {
@ -720,7 +729,7 @@
this.$message.error(e.msg || '') this.$message.error(e.msg || '')
}) })
}, },
/** /**
* Paging event of process definition versions * Paging event of process definition versions
* *
@ -729,17 +738,17 @@
* @param processDefinitionId the process definition id of page version * @param processDefinitionId the process definition id of page version
* @param fromThis fromThis * @param fromThis fromThis
*/ */
mVersionGetProcessDefinitionVersionsPage({ pageNo, pageSize, processDefinitionId, fromThis }) { mVersionGetProcessDefinitionVersionsPage ({ pageNo, pageSize, processDefinitionId, fromThis }) {
this.getProcessDefinitionVersionsPage({ this.getProcessDefinitionVersionsPage({
pageNo: pageNo, pageNo: pageNo,
pageSize: pageSize, pageSize: pageSize,
processDefinitionId: processDefinitionId processDefinitionId: processDefinitionId
}).then(res=>{ }).then(res => {
this.versionData.processDefinitionVersions = res.data.lists this.versionData.processDefinitionVersions = res.data.lists
this.versionData.total = res.data.totalCount this.versionData.total = res.data.totalCount
this.versionData.pageSize = res.data.pageSize this.versionData.pageSize = res.data.pageSize
this.versionData.pageNo = res.data.currentPage this.versionData.pageNo = res.data.currentPage
}).catch(e=>{ }).catch(e => {
this.$message.error(e.msg || '') this.$message.error(e.msg || '')
}) })
}, },
@ -748,7 +757,6 @@
* query the process definition pagination version * query the process definition pagination version
*/ */
_version (item) { _version (item) {
let self = this
this.getProcessDefinitionVersionsPage({ this.getProcessDefinitionVersionsPage({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
@ -766,17 +774,15 @@
this.versionData.pageNo = pageNo this.versionData.pageNo = pageNo
this.versionData.pageSize = pageSize this.versionData.pageSize = pageSize
this.drawer = true this.drawer = true
}).catch(e => { }).catch(e => {
this.$message.error(e.msg || '') this.$message.error(e.msg || '')
}) })
} }
}, },
watch: { watch: {
'tasks': { tasks: {
deep: true, deep: true,
handler (o) { handler (o) {
// Edit state does not allow deletion of node a... // Edit state does not allow deletion of node a...
this.setIsEditDag(true) this.setIsEditDag(true)
} }
@ -809,8 +815,8 @@
} }
], ],
['Label', { ['Label', {
location: 0.5, location: 0.5,
id: 'label' id: 'label'
}] }]
], ],
Container: 'canvas', Container: 'canvas',

36
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/dependentTimeout.vue

@ -143,21 +143,21 @@
if (p === 2 || p === 0) { if (p === 2 || p === 0) {
this.waitCompleteTimeout.strategy = is ? ['WARN'] : [] this.waitCompleteTimeout.strategy = is ? ['WARN'] : []
this.waitCompleteTimeout.interval = is ? 30 : null this.waitCompleteTimeout.interval = is ? 30 : null
} }
}, },
_verification () { _verification () {
// Verification timeout policy // Verification timeout policy
if (this.enable if (this.enable &&
&& (this.waitCompleteTimeout.enable && !this.waitCompleteTimeout.strategy.length) (this.waitCompleteTimeout.enable && !this.waitCompleteTimeout.strategy.length) ||
|| (this.waitStartTimeout.enable && !this.waitStartTimeout.strategy.length)) { (this.waitStartTimeout.enable && !this.waitStartTimeout.strategy.length)) {
this.$message.warning(`${this.$t('Timeout strategy must be selected')}`) this.$message.warning(`${this.$t('Timeout strategy must be selected')}`)
return false return false
} }
// Verify timeout duration Non 0 positive integer // Verify timeout duration Non 0 positive integer
const reg = /^[1-9]\d*$/ const reg = /^[1-9]\d*$/
if (this.enable if (this.enable &&
&& (this.waitCompleteTimeout.enable && !reg.test(this.waitCompleteTimeout.interval)) (this.waitCompleteTimeout.enable && !reg.test(this.waitCompleteTimeout.interval)) ||
|| (this.waitStartTimeout.enable && (!reg.test(this.waitStartTimeout.interval || !reg.test(this.waitStartTimeout.checkInterval))))) { (this.waitStartTimeout.enable && (!reg.test(this.waitStartTimeout.interval || !reg.test(this.waitStartTimeout.checkInterval))))) {
this.$message.warning(`${this.$t('Timeout must be a positive integer')}`) this.$message.warning(`${this.$t('Timeout must be a positive integer')}`)
return false return false
} }
@ -175,16 +175,16 @@
}, },
waitCompleteTimeout: { waitCompleteTimeout: {
strategy: (() => { strategy: (() => {
// Handling checkout sequence // Handling checkout sequence
let strategy = this.waitCompleteTimeout.strategy let strategy = this.waitCompleteTimeout.strategy
if (strategy.length === 2 && strategy[0] === 'FAILED') { if (strategy.length === 2 && strategy[0] === 'FAILED') {
return [strategy[1], strategy[0]].join(',') return [strategy[1], strategy[0]].join(',')
} else { } else {
return strategy.join(',') return strategy.join(',')
} }
})(), })(),
interval: parseInt(this.waitCompleteTimeout.interval), interval: parseInt(this.waitCompleteTimeout.interval),
enable: this.waitCompleteTimeout.enable enable: this.waitCompleteTimeout.enable
} }
}) })
return true return true
@ -215,4 +215,4 @@
}, },
components: {} components: {}
} }
</script> </script>

12
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/selectInput.vue

@ -20,7 +20,7 @@
:disabled="isDetails" :disabled="isDetails"
size="small" size="small"
@change="_onChange" @change="_onChange"
v-model="value"> v-model="selectedValue">
<el-input <el-input
ref="input" ref="input"
slot="trigger" slot="trigger"
@ -53,6 +53,7 @@
name: 'form-select-input', name: 'form-select-input',
data () { data () {
return { return {
selectedValue: this.value,
isIconState: false, isIconState: false,
isInput: true isInput: true
} }
@ -88,7 +89,7 @@
}, 1) }, 1)
}, },
_onBlur () { _onBlur () {
let val = $(this.$refs['input'].$el).find('input')[0].value let val = $(this.$refs.input.$el).find('input')[0].value
if (this._validation(val)) { if (this._validation(val)) {
this.$emit('valueEvent', val) this.$emit('valueEvent', val)
this._setIconState(val) this._setIconState(val)
@ -107,12 +108,15 @@
} }
}, },
watch: { watch: {
value (val) {
this.selectedValue = val
}
}, },
created () { created () {
this._setIconState(this.value) this._setIconState(this.selectedValue)
}, },
mounted () { mounted () {
}, },
components: {} components: {}
} }
</script> </script>

2
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue

@ -127,4 +127,4 @@
}, },
components: {} components: {}
} }
</script> </script>

7
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/workerGroups.vue

@ -18,7 +18,7 @@
<el-select <el-select
:disabled="isDetails" :disabled="isDetails"
@change="_onChange" @change="_onChange"
v-model="value" v-model="selectedValue"
size="small" size="small"
style="width: 180px"> style="width: 180px">
<el-option <el-option
@ -35,6 +35,7 @@
name: 'form-worker-group', name: 'form-worker-group',
data () { data () {
return { return {
selectedValue: this.value,
workerGroupsList: [] workerGroupsList: []
} }
}, },
@ -51,11 +52,13 @@
}, },
methods: { methods: {
_onChange (o) { _onChange (o) {
this.value = o
this.$emit('workerGroupsEvent', o) this.$emit('workerGroupsEvent', o)
} }
}, },
watch: { watch: {
value (val) {
this.selectedValue = val
}
}, },
created () { created () {
let stateWorkerGroupsList = this.store.state.security.workerGroupsListAll || [] let stateWorkerGroupsList = this.store.state.security.workerGroupsListAll || []

54
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formLineModel.vue

@ -48,20 +48,16 @@
</div> </div>
</template> </template>
<script> <script>
import _ from 'lodash'
import { mapActions } from 'vuex'
import i18n from '@/module/i18n'
import JSP from './../plugIn/jsPlumbHandle'
import disabledState from '@/module/mixin/disabledState' import disabledState from '@/module/mixin/disabledState'
export default { export default {
name: 'form-line-model', name: 'form-line-model',
data () { data () {
return { return {
// loading // loading
spinnerLoading: false, spinnerLoading: false,
// node name // node name
labelName: '', labelName: ''
} }
}, },
mixins: [disabledState], mixins: [disabledState],
@ -69,38 +65,38 @@
lineData: Object lineData: Object
}, },
methods: { methods: {
cancel() { cancel () {
this.$emit('cancel', { this.$emit('cancel', {
fromThis: this fromThis: this
}) })
}, },
ok() { ok () {
if($(`#${this.lineData.id}`).prev().attr('class')==='jtk-overlay') { if ($(`#${this.lineData.id}`).prev().attr('class') === 'jtk-overlay') {
$(`#${this.lineData.id}`).prev().empty() $(`#${this.lineData.id}`).prev().empty()
}
$(`#${this.lineData.id}`).text(this.labelName)
this.$emit('addLineInfo', {
item: {
labelName: this.labelName,
sourceId: this.lineData.sourceId,
targetId: this.lineData.targetId
},
fromThis: this
})
} }
}, $(`#${this.lineData.id}`).text(this.labelName)
this.$emit('addLineInfo', {
item: {
labelName: this.labelName,
sourceId: this.lineData.sourceId,
targetId: this.lineData.targetId
},
fromThis: this
})
}
},
watch: { watch: {
}, },
created () { created () {
if($(`#${this.lineData.id}`).prev().attr('class').indexOf('jtk-overlay')!==-1) { if ($(`#${this.lineData.id}`).prev().attr('class').indexOf('jtk-overlay') !== -1) {
this.labelName = $(`#${this.lineData.id}`).prev().text() this.labelName = $(`#${this.lineData.id}`).prev().text()
} else { } else {
this.labelName = $(`#${this.lineData.id}`).text() this.labelName = $(`#${this.lineData.id}`).text()
} }
}, },
mounted () { mounted () {
}, },
updated () { updated () {
}, },
@ -109,7 +105,7 @@
destroyed () { destroyed () {
}, },
computed: { computed: {
}, },
components: {} components: {}
} }

88
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue

@ -342,8 +342,8 @@
successBranch: '', successBranch: '',
failedBranch: '', failedBranch: '',
conditionResult: { conditionResult: {
'successNode': [], successNode: [],
'failedNode': [] failedNode: []
}, },
// dependence // dependence
dependence: {}, dependence: {},
@ -369,7 +369,7 @@
taskInstancePriority: 'MEDIUM', taskInstancePriority: 'MEDIUM',
// worker group id // worker group id
workerGroup: 'default', workerGroup: 'default',
stateList:[ stateList: [
{ {
value: 'success', value: 'success',
label: `${i18n.$t('success')}` label: `${i18n.$t('success')}`
@ -381,8 +381,8 @@
], ],
// preTasks // preTasks
preTaskIdsInWorkflow: [], preTaskIdsInWorkflow: [],
preTasksToAdd: [], // pre-taskIds to add, used in jsplumb connects preTasksToAdd: [], // pre-taskIds to add, used in jsplumb connects
preTasksToDelete: [], // pre-taskIds to delete, used in jsplumb connects preTasksToDelete: [] // pre-taskIds to delete, used in jsplumb connects
} }
}, },
/** /**
@ -438,13 +438,7 @@
* Jump to task instance * Jump to task instance
*/ */
_seeHistory () { _seeHistory () {
this.nodeData.self.$router.push({ this.$emit('seeHistory', this.backfillItem.name)
name: 'task-instance',
query: {
processInstanceId: this.nodeData.self.$route.params.id,
taskName: this.backfillItem.name
}
})
}, },
/** /**
* Enter the child node to judge the process instance or the process definition * Enter the child node to judge the process instance or the process definition
@ -463,12 +457,12 @@
} }
this.store.dispatch('dag/getSubProcessId', { taskId: stateId }).then(res => { this.store.dispatch('dag/getSubProcessId', { taskId: stateId }).then(res => {
this.$emit('onSubProcess', { this.$emit('onSubProcess', {
subProcessId: res.data.subProcessInstanceId, subProcessId: res.data.subProcessInstanceId,
fromThis: this fromThis: this
}) })
}).catch(e => { }).catch(e => {
this.$message.error(e.msg || '') this.$message.error(e.msg || '')
}) })
} else { } else {
this.$emit('onSubProcess', { this.$emit('onSubProcess', {
subProcessId: this.backfillItem.params.processDefinitionId, subProcessId: this.backfillItem.params.processDefinitionId,
@ -522,7 +516,7 @@
this.$message.warning(`${i18n.$t('Please enter name (required)')}`) this.$message.warning(`${i18n.$t('Please enter name (required)')}`)
return false return false
} }
if (this.successBranch !='' && this.successBranch !=null && this.successBranch == this.failedBranch) { if (this.successBranch !== '' && this.successBranch !== null && this.successBranch === this.failedBranch) {
this.$message.warning(`${i18n.$t('Cannot select the same node for successful branch flow and failed branch flow')}`) this.$message.warning(`${i18n.$t('Cannot select the same node for successful branch flow and failed branch flow')}`)
return false return false
} }
@ -536,13 +530,13 @@
} }
return true return true
}, },
_verifWorkGroup() { _verifWorkGroup () {
let item = this.store.state.security.workerGroupsListAll.find(item => { let item = this.store.state.security.workerGroupsListAll.find(item => {
return item.id == this.workerGroup; return item.id === this.workerGroup
}); })
if(item==undefined) { if (item === undefined) {
this.$message.warning(`${i18n.$t('The Worker group no longer exists, please select the correct Worker group!')}`) this.$message.warning(`${i18n.$t('The Worker group no longer exists, please select the correct Worker group!')}`)
return false; return false
} }
return true return true
}, },
@ -555,30 +549,29 @@
return return
} }
// verif workGroup // verif workGroup
if(!this._verifWorkGroup()) { if (!this._verifWorkGroup()) {
return return
} }
// Verify task alarm parameters // Verify task alarm parameters
if (this.nodeData.taskType === 'DEPENDENT') { if (this.nodeData.taskType === 'DEPENDENT') {
if (!this.$refs['dependentTimeout']._verification()) { if (!this.$refs.dependentTimeout._verification()) {
return return
} }
} else { } else {
if (!this.$refs['timeout']._verification()) { if (!this.$refs.timeout._verification()) {
return return
} }
} }
// Verify node parameters // Verify node parameters
if (!this.$refs[this.nodeData.taskType]._verification()) { if (!this.$refs[this.nodeData.taskType]._verification()) {
return return
} }
// Verify preTasks and update dag-things // Verify preTasks and update dag-things
if (this.$refs['PRE_TASK']) { if (this.$refs.PRE_TASK) {
if (!this.$refs['PRE_TASK']._verification()) { if (!this.$refs.PRE_TASK._verification()) {
return return
} } else {
else {
// Sync data-targetarr // Sync data-targetarr
$(`#${this.nodeData.id}`).attr( $(`#${this.nodeData.id}`).attr(
'data-targetarr', this.preTaskIdsInWorkflow ? this.preTaskIdsInWorkflow.join(',') : '') 'data-targetarr', this.preTaskIdsInWorkflow ? this.preTaskIdsInWorkflow.join(',') : '')
@ -594,7 +587,7 @@
target: targetId, target: targetId,
type: 'basic', type: 'basic',
paintStyle: { strokeWidth: 2, stroke: '#2d8cf0' }, paintStyle: { strokeWidth: 2, stroke: '#2d8cf0' },
HoverPaintStyle: {stroke: '#ccc', strokeWidth: 3} HoverPaintStyle: { stroke: '#ccc', strokeWidth: 3 }
}) })
}) })
@ -602,7 +595,7 @@
let currentConnects = plumbIns.getAllConnections() let currentConnects = plumbIns.getAllConnections()
let len = currentConnects.length let len = currentConnects.length
for (let i = 0; i < len; i++) { for (let i = 0; i < len; i++) {
if (this.preTasksToDelete.indexOf(currentConnects[i].sourceId) > -1 && currentConnects[i].targetId == targetId) { if (this.preTasksToDelete.indexOf(currentConnects[i].sourceId) > -1 && currentConnects[i].targetId === targetId) {
plumbIns.deleteConnection(currentConnects[i]) plumbIns.deleteConnection(currentConnects[i])
i -= 1 i -= 1
len -= 1 len -= 1
@ -680,7 +673,7 @@
fromThis: this fromThis: this
}) })
} }
}, },
watch: { watch: {
/** /**
* Watch the item change, cache the value it changes * Watch the item change, cache the value it changes
@ -695,7 +688,7 @@
// Backfill data // Backfill data
let taskList = this.store.state.dag.tasks let taskList = this.store.state.dag.tasks
//fillback use cacheTasks // fillback use cacheTasks
let cacheTasks = this.store.state.dag.cacheTasks let cacheTasks = this.store.state.dag.cacheTasks
let o = {} let o = {}
if (cacheTasks[this.nodeData.id]) { if (cacheTasks[this.nodeData.id]) {
@ -720,21 +713,19 @@
this.maxRetryTimes = o.maxRetryTimes this.maxRetryTimes = o.maxRetryTimes
this.retryInterval = o.retryInterval this.retryInterval = o.retryInterval
this.delayTime = o.delayTime this.delayTime = o.delayTime
if(o.conditionResult) { if (o.conditionResult) {
this.successBranch = o.conditionResult.successNode[0] this.successBranch = o.conditionResult.successNode[0]
this.failedBranch = o.conditionResult.failedNode[0] this.failedBranch = o.conditionResult.failedNode[0]
} }
// If the workergroup has been deleted, set the default workergroup // If the workergroup has been deleted, set the default workergroup
var hasMatch = false;
for (let i = 0; i < this.store.state.security.workerGroupsListAll.length; i++) { for (let i = 0; i < this.store.state.security.workerGroupsListAll.length; i++) {
var workerGroup = this.store.state.security.workerGroupsListAll[i].id var workerGroup = this.store.state.security.workerGroupsListAll[i].id
if (o.workerGroup == workerGroup) { if (o.workerGroup === workerGroup) {
hasMatch = true; break
break;
} }
} }
if(o.workerGroup == undefined) { if (o.workerGroup === undefined) {
this.store.dispatch('dag/getTaskInstanceList',{ this.store.dispatch('dag/getTaskInstanceList', {
pageSize: 10, pageNo: 1, processInstanceId: this.nodeData.instanceId, name: o.name pageSize: 10, pageNo: 1, processInstanceId: this.nodeData.instanceId, name: o.name
}).then(res => { }).then(res => {
this.workerGroup = res.totalList[0].workerGroup this.workerGroup = res.totalList[0].workerGroup
@ -746,7 +737,6 @@
this.params = o.params || {} this.params = o.params || {}
this.dependence = o.dependence || {} this.dependence = o.dependence || {}
this.cacheDependence = o.dependence || {} this.cacheDependence = o.dependence || {}
} else { } else {
this.workerGroup = this.store.state.security.workerGroupsListAll[0].id this.workerGroup = this.store.state.security.workerGroupsListAll[0].id
} }
@ -765,10 +755,10 @@
}, },
mounted () { mounted () {
let self = this let self = this
$("#cancelBtn").mousedown(function(event){ $('#cancelBtn').mousedown(function (event) {
event.preventDefault(); event.preventDefault()
self.close() self.close()
}); })
}, },
updated () { updated () {
}, },
@ -784,7 +774,7 @@
return this.nodeData.taskType === 'SUB_PROCESS' && this.name return this.nodeData.taskType === 'SUB_PROCESS' && this.name
}, },
//Define the item model // Define the item model
_item () { _item () {
return { return {
type: this.nodeData.taskType, type: this.nodeData.taskType,
@ -826,7 +816,7 @@
mDependentTimeout, mDependentTimeout,
mPriority, mPriority,
mWorkerGroups, mWorkerGroups,
mPreTasks, mPreTasks
} }
} }
</script> </script>

12
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/log.vue

@ -67,7 +67,7 @@
*/ */
const handerTextareaSize = (isH = 0) => { const handerTextareaSize = (isH = 0) => {
$('body').find('.tooltip.fade.top.in').remove() $('body').find('.tooltip.fade.top.in').remove()
return $('.textarea-ft').css({ 'height': `${$('.content-log-box').height() - isH}px` }) return $('.textarea-ft').css({ height: `${$('.content-log-box').height() - isH}px` })
} }
let content = '' let content = ''
@ -89,7 +89,7 @@
props: { props: {
item: { item: {
type: Object, type: Object,
default: {} default: Object
}, },
source: { source: {
type: String, type: String,
@ -179,8 +179,8 @@
this.loadingIndex = this.loadingIndex - 1 this.loadingIndex = this.loadingIndex - 1
this._ckLog() this._ckLog()
}, 1000, { }, 1000, {
'leading': false, leading: false,
'trailing': true trailing: true
}), }),
/** /**
* down * down
@ -189,8 +189,8 @@
this.loadingIndex = this.loadingIndex + 1 this.loadingIndex = this.loadingIndex + 1
this._ckLog() this._ckLog()
}, 1000, { }, 1000, {
'leading': false, leading: false,
'trailing': true trailing: true
}), }),
/** /**
* Monitor scroll bar * Monitor scroll bar

2
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue

@ -128,7 +128,7 @@
this.$emit('on-dsData', { this.$emit('on-dsData', {
type: this.type, type: this.type,
datasource: val datasource: val
}); })
} }
}, },
created () { created () {

11
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue

@ -74,7 +74,7 @@
props: { props: {
dependItemList: Array, dependItemList: Array,
index: Number, index: Number,
dependTaskList:Array dependTaskList: Array
}, },
model: { model: {
prop: 'dependItemList', prop: 'dependItemList',
@ -109,7 +109,6 @@
* remove task * remove task
*/ */
_remove (i) { _remove (i) {
this.dependTaskList[this.index].dependItemList.splice(i,1)
this._removeTip() this._removeTip()
if (!this.dependItemList.length || this.dependItemList.length === 0) { if (!this.dependItemList.length || this.dependItemList.length === 0) {
this.$emit('on-delete-all', { this.$emit('on-delete-all', {
@ -176,14 +175,14 @@
*/ */
_onChangeProjectId (value) { _onChangeProjectId (value) {
this._getProcessByProjectId(value).then(definitionList => { this._getProcessByProjectId(value).then(definitionList => {
/*this.$set(this.dependItemList, this.itemIndex, this._dlOldParams(value, definitionList, item))*/ /* this.$set(this.dependItemList, this.itemIndex, this._dlOldParams(value, definitionList, item)) */
let definitionId = definitionList[0].value let definitionId = definitionList[0].value
this._getDependItemList(definitionId).then(depTasksList => { this._getDependItemList(definitionId).then(depTasksList => {
let item = this.dependItemList[this.itemIndex] let item = this.dependItemList[this.itemIndex]
// init set depTasks All // init set depTasks All
item.depTasks = 'ALL' item.depTasks = 'ALL'
// set dependItemList item data // set dependItemList item data
this.$set(this.dependItemList, this.itemIndex, this._cpOldParams(value,definitionId, definitionList,depTasksList, item)) this.$set(this.dependItemList, this.itemIndex, this._cpOldParams(value, definitionId, definitionList, depTasksList, item))
}) })
}) })
}, },
@ -212,7 +211,7 @@
depTasksList: depTasksList, depTasksList: depTasksList,
cycle: 'day', cycle: 'day',
dateValue: 'today', dateValue: 'today',
dateValueList: _.cloneDeep(dateValueList['day']), dateValueList: _.cloneDeep(dateValueList.day),
state: '' state: ''
} }
}, },
@ -231,7 +230,7 @@
} }
}, },
_cpOldParams (value,definitionId, definitionList,depTasksList, item) { _cpOldParams (value, definitionId, definitionList, depTasksList, item) {
return { return {
projectId: value, projectId: value,
definitionList: definitionList, definitionList: definitionList,

9
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/httpParams.vue

@ -83,7 +83,7 @@
// Current execution index // Current execution index
httpParamsIndex: null, httpParamsIndex: null,
// //
positionList:positionList positionList: positionList
} }
}, },
mixins: [disabledState], mixins: [disabledState],
@ -142,7 +142,7 @@
if (!v.prop) { if (!v.prop) {
flag = false flag = false
} }
if(v.value === ''){ if (v.value === '') {
this.$message.warning(`${i18n.$t('value is empty')}`) this.$message.warning(`${i18n.$t('value is empty')}`)
return false return false
} }
@ -173,7 +173,7 @@
} }
}) })
if (!flag) { if (!flag) {
this.$message.warning(`${i18n.$t('value is empty')}`) this.$message.warning(`${i18n.$t('value is empty')}`)
return false return false
} }
this.$emit('on-http-params', _.cloneDeep(this.httpParamsList)) this.$emit('on-http-params', _.cloneDeep(this.httpParamsList))
@ -191,7 +191,7 @@
}, },
computed: { computed: {
inputStyle () { inputStyle () {
return "width:30%" return 'width:30%'
} }
}, },
mounted () { mounted () {
@ -240,4 +240,3 @@
} }
} }
</style> </style>

11
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/jsonBox.vue

@ -31,7 +31,6 @@
</template> </template>
<script> <script>
import _ from 'lodash' import _ from 'lodash'
import i18n from '@/module/i18n'
import mListBox from './listBox' import mListBox from './listBox'
import disabledState from '@/module/mixin/disabledState' import disabledState from '@/module/mixin/disabledState'
import codemirror from '@/conf/home/pages/resource/pages/file/pages/_source/codemirror' import codemirror from '@/conf/home/pages/resource/pages/file/pages/_source/codemirror'
@ -43,7 +42,7 @@
data () { data () {
return { return {
// script // script
rawScript: '', rawScript: ''
} }
}, },
mixins: [disabledState], mixins: [disabledState],
@ -56,13 +55,13 @@
*/ */
_handlerEditor () { _handlerEditor () {
// editor // editor
let self =this let self = this
editor = codemirror('code-shell-mirror1', { editor = codemirror('code-shell-mirror1', {
mode: 'shell', mode: 'shell',
readOnly: this.isDetails readOnly: this.isDetails
}) })
editor.on("change",function(){ editor.on('change', function () {
self.$emit('getJsonBoxValue',editor.getValue()) self.$emit('getJsonBoxValue', editor.getValue())
}) })
this.keypress = () => { this.keypress = () => {
@ -79,7 +78,7 @@
editor.setValue(this.rawScript) editor.setValue(this.rawScript)
return editor return editor
}, }
}, },
watch: {}, watch: {},
created () { created () {

10
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/nodeStatus.vue

@ -45,7 +45,7 @@
</template> </template>
<script> <script>
import _ from 'lodash' import _ from 'lodash'
import { cycleList, dateValueList, nodeStatusList } from './commcon' import { cycleList, nodeStatusList } from './commcon'
import disabledState from '@/module/mixin/disabledState' import disabledState from '@/module/mixin/disabledState'
export default { export default {
name: 'node-status', name: 'node-status',
@ -64,7 +64,7 @@
props: { props: {
dependItemList: Array, dependItemList: Array,
index: Number, index: Number,
dependTaskList:Array, dependTaskList: Array,
preNode: Array preNode: Array
}, },
model: { model: {
@ -78,7 +78,7 @@
_add () { _add () {
// btn loading // btn loading
this.isLoading = true this.isLoading = true
this.$emit('dependItemListEvent', _.concat(this.dependItemList, this._rtNewParams())) this.$emit('dependItemListEvent', _.concat(this.dependItemList, this._rtNewParams()))
// remove tooltip // remove tooltip
this._removeTip() this._removeTip()
@ -87,7 +87,6 @@
* remove task * remove task
*/ */
_remove (i) { _remove (i) {
this.dependTaskList[this.index].dependItemList.splice(i,1)
this._removeTip() this._removeTip()
if (!this.dependItemList.length || this.dependItemList.length === 0) { if (!this.dependItemList.length || this.dependItemList.length === 0) {
this.$emit('on-delete-all', { this.$emit('on-delete-all', {
@ -137,7 +136,7 @@
status: '' status: ''
} }
}, },
_rtOldParams (value,depTasksList, item) { _rtOldParams (value, depTasksList, item) {
return { return {
depTasks: '', depTasks: '',
status: '' status: ''
@ -159,7 +158,6 @@
this.isInstance = this.router.history.current.name === 'projects-instance-details' this.isInstance = this.router.history.current.name === 'projects-instance-details'
// get processlist // get processlist
this._getProjectList().then(() => { this._getProjectList().then(() => {
let projectId = this.projectList[0].value
if (!this.dependItemList.length) { if (!this.dependItemList.length) {
this.$emit('dependItemListEvent', _.concat(this.dependItemList, this._rtNewParams())) this.$emit('dependItemListEvent', _.concat(this.dependItemList, this._rtNewParams()))
} else { } else {

11
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/scriptBox.vue

@ -31,7 +31,6 @@
</template> </template>
<script> <script>
import _ from 'lodash' import _ from 'lodash'
import i18n from '@/module/i18n'
import mListBox from './listBox' import mListBox from './listBox'
import disabledState from '@/module/mixin/disabledState' import disabledState from '@/module/mixin/disabledState'
import codemirror from '@/conf/home/pages/resource/pages/file/pages/_source/codemirror' import codemirror from '@/conf/home/pages/resource/pages/file/pages/_source/codemirror'
@ -43,7 +42,7 @@
data () { data () {
return { return {
// script // script
rawScript: '', rawScript: ''
} }
}, },
mixins: [disabledState], mixins: [disabledState],
@ -56,13 +55,13 @@
*/ */
_handlerEditor () { _handlerEditor () {
// editor // editor
let self =this let self = this
editor = codemirror('code-shell-mirror1', { editor = codemirror('code-shell-mirror1', {
mode: 'shell', mode: 'shell',
readOnly: this.isDetails readOnly: this.isDetails
}) })
editor.on("change",function(){ editor.on('change', function () {
self.$emit('getSriptBoxValue',editor.getValue()) self.$emit('getSriptBoxValue', editor.getValue())
}) })
this.keypress = () => { this.keypress = () => {
@ -79,7 +78,7 @@
editor.setValue(this.rawScript) editor.setValue(this.rawScript)
return editor return editor
}, }
}, },
watch: {}, watch: {},
created () { created () {

3
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/sqlType.vue

@ -32,7 +32,6 @@
</div> </div>
</template> </template>
<script> <script>
import _ from 'lodash'
import { sqlTypeList } from './commcon' import { sqlTypeList } from './commcon'
import disabledState from '@/module/mixin/disabledState' import disabledState from '@/module/mixin/disabledState'
export default { export default {
@ -61,7 +60,7 @@
}, },
created () { created () {
this.$nextTick(() => { this.$nextTick(() => {
if (this.sqlType != 0) { if (this.sqlType !== 0) {
this.sqlTypeId = this.sqlType this.sqlTypeId = this.sqlType
} else { } else {
this.sqlTypeId = this.sqlTypeList[0].id this.sqlTypeId = this.sqlTypeList[0].id

4
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/udfs.vue

@ -25,7 +25,7 @@
v-for="city in udfsList" v-for="city in udfsList"
:key="city.id" :key="city.id"
:value="city.id" :value="city.id"
:label="city.code"> :label="city.code">
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
@ -93,7 +93,7 @@
}, },
type (a) { type (a) {
// The props parameter needs to be changed due to the scene. // The props parameter needs to be changed due to the scene.
this.udfs = '' this.$emit('on-udfsData', '')
if (a === 'HIVE') { if (a === 'HIVE') {
this._getUdfList() this._getUdfList()
} else { } else {

18
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/conditions.vue

@ -99,9 +99,10 @@
$('body').find('.tooltip.fade.top.in').remove() $('body').find('.tooltip.fade.top.in').remove()
}, },
_onDeleteAll (i) { _onDeleteAll (i) {
this.dependTaskList.map((item,i)=>{ this.dependTaskList[this.index].dependItemList.splice(i, 1)
if(item.dependItemList.length === 0){ this.dependTaskList.map((item, i) => {
this.dependTaskList.splice(i,1) if (item.dependItemList.length === 0) {
this.dependTaskList.splice(i, 1)
} }
}) })
// this._deleteDep(i) // this._deleteDep(i)
@ -109,7 +110,7 @@
_setGlobalRelation () { _setGlobalRelation () {
this.relation = this.relation === 'AND' ? 'OR' : 'AND' this.relation = this.relation === 'AND' ? 'OR' : 'AND'
}, },
getDependTaskList(i){ getDependTaskList (i) {
// console.log('getDependTaskList',i) // console.log('getDependTaskList',i)
}, },
_setRelation (i) { _setRelation (i) {
@ -142,20 +143,17 @@
}, },
created () { created () {
let o = this.backfillItem let o = this.backfillItem
let dependentResult = $(`#${o.id}`).data('dependent-result') || {}
// Does not represent an empty object backfill // Does not represent an empty object backfill
if (!_.isEmpty(o)) { if (!_.isEmpty(o)) {
this.relation = _.cloneDeep(o.dependence.relation) || 'AND' this.relation = _.cloneDeep(o.dependence.relation) || 'AND'
this.dependTaskList = _.cloneDeep(o.dependence.dependTaskList) || [] this.dependTaskList = _.cloneDeep(o.dependence.dependTaskList) || []
let defaultState = this.isDetails ? 'WAITING' : ''
// Process instance return status display matches by key // Process instance return status display matches by key
_.map(this.dependTaskList, v => _.map(v.dependItemList, v1 => { _.map(this.dependTaskList, v => _.map(v.dependItemList, v1 => {
$(`#${o.id}`).siblings().each(function(){ $(`#${o.id}`).siblings().each(function () {
if(v1.depTasks == $(this).text()) { if (v1.depTasks === $(this).text()) {
v1.state = $(this).attr('data-dependent-depstate') v1.state = $(this).attr('data-dependent-depstate')
} }
}); })
})) }))
} }
}, },

44
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/datax.vue

@ -214,12 +214,12 @@
// Custom parameter // Custom parameter
localParams: [], localParams: [],
customConfig: 0, customConfig: 0,
//jvm memory xms // jvm memory xms
xms: 1, xms: 1,
//jvm memory xms // jvm memory xms
xmx: 1, xmx: 1,
scriptBoxDialog: false, scriptBoxDialog: false,
item: '', item: ''
} }
}, },
mixins: [disabledState], mixins: [disabledState],
@ -228,7 +228,7 @@
createNodeId: Number createNodeId: Number
}, },
methods: { methods: {
setEditorVal() { setEditorVal () {
this.item = editor.getValue() this.item = editor.getValue()
this.scriptBoxDialog = true this.scriptBoxDialog = true
}, },
@ -236,7 +236,7 @@
editor.setValue(val) editor.setValue(val)
}, },
_onSwitch (is) { _onSwitch (is) {
if(is) { if (is) {
this.customConfig = 1 this.customConfig = 1
setTimeout(() => { setTimeout(() => {
this._handlerJsonEditor() this._handlerJsonEditor()
@ -284,7 +284,7 @@
* verification * verification
*/ */
_verification () { _verification () {
if(this.customConfig) { if (this.customConfig) {
if (!jsonEditor.getValue()) { if (!jsonEditor.getValue()) {
this.$message.warning(`${i18n.$t('Please enter a JSON Statement(required)')}`) this.$message.warning(`${i18n.$t('Please enter a JSON Statement(required)')}`)
return false return false
@ -300,8 +300,8 @@
customConfig: this.customConfig, customConfig: this.customConfig,
json: jsonEditor.getValue(), json: jsonEditor.getValue(),
localParams: this.localParams, localParams: this.localParams,
xms:+this.xms, xms: +this.xms,
xmx:+this.xmx xmx: +this.xmx
}) })
return true return true
} else { } else {
@ -335,7 +335,6 @@
return false return false
} }
debugger
// storage // storage
this.$emit('on-params', { this.$emit('on-params', {
customConfig: this.customConfig, customConfig: this.customConfig,
@ -349,8 +348,8 @@
jobSpeedRecord: this.jobSpeedRecord, jobSpeedRecord: this.jobSpeedRecord,
preStatements: this.preStatements, preStatements: this.preStatements,
postStatements: this.postStatements, postStatements: this.postStatements,
xms:+this.xms, xms: +this.xms,
xmx:+this.xmx xmx: +this.xmx
}) })
return true return true
} }
@ -420,25 +419,25 @@
dataSource: this.rtDatasource, dataSource: this.rtDatasource,
dtType: this.dtType, dtType: this.dtType,
dataTarget: this.rtDatatarget, dataTarget: this.rtDatatarget,
sql: editor?editor.getValue():'', sql: editor ? editor.getValue() : '',
targetTable: this.targetTable, targetTable: this.targetTable,
jobSpeedByte: this.jobSpeedByte * 1024, jobSpeedByte: this.jobSpeedByte * 1024,
jobSpeedRecord: this.jobSpeedRecord, jobSpeedRecord: this.jobSpeedRecord,
preStatements: this.preStatements, preStatements: this.preStatements,
postStatements: this.postStatements, postStatements: this.postStatements,
xms: +this.xms, xms: +this.xms,
xmx: +this.xmx, xmx: +this.xmx
}); })
}, },
_destroyEditor () { _destroyEditor () {
if (editor) { if (editor) {
editor.toTextArea() // Uninstall editor.toTextArea() // Uninstall
editor.off($('.code-sql-mirror'), 'keypress', this.keypress) editor.off($('.code-sql-mirror'), 'keypress', this.keypress)
editor.off($('.code-sql-mirror'), 'changes', this.changes) editor.off($('.code-sql-mirror'), 'changes', this.changes)
} }
}, },
_destroyJsonEditor () { _destroyJsonEditor () {
if (jsonEditor) { if (jsonEditor) {
jsonEditor.toTextArea() // Uninstall jsonEditor.toTextArea() // Uninstall
jsonEditor.off($('.code-json-mirror'), 'keypress', this.keypress) jsonEditor.off($('.code-json-mirror'), 'keypress', this.keypress)
jsonEditor.off($('.code-json-mirror'), 'changes', this.changes) jsonEditor.off($('.code-json-mirror'), 'changes', this.changes)
@ -450,12 +449,11 @@
// Non-null objects represent backfill // Non-null objects represent backfill
if (!_.isEmpty(o)) { if (!_.isEmpty(o)) {
// set jvm memory // set jvm memory
this.xms = o.params.xms || 1 ; this.xms = o.params.xms || 1
this.xmx = o.params.xmx || 1 ; this.xmx = o.params.xmx || 1
// backfill // backfill
if(o.params.customConfig == 0) { if (o.params.customConfig === 0) {
this.customConfig = 0 this.customConfig = 0
this.enable = false this.enable = false
this.dsType = o.params.dsType || '' this.dsType = o.params.dsType || ''
@ -477,7 +475,7 @@
} }
}, },
mounted () { mounted () {
if(this.customConfig) { if (this.customConfig) {
setTimeout(() => { setTimeout(() => {
this._handlerJsonEditor() this._handlerJsonEditor()
}, 200) }, 200)
@ -501,9 +499,9 @@
} }
}, },
watch: { watch: {
//Watch the cacheParams // Watch the cacheParams
cacheParams (val) { cacheParams (val) {
this._cacheParams(); this._cacheParams()
} }
}, },
computed: { computed: {

13
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue

@ -97,9 +97,10 @@
$('body').find('.tooltip.fade.top.in').remove() $('body').find('.tooltip.fade.top.in').remove()
}, },
_onDeleteAll (i) { _onDeleteAll (i) {
this.dependTaskList.map((item,i)=>{ this.dependTaskList[this.index].dependItemList.splice(i, 1)
if(item.dependItemList.length === 0){ this.dependTaskList.map((item, i) => {
this.dependTaskList.splice(i,1) if (item.dependItemList.length === 0) {
this.dependTaskList.splice(i, 1)
} }
}) })
// this._deleteDep(i) // this._deleteDep(i)
@ -107,7 +108,7 @@
_setGlobalRelation () { _setGlobalRelation () {
this.relation = this.relation === 'AND' ? 'OR' : 'AND' this.relation = this.relation === 'AND' ? 'OR' : 'AND'
}, },
getDependTaskList(i){ getDependTaskList (i) {
// console.log('getDependTaskList',i) // console.log('getDependTaskList',i)
}, },
_setRelation (i) { _setRelation (i) {
@ -147,7 +148,9 @@
this.dependTaskList = _.cloneDeep(o.dependence.dependTaskList) || [] this.dependTaskList = _.cloneDeep(o.dependence.dependTaskList) || []
let defaultState = this.isDetails ? 'WAITING' : '' let defaultState = this.isDetails ? 'WAITING' : ''
// Process instance return status display matches by key // Process instance return status display matches by key
_.map(this.dependTaskList, v => _.map(v.dependItemList, v1 => v1.state = dependentResult[`${v1.definitionId}-${v1.depTasks}-${v1.cycle}-${v1.dateValue}`] || defaultState)) _.map(this.dependTaskList, v => _.map(v.dependItemList, v1 => {
v1.state = dependentResult[`${v1.definitionId}-${v1.depTasks}-${v1.cycle}-${v1.dateValue}`] || defaultState
}))
} }
}, },
mounted () { mounted () {

248
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue

@ -184,7 +184,6 @@
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import mLocalParams from './_source/localParams' import mLocalParams from './_source/localParams'
import mListBox from './_source/listBox' import mListBox from './_source/listBox'
import mResources from './_source/resources'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import disabledState from '@/module/mixin/disabledState' import disabledState from '@/module/mixin/disabledState'
@ -226,17 +225,17 @@
// Program type(List) // Program type(List)
programTypeList: [{ code: 'JAVA' }, { code: 'SCALA' }, { code: 'PYTHON' }], programTypeList: [{ code: 'JAVA' }, { code: 'SCALA' }, { code: 'PYTHON' }],
flinkVersion:'<1.10', flinkVersion: '<1.10',
// Flink Versions(List) // Flink Versions(List)
flinkVersionList: [{ code: '<1.10' }, { code: '>=1.10' }], flinkVersionList: [{ code: '<1.10' }, { code: '>=1.10' }],
normalizer(node) { normalizer (node) {
return { return {
label: node.name label: node.name
} }
}, },
allNoResources: [], allNoResources: [],
noRes: [], noRes: []
} }
}, },
props: { props: {
@ -247,10 +246,10 @@
/** /**
* getResourceId * getResourceId
*/ */
marjarId(name) { marjarId (name) {
this.store.dispatch('dag/getResourceId',{ this.store.dispatch('dag/getResourceId', {
type: 'FILE', type: 'FILE',
fullName: '/'+name fullName: '/' + name
}).then(res => { }).then(res => {
this.mainJar = res.id this.mainJar = res.id
}).catch(e => { }).catch(e => {
@ -284,7 +283,6 @@
return false return false
} }
if (!this.mainJar) { if (!this.mainJar) {
this.$message.warning(`${i18n.$t('Please enter main jar package')}`) this.$message.warning(`${i18n.$t('Please enter main jar package')}`)
return false return false
@ -311,7 +309,7 @@
} }
// noRes // noRes
if (this.noRes.length>0) { if (this.noRes.length > 0) {
this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`) this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`)
return false return false
} }
@ -329,7 +327,7 @@
}, },
deployMode: this.deployMode, deployMode: this.deployMode,
resourceList: _.map(this.resourceList, v => { resourceList: _.map(this.resourceList, v => {
return {id: v} return { id: v }
}), }),
localParams: this.localParams, localParams: this.localParams,
flinkVersion: this.flinkVersion, flinkVersion: this.flinkVersion,
@ -343,55 +341,55 @@
}) })
return true return true
}, },
diGuiTree(item) { // Recursive convenience tree structure diGuiTree (item) { // Recursive convenience tree structure
item.forEach(item => { item.forEach(item => {
item.children === '' || item.children === undefined || item.children === null || item.children.length === 0?         item.children === '' || item.children === undefined || item.children === null || item.children.length === 0
this.operationTree(item) : this.diGuiTree(item.children); ? this.operationTree(item) : this.diGuiTree(item.children)
}) })
}, },
operationTree(item) { operationTree (item) {
if(item.dirctory) { if (item.dirctory) {
item.isDisabled =true item.isDisabled = true
} }
delete item.children delete item.children
}, },
searchTree(element, id) { searchTree (element, id) {
// id // id
if (element.id == id) { if (element.id === id) {
return element; return element
} else if (element.children != null) { } else if (element.children !== null) {
var i; var i
var result = null; var result = null
for (i = 0; result == null && i < element.children.length; i++) { for (i = 0; result === null && i < element.children.length; i++) {
result = this.searchTree(element.children[i], id); result = this.searchTree(element.children[i], id)
} }
return result; return result
} }
return null; return null
}, },
dataProcess(backResource) { dataProcess (backResource) {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if(this.resourceList.length>0) { if (this.resourceList.length > 0) {
this.resourceList.forEach(v=>{ this.resourceList.forEach(v => {
this.mainJarList.forEach(v1=>{ this.mainJarList.forEach(v1 => {
if(this.searchTree(v1,v)) { if (this.searchTree(v1, v)) {
isResourceId.push(this.searchTree(v1,v)) isResourceId.push(this.searchTree(v1, v))
} }
}) })
}) })
resourceIdArr = isResourceId.map(item=>{ resourceIdArr = isResourceId.map(item => {
return item.id return item.id
}) })
Array.prototype.diff = function(a) { Array.prototype.diff = function (a) {
return this.filter(function(i) {return a.indexOf(i) < 0;}); return this.filter(function (i) { return a.indexOf(i) < 0 })
}; }
let diffSet = this.resourceList.diff(resourceIdArr); let diffSet = this.resourceList.diff(resourceIdArr)
let optionsCmp = [] let optionsCmp = []
if(diffSet.length>0) { if (diffSet.length > 0) {
diffSet.forEach(item=>{ diffSet.forEach(item => {
backResource.forEach(item1=>{ backResource.forEach(item1 => {
if(item==item1.id || item==item1.res) { if (item === item1.id || item === item1.res) {
optionsCmp.push(item1) optionsCmp.push(item1)
} }
}) })
@ -400,22 +398,22 @@
let noResources = [{ let noResources = [{
id: -1, id: -1,
name: $t('Unauthorized or deleted resources'), name: $t('Unauthorized or deleted resources'),
fullName: '/'+$t('Unauthorized or deleted resources'), fullName: '/' + $t('Unauthorized or deleted resources'),
children: [] children: []
}] }]
if(optionsCmp.length>0) { if (optionsCmp.length > 0) {
this.allNoResources = optionsCmp this.allNoResources = optionsCmp
optionsCmp = optionsCmp.map(item=>{ optionsCmp = optionsCmp.map(item => {
return {id: item.id,name: item.name,fullName: item.res} return { id: item.id, name: item.name, fullName: item.res }
}) })
optionsCmp.forEach(item=>{ optionsCmp.forEach(item => {
item.isNew = true item.isNew = true
}) })
noResources[0].children = optionsCmp noResources[0].children = optionsCmp
this.mainJarList = this.mainJarList.concat(noResources) this.mainJarList = this.mainJarList.concat(noResources)
} }
} }
}, }
}, },
watch: { watch: {
// Listening type // Listening type
@ -424,44 +422,49 @@
this.mainClass = '' this.mainClass = ''
} }
}, },
//Watch the cacheParams // Watch the cacheParams
cacheParams (val) { cacheParams (val) {
this.$emit('on-cache-params', val); this.$emit('on-cache-params', val)
},
resourceIdArr (arr) {
let result = []
arr.forEach(item => {
this.allNoResources.forEach(item1 => {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
} }
}, },
computed: { computed: {
cacheParams () { resourceIdArr () {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if(this.resourceList.length>0) { if (this.resourceList.length > 0) {
this.resourceList.forEach(v=>{ this.resourceList.forEach(v => {
this.mainJarList.forEach(v1=>{ this.mainJarList.forEach(v1 => {
if(this.searchTree(v1,v)) { if (this.searchTree(v1, v)) {
isResourceId.push(this.searchTree(v1,v)) isResourceId.push(this.searchTree(v1, v))
} }
}) })
}) })
resourceIdArr = isResourceId.map(item=>{ resourceIdArr = isResourceId.map(item => {
return {id: item.id,name: item.name,res: item.fullName} return { id: item.id, name: item.name, res: item.fullName }
}) })
} }
let result = [] return resourceIdArr
resourceIdArr.forEach(item=>{ },
this.allNoResources.forEach(item1=>{ cacheParams () {
if(item.id==item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
return { return {
mainClass: this.mainClass, mainClass: this.mainClass,
mainJar: { mainJar: {
id: this.mainJar id: this.mainJar
}, },
deployMode: this.deployMode, deployMode: this.deployMode,
resourceList: resourceIdArr, resourceList: this.resourceIdArr,
localParams: this.localParams, localParams: this.localParams,
slot: this.slot, slot: this.slot,
taskManager: this.taskManager, taskManager: this.taskManager,
@ -474,70 +477,69 @@
} }
}, },
created () { created () {
let item = this.store.state.dag.resourcesListS let item = this.store.state.dag.resourcesListS
let items = this.store.state.dag.resourcesListJar let items = this.store.state.dag.resourcesListJar
this.diGuiTree(item) this.diGuiTree(item)
this.diGuiTree(items) this.diGuiTree(items)
this.mainJarList = item this.mainJarList = item
this.mainJarLists = items this.mainJarLists = items
let o = this.backfillItem let o = this.backfillItem
// Non-null objects represent backfill // Non-null objects represent backfill
if (!_.isEmpty(o)) { if (!_.isEmpty(o)) {
this.mainClass = o.params.mainClass || '' this.mainClass = o.params.mainClass || ''
if(o.params.mainJar.res) { if (o.params.mainJar.res) {
this.marjarId(o.params.mainJar.res) this.marjarId(o.params.mainJar.res)
} else if(o.params.mainJar.res=='') { } else if (o.params.mainJar.res === '') {
this.mainJar = '' this.mainJar = ''
} else { } else {
this.mainJar = o.params.mainJar.id || '' this.mainJar = o.params.mainJar.id || ''
} }
this.deployMode = o.params.deployMode || '' this.deployMode = o.params.deployMode || ''
this.flinkVersion = o.params.flinkVersion || '<1.10' this.flinkVersion = o.params.flinkVersion || '<1.10'
this.slot = o.params.slot || 1 this.slot = o.params.slot || 1
this.taskManager = o.params.taskManager || '2' this.taskManager = o.params.taskManager || '2'
this.jobManagerMemory = o.params.jobManagerMemory || '1G' this.jobManagerMemory = o.params.jobManagerMemory || '1G'
this.taskManagerMemory = o.params.taskManagerMemory || '2G' this.taskManagerMemory = o.params.taskManagerMemory || '2G'
this.mainArgs = o.params.mainArgs || '' this.mainArgs = o.params.mainArgs || ''
this.others = o.params.others this.others = o.params.others
this.programType = o.params.programType || 'SCALA' this.programType = o.params.programType || 'SCALA'
// backfill resourceList // backfill resourceList
let backResource = o.params.resourceList || [] let backResource = o.params.resourceList || []
let resourceList = o.params.resourceList || [] let resourceList = o.params.resourceList || []
if (resourceList.length) { if (resourceList.length) {
_.map(resourceList, v => { _.map(resourceList, v => {
if(!v.id) { if (!v.id) {
this.store.dispatch('dag/getResourceId',{ this.store.dispatch('dag/getResourceId', {
type: 'FILE', type: 'FILE',
fullName: '/'+v.res fullName: '/' + v.res
}).then(res => { }).then(res => {
this.resourceList.push(res.id) this.resourceList.push(res.id)
this.dataProcess(backResource)
}).catch(e => {
this.resourceList.push(v.res)
this.dataProcess(backResource)
})
} else {
this.resourceList.push(v.id)
this.dataProcess(backResource) this.dataProcess(backResource)
} }).catch(e => {
}) this.resourceList.push(v.res)
this.cacheResourceList = resourceList this.dataProcess(backResource)
} })
} else {
this.resourceList.push(v.id)
this.dataProcess(backResource)
}
})
this.cacheResourceList = resourceList
}
// backfill localParams // backfill localParams
let localParams = o.params.localParams || [] let localParams = o.params.localParams || []
if (localParams.length) { if (localParams.length) {
this.localParams = localParams this.localParams = localParams
}
} }
}
}, },
mounted () { mounted () {
}, },
components: { mLocalParams, mListBox, mResources, Treeselect } components: { mLocalParams, mListBox, Treeselect }
} }
</script> </script>

59
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/http.vue

@ -89,7 +89,6 @@
</div> </div>
</m-list-box> </m-list-box>
<m-list-box > <m-list-box >
<div slot="text">{{$t('Timeout Settings')}}</div> <div slot="text">{{$t('Timeout Settings')}}</div>
<div slot="content"> <div slot="content">
@ -144,8 +143,8 @@
data () { data () {
return { return {
timeoutSettings: false, timeoutSettings: false,
connectTimeout : 60000 , connectTimeout: 60000,
socketTimeout : 60000 , socketTimeout: 60000,
url: '', url: '',
condition: '', condition: '',
@ -154,7 +153,7 @@
httpMethod: 'GET', httpMethod: 'GET',
httpMethodList: [{ code: 'GET' }, { code: 'POST' }, { code: 'HEAD' }, { code: 'PUT' }, { code: 'DELETE' }], httpMethodList: [{ code: 'GET' }, { code: 'POST' }, { code: 'HEAD' }, { code: 'PUT' }, { code: 'DELETE' }],
httpCheckCondition: 'STATUS_CODE_DEFAULT', httpCheckCondition: 'STATUS_CODE_DEFAULT',
httpCheckConditionList: cookies.get('language') == 'en_US'? [{ code: 'STATUS_CODE_DEFAULT',value:'Default response code 200' }, { code: 'STATUS_CODE_CUSTOM',value:'Custom response code' }, { code: 'BODY_CONTAINS',value:'Content includes' }, { code: 'BODY_NOT_CONTAINS',value:'Content does not contain' }]:[{ code: 'STATUS_CODE_DEFAULT',value:'默认响应码200' }, { code: 'STATUS_CODE_CUSTOM',value:'自定义响应码' }, { code: 'BODY_CONTAINS',value:'内容包含' }, { code: 'BODY_NOT_CONTAINS',value:'内容不包含' }] httpCheckConditionList: cookies.get('language') === 'en_US' ? [{ code: 'STATUS_CODE_DEFAULT', value: 'Default response code 200' }, { code: 'STATUS_CODE_CUSTOM', value: 'Custom response code' }, { code: 'BODY_CONTAINS', value: 'Content includes' }, { code: 'BODY_NOT_CONTAINS', value: 'Content does not contain' }] : [{ code: 'STATUS_CODE_DEFAULT', value: '默认响应码200' }, { code: 'STATUS_CODE_CUSTOM', value: '自定义响应码' }, { code: 'BODY_CONTAINS', value: '内容包含' }, { code: 'BODY_NOT_CONTAINS', value: '内容不包含' }]
} }
}, },
props: { props: {
@ -205,8 +204,8 @@
httpMethod: this.httpMethod, httpMethod: this.httpMethod,
httpCheckCondition: this.httpCheckCondition, httpCheckCondition: this.httpCheckCondition,
condition: this.condition, condition: this.condition,
connectTimeout : this.connectTimeout , connectTimeout: this.connectTimeout,
socketTimeout : this.socketTimeout socketTimeout: this.socketTimeout
}) })
return true return true
} }
@ -220,8 +219,8 @@
httpMethod: this.httpMethod, httpMethod: this.httpMethod,
httpCheckCondition: this.httpCheckCondition, httpCheckCondition: this.httpCheckCondition,
condition: this.condition, condition: this.condition,
connectTimeout : this.connectTimeout , connectTimeout: this.connectTimeout,
socketTimeout : this.socketTimeout socketTimeout: this.socketTimeout
} }
} }
}, },
@ -231,32 +230,32 @@
* @param val * @param val
*/ */
cacheParams (val) { cacheParams (val) {
this.$emit('on-cache-params', val); this.$emit('on-cache-params', val)
} }
}, },
created () { created () {
let o = this.backfillItem let o = this.backfillItem
// Non-null objects represent backfill // Non-null objects represent backfill
if (!_.isEmpty(o)) { if (!_.isEmpty(o)) {
this.url = o.params.url || '' this.url = o.params.url || ''
this.httpMethod = o.params.httpMethod || 'GET' this.httpMethod = o.params.httpMethod || 'GET'
this.httpCheckCondition = o.params.httpCheckCondition || 'DEFAULT' this.httpCheckCondition = o.params.httpCheckCondition || 'DEFAULT'
this.condition = o.params.condition || '' this.condition = o.params.condition || ''
this.connectTimeout = o.params.connectTimeout this.connectTimeout = o.params.connectTimeout
this.socketTimeout = o.params.socketTimeout this.socketTimeout = o.params.socketTimeout
if(this.connectTimeout != 60000 || this.socketTimeout != 60000 ){ if (this.connectTimeout !== 60000 || this.socketTimeout !== 60000) {
this.timeoutSettings = true this.timeoutSettings = true
} }
// backfill localParams // backfill localParams
let localParams = o.params.localParams || [] let localParams = o.params.localParams || []
if (localParams.length) { if (localParams.length) {
this.localParams = localParams this.localParams = localParams
}
let httpParams = o.params.httpParams || []
if (httpParams.length) {
this.httpParams = httpParams
}
} }
let httpParams = o.params.httpParams || []
if (httpParams.length) {
this.httpParams = httpParams
}
}
}, },
mounted () { mounted () {
}, },

232
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue

@ -100,7 +100,6 @@
import _ from 'lodash' import _ from 'lodash'
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import mListBox from './_source/listBox' import mListBox from './_source/listBox'
import mResources from './_source/resources'
import mLocalParams from './_source/localParams' import mLocalParams from './_source/localParams'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@ -131,7 +130,7 @@
programType: 'JAVA', programType: 'JAVA',
// Program type(List) // Program type(List)
programTypeList: [{ code: 'JAVA' }, { code: 'PYTHON' }], programTypeList: [{ code: 'JAVA' }, { code: 'PYTHON' }],
normalizer(node) { normalizer (node) {
return { return {
label: node.name label: node.name
} }
@ -148,10 +147,10 @@
/** /**
* getResourceId * getResourceId
*/ */
marjarId(name) { marjarId (name) {
this.store.dispatch('dag/getResourceId',{ this.store.dispatch('dag/getResourceId', {
type: 'FILE', type: 'FILE',
fullName: '/'+name fullName: '/' + name
}).then(res => { }).then(res => {
this.mainJar = res.id this.mainJar = res.id
}).catch(e => { }).catch(e => {
@ -176,55 +175,55 @@
_onCacheResourcesData (a) { _onCacheResourcesData (a) {
this.cacheResourceList = a this.cacheResourceList = a
}, },
diGuiTree(item) { // Recursive convenience tree structure diGuiTree (item) { // Recursive convenience tree structure
item.forEach(item => { item.forEach(item => {
item.children === '' || item.children === undefined || item.children === null || item.children.length === 0?         item.children === '' || item.children === undefined || item.children === null || item.children.length === 0
this.operationTree(item) : this.diGuiTree(item.children); ? this.operationTree(item) : this.diGuiTree(item.children)
}) })
}, },
operationTree(item) { operationTree (item) {
if(item.dirctory) { if (item.dirctory) {
item.isDisabled =true item.isDisabled = true
} }
delete item.children delete item.children
}, },
searchTree(element, id) { searchTree (element, id) {
// id // id
if (element.id == id) { if (element.id === id) {
return element; return element
} else if (element.children != null) { } else if (element.children !== null) {
var i; var i
var result = null; var result = null
for (i = 0; result == null && i < element.children.length; i++) { for (i = 0; result === null && i < element.children.length; i++) {
result = this.searchTree(element.children[i], id); result = this.searchTree(element.children[i], id)
} }
return result; return result
} }
return null; return null
}, },
dataProcess(backResource) { dataProcess (backResource) {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if(this.resourceList.length>0) { if (this.resourceList.length > 0) {
this.resourceList.forEach(v=>{ this.resourceList.forEach(v => {
this.mainJarList.forEach(v1=>{ this.mainJarList.forEach(v1 => {
if(this.searchTree(v1,v)) { if (this.searchTree(v1, v)) {
isResourceId.push(this.searchTree(v1,v)) isResourceId.push(this.searchTree(v1, v))
} }
}) })
}) })
resourceIdArr = isResourceId.map(item=>{ resourceIdArr = isResourceId.map(item => {
return item.id return item.id
}) })
Array.prototype.diff = function(a) { Array.prototype.diff = function (a) {
return this.filter(function(i) {return a.indexOf(i) < 0;}); return this.filter(function (i) { return a.indexOf(i) < 0 })
}; }
let diffSet = this.resourceList.diff(resourceIdArr); let diffSet = this.resourceList.diff(resourceIdArr)
let optionsCmp = [] let optionsCmp = []
if(diffSet.length>0) { if (diffSet.length > 0) {
diffSet.forEach(item=>{ diffSet.forEach(item => {
backResource.forEach(item1=>{ backResource.forEach(item1 => {
if(item==item1.id || item==item1.res) { if (item === item1.id || item === item1.res) {
optionsCmp.push(item1) optionsCmp.push(item1)
} }
}) })
@ -233,15 +232,15 @@
let noResources = [{ let noResources = [{
id: -1, id: -1,
name: $t('Unauthorized or deleted resources'), name: $t('Unauthorized or deleted resources'),
fullName: '/'+$t('Unauthorized or deleted resources'), fullName: '/' + $t('Unauthorized or deleted resources'),
children: [] children: []
}] }]
if(optionsCmp.length>0) { if (optionsCmp.length > 0) {
this.allNoResources = optionsCmp this.allNoResources = optionsCmp
optionsCmp = optionsCmp.map(item=>{ optionsCmp = optionsCmp.map(item => {
return {id: item.id,name: item.name,fullName: item.res} return { id: item.id, name: item.name, fullName: item.res }
}) })
optionsCmp.forEach(item=>{ optionsCmp.forEach(item => {
item.isNew = true item.isNew = true
}) })
noResources[0].children = optionsCmp noResources[0].children = optionsCmp
@ -264,7 +263,7 @@
} }
// noRes // noRes
if (this.noRes.length>0) { if (this.noRes.length > 0) {
this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`) this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`)
return false return false
} }
@ -280,7 +279,7 @@
id: this.mainJar id: this.mainJar
}, },
resourceList: _.map(this.resourceList, v => { resourceList: _.map(this.resourceList, v => {
return {id: v} return { id: v }
}), }),
localParams: this.localParams, localParams: this.localParams,
mainArgs: this.mainArgs, mainArgs: this.mainArgs,
@ -288,8 +287,8 @@
programType: this.programType programType: this.programType
}) })
return true return true
}, }
}, },
watch: { watch: {
/** /**
@ -300,43 +299,48 @@
this.mainClass = '' this.mainClass = ''
} }
}, },
//Watch the cacheParams // Watch the cacheParams
cacheParams (val) { cacheParams (val) {
this.$emit('on-cache-params', val); this.$emit('on-cache-params', val)
},
resourceIdArr (arr) {
let result = []
arr.forEach(item => {
this.allNoResources.forEach(item1 => {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
} }
}, },
computed: { computed: {
cacheParams () { resourceIdArr () {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if(this.resourceList.length>0) { if (this.resourceList.length > 0) {
this.resourceList.forEach(v=>{ this.resourceList.forEach(v => {
this.mainJarList.forEach(v1=>{ this.mainJarList.forEach(v1 => {
if(this.searchTree(v1,v)) { if (this.searchTree(v1, v)) {
isResourceId.push(this.searchTree(v1,v)) isResourceId.push(this.searchTree(v1, v))
} }
}) })
}) })
resourceIdArr = isResourceId.map(item=>{ resourceIdArr = isResourceId.map(item => {
return {id: item.id,name: item.name,res: item.fullName} return { id: item.id, name: item.name, res: item.fullName }
}) })
} }
let result = [] return resourceIdArr
resourceIdArr.forEach(item=>{ },
this.allNoResources.forEach(item1=>{ cacheParams () {
if(item.id==item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
return { return {
mainClass: this.mainClass, mainClass: this.mainClass,
mainJar: { mainJar: {
id: this.mainJar id: this.mainJar
}, },
resourceList: resourceIdArr, resourceList: this.resourceIdArr,
localParams: this.localParams, localParams: this.localParams,
mainArgs: this.mainArgs, mainArgs: this.mainArgs,
others: this.others, others: this.others,
@ -345,63 +349,63 @@
} }
}, },
created () { created () {
let item = this.store.state.dag.resourcesListS let item = this.store.state.dag.resourcesListS
let items = this.store.state.dag.resourcesListJar let items = this.store.state.dag.resourcesListJar
this.diGuiTree(item) this.diGuiTree(item)
this.diGuiTree(items) this.diGuiTree(items)
this.mainJarList = item this.mainJarList = item
this.mainJarLists = items this.mainJarLists = items
let o = this.backfillItem let o = this.backfillItem
// Non-null objects represent backfill // Non-null objects represent backfill
if (!_.isEmpty(o)) { if (!_.isEmpty(o)) {
this.mainClass = o.params.mainClass || '' this.mainClass = o.params.mainClass || ''
if(o.params.mainJar.res) { if (o.params.mainJar.res) {
this.marjarId(o.params.mainJar.res) this.marjarId(o.params.mainJar.res)
} else if(o.params.mainJar.res=='') { } else if (o.params.mainJar.res === '') {
this.mainJar = '' this.mainJar = ''
} else { } else {
this.mainJar = o.params.mainJar.id || '' this.mainJar = o.params.mainJar.id || ''
} }
this.mainArgs = o.params.mainArgs || '' this.mainArgs = o.params.mainArgs || ''
this.others = o.params.others this.others = o.params.others
this.programType = o.params.programType || 'JAVA' this.programType = o.params.programType || 'JAVA'
// backfill resourceList // backfill resourceList
let resourceList = o.params.resourceList || [] let resourceList = o.params.resourceList || []
if (resourceList.length) { if (resourceList.length) {
_.map(resourceList, v => { _.map(resourceList, v => {
if(!v.id) { if (!v.id) {
this.store.dispatch('dag/getResourceId',{ this.store.dispatch('dag/getResourceId', {
type: 'FILE', type: 'FILE',
fullName: '/'+v.res fullName: '/' + v.res
}).then(res => { }).then(res => {
this.resourceList.push(res.id) this.resourceList.push(res.id)
this.dataProcess(backResource)
}).catch(e => {
this.resourceList.push(v.res)
this.dataProcess(backResource)
})
} else {
this.resourceList.push(v.id)
this.dataProcess(backResource) this.dataProcess(backResource)
} }).catch(e => {
}) this.resourceList.push(v.res)
this.cacheResourceList = resourceList this.dataProcess(backResource)
} })
} else {
this.resourceList.push(v.id)
this.dataProcess(backResource)
}
})
this.cacheResourceList = resourceList
}
// backfill localParams // backfill localParams
let backResource = o.params.resourceList || [] let backResource = o.params.resourceList || []
let localParams = o.params.localParams || [] let localParams = o.params.localParams || []
if (localParams.length) { if (localParams.length) {
this.localParams = localParams this.localParams = localParams
}
} }
}
}, },
mounted () { mounted () {
}, },
components: { mLocalParams, mListBox, mResources, Treeselect } components: { mLocalParams, mListBox, Treeselect }
} }
</script> </script>

14
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/pre_tasks.vue

@ -53,15 +53,15 @@
}, },
data () { data () {
return { return {
preTasksSelectorId: '_preTasksSelectorId', // Refresh target vue-component by changing id preTasksSelectorId: '_preTasksSelectorId', // Refresh target vue-component by changing id
preTasks: [], preTasks: [],
preTasksOld: [], preTasksOld: []
} }
}, },
mounted () { mounted () {
this.preTasks = this.backfillItem['preTasks'] || this.preTasks this.preTasks = this.backfillItem.preTasks || this.preTasks
this.preTasksOld = this.preTasks this.preTasksOld = this.preTasks
// Refresh target vue-component by changing id // Refresh target vue-component by changing id
this.$nextTick(() => { this.$nextTick(() => {
this.preTasksSelectorId = 'preTasksSelectorId' this.preTasksSelectorId = 'preTasksSelectorId'
@ -69,7 +69,7 @@
}, },
computed: { computed: {
preTaskList: function () { preTaskList: function () {
let currentTaskId = this.backfillItem['id'] || this.id let currentTaskId = this.backfillItem.id || this.id
let cacheTasks = Object.assign({}, this.store.state.dag.tasks) let cacheTasks = Object.assign({}, this.store.state.dag.tasks)
let keys = Object.keys(cacheTasks) let keys = Object.keys(cacheTasks)
for (let i = 0; i < keys.length; i++) { for (let i = 0; i < keys.length; i++) {
@ -92,7 +92,7 @@
// preTaskIds used to delete connection // preTaskIds used to delete connection
preTasksToDelete: function () { preTasksToDelete: function () {
return this.preTasksOld.filter(taskId => this.preTasks.indexOf(taskId) === -1) return this.preTasksOld.filter(taskId => this.preTasks.indexOf(taskId) === -1)
}, }
}, },
methods: { methods: {
// Pass data to parent-level to process dag // Pass data to parent-level to process dag
@ -100,7 +100,7 @@
this.$emit('on-pre-tasks', { this.$emit('on-pre-tasks', {
preTasks: this.preTasks, preTasks: this.preTasks,
preTasksToAdd: this.preTasksToAdd, preTasksToAdd: this.preTasksToAdd,
preTasksToDelete: this.preTasksToDelete, preTasksToDelete: this.preTasksToDelete
}) })
return true return true
} }

4
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue

@ -122,9 +122,9 @@
} }
}, },
watch: { watch: {
//Watch the cacheParams // Watch the cacheParams
cacheParams (val) { cacheParams (val) {
this.$emit('on-cache-params', val); this.$emit('on-cache-params', val)
} }
}, },
computed: { computed: {

138
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue

@ -61,7 +61,6 @@
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import mListBox from './_source/listBox' import mListBox from './_source/listBox'
import mScriptBox from './_source/scriptBox' import mScriptBox from './_source/scriptBox'
import mResources from './_source/resources'
import mLocalParams from './_source/localParams' import mLocalParams from './_source/localParams'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@ -84,7 +83,7 @@
// Cache ResourceList // Cache ResourceList
cacheResourceList: [], cacheResourceList: [],
resourceOptions: [], resourceOptions: [],
normalizer(node) { normalizer (node) {
return { return {
label: node.name label: node.name
} }
@ -106,7 +105,7 @@
_onLocalParams (a) { _onLocalParams (a) {
this.localParams = a this.localParams = a
}, },
setEditorVal() { setEditorVal () {
this.item = editor.getValue() this.item = editor.getValue()
this.scriptBoxDialog = true this.scriptBoxDialog = true
}, },
@ -141,7 +140,7 @@
} }
// noRes // noRes
if (this.noRes.length>0) { if (this.noRes.length > 0) {
this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`) this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`)
return false return false
} }
@ -149,7 +148,7 @@
// storage // storage
this.$emit('on-params', { this.$emit('on-params', {
resourceList: _.map(this.resourceList, v => { resourceList: _.map(this.resourceList, v => {
return {id: v} return { id: v }
}), }),
localParams: this.localParams, localParams: this.localParams,
rawScript: editor.getValue() rawScript: editor.getValue()
@ -181,55 +180,55 @@
return editor return editor
}, },
diGuiTree(item) { // Recursive convenience tree structure diGuiTree (item) { // Recursive convenience tree structure
item.forEach(item => { item.forEach(item => {
item.children === '' || item.children === undefined || item.children === null || item.children.length === 0?         item.children === '' || item.children === undefined || item.children === null || item.children.length === 0
this.operationTree(item) : this.diGuiTree(item.children); ? this.operationTree(item) : this.diGuiTree(item.children)
}) })
}, },
operationTree(item) { operationTree (item) {
if(item.dirctory) { if (item.dirctory) {
item.isDisabled =true item.isDisabled = true
} }
delete item.children delete item.children
}, },
searchTree(element, id) { searchTree (element, id) {
// id // id
if (element.id == id) { if (element.id === id) {
return element; return element
} else if (element.children != null) { } else if (element.children !== null) {
var i; var i
var result = null; var result = null
for (i = 0; result == null && i < element.children.length; i++) { for (i = 0; result === null && i < element.children.length; i++) {
result = this.searchTree(element.children[i], id); result = this.searchTree(element.children[i], id)
} }
return result; return result
} }
return null; return null
}, },
dataProcess(backResource) { dataProcess (backResource) {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if(this.resourceList.length>0) { if (this.resourceList.length > 0) {
this.resourceList.forEach(v=>{ this.resourceList.forEach(v => {
this.resourceOptions.forEach(v1=>{ this.resourceOptions.forEach(v1 => {
if(this.searchTree(v1,v)) { if (this.searchTree(v1, v)) {
isResourceId.push(this.searchTree(v1,v)) isResourceId.push(this.searchTree(v1, v))
} }
}) })
}) })
resourceIdArr = isResourceId.map(item=>{ resourceIdArr = isResourceId.map(item => {
return item.id return item.id
}) })
Array.prototype.diff = function(a) { Array.prototype.diff = function (a) {
return this.filter(function(i) {return a.indexOf(i) < 0;}); return this.filter(function (i) { return a.indexOf(i) < 0 })
}; }
let diffSet = this.resourceList.diff(resourceIdArr); let diffSet = this.resourceList.diff(resourceIdArr)
let optionsCmp = [] let optionsCmp = []
if(diffSet.length>0) { if (diffSet.length > 0) {
diffSet.forEach(item=>{ diffSet.forEach(item => {
backResource.forEach(item1=>{ backResource.forEach(item1 => {
if(item==item1.id || item==item1.res) { if (item === item1.id || item === item1.res) {
optionsCmp.push(item1) optionsCmp.push(item1)
} }
}) })
@ -238,15 +237,15 @@
let noResources = [{ let noResources = [{
id: -1, id: -1,
name: $t('Unauthorized or deleted resources'), name: $t('Unauthorized or deleted resources'),
fullName: '/'+$t('Unauthorized or deleted resources'), fullName: '/' + $t('Unauthorized or deleted resources'),
children: [] children: []
}] }]
if(optionsCmp.length>0) { if (optionsCmp.length > 0) {
this.allNoResources = optionsCmp this.allNoResources = optionsCmp
optionsCmp = optionsCmp.map(item=>{ optionsCmp = optionsCmp.map(item => {
return {id: item.id,name: item.name,fullName: item.res} return { id: item.id, name: item.name, fullName: item.res }
}) })
optionsCmp.forEach(item=>{ optionsCmp.forEach(item => {
item.isNew = true item.isNew = true
}) })
noResources[0].children = optionsCmp noResources[0].children = optionsCmp
@ -256,39 +255,44 @@
} }
}, },
watch: { watch: {
//Watch the cacheParams // Watch the cacheParams
cacheParams (val) { cacheParams (val) {
this.$emit('on-cache-params', val); this.$emit('on-cache-params', val)
},
resourceIdArr (arr) {
let result = []
arr.forEach(item => {
this.allNoResources.forEach(item1 => {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
} }
}, },
computed: { computed: {
cacheParams () { resourceIdArr () {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if(this.resourceList.length>0) { if (this.resourceList.length > 0) {
this.resourceList.forEach(v=>{ this.resourceList.forEach(v => {
this.resourceOptions.forEach(v1=>{ this.resourceOptions.forEach(v1 => {
if(this.searchTree(v1,v)) { if (this.searchTree(v1, v)) {
isResourceId.push(this.searchTree(v1,v)) isResourceId.push(this.searchTree(v1, v))
} }
}) })
}) })
resourceIdArr = isResourceId.map(item=>{ resourceIdArr = isResourceId.map(item => {
return {id: item.id,name: item.name,res: item.fullName} return { id: item.id, name: item.name, res: item.fullName }
}) })
} }
let result = [] return resourceIdArr
resourceIdArr.forEach(item=>{ },
this.allNoResources.forEach(item1=>{ cacheParams () {
if(item.id==item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
return { return {
resourceList: resourceIdArr, resourceList: this.resourceIdArr,
localParams: this.localParams localParams: this.localParams
} }
} }
@ -308,10 +312,10 @@
let resourceList = o.params.resourceList || [] let resourceList = o.params.resourceList || []
if (resourceList.length) { if (resourceList.length) {
_.map(resourceList, v => { _.map(resourceList, v => {
if(!v.id) { if (!v.id) {
this.store.dispatch('dag/getResourceId',{ this.store.dispatch('dag/getResourceId', {
type: 'FILE', type: 'FILE',
fullName: '/'+v.res fullName: '/' + v.res
}).then(res => { }).then(res => {
this.resourceList.push(res.id) this.resourceList.push(res.id)
this.dataProcess(backResource) this.dataProcess(backResource)
@ -343,7 +347,7 @@
editor.toTextArea() // Uninstall editor.toTextArea() // Uninstall
editor.off($('.code-python-mirror'), 'keypress', this.keypress) editor.off($('.code-python-mirror'), 'keypress', this.keypress)
}, },
components: { mLocalParams, mListBox, mResources,Treeselect, mScriptBox } components: { mLocalParams, mListBox, Treeselect, mScriptBox }
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss" scope> <style lang="scss" rel="stylesheet/scss" scope>
@ -360,4 +364,4 @@
right: -12px; right: -12px;
top: -16px; top: -16px;
} }
</style> </style>

144
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue

@ -63,7 +63,6 @@
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import mListBox from './_source/listBox' import mListBox from './_source/listBox'
import mScriptBox from './_source/scriptBox' import mScriptBox from './_source/scriptBox'
import mResources from './_source/resources'
import mLocalParams from './_source/localParams' import mLocalParams from './_source/localParams'
import disabledState from '@/module/mixin/disabledState' import disabledState from '@/module/mixin/disabledState'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
@ -87,7 +86,7 @@
cacheResourceList: [], cacheResourceList: [],
// define options // define options
options: [], options: [],
normalizer(node) { normalizer (node) {
return { return {
label: node.name label: node.name
} }
@ -109,7 +108,7 @@
_onLocalParams (a) { _onLocalParams (a) {
this.localParams = a this.localParams = a
}, },
setEditorVal() { setEditorVal () {
this.item = editor.getValue() this.item = editor.getValue()
this.scriptBoxDialog = true this.scriptBoxDialog = true
}, },
@ -118,7 +117,7 @@
// this.scriptBoxDialog = false // this.scriptBoxDialog = false
}, },
closeAble () { closeAble () {
// this.scriptBoxDialog = false // this.scriptBoxDialog = false
}, },
/** /**
* return resourceList * return resourceList
@ -148,12 +147,12 @@
return false return false
} }
// noRes // noRes
if (this.noRes.length>0) { if (this.noRes.length > 0) {
this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`) this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`)
return false return false
} }
// Process resourcelist // Process resourcelist
let dataProcessing= _.map(this.resourceList, v => { let dataProcessing = _.map(this.resourceList, v => {
return { return {
id: v id: v
} }
@ -190,55 +189,55 @@
return editor return editor
}, },
diGuiTree(item) { // Recursive convenience tree structure diGuiTree (item) { // Recursive convenience tree structure
item.forEach(item => { item.forEach(item => {
item.children === '' || item.children === undefined || item.children === null || item.children.length === 0?         item.children === '' || item.children === undefined || item.children === null || item.children.length === 0
this.operationTree(item) : this.diGuiTree(item.children); ? this.operationTree(item) : this.diGuiTree(item.children)
}) })
}, },
operationTree(item) { operationTree (item) {
if(item.dirctory) { if (item.dirctory) {
item.isDisabled =true item.isDisabled = true
} }
delete item.children delete item.children
}, },
searchTree(element, id) { searchTree (element, id) {
// id // id
if (element.id == id) { if (element.id === id) {
return element; return element
} else if (element.children != null) { } else if (element.children !== null) {
var i; var i
var result = null; var result = null
for (i = 0; result == null && i < element.children.length; i++) { for (i = 0; result === null && i < element.children.length; i++) {
result = this.searchTree(element.children[i], id); result = this.searchTree(element.children[i], id)
} }
return result; return result
} }
return null; return null
}, },
dataProcess(backResource) { dataProcess (backResource) {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if(this.resourceList.length>0) { if (this.resourceList.length > 0) {
this.resourceList.forEach(v=>{ this.resourceList.forEach(v => {
this.options.forEach(v1=>{ this.options.forEach(v1 => {
if(this.searchTree(v1,v)) { if (this.searchTree(v1, v)) {
isResourceId.push(this.searchTree(v1,v)) isResourceId.push(this.searchTree(v1, v))
} }
}) })
}) })
resourceIdArr = isResourceId.map(item=>{ resourceIdArr = isResourceId.map(item => {
return item.id return item.id
}) })
Array.prototype.diff = function(a) { Array.prototype.diff = function (a) {
return this.filter(function(i) {return a.indexOf(i) < 0;}); return this.filter(function (i) { return a.indexOf(i) < 0 })
}; }
let diffSet = this.resourceList.diff(resourceIdArr); let diffSet = this.resourceList.diff(resourceIdArr)
let optionsCmp = [] let optionsCmp = []
if(diffSet.length>0) { if (diffSet.length > 0) {
diffSet.forEach(item=>{ diffSet.forEach(item => {
backResource.forEach(item1=>{ backResource.forEach(item1 => {
if(item==item1.id || item==item1.res) { if (item === item1.id || item === item1.res) {
optionsCmp.push(item1) optionsCmp.push(item1)
} }
}) })
@ -247,15 +246,15 @@
let noResources = [{ let noResources = [{
id: -1, id: -1,
name: $t('Unauthorized or deleted resources'), name: $t('Unauthorized or deleted resources'),
fullName: '/'+$t('Unauthorized or deleted resources'), fullName: '/' + $t('Unauthorized or deleted resources'),
children: [] children: []
}] }]
if(optionsCmp.length>0) { if (optionsCmp.length > 0) {
this.allNoResources = optionsCmp this.allNoResources = optionsCmp
optionsCmp = optionsCmp.map(item=>{ optionsCmp = optionsCmp.map(item => {
return {id: item.id,name: item.name,fullName: item.res} return { id: item.id, name: item.name, fullName: item.res }
}) })
optionsCmp.forEach(item=>{ optionsCmp.forEach(item => {
item.isNew = true item.isNew = true
}) })
noResources[0].children = optionsCmp noResources[0].children = optionsCmp
@ -265,39 +264,44 @@
} }
}, },
watch: { watch: {
//Watch the cacheParams // Watch the cacheParams
cacheParams (val) { cacheParams (val) {
this.$emit('on-cache-params', val); this.$emit('on-cache-params', val)
},
resourceIdArr (arr) {
let result = []
arr.forEach(item => {
this.allNoResources.forEach(item1 => {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
} }
}, },
computed: { computed: {
cacheParams () { resourceIdArr () {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if(this.resourceList.length>0) { if (this.resourceList.length > 0) {
this.resourceList.forEach(v=>{ this.resourceList.forEach(v => {
this.options.forEach(v1=>{ this.options.forEach(v1 => {
if(this.searchTree(v1,v)) { if (this.searchTree(v1, v)) {
isResourceId.push(this.searchTree(v1,v)) isResourceId.push(this.searchTree(v1, v))
} }
}) })
}) })
resourceIdArr = isResourceId.map(item=>{ resourceIdArr = isResourceId.map(item => {
return {id: item.id,name: item.name,res: item.fullName} return { id: item.id, name: item.name, res: item.fullName }
}) })
} }
let result = [] return resourceIdArr
resourceIdArr.forEach(item=>{ },
this.allNoResources.forEach(item1=>{ cacheParams () {
if(item.id==item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
return { return {
resourceList: resourceIdArr, resourceList: this.resourceIdArr,
localParams: this.localParams localParams: this.localParams
} }
} }
@ -307,7 +311,7 @@
this.diGuiTree(item) this.diGuiTree(item)
this.options = item this.options = item
let o = this.backfillItem let o = this.backfillItem
// Non-null objects represent backfill // Non-null objects represent backfill
if (!_.isEmpty(o)) { if (!_.isEmpty(o)) {
this.rawScript = o.params.rawScript || '' this.rawScript = o.params.rawScript || ''
@ -316,11 +320,11 @@
let backResource = o.params.resourceList || [] let backResource = o.params.resourceList || []
let resourceList = o.params.resourceList || [] let resourceList = o.params.resourceList || []
if (resourceList.length) { if (resourceList.length) {
_.map(resourceList, v => { _.map(resourceList, v => {
if(!v.id) { if (!v.id) {
this.store.dispatch('dag/getResourceId',{ this.store.dispatch('dag/getResourceId', {
type: 'FILE', type: 'FILE',
fullName: '/'+v.res fullName: '/' + v.res
}).then(res => { }).then(res => {
this.resourceList.push(res.id) this.resourceList.push(res.id)
this.dataProcess(backResource) this.dataProcess(backResource)
@ -335,7 +339,7 @@
}) })
this.cacheResourceList = resourceList this.cacheResourceList = resourceList
} }
// backfill localParams // backfill localParams
let localParams = o.params.localParams || [] let localParams = o.params.localParams || []
if (localParams.length) { if (localParams.length) {
@ -354,7 +358,7 @@
editor.off($('.code-shell-mirror'), 'keypress', this.keypress) editor.off($('.code-shell-mirror'), 'keypress', this.keypress)
} }
}, },
components: { mLocalParams, mListBox, mResources, mScriptBox, Treeselect } components: { mLocalParams, mListBox, mScriptBox, Treeselect }
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss" scope> <style lang="scss" rel="stylesheet/scss" scope>

240
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/spark.vue

@ -195,7 +195,6 @@
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import mLocalParams from './_source/localParams' import mLocalParams from './_source/localParams'
import mListBox from './_source/listBox' import mListBox from './_source/listBox'
import mResources from './_source/resources'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import disabledState from '@/module/mixin/disabledState' import disabledState from '@/module/mixin/disabledState'
@ -242,7 +241,7 @@
sparkVersion: 'SPARK2', sparkVersion: 'SPARK2',
// Spark version(LIst) // Spark version(LIst)
sparkVersionList: [{ code: 'SPARK2' }, { code: 'SPARK1' }], sparkVersionList: [{ code: 'SPARK2' }, { code: 'SPARK1' }],
normalizer(node) { normalizer (node) {
return { return {
label: node.name label: node.name
} }
@ -259,10 +258,10 @@
/** /**
* getResourceId * getResourceId
*/ */
marjarId(name) { marjarId (name) {
this.store.dispatch('dag/getResourceId',{ this.store.dispatch('dag/getResourceId', {
type: 'FILE', type: 'FILE',
fullName: '/'+name fullName: '/' + name
}).then(res => { }).then(res => {
this.mainJar = res.id this.mainJar = res.id
}).catch(e => { }).catch(e => {
@ -287,55 +286,55 @@
_onCacheResourcesData (a) { _onCacheResourcesData (a) {
this.cacheResourceList = a this.cacheResourceList = a
}, },
diGuiTree(item) { // Recursive convenience tree structure diGuiTree (item) { // Recursive convenience tree structure
item.forEach(item => { item.forEach(item => {
item.children === '' || item.children === undefined || item.children === null || item.children.length === 0?         item.children === '' || item.children === undefined || item.children === null || item.children.length === 0
this.operationTree(item) : this.diGuiTree(item.children); ? this.operationTree(item) : this.diGuiTree(item.children)
}) })
}, },
operationTree(item) { operationTree (item) {
if(item.dirctory) { if (item.dirctory) {
item.isDisabled =true item.isDisabled = true
} }
delete item.children delete item.children
}, },
searchTree(element, id) { searchTree (element, id) {
// id // id
if (element.id == id) { if (element.id === id) {
return element; return element
} else if (element.children != null) { } else if (element.children !== null) {
var i; var i
var result = null; var result = null
for (i = 0; result == null && i < element.children.length; i++) { for (i = 0; result === null && i < element.children.length; i++) {
result = this.searchTree(element.children[i], id); result = this.searchTree(element.children[i], id)
} }
return result; return result
} }
return null; return null
}, },
dataProcess(backResource) { dataProcess (backResource) {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if(this.resourceList.length>0) { if (this.resourceList.length > 0) {
this.resourceList.forEach(v=>{ this.resourceList.forEach(v => {
this.mainJarList.forEach(v1=>{ this.mainJarList.forEach(v1 => {
if(this.searchTree(v1,v)) { if (this.searchTree(v1, v)) {
isResourceId.push(this.searchTree(v1,v)) isResourceId.push(this.searchTree(v1, v))
} }
}) })
}) })
resourceIdArr = isResourceId.map(item=>{ resourceIdArr = isResourceId.map(item => {
return item.id return item.id
}) })
Array.prototype.diff = function(a) { Array.prototype.diff = function (a) {
return this.filter(function(i) {return a.indexOf(i) < 0;}); return this.filter(function (i) { return a.indexOf(i) < 0 })
}; }
let diffSet = this.resourceList.diff(resourceIdArr); let diffSet = this.resourceList.diff(resourceIdArr)
let optionsCmp = [] let optionsCmp = []
if(diffSet.length>0) { if (diffSet.length > 0) {
diffSet.forEach(item=>{ diffSet.forEach(item => {
backResource.forEach(item1=>{ backResource.forEach(item1 => {
if(item==item1.id || item==item1.res) { if (item === item1.id || item === item1.res) {
optionsCmp.push(item1) optionsCmp.push(item1)
} }
}) })
@ -344,15 +343,15 @@
let noResources = [{ let noResources = [{
id: -1, id: -1,
name: $t('Unauthorized or deleted resources'), name: $t('Unauthorized or deleted resources'),
fullName: '/'+$t('Unauthorized or deleted resources'), fullName: '/' + $t('Unauthorized or deleted resources'),
children: [] children: []
}] }]
if(optionsCmp.length>0) { if (optionsCmp.length > 0) {
this.allNoResources = optionsCmp this.allNoResources = optionsCmp
optionsCmp = optionsCmp.map(item=>{ optionsCmp = optionsCmp.map(item => {
return {id: item.id,name: item.name,fullName: item.res} return { id: item.id, name: item.name, fullName: item.res }
}) })
optionsCmp.forEach(item=>{ optionsCmp.forEach(item => {
item.isNew = true item.isNew = true
}) })
noResources[0].children = optionsCmp noResources[0].children = optionsCmp
@ -380,7 +379,7 @@
} }
// noRes // noRes
if (this.noRes.length>0) { if (this.noRes.length > 0) {
this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`) this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`)
return false return false
} }
@ -419,7 +418,7 @@
return false return false
} }
// Process resourcelist // Process resourcelist
let dataProcessing= _.map(this.resourceList, v => { let dataProcessing = _.map(this.resourceList, v => {
return { return {
id: v id: v
} }
@ -454,44 +453,49 @@
this.mainClass = '' this.mainClass = ''
} }
}, },
//Watch the cacheParams // Watch the cacheParams
cacheParams (val) { cacheParams (val) {
this.$emit('on-cache-params', val) this.$emit('on-cache-params', val)
},
resourceIdArr (arr) {
let result = []
arr.forEach(item => {
this.allNoResources.forEach(item1 => {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
} }
}, },
computed: { computed: {
cacheParams () { resourceIdArr () {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if(this.resourceList.length>0) { if (this.resourceList.length > 0) {
this.resourceList.forEach(v=>{ this.resourceList.forEach(v => {
this.mainJarList.forEach(v1=>{ this.mainJarList.forEach(v1 => {
if(this.searchTree(v1,v)) { if (this.searchTree(v1, v)) {
isResourceId.push(this.searchTree(v1,v)) isResourceId.push(this.searchTree(v1, v))
} }
}) })
}) })
resourceIdArr = isResourceId.map(item=>{ resourceIdArr = isResourceId.map(item => {
return {id: item.id,name: item.name,res: item.fullName} return { id: item.id, name: item.name, res: item.fullName }
}) })
} }
let result = [] return resourceIdArr
resourceIdArr.forEach(item=>{ },
this.allNoResources.forEach(item1=>{ cacheParams () {
if(item.id==item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
return { return {
mainClass: this.mainClass, mainClass: this.mainClass,
mainJar: { mainJar: {
id: this.mainJar id: this.mainJar
}, },
deployMode: this.deployMode, deployMode: this.deployMode,
resourceList: resourceIdArr, resourceList: this.resourceIdArr,
localParams: this.localParams, localParams: this.localParams,
driverCores: this.driverCores, driverCores: this.driverCores,
driverMemory: this.driverMemory, driverMemory: this.driverMemory,
@ -506,70 +510,70 @@
} }
}, },
created () { created () {
let item = this.store.state.dag.resourcesListS let item = this.store.state.dag.resourcesListS
let items = this.store.state.dag.resourcesListJar let items = this.store.state.dag.resourcesListJar
this.diGuiTree(item) this.diGuiTree(item)
this.diGuiTree(items) this.diGuiTree(items)
this.mainJarList = item this.mainJarList = item
this.mainJarLists = items this.mainJarLists = items
let o = this.backfillItem let o = this.backfillItem
// Non-null objects represent backfill // Non-null objects represent backfill
if (!_.isEmpty(o)) { if (!_.isEmpty(o)) {
this.mainClass = o.params.mainClass || '' this.mainClass = o.params.mainClass || ''
if(o.params.mainJar.res) { if (o.params.mainJar.res) {
this.marjarId(o.params.mainJar.res) this.marjarId(o.params.mainJar.res)
} else if(o.params.mainJar.res=='') { } else if (o.params.mainJar.res === '') {
this.mainJar = '' this.mainJar = ''
} else { } else {
this.mainJar = o.params.mainJar.id || '' this.mainJar = o.params.mainJar.id || ''
} }
this.deployMode = o.params.deployMode || '' this.deployMode = o.params.deployMode || ''
this.driverCores = o.params.driverCores || 1 this.driverCores = o.params.driverCores || 1
this.driverMemory = o.params.driverMemory || '512M' this.driverMemory = o.params.driverMemory || '512M'
this.numExecutors = o.params.numExecutors || 2 this.numExecutors = o.params.numExecutors || 2
this.executorMemory = o.params.executorMemory || '2G' this.executorMemory = o.params.executorMemory || '2G'
this.executorCores = o.params.executorCores || 2 this.executorCores = o.params.executorCores || 2
this.mainArgs = o.params.mainArgs || '' this.mainArgs = o.params.mainArgs || ''
this.others = o.params.others this.others = o.params.others
this.programType = o.params.programType || 'SCALA' this.programType = o.params.programType || 'SCALA'
this.sparkVersion = o.params.sparkVersion || 'SPARK2' this.sparkVersion = o.params.sparkVersion || 'SPARK2'
// backfill resourceList // backfill resourceList
let backResource = o.params.resourceList || [] let backResource = o.params.resourceList || []
let resourceList = o.params.resourceList || [] let resourceList = o.params.resourceList || []
if (resourceList.length) { if (resourceList.length) {
_.map(resourceList, v => { _.map(resourceList, v => {
if(!v.id) { if (!v.id) {
this.store.dispatch('dag/getResourceId',{ this.store.dispatch('dag/getResourceId', {
type: 'FILE', type: 'FILE',
fullName: '/'+v.res fullName: '/' + v.res
}).then(res => { }).then(res => {
this.resourceList.push(res.id) this.resourceList.push(res.id)
this.dataProcess(backResource)
}).catch(e => {
this.resourceList.push(v.res)
this.dataProcess(backResource)
})
} else {
this.resourceList.push(v.id)
this.dataProcess(backResource) this.dataProcess(backResource)
} }).catch(e => {
}) this.resourceList.push(v.res)
this.cacheResourceList = resourceList this.dataProcess(backResource)
} })
} else {
this.resourceList.push(v.id)
this.dataProcess(backResource)
}
})
this.cacheResourceList = resourceList
}
// backfill localParams // backfill localParams
let localParams = o.params.localParams || [] let localParams = o.params.localParams || []
if (localParams.length) { if (localParams.length) {
this.localParams = localParams this.localParams = localParams
}
} }
}
}, },
mounted () { mounted () {
}, },
components: { mLocalParams, mListBox, mResources, Treeselect } components: { mLocalParams, mListBox, Treeselect }
} }
</script> </script>

29
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sql.vue

@ -202,7 +202,7 @@
createNodeId: Number createNodeId: Number
}, },
methods: { methods: {
setEditorVal() { setEditorVal () {
this.item = editor.getValue() this.item = editor.getValue()
this.scriptBoxDialog = true this.scriptBoxDialog = true
}, },
@ -214,7 +214,7 @@
*/ */
_onSqlType (a) { _onSqlType (a) {
this.sqlType = a this.sqlType = a
if(a==0) { if (a === 0) {
this.showType = ['TABLE'] this.showType = ['TABLE']
} }
}, },
@ -262,24 +262,24 @@
if (!this.$refs.refDs._verifDatasource()) { if (!this.$refs.refDs._verifDatasource()) {
return false return false
} }
if (this.sqlType==0 && !this.showType.length) { if (this.sqlType === 0 && !this.showType.length) {
this.$message.warning(`${i18n.$t('One form or attachment must be selected')}`) this.$message.warning(`${i18n.$t('One form or attachment must be selected')}`)
return false return false
} }
if (this.sqlType==0 && !this.title) { if (this.sqlType === 0 && !this.title) {
this.$message.warning(`${i18n.$t('Mail subject required')}`) this.$message.warning(`${i18n.$t('Mail subject required')}`)
return false return false
} }
if (this.sqlType==0 && !this.receivers.length) { if (this.sqlType === 0 && !this.receivers.length) {
this.$message.warning(`${i18n.$t('Recipient required')}`) this.$message.warning(`${i18n.$t('Recipient required')}`)
return false return false
} }
// receivers Subcomponent verification // receivers Subcomponent verification
if (this.sqlType==0 && !this.$refs.refEmail._manualEmail()) { if (this.sqlType === 0 && !this.$refs.refEmail._manualEmail()) {
return false return false
} }
// receiversCc Subcomponent verification // receiversCc Subcomponent verification
if (this.sqlType==0 && !this.$refs.refCc._manualEmail()) { if (this.sqlType === 0 && !this.$refs.refCc._manualEmail()) {
return false return false
} }
// udfs Subcomponent verification Verification only if the data type is HIVE // udfs Subcomponent verification Verification only if the data type is HIVE
@ -390,7 +390,6 @@
receivers: this.receivers.join(','), receivers: this.receivers.join(','),
receiversCc: this.receiversCc.join(','), receiversCc: this.receiversCc.join(','),
showType: (() => { showType: (() => {
let showType = this.showType let showType = this.showType
if (showType.length === 2 && showType[0] === 'ATTACHMENT') { if (showType.length === 2 && showType[0] === 'ATTACHMENT') {
return [showType[1], showType[0]].join(',') return [showType[1], showType[0]].join(',')
@ -402,10 +401,10 @@
connParams: this.connParams, connParams: this.connParams,
preStatements: this.preStatements, preStatements: this.preStatements,
postStatements: this.postStatements postStatements: this.postStatements
}); })
}, },
_destroyEditor () { _destroyEditor () {
if (editor) { if (editor) {
editor.toTextArea() // Uninstall editor.toTextArea() // Uninstall
editor.off($('.code-sql-mirror'), 'keypress', this.keypress) editor.off($('.code-sql-mirror'), 'keypress', this.keypress)
editor.off($('.code-sql-mirror'), 'changes', this.changes) editor.off($('.code-sql-mirror'), 'changes', this.changes)
@ -415,10 +414,10 @@
watch: { watch: {
// Listening to sqlType // Listening to sqlType
sqlType (val) { sqlType (val) {
if (val==0) { if (val === 0) {
this.showType = [] this.showType = []
} }
if (val != 0) { if (val !== 0) {
this.title = '' this.title = ''
this.receivers = [] this.receivers = []
this.receiversCc = [] this.receiversCc = []
@ -430,7 +429,7 @@
this.connParams = '' this.connParams = ''
} }
}, },
//Watch the cacheParams // Watch the cacheParams
cacheParams (val) { cacheParams (val) {
this._cacheParams() this._cacheParams()
} }
@ -448,7 +447,7 @@
this.sqlType = o.params.sqlType this.sqlType = o.params.sqlType
this.connParams = o.params.connParams || '' this.connParams = o.params.connParams || ''
this.localParams = o.params.localParams || [] this.localParams = o.params.localParams || []
if(o.params.showType == '') { if (o.params.showType === '') {
this.showType = [] this.showType = []
} else { } else {
this.showType = o.params.showType.split(',') || [] this.showType = o.params.showType.split(',') || []
@ -491,7 +490,6 @@
receivers: this.receivers.join(','), receivers: this.receivers.join(','),
receiversCc: this.receiversCc.join(','), receiversCc: this.receiversCc.join(','),
showType: (() => { showType: (() => {
let showType = this.showType let showType = this.showType
if (showType.length === 2 && showType[0] === 'ATTACHMENT') { if (showType.length === 2 && showType[0] === 'ATTACHMENT') {
return [showType[1], showType[0]].join(',') return [showType[1], showType[0]].join(',')
@ -520,4 +518,3 @@
top: -16px; top: -16px;
} }
</style> </style>

394
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sqoop.vue

@ -614,103 +614,103 @@
/** /**
* mysql query type * mysql query type
*/ */
srcQueryType:'1', srcQueryType: '1',
/** /**
* source data source * source data source
*/ */
srcDatasource:'', srcDatasource: '',
/** /**
* target data source * target data source
*/ */
targetDatasource:'', targetDatasource: '',
/** /**
* concurrency * concurrency
*/ */
concurrency:1, concurrency: 1,
/** /**
* default job type * default job type
*/ */
jobType:'TEMPLATE', jobType: 'TEMPLATE',
/** /**
* direct model type * direct model type
*/ */
modelType:'import', modelType: 'import',
modelTypeList: [{ code: 'import' }, { code: 'export' }], modelTypeList: [{ code: 'import' }, { code: 'export' }],
sourceTypeList: [ sourceTypeList: [
{ {
code: "MYSQL" code: 'MYSQL'
}, }
], ],
targetTypeList:[ targetTypeList: [
{ {
code:"HIVE" code: 'HIVE'
}, },
{ {
code:"HDFS" code: 'HDFS'
} }
], ],
sourceType:"MYSQL", sourceType: 'MYSQL',
targetType:"HDFS", targetType: 'HDFS',
sourceMysqlParams:{ sourceMysqlParams: {
srcType:"MYSQL", srcType: 'MYSQL',
srcDatasource:"", srcDatasource: '',
srcTable:"", srcTable: '',
srcQueryType:"1", srcQueryType: '1',
srcQuerySql:'', srcQuerySql: '',
srcColumnType:"0", srcColumnType: '0',
srcColumns:"", srcColumns: '',
srcConditionList:[], srcConditionList: [],
mapColumnHive:[], mapColumnHive: [],
mapColumnJava:[] mapColumnJava: []
}, },
sourceHdfsParams:{ sourceHdfsParams: {
exportDir:"" exportDir: ''
}, },
sourceHiveParams:{ sourceHiveParams: {
hiveDatabase:"", hiveDatabase: '',
hiveTable:"", hiveTable: '',
hivePartitionKey:"", hivePartitionKey: '',
hivePartitionValue:"" hivePartitionValue: ''
}, },
targetHdfsParams:{ targetHdfsParams: {
targetPath:"", targetPath: '',
deleteTargetDir:true, deleteTargetDir: true,
fileType:"--as-avrodatafile", fileType: '--as-avrodatafile',
compressionCodec:"snappy", compressionCodec: 'snappy',
fieldsTerminated:"", fieldsTerminated: '',
linesTerminated:"", linesTerminated: ''
}, },
targetMysqlParams:{ targetMysqlParams: {
targetType:"MYSQL", targetType: 'MYSQL',
targetDatasource:"", targetDatasource: '',
targetTable:"", targetTable: '',
targetColumns:"", targetColumns: '',
fieldsTerminated:"", fieldsTerminated: '',
linesTerminated:"", linesTerminated: '',
preQuery:"", preQuery: '',
isUpdate:false, isUpdate: false,
targetUpdateKey:"", targetUpdateKey: '',
targetUpdateMode:"allowinsert" targetUpdateMode: 'allowinsert'
}, },
targetHiveParams:{ targetHiveParams: {
hiveDatabase:"", hiveDatabase: '',
hiveTable:"", hiveTable: '',
createHiveTable:false, createHiveTable: false,
dropDelimiter:false, dropDelimiter: false,
hiveOverWrite:true, hiveOverWrite: true,
replaceDelimiter:"", replaceDelimiter: '',
hivePartitionKey:"", hivePartitionKey: '',
hivePartitionValue:"" hivePartitionValue: ''
}, },
item: '', item: '',
scriptBoxDialog: false scriptBoxDialog: false
@ -721,108 +721,108 @@
backfillItem: Object backfillItem: Object
}, },
methods: { methods: {
setEditorVal() { setEditorVal () {
this.item = editor.getValue() this.item = editor.getValue()
this.scriptBoxDialog = true this.scriptBoxDialog = true
}, },
getSriptBoxValue (val) { getSriptBoxValue (val) {
editor.setValue(val) editor.setValue(val)
}, },
_handleQueryType(o){ _handleQueryType (o) {
this.sourceMysqlParams.srcQueryType = this.srcQueryType this.sourceMysqlParams.srcQueryType = this.srcQueryType
this._getTargetTypeList(this.sourceType) this._getTargetTypeList(this.sourceType)
this.targetType = this.targetTypeList[0].code this.targetType = this.targetTypeList[0].code
}, },
_handleModelTypeChange(a){ _handleModelTypeChange (a) {
this._getSourceTypeList(a) this._getSourceTypeList(a)
this.sourceType = this.sourceTypeList[0].code this.sourceType = this.sourceTypeList[0].code
this._handleSourceTypeChange({label: this.sourceType, value: this.sourceType}) this._handleSourceTypeChange({ label: this.sourceType, value: this.sourceType })
}, },
_handleSourceTypeChange(a){ _handleSourceTypeChange (a) {
this._getTargetTypeList(a.label) this._getTargetTypeList(a.label)
this.targetType = this.targetTypeList[0].code this.targetType = this.targetTypeList[0].code
}, },
_getSourceTypeList(data){ _getSourceTypeList (data) {
switch(data){ switch (data) {
case 'import': case 'import':
this.sourceTypeList = [ this.sourceTypeList = [
{ {
code:"MYSQL" code: 'MYSQL'
}, }
] ]
break; break
case 'export': case 'export':
this.sourceTypeList = [ this.sourceTypeList = [
{ {
code: "HDFS" code: 'HDFS'
}, },
{ {
code: "HIVE" code: 'HIVE'
} }
] ]
break; break
default: default:
this.sourceTypeList = [ this.sourceTypeList = [
{ {
code:"MYSQL" code: 'MYSQL'
}, },
{ {
code:"HIVE" code: 'HIVE'
}, },
{ {
code:"HDFS" code: 'HDFS'
} }
] ]
break; break
} }
}, },
_getTargetTypeList(data){ _getTargetTypeList (data) {
switch(data){ switch (data) {
case 'MYSQL': case 'MYSQL':
if (this.srcQueryType === "1") { if (this.srcQueryType === '1') {
this.targetTypeList = [ this.targetTypeList = [
{ {
code: "HDFS" code: 'HDFS'
}] }]
} else { } else {
this.targetTypeList = [ this.targetTypeList = [
{ {
code: "HIVE" code: 'HIVE'
}, },
{ {
code: "HDFS" code: 'HDFS'
} }
] ]
} }
break; break
case 'HDFS': case 'HDFS':
this.targetTypeList = [ this.targetTypeList = [
{ {
code:"MYSQL" code: 'MYSQL'
} }
] ]
break; break
case 'HIVE': case 'HIVE':
this.targetTypeList = [ this.targetTypeList = [
{ {
code:"MYSQL" code: 'MYSQL'
} }
] ]
break; break
default: default:
this.targetTypeList = [ this.targetTypeList = [
{ {
code:"HIVE" code: 'HIVE'
}, },
{ {
code:"HDFS" code: 'HDFS'
} }
] ]
break; break
} }
}, },
@ -853,26 +853,26 @@
/** /**
* stringify the source params * stringify the source params
*/ */
_handleSourceParams() { _handleSourceParams () {
var params = null var params = null
switch(this.sourceType){ switch (this.sourceType) {
case "MYSQL": case 'MYSQL':
this.sourceMysqlParams.srcQuerySql = this.sourceMysqlParams.srcQueryType === "1" && editor ? this.sourceMysqlParams.srcQuerySql = this.sourceMysqlParams.srcQueryType === '1' && editor
editor.getValue() : this.sourceMysqlParams.srcQuerySql ? editor.getValue() : this.sourceMysqlParams.srcQuerySql
params = JSON.stringify(this.sourceMysqlParams) params = JSON.stringify(this.sourceMysqlParams)
break; break
case "ORACLE": case 'ORACLE':
params = JSON.stringify(this.sourceOracleParams) params = JSON.stringify(this.sourceOracleParams)
break; break
case "HDFS": case 'HDFS':
params = JSON.stringify(this.sourceHdfsParams) params = JSON.stringify(this.sourceHdfsParams)
break; break
case "HIVE": case 'HIVE':
params = JSON.stringify(this.sourceHiveParams) params = JSON.stringify(this.sourceHiveParams)
break; break
default: default:
params = ""; params = ''
break; break
} }
return params return params
}, },
@ -880,21 +880,21 @@
/** /**
* stringify the target params * stringify the target params
*/ */
_handleTargetParams() { _handleTargetParams () {
var params = null var params = null
switch(this.targetType){ switch (this.targetType) {
case "HIVE": case 'HIVE':
params = JSON.stringify(this.targetHiveParams) params = JSON.stringify(this.targetHiveParams)
break; break
case "HDFS": case 'HDFS':
params = JSON.stringify(this.targetHdfsParams) params = JSON.stringify(this.targetHdfsParams)
break; break
case "MYSQL": case 'MYSQL':
params = JSON.stringify(this.targetMysqlParams) params = JSON.stringify(this.targetMysqlParams)
break; break
default: default:
params = ""; params = ''
break; break
} }
return params return params
@ -903,47 +903,46 @@
/** /**
* get source params by source type * get source params by source type
*/ */
_getSourceParams(data) { _getSourceParams (data) {
switch(this.sourceType){ switch (this.sourceType) {
case "MYSQL": case 'MYSQL':
this.sourceMysqlParams = JSON.parse(data) this.sourceMysqlParams = JSON.parse(data)
this.srcDatasource = this.sourceMysqlParams.srcDatasource this.srcDatasource = this.sourceMysqlParams.srcDatasource
break; break
case "ORACLE": case 'ORACLE':
this.sourceOracleParams = JSON.parse(data) this.sourceOracleParams = JSON.parse(data)
break; break
case "HDFS": case 'HDFS':
this.sourceHdfsParams = JSON.parse(data) this.sourceHdfsParams = JSON.parse(data)
break; break
case "HIVE": case 'HIVE':
this.sourceHiveParams = JSON.parse(data) this.sourceHiveParams = JSON.parse(data)
break; break
default: default:
break; break
} }
}, },
/** /**
* get target params by target type * get target params by target type
*/ */
_getTargetParams(data) { _getTargetParams (data) {
switch(this.targetType){ switch (this.targetType) {
case "HIVE": case 'HIVE':
this.targetHiveParams = JSON.parse(data) this.targetHiveParams = JSON.parse(data)
break; break
case "HDFS": case 'HDFS':
this.targetHdfsParams = JSON.parse(data) this.targetHdfsParams = JSON.parse(data)
break; break
case "MYSQL": case 'MYSQL':
this.targetMysqlParams = JSON.parse(data) this.targetMysqlParams = JSON.parse(data)
this.targetDatasource = this.targetMysqlParams.targetDatasource this.targetDatasource = this.targetMysqlParams.targetDatasource
break; break
default: default:
break; break
} }
}, },
/** /**
* verification * verification
*/ */
@ -957,7 +956,7 @@
this.$message.warning(`${i18n.$t('Please enter Custom Shell(required)')}`) this.$message.warning(`${i18n.$t('Please enter Custom Shell(required)')}`)
return false return false
} }
sqoopParams['customShell'] = shellEditor.getValue() sqoopParams.customShell = shellEditor.getValue()
} else { } else {
if (!this.jobName) { if (!this.jobName) {
this.$message.warning(`${i18n.$t('Please enter Job Name(required)')}`) this.$message.warning(`${i18n.$t('Please enter Job Name(required)')}`)
@ -965,7 +964,7 @@
} }
switch (this.sourceType) { switch (this.sourceType) {
case "MYSQL": case 'MYSQL':
if (!this.$refs.refSourceDs._verifDatasource()) { if (!this.$refs.refSourceDs._verifDatasource()) {
return false return false
} }
@ -974,84 +973,84 @@
this.$message.warning(`${i18n.$t('Please enter a SQL Statement(required)')}`) this.$message.warning(`${i18n.$t('Please enter a SQL Statement(required)')}`)
return false return false
} }
this.sourceMysqlParams.srcTable = "" this.sourceMysqlParams.srcTable = ''
this.sourceMysqlParams.srcColumnType = "0" this.sourceMysqlParams.srcColumnType = '0'
this.sourceMysqlParams.srcColumns = "" this.sourceMysqlParams.srcColumns = ''
} else { } else {
if (this.sourceMysqlParams.srcTable === "") { if (this.sourceMysqlParams.srcTable === '') {
this.$message.warning(`${i18n.$t('Please enter Mysql Table(required)')}`) this.$message.warning(`${i18n.$t('Please enter Mysql Table(required)')}`)
return false return false
} }
this.sourceMysqlParams.srcQuerySql = "" this.sourceMysqlParams.srcQuerySql = ''
if (this.sourceMysqlParams.srcColumnType === "1" && this.sourceMysqlParams.srcColumns === "") { if (this.sourceMysqlParams.srcColumnType === '1' && this.sourceMysqlParams.srcColumns === '') {
this.$message.warning(`${i18n.$t('Please enter Columns (Comma separated)')}`) this.$message.warning(`${i18n.$t('Please enter Columns (Comma separated)')}`)
return false return false
} }
if (this.sourceMysqlParams.srcColumnType === "0") { if (this.sourceMysqlParams.srcColumnType === '0') {
this.sourceMysqlParams.srcColumns = "" this.sourceMysqlParams.srcColumns = ''
} }
} }
break; break
case "HDFS": case 'HDFS':
if (this.sourceHdfsParams.exportDir === "") { if (this.sourceHdfsParams.exportDir === '') {
this.$message.warning(`${i18n.$t('Please enter Export Dir(required)')}`) this.$message.warning(`${i18n.$t('Please enter Export Dir(required)')}`)
return false return false
} }
break; break
case "HIVE": case 'HIVE':
if (this.sourceHiveParams.hiveDatabase === "") { if (this.sourceHiveParams.hiveDatabase === '') {
this.$message.warning(`${i18n.$t('Please enter Hive Database(required)')}`) this.$message.warning(`${i18n.$t('Please enter Hive Database(required)')}`)
return false return false
} }
if (this.sourceHiveParams.hiveTable === "") { if (this.sourceHiveParams.hiveTable === '') {
this.$message.warning(`${i18n.$t('Please enter Hive Table(required)')}`) this.$message.warning(`${i18n.$t('Please enter Hive Table(required)')}`)
return false return false
} }
break; break
default: default:
break; break
} }
switch (this.targetType) { switch (this.targetType) {
case "HIVE": case 'HIVE':
if (this.targetHiveParams.hiveDatabase === "") { if (this.targetHiveParams.hiveDatabase === '') {
this.$message.warning(`${i18n.$t('Please enter Hive Database(required)')}`) this.$message.warning(`${i18n.$t('Please enter Hive Database(required)')}`)
return false return false
} }
if (this.targetHiveParams.hiveTable === "") { if (this.targetHiveParams.hiveTable === '') {
this.$message.warning(`${i18n.$t('Please enter Hive Table(required)')}`) this.$message.warning(`${i18n.$t('Please enter Hive Table(required)')}`)
return false return false
} }
break; break
case "HDFS": case 'HDFS':
if (this.targetHdfsParams.targetPath === "") { if (this.targetHdfsParams.targetPath === '') {
this.$message.warning(`${i18n.$t('Please enter Target Dir(required)')}`) this.$message.warning(`${i18n.$t('Please enter Target Dir(required)')}`)
return false return false
} }
break; break
case "MYSQL": case 'MYSQL':
if (!this.$refs.refTargetDs._verifDatasource()) { if (!this.$refs.refTargetDs._verifDatasource()) {
return false return false
} }
if (this.targetMysqlParams.targetTable === "") { if (this.targetMysqlParams.targetTable === '') {
this.$message.warning(`${i18n.$t('Please enter Mysql Table(required)')}`) this.$message.warning(`${i18n.$t('Please enter Mysql Table(required)')}`)
return false return false
} }
break; break
default: default:
break; break
} }
sqoopParams['jobName'] = this.jobName sqoopParams.jobName = this.jobName
sqoopParams['hadoopCustomParams'] = this.hadoopCustomParams sqoopParams.hadoopCustomParams = this.hadoopCustomParams
sqoopParams['sqoopAdvancedParams'] = this.sqoopAdvancedParams sqoopParams.sqoopAdvancedParams = this.sqoopAdvancedParams
sqoopParams['concurrency'] = this.concurrency sqoopParams.concurrency = this.concurrency
sqoopParams['modelType'] = this.modelType sqoopParams.modelType = this.modelType
sqoopParams['sourceType'] = this.sourceType sqoopParams.sourceType = this.sourceType
sqoopParams['targetType'] = this.targetType sqoopParams.targetType = this.targetType
sqoopParams['targetParams'] = this._handleTargetParams() sqoopParams.targetParams = this._handleTargetParams()
sqoopParams['sourceParams'] = this._handleSourceParams() sqoopParams.sourceParams = this._handleSourceParams()
} }
// storage // storage
@ -1142,14 +1141,14 @@
_cacheParams () { _cacheParams () {
this.$emit('on-cache-params', { this.$emit('on-cache-params', {
concurrency:this.concurrency, concurrency: this.concurrency,
modelType:this.modelType, modelType: this.modelType,
sourceType:this.sourceType, sourceType: this.sourceType,
targetType:this.targetType, targetType: this.targetType,
sourceParams:this._handleSourceParams(), sourceParams: this._handleSourceParams(),
targetParams:this._handleTargetParams(), targetParams: this._handleTargetParams(),
localParams:this.localParams localParams: this.localParams
}); })
}, },
_destroyEditor () { _destroyEditor () {
@ -1171,10 +1170,10 @@
watch: { watch: {
// Listening to sqlType // Listening to sqlType
sqlType (val) { sqlType (val) {
if (val==0) { if (val === 0) {
this.showType = [] this.showType = []
} }
if (val != 0) { if (val !== 0) {
this.title = '' this.title = ''
this.receivers = [] this.receivers = []
this.receiversCc = [] this.receiversCc = []
@ -1186,7 +1185,7 @@
this.connParams = '' this.connParams = ''
} }
}, },
//Watch the cacheParams // Watch the cacheParams
cacheParams (val) { cacheParams (val) {
this._cacheParams() this._cacheParams()
} }
@ -1248,21 +1247,21 @@
computed: { computed: {
cacheParams () { cacheParams () {
return { return {
concurrency:this.concurrency, concurrency: this.concurrency,
modelType:this.modelType, modelType: this.modelType,
sourceType:this.sourceType, sourceType: this.sourceType,
targetType:this.targetType, targetType: this.targetType,
localParams:this.localParams, localParams: this.localParams,
sourceMysqlParams:this.sourceMysqlParams, sourceMysqlParams: this.sourceMysqlParams,
sourceHdfsParams:this.sourceHdfsParams, sourceHdfsParams: this.sourceHdfsParams,
sourceHiveParams:this.sourceHiveParams, sourceHiveParams: this.sourceHiveParams,
targetHdfsParams:this.targetHdfsParams, targetHdfsParams: this.targetHdfsParams,
targetMysqlParams:this.targetMysqlParams, targetMysqlParams: this.targetMysqlParams,
targetHiveParams:this.targetHiveParams targetHiveParams: this.targetHiveParams
} }
} }
}, },
components: { mListBox, mDatasource, mLocalParams, mScriptBox} components: { mListBox, mDatasource, mLocalParams, mScriptBox }
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss"> <style lang="scss" rel="stylesheet/scss">
@ -1276,4 +1275,3 @@
top: -16px; top: -16px;
} }
</style> </style>

4
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sub_process.vue

@ -97,7 +97,7 @@
created () { created () {
let processListS = _.cloneDeep(this.store.state.dag.processListS) let processListS = _.cloneDeep(this.store.state.dag.processListS)
let id = null let id = null
if(this.router.history.current.name==='projects-instance-details') { if (this.router.history.current.name === 'projects-instance-details') {
id = this.router.history.current.query.id || null id = this.router.history.current.query.id || null
} else { } else {
id = this.router.history.current.params.id || null id = this.router.history.current.params.id || null
@ -119,7 +119,7 @@
this.wdiCurr = o.params.processDefinitionId this.wdiCurr = o.params.processDefinitionId
} else { } else {
if (this.processDefinitionList.length) { if (this.processDefinitionList.length) {
this.wdiCurr = this.processDefinitionList[0]['id'] this.wdiCurr = this.processDefinitionList[0].id
this.$emit('on-set-process-name', this._handleName(this.wdiCurr)) this.$emit('on-set-process-name', this._handleName(this.wdiCurr))
} }
} }

189
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/waterdrop.vue

@ -97,8 +97,6 @@
import _ from 'lodash' import _ from 'lodash'
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import mListBox from './_source/listBox' import mListBox from './_source/listBox'
import mScriptBox from './_source/scriptBox'
import mResources from './_source/resources'
import mLocalParams from './_source/localParams' import mLocalParams from './_source/localParams'
import disabledState from '@/module/mixin/disabledState' import disabledState from '@/module/mixin/disabledState'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
@ -112,9 +110,9 @@
// script // script
rawScript: '', rawScript: '',
// waterdrop script // waterdrop script
baseScript: 'sh ${WATERDROP_HOME}/bin/start-waterdrop.sh', baseScript: 'sh ${WATERDROP_HOME}/bin/start-waterdrop.sh', // eslint-disable-line
// resourceNameVal // resourceNameVal
resourceNameVal : [], resourceNameVal: [],
// Custom parameter // Custom parameter
localParams: [], localParams: [],
// resource(list) // resource(list)
@ -128,14 +126,14 @@
// Spark version(LIst) // Spark version(LIst)
masterType: [{ code: 'yarn' }, { code: 'local' }, { code: 'spark://' }, { code: 'mesos://' }], masterType: [{ code: 'yarn' }, { code: 'local' }, { code: 'spark://' }, { code: 'mesos://' }],
// Deployment masterUrl state // Deployment masterUrl state
masterUrlState:false, masterUrlState: false,
// Deployment masterUrl // Deployment masterUrl
masterUrl: '', masterUrl: '',
// Cache ResourceList // Cache ResourceList
cacheResourceList: [], cacheResourceList: [],
// define options // define options
options: [], options: [],
normalizer(node) { normalizer (node) {
return { return {
label: node.name label: node.name
} }
@ -177,7 +175,7 @@
return false return false
} }
// noRes // noRes
if (this.noRes.length>0) { if (this.noRes.length > 0) {
this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`) this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`)
return false return false
} }
@ -186,40 +184,40 @@
this.$message.warning(`${i18n.$t('Please select the waterdrop resources')}`) this.$message.warning(`${i18n.$t('Please select the waterdrop resources')}`)
return false return false
} }
if (this.resourceNameVal.resourceList && this.resourceNameVal.resourceList.length==0) { if (this.resourceNameVal.resourceList && this.resourceNameVal.resourceList.length === 0) {
this.$message.warning(`${i18n.$t('Please select the waterdrop resources')}`) this.$message.warning(`${i18n.$t('Please select the waterdrop resources')}`)
return false return false
} }
// Process resourcelist // Process resourcelist
let dataProcessing= _.map(this.resourceList, v => { let dataProcessing = _.map(this.resourceList, v => {
return { return {
id: v id: v
} }
}) })
//verify deploy mode // verify deploy mode
let deployMode = this.deployMode let deployMode = this.deployMode
let master = this.master let master = this.master
let masterUrl = this.masterUrl let masterUrl = this.masterUrl
if(this.deployMode == 'local'){ if (this.deployMode === 'local') {
master = 'local' master = 'local'
masterUrl = '' masterUrl = ''
deployMode = 'client' deployMode = 'client'
} }
// get local params // get local params
let locparams = '' let locparams = ''
this.localParams.forEach(v=>{ this.localParams.forEach(v => {
locparams = locparams + ' --variable ' + v.prop + '=' + v.value locparams = locparams + ' --variable ' + v.prop + '=' + v.value
} }
) )
// get waterdrop script // get waterdrop script
let tureScript = '' let tureScript = ''
this.resourceNameVal.resourceList.forEach(v=>{ this.resourceNameVal.resourceList.forEach(v => {
tureScript = tureScript + this.baseScript + tureScript = tureScript + this.baseScript +
' --master '+ master + masterUrl + ' --master ' + master + masterUrl +
' --deploy-mode '+ deployMode + ' --deploy-mode ' + deployMode +
' --queue '+ this.queue + ' --queue ' + this.queue +
' --config ' + v.res + ' --config ' + v.res +
locparams + ' \n' locparams + ' \n'
}) })
@ -227,60 +225,60 @@
this.$emit('on-params', { this.$emit('on-params', {
resourceList: dataProcessing, resourceList: dataProcessing,
localParams: this.localParams, localParams: this.localParams,
rawScript: tureScript, rawScript: tureScript
}) })
return true return true
}, },
diGuiTree(item) { // Recursive convenience tree structure diGuiTree (item) { // Recursive convenience tree structure
item.forEach(item => { item.forEach(item => {
item.children === '' || item.children === undefined || item.children === null || item.children.length === 0? item.children === '' || item.children === undefined || item.children === null || item.children.length === 0
this.operationTree(item) : this.diGuiTree(item.children); ? this.operationTree(item) : this.diGuiTree(item.children)
}) })
}, },
operationTree(item) { operationTree (item) {
if(item.dirctory) { if (item.dirctory) {
item.isDisabled =true item.isDisabled = true
} }
delete item.children delete item.children
}, },
searchTree(element, id) { searchTree (element, id) {
// id // id
if (element.id == id) { if (element.id === id) {
return element; return element
} else if (element.children != null) { } else if (element.children !== null) {
var i; var i
var result = null; var result = null
for (i = 0; result == null && i < element.children.length; i++) { for (i = 0; result === null && i < element.children.length; i++) {
result = this.searchTree(element.children[i], id); result = this.searchTree(element.children[i], id)
} }
return result; return result
} }
return null; return null
}, },
dataProcess(backResource) { dataProcess (backResource) {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if(this.resourceList.length>0) { if (this.resourceList.length > 0) {
this.resourceList.forEach(v=>{ this.resourceList.forEach(v => {
this.options.forEach(v1=>{ this.options.forEach(v1 => {
if(this.searchTree(v1,v)) { if (this.searchTree(v1, v)) {
isResourceId.push(this.searchTree(v1,v)) isResourceId.push(this.searchTree(v1, v))
} }
}) })
}) })
resourceIdArr = isResourceId.map(item=>{ resourceIdArr = isResourceId.map(item => {
return item.id return item.id
}) })
Array.prototype.diff = function(a) { Array.prototype.diff = function (a) {
return this.filter(function(i) {return a.indexOf(i) < 0;}); return this.filter(function (i) { return a.indexOf(i) < 0 })
}; }
let diffSet = this.resourceList.diff(resourceIdArr); let diffSet = this.resourceList.diff(resourceIdArr)
let optionsCmp = [] let optionsCmp = []
if(diffSet.length>0) { if (diffSet.length > 0) {
diffSet.forEach(item=>{ diffSet.forEach(item => {
backResource.forEach(item1=>{ backResource.forEach(item1 => {
if(item==item1.id || item==item1.res) { if (item === item1.id || item === item1.res) {
optionsCmp.push(item1) optionsCmp.push(item1)
} }
}) })
@ -289,15 +287,15 @@
let noResources = [{ let noResources = [{
id: -1, id: -1,
name: $t('Unauthorized or deleted resources'), name: $t('Unauthorized or deleted resources'),
fullName: '/'+$t('Unauthorized or deleted resources'), fullName: '/' + $t('Unauthorized or deleted resources'),
children: [] children: []
}] }]
if(optionsCmp.length>0) { if (optionsCmp.length > 0) {
this.allNoResources = optionsCmp this.allNoResources = optionsCmp
optionsCmp = optionsCmp.map(item=>{ optionsCmp = optionsCmp.map(item => {
return {id: item.id,name: item.name,fullName: item.res} return { id: item.id, name: item.name, fullName: item.res }
}) })
optionsCmp.forEach(item=>{ optionsCmp.forEach(item => {
item.isNew = true item.isNew = true
}) })
noResources[0].children = optionsCmp noResources[0].children = optionsCmp
@ -307,57 +305,62 @@
} }
}, },
watch: { watch: {
//Watch the cacheParams // Watch the cacheParams
cacheParams (val) { cacheParams (val) {
this.resourceNameVal = val this.resourceNameVal = val
this.$emit('on-cache-params', val); this.$emit('on-cache-params', val)
},
resourceIdArr (arr) {
let result = []
arr.forEach(item => {
this.allNoResources.forEach(item1 => {
if (item.id === item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
}, },
"master": { master: {
handler(code) { handler (code) {
if(code == 'spark://'){ if (code === 'spark://') {
this.masterUrlState = true; this.masterUrlState = true
}else if(code == 'mesos://'){ } else if (code === 'mesos://') {
this.masterUrlState = true; this.masterUrlState = true
}else{ } else {
this.masterUrlState = false; this.masterUrlState = false
this.masterUrl = '' this.masterUrl = ''
} }
} }
}, }
}, },
computed: { computed: {
cacheParams () { resourceIdArr () {
let isResourceId = [] let isResourceId = []
let resourceIdArr = [] let resourceIdArr = []
if(this.resourceList.length>0) { if (this.resourceList.length > 0) {
this.resourceList.forEach(v=>{ this.resourceList.forEach(v => {
this.options.forEach(v1=>{ this.options.forEach(v1 => {
if(this.searchTree(v1,v)) { if (this.searchTree(v1, v)) {
isResourceId.push(this.searchTree(v1,v)) isResourceId.push(this.searchTree(v1, v))
} }
}) })
}) })
resourceIdArr = isResourceId.map(item=>{ resourceIdArr = isResourceId.map(item => {
return {id: item.id,name: item.name,res: item.fullName} return { id: item.id, name: item.name, res: item.fullName }
}) })
} }
let result = [] return resourceIdArr
resourceIdArr.forEach(item=>{ },
this.allNoResources.forEach(item1=>{ cacheParams () {
if(item.id==item1.id) {
// resultBool = true
result.push(item1)
}
})
})
this.noRes = result
return { return {
resourceList: resourceIdArr, resourceList: this.resourceIdArr,
localParams: this.localParams, localParams: this.localParams,
deployMode: this.deployMode, deployMode: this.deployMode,
master: this.master, master: this.master,
masterUrl: this.masterUrl, masterUrl: this.masterUrl,
queue:this.queue, queue: this.queue
} }
} }
}, },
@ -370,7 +373,7 @@
// Non-null objects represent backfill // Non-null objects represent backfill
if (!_.isEmpty(o)) { if (!_.isEmpty(o)) {
this.master = o.params.master || 'yarn' this.master = o.params.master || 'yarn'
this.deployMode = o.params.deployMode || 'client' this.deployMode = o.params.deployMode || 'client'
this.masterUrl = o.params.masterUrl || '' this.masterUrl = o.params.masterUrl || ''
this.queue = o.params.queue || 'default' this.queue = o.params.queue || 'default'
this.rawScript = o.params.rawScript || '' this.rawScript = o.params.rawScript || ''
@ -380,10 +383,10 @@
let resourceList = o.params.resourceList || [] let resourceList = o.params.resourceList || []
if (resourceList.length) { if (resourceList.length) {
_.map(resourceList, v => { _.map(resourceList, v => {
if(!v.id) { if (!v.id) {
this.store.dispatch('dag/getResourceId',{ this.store.dispatch('dag/getResourceId', {
type: 'FILE', type: 'FILE',
fullName: '/'+v.res fullName: '/' + v.res
}).then(res => { }).then(res => {
this.resourceList.push(res.id) this.resourceList.push(res.id)
this.dataProcess(backResource) this.dataProcess(backResource)
@ -408,7 +411,7 @@
}, },
destroyed () { destroyed () {
}, },
components: { mLocalParams, mListBox, mResources, mScriptBox, Treeselect } components: { mLocalParams, mListBox, Treeselect }
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss" scope> <style lang="scss" rel="stylesheet/scss" scope>

13
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/startingParam/index.vue

@ -35,10 +35,11 @@
</div> </div>
</template> </template>
<script> <script>
import _ from 'lodash'
import store from '@/conf/home/store' import store from '@/conf/home/store'
import { runningType } from '@/conf/home/pages/dag/_source/config' import { runningType } from '@/conf/home/pages/dag/_source/config'
import { warningTypeList } from '@/conf/home/pages/projects/pages/definition/pages/list/_source/util' import { warningTypeList } from '@/conf/home/pages/projects/pages/definition/pages/list/_source/util'
export default { export default {
name: 'starting-params-dag-index', name: 'starting-params-dag-index',
data () { data () {
@ -69,16 +70,16 @@
return '-' return '-'
}, },
_rtWorkerGroupName (id) { _rtWorkerGroupName (id) {
let o = _.filter(this.workerGroupList, v => v.id === id) let o = _.filter(this.workerGroupList, v => v.id === id)
if (o && o.length) { if (o && o.length) {
return o[0].name return o[0].name
} }
return '-' return '-'
}, },
_getNotifyGroupList () { _getNotifyGroupList () {
this.store.dispatch('dag/getNotifyGroupList').then(res => { this.store.dispatch('dag/getNotifyGroupList').then(res => {
this.notifyGroupList = res this.notifyGroupList = res
}) })
}, },
_getWorkerGroupList () { _getWorkerGroupList () {
let stateWorkerGroupsList = this.store.state.security.workerGroupsListAll || [] let stateWorkerGroupsList = this.store.state.security.workerGroupsListAll || []
@ -92,7 +93,7 @@
} }
}, },
watch: { watch: {
'$route': { $route: {
deep: true, deep: true,
handler () { handler () {
this.isActive = false this.isActive = false

19
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/_source/selectTenant.vue

@ -18,7 +18,7 @@
<el-select <el-select
:disabled="isDetails" :disabled="isDetails"
@change="_onChange" @change="_onChange"
v-model="value" v-model="selectedValue"
size="small" size="small"
style="width: 180px"> style="width: 180px">
<el-option <el-option
@ -35,6 +35,7 @@
name: 'form-tenant', name: 'form-tenant',
data () { data () {
return { return {
selectedValue: this.value,
itemList: [] itemList: []
} }
}, },
@ -49,23 +50,25 @@
prop: 'value', prop: 'value',
event: 'tenantSelectEvent' event: 'tenantSelectEvent'
}, },
mounted() { mounted () {
let result = this.itemList.some(item=>{ let result = this.itemList.some(item => {
if(item.id == this.value) { if (item.id === this.value) {
return true return true
} }
}) })
if(!result) { if (!result) {
this.value = 'default' this.selectedValue = 'default'
} }
}, },
methods: { methods: {
_onChange (o) { _onChange (o) {
this.value = o
this.$emit('tenantSelectEvent', o) this.$emit('tenantSelectEvent', o)
} }
}, },
watch: { watch: {
value (val) {
this.selectedValue = val
}
}, },
created () { created () {
let stateTenantAllList = this.store.state.security.tenantAllList || [] let stateTenantAllList = this.store.state.security.tenantAllList || []

7
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue

@ -91,7 +91,7 @@
import mLocalParams from '../formModel/tasks/_source/localParams' import mLocalParams from '../formModel/tasks/_source/localParams'
import disabledState from '@/module/mixin/disabledState' import disabledState from '@/module/mixin/disabledState'
import Affirm from '../jumpAffirm' import Affirm from '../jumpAffirm'
import FormTenant from "./_source/selectTenant"; import FormTenant from './_source/selectTenant'
export default { export default {
name: 'udp', name: 'udp',
@ -134,7 +134,7 @@
} }
return true return true
}, },
_accuStore(){ _accuStore () {
this.store.commit('dag/setGlobalParams', _.cloneDeep(this.udpList)) this.store.commit('dag/setGlobalParams', _.cloneDeep(this.udpList))
this.store.commit('dag/setName', _.cloneDeep(this.name)) this.store.commit('dag/setName', _.cloneDeep(this.name))
this.store.commit('dag/setTimeout', _.cloneDeep(this.timeout)) this.store.commit('dag/setTimeout', _.cloneDeep(this.timeout))
@ -210,10 +210,9 @@
this.tenantId = dag.tenantId this.tenantId = dag.tenantId
} }
}) })
}, },
mounted () {}, mounted () {},
components: {FormTenant, mLocalParams } components: { FormTenant, mLocalParams }
} }
</script> </script>

2
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/variable/index.vue

@ -37,7 +37,7 @@
} }
}, },
watch: { watch: {
'$route': { $route: {
deep: true, deep: true,
handler () { handler () {
this.isActive = false this.isActive = false

6
dolphinscheduler-ui/src/js/conf/home/pages/dag/definitionDetails.vue

@ -41,8 +41,8 @@
props: {}, props: {},
methods: { methods: {
...mapMutations('dag', ['resetParams', 'setIsDetails']), ...mapMutations('dag', ['resetParams', 'setIsDetails']),
...mapActions('dag', ['getProcessList','getProjectList', 'getResourcesList', 'getProcessDetails','getResourcesListJar']), ...mapActions('dag', ['getProcessList', 'getProjectList', 'getResourcesList', 'getProcessDetails', 'getResourcesListJar']),
...mapActions('security', ['getTenantList','getWorkerGroupsAll']), ...mapActions('security', ['getTenantList', 'getWorkerGroupsAll']),
/** /**
* init * init
*/ */
@ -89,7 +89,7 @@
}, },
watch: { watch: {
// Listening for routing changes // Listening for routing changes
'$route': { $route: {
deep: true, deep: true,
handler () { handler () {
this.init() this.init()

6
dolphinscheduler-ui/src/js/conf/home/pages/dag/index.vue

@ -40,8 +40,8 @@
props: {}, props: {},
methods: { methods: {
...mapMutations('dag', ['resetParams']), ...mapMutations('dag', ['resetParams']),
...mapActions('dag', ['getProcessList','getProjectList', 'getResourcesList','getResourcesListJar','getResourcesListJar']), ...mapActions('dag', ['getProcessList', 'getProjectList', 'getResourcesList', 'getResourcesListJar', 'getResourcesListJar']),
...mapActions('security', ['getTenantList','getWorkerGroupsAll']), ...mapActions('security', ['getTenantList', 'getWorkerGroupsAll']),
/** /**
* init * init
*/ */
@ -74,7 +74,7 @@
} }
}, },
watch: { watch: {
'$route': { $route: {
deep: true, deep: true,
handler () { handler () {
this.init() this.init()

6
dolphinscheduler-ui/src/js/conf/home/pages/dag/instanceDetails.vue

@ -43,8 +43,8 @@
props: {}, props: {},
methods: { methods: {
...mapMutations('dag', ['setIsDetails', 'resetParams']), ...mapMutations('dag', ['setIsDetails', 'resetParams']),
...mapActions('dag', ['getProcessList','getProjectList', 'getResourcesList', 'getInstancedetail','getResourcesListJar']), ...mapActions('dag', ['getProcessList', 'getProjectList', 'getResourcesList', 'getInstancedetail', 'getResourcesListJar']),
...mapActions('security', ['getTenantList','getWorkerGroupsAll']), ...mapActions('security', ['getTenantList', 'getWorkerGroupsAll']),
/** /**
* init * init
*/ */
@ -101,7 +101,7 @@
} }
}, },
watch: { watch: {
'$route': { $route: {
deep: true, deep: true,
handler () { handler () {
this.init() this.init()

67
dolphinscheduler-ui/src/js/conf/home/pages/datasource/pages/list/_source/createDataSource.vue

@ -152,8 +152,7 @@
<script> <script>
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import store from '@/conf/home/store' import store from '@/conf/home/store'
import {isJson} from '@/module/util/util' import { isJson } from '@/module/util/util'
import mPopup from '@/module/components/popup/popup'
import mListBoxF from '@/module/components/listBoxF/listBoxF' import mListBoxF from '@/module/components/listBoxF/listBoxF'
export default { export default {
@ -176,7 +175,7 @@
// data storage name // data storage name
database: '', database: '',
// principal // principal
principal:'', principal: '',
// database username // database username
userName: '', userName: '',
// Database password // Database password
@ -190,8 +189,8 @@
showPrincipal: true, showPrincipal: true,
showdDatabase: false, showdDatabase: false,
showConnectType: false, showConnectType: false,
isShowPrincipal:true, isShowPrincipal: true,
prePortMapper:{}, prePortMapper: {},
datasourceTypeList: [ datasourceTypeList: [
{ {
value: 'MYSQL', value: 'MYSQL',
@ -329,7 +328,7 @@
return false return false
} }
if (!this.database && this.showdDatabase == false) { if (!this.database && this.showdDatabase === false) {
this.$message.warning(`${i18n.$t('Please enter database name')}`) this.$message.warning(`${i18n.$t('Please enter database name')}`)
return false return false
} }
@ -352,7 +351,7 @@
if (this.item) { if (this.item) {
param.id = this.item.id param.id = this.item.id
} }
this.store.dispatch(`datasource/${this.item ? `updateDatasource` : `createDatasources`}`, param).then(res => { this.store.dispatch(`datasource/${this.item ? 'updateDatasource' : 'createDatasources'}`, param).then(res => {
this.$message.success(res.msg) this.$message.success(res.msg)
this.spinnerLoading = false this.spinnerLoading = false
this.$emit('onUpdate') this.$emit('onUpdate')
@ -364,18 +363,17 @@
/** /**
* Get modified data * Get modified data
*/ */
_getEditDatasource() { _getEditDatasource () {
this.store.dispatch('datasource/getEditDatasource', {id: this.item.id}).then(res => { this.store.dispatch('datasource/getEditDatasource', { id: this.item.id }).then(res => {
this.type = res.type this.type = res.type
this.name = res.name this.name = res.name
this.note = res.note this.note = res.note
this.host = res.host this.host = res.host
//When in Editpage, Prevent default value overwrite backfill value // When in Editpage, Prevent default value overwrite backfill value
let that = this;
setTimeout(() => { setTimeout(() => {
this.port = res.port this.port = res.port
},0) }, 0)
this.principal = res.principal this.principal = res.principal
this.database = res.database this.database = res.database
@ -390,24 +388,22 @@
/** /**
* Set default port for each type. * Set default port for each type.
*/ */
_setDefaultValues(value) { _setDefaultValues (value) {
// Default type is MYSQL
//Default type is MYSQL
let type = this.type || 'MYSQL' let type = this.type || 'MYSQL'
let defaultPort = this._getDefaultPort(type) let defaultPort = this._getDefaultPort(type)
//Backfill the previous input from memcache // Backfill the previous input from memcache
let mapperPort = this.prePortMapper[type] let mapperPort = this.prePortMapper[type]
this.port = mapperPort || defaultPort this.port = mapperPort || defaultPort
}, },
/** /**
* Get default port by type * Get default port by type
*/ */
_getDefaultPort(type) { _getDefaultPort (type) {
var defaultPort = '' var defaultPort = ''
switch (type) { switch (type) {
case 'MYSQL': case 'MYSQL':
@ -439,10 +435,9 @@
break break
default: default:
break break
} }
return defaultPort return defaultPort
}, }
}, },
created () { created () {
// Backfill // Backfill
@ -451,33 +446,32 @@
} }
this._setDefaultValues() this._setDefaultValues()
}, },
watch: { watch: {
type(value){ type (value) {
if(value == 'POSTGRESQL') { if (value === 'POSTGRESQL') {
this.showdDatabase = true; this.showdDatabase = true
} else { } else {
this.showdDatabase = false; this.showdDatabase = false
} }
if (value== 'ORACLE' && !this.item.id) { if (value === 'ORACLE' && !this.item.id) {
this.showConnectType = true; this.showConnectType = true
this.connectType = 'ORACLE_SERVICE_NAME' this.connectType = 'ORACLE_SERVICE_NAME'
} else if(value== 'ORACLE' && this.item.id) { } else if (value === 'ORACLE' && this.item.id) {
this.showConnectType = true; this.showConnectType = true
} else { } else {
this.showConnectType = false; this.showConnectType = false
} }
//Set default port for each type datasource // Set default port for each type datasource
this._setDefaultValues(value) this._setDefaultValues(value)
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.store.dispatch('datasource/getKerberosStartupState').then(res => { this.store.dispatch('datasource/getKerberosStartupState').then(res => {
this.isShowPrincipal=res this.isShowPrincipal = res
if((value =='HIVE'||value == 'SPARK')&&this.isShowPrincipal== true){ if ((value === 'HIVE' || value === 'SPARK') && this.isShowPrincipal === true) {
this.showPrincipal = false this.showPrincipal = false
}else{ } else {
this.showPrincipal = true this.showPrincipal = true
} }
}).catch(e => { }).catch(e => {
@ -490,14 +484,14 @@
* Cache the previous input port for each type datasource * Cache the previous input port for each type datasource
* @param value * @param value
*/ */
port(value){ port (value) {
this.prePortMapper[this.type] = value this.prePortMapper[this.type] = value
} }
}, },
mounted () { mounted () {
}, },
components: { mPopup, mListBoxF } components: { mListBoxF }
} }
</script> </script>
@ -539,5 +533,4 @@
} }
} }
</style> </style>

12
dolphinscheduler-ui/src/js/conf/home/pages/datasource/pages/list/index.vue

@ -81,11 +81,11 @@
// Number of pages // Number of pages
pageNo: 1, pageNo: 1,
// Search value // Search value
searchVal: '', searchVal: ''
}, },
dialogVisible: false, dialogVisible: false,
item: {}, item: {}
} }
}, },
mixins: [listUrlParamHandle], mixins: [listUrlParamHandle],
@ -128,8 +128,8 @@
_getList (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
this.getDatasourcesListP(this.searchParams).then(res => { this.getDatasourcesListP(this.searchParams).then(res => {
if(this.searchParams.pageNo>1 && res.totalList.length == 0) { if (this.searchParams.pageNo > 1 && res.totalList.length === 0) {
this.searchParams.pageNo = this.searchParams.pageNo -1 this.searchParams.pageNo = this.searchParams.pageNo - 1
} else { } else {
this.datasourcesList = [] this.datasourcesList = []
this.datasourcesList = res.totalList this.datasourcesList = res.totalList
@ -142,7 +142,7 @@
}, },
_onUpdate () { _onUpdate () {
this._debounceGET('false') this._debounceGET('false')
}, }
}, },
watch: { watch: {
// router // router

17
dolphinscheduler-ui/src/js/conf/home/pages/home/index.vue

@ -19,13 +19,12 @@
</template> </template>
<script> <script>
import mProjectHome from '@/conf/home/pages/projects/pages/index' import mProjectHome from '@/conf/home/pages/projects/pages/index'
import mListConstruction from '@/module/components/listConstruction/listConstruction' export default {
export default { name: 'home',
name: 'home', components: { mProjectHome },
components: { mProjectHome, mListConstruction }, mounted () {
mounted() {
}
}, }
}
</script> </script>

6
dolphinscheduler-ui/src/js/conf/home/pages/monitor/index.vue

@ -25,9 +25,9 @@
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu' import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
export default { export default {
name: 'monitor-index', name: 'monitor-index',
mounted() { mounted () {
}, },
components: { mSecondaryMenu } components: { mSecondaryMenu }
} }
</script> </script>

6
dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/zookeeperList.vue

@ -49,11 +49,6 @@
<script> <script>
export default { export default {
name: 'zookeeper-list', name: 'zookeeper-list',
data () {
return {
list: []
}
},
props: { props: {
list: Array list: Array
} }
@ -77,4 +72,3 @@
} }
} }
</style> </style>

68
dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/db.vue

@ -79,41 +79,39 @@
</div> </div>
</template> </template>
<script> <script>
import { mapActions } from "vuex"; import { mapActions } from 'vuex'
import mList from "./_source/zookeeperList"; import mSpin from '@/module/components/spin/spin'
import mSpin from "@/module/components/spin/spin"; import mNoData from '@/module/components/noData/noData'
import mNoData from "@/module/components/noData/noData"; import themeData from '@/module/echarts/themeData.json'
import themeData from "@/module/echarts/themeData.json";
import mListConstruction from "@/module/components/listConstruction/listConstruction";
export default { export default {
name: "servers-mysql", name: 'servers-mysql',
data() { data () {
return { return {
isLoading: false, isLoading: false,
mysqlList: [], mysqlList: [],
color: themeData.color color: themeData.color
}; }
}, },
props: {}, props: {},
methods: { methods: {
...mapActions("monitor", ["getDatabaseData"]) ...mapActions('monitor', ['getDatabaseData'])
}, },
watch: {}, watch: {},
created() { created () {
this.isLoading = true; this.isLoading = true
this.getDatabaseData() this.getDatabaseData()
.then(res => { .then(res => {
this.mysqlList = res; this.mysqlList = res
this.isLoading = false; this.isLoading = false
}) })
.catch(() => { .catch(() => {
this.isLoading = false; this.isLoading = false
}); })
}, },
mounted() {}, mounted () {},
components: { mList, mListConstruction, mSpin, mNoData } components: { mSpin, mNoData }
}; }
</script> </script>
<style lang="scss" rel="stylesheet/scss"> <style lang="scss" rel="stylesheet/scss">
@import "./servers"; @import "./servers";
@ -135,4 +133,4 @@ export default {
color: #2a455b; color: #2a455b;
} }
} }
</style> </style>

5
dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/master.vue

@ -68,7 +68,6 @@
import _ from 'lodash' import _ from 'lodash'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import mGauge from './_source/gauge' import mGauge from './_source/gauge'
import mList from './_source/zookeeperList'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import themeData from '@/module/echarts/themeData.json' import themeData from '@/module/echarts/themeData.json'
@ -95,7 +94,7 @@
this.getMasterData().then(res => { this.getMasterData().then(res => {
this.masterList = _.map(res, (v, i) => { this.masterList = _.map(res, (v, i) => {
return _.assign(v, { return _.assign(v, {
id: v.host + "_" + v.id, id: v.host + '_' + v.id,
resInfo: JSON.parse(v.resInfo) resInfo: JSON.parse(v.resInfo)
}) })
}) })
@ -104,7 +103,7 @@
this.isLoading = false this.isLoading = false
}) })
}, },
components: { mList, mListConstruction, mSpin, mNoData, mGauge } components: { mListConstruction, mSpin, mNoData, mGauge }
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss"> <style lang="scss" rel="stylesheet/scss">

26
dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/statistics.vue

@ -67,14 +67,14 @@
</template> </template>
<script> <script>
import _ from 'lodash'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData'
import themeData from '@/module/echarts/themeData.json' import themeData from '@/module/echarts/themeData.json'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default { export default {
name: 'statistics', name: 'statistics',
data () { data () {
return { return {
isLoading: false, isLoading: false,
@ -83,12 +83,12 @@
color: themeData.color color: themeData.color
} }
}, },
props:{}, props: {},
methods: { methods: {
//...mapActions('monitor', ['getDatabaseData']) // ...mapActions('monitor', ['getDatabaseData'])
// ...mapActions('projects', ['getCommandStateCount']), // ...mapActions('projects', ['getCommandStateCount']),
...mapActions('projects', ['getQueueCount']), ...mapActions('projects', ['getQueueCount']),
...mapActions('projects', ['getCommandStateCount']), ...mapActions('projects', ['getCommandStateCount'])
}, },
watch: {}, watch: {},
created () { created () {
@ -98,31 +98,31 @@
this.isLoading = false this.isLoading = false
}).catch(() => { }).catch(() => {
this.isLoading = false this.isLoading = false
}) })
this.getCommandStateCount().then(res => { this.getCommandStateCount().then(res => {
let normal = 0 let normal = 0
let error = 0 let error = 0
_.forEach(res.data, (v, i) => { _.forEach(res.data, (v, i) => {
let key = _.keys(v) let key = _.keys(v)
if(key[0] == 'errorCount') { if (key[0] === 'errorCount') {
error = error + v.errorCount error = error + v.errorCount
} }
if(key[1] == 'normalCount'){ if (key[1] === 'normalCount') {
normal = normal + v.normalCount normal = normal + v.normalCount
} }
} }
) )
this.commandCountData = { this.commandCountData = {
'normalCount': normal, normalCount: normal,
'errorCount' : error errorCount: error
} }
}).catch( () => { }).catch(() => {
}) })
}, },
mounted () { mounted () {
}, },
components: { mListConstruction, mSpin, mNoData } components: { mListConstruction, mSpin }
} }
</script> </script>

5
dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/worker.vue

@ -73,7 +73,6 @@
import _ from 'lodash' import _ from 'lodash'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import mGauge from './_source/gauge' import mGauge from './_source/gauge'
import mList from './_source/zookeeperList'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import themeData from '@/module/echarts/themeData.json' import themeData from '@/module/echarts/themeData.json'
@ -112,7 +111,7 @@
this.getWorkerData().then(res => { this.getWorkerData().then(res => {
this.workerList = _.map(res, (v, i) => { this.workerList = _.map(res, (v, i) => {
return _.assign(v, { return _.assign(v, {
id: v.host + "_" + v.id, id: v.host + '_' + v.id,
resInfo: JSON.parse(v.resInfo) resInfo: JSON.parse(v.resInfo)
}) })
}) })
@ -121,7 +120,7 @@
this.isLoading = true this.isLoading = true
}) })
}, },
components: { mList, mListConstruction, mSpin, mNoData, mGauge, zookeeperDirectoriesPopup } components: { mListConstruction, mSpin, mNoData, mGauge, zookeeperDirectoriesPopup }
} }
</script> </script>
<style lang="scss" rel="stylesheet/scss"> <style lang="scss" rel="stylesheet/scss">

4
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/conditions/instance/processInstance.vue

@ -94,14 +94,14 @@
this.searchParams.startDate = val[0] this.searchParams.startDate = val[0]
this.searchParams.endDate = val[1] this.searchParams.endDate = val[1]
this.dataTime[0] = val[0] this.dataTime[0] = val[0]
this.dataTime[1]= val[1] this.dataTime[1] = val[1]
}, },
/** /**
* change state * change state
*/ */
_onChangeState (val) { _onChangeState (val) {
this.searchParams.stateType = val this.searchParams.stateType = val
}, }
}, },
watch: { watch: {
}, },

6
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/conditions/instance/taskInstance.vue

@ -83,7 +83,7 @@
executorName: '', executorName: '',
processInstanceName: '' processInstanceName: ''
}, },
dataTime: [], dataTime: []
} }
}, },
props: {}, props: {},
@ -98,14 +98,14 @@
this.searchParams.startDate = val[0] this.searchParams.startDate = val[0]
this.searchParams.endDate = val[1] this.searchParams.endDate = val[1]
this.dataTime[0] = val[0] this.dataTime[0] = val[0]
this.dataTime[1]= val[1] this.dataTime[1] = val[1]
}, },
/** /**
* change state * change state
*/ */
_onChangeState (val) { _onChangeState (val) {
this.searchParams.stateType = val this.searchParams.stateType = val
}, }
}, },
watch: { watch: {
}, },

18
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/taskRecordList/_source/conditions.vue

@ -74,26 +74,26 @@
stateList: [ stateList: [
{ {
label: `${this.$t('none')}`, label: `${this.$t('none')}`,
code: `` code: ''
}, },
{ {
label: `${this.$t('success')}`, label: `${this.$t('success')}`,
code: `成功` code: '成功'
}, },
{ {
label: `${this.$t('waiting')}`, label: `${this.$t('waiting')}`,
code: `等待` code: '等待'
}, },
{ {
label: `${this.$t('execution')}`, label: `${this.$t('execution')}`,
code: `执行中` code: '执行中'
}, },
{ {
label: `${this.$t('finish')}`, label: `${this.$t('finish')}`,
code: `完成` code: '完成'
}, { }, {
label: `${this.$t('failed')}`, label: `${this.$t('failed')}`,
code: `失败` code: '失败'
} }
], ],
searchParams: { searchParams: {
@ -105,7 +105,7 @@
startDate: '', startDate: '',
endDate: '' endDate: ''
}, },
dataTime: [], dataTime: []
} }
}, },
props: {}, props: {},
@ -118,7 +118,7 @@
*/ */
_onChangeStartStop (val) { _onChangeStartStop (val) {
this.searchParams.startDate = val[0] this.searchParams.startDate = val[0]
this.searchParams.endDate = val[1] this.searchParams.endDate = val[1]
}, },
/** /**
* change state * change state
@ -148,4 +148,4 @@
}, },
components: { mConditions } components: { mConditions }
} }
</script> </script>

2
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/taskRecordList/_source/list.vue

@ -88,4 +88,4 @@
}, },
components: { } components: { }
} }
</script> </script>

3
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/_source/taskRecordList/index.vue

@ -51,7 +51,6 @@
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import listUrlParamHandle from '@/module/mixin/listUrlParamHandle' import listUrlParamHandle from '@/module/mixin/listUrlParamHandle'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default { export default {
@ -119,6 +118,6 @@
}, },
mounted () { mounted () {
}, },
components: { mList, mConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData } components: { mList, mConditions, mSpin, mListConstruction, mNoData }
} }
</script> </script>

3
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/create/index.vue

@ -19,9 +19,8 @@
</template> </template>
<script> <script>
import mCreateDag from '@/conf/home/pages/dag/index' import mCreateDag from '@/conf/home/pages/dag/index'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
export default { export default {
name: 'definition-create-index', name: 'definition-create-index',
components: { mCreateDag, mSecondaryMenu } components: { mCreateDag }
} }
</script> </script>

3
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/details/index.vue

@ -18,10 +18,9 @@
<m-definition-details></m-definition-details> <m-definition-details></m-definition-details>
</template> </template>
<script> <script>
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
import mDefinitionDetails from '@/conf/home/pages/dag/definitionDetails.vue' import mDefinitionDetails from '@/conf/home/pages/dag/definitionDetails.vue'
export default { export default {
name: 'definition-details-index', name: 'definition-details-index',
components: { mDefinitionDetails, mSecondaryMenu } components: { mDefinitionDetails }
} }
</script> </script>

28
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue

@ -17,7 +17,7 @@
<template> <template>
<div class="ans-input email-model"> <div class="ans-input email-model">
<div class="clearfix input-element" :class="disabled ? 'disabled' : ''"> <div class="clearfix input-element" :class="disabled ? 'disabled' : ''">
<span class="tag-wrapper" v-for="(item,$index) in activeList" :key="$index" :class="activeIndex === $index ? 'active' : ''"> <span class="tag-wrapper" v-for="(item,$index) in activeListL" :key="$index" :class="activeIndex === $index ? 'active' : ''">
<span class="tag-text">{{item}}</span> <span class="tag-text">{{item}}</span>
<em class="remove-tag el-icon-close" @click.stop="_del($index)" v-if="!disabled"></em> <em class="remove-tag el-icon-close" @click.stop="_del($index)" v-if="!disabled"></em>
</span> </span>
@ -74,6 +74,7 @@
tagModel: false, tagModel: false,
email: '', email: '',
activeIndex: null, activeIndex: null,
activeListL: _.cloneDeep(this.activeList),
emailList: [], emailList: [],
index: 0, index: 0,
emailWidth: 100, emailWidth: 100,
@ -100,18 +101,18 @@
if (this.email === '') { if (this.email === '') {
return true return true
} }
this.email = _.trim(this.email).replace(/(;$)|(;$)/g, "") this.email = _.trim(this.email).replace(/(;$)|(;$)/g, '')
let email = this.email let email = this.email
let is = (n) => { let is = (n) => {
return _.some(_.cloneDeep(this.repeatData).concat(_.cloneDeep(this.activeList)), v => v === n) return _.some(_.cloneDeep(this.repeatData).concat(_.cloneDeep(this.activeListL)), v => v === n)
} }
if (isEmial(email)) { if (isEmial(email)) {
if (!is(email)) { if (!is(email)) {
this.emailWidth = 0 this.emailWidth = 0
this.activeList.push(email) this.activeListL.push(email)
this.email = '' this.email = ''
this._handlerEmailWitch() this._handlerEmailWitch()
return true return true
@ -132,7 +133,7 @@
this.emailList = [] this.emailList = []
this.isEmail = false this.isEmail = false
} else { } else {
let a = _.cloneDeep(this.repeatData).concat(_.cloneDeep(this.activeList)) let a = _.cloneDeep(this.repeatData).concat(_.cloneDeep(this.activeListL))
let b = a.concat(emailList) let b = a.concat(emailList)
let list = fuzzyQuery(b, val) let list = fuzzyQuery(b, val)
this.emailList = _.uniqWith(list.length && list, _.isEqual) this.emailList = _.uniqWith(list.length && list, _.isEqual)
@ -161,11 +162,11 @@
if (!this.isCn) { if (!this.isCn) {
this.emailWidth = 0 this.emailWidth = 0
if (_.isInteger(this.activeIndex)) { if (_.isInteger(this.activeIndex)) {
this.activeList.pop() this.activeListL.pop()
this.activeIndex = null this.activeIndex = null
} else { } else {
if (!this.email) { if (!this.email) {
this.activeIndex = this.activeList.length - 1 this.activeIndex = this.activeListL.length - 1
} }
} }
this._handlerEmailWitch() this._handlerEmailWitch()
@ -176,7 +177,7 @@
*/ */
_del (i) { _del (i) {
this.emailWidth = 0 this.emailWidth = 0
this.activeList.splice(i, 1) this.activeListL.splice(i, 1)
this._handlerEmailWitch() this._handlerEmailWitch()
}, },
/** /**
@ -221,14 +222,14 @@
this.email = '' this.email = ''
// Non-existing data // Non-existing data
if (_.filter(_.cloneDeep(this.repeatData).concat(_.cloneDeep(this.activeList)), v => v === item).length) { if (_.filter(_.cloneDeep(this.repeatData).concat(_.cloneDeep(this.activeListL)), v => v === item).length) {
this.$message.warning(`${i18n.$t('Mailbox already exists! Recipients and copyers cannot repeat')}`) this.$message.warning(`${i18n.$t('Mailbox already exists! Recipients and copyers cannot repeat')}`)
return return
} }
// Width initialization // Width initialization
this.emailWidth = 0 this.emailWidth = 0
// Insert data // Insert data
this.activeList.push(item) this.activeListL.push(item)
// Calculated width // Calculated width
this._handlerEmailWitch() this._handlerEmailWitch()
// Check mailbox index initialization // Check mailbox index initialization
@ -264,7 +265,12 @@
this.activeIndex = null this.activeIndex = null
}, },
activeList (val) { activeList (val) {
this.$emit('valueEvent', val) this.activeListL = _.cloneDeep(val)
},
activeListL (val) {
if (!_.isEqual(val, this.activeList)) {
this.$emit('valueEvent', val)
}
} }
}, },
created () { created () {

71
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/list.vue

@ -190,8 +190,8 @@
...mapActions('dag', ['editProcessState', 'getStartCheck', 'getReceiver', 'deleteDefinition', 'batchDeleteDefinition', 'exportDefinition', 'getProcessDefinitionVersionsPage', 'copyProcess', 'switchProcessDefinitionVersion', 'deleteProcessDefinitionVersion', 'moveProcess']), ...mapActions('dag', ['editProcessState', 'getStartCheck', 'getReceiver', 'deleteDefinition', 'batchDeleteDefinition', 'exportDefinition', 'getProcessDefinitionVersionsPage', 'copyProcess', 'switchProcessDefinitionVersion', 'deleteProcessDefinitionVersion', 'moveProcess']),
...mapActions('security', ['getWorkerGroupsAll']), ...mapActions('security', ['getWorkerGroupsAll']),
selectable(row,index) { selectable (row, index) {
if(row.releaseState === 'ONLINE') { if (row.releaseState === 'ONLINE') {
return false return false
} else { } else {
return true return true
@ -209,8 +209,8 @@
_start (item) { _start (item) {
this.getWorkerGroupsAll() this.getWorkerGroupsAll()
this.getStartCheck({ processDefinitionId: item.id }).then(res => { this.getStartCheck({ processDefinitionId: item.id }).then(res => {
this.startData = item this.startData = item
this.startDialog = true this.startDialog = true
}).catch(e => { }).catch(e => {
this.$message.error(e.msg || '') this.$message.error(e.msg || '')
}) })
@ -239,11 +239,10 @@
* timing * timing
*/ */
_timing (item) { _timing (item) {
let self = this
this._getReceiver(item.id).then(res => { this._getReceiver(item.id).then(res => {
this.timingData.item = item, this.timingData.item = item
this.timingData.receiversD = res.receivers, this.timingData.receiversD = res.receivers
this.timingData.receiversCcD = res.receiversCc, this.timingData.receiversCcD = res.receiversCc
this.timingData.type = 'timing' this.timingData.type = 'timing'
this.timingDialog = true this.timingDialog = true
}) })
@ -353,11 +352,11 @@
* @param processDefinitionId the process definition id * @param processDefinitionId the process definition id
* @param fromThis fromThis * @param fromThis fromThis
*/ */
mVersionSwitchProcessDefinitionVersion({ version, processDefinitionId, fromThis }) { mVersionSwitchProcessDefinitionVersion ({ version, processDefinitionId, fromThis }) {
this.switchProcessDefinitionVersion({ this.switchProcessDefinitionVersion({
version: version, version: version,
processDefinitionId: processDefinitionId processDefinitionId: processDefinitionId
}).then(res=>{ }).then(res => {
this.$message.success($t('Switch Version Successfully')) this.$message.success($t('Switch Version Successfully'))
this.$router.push({ path: `/projects/definition/list/${processDefinitionId}` }) this.$router.push({ path: `/projects/definition/list/${processDefinitionId}` })
}).catch(e => { }).catch(e => {
@ -372,19 +371,19 @@
* @param processDefinitionId the process definition id of page version * @param processDefinitionId the process definition id of page version
* @param fromThis fromThis * @param fromThis fromThis
*/ */
mVersionGetProcessDefinitionVersionsPage({ pageNo, pageSize, processDefinitionId, fromThis }) { mVersionGetProcessDefinitionVersionsPage ({ pageNo, pageSize, processDefinitionId, fromThis }) {
this.getProcessDefinitionVersionsPage({ this.getProcessDefinitionVersionsPage({
pageNo: pageNo, pageNo: pageNo,
pageSize: pageSize, pageSize: pageSize,
processDefinitionId: processDefinitionId processDefinitionId: processDefinitionId
}).then(res=>{ }).then(res => {
this.versionData.processDefinitionVersions = res.data.lists this.versionData.processDefinitionVersions = res.data.lists
this.versionData.total = res.data.totalCount this.versionData.total = res.data.totalCount
this.versionData.pageSize = res.data.pageSize this.versionData.pageSize = res.data.pageSize
this.versionData.pageNo = res.data.currentPage this.versionData.pageNo = res.data.currentPage
}).catch(e=>{ }).catch(e => {
this.$message.error(e.msg || '') this.$message.error(e.msg || '')
}) })
}, },
/** /**
* delete one version of process definition * delete one version of process definition
@ -393,11 +392,11 @@
* @param processDefinitionId the process definition id user want to delete * @param processDefinitionId the process definition id user want to delete
* @param fromThis fromThis * @param fromThis fromThis
*/ */
mVersionDeleteProcessDefinitionVersion({ version, processDefinitionId, fromThis }) { mVersionDeleteProcessDefinitionVersion ({ version, processDefinitionId, fromThis }) {
this.deleteProcessDefinitionVersion({ this.deleteProcessDefinitionVersion({
version: version, version: version,
processDefinitionId: processDefinitionId processDefinitionId: processDefinitionId
}).then(res=>{ }).then(res => {
this.$message.success(res.msg || '') this.$message.success(res.msg || '')
this.mVersionGetProcessDefinitionVersionsPage({ this.mVersionGetProcessDefinitionVersionsPage({
pageNo: 1, pageNo: 1,
@ -410,7 +409,6 @@
}) })
}, },
_version (item) { _version (item) {
let self = this
this.getProcessDefinitionVersionsPage({ this.getProcessDefinitionVersionsPage({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
@ -420,14 +418,13 @@
let total = res.data.totalCount let total = res.data.totalCount
let pageSize = res.data.pageSize let pageSize = res.data.pageSize
let pageNo = res.data.currentPage let pageNo = res.data.currentPage
this.versionData.processDefinition = item, this.versionData.processDefinition = item
this.versionData.processDefinitionVersions = processDefinitionVersions, this.versionData.processDefinitionVersions = processDefinitionVersions
this.versionData.total = total, this.versionData.total = total
this.versionData.pageNo = pageNo, this.versionData.pageNo = pageNo
this.versionData.pageSize = pageSize this.versionData.pageSize = pageSize
this.drawer = true this.drawer = true
}).catch(e => { }).catch(e => {
this.$message.error(e.msg || '') this.$message.error(e.msg || '')
}) })
@ -436,7 +433,7 @@
_batchExport () { _batchExport () {
this.exportDefinition({ this.exportDefinition({
processDefinitionIds: this.strSelectIds, processDefinitionIds: this.strSelectIds,
fileName: "process_"+new Date().getTime() fileName: 'process_' + new Date().getTime()
}).then(res => { }).then(res => {
this._onUpdate() this._onUpdate()
this.checkAll = false this.checkAll = false
@ -451,11 +448,11 @@
* Batch Copy * Batch Copy
*/ */
_batchCopy () { _batchCopy () {
this.relatedItemsDialog= true this.relatedItemsDialog = true
this.tmp = false this.tmp = false
}, },
onBatchCopy (item) { onBatchCopy (item) {
this._copyProcess({id: this.strSelectIds,projectId: item}) this._copyProcess({ id: this.strSelectIds, projectId: item })
this.relatedItemsDialog = false this.relatedItemsDialog = false
}, },
closeRelatedItems () { closeRelatedItems () {
@ -464,12 +461,12 @@
/** /**
* _batchMove * _batchMove
*/ */
_batchMove() { _batchMove () {
this.tmp = true this.tmp = true
this.relatedItemsDialog = true this.relatedItemsDialog = true
}, },
onBatchMove (item) { onBatchMove (item) {
this._moveProcess({id: this.strSelectIds,projectId: item}) this._moveProcess({ id: this.strSelectIds, projectId: item })
this.relatedItemsDialog = false this.relatedItemsDialog = false
}, },
/** /**
@ -492,7 +489,7 @@
*/ */
_arrDelChange (v) { _arrDelChange (v) {
let arr = [] let arr = []
arr = _.map(v, 'id'); arr = _.map(v, 'id')
this.strSelectIds = _.join(arr, ',') this.strSelectIds = _.join(arr, ',')
}, },
/** /**

37
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/relatedItems.vue

@ -40,7 +40,6 @@
</m-popup> </m-popup>
</template> </template>
<script> <script>
import _ from 'lodash'
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import store from '@/conf/home/store' import store from '@/conf/home/store'
import mPopup from '@/module/components/popup/popup' import mPopup from '@/module/components/popup/popup'
@ -56,39 +55,39 @@
} }
}, },
props: { props: {
tmp: Boolean tmp: Boolean
}, },
methods: { methods: {
_ok () { _ok () {
if(this._verification()) { if (this._verification()) {
if(this.tmp) { if (this.tmp) {
this.$emit('onBatchMove',this.itemId) this.$emit('onBatchMove', this.itemId)
} else { } else {
this.$emit('onBatchCopy',this.itemId) this.$emit('onBatchCopy', this.itemId)
} }
} }
}, },
_verification() { _verification () {
if(!this.itemId) { if (!this.itemId) {
this.$message.warning(`${i18n.$t('Project name is required')}`) this.$message.warning(`${i18n.$t('Project name is required')}`)
return false return false
} }
return true return true
} }
}, },
watch: { watch: {
}, },
created () { created () {
this.store.dispatch('dag/getAllItems', {}).then(res => { this.store.dispatch('dag/getAllItems', {}).then(res => {
if(res.data.length> 0) { if (res.data.length > 0) {
this.itemList = res.data this.itemList = res.data
} }
}) })
}, },
mounted () { mounted () {
}, },
components: { mPopup, mListBoxF } components: { mPopup, mListBoxF }
} }
</script> </script>

15
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/start.vue

@ -85,7 +85,7 @@
style="width: 200px;" style="width: 200px;"
size="small" size="small"
v-model="warningGroupId" v-model="warningGroupId"
:disabled="!notifyGroupList.length"> :disabled="!notifyGroupList.length">
<el-input slot="trigger" slot-scope="{ selectedModel }" readonly :placeholder="$t('Please select a notification group')" size="small" :value="selectedModel ? selectedModel.label : ''" style="width: 200px;" @on-click-icon.stop="warningGroupId = ''"> <el-input slot="trigger" slot-scope="{ selectedModel }" readonly :placeholder="$t('Please select a notification group')" size="small" :value="selectedModel ? selectedModel.label : ''" style="width: 200px;" @on-click-icon.stop="warningGroupId = ''">
<em slot="suffix" class="el-icon-error" style="font-size: 15px;cursor: pointer;" v-show="warningGroupId"></em> <em slot="suffix" class="el-icon-error" style="font-size: 15px;cursor: pointer;" v-show="warningGroupId"></em>
<em slot="suffix" class="el-icon-bottom" style="font-size: 12px;" v-show="!warningGroupId"></em> <em slot="suffix" class="el-icon-bottom" style="font-size: 12px;" v-show="!warningGroupId"></em>
@ -163,7 +163,6 @@
</div> </div>
</template> </template>
<script> <script>
import _ from 'lodash'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import mEmail from './email.vue' import mEmail from './email.vue'
import store from '@/conf/home/store' import store from '@/conf/home/store'
@ -214,7 +213,7 @@
scheduleTime: this.scheduleTime.length && this.scheduleTime.join(',') || '', scheduleTime: this.scheduleTime.length && this.scheduleTime.join(',') || '',
failureStrategy: this.failureStrategy, failureStrategy: this.failureStrategy,
warningType: this.warningType, warningType: this.warningType,
warningGroupId: this.warningGroupId=='' ? 0 : this.warningGroupId, warningGroupId: this.warningGroupId === '' ? 0 : this.warningGroupId,
execType: this.execType ? 'COMPLEMENT_DATA' : null, execType: this.execType ? 'COMPLEMENT_DATA' : null,
startNodeList: this.startNodeList, startNodeList: this.startNodeList,
taskDependType: this.taskDependType, taskDependType: this.taskDependType,
@ -242,10 +241,10 @@
}, },
_getNotifyGroupList () { _getNotifyGroupList () {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.store.dispatch('dag/getNotifyGroupList').then(res => { this.store.dispatch('dag/getNotifyGroupList').then(res => {
this.notifyGroupList = res this.notifyGroupList = res
resolve() resolve()
}) })
}) })
}, },
_getReceiver () { _getReceiver () {
@ -277,7 +276,7 @@
} else { } else {
this.store.dispatch('security/getWorkerGroupsAll').then(res => { this.store.dispatch('security/getWorkerGroupsAll').then(res => {
this.$nextTick(() => { this.$nextTick(() => {
if(res.length>0) { if (res.length > 0) {
this.workerGroup = res[0].id this.workerGroup = res[0].id
} }
}) })

77
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/timing.vue

@ -228,7 +228,7 @@
failureStrategy: this.failureStrategy, failureStrategy: this.failureStrategy,
warningType: this.warningType, warningType: this.warningType,
processInstancePriority: this.processInstancePriority, processInstancePriority: this.processInstancePriority,
warningGroupId: this.warningGroupId =='' ? 0 : this.warningGroupId, warningGroupId: this.warningGroupId === '' ? 0 : this.warningGroupId,
receivers: this.receivers.join(',') || '', receivers: this.receivers.join(',') || '',
receiversCc: this.receiversCc.join(',') || '', receiversCc: this.receiversCc.join(',') || '',
workerGroup: this.workerGroup workerGroup: this.workerGroup
@ -256,37 +256,36 @@
}, },
_preview () { _preview () {
if (this._verification()) { if (this._verification()) {
let api = 'dag/previewSchedule' let api = 'dag/previewSchedule'
let searchParams = { let searchParams = {
schedule: JSON.stringify({ schedule: JSON.stringify({
startTime: this.scheduleTime[0], startTime: this.scheduleTime[0],
endTime: this.scheduleTime[1], endTime: this.scheduleTime[1],
crontab: this.crontab crontab: this.crontab
}) })
} }
let msg = ''
this.store.dispatch(api, searchParams).then(res => { this.store.dispatch(api, searchParams).then(res => {
if (res.length) { if (res.length) {
this.previewTimes = res this.previewTimes = res
} else { } else {
this.$message.warning(`${i18n.$t('There is no data for this period of time')}`) this.$message.warning(`${i18n.$t('There is no data for this period of time')}`)
} }
}) })
} }
}, },
_getNotifyGroupList () { _getNotifyGroupList () {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
this.store.dispatch('dag/getNotifyGroupList').then(res => { this.store.dispatch('dag/getNotifyGroupList').then(res => {
this.notifyGroupList = res this.notifyGroupList = res
if (this.notifyGroupList.length) { if (this.notifyGroupList.length) {
resolve() resolve()
} else { } else {
reject(new Error(0)) reject(new Error(0))
} }
}) })
}) })
}, },
ok () { ok () {
@ -302,7 +301,7 @@
watch: { watch: {
}, },
created () { created () {
if(this.timingData.item.workerGroup===undefined) { if (this.timingData.item.workerGroup === undefined) {
let stateWorkerGroupsList = this.store.state.security.workerGroupsListAll || [] let stateWorkerGroupsList = this.store.state.security.workerGroupsListAll || []
if (stateWorkerGroupsList.length) { if (stateWorkerGroupsList.length) {
this.workerGroup = stateWorkerGroupsList[0].id this.workerGroup = stateWorkerGroupsList[0].id
@ -316,22 +315,22 @@
} else { } else {
this.workerGroup = this.timingData.item.workerGroup this.workerGroup = this.timingData.item.workerGroup
} }
if(this.timingData.item.crontab !== null){ if (this.timingData.item.crontab !== null) {
this.crontab = this.timingData.item.crontab this.crontab = this.timingData.item.crontab
} }
if(this.timingData.type == 'timing') { if (this.timingData.type === 'timing') {
let date = new Date() let date = new Date()
let year = date.getFullYear() let year = date.getFullYear()
let month = date.getMonth() + 1 let month = date.getMonth() + 1
let day = date.getDate() let day = date.getDate()
if (month < 10) { if (month < 10) {
month = "0" + month; month = '0' + month
} }
if (day < 10) { if (day < 10) {
day = "0" + day; day = '0' + day
} }
let startDate = year + "-" + month + "-" + day + ' ' + '00:00:00' let startDate = year + '-' + month + '-' + day + ' ' + '00:00:00'
let endDate = (year+100) + "-" + month + "-" + day + ' ' + '00:00:00' let endDate = (year + 100) + '-' + month + '-' + day + ' ' + '00:00:00'
let times = [] let times = []
times[0] = startDate times[0] = startDate
times[1] = endDate times[1] = endDate
@ -355,13 +354,13 @@
// let list = _.filter(this.notifyGroupList, v => v.id === item.warningGroupId) // let list = _.filter(this.notifyGroupList, v => v.id === item.warningGroupId)
this.warningGroupId = item.warningGroupId this.warningGroupId = item.warningGroupId
}) })
}).catch(() => this.warningGroupId = '') }).catch(() => { this.warningGroupId = '' })
} else { } else {
this._getNotifyGroupList().then(() => { this._getNotifyGroupList().then(() => {
this.$nextTick(() => { this.$nextTick(() => {
this.warningGroupId = '' this.warningGroupId = ''
}) })
}).catch(() => this.warningGroupId = '') }).catch(() => { this.warningGroupId = '' })
} }
}, },
components: { vCrontab, mEmail, mPriority, mWorkerGroups } components: { vCrontab, mEmail, mPriority, mWorkerGroups }
@ -419,10 +418,10 @@
} }
} }
.x-date-packer-panel .x-date-packer-day .lattice label.bg-hover { .x-date-packer-panel .x-date-packer-day .lattice label.bg-hover {
background: #00BFFF!important; background: #00BFFF!important;
margin-top: -4px; margin-top: -4px;
} }
.x-date-packer-panel .x-date-packer-day .lattice em:hover { .x-date-packer-panel .x-date-packer-day .lattice em:hover {
background: #0098e1!important; background: #0098e1!important;
} }
</style> </style>

17
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/index.vue

@ -58,7 +58,6 @@
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import listUrlParamHandle from '@/module/mixin/listUrlParamHandle' import listUrlParamHandle from '@/module/mixin/listUrlParamHandle'
import mConditions from '@/module/components/conditions/conditions' import mConditions from '@/module/components/conditions/conditions'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
import { findComponentDownward } from '@/module/util/' import { findComponentDownward } from '@/module/util/'
@ -109,15 +108,15 @@
* get data list * get data list
*/ */
_getList (flag) { _getList (flag) {
if(sessionStorage.getItem('isLeft')==0) { if (sessionStorage.getItem('isLeft') === 0) {
this.isLeft = false this.isLeft = false
} else { } else {
this.isLeft = true this.isLeft = true
} }
this.isLoading = !flag this.isLoading = !flag
this.getProcessListP(this.searchParams).then(res => { this.getProcessListP(this.searchParams).then(res => {
if(this.searchParams.pageNo>1 && res.totalList.length == 0) { if (this.searchParams.pageNo > 1 && res.totalList.length === 0) {
this.searchParams.pageNo = this.searchParams.pageNo -1 this.searchParams.pageNo = this.searchParams.pageNo - 1
} else { } else {
this.processListP = [] this.processListP = []
this.processListP = res.totalList this.processListP = res.totalList
@ -146,13 +145,13 @@
created () { created () {
localStore.removeItem('subProcessId') localStore.removeItem('subProcessId')
}, },
mounted() { mounted () {
}, },
beforeDestroy () { beforeDestroy () {
sessionStorage.setItem('isLeft',1) sessionStorage.setItem('isLeft', 1)
}, },
components: { mList, mConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData } components: { mList, mConditions, mSpin, mListConstruction, mNoData }
} }
</script> </script>
@ -185,4 +184,4 @@
} }
} }
} }
</style> </style>

6
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/tree/index.vue

@ -82,7 +82,6 @@
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import { tasksType, tasksState } from '@/conf/home/pages/dag/_source/config' import { tasksType, tasksState } from '@/conf/home/pages/dag/_source/config'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default { export default {
@ -106,7 +105,7 @@
props: {}, props: {},
methods: { methods: {
...mapActions('dag', ['getViewTree']), ...mapActions('dag', ['getViewTree']),
_close(){ _close () {
this.$router.go(-1) this.$router.go(-1)
}, },
/** /**
@ -203,7 +202,7 @@
}, },
mounted () { mounted () {
}, },
components: { mSpin, mSecondaryMenu, mListConstruction, mNoData } components: { mSpin, mListConstruction, mNoData }
} }
</script> </script>
@ -265,5 +264,4 @@
} }
} }
</style> </style>

4
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue

@ -133,7 +133,7 @@
props: { props: {
}, },
methods: { methods: {
...mapActions('dag', ['getScheduleList', 'scheduleOffline', 'scheduleOnline', 'getReceiver','deleteTiming']), ...mapActions('dag', ['getScheduleList', 'scheduleOffline', 'scheduleOnline', 'getReceiver', 'deleteTiming']),
/** /**
* delete * delete
*/ */
@ -260,7 +260,7 @@
}, },
closeTiming () { closeTiming () {
this.timingDialog = false this.timingDialog = false
}, }
}, },
watch: {}, watch: {},
created () { created () {

7
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/index.vue

@ -28,15 +28,14 @@
</template> </template>
<script> <script>
import mList from './_source/list' import mList from './_source/list'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default { export default {
name: 'definition-timing-index', name: 'definition-timing-index',
methods :{ methods: {
_close(){ _close () {
this.$router.go(-1) this.$router.go(-1)
} }
}, },
components: { mList, mListConstruction, mSecondaryMenu } components: { mList, mListConstruction }
} }
</script> </script>

4
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/commandStateCount.vue

@ -70,7 +70,7 @@
}, },
watch: { watch: {
'searchParams': { searchParams: {
deep: true, deep: true,
immediate: true, immediate: true,
handler (o) { handler (o) {
@ -91,4 +91,4 @@
computed: {}, computed: {},
components: { mNoData } components: { mNoData }
} }
</script> </script>

6
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/defineUserCount.vue

@ -38,7 +38,7 @@
return { return {
isSpin: true, isSpin: true,
msg: true, msg: true,
parameter: {projectId: 0} parameter: { projectId: 0 }
} }
}, },
props: { props: {
@ -71,9 +71,9 @@
}, },
created () { created () {
this.isSpin = true this.isSpin = true
this.parameter.projectId = this.projectId; this.parameter.projectId = this.projectId
this.getDefineUserCount(this.parameter).then(res => { this.getDefineUserCount(this.parameter).then(res => {
this.msg = res.data.count > 0 ? true : false this.msg = res.data.count > 0
this.defineUserList = [] this.defineUserList = []
this._handleDefineUser(res) this._handleDefineUser(res)
this.isSpin = false this.isSpin = false

11
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/processStateCount.vue

@ -53,7 +53,6 @@
import { pie } from './chartConfig' import { pie } from './chartConfig'
import Chart from '@/module/ana-charts' import Chart from '@/module/ana-charts'
import echarts from 'echarts' import echarts from 'echarts'
import store from '@/conf/home/store'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import { stateType } from '@/conf/home/pages/projects/pages/_source/conditions/instance/common' import { stateType } from '@/conf/home/pages/projects/pages/_source/conditions/instance/common'
export default { export default {
@ -75,7 +74,7 @@
this.$router.push({ this.$router.push({
name: 'projects-instance-list', name: 'projects-instance-list',
query: { query: {
stateType: _.find(stateType, ['label', name])['code'], stateType: _.find(stateType, ['label', name]).code,
startDate: this.searchParams.startDate, startDate: this.searchParams.startDate,
endDate: this.searchParams.endDate endDate: this.searchParams.endDate
} }
@ -85,11 +84,11 @@
let data = res.data.taskCountDtos let data = res.data.taskCountDtos
this.processStateList = _.map(data, v => { this.processStateList = _.map(data, v => {
return { return {
key: _.find(stateType, ['code', v.taskStateType])['label'], key: _.find(stateType, ['code', v.taskStateType]).label,
value: v.count value: v.count
} }
}) })
const myChart = Chart.pie('#process-state-pie', this.processStateList, { title: '' }) const myChart = Chart.pie('#process-state-pie', this.processStateList, { title: '' })
myChart.echart.setOption(pie) myChart.echart.setOption(pie)
// //
if (this.searchParams.projectId) { if (this.searchParams.projectId) {
@ -100,7 +99,7 @@
} }
}, },
watch: { watch: {
'searchParams': { searchParams: {
deep: true, deep: true,
immediate: true, immediate: true,
handler (o) { handler (o) {
@ -115,7 +114,7 @@
}) })
} }
}, },
'$store.state.projects.sideBar': function() { '$store.state.projects.sideBar': function () {
echarts.init(document.getElementById('process-state-pie')).resize() echarts.init(document.getElementById('process-state-pie')).resize()
} }
}, },

6
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/queueCount.vue

@ -29,7 +29,7 @@
<th>{{$t('Number')}}</th> <th>{{$t('Number')}}</th>
<th>{{$t('State')}}</th> <th>{{$t('State')}}</th>
</tr> </tr>
<tr v-for="(item,$index) in queueList"> <tr :key="$index" v-for="(item,$index) in queueList">
<td><span>{{$index+1}}</span></td> <td><span>{{$index+1}}</span></td>
<td><span><a href="javascript:" >{{item.value}}</a></span></td> <td><span><a href="javascript:" >{{item.value}}</a></span></td>
<td><span class="ellipsis" style="width: 98%;" :title="item.key">{{item.key}}</span></td> <td><span class="ellipsis" style="width: 98%;" :title="item.key">{{item.key}}</span></td>
@ -76,7 +76,7 @@
} }
}, },
watch: { watch: {
'searchParams': { searchParams: {
deep: true, deep: true,
immediate: true, immediate: true,
handler (o) { handler (o) {
@ -98,4 +98,4 @@
}, },
components: { mNoData } components: { mNoData }
} }
</script> </script>

150
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskCtatusCount.vue

@ -1,150 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on 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.
*/
<template>
<div class="task-ctatus-count-model">
<div v-show="!msg">
<div class="data-area" v-spin="isSpin" style="height: 430px;">
<div class="col-md-7">
<div id="task-status-pie" style="width:100%;height:260px;margin-top: 100px;"></div>
</div>
<div class="col-md-5">
<div class="table-small-model">
<table>
<tr>
<th width="40">{{$t('#')}}</th>
<th>{{$t('Number')}}</th>
<th>{{$t('State')}}</th>
</tr>
<tr v-for="(item,$index) in taskCtatusList" :key="$index">
<td><span>{{$index+1}}</span></td>
<td>
<a v-if="currentName === 'home'" style="cursor: default">{{item.value}}</a>
<span v-else>
<a href="javascript:" @click="searchParams.projectId && _goTask(item.key)">{{item.value}}</a>
</span>
</td>
<td><span class="ellipsis" style="width: 98%;" :title="item.key">{{item.key}}</span></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div v-show="msg">
<m-no-data :msg="msg" v-if="msg" :height="430"></m-no-data>
</div>
</div>
</template>
<script>
import _ from 'lodash'
import { mapActions } from 'vuex'
import { pie } from './chartConfig'
import Chart from '@/module/ana-charts'
import echarts from 'echarts'
import store from '@/conf/home/store'
import mNoData from '@/module/components/noData/noData'
import { stateType } from '@/conf/home/pages/projects/pages/_source/conditions/instance/common'
export default {
name: 'task-ctatus-count',
data () {
return {
isSpin: true,
msg: '',
taskCtatusList: [],
currentName: ''
}
},
props: {
searchParams: Object
},
methods: {
...mapActions('projects', ['getTaskCtatusCount']),
_goTask (name) {
this.$router.push({
name: 'task-instance',
query: {
stateType: _.find(stateType, ['label', name])['code'],
startDate: this.searchParams.startDate,
endDate: this.searchParams.endDate
}
})
},
_handleTaskCtatus (res) {
let data = res.data.taskCountDtos
this.taskCtatusList = _.map(data, v => {
return {
key: _.find(stateType, ['code', v.taskStateType])['label'],
value: v.count,
type: 'type'
}
})
const myChart = Chart.pie('#task-status-pie', this.taskCtatusList, { title: '' })
myChart.echart.setOption(pie)
//
if (this.searchParams.projectId) {
myChart.echart.on('click', e => {
this._goTask(e.data.name)
})
}
}
},
watch: {
'searchParams': {
deep: true,
immediate: true,
handler (o) {
this.isSpin = true
this.getTaskCtatusCount(o).then(res => {
this.taskCtatusList = []
this._handleTaskCtatus(res)
this.isSpin = false
}).catch(e => {
this.msg = e.msg || 'error'
this.isSpin = false
})
}
},
'$store.state.projects.sideBar': function() {
echarts.init(document.getElementById('task-status-pie')).resize()
}
},
beforeCreate () {
},
created () {
this.currentName = this.$router.currentRoute.name
},
beforeMount () {
},
mounted () {
},
beforeUpdate () {
},
updated () {
},
beforeDestroy () {
},
destroyed () {
},
computed: {},
components: { mNoData }
}
</script>
<style lang="scss" rel="stylesheet/scss">
</style>

6
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskStatusCount.vue

@ -74,7 +74,7 @@
this.$router.push({ this.$router.push({
name: 'task-instance', name: 'task-instance',
query: { query: {
stateType: _.find(stateType, ['label', name])['code'], stateType: _.find(stateType, ['label', name]).code,
startDate: this.searchParams.startDate, startDate: this.searchParams.startDate,
endDate: this.searchParams.endDate endDate: this.searchParams.endDate
} }
@ -85,7 +85,7 @@
this.taskStatusList = _.map(data, v => { this.taskStatusList = _.map(data, v => {
return { return {
// CHECK!! // CHECK!!
key: _.find(stateType, ['code', v.taskStateType])['label'], key: _.find(stateType, ['code', v.taskStateType]).label,
value: v.count, value: v.count,
type: 'type' type: 'type'
} }
@ -102,7 +102,7 @@
} }
}, },
watch: { watch: {
'searchParams': { searchParams: {
deep: true, deep: true,
immediate: true, immediate: true,
handler (o) { handler (o) {

10
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/index.vue

@ -68,12 +68,9 @@
<script> <script>
import dayjs from 'dayjs' import dayjs from 'dayjs'
import mDefineUserCount from './_source/defineUserCount' import mDefineUserCount from './_source/defineUserCount'
import mCommandStateCount from './_source/commandStateCount'
import mTaskStatusCount from './_source/taskStatusCount' import mTaskStatusCount from './_source/taskStatusCount'
import mProcessStateCount from './_source/processStateCount' import mProcessStateCount from './_source/processStateCount'
import mQueueCount from './_source/queueCount'
import localStore from '@/module/util/localStorage' import localStore from '@/module/util/localStorage'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default { export default {
@ -85,7 +82,7 @@
startDate: '', startDate: '',
endDate: '' endDate: ''
}, },
dataTime: [], dataTime: []
} }
}, },
props: { props: {
@ -103,13 +100,10 @@
this.dataTime[1] = dayjs().format('YYYY-MM-DD HH:mm:ss') this.dataTime[1] = dayjs().format('YYYY-MM-DD HH:mm:ss')
}, },
components: { components: {
mSecondaryMenu,
mListConstruction, mListConstruction,
mDefineUserCount, mDefineUserCount,
mCommandStateCount,
mTaskStatusCount, mTaskStatusCount,
mProcessStateCount, mProcessStateCount
mQueueCount
} }
} }
</script> </script>

2
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/index.vue

@ -21,4 +21,4 @@
export default { export default {
name: 'process-instance-index' name: 'process-instance-index'
} }
</script> </script>

5
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/details/index.vue

@ -18,13 +18,12 @@
<m-instance-details></m-instance-details> <m-instance-details></m-instance-details>
</template> </template>
<script> <script>
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
import mInstanceDetails from '@/conf/home/pages/dag/instanceDetails.vue' import mInstanceDetails from '@/conf/home/pages/dag/instanceDetails.vue'
export default { export default {
name: 'instance-details-index', name: 'instance-details-index',
data () { data () {
return {} return {}
}, },
components: { mInstanceDetails, mSecondaryMenu } components: { mInstanceDetails }
} }
</script> </script>

4
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/gantt/index.vue

@ -47,8 +47,6 @@
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import { tasksState } from '@/conf/home/pages/dag/_source/config' import { tasksState } from '@/conf/home/pages/dag/_source/config'
import mConditions from '@/module/components/conditions/conditions'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default { export default {
@ -111,7 +109,7 @@
destroyed () { destroyed () {
}, },
computed: {}, computed: {},
components: { mConditions, mSecondaryMenu, mListConstruction, mSpin, mNoData } components: { mListConstruction, mSpin, mNoData }
} }
</script> </script>

12
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue

@ -78,7 +78,7 @@
</span> </span>
</el-tooltip> </el-tooltip>
<el-tooltip :content="scope.row.state === 'STOP' ? $t('Recovery Suspend') : $t('Stop')" placement="top" :enterable="false"> <el-tooltip :content="scope.row.state === 'STOP' ? $t('Recovery Suspend') : $t('Stop')" placement="top" :enterable="false">
<span><el-button type="warning" size="mini" :disabled="scope.row.state !== 'RUNNING_EXECUTION' && scope.row.state != 'STOP'" :icon="scope.row.state === 'STOP' ? 'el-icon-video-play' : 'el-icon-close'" @click="_stop(scope.row,scope.$index)" circle></el-button></span> <span><el-button type="warning" size="mini" :disabled="scope.row.state !== 'RUNNING_EXECUTION' && scope.row.state !== 'STOP'" :icon="scope.row.state === 'STOP' ? 'el-icon-video-play' : 'el-icon-close'" @click="_stop(scope.row,scope.$index)" circle></el-button></span>
</el-tooltip> </el-tooltip>
<el-tooltip :content="scope.row.state === 'PAUSE' ? $t('Recovery Suspend') : $t('Pause')" placement="top" :enterable="false"> <el-tooltip :content="scope.row.state === 'PAUSE' ? $t('Recovery Suspend') : $t('Pause')" placement="top" :enterable="false">
<span><el-button type="error" size="mini" :icon="scope.row.state === 'PAUSE' ? 'el-icon-video-play' : 'el-icon-video-pause'" :disabled="scope.row.state !== 'RUNNING_EXECUTION' && scope.row.state !== 'PAUSE'" @click="_suspend(scope.row,scope.$index)" circle></el-button></span> <span><el-button type="error" size="mini" :icon="scope.row.state === 'PAUSE' ? 'el-icon-video-play' : 'el-icon-video-pause'" :disabled="scope.row.state !== 'RUNNING_EXECUTION' && scope.row.state !== 'PAUSE'" @click="_suspend(scope.row,scope.$index)" circle></el-button></span>
@ -154,7 +154,7 @@
<span> <span>
<el-button <el-button
style="padding: 0 3px" style="padding: 0 3px"
v-show="(scope.row.state === 'PAUSE' || scope.row.state == 'STOP') && buttonType === 'suspend'" v-show="(scope.row.state === 'PAUSE' || scope.row.state === 'STOP') && buttonType === 'suspend'"
type="warning" type="warning"
size="mini" size="mini"
circle circle
@ -162,10 +162,10 @@
{{scope.row.count}} {{scope.row.count}}
</el-button> </el-button>
</span> </span>
<!--Recovery Suspend--> <!--Recovery Suspend-->
<el-button <el-button
v-show="(scope.row.state === 'PAUSE' || scope.row.state == 'STOP') && buttonType !== 'suspend'" v-show="(scope.row.state === 'PAUSE' || scope.row.state === 'STOP') && buttonType !== 'suspend'"
type="warning" type="warning"
size="mini" size="mini"
circle circle
@ -312,7 +312,7 @@
* @param STOP * @param STOP
*/ */
_stop (item, index) { _stop (item, index) {
if(item.state == 'STOP') { if (item.state === 'STOP') {
this._countDownFn({ this._countDownFn({
id: item.id, id: item.id,
executeType: 'RECOVER_SUSPENDED_PROCESS', executeType: 'RECOVER_SUSPENDED_PROCESS',
@ -443,7 +443,7 @@
// }, // },
_arrDelChange (v) { _arrDelChange (v) {
let arr = [] let arr = []
arr = _.map(v, 'id'); arr = _.map(v, 'id')
console.log(arr) console.log(arr)
this.strDelete = _.join(arr, ',') this.strDelete = _.join(arr, ',')
}, },

19
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/index.vue

@ -53,7 +53,6 @@
import localStore from '@/module/util/localStorage' import localStore from '@/module/util/localStorage'
import { setUrlParams } from '@/module/util/routerUtil' import { setUrlParams } from '@/module/util/routerUtil'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
import mInstanceConditions from '@/conf/home/pages/projects/pages/_source/conditions/instance/processInstance' import mInstanceConditions from '@/conf/home/pages/projects/pages/_source/conditions/instance/processInstance'
@ -108,7 +107,7 @@
setUrlParams(this.searchParams) setUrlParams(this.searchParams)
this._debounceGET() this._debounceGET()
}, },
_pageSize(val) { _pageSize (val) {
this.searchParams.pageSize = val this.searchParams.pageSize = val
setUrlParams(this.searchParams) setUrlParams(this.searchParams)
this._debounceGET() this._debounceGET()
@ -119,8 +118,8 @@
_getProcessInstanceListP (flag) { _getProcessInstanceListP (flag) {
this.isLoading = !flag this.isLoading = !flag
this.getProcessInstance(this.searchParams).then(res => { this.getProcessInstance(this.searchParams).then(res => {
if(this.searchParams.pageNo>1 && res.totalList.length == 0) { if (this.searchParams.pageNo > 1 && res.totalList.length === 0) {
this.searchParams.pageNo = this.searchParams.pageNo -1 this.searchParams.pageNo = this.searchParams.pageNo - 1
} else { } else {
this.processInstanceList = [] this.processInstanceList = []
this.processInstanceList = res.totalList this.processInstanceList = res.totalList
@ -148,15 +147,15 @@
* @desc Prevent functions from being called multiple times * @desc Prevent functions from being called multiple times
*/ */
_debounceGET: _.debounce(function (flag) { _debounceGET: _.debounce(function (flag) {
if(sessionStorage.getItem('isLeft')==0) { if (sessionStorage.getItem('isLeft') === 0) {
this.isLeft = false this.isLeft = false
} else { } else {
this.isLeft = true this.isLeft = true
} }
this._getProcessInstanceListP(flag) this._getProcessInstanceListP(flag)
}, 100, { }, 100, {
'leading': false, leading: false,
'trailing': true trailing: true
}) })
}, },
watch: { watch: {
@ -169,7 +168,7 @@
this.searchParams.pageNo = !_.isEmpty(a.query) && a.query.pageNo || 1 this.searchParams.pageNo = !_.isEmpty(a.query) && a.query.pageNo || 1
} }
}, },
'searchParams': { searchParams: {
deep: true, deep: true,
handler () { handler () {
this._debounceGET() this._debounceGET()
@ -199,9 +198,9 @@
beforeDestroy () { beforeDestroy () {
// Destruction wheel // Destruction wheel
clearInterval(this.setIntervalP) clearInterval(this.setIntervalP)
sessionStorage.setItem('isLeft',1) sessionStorage.setItem('isLeft', 1)
}, },
components: { mList, mInstanceConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData } components: { mList, mInstanceConditions, mSpin, mListConstruction, mNoData }
} }
</script> </script>

12
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/_source/graphGrid.vue

@ -19,7 +19,7 @@
</template> </template>
<script> <script>
import echarts from 'echarts' import echarts from 'echarts'
import { mapActions, mapState, mapMutations } from 'vuex' import { mapState } from 'vuex'
import graphGridOption from './graphGridOption' import graphGridOption from './graphGridOption'
export default { export default {
@ -35,7 +35,7 @@
}, },
methods: { methods: {
init () { init () {
}, }
}, },
created () { created () {
}, },
@ -43,14 +43,14 @@
const graphGrid = echarts.init(this.$refs['graph-grid']) const graphGrid = echarts.init(this.$refs['graph-grid'])
graphGrid.setOption(graphGridOption(this.locations, this.connects, this.sourceWorkFlowId, this.isShowLabel), true) graphGrid.setOption(graphGridOption(this.locations, this.connects, this.sourceWorkFlowId, this.isShowLabel), true)
graphGrid.on('click', (params) => { graphGrid.on('click', (params) => {
// Jump to the definition page // Jump to the definition page
this.$router.push({ path: `/projects/definition/list/${params.data.id}`}) this.$router.push({ path: `/projects/definition/list/${params.data.id}` })
}); })
}, },
components: {}, components: {},
computed: { computed: {
...mapState('kinship', ['locations', 'connects', 'sourceWorkFlowId']) ...mapState('kinship', ['locations', 'connects', 'sourceWorkFlowId'])
}, }
} }
</script> </script>

48
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/index.vue

@ -39,7 +39,7 @@
v-tooltip.small.top.start="$t('Reset')" v-tooltip.small.top.start="$t('Reset')"
@click="reset" @click="reset"
></el-button> ></el-button>
<el-button <el-button
icon="el-icon-view" icon="el-icon-view"
size="mini" size="mini"
v-tooltip.small.top="$t('Dag label display control')" v-tooltip.small.top="$t('Dag label display control')"
@ -55,15 +55,11 @@
</div> </div>
</template> </template>
<script> <script>
import _ from 'lodash'
import { mapActions, mapState } from 'vuex' import { mapActions, mapState } from 'vuex'
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import listUrlParamHandle from '@/module/mixin/listUrlParamHandle'
import graphGrid from './_source/graphGrid.vue' import graphGrid from './_source/graphGrid.vue'
export default { export default {
name: 'projects-kinship-index', name: 'projects-kinship-index',
components: { graphGrid, mSpin, mNoData }, components: { graphGrid, mSpin, mNoData },
@ -71,12 +67,12 @@
return { return {
isLoading: true, isLoading: true,
isShowLabel: true, isShowLabel: true,
currentItemName: '', currentItemName: ''
} }
}, },
props: {}, props: {},
methods: { methods: {
...mapActions('kinship', ['getWorkFlowList','getWorkFlowDAG']), ...mapActions('kinship', ['getWorkFlowList', 'getWorkFlowDAG']),
/** /**
* init * init
*/ */
@ -86,7 +82,7 @@
Promise.all([ Promise.all([
// get process definition // get process definition
this.getWorkFlowList(), this.getWorkFlowList(),
this.getWorkFlowDAG(), this.getWorkFlowDAG()
]).then((data) => { ]).then((data) => {
this.isLoading = false this.isLoading = false
}).catch(() => { }).catch(() => {
@ -96,38 +92,38 @@
/** /**
* reset * reset
*/ */
reset() { reset () {
this.isLoading = true; this.isLoading = true
this.$nextTick(() => { this.$nextTick(() => {
this.isLoading = false; this.isLoading = false
}) })
}, },
async onChange(item) { async onChange (item) {
const { value, label } = item || {}; const { value, label } = item || {}
this.isLoading = true; this.isLoading = true
this.currentItemName = label; this.currentItemName = label
try { try {
await this.getWorkFlowDAG(value); await this.getWorkFlowDAG(value)
} catch (error) { } catch (error) {
this.$message.error(error.msg || '') this.$message.error(error.msg || '')
} }
this.isLoading = false; this.isLoading = false
}, },
tooltipOption(text) { tooltipOption (text) {
return { return {
text, text,
maxWidth: '500px', maxWidth: '500px',
placement: 'top', placement: 'top',
theme: 'dark', theme: 'dark',
triggerEvent: 'mouseenter', triggerEvent: 'mouseenter',
large: false, large: false
} }
}, },
changeLabel() { changeLabel () {
this.isLoading = true; this.isLoading = true
this.isShowLabel = !this.isShowLabel; this.isShowLabel = !this.isShowLabel
this.$nextTick(() => { this.$nextTick(() => {
this.isLoading = false; this.isLoading = false
}) })
} }
}, },
@ -142,9 +138,9 @@
}, },
computed: { computed: {
...mapState('kinship', ['locations', 'workList']), ...mapState('kinship', ['locations', 'workList']),
inputFocusStyle() { inputFocusStyle () {
return `width:280px` return 'width:280px'
}, }
}, },
mounted () { mounted () {
} }

8
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/createProject.vue

@ -80,7 +80,7 @@
param.projectId = this.item.id param.projectId = this.item.id
} }
this.$refs['popup'].spinnerLoading = true this.$refs.popup.spinnerLoading = true
this.store.dispatch(`projects/${this.item ? 'updateProjects' : 'createProjects'}`, param).then(res => { this.store.dispatch(`projects/${this.item ? 'updateProjects' : 'createProjects'}`, param).then(res => {
this.$emit('_onUpdate') this.$emit('_onUpdate')
@ -88,13 +88,13 @@
message: res.msg, message: res.msg,
type: 'success', type: 'success',
offset: 70 offset: 70
}); })
setTimeout(() => { setTimeout(() => {
this.$refs['popup'].spinnerLoading = false this.$refs.popup.spinnerLoading = false
}, 800) }, 800)
}).catch(e => { }).catch(e => {
this.$message.error(e.msg || '') this.$message.error(e.msg || '')
this.$refs['popup'].spinnerLoading = false this.$refs.popup.spinnerLoading = false
}) })
}, },
_verification () { _verification () {

4
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/list/_source/list.vue

@ -90,7 +90,7 @@
this.setProjectName(item.name) this.setProjectName(item.name)
localStore.setItem('projectName', `${item.name}`) localStore.setItem('projectName', `${item.name}`)
localStore.setItem('projectId', `${item.id}`) localStore.setItem('projectId', `${item.id}`)
this.$router.push({ path: `/projects/index` }) this.$router.push({ path: '/projects/index' })
}, },
/** /**
* Delete Project * Delete Project
@ -113,7 +113,7 @@
*/ */
_edit (item) { _edit (item) {
findComponentDownward(this.$root, 'projects-list')._create(item) findComponentDownward(this.$root, 'projects-list')._create(item)
}, }
}, },
watch: { watch: {

5
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/list/index.vue

@ -62,7 +62,6 @@
import mConditions from '@/module/components/conditions/conditions' import mConditions from '@/module/components/conditions/conditions'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default { export default {
name: 'projects-list', name: 'projects-list',
data () { data () {
@ -108,8 +107,8 @@
_getList (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
this.getProjectsList(this.searchParams).then(res => { this.getProjectsList(this.searchParams).then(res => {
if(this.searchParams.pageNo>1 && res.totalList.length == 0) { if (this.searchParams.pageNo > 1 && res.totalList.length === 0) {
this.searchParams.pageNo = this.searchParams.pageNo -1 this.searchParams.pageNo = this.searchParams.pageNo - 1
} else { } else {
this.projectsList = [] this.projectsList = []
this.projectsList = res.totalList this.projectsList = res.totalList

6
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/_source/list.vue

@ -122,7 +122,7 @@
}, },
_forceSuccess (item) { _forceSuccess (item) {
this.forceTaskSuccess({taskInstanceId: item.id}).then(res => { this.forceTaskSuccess({ taskInstanceId: item.id }).then(res => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success(res.msg) this.$message.success(res.msg)
} else { } else {
@ -134,7 +134,7 @@
}, },
_go (item) { _go (item) {
this.$router.push({ path: `/projects/instance/list/${item.processInstanceId}` }) this.$router.push({ path: `/projects/instance/list/${item.processInstanceId}` })
}, }
}, },
watch: { watch: {
taskInstanceList (a) { taskInstanceList (a) {
@ -149,6 +149,6 @@
mounted () { mounted () {
this.list = this.taskInstanceList this.list = this.taskInstanceList
}, },
components: { mLog} components: { mLog }
} }
</script> </script>

17
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/index.vue

@ -53,7 +53,6 @@
import mSpin from '@/module/components/spin/spin' import mSpin from '@/module/components/spin/spin'
import mNoData from '@/module/components/noData/noData' import mNoData from '@/module/components/noData/noData'
import listUrlParamHandle from '@/module/mixin/listUrlParamHandle' import listUrlParamHandle from '@/module/mixin/listUrlParamHandle'
import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
import mInstanceConditions from '@/conf/home/pages/projects/pages/_source/conditions/instance/taskInstance' import mInstanceConditions from '@/conf/home/pages/projects/pages/_source/conditions/instance/taskInstance'
@ -106,7 +105,7 @@
_page (val) { _page (val) {
this.searchParams.pageNo = val this.searchParams.pageNo = val
}, },
_pageSize(val) { _pageSize (val) {
this.searchParams.pageSize = val this.searchParams.pageSize = val
}, },
/** /**
@ -114,8 +113,8 @@
*/ */
_getList (flag) { _getList (flag) {
this.isLoading = !flag this.isLoading = !flag
if(this.searchParams.pageNo == undefined) { if (this.searchParams.pageNo === undefined) {
this.$router.push({ path: `/projects/index` }) this.$router.push({ path: '/projects/index' })
return false return false
} }
this.getTaskInstanceList(this.searchParams).then(res => { this.getTaskInstanceList(this.searchParams).then(res => {
@ -132,15 +131,15 @@
* @desc Prevent functions from being called multiple times * @desc Prevent functions from being called multiple times
*/ */
_debounceGET: _.debounce(function (flag) { _debounceGET: _.debounce(function (flag) {
if(sessionStorage.getItem('isLeft')==0) { if (sessionStorage.getItem('isLeft') === 0) {
this.isLeft = false this.isLeft = false
} else { } else {
this.isLeft = true this.isLeft = true
} }
this._getList(flag) this._getList(flag)
}, 100, { }, 100, {
'leading': false, leading: false,
'trailing': true trailing: true
}) })
}, },
watch: { watch: {
@ -164,9 +163,9 @@
beforeDestroy () { beforeDestroy () {
// Destruction wheel // Destruction wheel
clearInterval(this.setIntervalP) clearInterval(this.setIntervalP)
sessionStorage.setItem('isLeft',1) sessionStorage.setItem('isLeft', 1)
}, },
components: { mList, mInstanceConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData } components: { mList, mInstanceConditions, mSpin, mListConstruction, mNoData }
} }
</script> </script>

2
dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/timing/index.vue

@ -28,4 +28,4 @@
name: 'timing-index', name: 'timing-index',
components: { mList, mListConstruction } components: { mList, mListConstruction }
} }
</script> </script>

4
dolphinscheduler-ui/src/js/conf/home/pages/resource/index.vue

@ -25,7 +25,7 @@
export default { export default {
name: 'resource-index', name: 'resource-index',
components: { mSecondaryMenu }, components: { mSecondaryMenu },
mounted() { mounted () {
}, }
} }
</script> </script>

4
dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/index.vue

@ -20,7 +20,7 @@
<script> <script>
export default { export default {
name: 'file-manage-index', name: 'file-manage-index',
mounted() { mounted () {
}, }
} }
</script> </script>

6
dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/create/index.vue

@ -82,8 +82,6 @@
import { handlerSuffix } from '../details/_source/utils' import { handlerSuffix } from '../details/_source/utils'
import codemirror from '../_source/codemirror' import codemirror from '../_source/codemirror'
import mListBoxF from '@/module/components/listBoxF/listBoxF' import mListBoxF from '@/module/components/listBoxF/listBoxF'
import mSpin from '@/module/components/spin/spin'
import mConditions from '@/module/components/conditions/conditions'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
let editor let editor
@ -136,7 +134,7 @@
this.$message.warning(`${i18n.$t('Please enter the resource content')}`) this.$message.warning(`${i18n.$t('Please enter the resource content')}`)
return false return false
} }
if (editor.doc.size>3000) { if (editor.doc.size > 3000) {
this.$message.warning(`${i18n.$t('Resource content cannot exceed 3000 lines')}`) this.$message.warning(`${i18n.$t('Resource content cannot exceed 3000 lines')}`)
return false return false
} }
@ -179,7 +177,7 @@
editor.off($('.code-create-mirror'), 'keypress', this.keypress) editor.off($('.code-create-mirror'), 'keypress', this.keypress)
}, },
computed: {}, computed: {},
components: { mListConstruction, mConditions, mSpin, mListBoxF } components: { mListConstruction, mListBoxF }
} }
</script> </script>

10
dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/createFolder/index.vue

@ -60,11 +60,7 @@
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { folderList } from '../_source/common' import { folderList } from '../_source/common'
import { handlerSuffix } from '../details/_source/utils'
import mListBoxF from '@/module/components/listBoxF/listBoxF' import mListBoxF from '@/module/components/listBoxF/listBoxF'
import mSpin from '@/module/components/spin/spin'
import mConditions from '@/module/components/conditions/conditions'
import localStore from '@/module/util/localStorage'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default { export default {
@ -94,7 +90,7 @@
this.$message.success(res.msg) this.$message.success(res.msg)
setTimeout(() => { setTimeout(() => {
this.spinnerLoading = false this.spinnerLoading = false
this.$router.push({ path: `/resource/file`}) this.$router.push({ path: '/resource/file' })
}, 800) }, 800)
}).catch(e => { }).catch(e => {
this.$message.error(e.msg || '') this.$message.error(e.msg || '')
@ -109,7 +105,7 @@
} }
return true return true
}, }
}, },
watch: {}, watch: {},
created () { created () {
@ -119,7 +115,7 @@
destroyed () { destroyed () {
}, },
computed: {}, computed: {},
components: { mListConstruction, mConditions, mSpin, mListBoxF } components: { mListConstruction, mListBoxF }
} }
</script> </script>

10
dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/createUdfFolder/index.vue

@ -60,11 +60,7 @@
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import { folderList } from '../_source/common' import { folderList } from '../_source/common'
import { handlerSuffix } from '../details/_source/utils'
import mListBoxF from '@/module/components/listBoxF/listBoxF' import mListBoxF from '@/module/components/listBoxF/listBoxF'
import mSpin from '@/module/components/spin/spin'
import mConditions from '@/module/components/conditions/conditions'
import localStore from '@/module/util/localStorage'
import mListConstruction from '@/module/components/listConstruction/listConstruction' import mListConstruction from '@/module/components/listConstruction/listConstruction'
export default { export default {
@ -94,7 +90,7 @@
this.$message.success(res.msg) this.$message.success(res.msg)
setTimeout(() => { setTimeout(() => {
this.spinnerLoading = false this.spinnerLoading = false
this.$router.push({ path: `/resource/udf/resource`}) this.$router.push({ path: '/resource/udf/resource' })
}, 800) }, 800)
}).catch(e => { }).catch(e => {
this.$message.error(e.msg || '') this.$message.error(e.msg || '')
@ -108,7 +104,7 @@
return false return false
} }
return true return true
}, }
}, },
watch: {}, watch: {},
created () { created () {
@ -118,7 +114,7 @@
destroyed () { destroyed () {
}, },
computed: {}, computed: {},
components: { mListConstruction, mConditions, mSpin, mListBoxF } components: { mListConstruction, mListBoxF }
} }
</script> </script>

8
dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/details/index.vue

@ -130,8 +130,8 @@
this._getViewResources() this._getViewResources()
}, 1000, { }, 1000, {
'leading': false, leading: false,
'trailing': true trailing: true
}), }),
/** /**
* down * down
@ -143,8 +143,8 @@
this._getViewResources() this._getViewResources()
}, 1000, { }, 1000, {
'leading': false, leading: false,
'trailing': true trailing: true
}), }),
/** /**
* off handle * off handle

6
dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue

@ -80,8 +80,8 @@
...mapActions('resource', ['getViewResources', 'updateContent']), ...mapActions('resource', ['getViewResources', 'updateContent']),
ok () { ok () {
if (this._validation()) { if (this._validation()) {
this.spinnerLoading = true this.spinnerLoading = true
this.updateContent({ this.updateContent({
id: this.$route.params.id, id: this.$route.params.id,
content: editor.getValue() content: editor.getValue()
}).then(res => { }).then(res => {
@ -97,7 +97,7 @@
} }
}, },
_validation () { _validation () {
if (editor.doc.size>3000) { if (editor.doc.size > 3000) {
this.$message.warning(`${i18n.$t('Resource content cannot exceed 3000 lines')}`) this.$message.warning(`${i18n.$t('Resource content cannot exceed 3000 lines')}`)
return false return false
} }

6
dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue

@ -111,7 +111,7 @@
}, },
_go (item) { _go (item) {
localStore.setItem('file', `${item.alias}|${item.size}`) localStore.setItem('file', `${item.alias}|${item.size}`)
if(item.directory) { if (item.directory) {
localStore.setItem('currentDir', `${item.fullName}`) localStore.setItem('currentDir', `${item.fullName}`)
this.$router.push({ path: `/resource/file/subdirectory/${item.id}` }) this.$router.push({ path: `/resource/file/subdirectory/${item.id}` })
} else { } else {
@ -142,12 +142,12 @@
this.renameDialog = true this.renameDialog = true
}, },
onUpDate(item) { onUpDate (item) {
this.$set(this.list, this.index, item) this.$set(this.list, this.index, item)
this.renameDialog = false this.renameDialog = false
}, },
close() { close () {
this.renameDialog = false this.renameDialog = false
}, },

13
dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/rename.vue

@ -47,7 +47,6 @@
<script> <script>
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import store from '@/conf/home/store' import store from '@/conf/home/store'
import localStore from '@/module/util/localStorage'
import mPopup from '@/module/components/popup/popup' import mPopup from '@/module/components/popup/popup'
import mListBoxF from '@/module/components/listBoxF/listBoxF' import mListBoxF from '@/module/components/listBoxF/listBoxF'
export default { export default {
@ -66,12 +65,12 @@
_ok (fn) { _ok (fn) {
this._verification().then(res => { this._verification().then(res => {
if (this.name === this.item.alias) { if (this.name === this.item.alias) {
return new Promise((resolve,reject) => { return new Promise((resolve, reject) => {
this.description === this.item.description ? reject({msg:'内容未修改'}) : resolve() this.description === this.item.description ? reject({ msg: '内容未修改' }) : resolve()
}) })
}else{ } else {
return this.store.dispatch('resource/resourceVerifyName', { return this.store.dispatch('resource/resourceVerifyName', {
fullName: '/'+this.name, fullName: '/' + this.name,
type: 'FILE' type: 'FILE'
}) })
} }
@ -102,7 +101,7 @@
} }
}) })
}, },
close() { close () {
this.$emit('close') this.$emit('close')
} }
}, },
@ -118,4 +117,4 @@
}, },
components: { mPopup, mListBoxF } components: { mPopup, mListBoxF }
} }
</script> </script>

10
dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/index.vue

@ -101,15 +101,15 @@
this.searchParams.pageSize = val this.searchParams.pageSize = val
}, },
_getList (flag) { _getList (flag) {
if(sessionStorage.getItem('isLeft')==0) { if (sessionStorage.getItem('isLeft') === 0) {
this.isLeft = false this.isLeft = false
} else { } else {
this.isLeft = true this.isLeft = true
} }
this.isLoading = !flag this.isLoading = !flag
this.getResourcesListP(this.searchParams).then(res => { this.getResourcesListP(this.searchParams).then(res => {
if(this.searchParams.pageNo>1 && res.totalList.length == 0) { if (this.searchParams.pageNo > 1 && res.totalList.length === 0) {
this.searchParams.pageNo = this.searchParams.pageNo -1 this.searchParams.pageNo = this.searchParams.pageNo - 1
} else { } else {
this.fileResourcesList = res.totalList this.fileResourcesList = res.totalList
this.total = res.total this.total = res.total
@ -124,7 +124,7 @@
this.searchParams.searchVal = '' this.searchParams.searchVal = ''
this._debounceGET() this._debounceGET()
}, },
_onUpdate () { _onUpdate () {
this._debounceGET() this._debounceGET()
} }
}, },
@ -140,7 +140,7 @@
mounted () { mounted () {
}, },
beforeDestroy () { beforeDestroy () {
sessionStorage.setItem('isLeft',1) sessionStorage.setItem('isLeft', 1)
}, },
components: { mListConstruction, mConditions, mList, mSpin, mNoData } components: { mListConstruction, mConditions, mList, mSpin, mNoData }
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save