@panpanzhao/component-ui 0.0.53 → 1.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 +1738 -556
- package/lib/components/crud.js +545 -292
- package/lib/components/dialog.js +44 -13
- package/lib/components/drawer.js +10 -10
- package/lib/components/form-dialog.js +242 -140
- package/lib/components/form-drawer.js +112 -45
- package/lib/components/form-group.js +105 -37
- package/lib/components/form-input.js +804 -94
- package/lib/components/form-item.js +19 -8
- package/lib/components/form-query.js +24 -9
- package/lib/components/form-view-dialog.js +94 -33
- package/lib/components/form-view-group.js +75 -18
- package/lib/components/form-view.js +7 -2
- package/lib/components/form.js +20 -10
- package/lib/components/formula.js +23 -23
- package/lib/components/table-column.js +47 -47
- package/lib/components/table-editable.js +22 -23
- package/lib/components/table-operate.js +354 -191
- package/lib/components/table-search.js +23 -17
- package/lib/components/table.js +22 -23
- package/lib/components/tree-line.js +272 -0
- package/lib/index.js +1 -1
- package/lib/styles/component-ui.css +2 -2
- package/lib/styles/dialog.css +1 -1
- package/lib/styles/form-item.css +1 -0
- package/lib/styles/form-view.css +1 -1
- package/lib/styles/index.css +2 -2
- package/lib/styles/tree-line.css +1 -0
- package/lib/styles/upload-process.css +1 -0
- package/lib/utils/formula/doc.js +2 -3
- package/lib/utils/formula/evalutor.js +4 -3
- package/lib/utils/formula/filter.js +1 -2
- package/lib/utils/formula/function.js +1 -2
- package/lib/utils/formula/lexer.js +1 -4
- package/lib/utils/helper.js +3 -5
- package/package.json +5 -2
|
@@ -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 =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 83);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -101,21 +101,21 @@ module.exports = require("lodash");
|
|
|
101
101
|
|
|
102
102
|
/***/ }),
|
|
103
103
|
|
|
104
|
-
/***/
|
|
104
|
+
/***/ 28:
|
|
105
105
|
/***/ (function(module, exports) {
|
|
106
106
|
|
|
107
107
|
module.exports = require("@panpanzhao/component-ui/lib/components/form-input");
|
|
108
108
|
|
|
109
109
|
/***/ }),
|
|
110
110
|
|
|
111
|
-
/***/
|
|
111
|
+
/***/ 55:
|
|
112
112
|
/***/ (function(module, exports) {
|
|
113
113
|
|
|
114
114
|
module.exports = require("element-ui/lib/form-item");
|
|
115
115
|
|
|
116
116
|
/***/ }),
|
|
117
117
|
|
|
118
|
-
/***/
|
|
118
|
+
/***/ 83:
|
|
119
119
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
120
120
|
|
|
121
121
|
"use strict";
|
|
@@ -127,11 +127,11 @@ var babel_helper_vue_jsx_merge_props_ = __webpack_require__(0);
|
|
|
127
127
|
var babel_helper_vue_jsx_merge_props_default = /*#__PURE__*/__webpack_require__.n(babel_helper_vue_jsx_merge_props_);
|
|
128
128
|
|
|
129
129
|
// EXTERNAL MODULE: external "element-ui/lib/form-item"
|
|
130
|
-
var form_item_ = __webpack_require__(
|
|
130
|
+
var form_item_ = __webpack_require__(55);
|
|
131
131
|
var form_item_default = /*#__PURE__*/__webpack_require__.n(form_item_);
|
|
132
132
|
|
|
133
133
|
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/form-input"
|
|
134
|
-
var form_input_ = __webpack_require__(
|
|
134
|
+
var form_input_ = __webpack_require__(28);
|
|
135
135
|
var form_input_default = /*#__PURE__*/__webpack_require__.n(form_input_);
|
|
136
136
|
|
|
137
137
|
// EXTERNAL MODULE: external "lodash"
|
|
@@ -158,6 +158,7 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
158
158
|
showMessage: Boolean,
|
|
159
159
|
inlineMessage: Boolean,
|
|
160
160
|
size: String,
|
|
161
|
+
slots: Object,
|
|
161
162
|
rules: [Object, Array],
|
|
162
163
|
required: Boolean,
|
|
163
164
|
actions: Array,
|
|
@@ -297,7 +298,13 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
297
298
|
}
|
|
298
299
|
},
|
|
299
300
|
render: function render(h) {
|
|
300
|
-
var _this3 = this
|
|
301
|
+
var _this3 = this,
|
|
302
|
+
_this$slots,
|
|
303
|
+
_this$slots2,
|
|
304
|
+
_this$slots3,
|
|
305
|
+
_this$slots4,
|
|
306
|
+
_this$slots5,
|
|
307
|
+
_this$slots6;
|
|
301
308
|
if (typeof this.render === "function") {
|
|
302
309
|
return this.render(h, {
|
|
303
310
|
form: this.form,
|
|
@@ -338,7 +345,11 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
338
345
|
"labelWidth": this.labelWidth,
|
|
339
346
|
"size": this.size
|
|
340
347
|
}
|
|
341
|
-
}, [h("
|
|
348
|
+
}, [h("div", {
|
|
349
|
+
"class": "form-input_wrap"
|
|
350
|
+
}, [typeof ((_this$slots = this.slots) == null ? void 0 : _this$slots.prependItem) === "function" ? (_this$slots2 = this.slots) == null || (_this$slots2 = _this$slots2.prependItem) == null ? void 0 : _this$slots2.call(this, h) : (_this$slots3 = this.slots) == null ? void 0 : _this$slots3.prependItem, h("div", {
|
|
351
|
+
"class": "form-input_content"
|
|
352
|
+
}, [h("form-input", babel_helper_vue_jsx_merge_props_default()([{}, itemProp]))]), typeof ((_this$slots4 = this.slots) == null ? void 0 : _this$slots4.appendItem) === "function" ? (_this$slots5 = this.slots) == null || (_this$slots5 = _this$slots5.appendItem) == null ? void 0 : _this$slots5.call(this, h) : (_this$slots6 = this.slots) == null ? void 0 : _this$slots6.appendItem])]);
|
|
342
353
|
}
|
|
343
354
|
});
|
|
344
355
|
// CONCATENATED MODULE: ./src/components/form-item/index.js
|
|
@@ -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 =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 80);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ({
|
|
@@ -241,7 +241,7 @@ module.exports = require("@panpanzhao/component-ui/lib/utils/formula");
|
|
|
241
241
|
|
|
242
242
|
/***/ }),
|
|
243
243
|
|
|
244
|
-
/***/
|
|
244
|
+
/***/ 80:
|
|
245
245
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
246
246
|
|
|
247
247
|
"use strict";
|
|
@@ -274,7 +274,7 @@ var formula_ = __webpack_require__(3);
|
|
|
274
274
|
// EXTERNAL MODULE: external "lodash"
|
|
275
275
|
var external_lodash_ = __webpack_require__(2);
|
|
276
276
|
|
|
277
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form-query/src/form.vue?vue&type=script&lang=js
|
|
277
|
+
// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.3.0_@babel+core@7.23.9_webpack@4.47.0/node_modules/babel-loader/lib!./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib??vue-loader-options!./src/components/form-query/src/form.vue?vue&type=script&lang=js
|
|
278
278
|
|
|
279
279
|
|
|
280
280
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
@@ -284,7 +284,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
284
284
|
|
|
285
285
|
|
|
286
286
|
|
|
287
|
-
/* harmony default export */ var
|
|
287
|
+
/* harmony default export */ var formvue_type_script_lang_js = ({
|
|
288
288
|
name: "FormQuery",
|
|
289
289
|
componentName: "FormQuery",
|
|
290
290
|
components: {
|
|
@@ -338,6 +338,12 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
338
338
|
default: function _default() {
|
|
339
339
|
return {};
|
|
340
340
|
}
|
|
341
|
+
},
|
|
342
|
+
on: {
|
|
343
|
+
type: Object,
|
|
344
|
+
default: function _default() {
|
|
345
|
+
return {};
|
|
346
|
+
}
|
|
341
347
|
}
|
|
342
348
|
},
|
|
343
349
|
computed: {
|
|
@@ -414,13 +420,22 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
414
420
|
this.resetFields();
|
|
415
421
|
},
|
|
416
422
|
resetFields: function resetFields() {
|
|
423
|
+
this.$refs.form.resetFields();
|
|
424
|
+
var resetFieldsFun = this.on.resetFields;
|
|
425
|
+
if (resetFieldsFun) {
|
|
426
|
+
resetFieldsFun.call(this, {
|
|
427
|
+
form: this,
|
|
428
|
+
formModel: this.formModel,
|
|
429
|
+
defaultModel: this.defaultModel,
|
|
430
|
+
formItemLayout: this.formItemLayout
|
|
431
|
+
});
|
|
432
|
+
}
|
|
417
433
|
for (var key in this.defaultModel) {
|
|
418
434
|
if (this.formItemLayout[key]) {
|
|
419
435
|
this.formItemLayout[key].value = this.defaultModel[key];
|
|
420
436
|
this.formModel[key] = this.defaultModel[key];
|
|
421
437
|
}
|
|
422
438
|
}
|
|
423
|
-
this.$refs.form.resetFields();
|
|
424
439
|
},
|
|
425
440
|
clearValidate: function clearValidate(props) {
|
|
426
441
|
return this.$refs.form.clearValidate(props);
|
|
@@ -617,9 +632,9 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
|
|
|
617
632
|
})])]);
|
|
618
633
|
}
|
|
619
634
|
});
|
|
620
|
-
// CONCATENATED MODULE: ./src/components/form-query/src/form.vue?vue&type=script&lang=js
|
|
621
|
-
/* harmony default export */ var
|
|
622
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
635
|
+
// CONCATENATED MODULE: ./src/components/form-query/src/form.vue?vue&type=script&lang=js
|
|
636
|
+
/* harmony default export */ var src_formvue_type_script_lang_js = (formvue_type_script_lang_js);
|
|
637
|
+
// EXTERNAL MODULE: ./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
623
638
|
var componentNormalizer = __webpack_require__(1);
|
|
624
639
|
|
|
625
640
|
// CONCATENATED MODULE: ./src/components/form-query/src/form.vue
|
|
@@ -631,7 +646,7 @@ var form_render, staticRenderFns
|
|
|
631
646
|
/* normalize component */
|
|
632
647
|
|
|
633
648
|
var component = Object(componentNormalizer["a" /* default */])(
|
|
634
|
-
|
|
649
|
+
src_formvue_type_script_lang_js,
|
|
635
650
|
form_render,
|
|
636
651
|
staticRenderFns,
|
|
637
652
|
false,
|
|
@@ -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 =
|
|
85
|
+
/******/ return __webpack_require__(__webpack_require__.s = 27);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ([
|
|
@@ -332,7 +332,7 @@ var external_dayjs_default = /*#__PURE__*/__webpack_require__.n(external_dayjs_)
|
|
|
332
332
|
this.formItems.forEach(function (item) {
|
|
333
333
|
_this2.formItemLayout[item.prop] = item;
|
|
334
334
|
//初始化数据值
|
|
335
|
-
_this2.$set(_this2.formModel, item.prop, null);
|
|
335
|
+
_this2.$set(_this2.formModel, item.prop, _this2.formModel[item.prop] || null);
|
|
336
336
|
});
|
|
337
337
|
},
|
|
338
338
|
methods: {
|
|
@@ -366,12 +366,17 @@ var external_dayjs_default = /*#__PURE__*/__webpack_require__.n(external_dayjs_)
|
|
|
366
366
|
}
|
|
367
367
|
},
|
|
368
368
|
renderItem: function renderItem(h, item) {
|
|
369
|
+
var _item$slots, _item$slots2, _item$slots3, _item$slots4, _item$slots5, _item$slots6;
|
|
369
370
|
var param = {
|
|
370
371
|
attrs: Object.assign({}, item)
|
|
371
372
|
};
|
|
372
373
|
return h("el-descriptions-item", babel_helper_vue_jsx_merge_props_default()([{
|
|
373
374
|
"key": item.prop
|
|
374
|
-
}, param]), [
|
|
375
|
+
}, param]), [h("div", {
|
|
376
|
+
"class": "form-view_wrap"
|
|
377
|
+
}, [typeof ((_item$slots = item.slots) == null ? void 0 : _item$slots.prependItem) === "function" ? (_item$slots2 = item.slots) == null || (_item$slots2 = _item$slots2.prependItem) == null ? void 0 : _item$slots2.call(this, h) : (_item$slots3 = item.slots) == null ? void 0 : _item$slots3.prependItem, h("div", {
|
|
378
|
+
"class": "form-view_content"
|
|
379
|
+
}, [this.renderContent(h, item)]), typeof ((_item$slots4 = item.slots) == null ? void 0 : _item$slots4.appendItem) === "function" ? (_item$slots5 = item.slots) == null || (_item$slots5 = _item$slots5.appendItem) == null ? void 0 : _item$slots5.call(this, h) : (_item$slots6 = item.slots) == null ? void 0 : _item$slots6.appendItem])]);
|
|
375
380
|
}
|
|
376
381
|
},
|
|
377
382
|
render: function render(h) {
|
|
@@ -468,15 +473,19 @@ var form_view = __webpack_require__(10);
|
|
|
468
473
|
render: Function,
|
|
469
474
|
slots: Object,
|
|
470
475
|
config: Object,
|
|
476
|
+
formModel: {
|
|
477
|
+
type: Object,
|
|
478
|
+
default: function _default() {
|
|
479
|
+
return {};
|
|
480
|
+
}
|
|
481
|
+
},
|
|
471
482
|
show: {
|
|
472
483
|
type: [Boolean, Function],
|
|
473
484
|
default: true
|
|
474
485
|
}
|
|
475
486
|
},
|
|
476
487
|
data: function data() {
|
|
477
|
-
return {
|
|
478
|
-
formModel: {}
|
|
479
|
-
};
|
|
488
|
+
return {};
|
|
480
489
|
},
|
|
481
490
|
computed: {
|
|
482
491
|
_formViewGroup: function _formViewGroup() {
|
|
@@ -539,6 +548,7 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
539
548
|
|
|
540
549
|
|
|
541
550
|
|
|
551
|
+
|
|
542
552
|
/* harmony default export */ var src = ({
|
|
543
553
|
name: "FormViewGroup",
|
|
544
554
|
componentName: "FormViewGroup",
|
|
@@ -579,6 +589,20 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
579
589
|
openedCode: null
|
|
580
590
|
};
|
|
581
591
|
},
|
|
592
|
+
created: function created() {
|
|
593
|
+
var _this = this;
|
|
594
|
+
this.items.forEach(function (item) {
|
|
595
|
+
var _item$formItems;
|
|
596
|
+
var formData = item.prop && _this.formModel[item.prop] || {};
|
|
597
|
+
if ((item == null || (_item$formItems = item.formItems) == null ? void 0 : _item$formItems.length) > 0) {
|
|
598
|
+
item == null || item.formItems.forEach(function (itemCh) {
|
|
599
|
+
_this.$set(formData, itemCh.prop, formData[itemCh.prop]);
|
|
600
|
+
});
|
|
601
|
+
}
|
|
602
|
+
//初始化数据值
|
|
603
|
+
_this.$set(_this.formModel, item.prop, formData);
|
|
604
|
+
});
|
|
605
|
+
},
|
|
582
606
|
computed: {},
|
|
583
607
|
methods: {
|
|
584
608
|
setFormModel: function setFormModel(model) {
|
|
@@ -587,7 +611,9 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
587
611
|
formNode: function formNode(form) {
|
|
588
612
|
var h = this.$createElement;
|
|
589
613
|
var formProp = {
|
|
590
|
-
attrs: Object.assign({
|
|
614
|
+
attrs: Object.assign({
|
|
615
|
+
formModel: form.prop && this.formModel[form.prop]
|
|
616
|
+
}, form),
|
|
591
617
|
on: form.on
|
|
592
618
|
};
|
|
593
619
|
return h(content, babel_helper_vue_jsx_merge_props_default()([{
|
|
@@ -600,10 +626,10 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
600
626
|
}, formProp]));
|
|
601
627
|
},
|
|
602
628
|
renderTab: function renderTab(h, filterItems) {
|
|
603
|
-
var
|
|
629
|
+
var _this2 = this;
|
|
604
630
|
var itemNode = filterItems.map(function (item) {
|
|
605
631
|
if (typeof item.render === "function") {
|
|
606
|
-
return item.render(h,
|
|
632
|
+
return item.render(h, _this2.formModel, item);
|
|
607
633
|
}
|
|
608
634
|
return h("el-tab-pane", {
|
|
609
635
|
"key": item.prop,
|
|
@@ -613,7 +639,7 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
613
639
|
}
|
|
614
640
|
}, [h("template", {
|
|
615
641
|
"slot": "label"
|
|
616
|
-
}, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(
|
|
642
|
+
}, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this2, h) : item.slots && item.slots.title]), _this2.formNode(item)]);
|
|
617
643
|
});
|
|
618
644
|
var tabsProp = {
|
|
619
645
|
attrs: {
|
|
@@ -622,17 +648,17 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
622
648
|
},
|
|
623
649
|
on: {
|
|
624
650
|
"tab-click": function tabClick(tabNode) {
|
|
625
|
-
|
|
651
|
+
_this2.$emit("openedCode", tabNode.name);
|
|
626
652
|
}
|
|
627
653
|
}
|
|
628
654
|
};
|
|
629
655
|
return h("el-tabs", babel_helper_vue_jsx_merge_props_default()([{}, tabsProp]), [itemNode]);
|
|
630
656
|
},
|
|
631
657
|
renderCollapse: function renderCollapse(h, filterItems) {
|
|
632
|
-
var
|
|
658
|
+
var _this3 = this;
|
|
633
659
|
var itemNode = filterItems.map(function (item) {
|
|
634
660
|
if (typeof item.render === "function") {
|
|
635
|
-
return item.render(h,
|
|
661
|
+
return item.render(h, _this3.formModel, item);
|
|
636
662
|
}
|
|
637
663
|
return h("el-collapse-item", {
|
|
638
664
|
"key": item.prop,
|
|
@@ -642,7 +668,7 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
642
668
|
}
|
|
643
669
|
}, [h("template", {
|
|
644
670
|
"slot": "title"
|
|
645
|
-
}, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(
|
|
671
|
+
}, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this3, h) : item.slots && item.slots.title]), _this3.formNode(item)]);
|
|
646
672
|
});
|
|
647
673
|
var collapseProp = {
|
|
648
674
|
attrs: {
|
|
@@ -650,20 +676,46 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
650
676
|
},
|
|
651
677
|
on: {
|
|
652
678
|
change: function change(val) {
|
|
653
|
-
|
|
679
|
+
_this3.$emit("openedCode", val);
|
|
654
680
|
}
|
|
655
681
|
}
|
|
656
682
|
};
|
|
657
683
|
return h("el-collapse", babel_helper_vue_jsx_merge_props_default()([{}, collapseProp]), [itemNode]);
|
|
684
|
+
},
|
|
685
|
+
renderCustom: function renderCustom(h, filterItems) {
|
|
686
|
+
var _this4 = this;
|
|
687
|
+
var itemNode = filterItems.map(function (item) {
|
|
688
|
+
if (typeof item.render === "function") {
|
|
689
|
+
return item.render(h, _this4.formModel, item);
|
|
690
|
+
}
|
|
691
|
+
return h("div", {
|
|
692
|
+
"key": item.prop,
|
|
693
|
+
"attrs": {
|
|
694
|
+
"name": item.prop,
|
|
695
|
+
"title": item.label
|
|
696
|
+
}
|
|
697
|
+
}, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this4, h) : item.slots && item.slots.title || item.label, _this4.formNode(item)]);
|
|
698
|
+
});
|
|
699
|
+
var collapseProp = {
|
|
700
|
+
attrs: {
|
|
701
|
+
value: this.openedCode
|
|
702
|
+
},
|
|
703
|
+
on: {
|
|
704
|
+
change: function change(val) {
|
|
705
|
+
_this4.$emit("openedCode", val);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
};
|
|
709
|
+
return h("div", babel_helper_vue_jsx_merge_props_default()([{}, collapseProp]), [itemNode]);
|
|
658
710
|
}
|
|
659
711
|
},
|
|
660
712
|
render: function render(h) {
|
|
661
|
-
var
|
|
713
|
+
var _this5 = this;
|
|
662
714
|
var filterItems = this.items.filter(function (item) {
|
|
663
715
|
if (item.show === false) {
|
|
664
716
|
return false;
|
|
665
717
|
}
|
|
666
|
-
if (typeof item.show === "function" && !item.show.call(
|
|
718
|
+
if (typeof item.show === "function" && !item.show.call(_this5, {
|
|
667
719
|
config: item
|
|
668
720
|
})) {
|
|
669
721
|
return false;
|
|
@@ -674,9 +726,14 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
674
726
|
return null;
|
|
675
727
|
}
|
|
676
728
|
this.openedCode = filterItems[0] && filterItems[0].prop;
|
|
729
|
+
var group = {
|
|
730
|
+
Custom: this.renderCustom,
|
|
731
|
+
Tab: this.renderTab,
|
|
732
|
+
Collapse: this.renderCollapse
|
|
733
|
+
};
|
|
677
734
|
return h("div", {
|
|
678
|
-
"class": ["form-view-group", "is-" +
|
|
679
|
-
}, [this.control
|
|
735
|
+
"class": ["form-view-group", "is-" + this.control]
|
|
736
|
+
}, [group[this.control] ? group[this.control](h, filterItems) : null]);
|
|
680
737
|
}
|
|
681
738
|
});
|
|
682
739
|
// CONCATENATED MODULE: ./src/components/form-view-group/index.js
|
|
@@ -689,7 +746,8 @@ src.install = function (Vue) {
|
|
|
689
746
|
/***/ }),
|
|
690
747
|
/* 24 */,
|
|
691
748
|
/* 25 */,
|
|
692
|
-
/* 26
|
|
749
|
+
/* 26 */,
|
|
750
|
+
/* 27 */
|
|
693
751
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
694
752
|
|
|
695
753
|
"use strict";
|
|
@@ -714,10 +772,7 @@ var form_view = __webpack_require__(10);
|
|
|
714
772
|
// EXTERNAL MODULE: ./src/components/form-view-group/index.js + 2 modules
|
|
715
773
|
var form_view_group = __webpack_require__(23);
|
|
716
774
|
|
|
717
|
-
//
|
|
718
|
-
var external_lodash_ = __webpack_require__(2);
|
|
719
|
-
|
|
720
|
-
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form-view-dialog/src/index.vue?vue&type=script&lang=js&
|
|
775
|
+
// CONCATENATED MODULE: ./node_modules/.pnpm/babel-loader@8.3.0_@babel+core@7.23.9_webpack@4.47.0/node_modules/babel-loader/lib!./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib??vue-loader-options!./src/components/form-view-dialog/src/index.vue?vue&type=script&lang=js
|
|
721
776
|
|
|
722
777
|
|
|
723
778
|
|
|
@@ -727,8 +782,8 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
727
782
|
|
|
728
783
|
|
|
729
784
|
|
|
730
|
-
|
|
731
|
-
/* harmony default export */ var
|
|
785
|
+
// import { merge } from 'lodash';
|
|
786
|
+
/* harmony default export */ var srcvue_type_script_lang_js = ({
|
|
732
787
|
name: "FormViewDialog",
|
|
733
788
|
componentName: "FormViewDialog",
|
|
734
789
|
components: {
|
|
@@ -855,7 +910,7 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
855
910
|
this.show = false;
|
|
856
911
|
},
|
|
857
912
|
setFormModel: function setFormModel(model) {
|
|
858
|
-
Object(
|
|
913
|
+
Object.assign(this.formModel, model);
|
|
859
914
|
},
|
|
860
915
|
renderForm: function renderForm(h) {
|
|
861
916
|
var param = {
|
|
@@ -874,13 +929,19 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
874
929
|
},
|
|
875
930
|
renderTitle: function renderTitle(h) {
|
|
876
931
|
if (typeof this.slots.title === "function") {
|
|
877
|
-
return this.slots.title.call(this,
|
|
932
|
+
return this.slots.title.call(this, {
|
|
933
|
+
ref: this,
|
|
934
|
+
formModel: this.formModel
|
|
935
|
+
});
|
|
878
936
|
}
|
|
879
937
|
return this.slots.title || this.dialog.title;
|
|
880
938
|
},
|
|
881
939
|
renderTools: function renderTools(h) {
|
|
882
940
|
if (typeof this.slots.footer === "function") {
|
|
883
|
-
return this.slots.footer.call(this,
|
|
941
|
+
return this.slots.footer.call(this, {
|
|
942
|
+
ref: this,
|
|
943
|
+
formModel: this.formModel
|
|
944
|
+
});
|
|
884
945
|
}
|
|
885
946
|
return h("div", [(this.tools || this.defaultTools).map(function (item) {
|
|
886
947
|
var toolParam = {
|
|
@@ -913,9 +974,9 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
913
974
|
}, [this.renderTools(h)]), this.renderForm(h)]);
|
|
914
975
|
}
|
|
915
976
|
});
|
|
916
|
-
// CONCATENATED MODULE: ./src/components/form-view-dialog/src/index.vue?vue&type=script&lang=js
|
|
917
|
-
/* harmony default export */ var
|
|
918
|
-
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
977
|
+
// CONCATENATED MODULE: ./src/components/form-view-dialog/src/index.vue?vue&type=script&lang=js
|
|
978
|
+
/* harmony default export */ var form_view_dialog_srcvue_type_script_lang_js = (srcvue_type_script_lang_js);
|
|
979
|
+
// EXTERNAL MODULE: ./node_modules/.pnpm/vue-loader@15.11.1_css-loader@2.1.1_lodash@4.17.21_vue-template-compiler@2.7.16_webpack@4.47.0/node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
919
980
|
var componentNormalizer = __webpack_require__(1);
|
|
920
981
|
|
|
921
982
|
// CONCATENATED MODULE: ./src/components/form-view-dialog/src/index.vue
|
|
@@ -927,7 +988,7 @@ var src_render, staticRenderFns
|
|
|
927
988
|
/* normalize component */
|
|
928
989
|
|
|
929
990
|
var component = Object(componentNormalizer["a" /* default */])(
|
|
930
|
-
|
|
991
|
+
form_view_dialog_srcvue_type_script_lang_js,
|
|
931
992
|
src_render,
|
|
932
993
|
staticRenderFns,
|
|
933
994
|
false,
|
|
@@ -224,7 +224,7 @@ var external_dayjs_default = /*#__PURE__*/__webpack_require__.n(external_dayjs_)
|
|
|
224
224
|
this.formItems.forEach(function (item) {
|
|
225
225
|
_this2.formItemLayout[item.prop] = item;
|
|
226
226
|
//初始化数据值
|
|
227
|
-
_this2.$set(_this2.formModel, item.prop, null);
|
|
227
|
+
_this2.$set(_this2.formModel, item.prop, _this2.formModel[item.prop] || null);
|
|
228
228
|
});
|
|
229
229
|
},
|
|
230
230
|
methods: {
|
|
@@ -258,12 +258,17 @@ var external_dayjs_default = /*#__PURE__*/__webpack_require__.n(external_dayjs_)
|
|
|
258
258
|
}
|
|
259
259
|
},
|
|
260
260
|
renderItem: function renderItem(h, item) {
|
|
261
|
+
var _item$slots, _item$slots2, _item$slots3, _item$slots4, _item$slots5, _item$slots6;
|
|
261
262
|
var param = {
|
|
262
263
|
attrs: Object.assign({}, item)
|
|
263
264
|
};
|
|
264
265
|
return h("el-descriptions-item", babel_helper_vue_jsx_merge_props_default()([{
|
|
265
266
|
"key": item.prop
|
|
266
|
-
}, param]), [
|
|
267
|
+
}, param]), [h("div", {
|
|
268
|
+
"class": "form-view_wrap"
|
|
269
|
+
}, [typeof ((_item$slots = item.slots) == null ? void 0 : _item$slots.prependItem) === "function" ? (_item$slots2 = item.slots) == null || (_item$slots2 = _item$slots2.prependItem) == null ? void 0 : _item$slots2.call(this, h) : (_item$slots3 = item.slots) == null ? void 0 : _item$slots3.prependItem, h("div", {
|
|
270
|
+
"class": "form-view_content"
|
|
271
|
+
}, [this.renderContent(h, item)]), typeof ((_item$slots4 = item.slots) == null ? void 0 : _item$slots4.appendItem) === "function" ? (_item$slots5 = item.slots) == null || (_item$slots5 = _item$slots5.appendItem) == null ? void 0 : _item$slots5.call(this, h) : (_item$slots6 = item.slots) == null ? void 0 : _item$slots6.appendItem])]);
|
|
267
272
|
}
|
|
268
273
|
},
|
|
269
274
|
render: function render(h) {
|
|
@@ -355,15 +360,19 @@ var form_view = __webpack_require__(10);
|
|
|
355
360
|
render: Function,
|
|
356
361
|
slots: Object,
|
|
357
362
|
config: Object,
|
|
363
|
+
formModel: {
|
|
364
|
+
type: Object,
|
|
365
|
+
default: function _default() {
|
|
366
|
+
return {};
|
|
367
|
+
}
|
|
368
|
+
},
|
|
358
369
|
show: {
|
|
359
370
|
type: [Boolean, Function],
|
|
360
371
|
default: true
|
|
361
372
|
}
|
|
362
373
|
},
|
|
363
374
|
data: function data() {
|
|
364
|
-
return {
|
|
365
|
-
formModel: {}
|
|
366
|
-
};
|
|
375
|
+
return {};
|
|
367
376
|
},
|
|
368
377
|
computed: {
|
|
369
378
|
_formViewGroup: function _formViewGroup() {
|
|
@@ -426,6 +435,7 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
426
435
|
|
|
427
436
|
|
|
428
437
|
|
|
438
|
+
|
|
429
439
|
/* harmony default export */ var src = ({
|
|
430
440
|
name: "FormViewGroup",
|
|
431
441
|
componentName: "FormViewGroup",
|
|
@@ -466,6 +476,20 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
466
476
|
openedCode: null
|
|
467
477
|
};
|
|
468
478
|
},
|
|
479
|
+
created: function created() {
|
|
480
|
+
var _this = this;
|
|
481
|
+
this.items.forEach(function (item) {
|
|
482
|
+
var _item$formItems;
|
|
483
|
+
var formData = item.prop && _this.formModel[item.prop] || {};
|
|
484
|
+
if ((item == null || (_item$formItems = item.formItems) == null ? void 0 : _item$formItems.length) > 0) {
|
|
485
|
+
item == null || item.formItems.forEach(function (itemCh) {
|
|
486
|
+
_this.$set(formData, itemCh.prop, formData[itemCh.prop]);
|
|
487
|
+
});
|
|
488
|
+
}
|
|
489
|
+
//初始化数据值
|
|
490
|
+
_this.$set(_this.formModel, item.prop, formData);
|
|
491
|
+
});
|
|
492
|
+
},
|
|
469
493
|
computed: {},
|
|
470
494
|
methods: {
|
|
471
495
|
setFormModel: function setFormModel(model) {
|
|
@@ -474,7 +498,9 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
474
498
|
formNode: function formNode(form) {
|
|
475
499
|
var h = this.$createElement;
|
|
476
500
|
var formProp = {
|
|
477
|
-
attrs: Object.assign({
|
|
501
|
+
attrs: Object.assign({
|
|
502
|
+
formModel: form.prop && this.formModel[form.prop]
|
|
503
|
+
}, form),
|
|
478
504
|
on: form.on
|
|
479
505
|
};
|
|
480
506
|
return h(content, babel_helper_vue_jsx_merge_props_default()([{
|
|
@@ -487,10 +513,10 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
487
513
|
}, formProp]));
|
|
488
514
|
},
|
|
489
515
|
renderTab: function renderTab(h, filterItems) {
|
|
490
|
-
var
|
|
516
|
+
var _this2 = this;
|
|
491
517
|
var itemNode = filterItems.map(function (item) {
|
|
492
518
|
if (typeof item.render === "function") {
|
|
493
|
-
return item.render(h,
|
|
519
|
+
return item.render(h, _this2.formModel, item);
|
|
494
520
|
}
|
|
495
521
|
return h("el-tab-pane", {
|
|
496
522
|
"key": item.prop,
|
|
@@ -500,7 +526,7 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
500
526
|
}
|
|
501
527
|
}, [h("template", {
|
|
502
528
|
"slot": "label"
|
|
503
|
-
}, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(
|
|
529
|
+
}, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this2, h) : item.slots && item.slots.title]), _this2.formNode(item)]);
|
|
504
530
|
});
|
|
505
531
|
var tabsProp = {
|
|
506
532
|
attrs: {
|
|
@@ -509,17 +535,17 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
509
535
|
},
|
|
510
536
|
on: {
|
|
511
537
|
"tab-click": function tabClick(tabNode) {
|
|
512
|
-
|
|
538
|
+
_this2.$emit("openedCode", tabNode.name);
|
|
513
539
|
}
|
|
514
540
|
}
|
|
515
541
|
};
|
|
516
542
|
return h("el-tabs", babel_helper_vue_jsx_merge_props_default()([{}, tabsProp]), [itemNode]);
|
|
517
543
|
},
|
|
518
544
|
renderCollapse: function renderCollapse(h, filterItems) {
|
|
519
|
-
var
|
|
545
|
+
var _this3 = this;
|
|
520
546
|
var itemNode = filterItems.map(function (item) {
|
|
521
547
|
if (typeof item.render === "function") {
|
|
522
|
-
return item.render(h,
|
|
548
|
+
return item.render(h, _this3.formModel, item);
|
|
523
549
|
}
|
|
524
550
|
return h("el-collapse-item", {
|
|
525
551
|
"key": item.prop,
|
|
@@ -529,7 +555,7 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
529
555
|
}
|
|
530
556
|
}, [h("template", {
|
|
531
557
|
"slot": "title"
|
|
532
|
-
}, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(
|
|
558
|
+
}, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this3, h) : item.slots && item.slots.title]), _this3.formNode(item)]);
|
|
533
559
|
});
|
|
534
560
|
var collapseProp = {
|
|
535
561
|
attrs: {
|
|
@@ -537,20 +563,46 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
537
563
|
},
|
|
538
564
|
on: {
|
|
539
565
|
change: function change(val) {
|
|
540
|
-
|
|
566
|
+
_this3.$emit("openedCode", val);
|
|
541
567
|
}
|
|
542
568
|
}
|
|
543
569
|
};
|
|
544
570
|
return h("el-collapse", babel_helper_vue_jsx_merge_props_default()([{}, collapseProp]), [itemNode]);
|
|
571
|
+
},
|
|
572
|
+
renderCustom: function renderCustom(h, filterItems) {
|
|
573
|
+
var _this4 = this;
|
|
574
|
+
var itemNode = filterItems.map(function (item) {
|
|
575
|
+
if (typeof item.render === "function") {
|
|
576
|
+
return item.render(h, _this4.formModel, item);
|
|
577
|
+
}
|
|
578
|
+
return h("div", {
|
|
579
|
+
"key": item.prop,
|
|
580
|
+
"attrs": {
|
|
581
|
+
"name": item.prop,
|
|
582
|
+
"title": item.label
|
|
583
|
+
}
|
|
584
|
+
}, [item.slots && typeof item.slots.title === "function" ? item.slots.title.call(_this4, h) : item.slots && item.slots.title || item.label, _this4.formNode(item)]);
|
|
585
|
+
});
|
|
586
|
+
var collapseProp = {
|
|
587
|
+
attrs: {
|
|
588
|
+
value: this.openedCode
|
|
589
|
+
},
|
|
590
|
+
on: {
|
|
591
|
+
change: function change(val) {
|
|
592
|
+
_this4.$emit("openedCode", val);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
};
|
|
596
|
+
return h("div", babel_helper_vue_jsx_merge_props_default()([{}, collapseProp]), [itemNode]);
|
|
545
597
|
}
|
|
546
598
|
},
|
|
547
599
|
render: function render(h) {
|
|
548
|
-
var
|
|
600
|
+
var _this5 = this;
|
|
549
601
|
var filterItems = this.items.filter(function (item) {
|
|
550
602
|
if (item.show === false) {
|
|
551
603
|
return false;
|
|
552
604
|
}
|
|
553
|
-
if (typeof item.show === "function" && !item.show.call(
|
|
605
|
+
if (typeof item.show === "function" && !item.show.call(_this5, {
|
|
554
606
|
config: item
|
|
555
607
|
})) {
|
|
556
608
|
return false;
|
|
@@ -561,9 +613,14 @@ var external_lodash_ = __webpack_require__(2);
|
|
|
561
613
|
return null;
|
|
562
614
|
}
|
|
563
615
|
this.openedCode = filterItems[0] && filterItems[0].prop;
|
|
616
|
+
var group = {
|
|
617
|
+
Custom: this.renderCustom,
|
|
618
|
+
Tab: this.renderTab,
|
|
619
|
+
Collapse: this.renderCollapse
|
|
620
|
+
};
|
|
564
621
|
return h("div", {
|
|
565
|
-
"class": ["form-view-group", "is-" +
|
|
566
|
-
}, [this.control
|
|
622
|
+
"class": ["form-view-group", "is-" + this.control]
|
|
623
|
+
}, [group[this.control] ? group[this.control](h, filterItems) : null]);
|
|
567
624
|
}
|
|
568
625
|
});
|
|
569
626
|
// CONCATENATED MODULE: ./src/components/form-view-group/index.js
|