Commit d8e6cfad by 郑艺斌

fix: 修复字典管理弹出滚动问题

parent 6e374532
<template> <template>
<div style="padding:10px"> <div style="padding:10px; height: calc(100% - 80px);">
<vxe-toolbar :refresh="{query: refreshList}" custom> <vxe-toolbar :refresh="{query: refreshList}" custom>
<template #buttons> <template #buttons>
<el-button type="primary" size="small" icon="el-icon-plus" @click="add()">新建</el-button> <el-button type="primary" size="small" icon="el-icon-plus" @click="add()">新建</el-button>
<el-button v-if="hasPermission('sys:dict:del')" type="danger" size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.dictValueTable && $refs.dictValueTable.getCheckboxRecords().length === 0" plain>删除</el-button> <el-button v-if="hasPermission('sys:dict:del')" type="danger" size="small" icon="el-icon-delete" @click="del()"
:disabled="$refs.dictValueTable && $refs.dictValueTable.getCheckboxRecords().length === 0" plain>删除
</el-button>
</template> </template>
</vxe-toolbar> </vxe-toolbar>
<vxe-table <vxe-table border="inner" auto-resize resizable height="auto" :scroll-y="{ enabled: false }" :loading="loading"
border="inner" size="small" ref="dictValueTable" show-header-overflow show-overflow highlight-hover-row :menu-config="{}"
auto-resize :print-config="{}" :import-config="{}" :export-config="{}" :sort-config="{remote:true}" :data="dataList"
resizable
height="auto"
:loading="loading"
size="small"
ref="dictValueTable"
show-header-overflow
show-overflow
highlight-hover-row
:menu-config="{}"
:print-config="{}"
:import-config="{}"
:export-config="{}"
:sort-config="{remote:true}"
:data="dataList"
:checkbox-config="{}"> :checkbox-config="{}">
<vxe-column type="seq" width="40"></vxe-column> <vxe-column type="seq" width="40"></vxe-column>
<vxe-column type="checkbox" width="40px"></vxe-column> <vxe-column type="checkbox" width="40px"></vxe-column>
<vxe-column <vxe-column field="label" title="标签">
field="label"
title="标签">
<template slot-scope="scope"> <template slot-scope="scope">
<el-link type="primary" :underline="false" v-if="hasPermission('sys:dict:edit')" @click="edit(scope.row.id)">{{scope.row.label}}</el-link> <el-link type="primary" :underline="false" v-if="hasPermission('sys:dict:edit')" @click="edit(scope.row.id)">
{{scope.row.label}}</el-link>
<span v-else>{{scope.row.label}}</span> <span v-else>{{scope.row.label}}</span>
</template> </template>
</vxe-column > </vxe-column>
<vxe-column title="键值" field="value"></vxe-column> <vxe-column title="键值" field="value"></vxe-column>
<vxe-column title="排序" field="sort"></vxe-column> <vxe-column title="排序" field="sort"></vxe-column>
<vxe-column title="操作" width="250px" fixed="right" align="center"> <vxe-column title="操作" width="250px" fixed="right" align="center">
...@@ -54,9 +41,9 @@ ...@@ -54,9 +41,9 @@
</template> </template>
<script> <script>
import DictValueForm from './DictValueForm' import DictValueForm from './DictValueForm'
import DictService from '@/api/sys/DictService' import DictService from '@/api/sys/DictService'
export default { export default {
data () { data () {
return { return {
dataList: [], dataList: [],
...@@ -79,7 +66,7 @@ ...@@ -79,7 +66,7 @@
if (dictTypeId) { if (dictTypeId) {
this.dictTypeId = dictTypeId this.dictTypeId = dictTypeId
} }
this.dictService.getDictValue(this.dictTypeId).then(({data}) => { this.dictService.getDictValue(this.dictTypeId).then(({ data }) => {
this.dataList = data this.dataList = data
this.loading = false this.loading = false
}) })
...@@ -88,14 +75,14 @@ ...@@ -88,14 +75,14 @@
add () { add () {
this.dictVisible = true this.dictVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.dictValueForm.init('add', {dictValueId: '', dictTypeId: this.dictTypeId}) this.$refs.dictValueForm.init('add', { dictValueId: '', dictTypeId: this.dictTypeId })
}) })
}, },
// 修改 // 修改
edit (id) { edit (id) {
this.dictVisible = true this.dictVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.dictValueForm.init('edit', {dictValueId: id, dictTypeId: this.dictTypeId}) this.$refs.dictValueForm.init('edit', { dictValueId: id, dictTypeId: this.dictTypeId })
}) })
}, },
// 删除 // 删除
...@@ -108,7 +95,7 @@ ...@@ -108,7 +95,7 @@
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
this.dictService.deleteDictValue(ids).then(({data}) => { this.dictService.deleteDictValue(ids).then(({ data }) => {
this.$message.success(data) this.$message.success(data)
this.refreshList() this.refreshList()
this.$dictUtils.refreshDictList() this.$dictUtils.refreshDictList()
...@@ -119,5 +106,5 @@ ...@@ -119,5 +106,5 @@
this.$emit('closeRight') this.$emit('closeRight')
} }
} }
} }
</script> </script>
...@@ -91,7 +91,9 @@ export default { ...@@ -91,7 +91,9 @@ export default {
captchaImg: '', captchaImg: '',
inputForm: { inputForm: {
username: 'admin', username: 'admin',
// username: '',
password: 'admin', password: 'admin',
// password: '',
uuid: '', uuid: '',
code: '' code: ''
}, },
......
...@@ -150,6 +150,9 @@ export default { ...@@ -150,6 +150,9 @@ export default {
}, },
// 表格新增 // 表格新增
tableDataADD () { tableDataADD () {
if (!this.formData.childDtoList) {
this.$set(this.formData, 'childDtoList', [])
}
this.formData.childDtoList.push({}) this.formData.childDtoList.push({})
}, },
// 表格删除 // 表格删除
...@@ -186,4 +189,5 @@ export default { ...@@ -186,4 +189,5 @@ export default {
} }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment