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

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

"use strict";

// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"29850416-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/portal-management/components/config/LayoutConfig.vue?vue&type=template&id=3d3f816b
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-row',{key:_vm.updateKey},[_c('el-col',{attrs:{"span":24}},[_c('el-form-item',{attrs:{"label":"宽度"}},[_c('el-input-number',{staticClass:"w-full",attrs:{"controls":false,"min":10,"max":_vm.layoutWidth - _vm.layoutConfig.x},on:{"change":function (curVal, oldVal) { return _vm.numChange('w', curVal, oldVal); }},model:{value:(_vm.layoutConfig.w),callback:function ($$v) {_vm.$set(_vm.layoutConfig, "w", $$v)},expression:"layoutConfig.w"}})],1),_c('el-form-item',{attrs:{"label":"高度"}},[_c('el-input-number',{staticClass:"w-full",attrs:{"controls":false,"min":10},on:{"change":function (curVal, oldVal) { return _vm.numChange('h', curVal, oldVal); }},model:{value:(_vm.layoutConfig.h),callback:function ($$v) {_vm.$set(_vm.layoutConfig, "h", $$v)},expression:"layoutConfig.h"}})],1),_c('el-form-item',{attrs:{"label":"x"}},[_c('el-input-number',{staticClass:"w-full",attrs:{"controls":false,"min":0,"max":_vm.layoutWidth - _vm.layoutConfig.w},on:{"change":function (curVal, oldVal) { return _vm.numChange('x', curVal, oldVal); }},model:{value:(_vm.layoutConfig.x),callback:function ($$v) {_vm.$set(_vm.layoutConfig, "x", $$v)},expression:"layoutConfig.x"}})],1),_c('el-form-item',{attrs:{"label":"y"}},[_c('el-input-number',{staticClass:"w-full",attrs:{"controls":false,"min":0},on:{"change":function (curVal, oldVal) { return _vm.numChange('y', curVal, oldVal); }},model:{value:(_vm.layoutConfig.y),callback:function ($$v) {_vm.$set(_vm.layoutConfig, "y", $$v)},expression:"layoutConfig.y"}})],1)],1)],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./src/modules/portal-management/components/config/LayoutConfig.vue?vue&type=template&id=3d3f816b

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.find-index.js
var es_array_find_index = __webpack_require__("c740");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.number.constructor.js
var es_number_constructor = __webpack_require__("a9e3");

// 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/portal-management/components/config/LayoutConfig.vue?vue&type=script&lang=js


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

/* harmony default export */ var LayoutConfigvue_type_script_lang_js = ({
  props: {
    config: {
      type: Object,
      default: function _default() {
        return {
          w: 10,
          h: 10,
          x: 0,
          y: 0
        };
      }
    },
    layoutWidth: {
      type: Number,
      default: window.innerWidth
    },
    layout: {
      type: Array,
      default: function _default() {
        return [];
      }
    }
  },
  data: function data() {
    return {
      layoutConfig: {},
      updateKey: _.random(5000)
    };
  },
  watch: {
    config: {
      deep: true,
      handler: function handler(val) {
        this.layoutConfig = _.cloneDeep(val);
      }
    }
  },
  computed: {
    windowWidth: function windowWidth() {
      return window.innerWidth;
    }
  },
  methods: {
    // 判断拖拽元素是否与布局元素碰撞
    isInRange: function isInRange() {
      var domRange = {
        x: this.layoutConfig.x,
        x1: this.layoutConfig.x + this.layoutConfig.w,
        y: this.layoutConfig.y,
        y1: this.layoutConfig.y + this.layoutConfig.h,
        i: this.layoutConfig.i
      };
      var inRange = _.findIndex(this.layout, function (item) {
        if (item.i === domRange.i) return false;
        var xInRange = domRange.x >= item.x && domRange.x <= item.x + item.w || domRange.x1 >= item.x && domRange.x1 <= item.x + item.w || item.x >= domRange.x && item.x <= domRange.x1 || item.x + item.w >= domRange.x && item.x + item.w <= domRange.x1;
        var yInRange = domRange.y >= item.y && domRange.y <= item.y + item.h || domRange.y1 >= item.y && domRange.y1 <= item.y + item.h || item.y >= domRange.y && item.y <= domRange.y1 || item.y + item.h >= domRange.y && item.y + item.h <= domRange.y1;
        return xInRange && yInRange;
      });
      return inRange > -1;
    },
    numChange: function numChange(key, curVal, oldVal) {
      if (!_.isNumber(curVal)) {
        this.$set(this.layoutConfig, key, oldVal);
        this.updateKey = _.random(5000);
        return;
      }
      var inRange = this.isInRange();
      if (inRange) {
        this.$set(this.layoutConfig, key, oldVal);
        this.updateKey = _.random(5000);
      } else {
        this.$emit('layoutChange', this.layoutConfig);
      }
    }
  },
  mounted: function mounted() {
    this.layoutConfig = _.cloneDeep(this.config);
  }
});
// CONCATENATED MODULE: ./src/modules/portal-management/components/config/LayoutConfig.vue?vue&type=script&lang=js
 /* harmony default export */ var config_LayoutConfigvue_type_script_lang_js = (LayoutConfigvue_type_script_lang_js); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");

// CONCATENATED MODULE: ./src/modules/portal-management/components/config/LayoutConfig.vue





/* normalize component */

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

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

/***/ }),

/***/ "c6ea":
/***/ (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":"29850416-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/portal-management/components/config/NewsVideoConfig.vue?vue&type=template&id=4d068d96
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('el-form',{attrs:{"model":_vm.form,"label-width":"95px","disabled":_vm.mode === 'view'}},[_c('el-form-item',{attrs:{"label":"数据来源"}},[_c('el-select',{attrs:{"placeholder":"请选择栏目","filterable":""},on:{"change":_vm.sourceChange},model:{value:(_vm.form.dataSource),callback:function ($$v) {_vm.$set(_vm.form, "dataSource", $$v)},expression:"form.dataSource"}},_vm._l((_vm.columnData),function(item){return _c('el-option',{key:item.id,attrs:{"label":item.name,"value":item.id}})}),1)],1),_c('el-form-item',{attrs:{"label":"列表样式"}},[_c('el-select',{attrs:{"placeholder":"请选择"},on:{"change":function($event){return _vm.layoutChange(_vm.config)}},model:{value:(_vm.config.component),callback:function ($$v) {_vm.$set(_vm.config, "component", $$v)},expression:"config.component"}},_vm._l((_vm.videoType),function(item){return _c('el-option',{key:item.value,attrs:{"label":item.name,"value":item.value}})}),1)],1),_c('el-form-item',{attrs:{"label":"图片展示"}},[_c('el-select',{attrs:{"placeholder":"请选择","filterable":""},on:{"change":_vm.selectChange},model:{value:(_vm.form.imageFit),callback:function ($$v) {_vm.$set(_vm.form, "imageFit", $$v)},expression:"form.imageFit"}},_vm._l((_vm.imageFitType),function(item){return _c('el-option',{key:item.value,attrs:{"label":item.name,"value":item.value}})}),1)],1),(_vm.form.showTitle)?_c('el-form-item',{attrs:{"label":"显示名称"}},[_c('el-input',{attrs:{"placeholder":"显示名称","maxlength":"20","clearable":""},on:{"input":_vm.selectChange},model:{value:(_vm.form.title),callback:function ($$v) {_vm.$set(_vm.form, "title", $$v)},expression:"form.title"}})],1):_vm._e(),(_vm.config.component === 'NewsVideoTwo')?_c('el-form-item',{attrs:{"label":"显示时间"}},[_c('el-checkbox',{on:{"change":_vm.selectChange},model:{value:(_vm.form.showDate),callback:function ($$v) {_vm.$set(_vm.form, "showDate", $$v)},expression:"form.showDate"}})],1):_vm._e(),(_vm.config.component === 'NewsVideoTwo')?_c('el-form-item',{attrs:{"label":"显示分页"}},[_c('el-checkbox',{on:{"change":_vm.selectChange},model:{value:(_vm.form.showPagination),callback:function ($$v) {_vm.$set(_vm.form, "showPagination", $$v)},expression:"form.showPagination"}})],1):_vm._e(),_c('el-form-item',{attrs:{"label":"显示栏目名称"}},[_c('el-checkbox',{on:{"change":_vm.selectChange},model:{value:(_vm.form.showTitle),callback:function ($$v) {_vm.$set(_vm.form, "showTitle", $$v)},expression:"form.showTitle"}})],1),_c('el-form-item',{attrs:{"label":"显示更多"}},[_c('el-checkbox',{on:{"change":_vm.selectChange},model:{value:(_vm.form.showMore),callback:function ($$v) {_vm.$set(_vm.form, "showMore", $$v)},expression:"form.showMore"}})],1),(_vm.config.component === 'NewsVideoTwo')?_c('el-form-item',{attrs:{"label":"展示行数"}},[_c('el-input-number',{staticClass:"w-full",attrs:{"min":1,"controls-position":"right"},on:{"change":_vm.selectChange},model:{value:(_vm.form.row),callback:function ($$v) {_vm.$set(_vm.form, "row", $$v)},expression:"form.row"}})],1):_vm._e(),(_vm.config.component === 'NewsVideoTwo')?_c('el-form-item',{attrs:{"label":"每行展示条数"}},[_c('el-input-number',{staticClass:"w-full",attrs:{"min":1,"controls-position":"right"},on:{"change":_vm.selectChange},model:{value:(_vm.form.col),callback:function ($$v) {_vm.$set(_vm.form, "col", $$v)},expression:"form.col"}})],1):_vm._e(),_c('layoutConfig',{attrs:{"config":_vm.config,"layoutWidth":_vm.layoutWidth,"layout":_vm.layout},on:{"layoutChange":_vm.layoutChange}})],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./src/modules/portal-management/components/config/NewsVideoConfig.vue?vue&type=template&id=4d068d96

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

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

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

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.filter.js
var es_array_filter = __webpack_require__("4de4");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.find.js
var es_array_find = __webpack_require__("7db0");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.function.name.js
var es_function_name = __webpack_require__("b0c0");

// EXTERNAL MODULE: ./node_modules/core-js/modules/es.object.to-string.js
var es_object_to_string = __webpack_require__("d3b7");

// EXTERNAL MODULE: ./node_modules/@wiz-api/workbench-std/lib/workbench-std.umd.js
var workbench_std_umd = __webpack_require__("78a9");

// EXTERNAL MODULE: ./src/assets/js/Common.js
var Common = __webpack_require__("2b76");

// EXTERNAL MODULE: ./src/modules/portal-management/js/config.js
var config = __webpack_require__("e2d8");

// EXTERNAL MODULE: ./src/modules/portal-management/components/config/LayoutConfig.vue + 4 modules
var LayoutConfig = __webpack_require__("6b6c");

// 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/portal-management/components/config/NewsVideoConfig.vue?vue&type=script&lang=js







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





var columnApi = new workbench_std_umd["ColumApi"]();
/* harmony default export */ var NewsVideoConfigvue_type_script_lang_js = ({
  props: ['configData', 'layoutData', 'mode', 'layoutWidth', 'layout'],
  components: {
    layoutConfig: LayoutConfig["a" /* default */]
  },
  data: function data() {
    return {
      form: {
        dataSource: '',
        // 数据来源
        showContent: true,
        // 显示摘要
        showDate: true,
        // 显示时间
        showPagination: true,
        // 显示分页
        showTitle: true,
        // 显示栏目名称
        showMore: true,
        // 显示更多
        row: 1,
        // 展示行数
        col: 1,
        // 每行展示条数
        imageFit: 'fill',
        // 图片填充方式
        title: '' // 显示名称
      },
      config: {
        component: config["l" /* videoType */][0].value,
        w: 10,
        h: 10
      },
      columnData: [],
      videoType: config["l" /* videoType */],
      imageFitType: config["e" /* imageFitType */]
    };
  },
  watch: {
    configData: {
      deep: true,
      immediate: true,
      handler: function handler(val) {
        this.form = this.$options.data().form;
        if (!_.isEmpty(val)) {
          _.assign(this.form, val);
        } else {
          this.selectChange();
        }
      }
    },
    layoutData: {
      deep: true,
      immediate: true,
      handler: function handler(val) {
        if (!_.isEmpty(val)) {
          this.config = _.pick(this.layoutData, ['w', 'h', 'component', 'type', 'x', 'y', 'i']);
        }
      }
    }
  },
  methods: {
    getColumnData: function getColumnData() {
      var _this = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee() {
        var _yield$columnApi$tree, _yield$columnApi$tree2, err, res, data;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              _context.next = 2;
              return columnApi.tree(0);
            case 2:
              _yield$columnApi$tree = _context.sent;
              _yield$columnApi$tree2 = Object(slicedToArray["a" /* default */])(_yield$columnApi$tree, 2);
              err = _yield$columnApi$tree2[0];
              res = _yield$columnApi$tree2[1];
              if (!err) {
                data = Object(Common["b" /* treeToOneArray */])(res, 'child');
                _this.columnData = _.filter(data, function (item) {
                  return item.type === _this.config.type;
                });
              }
            case 7:
            case "end":
              return _context.stop();
          }
        }, _callee);
      }))();
    },
    sourceChange: function sourceChange() {
      this.form.title = _.find(this.columnData, {
        id: this.form.dataSource
      }).name;
      this.selectChange();
    },
    selectChange: function selectChange() {
      this.$emit('configChange', this.form);
    },
    layoutChange: function layoutChange(val) {
      this.config = _.cloneDeep(val);
      this.$emit('layoutChange', val);
    }
  },
  created: function created() {
    this.getColumnData();
  }
});
// CONCATENATED MODULE: ./src/modules/portal-management/components/config/NewsVideoConfig.vue?vue&type=script&lang=js
 /* harmony default export */ var config_NewsVideoConfigvue_type_script_lang_js = (NewsVideoConfigvue_type_script_lang_js); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");

// CONCATENATED MODULE: ./src/modules/portal-management/components/config/NewsVideoConfig.vue





/* normalize component */

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

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

/***/ })

}]);
//# sourceMappingURL=portal-management-std.umd.109.js.map