@panpanzhao/component-ui 0.0.21 → 0.0.23

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,64 @@ 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 (value === null || value === undefined) {
243
+ return value;
244
+ }
245
+ if (item.control === "Dict" && item.dictCode && this.$COMPONENT.dataSource && this.$COMPONENT.dataSource.dict) {
246
+ var options = this.$COMPONENT.dataSource.dict[item.dictCode];
247
+ var map = {};
248
+ if (Array.isArray(options)) {
249
+ options.forEach(function (dictItem) {
250
+ map[dictItem.value] = dictItem;
251
+ });
252
+ }
253
+ return map[value] && map[value].label;
254
+ } else if (item.control === "Data" && this.format && external_dayjs_default()(value).isValid()) {
255
+ return external_dayjs_default()(value).format(this.format);
256
+ } else {
257
+ return value;
258
+ }
259
+ },
260
+ renderItem: function renderItem(h, item) {
261
+ var param = {
262
+ attrs: Object.assign({}, item)
263
+ };
264
+ return h("el-descriptions-item", babel_helper_vue_jsx_merge_props_default()([{
265
+ "key": item.prop
266
+ }, param]), [this.renderContent(h, item)]);
390
267
  }
268
+ },
269
+ render: function render(h) {
270
+ var _this3 = this;
271
+ var param = {
272
+ attrs: Object.assign({
273
+ border: true,
274
+ direction: this.labelPosition === "top" ? "vertical" : "horizontal",
275
+ labelStyle: {
276
+ width: this.labelWidth,
277
+ textAlign: this.labelPosition
278
+ }
279
+ }, this.$attrs),
280
+ on: Object.assign({}, this.$listeners)
281
+ };
282
+ return h("div", {
283
+ "class": "form-view"
284
+ }, [h("el-descriptions", babel_helper_vue_jsx_merge_props_default()([{
285
+ "ref": "form"
286
+ }, param]), [this.filterFormItems.map(function (item) {
287
+ return _this3.renderItem(h, item);
288
+ })])]);
391
289
  }
392
290
  });
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
291
  // CONCATENATED MODULE: ./src/components/form-view/index.js
419
292
 
420
293
  src.install = function (Vue) {
@@ -423,27 +296,33 @@ src.install = function (Vue) {
423
296
  /* harmony default export */ var form_view = __webpack_exports__["default"] = (src);
424
297
 
425
298
  /***/ }),
426
- /* 11 */,
299
+ /* 11 */
300
+ /***/ (function(module, exports) {
301
+
302
+ module.exports = require("dayjs");
303
+
304
+ /***/ }),
427
305
  /* 12 */,
428
306
  /* 13 */,
429
307
  /* 14 */,
430
308
  /* 15 */,
431
309
  /* 16 */,
432
310
  /* 17 */,
433
- /* 18 */
311
+ /* 18 */,
312
+ /* 19 */,
313
+ /* 20 */
434
314
  /***/ (function(module, exports) {
435
315
 
436
316
  module.exports = require("element-ui/lib/descriptions");
437
317
 
438
318
  /***/ }),
439
- /* 19 */
319
+ /* 21 */
440
320
  /***/ (function(module, exports) {
441
321
 
442
322
  module.exports = require("element-ui/lib/descriptions-item");
443
323
 
444
324
  /***/ }),
445
- /* 20 */,
446
- /* 21 */
325
+ /* 22 */
447
326
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
448
327
 
449
328
  "use strict";
@@ -454,7 +333,7 @@ __webpack_require__.r(__webpack_exports__);
454
333
  var babel_helper_vue_jsx_merge_props_ = __webpack_require__(0);
455
334
  var babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(babel_helper_vue_jsx_merge_props_);
456
335
 
457
- // EXTERNAL MODULE: ./src/components/form-view/index.js + 5 modules
336
+ // EXTERNAL MODULE: ./src/components/form-view/index.js + 1 modules
458
337
  var form_view = __webpack_require__(10);
459
338
 
460
339
  // CONCATENATED MODULE: ./src/components/form-view-group/src/content.js