稽查配置children上下移动
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-07-23 18:04:24 +08:00
parent 87eac9f478
commit 05c6e9727f
1 changed files with 29 additions and 6 deletions

View File

@ -731,8 +731,18 @@
</template>
</el-table-column>
<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">
<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
size="mini"
type="text"
@ -907,24 +917,37 @@ export default {
return pre - target > curr - target ? curr : pre
})
},
handleUpMove(row) {
handleUpMove(row, isChildren = false, isLast = true) {
var index
var target
var list = this.list.filter((v, i) => {
return row.ModuleTypeId === v.ModuleTypeId && v.ModuleTypeValueCN && v.ObjectTypeValueCN && v.OptTypeValueCN && v.ChildrenTypeValueCN
})
if (isChildren) {
list = this.childrenList
}
list.forEach((v, i) => {
if (row.Id === v.Id) {
index = i
}
})
console.log(index)
if (index === 0) {
this.$alert('该行排序已是最高')
return
if (isLast) {
if (index === 0) {
this.$alert('该行排序已是最高')
return
} else {
target = list[index - 1]
}
} else {
target = list[index - 1]
if (index === this.list.length) {
this.$alert('该行排序已是最底')
return
} else {
target = list[index + 1]
}
}
console.log(list)
var params = [
{ Id: target.Id, Sort: row.Sort },