gaoshp
2024-04-16 5ce658c5cf97b40cc0d84d8bfb37f96053ea8ef1
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
<!--
 * @Author: lzhe lzhe@example.com
 * @Date: 2024-03-26 10:28:33
 * @LastEditors: lzhe lzhe@example.com
 * @LastEditTime: 2024-04-02 17:48:31
 * @FilePath: /smart-web/src/views/master/person/main/index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
    <div class="dict-main">
        <el-form :inline="true" :model="searchData" abel-width="120px">
            <el-form-item label="菜单名称">
                <el-input v-model="searchData.name" placeholder="菜单名称" clearable />
            </el-form-item>
            <el-form-item label="菜单编号">
                <el-input v-model="searchData.code" placeholder="菜单编号" clearable></el-input>
            </el-form-item>
            <el-form-item label="所属应用">
                <el-select v-model="searchData.belongApplication" style="width: 100%">
                    <el-option key="CPS" label="CPS" value="CPS"/>
                    <el-option key="FMS" label="FMS" value="FMS"/>
                </el-select>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="searchclick">搜索</el-button>
                <el-button @click="searchClearBtn">清空</el-button>
            </el-form-item>
        </el-form>
        <div>
            <div class="dict-table">
                <el-table ref="multipleTableRef" :data="tableData" border row-key="id" style="width: 100%" class="multipleTableRef" @selection-change="handleSelectionChange" :tree-props="{ children: 'children', hasChildren: 'has' }">
                    <el-table-column type="selection" width="55" />
                    <el-table-column prop="name" label="菜单名称"></el-table-column>
                    <el-table-column prop="path" label="路由地址"></el-table-column>
                    <el-table-column prop="source" label="菜单图标">
                        <template #default="scope">
                            <component v-if="icons.includes(scope.row.source)" style="width: 20px;height: 20px;"
                                    :is='scope.row.source'></component>
                        </template>
                    </el-table-column>
                    <el-table-column prop="code" label="菜单编号"></el-table-column>
                    <el-table-column prop="alias" label="菜单别名"></el-table-column>
                    <el-table-column prop="sort" label="菜单排序"></el-table-column>
                    <el-table-column prop="isOpen" label="新窗口">
                        <template #default="scope">
                            <div>{{scope.row.isOpen == 0?"是":"否"}}</div>
                        </template>
                    </el-table-column>
                    <el-table-column prop="belongApplication" label="所属应用"></el-table-column>
                    <!-- <el-table-column prop="attachSize" label="附件大小">
                        <template #default="scope">
                            <span class="attachSize">{{scope.row.attachSize}} B</span>
                        </template>
                    </el-table-column> -->
                    <el-table-column fixed="right" label="操作">
                        <template #default="scope">
                            <el-button text type="primary" size="small" @click="table_del(scope.row, scope.$index)">权限配置</el-button>
                        </template>
                    </el-table-column>
                </el-table>
            </div>
        </div>
    </div>
</template>
<script>
    import * as ElementPlusIconsVue from '@element-plus/icons-vue'
    let icons = []
    for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
        icons.push(key)
    }
    export default {
        name: "attach",
        data(){
            return {
                icons,
                belongApplicationList: [],
                fileDialogVisible: false,
                getModalData: [],
                selection: [],
                total: 0,
                searchData: {
                    name: "",
                    code: "",
                    belongApplication: "",
                    parentId: ""
                },
                dialog: {
                    save: false,
                    allocation: false
                },
                tableData: []
            }
        },
        created(){
            
        },
        mounted(){
            this.searchBtn();
        },
        components: {
            ...ElementPlusIconsVue
        },
        methods: {
            exportFile(row,index){
                window.open(row.link);
            },
            codeClick() {
                
            },
            searchClearBtn() {
                this.searchData = {
                    name: "",
                    code: "",
                    belongApplication: "",
                    parentId: ""
                }
                this.searchBtn();
            },
            searchclick() {
                this.searchBtn();
            },
            searchBtn() {
                var obj = {};
                for(var key in this.searchData) {
                    if(this.searchData[key]) {
                        obj[key] = this.searchData[key];
                    }
                }
                this.$HTTP.get("/api/blade-system/menu/lazy-menu-list",obj).then(res=> {
                    if(res.code == 200) {
                        this.tableData = res.data;
                    }
                })
            },
            //删除
            table_del(row) {
                
            },
            //查看
            table_show(row){
                this.dialog.save = true
                this.$nextTick(() => {
                    this.$refs.saveDialog.open('show').setData(row)
                })
            },
            handleSelectionChange(selection) {
                this.selection = selection;
            },
            changeDepartment() {
                this.departmentVisible = true;
            },
            handleSizeChange(val) {
                console.log(`每页 ${val} 条`);
                this.searchData.current = "1";
                this.searchData.size = val;
                this.searchBtn();
            },
            handleCurrentChange(val) {
                console.log(`当前页: ${val}`);
                this.searchData.current = val;
                this.searchBtn();
            }
        }
    }
</script>
 
<style scoped>
    .dict-main {
        background-color: #fff;
        margin: 8px;
        padding: 8px;
    }
    .dict-Btn {
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid #dcdfe6;
        margin-bottom: 8px;
        padding-left: 8px;
        padding-right: 8px;
    }
    .dict-btn-bottom {
        padding-left: 8px;
        padding-right: 8px;
        margin-bottom: 8px;
    }
    .dict-table {
        padding-left: 8px;
        padding-right: 8px;
        margin-bottom: 8px;
        
    }
    .multipleTableRef {
        margin-bottom: 8px;
    }
    .attachSize {
        color:#3b8e8e;
        padding: 0 10px;
        font-size: 12px;
        background-color: #ebf4f4;
        border: 1px solid #d8e8e8;
    }
</style>