From 706f7a1328df01219b663826bd5c6e8ebb0ef185 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期六, 27 一月 2024 11:42:56 +0800
Subject: [PATCH] Mr.Shi

---
 company/src/components/system/menu/OperaMenuComWindow.vue |  164 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 164 insertions(+), 0 deletions(-)

diff --git a/company/src/components/system/menu/OperaMenuComWindow.vue b/company/src/components/system/menu/OperaMenuComWindow.vue
new file mode 100644
index 0000000..efafc84
--- /dev/null
+++ b/company/src/components/system/menu/OperaMenuComWindow.vue
@@ -0,0 +1,164 @@
+<template>
+    <GlobalWindow
+        class="handle-table-dialog"
+        :title="title"
+        :visible.sync="visible"
+        :confirm-working="isWorking"
+        @confirm="confirm"
+    >
+        <p class="tip" v-if="form.parent != null && form.id == null">涓� <em>{{parentName}}</em> 鏂板缓瀛愯彍鍗�</p>
+        <el-form :model="form" ref="form" :rules="rules">
+            <el-form-item label="涓婄骇鑿滃崟" prop="parentId">
+                <MenuSelect v-if="visible" type="1" v-model="form.parentId" placeholder="璇烽�夋嫨涓婄骇鑿滃崟" :exclude-id="excludeMenuId" clearable :inline="false"/>
+            </el-form-item>
+            <el-form-item label="鑿滃崟鍚嶇О" prop="name" required>
+                <el-input v-model="form.name" placeholder="璇疯緭鍏ヨ彍鍗曞悕绉�" v-trim maxlength="50"/>
+            </el-form-item>
+            <el-form-item label="璁块棶璺緞" prop="path">
+                <el-input v-model="form.path" placeholder="璇疯緭鍏ヨ闂矾寰�" v-trim maxlength="200"/>
+            </el-form-item>
+            <el-form-item label="鍥炬爣" prop="icon" class="form-item-icon">
+                <el-radio-group v-model="form.icon">
+                    <el-radio :label="icon" v-for="icon in icons" :key="icon">
+                        <i :class="{[icon]: true}"></i>
+                    </el-radio>
+                </el-radio-group>
+            </el-form-item>
+            <el-form-item label="澶囨敞" prop="remark">
+                <el-input type="textarea" v-model="form.remark" placeholder="璇疯緭鍏ヨ彍鍗曞娉�" v-trim :rows="3" maxlength="500"/>
+            </el-form-item>
+        </el-form>
+    </GlobalWindow>
+</template>
+
+<script>
+    import BaseOpera from '@/components/base/BaseOpera'
+    import GlobalWindow from '@/components/common/GlobalWindow'
+    import MenuSelect from '@/components/common/MenuSelect'
+    import icons from '@/utils/icons'
+    export default {
+        name: 'OperaMenuWindow',
+        extends: BaseOpera,
+        components: { MenuSelect, GlobalWindow },
+        data () {
+            return {
+                icons,
+                // 涓婄骇鑿滃崟鍚嶇О
+                parentName: '',
+                // 闇�鎺掗櫎閫夋嫨鐨勮彍鍗旾D
+                excludeMenuId: null,
+                // 琛ㄥ崟鏁版嵁
+                form: {
+                    id: null,
+                    parentId: null,
+                    name: '',
+                    path: '',
+                    icon: '',
+                    remark: '',
+                    type: '1'
+                },
+                // 楠岃瘉瑙勫垯
+                rules: {
+                    name: [
+                        { required: true, message: '璇疯緭鍏ヨ彍鍗曞悕绉�' }
+                    ]
+                }
+            }
+        },
+        methods: {
+            /**
+             * @title: 绐楀彛鏍囬
+             * @target: 缂栬緫鐨勮彍鍗曞璞�
+             * @parent: 鏂板缓鏃剁殑涓婄骇鑿滃崟
+             */
+            open (title, target, parent) {
+                this.title = title
+                this.visible = true
+                // 鏂板缓锛宮enu涓虹┖鏃惰〃绀烘柊寤鸿彍鍗�
+                if (target == null) {
+                    this.excludeMenuId = null
+                    this.$nextTick(() => {
+                        this.$refs.form.resetFields()
+                        this.form.id = null
+                        this.form.type = parent.type
+                        this.form.parentId = parent == null ? null : parent.id
+                        this.parentName = parent == null ? null : parent.name
+                    })
+                    return
+                }
+                // 缂栬緫
+                this.$nextTick(() => {
+                    this.excludeMenuId = target.id
+                    for (const key in this.form) {
+                        this.form[key] = target[key]
+                    }
+                })
+            }
+        },
+        created () {
+            this.config({
+                api: '/system/menu'
+            })
+        }
+    }
+</script>
+
+<style scoped lang="scss">
+    @import "@/assets/style/variables";
+    $icon-background-color: $primary-color;
+    .global-window {
+        .tip {
+            margin-bottom: 12px;
+            em {
+                font-style: normal;
+                color: $primary-color;
+                font-weight: bold;
+            }
+        }
+        // 鍥炬爣
+        /deep/ .form-item-icon {
+            .el-form-item__content {
+                height: 193px;
+                overflow-y: auto;
+            }
+            .el-radio-group {
+                background: $icon-background-color;
+                padding: 4px;
+                .el-radio {
+                    margin-right: 0;
+                    color: #fff;
+                    padding: 6px;
+                    &.is-checked {
+                        background: $icon-background-color - 30;
+                        border-radius: 10px;
+                    }
+                    .el-radio__input.is-checked + .el-radio__label {
+                        color: #fff;
+                    }
+                }
+                .el-radio__input {
+                    display: none;
+                }
+                .el-radio__label {
+                    padding-left: 0;
+                    // element-ui鍥炬爣
+                    i {
+                        font-size: 30px;
+                    }
+                    // 鑷畾涔夊浘鏍�
+                    [class^="eva-icon-"], [class*=" eva-icon-"] {
+                        width: 30px;
+                        height: 30px;
+                        background-size: 25px;
+                        vertical-align: bottom;
+                    }
+                }
+                .el-radio--small {
+                    height: auto;
+                    padding: 8px;
+                    margin-left: 0;
+                }
+            }
+        }
+    }
+</style>

--
Gitblit v1.9.3