Mr.Zhang
2023-08-11 622382942e20d2e17e3e2502131cbd4fe69103c9
platform_web/src/components/system/menu/OperaMenuH5Window.vue
@@ -6,7 +6,7 @@
    :confirm-working="isWorking"
    @confirm="confirm"
  >
    <p class="tip" v-if="form.parent != null && form.id == null">为 <em>{{parentName}}</em> 新建子菜单</p>
    <p class="tip" v-if="form.parentId != 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" v-model="form.parentId" placeholder="请选择上级菜单" type="2" :exclude-id="excludeMenuId" clearable :inline="false"/>
@@ -20,7 +20,7 @@
      <el-form-item label="图标" prop="icon" class="form-item-icon">
        <div style="display: flex;">
          <UploadAvatarImage
            :file="{ 'imgurlfull': form.icon, 'imgurl': form.icon }"
            :file="{ 'imgurlfull': form.fullIcon, 'imgurl': form.icon }"
            :uploadData="uploadData"
            customStyle="width: 80px; height: 80px;"
            tipsLabel="上传图标"
@@ -61,6 +61,7 @@
      uploadData: {
        floader: 'company/menu'
      },
      parent: {},
      // 表单数据
      form: {
        id: null,
@@ -68,6 +69,7 @@
        name: '',
        path: '',
        icon: '',
        fullIcon: '',
        remark: '',
        type: '2'
      },
@@ -79,6 +81,12 @@
      }
    }
  },
  created () {
    this.config({
      api: '/system/menu'
    })
  },
  methods: {
    /**
     * @title: 窗口标题
@@ -86,18 +94,21 @@
     * @parent: 新建时的上级菜单
     * @type: 0平台 1、企业 2、h5
     */
    open (title, target, parent, type) {
    open (title, target, parent) {
      debugger
      this.title = title
      console.log('-----',parent);
      this.visible = true
      // 新建,menu为空时表示新建菜单
      if (target == null) {
        this.excludeMenuId = null
        this.$nextTick(() => {
          this.$refs.form.resetFields()
          this.parent = parent
          this.form.id = null
          this.form.parentId = parent == null ? null : parent.id
          this.parentName = parent == null ? null : parent.name
          this.form.type = type
        })
        return
      }
@@ -107,20 +118,14 @@
        for (const key in this.form) {
          this.form[key] = target[key]
        }
        this.form.fullIcon = !!target.icon ? (target.resourcePath + target.icon) : ''
      })
    }
  },
  created () {
    this.config({
      api: '/system/menu'
    })
  },
  methods: {
    },
    uploadReverseSuccess(file) {
      // this.form. = file.imgurl;
      this.form.icon = file.imgurlfull;
      this.form.icon = file.imgurl;
      this.form.fullIcon = file.imgurlfull;
    }
  }
  },
}
</script>