稽查配置children上下移动
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
87eac9f478
commit
05c6e9727f
|
@ -731,8 +731,18 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="TrialConfigRelyFieldName" label="依赖字段" min-width="120px" :show-overflow-tooltip="true" />
|
<el-table-column prop="TrialConfigRelyFieldName" label="依赖字段" min-width="120px" :show-overflow-tooltip="true" />
|
||||||
<el-table-column label="操作" align="center" min-width="180" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" min-width="180" class-name="small-padding fixed-width" fixed="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="handleUpMove(scope.row, true, true)"
|
||||||
|
>上移</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
@click="handleUpMove(scope.row, true, false)"
|
||||||
|
>下移</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -907,24 +917,37 @@ export default {
|
||||||
return pre - target > curr - target ? curr : pre
|
return pre - target > curr - target ? curr : pre
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleUpMove(row) {
|
handleUpMove(row, isChildren = false, isLast = true) {
|
||||||
var index
|
var index
|
||||||
var target
|
var target
|
||||||
var list = this.list.filter((v, i) => {
|
var list = this.list.filter((v, i) => {
|
||||||
return row.ModuleTypeId === v.ModuleTypeId && v.ModuleTypeValueCN && v.ObjectTypeValueCN && v.OptTypeValueCN && v.ChildrenTypeValueCN
|
return row.ModuleTypeId === v.ModuleTypeId && v.ModuleTypeValueCN && v.ObjectTypeValueCN && v.OptTypeValueCN && v.ChildrenTypeValueCN
|
||||||
})
|
})
|
||||||
|
if (isChildren) {
|
||||||
|
list = this.childrenList
|
||||||
|
}
|
||||||
list.forEach((v, i) => {
|
list.forEach((v, i) => {
|
||||||
if (row.Id === v.Id) {
|
if (row.Id === v.Id) {
|
||||||
index = i
|
index = i
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(index)
|
console.log(index)
|
||||||
if (index === 0) {
|
if (isLast) {
|
||||||
this.$alert('该行排序已是最高')
|
if (index === 0) {
|
||||||
return
|
this.$alert('该行排序已是最高')
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
target = list[index - 1]
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
target = list[index - 1]
|
if (index === this.list.length) {
|
||||||
|
this.$alert('该行排序已是最底')
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
target = list[index + 1]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(list)
|
console.log(list)
|
||||||
var params = [
|
var params = [
|
||||||
{ Id: target.Id, Sort: row.Sort },
|
{ Id: target.Id, Sort: row.Sort },
|
||||||
|
|
Loading…
Reference in New Issue