<template>
  <div class="wrap" style="margin-top: 15px;">
    <el-timeline style="max-width: 600px">
      <el-timeline-item v-for="(activity, index) in tableData" :key="index" :timestamp="activity.createTime">
        {{ activity.content }}
      </el-timeline-item>
    </el-timeline>
  </div>
</template>
<script setup>
  import { onMounted, ref } from 'vue';
  import { MoreFilled } from '@element-plus/icons-vue'
  import { getPageListData } from '@/api/main/system/system';

  const props = defineProps({
    planId: {
      type: Number,
      default: 0
    }
  });
  const tableData = ref([])
  const planId = ref()
  const queryParams = ref({})
  watch(props, (nweProps) => {
    initMethod(nweProps);
  });
  onMounted(() => {
    initMethod(props);
  });
  function initMethod(data) {
    planId.value = data.planId
    if (planId.value) {
      getPlanpatient()
    }
  }
  function getPlanpatient() {
    queryParams.value.plId = planId.value
    getPageListData('/SfPlanOperate/sfplanoperate', queryParams.value).then((res) => {
      tableData.value = []
      if (res.data.length > 0) {
        tableData.value = res.data
      }
    })
  }
</script>
<style scoped lang="scss"></style>