nmxiaowei / avue

Avue.js2.0是基于现有的element-ui库进行的二次封装,简化一些繁琐的操作,核心理念为数据驱动视图,主要的组件库针对table表格和form表单场景,同时衍生出更多企业常用的组件,达到高复用,容易维护和扩展的框架,同时内置了丰富了数据展示组件,让开发变得更加容易
https://avuejs.com
MIT License
2.23k stars 490 forks source link

crud组件文件上传后文件名称不回显 #656

Closed liyun1001 closed 5 months ago

liyun1001 commented 5 months ago

avue版本号为"@smallwei/avue": "^3.4.4",

{

            label: "附件",
            prop: "fileUrl",
            type: 'upload',
            hide:true,
            multiple:false,
            action:"/api/blade-resource/oss/endpoint/put-file-attach",
            propsHttp:{
              res: 'data',
              url: "attachId",
              home:  '/api/blade-resource/oss/endpoint/getFileStream?tenantId=131000&attachId=',
              name:'originalName',
            },
            fileType: 'doc,xls,xlsx,docx,pdf,',
}

option中按照如上设置,接口返回值为

{
    "code": 200,
    "success": true,
    "data": {
        "link": "http://20.10.3.247:9000/willsoft/upload/20240613/6cd80dca883ab86659196c8c6a87d784.png",
        "domain": "http://20.10.3.247:9000/willsoft",
        "name": "upload/20240613/6cd80dca883ab86659196c8c6a87d784.png",
        "originalName": "ajdtjg.png",
        "attachId": "1801172326234628097"
    },
    "msg": "操作成功"
}

上传后页面只回显id,不回显originalName image

nmxiaowei commented 5 months ago

类型为object https://avuejs.com/form/form-upload.html#%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B