Browse Source

[Feature-#3805][server-UI] global params of UI (#4736)

* gloabl

* 全局变量取值修改

* remove files

* fixed

* remove basicSetting
pull/3/MERGE
renlu 4 years ago committed by GitHub
parent
commit
d28c856f5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      dolphinscheduler-ui/.env
  2. 6
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue
  3. 52
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/udp.vue

2
dolphinscheduler-ui/.env

@ -14,7 +14,7 @@
# limitations under the License. # limitations under the License.
# back end interface address # back end interface address
API_BASE = http://127.0.0.1:12345 API_BASE = http://192.168.xx.xx:12345
# If IP access is required for local development, remove the "#" # If IP access is required for local development, remove the "#"
#DEV_HOST = 192.168.xx.xx #DEV_HOST = 192.168.xx.xx

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

@ -178,7 +178,7 @@
:title="$t('Set the DAG diagram name')" :title="$t('Set the DAG diagram name')"
:visible.sync="dialogVisible" :visible.sync="dialogVisible"
width="auto"> width="auto">
<m-udp @onUdp="onUdpDialog" @close="closeDialog"></m-udp> <m-udp ref="mUdp" @onUdp="onUdpDialog" @close="closeDialog"></m-udp>
</el-dialog> </el-dialog>
<el-dialog <el-dialog
:title="$t('Please set the parameters before starting')" :title="$t('Please set the parameters before starting')"
@ -559,7 +559,11 @@
this.$message.warning(`${i18n.$t('Failed to create node to save')}`) this.$message.warning(`${i18n.$t('Failed to create node to save')}`)
return return
} }
this.dialogVisible = true this.dialogVisible = true
this.$nextTick(() => {
this.$refs.mUdp.reloadParam()
})
}, },
/** /**
* Return to the previous child node * Return to the previous child node

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

@ -196,34 +196,24 @@
*/ */
close () { close () {
this.$emit('close') this.$emit('close')
}
},
watch: {
checkedTimeout (val) {
if (!val) {
this.timeout = 0
this.store.commit('dag/setTimeout', _.cloneDeep(this.timeout))
}
}
}, },
created () { /**
* reload localParam
*/
reloadParam () {
const dag = _.cloneDeep(this.store.state.dag) const dag = _.cloneDeep(this.store.state.dag)
let fixedParam = [] let fixedParam = []
const tasks = this.store.state.dag.tasks const tasks = this.store.state.dag.tasks
for (const task of tasks) { for (const task of tasks) {
const localParam = task.params ? task.params.localParams : [] const localParam = task.params ? task.params.localParams : []
if (localParam && localParam.length > 0) { localParam.forEach(l => {
fixedParam = fixedParam.concat(localParam) if (!fixedParam.some(f => { return f.prop === l.prop })) {
} fixedParam.push(Object.assign({
}
fixedParam = fixedParam.map(f => {
return {
prop: f.prop,
value: f.value,
ifFixed: true ifFixed: true
}, l))
} }
}) })
}
let globalParams = _.cloneDeep(dag.globalParams) let globalParams = _.cloneDeep(dag.globalParams)
@ -237,9 +227,27 @@
return g return g
} }
}) })
let udpList = [...fixedParam, ...globalParams].sort(s => {
this.udpList = [...fixedParam, ...globalParams] if (s.ifFixed) {
this.udpListCache = [...fixedParam, ...globalParams] return -1
} else {
return 1
}
})
this.udpList = udpList
this.udpListCache = udpList
}
},
watch: {
checkedTimeout (val) {
if (!val) {
this.timeout = 0
this.store.commit('dag/setTimeout', _.cloneDeep(this.timeout))
}
}
},
created () {
const dag = _.cloneDeep(this.store.state.dag)
this.name = dag.name this.name = dag.name
this.originalName = dag.name this.originalName = dag.name

Loading…
Cancel
Save