king
2023-08-06 7a2e1070c994039a2115be55953cd879f78f654d
2023-08-06
1个文件已修改
13 ■■■■■ 已修改文件
src/tabviews/custom/components/module/voucher/resetAttach/index.jsx 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/tabviews/custom/components/module/voucher/resetAttach/index.jsx
@@ -41,6 +41,7 @@
    list = list.map(item => {
      item.icon = this.getIcon(item.attachments_url)
      item.name = this.getName(item.attachments_url)
      return item
    })
@@ -74,6 +75,7 @@
          file.attachments = file.attachments.map(item => {
            item.id = item.attach_id
            item.icon = this.getIcon(item.attachments_url)
            item.name = this.getName(item.attachments_url)
            item.data_code = file.data_code
            item.data_name = file.data_name
            item.BID = file.id
@@ -152,6 +154,7 @@
        }
        item.icon = this.getIcon(res.url)
        item.name = this.getName(res.url)
        list.push(item)
@@ -162,6 +165,14 @@
  deleteFile = (id) => {
    this.setState({list: this.state.list.filter(item => item.id !== id)})
  }
  getName = (url) => {
    if (!url || !/\//.test(url)) return url
    let names = url.split('/')
    return names[names.length - 1]
  }
  getIcon = (url) => {
@@ -256,7 +267,7 @@
                <img src={item.icon} alt=""/>
                <div className="attach-msg">
                  <div>{item.attachments_title}</div>
                  <div>{item.data_name ? item.data_name + ' / ' : ''}{item.attachments_url}</div>
                  <div>{item.data_name ? item.data_name + ' / ' : ''}{item.name}</div>
                </div>
                <div>
                  <DeleteOutlined onClick={() => this.deleteFile(item.id)}/>