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

/***/ "b43a":
/***/ (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":"28eb61d9-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/contractor-management-sm/components/ViewAccount.vue?vue&type=template&id=3e424ea2
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:"small-dialog",attrs:{"close-on-click-modal":false,"title":"承包商负责人账号信息","visible":_vm.dialogVisible},on:{"update:visible":function($event){_vm.dialogVisible=$event},"close":_vm.closeDialog}},[_c('el-form',{attrs:{"model":_vm.form,"label-width":"150px"}},[_c('el-form-item',{attrs:{"label":"所属承包商："}},[_vm._v(_vm._s(_vm.form.contractorName))]),_c('div',{attrs:{"id":"copyContent"}},[_c('el-form-item',{attrs:{"label":"负责人账号："}},[_vm._v(_vm._s(_vm.form.userName))]),_c('el-form-item',{attrs:{"label":"初始密码："}},[_vm._v(_vm._s(_vm.form.initialPwd))])],1),_c('el-form-item',{attrs:{"label":"初始密码规则："}},[_vm._v("账号拼音首字母大写+.身份证后四位")])],1),_c('div',{staticClass:"text-center",attrs:{"slot":"footer"},slot:"footer"},[_c('el-button',{attrs:{"size":"small","type":"primary"},on:{"click":_vm.copy}},[_vm._v("复制信息")]),_c('el-button',{staticClass:"iconfont icon-close",attrs:{"size":"small"},on:{"click":function($event){return _vm.closeDialog()}}},[_vm._v("取消")])],1)],1)}
var staticRenderFns = []


// CONCATENATED MODULE: ./src/modules/contractor-management-sm/components/ViewAccount.vue?vue&type=template&id=3e424ea2

// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/regenerator.js + 1 modules
var regenerator = __webpack_require__("c14f");

// 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.concat.js
var es_array_concat = __webpack_require__("99af");

// EXTERNAL MODULE: ./node_modules/@wiz-api/contractor-management/lib/contractor-management.umd.js
var contractor_management_umd = __webpack_require__("77b0");

// 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/contractor-management-sm/components/ViewAccount.vue?vue&type=script&lang=js




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


var contractorAccountRelationApi = new contractor_management_umd["ContractorAccountRelationApi"]();
/* harmony default export */ var ViewAccountvue_type_script_lang_js = ({
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    id: {
      type: String,
      required: true
    }
  },
  data: function data() {
    return {
      form: {}
    };
  },
  computed: {
    dialogVisible: {
      get: function get() {
        return this.visible;
      },
      set: function set(val) {
        this.$emit('update:visible', val);
      }
    }
  },
  watch: {
    dialogVisible: function dialogVisible(val) {
      if (val) {
        this.getDetail();
      }
    }
  },
  methods: {
    getDetail: function getDetail() {
      var _this = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee() {
        var _yield$contractorAcco, _yield$contractorAcco2, err, res;
        return Object(regenerator["a" /* default */])().w(function (_context) {
          while (1) switch (_context.n) {
            case 0:
              _context.n = 1;
              return contractorAccountRelationApi.getContractorLeaderAccountInfo(_this.id);
            case 1:
              _yield$contractorAcco = _context.v;
              _yield$contractorAcco2 = Object(slicedToArray["a" /* default */])(_yield$contractorAcco, 2);
              err = _yield$contractorAcco2[0];
              res = _yield$contractorAcco2[1];
              if (!err) {
                _this.form = res;
              }
            case 2:
              return _context.a(2);
          }
        }, _callee);
      }))();
    },
    copy: function copy() {
      var _this2 = this;
      return Object(asyncToGenerator["a" /* default */])(/*#__PURE__*/Object(regenerator["a" /* default */])().m(function _callee2() {
        var copyContent, selection, range;
        return Object(regenerator["a" /* default */])().w(function (_context2) {
          while (1) switch (_context2.n) {
            case 0:
              if (!navigator.clipboard) {
                _context2.n = 2;
                break;
              }
              _context2.n = 1;
              return navigator.clipboard.writeText("\u8D1F\u8D23\u4EBA\u8D26\u53F7\uFF1A".concat(_this2.form.userName, "\n\u521D\u59CB\u5BC6\u7801\uFF1A").concat(_this2.form.initialPwd));
            case 1:
              _this2.$message.success('复制成功');
              _context2.n = 3;
              break;
            case 2:
              if (document.execCommand && document.execCommand('copy')) {
                copyContent = document.getElementById('copyContent');
                selection = window.getSelection();
                range = document.createRange();
                if (selection.rangeCount > 0) selection.removeAllRanges();
                range.selectNode(copyContent);
                selection.addRange(range);
                document.execCommand('copy');
                _this2.$message.success('复制成功');
              } else {
                _this2.$message.warning('复制失败，请使用Ctrl+C或右键复制');
              }
            case 3:
              return _context2.a(2);
          }
        }, _callee2);
      }))();
    },
    closeDialog: function closeDialog(done) {
      this.form = this.$options.data().form;
      if (done) {
        done();
      } else {
        this.dialogVisible = false;
      }
    }
  }
});
// CONCATENATED MODULE: ./src/modules/contractor-management-sm/components/ViewAccount.vue?vue&type=script&lang=js
 /* harmony default export */ var components_ViewAccountvue_type_script_lang_js = (ViewAccountvue_type_script_lang_js); 
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");

// CONCATENATED MODULE: ./src/modules/contractor-management-sm/components/ViewAccount.vue





/* normalize component */

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

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

/***/ })

}]);
//# sourceMappingURL=contractor-management-sm.umd.14.js.map