mk-form-design
Version:
基于vue、ant-design-vue的表单设计器,可视化开发表单
665 lines (575 loc) • 9.39 MB
JavaScript
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // 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 });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
/******/ })
/************************************************************************/
/******/ ({
/***/ 0:
/***/ (function(module, exports) {
/* (ignored) */
/***/ }),
/***/ "00bb":
/***/ (function(module, exports, __webpack_require__) {
;(function (root, factory, undef) {
if (true) {
// CommonJS
module.exports = exports = factory(__webpack_require__("21bf"), __webpack_require__("38ba"));
}
else {}
}(this, function (CryptoJS) {
/**
* Cipher Feedback block mode.
*/
CryptoJS.mode.CFB = (function () {
var CFB = CryptoJS.lib.BlockCipherMode.extend();
CFB.Encryptor = CFB.extend({
processBlock: function (words, offset) {
// Shortcuts
var cipher = this._cipher;
var blockSize = cipher.blockSize;
generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
// Remember this block to use with next block
this._prevBlock = words.slice(offset, offset + blockSize);
}
});
CFB.Decryptor = CFB.extend({
processBlock: function (words, offset) {
// Shortcuts
var cipher = this._cipher;
var blockSize = cipher.blockSize;
// Remember this block to use with next block
var thisBlock = words.slice(offset, offset + blockSize);
generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
// This block becomes the previous block
this._prevBlock = thisBlock;
}
});
function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {
var keystream;
// Shortcut
var iv = this._iv;
// Generate keystream
if (iv) {
keystream = iv.slice(0);
// Remove IV for subsequent blocks
this._iv = undefined;
} else {
keystream = this._prevBlock;
}
cipher.encryptBlock(keystream, 0);
// Encrypt
for (var i = 0; i < blockSize; i++) {
words[offset + i] ^= keystream[i];
}
}
return CFB;
}());
return CryptoJS.mode.CFB;
}));
/***/ }),
/***/ "00fd":
/***/ (function(module, exports, __webpack_require__) {
var Symbol = __webpack_require__("9e69");
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/** Built-in value references. */
var symToStringTag = Symbol ? Symbol.toStringTag : undefined;
/**
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
*
* @private
* @param {*} value The value to query.
* @returns {string} Returns the raw `toStringTag`.
*/
function getRawTag(value) {
var isOwn = hasOwnProperty.call(value, symToStringTag),
tag = value[symToStringTag];
try {
value[symToStringTag] = undefined;
var unmasked = true;
} catch (e) {}
var result = nativeObjectToString.call(value);
if (unmasked) {
if (isOwn) {
value[symToStringTag] = tag;
} else {
delete value[symToStringTag];
}
}
return result;
}
module.exports = getRawTag;
/***/ }),
/***/ "00ff":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.function.name.js
var es6_function_name = __webpack_require__("7f7f");
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"250e4638-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!./packages/MkFormItem/index.vue?vue&type=template&id=2ad4d38b&scoped=true&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (
!(_vm.record.options.hidden === true) &&
(
(_vm.openStatus === 'add' && _vm.record.options.addVisible) ||
(_vm.openStatus === 'edit' && _vm.record.options.updateVisible) ||
(_vm.openStatus === 'view' && _vm.record.options.readVisible) ||
(_vm.openStatus === 'preview')
) &&
[
'input',
'textarea',
'date',
'time',
'number',
'radio',
'checkbox',
'select',
'rate',
'switch',
'slider',
'uploadImg',
'uploadFile',
'cascader',
'treeSelect',
'girdview',
'address'
].includes(_vm.record.type)
)?_c('van-cell-group',{attrs:{"label-col":_vm.formConfig.layout === 'horizontal' ? _vm.formConfig.labelCol : {},"id":_vm.record.model,"wrapper-col":_vm.formConfig.layout === 'horizontal' ? _vm.formConfig.wrapperCol : {}}},[(['input', 'textarea'].includes(_vm.record.type))?_c('MkFormInputSensitive',{attrs:{"record":_vm.record,"disabled":_vm.disabled,"open-status":_vm.openStatus,"rules":_vm.rules,"label-width":_vm.labelWidth},on:{"change":_vm.handleChange,"changeValue":_vm.changeValue},model:{value:(_vm.record.value),callback:function ($$v) {_vm.$set(_vm.record, "value", $$v)},expression:"record.value"}}):(_vm.record.type === 'date')?[_c('k-date-picker',{attrs:{"containerName":_vm.containerName,"record":_vm.record,"disabled":_vm.disabled,"open-status":_vm.openStatus,"label-width":_vm.labelWidth,"rules":_vm.rules},on:{"change":_vm.handleChange},model:{value:(_vm.record.value),callback:function ($$v) {_vm.$set(_vm.record, "value", $$v)},expression:"record.value"}})]:(_vm.record.type === 'time')?[_c('k-time-picker',{attrs:{"containerName":_vm.containerName,"record":_vm.record,"disabled":_vm.disabled,"open-status":_vm.openStatus,"label-width":_vm.labelWidth,"rules":_vm.rules},on:{"change":_vm.handleChange},model:{value:(_vm.record.value),callback:function ($$v) {_vm.$set(_vm.record, "value", $$v)},expression:"record.value"}})]:(_vm.record.type === 'number')?_c('van-field',{directives:[{name:"decorator",rawName:"v-decorator",value:([
_vm.record.model,
{
initialValue: _vm.record.options.defaultValue,
rules: _vm.rules
}
]),expression:"[\n record.model,\n {\n initialValue: record.options.defaultValue,\n rules: rules\n }\n ]"}],style:(("width:" + (_vm.record.options.width))),attrs:{"label-width":_vm.labelWidth,"name":_vm.record.model,"type":"number","min":_vm.record.options.min || _vm.record.options.min === 0
? _vm.record.options.min
: -Infinity,"max":_vm.record.options.max || _vm.record.options.max === 0
? _vm.record.options.max
: Infinity,"disabled":_vm.disabledComputed,"step":_vm.record.options.step,"precision":_vm.record.options.precision > 50 ||
(!_vm.record.options.precision && _vm.record.options.precision !== 0)
? null
: _vm.record.options.precision,"placeholder":_vm.openStatus === 'view' ? '' : _vm.record.options.placeholder,"required":_vm.record.options.required,"rules":_vm.rules},on:{"change":function($event){return _vm.handleNumberChange($event, _vm.record.model)}},model:{value:(_vm.record.value),callback:function ($$v) {_vm.$set(_vm.record, "value", (typeof $$v === 'string'? $$v.trim(): $$v))},expression:"record.value"}},[_c('template',{slot:"label"},[_c('span',[_vm._v(_vm._s(_vm.record.label))]),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.record.options.tooltip),expression:"record.options.tooltip"}],staticStyle:{"padding-left":"5px"}},[_c('van-popover',{attrs:{"trigger":"click","theme":"dark"},scopedSlots:_vm._u([{key:"reference",fn:function(){return [_c('van-icon',{attrs:{"name":"question-o"}})]},proxy:true}],null,false,1267421819),model:{value:(_vm.showPopover),callback:function ($$v) {_vm.showPopover=$$v},expression:"showPopover"}},[_c('div',{staticStyle:{"width":"120px","max-height":"80px","overflow":"auto","margin":"20px"}},[_vm._v(" "+_vm._s(_vm.record.options.tooltip)+" ")])])],1)])],2):(_vm.record.type === 'radio')?_c('van-field',{attrs:{"label-width":_vm.labelWidth,"name":_vm.record.model,"required":_vm.record.options.required,"rules":_vm.rules,"disabled":_vm.disabledComputed},scopedSlots:_vm._u([{key:"input",fn:function(){return [_c('van-radio-group',{attrs:{"direction":_vm.record.options.direction === 'vertical'?'vertical':'horizontal',"options":_vm.defaultOptions,"disabled":_vm.disabledComputed},on:{"change":function($event){return _vm.handleChange($event, _vm.record.model)}},model:{value:(_vm.record.value),callback:function ($$v) {_vm.$set(_vm.record, "value", $$v)},expression:"record.value"}},_vm._l((_vm.defaultOptions),function(item,idx){return _c('van-radio',{key:'key'+_vm.record.options.dynamicKey+idx,attrs:{"name":item.value,"label-disabled":""}},[_vm._v(_vm._s(item.label))])}),1)]},proxy:true}],null,false,2944130637)},[_c('template',{slot:"label"},[_c('span',[_vm._v(_vm._s(_vm.record.label))]),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.record.options.tooltip),expression:"record.options.tooltip"}],staticStyle:{"padding-left":"5px"}},[_c('van-popover',{attrs:{"trigger":"click","theme":"dark"},scopedSlots:_vm._u([{key:"reference",fn:function(){return [_c('van-icon',{attrs:{"name":"question-o"}})]},proxy:true}],null,false,1267421819),model:{value:(_vm.showPopover),callback:function ($$v) {_vm.showPopover=$$v},expression:"showPopover"}},[_c('div',{staticStyle:{"width":"120px","max-height":"80px","overflow":"auto","margin":"20px"}},[_vm._v(" "+_vm._s(_vm.record.options.tooltip)+" ")])])],1)])],2):(_vm.record.type === 'checkbox')?_c('van-field',{attrs:{"label-width":_vm.labelWidth,"name":_vm.record.model,"required":_vm.record.options.required,"rules":_vm.rules,"disabled":_vm.disabledComputed},scopedSlots:_vm._u([{key:"input",fn:function(){return [_c('van-checkbox-group',{attrs:{"direction":_vm.record.options.direction === 'vertical'?'vertical':'horizontal',"disabled":_vm.disabledComputed},on:{"change":function($event){return _vm.handleChange($event, _vm.record.model)}},model:{value:(_vm.record.value),callback:function ($$v) {_vm.$set(_vm.record, "value", $$v)},expression:"record.value"}},_vm._l((_vm.defaultOptions),function(item,idx){return _c('van-checkbox',{key:'key'+_vm.record.options.dynamicKey+idx,attrs:{"shape":"square","name":item.value,"label-disabled":""}},[_vm._v(_vm._s(item.label))])}),1)]},proxy:true}],null,false,509022696)},[_c('template',{slot:"label"},[_c('span',[_vm._v(_vm._s(_vm.record.label))]),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.record.options.tooltip),expression:"record.options.tooltip"}],staticStyle:{"padding-left":"5px"}},[_c('van-popover',{attrs:{"trigger":"click","theme":"dark"},scopedSlots:_vm._u([{key:"reference",fn:function(){return [_c('van-icon',{attrs:{"name":"question-o"}})]},proxy:true}],null,false,1267421819),model:{value:(_vm.showPopover),callback:function ($$v) {_vm.showPopover=$$v},expression:"showPopover"}},[_c('div',{staticStyle:{"width":"120px","max-height":"80px","overflow":"auto","margin":"20px"}},[_vm._v(" "+_vm._s(_vm.record.options.tooltip)+" ")])])],1)])],2):(_vm.record.type === 'rate')?_c('van-field',{attrs:{"label-width":_vm.labelWidth,"name":_vm.record.model,"required":_vm.record.options.required,"rules":_vm.rules,"disabled":_vm.disabledComputed},scopedSlots:_vm._u([{key:"input",fn:function(){return [_c('van-rate',{attrs:{"count":_vm.record.options.max,"disabled":_vm.disabledComputed,"allow-half":_vm.record.options.allowHalf},on:{"change":function($event){return _vm.handleChange($event, _vm.record.model)}},model:{value:(_vm.record.value),callback:function ($$v) {_vm.$set(_vm.record, "value", $$v)},expression:"record.value"}})]},proxy:true}],null,false,1304686672)},[_c('template',{slot:"label"},[_c('span',[_vm._v(_vm._s(_vm.record.label))]),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.record.options.tooltip),expression:"record.options.tooltip"}],staticStyle:{"padding-left":"5px"}},[_c('van-popover',{attrs:{"trigger":"click","theme":"dark"},scopedSlots:_vm._u([{key:"reference",fn:function(){return [_c('van-icon',{attrs:{"name":"question-o"}})]},proxy:true}],null,false,1267421819),model:{value:(_vm.showPopover),callback:function ($$v) {_vm.showPopover=$$v},expression:"showPopover"}},[_c('div',{staticStyle:{"width":"120px","max-height":"80px","overflow":"auto","margin":"20px"}},[_vm._v(" "+_vm._s(_vm.record.options.tooltip)+" ")])])],1)])],2):(_vm.record.type === 'select')?[_c('van-field',{attrs:{"label-width":_vm.labelWidth,"readonly":"","clickable":"","name":_vm.record.model,"disabled":_vm.disabledComputed,"value":_vm.selectLabel,"required":_vm.record.options.required,"placeholder":_vm.openStatus === 'view' ? '' : _vm.record.options.placeholder,"rules":_vm.rules},on:{"click-input":function () {if (!_vm.disabledComputed) { if (_vm.record.options.multiple) {
_vm.showMultiplePicker = true
} else {
_vm.showPicker = true
}}},"change":function($event){return _vm.handleChange($event.target.value, _vm.record.model)}},scopedSlots:_vm._u([{key:"button",fn:function(){return [_c('i',{directives:[{name:"show",rawName:"v-show",value:(_vm.record.options.clearable && _vm.record.value),expression:"record.options.clearable && record.value"}],staticClass:"van-icon van-icon-clear van-field__clear",on:{"click":function($event){return _vm.clearContent($event.target.value, _vm.record.model)}}})]},proxy:true}],null,false,815187858)},[_c('template',{slot:"label"},[_c('span',[_vm._v(_vm._s(_vm.record.label))]),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.record.options.tooltip),expression:"record.options.tooltip"}],staticStyle:{"padding-left":"5px"}},[_c('van-popover',{attrs:{"trigger":"click","theme":"dark"},scopedSlots:_vm._u([{key:"reference",fn:function(){return [_c('van-icon',{attrs:{"name":"question-o"}})]},proxy:true}],null,false,1267421819),model:{value:(_vm.showPopover),callback:function ($$v) {_vm.showPopover=$$v},expression:"showPopover"}},[_c('div',{staticStyle:{"width":"120px","max-height":"80px","overflow":"auto","margin":"20px"}},[_vm._v(" "+_vm._s(_vm.record.options.tooltip)+" ")])])],1)]),_c('template',{slot:"right-icon"},[_c('span',{style:(_vm.disabledComputed ? {'color': '#c8c9cc'} : {'color':'#1a8afa'}),on:{"click":function () {if (!_vm.disabledComputed) { if (_vm.record.options.multiple) {
_vm.showMultiplePicker = true
} else {
_vm.showPicker = true
}}}}},[_vm._v("选择")])])],2),(_vm.record.options.multiple)?_c('MultipleSelectPopup',{attrs:{"label":"label","value":"value","containerName":_vm.containerName,"show-pop":_vm.showMultiplePicker,"select-list":_vm.record.value,"list":_vm.columns},on:{"update:showPop":function($event){_vm.showMultiplePicker=$event},"update:show-pop":function($event){_vm.showMultiplePicker=$event},"onConfirm":function (value) { return _vm.onPickerConfirm(_vm.record, value); }}}):_vm._e(),_c('mk-form-popup',{attrs:{"containerName":_vm.containerName,"show":_vm.showPicker,"ok-btn":_vm.record.options.okBtn},on:{"update:show":function($event){_vm.showPicker=$event},"ok":function($event){_vm.$refs['picker_' + _vm.record.key].confirm()}}},[_c('van-picker',{ref:'picker_' + _vm.record.key,attrs:{"show-toolbar":_vm.record.options.toolbar,"columns":_vm.columns,"value-key":"label"},on:{"confirm":function (value){ return _vm.onPickerConfirm(_vm.record,value); },"cancel":function($event){_vm.showPicker = false}}})],1)]:(_vm.record.type === 'switch')?_c('van-field',{attrs:{"label-width":_vm.labelWidth,"name":_vm.record.model,"required":_vm.record.options.required,"rules":_vm.rules},scopedSlots:_vm._u([{key:"input",fn:function(){return [_c('van-switch',{attrs:{"disabled":_vm.disabledComputed},on:{"change":function($event){return _vm.handleChange($event, _vm.record.model)}},model:{value:(_vm.record.value),callback:function ($$v) {_vm.$set(_vm.record, "value", $$v)},expression:"record.value"}})]},proxy:true}],null,false,2200044410)},[_c('template',{slot:"label"},[_c('span',[_vm._v(_vm._s(_vm.record.label))]),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.record.options.tooltip),expression:"record.options.tooltip"}],staticStyle:{"padding-left":"5px"}},[_c('van-popover',{attrs:{"trigger":"click","theme":"dark"},scopedSlots:_vm._u([{key:"reference",fn:function(){return [_c('van-icon',{attrs:{"name":"question-o"}})]},proxy:true}],null,false,1267421819),model:{value:(_vm.showPopover),callback:function ($$v) {_vm.showPopover=$$v},expression:"showPopover"}},[_c('div',{staticStyle:{"width":"120px","max-height":"80px","overflow":"auto","margin":"20px"}},[_vm._v(" "+_vm._s(_vm.record.options.tooltip)+" ")])])],1)])],2):(_vm.record.type === 'slider')?_c('van-field',{attrs:{"label-width":_vm.labelWidth,"name":_vm.record.model,"required":_vm.record.options.required,"rules":_vm.rules,"disabled":_vm.disabledComputed},scopedSlots:_vm._u([{key:"input",fn:function(){return [_c('van-slider',{attrs:{"disabled":_vm.disabledComputed,"min":_vm.record.options.min,"max":_vm.record.options.max,"step":_vm.record.options.step},on:{"change":function($event){return _vm.handleChange($event, _vm.record.model)}},model:{value:(_vm.record.value),callback:function ($$v) {_vm.$set(_vm.record, "value", $$v)},expression:"record.value"}})]},proxy:true}],null,false,3529264070)},[_c('template',{slot:"label"},[_c('span',[_vm._v(_vm._s(_vm.record.label))]),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.record.options.tooltip),expression:"record.options.tooltip"}],staticStyle:{"padding-left":"5px"}},[_c('van-popover',{attrs:{"trigger":"click","theme":"dark"},scopedSlots:_vm._u([{key:"reference",fn:function(){return [_c('van-icon',{attrs:{"name":"question-o"}})]},proxy:true}],null,false,1267421819),model:{value:(_vm.showPopover),callback:function ($$v) {_vm.showPopover=$$v},expression:"showPopover"}},[_c('div',{staticStyle:{"width":"120px","max-height":"80px","overflow":"auto","margin":"20px"}},[_vm._v(" "+_vm._s(_vm.record.options.tooltip)+" ")])])],1)])],2):(_vm.record.type === 'uploadImg')?_c('upload-img',{attrs:{"label-width":_vm.labelWidth,"record":_vm.record,"rules":_vm.rules,"disabled":_vm.disabled,"openStatus":_vm.openStatus}}):(_vm.record.type === 'uploadFile')?_c('upload-file',{attrs:{"label-width":_vm.labelWidth,"record":_vm.record,"rules":_vm.rules,"disabled":_vm.disabled,"openStatus":_vm.openStatus}}):(_vm.record.type === 'girdview')?_c('van-field',{attrs:{"name":_vm.record.model,"required":_vm.record.options.required,"rules":_vm.rules}},[_c('template',{slot:"input"},[_c('MkDynamicTable',{attrs:{"record":_vm.record,"dynamicData":_vm.dynamicData,"fieldFormatList":_vm.fieldFormatList,"openStatus":_vm.openStatus,"config":_vm.config,"disabled":_vm.disabled || _vm.record.options.disabled,"formConfig":_vm.formConfig,"form":_vm.form,"jsonData":_vm.jsonData,"name":_vm.record.model},model:{value:(_vm.record.value),callback:function ($$v) {_vm.$set(_vm.record, "value", $$v)},expression:"record.value"}})],1),(_vm.record.options.showLabel)?_c('template',{slot:"label"},[_c('span',[_vm._v(_vm._s(_vm.record.label))])]):_vm._e()],2):(_vm.record.type === 'treeSelect')?_c('van-field',{attrs:{"label-width":_vm.labelWidth,"name":_vm.record.model,"readonly":"","disabled":_vm.disabledComputed,"placeholder":_vm.openStatus === 'view' ? '' : _vm.record.options.placeholder,"required":_vm.record.options.required,"rules":_vm.rules},on:{"click-input":function () {if (!_vm.disabledComputed) {_vm.record.options.showTreeOptions = true}}},model:{value:(_vm.record.treeLabel),callback:function ($$v) {_vm.$set(_vm.record, "treeLabel", $$v)},expression:"record.treeLabel"}},[_c('template',{slot:"label"},[_c('span',[_vm._v(_vm._s(_vm.record.label))]),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.record.options.tooltip),expression:"record.options.tooltip"}],staticStyle:{"padding-left":"5px"}},[_c('van-popover',{attrs:{"trigger":"click","theme":"dark"},scopedSlots:_vm._u([{key:"reference",fn:function(){return [_c('van-icon',{attrs:{"name":"question-o"}})]},proxy:true}],null,false,1267421819),model:{value:(_vm.showPopover),callback:function ($$v) {_vm.showPopover=$$v},expression:"showPopover"}},[_c('div',{staticStyle:{"width":"120px","max-height":"80px","overflow":"auto","margin":"20px"}},[_vm._v(" "+_vm._s(_vm.record.options.tooltip)+" ")])])],1)]),_c('template',{slot:"extra"},[_c('span',{style:(_vm.disabledComputed ? {'color': '#c8c9cc'} : {'color':'#1a8afa'}),on:{"click":function () {if (!_vm.disabledComputed) {
_vm.record.options.showTreeOptions = true
}}}},[_vm._v("选择")])])],2):(_vm.record.type === 'cascader')?_c('van-field',{attrs:{"label-width":_vm.labelWidth,"name":_vm.record.model,"readonly":"","disabled":_vm.disabledComputed,"placeholder":_vm.openStatus === 'view' ? '' : _vm.record.options.placeholder,"required":_vm.record.options.required,"rules":_vm.rules},on:{"click-input":function () {if (!_vm.disabledComputed) {_vm.record.options.showCascaderOptions = true}}},model:{value:(_vm.record.cascaderLabel),callback:function ($$v) {_vm.$set(_vm.record, "cascaderLabel", $$v)},expression:"record.cascaderLabel"}},[_c('template',{slot:"label"},[_c('span',[_vm._v(_vm._s(_vm.record.label))]),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.record.options.tooltip),expression:"record.options.tooltip"}],staticStyle:{"padding-left":"5px"}},[_c('van-popover',{attrs:{"trigger":"click","theme":"dark"},scopedSlots:_vm._u([{key:"reference",fn:function(){return [_c('van-icon',{attrs:{"name":"question-o"}})]},proxy:true}],null,false,1267421819),model:{value:(_vm.showPopover),callback:function ($$v) {_vm.showPopover=$$v},expression:"showPopover"}},[_c('div',{staticStyle:{"width":"120px","max-height":"80px","overflow":"auto","margin":"20px"}},[_vm._v(" "+_vm._s(_vm.record.options.tooltip)+" ")])])],1)]),_c('template',{slot:"extra"},[_c('span',{style:(_vm.disabledComputed ? {'color': '#c8c9cc'} : {'color':'#1a8afa'}),on:{"click":function () {if (!_vm.disabledComputed) {
_vm.record.options.showCascaderOptions = true
}}}},[_vm._v("选择")])])],2):_vm._e(),_c('van-popup',{attrs:{"get-container":_vm.getContainer,"round":"","position":"bottom"},model:{value:(_vm.record.options.showCascaderOptions),callback:function ($$v) {_vm.$set(_vm.record.options, "showCascaderOptions", $$v)},expression:"record.options.showCascaderOptions"}},[_c('van-cascader',{attrs:{"title":_vm.record.options.placeholder,"options":_vm.defaultOptions,"field-names":_vm.fieldNames},on:{"close":function($event){_vm.record.options.showCascaderOptions = false},"change":function (value) { return _vm.finishCascader(value); }},model:{value:(_vm.cascaderValue),callback:function ($$v) {_vm.cascaderValue=$$v},expression:"cascaderValue"}})],1),_c('van-popup',{attrs:{"get-container":_vm.getContainer,"round":"","position":"bottom"},model:{value:(_vm.record.options.showTreeOptions),callback:function ($$v) {_vm.$set(_vm.record.options, "showTreeOptions", $$v)},expression:"record.options.showTreeOptions"}},[_c('van-cascader',{attrs:{"title":_vm.record.options.placeholder,"options":_vm.defaultOptions,"field-names":_vm.fieldNames},on:{"close":function($event){_vm.record.options.showTreeOptions = false},"change":function (value) { return _vm.finishTree(value); }},model:{value:(_vm.cascaderValue),callback:function ($$v) {_vm.cascaderValue=$$v},expression:"cascaderValue"}})],1),(_vm.record.type === 'address')?_c('MkFormAddress',{attrs:{"containerName":_vm.containerName,"dynamicData":_vm.dynamicData,"record":_vm.record,"disabled":_vm.disabled,"open-status":_vm.openStatus,"config":_vm.config,"rules":_vm.rules,"label-width":_vm.labelWidth},on:{"change":function($event){return _vm.handleChange($event, _vm.record.model)}},model:{value:(_vm.record.value),callback:function ($$v) {_vm.$set(_vm.record, "value", $$v)},expression:"record.value"}}):_vm._e()],2):(!(_vm.record.options.hidden === true) && _vm.record.type === 'button')?_c('van-cell-group',[_c('van-button',{attrs:{"name":_vm.record.model,"round":"","block":"","disabled":_vm.disabledComputed,"type":_vm.record.options.type,"native-type":"submit"}},[_vm._v(_vm._s(_vm.record.label))])],1):(!(_vm.record.options.hidden === true) && _vm.record.type === 'alert')?_c('van-cell-group',[_c('van-notice-bar',{attrs:{"text":_vm.record.label}})],1):(!(_vm.record.options.hidden === true) && _vm.record.type === 'text')?_c('van-cell-group',[_c('div',{style:({ textAlign: _vm.record.options.textAlign })},[_c('label',{domProps:{"textContent":_vm._s(_vm.record.label)}})])]):(!(_vm.record.options.hidden === true) && _vm.record.type === 'html')?_c('div',{domProps:{"innerHTML":_vm._s(_vm.record.options.defaultValue)}}):(_vm.customList.includes(_vm.record.type) && (
!(_vm.record.options.hidden === true) &&
(
(_vm.openStatus === 'add' && _vm.record.options.addVisible) ||
(_vm.openStatus === 'edit' && _vm.record.options.updateVisible) ||
(_vm.openStatus === 'view' && _vm.record.options.readVisible) ||
(_vm.openStatus === 'preview')
)
))?_c('van-cell-group',{attrs:{"label-col":_vm.formConfig.layout === 'horizontal' ? _vm.formConfig.labelCol : {},"wrapper-col":_vm.formConfig.layout === 'horizontal' ? _vm.formConfig.wrapperCol : {}}},[_c('customComponent',{style:(("width:" + (_vm.record.options.width))),attrs:{"openStatus":_vm.openStatus,"labelWidth":_vm.labelWidth,"record":_vm.record,"config":_vm.config,"parentDisabled":_vm.disabled||
_vm.record.options.disabled ||
(_vm.openStatus === 'add' && !_vm.record.options.addWritable) ||
(_vm.openStatus === 'edit' && !_vm.record.options.updateWritable) ||
(_vm.openStatus === 'view'),"dynamicData":_vm.dynamicData,"formConfig":_vm.formConfig,"rules":_vm.rules},on:{"change":function($event){return _vm.handleChange(_vm.value, _vm.record.model)},"fillBack":_vm.doFillBack}})],1):_c('div',[(
_vm.record.type === 'divider' &&
_vm.record.label !== '' &&
_vm.record.options.orientation
)?_c('van-divider',{attrs:{"orientation":_vm.record.options.orientation}},[_vm._v(_vm._s(_vm.record.label))]):(_vm.record.type === 'divider' && _vm.record.label !== '')?_c('van-divider',[_vm._v(_vm._s(_vm.record.label))]):(_vm.record.type === 'divider' && _vm.record.label === '')?_c('van-divider'):_vm._e()],1)}
var staticRenderFns = []
// CONCATENATED MODULE: ./packages/MkFormItem/index.vue?vue&type=template&id=2ad4d38b&scoped=true&
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.array.find.js
var es6_array_find = __webpack_require__("7514");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.regexp.constructor.js
var es6_regexp_constructor = __webpack_require__("3b2b");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
var esm_typeof = __webpack_require__("53ca");
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"250e4638-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!./packages/MkFormItem/customComponent.vue?vue&type=template&id=76ba3922&
var customComponentvue_type_template_id_76ba3922_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c(_vm.customComponent,{tag:"component",style:(("width:" + (_vm.record.options.width))),attrs:{"record":_vm.record,"labelWidth":_vm.labelWidth,"parentDisabled":_vm.parentDisabled,"dynamicData":_vm.dynamicData,"config":_vm.config,"height":typeof _vm.record.options.height !== 'undefined'
? _vm.record.options.height
: '',"rules":_vm.rules},on:{"change":_vm.handleChange,"fillBack":_vm.doFillBack}})}
var customComponentvue_type_template_id_76ba3922_staticRenderFns = []
// CONCATENATED MODULE: ./packages/MkFormItem/customComponent.vue?vue&type=template&id=76ba3922&
// EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom.iterable.js
var web_dom_iterable = __webpack_require__("ac6a");
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/MkFormItem/customComponent.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var customComponentvue_type_script_lang_js_ = ({
name: 'CustomComponent',
// eslint-disable-next-line vue/require-prop-types
props: ['record', 'formConfig', 'disabled', 'dynamicData', 'parentDisabled', 'config', 'openStatus', 'labelWidth', 'rules'],
computed: {
customComponent: function customComponent() {
// 计算需要显示的组件
var customComponentList = {};
if (window.$customComponentListApp) {
// 将数组映射成json
window.$customComponentListApp.forEach(function (item) {
customComponentList[item.type] = item.component;
});
}
return customComponentList[this.record.type];
}
},
methods: {
handleChange: function handleChange(value, key) {
this.$emit('change', value, key);
},
doFillBack: function doFillBack(record, val) {
this.$emit('fillBack', record, val);
}
}
});
// CONCATENATED MODULE: ./packages/MkFormItem/customComponent.vue?vue&type=script&lang=js&
/* harmony default export */ var MkFormItem_customComponentvue_type_script_lang_js_ = (customComponentvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__("2877");
// CONCATENATED MODULE: ./packages/MkFormItem/customComponent.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
MkFormItem_customComponentvue_type_script_lang_js_,
customComponentvue_type_template_id_76ba3922_render,
customComponentvue_type_template_id_76ba3922_staticRenderFns,
false,
null,
null,
null
)
/* harmony default export */ var customComponent = (component.exports);
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"250e4638-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!./packages/MkBatch/batch.vue?vue&type=template&id=55bb01b4&scoped=true&
var batchvue_type_template_id_55bb01b4_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('a-form-model',{ref:"dynamicValidateForm",attrs:{"layout":"inline","model":_vm.dynamicValidateForm}},[_c('a-table',{staticClass:"batch-table",attrs:{"pagination":false,"rowKey":function (record) { return record.key; },"columns":_vm.columns,"dataSource":_vm.dynamicValidateForm.domains,"bordered":"","scroll":{
x: _vm.listLength * 190 + 80 + (!_vm.record.options.hideSequence ? 60 : 0),
y: _vm.record.options.scrollY
}},scopedSlots:_vm._u([_vm._l((_vm.record.list),function(item){return {key:item.key,fn:function(text, vRecord, index){return [_c('KFormModelItem',{key:item.key + '1',attrs:{"record":item,"config":_vm.config,"parentDisabled":_vm.disabled,"index":index,"domains":_vm.dynamicValidateForm.domains,"dynamicData":_vm.dynamicData},on:{"input":_vm.handleInput},model:{value:(vRecord[item.model]),callback:function ($$v) {_vm.$set(vRecord, item.model, $$v)},expression:"vRecord[item.model]"}})]}}}),{key:"dynamic-delete-button",fn:function(text, vRecord){return [(!_vm.disabled)?_c('a-icon',{staticClass:"dynamic-delete-button",attrs:{"type":"minus-circle-o"},on:{"click":function($event){return _vm.removeDomain(vRecord)}}}):_vm._e()]}}],null,true)}),_c('a-button',{attrs:{"type":"dashed","disabled":_vm.disabled},on:{"click":_vm.addDomain}},[_c('a-icon',{attrs:{"type":"plus"}}),_vm._v("增加 ")],1)],1)}
var batchvue_type_template_id_55bb01b4_scoped_true_staticRenderFns = []
// CONCATENATED MODULE: ./packages/MkBatch/batch.vue?vue&type=template&id=55bb01b4&scoped=true&
// EXTERNAL MODULE: ./node_modules/core-js/modules/es7.object.get-own-property-descriptors.js
var es7_object_get_own_property_descriptors = __webpack_require__("8e6e");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.array.iterator.js
var es6_array_iterator = __webpack_require__("cadf");
// EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.keys.js
var es6_object_keys = __webpack_require__("456d");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
var defineProperty = __webpack_require__("ade3");
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 5 modules
var toConsumableArray = __webpack_require__("2909");
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"250e4638-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!./packages/MkBatch/module/MkFormModelItem.vue?vue&type=template&id=67b14851&scoped=true&
var MkFormModelItemvue_type_template_id_67b14851_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (
[
'input',
'textarea',
'date',
'time',
'number',
'radio',
'checkbox',
'select',
'rate',
'switch',
'slider',
'uploadImg',
'uploadFile',
'cascader',
'treeSelect'
].includes(_vm.record.type)
)?_c('a-form-model-item',{attrs:{"prop":("domains." + _vm.index + "." + (_vm.record.model)),"rules":_vm.record.rules}},[(_vm.record.type === 'input')?_c('a-input',{style:(("width:" + (_vm.record.options.width))),attrs:{"disabled":_vm.record.options.disabled || _vm.parentDisabled,"placeholder":_vm.record.options.placeholder,"type":_vm.record.options.type,"allowClear":_vm.record.options.clearable,"maxLength":_vm.record.options.maxLength,"value":_vm.value},on:{"change":function($event){return _vm.handleChange($event.target.value)}}}):(_vm.record.type === 'textarea')?_c('a-textarea',{style:(("width:" + (_vm.record.options.width))),attrs:{"autoSize":{
minRows: _vm.record.options.minRows,
maxRows: _vm.record.options.maxRows
},"disabled":_vm.record.options.disabled || _vm.parentDisabled,"placeholder":_vm.record.options.placeholder,"allowClear":_vm.record.options.clearable,"maxLength":_vm.record.options.maxLength,"rows":4,"value":_vm.value},on:{"change":function($event){return _vm.handleChange($event.target.value)}}}):(_vm.record.type === 'date')?_c('MkDatePicker',{attrs:{"parentDisabled":_vm.parentDisabled,"record":_vm.record,"value":_vm.value},on:{"change":_vm.handleChange}}):(_vm.record.type === 'time')?_c('MkTimePicker',{attrs:{"parentDisabled":_vm.parentDisabled,"record":_vm.record,"value":_vm.value},on:{"change":_vm.handleChange}}):(_vm.record.type === 'number')?_c('a-input-number',{style:(("width:" + (_vm.record.options.width))),attrs:{"min":_vm.record.options.min || _vm.record.options.min === 0
? _vm.record.options.min
: -Infinity,"max":_vm.record.options.max || _vm.record.options.max === 0
? _vm.record.options.max
: Infinity,"precision":_vm.record.options.precision > 50 ||
(!_vm.record.options.precision && _vm.record.options.precision !== 0)
? null
: _vm.record.options.precision,"disabled":_vm.record.options.disabled || _vm.parentDisabled,"step":_vm.record.options.step,"placeholder":_vm.record.options.placeholder,"value":_vm.value},on:{"change":_vm.handleChange}}):(_vm.record.type === 'radio')?_c('a-radio-group',{attrs:{"options":!_vm.record.options.dynamic
? _vm.record.options.options
: _vm.dynamicData[_vm.record.options.dynamicKey]
? _vm.dynamicData[_vm.record.options.dynamicKey]
: [],"disabled":_vm.record.options.disabled || _vm.parentDisabled,"placeholder":_vm.record.options.placeholder,"value":_vm.value},on:{"change":function($event){return _vm.handleChange($event.target.value)}}}):(_vm.record.type === 'checkbox')?_c('a-checkbox-group',{attrs:{"options":!_vm.record.options.dynamic
? _vm.record.options.options
: _vm.dynamicData[_vm.record.options.dynamicKey]
? _vm.dynamicData[_vm.record.options.dynamicKey]
: [],"disabled":_vm.record.options.disabled || _vm.parentDisabled,"placeholder":_vm.record.options.placeholder,"value":_vm.value},on:{"change":_vm.handleChange}}):(_vm.record.type === 'rate')?_c('a-rate',{attrs:{"count":_vm.record.options.max,"disabled":_vm.record.options.disabled || _vm.parentDisabled,"placeholder":_vm.record.options.placeholder,"allowHalf":_vm.record.options.allowHalf,"value":_vm.value},on:{"change":_vm.handleChange}}):(_vm.record.type === 'select')?_c('a-select',{style:(("width:" + (_vm.record.options.width))),attrs:{"placeholder":_vm.record.options.placeholder,"showSearch":_vm.record.options.filterable,"options":!_vm.record.options.dynamic
? _vm.record.options.options
: _vm.dynamicData[_vm.record.options.dynamicKey]
? _vm.dynamicData[_vm.record.options.dynamicKey]
: [],"disabled":_vm.record.options.disabled || _vm.parentDisabled,"allowClear":_vm.record.options.clearable,"mode":_vm.record.options.multiple ? 'multiple' : '',"value":_vm.value},on:{"change":_vm.handleChange}}):(_vm.record.type === 'switch')?_c('a-switch',{attrs:{"disabled":_vm.record.options.disabled || _vm.parentDisabled,"checked":_vm.value},on:{"change":_vm.handleChange}}):(_vm.record.type === 'slider')?_c('div',{staticClass:"slider-box",style:(("width:" + (_vm.record.options.width)))},[_c('div',{staticClass:"slider"},[_c('a-slider',{attrs:{"disabled":_vm.record.options.disabled || _vm.parentDisabled,"min":_vm.record.options.min,"max":_vm.record.options.max,"step":_vm.record.options.step,"value":_vm.value},on:{"change":_vm.handleChange}})],1),(_vm.record.options.showInput)?_c('div',{staticClass:"number"},[_c('a-input-number',{staticStyle:{"width":"100%"},attrs:{"disabled":_vm.record.options.disabled || _vm.parentDisabled,"min":_vm.record.options.min,"max":_vm.record.options.max,"step":_vm.record.options.step,"value":_vm.value},on:{"change":_vm.handleChange}})],1):_vm._e()]):(_vm.record.type === 'uploadImg')?_c('UploadImg',{style:(("width:" + (_vm.record.options.width))),attrs:{"parentDisabled":_vm.parentDisabled,"record":_vm.record,"config":_vm.config,"value":_vm.value},on:{"change":_vm.handleChange}}):(_vm.record.type === 'uploadFile')?_c('UploadFile',{style:(("width:" + (_vm.record.options.width))),attrs:{"parentDisabled":_vm.parentDisabled,"dynamicData":_vm.dynamicData,"config":_vm.config,"record":_vm.record,"value":_vm.value},on:{"change":_vm.handleChange}}):(_vm.record.type === 'treeSelect')?_c('a-tree-select',{style:(("width:" + (_vm.record.options.width))),attrs:{"placeholder":_vm.record.options.placeholder,"multiple":_vm.record.options.multiple,"showSearch":_vm.record.options.showSearch,"treeCheckable":_vm.record.options.treeCheckable,"treeData":!_vm.record.options.dynamic
? _vm.record.options.options
: _vm.dynamicData[_vm.record.options.dynamicKey]
? _vm.dynamicData[_vm.record.options.dynamicKey]
: [],"disabled":_vm.record.options.disabled || _vm.parentDisabled,"allowClear":_vm.record.options.clearable,"value":_vm.value},on:{"change":_vm.handleChange}}):(_vm.record.type === 'cascader')?_c('a-cascader',{style:(("width:" + (_vm.record.options.width))),attrs:{"placeholder":_vm.record.options.placeholder,"showSearch":_vm.record.options.showSearch,"options":!_vm.record.options.dynamic
? _vm.record.options.options
: _vm.dynamicData[_vm.record.options.dynamicKey]
? _vm.dynamicData[_vm.record.options.dynamicKey]
: [],"disabled":_vm.record.options.disabled || _vm.parentDisabled,"allowClear":_vm.record.options.clearable,"value":_vm.value},on:{"change":_vm.handleChange}}):_vm._e()],1):(_vm.record.type === 'text')?_c('a-form-model-item',[_c('div',{style:({ textAlign: _vm.record.options.textAlign })},[_c('label',{class:{ 'ant-form-item-required': _vm.record.options.showRequiredMark },domProps:{"textContent":_vm._s(_vm.record.label)}})])]):(_vm.record.type === 'html')?_c('div',{domProps:{"innerHTML":_vm._s(_vm.record.options.defaultValue)}}):_c('div')}
var MkFormModelItemvue_type_template_id_67b14851_scoped_true_staticRenderFns = []
// CONCATENATED MODULE: ./packages/MkBatch/module/MkFormModelItem.vue?vue&type=template&id=67b14851&scoped=true&
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"250e4638-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!./packages/UploadFile/uploadFile.vue?vue&type=template&id=af95c1c8&
var uploadFilevue_type_template_id_af95c1c8_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('van-field',{attrs:{"label-width":_vm.labelWidth,"name":_vm.record.model,"required":_vm.record.options.required,"rules":_vm.rules},scopedSlots:_vm._u([{key:"input",fn:function(){return [_c('van-uploader',{attrs:{"accept":".","disabled":_vm.disabled ||
_vm.record.options.disabled ||
(_vm.openStatus === 'add' && !_vm.record.options.addWritable) ||
(_vm.openStatus === 'edit' && !_vm.record.options.updateWritable) ||
(_vm.openStatus === 'view'),"max-count":_vm.record.options.limit,"multiple":_vm.record.options.multiple,"max-size":_vm.fileMaxSize,"after-read":_vm.afterRead,"before-delete":_vm.beforeDelete},model:{value:(_vm.fileList),callback:function ($$v) {_vm.fileList=$$v},expression:"fileList"}},[_c('van-button',{attrs:{"icon":"plus","type":"primary"}},[_vm._v("上传文件")])],1)]},proxy:true}])},[_c('template',{slot:"label"},[_c('span',[_vm._v(_vm._s(_vm.record.label))]),_c('span',{directives:[{name:"show",rawName:"v-show",value:(_vm.record.options.tooltip),expression:"record.options.tooltip"}],staticStyle:{"padding-left":"5px"}},[_c('van-popover',{attrs:{"trigger":"click","theme":"dark"},scopedSlots:_vm._u([{key:"reference",fn:function(){return [_c('van-icon',{attrs:{"name":"question-o"}})]},proxy:true}]),model:{value:(_vm.showPopover),callback:function ($$v) {_vm.showPopover=$$v},expression:"showPopover"}},[_c('div',{staticStyle:{"width":"120px","max-height":"80px","overflow":"auto","margin":"20px"}},[_vm._v(" "+_vm._s(_vm.record.options.tooltip)+" ")])])],1)])],2)}
var uploadFilevue_type_template_id_af95c1c8_staticRenderFns = []
// CONCATENATED MODULE: ./packages/UploadFile/uploadFile.vue?vue&type=template&id=af95c1c8&
// EXTERNAL MODULE: ./packages/common/constants/index.js + 1 modules
var constants = __webpack_require__("6df8");
// EXTERNAL MODULE: ./packages/api/smartform/common/attachmentApi.js
var attachmentApi = __webpack_require__("f55f");
// EXTERNAL MODULE: ./packages/utils/commonUtil.js
var commonUtil = __webpack_require__("8207");
// EXTERNAL MODULE: ./packages/common/constants/URLConstants.js
var URLConstants = __webpack_require__("3ce8");
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/UploadFile/uploadFile.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/*
* author kcz
* date 2019-12-31
* description 上传文件组件
*/
/* harmony default export */ var uploadFilevue_type_script_lang_js_ = ({
name: 'KUploadFile',
props: {
labelWidth: {
type: String,
required: true
},
record: {
type: Object,
required: true
},
rules: {
type: Array,
default: function _default() {
return [];
}
},
disabled: {
type: Boolean,
required: true
},
openStatus: {
type: String,
default: 'preview'
}
},
data: function data() {
return {
showPopover: false,
// 显示的数据
fileList: []
};
},
watch: {
'record.value': {
handler: function handler(val) {
this.fileList = val;
},
immediate: true,
deep: true
}
},
computed: {
fileMaxSize: function fileMaxSize() {
var limitFileSizeNum = this.record.options.fileSize;
var limitFileSizeUnit = this.record.options.fileSizeUnit;
var fileMaxSize = 1024000;
switch (limitFileSizeUnit) {
case 'KB':
{
fileMaxSize = limitFileSizeNum * 1000;
break;
}
case 'MB':
{
fileMaxSize = limitFileSizeNum * 1000 * 1000;
break;
}
case 'GB':
{
fileMaxSize = limitFileSizeNum * 1000 * 1000 * 1000;
break;
}
}
return fileMaxSize;
}
},
methods: {
beforeDelete: function beforeDelete(file, detail) {
console.log(file, detail);
var tempValue = this.fileList.filter(function (item, idx) {
return idx !== detail.index;
});
console.log(tempValue);
this.record.value = tempValue;
return false;
},
afterRead: function afterRead(fileList) {
var _this = this;
console.log('afterRead', JSON.stringify(fileList));
if (fileList.length) {
var _loop = function _loop(i) {
fileList[i].status = constants["a" /* Constants */].ATTACHMENT_UPLOADING;
var formData = new FormData();
formData.append('file', fileList[i].file);
attachmentApi["a" /* default */].