Browse Source

fix eslint: unexpected mutation of prop

pull/3/MERGE
chengshiwen 4 years ago
parent
commit
d06c9f8ad6
  1. 1
      dolphinscheduler-ui/.eslintrc.yml
  2. 12
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/dag.vue
  3. 8
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/selectInput.vue
  4. 7
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/_source/workerGroups.vue
  5. 8
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
  6. 1
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/dependItemList.vue
  7. 1
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/nodeStatus.vue
  8. 2
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/_source/udfs.vue
  9. 1
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/conditions.vue
  10. 1
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/dependent.vue
  11. 9
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/udp/_source/selectTenant.vue
  12. 26
      dolphinscheduler-ui/src/js/conf/home/pages/projects/pages/definition/pages/list/_source/email.vue
  13. 9
      dolphinscheduler-ui/src/js/module/components/priority/priority.vue

1
dolphinscheduler-ui/.eslintrc.yml

@ -34,7 +34,6 @@ plugins:
- vue - vue
rules: rules:
vue/script-indent: ['error', 2, { 'baseIndent': 1, 'switchCase': 1 }] vue/script-indent: ['error', 2, { 'baseIndent': 1, 'switchCase': 1 }]
vue/no-mutating-props: 'off'
prefer-promise-reject-errors: 'off' prefer-promise-reject-errors: 'off'
no-prototype-builtins: 'off' no-prototype-builtins: 'off'
no-mixed-operators: 'off' no-mixed-operators: 'off'

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

@ -156,7 +156,7 @@
:visible.sync="nodeDrawer" :visible.sync="nodeDrawer"
size="50%" size="50%"
:with-header="false"> :with-header="false">
<m-form-model v-if="nodeDrawer" :nodeData = nodeData @addTaskInfo="addTaskInfo" @cacheTaskInfo="cacheTaskInfo" @close="close" @onSubProcess="onSubProcess"></m-form-model> <m-form-model v-if="nodeDrawer" :nodeData=nodeData @seeHistory="seeHistory" @addTaskInfo="addTaskInfo" @cacheTaskInfo="cacheTaskInfo" @close="close" @onSubProcess="onSubProcess"></m-form-model>
</el-drawer> </el-drawer>
<el-drawer <el-drawer
:visible.sync="lineDrawer" :visible.sync="lineDrawer"
@ -628,6 +628,16 @@
this.lineDrawer = true this.lineDrawer = true
}, },
seeHistory (taskName) {
this.nodeData.self.$router.push({
name: 'task-instance',
query: {
processInstanceId: this.nodeData.self.$route.params.id,
taskName: taskName
}
})
},
addTaskInfo ({ item, fromThis }) { addTaskInfo ({ item, fromThis }) {
this.addTasks(item) this.addTasks(item)
this.nodeDrawer = false this.nodeDrawer = false

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

@ -20,7 +20,7 @@
:disabled="isDetails" :disabled="isDetails"
size="small" size="small"
@change="_onChange" @change="_onChange"
v-model="value"> v-model="selectedValue">
<el-input <el-input
ref="input" ref="input"
slot="trigger" slot="trigger"
@ -53,6 +53,7 @@
name: 'form-select-input', name: 'form-select-input',
data () { data () {
return { return {
selectedValue: this.value,
isIconState: false, isIconState: false,
isInput: true isInput: true
} }
@ -107,9 +108,12 @@
} }
}, },
watch: { watch: {
value (val) {
this.selectedValue = val
}
}, },
created () { created () {
this._setIconState(this.value) this._setIconState(this.selectedValue)
}, },
mounted () { mounted () {
}, },

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

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

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

@ -438,13 +438,7 @@
* Jump to task instance * Jump to task instance
*/ */
_seeHistory () { _seeHistory () {
this.nodeData.self.$router.push({ this.$emit('seeHistory', this.backfillItem.name)
name: 'task-instance',
query: {
processInstanceId: this.nodeData.self.$route.params.id,
taskName: this.backfillItem.name
}
})
}, },
/** /**
* Enter the child node to judge the process instance or the process definition * Enter the child node to judge the process instance or the process definition

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

@ -109,7 +109,6 @@
* remove task * remove task
*/ */
_remove (i) { _remove (i) {
this.dependTaskList[this.index].dependItemList.splice(i, 1)
this._removeTip() this._removeTip()
if (!this.dependItemList.length || this.dependItemList.length === 0) { if (!this.dependItemList.length || this.dependItemList.length === 0) {
this.$emit('on-delete-all', { this.$emit('on-delete-all', {

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

@ -87,7 +87,6 @@
* remove task * remove task
*/ */
_remove (i) { _remove (i) {
this.dependTaskList[this.index].dependItemList.splice(i, 1)
this._removeTip() this._removeTip()
if (!this.dependItemList.length || this.dependItemList.length === 0) { if (!this.dependItemList.length || this.dependItemList.length === 0) {
this.$emit('on-delete-all', { this.$emit('on-delete-all', {

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

@ -93,7 +93,7 @@
}, },
type (a) { type (a) {
// The props parameter needs to be changed due to the scene. // The props parameter needs to be changed due to the scene.
this.udfs = '' this.$emit('on-udfsData', '')
if (a === 'HIVE') { if (a === 'HIVE') {
this._getUdfList() this._getUdfList()
} else { } else {

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

@ -99,6 +99,7 @@
$('body').find('.tooltip.fade.top.in').remove() $('body').find('.tooltip.fade.top.in').remove()
}, },
_onDeleteAll (i) { _onDeleteAll (i) {
this.dependTaskList[this.index].dependItemList.splice(i, 1)
this.dependTaskList.map((item, i) => { this.dependTaskList.map((item, i) => {
if (item.dependItemList.length === 0) { if (item.dependItemList.length === 0) {
this.dependTaskList.splice(i, 1) this.dependTaskList.splice(i, 1)

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

@ -97,6 +97,7 @@
$('body').find('.tooltip.fade.top.in').remove() $('body').find('.tooltip.fade.top.in').remove()
}, },
_onDeleteAll (i) { _onDeleteAll (i) {
this.dependTaskList[this.index].dependItemList.splice(i, 1)
this.dependTaskList.map((item, i) => { this.dependTaskList.map((item, i) => {
if (item.dependItemList.length === 0) { if (item.dependItemList.length === 0) {
this.dependTaskList.splice(i, 1) this.dependTaskList.splice(i, 1)

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

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

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

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

9
dolphinscheduler-ui/src/js/module/components/priority/priority.vue

@ -16,7 +16,7 @@
*/ */
<template> <template>
<div class="priority-model"> <div class="priority-model">
<el-select @change="_onChange" size="small" v-model="value" style="width: 130px;" :disabled="isDetails"> <el-select @change="_onChange" size="small" v-model="selectedValue" style="width: 130px;" :disabled="isDetails">
<el-option <el-option
v-for="item in priorityList" v-for="item in priorityList"
:key="item.code" :key="item.code"
@ -38,6 +38,7 @@
name: 'priority', name: 'priority',
data () { data () {
return { return {
selectedValue: this.value,
priorityList: [ priorityList: [
{ {
code: 'HIGHEST', code: 'HIGHEST',
@ -84,10 +85,14 @@
return `<em class="${o.unicode}" style="color:${o.color}"></em>` return `<em class="${o.unicode}" style="color:${o.color}"></em>`
}, },
_onChange (o) { _onChange (o) {
this.value = o
this.$emit('priorityEvent', o) this.$emit('priorityEvent', o)
} }
}, },
watch: {
value (val) {
this.selectedValue = val
}
},
created () { created () {
}, },
mounted () { mounted () {

Loading…
Cancel
Save