字典子项增加排序
continuous-integration/drone/push Build is passing Details

main
wangxiaoshuang 2025-06-19 13:39:12 +08:00
parent 50ae94bf08
commit a41359111f
2 changed files with 33 additions and 67 deletions

View File

@ -418,10 +418,11 @@ export function addOrUpdateBasicDic(param) {
})
}
export function getDictionaryChildList(id) {
export function getDictionaryChildList(data) {
return request({
url: `/Dictionary/getChildList/${id}`,
method: 'get'
url: `/Dictionary/getChildList`,
method: 'post',
data
})
}

View File

@ -7,74 +7,28 @@
<el-button type="primary" size="mini" @click="handleAdd"></el-button>
</span>
</div>
<el-table
v-loading="loading"
v-adaptive="{bottomOffset:45}"
:data="list"
stripe
size="small"
height="100"
>
<el-table v-loading="loading" v-adaptive="{ bottomOffset: 45 }" :data="list" stripe size="small" height="100"
@sort-change="handleSortByColumn">
<el-table-column type="index" width="60" />
<el-table-column
v-if="!~$route.path.indexOf('select')"
prop="Code"
label="字典键值"
min-width="180"
show-overflow-tooltip
/>
<el-table-column
prop="ValueCN"
label="中文值"
min-width="180"
show-overflow-tooltip
/>
<el-table-column
prop="Value"
label="英文值"
min-width="180"
show-overflow-tooltip
/>
<el-table-column
prop="ChildGroup"
label="分组"
min-width="180"
show-overflow-tooltip
/>
<el-table-column
prop="ShowOrder"
label="显示顺序"
min-width="180"
show-overflow-tooltip
/>
<el-table-column
prop="Description"
label="描述"
min-width="180"
show-overflow-tooltip
/>
<el-table-column v-if="!~$route.path.indexOf('select')" prop="Code" label="字典键值" min-width="180"
show-overflow-tooltip sortable='custom' />
<el-table-column prop="ValueCN" label="中文值" min-width="180" show-overflow-tooltip sortable='custom' />
<el-table-column prop="Value" label="英文值" min-width="180" show-overflow-tooltip sortable='custom' />
<el-table-column prop="ChildGroup" label="分组" min-width="180" show-overflow-tooltip sortable='custom' />
<el-table-column prop="ShowOrder" label="显示顺序" min-width="180" show-overflow-tooltip sortable='custom' />
<el-table-column prop="Description" label="描述" min-width="180" show-overflow-tooltip sortable='custom' />
<el-table-column label="是否可用" width="100" fixed="right">
<template slot-scope="scope">
<el-switch
v-model="scope.row.IsEnable"
:active-value="true"
:inactive-value="false"
@change="(event) => {return switchChange(event, scope.row)}"
/>
<el-switch v-model="scope.row.IsEnable" :active-value="true" :inactive-value="false"
@change="(event) => { return switchChange(event, scope.row) }" />
</template>
</el-table-column>
<el-table-column label="操作" width="150" fixed="right">
<template slot-scope="scope">
<el-button
type="text"
@click="handleEdit(scope.row)"
>
<el-button type="text" @click="handleEdit(scope.row)">
编辑
</el-button>
<el-button
type="text"
@click="handleDelete(scope.row)"
>
<el-button type="text" @click="handleDelete(scope.row)">
删除
</el-button>
</template>
@ -91,7 +45,8 @@ import DictionaryChildAddOrUpdateForm from './DictionaryChildAddOrUpdateForm'
const searchDataDefault = () => {
return {
parentId: ''
Asc: true,
SortField: 'ShowOrder',
}
}
export default {
@ -121,6 +76,17 @@ export default {
this.getList()
},
methods: {
//
handleSortByColumn(column) {
if (column.order === 'ascending') {
this.searchData.Asc = true
} else {
this.searchData.Asc = false
}
this.searchData.SortField = column.prop
this.searchData.PageIndex = 1
this.getList()
},
handleChild(row) {
this.drawerChild = true
this.getDictionaryChildList(row.Id)
@ -172,7 +138,8 @@ export default {
//
getList() {
this.loading = true
getDictionaryChildList(this.parent.Id).then(res => {
this.searchData.ParentId = this.parent.Id
getDictionaryChildList(this.searchData).then(res => {
this.loading = false
this.list = res.Result
}).catch(() => { this.loading = false })
@ -190,6 +157,4 @@ export default {
}
</script>
<style scoped>
</style>
<style scoped></style>