Browse Source

菜单管理修改

master
陈薪名 1 year ago
parent
commit
f30f0a48cd
  1. 31
      src/views/system/menu/index.vue

31
src/views/system/menu/index.vue

@ -46,8 +46,8 @@
:expand-column-key="expandColumnKey" :expand-column-key="expandColumnKey"
:columns="columns" :columns="columns"
:data="list" :data="list"
:width="1600" :width="clientWidth-300"
:height="600" :height="clientHeight-280"
@row-expand="onRowExpanded" @row-expand="onRowExpanded"
@expanded-rows-change="onExpandedRowsChange" @expanded-rows-change="onExpandedRowsChange"
fixed fixed
@ -93,15 +93,17 @@
</template> </template>
<script lang="tsx" setup> <script lang="tsx" setup>
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict' import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
import { handleTree, unflatten } from '@/utils/tree' import { handleTree } from '@/utils/tree'
import * as MenuApi from '@/api/system/menu' import * as MenuApi from '@/api/system/menu'
import MenuForm from './MenuForm.vue' import MenuForm from './MenuForm.vue'
import { CACHE_KEY, useCache } from '@/hooks/web/useCache' import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
import { getInfo } from '@/api/login' import { getInfo } from '@/api/login'
import Icon from '@/components/Icon/src/Icon.vue' import Icon from '@/components/Icon/src/Icon.vue'
import { ElButton } from 'element-plus' import { ElButton, TableV2FixedDir } from 'element-plus'
defineOptions({ name: 'SystemMenu' }) defineOptions({ name: 'SystemMenu' })
const clientWidth = window.document.documentElement.clientWidth
const clientHeight = window.document.documentElement.clientHeight
const { wsCache } = useCache() const { wsCache } = useCache()
const { t } = useI18n() // const { t } = useI18n() //
@ -120,9 +122,6 @@ const refreshTable = ref(true) // 重新渲染表格状态
const expandedRowKeys = ref<string[]>([]) const expandedRowKeys = ref<string[]>([])
const expandColumnKey = ref('name') const expandColumnKey = ref('name')
/** 查询列表 */ /** 查询列表 */
const getList = async () => { const getList = async () => {
loading.value = true loading.value = true
@ -256,25 +255,17 @@ const generateColumns = [{
// v-hasPermi={['system:menu:update']} // v-hasPermi={['system:menu:update']}
// v-hasPermi={['system:menu:create']} // v-hasPermi={['system:menu:create']}
// v-hasPermi={['system:menu:delete']} // v-hasPermi={['system:menu:delete']}
}] }].map((column, columnIndex) => {
let fixed!: TableV2FixedDir
if (columnIndex == 7) fixed = TableV2FixedDir.RIGHT
return { ...column, fixed }
})
const onRowExpanded = () => { const onRowExpanded = () => {
} }
const onExpandedRowsChange = () => { const onExpandedRowsChange = () => {
} }
// const generateColumns = (length = 10, prefix = 'column-', props?: any) =>
// Array.from({ length }).map((_, columnIndex) => ({
// ...props,
// key: `${prefix}${columnIndex}`,
// dataKey: `${prefix}${columnIndex}`,
// title: `Column ${columnIndex}`,
// width: 150,
// }))
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
await getList() await getList()

Loading…
Cancel
Save