/******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	// The require scope
/******/ 	var __webpack_require__ = {};
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/make namespace object */
/******/ 	!function() {
/******/ 		// define __esModule on exports
/******/ 		__webpack_require__.r = function(exports) {
/******/ 			if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 				Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 			}
/******/ 			Object.defineProperty(exports, '__esModule', { value: true });
/******/ 		};
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": function() { return /* binding */ ai_recommend; }
});

;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js??ruleSet[1].rules[2]!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/ai-recommend/src/main.vue?vue&type=template&id=4ccd667d&
var render = function render() {
  var _vm = this,
    _c = _vm._self._c;
  return _c("div", {
    staticClass: "jdf-ai-recommend"
  }, [_c("div", {
    staticClass: "ai-recommend-tips"
  }, [_c("div", {
    staticClass: "title"
  }, [_vm._v(_vm._s(_vm.title))]), _c("div", {
    staticClass: "tips"
  }, [_vm._m(0), _c("div", {
    staticClass: "recommend-tips-text"
  }, [_vm._v(_vm._s(_vm.tipsText))])])]), _c("div", {
    directives: [{
      name: "loading",
      rawName: "v-loading",
      value: _vm.loading,
      expression: "loading"
    }],
    staticClass: "ai-recommend-select"
  }, [_c("el-radio-group", {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: _vm.loaded,
      expression: "loaded"
    }],
    on: {
      change: _vm.changeRecommend
    },
    model: {
      value: _vm.checked,
      callback: function callback($$v) {
        _vm.checked = $$v;
      },
      expression: "checked"
    }
  }, _vm._l(_vm.recommendList, function (item, index) {
    return _c("el-radio", {
      key: index,
      attrs: {
        label: item.content,
        value: item.content,
        title: item.content
      }
    });
  }), 1), _c("div", {
    directives: [{
      name: "show",
      rawName: "v-show",
      value: _vm.isEmpty(_vm.recommendList),
      expression: "isEmpty(recommendList)"
    }],
    staticClass: "empty-info"
  }, [_vm._v("\n      该文处理流程较少，暂时没有AI意见\n    ")])], 1)]);
};
var staticRenderFns = [function () {
  var _vm = this,
    _c = _vm._self._c;
  return _c("div", {
    staticClass: "recommend-tips-icon"
  }, [_c("div", {
    staticClass: "icon"
  })]);
}];
render._withStripped = true;

;// CONCATENATED MODULE: ./packages/ai-recommend/src/main.vue?vue&type=template&id=4ccd667d&

;// CONCATENATED MODULE: external "@babel/runtime/helpers/asyncToGenerator"
var asyncToGenerator_namespaceObject = require("@babel/runtime/helpers/asyncToGenerator");
var asyncToGenerator_default = /*#__PURE__*/__webpack_require__.n(asyncToGenerator_namespaceObject);
;// CONCATENATED MODULE: external "@babel/runtime/regenerator"
var regenerator_namespaceObject = require("@babel/runtime/regenerator");
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator_namespaceObject);
;// CONCATENATED MODULE: external "lodash/isEmpty"
var isEmpty_namespaceObject = require("lodash/isEmpty");
var isEmpty_default = /*#__PURE__*/__webpack_require__.n(isEmpty_namespaceObject);
;// CONCATENATED MODULE: external "jdf-jssdk"
var external_jdf_jssdk_namespaceObject = require("jdf-jssdk");
;// CONCATENATED MODULE: ./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/index.js??vue-loader-options!./packages/ai-recommend/src/main.vue?vue&type=script&lang=js&




/* harmony default export */ var mainvue_type_script_lang_js_ = ({
  name: 'JdfAiRecommend',
  props: {
    // 任务信息
    taskInfo: {
      type: Object,
      default: function _default() {
        return {};
      }
    },
    // 标题
    title: {
      type: String,
      default: 'AI推荐'
    },
    // 标题下方文字
    tipsText: {
      type: String,
      default: 'AI智能引擎已为您推荐“审批意见”，您可以点击切换其他意见'
    },
    // 当前任务处理人所属部门code
    ownerOrgCode: String,
    // 是否默认选中第一条
    defaultCheckedFirst: {
      type: Boolean,
      default: true
    }
  },
  data: function data() {
    return {
      isEmpty: (isEmpty_default()),
      checked: '',
      // 推荐列表
      recommendList: [],
      loaded: false,
      loading: false
    };
  },
  created: function created() {
    this.getRecommendList();
  },
  methods: {
    /**
     * 获取AI智能推荐数据
     */
    getRecommendList: function getRecommendList() {
      var _this = this;
      return asyncToGenerator_default()( /*#__PURE__*/regenerator_default().mark(function _callee() {
        var taskInfo, owner, _yield$AIRecommendSer, opinionCandidate, _opinionCandidate$, first;
        return regenerator_default().wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              _context.prev = 0;
              _this.loading = true;
              taskInfo = _this.taskInfo, owner = _this.taskInfo.owner;
              _context.next = 5;
              return new external_jdf_jssdk_namespaceObject.AIRecommendService(_this.$JDF.baseUrl).predict({
                msg_id: taskInfo.processInstanceId,
                msg_tiid: taskInfo.taskId,
                msg_tid: taskInfo.nodeKey,
                current_unit: "".concat(_this.ownerOrgCode, "|").concat(owner.deptName),
                current_person: owner.userId,
                msg_type: taskInfo.processDefinitionName
              });
            case 5:
              _yield$AIRecommendSer = _context.sent;
              opinionCandidate = _yield$AIRecommendSer.msg_data.opinion_candidate;
              _this.recommendList = opinionCandidate;
              if (_this.defaultCheckedFirst) {
                // 默认选中第一个
                first = (_opinionCandidate$ = opinionCandidate[0]) === null || _opinionCandidate$ === void 0 ? void 0 : _opinionCandidate$.content;
                _this.checked = first;
                _this.changeRecommend(first);
              }
              _context.next = 14;
              break;
            case 11:
              _context.prev = 11;
              _context.t0 = _context["catch"](0);
              _this.recommendList = [];
            case 14:
              _context.prev = 14;
              _this.loaded = true;
              _this.loading = false;
              return _context.finish(14);
            case 18:
            case "end":
              return _context.stop();
          }
        }, _callee, null, [[0, 11, 14, 18]]);
      }))();
    },
    /**
     * 切换
     * @param {String} val 选中的值
     */
    changeRecommend: function changeRecommend(val) {
      var data = this.recommendList.find(function (t) {
        return t.content === val;
      });
      this.checkRecommend(data);
      this.$emit('change', data);
    },
    /**
     * 选中数据
     * @param {Object} data 默认选中的AI推荐数据
     */
    checkRecommend: function checkRecommend(data) {
      this.checked = data === null || data === void 0 ? void 0 : data.content;
    }
  }
});
;// CONCATENATED MODULE: ./packages/ai-recommend/src/main.vue?vue&type=script&lang=js&
 /* harmony default export */ var src_mainvue_type_script_lang_js_ = (mainvue_type_script_lang_js_); 
;// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
/* globals __VUE_SSR_CONTEXT__ */

// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
// This module is a runtime utility for cleaner component module output and will
// be included in the final webpack user bundle.

function normalizeComponent(
  scriptExports,
  render,
  staticRenderFns,
  functionalTemplate,
  injectStyles,
  scopeId,
  moduleIdentifier /* server only */,
  shadowMode /* vue-cli only */
) {
  // Vue.extend constructor export interop
  var options =
    typeof scriptExports === 'function' ? scriptExports.options : scriptExports

  // render functions
  if (render) {
    options.render = render
    options.staticRenderFns = staticRenderFns
    options._compiled = true
  }

  // functional template
  if (functionalTemplate) {
    options.functional = true
  }

  // scopedId
  if (scopeId) {
    options._scopeId = 'data-v-' + scopeId
  }

  var hook
  if (moduleIdentifier) {
    // server build
    hook = function (context) {
      // 2.3 injection
      context =
        context || // cached call
        (this.$vnode && this.$vnode.ssrContext) || // stateful
        (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
      // 2.2 with runInNewContext: true
      if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
        context = __VUE_SSR_CONTEXT__
      }
      // inject component styles
      if (injectStyles) {
        injectStyles.call(this, context)
      }
      // register component module identifier for async chunk inferrence
      if (context && context._registeredComponents) {
        context._registeredComponents.add(moduleIdentifier)
      }
    }
    // used by ssr in case component is cached and beforeCreate
    // never gets called
    options._ssrRegister = hook
  } else if (injectStyles) {
    hook = shadowMode
      ? function () {
          injectStyles.call(
            this,
            (options.functional ? this.parent : this).$root.$options.shadowRoot
          )
        }
      : injectStyles
  }

  if (hook) {
    if (options.functional) {
      // for template-only hot-reload because in that case the render fn doesn't
      // go through the normalizer
      options._injectStyles = hook
      // register for functional component in vue file
      var originalRender = options.render
      options.render = function renderWithStyleInjection(h, context) {
        hook.call(context)
        return originalRender(h, context)
      }
    } else {
      // inject component registration as beforeCreate hook
      var existing = options.beforeCreate
      options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
    }
  }

  return {
    exports: scriptExports,
    options: options
  }
}

;// CONCATENATED MODULE: ./packages/ai-recommend/src/main.vue





/* normalize component */
;
var component = normalizeComponent(
  src_mainvue_type_script_lang_js_,
  render,
  staticRenderFns,
  false,
  null,
  null,
  null
  
)

/* harmony default export */ var main = (component.exports);
;// CONCATENATED MODULE: ./packages/ai-recommend/index.js

main.install = function (Vue) {
  Vue.component(main.name, main);
};
/* harmony default export */ var ai_recommend = (main);
module.exports = __webpack_exports__;
/******/ })()
;