((typeof self !== 'undefined' ? self : this)["webpackJsonpvcolorpicker"] = (typeof self !== 'undefined' ? self : this)["webpackJsonpvcolorpicker"] || []).push([[0],{

/***/ "e1f7":
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"25dd08ce-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/redirect/FormRedirectTab.vue?vue&type=template&id=ee718e1a&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('a-spin',{staticStyle:{"height":"100%"},style:(_vm.bodyStyle),attrs:{"spinning":_vm.spinning !== 0}},[(_vm.formType === 'form')?_c('a-card',{attrs:{"bordered":false}},[_c('form-redirect',{ref:"formRedirect",attrs:{"func":_vm.func,"formId":_vm.formId,"formCode":_vm.formCode,"fks":_vm.fks,"parentValue":_vm.parentValue,"saveInPage":_vm.saveInPage,"disQueryDB":_vm.disQueryDB,"record":_vm.record,"stores":_vm.stores,"isTab":true},on:{"close":_vm.close,"hideDialogButtons":_vm.hideDialogButtons,"addParentSpinning":_vm.addSpinning,"delParentSpinning":_vm.delSpinning,"refreshParent":_vm.refreshParent,"handleOk":_vm.handleOk,"setFormTitle":_vm.setFormTitle}})],1):(_vm.formType === 'view')?_c('view-layout-redirect',{ref:"viewRedirect",attrs:{"formOption":_vm.formOption,"view-code":_vm.formCode,"stores":_vm.stores,"isShowInTab":true},on:{"closeFromView":_vm.close,"hideDialogButtonsFromView":_vm.hideDialogButtons,"addParentSpinningFromView":_vm.addSpinning,"delParentSpinningFromView":_vm.delSpinning,"refreshParent":_vm.refreshParent,"handleOkFromView":_vm.handleOk,"setFormTitleFromView":_vm.setFormTitle}}):_vm._e()],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./packages/components/redirect/FormRedirectTab.vue?vue&type=template&id=ee718e1a&

// EXTERNAL MODULE: ./packages/components/redirect/FormRedirect.vue + 4 modules
var FormRedirect = __webpack_require__("9ef9");

// EXTERNAL MODULE: ./packages/utils/LocleUtil.js
var LocleUtil = __webpack_require__("6bf9");

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/components/redirect/FormRedirectTab.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//





/* harmony default export */ var FormRedirectTabvue_type_script_lang_js_ = ({
  name: 'FormRedirectTab',
  components: {
    FormRedirect: FormRedirect["default"],
    ViewLayoutRedirect: () => Promise.resolve(/* import() */).then(__webpack_require__.bind(null, "5edf"))
  },
  props: {
    func: String,
    formCode: String,
    formId: String,
    record: Object,
    formType: {
      type: String,
      default: 'form'
    },
    fks: {
      type: Array,
      default: () => []
    },
    parentValue: {
      type: Object,
      default: () => {
      }
    },
    disQueryDB: {
      type: Boolean,
      default: false // 不查询数据库
    },
    stores: {
      type: Object,
      default: () => {
        return {}
      }
    },
  },
  computed: {
    formOption() {
      return {
        func: this.func,
        formId: this.formId,
        fks: this.fks,
        parentValue: this.parentValue,
        saveInPage: this.saveInPage,
        disQueryDB: this.disQueryDB,
        record: this.record,
        isTab: true,
        needClose: false,
      }
    },
    bodyStyle() {
      if (this.formType === 'view') {
        return {
          background: "#F0F2F5"
        }
      }
      return {}
    },
  },
  data() {
    return {
      spinning: 0,
      saveInPage: false, // 仅在页面暂时存储，用于子表添加
      needClose: false,
    }
  },
  inject: ['closeCurrent', 'removeCache'],
  methods: {
    // 设置标题
    // TODO 暂时没有处理纯列表页面的标题
    setFormTitle(title) {
      let titleName = title || LocleUtil["a" /* default */].getLocale('m.eform.formDesign.label.biao-dan')
      let funcName = LocleUtil["a" /* default */].getLocale('m.common.button.add')
      if (this.func === 'edit') {
        funcName = LocleUtil["a" /* default */].getLocale('m.common.button.update')
      } else if (this.func === 'detail') {
        funcName = LocleUtil["a" /* default */].getLocale('m.common.title.detail')
      }
      this.$route.meta.title = funcName + " " + titleName
    },
    handleCancel() {
      if (this.spinning > 0) {
        this.needClose = true
        return;
      }
      this.closeCurrent()
    },
    handleOk($vue,isDraft) {
      const that = this;
      this.addSpinning();
      $vue.save(this.afterSave,null,isDraft)
      setTimeout(function () {
        that.delSpinning();
      }, 500)
    },
    afterSave(id,saveSucessMsg) {
      if(saveSucessMsg){
        this.$message.success(saveSucessMsg)
      }else{
        this.$message.success(LocleUtil["a" /* default */].getLocale('m.eform.formDesign.label.bao-cun-cheng-gong'))
      }
      // 不关闭当前页面，后续改为可配置参数
      // this.closeCurrent()
    },
    hideDialogButtons() {
    },
    //关闭页面
    close() {
      this.handleCancel()
    },
    //刷新父页面
    refreshParent(id, tableName, formData) {
      this.removeCache(this.$route.meta.parentFullPath)
    },
    addSpinning() {
      this.spinning++
    },
    delSpinning() {
      this.spinning--
      if (this.spinning === 0 && this.needClose) {
        this.needClose = false
        this.handleCancel()
      }
    },
  },
  activated() {
    if (this.formType === 'view') {
      if (this.$refs.viewRedirect) {
        this.$refs.viewRedirect.doResize();
      }
    }
  }
});

// CONCATENATED MODULE: ./packages/components/redirect/FormRedirectTab.vue?vue&type=script&lang=js&
 /* harmony default export */ var redirect_FormRedirectTabvue_type_script_lang_js_ = (FormRedirectTabvue_type_script_lang_js_); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");

// CONCATENATED MODULE: ./packages/components/redirect/FormRedirectTab.vue





/* normalize component */

var component = Object(componentNormalizer["a" /* default */])(
  redirect_FormRedirectTabvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* harmony default export */ var FormRedirectTab = __webpack_exports__["default"] = (component.exports);

/***/ })

}]);
//# sourceMappingURL=vcolorpicker.umd.0.js.map