diff --git a/dolphinscheduler-ui/.eslintignore b/dolphinscheduler-ui/.eslintignore new file mode 100644 index 0000000000..cd1b8213b3 --- /dev/null +++ b/dolphinscheduler-ui/.eslintignore @@ -0,0 +1,7 @@ +/_test_/ +/build/ +/dist/ +/node/ +/node_modules/ +/target/ +/*.js diff --git a/dolphinscheduler-ui/.eslintrc.yml b/dolphinscheduler-ui/.eslintrc.yml index 8d4020f7c4..a72507d2f2 100644 --- a/dolphinscheduler-ui/.eslintrc.yml +++ b/dolphinscheduler-ui/.eslintrc.yml @@ -26,9 +26,18 @@ globals: Atomics: readonly SharedArrayBuffer: readonly PUBLIC_PATH: readonly + $t: readonly parserOptions: ecmaVersion: 2018 sourceType: module plugins: - 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' }} diff --git a/dolphinscheduler-ui/build/config.js b/dolphinscheduler-ui/build/config.js index 11bbec550f..77de5b690e 100644 --- a/dolphinscheduler-ui/build/config.js +++ b/dolphinscheduler-ui/build/config.js @@ -125,6 +125,16 @@ const baseConfig = { }, module: { rules: [ + { + test: /\.(js|vue)$/, + loader: 'eslint-loader', + enforce: 'pre', + include: [resolve('src')], + options: { + formatter: require('eslint-friendly-formatter'), + emitWarning: true + } + }, { test: /\.vue$/, loader: 'vue-loader', diff --git a/dolphinscheduler-ui/build/webpack.config.dev.js b/dolphinscheduler-ui/build/webpack.config.dev.js index d443bf8366..ea250330ad 100644 --- a/dolphinscheduler-ui/build/webpack.config.dev.js +++ b/dolphinscheduler-ui/build/webpack.config.dev.js @@ -19,6 +19,8 @@ const merge = require('webpack-merge') const { assetsDir, baseConfig } = require('./config') const MiniCssExtractPlugin = require('mini-css-extract-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 config = merge.smart(baseConfig, { @@ -33,6 +35,7 @@ const config = merge.smart(baseConfig, { port: getEnv('DEV_PORT', 8888), host: getEnv('DEV_HOST', 'localhost'), noInfo: false, + overlay: { warnings: false, errors: true }, historyApiFallback: true, disableHostCheck: true, proxy: { @@ -42,12 +45,12 @@ const config = merge.smart(baseConfig, { changeOrigin: true } }, - progress: false, - quiet: false, + progress: true, + quiet: true, stats: { colors: true }, - clientLogLevel: 'none' + clientLogLevel: 'warning' }, plugins: [ new ProgressPlugin(), @@ -57,4 +60,36 @@ const config = merge.smart(baseConfig, { 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) + } + }) +}) diff --git a/dolphinscheduler-ui/package.json b/dolphinscheduler-ui/package.json index 8a9291c43d..a2cd72c7f1 100644 --- a/dolphinscheduler-ui/package.json +++ b/dolphinscheduler-ui/package.json @@ -8,7 +8,7 @@ "dev": "cross-env NODE_ENV=development webpack-dev-server --config ./build/webpack.config.dev.js", "clean": "rimraf dist", "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" }, "dependencies": { @@ -55,18 +55,23 @@ "env-parse": "^1.0.5", "eslint": "^6.8.0", "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-node": "^11.1.0", "eslint-plugin-promise": "^4.2.1", "eslint-plugin-standard": "^4.0.1", - "eslint-plugin-vue": "^6.2.2", + "eslint-plugin-vue": "^7.2.0", "file-loader": "^5.0.2", + "friendly-errors-webpack-plugin": "^1.7.0", "globby": "^8.0.1", "html-loader": "^0.5.5", "html-webpack-plugin": "^3.2.0", "mini-css-extract-plugin": "^0.8.2", + "node-notifier": "^8.0.0", "node-sass": "^4.14.1", "pack": "^2.2.0", + "portfinder": "^1.0.28", "postcss-loader": "^3.0.0", "progress-bar-webpack-plugin": "^1.12.1", "rimraf": "^2.6.2", diff --git a/dolphinscheduler-ui/src/components/Counter.vue b/dolphinscheduler-ui/src/components/Counter.vue index 6fafb5a54e..74dbfcd8de 100644 --- a/dolphinscheduler-ui/src/components/Counter.vue +++ b/dolphinscheduler-ui/src/components/Counter.vue @@ -24,30 +24,30 @@ \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/components/Message.vue b/dolphinscheduler-ui/src/components/Message.vue index 95f5236b6e..aba5ea6a56 100644 --- a/dolphinscheduler-ui/src/components/Message.vue +++ b/dolphinscheduler-ui/src/components/Message.vue @@ -19,10 +19,10 @@ \ No newline at end of file + export default { + name: 'message', + props: [ + 'msg' + ] + } + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue index a47d729baa..6fc5f103a7 100755 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue @@ -156,7 +156,7 @@ :visible.sync="nodeDrawer" size="50%" :with-header="false"> - + { this.$message.success(`${i18n.$t('Copy success')}`) // Free memory @@ -383,8 +383,8 @@ let dom = $(`#${v2.id}`) let state = dom.find('.state-p') let depState = '' - taskList.forEach(item=>{ - if(item.name==v1.name) { + taskList.forEach(item => { + if (item.name === v1.name) { depState = item.state } }) @@ -460,7 +460,7 @@ this.spinnerLoading = true // Storage store Dag.saveStore().then(res => { - if(this._verifConditions(res.tasks)) { + if (this._verifConditions(res.tasks)) { if (this.urlParam.id) { /** * Edit @@ -509,24 +509,24 @@ }) }) }, - _closeDAG(){ + _closeDAG () { let $name = this.$route.name - if($name && $name.indexOf("definition") != -1){ - this.$router.push({ name: 'projects-definition-list'}) - }else{ - this.$router.push({ name: 'projects-instance-list'}) + if ($name && $name.indexOf('definition') !== -1) { + this.$router.push({ name: 'projects-definition-list' }) + } else { + this.$router.push({ name: 'projects-instance-list' }) } }, _verifConditions (value) { let tasks = value let bool = true - 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)) { + 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)) { bool = false return false } }) - if(!bool) { + if (!bool) { this.$message.warning(`${i18n.$t('Successful branch flow and failed branch flow are required')}`) this.spinnerLoading = false return false @@ -600,20 +600,20 @@ * View variables */ _toggleView () { - findComponentDownward(this.$root, `assist-dag-index`)._toggleView() + findComponentDownward(this.$root, 'assist-dag-index')._toggleView() }, /** * Starting parameters */ _toggleParam () { - findComponentDownward(this.$root, `starting-params-dag-index`)._toggleParam() + findComponentDownward(this.$root, 'starting-params-dag-index')._toggleParam() }, addLineInfo ({ item, fromThis }) { this.addConnects(item) this.lineDrawer = false }, - cancel ({fromThis}) { + cancel ({ fromThis }) { this.lineDrawer = false }, @@ -621,23 +621,33 @@ * Create a node popup layer * @param Object id */ - _createLineLabel({id, sourceId, targetId}) { + _createLineLabel ({ id, sourceId, targetId }) { this.lineData.id = id this.lineData.sourceId = sourceId this.lineData.targetId = targetId 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 }) { this.addTasks(item) this.nodeDrawer = false }, - cacheTaskInfo({item, fromThis}) { + cacheTaskInfo ({ item, fromThis }) { this.cacheTasks(item) }, - close ({ item,flag, fromThis }) { + close ({ item, flag, fromThis }) { this.addTasks(item) // Edit status does not allow deletion of nodes if (flag) { @@ -654,11 +664,11 @@ let preNode = [] let rearNode = [] let rearList = [] - $('div[data-targetarr*="' + id + '"]').each(function(){ - rearNode.push($(this).attr("id")) + $('div[data-targetarr*="' + id + '"]').each(function () { + rearNode.push($(this).attr('id')) }) - if (rearNode.length>0) { + if (rearNode.length > 0) { rearNode.forEach(v => { let rearobj = {} rearobj.value = $(`#${v}`).find('.name-p').text() @@ -690,12 +700,11 @@ this.nodeData.preNode = preNode this.nodeData.rearList = rearList this.nodeData.instanceId = this.$route.params.id - + this.nodeDrawer = true - }, removeEventModelById ($id) { - if(eventModel && this.taskId == $id){ + if (eventModel && this.taskId === $id) { eventModel.remove() } }, @@ -707,12 +716,12 @@ * @param processDefinitionId the process definition id * @param fromThis fromThis */ - mVersionSwitchProcessDefinitionVersion({ version, processDefinitionId, fromThis }) { + mVersionSwitchProcessDefinitionVersion ({ version, processDefinitionId, fromThis }) { this.$store.state.dag.isSwitchVersion = true this.switchProcessDefinitionVersion({ version: version, processDefinitionId: processDefinitionId - }).then(res=>{ + }).then(res => { this.$message.success($t('Switch Version Successfully')) this.$router.push({ path: `/projects/definition/list/${processDefinitionId}?_t=${new Date().getTime()}` }) }).catch(e => { @@ -720,7 +729,7 @@ this.$message.error(e.msg || '') }) }, - + /** * Paging event of process definition versions * @@ -729,17 +738,17 @@ * @param processDefinitionId the process definition id of page version * @param fromThis fromThis */ - mVersionGetProcessDefinitionVersionsPage({ pageNo, pageSize, processDefinitionId, fromThis }) { + mVersionGetProcessDefinitionVersionsPage ({ pageNo, pageSize, processDefinitionId, fromThis }) { this.getProcessDefinitionVersionsPage({ pageNo: pageNo, pageSize: pageSize, processDefinitionId: processDefinitionId - }).then(res=>{ + }).then(res => { this.versionData.processDefinitionVersions = res.data.lists this.versionData.total = res.data.totalCount this.versionData.pageSize = res.data.pageSize this.versionData.pageNo = res.data.currentPage - }).catch(e=>{ + }).catch(e => { this.$message.error(e.msg || '') }) }, @@ -748,7 +757,6 @@ * query the process definition pagination version */ _version (item) { - let self = this this.getProcessDefinitionVersionsPage({ pageNo: 1, pageSize: 10, @@ -766,17 +774,15 @@ this.versionData.pageNo = pageNo this.versionData.pageSize = pageSize this.drawer = true - }).catch(e => { this.$message.error(e.msg || '') }) } }, watch: { - 'tasks': { + tasks: { deep: true, handler (o) { - // Edit state does not allow deletion of node a... this.setIsEditDag(true) } @@ -809,8 +815,8 @@ } ], ['Label', { - location: 0.5, - id: 'label' + location: 0.5, + id: 'label' }] ], Container: 'canvas', diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/dependentTimeout.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/dependentTimeout.vue index 7d2c711b47..8d8f13cfee 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/dependentTimeout.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/dependentTimeout.vue @@ -143,21 +143,21 @@ if (p === 2 || p === 0) { this.waitCompleteTimeout.strategy = is ? ['WARN'] : [] this.waitCompleteTimeout.interval = is ? 30 : null - } + } }, _verification () { // Verification timeout policy - if (this.enable - && (this.waitCompleteTimeout.enable && !this.waitCompleteTimeout.strategy.length) - || (this.waitStartTimeout.enable && !this.waitStartTimeout.strategy.length)) { + if (this.enable && + (this.waitCompleteTimeout.enable && !this.waitCompleteTimeout.strategy.length) || + (this.waitStartTimeout.enable && !this.waitStartTimeout.strategy.length)) { this.$message.warning(`${this.$t('Timeout strategy must be selected')}`) return false } // Verify timeout duration Non 0 positive integer const reg = /^[1-9]\d*$/ - if (this.enable - && (this.waitCompleteTimeout.enable && !reg.test(this.waitCompleteTimeout.interval)) - || (this.waitStartTimeout.enable && (!reg.test(this.waitStartTimeout.interval || !reg.test(this.waitStartTimeout.checkInterval))))) { + if (this.enable && + (this.waitCompleteTimeout.enable && !reg.test(this.waitCompleteTimeout.interval)) || + (this.waitStartTimeout.enable && (!reg.test(this.waitStartTimeout.interval || !reg.test(this.waitStartTimeout.checkInterval))))) { this.$message.warning(`${this.$t('Timeout must be a positive integer')}`) return false } @@ -175,16 +175,16 @@ }, waitCompleteTimeout: { strategy: (() => { - // Handling checkout sequence - let strategy = this.waitCompleteTimeout.strategy - if (strategy.length === 2 && strategy[0] === 'FAILED') { - return [strategy[1], strategy[0]].join(',') - } else { - return strategy.join(',') - } - })(), - interval: parseInt(this.waitCompleteTimeout.interval), - enable: this.waitCompleteTimeout.enable + // Handling checkout sequence + let strategy = this.waitCompleteTimeout.strategy + if (strategy.length === 2 && strategy[0] === 'FAILED') { + return [strategy[1], strategy[0]].join(',') + } else { + return strategy.join(',') + } + })(), + interval: parseInt(this.waitCompleteTimeout.interval), + enable: this.waitCompleteTimeout.enable } }) return true @@ -215,4 +215,4 @@ }, components: {} } - \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/selectInput.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/selectInput.vue index 297cfaa892..160db6e320 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/selectInput.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/selectInput.vue @@ -20,7 +20,7 @@ :disabled="isDetails" size="small" @change="_onChange" - v-model="value"> + v-model="selectedValue"> \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue index 0d11a1edd9..2fece25675 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/timeoutAlarm.vue @@ -127,4 +127,4 @@ }, components: {} } - \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/workerGroups.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/workerGroups.vue index 4ab4efb00a..de2b2c73c2 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/workerGroups.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/workerGroups.vue @@ -18,7 +18,7 @@ diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/log.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/log.vue index aa869c6a2b..77975b22ff 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/log.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/log.vue @@ -67,7 +67,7 @@ */ const handerTextareaSize = (isH = 0) => { $('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 = '' @@ -89,7 +89,7 @@ props: { item: { type: Object, - default: {} + default: Object }, source: { type: String, @@ -179,8 +179,8 @@ this.loadingIndex = this.loadingIndex - 1 this._ckLog() }, 1000, { - 'leading': false, - 'trailing': true + leading: false, + trailing: true }), /** * down @@ -189,8 +189,8 @@ this.loadingIndex = this.loadingIndex + 1 this._ckLog() }, 1000, { - 'leading': false, - 'trailing': true + leading: false, + trailing: true }), /** * Monitor scroll bar diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue index 1344666e42..0a3f17b059 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/datasource.vue @@ -128,7 +128,7 @@ this.$emit('on-dsData', { type: this.type, datasource: val - }); + }) } }, created () { diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue index ead747edc2..abadc2c36b 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue @@ -74,7 +74,7 @@ props: { dependItemList: Array, index: Number, - dependTaskList:Array + dependTaskList: Array }, model: { prop: 'dependItemList', @@ -109,7 +109,6 @@ * remove task */ _remove (i) { - this.dependTaskList[this.index].dependItemList.splice(i,1) this._removeTip() if (!this.dependItemList.length || this.dependItemList.length === 0) { this.$emit('on-delete-all', { @@ -176,14 +175,14 @@ */ _onChangeProjectId (value) { 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 this._getDependItemList(definitionId).then(depTasksList => { let item = this.dependItemList[this.itemIndex] // init set depTasks All item.depTasks = 'ALL' // 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, cycle: 'day', dateValue: 'today', - dateValueList: _.cloneDeep(dateValueList['day']), + dateValueList: _.cloneDeep(dateValueList.day), state: '' } }, @@ -231,7 +230,7 @@ } }, - _cpOldParams (value,definitionId, definitionList,depTasksList, item) { + _cpOldParams (value, definitionId, definitionList, depTasksList, item) { return { projectId: value, definitionList: definitionList, diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/httpParams.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/httpParams.vue index 7f9724c782..82d3d1944d 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/httpParams.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/httpParams.vue @@ -83,7 +83,7 @@ // Current execution index httpParamsIndex: null, // 参数位置的下拉框 - positionList:positionList + positionList: positionList } }, mixins: [disabledState], @@ -142,7 +142,7 @@ if (!v.prop) { flag = false } - if(v.value === ''){ + if (v.value === '') { this.$message.warning(`${i18n.$t('value is empty')}`) return false } @@ -173,7 +173,7 @@ } }) if (!flag) { - this.$message.warning(`${i18n.$t('value is empty')}`) + this.$message.warning(`${i18n.$t('value is empty')}`) return false } this.$emit('on-http-params', _.cloneDeep(this.httpParamsList)) @@ -191,7 +191,7 @@ }, computed: { inputStyle () { - return "width:30%" + return 'width:30%' } }, mounted () { @@ -240,4 +240,3 @@ } } - diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/jsonBox.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/jsonBox.vue index 71e4d80f7a..04375e616a 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/jsonBox.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/jsonBox.vue @@ -31,7 +31,6 @@ diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/http.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/http.vue index 50a9a28962..bbd5e535ea 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/http.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/http.vue @@ -89,7 +89,6 @@ -
{{$t('Timeout Settings')}}
@@ -144,8 +143,8 @@ data () { return { timeoutSettings: false, - connectTimeout : 60000 , - socketTimeout : 60000 , + connectTimeout: 60000, + socketTimeout: 60000, url: '', condition: '', @@ -154,7 +153,7 @@ httpMethod: 'GET', httpMethodList: [{ code: 'GET' }, { code: 'POST' }, { code: 'HEAD' }, { code: 'PUT' }, { code: 'DELETE' }], 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: { @@ -205,8 +204,8 @@ httpMethod: this.httpMethod, httpCheckCondition: this.httpCheckCondition, condition: this.condition, - connectTimeout : this.connectTimeout , - socketTimeout : this.socketTimeout + connectTimeout: this.connectTimeout, + socketTimeout: this.socketTimeout }) return true } @@ -220,8 +219,8 @@ httpMethod: this.httpMethod, httpCheckCondition: this.httpCheckCondition, condition: this.condition, - connectTimeout : this.connectTimeout , - socketTimeout : this.socketTimeout + connectTimeout: this.connectTimeout, + socketTimeout: this.socketTimeout } } }, @@ -231,32 +230,32 @@ * @param val */ cacheParams (val) { - this.$emit('on-cache-params', val); + this.$emit('on-cache-params', val) } }, created () { - let o = this.backfillItem - // Non-null objects represent backfill - if (!_.isEmpty(o)) { - this.url = o.params.url || '' - this.httpMethod = o.params.httpMethod || 'GET' - this.httpCheckCondition = o.params.httpCheckCondition || 'DEFAULT' - this.condition = o.params.condition || '' - this.connectTimeout = o.params.connectTimeout - this.socketTimeout = o.params.socketTimeout - if(this.connectTimeout != 60000 || this.socketTimeout != 60000 ){ - this.timeoutSettings = true - } - // backfill localParams - let localParams = o.params.localParams || [] - if (localParams.length) { - this.localParams = localParams - } - let httpParams = o.params.httpParams || [] - if (httpParams.length) { - this.httpParams = httpParams - } + let o = this.backfillItem + // Non-null objects represent backfill + if (!_.isEmpty(o)) { + this.url = o.params.url || '' + this.httpMethod = o.params.httpMethod || 'GET' + this.httpCheckCondition = o.params.httpCheckCondition || 'DEFAULT' + this.condition = o.params.condition || '' + this.connectTimeout = o.params.connectTimeout + this.socketTimeout = o.params.socketTimeout + if (this.connectTimeout !== 60000 || this.socketTimeout !== 60000) { + this.timeoutSettings = true + } + // backfill localParams + let localParams = o.params.localParams || [] + if (localParams.length) { + this.localParams = localParams } + let httpParams = o.params.httpParams || [] + if (httpParams.length) { + this.httpParams = httpParams + } + } }, mounted () { }, diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue index ffeba7c75f..41f0bfd6ad 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/mr.vue @@ -100,7 +100,6 @@ import _ from 'lodash' import i18n from '@/module/i18n' import mListBox from './_source/listBox' - import mResources from './_source/resources' import mLocalParams from './_source/localParams' import Treeselect from '@riophae/vue-treeselect' import '@riophae/vue-treeselect/dist/vue-treeselect.css' @@ -131,7 +130,7 @@ programType: 'JAVA', // Program type(List) programTypeList: [{ code: 'JAVA' }, { code: 'PYTHON' }], - normalizer(node) { + normalizer (node) { return { label: node.name } @@ -148,10 +147,10 @@ /** * getResourceId */ - marjarId(name) { - this.store.dispatch('dag/getResourceId',{ + marjarId (name) { + this.store.dispatch('dag/getResourceId', { type: 'FILE', - fullName: '/'+name + fullName: '/' + name }).then(res => { this.mainJar = res.id }).catch(e => { @@ -176,55 +175,55 @@ _onCacheResourcesData (a) { this.cacheResourceList = a }, - diGuiTree(item) { // Recursive convenience tree structure + diGuiTree (item) { // Recursive convenience tree structure item.forEach(item => { - item.children === '' || item.children === undefined || item.children === null || item.children.length === 0?         - this.operationTree(item) : this.diGuiTree(item.children); + item.children === '' || item.children === undefined || item.children === null || item.children.length === 0 + ? this.operationTree(item) : this.diGuiTree(item.children) }) }, - operationTree(item) { - if(item.dirctory) { - item.isDisabled =true + operationTree (item) { + if (item.dirctory) { + item.isDisabled = true } delete item.children }, - searchTree(element, id) { + searchTree (element, id) { // 根据id查找节点 - if (element.id == id) { - return element; - } else if (element.children != null) { - var i; - var result = null; - for (i = 0; result == null && i < element.children.length; i++) { - result = this.searchTree(element.children[i], id); + if (element.id === id) { + return element + } else if (element.children !== null) { + var i + var result = null + for (i = 0; result === null && i < element.children.length; i++) { + result = this.searchTree(element.children[i], id) } - return result; + return result } - return null; + return null }, - dataProcess(backResource) { + dataProcess (backResource) { let isResourceId = [] let resourceIdArr = [] - if(this.resourceList.length>0) { - this.resourceList.forEach(v=>{ - this.mainJarList.forEach(v1=>{ - if(this.searchTree(v1,v)) { - isResourceId.push(this.searchTree(v1,v)) + if (this.resourceList.length > 0) { + this.resourceList.forEach(v => { + this.mainJarList.forEach(v1 => { + if (this.searchTree(v1, v)) { + isResourceId.push(this.searchTree(v1, v)) } }) }) - resourceIdArr = isResourceId.map(item=>{ + resourceIdArr = isResourceId.map(item => { return item.id }) - Array.prototype.diff = function(a) { - return this.filter(function(i) {return a.indexOf(i) < 0;}); - }; - let diffSet = this.resourceList.diff(resourceIdArr); + Array.prototype.diff = function (a) { + return this.filter(function (i) { return a.indexOf(i) < 0 }) + } + let diffSet = this.resourceList.diff(resourceIdArr) let optionsCmp = [] - if(diffSet.length>0) { - diffSet.forEach(item=>{ - backResource.forEach(item1=>{ - if(item==item1.id || item==item1.res) { + if (diffSet.length > 0) { + diffSet.forEach(item => { + backResource.forEach(item1 => { + if (item === item1.id || item === item1.res) { optionsCmp.push(item1) } }) @@ -233,15 +232,15 @@ let noResources = [{ id: -1, name: $t('Unauthorized or deleted resources'), - fullName: '/'+$t('Unauthorized or deleted resources'), + fullName: '/' + $t('Unauthorized or deleted resources'), children: [] }] - if(optionsCmp.length>0) { + if (optionsCmp.length > 0) { this.allNoResources = optionsCmp - optionsCmp = optionsCmp.map(item=>{ - return {id: item.id,name: item.name,fullName: item.res} + optionsCmp = optionsCmp.map(item => { + return { id: item.id, name: item.name, fullName: item.res } }) - optionsCmp.forEach(item=>{ + optionsCmp.forEach(item => { item.isNew = true }) noResources[0].children = optionsCmp @@ -264,7 +263,7 @@ } // noRes - if (this.noRes.length>0) { + if (this.noRes.length > 0) { this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`) return false } @@ -280,7 +279,7 @@ id: this.mainJar }, resourceList: _.map(this.resourceList, v => { - return {id: v} + return { id: v } }), localParams: this.localParams, mainArgs: this.mainArgs, @@ -288,8 +287,8 @@ programType: this.programType }) return true - }, - + } + }, watch: { /** @@ -300,43 +299,48 @@ this.mainClass = '' } }, - //Watch the cacheParams + // Watch the cacheParams 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: { - cacheParams () { + resourceIdArr () { let isResourceId = [] let resourceIdArr = [] - if(this.resourceList.length>0) { - this.resourceList.forEach(v=>{ - this.mainJarList.forEach(v1=>{ - if(this.searchTree(v1,v)) { - isResourceId.push(this.searchTree(v1,v)) + if (this.resourceList.length > 0) { + this.resourceList.forEach(v => { + this.mainJarList.forEach(v1 => { + if (this.searchTree(v1, v)) { + isResourceId.push(this.searchTree(v1, v)) } }) }) - resourceIdArr = isResourceId.map(item=>{ - return {id: item.id,name: item.name,res: item.fullName} + resourceIdArr = isResourceId.map(item => { + return { id: item.id, name: item.name, res: item.fullName } }) } - let result = [] - resourceIdArr.forEach(item=>{ - this.allNoResources.forEach(item1=>{ - if(item.id==item1.id) { - // resultBool = true - result.push(item1) - } - }) - }) - this.noRes = result + return resourceIdArr + }, + cacheParams () { return { mainClass: this.mainClass, mainJar: { id: this.mainJar }, - resourceList: resourceIdArr, + resourceList: this.resourceIdArr, localParams: this.localParams, mainArgs: this.mainArgs, others: this.others, @@ -345,63 +349,63 @@ } }, created () { - let item = this.store.state.dag.resourcesListS - let items = this.store.state.dag.resourcesListJar - this.diGuiTree(item) - this.diGuiTree(items) - this.mainJarList = item - this.mainJarLists = items - let o = this.backfillItem + let item = this.store.state.dag.resourcesListS + let items = this.store.state.dag.resourcesListJar + this.diGuiTree(item) + this.diGuiTree(items) + this.mainJarList = item + this.mainJarLists = items + let o = this.backfillItem - // Non-null objects represent backfill - if (!_.isEmpty(o)) { - this.mainClass = o.params.mainClass || '' - if(o.params.mainJar.res) { - this.marjarId(o.params.mainJar.res) - } else if(o.params.mainJar.res=='') { - this.mainJar = '' - } else { - this.mainJar = o.params.mainJar.id || '' - } - this.mainArgs = o.params.mainArgs || '' - this.others = o.params.others - this.programType = o.params.programType || 'JAVA' + // Non-null objects represent backfill + if (!_.isEmpty(o)) { + this.mainClass = o.params.mainClass || '' + if (o.params.mainJar.res) { + this.marjarId(o.params.mainJar.res) + } else if (o.params.mainJar.res === '') { + this.mainJar = '' + } else { + this.mainJar = o.params.mainJar.id || '' + } + this.mainArgs = o.params.mainArgs || '' + this.others = o.params.others + this.programType = o.params.programType || 'JAVA' - // backfill resourceList - let resourceList = o.params.resourceList || [] - if (resourceList.length) { - _.map(resourceList, v => { - if(!v.id) { - this.store.dispatch('dag/getResourceId',{ - type: 'FILE', - fullName: '/'+v.res - }).then(res => { - this.resourceList.push(res.id) - this.dataProcess(backResource) - }).catch(e => { - this.resourceList.push(v.res) - this.dataProcess(backResource) - }) - } else { - this.resourceList.push(v.id) + // backfill resourceList + let resourceList = o.params.resourceList || [] + if (resourceList.length) { + _.map(resourceList, v => { + if (!v.id) { + this.store.dispatch('dag/getResourceId', { + type: 'FILE', + fullName: '/' + v.res + }).then(res => { + this.resourceList.push(res.id) this.dataProcess(backResource) - } - }) - this.cacheResourceList = resourceList - } + }).catch(e => { + this.resourceList.push(v.res) + this.dataProcess(backResource) + }) + } else { + this.resourceList.push(v.id) + this.dataProcess(backResource) + } + }) + this.cacheResourceList = resourceList + } - // backfill localParams - let backResource = o.params.resourceList || [] - let localParams = o.params.localParams || [] - if (localParams.length) { - this.localParams = localParams - } + // backfill localParams + let backResource = o.params.resourceList || [] + let localParams = o.params.localParams || [] + if (localParams.length) { + this.localParams = localParams } + } }, mounted () { }, - components: { mLocalParams, mListBox, mResources, Treeselect } + components: { mLocalParams, mListBox, Treeselect } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/pre_tasks.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/pre_tasks.vue index cb3aedc002..c922f98943 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/pre_tasks.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/pre_tasks.vue @@ -53,15 +53,15 @@ }, data () { return { - preTasksSelectorId: '_preTasksSelectorId', // Refresh target vue-component by changing id + preTasksSelectorId: '_preTasksSelectorId', // Refresh target vue-component by changing id preTasks: [], - preTasksOld: [], + preTasksOld: [] } }, mounted () { - this.preTasks = this.backfillItem['preTasks'] || this.preTasks + this.preTasks = this.backfillItem.preTasks || this.preTasks this.preTasksOld = this.preTasks - + // Refresh target vue-component by changing id this.$nextTick(() => { this.preTasksSelectorId = 'preTasksSelectorId' @@ -69,7 +69,7 @@ }, computed: { 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 keys = Object.keys(cacheTasks) for (let i = 0; i < keys.length; i++) { @@ -92,7 +92,7 @@ // preTaskIds used to delete connection preTasksToDelete: function () { return this.preTasksOld.filter(taskId => this.preTasks.indexOf(taskId) === -1) - }, + } }, methods: { // Pass data to parent-level to process dag @@ -100,7 +100,7 @@ this.$emit('on-pre-tasks', { preTasks: this.preTasks, preTasksToAdd: this.preTasksToAdd, - preTasksToDelete: this.preTasksToDelete, + preTasksToDelete: this.preTasksToDelete }) return true } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue index be881118d9..857e7a7571 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/procedure.vue @@ -122,9 +122,9 @@ } }, watch: { - //Watch the cacheParams + // Watch the cacheParams cacheParams (val) { - this.$emit('on-cache-params', val); + this.$emit('on-cache-params', val) } }, computed: { diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue index d9aa4ce959..b74e2510e0 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/python.vue @@ -61,7 +61,6 @@ import i18n from '@/module/i18n' import mListBox from './_source/listBox' import mScriptBox from './_source/scriptBox' - import mResources from './_source/resources' import mLocalParams from './_source/localParams' import Treeselect from '@riophae/vue-treeselect' import '@riophae/vue-treeselect/dist/vue-treeselect.css' @@ -84,7 +83,7 @@ // Cache ResourceList cacheResourceList: [], resourceOptions: [], - normalizer(node) { + normalizer (node) { return { label: node.name } @@ -106,7 +105,7 @@ _onLocalParams (a) { this.localParams = a }, - setEditorVal() { + setEditorVal () { this.item = editor.getValue() this.scriptBoxDialog = true }, @@ -141,7 +140,7 @@ } // noRes - if (this.noRes.length>0) { + if (this.noRes.length > 0) { this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`) return false } @@ -149,7 +148,7 @@ // storage this.$emit('on-params', { resourceList: _.map(this.resourceList, v => { - return {id: v} + return { id: v } }), localParams: this.localParams, rawScript: editor.getValue() @@ -181,55 +180,55 @@ return editor }, - diGuiTree(item) { // Recursive convenience tree structure + diGuiTree (item) { // Recursive convenience tree structure item.forEach(item => { - item.children === '' || item.children === undefined || item.children === null || item.children.length === 0?         - this.operationTree(item) : this.diGuiTree(item.children); + item.children === '' || item.children === undefined || item.children === null || item.children.length === 0 + ? this.operationTree(item) : this.diGuiTree(item.children) }) }, - operationTree(item) { - if(item.dirctory) { - item.isDisabled =true + operationTree (item) { + if (item.dirctory) { + item.isDisabled = true } delete item.children }, - searchTree(element, id) { + searchTree (element, id) { // 根据id查找节点 - if (element.id == id) { - return element; - } else if (element.children != null) { - var i; - var result = null; - for (i = 0; result == null && i < element.children.length; i++) { - result = this.searchTree(element.children[i], id); + if (element.id === id) { + return element + } else if (element.children !== null) { + var i + var result = null + for (i = 0; result === null && i < element.children.length; i++) { + result = this.searchTree(element.children[i], id) } - return result; + return result } - return null; + return null }, - dataProcess(backResource) { + dataProcess (backResource) { let isResourceId = [] let resourceIdArr = [] - if(this.resourceList.length>0) { - this.resourceList.forEach(v=>{ - this.resourceOptions.forEach(v1=>{ - if(this.searchTree(v1,v)) { - isResourceId.push(this.searchTree(v1,v)) + if (this.resourceList.length > 0) { + this.resourceList.forEach(v => { + this.resourceOptions.forEach(v1 => { + if (this.searchTree(v1, v)) { + isResourceId.push(this.searchTree(v1, v)) } }) }) - resourceIdArr = isResourceId.map(item=>{ + resourceIdArr = isResourceId.map(item => { return item.id }) - Array.prototype.diff = function(a) { - return this.filter(function(i) {return a.indexOf(i) < 0;}); - }; - let diffSet = this.resourceList.diff(resourceIdArr); + Array.prototype.diff = function (a) { + return this.filter(function (i) { return a.indexOf(i) < 0 }) + } + let diffSet = this.resourceList.diff(resourceIdArr) let optionsCmp = [] - if(diffSet.length>0) { - diffSet.forEach(item=>{ - backResource.forEach(item1=>{ - if(item==item1.id || item==item1.res) { + if (diffSet.length > 0) { + diffSet.forEach(item => { + backResource.forEach(item1 => { + if (item === item1.id || item === item1.res) { optionsCmp.push(item1) } }) @@ -238,15 +237,15 @@ let noResources = [{ id: -1, name: $t('Unauthorized or deleted resources'), - fullName: '/'+$t('Unauthorized or deleted resources'), + fullName: '/' + $t('Unauthorized or deleted resources'), children: [] }] - if(optionsCmp.length>0) { + if (optionsCmp.length > 0) { this.allNoResources = optionsCmp - optionsCmp = optionsCmp.map(item=>{ - return {id: item.id,name: item.name,fullName: item.res} + optionsCmp = optionsCmp.map(item => { + return { id: item.id, name: item.name, fullName: item.res } }) - optionsCmp.forEach(item=>{ + optionsCmp.forEach(item => { item.isNew = true }) noResources[0].children = optionsCmp @@ -256,39 +255,44 @@ } }, watch: { - //Watch the cacheParams + // Watch the cacheParams 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: { - cacheParams () { + resourceIdArr () { let isResourceId = [] let resourceIdArr = [] - if(this.resourceList.length>0) { - this.resourceList.forEach(v=>{ - this.resourceOptions.forEach(v1=>{ - if(this.searchTree(v1,v)) { - isResourceId.push(this.searchTree(v1,v)) + if (this.resourceList.length > 0) { + this.resourceList.forEach(v => { + this.resourceOptions.forEach(v1 => { + if (this.searchTree(v1, v)) { + isResourceId.push(this.searchTree(v1, v)) } }) }) - resourceIdArr = isResourceId.map(item=>{ - return {id: item.id,name: item.name,res: item.fullName} + resourceIdArr = isResourceId.map(item => { + return { id: item.id, name: item.name, res: item.fullName } }) } - let result = [] - resourceIdArr.forEach(item=>{ - this.allNoResources.forEach(item1=>{ - if(item.id==item1.id) { - // resultBool = true - result.push(item1) - } - }) - }) - this.noRes = result + return resourceIdArr + }, + cacheParams () { return { - resourceList: resourceIdArr, + resourceList: this.resourceIdArr, localParams: this.localParams } } @@ -308,10 +312,10 @@ let resourceList = o.params.resourceList || [] if (resourceList.length) { _.map(resourceList, v => { - if(!v.id) { - this.store.dispatch('dag/getResourceId',{ + if (!v.id) { + this.store.dispatch('dag/getResourceId', { type: 'FILE', - fullName: '/'+v.res + fullName: '/' + v.res }).then(res => { this.resourceList.push(res.id) this.dataProcess(backResource) @@ -343,7 +347,7 @@ editor.toTextArea() // Uninstall editor.off($('.code-python-mirror'), 'keypress', this.keypress) }, - components: { mLocalParams, mListBox, mResources,Treeselect, mScriptBox } + components: { mLocalParams, mListBox, Treeselect, mScriptBox } } \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue index 3d099d4a54..4fb955e21b 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/shell.vue @@ -63,7 +63,6 @@ import i18n from '@/module/i18n' import mListBox from './_source/listBox' import mScriptBox from './_source/scriptBox' - import mResources from './_source/resources' import mLocalParams from './_source/localParams' import disabledState from '@/module/mixin/disabledState' import Treeselect from '@riophae/vue-treeselect' @@ -87,7 +86,7 @@ cacheResourceList: [], // define options options: [], - normalizer(node) { + normalizer (node) { return { label: node.name } @@ -109,7 +108,7 @@ _onLocalParams (a) { this.localParams = a }, - setEditorVal() { + setEditorVal () { this.item = editor.getValue() this.scriptBoxDialog = true }, @@ -118,7 +117,7 @@ // this.scriptBoxDialog = false }, closeAble () { - // this.scriptBoxDialog = false + // this.scriptBoxDialog = false }, /** * return resourceList @@ -148,12 +147,12 @@ return false } // noRes - if (this.noRes.length>0) { + if (this.noRes.length > 0) { this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`) return false } // Process resourcelist - let dataProcessing= _.map(this.resourceList, v => { + let dataProcessing = _.map(this.resourceList, v => { return { id: v } @@ -190,55 +189,55 @@ return editor }, - diGuiTree(item) { // Recursive convenience tree structure + diGuiTree (item) { // Recursive convenience tree structure item.forEach(item => { - item.children === '' || item.children === undefined || item.children === null || item.children.length === 0?         - this.operationTree(item) : this.diGuiTree(item.children); + item.children === '' || item.children === undefined || item.children === null || item.children.length === 0 + ? this.operationTree(item) : this.diGuiTree(item.children) }) }, - operationTree(item) { - if(item.dirctory) { - item.isDisabled =true + operationTree (item) { + if (item.dirctory) { + item.isDisabled = true } delete item.children }, - searchTree(element, id) { + searchTree (element, id) { // 根据id查找节点 - if (element.id == id) { - return element; - } else if (element.children != null) { - var i; - var result = null; - for (i = 0; result == null && i < element.children.length; i++) { - result = this.searchTree(element.children[i], id); + if (element.id === id) { + return element + } else if (element.children !== null) { + var i + var result = null + for (i = 0; result === null && i < element.children.length; i++) { + result = this.searchTree(element.children[i], id) } - return result; + return result } - return null; + return null }, - dataProcess(backResource) { + dataProcess (backResource) { let isResourceId = [] let resourceIdArr = [] - if(this.resourceList.length>0) { - this.resourceList.forEach(v=>{ - this.options.forEach(v1=>{ - if(this.searchTree(v1,v)) { - isResourceId.push(this.searchTree(v1,v)) + if (this.resourceList.length > 0) { + this.resourceList.forEach(v => { + this.options.forEach(v1 => { + if (this.searchTree(v1, v)) { + isResourceId.push(this.searchTree(v1, v)) } }) }) - resourceIdArr = isResourceId.map(item=>{ + resourceIdArr = isResourceId.map(item => { return item.id }) - Array.prototype.diff = function(a) { - return this.filter(function(i) {return a.indexOf(i) < 0;}); - }; - let diffSet = this.resourceList.diff(resourceIdArr); + Array.prototype.diff = function (a) { + return this.filter(function (i) { return a.indexOf(i) < 0 }) + } + let diffSet = this.resourceList.diff(resourceIdArr) let optionsCmp = [] - if(diffSet.length>0) { - diffSet.forEach(item=>{ - backResource.forEach(item1=>{ - if(item==item1.id || item==item1.res) { + if (diffSet.length > 0) { + diffSet.forEach(item => { + backResource.forEach(item1 => { + if (item === item1.id || item === item1.res) { optionsCmp.push(item1) } }) @@ -247,15 +246,15 @@ let noResources = [{ id: -1, name: $t('Unauthorized or deleted resources'), - fullName: '/'+$t('Unauthorized or deleted resources'), + fullName: '/' + $t('Unauthorized or deleted resources'), children: [] }] - if(optionsCmp.length>0) { + if (optionsCmp.length > 0) { this.allNoResources = optionsCmp - optionsCmp = optionsCmp.map(item=>{ - return {id: item.id,name: item.name,fullName: item.res} + optionsCmp = optionsCmp.map(item => { + return { id: item.id, name: item.name, fullName: item.res } }) - optionsCmp.forEach(item=>{ + optionsCmp.forEach(item => { item.isNew = true }) noResources[0].children = optionsCmp @@ -265,39 +264,44 @@ } }, watch: { - //Watch the cacheParams + // Watch the cacheParams 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: { - cacheParams () { + resourceIdArr () { let isResourceId = [] let resourceIdArr = [] - if(this.resourceList.length>0) { - this.resourceList.forEach(v=>{ - this.options.forEach(v1=>{ - if(this.searchTree(v1,v)) { - isResourceId.push(this.searchTree(v1,v)) + if (this.resourceList.length > 0) { + this.resourceList.forEach(v => { + this.options.forEach(v1 => { + if (this.searchTree(v1, v)) { + isResourceId.push(this.searchTree(v1, v)) } }) }) - resourceIdArr = isResourceId.map(item=>{ - return {id: item.id,name: item.name,res: item.fullName} + resourceIdArr = isResourceId.map(item => { + return { id: item.id, name: item.name, res: item.fullName } }) } - let result = [] - resourceIdArr.forEach(item=>{ - this.allNoResources.forEach(item1=>{ - if(item.id==item1.id) { - // resultBool = true - result.push(item1) - } - }) - }) - this.noRes = result + return resourceIdArr + }, + cacheParams () { return { - resourceList: resourceIdArr, + resourceList: this.resourceIdArr, localParams: this.localParams } } @@ -307,7 +311,7 @@ this.diGuiTree(item) this.options = item let o = this.backfillItem - + // Non-null objects represent backfill if (!_.isEmpty(o)) { this.rawScript = o.params.rawScript || '' @@ -316,11 +320,11 @@ let backResource = o.params.resourceList || [] let resourceList = o.params.resourceList || [] if (resourceList.length) { - _.map(resourceList, v => { - if(!v.id) { - this.store.dispatch('dag/getResourceId',{ + _.map(resourceList, v => { + if (!v.id) { + this.store.dispatch('dag/getResourceId', { type: 'FILE', - fullName: '/'+v.res + fullName: '/' + v.res }).then(res => { this.resourceList.push(res.id) this.dataProcess(backResource) @@ -335,7 +339,7 @@ }) this.cacheResourceList = resourceList } - + // backfill localParams let localParams = o.params.localParams || [] if (localParams.length) { @@ -354,7 +358,7 @@ editor.off($('.code-shell-mirror'), 'keypress', this.keypress) } }, - components: { mLocalParams, mListBox, mResources, mScriptBox, Treeselect } + components: { mLocalParams, mListBox, mScriptBox, Treeselect } } - diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sqoop.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sqoop.vue index 0686a4e598..0c8e220205 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sqoop.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sqoop.vue @@ -614,103 +614,103 @@ /** * mysql query type */ - srcQueryType:'1', + srcQueryType: '1', /** * source data source */ - srcDatasource:'', + srcDatasource: '', /** * target data source */ - targetDatasource:'', + targetDatasource: '', /** * concurrency */ - concurrency:1, + concurrency: 1, /** * default job type */ - jobType:'TEMPLATE', + jobType: 'TEMPLATE', /** * direct model type */ - modelType:'import', + modelType: 'import', modelTypeList: [{ code: 'import' }, { code: 'export' }], sourceTypeList: [ { - code: "MYSQL" - }, + code: 'MYSQL' + } ], - targetTypeList:[ + targetTypeList: [ { - code:"HIVE" + code: 'HIVE' }, { - code:"HDFS" + code: 'HDFS' } ], - sourceType:"MYSQL", - targetType:"HDFS", - - sourceMysqlParams:{ - srcType:"MYSQL", - srcDatasource:"", - srcTable:"", - srcQueryType:"1", - srcQuerySql:'', - srcColumnType:"0", - srcColumns:"", - srcConditionList:[], - mapColumnHive:[], - mapColumnJava:[] + sourceType: 'MYSQL', + targetType: 'HDFS', + + sourceMysqlParams: { + srcType: 'MYSQL', + srcDatasource: '', + srcTable: '', + srcQueryType: '1', + srcQuerySql: '', + srcColumnType: '0', + srcColumns: '', + srcConditionList: [], + mapColumnHive: [], + mapColumnJava: [] }, - sourceHdfsParams:{ - exportDir:"" + sourceHdfsParams: { + exportDir: '' }, - sourceHiveParams:{ - hiveDatabase:"", - hiveTable:"", - hivePartitionKey:"", - hivePartitionValue:"" + sourceHiveParams: { + hiveDatabase: '', + hiveTable: '', + hivePartitionKey: '', + hivePartitionValue: '' }, - targetHdfsParams:{ - targetPath:"", - deleteTargetDir:true, - fileType:"--as-avrodatafile", - compressionCodec:"snappy", - fieldsTerminated:"", - linesTerminated:"", + targetHdfsParams: { + targetPath: '', + deleteTargetDir: true, + fileType: '--as-avrodatafile', + compressionCodec: 'snappy', + fieldsTerminated: '', + linesTerminated: '' }, - targetMysqlParams:{ - targetType:"MYSQL", - targetDatasource:"", - targetTable:"", - targetColumns:"", - fieldsTerminated:"", - linesTerminated:"", - preQuery:"", - isUpdate:false, - targetUpdateKey:"", - targetUpdateMode:"allowinsert" + targetMysqlParams: { + targetType: 'MYSQL', + targetDatasource: '', + targetTable: '', + targetColumns: '', + fieldsTerminated: '', + linesTerminated: '', + preQuery: '', + isUpdate: false, + targetUpdateKey: '', + targetUpdateMode: 'allowinsert' }, - targetHiveParams:{ - hiveDatabase:"", - hiveTable:"", - createHiveTable:false, - dropDelimiter:false, - hiveOverWrite:true, - replaceDelimiter:"", - hivePartitionKey:"", - hivePartitionValue:"" + targetHiveParams: { + hiveDatabase: '', + hiveTable: '', + createHiveTable: false, + dropDelimiter: false, + hiveOverWrite: true, + replaceDelimiter: '', + hivePartitionKey: '', + hivePartitionValue: '' }, item: '', scriptBoxDialog: false @@ -721,108 +721,108 @@ backfillItem: Object }, methods: { - setEditorVal() { + setEditorVal () { this.item = editor.getValue() this.scriptBoxDialog = true }, getSriptBoxValue (val) { editor.setValue(val) }, - _handleQueryType(o){ + _handleQueryType (o) { this.sourceMysqlParams.srcQueryType = this.srcQueryType this._getTargetTypeList(this.sourceType) this.targetType = this.targetTypeList[0].code }, - _handleModelTypeChange(a){ + _handleModelTypeChange (a) { this._getSourceTypeList(a) 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.targetType = this.targetTypeList[0].code }, - _getSourceTypeList(data){ - switch(data){ + _getSourceTypeList (data) { + switch (data) { case 'import': this.sourceTypeList = [ { - code:"MYSQL" - }, + code: 'MYSQL' + } ] - break; + break case 'export': this.sourceTypeList = [ { - code: "HDFS" + code: 'HDFS' }, { - code: "HIVE" + code: 'HIVE' } ] - break; + break default: this.sourceTypeList = [ { - code:"MYSQL" + code: 'MYSQL' }, { - code:"HIVE" + code: 'HIVE' }, { - code:"HDFS" + code: 'HDFS' } ] - break; + break } }, - _getTargetTypeList(data){ - switch(data){ + _getTargetTypeList (data) { + switch (data) { case 'MYSQL': - if (this.srcQueryType === "1") { + if (this.srcQueryType === '1') { this.targetTypeList = [ { - code: "HDFS" + code: 'HDFS' }] } else { this.targetTypeList = [ { - code: "HIVE" + code: 'HIVE' }, { - code: "HDFS" + code: 'HDFS' } ] } - break; + break case 'HDFS': this.targetTypeList = [ { - code:"MYSQL" + code: 'MYSQL' } ] - break; + break case 'HIVE': this.targetTypeList = [ { - code:"MYSQL" + code: 'MYSQL' } ] - break; + break default: this.targetTypeList = [ { - code:"HIVE" + code: 'HIVE' }, { - code:"HDFS" + code: 'HDFS' } ] - break; + break } }, @@ -853,26 +853,26 @@ /** * stringify the source params */ - _handleSourceParams() { + _handleSourceParams () { var params = null - switch(this.sourceType){ - case "MYSQL": - this.sourceMysqlParams.srcQuerySql = this.sourceMysqlParams.srcQueryType === "1" && editor ? - editor.getValue() : this.sourceMysqlParams.srcQuerySql + switch (this.sourceType) { + case 'MYSQL': + this.sourceMysqlParams.srcQuerySql = this.sourceMysqlParams.srcQueryType === '1' && editor + ? editor.getValue() : this.sourceMysqlParams.srcQuerySql params = JSON.stringify(this.sourceMysqlParams) - break; - case "ORACLE": + break + case 'ORACLE': params = JSON.stringify(this.sourceOracleParams) - break; - case "HDFS": + break + case 'HDFS': params = JSON.stringify(this.sourceHdfsParams) - break; - case "HIVE": + break + case 'HIVE': params = JSON.stringify(this.sourceHiveParams) - break; + break default: - params = ""; - break; + params = '' + break } return params }, @@ -880,21 +880,21 @@ /** * stringify the target params */ - _handleTargetParams() { + _handleTargetParams () { var params = null - switch(this.targetType){ - case "HIVE": + switch (this.targetType) { + case 'HIVE': params = JSON.stringify(this.targetHiveParams) - break; - case "HDFS": + break + case 'HDFS': params = JSON.stringify(this.targetHdfsParams) - break; - case "MYSQL": + break + case 'MYSQL': params = JSON.stringify(this.targetMysqlParams) - break; + break default: - params = ""; - break; + params = '' + break } return params @@ -903,47 +903,46 @@ /** * get source params by source type */ - _getSourceParams(data) { - switch(this.sourceType){ - case "MYSQL": + _getSourceParams (data) { + switch (this.sourceType) { + case 'MYSQL': this.sourceMysqlParams = JSON.parse(data) this.srcDatasource = this.sourceMysqlParams.srcDatasource - break; - case "ORACLE": + break + case 'ORACLE': this.sourceOracleParams = JSON.parse(data) - break; - case "HDFS": + break + case 'HDFS': this.sourceHdfsParams = JSON.parse(data) - break; - case "HIVE": + break + case 'HIVE': this.sourceHiveParams = JSON.parse(data) - break; + break default: - break; + break } }, /** * get target params by target type */ - _getTargetParams(data) { - switch(this.targetType){ - case "HIVE": + _getTargetParams (data) { + switch (this.targetType) { + case 'HIVE': this.targetHiveParams = JSON.parse(data) - break; - case "HDFS": + break + case 'HDFS': this.targetHdfsParams = JSON.parse(data) - break; - case "MYSQL": + break + case 'MYSQL': this.targetMysqlParams = JSON.parse(data) this.targetDatasource = this.targetMysqlParams.targetDatasource - break; + break default: - break; + break } }, - /** * verification */ @@ -957,7 +956,7 @@ this.$message.warning(`${i18n.$t('Please enter Custom Shell(required)')}`) return false } - sqoopParams['customShell'] = shellEditor.getValue() + sqoopParams.customShell = shellEditor.getValue() } else { if (!this.jobName) { this.$message.warning(`${i18n.$t('Please enter Job Name(required)')}`) @@ -965,7 +964,7 @@ } switch (this.sourceType) { - case "MYSQL": + case 'MYSQL': if (!this.$refs.refSourceDs._verifDatasource()) { return false } @@ -974,84 +973,84 @@ this.$message.warning(`${i18n.$t('Please enter a SQL Statement(required)')}`) return false } - this.sourceMysqlParams.srcTable = "" - this.sourceMysqlParams.srcColumnType = "0" - this.sourceMysqlParams.srcColumns = "" + this.sourceMysqlParams.srcTable = '' + this.sourceMysqlParams.srcColumnType = '0' + this.sourceMysqlParams.srcColumns = '' } else { - if (this.sourceMysqlParams.srcTable === "") { + if (this.sourceMysqlParams.srcTable === '') { this.$message.warning(`${i18n.$t('Please enter Mysql Table(required)')}`) return false } - this.sourceMysqlParams.srcQuerySql = "" - if (this.sourceMysqlParams.srcColumnType === "1" && this.sourceMysqlParams.srcColumns === "") { + this.sourceMysqlParams.srcQuerySql = '' + if (this.sourceMysqlParams.srcColumnType === '1' && this.sourceMysqlParams.srcColumns === '') { this.$message.warning(`${i18n.$t('Please enter Columns (Comma separated)')}`) return false } - if (this.sourceMysqlParams.srcColumnType === "0") { - this.sourceMysqlParams.srcColumns = "" + if (this.sourceMysqlParams.srcColumnType === '0') { + this.sourceMysqlParams.srcColumns = '' } } - break; - case "HDFS": - if (this.sourceHdfsParams.exportDir === "") { + break + case 'HDFS': + if (this.sourceHdfsParams.exportDir === '') { this.$message.warning(`${i18n.$t('Please enter Export Dir(required)')}`) return false } - break; - case "HIVE": - if (this.sourceHiveParams.hiveDatabase === "") { + break + case 'HIVE': + if (this.sourceHiveParams.hiveDatabase === '') { this.$message.warning(`${i18n.$t('Please enter Hive Database(required)')}`) return false } - if (this.sourceHiveParams.hiveTable === "") { + if (this.sourceHiveParams.hiveTable === '') { this.$message.warning(`${i18n.$t('Please enter Hive Table(required)')}`) return false } - break; + break default: - break; + break } switch (this.targetType) { - case "HIVE": - if (this.targetHiveParams.hiveDatabase === "") { + case 'HIVE': + if (this.targetHiveParams.hiveDatabase === '') { this.$message.warning(`${i18n.$t('Please enter Hive Database(required)')}`) return false } - if (this.targetHiveParams.hiveTable === "") { + if (this.targetHiveParams.hiveTable === '') { this.$message.warning(`${i18n.$t('Please enter Hive Table(required)')}`) return false } - break; - case "HDFS": - if (this.targetHdfsParams.targetPath === "") { + break + case 'HDFS': + if (this.targetHdfsParams.targetPath === '') { this.$message.warning(`${i18n.$t('Please enter Target Dir(required)')}`) return false } - break; - case "MYSQL": + break + case 'MYSQL': if (!this.$refs.refTargetDs._verifDatasource()) { return false } - if (this.targetMysqlParams.targetTable === "") { + if (this.targetMysqlParams.targetTable === '') { this.$message.warning(`${i18n.$t('Please enter Mysql Table(required)')}`) return false } - break; + break default: - break; + break } - sqoopParams['jobName'] = this.jobName - sqoopParams['hadoopCustomParams'] = this.hadoopCustomParams - sqoopParams['sqoopAdvancedParams'] = this.sqoopAdvancedParams - sqoopParams['concurrency'] = this.concurrency - sqoopParams['modelType'] = this.modelType - sqoopParams['sourceType'] = this.sourceType - sqoopParams['targetType'] = this.targetType - sqoopParams['targetParams'] = this._handleTargetParams() - sqoopParams['sourceParams'] = this._handleSourceParams() + sqoopParams.jobName = this.jobName + sqoopParams.hadoopCustomParams = this.hadoopCustomParams + sqoopParams.sqoopAdvancedParams = this.sqoopAdvancedParams + sqoopParams.concurrency = this.concurrency + sqoopParams.modelType = this.modelType + sqoopParams.sourceType = this.sourceType + sqoopParams.targetType = this.targetType + sqoopParams.targetParams = this._handleTargetParams() + sqoopParams.sourceParams = this._handleSourceParams() } // storage @@ -1142,14 +1141,14 @@ _cacheParams () { this.$emit('on-cache-params', { - concurrency:this.concurrency, - modelType:this.modelType, - sourceType:this.sourceType, - targetType:this.targetType, - sourceParams:this._handleSourceParams(), - targetParams:this._handleTargetParams(), - localParams:this.localParams - }); + concurrency: this.concurrency, + modelType: this.modelType, + sourceType: this.sourceType, + targetType: this.targetType, + sourceParams: this._handleSourceParams(), + targetParams: this._handleTargetParams(), + localParams: this.localParams + }) }, _destroyEditor () { @@ -1171,10 +1170,10 @@ watch: { // Listening to sqlType sqlType (val) { - if (val==0) { + if (val === 0) { this.showType = [] } - if (val != 0) { + if (val !== 0) { this.title = '' this.receivers = [] this.receiversCc = [] @@ -1186,7 +1185,7 @@ this.connParams = '' } }, - //Watch the cacheParams + // Watch the cacheParams cacheParams (val) { this._cacheParams() } @@ -1248,21 +1247,21 @@ computed: { cacheParams () { return { - concurrency:this.concurrency, - modelType:this.modelType, - sourceType:this.sourceType, - targetType:this.targetType, - localParams:this.localParams, - sourceMysqlParams:this.sourceMysqlParams, - sourceHdfsParams:this.sourceHdfsParams, - sourceHiveParams:this.sourceHiveParams, - targetHdfsParams:this.targetHdfsParams, - targetMysqlParams:this.targetMysqlParams, - targetHiveParams:this.targetHiveParams + concurrency: this.concurrency, + modelType: this.modelType, + sourceType: this.sourceType, + targetType: this.targetType, + localParams: this.localParams, + sourceMysqlParams: this.sourceMysqlParams, + sourceHdfsParams: this.sourceHdfsParams, + sourceHiveParams: this.sourceHiveParams, + targetHdfsParams: this.targetHdfsParams, + targetMysqlParams: this.targetMysqlParams, + targetHiveParams: this.targetHiveParams } } }, - components: { mListBox, mDatasource, mLocalParams, mScriptBox} + components: { mListBox, mDatasource, mLocalParams, mScriptBox } } - diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sub_process.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sub_process.vue index 1f59bfcc3d..23fe4ceb42 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sub_process.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/sub_process.vue @@ -97,7 +97,7 @@ created () { let processListS = _.cloneDeep(this.store.state.dag.processListS) 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 } else { id = this.router.history.current.params.id || null @@ -119,7 +119,7 @@ this.wdiCurr = o.params.processDefinitionId } else { 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)) } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/waterdrop.vue b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/waterdrop.vue index 9d2feb47ce..1dec899242 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/waterdrop.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/waterdrop.vue @@ -97,8 +97,6 @@ import _ from 'lodash' import i18n from '@/module/i18n' import mListBox from './_source/listBox' - import mScriptBox from './_source/scriptBox' - import mResources from './_source/resources' import mLocalParams from './_source/localParams' import disabledState from '@/module/mixin/disabledState' import Treeselect from '@riophae/vue-treeselect' @@ -112,9 +110,9 @@ // script rawScript: '', // waterdrop script - baseScript: 'sh ${WATERDROP_HOME}/bin/start-waterdrop.sh', + baseScript: 'sh ${WATERDROP_HOME}/bin/start-waterdrop.sh', // eslint-disable-line // resourceNameVal - resourceNameVal : [], + resourceNameVal: [], // Custom parameter localParams: [], // resource(list) @@ -128,14 +126,14 @@ // Spark version(LIst) masterType: [{ code: 'yarn' }, { code: 'local' }, { code: 'spark://' }, { code: 'mesos://' }], // Deployment masterUrl state - masterUrlState:false, + masterUrlState: false, // Deployment masterUrl masterUrl: '', // Cache ResourceList cacheResourceList: [], // define options options: [], - normalizer(node) { + normalizer (node) { return { label: node.name } @@ -177,7 +175,7 @@ return false } // noRes - if (this.noRes.length>0) { + if (this.noRes.length > 0) { this.$message.warning(`${i18n.$t('Please delete all non-existent resources')}`) return false } @@ -186,40 +184,40 @@ this.$message.warning(`${i18n.$t('Please select the waterdrop resources')}`) 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')}`) return false } // Process resourcelist - let dataProcessing= _.map(this.resourceList, v => { + let dataProcessing = _.map(this.resourceList, v => { return { id: v } }) - //verify deploy mode + // verify deploy mode let deployMode = this.deployMode let master = this.master let masterUrl = this.masterUrl - - if(this.deployMode == 'local'){ + + if (this.deployMode === 'local') { master = 'local' masterUrl = '' deployMode = 'client' } // get local params let locparams = '' - this.localParams.forEach(v=>{ - locparams = locparams + ' --variable ' + v.prop + '=' + v.value - } + this.localParams.forEach(v => { + locparams = locparams + ' --variable ' + v.prop + '=' + v.value + } ) // get waterdrop script let tureScript = '' - this.resourceNameVal.resourceList.forEach(v=>{ + this.resourceNameVal.resourceList.forEach(v => { tureScript = tureScript + this.baseScript + - ' --master '+ master + masterUrl + - ' --deploy-mode '+ deployMode + - ' --queue '+ this.queue + - ' --config ' + v.res + + ' --master ' + master + masterUrl + + ' --deploy-mode ' + deployMode + + ' --queue ' + this.queue + + ' --config ' + v.res + locparams + ' \n' }) @@ -227,60 +225,60 @@ this.$emit('on-params', { resourceList: dataProcessing, localParams: this.localParams, - rawScript: tureScript, + rawScript: tureScript }) return true }, - diGuiTree(item) { // Recursive convenience tree structure + diGuiTree (item) { // Recursive convenience tree structure item.forEach(item => { - item.children === '' || item.children === undefined || item.children === null || item.children.length === 0? - this.operationTree(item) : this.diGuiTree(item.children); + item.children === '' || item.children === undefined || item.children === null || item.children.length === 0 + ? this.operationTree(item) : this.diGuiTree(item.children) }) }, - operationTree(item) { - if(item.dirctory) { - item.isDisabled =true + operationTree (item) { + if (item.dirctory) { + item.isDisabled = true } delete item.children }, - searchTree(element, id) { + searchTree (element, id) { // 根据id查找节点 - if (element.id == id) { - return element; - } else if (element.children != null) { - var i; - var result = null; - for (i = 0; result == null && i < element.children.length; i++) { - result = this.searchTree(element.children[i], id); + if (element.id === id) { + return element + } else if (element.children !== null) { + var i + var result = null + for (i = 0; result === null && i < element.children.length; i++) { + result = this.searchTree(element.children[i], id) } - return result; + return result } - return null; + return null }, - dataProcess(backResource) { + dataProcess (backResource) { let isResourceId = [] let resourceIdArr = [] - if(this.resourceList.length>0) { - this.resourceList.forEach(v=>{ - this.options.forEach(v1=>{ - if(this.searchTree(v1,v)) { - isResourceId.push(this.searchTree(v1,v)) + if (this.resourceList.length > 0) { + this.resourceList.forEach(v => { + this.options.forEach(v1 => { + if (this.searchTree(v1, v)) { + isResourceId.push(this.searchTree(v1, v)) } }) }) - resourceIdArr = isResourceId.map(item=>{ + resourceIdArr = isResourceId.map(item => { return item.id }) - Array.prototype.diff = function(a) { - return this.filter(function(i) {return a.indexOf(i) < 0;}); - }; - let diffSet = this.resourceList.diff(resourceIdArr); + Array.prototype.diff = function (a) { + return this.filter(function (i) { return a.indexOf(i) < 0 }) + } + let diffSet = this.resourceList.diff(resourceIdArr) let optionsCmp = [] - if(diffSet.length>0) { - diffSet.forEach(item=>{ - backResource.forEach(item1=>{ - if(item==item1.id || item==item1.res) { + if (diffSet.length > 0) { + diffSet.forEach(item => { + backResource.forEach(item1 => { + if (item === item1.id || item === item1.res) { optionsCmp.push(item1) } }) @@ -289,15 +287,15 @@ let noResources = [{ id: -1, name: $t('Unauthorized or deleted resources'), - fullName: '/'+$t('Unauthorized or deleted resources'), + fullName: '/' + $t('Unauthorized or deleted resources'), children: [] }] - if(optionsCmp.length>0) { + if (optionsCmp.length > 0) { this.allNoResources = optionsCmp - optionsCmp = optionsCmp.map(item=>{ - return {id: item.id,name: item.name,fullName: item.res} + optionsCmp = optionsCmp.map(item => { + return { id: item.id, name: item.name, fullName: item.res } }) - optionsCmp.forEach(item=>{ + optionsCmp.forEach(item => { item.isNew = true }) noResources[0].children = optionsCmp @@ -307,57 +305,62 @@ } }, watch: { - //Watch the cacheParams + // Watch the cacheParams cacheParams (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": { - handler(code) { - if(code == 'spark://'){ - this.masterUrlState = true; - }else if(code == 'mesos://'){ - this.masterUrlState = true; - }else{ - this.masterUrlState = false; + master: { + handler (code) { + if (code === 'spark://') { + this.masterUrlState = true + } else if (code === 'mesos://') { + this.masterUrlState = true + } else { + this.masterUrlState = false this.masterUrl = '' } } - }, + } }, computed: { - cacheParams () { + resourceIdArr () { let isResourceId = [] let resourceIdArr = [] - if(this.resourceList.length>0) { - this.resourceList.forEach(v=>{ - this.options.forEach(v1=>{ - if(this.searchTree(v1,v)) { - isResourceId.push(this.searchTree(v1,v)) + if (this.resourceList.length > 0) { + this.resourceList.forEach(v => { + this.options.forEach(v1 => { + if (this.searchTree(v1, v)) { + isResourceId.push(this.searchTree(v1, v)) } }) }) - resourceIdArr = isResourceId.map(item=>{ - return {id: item.id,name: item.name,res: item.fullName} + resourceIdArr = isResourceId.map(item => { + return { id: item.id, name: item.name, res: item.fullName } }) } - let result = [] - resourceIdArr.forEach(item=>{ - this.allNoResources.forEach(item1=>{ - if(item.id==item1.id) { - // resultBool = true - result.push(item1) - } - }) - }) - this.noRes = result + return resourceIdArr + }, + cacheParams () { return { - resourceList: resourceIdArr, + resourceList: this.resourceIdArr, localParams: this.localParams, deployMode: this.deployMode, master: this.master, masterUrl: this.masterUrl, - queue:this.queue, + queue: this.queue } } }, @@ -370,7 +373,7 @@ // Non-null objects represent backfill if (!_.isEmpty(o)) { this.master = o.params.master || 'yarn' - this.deployMode = o.params.deployMode || 'client' + this.deployMode = o.params.deployMode || 'client' this.masterUrl = o.params.masterUrl || '' this.queue = o.params.queue || 'default' this.rawScript = o.params.rawScript || '' @@ -380,10 +383,10 @@ let resourceList = o.params.resourceList || [] if (resourceList.length) { _.map(resourceList, v => { - if(!v.id) { - this.store.dispatch('dag/getResourceId',{ + if (!v.id) { + this.store.dispatch('dag/getResourceId', { type: 'FILE', - fullName: '/'+v.res + fullName: '/' + v.res }).then(res => { this.resourceList.push(res.id) this.dataProcess(backResource) @@ -408,7 +411,7 @@ }, destroyed () { }, - components: { mLocalParams, mListBox, mResources, mScriptBox, Treeselect } + components: { mLocalParams, mListBox, Treeselect } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/datasource/pages/list/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/datasource/pages/list/index.vue index 1c5e41e5d2..5b290b422a 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/datasource/pages/list/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/datasource/pages/list/index.vue @@ -81,11 +81,11 @@ // Number of pages pageNo: 1, // Search value - searchVal: '', - + searchVal: '' + }, dialogVisible: false, - item: {}, + item: {} } }, mixins: [listUrlParamHandle], @@ -128,8 +128,8 @@ _getList (flag) { this.isLoading = !flag this.getDatasourcesListP(this.searchParams).then(res => { - if(this.searchParams.pageNo>1 && res.totalList.length == 0) { - this.searchParams.pageNo = this.searchParams.pageNo -1 + if (this.searchParams.pageNo > 1 && res.totalList.length === 0) { + this.searchParams.pageNo = this.searchParams.pageNo - 1 } else { this.datasourcesList = [] this.datasourcesList = res.totalList @@ -142,7 +142,7 @@ }, _onUpdate () { this._debounceGET('false') - }, + } }, watch: { // router diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/home/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/home/index.vue index 6f7d5ae788..71cff27092 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/home/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/home/index.vue @@ -19,13 +19,12 @@ diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/monitor/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/monitor/index.vue index c1ad81fd2f..60af1187f7 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/monitor/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/monitor/index.vue @@ -25,9 +25,9 @@ import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu' export default { name: 'monitor-index', - mounted() { - + mounted () { + }, components: { mSecondaryMenu } } - \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/zookeeperList.vue b/dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/zookeeperList.vue index 88fcfb025b..df987908f9 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/zookeeperList.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/_source/zookeeperList.vue @@ -49,11 +49,6 @@ \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/master.vue b/dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/master.vue index 8182dac639..40ff14b53d 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/master.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/monitor/pages/servers/master.vue @@ -68,7 +68,6 @@ import _ from 'lodash' import { mapActions } from 'vuex' import mGauge from './_source/gauge' - import mList from './_source/zookeeperList' import mSpin from '@/module/components/spin/spin' import mNoData from '@/module/components/noData/noData' import themeData from '@/module/echarts/themeData.json' @@ -95,7 +94,7 @@ this.getMasterData().then(res => { this.masterList = _.map(res, (v, i) => { return _.assign(v, { - id: v.host + "_" + v.id, + id: v.host + '_' + v.id, resInfo: JSON.parse(v.resInfo) }) }) @@ -104,7 +103,7 @@ this.isLoading = false }) }, - components: { mList, mListConstruction, mSpin, mNoData, mGauge } + components: { mListConstruction, mSpin, mNoData, mGauge } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/index.vue index fabd736ecc..4a993a9a14 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/index.vue +++ b/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 listUrlParamHandle from '@/module/mixin/listUrlParamHandle' import mConditions from '@/module/components/conditions/conditions' - import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu' import mListConstruction from '@/module/components/listConstruction/listConstruction' import { findComponentDownward } from '@/module/util/' @@ -109,15 +108,15 @@ * get data list */ _getList (flag) { - if(sessionStorage.getItem('isLeft')==0) { + if (sessionStorage.getItem('isLeft') === 0) { this.isLeft = false } else { this.isLeft = true } this.isLoading = !flag this.getProcessListP(this.searchParams).then(res => { - if(this.searchParams.pageNo>1 && res.totalList.length == 0) { - this.searchParams.pageNo = this.searchParams.pageNo -1 + if (this.searchParams.pageNo > 1 && res.totalList.length === 0) { + this.searchParams.pageNo = this.searchParams.pageNo - 1 } else { this.processListP = [] this.processListP = res.totalList @@ -146,13 +145,13 @@ created () { localStore.removeItem('subProcessId') }, - mounted() { - + mounted () { + }, beforeDestroy () { - sessionStorage.setItem('isLeft',1) + sessionStorage.setItem('isLeft', 1) }, - components: { mList, mConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData } + components: { mList, mConditions, mSpin, mListConstruction, mNoData } } @@ -185,4 +184,4 @@ } } } - \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/tree/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/tree/index.vue index 0c80d1892e..99455f8f8f 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/tree/index.vue +++ b/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 mNoData from '@/module/components/noData/noData' import { tasksType, tasksState } from '@/conf/home/pages/dag/_source/config' - import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu' import mListConstruction from '@/module/components/listConstruction/listConstruction' export default { @@ -106,7 +105,7 @@ props: {}, methods: { ...mapActions('dag', ['getViewTree']), - _close(){ + _close () { this.$router.go(-1) }, /** @@ -203,7 +202,7 @@ }, mounted () { }, - components: { mSpin, mSecondaryMenu, mListConstruction, mNoData } + components: { mSpin, mListConstruction, mNoData } } @@ -265,5 +264,4 @@ } } - diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue index 68ec207399..cf308f7238 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/_source/list.vue @@ -133,7 +133,7 @@ props: { }, methods: { - ...mapActions('dag', ['getScheduleList', 'scheduleOffline', 'scheduleOnline', 'getReceiver','deleteTiming']), + ...mapActions('dag', ['getScheduleList', 'scheduleOffline', 'scheduleOnline', 'getReceiver', 'deleteTiming']), /** * delete */ @@ -260,7 +260,7 @@ }, closeTiming () { this.timingDialog = false - }, + } }, watch: {}, created () { diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/index.vue index 17a49643a5..0540a32851 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/timing/index.vue @@ -28,15 +28,14 @@ diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/commandStateCount.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/commandStateCount.vue index f640a1e3c4..ab615e141c 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/commandStateCount.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/commandStateCount.vue @@ -70,7 +70,7 @@ }, watch: { - 'searchParams': { + searchParams: { deep: true, immediate: true, handler (o) { @@ -91,4 +91,4 @@ computed: {}, components: { mNoData } } - \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/defineUserCount.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/defineUserCount.vue index d509d50cf4..07e734987c 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/defineUserCount.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/defineUserCount.vue @@ -38,7 +38,7 @@ return { isSpin: true, msg: true, - parameter: {projectId: 0} + parameter: { projectId: 0 } } }, props: { @@ -71,9 +71,9 @@ }, created () { this.isSpin = true - this.parameter.projectId = this.projectId; + this.parameter.projectId = this.projectId this.getDefineUserCount(this.parameter).then(res => { - this.msg = res.data.count > 0 ? true : false + this.msg = res.data.count > 0 this.defineUserList = [] this._handleDefineUser(res) this.isSpin = false diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/processStateCount.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/processStateCount.vue index 34ba8265d5..277d799fba 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/processStateCount.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/processStateCount.vue @@ -53,7 +53,6 @@ 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 { @@ -75,7 +74,7 @@ this.$router.push({ name: 'projects-instance-list', query: { - stateType: _.find(stateType, ['label', name])['code'], + stateType: _.find(stateType, ['label', name]).code, startDate: this.searchParams.startDate, endDate: this.searchParams.endDate } @@ -85,11 +84,11 @@ let data = res.data.taskCountDtos this.processStateList = _.map(data, v => { return { - key: _.find(stateType, ['code', v.taskStateType])['label'], + key: _.find(stateType, ['code', v.taskStateType]).label, 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) // 首页不允许跳转 if (this.searchParams.projectId) { @@ -100,7 +99,7 @@ } }, watch: { - 'searchParams': { + searchParams: { deep: true, immediate: true, handler (o) { @@ -115,7 +114,7 @@ }) } }, - '$store.state.projects.sideBar': function() { + '$store.state.projects.sideBar': function () { echarts.init(document.getElementById('process-state-pie')).resize() } }, diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/queueCount.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/queueCount.vue index 00eef39ea2..5f2dae37ea 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/queueCount.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/queueCount.vue @@ -29,7 +29,7 @@ {{$t('Number')}} {{$t('State')}} - + {{$index+1}} {{item.value}} {{item.key}} @@ -76,7 +76,7 @@ } }, watch: { - 'searchParams': { + searchParams: { deep: true, immediate: true, handler (o) { @@ -98,4 +98,4 @@ }, components: { mNoData } } - \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskCtatusCount.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskCtatusCount.vue deleted file mode 100644 index 27b576575f..0000000000 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskCtatusCount.vue +++ /dev/null @@ -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. - */ - - - - diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskStatusCount.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskStatusCount.vue index e752bf4889..9fd45418f9 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskStatusCount.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/_source/taskStatusCount.vue @@ -74,7 +74,7 @@ this.$router.push({ name: 'task-instance', query: { - stateType: _.find(stateType, ['label', name])['code'], + stateType: _.find(stateType, ['label', name]).code, startDate: this.searchParams.startDate, endDate: this.searchParams.endDate } @@ -85,7 +85,7 @@ this.taskStatusList = _.map(data, v => { return { // CHECK!! - key: _.find(stateType, ['code', v.taskStateType])['label'], + key: _.find(stateType, ['code', v.taskStateType]).label, value: v.count, type: 'type' } @@ -102,7 +102,7 @@ } }, watch: { - 'searchParams': { + searchParams: { deep: true, immediate: true, handler (o) { diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/index.vue index 560b72e857..1fdf8a8561 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/index/index.vue @@ -68,12 +68,9 @@ diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/index.vue index 0836a52f1c..b02b297709 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/index.vue @@ -21,4 +21,4 @@ export default { name: 'process-instance-index' } - \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/details/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/details/index.vue index 88c88e079f..ac67c25c63 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/details/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/details/index.vue @@ -18,13 +18,12 @@ \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/gantt/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/gantt/index.vue index b39152e329..553d981c00 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/gantt/index.vue +++ b/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 mNoData from '@/module/components/noData/noData' 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' export default { @@ -111,7 +109,7 @@ destroyed () { }, computed: {}, - components: { mConditions, mSecondaryMenu, mListConstruction, mSpin, mNoData } + components: { mListConstruction, mSpin, mNoData } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue index 9e869f5770..69d1a4c503 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/instance/pages/list/_source/list.vue @@ -78,7 +78,7 @@ - + @@ -154,7 +154,7 @@ - + { - if(this.searchParams.pageNo>1 && res.totalList.length == 0) { - this.searchParams.pageNo = this.searchParams.pageNo -1 + if (this.searchParams.pageNo > 1 && res.totalList.length === 0) { + this.searchParams.pageNo = this.searchParams.pageNo - 1 } else { this.processInstanceList = [] this.processInstanceList = res.totalList @@ -148,15 +147,15 @@ * @desc Prevent functions from being called multiple times */ _debounceGET: _.debounce(function (flag) { - if(sessionStorage.getItem('isLeft')==0) { + if (sessionStorage.getItem('isLeft') === 0) { this.isLeft = false } else { this.isLeft = true } this._getProcessInstanceListP(flag) }, 100, { - 'leading': false, - 'trailing': true + leading: false, + trailing: true }) }, watch: { @@ -169,7 +168,7 @@ this.searchParams.pageNo = !_.isEmpty(a.query) && a.query.pageNo || 1 } }, - 'searchParams': { + searchParams: { deep: true, handler () { this._debounceGET() @@ -199,9 +198,9 @@ beforeDestroy () { // Destruction wheel clearInterval(this.setIntervalP) - sessionStorage.setItem('isLeft',1) + sessionStorage.setItem('isLeft', 1) }, - components: { mList, mInstanceConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData } + components: { mList, mInstanceConditions, mSpin, mListConstruction, mNoData } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/_source/graphGrid.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/_source/graphGrid.vue index eb5ced5dd0..fe685ba8eb 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/_source/graphGrid.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/_source/graphGrid.vue @@ -19,7 +19,7 @@ diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/index.vue index ebfb74af40..e6e21f71e6 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/kinship/index.vue @@ -39,7 +39,7 @@ v-tooltip.small.top.start="$t('Reset')" @click="reset" > - diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/index.vue index 00c7b5e7c2..c13b69733e 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/taskInstance/index.vue @@ -53,7 +53,6 @@ import mSpin from '@/module/components/spin/spin' import mNoData from '@/module/components/noData/noData' import listUrlParamHandle from '@/module/mixin/listUrlParamHandle' - import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu' import mListConstruction from '@/module/components/listConstruction/listConstruction' import mInstanceConditions from '@/conf/home/pages/projects/pages/_source/conditions/instance/taskInstance' @@ -106,7 +105,7 @@ _page (val) { this.searchParams.pageNo = val }, - _pageSize(val) { + _pageSize (val) { this.searchParams.pageSize = val }, /** @@ -114,8 +113,8 @@ */ _getList (flag) { this.isLoading = !flag - if(this.searchParams.pageNo == undefined) { - this.$router.push({ path: `/projects/index` }) + if (this.searchParams.pageNo === undefined) { + this.$router.push({ path: '/projects/index' }) return false } this.getTaskInstanceList(this.searchParams).then(res => { @@ -132,15 +131,15 @@ * @desc Prevent functions from being called multiple times */ _debounceGET: _.debounce(function (flag) { - if(sessionStorage.getItem('isLeft')==0) { + if (sessionStorage.getItem('isLeft') === 0) { this.isLeft = false } else { this.isLeft = true } this._getList(flag) }, 100, { - 'leading': false, - 'trailing': true + leading: false, + trailing: true }) }, watch: { @@ -164,9 +163,9 @@ beforeDestroy () { // Destruction wheel clearInterval(this.setIntervalP) - sessionStorage.setItem('isLeft',1) + sessionStorage.setItem('isLeft', 1) }, - components: { mList, mInstanceConditions, mSpin, mListConstruction, mSecondaryMenu, mNoData } + components: { mList, mInstanceConditions, mSpin, mListConstruction, mNoData } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/timing/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/timing/index.vue index b9d8ab566f..71c2569b9b 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/timing/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/timing/index.vue @@ -28,4 +28,4 @@ name: 'timing-index', components: { mList, mListConstruction } } - \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/index.vue index afed41677c..ce4e3bbc5e 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/index.vue @@ -25,7 +25,7 @@ export default { name: 'resource-index', components: { mSecondaryMenu }, - mounted() { - }, + mounted () { + } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/index.vue index 3a89a53877..2eb4e6b441 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/index.vue @@ -20,7 +20,7 @@ diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/create/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/create/index.vue index 9477373ae4..b7b7efce31 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/create/index.vue +++ b/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 codemirror from '../_source/codemirror' 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' let editor @@ -136,7 +134,7 @@ this.$message.warning(`${i18n.$t('Please enter the resource content')}`) return false } - if (editor.doc.size>3000) { + if (editor.doc.size > 3000) { this.$message.warning(`${i18n.$t('Resource content cannot exceed 3000 lines')}`) return false } @@ -179,7 +177,7 @@ editor.off($('.code-create-mirror'), 'keypress', this.keypress) }, computed: {}, - components: { mListConstruction, mConditions, mSpin, mListBoxF } + components: { mListConstruction, mListBoxF } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/createFolder/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/createFolder/index.vue index 7982f6bffb..7253101307 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/createFolder/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/createFolder/index.vue @@ -60,11 +60,7 @@ import i18n from '@/module/i18n' import { mapActions } from 'vuex' import { folderList } from '../_source/common' - import { handlerSuffix } from '../details/_source/utils' 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' export default { @@ -94,7 +90,7 @@ this.$message.success(res.msg) setTimeout(() => { this.spinnerLoading = false - this.$router.push({ path: `/resource/file`}) + this.$router.push({ path: '/resource/file' }) }, 800) }).catch(e => { this.$message.error(e.msg || '') @@ -109,7 +105,7 @@ } return true - }, + } }, watch: {}, created () { @@ -119,7 +115,7 @@ destroyed () { }, computed: {}, - components: { mListConstruction, mConditions, mSpin, mListBoxF } + components: { mListConstruction, mListBoxF } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/createUdfFolder/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/createUdfFolder/index.vue index 0cee78904f..17530815ce 100755 --- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/createUdfFolder/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/createUdfFolder/index.vue @@ -60,11 +60,7 @@ import i18n from '@/module/i18n' import { mapActions } from 'vuex' import { folderList } from '../_source/common' - import { handlerSuffix } from '../details/_source/utils' 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' export default { @@ -94,7 +90,7 @@ this.$message.success(res.msg) setTimeout(() => { this.spinnerLoading = false - this.$router.push({ path: `/resource/udf/resource`}) + this.$router.push({ path: '/resource/udf/resource' }) }, 800) }).catch(e => { this.$message.error(e.msg || '') @@ -108,7 +104,7 @@ return false } return true - }, + } }, watch: {}, created () { @@ -118,7 +114,7 @@ destroyed () { }, computed: {}, - components: { mListConstruction, mConditions, mSpin, mListBoxF } + components: { mListConstruction, mListBoxF } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/details/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/details/index.vue index 6f7dbe1e36..e3df62b8cf 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/details/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/details/index.vue @@ -130,8 +130,8 @@ this._getViewResources() }, 1000, { - 'leading': false, - 'trailing': true + leading: false, + trailing: true }), /** * down @@ -143,8 +143,8 @@ this._getViewResources() }, 1000, { - 'leading': false, - 'trailing': true + leading: false, + trailing: true }), /** * off handle diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue index 30e960f784..428d7aaf85 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/edit/index.vue @@ -80,8 +80,8 @@ ...mapActions('resource', ['getViewResources', 'updateContent']), ok () { if (this._validation()) { - this.spinnerLoading = true - this.updateContent({ + this.spinnerLoading = true + this.updateContent({ id: this.$route.params.id, content: editor.getValue() }).then(res => { @@ -97,7 +97,7 @@ } }, _validation () { - if (editor.doc.size>3000) { + if (editor.doc.size > 3000) { this.$message.warning(`${i18n.$t('Resource content cannot exceed 3000 lines')}`) return false } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue index 8536e09dbb..46021eeadf 100755 --- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/list.vue @@ -111,7 +111,7 @@ }, _go (item) { localStore.setItem('file', `${item.alias}|${item.size}`) - if(item.directory) { + if (item.directory) { localStore.setItem('currentDir', `${item.fullName}`) this.$router.push({ path: `/resource/file/subdirectory/${item.id}` }) } else { @@ -142,12 +142,12 @@ this.renameDialog = true }, - onUpDate(item) { + onUpDate (item) { this.$set(this.list, this.index, item) this.renameDialog = false }, - close() { + close () { this.renameDialog = false }, diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/rename.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/rename.vue index a83cc42e65..aa25fa62d2 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/rename.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/_source/rename.vue @@ -47,7 +47,6 @@ \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/index.vue index 899ba8f608..875ed6b2b6 100755 --- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/list/index.vue @@ -101,15 +101,15 @@ this.searchParams.pageSize = val }, _getList (flag) { - if(sessionStorage.getItem('isLeft')==0) { + if (sessionStorage.getItem('isLeft') === 0) { this.isLeft = false } else { this.isLeft = true } this.isLoading = !flag this.getResourcesListP(this.searchParams).then(res => { - if(this.searchParams.pageNo>1 && res.totalList.length == 0) { - this.searchParams.pageNo = this.searchParams.pageNo -1 + if (this.searchParams.pageNo > 1 && res.totalList.length === 0) { + this.searchParams.pageNo = this.searchParams.pageNo - 1 } else { this.fileResourcesList = res.totalList this.total = res.total @@ -124,7 +124,7 @@ this.searchParams.searchVal = '' this._debounceGET() }, - _onUpdate () { + _onUpdate () { this._debounceGET() } }, @@ -140,7 +140,7 @@ mounted () { }, beforeDestroy () { - sessionStorage.setItem('isLeft',1) + sessionStorage.setItem('isLeft', 1) }, components: { mListConstruction, mConditions, mList, mSpin, mNoData } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subFile/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subFile/index.vue index 78b9715956..2936aad760 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subFile/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subFile/index.vue @@ -83,8 +83,6 @@ import { handlerSuffix } from '../details/_source/utils' import codemirror from '../_source/codemirror' 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' @@ -121,7 +119,7 @@ this.$message.success(res.msg) setTimeout(() => { this.spinnerLoading = false - this.$router.push({ path: `/resource/file/subdirectory/${this.$route.params.id}`}) + this.$router.push({ path: `/resource/file/subdirectory/${this.$route.params.id}` }) }, 800) }).catch(e => { this.$message.error(e.msg || '') @@ -138,7 +136,7 @@ this.$message.warning(`${i18n.$t('Please enter the resource content')}`) return false } - if (editor.doc.size>3000) { + if (editor.doc.size > 3000) { this.$message.warning(`${i18n.$t('Resource content cannot exceed 3000 lines')}`) return false } @@ -181,7 +179,7 @@ editor.off($('.code-create-mirror'), 'keypress', this.keypress) }, computed: {}, - components: { mListConstruction, mConditions, mSpin, mListBoxF } + components: { mListConstruction, mListBoxF } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subFileFolder/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subFileFolder/index.vue index 4f3dbf6a6a..2b323b9f89 100755 --- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subFileFolder/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subFileFolder/index.vue @@ -60,10 +60,7 @@ import i18n from '@/module/i18n' import { mapActions } from 'vuex' import { folderList } from '../_source/common' - import { handlerSuffix } from '../details/_source/utils' 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' @@ -94,7 +91,7 @@ this.$message.success(res.msg) setTimeout(() => { this.spinnerLoading = false - this.$router.push({ path: `/resource/file/subdirectory/${this.$route.params.id}`}) + this.$router.push({ path: `/resource/file/subdirectory/${this.$route.params.id}` }) }, 800) }).catch(e => { this.$message.error(e.msg || '') @@ -109,7 +106,7 @@ } return true - }, + } }, watch: {}, created () { @@ -119,7 +116,7 @@ destroyed () { }, computed: {}, - components: { mListConstruction, mConditions, mSpin, mListBoxF } + components: { mListConstruction, mListBoxF } } diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/list.vue index c6f04b58f0..c7d739acc0 100755 --- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/list.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/list.vue @@ -110,7 +110,7 @@ }, _go (item) { localStore.setItem('file', `${item.alias}|${item.size}`) - if(item.directory) { + if (item.directory) { localStore.setItem('currentDir', `${item.fullName}`) this.$router.push({ path: `/resource/file/subdirectory/${item.id}` }) } else { @@ -141,12 +141,12 @@ this.renameDialog = true }, - onUpDate(item) { + onUpDate (item) { this.$set(this.list, this.index, item) this.renameDialog = false }, - close() { + close () { this.renameDialog = false }, @@ -168,7 +168,7 @@ setTimeout(() => { this.list = a }) - }, + } // Listening for routing changes // '$route': { // deep: false, diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/rename.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/rename.vue index 72c4178070..d649a1551d 100755 --- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/rename.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/_source/rename.vue @@ -67,12 +67,12 @@ _ok (fn) { this._verification().then(res => { if (this.name === this.item.alias) { - return new Promise((resolve,reject) => { - this.description === this.item.description ? reject({msg:'内容未修改'}) : resolve() + return new Promise((resolve, reject) => { + this.description === this.item.description ? reject({ msg: '内容未修改' }) : resolve() }) - }else{ + } else { return this.store.dispatch('resource/resourceVerifyName', { - fullName: localStore.getItem('currentDir')+'/'+this.name, + fullName: localStore.getItem('currentDir') + '/' + this.name, type: 'FILE' }) } @@ -101,10 +101,9 @@ } else { resolve() } - }) }, - close() { + close () { this.$emit('close') } }, @@ -120,4 +119,4 @@ }, components: { mPopup, mListBoxF } } - \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/index.vue index 7864dcf4fc..6c19297e6d 100755 --- a/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/resource/pages/file/pages/subdirectory/index.vue @@ -66,7 +66,6 @@ import mNoData from '@/module/components/noData/noData' import listUrlParamHandle from '@/module/mixin/listUrlParamHandle' import mConditions from '@/module/components/conditions/conditions' - import mListConstruction from '@/module/components/listConstruction/listConstruction' export default { name: 'resource-list-index-FILE', @@ -89,12 +88,12 @@ mixins: [listUrlParamHandle], props: {}, methods: { - ...mapActions('resource', ['getResourcesListP','getResourceId']), + ...mapActions('resource', ['getResourcesListP', 'getResourceId']), /** * File Upload */ _uploading () { - findComponentDownward(this.$root, 'roof-nav')._fileChildUpdate('FILE',this.searchParams.id) + findComponentDownward(this.$root, 'roof-nav')._fileChildUpdate('FILE', this.searchParams.id) }, _onConditions (o) { this.searchParams = _.assign(this.searchParams, o) @@ -107,15 +106,15 @@ this.searchParams.pageSize = val }, _getList (flag) { - if(sessionStorage.getItem('isLeft')==0) { + if (sessionStorage.getItem('isLeft') === 0) { this.isLeft = false } else { this.isLeft = true } this.isLoading = !flag this.getResourcesListP(this.searchParams).then(res => { - if(this.searchParams.pageNo>1 && res.totalList.length == 0) { - this.searchParams.pageNo = this.searchParams.pageNo -1 + if (this.searchParams.pageNo > 1 && res.totalList.length === 0) { + this.searchParams.pageNo = this.searchParams.pageNo - 1 } else { this.fileResourcesList = res.totalList this.total = res.total @@ -131,20 +130,20 @@ this.searchParams.searchVal = '' this._debounceGET() }, - _onUpdate () { + _onUpdate () { this.searchParams.id = this.$route.params.id this._debounceGET() }, - _ckOperation(index) { - let breadName ='' + _ckOperation (index) { + let breadName = '' this.breadList.forEach((item, i) => { - if(i<=index) { - breadName = breadName+'/'+item + if (i <= index) { + breadName = breadName + '/' + item } }) this.transferApi(breadName) }, - transferApi(api) { + transferApi (api) { this.getResourceId({ type: 'FILE', fullName: api @@ -174,9 +173,9 @@ this.breadList = dir }, beforeDestroy () { - sessionStorage.setItem('isLeft',1) + sessionStorage.setItem('isLeft', 1) }, - components: { mListConstruction, mConditions, mList, mSpin, mNoData } + components: { mConditions, mList, mSpin, mNoData } } \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/workerGroups/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/workerGroups/_source/list.vue index 733e79ce30..596729c070 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/workerGroups/_source/list.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/workerGroups/_source/list.vue @@ -82,6 +82,6 @@ this.list = this.workerGroupList }, mounted () {}, - components: {}, + components: {} } - \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/workerGroups/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/workerGroups/index.vue index 6bbf94c8d7..7f8bc6c445 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/workerGroups/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/security/pages/workerGroups/index.vue @@ -53,7 +53,6 @@ import mList from './_source/list' import store from '@/conf/home/store' import mSpin from '@/module/components/spin/spin' - import mCreateWorker from './_source/createWorker' import mNoData from '@/module/components/noData/noData' import listUrlParamHandle from '@/module/mixin/listUrlParamHandle' import mConditions from '@/module/components/conditions/conditions' @@ -100,8 +99,8 @@ _getList (flag) { this.isLoading = !flag this.getWorkerGroups(this.searchParams).then(res => { - if(this.searchParams.pageNo>1 && res.totalList.length == 0) { - this.searchParams.pageNo = this.searchParams.pageNo -1 + if (this.searchParams.pageNo > 1 && res.totalList.length === 0) { + this.searchParams.pageNo = this.searchParams.pageNo - 1 } else { this.workerGroupList = [] this.workerGroupList = res.totalList diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/user/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/user/index.vue index 197f903b35..8219a5f17f 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/user/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/user/index.vue @@ -25,8 +25,8 @@ import mSecondaryMenu from '@/module/components/secondaryMenu/secondaryMenu' export default { name: 'user-index', - mounted() { + mounted () { }, components: { mSecondaryMenu } } - \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/account/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/account/index.vue index c2ae1ed80f..69796705fb 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/account/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/account/index.vue @@ -27,8 +27,8 @@ export default { name: 'account-index', - mounted() { + mounted () { }, components: { mListConstruction, mInfo } } - \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/password/_source/info.vue b/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/password/_source/info.vue index 053954a1d7..5c19b5605a 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/password/_source/info.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/password/_source/info.vue @@ -107,7 +107,7 @@ * verification */ _verification () { - let regPassword = /^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?![`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]+$)[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、0-9A-Za-z]{6,22}$/; + let regPassword = /^(?![0-9]+$)(?![a-z]+$)(?![A-Z]+$)(?![`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]+$)[`~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、0-9A-Za-z]{6,22}$/ // password if (!regPassword.test(this.userPassword)) { diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/password/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/password/index.vue index 5ec1bb86ce..2ec45785fc 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/password/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/password/index.vue @@ -27,8 +27,8 @@ export default { name: 'password-index', - mounted() { + mounted () { }, components: { mListConstruction, mInfo } } - \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/token/_source/createToken.vue b/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/token/_source/createToken.vue index 5aec68af61..36d8009a6a 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/token/_source/createToken.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/token/_source/createToken.vue @@ -89,9 +89,9 @@ tokenLoading: false, auth: !Permissions.getAuth(), pickerOptions: { - disabledDate(time) { - return time.getTime() < Date.now() - 8.64e7 //当前时间以后可以选择当前时间 - }, + disabledDate (time) { + return time.getTime() < Date.now() - 8.64e7 // 当前时间以后可以选择当前时间 + } } } }, @@ -120,21 +120,21 @@ if (this.item) { param.id = this.item.id } - this.$refs['popup'].spinnerLoading = true + this.$refs.popup.spinnerLoading = true this.store.dispatch(`user/${this.item ? 'updateToken' : 'createToken'}`, param).then(res => { this.$emit('onUpdate') this.$message.success(res.msg) setTimeout(() => { - this.$refs['popup'].spinnerLoading = false + this.$refs.popup.spinnerLoading = false }, 800) }).catch(e => { this.$message.error(e.msg || '') - this.$refs['popup'].spinnerLoading = false + this.$refs.popup.spinnerLoading = false }) }, _generateToken () { this.tokenLoading = true - this.store.dispatch(`user/generateToken`, { + this.store.dispatch('user/generateToken', { userId: this.userId, expireTime: this.expireTime }).then(res => { @@ -151,7 +151,7 @@ _onChange () { this.token = '' }, - close() { + close () { this.$emit('close') } }, @@ -167,7 +167,7 @@ } } if (this.auth) { - this.store.dispatch(`security/getUsersAll`).then(res => { + this.store.dispatch('security/getUsersAll').then(res => { this.userIdList = _.map(res, v => _.pick(v, ['id', 'userName'])) d(this.userIdList[0].id) }) diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/token/_source/list.vue b/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/token/_source/list.vue index 7d92953283..4f9a37316e 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/token/_source/list.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/token/_source/list.vue @@ -105,4 +105,4 @@ }, components: { } } - \ No newline at end of file + diff --git a/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/token/index.vue b/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/token/index.vue index b46daadfc8..bceb89be28 100644 --- a/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/token/index.vue +++ b/dolphinscheduler-ui/src/js/conf/home/pages/user/pages/token/index.vue @@ -30,7 +30,7 @@