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

/***/ "9757":
/***/ (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":"1d052202-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/windicss-webpack-plugin/dist/loaders/windicss-template.cjs!./src/modules/risk-area-management/components/PictureForm.vue?vue&type=template&id=4f0d97b0&scoped=true
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-dialog',{directives:[{name:"dialogDrag",rawName:"v-dialogDrag"}],staticClass:"mini-dialog",attrs:{"close-on-click-modal":false,"title":_vm.pageType === 'create' ? '新增四色图' : _vm.pageType === 'edit' ? '编辑四色图' : '四色图详情',"visible":_vm.addAreaDialog,"before-close":_vm.closeDialog},on:{"update:visible":function($event){_vm.addAreaDialog=$event}}},[_c('el-form',{ref:"areaForm",attrs:{"label-width":"160px","rules":_vm.rules,"model":_vm.formData,"disabled":_vm.tableFormDisabled}},[_c('el-form-item',{attrs:{"label":"二维四色图名称","prop":"name"}},[_c('el-input',{attrs:{"placeholder":"请输入二维四色图名称","size":"small","maxlength":"50","clearable":""},model:{value:(_vm.formData.name),callback:function ($$v) {_vm.$set(_vm.formData, "name", $$v)},expression:"formData.name"}})],1),_c('el-form-item',{attrs:{"label":"二维四色图编号","prop":"code"}},[_c('el-input',{attrs:{"placeholder":"请输入二维四色图编号","size":"small","clearable":"","maxlength":"50"},model:{value:(_vm.formData.code),callback:function ($$v) {_vm.$set(_vm.formData, "code", $$v)},expression:"formData.code"}})],1),_c('el-form-item',{attrs:{"label":"二维四色图说明","prop":"remark"}},[_c('el-input',{attrs:{"placeholder":"请输入二维四色图说明","size":"small","clearable":"","type":"textarea","rows":2,"maxlength":"5000","resize":"none"},model:{value:(_vm.formData.remark),callback:function ($$v) {_vm.$set(_vm.formData, "remark", $$v)},expression:"formData.remark"}})],1),_c('el-form-item',{attrs:{"label":"HT图文件路径","prop":"fileUrl"}},[_c('el-input',{attrs:{"placeholder":"请输入HT图文件路径","size":"small","clearable":"","type":"textarea","rows":2,"maxlength":"200","resize":"none"},model:{value:(_vm.formData.fileUrl),callback:function ($$v) {_vm.$set(_vm.formData, "fileUrl", $$v)},expression:"formData.fileUrl"}})],1)],1),(!this.tableFormDisabled)?_c('div',{staticClass:"flex justify-center items-center",attrs:{"slot":"footer"},slot:"footer"},[_c('el-button',{attrs:{"size":"small","type":"primary","loading":_vm.saveLoading},on:{"click":_vm.handleSave}},[_vm._v("保存")]),_c('el-button',{attrs:{"size":"small"},on:{"click":function($event){return _vm.$emit('cancel')}}},[_vm._v("取消")])],1):_vm._e()],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./src/modules/risk-area-management/components/PictureForm.vue?vue&type=template&id=4f0d97b0&scoped=true

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 5 modules
var slicedToArray = __webpack_require__("3835");

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/regeneratorRuntime.js
var regeneratorRuntime = __webpack_require__("c7eb");

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
var asyncToGenerator = __webpack_require__("1da1");

// EXTERNAL MODULE: ./node_modules/@wiz-api/area-management/lib/area-management.umd.js
var area_management_umd = __webpack_require__("aa07");

// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/@vue/cli-plugin-babel/node_modules/babel-loader/lib??ref--12-1!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/windicss-webpack-plugin/dist/loaders/windicss-template.cjs!./src/modules/risk-area-management/components/PictureForm.vue?vue&type=script&lang=js



//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//


var areaChartApi = new area_management_umd["AreaChartApi"]();
/* harmony default export */ var PictureFormvue_type_script_lang_js = ({
  name: 'picture-form',
  props: {
    addAreaDialog: {
      type: Boolean,
      default: false
    },
    checkForm: {
      type: Object,
      default: function _default() {
        return {};
      }
    },
    pageType: {
      type: String,
      default: 'create'
    }
  },
  computed: {
    // 表单禁用
    tableFormDisabled: function tableFormDisabled() {
      return this.pageType === 'detail';
    }
  },
  data: function data() {
    return {
      // 表单校验
      rules: {
        name: [{
          required: true,
          message: '请输入二维四色图名称',
          trigger: 'change'
        }],
        code: [{
          required: true,
          message: '请输入二维四色图编码',
          trigger: 'change'
        }],
        fileUrl: [{
          required: true,
          message: '请输入HT图文件路径',
          trigger: 'change'
        }]
      },
      // 选中资质模板过滤后显示的字段
      chooseFilterList: [],
      dataList: [],
      // 表单数据
      formData: {
        name: '',
        areaTypeId: '',
        code: '',
        riskLevelId: '',
        areaGroupIds: []
      },
      // 保存加载动画
      saveLoading: false
    };
  },
  methods: {
    // 关闭弹框
    closeDialog: function closeDialog() {
      this.$emit('cancel');
    },
    // 保存
    handleSave: function handleSave() {
      var _this = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee2() {
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee2$(_context2) {
          while (1) switch (_context2.prev = _context2.next) {
            case 0:
              _this.$refs.areaForm.validate( /*#__PURE__*/function () {
                var _ref = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee(valid) {
                  return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee$(_context) {
                    while (1) switch (_context.prev = _context.next) {
                      case 0:
                        if (valid) {
                          _context.next = 2;
                          break;
                        }
                        return _context.abrupt("return");
                      case 2:
                        if (!_this.formData.id) {
                          _context.next = 5;
                          break;
                        }
                        _this.editAreaManagement();
                        return _context.abrupt("return");
                      case 5:
                        _this.addAreaManagement();
                      case 6:
                      case "end":
                        return _context.stop();
                    }
                  }, _callee);
                }));
                return function (_x) {
                  return _ref.apply(this, arguments);
                };
              }());
            case 1:
            case "end":
              return _context2.stop();
          }
        }, _callee2);
      }))();
    },
    // 编辑二维二维四色图管理
    editAreaManagement: function editAreaManagement() {
      var _this2 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee3() {
        var body, _yield$areaChartApi$u, _yield$areaChartApi$u2, err, res;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee3$(_context3) {
          while (1) switch (_context3.prev = _context3.next) {
            case 0:
              _this2.saveLoading = true;
              // 暂时写死 待接口改造去除必填
              body = _.cloneDeep(_this2.formData);
              _context3.next = 4;
              return areaChartApi.update(_this2.formData.id, {
                body: body
              });
            case 4:
              _yield$areaChartApi$u = _context3.sent;
              _yield$areaChartApi$u2 = Object(slicedToArray["a" /* default */])(_yield$areaChartApi$u, 2);
              err = _yield$areaChartApi$u2[0];
              res = _yield$areaChartApi$u2[1];
              _this2.saveLoading = false;
              if (!err) {
                _this2.$message.success('保存成功');
                // 保存成功后，清空数据和二维四色图
                _this2.formData = _this2.$options.data().formData;
                _this2.$emit('cancel');
                // 编辑更新当前列表
                _this2.$emit('updateList', 'edit');
              }
            case 10:
            case "end":
              return _context3.stop();
          }
        }, _callee3);
      }))();
    },
    // 新建二维二维四色图管理
    addAreaManagement: function addAreaManagement() {
      var _this3 = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee4() {
        var body, _yield$areaChartApi$c, _yield$areaChartApi$c2, err, res;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee4$(_context4) {
          while (1) switch (_context4.prev = _context4.next) {
            case 0:
              _this3.saveLoading = true;
              // 暂时写死 待接口改造去除必填
              body = _.cloneDeep(_this3.formData);
              _context4.next = 4;
              return areaChartApi.create({
                body: body
              });
            case 4:
              _yield$areaChartApi$c = _context4.sent;
              _yield$areaChartApi$c2 = Object(slicedToArray["a" /* default */])(_yield$areaChartApi$c, 2);
              err = _yield$areaChartApi$c2[0];
              res = _yield$areaChartApi$c2[1];
              _this3.saveLoading = false;
              if (!err) {
                _this3.$message.success('保存成功');
                // 保存成功后，清空数据和二维四色图
                _this3.formData = _this3.$options.data().formData;
                _this3.$emit('cancel');
                // 新增获取第一页新数据
                _this3.$emit('updateList');
              }
            case 10:
            case "end":
              return _context4.stop();
          }
        }, _callee4);
      }))();
    },
    // 接口保存表单
    saveForm: function saveForm() {
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee5() {
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee5$(_context5) {
          while (1) switch (_context5.prev = _context5.next) {
            case 0:
            case "end":
              return _context5.stop();
          }
        }, _callee5);
      }))();
    }
  },
  created: function created() {
    this.formData = _.cloneDeep(this.checkForm);
  }
});
// CONCATENATED MODULE: ./src/modules/risk-area-management/components/PictureForm.vue?vue&type=script&lang=js
 /* harmony default export */ var components_PictureFormvue_type_script_lang_js = (PictureFormvue_type_script_lang_js); 
// EXTERNAL MODULE: ./src/modules/risk-area-management/components/PictureForm.vue?vue&type=style&index=0&id=4f0d97b0&prod&lang=scss&scoped=true
var PictureFormvue_type_style_index_0_id_4f0d97b0_prod_lang_scss_scoped_true = __webpack_require__("fa2a");

// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");

// CONCATENATED MODULE: ./src/modules/risk-area-management/components/PictureForm.vue






/* normalize component */

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

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

/***/ }),

/***/ "a5b3":
/***/ (function(module, exports, __webpack_require__) {

// style-loader: Adds some css to the DOM by adding a <style> tag

// load the styles
var content = __webpack_require__("f90c");
if(content.__esModule) content = content.default;
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add the styles to the DOM
var add = __webpack_require__("499e").default
var update = add("cfe37b5a", content, true, {"sourceMap":false,"shadowMode":false});

/***/ }),

/***/ "f90c":
/***/ (function(module, exports, __webpack_require__) {

exports = module.exports = __webpack_require__("2350")(false);
// imports


// module
exports.push([module.i, "[data-v-4f0d97b0] .el-form-item__content .el-input,[data-v-4f0d97b0] .el-form-item__content .el-select{max-width:none}", ""]);

// exports


/***/ }),

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

"use strict";
/* harmony import */ var _node_modules_windicss_webpack_plugin_dist_loaders_windicss_style_pitcher_cjs_node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_windicss_webpack_plugin_dist_loaders_windicss_template_cjs_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_PictureForm_vue_vue_type_style_index_0_id_4f0d97b0_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("a5b3");
/* harmony import */ var _node_modules_windicss_webpack_plugin_dist_loaders_windicss_style_pitcher_cjs_node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_windicss_webpack_plugin_dist_loaders_windicss_template_cjs_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_PictureForm_vue_vue_type_style_index_0_id_4f0d97b0_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_windicss_webpack_plugin_dist_loaders_windicss_style_pitcher_cjs_node_modules_vue_style_loader_index_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_windicss_webpack_plugin_dist_loaders_windicss_template_cjs_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_3_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_4_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_PictureForm_vue_vue_type_style_index_0_id_4f0d97b0_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
/* unused harmony reexport * */


/***/ })

}]);
//# sourceMappingURL=risk-area-management.umd.10.js.map