let mixin = {};
let configUtil = {
  baseUrl: process.env.VUE_APP_BASE_API,
  requireView: (url) => {
    return require("@/views" + url).default;
  },
};
mixin = {
  name: "wfModifyMixin",
  props: {
    dataId: [String, Number],
    code: [String, Number],
    visible: Boolean,
    paramData: Object,
    parentVue: Object,
    wfInfo: Object,
  },
  data() {
    return {
      showModifyDialog: false,
      showBillEdit: false,
      content: "",
    };
  },
  async mounted() {
    this.openWfModifyDialog(this.code);
  },
  methods: {
    openWfModifyDialog() {
      let row = this.paramData;
      let url = row.mobileurl + ".vue";
      this.showModifyDialog = true;
      this.content = configUtil.requireView(url);
      this.$openEditView("showBillEdit");
    },
    close() {
      this.$destroy();
      this.$el.parentElement.removeChild(this.$el);
    },
    refreshEdit() {
      this.showModifyDialog = false;
      this.parentVue.$baseReload()
    }
  },
};

export default mixin;
