jinlin
2024-01-31 9025b9cf7ec8610003d445a31d93e35e7bd73c2e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<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>