Files
Situation-Awareness-Platfor…/src/components/IssueItem
2025-03-12 18:41:20 +08:00
..
2025-03-12 18:41:20 +08:00
2025-03-12 18:41:20 +08:00
2025-03-12 18:41:20 +08:00

IssueItem

说明

  • IssueItem组件为issue卡片或列表展示时使用
// tempalte
    <issue-item
    :data="IssueItemData"
    :hideChecked="false"
    :key="updateCheckedKey"
    @updateChecked="updateChecked"
    @handleComments="handleComments"
    @handleAvatar="handleAvatar"
    >
    </issue-item>

// script 
const IssueItemData = [
  {
    checked: true,
    isOpen: true,
    title: 'Import Bug Fix',
    tags: ['线上故障', '功能优化', '线上故障', '功能优化', '线上故障', '功能优化', '线上故障', '功能优化', '线上故障', '功能优化', '线上故障', '功能优化'],
    index: 1,
    userName: '李轩杨',
    createdTime: '2023-07-22',
    milestoneName: '里程碑名称',
    midNum: 1,
    commentsNum: 23,
    updateTime: '2023-07-23',
    statusIcon: 'icon-infomation',
    statusIconColor: 'red',
    avatarArr: [
      {
        imgSrc: 'https://avatars.githubusercontent.com/u/48074435?v=4'
      },
      {
        imgSrc: 'https://avatars.githubusercontent.com/u/40119767?v=4'
      },
      {
        imgSrc: 'https://avatars.githubusercontent.com/u/48074435?v=4'
      }
    ]
  },
  {
    checked: false,
    isOpen: false,
    title: 'Import Bug Fix',
    tags: ['线上故障', '功能优化', '线上故障', '功能优化', '线上故障', '功能优化', '线上故障', '功能优化', '线上故障', '功能优化', '线上故障', '功能优化'],
    index: 1,
    userName: '李轩杨',
    createdTime: '2023-07-22',
    milestoneName: '里程碑名称',
    midNum: 1,
    commentsNum: 23,
    updateTime: '2023-07-23'
  }
];
const updateCheckedKey = ref(0);
const updateChecked = (checked:boolean, item:object, index:number) => {
  
  IssueItemData[index].checked = checked;
  
  updateCheckedKey.value += 1;
};

const handleComments = (item:object, index:number) => {
  
};

const handleAvatar = (item:object, index:number) => {
  
};

Props

参数 说明 类型 可选值 默认值
data 列表数据 arrayrow参数见下表props(data) []
hideChecked? 隐藏checkbox boolean false

Props(data)

参数 说明 类型 可选值 默认值
checked? 是否选中 boolean false
isOpen? 是否开启 boolean false
title 标题 string
tags 标签数组 array
indexLabel? index自定义名称 string | number
userName 用户名 string
createdTime 创建时间 string
milestoneName 里程碑名称 string
midNum? 中间布局数值 string | number
commentsNum 评论数 string | number
updateTime 更新时间 string
statusIcon? 状态颜色 string
statusIconColor? 状态icon string
avatarArr? 右侧头像列表 array 例如:[{imgSrc:'xxx'}]

Emits

方法 说明 返回值
updateChecked 点击checkbox触发 checked, item, index分别为是否选中当前行对象index索引
handleComments 点击评论数触发 item, index分别为当前行对象index索引
handleMidNum 点击中间数字触发 item, index分别为当前行对象index索引
handleAvatar 点击头像区域触发 item, index分别为当前行对象index索引
handleTitle 点击标题触发 item, index分别为当前行对象index索引

Slots

名称 说明
checkbox checkbox区域插槽
tags 标签区域插槽
status 索引前icon区域插槽
midNum 中间列区域插槽
right 右侧区域插槽
avatar 头像列表区域插槽