@panpanzhao/component-ui 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/component-ui.common.js +5689 -0
- package/lib/components/crud.js +2276 -0
- package/lib/components/form-dialog.js +1198 -0
- package/lib/components/form-group.js +883 -0
- package/lib/components/form-input.js +1571 -0
- package/lib/components/form-item.js +284 -0
- package/lib/components/form-view-dialog.js +963 -0
- package/lib/components/form-view-group.js +687 -0
- package/lib/components/form-view.js +409 -0
- package/lib/components/form.js +495 -0
- package/lib/components/table-column.js +1053 -0
- package/lib/components/table-editable.js +954 -0
- package/lib/components/table-search.js +407 -0
- package/lib/components/table.js +659 -0
- package/lib/index.js +1 -0
- package/lib/styles/component-ui.css +1 -0
- package/lib/styles/fonts/element-icons.ttf +0 -0
- package/lib/styles/fonts/element-icons.woff +0 -0
- package/lib/styles/form.css +1 -0
- package/lib/styles/index.css +1 -0
- package/lib/styles/table-editable.css +1 -0
- package/lib/styles/table.css +1 -0
- package/lib/utils/formula/evalutor.js +1883 -0
- package/lib/utils/formula/filter.js +48 -0
- package/lib/utils/formula/function.js +12 -0
- package/lib/utils/formula/index.js +25 -0
- package/lib/utils/formula/lexer.js +590 -0
- package/lib/utils/formula/parser.js +734 -0
- package/package.json +67 -0
|
@@ -0,0 +1,687 @@
|
|
|
1
|
+
module.exports =
|
|
2
|
+
/******/ (function(modules) { // webpackBootstrap
|
|
3
|
+
/******/ // The module cache
|
|
4
|
+
/******/ var installedModules = {};
|
|
5
|
+
/******/
|
|
6
|
+
/******/ // The require function
|
|
7
|
+
/******/ function __webpack_require__(moduleId) {
|
|
8
|
+
/******/
|
|
9
|
+
/******/ // Check if module is in cache
|
|
10
|
+
/******/ if(installedModules[moduleId]) {
|
|
11
|
+
/******/ return installedModules[moduleId].exports;
|
|
12
|
+
/******/ }
|
|
13
|
+
/******/ // Create a new module (and put it into the cache)
|
|
14
|
+
/******/ var module = installedModules[moduleId] = {
|
|
15
|
+
/******/ i: moduleId,
|
|
16
|
+
/******/ l: false,
|
|
17
|
+
/******/ exports: {}
|
|
18
|
+
/******/ };
|
|
19
|
+
/******/
|
|
20
|
+
/******/ // Execute the module function
|
|
21
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
22
|
+
/******/
|
|
23
|
+
/******/ // Flag the module as loaded
|
|
24
|
+
/******/ module.l = true;
|
|
25
|
+
/******/
|
|
26
|
+
/******/ // Return the exports of the module
|
|
27
|
+
/******/ return module.exports;
|
|
28
|
+
/******/ }
|
|
29
|
+
/******/
|
|
30
|
+
/******/
|
|
31
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
32
|
+
/******/ __webpack_require__.m = modules;
|
|
33
|
+
/******/
|
|
34
|
+
/******/ // expose the module cache
|
|
35
|
+
/******/ __webpack_require__.c = installedModules;
|
|
36
|
+
/******/
|
|
37
|
+
/******/ // define getter function for harmony exports
|
|
38
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
39
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
40
|
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
41
|
+
/******/ }
|
|
42
|
+
/******/ };
|
|
43
|
+
/******/
|
|
44
|
+
/******/ // define __esModule on exports
|
|
45
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
46
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
47
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
48
|
+
/******/ }
|
|
49
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
50
|
+
/******/ };
|
|
51
|
+
/******/
|
|
52
|
+
/******/ // create a fake namespace object
|
|
53
|
+
/******/ // mode & 1: value is a module id, require it
|
|
54
|
+
/******/ // mode & 2: merge all properties of value into the ns
|
|
55
|
+
/******/ // mode & 4: return value when already ns object
|
|
56
|
+
/******/ // mode & 8|1: behave like require
|
|
57
|
+
/******/ __webpack_require__.t = function(value, mode) {
|
|
58
|
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
59
|
+
/******/ if(mode & 8) return value;
|
|
60
|
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
61
|
+
/******/ var ns = Object.create(null);
|
|
62
|
+
/******/ __webpack_require__.r(ns);
|
|
63
|
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
64
|
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
65
|
+
/******/ return ns;
|
|
66
|
+
/******/ };
|
|
67
|
+
/******/
|
|
68
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
69
|
+
/******/ __webpack_require__.n = function(module) {
|
|
70
|
+
/******/ var getter = module && module.__esModule ?
|
|
71
|
+
/******/ function getDefault() { return module['default']; } :
|
|
72
|
+
/******/ function getModuleExports() { return module; };
|
|
73
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
74
|
+
/******/ return getter;
|
|
75
|
+
/******/ };
|
|
76
|
+
/******/
|
|
77
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
|
78
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
79
|
+
/******/
|
|
80
|
+
/******/ // __webpack_public_path__
|
|
81
|
+
/******/ __webpack_require__.p = "/dist/";
|
|
82
|
+
/******/
|
|
83
|
+
/******/
|
|
84
|
+
/******/ // Load entry module and return exports
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 20);
|
|
86
|
+
/******/ })
|
|
87
|
+
/************************************************************************/
|
|
88
|
+
/******/ ([
|
|
89
|
+
/* 0 */
|
|
90
|
+
/***/ (function(module, exports) {
|
|
91
|
+
|
|
92
|
+
module.exports = require("@vue/babel-helper-vue-jsx-merge-props");
|
|
93
|
+
|
|
94
|
+
/***/ }),
|
|
95
|
+
/* 1 */
|
|
96
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
97
|
+
|
|
98
|
+
"use strict";
|
|
99
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "a", function() { return normalizeComponent; });
|
|
100
|
+
/* globals __VUE_SSR_CONTEXT__ */
|
|
101
|
+
|
|
102
|
+
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
|
103
|
+
// This module is a runtime utility for cleaner component module output and will
|
|
104
|
+
// be included in the final webpack user bundle.
|
|
105
|
+
|
|
106
|
+
function normalizeComponent(
|
|
107
|
+
scriptExports,
|
|
108
|
+
render,
|
|
109
|
+
staticRenderFns,
|
|
110
|
+
functionalTemplate,
|
|
111
|
+
injectStyles,
|
|
112
|
+
scopeId,
|
|
113
|
+
moduleIdentifier /* server only */,
|
|
114
|
+
shadowMode /* vue-cli only */
|
|
115
|
+
) {
|
|
116
|
+
// Vue.extend constructor export interop
|
|
117
|
+
var options =
|
|
118
|
+
typeof scriptExports === 'function' ? scriptExports.options : scriptExports
|
|
119
|
+
|
|
120
|
+
// render functions
|
|
121
|
+
if (render) {
|
|
122
|
+
options.render = render
|
|
123
|
+
options.staticRenderFns = staticRenderFns
|
|
124
|
+
options._compiled = true
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// functional template
|
|
128
|
+
if (functionalTemplate) {
|
|
129
|
+
options.functional = true
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// scopedId
|
|
133
|
+
if (scopeId) {
|
|
134
|
+
options._scopeId = 'data-v-' + scopeId
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
var hook
|
|
138
|
+
if (moduleIdentifier) {
|
|
139
|
+
// server build
|
|
140
|
+
hook = function (context) {
|
|
141
|
+
// 2.3 injection
|
|
142
|
+
context =
|
|
143
|
+
context || // cached call
|
|
144
|
+
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
145
|
+
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
|
146
|
+
// 2.2 with runInNewContext: true
|
|
147
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
148
|
+
context = __VUE_SSR_CONTEXT__
|
|
149
|
+
}
|
|
150
|
+
// inject component styles
|
|
151
|
+
if (injectStyles) {
|
|
152
|
+
injectStyles.call(this, context)
|
|
153
|
+
}
|
|
154
|
+
// register component module identifier for async chunk inferrence
|
|
155
|
+
if (context && context._registeredComponents) {
|
|
156
|
+
context._registeredComponents.add(moduleIdentifier)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
// used by ssr in case component is cached and beforeCreate
|
|
160
|
+
// never gets called
|
|
161
|
+
options._ssrRegister = hook
|
|
162
|
+
} else if (injectStyles) {
|
|
163
|
+
hook = shadowMode
|
|
164
|
+
? function () {
|
|
165
|
+
injectStyles.call(
|
|
166
|
+
this,
|
|
167
|
+
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
: injectStyles
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (hook) {
|
|
174
|
+
if (options.functional) {
|
|
175
|
+
// for template-only hot-reload because in that case the render fn doesn't
|
|
176
|
+
// go through the normalizer
|
|
177
|
+
options._injectStyles = hook
|
|
178
|
+
// register for functional component in vue file
|
|
179
|
+
var originalRender = options.render
|
|
180
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
181
|
+
hook.call(context)
|
|
182
|
+
return originalRender(h, context)
|
|
183
|
+
}
|
|
184
|
+
} else {
|
|
185
|
+
// inject component registration as beforeCreate hook
|
|
186
|
+
var existing = options.beforeCreate
|
|
187
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return {
|
|
192
|
+
exports: scriptExports,
|
|
193
|
+
options: options
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
/***/ }),
|
|
199
|
+
/* 2 */
|
|
200
|
+
/***/ (function(module, exports) {
|
|
201
|
+
|
|
202
|
+
module.exports = require("component-ui/lib/utils/formula");
|
|
203
|
+
|
|
204
|
+
/***/ }),
|
|
205
|
+
/* 3 */
|
|
206
|
+
/***/ (function(module, exports) {
|
|
207
|
+
|
|
208
|
+
module.exports = require("lodash");
|
|
209
|
+
|
|
210
|
+
/***/ }),
|
|
211
|
+
/* 4 */,
|
|
212
|
+
/* 5 */,
|
|
213
|
+
/* 6 */
|
|
214
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
215
|
+
|
|
216
|
+
"use strict";
|
|
217
|
+
// ESM COMPAT FLAG
|
|
218
|
+
__webpack_require__.r(__webpack_exports__);
|
|
219
|
+
|
|
220
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form-view/src/index.vue?vue&type=template&id=82a59c42&
|
|
221
|
+
var render = function render() {
|
|
222
|
+
var _vm = this,
|
|
223
|
+
_c = _vm._self._c
|
|
224
|
+
return _c(
|
|
225
|
+
"div",
|
|
226
|
+
{ staticClass: "form-view" },
|
|
227
|
+
[
|
|
228
|
+
_vm._t("default", function () {
|
|
229
|
+
return [
|
|
230
|
+
_c(
|
|
231
|
+
"el-descriptions",
|
|
232
|
+
_vm._g(
|
|
233
|
+
_vm._b({ ref: "form" }, "el-descriptions", _vm.formProps, false),
|
|
234
|
+
_vm.formListeners
|
|
235
|
+
),
|
|
236
|
+
_vm._l(_vm.filterFormItems, function (item) {
|
|
237
|
+
return _c(
|
|
238
|
+
"el-descriptions-item",
|
|
239
|
+
_vm._g(
|
|
240
|
+
_vm._b(
|
|
241
|
+
{ key: item.prop },
|
|
242
|
+
"el-descriptions-item",
|
|
243
|
+
item,
|
|
244
|
+
false
|
|
245
|
+
),
|
|
246
|
+
item.on
|
|
247
|
+
),
|
|
248
|
+
[
|
|
249
|
+
_vm._v(
|
|
250
|
+
"\n " + _vm._s(_vm.formModel[item.prop]) + "\n "
|
|
251
|
+
),
|
|
252
|
+
]
|
|
253
|
+
)
|
|
254
|
+
}),
|
|
255
|
+
1
|
|
256
|
+
),
|
|
257
|
+
]
|
|
258
|
+
}),
|
|
259
|
+
],
|
|
260
|
+
2
|
|
261
|
+
)
|
|
262
|
+
}
|
|
263
|
+
var staticRenderFns = []
|
|
264
|
+
render._withStripped = true
|
|
265
|
+
|
|
266
|
+
|
|
267
|
+
// CONCATENATED MODULE: ./src/components/form-view/src/index.vue?vue&type=template&id=82a59c42&
|
|
268
|
+
|
|
269
|
+
// EXTERNAL MODULE: external "element-ui/lib/descriptions"
|
|
270
|
+
var descriptions_ = __webpack_require__(16);
|
|
271
|
+
var descriptions_default = /*#__PURE__*/__webpack_require__.n(descriptions_);
|
|
272
|
+
|
|
273
|
+
// EXTERNAL MODULE: external "element-ui/lib/descriptions-item"
|
|
274
|
+
var descriptions_item_ = __webpack_require__(17);
|
|
275
|
+
var descriptions_item_default = /*#__PURE__*/__webpack_require__.n(descriptions_item_);
|
|
276
|
+
|
|
277
|
+
// EXTERNAL MODULE: external "component-ui/lib/utils/formula"
|
|
278
|
+
var formula_ = __webpack_require__(2);
|
|
279
|
+
|
|
280
|
+
// EXTERNAL MODULE: external "lodash"
|
|
281
|
+
var external_lodash_ = __webpack_require__(3);
|
|
282
|
+
|
|
283
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form-view/src/index.vue?vue&type=script&lang=js&
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
/* harmony default export */ var srcvue_type_script_lang_js_ = ({
|
|
289
|
+
name: "FormView",
|
|
290
|
+
componentName: "FormView",
|
|
291
|
+
components: {
|
|
292
|
+
elDescriptions: descriptions_default.a,
|
|
293
|
+
elDescriptionsItem: descriptions_item_default.a
|
|
294
|
+
},
|
|
295
|
+
props: {
|
|
296
|
+
prop: String,
|
|
297
|
+
formItems: {
|
|
298
|
+
type: Array,
|
|
299
|
+
default: function _default() {
|
|
300
|
+
return [];
|
|
301
|
+
}
|
|
302
|
+
},
|
|
303
|
+
formModel: {
|
|
304
|
+
type: Object,
|
|
305
|
+
default: function _default() {
|
|
306
|
+
return {};
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
},
|
|
310
|
+
computed: {
|
|
311
|
+
formProps: function formProps() {
|
|
312
|
+
return Object.assign({
|
|
313
|
+
border: true
|
|
314
|
+
}, this.$attrs);
|
|
315
|
+
},
|
|
316
|
+
formListeners: function formListeners() {
|
|
317
|
+
return Object.assign({}, this.$listeners);
|
|
318
|
+
},
|
|
319
|
+
rowProps: function rowProps() {
|
|
320
|
+
return Object.assign({}, this.$attrs);
|
|
321
|
+
},
|
|
322
|
+
filterFormItems: function filterFormItems() {
|
|
323
|
+
var _this = this;
|
|
324
|
+
return this.formItems.filter(function (item) {
|
|
325
|
+
if (item.show === false) {
|
|
326
|
+
return false;
|
|
327
|
+
}
|
|
328
|
+
if (typeof item.show === "function" && !item.show.call(_this, {
|
|
329
|
+
form: _this,
|
|
330
|
+
config: item
|
|
331
|
+
})) {
|
|
332
|
+
return false;
|
|
333
|
+
}
|
|
334
|
+
if (typeof item.show === "string" && !Object(formula_["evaluate"])(item.show, _this.formModel)) {
|
|
335
|
+
return false;
|
|
336
|
+
}
|
|
337
|
+
return true;
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
},
|
|
341
|
+
data: function data() {
|
|
342
|
+
return {
|
|
343
|
+
formItemLayout: {}
|
|
344
|
+
};
|
|
345
|
+
},
|
|
346
|
+
created: function created() {
|
|
347
|
+
var _this2 = this;
|
|
348
|
+
this.formItems.forEach(function (item) {
|
|
349
|
+
_this2.formItemLayout[item.prop] = item;
|
|
350
|
+
//初始化数据值
|
|
351
|
+
_this2.$set(_this2.formModel, item.prop, null);
|
|
352
|
+
});
|
|
353
|
+
},
|
|
354
|
+
methods: {
|
|
355
|
+
setFormModel: function setFormModel(model) {
|
|
356
|
+
Object(external_lodash_["merge"])(this.formModel, model);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
});
|
|
360
|
+
// CONCATENATED MODULE: ./src/components/form-view/src/index.vue?vue&type=script&lang=js&
|
|
361
|
+
/* harmony default export */ var form_view_srcvue_type_script_lang_js_ = (srcvue_type_script_lang_js_);
|
|
362
|
+
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
363
|
+
var componentNormalizer = __webpack_require__(1);
|
|
364
|
+
|
|
365
|
+
// CONCATENATED MODULE: ./src/components/form-view/src/index.vue
|
|
366
|
+
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
|
|
371
|
+
/* normalize component */
|
|
372
|
+
|
|
373
|
+
var component = Object(componentNormalizer["a" /* default */])(
|
|
374
|
+
form_view_srcvue_type_script_lang_js_,
|
|
375
|
+
render,
|
|
376
|
+
staticRenderFns,
|
|
377
|
+
false,
|
|
378
|
+
null,
|
|
379
|
+
null,
|
|
380
|
+
null
|
|
381
|
+
|
|
382
|
+
)
|
|
383
|
+
|
|
384
|
+
/* harmony default export */ var src = (component.exports);
|
|
385
|
+
// CONCATENATED MODULE: ./src/components/form-view/index.js
|
|
386
|
+
|
|
387
|
+
src.install = function (Vue) {
|
|
388
|
+
Vue.component(src.name, src);
|
|
389
|
+
};
|
|
390
|
+
/* harmony default export */ var form_view = __webpack_exports__["default"] = (src);
|
|
391
|
+
|
|
392
|
+
/***/ }),
|
|
393
|
+
/* 7 */
|
|
394
|
+
/***/ (function(module, exports) {
|
|
395
|
+
|
|
396
|
+
module.exports = require("element-ui/lib/tabs");
|
|
397
|
+
|
|
398
|
+
/***/ }),
|
|
399
|
+
/* 8 */
|
|
400
|
+
/***/ (function(module, exports) {
|
|
401
|
+
|
|
402
|
+
module.exports = require("element-ui/lib/tab-pane");
|
|
403
|
+
|
|
404
|
+
/***/ }),
|
|
405
|
+
/* 9 */
|
|
406
|
+
/***/ (function(module, exports) {
|
|
407
|
+
|
|
408
|
+
module.exports = require("element-ui/lib/collapse");
|
|
409
|
+
|
|
410
|
+
/***/ }),
|
|
411
|
+
/* 10 */
|
|
412
|
+
/***/ (function(module, exports) {
|
|
413
|
+
|
|
414
|
+
module.exports = require("element-ui/lib/collapse-item");
|
|
415
|
+
|
|
416
|
+
/***/ }),
|
|
417
|
+
/* 11 */,
|
|
418
|
+
/* 12 */,
|
|
419
|
+
/* 13 */,
|
|
420
|
+
/* 14 */,
|
|
421
|
+
/* 15 */,
|
|
422
|
+
/* 16 */
|
|
423
|
+
/***/ (function(module, exports) {
|
|
424
|
+
|
|
425
|
+
module.exports = require("element-ui/lib/descriptions");
|
|
426
|
+
|
|
427
|
+
/***/ }),
|
|
428
|
+
/* 17 */
|
|
429
|
+
/***/ (function(module, exports) {
|
|
430
|
+
|
|
431
|
+
module.exports = require("element-ui/lib/descriptions-item");
|
|
432
|
+
|
|
433
|
+
/***/ }),
|
|
434
|
+
/* 18 */,
|
|
435
|
+
/* 19 */,
|
|
436
|
+
/* 20 */
|
|
437
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
438
|
+
|
|
439
|
+
"use strict";
|
|
440
|
+
// ESM COMPAT FLAG
|
|
441
|
+
__webpack_require__.r(__webpack_exports__);
|
|
442
|
+
|
|
443
|
+
// EXTERNAL MODULE: external "@vue/babel-helper-vue-jsx-merge-props"
|
|
444
|
+
var babel_helper_vue_jsx_merge_props_ = __webpack_require__(0);
|
|
445
|
+
var babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(babel_helper_vue_jsx_merge_props_);
|
|
446
|
+
|
|
447
|
+
// EXTERNAL MODULE: ./src/components/form-view/index.js + 5 modules
|
|
448
|
+
var form_view = __webpack_require__(6);
|
|
449
|
+
|
|
450
|
+
// CONCATENATED MODULE: ./src/components/form-view-group/src/content.js
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
/* harmony default export */ var content = ({
|
|
454
|
+
name: "Content",
|
|
455
|
+
inheritAttrs: false,
|
|
456
|
+
components: {
|
|
457
|
+
FormView: form_view["default"]
|
|
458
|
+
},
|
|
459
|
+
props: {
|
|
460
|
+
control: String,
|
|
461
|
+
prop: String,
|
|
462
|
+
label: String,
|
|
463
|
+
formItems: Array,
|
|
464
|
+
on: Object,
|
|
465
|
+
render: Function,
|
|
466
|
+
slots: Object,
|
|
467
|
+
config: Object,
|
|
468
|
+
show: {
|
|
469
|
+
type: [Boolean, Function],
|
|
470
|
+
default: true
|
|
471
|
+
}
|
|
472
|
+
},
|
|
473
|
+
data: function data() {
|
|
474
|
+
return {
|
|
475
|
+
formModel: {}
|
|
476
|
+
};
|
|
477
|
+
},
|
|
478
|
+
computed: {
|
|
479
|
+
_formViewGroup: function _formViewGroup() {
|
|
480
|
+
var parent = this.$parent;
|
|
481
|
+
while (parent) {
|
|
482
|
+
if (parent.$options.componentName !== 'FormViewGroup') {
|
|
483
|
+
parent = parent.$parent;
|
|
484
|
+
} else {
|
|
485
|
+
return parent;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
return false;
|
|
489
|
+
}
|
|
490
|
+
},
|
|
491
|
+
methods: {},
|
|
492
|
+
render: function render(h) {
|
|
493
|
+
if (this.slots.form) {
|
|
494
|
+
var vForm = typeof this.slots.form === "function" ? this.slots.form.call(this, h) : this.slots.form;
|
|
495
|
+
return vForm;
|
|
496
|
+
}
|
|
497
|
+
var formProp = {
|
|
498
|
+
attrs: Object.assign({
|
|
499
|
+
prop: this.prop,
|
|
500
|
+
formModel: this.formModel,
|
|
501
|
+
formItems: this.formItems
|
|
502
|
+
}, this.$attrs),
|
|
503
|
+
on: this.on
|
|
504
|
+
};
|
|
505
|
+
return h(form_view["default"], babel_helper_vue_jsx_merge_props_default()([{
|
|
506
|
+
"ref": "formView"
|
|
507
|
+
}, formProp]));
|
|
508
|
+
}
|
|
509
|
+
});
|
|
510
|
+
// EXTERNAL MODULE: external "element-ui/lib/tabs"
|
|
511
|
+
var tabs_ = __webpack_require__(7);
|
|
512
|
+
var tabs_default = /*#__PURE__*/__webpack_require__.n(tabs_);
|
|
513
|
+
|
|
514
|
+
// EXTERNAL MODULE: external "element-ui/lib/tab-pane"
|
|
515
|
+
var tab_pane_ = __webpack_require__(8);
|
|
516
|
+
var tab_pane_default = /*#__PURE__*/__webpack_require__.n(tab_pane_);
|
|
517
|
+
|
|
518
|
+
// EXTERNAL MODULE: external "element-ui/lib/collapse"
|
|
519
|
+
var collapse_ = __webpack_require__(9);
|
|
520
|
+
var collapse_default = /*#__PURE__*/__webpack_require__.n(collapse_);
|
|
521
|
+
|
|
522
|
+
// EXTERNAL MODULE: external "element-ui/lib/collapse-item"
|
|
523
|
+
var collapse_item_ = __webpack_require__(10);
|
|
524
|
+
var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
|
|
525
|
+
|
|
526
|
+
// EXTERNAL MODULE: external "lodash"
|
|
527
|
+
var external_lodash_ = __webpack_require__(3);
|
|
528
|
+
|
|
529
|
+
// CONCATENATED MODULE: ./src/components/form-view-group/src/index.js
|
|
530
|
+
|
|
531
|
+
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
|
|
539
|
+
/* harmony default export */ var src = ({
|
|
540
|
+
name: "FormViewGroup",
|
|
541
|
+
componentName: "FormViewGroup",
|
|
542
|
+
components: {
|
|
543
|
+
elTabs: tabs_default.a,
|
|
544
|
+
elTabPane: tab_pane_default.a,
|
|
545
|
+
elCollapse: collapse_default.a,
|
|
546
|
+
elCollapseItem: collapse_item_default.a
|
|
547
|
+
},
|
|
548
|
+
props: {
|
|
549
|
+
request: Function,
|
|
550
|
+
control: {
|
|
551
|
+
type: String,
|
|
552
|
+
default: "Collapse"
|
|
553
|
+
},
|
|
554
|
+
items: {
|
|
555
|
+
type: Array,
|
|
556
|
+
default: function _default() {
|
|
557
|
+
return [];
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
formModel: {
|
|
561
|
+
type: Object,
|
|
562
|
+
default: function _default() {
|
|
563
|
+
return {};
|
|
564
|
+
}
|
|
565
|
+
},
|
|
566
|
+
on: {
|
|
567
|
+
type: Object,
|
|
568
|
+
default: function _default() {
|
|
569
|
+
return {};
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
},
|
|
573
|
+
data: function data() {
|
|
574
|
+
return {
|
|
575
|
+
formLayout: {},
|
|
576
|
+
openedCode: null
|
|
577
|
+
};
|
|
578
|
+
},
|
|
579
|
+
computed: {},
|
|
580
|
+
methods: {
|
|
581
|
+
setFormModel: function setFormModel(model) {
|
|
582
|
+
Object(external_lodash_["merge"])(this.formModel, model);
|
|
583
|
+
},
|
|
584
|
+
formNode: function formNode(form) {
|
|
585
|
+
var h = this.$createElement;
|
|
586
|
+
var formProp = {
|
|
587
|
+
attrs: Object.assign({}, form),
|
|
588
|
+
on: form.on
|
|
589
|
+
};
|
|
590
|
+
return h(content, babel_helper_vue_jsx_merge_props_default()([{
|
|
591
|
+
"ref": form.prop,
|
|
592
|
+
"key": form.prop,
|
|
593
|
+
"attrs": {
|
|
594
|
+
"config": form,
|
|
595
|
+
"control": this.control
|
|
596
|
+
}
|
|
597
|
+
}, formProp]));
|
|
598
|
+
},
|
|
599
|
+
renderTab: function renderTab(h, filterItems) {
|
|
600
|
+
var _this = this;
|
|
601
|
+
var itemNode = filterItems.map(function (item) {
|
|
602
|
+
if (typeof item.render === "function") {
|
|
603
|
+
return item.render(h, _this.formModel, item);
|
|
604
|
+
}
|
|
605
|
+
return h("el-tab-pane", {
|
|
606
|
+
"key": item.prop,
|
|
607
|
+
"attrs": {
|
|
608
|
+
"name": item.prop,
|
|
609
|
+
"label": item.label
|
|
610
|
+
}
|
|
611
|
+
}, [h("template", {
|
|
612
|
+
"slot": "label"
|
|
613
|
+
}, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this, h) : item.slots && item.slots.title]), _this.formNode(item)]);
|
|
614
|
+
});
|
|
615
|
+
var tabsProp = {
|
|
616
|
+
attrs: {
|
|
617
|
+
type: "border-card",
|
|
618
|
+
value: this.openedCode
|
|
619
|
+
},
|
|
620
|
+
on: {
|
|
621
|
+
"tab-click": function tabClick(tabNode) {
|
|
622
|
+
_this.$emit("openedCode", tabNode.name);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
};
|
|
626
|
+
return h("el-tabs", babel_helper_vue_jsx_merge_props_default()([{}, tabsProp]), [itemNode]);
|
|
627
|
+
},
|
|
628
|
+
renderCollapse: function renderCollapse(h, filterItems) {
|
|
629
|
+
var _this2 = this;
|
|
630
|
+
var itemNode = filterItems.map(function (item) {
|
|
631
|
+
if (typeof item.render === "function") {
|
|
632
|
+
return item.render(h, _this2.formModel, item);
|
|
633
|
+
}
|
|
634
|
+
return h("el-collapse-item", {
|
|
635
|
+
"key": item.prop,
|
|
636
|
+
"attrs": {
|
|
637
|
+
"name": item.prop,
|
|
638
|
+
"title": item.label
|
|
639
|
+
}
|
|
640
|
+
}, [h("template", {
|
|
641
|
+
"slot": "title"
|
|
642
|
+
}, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this2, h) : item.slots && item.slots.title]), _this2.formNode(item)]);
|
|
643
|
+
});
|
|
644
|
+
var collapseProp = {
|
|
645
|
+
attrs: {
|
|
646
|
+
value: this.openedCode
|
|
647
|
+
},
|
|
648
|
+
on: {
|
|
649
|
+
change: function change(val) {
|
|
650
|
+
_this2.$emit("openedCode", val);
|
|
651
|
+
}
|
|
652
|
+
}
|
|
653
|
+
};
|
|
654
|
+
return h("el-collapse", babel_helper_vue_jsx_merge_props_default()([{}, collapseProp]), [itemNode]);
|
|
655
|
+
}
|
|
656
|
+
},
|
|
657
|
+
render: function render(h) {
|
|
658
|
+
var _this3 = this;
|
|
659
|
+
var filterItems = this.items.filter(function (item) {
|
|
660
|
+
if (item.show === false) {
|
|
661
|
+
return false;
|
|
662
|
+
}
|
|
663
|
+
if (typeof item.show === "function" && !item.show.call(_this3, {
|
|
664
|
+
config: item
|
|
665
|
+
})) {
|
|
666
|
+
return false;
|
|
667
|
+
}
|
|
668
|
+
return true;
|
|
669
|
+
});
|
|
670
|
+
if (!filterItems.length > 0) {
|
|
671
|
+
return null;
|
|
672
|
+
}
|
|
673
|
+
this.openedCode = filterItems[0] && filterItems[0].prop;
|
|
674
|
+
return h("div", {
|
|
675
|
+
"class": ["form-view-group", "is-" + (this.control === "Tab" ? "tab" : "collapse")]
|
|
676
|
+
}, [this.control === "Tab" ? this.renderTab(h, filterItems) : this.renderCollapse(h, filterItems)]);
|
|
677
|
+
}
|
|
678
|
+
});
|
|
679
|
+
// CONCATENATED MODULE: ./src/components/form-view-group/index.js
|
|
680
|
+
|
|
681
|
+
src.install = function (Vue) {
|
|
682
|
+
Vue.component(src.name, src);
|
|
683
|
+
};
|
|
684
|
+
/* harmony default export */ var form_view_group = __webpack_exports__["default"] = (src);
|
|
685
|
+
|
|
686
|
+
/***/ })
|
|
687
|
+
/******/ ]);
|