Blame view

src/views/workflow/mixin/public.js 1.21 KB
1 2 3
/*
 * @Description: 
 * @Autor: renchao
4
 * @LastEditTime: 2023-05-24 14:42:24
5
 */
任超 committed
6
import { getForm } from "../flowform";
7
import { getHomeNoticeList } from "@/api/home.js"
任超 committed
8
export default {
任超 committed
9 10
  data () {
    return {
11
      noticeList: []
任超 committed
12 13 14
    }
  },
  created () {
任超 committed
15 16 17
    this.getHomeNotice()
  },
  mounted () {
18
    let _this = this
任超 committed
19
    window.addEventListener('message', function (messageEvent) {
20
      _this.getHomeNotice()
任超 committed
21
    }, false)
任超 committed
22
  },
任超 committed
23
  methods: {
任超 committed
24 25 26 27 28 29 30
    getHomeNotice () {
      getHomeNoticeList().then(res => {
        if (res.result) {
          this.noticeList = res.result.noticeList
        }
      })
    },
任超 committed
31 32 33 34 35 36
    //右侧表单选项卡事件
    beforeLeave (activeName, oldActiveName) {
      if (activeName && activeName != 0) this.getFromRouter(activeName)
    },
    //切换选项卡内容组件
    getFromRouter (tabname) {
蔡俊立 committed
37
      //根据tabname获取选中的表单  此操作为了获取后端返回的表单对象,使用里面的是否可操作的属性
任超 committed
38 39
      for (let item of this.tabList) {
        if (item.value === tabname) {
蔡俊立 committed
40 41 42 43
          this.currentSelectTab = item
          break;
        }
      }
任超 committed
44
      this.componentTag = getForm(tabname, this.$route.query.sqywbm);
45
      console.log(tabname);
任超 committed
46 47 48
    }
  }
}