riku
2024-10-22 3908a403cb3a852bee96414a8bb82b88371e7b5a
src/views/fysp/task/components/CompSubTaskList.vue
@@ -1,12 +1,24 @@
<template>
  <el-row justify="space-between">
    <el-text>单日计划</el-text>
    <el-button type="success" size="small" @click="add">新增</el-button>
    <el-button
      v-show="create && data && data.length > 0"
      type="success"
      size="small"
      @click="add"
      >任务调整</el-button
    >
  </el-row>
  <el-divider />
  <div>
    <el-scrollbar :height="height">
      <el-space fill direction="vertical">
    <el-scrollbar v-loading="loading" :height="height">
      <el-space
        v-if="data && data.length > 0"
        fill
        :fill-ratio="100"
        direction="vertical"
        style="width: 100%"
      >
        <ItemSubTask v-for="s in data" :key="s.guid" :item="s">
          <template #default="{ item }">
            <el-button type="danger" size="small" @click="remove(item)"
@@ -15,6 +27,14 @@
          </template>
        </ItemSubTask>
      </el-space>
      <div v-else>
        <el-empty description="无任务记录" />
        <el-row justify="center">
          <el-button type="success" size="small" @click="add"
            >添加任务</el-button
          >
        </el-row>
      </div>
    </el-scrollbar>
  </div>
</template>
@@ -26,7 +46,10 @@
  height: {
    type: String,
    default: '70vh'
  }
  },
  // 是否显示添加任务按钮
  create: Boolean,
  loading: Boolean
});
const curSubTaskList = ref([]);