From fe3fd82f31b4fb43f6b207715a443e96d0442b26 Mon Sep 17 00:00:00 2001
From: nidapeng <jp@doumee.com>
Date: 星期二, 02 四月 2024 16:38:52 +0800
Subject: [PATCH] 提交一把
---
company/src/components/system/menu/OperaMenuComWindow.vue | 129 +++++++++++++++++++++---------------------
1 files changed, 65 insertions(+), 64 deletions(-)
diff --git a/company/src/components/system/menu/OperaMenuComWindow.vue b/company/src/components/system/menu/OperaMenuComWindow.vue
index efafc84..5744730 100644
--- a/company/src/components/system/menu/OperaMenuComWindow.vue
+++ b/company/src/components/system/menu/OperaMenuComWindow.vue
@@ -9,7 +9,7 @@
<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"/>
+ <MenuSelect v-if="visible" :type="form.type" 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"/>
@@ -32,75 +32,76 @@
</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: {
- /**
+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'
- })
+ open (title, target, parent, type) {
+ this.title = title
+ this.visible = true
+ this.form.type = type || 1
+ // 鏂板缓锛宮enu涓虹┖鏃惰〃绀烘柊寤鸿彍鍗�
+ if (target == null) {
+ this.excludeMenuId = null
+ this.$nextTick(() => {
+ this.$refs.form.resetFields()
+ this.form.id = null
+ this.form.type = parent != null ? parent.type : (type || 1)
+ 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">
--
Gitblit v1.9.3