@panpanzhao/component-ui 0.0.21 → 0.0.22

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.
@@ -82,7 +82,7 @@ module.exports =
82
82
  /******/
83
83
  /******/
84
84
  /******/ // Load entry module and return exports
85
- /******/ return __webpack_require__(__webpack_require__.s = 21);
85
+ /******/ return __webpack_require__(__webpack_require__.s = 22);
86
86
  /******/ })
87
87
  /************************************************************************/
88
88
  /******/ ([
@@ -92,110 +92,7 @@ module.exports =
92
92
  module.exports = require("@vue/babel-helper-vue-jsx-merge-props");
93
93
 
94
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
- /***/ }),
95
+ /* 1 */,
199
96
  /* 2 */
200
97
  /***/ (function(module, exports) {
201
98
 
@@ -241,61 +138,16 @@ module.exports = require("element-ui/lib/collapse-item");
241
138
  // ESM COMPAT FLAG
242
139
  __webpack_require__.r(__webpack_exports__);
243
140
 
244
- // 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=32454b68&
245
- var render = function render() {
246
- var _vm = this,
247
- _c = _vm._self._c
248
- return _c(
249
- "div",
250
- { staticClass: "form-view" },
251
- [
252
- _vm._t("default", function () {
253
- return [
254
- _c(
255
- "el-descriptions",
256
- _vm._g(
257
- _vm._b({ ref: "form" }, "el-descriptions", _vm.formProps, false),
258
- _vm.formListeners
259
- ),
260
- _vm._l(_vm.filterFormItems, function (item) {
261
- return _c(
262
- "el-descriptions-item",
263
- _vm._g(
264
- _vm._b(
265
- { key: item.prop },
266
- "el-descriptions-item",
267
- item,
268
- false
269
- ),
270
- item.on
271
- ),
272
- [
273
- _vm._v(
274
- "\n " + _vm._s(_vm.formModel[item.prop]) + "\n "
275
- ),
276
- ]
277
- )
278
- }),
279
- 1
280
- ),
281
- ]
282
- }),
283
- ],
284
- 2
285
- )
286
- }
287
- var staticRenderFns = []
288
- render._withStripped = true
289
-
290
-
291
- // CONCATENATED MODULE: ./src/components/form-view/src/index.vue?vue&type=template&id=32454b68&
141
+ // EXTERNAL MODULE: external "@vue/babel-helper-vue-jsx-merge-props"
142
+ var babel_helper_vue_jsx_merge_props_ = __webpack_require__(0);
143
+ var babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(babel_helper_vue_jsx_merge_props_);
292
144
 
293
145
  // EXTERNAL MODULE: external "element-ui/lib/descriptions"
294
- var descriptions_ = __webpack_require__(18);
146
+ var descriptions_ = __webpack_require__(20);
295
147
  var descriptions_default = /*#__PURE__*/__webpack_require__.n(descriptions_);
296
148
 
297
149
  // EXTERNAL MODULE: external "element-ui/lib/descriptions-item"
298
- var descriptions_item_ = __webpack_require__(19);
150
+ var descriptions_item_ = __webpack_require__(21);
299
151
  var descriptions_item_default = /*#__PURE__*/__webpack_require__.n(descriptions_item_);
300
152
 
301
153
  // EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/utils/formula"
@@ -304,12 +156,19 @@ var formula_ = __webpack_require__(3);
304
156
  // EXTERNAL MODULE: external "lodash"
305
157
  var external_lodash_ = __webpack_require__(2);
306
158
 
307
- // 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&
159
+ // EXTERNAL MODULE: external "dayjs"
160
+ var external_dayjs_ = __webpack_require__(11);
161
+ var external_dayjs_default = /*#__PURE__*/__webpack_require__.n(external_dayjs_);
162
+
163
+ // CONCATENATED MODULE: ./src/components/form-view/src/index.js
164
+
308
165
 
309
166
 
310
167
 
311
168
 
312
- /* harmony default export */ var srcvue_type_script_lang_js_ = ({
169
+
170
+
171
+ /* harmony default export */ var src = ({
313
172
  name: "FormView",
314
173
  componentName: "FormView",
315
174
  components: {
@@ -334,22 +193,6 @@ var external_lodash_ = __webpack_require__(2);
334
193
  }
335
194
  },
336
195
  computed: {
337
- formProps: function formProps() {
338
- return Object.assign({
339
- border: true,
340
- direction: this.labelPosition === "top" ? "vertical" : "horizontal",
341
- labelStyle: {
342
- width: this.labelWidth,
343
- textAlign: this.labelPosition
344
- }
345
- }, this.$attrs);
346
- },
347
- formListeners: function formListeners() {
348
- return Object.assign({}, this.$listeners);
349
- },
350
- rowProps: function rowProps() {
351
- return Object.assign({}, this.$attrs);
352
- },
353
196
  filterFormItems: function filterFormItems() {
354
197
  var _this = this;
355
198
  return this.formItems.filter(function (item) {
@@ -387,34 +230,61 @@ var external_lodash_ = __webpack_require__(2);
387
230
  methods: {
388
231
  setFormModel: function setFormModel(model) {
389
232
  Object(external_lodash_["merge"])(this.formModel, model);
233
+ },
234
+ renderContent: function renderContent(h, item) {
235
+ if (typeof item.formatter === "function") {
236
+ return item.formatter.call(this, {
237
+ formModel: this.formModel,
238
+ config: item
239
+ });
240
+ }
241
+ var value = this.formModel[item.prop];
242
+ if (item.control === "Dict" && item.dictCode && this.$COMPONENT.dataSource && this.$COMPONENT.dataSource.dict) {
243
+ var options = this.$COMPONENT.dataSource.dict[item.dictCode];
244
+ var map = {};
245
+ if (Array.isArray(options)) {
246
+ options.forEach(function (dictItem) {
247
+ map[dictItem.value] = item;
248
+ });
249
+ }
250
+ return map[value] && map[value].label;
251
+ } else if (item.control === "Data" && this.format && external_dayjs_default()(value).isValid()) {
252
+ return external_dayjs_default()(value).format(this.format);
253
+ } else {
254
+ return value;
255
+ }
256
+ },
257
+ renderItem: function renderItem(h, item) {
258
+ var param = {
259
+ attrs: Object.assign({}, item)
260
+ };
261
+ return h("el-descriptions-item", babel_helper_vue_jsx_merge_props_default()([{
262
+ "key": item.prop
263
+ }, param]), [this.renderContent(h, item)]);
390
264
  }
265
+ },
266
+ render: function render(h) {
267
+ var _this3 = this;
268
+ var param = {
269
+ attrs: Object.assign({
270
+ border: true,
271
+ direction: this.labelPosition === "top" ? "vertical" : "horizontal",
272
+ labelStyle: {
273
+ width: this.labelWidth,
274
+ textAlign: this.labelPosition
275
+ }
276
+ }, this.$attrs),
277
+ on: Object.assign({}, this.$listeners)
278
+ };
279
+ return h("div", {
280
+ "class": "form-view"
281
+ }, [h("el-descriptions", babel_helper_vue_jsx_merge_props_default()([{
282
+ "ref": "form"
283
+ }, param]), [this.filterFormItems.map(function (item) {
284
+ return _this3.renderItem(h, item);
285
+ })])]);
391
286
  }
392
287
  });
393
- // CONCATENATED MODULE: ./src/components/form-view/src/index.vue?vue&type=script&lang=js&
394
- /* harmony default export */ var form_view_srcvue_type_script_lang_js_ = (srcvue_type_script_lang_js_);
395
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
396
- var componentNormalizer = __webpack_require__(1);
397
-
398
- // CONCATENATED MODULE: ./src/components/form-view/src/index.vue
399
-
400
-
401
-
402
-
403
-
404
- /* normalize component */
405
-
406
- var component = Object(componentNormalizer["a" /* default */])(
407
- form_view_srcvue_type_script_lang_js_,
408
- render,
409
- staticRenderFns,
410
- false,
411
- null,
412
- null,
413
- null
414
-
415
- )
416
-
417
- /* harmony default export */ var src = (component.exports);
418
288
  // CONCATENATED MODULE: ./src/components/form-view/index.js
419
289
 
420
290
  src.install = function (Vue) {
@@ -423,27 +293,33 @@ src.install = function (Vue) {
423
293
  /* harmony default export */ var form_view = __webpack_exports__["default"] = (src);
424
294
 
425
295
  /***/ }),
426
- /* 11 */,
296
+ /* 11 */
297
+ /***/ (function(module, exports) {
298
+
299
+ module.exports = require("dayjs");
300
+
301
+ /***/ }),
427
302
  /* 12 */,
428
303
  /* 13 */,
429
304
  /* 14 */,
430
305
  /* 15 */,
431
306
  /* 16 */,
432
307
  /* 17 */,
433
- /* 18 */
308
+ /* 18 */,
309
+ /* 19 */,
310
+ /* 20 */
434
311
  /***/ (function(module, exports) {
435
312
 
436
313
  module.exports = require("element-ui/lib/descriptions");
437
314
 
438
315
  /***/ }),
439
- /* 19 */
316
+ /* 21 */
440
317
  /***/ (function(module, exports) {
441
318
 
442
319
  module.exports = require("element-ui/lib/descriptions-item");
443
320
 
444
321
  /***/ }),
445
- /* 20 */,
446
- /* 21 */
322
+ /* 22 */
447
323
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
448
324
 
449
325
  "use strict";
@@ -454,7 +330,7 @@ __webpack_require__.r(__webpack_exports__);
454
330
  var babel_helper_vue_jsx_merge_props_ = __webpack_require__(0);
455
331
  var babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(babel_helper_vue_jsx_merge_props_);
456
332
 
457
- // EXTERNAL MODULE: ./src/components/form-view/index.js + 5 modules
333
+ // EXTERNAL MODULE: ./src/components/form-view/index.js + 1 modules
458
334
  var form_view = __webpack_require__(10);
459
335
 
460
336
  // CONCATENATED MODULE: ./src/components/form-view-group/src/content.js