xt-element-ui 2.1.72 → 2.2.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/index.common.js +267 -61
- package/lib/index.css +1 -1
- package/lib/index.umd.js +267 -61
- package/lib/index.umd.min.js +1 -1
- package/lib/xt-badge/demo.html +10 -0
- package/lib/xt-badge/index.js +1 -0
- package/lib/xt-badge/xt-badge.common.js +335 -0
- package/lib/xt-badge/xt-badge.css +1 -0
- package/lib/xt-badge/xt-badge.umd.js +345 -0
- package/lib/xt-badge/xt-badge.umd.min.js +1 -0
- package/lib/xt-button/demo.html +10 -0
- package/lib/xt-button/index.js +1 -0
- package/lib/xt-button/xt-button.common.js +331 -0
- package/lib/xt-button/xt-button.css +1 -0
- package/lib/xt-button/xt-button.umd.js +341 -0
- package/lib/xt-button/xt-button.umd.min.js +1 -0
- package/lib/xt-card/demo.html +10 -0
- package/lib/xt-card/index.js +1 -0
- package/lib/xt-card/xt-card.common.js +325 -0
- package/lib/xt-card/xt-card.css +1 -0
- package/lib/xt-card/xt-card.umd.js +335 -0
- package/lib/xt-card/xt-card.umd.min.js +1 -0
- package/lib/xt-card-item/demo.html +10 -0
- package/lib/xt-card-item/index.js +1 -0
- package/lib/xt-card-item/xt-card-item.common.js +291 -0
- package/lib/xt-card-item/xt-card-item.css +1 -0
- package/lib/xt-card-item/xt-card-item.umd.js +301 -0
- package/lib/xt-card-item/xt-card-item.umd.min.js +1 -0
- package/lib/xt-chart/demo.html +10 -0
- package/lib/xt-chart/index.js +1 -0
- package/lib/xt-chart/xt-chart.common.js +109203 -0
- package/lib/xt-chart/xt-chart.css +1 -0
- package/lib/xt-chart/xt-chart.umd.js +109213 -0
- package/lib/xt-chart/xt-chart.umd.min.js +1 -0
- package/lib/xt-config-provider/demo.html +10 -0
- package/lib/xt-config-provider/index.js +1 -0
- package/lib/xt-config-provider/xt-config-provider.common.js +108388 -0
- package/lib/xt-config-provider/xt-config-provider.css +1 -0
- package/lib/xt-config-provider/xt-config-provider.umd.js +108398 -0
- package/lib/xt-config-provider/xt-config-provider.umd.min.js +1 -0
- package/lib/xt-date-picker/demo.html +10 -0
- package/lib/xt-date-picker/index.js +1 -0
- package/lib/xt-date-picker/xt-date-picker.common.js +768 -0
- package/lib/xt-date-picker/xt-date-picker.css +1 -0
- package/lib/xt-date-picker/xt-date-picker.umd.js +778 -0
- package/lib/xt-date-picker/xt-date-picker.umd.min.js +1 -0
- package/lib/xt-flex-box/demo.html +10 -0
- package/lib/xt-flex-box/index.js +1 -0
- package/lib/xt-flex-box/xt-flex-box.common.js +303 -0
- package/lib/xt-flex-box/xt-flex-box.css +1 -0
- package/lib/xt-flex-box/xt-flex-box.umd.js +313 -0
- package/lib/xt-flex-box/xt-flex-box.umd.min.js +1 -0
- package/lib/xt-form-schema/demo.html +10 -0
- package/lib/xt-form-schema/index.js +1 -0
- package/lib/xt-form-schema/xt-form-schema.common.js +510 -0
- package/lib/xt-form-schema/xt-form-schema.css +1 -0
- package/lib/xt-form-schema/xt-form-schema.umd.js +520 -0
- package/lib/xt-form-schema/xt-form-schema.umd.min.js +1 -0
- package/lib/xt-grid-box/demo.html +10 -0
- package/lib/xt-grid-box/index.js +1 -0
- package/lib/xt-grid-box/xt-grid-box.common.js +404 -0
- package/lib/xt-grid-box/xt-grid-box.css +1 -0
- package/lib/xt-grid-box/xt-grid-box.umd.js +414 -0
- package/lib/xt-grid-box/xt-grid-box.umd.min.js +1 -0
- package/lib/xt-grid-item/demo.html +10 -0
- package/lib/xt-grid-item/index.js +1 -0
- package/lib/xt-grid-item/xt-grid-item.common.js +381 -0
- package/lib/xt-grid-item/xt-grid-item.css +1 -0
- package/lib/xt-grid-item/xt-grid-item.umd.js +391 -0
- package/lib/xt-grid-item/xt-grid-item.umd.min.js +1 -0
- package/lib/xt-icon/demo.html +10 -0
- package/lib/xt-icon/index.js +1 -0
- package/lib/xt-icon/xt-icon.common.js +430 -0
- package/lib/xt-icon/xt-icon.css +1 -0
- package/lib/xt-icon/xt-icon.umd.js +440 -0
- package/lib/xt-icon/xt-icon.umd.min.js +1 -0
- package/lib/xt-input/demo.html +10 -0
- package/lib/xt-input/index.js +1 -0
- package/lib/xt-input/xt-input.common.js +584 -0
- package/lib/xt-input/xt-input.css +1 -0
- package/lib/xt-input/xt-input.umd.js +594 -0
- package/lib/xt-input/xt-input.umd.min.js +1 -0
- package/lib/xt-list/demo.html +10 -0
- package/lib/xt-list/index.js +1 -0
- package/lib/xt-list/xt-list.common.js +714 -0
- package/lib/xt-list/xt-list.css +1 -0
- package/lib/xt-list/xt-list.umd.js +724 -0
- package/lib/xt-list/xt-list.umd.min.js +1 -0
- package/lib/xt-map/demo.html +10 -0
- package/lib/xt-map/index.js +1 -0
- package/lib/xt-map/xt-map.common.js +1951 -0
- package/lib/xt-map/xt-map.css +1 -0
- package/lib/xt-map/xt-map.umd.js +1961 -0
- package/lib/xt-map/xt-map.umd.min.js +1 -0
- package/lib/xt-map-provider/demo.html +10 -0
- package/lib/xt-map-provider/index.js +1 -0
- package/lib/xt-map-provider/xt-map-provider.common.js +644 -0
- package/lib/xt-map-provider/xt-map-provider.css +1 -0
- package/lib/xt-map-provider/xt-map-provider.umd.js +654 -0
- package/lib/xt-map-provider/xt-map-provider.umd.min.js +1 -0
- package/lib/xt-page/demo.html +10 -0
- package/lib/xt-page/index.js +1 -0
- package/lib/xt-page/xt-page.common.js +353 -0
- package/lib/xt-page/xt-page.css +1 -0
- package/lib/xt-page/xt-page.umd.js +363 -0
- package/lib/xt-page/xt-page.umd.min.js +1 -0
- package/lib/xt-progress/demo.html +10 -0
- package/lib/xt-progress/index.js +1 -0
- package/lib/xt-progress/xt-progress.common.js +327 -0
- package/lib/xt-progress/xt-progress.css +1 -0
- package/lib/xt-progress/xt-progress.umd.js +337 -0
- package/lib/xt-progress/xt-progress.umd.min.js +1 -0
- package/lib/xt-scroll-arrow/demo.html +10 -0
- package/lib/xt-scroll-arrow/index.js +1 -0
- package/lib/xt-scroll-arrow/xt-scroll-arrow.common.js +495 -0
- package/lib/xt-scroll-arrow/xt-scroll-arrow.css +1 -0
- package/lib/xt-scroll-arrow/xt-scroll-arrow.umd.js +505 -0
- package/lib/xt-scroll-arrow/xt-scroll-arrow.umd.min.js +1 -0
- package/lib/xt-select-tree/demo.html +10 -0
- package/lib/xt-select-tree/index.js +1 -0
- package/lib/xt-select-tree/xt-select-tree.common.js +1791 -0
- package/lib/xt-select-tree/xt-select-tree.css +1 -0
- package/lib/xt-select-tree/xt-select-tree.umd.js +1801 -0
- package/lib/xt-select-tree/xt-select-tree.umd.min.js +1 -0
- package/lib/xt-step-price/demo.html +10 -0
- package/lib/xt-step-price/index.js +1 -0
- package/lib/xt-step-price/xt-step-price.common.js +800 -0
- package/lib/xt-step-price/xt-step-price.css +1 -0
- package/lib/xt-step-price/xt-step-price.umd.js +810 -0
- package/lib/xt-step-price/xt-step-price.umd.min.js +1 -0
- package/lib/xt-step-price-item/demo.html +10 -0
- package/lib/xt-step-price-item/index.js +1 -0
- package/lib/xt-step-price-item/xt-step-price-item.common.js +417 -0
- package/lib/xt-step-price-item/xt-step-price-item.umd.js +427 -0
- package/lib/xt-step-price-item/xt-step-price-item.umd.min.js +1 -0
- package/lib/xt-tab-pane/demo.html +10 -0
- package/lib/xt-tab-pane/index.js +1 -0
- package/lib/xt-tab-pane/xt-tab-pane.common.js +309 -0
- package/lib/xt-tab-pane/xt-tab-pane.umd.js +319 -0
- package/lib/xt-tab-pane/xt-tab-pane.umd.min.js +1 -0
- package/lib/xt-table/demo.html +10 -0
- package/lib/xt-table/index.js +1 -0
- package/lib/xt-table/xt-table.common.js +1027 -0
- package/lib/xt-table/xt-table.css +1 -0
- package/lib/xt-table/xt-table.umd.js +1037 -0
- package/lib/xt-table/xt-table.umd.min.js +1 -0
- package/lib/xt-tabs/demo.html +10 -0
- package/lib/xt-tabs/index.js +1 -0
- package/lib/xt-tabs/xt-tabs.common.js +463 -0
- package/lib/xt-tabs/xt-tabs.css +1 -0
- package/lib/xt-tabs/xt-tabs.umd.js +473 -0
- package/lib/xt-tabs/xt-tabs.umd.min.js +1 -0
- package/lib/xt-text/demo.html +10 -0
- package/lib/xt-text/index.js +1 -0
- package/lib/xt-text/xt-text.common.js +536 -0
- package/lib/xt-text/xt-text.css +1 -0
- package/lib/xt-text/xt-text.umd.js +546 -0
- package/lib/xt-text/xt-text.umd.min.js +1 -0
- package/lib/xt-time/demo.html +10 -0
- package/lib/xt-time/index.js +1 -0
- package/lib/xt-time/xt-time.common.js +555 -0
- package/lib/xt-time/xt-time.css +1 -0
- package/lib/xt-time/xt-time.umd.js +565 -0
- package/lib/xt-time/xt-time.umd.min.js +1 -0
- package/lib/xt-transfer-tree/demo.html +10 -0
- package/lib/xt-transfer-tree/index.js +1 -0
- package/lib/xt-transfer-tree/xt-transfer-tree.common.js +594 -0
- package/lib/xt-transfer-tree/xt-transfer-tree.css +1 -0
- package/lib/xt-transfer-tree/xt-transfer-tree.umd.js +604 -0
- package/lib/xt-transfer-tree/xt-transfer-tree.umd.min.js +1 -0
- package/lib/xt-upload/demo.html +10 -0
- package/lib/xt-upload/index.js +1 -0
- package/lib/xt-upload/xt-upload.common.js +1292 -0
- package/lib/xt-upload/xt-upload.css +1 -0
- package/lib/xt-upload/xt-upload.umd.js +1302 -0
- package/lib/xt-upload/xt-upload.umd.min.js +1 -0
- package/package.json +4 -2
- package/src/components/xt-badge/index.js +8 -7
- package/src/components/xt-button/index.js +1 -0
- package/src/components/xt-card/index.js +1 -0
- package/src/components/xt-card-item/index.js +1 -0
- package/src/components/xt-config-provider/index.js +1 -0
- package/src/components/xt-flex-box/index.js +1 -0
- package/src/components/xt-grid-box/index.js +1 -0
- package/src/components/xt-icon/index.js +1 -0
- package/src/components/xt-input/index.js +1 -0
- package/src/components/xt-map/index.js +1 -0
- package/src/components/xt-progress/index.js +8 -7
- package/src/components/xt-scroll-arrow/index.js +8 -7
- package/src/components/xt-step-price/index.js +1 -0
- package/src/components/xt-tabs/index.js +9 -8
- package/src/components/xt-text/index.js +1 -0
- package/src/components/xt-time/index.js +1 -0
- package/src/index.js +32 -2
|
@@ -0,0 +1,520 @@
|
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory();
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define([], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["xt-form-schema"] = factory();
|
|
8
|
+
else
|
|
9
|
+
root["xt-form-schema"] = factory();
|
|
10
|
+
})((typeof self !== 'undefined' ? self : this), function() {
|
|
11
|
+
return /******/ (function(modules) { // webpackBootstrap
|
|
12
|
+
/******/ // The module cache
|
|
13
|
+
/******/ var installedModules = {};
|
|
14
|
+
/******/
|
|
15
|
+
/******/ // The require function
|
|
16
|
+
/******/ function __webpack_require__(moduleId) {
|
|
17
|
+
/******/
|
|
18
|
+
/******/ // Check if module is in cache
|
|
19
|
+
/******/ if(installedModules[moduleId]) {
|
|
20
|
+
/******/ return installedModules[moduleId].exports;
|
|
21
|
+
/******/ }
|
|
22
|
+
/******/ // Create a new module (and put it into the cache)
|
|
23
|
+
/******/ var module = installedModules[moduleId] = {
|
|
24
|
+
/******/ i: moduleId,
|
|
25
|
+
/******/ l: false,
|
|
26
|
+
/******/ exports: {}
|
|
27
|
+
/******/ };
|
|
28
|
+
/******/
|
|
29
|
+
/******/ // Execute the module function
|
|
30
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
31
|
+
/******/
|
|
32
|
+
/******/ // Flag the module as loaded
|
|
33
|
+
/******/ module.l = true;
|
|
34
|
+
/******/
|
|
35
|
+
/******/ // Return the exports of the module
|
|
36
|
+
/******/ return module.exports;
|
|
37
|
+
/******/ }
|
|
38
|
+
/******/
|
|
39
|
+
/******/
|
|
40
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
41
|
+
/******/ __webpack_require__.m = modules;
|
|
42
|
+
/******/
|
|
43
|
+
/******/ // expose the module cache
|
|
44
|
+
/******/ __webpack_require__.c = installedModules;
|
|
45
|
+
/******/
|
|
46
|
+
/******/ // define getter function for harmony exports
|
|
47
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
48
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
49
|
+
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
50
|
+
/******/ }
|
|
51
|
+
/******/ };
|
|
52
|
+
/******/
|
|
53
|
+
/******/ // define __esModule on exports
|
|
54
|
+
/******/ __webpack_require__.r = function(exports) {
|
|
55
|
+
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
56
|
+
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
57
|
+
/******/ }
|
|
58
|
+
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
59
|
+
/******/ };
|
|
60
|
+
/******/
|
|
61
|
+
/******/ // create a fake namespace object
|
|
62
|
+
/******/ // mode & 1: value is a module id, require it
|
|
63
|
+
/******/ // mode & 2: merge all properties of value into the ns
|
|
64
|
+
/******/ // mode & 4: return value when already ns object
|
|
65
|
+
/******/ // mode & 8|1: behave like require
|
|
66
|
+
/******/ __webpack_require__.t = function(value, mode) {
|
|
67
|
+
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
68
|
+
/******/ if(mode & 8) return value;
|
|
69
|
+
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
70
|
+
/******/ var ns = Object.create(null);
|
|
71
|
+
/******/ __webpack_require__.r(ns);
|
|
72
|
+
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
73
|
+
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
74
|
+
/******/ return ns;
|
|
75
|
+
/******/ };
|
|
76
|
+
/******/
|
|
77
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
78
|
+
/******/ __webpack_require__.n = function(module) {
|
|
79
|
+
/******/ var getter = module && module.__esModule ?
|
|
80
|
+
/******/ function getDefault() { return module['default']; } :
|
|
81
|
+
/******/ function getModuleExports() { return module; };
|
|
82
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
83
|
+
/******/ return getter;
|
|
84
|
+
/******/ };
|
|
85
|
+
/******/
|
|
86
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
|
87
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
88
|
+
/******/
|
|
89
|
+
/******/ // __webpack_public_path__
|
|
90
|
+
/******/ __webpack_require__.p = "";
|
|
91
|
+
/******/
|
|
92
|
+
/******/
|
|
93
|
+
/******/ // Load entry module and return exports
|
|
94
|
+
/******/ return __webpack_require__(__webpack_require__.s = "fb15");
|
|
95
|
+
/******/ })
|
|
96
|
+
/************************************************************************/
|
|
97
|
+
/******/ ({
|
|
98
|
+
|
|
99
|
+
/***/ "76cb":
|
|
100
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
101
|
+
|
|
102
|
+
// extracted by mini-css-extract-plugin
|
|
103
|
+
|
|
104
|
+
/***/ }),
|
|
105
|
+
|
|
106
|
+
/***/ "ee05":
|
|
107
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
108
|
+
|
|
109
|
+
"use strict";
|
|
110
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_50399771_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("76cb");
|
|
111
|
+
/* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_50399771_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_9_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_9_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_9_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_9_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_1_0_node_modules_vue_loader_lib_index_js_vue_loader_options_index_vue_vue_type_style_index_0_id_50399771_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
|
|
112
|
+
/* unused harmony reexport * */
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
/***/ }),
|
|
116
|
+
|
|
117
|
+
/***/ "fb15":
|
|
118
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
119
|
+
|
|
120
|
+
"use strict";
|
|
121
|
+
// ESM COMPAT FLAG
|
|
122
|
+
__webpack_require__.r(__webpack_exports__);
|
|
123
|
+
|
|
124
|
+
// EXPORTS
|
|
125
|
+
__webpack_require__.d(__webpack_exports__, "XtFormSchema", function() { return /* reexport */ xt_form_schema; });
|
|
126
|
+
|
|
127
|
+
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js
|
|
128
|
+
// This file is imported into lib/wc client bundles.
|
|
129
|
+
|
|
130
|
+
if (typeof window !== 'undefined') {
|
|
131
|
+
var currentScript = window.document.currentScript
|
|
132
|
+
if (false) { var getCurrentScript; }
|
|
133
|
+
|
|
134
|
+
var src = currentScript && currentScript.src.match(/(.+\/)[^/]+\.js(\?.*)?$/)
|
|
135
|
+
if (src) {
|
|
136
|
+
__webpack_require__.p = src[1] // eslint-disable-line
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Indicate to webpack that this file can be concatenated
|
|
141
|
+
/* harmony default export */ var setPublicPath = (null);
|
|
142
|
+
|
|
143
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"b8cd9b04-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-form-schema/index.vue?vue&type=template&id=50399771&scoped=true
|
|
144
|
+
var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:"xt-form-schema"},[(_vm.showSearchTags)?_c('div',{staticClass:"search-tags"},[_c('span',{staticClass:"tags-title"},[_vm._v("已检索:")]),_vm._l((_vm.activeSearchTags),function(tag,key){return _c('el-tag',{key:key,attrs:{"closable":"","size":"small"},on:{"close":function($event){return _vm.handleRemoveTag(key)}}},[_vm._v(" "+_vm._s(tag.label)+": "+_vm._s(tag.value)+" ")])}),(_vm.activeSearchTagsCount === 0)?_c('span',{staticClass:"no-tags"},[_vm._v("暂无检索条件")]):_vm._e()],2):_vm._e(),(_vm.mode === 'dialog')?_c('el-dialog',{staticClass:"xt-form-schema-dialog",attrs:{"title":_vm.title,"visible":_vm.visible,"width":_vm.width,"before-close":_vm.handleCancel,"append-to-body":"","modal-append-to-body":""},on:{"update:visible":function($event){_vm.visible=$event}}},[_c('el-form',{attrs:{"model":_vm.formData,"inline":false,"label-width":"120px"}},_vm._l((_vm.schema),function(field){return _c('el-form-item',{key:field.prop,attrs:{"label":field.label,"prop":field.prop}},[(!field.isSlot)?_c(_vm.getFieldComponent(field),_vm._b({tag:"component"},'component',_vm.getFieldProps(field),false)):_vm._t(field.prop,null,{"field":field})],2)}),1),_c('div',{staticClass:"dialog-footer",attrs:{"slot":"footer"},slot:"footer"},[_c('el-button',{on:{"click":_vm.handleCancel}},[_vm._v("取消")]),_c('el-button',{attrs:{"type":"primary"},on:{"click":_vm.handleConfirm}},[_vm._v("确认")])],1)],1):_vm._e(),(_vm.mode === 'drawer')?_c('el-drawer',{staticClass:"xt-form-schema-drawer",attrs:{"title":_vm.title,"visible":_vm.visible,"direction":_vm.direction,"size":_vm.width,"before-close":_vm.handleCancel,"append-to-body":"","modal-append-to-body":""},on:{"update:visible":function($event){_vm.visible=$event}}},[_c('el-form',{attrs:{"model":_vm.formData,"inline":false,"label-width":"120px"}},_vm._l((_vm.schema),function(field){return _c('el-form-item',{key:field.prop,attrs:{"label":field.label,"prop":field.prop}},[(!field.isSlot)?_c(_vm.getFieldComponent(field),_vm._b({tag:"component"},'component',_vm.getFieldProps(field),false)):_vm._t(field.prop,null,{"field":field})],2)}),1),_c('div',{staticClass:"drawer-footer"},[_c('el-button',{on:{"click":_vm.handleCancel}},[_vm._v("取消")]),_c('el-button',{attrs:{"type":"primary"},on:{"click":_vm.handleConfirm}},[_vm._v("确认")])],1)],1):_vm._e()],1)
|
|
145
|
+
}
|
|
146
|
+
var staticRenderFns = []
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
// CONCATENATED MODULE: ./src/components/xt-form-schema/index.vue?vue&type=template&id=50399771&scoped=true
|
|
150
|
+
|
|
151
|
+
// CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--1-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/xt-form-schema/index.vue?vue&type=script&lang=js
|
|
152
|
+
|
|
153
|
+
/* harmony default export */ var xt_form_schemavue_type_script_lang_js = ({
|
|
154
|
+
name: 'XtFormSchema',
|
|
155
|
+
props: {
|
|
156
|
+
visible: {
|
|
157
|
+
type: Boolean,
|
|
158
|
+
default: false
|
|
159
|
+
},
|
|
160
|
+
value: {
|
|
161
|
+
type: Object,
|
|
162
|
+
default: () => ({})
|
|
163
|
+
},
|
|
164
|
+
schema: {
|
|
165
|
+
type: Array,
|
|
166
|
+
default: () => []
|
|
167
|
+
},
|
|
168
|
+
mode: {
|
|
169
|
+
type: String,
|
|
170
|
+
default: 'dialog',
|
|
171
|
+
validator: (val) => ['dialog', 'drawer'].includes(val)
|
|
172
|
+
},
|
|
173
|
+
title: {
|
|
174
|
+
type: String,
|
|
175
|
+
default: '高级搜索'
|
|
176
|
+
},
|
|
177
|
+
width: {
|
|
178
|
+
type: [String, Number],
|
|
179
|
+
default: '500px'
|
|
180
|
+
},
|
|
181
|
+
direction: {
|
|
182
|
+
type: String,
|
|
183
|
+
default: 'rtl',
|
|
184
|
+
validator: (val) => ['ltr', 'rtl', 'ttb', 'btt'].includes(val)
|
|
185
|
+
},
|
|
186
|
+
showSearchTags: {
|
|
187
|
+
type: Boolean,
|
|
188
|
+
default: false
|
|
189
|
+
},
|
|
190
|
+
simpleFields: {
|
|
191
|
+
type: Array,
|
|
192
|
+
default: () => []
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
data() {
|
|
196
|
+
return {
|
|
197
|
+
formData: {}
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
computed: {
|
|
201
|
+
activeSearchTags() {
|
|
202
|
+
const tags = {}
|
|
203
|
+
this.schema.forEach(field => {
|
|
204
|
+
const value = this.formData[field.prop]
|
|
205
|
+
if (value !== null && value !== undefined && value !== '' && value !== []) {
|
|
206
|
+
let displayValue = value
|
|
207
|
+
if (field.type === 'select' && field.options) {
|
|
208
|
+
const option = field.options.find(opt => opt.value === value)
|
|
209
|
+
displayValue = option ? option.label : value
|
|
210
|
+
} else if (field.type === 'date' && Array.isArray(value)) {
|
|
211
|
+
displayValue = value.map(v => v ? this.formatDate(v) : '').join(' - ')
|
|
212
|
+
} else if (field.type === 'daterange' && Array.isArray(value)) {
|
|
213
|
+
displayValue = value.map(v => v ? this.formatDate(v) : '').join(' - ')
|
|
214
|
+
} else if (field.type === 'checkbox-group' && Array.isArray(value)) {
|
|
215
|
+
const labels = value.map(v => {
|
|
216
|
+
const option = (field.options || []).find(opt => opt.value === v)
|
|
217
|
+
return option ? option.label : v
|
|
218
|
+
})
|
|
219
|
+
displayValue = labels.join(', ')
|
|
220
|
+
}
|
|
221
|
+
tags[field.prop] = {
|
|
222
|
+
label: field.label,
|
|
223
|
+
value: displayValue
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
})
|
|
227
|
+
return tags
|
|
228
|
+
},
|
|
229
|
+
activeSearchTagsCount() {
|
|
230
|
+
return Object.keys(this.activeSearchTags).length
|
|
231
|
+
}
|
|
232
|
+
},
|
|
233
|
+
watch: {
|
|
234
|
+
visible: {
|
|
235
|
+
immediate: true,
|
|
236
|
+
handler(val) {
|
|
237
|
+
if (val) {
|
|
238
|
+
this.initFormData()
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
value: {
|
|
243
|
+
deep: true,
|
|
244
|
+
handler(val) {
|
|
245
|
+
if (val && this.visible) {
|
|
246
|
+
this.formData = { ...val }
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
methods: {
|
|
252
|
+
initFormData() {
|
|
253
|
+
const data = {}
|
|
254
|
+
this.schema.forEach(field => {
|
|
255
|
+
data[field.prop] = this.value[field.prop] !== undefined ? this.value[field.prop] : (field.defaultValue !== undefined ? field.defaultValue : '')
|
|
256
|
+
})
|
|
257
|
+
this.formData = data
|
|
258
|
+
},
|
|
259
|
+
getFieldComponent(field) {
|
|
260
|
+
const componentMap = {
|
|
261
|
+
input: 'el-input',
|
|
262
|
+
textarea: 'el-input',
|
|
263
|
+
select: 'el-select',
|
|
264
|
+
checkbox: 'el-checkbox',
|
|
265
|
+
'checkbox-group': 'el-checkbox-group',
|
|
266
|
+
radio: 'el-radio',
|
|
267
|
+
'radio-group': 'el-radio-group',
|
|
268
|
+
'date': 'el-date-picker',
|
|
269
|
+
daterange: 'el-date-picker',
|
|
270
|
+
datetime: 'el-date-picker',
|
|
271
|
+
'datetime-range': 'el-date-picker',
|
|
272
|
+
number: 'el-input-number',
|
|
273
|
+
switch: 'el-switch'
|
|
274
|
+
}
|
|
275
|
+
return componentMap[field.type] || 'el-input'
|
|
276
|
+
},
|
|
277
|
+
getFieldProps(field) {
|
|
278
|
+
const props = {
|
|
279
|
+
value: this.formData[field.prop],
|
|
280
|
+
placeholder: field.placeholder || `请输入${field.label}`
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
if (field.type === 'textarea') {
|
|
284
|
+
props.type = 'textarea'
|
|
285
|
+
props.rows = field.rows || 3
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
if (field.type === 'select') {
|
|
289
|
+
props.filterable = field.filterable || false
|
|
290
|
+
props.multiple = field.multiple || false
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
if (field.type === 'date') {
|
|
294
|
+
props.type = field.dateType || 'date'
|
|
295
|
+
props.format = field.format || 'yyyy-MM-dd'
|
|
296
|
+
props['value-format'] = field.valueFormat || 'yyyy-MM-dd'
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
if (field.type === 'daterange') {
|
|
300
|
+
props.type = 'daterange'
|
|
301
|
+
props.format = field.format || 'yyyy-MM-dd'
|
|
302
|
+
props['value-format'] = field.valueFormat || 'yyyy-MM-dd'
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
if (field.type === 'datetime') {
|
|
306
|
+
props.type = 'datetime'
|
|
307
|
+
props.format = field.format || 'yyyy-MM-dd HH:mm:ss'
|
|
308
|
+
props['value-format'] = field.valueFormat || 'yyyy-MM-dd HH:mm:ss'
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (field.type === 'datetime-range') {
|
|
312
|
+
props.type = 'datetimerange'
|
|
313
|
+
props.format = field.format || 'yyyy-MM-dd HH:mm:ss'
|
|
314
|
+
props['value-format'] = field.valueFormat || 'yyyy-MM-dd HH:mm:ss'
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
if (field.type === 'number') {
|
|
318
|
+
props.min = field.min
|
|
319
|
+
props.max = field.max
|
|
320
|
+
props.step = field.step || 1
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
if (field.type === 'checkbox-group' || field.type === 'radio-group') {
|
|
324
|
+
props.options = field.options || []
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
if (field.disabled !== undefined) {
|
|
328
|
+
props.disabled = field.disabled
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (field.size !== undefined) {
|
|
332
|
+
props.size = field.size
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
props['on:input'] = (val) => this.handleFieldChange(field.prop, val)
|
|
336
|
+
props['on:change'] = (val) => this.handleFieldChange(field.prop, val)
|
|
337
|
+
|
|
338
|
+
return props
|
|
339
|
+
},
|
|
340
|
+
handleFieldChange(prop, val) {
|
|
341
|
+
this.formData[prop] = val
|
|
342
|
+
this.$emit('input', { ...this.formData })
|
|
343
|
+
this.$emit('change', { prop, value: val })
|
|
344
|
+
},
|
|
345
|
+
handleRemoveTag(prop) {
|
|
346
|
+
this.formData[prop] = ''
|
|
347
|
+
this.$emit('input', { ...this.formData })
|
|
348
|
+
this.$emit('change', { prop, value: '' })
|
|
349
|
+
},
|
|
350
|
+
handleConfirm() {
|
|
351
|
+
this.$emit('confirm', { ...this.formData })
|
|
352
|
+
this.$emit('input', { ...this.formData })
|
|
353
|
+
this.$emit('update:visible', false)
|
|
354
|
+
},
|
|
355
|
+
handleCancel() {
|
|
356
|
+
this.$emit('cancel')
|
|
357
|
+
this.$emit('update:visible', false)
|
|
358
|
+
},
|
|
359
|
+
formatDate(date) {
|
|
360
|
+
if (!date) return ''
|
|
361
|
+
const d = new Date(date)
|
|
362
|
+
const year = d.getFullYear()
|
|
363
|
+
const month = String(d.getMonth() + 1).padStart(2, '0')
|
|
364
|
+
const day = String(d.getDate()).padStart(2, '0')
|
|
365
|
+
return `${year}-${month}-${day}`
|
|
366
|
+
},
|
|
367
|
+
resetFields() {
|
|
368
|
+
this.initFormData()
|
|
369
|
+
this.schema.forEach(field => {
|
|
370
|
+
this.formData[field.prop] = field.defaultValue !== undefined ? field.defaultValue : ''
|
|
371
|
+
})
|
|
372
|
+
this.$emit('input', { ...this.formData })
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
// CONCATENATED MODULE: ./src/components/xt-form-schema/index.vue?vue&type=script&lang=js
|
|
378
|
+
/* harmony default export */ var components_xt_form_schemavue_type_script_lang_js = (xt_form_schemavue_type_script_lang_js);
|
|
379
|
+
// EXTERNAL MODULE: ./src/components/xt-form-schema/index.vue?vue&type=style&index=0&id=50399771&prod&lang=scss&scoped=true
|
|
380
|
+
var xt_form_schemavue_type_style_index_0_id_50399771_prod_lang_scss_scoped_true = __webpack_require__("ee05");
|
|
381
|
+
|
|
382
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
|
|
383
|
+
/* globals __VUE_SSR_CONTEXT__ */
|
|
384
|
+
|
|
385
|
+
// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).
|
|
386
|
+
// This module is a runtime utility for cleaner component module output and will
|
|
387
|
+
// be included in the final webpack user bundle.
|
|
388
|
+
|
|
389
|
+
function normalizeComponent(
|
|
390
|
+
scriptExports,
|
|
391
|
+
render,
|
|
392
|
+
staticRenderFns,
|
|
393
|
+
functionalTemplate,
|
|
394
|
+
injectStyles,
|
|
395
|
+
scopeId,
|
|
396
|
+
moduleIdentifier /* server only */,
|
|
397
|
+
shadowMode /* vue-cli only */
|
|
398
|
+
) {
|
|
399
|
+
// Vue.extend constructor export interop
|
|
400
|
+
var options =
|
|
401
|
+
typeof scriptExports === 'function' ? scriptExports.options : scriptExports
|
|
402
|
+
|
|
403
|
+
// render functions
|
|
404
|
+
if (render) {
|
|
405
|
+
options.render = render
|
|
406
|
+
options.staticRenderFns = staticRenderFns
|
|
407
|
+
options._compiled = true
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
// functional template
|
|
411
|
+
if (functionalTemplate) {
|
|
412
|
+
options.functional = true
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
// scopedId
|
|
416
|
+
if (scopeId) {
|
|
417
|
+
options._scopeId = 'data-v-' + scopeId
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
var hook
|
|
421
|
+
if (moduleIdentifier) {
|
|
422
|
+
// server build
|
|
423
|
+
hook = function (context) {
|
|
424
|
+
// 2.3 injection
|
|
425
|
+
context =
|
|
426
|
+
context || // cached call
|
|
427
|
+
(this.$vnode && this.$vnode.ssrContext) || // stateful
|
|
428
|
+
(this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional
|
|
429
|
+
// 2.2 with runInNewContext: true
|
|
430
|
+
if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
|
|
431
|
+
context = __VUE_SSR_CONTEXT__
|
|
432
|
+
}
|
|
433
|
+
// inject component styles
|
|
434
|
+
if (injectStyles) {
|
|
435
|
+
injectStyles.call(this, context)
|
|
436
|
+
}
|
|
437
|
+
// register component module identifier for async chunk inferrence
|
|
438
|
+
if (context && context._registeredComponents) {
|
|
439
|
+
context._registeredComponents.add(moduleIdentifier)
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
// used by ssr in case component is cached and beforeCreate
|
|
443
|
+
// never gets called
|
|
444
|
+
options._ssrRegister = hook
|
|
445
|
+
} else if (injectStyles) {
|
|
446
|
+
hook = shadowMode
|
|
447
|
+
? function () {
|
|
448
|
+
injectStyles.call(
|
|
449
|
+
this,
|
|
450
|
+
(options.functional ? this.parent : this).$root.$options.shadowRoot
|
|
451
|
+
)
|
|
452
|
+
}
|
|
453
|
+
: injectStyles
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
if (hook) {
|
|
457
|
+
if (options.functional) {
|
|
458
|
+
// for template-only hot-reload because in that case the render fn doesn't
|
|
459
|
+
// go through the normalizer
|
|
460
|
+
options._injectStyles = hook
|
|
461
|
+
// register for functional component in vue file
|
|
462
|
+
var originalRender = options.render
|
|
463
|
+
options.render = function renderWithStyleInjection(h, context) {
|
|
464
|
+
hook.call(context)
|
|
465
|
+
return originalRender(h, context)
|
|
466
|
+
}
|
|
467
|
+
} else {
|
|
468
|
+
// inject component registration as beforeCreate hook
|
|
469
|
+
var existing = options.beforeCreate
|
|
470
|
+
options.beforeCreate = existing ? [].concat(existing, hook) : [hook]
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
return {
|
|
475
|
+
exports: scriptExports,
|
|
476
|
+
options: options
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
// CONCATENATED MODULE: ./src/components/xt-form-schema/index.vue
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
|
|
487
|
+
/* normalize component */
|
|
488
|
+
|
|
489
|
+
var component = normalizeComponent(
|
|
490
|
+
components_xt_form_schemavue_type_script_lang_js,
|
|
491
|
+
render,
|
|
492
|
+
staticRenderFns,
|
|
493
|
+
false,
|
|
494
|
+
null,
|
|
495
|
+
"50399771",
|
|
496
|
+
null
|
|
497
|
+
|
|
498
|
+
)
|
|
499
|
+
|
|
500
|
+
/* harmony default export */ var xt_form_schema = (component.exports);
|
|
501
|
+
// CONCATENATED MODULE: ./src/components/xt-form-schema/index.js
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
xt_form_schema.install = function (Vue) {
|
|
505
|
+
Vue.component(xt_form_schema.name, xt_form_schema)
|
|
506
|
+
}
|
|
507
|
+
|
|
508
|
+
/* harmony default export */ var components_xt_form_schema = (xt_form_schema);
|
|
509
|
+
|
|
510
|
+
// CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib.js
|
|
511
|
+
|
|
512
|
+
|
|
513
|
+
/* harmony default export */ var entry_lib = __webpack_exports__["default"] = (components_xt_form_schema);
|
|
514
|
+
|
|
515
|
+
|
|
516
|
+
|
|
517
|
+
/***/ })
|
|
518
|
+
|
|
519
|
+
/******/ });
|
|
520
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["xt-form-schema"]=t():e["xt-form-schema"]=t()})("undefined"!==typeof self?self:this,(function(){return function(e){var t={};function a(o){if(t[o])return t[o].exports;var r=t[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,a),r.l=!0,r.exports}return a.m=e,a.c=t,a.d=function(e,t,o){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},a.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(a.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(o,r,function(t){return e[t]}.bind(null,r));return o},a.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s="fb15")}({"76cb":function(e,t,a){},ee05:function(e,t,a){"use strict";a("76cb")},fb15:function(e,t,a){"use strict";if(a.r(t),a.d(t,"XtFormSchema",(function(){return c})),"undefined"!==typeof window){var o=window.document.currentScript,r=o&&o.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);r&&(a.p=r[1])}var i=function(){var e=this,t=e._self._c;return t("div",{staticClass:"xt-form-schema"},[e.showSearchTags?t("div",{staticClass:"search-tags"},[t("span",{staticClass:"tags-title"},[e._v("已检索:")]),e._l(e.activeSearchTags,(function(a,o){return t("el-tag",{key:o,attrs:{closable:"",size:"small"},on:{close:function(t){return e.handleRemoveTag(o)}}},[e._v(" "+e._s(a.label)+": "+e._s(a.value)+" ")])})),0===e.activeSearchTagsCount?t("span",{staticClass:"no-tags"},[e._v("暂无检索条件")]):e._e()],2):e._e(),"dialog"===e.mode?t("el-dialog",{staticClass:"xt-form-schema-dialog",attrs:{title:e.title,visible:e.visible,width:e.width,"before-close":e.handleCancel,"append-to-body":"","modal-append-to-body":""},on:{"update:visible":function(t){e.visible=t}}},[t("el-form",{attrs:{model:e.formData,inline:!1,"label-width":"120px"}},e._l(e.schema,(function(a){return t("el-form-item",{key:a.prop,attrs:{label:a.label,prop:a.prop}},[a.isSlot?e._t(a.prop,null,{field:a}):t(e.getFieldComponent(a),e._b({tag:"component"},"component",e.getFieldProps(a),!1))],2)})),1),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:e.handleCancel}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleConfirm}},[e._v("确认")])],1)],1):e._e(),"drawer"===e.mode?t("el-drawer",{staticClass:"xt-form-schema-drawer",attrs:{title:e.title,visible:e.visible,direction:e.direction,size:e.width,"before-close":e.handleCancel,"append-to-body":"","modal-append-to-body":""},on:{"update:visible":function(t){e.visible=t}}},[t("el-form",{attrs:{model:e.formData,inline:!1,"label-width":"120px"}},e._l(e.schema,(function(a){return t("el-form-item",{key:a.prop,attrs:{label:a.label,prop:a.prop}},[a.isSlot?e._t(a.prop,null,{field:a}):t(e.getFieldComponent(a),e._b({tag:"component"},"component",e.getFieldProps(a),!1))],2)})),1),t("div",{staticClass:"drawer-footer"},[t("el-button",{on:{click:e.handleCancel}},[e._v("取消")]),t("el-button",{attrs:{type:"primary"},on:{click:e.handleConfirm}},[e._v("确认")])],1)],1):e._e()],1)},n=[],l={name:"XtFormSchema",props:{visible:{type:Boolean,default:!1},value:{type:Object,default:()=>({})},schema:{type:Array,default:()=>[]},mode:{type:String,default:"dialog",validator:e=>["dialog","drawer"].includes(e)},title:{type:String,default:"高级搜索"},width:{type:[String,Number],default:"500px"},direction:{type:String,default:"rtl",validator:e=>["ltr","rtl","ttb","btt"].includes(e)},showSearchTags:{type:Boolean,default:!1},simpleFields:{type:Array,default:()=>[]}},data(){return{formData:{}}},computed:{activeSearchTags(){const e={};return this.schema.forEach(t=>{const a=this.formData[t.prop];if(null!==a&&void 0!==a&&""!==a&&a!==[]){let o=a;if("select"===t.type&&t.options){const e=t.options.find(e=>e.value===a);o=e?e.label:a}else if("date"===t.type&&Array.isArray(a))o=a.map(e=>e?this.formatDate(e):"").join(" - ");else if("daterange"===t.type&&Array.isArray(a))o=a.map(e=>e?this.formatDate(e):"").join(" - ");else if("checkbox-group"===t.type&&Array.isArray(a)){const e=a.map(e=>{const a=(t.options||[]).find(t=>t.value===e);return a?a.label:e});o=e.join(", ")}e[t.prop]={label:t.label,value:o}}}),e},activeSearchTagsCount(){return Object.keys(this.activeSearchTags).length}},watch:{visible:{immediate:!0,handler(e){e&&this.initFormData()}},value:{deep:!0,handler(e){e&&this.visible&&(this.formData={...e})}}},methods:{initFormData(){const e={};this.schema.forEach(t=>{e[t.prop]=void 0!==this.value[t.prop]?this.value[t.prop]:void 0!==t.defaultValue?t.defaultValue:""}),this.formData=e},getFieldComponent(e){const t={input:"el-input",textarea:"el-input",select:"el-select",checkbox:"el-checkbox","checkbox-group":"el-checkbox-group",radio:"el-radio","radio-group":"el-radio-group",date:"el-date-picker",daterange:"el-date-picker",datetime:"el-date-picker","datetime-range":"el-date-picker",number:"el-input-number",switch:"el-switch"};return t[e.type]||"el-input"},getFieldProps(e){const t={value:this.formData[e.prop],placeholder:e.placeholder||"请输入"+e.label};return"textarea"===e.type&&(t.type="textarea",t.rows=e.rows||3),"select"===e.type&&(t.filterable=e.filterable||!1,t.multiple=e.multiple||!1),"date"===e.type&&(t.type=e.dateType||"date",t.format=e.format||"yyyy-MM-dd",t["value-format"]=e.valueFormat||"yyyy-MM-dd"),"daterange"===e.type&&(t.type="daterange",t.format=e.format||"yyyy-MM-dd",t["value-format"]=e.valueFormat||"yyyy-MM-dd"),"datetime"===e.type&&(t.type="datetime",t.format=e.format||"yyyy-MM-dd HH:mm:ss",t["value-format"]=e.valueFormat||"yyyy-MM-dd HH:mm:ss"),"datetime-range"===e.type&&(t.type="datetimerange",t.format=e.format||"yyyy-MM-dd HH:mm:ss",t["value-format"]=e.valueFormat||"yyyy-MM-dd HH:mm:ss"),"number"===e.type&&(t.min=e.min,t.max=e.max,t.step=e.step||1),"checkbox-group"!==e.type&&"radio-group"!==e.type||(t.options=e.options||[]),void 0!==e.disabled&&(t.disabled=e.disabled),void 0!==e.size&&(t.size=e.size),t["on:input"]=t=>this.handleFieldChange(e.prop,t),t["on:change"]=t=>this.handleFieldChange(e.prop,t),t},handleFieldChange(e,t){this.formData[e]=t,this.$emit("input",{...this.formData}),this.$emit("change",{prop:e,value:t})},handleRemoveTag(e){this.formData[e]="",this.$emit("input",{...this.formData}),this.$emit("change",{prop:e,value:""})},handleConfirm(){this.$emit("confirm",{...this.formData}),this.$emit("input",{...this.formData}),this.$emit("update:visible",!1)},handleCancel(){this.$emit("cancel"),this.$emit("update:visible",!1)},formatDate(e){if(!e)return"";const t=new Date(e),a=t.getFullYear(),o=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0");return`${a}-${o}-${r}`},resetFields(){this.initFormData(),this.schema.forEach(e=>{this.formData[e.prop]=void 0!==e.defaultValue?e.defaultValue:""}),this.$emit("input",{...this.formData})}}},s=l;a("ee05");function d(e,t,a,o,r,i,n,l){var s,d="function"===typeof e?e.options:e;if(t&&(d.render=t,d.staticRenderFns=a,d._compiled=!0),o&&(d.functional=!0),i&&(d._scopeId="data-v-"+i),n?(s=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),r&&r.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(n)},d._ssrRegister=s):r&&(s=l?function(){r.call(this,(d.functional?this.parent:this).$root.$options.shadowRoot)}:r),s)if(d.functional){d._injectStyles=s;var p=d.render;d.render=function(e,t){return s.call(t),p(e,t)}}else{var c=d.beforeCreate;d.beforeCreate=c?[].concat(c,s):[s]}return{exports:e,options:d}}var p=d(s,i,n,!1,null,"50399771",null),c=p.exports;c.install=function(e){e.component(c.name,c)};var u=c;t["default"]=u}})}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = require('./xt-grid-box.common.js');
|