timeline.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <div class="contrl-bar">
  3. <el-timeline style="max-width: 600px">
  4. <el-timeline-item :timestamp="p.state?'已完成':'未完成'" placement="top" :color="p.state?'#ff6154':'#dae1eb'"
  5. v-for="(p , index) in processes">
  6. <el-card shadow="never" @click="goto(p.router)" class="timeline-card report-item">
  7. <h4>{{ p.name }}</h4>
  8. <p v-if="p.state" >更新时间:{{ p.updateDate }}</p>
  9. <el-button v-if="p.state" @click="openPageoffice(p.docUrl)">{{ p.name }}.docx 预览</el-button>
  10. </el-card>
  11. </el-timeline-item>
  12. </el-timeline>
  13. </div>
  14. </template>
  15. <script>
  16. import houseGuaranty from '@/api/houseGuaranty';
  17. import { POBrowser } from 'js-pageoffice'
  18. export default {
  19. props: {
  20. processParentId:{
  21. type:Number,
  22. required:false,
  23. }
  24. },
  25. watch:{
  26. processParentId:{
  27. handler(nv){
  28. this.getProcesses();
  29. }
  30. }
  31. },
  32. created(){
  33. this.getProcesses();
  34. },
  35. data() {
  36. return {
  37. processes:[]
  38. }
  39. },
  40. methods:{
  41. goto(path) {
  42. this.$router.push(`/home/houseWorkbench/${path}`)
  43. },
  44. getProcesses(){
  45. houseGuaranty.getProcesses(this.processParentId).then(res=>{
  46. if (res.code === 200){
  47. this.processes = res.data;
  48. }
  49. })
  50. },
  51. openPageoffice(fileUrl) {
  52. let paramJson={};
  53. paramJson.fileName="";
  54. paramJson.fileUrl=fileUrl;
  55. let paramString=JSON.stringify(paramJson);
  56. POBrowser.openWindow('/prod/showDoc', 'width=1150px;height=900px;',paramString);
  57. },
  58. }
  59. }
  60. </script>
  61. <style scoped>
  62. .contrl-bar{
  63. height: 600px;
  64. width: 20%;
  65. position:fixed;
  66. top:160px;
  67. right: 150px;
  68. }
  69. .timeline-card:hover{
  70. cursor: pointer;
  71. }
  72. </style>