bug
jiangping
2023-11-07 64b432916af9c9218ab3f3eca614e26c542142ae
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"/>
@@ -14,13 +14,16 @@
      <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-form-item label="h5访问路径" prop="path">
        <el-input v-model="form.path" placeholder="请输入访问路径" v-trim maxlength="200"/>
      </el-form-item>
      <el-form-item label="小程序访问路径" prop="pathSec">
        <el-input v-model="form.pathSec" placeholder="请输入访问路径" v-trim maxlength="200"/>
      </el-form-item>
      <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="上传图标"
@@ -29,7 +32,7 @@
            @uploadBegin="isUploading=true"
          />
          <div style="display: flex; flex-direction: column-reverse;" v-if="!!form.icon">
            <el-button style="margin-left: 5px; padding: 0 5px;" type="text" @click="form.icon=''">删除</el-button>
            <el-button style="margin-left: 5px; padding: 0 5px;" type="text" @click="deletePic">删除</el-button>
          </div>
        </div>
      </el-form-item>
@@ -59,15 +62,19 @@
      // 需排除选择的菜单ID
      excludeMenuId: null,
      uploadData: {
        floader: 'company/menu'
        // floader: 'company/menu'
        folder: 'company/menu'
      },
      parent: {},
      // 表单数据
      form: {
        id: null,
        parentId: null,
        name: '',
        path: '',
        pathSec: '',
        icon: '',
        fullIcon: '',
        remark: '',
        type: '2'
      },
@@ -79,6 +86,12 @@
      }
    }
  },
  created () {
    this.config({
      api: '/system/menu'
    })
  },
  methods: {
    /**
     * @title: 窗口标题
@@ -86,18 +99,21 @@
     * @parent: 新建时的上级菜单
     * @type: 0平台 1、企业 2、h5
     */
    open (title, target, parent, type) {
    open (title, target, parent) {
      debugger
      this.title = title
      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
          this.form.fullIcon = ''
        })
        return
      }
@@ -107,20 +123,18 @@
        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;
    },
    deletePic() {
      this.form.fullIcon=''
      this.form.icon=''
    }
  }
  },
}
</script>