<template>
|
<div class="fa-card-a" shadow="never">
|
<div class="mod-sys__menu">
|
<zt-table-wraper v-slot="{ table }" delete-url="/sys/menu" query-url="/sys/menu/tree" v-bind:paging='false'>
|
<el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()">
|
<el-form-item>
|
<zt-button style="margin-left: 30px" type="add" @click="table.editHandle()"/>
|
</el-form-item>
|
</el-form>
|
<el-table v-loading="table.dataLoading" :data="table.dataList" border row-key="id"
|
class="myTable"
|
:cell-style="cellStyle"
|
v-adaptive="{bottomOffset:50}"
|
height="650px"
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
|
<el-table-column :label="$t('menu.name')" align="left" min-width="250" prop="name"/>
|
<el-table-column :label="$t('menu.icon')" align="center" min-width="60" prop="icon">
|
<template slot-scope="scope">
|
<svg aria-hidden="true" class="icon-svg">
|
<use :xlink:href="`#${scope.row.icon}`"></use>
|
</svg>
|
</template>
|
</el-table-column>
|
<zt-table-column-dict :label="$t('menu.type')" align="center" dict="menu_type" min-width="50"
|
prop="type"/>
|
<el-table-column :label="$t('menu.sort')" align="center" min-width="60" prop="sort"/>
|
<el-table-column align="center" label="显示" min-width="60" prop="showMenu"/>
|
<el-table-column :label="$t('menu.url')" :show-overflow-tooltip="true" prop="url" width="400"/>
|
<el-table-column :label="$t('menu.permissions')" :show-overflow-tooltip="true" prop="permissions"
|
width="150"/>
|
<el-table-column :label="$t('menu.remark')" :show-overflow-tooltip="true" min-width="60" prop="remark"/>
|
<zt-table-column-handle :has-delete="isNotPlatform" :has-edit="isNotPlatform" :table="table" width="200"/>
|
</el-table>
|
<!-- 弹窗, 新增 / 修改 -->
|
<add-or-update @refreshDataList="table.query"/>
|
</zt-table-wraper>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import AddOrUpdate from './menu-add-or-update'
|
|
export default {
|
data() {
|
return {
|
dataForm: {
|
id: ''
|
}
|
}
|
},
|
components: {
|
AddOrUpdate
|
},
|
methods: {
|
cellStyle({column}) {
|
if (column.label === '名称') {
|
return 'text-align: left !important;'
|
}
|
},
|
isNotPlatform(row) {
|
return true;
|
return !this.$equalsIgnoreType(row.type, this.$dict.MenuType.PLATFORM)// 平台不允许修改删除
|
}
|
}
|
}
|
</script>
|
|
<style>
|
body .el-table.myTable{
|
overflow: hidden;
|
}
|
</style>
|