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

/***/ 1:
/***/ (function(module, exports) {

/* (ignored) */

/***/ }),

/***/ "9105":
/***/ (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":"3f554254-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/host/resource-management/components/apiScope/OperateApiScope.vue?vue&type=template&id=2affb522&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:{"width":"565px","close-on-click-modal":false,"append-to-body":true,"visible":_vm.operateApiScopeProps.visible,"title":_vm.operateApiScopeProps.title},on:{"update:visible":function($event){return _vm.$set(_vm.operateApiScopeProps, "visible", $event)}}},[_c('el-form',{directives:[{name:"loading",rawName:"v-loading",value:(_vm.formLoading),expression:"formLoading"}],ref:"apiScopeForm",attrs:{"size":"mini","label-width":"150px","rules":_vm.apiRules,"model":_vm.apiScopeForm}},[_c('el-form-item',{attrs:{"label":"名称","prop":"name"}},[_c('el-input',{attrs:{"readonly":_vm.operateApiScopeProps.editType === 'edit',"placeholder":"请输入名称","size":"small","clearable":""},model:{value:(_vm.apiScopeForm.name),callback:function ($$v) {_vm.$set(_vm.apiScopeForm, "name", $$v)},expression:"apiScopeForm.name"}})],1),_c('el-form-item',{attrs:{"label":"显示名称","prop":"displayName"}},[_c('el-input',{attrs:{"placeholder":"请输入显示名称","size":"small","clearable":""},model:{value:(_vm.apiScopeForm.displayName),callback:function ($$v) {_vm.$set(_vm.apiScopeForm, "displayName", $$v)},expression:"apiScopeForm.displayName"}})],1),_c('el-form-item',{attrs:{"label":"声明集","prop":"userClaims"}},[_c('el-select',{staticClass:"w-full",attrs:{"size":"small","multiple":"","filterable":"","clearable":""},model:{value:(_vm.apiScopeForm.userClaims),callback:function ($$v) {_vm.$set(_vm.apiScopeForm, "userClaims", $$v)},expression:"apiScopeForm.userClaims"}},_vm._l((_vm.claimTypes),function(item){return _c('el-option',{key:item.id,attrs:{"value":item.name,"label":item.name}})}),1)],1),_c('el-form-item',{attrs:{"label":"描述","prop":"description"}},[_c('el-input',{attrs:{"placeholder":"请输入描述","size":"small","clearable":""},model:{value:(_vm.apiScopeForm.description),callback:function ($$v) {_vm.$set(_vm.apiScopeForm, "description", $$v)},expression:"apiScopeForm.description"}})],1),_c('el-form-item',{attrs:{"label":"启用","prop":"enabled"}},[_c('el-checkbox',{model:{value:(_vm.apiScopeForm.enabled),callback:function ($$v) {_vm.$set(_vm.apiScopeForm, "enabled", $$v)},expression:"apiScopeForm.enabled"}})],1),_c('el-form-item',{attrs:{"label":"在发现文档中显示","prop":"showInDiscoveryDocument"}},[_c('el-checkbox',{model:{value:(_vm.apiScopeForm.showInDiscoveryDocument),callback:function ($$v) {_vm.$set(_vm.apiScopeForm, "showInDiscoveryDocument", $$v)},expression:"apiScopeForm.showInDiscoveryDocument"}})],1),_c('el-form-item',{attrs:{"label":"重要","prop":"emphasize"}},[_c('el-checkbox',{model:{value:(_vm.apiScopeForm.emphasize),callback:function ($$v) {_vm.$set(_vm.apiScopeForm, "emphasize", $$v)},expression:"apiScopeForm.emphasize"}})],1),_c('el-form-item',{attrs:{"label":"必须","prop":"required"}},[_c('el-checkbox',{model:{value:(_vm.apiScopeForm.required),callback:function ($$v) {_vm.$set(_vm.apiScopeForm, "required", $$v)},expression:"apiScopeForm.required"}})],1)],1),_c('div',{staticClass:"text-center",attrs:{"slot":"footer"},slot:"footer"},[_c('el-button',{staticClass:"iconfont icon-save",attrs:{"size":"small","type":"primary"},on:{"click":function($event){return _vm.save()}}},[_vm._v("保存")]),_c('el-button',{staticClass:"iconfont icon-close",attrs:{"size":"small"},on:{"click":function($event){return _vm.cancel()}}},[_vm._v("取消")])],1)],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./src/modules/host/resource-management/components/apiScope/OperateApiScope.vue?vue&type=template&id=2affb522&scoped=true

// 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/@wiz-api/auth-server/lib/auth-server.umd.js
var auth_server_umd = __webpack_require__("93f7");

// EXTERNAL MODULE: ./node_modules/@wiz-api/account/lib/account.umd.js
var account_umd = __webpack_require__("32d0");

// 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/host/resource-management/components/apiScope/OperateApiScope.vue?vue&type=script&lang=js



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



var apiScopeApi = new auth_server_umd["ApiScopeApi"]();
var claimTypeApi = new account_umd["ClaimTypeApi"]();
/* harmony default export */ var OperateApiScopevue_type_script_lang_js = ({
  name: 'operateApiScopeDialog',
  props: {
    operateApiScopeProps: {
      type: Object,
      default: function _default() {
        return {
          title: '新增api范围',
          editType: 'create',
          visible: false
        };
      }
    },
    apiScopeForm: {
      type: Object,
      default: function _default() {
        return {
          name: '',
          displayName: '',
          description: '',
          userClaims: [],
          enabled: false,
          showInDiscoveryDocument: false
        };
      }
    }
  },
  components: {},
  data: function data() {
    return {
      formLoading: false,
      claimTypes: [],
      // 声明集
      apiRules: {
        name: [{
          required: true,
          message: '请输入名称',
          trigger: ['blur', 'change']
        }],
        displayName: [{
          required: true,
          message: '请输入显示名称',
          trigger: ['blur', 'change']
        }]
      }
    };
  },
  computed: {},
  methods: {
    findClaimTypes: function findClaimTypes() {
      var _this = this;
      return Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee() {
        var _yield$claimTypeApi$g, _yield$claimTypeApi$g2, err, res;
        return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              _this.formLoading = true;
              _context.next = 3;
              return claimTypeApi.getAllList();
            case 3:
              _yield$claimTypeApi$g = _context.sent;
              _yield$claimTypeApi$g2 = Object(slicedToArray["a" /* default */])(_yield$claimTypeApi$g, 2);
              err = _yield$claimTypeApi$g2[0];
              res = _yield$claimTypeApi$g2[1];
              _this.formLoading = false;
              if (!err) {
                _this.claimTypes = res;
                _this.initClaimTypes = _.cloneDeep(_this.claimTypes);
              }
            case 9:
            case "end":
              return _context.stop();
          }
        }, _callee);
      }))();
    },
    cancel: function cancel() {
      this.operateApiScopeProps.visible = false;
    },
    save: function save() {
      var _this2 = this;
      this.$refs.apiScopeForm.validate( /*#__PURE__*/function () {
        var _ref = Object(asyncToGenerator["a" /* default */])( /*#__PURE__*/Object(regeneratorRuntime["a" /* default */])().mark(function _callee2(valid) {
          var _yield$apiScopeApi$cr, _yield$apiScopeApi$cr2, err, res, _yield$apiScopeApi$up, _yield$apiScopeApi$up2, updateErr, updateRes;
          return Object(regeneratorRuntime["a" /* default */])().wrap(function _callee2$(_context2) {
            while (1) switch (_context2.prev = _context2.next) {
              case 0:
                if (!valid) {
                  _context2.next = 17;
                  break;
                }
                if (!(_this2.operateApiScopeProps.editType === 'create')) {
                  _context2.next = 10;
                  break;
                }
                _context2.next = 4;
                return apiScopeApi.create({
                  body: _this2.apiScopeForm
                });
              case 4:
                _yield$apiScopeApi$cr = _context2.sent;
                _yield$apiScopeApi$cr2 = Object(slicedToArray["a" /* default */])(_yield$apiScopeApi$cr, 2);
                err = _yield$apiScopeApi$cr2[0];
                res = _yield$apiScopeApi$cr2[1];
                if (!err) {
                  _this2.$message.success({
                    showClose: true,
                    message: '新增成功'
                  });
                  _this2.operateApiScopeProps.visible = false;
                  _this2.$emit('refreshList');
                }
                return _context2.abrupt("return");
              case 10:
                _context2.next = 12;
                return apiScopeApi.update(_this2.apiScopeForm.id, {
                  body: _this2.apiScopeForm
                });
              case 12:
                _yield$apiScopeApi$up = _context2.sent;
                _yield$apiScopeApi$up2 = Object(slicedToArray["a" /* default */])(_yield$apiScopeApi$up, 2);
                updateErr = _yield$apiScopeApi$up2[0];
                updateRes = _yield$apiScopeApi$up2[1];
                if (!updateErr) {
                  _this2.$message.success({
                    showClose: true,
                    message: '修改成功'
                  });
                  _this2.operateApiScopeProps.visible = false;
                  _this2.$emit('refreshList');
                }
              case 17:
              case "end":
                return _context2.stop();
            }
          }, _callee2);
        }));
        return function (_x) {
          return _ref.apply(this, arguments);
        };
      }());
    }
  },
  created: function created() {
    this.findClaimTypes();
  }
});
// CONCATENATED MODULE: ./src/modules/host/resource-management/components/apiScope/OperateApiScope.vue?vue&type=script&lang=js
 /* harmony default export */ var apiScope_OperateApiScopevue_type_script_lang_js = (OperateApiScopevue_type_script_lang_js); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");

// CONCATENATED MODULE: ./src/modules/host/resource-management/components/apiScope/OperateApiScope.vue





/* normalize component */

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

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

/***/ })

}]);
//# sourceMappingURL=resource-management.umd.11.js.map