/* * @Author: Yolo * @Date: 2020-11-11 09:21:56 * @Last Modified by: Yolo * @Last Modified time: 2021-01-06 09:35:30 * 通用视图方法抽离mixins */ import { mapActions, mapGetters } from 'vuex' import { get } from 'lodash' export default { name: 'ViewUtilMixin', // 通用函数 props: { }, // 通用数据 data () { return { compId: localStorage.getItem('ws-pf_compId'), tenantId: localStorage.getItem('ws-pf_tenantId'), userId: localStorage.getItem('ws-pf_userId'), roleId: localStorage.getItem('ws-pf_roleId'), vesselBankFlag: localStorage.getItem('ws-pf_serviceTypeFlag') == 'true' } }, // 通用计算属性 computed: { ...mapGetters(['language']), }, // 通用方法 methods: { // 通用基础数据方法 可以按需使用 ...mapActions('common', ['getVesselDeptByCompId', 'getDeptListByCompId', 'getDeptListByCompIdAll']), shipMouted (option) { console.info(option, '毁掉', get(option, '[1].vesselId', '')) console.info(this.option) }, deptMouted (option) { } }, // 通用初始化 调用函数 async created () { if (get(this, 'init', '')) { this.init() } }, mounted () { // 计算当前日期差 使用 this.$rt('2020-01-01') }, // 通用初始化之前调用的函数 beforeCreate () { }, // 通用销毁之前调用函数 deactivated () { }, }