@panpanzhao/component-ui 0.0.1 → 0.0.3
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 +2882 -79
- package/lib/components/crud.js +426 -85
- package/lib/components/form-dialog.js +385 -52
- package/lib/components/form-group.js +43 -43
- package/lib/components/form-input.js +61 -49
- package/lib/components/form-item.js +8 -8
- package/lib/components/form-view-dialog.js +380 -47
- package/lib/components/form-view-group.js +37 -37
- package/lib/components/form-view.js +13 -12
- package/lib/components/form.js +19 -18
- package/lib/components/formula.js +2655 -0
- package/lib/components/table-column.js +14 -14
- package/lib/components/table-editable.js +16 -16
- package/lib/components/table-search.js +10 -10
- package/lib/components/table.js +12 -12
- package/lib/index.js +1 -1
- package/lib/styles/code-mirror.css +1 -0
- package/lib/styles/component-ui.css +6 -1
- package/lib/styles/crud.css +0 -0
- package/lib/styles/dialog.css +1 -0
- package/lib/styles/form-dialog.css +0 -0
- package/lib/styles/form-group.css +0 -0
- package/lib/styles/form-input.css +0 -0
- package/lib/styles/form-item.css +0 -0
- package/lib/styles/form-view-dialog.css +0 -0
- package/lib/styles/form-view-group.css +0 -0
- package/lib/styles/form-view.css +0 -0
- package/lib/styles/formula.css +6 -0
- package/lib/styles/index.css +6 -1
- package/lib/styles/table-column.css +0 -0
- package/lib/styles/table-search.css +0 -0
- package/lib/utils/formula/doc.js +1547 -0
- package/lib/utils/formula/evalutor.js +17 -17
- package/lib/utils/helper.js +48 -0
- package/package.json +3 -3
|
@@ -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 = 57);
|
|
86
86
|
/******/ })
|
|
87
87
|
/************************************************************************/
|
|
88
88
|
/******/ ([
|
|
@@ -101,7 +101,7 @@ module.exports = require("lodash");
|
|
|
101
101
|
/* 2 */
|
|
102
102
|
/***/ (function(module, exports) {
|
|
103
103
|
|
|
104
|
-
module.exports = require("component-ui/lib/utils/formula");
|
|
104
|
+
module.exports = require("@panpanzhao/component-ui/lib/utils/formula");
|
|
105
105
|
|
|
106
106
|
/***/ }),
|
|
107
107
|
/* 3 */
|
|
@@ -119,49 +119,49 @@ module.exports = require("element-ui/lib/button");
|
|
|
119
119
|
/* 5 */
|
|
120
120
|
/***/ (function(module, exports) {
|
|
121
121
|
|
|
122
|
-
module.exports = require("
|
|
122
|
+
module.exports = require("element-ui/lib/input");
|
|
123
123
|
|
|
124
124
|
/***/ }),
|
|
125
125
|
/* 6 */
|
|
126
126
|
/***/ (function(module, exports) {
|
|
127
127
|
|
|
128
|
-
module.exports = require("
|
|
128
|
+
module.exports = require("element-ui/lib/tabs");
|
|
129
129
|
|
|
130
130
|
/***/ }),
|
|
131
131
|
/* 7 */
|
|
132
132
|
/***/ (function(module, exports) {
|
|
133
133
|
|
|
134
|
-
module.exports = require("element-ui/lib/
|
|
134
|
+
module.exports = require("element-ui/lib/tab-pane");
|
|
135
135
|
|
|
136
136
|
/***/ }),
|
|
137
137
|
/* 8 */
|
|
138
138
|
/***/ (function(module, exports) {
|
|
139
139
|
|
|
140
|
-
module.exports = require("element-ui/lib/
|
|
140
|
+
module.exports = require("element-ui/lib/collapse");
|
|
141
141
|
|
|
142
142
|
/***/ }),
|
|
143
143
|
/* 9 */
|
|
144
144
|
/***/ (function(module, exports) {
|
|
145
145
|
|
|
146
|
-
module.exports = require("element-ui/lib/
|
|
146
|
+
module.exports = require("element-ui/lib/collapse-item");
|
|
147
147
|
|
|
148
148
|
/***/ }),
|
|
149
149
|
/* 10 */
|
|
150
150
|
/***/ (function(module, exports) {
|
|
151
151
|
|
|
152
|
-
module.exports = require("
|
|
152
|
+
module.exports = require("@panpanzhao/component-ui/lib/components/form-input");
|
|
153
153
|
|
|
154
154
|
/***/ }),
|
|
155
155
|
/* 11 */
|
|
156
156
|
/***/ (function(module, exports) {
|
|
157
157
|
|
|
158
|
-
module.exports = require("
|
|
158
|
+
module.exports = require("@panpanzhao/component-ui/lib/components/table-column");
|
|
159
159
|
|
|
160
160
|
/***/ }),
|
|
161
161
|
/* 12 */
|
|
162
162
|
/***/ (function(module, exports) {
|
|
163
163
|
|
|
164
|
-
module.exports = require("element-ui/lib/
|
|
164
|
+
module.exports = require("element-ui/lib/radio");
|
|
165
165
|
|
|
166
166
|
/***/ }),
|
|
167
167
|
/* 13 */
|
|
@@ -173,43 +173,43 @@ module.exports = require("element-ui/lib/table");
|
|
|
173
173
|
/* 14 */
|
|
174
174
|
/***/ (function(module, exports) {
|
|
175
175
|
|
|
176
|
-
module.exports = require("
|
|
176
|
+
module.exports = require("codemirror");
|
|
177
177
|
|
|
178
178
|
/***/ }),
|
|
179
179
|
/* 15 */
|
|
180
180
|
/***/ (function(module, exports) {
|
|
181
181
|
|
|
182
|
-
module.exports = require("
|
|
182
|
+
module.exports = require("dayjs");
|
|
183
183
|
|
|
184
184
|
/***/ }),
|
|
185
185
|
/* 16 */
|
|
186
186
|
/***/ (function(module, exports) {
|
|
187
187
|
|
|
188
|
-
module.exports = require("element-ui/lib/
|
|
188
|
+
module.exports = require("element-ui/lib/link");
|
|
189
189
|
|
|
190
190
|
/***/ }),
|
|
191
191
|
/* 17 */
|
|
192
192
|
/***/ (function(module, exports) {
|
|
193
193
|
|
|
194
|
-
module.exports = require("element-ui/lib/
|
|
194
|
+
module.exports = require("element-ui/lib/form");
|
|
195
195
|
|
|
196
196
|
/***/ }),
|
|
197
197
|
/* 18 */
|
|
198
198
|
/***/ (function(module, exports) {
|
|
199
199
|
|
|
200
|
-
module.exports = require("element-ui/lib/
|
|
200
|
+
module.exports = require("element-ui/lib/row");
|
|
201
201
|
|
|
202
202
|
/***/ }),
|
|
203
203
|
/* 19 */
|
|
204
204
|
/***/ (function(module, exports) {
|
|
205
205
|
|
|
206
|
-
module.exports = require("
|
|
206
|
+
module.exports = require("element-ui/lib/col");
|
|
207
207
|
|
|
208
208
|
/***/ }),
|
|
209
209
|
/* 20 */
|
|
210
210
|
/***/ (function(module, exports) {
|
|
211
211
|
|
|
212
|
-
module.exports = require("
|
|
212
|
+
module.exports = require("@panpanzhao/component-ui/lib/components/form-item");
|
|
213
213
|
|
|
214
214
|
/***/ }),
|
|
215
215
|
/* 21 */
|
|
@@ -317,83 +317,149 @@ module.exports = require("element-ui/lib/form-item");
|
|
|
317
317
|
/* 38 */
|
|
318
318
|
/***/ (function(module, exports) {
|
|
319
319
|
|
|
320
|
-
module.exports = require("element-ui/
|
|
320
|
+
module.exports = require("element-ui/src/utils/popup");
|
|
321
321
|
|
|
322
322
|
/***/ }),
|
|
323
323
|
/* 39 */
|
|
324
324
|
/***/ (function(module, exports) {
|
|
325
325
|
|
|
326
|
-
module.exports = require("element-ui/
|
|
326
|
+
module.exports = require("element-ui/src/mixins/migrating");
|
|
327
327
|
|
|
328
328
|
/***/ }),
|
|
329
329
|
/* 40 */
|
|
330
330
|
/***/ (function(module, exports) {
|
|
331
331
|
|
|
332
|
-
module.exports = require("element-ui/
|
|
332
|
+
module.exports = require("element-ui/src/mixins/emitter");
|
|
333
333
|
|
|
334
334
|
/***/ }),
|
|
335
335
|
/* 41 */
|
|
336
336
|
/***/ (function(module, exports) {
|
|
337
337
|
|
|
338
|
-
module.exports = require("element-ui/lib/
|
|
338
|
+
module.exports = require("element-ui/lib/descriptions");
|
|
339
339
|
|
|
340
340
|
/***/ }),
|
|
341
341
|
/* 42 */
|
|
342
342
|
/***/ (function(module, exports) {
|
|
343
343
|
|
|
344
|
-
module.exports = require("element-ui/lib/
|
|
344
|
+
module.exports = require("element-ui/lib/descriptions-item");
|
|
345
345
|
|
|
346
346
|
/***/ }),
|
|
347
347
|
/* 43 */
|
|
348
348
|
/***/ (function(module, exports) {
|
|
349
349
|
|
|
350
|
-
module.exports = require("element-ui/lib/
|
|
350
|
+
module.exports = require("element-ui/lib/pagination");
|
|
351
351
|
|
|
352
352
|
/***/ }),
|
|
353
353
|
/* 44 */
|
|
354
354
|
/***/ (function(module, exports) {
|
|
355
355
|
|
|
356
|
-
module.exports = require("
|
|
356
|
+
module.exports = require("element-ui/lib/dropdown");
|
|
357
357
|
|
|
358
358
|
/***/ }),
|
|
359
359
|
/* 45 */
|
|
360
360
|
/***/ (function(module, exports) {
|
|
361
361
|
|
|
362
|
-
module.exports = require("
|
|
362
|
+
module.exports = require("element-ui/lib/dropdown-item");
|
|
363
363
|
|
|
364
364
|
/***/ }),
|
|
365
365
|
/* 46 */
|
|
366
366
|
/***/ (function(module, exports) {
|
|
367
367
|
|
|
368
|
-
module.exports = require("element-ui/lib/
|
|
368
|
+
module.exports = require("element-ui/lib/dropdown-menu");
|
|
369
369
|
|
|
370
370
|
/***/ }),
|
|
371
371
|
/* 47 */
|
|
372
372
|
/***/ (function(module, exports) {
|
|
373
373
|
|
|
374
|
-
module.exports = require("
|
|
374
|
+
module.exports = require("@panpanzhao/component-ui/lib/components/form");
|
|
375
375
|
|
|
376
376
|
/***/ }),
|
|
377
377
|
/* 48 */
|
|
378
378
|
/***/ (function(module, exports) {
|
|
379
379
|
|
|
380
|
-
module.exports = require("component-ui/lib/components/table
|
|
380
|
+
module.exports = require("@panpanzhao/component-ui/lib/components/table");
|
|
381
381
|
|
|
382
382
|
/***/ }),
|
|
383
383
|
/* 49 */
|
|
384
384
|
/***/ (function(module, exports) {
|
|
385
385
|
|
|
386
|
-
module.exports = require("element-ui/lib/
|
|
386
|
+
module.exports = require("element-ui/lib/popover");
|
|
387
387
|
|
|
388
388
|
/***/ }),
|
|
389
389
|
/* 50 */
|
|
390
|
+
/***/ (function(module, exports) {
|
|
391
|
+
|
|
392
|
+
module.exports = require("async-validator");
|
|
393
|
+
|
|
394
|
+
/***/ }),
|
|
395
|
+
/* 51 */
|
|
396
|
+
/***/ (function(module, exports) {
|
|
397
|
+
|
|
398
|
+
module.exports = require("@panpanzhao/component-ui/lib/components/table-search");
|
|
399
|
+
|
|
400
|
+
/***/ }),
|
|
401
|
+
/* 52 */
|
|
402
|
+
/***/ (function(module, exports) {
|
|
403
|
+
|
|
404
|
+
module.exports = require("element-ui/lib/message-box");
|
|
405
|
+
|
|
406
|
+
/***/ }),
|
|
407
|
+
/* 53 */
|
|
408
|
+
/***/ (function(module, exports) {
|
|
409
|
+
|
|
410
|
+
module.exports = require("element-ui/lib/tree");
|
|
411
|
+
|
|
412
|
+
/***/ }),
|
|
413
|
+
/* 54 */
|
|
414
|
+
/***/ (function(module, exports) {
|
|
415
|
+
|
|
416
|
+
module.exports = require("element-ui/lib/badge");
|
|
417
|
+
|
|
418
|
+
/***/ }),
|
|
419
|
+
/* 55 */
|
|
420
|
+
/***/ (function(module, exports) {
|
|
421
|
+
|
|
422
|
+
module.exports = require("@panpanzhao/component-ui/lib/utils/helper");
|
|
423
|
+
|
|
424
|
+
/***/ }),
|
|
425
|
+
/* 56 */
|
|
426
|
+
/***/ (function(module, exports) {
|
|
427
|
+
|
|
428
|
+
module.exports = require("element-ui/lib/message");
|
|
429
|
+
|
|
430
|
+
/***/ }),
|
|
431
|
+
/* 57 */
|
|
390
432
|
/***/ (function(module, exports, __webpack_require__) {
|
|
391
433
|
|
|
392
|
-
module.exports = __webpack_require__(
|
|
434
|
+
module.exports = __webpack_require__(62);
|
|
393
435
|
|
|
394
436
|
|
|
395
437
|
/***/ }),
|
|
396
|
-
/*
|
|
438
|
+
/* 58 */
|
|
439
|
+
/***/ (function(module, exports) {
|
|
440
|
+
|
|
441
|
+
module.exports = require("codemirror/mode/javascript/javascript");
|
|
442
|
+
|
|
443
|
+
/***/ }),
|
|
444
|
+
/* 59 */
|
|
445
|
+
/***/ (function(module, exports) {
|
|
446
|
+
|
|
447
|
+
module.exports = require("codemirror/mode/htmlmixed/htmlmixed");
|
|
448
|
+
|
|
449
|
+
/***/ }),
|
|
450
|
+
/* 60 */
|
|
451
|
+
/***/ (function(module, exports) {
|
|
452
|
+
|
|
453
|
+
module.exports = require("codemirror/addon/mode/simple");
|
|
454
|
+
|
|
455
|
+
/***/ }),
|
|
456
|
+
/* 61 */
|
|
457
|
+
/***/ (function(module, exports) {
|
|
458
|
+
|
|
459
|
+
module.exports = require("codemirror/addon/mode/multiplex");
|
|
460
|
+
|
|
461
|
+
/***/ }),
|
|
462
|
+
/* 62 */
|
|
397
463
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
398
464
|
|
|
399
465
|
"use strict";
|
|
@@ -471,22 +537,22 @@ formvue_type_template_id_42f43bc0_render._withStripped = true
|
|
|
471
537
|
// CONCATENATED MODULE: ./src/components/form/src/form.vue?vue&type=template&id=42f43bc0&
|
|
472
538
|
|
|
473
539
|
// EXTERNAL MODULE: external "element-ui/lib/form"
|
|
474
|
-
var form_ = __webpack_require__(
|
|
540
|
+
var form_ = __webpack_require__(17);
|
|
475
541
|
var form_default = /*#__PURE__*/__webpack_require__.n(form_);
|
|
476
542
|
|
|
477
543
|
// EXTERNAL MODULE: external "element-ui/lib/row"
|
|
478
|
-
var row_ = __webpack_require__(
|
|
544
|
+
var row_ = __webpack_require__(18);
|
|
479
545
|
var row_default = /*#__PURE__*/__webpack_require__.n(row_);
|
|
480
546
|
|
|
481
547
|
// EXTERNAL MODULE: external "element-ui/lib/col"
|
|
482
|
-
var col_ = __webpack_require__(
|
|
548
|
+
var col_ = __webpack_require__(19);
|
|
483
549
|
var col_default = /*#__PURE__*/__webpack_require__.n(col_);
|
|
484
550
|
|
|
485
|
-
// EXTERNAL MODULE: external "component-ui/lib/components/form-item"
|
|
486
|
-
var form_item_ = __webpack_require__(
|
|
551
|
+
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/form-item"
|
|
552
|
+
var form_item_ = __webpack_require__(20);
|
|
487
553
|
var form_item_default = /*#__PURE__*/__webpack_require__.n(form_item_);
|
|
488
554
|
|
|
489
|
-
// EXTERNAL MODULE: external "component-ui/lib/utils/formula"
|
|
555
|
+
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/utils/formula"
|
|
490
556
|
var formula_ = __webpack_require__(2);
|
|
491
557
|
|
|
492
558
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/form.vue?vue&type=script&lang=js&
|
|
@@ -812,7 +878,7 @@ Inputvue_type_template_id_24c10975_render._withStripped = true
|
|
|
812
878
|
// CONCATENATED MODULE: ./src/components/form/src/item/Input.vue?vue&type=template&id=24c10975&
|
|
813
879
|
|
|
814
880
|
// EXTERNAL MODULE: external "element-ui/lib/input"
|
|
815
|
-
var input_ = __webpack_require__(
|
|
881
|
+
var input_ = __webpack_require__(5);
|
|
816
882
|
var input_default = /*#__PURE__*/__webpack_require__.n(input_);
|
|
817
883
|
|
|
818
884
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/form/src/item/Input.vue?vue&type=script&lang=js&
|
|
@@ -1486,7 +1552,7 @@ var radio_group_ = __webpack_require__(25);
|
|
|
1486
1552
|
var radio_group_default = /*#__PURE__*/__webpack_require__.n(radio_group_);
|
|
1487
1553
|
|
|
1488
1554
|
// EXTERNAL MODULE: external "element-ui/lib/radio"
|
|
1489
|
-
var radio_ = __webpack_require__(
|
|
1555
|
+
var radio_ = __webpack_require__(12);
|
|
1490
1556
|
var radio_default = /*#__PURE__*/__webpack_require__.n(radio_);
|
|
1491
1557
|
|
|
1492
1558
|
// EXTERNAL MODULE: external "element-ui/lib/radio-button"
|
|
@@ -1955,8 +2021,8 @@ form_input.install = function (Vue) {
|
|
|
1955
2021
|
var lib_form_item_ = __webpack_require__(37);
|
|
1956
2022
|
var lib_form_item_default = /*#__PURE__*/__webpack_require__.n(lib_form_item_);
|
|
1957
2023
|
|
|
1958
|
-
// EXTERNAL MODULE: external "component-ui/lib/components/form-input"
|
|
1959
|
-
var form_input_ = __webpack_require__(
|
|
2024
|
+
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/form-input"
|
|
2025
|
+
var form_input_ = __webpack_require__(10);
|
|
1960
2026
|
var form_input_default = /*#__PURE__*/__webpack_require__.n(form_input_);
|
|
1961
2027
|
|
|
1962
2028
|
// CONCATENATED MODULE: ./src/components/form/src/form-item.js
|
|
@@ -2190,19 +2256,19 @@ form_item.install = function (Vue) {
|
|
|
2190
2256
|
}
|
|
2191
2257
|
});
|
|
2192
2258
|
// EXTERNAL MODULE: external "element-ui/lib/tabs"
|
|
2193
|
-
var tabs_ = __webpack_require__(
|
|
2259
|
+
var tabs_ = __webpack_require__(6);
|
|
2194
2260
|
var tabs_default = /*#__PURE__*/__webpack_require__.n(tabs_);
|
|
2195
2261
|
|
|
2196
2262
|
// EXTERNAL MODULE: external "element-ui/lib/tab-pane"
|
|
2197
|
-
var tab_pane_ = __webpack_require__(
|
|
2263
|
+
var tab_pane_ = __webpack_require__(7);
|
|
2198
2264
|
var tab_pane_default = /*#__PURE__*/__webpack_require__.n(tab_pane_);
|
|
2199
2265
|
|
|
2200
2266
|
// EXTERNAL MODULE: external "element-ui/lib/collapse"
|
|
2201
|
-
var collapse_ = __webpack_require__(
|
|
2267
|
+
var collapse_ = __webpack_require__(8);
|
|
2202
2268
|
var collapse_default = /*#__PURE__*/__webpack_require__.n(collapse_);
|
|
2203
2269
|
|
|
2204
2270
|
// EXTERNAL MODULE: external "element-ui/lib/collapse-item"
|
|
2205
|
-
var collapse_item_ = __webpack_require__(
|
|
2271
|
+
var collapse_item_ = __webpack_require__(9);
|
|
2206
2272
|
var collapse_item_default = /*#__PURE__*/__webpack_require__.n(collapse_item_);
|
|
2207
2273
|
|
|
2208
2274
|
// CONCATENATED MODULE: ./src/components/form-group/src/index.js
|
|
@@ -2454,10 +2520,317 @@ src.install = function (Vue) {
|
|
|
2454
2520
|
Vue.component(src.name, src);
|
|
2455
2521
|
};
|
|
2456
2522
|
/* harmony default export */ var form_group = (src);
|
|
2457
|
-
//
|
|
2458
|
-
var
|
|
2459
|
-
var
|
|
2523
|
+
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--5!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dialog/src/index.vue?vue&type=template&id=f33d57c0&
|
|
2524
|
+
var srcvue_type_template_id_f33d57c0_render = function render() {
|
|
2525
|
+
var _vm = this,
|
|
2526
|
+
_c = _vm._self._c
|
|
2527
|
+
return _c(
|
|
2528
|
+
"transition",
|
|
2529
|
+
{
|
|
2530
|
+
attrs: { name: "dialog-fade" },
|
|
2531
|
+
on: { "after-enter": _vm.afterEnter, "after-leave": _vm.afterLeave },
|
|
2532
|
+
},
|
|
2533
|
+
[
|
|
2534
|
+
_c(
|
|
2535
|
+
"div",
|
|
2536
|
+
{
|
|
2537
|
+
directives: [
|
|
2538
|
+
{
|
|
2539
|
+
name: "show",
|
|
2540
|
+
rawName: "v-show",
|
|
2541
|
+
value: _vm.visible,
|
|
2542
|
+
expression: "visible",
|
|
2543
|
+
},
|
|
2544
|
+
],
|
|
2545
|
+
staticClass: "el-dialog__wrapper",
|
|
2546
|
+
on: {
|
|
2547
|
+
click: function ($event) {
|
|
2548
|
+
if ($event.target !== $event.currentTarget) return null
|
|
2549
|
+
return _vm.handleWrapperClick.apply(null, arguments)
|
|
2550
|
+
},
|
|
2551
|
+
},
|
|
2552
|
+
},
|
|
2553
|
+
[
|
|
2554
|
+
_c(
|
|
2555
|
+
"div",
|
|
2556
|
+
{
|
|
2557
|
+
key: _vm.key,
|
|
2558
|
+
ref: "dialog",
|
|
2559
|
+
class: [
|
|
2560
|
+
"el-dialog",
|
|
2561
|
+
{
|
|
2562
|
+
"is-scroll": _vm.scroll,
|
|
2563
|
+
"is-fullscreen": _vm.fullscreen,
|
|
2564
|
+
"el-dialog--center": _vm.center,
|
|
2565
|
+
},
|
|
2566
|
+
_vm.customClass,
|
|
2567
|
+
],
|
|
2568
|
+
style: _vm.style,
|
|
2569
|
+
attrs: {
|
|
2570
|
+
role: "dialog",
|
|
2571
|
+
"aria-modal": "true",
|
|
2572
|
+
"aria-label": _vm.title || "dialog",
|
|
2573
|
+
},
|
|
2574
|
+
},
|
|
2575
|
+
[
|
|
2576
|
+
_c(
|
|
2577
|
+
"div",
|
|
2578
|
+
{ staticClass: "el-dialog__header" },
|
|
2579
|
+
[
|
|
2580
|
+
_vm._t("title", function () {
|
|
2581
|
+
return [
|
|
2582
|
+
_c("span", { staticClass: "el-dialog__title" }, [
|
|
2583
|
+
_vm._v(_vm._s(_vm.title)),
|
|
2584
|
+
]),
|
|
2585
|
+
]
|
|
2586
|
+
}),
|
|
2587
|
+
_vm.showClose
|
|
2588
|
+
? _c(
|
|
2589
|
+
"button",
|
|
2590
|
+
{
|
|
2591
|
+
staticClass: "el-dialog__headerbtn",
|
|
2592
|
+
attrs: { type: "button", "aria-label": "Close" },
|
|
2593
|
+
on: { click: _vm.handleClose },
|
|
2594
|
+
},
|
|
2595
|
+
[
|
|
2596
|
+
_c("i", {
|
|
2597
|
+
staticClass:
|
|
2598
|
+
"el-dialog__close el-icon el-icon-close",
|
|
2599
|
+
}),
|
|
2600
|
+
]
|
|
2601
|
+
)
|
|
2602
|
+
: _vm._e(),
|
|
2603
|
+
],
|
|
2604
|
+
2
|
|
2605
|
+
),
|
|
2606
|
+
_vm.rendered
|
|
2607
|
+
? _c(
|
|
2608
|
+
"div",
|
|
2609
|
+
{ staticClass: "el-dialog__body" },
|
|
2610
|
+
[_vm._t("default")],
|
|
2611
|
+
2
|
|
2612
|
+
)
|
|
2613
|
+
: _vm._e(),
|
|
2614
|
+
_vm.$slots.footer
|
|
2615
|
+
? _c(
|
|
2616
|
+
"div",
|
|
2617
|
+
{ staticClass: "el-dialog__footer" },
|
|
2618
|
+
[_vm._t("footer")],
|
|
2619
|
+
2
|
|
2620
|
+
)
|
|
2621
|
+
: _vm._e(),
|
|
2622
|
+
]
|
|
2623
|
+
),
|
|
2624
|
+
]
|
|
2625
|
+
),
|
|
2626
|
+
]
|
|
2627
|
+
)
|
|
2628
|
+
}
|
|
2629
|
+
var srcvue_type_template_id_f33d57c0_staticRenderFns = []
|
|
2630
|
+
srcvue_type_template_id_f33d57c0_render._withStripped = true
|
|
2460
2631
|
|
|
2632
|
+
|
|
2633
|
+
// CONCATENATED MODULE: ./src/components/dialog/src/index.vue?vue&type=template&id=f33d57c0&
|
|
2634
|
+
|
|
2635
|
+
// EXTERNAL MODULE: external "element-ui/src/utils/popup"
|
|
2636
|
+
var popup_ = __webpack_require__(38);
|
|
2637
|
+
var popup_default = /*#__PURE__*/__webpack_require__.n(popup_);
|
|
2638
|
+
|
|
2639
|
+
// EXTERNAL MODULE: external "element-ui/src/mixins/migrating"
|
|
2640
|
+
var migrating_ = __webpack_require__(39);
|
|
2641
|
+
var migrating_default = /*#__PURE__*/__webpack_require__.n(migrating_);
|
|
2642
|
+
|
|
2643
|
+
// EXTERNAL MODULE: external "element-ui/src/mixins/emitter"
|
|
2644
|
+
var emitter_ = __webpack_require__(40);
|
|
2645
|
+
var emitter_default = /*#__PURE__*/__webpack_require__.n(emitter_);
|
|
2646
|
+
|
|
2647
|
+
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dialog/src/index.vue?vue&type=script&lang=js&
|
|
2648
|
+
|
|
2649
|
+
|
|
2650
|
+
|
|
2651
|
+
/* harmony default export */ var srcvue_type_script_lang_js_ = ({
|
|
2652
|
+
name: 'Dialog',
|
|
2653
|
+
mixins: [popup_default.a, emitter_default.a, migrating_default.a],
|
|
2654
|
+
props: {
|
|
2655
|
+
title: {
|
|
2656
|
+
type: String,
|
|
2657
|
+
default: ''
|
|
2658
|
+
},
|
|
2659
|
+
modal: {
|
|
2660
|
+
type: Boolean,
|
|
2661
|
+
default: true
|
|
2662
|
+
},
|
|
2663
|
+
scroll: {
|
|
2664
|
+
type: Boolean,
|
|
2665
|
+
default: true
|
|
2666
|
+
},
|
|
2667
|
+
modalAppendToBody: {
|
|
2668
|
+
type: Boolean,
|
|
2669
|
+
default: true
|
|
2670
|
+
},
|
|
2671
|
+
appendToBody: {
|
|
2672
|
+
type: Boolean,
|
|
2673
|
+
default: false
|
|
2674
|
+
},
|
|
2675
|
+
lockScroll: {
|
|
2676
|
+
type: Boolean,
|
|
2677
|
+
default: true
|
|
2678
|
+
},
|
|
2679
|
+
closeOnClickModal: {
|
|
2680
|
+
type: Boolean,
|
|
2681
|
+
default: true
|
|
2682
|
+
},
|
|
2683
|
+
closeOnPressEscape: {
|
|
2684
|
+
type: Boolean,
|
|
2685
|
+
default: true
|
|
2686
|
+
},
|
|
2687
|
+
showClose: {
|
|
2688
|
+
type: Boolean,
|
|
2689
|
+
default: true
|
|
2690
|
+
},
|
|
2691
|
+
width: String,
|
|
2692
|
+
fullscreen: Boolean,
|
|
2693
|
+
customClass: {
|
|
2694
|
+
type: String,
|
|
2695
|
+
default: ''
|
|
2696
|
+
},
|
|
2697
|
+
top: {
|
|
2698
|
+
type: String,
|
|
2699
|
+
default: '15vh'
|
|
2700
|
+
},
|
|
2701
|
+
beforeClose: Function,
|
|
2702
|
+
center: {
|
|
2703
|
+
type: Boolean,
|
|
2704
|
+
default: false
|
|
2705
|
+
},
|
|
2706
|
+
destroyOnClose: Boolean
|
|
2707
|
+
},
|
|
2708
|
+
data: function data() {
|
|
2709
|
+
return {
|
|
2710
|
+
closed: false,
|
|
2711
|
+
key: 0
|
|
2712
|
+
};
|
|
2713
|
+
},
|
|
2714
|
+
watch: {
|
|
2715
|
+
visible: function visible(val) {
|
|
2716
|
+
var _this = this;
|
|
2717
|
+
if (val) {
|
|
2718
|
+
this.closed = false;
|
|
2719
|
+
this.$emit('open');
|
|
2720
|
+
this.$el.addEventListener('scroll', this.updatePopper);
|
|
2721
|
+
this.$nextTick(function () {
|
|
2722
|
+
_this.$refs.dialog.scrollTop = 0;
|
|
2723
|
+
});
|
|
2724
|
+
if (this.appendToBody) {
|
|
2725
|
+
document.body.appendChild(this.$el);
|
|
2726
|
+
}
|
|
2727
|
+
} else {
|
|
2728
|
+
this.$el.removeEventListener('scroll', this.updatePopper);
|
|
2729
|
+
if (!this.closed) this.$emit('close');
|
|
2730
|
+
if (this.destroyOnClose) {
|
|
2731
|
+
this.$nextTick(function () {
|
|
2732
|
+
_this.key++;
|
|
2733
|
+
});
|
|
2734
|
+
}
|
|
2735
|
+
}
|
|
2736
|
+
}
|
|
2737
|
+
},
|
|
2738
|
+
computed: {
|
|
2739
|
+
style: function style() {
|
|
2740
|
+
var style = {};
|
|
2741
|
+
if (!this.fullscreen) {
|
|
2742
|
+
style.marginTop = this.top;
|
|
2743
|
+
if (this.width) {
|
|
2744
|
+
style.width = this.width;
|
|
2745
|
+
}
|
|
2746
|
+
if (this.scroll) {
|
|
2747
|
+
style.maxHeight = "calc(100vh - " + this.top + " * 2)";
|
|
2748
|
+
}
|
|
2749
|
+
}
|
|
2750
|
+
return style;
|
|
2751
|
+
}
|
|
2752
|
+
},
|
|
2753
|
+
methods: {
|
|
2754
|
+
getMigratingConfig: function getMigratingConfig() {
|
|
2755
|
+
return {
|
|
2756
|
+
props: {
|
|
2757
|
+
'size': 'size is removed.'
|
|
2758
|
+
}
|
|
2759
|
+
};
|
|
2760
|
+
},
|
|
2761
|
+
handleWrapperClick: function handleWrapperClick() {
|
|
2762
|
+
if (!this.closeOnClickModal) return;
|
|
2763
|
+
this.handleClose();
|
|
2764
|
+
},
|
|
2765
|
+
handleClose: function handleClose() {
|
|
2766
|
+
if (typeof this.beforeClose === 'function') {
|
|
2767
|
+
this.beforeClose(this.hide);
|
|
2768
|
+
} else {
|
|
2769
|
+
this.hide();
|
|
2770
|
+
}
|
|
2771
|
+
},
|
|
2772
|
+
hide: function hide(cancel) {
|
|
2773
|
+
if (cancel !== false) {
|
|
2774
|
+
this.$emit('update:visible', false);
|
|
2775
|
+
this.$emit('close');
|
|
2776
|
+
this.closed = true;
|
|
2777
|
+
}
|
|
2778
|
+
},
|
|
2779
|
+
updatePopper: function updatePopper() {
|
|
2780
|
+
this.broadcast('ElSelectDropdown', 'updatePopper');
|
|
2781
|
+
this.broadcast('ElDropdownMenu', 'updatePopper');
|
|
2782
|
+
},
|
|
2783
|
+
afterEnter: function afterEnter() {
|
|
2784
|
+
this.$emit('opened');
|
|
2785
|
+
},
|
|
2786
|
+
afterLeave: function afterLeave() {
|
|
2787
|
+
this.$emit('closed');
|
|
2788
|
+
}
|
|
2789
|
+
},
|
|
2790
|
+
mounted: function mounted() {
|
|
2791
|
+
if (this.visible) {
|
|
2792
|
+
this.rendered = true;
|
|
2793
|
+
this.open();
|
|
2794
|
+
if (this.appendToBody) {
|
|
2795
|
+
document.body.appendChild(this.$el);
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2798
|
+
},
|
|
2799
|
+
destroyed: function destroyed() {
|
|
2800
|
+
// if appendToBody is true, remove DOM node after destroy
|
|
2801
|
+
if (this.appendToBody && this.$el && this.$el.parentNode) {
|
|
2802
|
+
this.$el.parentNode.removeChild(this.$el);
|
|
2803
|
+
}
|
|
2804
|
+
}
|
|
2805
|
+
});
|
|
2806
|
+
// CONCATENATED MODULE: ./src/components/dialog/src/index.vue?vue&type=script&lang=js&
|
|
2807
|
+
/* harmony default export */ var dialog_srcvue_type_script_lang_js_ = (srcvue_type_script_lang_js_);
|
|
2808
|
+
// CONCATENATED MODULE: ./src/components/dialog/src/index.vue
|
|
2809
|
+
|
|
2810
|
+
|
|
2811
|
+
|
|
2812
|
+
|
|
2813
|
+
|
|
2814
|
+
/* normalize component */
|
|
2815
|
+
|
|
2816
|
+
var src_component = normalizeComponent(
|
|
2817
|
+
dialog_srcvue_type_script_lang_js_,
|
|
2818
|
+
srcvue_type_template_id_f33d57c0_render,
|
|
2819
|
+
srcvue_type_template_id_f33d57c0_staticRenderFns,
|
|
2820
|
+
false,
|
|
2821
|
+
null,
|
|
2822
|
+
null,
|
|
2823
|
+
null
|
|
2824
|
+
|
|
2825
|
+
)
|
|
2826
|
+
|
|
2827
|
+
/* harmony default export */ var dialog_src = (src_component.exports);
|
|
2828
|
+
// CONCATENATED MODULE: ./src/components/dialog/index.js
|
|
2829
|
+
|
|
2830
|
+
dialog_src.install = function (Vue) {
|
|
2831
|
+
Vue.component(dialog_src.name, dialog_src);
|
|
2832
|
+
};
|
|
2833
|
+
/* harmony default export */ var dialog = (dialog_src);
|
|
2461
2834
|
// EXTERNAL MODULE: external "element-ui/lib/button"
|
|
2462
2835
|
var button_ = __webpack_require__(4);
|
|
2463
2836
|
var button_default = /*#__PURE__*/__webpack_require__.n(button_);
|
|
@@ -2474,13 +2847,13 @@ var button_default = /*#__PURE__*/__webpack_require__.n(button_);
|
|
|
2474
2847
|
|
|
2475
2848
|
|
|
2476
2849
|
|
|
2477
|
-
/* harmony default export */ var
|
|
2850
|
+
/* harmony default export */ var form_dialog_srcvue_type_script_lang_js_ = ({
|
|
2478
2851
|
name: "FormDialog",
|
|
2479
2852
|
componentName: "FormDialog",
|
|
2480
2853
|
components: {
|
|
2481
2854
|
Form: components_form,
|
|
2482
2855
|
FormGroup: form_group,
|
|
2483
|
-
|
|
2856
|
+
Dialog: dialog,
|
|
2484
2857
|
Tool: {
|
|
2485
2858
|
components: {
|
|
2486
2859
|
elButton: button_default.a
|
|
@@ -2684,7 +3057,7 @@ var button_default = /*#__PURE__*/__webpack_require__.n(button_);
|
|
|
2684
3057
|
}
|
|
2685
3058
|
})
|
|
2686
3059
|
};
|
|
2687
|
-
return h(
|
|
3060
|
+
return h(dialog, babel_helper_vue_jsx_merge_props_default()([{}, param]), [h("template", {
|
|
2688
3061
|
"slot": "title",
|
|
2689
3062
|
"class": "dialog-title"
|
|
2690
3063
|
}, [this.renderTitle(h)]), h("template", {
|
|
@@ -2694,7 +3067,7 @@ var button_default = /*#__PURE__*/__webpack_require__.n(button_);
|
|
|
2694
3067
|
}
|
|
2695
3068
|
});
|
|
2696
3069
|
// CONCATENATED MODULE: ./src/components/form-dialog/src/index.vue?vue&type=script&lang=js&
|
|
2697
|
-
/* harmony default export */ var
|
|
3070
|
+
/* harmony default export */ var components_form_dialog_srcvue_type_script_lang_js_ = (form_dialog_srcvue_type_script_lang_js_);
|
|
2698
3071
|
// CONCATENATED MODULE: ./src/components/form-dialog/src/index.vue
|
|
2699
3072
|
var src_render, src_staticRenderFns
|
|
2700
3073
|
|
|
@@ -2703,8 +3076,8 @@ var src_render, src_staticRenderFns
|
|
|
2703
3076
|
|
|
2704
3077
|
/* normalize component */
|
|
2705
3078
|
|
|
2706
|
-
var
|
|
2707
|
-
|
|
3079
|
+
var form_dialog_src_component = normalizeComponent(
|
|
3080
|
+
components_form_dialog_srcvue_type_script_lang_js_,
|
|
2708
3081
|
src_render,
|
|
2709
3082
|
src_staticRenderFns,
|
|
2710
3083
|
false,
|
|
@@ -2714,7 +3087,7 @@ var src_component = normalizeComponent(
|
|
|
2714
3087
|
|
|
2715
3088
|
)
|
|
2716
3089
|
|
|
2717
|
-
/* harmony default export */ var form_dialog_src = (
|
|
3090
|
+
/* harmony default export */ var form_dialog_src = (form_dialog_src_component.exports);
|
|
2718
3091
|
// CONCATENATED MODULE: ./src/components/form-dialog/index.js
|
|
2719
3092
|
|
|
2720
3093
|
form_dialog_src.install = function (Vue) {
|
|
@@ -2771,11 +3144,11 @@ srcvue_type_template_id_82a59c42_render._withStripped = true
|
|
|
2771
3144
|
// CONCATENATED MODULE: ./src/components/form-view/src/index.vue?vue&type=template&id=82a59c42&
|
|
2772
3145
|
|
|
2773
3146
|
// EXTERNAL MODULE: external "element-ui/lib/descriptions"
|
|
2774
|
-
var descriptions_ = __webpack_require__(
|
|
3147
|
+
var descriptions_ = __webpack_require__(41);
|
|
2775
3148
|
var descriptions_default = /*#__PURE__*/__webpack_require__.n(descriptions_);
|
|
2776
3149
|
|
|
2777
3150
|
// EXTERNAL MODULE: external "element-ui/lib/descriptions-item"
|
|
2778
|
-
var descriptions_item_ = __webpack_require__(
|
|
3151
|
+
var descriptions_item_ = __webpack_require__(42);
|
|
2779
3152
|
var descriptions_item_default = /*#__PURE__*/__webpack_require__.n(descriptions_item_);
|
|
2780
3153
|
|
|
2781
3154
|
// 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&
|
|
@@ -3117,7 +3490,7 @@ form_view_group_src.install = function (Vue) {
|
|
|
3117
3490
|
components: {
|
|
3118
3491
|
FormView: form_view,
|
|
3119
3492
|
FormViewGroup: form_view_group,
|
|
3120
|
-
|
|
3493
|
+
Dialog: dialog,
|
|
3121
3494
|
Tool: {
|
|
3122
3495
|
components: {
|
|
3123
3496
|
elButton: button_default.a
|
|
@@ -3287,7 +3660,7 @@ form_view_group_src.install = function (Vue) {
|
|
|
3287
3660
|
}
|
|
3288
3661
|
})
|
|
3289
3662
|
};
|
|
3290
|
-
return h(
|
|
3663
|
+
return h(dialog, babel_helper_vue_jsx_merge_props_default()([{}, param]), [h("template", {
|
|
3291
3664
|
"slot": "title",
|
|
3292
3665
|
"class": "dialog-title"
|
|
3293
3666
|
}, [this.renderTitle(h)]), h("template", {
|
|
@@ -3418,11 +3791,11 @@ var table_column_ = __webpack_require__(3);
|
|
|
3418
3791
|
var table_column_default = /*#__PURE__*/__webpack_require__.n(table_column_);
|
|
3419
3792
|
|
|
3420
3793
|
// EXTERNAL MODULE: external "element-ui/lib/pagination"
|
|
3421
|
-
var pagination_ = __webpack_require__(
|
|
3794
|
+
var pagination_ = __webpack_require__(43);
|
|
3422
3795
|
var pagination_default = /*#__PURE__*/__webpack_require__.n(pagination_);
|
|
3423
3796
|
|
|
3424
|
-
// EXTERNAL MODULE: external "component-ui/lib/components/table-column"
|
|
3425
|
-
var components_table_column_ = __webpack_require__(
|
|
3797
|
+
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/table-column"
|
|
3798
|
+
var components_table_column_ = __webpack_require__(11);
|
|
3426
3799
|
var components_table_column_default = /*#__PURE__*/__webpack_require__.n(components_table_column_);
|
|
3427
3800
|
|
|
3428
3801
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table/src/table.vue?vue&type=script&lang=js&
|
|
@@ -3953,7 +4326,7 @@ datevue_type_template_id_3d682315_render._withStripped = true
|
|
|
3953
4326
|
// CONCATENATED MODULE: ./src/components/table/src/column/date.vue?vue&type=template&id=3d682315&
|
|
3954
4327
|
|
|
3955
4328
|
// EXTERNAL MODULE: external "dayjs"
|
|
3956
|
-
var external_dayjs_ = __webpack_require__(
|
|
4329
|
+
var external_dayjs_ = __webpack_require__(15);
|
|
3957
4330
|
var external_dayjs_default = /*#__PURE__*/__webpack_require__.n(external_dayjs_);
|
|
3958
4331
|
|
|
3959
4332
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table/src/column/date.vue?vue&type=script&lang=js&
|
|
@@ -4140,19 +4513,19 @@ var dict_component = normalizeComponent(
|
|
|
4140
4513
|
|
|
4141
4514
|
/* harmony default export */ var dict = (dict_component.exports);
|
|
4142
4515
|
// EXTERNAL MODULE: external "element-ui/lib/dropdown"
|
|
4143
|
-
var dropdown_ = __webpack_require__(
|
|
4516
|
+
var dropdown_ = __webpack_require__(44);
|
|
4144
4517
|
var dropdown_default = /*#__PURE__*/__webpack_require__.n(dropdown_);
|
|
4145
4518
|
|
|
4146
4519
|
// EXTERNAL MODULE: external "element-ui/lib/dropdown-item"
|
|
4147
|
-
var dropdown_item_ = __webpack_require__(
|
|
4520
|
+
var dropdown_item_ = __webpack_require__(45);
|
|
4148
4521
|
var dropdown_item_default = /*#__PURE__*/__webpack_require__.n(dropdown_item_);
|
|
4149
4522
|
|
|
4150
4523
|
// EXTERNAL MODULE: external "element-ui/lib/dropdown-menu"
|
|
4151
|
-
var dropdown_menu_ = __webpack_require__(
|
|
4524
|
+
var dropdown_menu_ = __webpack_require__(46);
|
|
4152
4525
|
var dropdown_menu_default = /*#__PURE__*/__webpack_require__.n(dropdown_menu_);
|
|
4153
4526
|
|
|
4154
4527
|
// EXTERNAL MODULE: external "element-ui/lib/link"
|
|
4155
|
-
var link_ = __webpack_require__(
|
|
4528
|
+
var link_ = __webpack_require__(16);
|
|
4156
4529
|
var link_default = /*#__PURE__*/__webpack_require__.n(link_);
|
|
4157
4530
|
|
|
4158
4531
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table/src/column/operate.vue?vue&type=script&lang=js&
|
|
@@ -4530,12 +4903,12 @@ srcvue_type_template_id_43bcdd3e_render._withStripped = true
|
|
|
4530
4903
|
|
|
4531
4904
|
// CONCATENATED MODULE: ./src/components/table-search/src/index.vue?vue&type=template&id=43bcdd3e&
|
|
4532
4905
|
|
|
4533
|
-
// EXTERNAL MODULE: external "component-ui/lib/components/form"
|
|
4534
|
-
var components_form_ = __webpack_require__(
|
|
4906
|
+
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/form"
|
|
4907
|
+
var components_form_ = __webpack_require__(47);
|
|
4535
4908
|
var components_form_default = /*#__PURE__*/__webpack_require__.n(components_form_);
|
|
4536
4909
|
|
|
4537
|
-
// EXTERNAL MODULE: external "component-ui/lib/components/table"
|
|
4538
|
-
var components_table_ = __webpack_require__(
|
|
4910
|
+
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/table"
|
|
4911
|
+
var components_table_ = __webpack_require__(48);
|
|
4539
4912
|
var components_table_default = /*#__PURE__*/__webpack_require__.n(components_table_);
|
|
4540
4913
|
|
|
4541
4914
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/table-search/src/index.vue?vue&type=script&lang=js&
|
|
@@ -4683,11 +5056,11 @@ srcvue_type_template_id_1701e242_render._withStripped = true
|
|
|
4683
5056
|
// CONCATENATED MODULE: ./src/components/table-editable/src/index.vue?vue&type=template&id=1701e242&
|
|
4684
5057
|
|
|
4685
5058
|
// EXTERNAL MODULE: external "element-ui/lib/popover"
|
|
4686
|
-
var popover_ = __webpack_require__(
|
|
5059
|
+
var popover_ = __webpack_require__(49);
|
|
4687
5060
|
var popover_default = /*#__PURE__*/__webpack_require__.n(popover_);
|
|
4688
5061
|
|
|
4689
5062
|
// EXTERNAL MODULE: external "async-validator"
|
|
4690
|
-
var external_async_validator_ = __webpack_require__(
|
|
5063
|
+
var external_async_validator_ = __webpack_require__(50);
|
|
4691
5064
|
var external_async_validator_default = /*#__PURE__*/__webpack_require__.n(external_async_validator_);
|
|
4692
5065
|
|
|
4693
5066
|
// CONCATENATED MODULE: ./src/components/table-editable/src/form-item.js
|
|
@@ -5385,12 +5758,12 @@ srcvue_type_template_id_65e4153e_render._withStripped = true
|
|
|
5385
5758
|
|
|
5386
5759
|
// CONCATENATED MODULE: ./src/components/crud/src/index.vue?vue&type=template&id=65e4153e&
|
|
5387
5760
|
|
|
5388
|
-
// EXTERNAL MODULE: external "component-ui/lib/components/table-search"
|
|
5389
|
-
var table_search_ = __webpack_require__(
|
|
5761
|
+
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/components/table-search"
|
|
5762
|
+
var table_search_ = __webpack_require__(51);
|
|
5390
5763
|
var table_search_default = /*#__PURE__*/__webpack_require__.n(table_search_);
|
|
5391
5764
|
|
|
5392
5765
|
// EXTERNAL MODULE: external "element-ui/lib/message-box"
|
|
5393
|
-
var message_box_ = __webpack_require__(
|
|
5766
|
+
var message_box_ = __webpack_require__(52);
|
|
5394
5767
|
var message_box_default = /*#__PURE__*/__webpack_require__.n(message_box_);
|
|
5395
5768
|
|
|
5396
5769
|
// CONCATENATED MODULE: ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib??vue-loader-options!./src/components/crud/src/index.vue?vue&type=script&lang=js&
|
|
@@ -5635,7 +6008,2435 @@ crud_src.install = function (Vue) {
|
|
|
5635
6008
|
Vue.component(crud_src.name, crud_src);
|
|
5636
6009
|
};
|
|
5637
6010
|
/* harmony default export */ var crud = (crud_src);
|
|
5638
|
-
//
|
|
6011
|
+
// EXTERNAL MODULE: external "codemirror"
|
|
6012
|
+
var external_codemirror_ = __webpack_require__(14);
|
|
6013
|
+
var external_codemirror_default = /*#__PURE__*/__webpack_require__.n(external_codemirror_);
|
|
6014
|
+
|
|
6015
|
+
// EXTERNAL MODULE: external "codemirror/mode/javascript/javascript"
|
|
6016
|
+
var javascript_ = __webpack_require__(58);
|
|
6017
|
+
|
|
6018
|
+
// EXTERNAL MODULE: external "codemirror/mode/htmlmixed/htmlmixed"
|
|
6019
|
+
var htmlmixed_ = __webpack_require__(59);
|
|
6020
|
+
|
|
6021
|
+
// EXTERNAL MODULE: external "codemirror/addon/mode/simple"
|
|
6022
|
+
var simple_ = __webpack_require__(60);
|
|
6023
|
+
|
|
6024
|
+
// EXTERNAL MODULE: external "codemirror/addon/mode/multiplex"
|
|
6025
|
+
var multiplex_ = __webpack_require__(61);
|
|
6026
|
+
|
|
6027
|
+
// CONCATENATED MODULE: ./src/components/formula/src/codeMirror.js
|
|
6028
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
6029
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
6030
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
6031
|
+
|
|
6032
|
+
|
|
6033
|
+
|
|
6034
|
+
|
|
6035
|
+
|
|
6036
|
+
/* harmony default export */ var codeMirror = ({
|
|
6037
|
+
name: "CodeMirror",
|
|
6038
|
+
inheritAttrs: false,
|
|
6039
|
+
components: {},
|
|
6040
|
+
props: {
|
|
6041
|
+
className: String,
|
|
6042
|
+
value: String,
|
|
6043
|
+
options: Object,
|
|
6044
|
+
editorFactory: Function,
|
|
6045
|
+
editorDidMount: Function,
|
|
6046
|
+
on: {
|
|
6047
|
+
type: Object,
|
|
6048
|
+
default: function _default() {
|
|
6049
|
+
return {};
|
|
6050
|
+
}
|
|
6051
|
+
}
|
|
6052
|
+
},
|
|
6053
|
+
watch: {
|
|
6054
|
+
value: function value(val) {
|
|
6055
|
+
this.setValue(val);
|
|
6056
|
+
}
|
|
6057
|
+
},
|
|
6058
|
+
data: function data() {
|
|
6059
|
+
return {
|
|
6060
|
+
editor: null,
|
|
6061
|
+
unmounted: false
|
|
6062
|
+
};
|
|
6063
|
+
},
|
|
6064
|
+
mounted: function mounted() {
|
|
6065
|
+
var _this = this;
|
|
6066
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
6067
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
6068
|
+
while (1) switch (_context.prev = _context.next) {
|
|
6069
|
+
case 0:
|
|
6070
|
+
if (!_this.unmounted) {
|
|
6071
|
+
_context.next = 2;
|
|
6072
|
+
break;
|
|
6073
|
+
}
|
|
6074
|
+
return _context.abrupt("return");
|
|
6075
|
+
case 2:
|
|
6076
|
+
_this.editor = _this.editorFactory && _this.editorFactory(_this.$refs.codeMirrorRef, external_codemirror_default.a, _this.options) || external_codemirror_default()(_this.$refs.codeMirrorRef, {
|
|
6077
|
+
value: _this.value || ''
|
|
6078
|
+
});
|
|
6079
|
+
_this.editorDidMount(external_codemirror_default.a, _this.editor);
|
|
6080
|
+
_this.editor.on('change', _this.handleChange);
|
|
6081
|
+
_this.editor.on('blur', _this.handleBlur);
|
|
6082
|
+
_this.editor.on('focus', _this.handleFocus);
|
|
6083
|
+
_this.$nextTick(function () {
|
|
6084
|
+
_this.editor.refresh();
|
|
6085
|
+
});
|
|
6086
|
+
case 8:
|
|
6087
|
+
case "end":
|
|
6088
|
+
return _context.stop();
|
|
6089
|
+
}
|
|
6090
|
+
}, _callee);
|
|
6091
|
+
}))();
|
|
6092
|
+
},
|
|
6093
|
+
beforeDestroy: function beforeDestroy() {
|
|
6094
|
+
this.unmounted = true;
|
|
6095
|
+
this.editor.off('change', this.handleChange);
|
|
6096
|
+
this.editor.off('blur', this.handleBlur);
|
|
6097
|
+
this.editor.off('focus', this.handleFocus);
|
|
6098
|
+
},
|
|
6099
|
+
methods: {
|
|
6100
|
+
setValue: function setValue(value) {
|
|
6101
|
+
var doc = this.editor.getDoc();
|
|
6102
|
+
if (value && value !== doc.getValue()) {
|
|
6103
|
+
var cursor = doc.getCursor();
|
|
6104
|
+
doc.setValue(value);
|
|
6105
|
+
doc.setCursor(cursor);
|
|
6106
|
+
}
|
|
6107
|
+
},
|
|
6108
|
+
handleChange: function handleChange(editor) {
|
|
6109
|
+
this.$emit("change", editor.getValue());
|
|
6110
|
+
},
|
|
6111
|
+
handleBlur: function handleBlur(editor) {
|
|
6112
|
+
this.$emit("blur", editor);
|
|
6113
|
+
},
|
|
6114
|
+
handleFocus: function handleFocus(editor) {
|
|
6115
|
+
this.$emit("focus", editor);
|
|
6116
|
+
}
|
|
6117
|
+
},
|
|
6118
|
+
render: function render(h) {
|
|
6119
|
+
return h("div", {
|
|
6120
|
+
"ref": "codeMirrorRef",
|
|
6121
|
+
"class": ["formula-codeMirror", this.className]
|
|
6122
|
+
});
|
|
6123
|
+
}
|
|
6124
|
+
});
|
|
6125
|
+
// CONCATENATED MODULE: ./src/components/formula/src/funcList.js
|
|
6126
|
+
function funcList_extends() { funcList_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 funcList_extends.apply(this, arguments); }
|
|
6127
|
+
|
|
6128
|
+
|
|
6129
|
+
|
|
6130
|
+
/* harmony default export */ var funcList = ({
|
|
6131
|
+
name: "FuncList",
|
|
6132
|
+
componentName: "FuncList",
|
|
6133
|
+
components: {
|
|
6134
|
+
elInput: input_default.a,
|
|
6135
|
+
elCollapse: collapse_default.a,
|
|
6136
|
+
elCollapseItem: collapse_item_default.a
|
|
6137
|
+
},
|
|
6138
|
+
props: {
|
|
6139
|
+
className: String,
|
|
6140
|
+
data: Array
|
|
6141
|
+
},
|
|
6142
|
+
data: function data() {
|
|
6143
|
+
return {
|
|
6144
|
+
filteredFuncs: [],
|
|
6145
|
+
activeFunc: null,
|
|
6146
|
+
searchVal: null
|
|
6147
|
+
};
|
|
6148
|
+
},
|
|
6149
|
+
created: function created() {
|
|
6150
|
+
this.filteredFuncs = this.data || [];
|
|
6151
|
+
},
|
|
6152
|
+
methods: {
|
|
6153
|
+
handleSearch: function handleSearch(val) {
|
|
6154
|
+
this.searchVal = val;
|
|
6155
|
+
var filtered = this.data.map(function (group) {
|
|
6156
|
+
return funcList_extends({}, group, {
|
|
6157
|
+
items: val ? group.items.filter(function (item) {
|
|
6158
|
+
return ~item.name.indexOf(val.toUpperCase());
|
|
6159
|
+
}) : group.items
|
|
6160
|
+
});
|
|
6161
|
+
}).filter(function (group) {
|
|
6162
|
+
return group.items.length;
|
|
6163
|
+
});
|
|
6164
|
+
console.log(filtered);
|
|
6165
|
+
this.filteredFuncs = filtered;
|
|
6166
|
+
},
|
|
6167
|
+
setActiveFunc: function setActiveFunc(item) {
|
|
6168
|
+
console.log(item);
|
|
6169
|
+
this.activeFunc = item;
|
|
6170
|
+
},
|
|
6171
|
+
onSelect: function onSelect(item) {
|
|
6172
|
+
this.$emit("select", item);
|
|
6173
|
+
}
|
|
6174
|
+
},
|
|
6175
|
+
render: function render(h) {
|
|
6176
|
+
var _this = this;
|
|
6177
|
+
var Param = {
|
|
6178
|
+
attrs: Object.assign({}, this.$attrs),
|
|
6179
|
+
on: Object.assign({}, this.$listeners),
|
|
6180
|
+
slots: this.$slots,
|
|
6181
|
+
scopedSlots: this.$scopedSlots
|
|
6182
|
+
};
|
|
6183
|
+
return h("div", {
|
|
6184
|
+
"class": ["FormulaEditor-FuncList", this.className]
|
|
6185
|
+
}, [h("div", {
|
|
6186
|
+
"class": "FormulaEditor-panel"
|
|
6187
|
+
}, [h("div", {
|
|
6188
|
+
"class": "FormulaEditor-panel-header"
|
|
6189
|
+
}, ["\u51FD\u6570"]), h("div", {
|
|
6190
|
+
"class": "FormulaEditor-panel-body"
|
|
6191
|
+
}, [h("div", {
|
|
6192
|
+
"class": "FormulaEditor-FuncList-searchBox"
|
|
6193
|
+
}, [h("el-input", {
|
|
6194
|
+
"attrs": {
|
|
6195
|
+
"value": this.searchVal,
|
|
6196
|
+
"prefix-icon": "el-icon-search",
|
|
6197
|
+
"clearable": true
|
|
6198
|
+
},
|
|
6199
|
+
"on": {
|
|
6200
|
+
"input": this.handleSearch
|
|
6201
|
+
}
|
|
6202
|
+
})]), h("div", {
|
|
6203
|
+
"class": ["FormulaEditor-FuncList-body"]
|
|
6204
|
+
}, [h("el-collapse", {
|
|
6205
|
+
"attrs": {
|
|
6206
|
+
"accordion": true
|
|
6207
|
+
}
|
|
6208
|
+
}, [this.filteredFuncs.map(function (group) {
|
|
6209
|
+
return h("el-collapse-item", {
|
|
6210
|
+
"attrs": {
|
|
6211
|
+
"name": group.groupName,
|
|
6212
|
+
"title": group.groupName
|
|
6213
|
+
}
|
|
6214
|
+
}, [group.items.map(function (item) {
|
|
6215
|
+
return h("div", {
|
|
6216
|
+
"class": ["FormulaEditor-FuncList-item", {
|
|
6217
|
+
'is-active': item.name === (_this.activeFunc && _this.activeFunc.name)
|
|
6218
|
+
}],
|
|
6219
|
+
"on": {
|
|
6220
|
+
"mouseenter": function mouseenter() {
|
|
6221
|
+
return _this.setActiveFunc(item);
|
|
6222
|
+
},
|
|
6223
|
+
"click": function click() {
|
|
6224
|
+
return _this.onSelect(item);
|
|
6225
|
+
}
|
|
6226
|
+
},
|
|
6227
|
+
"key": item.name
|
|
6228
|
+
}, [item.name]);
|
|
6229
|
+
})]);
|
|
6230
|
+
})])])])]), h("div", {
|
|
6231
|
+
"class": "FormulaEditor-panel"
|
|
6232
|
+
}, [h("div", {
|
|
6233
|
+
"class": "FormulaEditor-panel-header"
|
|
6234
|
+
}, [this.activeFunc && this.activeFunc.name || '']), h("div", {
|
|
6235
|
+
"class": "FormulaEditor-panel-body"
|
|
6236
|
+
}, [this.activeFunc ? h("div", {
|
|
6237
|
+
"class": ["FormulaEditor-FuncList-doc"]
|
|
6238
|
+
}, [h("pre", [h("code", [this.activeFunc.example])]), h("div", {
|
|
6239
|
+
"class": "FormulaEditor-FuncList-doc-desc"
|
|
6240
|
+
}, [this.activeFunc.description])]) : h("div")])])]);
|
|
6241
|
+
}
|
|
6242
|
+
});
|
|
6243
|
+
// EXTERNAL MODULE: external "element-ui/lib/tree"
|
|
6244
|
+
var tree_ = __webpack_require__(53);
|
|
6245
|
+
var tree_default = /*#__PURE__*/__webpack_require__.n(tree_);
|
|
6246
|
+
|
|
6247
|
+
// EXTERNAL MODULE: external "element-ui/lib/badge"
|
|
6248
|
+
var badge_ = __webpack_require__(54);
|
|
6249
|
+
var badge_default = /*#__PURE__*/__webpack_require__.n(badge_);
|
|
6250
|
+
|
|
6251
|
+
// EXTERNAL MODULE: external "@panpanzhao/component-ui/lib/utils/helper"
|
|
6252
|
+
var helper_ = __webpack_require__(55);
|
|
6253
|
+
|
|
6254
|
+
// CONCATENATED MODULE: ./src/components/formula/src/variableList.js
|
|
6255
|
+
|
|
6256
|
+
|
|
6257
|
+
|
|
6258
|
+
|
|
6259
|
+
|
|
6260
|
+
|
|
6261
|
+
|
|
6262
|
+
|
|
6263
|
+
/* harmony default export */ var variableList = ({
|
|
6264
|
+
name: "VariableList",
|
|
6265
|
+
componentName: "VariableList",
|
|
6266
|
+
components: {
|
|
6267
|
+
elInput: input_default.a,
|
|
6268
|
+
elTabs: tabs_default.a,
|
|
6269
|
+
elTabPane: tab_pane_default.a,
|
|
6270
|
+
elTree: tree_default.a,
|
|
6271
|
+
elBadge: badge_default.a
|
|
6272
|
+
},
|
|
6273
|
+
props: {
|
|
6274
|
+
className: String,
|
|
6275
|
+
itemClassName: String,
|
|
6276
|
+
classPrefix: {
|
|
6277
|
+
type: String,
|
|
6278
|
+
default: "FormulaEditor-VariableList"
|
|
6279
|
+
},
|
|
6280
|
+
selectMode: String,
|
|
6281
|
+
data: Array,
|
|
6282
|
+
itemRender: Function,
|
|
6283
|
+
selfVariableName: String
|
|
6284
|
+
},
|
|
6285
|
+
data: function data() {
|
|
6286
|
+
return {
|
|
6287
|
+
searchVal: null,
|
|
6288
|
+
filterVars: []
|
|
6289
|
+
};
|
|
6290
|
+
},
|
|
6291
|
+
created: function created() {
|
|
6292
|
+
this.filterVars = this.data || [];
|
|
6293
|
+
},
|
|
6294
|
+
methods: {
|
|
6295
|
+
handleSearch: function handleSearch(val) {
|
|
6296
|
+
this.searchVal = val;
|
|
6297
|
+
var filtered = Object(helper_["findTree"])(this.data, function (i) {
|
|
6298
|
+
return ~i.label.indexOf(val);
|
|
6299
|
+
});
|
|
6300
|
+
this.filterVars = !val ? this.data : filtered ? [filtered] : [];
|
|
6301
|
+
},
|
|
6302
|
+
onSelect: function onSelect(item) {
|
|
6303
|
+
this.$emit("select", item);
|
|
6304
|
+
},
|
|
6305
|
+
handleTree: function handleTree(data, node) {
|
|
6306
|
+
this.onSelect(data);
|
|
6307
|
+
},
|
|
6308
|
+
renderSearchBox: function renderSearchBox(h) {
|
|
6309
|
+
return h("div", {
|
|
6310
|
+
"class": "FormulaEditor-VariableList-searchBox"
|
|
6311
|
+
}, [h("el-input", {
|
|
6312
|
+
"attrs": {
|
|
6313
|
+
"value": this.searchVal,
|
|
6314
|
+
"prefix-icon": "el-icon-search",
|
|
6315
|
+
"clearable": true
|
|
6316
|
+
},
|
|
6317
|
+
"on": {
|
|
6318
|
+
"input": this.handleSearch
|
|
6319
|
+
}
|
|
6320
|
+
})]);
|
|
6321
|
+
},
|
|
6322
|
+
renderItem: function renderItem(h, _ref) {
|
|
6323
|
+
var node = _ref.node,
|
|
6324
|
+
data = _ref.data,
|
|
6325
|
+
store = _ref.store;
|
|
6326
|
+
if (typeof this.itemRender === 'function') {
|
|
6327
|
+
return this.itemRender.call(this, h, {
|
|
6328
|
+
node: node,
|
|
6329
|
+
data: data,
|
|
6330
|
+
store: store
|
|
6331
|
+
});
|
|
6332
|
+
}
|
|
6333
|
+
return h("span", {
|
|
6334
|
+
"class": [this.classPrefix + "-item", this.itemClassName]
|
|
6335
|
+
}, [data.label && this.selfVariableName && data.value === this.selfVariableName && h("el-badge", {
|
|
6336
|
+
"attrs": {
|
|
6337
|
+
"value": "self"
|
|
6338
|
+
}
|
|
6339
|
+
}, [h("label", [data.label])]), data.label && (!this.selfVariableName || data.value !== this.selfVariableName) && h("label", [data.label]), data.tag ? h("span", {
|
|
6340
|
+
"class": this.classPrefix + "-item-tag"
|
|
6341
|
+
}, [data.tag]) : null]);
|
|
6342
|
+
},
|
|
6343
|
+
renderTab: function renderTab(h) {
|
|
6344
|
+
var _this = this;
|
|
6345
|
+
return h("el-tabs", {
|
|
6346
|
+
"class": [this.classPrefix + "-base " + this.classPrefix + "-tabs"]
|
|
6347
|
+
}, [this.filterVars.map(function (item, index) {
|
|
6348
|
+
return h("el-tab-pane", {
|
|
6349
|
+
"class": _this.classPrefix + "-tab",
|
|
6350
|
+
"key": index,
|
|
6351
|
+
"attrs": {
|
|
6352
|
+
"label": item.label
|
|
6353
|
+
}
|
|
6354
|
+
}, [h("VariableList", babel_helper_vue_jsx_merge_props_default()([{
|
|
6355
|
+
"attrs": {
|
|
6356
|
+
"classPrefix": _this.classPrefix + "-sub-",
|
|
6357
|
+
"className": _this.classPrefix + "-sub",
|
|
6358
|
+
"selectMode": item.selectMode,
|
|
6359
|
+
"data": item.children,
|
|
6360
|
+
"selfVariableName": _this.selfVariableName
|
|
6361
|
+
}
|
|
6362
|
+
}, {
|
|
6363
|
+
"on": {
|
|
6364
|
+
select: _this.onSelect
|
|
6365
|
+
}
|
|
6366
|
+
}]))]);
|
|
6367
|
+
})]);
|
|
6368
|
+
},
|
|
6369
|
+
renderTree: function renderTree(h) {
|
|
6370
|
+
return h("div", {
|
|
6371
|
+
"class": "FormulaEditor-VariableList-body"
|
|
6372
|
+
}, [this.renderSearchBox(h), h("el-tree", babel_helper_vue_jsx_merge_props_default()([{
|
|
6373
|
+
"class": [this.classPrefix + "-base", "is-scrollable"],
|
|
6374
|
+
"attrs": {
|
|
6375
|
+
"expand-on-click-node": false,
|
|
6376
|
+
"default-expand-all": true,
|
|
6377
|
+
"data": this.filterVars,
|
|
6378
|
+
"render-content": this.renderItem
|
|
6379
|
+
}
|
|
6380
|
+
}, {
|
|
6381
|
+
"on": {
|
|
6382
|
+
"node-click": this.handleTree
|
|
6383
|
+
}
|
|
6384
|
+
}]))]);
|
|
6385
|
+
},
|
|
6386
|
+
renderOption: function renderOption(h, _ref2) {
|
|
6387
|
+
var _this2 = this;
|
|
6388
|
+
var data = _ref2.data;
|
|
6389
|
+
if (Array.isArray(data.children)) {
|
|
6390
|
+
return h("div", {
|
|
6391
|
+
"class": "GroupedSelection-group"
|
|
6392
|
+
}, [h("div", {
|
|
6393
|
+
"class": "GroupedSelection-itemLabel"
|
|
6394
|
+
}, [this.renderItem(h, {
|
|
6395
|
+
data: data
|
|
6396
|
+
})]), h("div", {
|
|
6397
|
+
"class": "GroupedSelection-items"
|
|
6398
|
+
}, [data.children && data.children.map(function (child) {
|
|
6399
|
+
return _this2.renderOption(h, {
|
|
6400
|
+
data: child
|
|
6401
|
+
});
|
|
6402
|
+
})])]);
|
|
6403
|
+
}
|
|
6404
|
+
return h("div", {
|
|
6405
|
+
"class": ["GroupedSelection-item"],
|
|
6406
|
+
"on": {
|
|
6407
|
+
"click": function click() {
|
|
6408
|
+
return _this2.onSelect(data);
|
|
6409
|
+
}
|
|
6410
|
+
}
|
|
6411
|
+
}, [h("div", {
|
|
6412
|
+
"class": "GroupedSelection-itemLabel"
|
|
6413
|
+
}, [this.renderItem(h, {
|
|
6414
|
+
data: data
|
|
6415
|
+
})])]);
|
|
6416
|
+
},
|
|
6417
|
+
renderContent: function renderContent(h) {
|
|
6418
|
+
var _this3 = this;
|
|
6419
|
+
if (this.selectMode === 'tree') {
|
|
6420
|
+
return this.renderTree(h);
|
|
6421
|
+
}
|
|
6422
|
+
return h("div", {
|
|
6423
|
+
"class": "FormulaEditor-VariableList-body"
|
|
6424
|
+
}, [this.renderSearchBox(h), h("div", {
|
|
6425
|
+
"class": ["GroupedSelection", this.classPrefix + "-base", 'is-scrollable']
|
|
6426
|
+
}, [this.filterVars.map(function (item) {
|
|
6427
|
+
return _this3.renderOption(h, {
|
|
6428
|
+
data: item
|
|
6429
|
+
});
|
|
6430
|
+
})])]);
|
|
6431
|
+
}
|
|
6432
|
+
},
|
|
6433
|
+
render: function render(h) {
|
|
6434
|
+
return h("div", {
|
|
6435
|
+
"class": ["FormulaEditor-VariableList", this.selectMode && "FormulaEditor-VariableList-" + this.selectMode, this.className]
|
|
6436
|
+
}, [this.selectMode === 'tabs' ? this.renderTab(h) : this.renderContent(h)]);
|
|
6437
|
+
}
|
|
6438
|
+
});
|
|
6439
|
+
// CONCATENATED MODULE: ./src/components/formula/src/plugin.js
|
|
6440
|
+
/**
|
|
6441
|
+
* @file 扩展 codemirror
|
|
6442
|
+
*/
|
|
6443
|
+
|
|
6444
|
+
/**
|
|
6445
|
+
* 遍历树
|
|
6446
|
+
* @param tree
|
|
6447
|
+
* @param iterator
|
|
6448
|
+
*/
|
|
6449
|
+
function eachTree(tree, iterator, level, paths) {
|
|
6450
|
+
if (level === void 0) {
|
|
6451
|
+
level = 1;
|
|
6452
|
+
}
|
|
6453
|
+
if (paths === void 0) {
|
|
6454
|
+
paths = [];
|
|
6455
|
+
}
|
|
6456
|
+
tree.map(function (item, index) {
|
|
6457
|
+
var currentPath = paths.concat(item);
|
|
6458
|
+
iterator(item, index, level, currentPath);
|
|
6459
|
+
if (item.children && item.children.splice) {
|
|
6460
|
+
eachTree(item.children, iterator, level + 1, currentPath);
|
|
6461
|
+
}
|
|
6462
|
+
});
|
|
6463
|
+
}
|
|
6464
|
+
function replaceStrByIndex(str, idx, key, replaceKey) {
|
|
6465
|
+
var from = str.slice(0, idx);
|
|
6466
|
+
var left = str.slice(idx);
|
|
6467
|
+
return from + left.replace(key, replaceKey);
|
|
6468
|
+
}
|
|
6469
|
+
function getRegExpByMode(evalMode, key) {
|
|
6470
|
+
var reg = evalMode ? "\\b" + key + "\\b" : "\\$\\{[^\\{\\}]*\\b" + key + "\\b[^\\{\\}]*\\}";
|
|
6471
|
+
return new RegExp(reg);
|
|
6472
|
+
}
|
|
6473
|
+
function plugin_editorFactory(dom, cm, props) {
|
|
6474
|
+
registerLaunguageMode(cm);
|
|
6475
|
+
return cm(dom, {
|
|
6476
|
+
value: props && props.value || '',
|
|
6477
|
+
autofocus: true,
|
|
6478
|
+
mode: props && props.evalMode ? 'text/formula' : 'text/formula-template'
|
|
6479
|
+
});
|
|
6480
|
+
}
|
|
6481
|
+
var FormulaPlugin = /*#__PURE__*/function () {
|
|
6482
|
+
function FormulaPlugin(editor, cm, getProps) {
|
|
6483
|
+
this.editor = editor;
|
|
6484
|
+
this.cm = cm;
|
|
6485
|
+
this.getProps = getProps;
|
|
6486
|
+
// editor.on('change', this.autoMarkText);
|
|
6487
|
+
this.autoMarkText();
|
|
6488
|
+
}
|
|
6489
|
+
var _proto = FormulaPlugin.prototype;
|
|
6490
|
+
_proto.autoMarkText = function autoMarkText() {
|
|
6491
|
+
var _this$getProps = this.getProps(),
|
|
6492
|
+
functions = _this$getProps.functions,
|
|
6493
|
+
variables = _this$getProps.variables,
|
|
6494
|
+
value = _this$getProps.value;
|
|
6495
|
+
if (value) {
|
|
6496
|
+
// todo functions 也需要自动替换
|
|
6497
|
+
this.autoMark(variables);
|
|
6498
|
+
this.focus(value);
|
|
6499
|
+
}
|
|
6500
|
+
}
|
|
6501
|
+
// 计算 `${`、`}` 括号的位置,如 ${a}+${b}, 结果是 [ { from: 0, to: 3 }, { from: 5, to: 8 } ]
|
|
6502
|
+
;
|
|
6503
|
+
_proto.computedBracesPosition = function computedBracesPosition(exp) {
|
|
6504
|
+
var braces = [];
|
|
6505
|
+
exp === null || exp === void 0 ? void 0 : exp.replace(/\$\{/g, function (val, offset) {
|
|
6506
|
+
if (val) {
|
|
6507
|
+
var charArr = exp.slice(offset + val.length).split('');
|
|
6508
|
+
var cache = ['${'];
|
|
6509
|
+
for (var index = 0; index < charArr.length; index++) {
|
|
6510
|
+
var char = charArr[index];
|
|
6511
|
+
if (char === '$' && charArr[index + 1] === '{') {
|
|
6512
|
+
cache.push('${');
|
|
6513
|
+
} else if (char === '}') {
|
|
6514
|
+
cache.pop();
|
|
6515
|
+
}
|
|
6516
|
+
if (cache.length === 0) {
|
|
6517
|
+
braces.push({
|
|
6518
|
+
begin: offset + 2,
|
|
6519
|
+
end: index + offset + 2
|
|
6520
|
+
});
|
|
6521
|
+
break;
|
|
6522
|
+
}
|
|
6523
|
+
}
|
|
6524
|
+
}
|
|
6525
|
+
return '';
|
|
6526
|
+
});
|
|
6527
|
+
return braces;
|
|
6528
|
+
}
|
|
6529
|
+
// 判断字符串是否在 ${} 中
|
|
6530
|
+
;
|
|
6531
|
+
_proto.checkStrIsInBraces = function checkStrIsInBraces(_ref, braces) {
|
|
6532
|
+
var from = _ref[0],
|
|
6533
|
+
to = _ref[1];
|
|
6534
|
+
var isIn = false;
|
|
6535
|
+
if (braces.length) {
|
|
6536
|
+
for (var index = 0; index < braces.length; index++) {
|
|
6537
|
+
var brace = braces[index];
|
|
6538
|
+
if (from >= brace.begin && to <= brace.end) {
|
|
6539
|
+
isIn = true;
|
|
6540
|
+
break;
|
|
6541
|
+
}
|
|
6542
|
+
}
|
|
6543
|
+
}
|
|
6544
|
+
return isIn;
|
|
6545
|
+
};
|
|
6546
|
+
_proto.insertBraces = function insertBraces(originFrom, originTo) {
|
|
6547
|
+
var str = this.editor.getValue();
|
|
6548
|
+
var braces = this.computedBracesPosition(str);
|
|
6549
|
+
if (!this.checkStrIsInBraces([originFrom.ch, originTo.ch], braces)) {
|
|
6550
|
+
this.editor.setCursor({
|
|
6551
|
+
line: originFrom.line,
|
|
6552
|
+
ch: originFrom.ch
|
|
6553
|
+
});
|
|
6554
|
+
this.editor.replaceSelection('${');
|
|
6555
|
+
this.editor.setCursor({
|
|
6556
|
+
line: originTo.line,
|
|
6557
|
+
ch: originTo.ch + 2
|
|
6558
|
+
});
|
|
6559
|
+
this.editor.replaceSelection('}');
|
|
6560
|
+
}
|
|
6561
|
+
};
|
|
6562
|
+
_proto.insertContent = function insertContent(value, type) {
|
|
6563
|
+
var from = this.editor.getCursor();
|
|
6564
|
+
var _this$getProps2 = this.getProps(),
|
|
6565
|
+
evalMode = _this$getProps2.evalMode;
|
|
6566
|
+
if (type === 'variable') {
|
|
6567
|
+
this.editor.replaceSelection(value.key);
|
|
6568
|
+
var to = this.editor.getCursor();
|
|
6569
|
+
this.markText(from, to, value.name, 'cm-field');
|
|
6570
|
+
!evalMode && this.insertBraces(from, to);
|
|
6571
|
+
} else if (type === 'func') {
|
|
6572
|
+
this.editor.replaceSelection(value + "()");
|
|
6573
|
+
var _to = this.editor.getCursor();
|
|
6574
|
+
this.markText(from, {
|
|
6575
|
+
line: _to.line,
|
|
6576
|
+
ch: _to.ch - 2
|
|
6577
|
+
}, value, 'cm-func');
|
|
6578
|
+
this.editor.setCursor({
|
|
6579
|
+
line: _to.line,
|
|
6580
|
+
ch: _to.ch - 1
|
|
6581
|
+
});
|
|
6582
|
+
if (!evalMode) {
|
|
6583
|
+
this.insertBraces(from, _to);
|
|
6584
|
+
this.editor.setCursor({
|
|
6585
|
+
line: _to.line,
|
|
6586
|
+
ch: _to.ch + 1
|
|
6587
|
+
});
|
|
6588
|
+
}
|
|
6589
|
+
} else if (typeof value === 'string') {
|
|
6590
|
+
this.editor.replaceSelection(value);
|
|
6591
|
+
}
|
|
6592
|
+
this.editor.focus();
|
|
6593
|
+
};
|
|
6594
|
+
_proto.markText = function markText(from, to, label, className) {
|
|
6595
|
+
if (className === void 0) {
|
|
6596
|
+
className = 'cm-func';
|
|
6597
|
+
}
|
|
6598
|
+
var text = document.createElement('span');
|
|
6599
|
+
text.className = className;
|
|
6600
|
+
text.innerText = label;
|
|
6601
|
+
this.editor.markText(from, to, {
|
|
6602
|
+
atomic: true,
|
|
6603
|
+
replacedWith: text
|
|
6604
|
+
});
|
|
6605
|
+
};
|
|
6606
|
+
_proto.autoMark = function autoMark(variables) {
|
|
6607
|
+
var _this = this;
|
|
6608
|
+
if (!Array.isArray(variables) || !variables.length) {
|
|
6609
|
+
return;
|
|
6610
|
+
}
|
|
6611
|
+
var varMap = {};
|
|
6612
|
+
eachTree(variables, function (item) {
|
|
6613
|
+
if (item.value) {
|
|
6614
|
+
varMap[item.value] = item.label;
|
|
6615
|
+
}
|
|
6616
|
+
});
|
|
6617
|
+
var vars = Object.keys(varMap).sort(function (a, b) {
|
|
6618
|
+
return b.length - a.length;
|
|
6619
|
+
});
|
|
6620
|
+
var editor = this.editor;
|
|
6621
|
+
var lines = editor.lineCount();
|
|
6622
|
+
var _this$getProps3 = this.getProps(),
|
|
6623
|
+
_this$getProps3$evalM = _this$getProps3.evalMode,
|
|
6624
|
+
evalMode = _this$getProps3$evalM === void 0 ? true : _this$getProps3$evalM;
|
|
6625
|
+
var _loop = function _loop(line) {
|
|
6626
|
+
var content = editor.getLine(line);
|
|
6627
|
+
// 标记方法调用
|
|
6628
|
+
content.replace(/([A-Z]+)\s*\(/g, function (_, func, pos) {
|
|
6629
|
+
_this.markText({
|
|
6630
|
+
line: line,
|
|
6631
|
+
ch: pos
|
|
6632
|
+
}, {
|
|
6633
|
+
line: line,
|
|
6634
|
+
ch: pos + func.length
|
|
6635
|
+
}, func, 'cm-func');
|
|
6636
|
+
return _;
|
|
6637
|
+
});
|
|
6638
|
+
var REPLACE_KEY = 'AMIS_FORMULA_REPLACE_KEY';
|
|
6639
|
+
// 标记变量
|
|
6640
|
+
vars.forEach(function (v) {
|
|
6641
|
+
var from = 0;
|
|
6642
|
+
var idx = -1;
|
|
6643
|
+
while (~(idx = content.indexOf(v, from))) {
|
|
6644
|
+
var encode = replaceStrByIndex(content, idx, v, REPLACE_KEY);
|
|
6645
|
+
var reg = getRegExpByMode(evalMode, REPLACE_KEY);
|
|
6646
|
+
if (reg.test(encode)) {
|
|
6647
|
+
_this.markText({
|
|
6648
|
+
line: line,
|
|
6649
|
+
ch: idx
|
|
6650
|
+
}, {
|
|
6651
|
+
line: line,
|
|
6652
|
+
ch: idx + v.length
|
|
6653
|
+
}, varMap[v], 'cm-field');
|
|
6654
|
+
}
|
|
6655
|
+
from = idx + v.length;
|
|
6656
|
+
}
|
|
6657
|
+
});
|
|
6658
|
+
};
|
|
6659
|
+
for (var line = 0; line < lines; line++) {
|
|
6660
|
+
_loop(line);
|
|
6661
|
+
}
|
|
6662
|
+
}
|
|
6663
|
+
// 焦点放在最后
|
|
6664
|
+
;
|
|
6665
|
+
_proto.focus = function focus(value) {
|
|
6666
|
+
this.editor.setCursor({
|
|
6667
|
+
line: 0,
|
|
6668
|
+
ch: (value === null || value === void 0 ? void 0 : value.length) || 0
|
|
6669
|
+
});
|
|
6670
|
+
};
|
|
6671
|
+
_proto.dispose = function dispose() {};
|
|
6672
|
+
_proto.validate = function validate() {};
|
|
6673
|
+
return FormulaPlugin;
|
|
6674
|
+
}();
|
|
6675
|
+
var modeRegisted = false;
|
|
6676
|
+
function registerLaunguageMode(cm) {
|
|
6677
|
+
if (modeRegisted) {
|
|
6678
|
+
return;
|
|
6679
|
+
}
|
|
6680
|
+
modeRegisted = true;
|
|
6681
|
+
// 对应 evalMode
|
|
6682
|
+
cm.defineMode('formula', function (config, parserConfig) {
|
|
6683
|
+
var formula = cm.getMode(config, 'javascript');
|
|
6684
|
+
if (!parserConfig || !parserConfig.base) return formula;
|
|
6685
|
+
debugger;
|
|
6686
|
+
return cm.multiplexingMode(cm.getMode(config, parserConfig.base), {
|
|
6687
|
+
open: '${',
|
|
6688
|
+
close: '}',
|
|
6689
|
+
mode: formula
|
|
6690
|
+
});
|
|
6691
|
+
});
|
|
6692
|
+
cm.defineMIME('text/formula', {
|
|
6693
|
+
name: 'formula'
|
|
6694
|
+
});
|
|
6695
|
+
cm.defineMIME('text/formula-template', {
|
|
6696
|
+
name: 'formula',
|
|
6697
|
+
base: 'htmlmixed'
|
|
6698
|
+
});
|
|
6699
|
+
}
|
|
6700
|
+
// CONCATENATED MODULE: ./src/utils/formula/doc.js
|
|
6701
|
+
/**
|
|
6702
|
+
* 公式文档 请运行 `npm run genDoc` 自动生成
|
|
6703
|
+
*/
|
|
6704
|
+
/* harmony default export */ var doc = ([{
|
|
6705
|
+
name: "IF",
|
|
6706
|
+
description: "示例:IF(A, B, C)\n\n如果满足条件A,则返回B,否则返回C,支持多层嵌套IF函数。\n\n也可以用表达式如:A ? B : C",
|
|
6707
|
+
example: "IF(condition, consequent, alternate)",
|
|
6708
|
+
params: [{
|
|
6709
|
+
type: "expression",
|
|
6710
|
+
name: "condition",
|
|
6711
|
+
description: "条件表达式."
|
|
6712
|
+
}, {
|
|
6713
|
+
type: "any",
|
|
6714
|
+
name: "consequent",
|
|
6715
|
+
description: "条件判断通过的返回结果"
|
|
6716
|
+
}, {
|
|
6717
|
+
type: "any",
|
|
6718
|
+
name: "alternate",
|
|
6719
|
+
description: "条件判断不通过的返回结果"
|
|
6720
|
+
}],
|
|
6721
|
+
returns: {
|
|
6722
|
+
type: "any",
|
|
6723
|
+
description: "根据条件返回不同的结果"
|
|
6724
|
+
},
|
|
6725
|
+
namespace: "逻辑函数"
|
|
6726
|
+
}, {
|
|
6727
|
+
name: "AND",
|
|
6728
|
+
description: "条件全部符合,返回 true,否则返回 false\n\n示例:AND(语文成绩>80, 数学成绩>80)\n\n语文成绩和数学成绩都大于 80,则返回 true,否则返回 false\n\n也可以直接用表达式如:语文成绩>80 && 数学成绩>80",
|
|
6729
|
+
example: "AND(expression1, expression2, ...expressionN)",
|
|
6730
|
+
params: [{
|
|
6731
|
+
type: "...expression",
|
|
6732
|
+
name: "conditions",
|
|
6733
|
+
description: "条件表达式."
|
|
6734
|
+
}],
|
|
6735
|
+
returns: {
|
|
6736
|
+
type: "boolean",
|
|
6737
|
+
description: null
|
|
6738
|
+
},
|
|
6739
|
+
namespace: "逻辑函数"
|
|
6740
|
+
}, {
|
|
6741
|
+
name: "OR",
|
|
6742
|
+
description: "条件任意一个满足条件,返回 true,否则返回 false\n\n示例:OR(语文成绩>80, 数学成绩>80)\n\n语文成绩和数学成绩任意一个大于 80,则返回 true,否则返回 false\n\n也可以直接用表达式如:语文成绩>80 || 数学成绩>80",
|
|
6743
|
+
example: "OR(expression1, expression2, ...expressionN)",
|
|
6744
|
+
params: [{
|
|
6745
|
+
type: "...expression",
|
|
6746
|
+
name: "conditions",
|
|
6747
|
+
description: "条件表达式."
|
|
6748
|
+
}],
|
|
6749
|
+
returns: {
|
|
6750
|
+
type: "boolean",
|
|
6751
|
+
description: null
|
|
6752
|
+
},
|
|
6753
|
+
namespace: "逻辑函数"
|
|
6754
|
+
}, {
|
|
6755
|
+
name: "XOR",
|
|
6756
|
+
description: "异或处理,多个表达式组中存在奇数个真时认为真。",
|
|
6757
|
+
example: "XOR(condition1, condition2)",
|
|
6758
|
+
params: [{
|
|
6759
|
+
type: "expression",
|
|
6760
|
+
name: "condition1",
|
|
6761
|
+
description: "条件表达式1"
|
|
6762
|
+
}, {
|
|
6763
|
+
type: "expression",
|
|
6764
|
+
name: "condition2",
|
|
6765
|
+
description: "条件表达式2"
|
|
6766
|
+
}],
|
|
6767
|
+
returns: {
|
|
6768
|
+
type: "boolean",
|
|
6769
|
+
description: null
|
|
6770
|
+
},
|
|
6771
|
+
namespace: "逻辑函数"
|
|
6772
|
+
}, {
|
|
6773
|
+
name: "IFS",
|
|
6774
|
+
description: "判断函数集合,相当于多个 else if 合并成一个。\n\n示例:IFS(语文成绩 > 80, \"优秀\", 语文成绩 > 60, \"良\", \"继续努力\")\n\n如果语文成绩大于 80,则返回优秀,否则判断大于 60 分,则返回良,否则返回继续努力。",
|
|
6775
|
+
example: "IFS(condition1, result1, condition2, result2,...conditionN, resultN)",
|
|
6776
|
+
params: [{
|
|
6777
|
+
type: "...any",
|
|
6778
|
+
name: "args",
|
|
6779
|
+
description: "条件,返回值集合"
|
|
6780
|
+
}],
|
|
6781
|
+
returns: {
|
|
6782
|
+
type: "any",
|
|
6783
|
+
description: "第一个满足条件的结果,没有命中的返回 false。"
|
|
6784
|
+
},
|
|
6785
|
+
namespace: "逻辑函数"
|
|
6786
|
+
}, {
|
|
6787
|
+
name: "ABS",
|
|
6788
|
+
description: "返回传入数字的绝对值",
|
|
6789
|
+
example: "ABS(num)",
|
|
6790
|
+
params: [{
|
|
6791
|
+
type: "number",
|
|
6792
|
+
name: "num",
|
|
6793
|
+
description: "数值"
|
|
6794
|
+
}],
|
|
6795
|
+
returns: {
|
|
6796
|
+
type: "number",
|
|
6797
|
+
description: "传入数值的绝对值"
|
|
6798
|
+
},
|
|
6799
|
+
namespace: "数学函数"
|
|
6800
|
+
}, {
|
|
6801
|
+
name: "MAX",
|
|
6802
|
+
description: "获取最大值,如果只有一个参数且是数组,则计算这个数组内的值",
|
|
6803
|
+
example: "MAX(num1, num2, ...numN)",
|
|
6804
|
+
params: [{
|
|
6805
|
+
type: "...number",
|
|
6806
|
+
name: "num",
|
|
6807
|
+
description: "数值"
|
|
6808
|
+
}],
|
|
6809
|
+
returns: {
|
|
6810
|
+
type: "number",
|
|
6811
|
+
description: "所有传入值中最大的那个"
|
|
6812
|
+
},
|
|
6813
|
+
namespace: "数学函数"
|
|
6814
|
+
}, {
|
|
6815
|
+
name: "MIN",
|
|
6816
|
+
description: "获取最小值,如果只有一个参数且是数组,则计算这个数组内的值",
|
|
6817
|
+
example: "MIN(num1, num2, ...numN)",
|
|
6818
|
+
params: [{
|
|
6819
|
+
type: "...number",
|
|
6820
|
+
name: "num",
|
|
6821
|
+
description: "数值"
|
|
6822
|
+
}],
|
|
6823
|
+
returns: {
|
|
6824
|
+
type: "number",
|
|
6825
|
+
description: "所有传入值中最小的那个"
|
|
6826
|
+
},
|
|
6827
|
+
namespace: "数学函数"
|
|
6828
|
+
}, {
|
|
6829
|
+
name: "SUM",
|
|
6830
|
+
description: "求和,如果只有一个参数且是数组,则计算这个数组内的值",
|
|
6831
|
+
example: "SUM(num1, num2, ...numN)",
|
|
6832
|
+
params: [{
|
|
6833
|
+
type: "...number",
|
|
6834
|
+
name: "num",
|
|
6835
|
+
description: "数值"
|
|
6836
|
+
}],
|
|
6837
|
+
returns: {
|
|
6838
|
+
type: "number",
|
|
6839
|
+
description: "所有传入数值的总和"
|
|
6840
|
+
},
|
|
6841
|
+
namespace: "数学函数"
|
|
6842
|
+
}, {
|
|
6843
|
+
name: "INT",
|
|
6844
|
+
description: "将数值向下取整为最接近的整数",
|
|
6845
|
+
example: "INT(num)",
|
|
6846
|
+
params: [{
|
|
6847
|
+
type: "number",
|
|
6848
|
+
name: "num",
|
|
6849
|
+
description: "数值"
|
|
6850
|
+
}],
|
|
6851
|
+
returns: {
|
|
6852
|
+
type: "number",
|
|
6853
|
+
description: "数值对应的整形"
|
|
6854
|
+
},
|
|
6855
|
+
namespace: "数学函数"
|
|
6856
|
+
}, {
|
|
6857
|
+
name: "MOD",
|
|
6858
|
+
description: "返回两数相除的余数,参数 number 是被除数,divisor 是除数",
|
|
6859
|
+
example: "MOD(num, divisor)",
|
|
6860
|
+
params: [{
|
|
6861
|
+
type: "number",
|
|
6862
|
+
name: "num",
|
|
6863
|
+
description: "被除数"
|
|
6864
|
+
}, {
|
|
6865
|
+
type: "number",
|
|
6866
|
+
name: "divisor",
|
|
6867
|
+
description: "除数"
|
|
6868
|
+
}],
|
|
6869
|
+
returns: {
|
|
6870
|
+
type: "number",
|
|
6871
|
+
description: "两数相除的余数"
|
|
6872
|
+
},
|
|
6873
|
+
namespace: "数学函数"
|
|
6874
|
+
}, {
|
|
6875
|
+
name: "PI",
|
|
6876
|
+
description: "圆周率 3.1415...",
|
|
6877
|
+
example: "PI()",
|
|
6878
|
+
params: [],
|
|
6879
|
+
returns: {
|
|
6880
|
+
type: "number",
|
|
6881
|
+
description: "圆周率数值"
|
|
6882
|
+
},
|
|
6883
|
+
namespace: "数学函数"
|
|
6884
|
+
}, {
|
|
6885
|
+
name: "ROUND",
|
|
6886
|
+
description: "将数字四舍五入到指定的位数,可以设置小数位。",
|
|
6887
|
+
example: "ROUND(num[, numDigits = 2])",
|
|
6888
|
+
params: [{
|
|
6889
|
+
type: "number",
|
|
6890
|
+
name: "num",
|
|
6891
|
+
description: "要处理的数字"
|
|
6892
|
+
}, {
|
|
6893
|
+
type: "number",
|
|
6894
|
+
name: "numDigits",
|
|
6895
|
+
description: "小数位数"
|
|
6896
|
+
}],
|
|
6897
|
+
returns: {
|
|
6898
|
+
type: "number",
|
|
6899
|
+
description: "传入数值四舍五入后的结果"
|
|
6900
|
+
},
|
|
6901
|
+
namespace: "数学函数"
|
|
6902
|
+
}, {
|
|
6903
|
+
name: "FLOOR",
|
|
6904
|
+
description: "将数字向下取整到指定的位数,可以设置小数位。",
|
|
6905
|
+
example: "FLOOR(num[, numDigits=2])",
|
|
6906
|
+
params: [{
|
|
6907
|
+
type: "number",
|
|
6908
|
+
name: "num",
|
|
6909
|
+
description: "要处理的数字"
|
|
6910
|
+
}, {
|
|
6911
|
+
type: "number",
|
|
6912
|
+
name: "numDigits",
|
|
6913
|
+
description: "小数位数"
|
|
6914
|
+
}],
|
|
6915
|
+
returns: {
|
|
6916
|
+
type: "number",
|
|
6917
|
+
description: "传入数值向下取整后的结果"
|
|
6918
|
+
},
|
|
6919
|
+
namespace: "数学函数"
|
|
6920
|
+
}, {
|
|
6921
|
+
name: "CEIL",
|
|
6922
|
+
description: "将数字向上取整到指定的位数,可以设置小数位。",
|
|
6923
|
+
example: "CEIL(num[, numDigits=2])",
|
|
6924
|
+
params: [{
|
|
6925
|
+
type: "number",
|
|
6926
|
+
name: "num",
|
|
6927
|
+
description: "要处理的数字"
|
|
6928
|
+
}, {
|
|
6929
|
+
type: "number",
|
|
6930
|
+
name: "numDigits",
|
|
6931
|
+
description: "小数位数"
|
|
6932
|
+
}],
|
|
6933
|
+
returns: {
|
|
6934
|
+
type: "number",
|
|
6935
|
+
description: "传入数值向上取整后的结果"
|
|
6936
|
+
},
|
|
6937
|
+
namespace: "数学函数"
|
|
6938
|
+
}, {
|
|
6939
|
+
name: "SQRT",
|
|
6940
|
+
description: "开平方,参数 number 为非负数",
|
|
6941
|
+
example: "SQRT(num)",
|
|
6942
|
+
params: [{
|
|
6943
|
+
type: "number",
|
|
6944
|
+
name: "num",
|
|
6945
|
+
description: "要处理的数字"
|
|
6946
|
+
}],
|
|
6947
|
+
returns: {
|
|
6948
|
+
type: "number",
|
|
6949
|
+
description: "开平方的结果"
|
|
6950
|
+
},
|
|
6951
|
+
namespace: "数学函数"
|
|
6952
|
+
}, {
|
|
6953
|
+
name: "AVG",
|
|
6954
|
+
description: "返回所有参数的平均值,如果只有一个参数且是数组,则计算这个数组内的值",
|
|
6955
|
+
example: "AVG(num1, num2, ...numN)",
|
|
6956
|
+
params: [{
|
|
6957
|
+
type: "...number",
|
|
6958
|
+
name: "num",
|
|
6959
|
+
description: "要处理的数字"
|
|
6960
|
+
}],
|
|
6961
|
+
returns: {
|
|
6962
|
+
type: "number",
|
|
6963
|
+
description: "所有数值的平均值"
|
|
6964
|
+
},
|
|
6965
|
+
namespace: "数学函数"
|
|
6966
|
+
}, {
|
|
6967
|
+
name: "DEVSQ",
|
|
6968
|
+
description: "返回数据点与数据均值点之差(数据偏差)的平方和,如果只有一个参数且是数组,则计算这个数组内的值",
|
|
6969
|
+
example: "DEVSQ(num1, num2, ...numN)",
|
|
6970
|
+
params: [{
|
|
6971
|
+
type: "...number",
|
|
6972
|
+
name: "num",
|
|
6973
|
+
description: "要处理的数字"
|
|
6974
|
+
}],
|
|
6975
|
+
returns: {
|
|
6976
|
+
type: "number",
|
|
6977
|
+
description: "所有数值的平均值"
|
|
6978
|
+
},
|
|
6979
|
+
namespace: "数学函数"
|
|
6980
|
+
}, {
|
|
6981
|
+
name: "AVEDEV",
|
|
6982
|
+
description: "数据点到其算术平均值的绝对偏差的平均值",
|
|
6983
|
+
example: "AVEDEV(num1, num2, ...numN)",
|
|
6984
|
+
params: [{
|
|
6985
|
+
type: "...number",
|
|
6986
|
+
name: "num",
|
|
6987
|
+
description: "要处理的数字"
|
|
6988
|
+
}],
|
|
6989
|
+
returns: {
|
|
6990
|
+
type: "number",
|
|
6991
|
+
description: "所有数值的平均值"
|
|
6992
|
+
},
|
|
6993
|
+
namespace: "数学函数"
|
|
6994
|
+
}, {
|
|
6995
|
+
name: "HARMEAN",
|
|
6996
|
+
description: "数据点的调和平均值,如果只有一个参数且是数组,则计算这个数组内的值",
|
|
6997
|
+
example: "HARMEAN(num1, num2, ...numN)",
|
|
6998
|
+
params: [{
|
|
6999
|
+
type: "...number",
|
|
7000
|
+
name: "num",
|
|
7001
|
+
description: "要处理的数字"
|
|
7002
|
+
}],
|
|
7003
|
+
returns: {
|
|
7004
|
+
type: "number",
|
|
7005
|
+
description: "所有数值的平均值"
|
|
7006
|
+
},
|
|
7007
|
+
namespace: "数学函数"
|
|
7008
|
+
}, {
|
|
7009
|
+
name: "LARGE",
|
|
7010
|
+
description: "数据集中第 k 个最大值",
|
|
7011
|
+
example: "LARGE(array, k)",
|
|
7012
|
+
params: [{
|
|
7013
|
+
type: "array",
|
|
7014
|
+
name: "nums",
|
|
7015
|
+
description: "要处理的数字"
|
|
7016
|
+
}, {
|
|
7017
|
+
type: "number",
|
|
7018
|
+
name: "k",
|
|
7019
|
+
description: "第几大"
|
|
7020
|
+
}],
|
|
7021
|
+
returns: {
|
|
7022
|
+
type: "number",
|
|
7023
|
+
description: "所有数值的平均值"
|
|
7024
|
+
},
|
|
7025
|
+
namespace: "数学函数"
|
|
7026
|
+
}, {
|
|
7027
|
+
name: "UPPERMONEY",
|
|
7028
|
+
description: "将数值转为中文大写金额",
|
|
7029
|
+
example: "UPPERMONEY(num)",
|
|
7030
|
+
params: [{
|
|
7031
|
+
type: "number",
|
|
7032
|
+
name: "num",
|
|
7033
|
+
description: "要处理的数字"
|
|
7034
|
+
}],
|
|
7035
|
+
returns: {
|
|
7036
|
+
type: "string",
|
|
7037
|
+
description: "数值中文大写字符"
|
|
7038
|
+
},
|
|
7039
|
+
namespace: "数学函数"
|
|
7040
|
+
}, {
|
|
7041
|
+
name: "RAND",
|
|
7042
|
+
description: "返回大于等于 0 且小于 1 的均匀分布随机实数。每一次触发计算都会变化。\n\n示例:`RAND()*100`\n\n返回 0-100 之间的随机数",
|
|
7043
|
+
example: "RAND()",
|
|
7044
|
+
params: [],
|
|
7045
|
+
returns: {
|
|
7046
|
+
type: "number",
|
|
7047
|
+
description: "随机数"
|
|
7048
|
+
},
|
|
7049
|
+
namespace: "数学函数"
|
|
7050
|
+
}, {
|
|
7051
|
+
name: "LAST",
|
|
7052
|
+
description: "取数据最后一个",
|
|
7053
|
+
example: "LAST(array)",
|
|
7054
|
+
params: [{
|
|
7055
|
+
type: "...number",
|
|
7056
|
+
name: "arr",
|
|
7057
|
+
description: "要处理的数组"
|
|
7058
|
+
}],
|
|
7059
|
+
returns: {
|
|
7060
|
+
type: "any",
|
|
7061
|
+
description: "最后一个值"
|
|
7062
|
+
},
|
|
7063
|
+
namespace: "数学函数"
|
|
7064
|
+
}, {
|
|
7065
|
+
name: "LEFT",
|
|
7066
|
+
description: "返回传入文本左侧的指定长度字符串。",
|
|
7067
|
+
example: "LEFT(text, len)",
|
|
7068
|
+
params: [{
|
|
7069
|
+
type: "string",
|
|
7070
|
+
name: "text",
|
|
7071
|
+
description: "要处理的文本"
|
|
7072
|
+
}, {
|
|
7073
|
+
type: "number",
|
|
7074
|
+
name: "len",
|
|
7075
|
+
description: "要处理的长度"
|
|
7076
|
+
}],
|
|
7077
|
+
returns: {
|
|
7078
|
+
type: "string",
|
|
7079
|
+
description: "对应字符串"
|
|
7080
|
+
},
|
|
7081
|
+
namespace: "文本函数"
|
|
7082
|
+
}, {
|
|
7083
|
+
name: "RIGHT",
|
|
7084
|
+
description: "返回传入文本右侧的指定长度字符串。",
|
|
7085
|
+
example: "RIGHT(text, len)",
|
|
7086
|
+
params: [{
|
|
7087
|
+
type: "string",
|
|
7088
|
+
name: "text",
|
|
7089
|
+
description: "要处理的文本"
|
|
7090
|
+
}, {
|
|
7091
|
+
type: "number",
|
|
7092
|
+
name: "len",
|
|
7093
|
+
description: "要处理的长度"
|
|
7094
|
+
}],
|
|
7095
|
+
returns: {
|
|
7096
|
+
type: "string",
|
|
7097
|
+
description: "对应字符串"
|
|
7098
|
+
},
|
|
7099
|
+
namespace: "文本函数"
|
|
7100
|
+
}, {
|
|
7101
|
+
name: "LEN",
|
|
7102
|
+
description: "计算文本的长度",
|
|
7103
|
+
example: "LEN(text)",
|
|
7104
|
+
params: [{
|
|
7105
|
+
type: "string",
|
|
7106
|
+
name: "text",
|
|
7107
|
+
description: "要处理的文本"
|
|
7108
|
+
}],
|
|
7109
|
+
returns: {
|
|
7110
|
+
type: "number",
|
|
7111
|
+
description: "长度"
|
|
7112
|
+
},
|
|
7113
|
+
namespace: "文本函数"
|
|
7114
|
+
}, {
|
|
7115
|
+
name: "LENGTH",
|
|
7116
|
+
description: "计算文本集合中所有文本的长度",
|
|
7117
|
+
example: "LENGTH(textArr)",
|
|
7118
|
+
params: [{
|
|
7119
|
+
type: "Array<string>",
|
|
7120
|
+
name: "textArr",
|
|
7121
|
+
description: "要处理的文本集合"
|
|
7122
|
+
}],
|
|
7123
|
+
returns: {
|
|
7124
|
+
type: "Array<number>",
|
|
7125
|
+
description: "长度集合"
|
|
7126
|
+
},
|
|
7127
|
+
namespace: "文本函数"
|
|
7128
|
+
}, {
|
|
7129
|
+
name: "ISEMPTY",
|
|
7130
|
+
description: "判断文本是否为空",
|
|
7131
|
+
example: "ISEMPTY(text)",
|
|
7132
|
+
params: [{
|
|
7133
|
+
type: "string",
|
|
7134
|
+
name: "text",
|
|
7135
|
+
description: "要处理的文本"
|
|
7136
|
+
}],
|
|
7137
|
+
returns: {
|
|
7138
|
+
type: "boolean",
|
|
7139
|
+
description: "判断结果"
|
|
7140
|
+
},
|
|
7141
|
+
namespace: "文本函数"
|
|
7142
|
+
}, {
|
|
7143
|
+
name: "CONCATENATE",
|
|
7144
|
+
description: "将多个传入值连接成文本",
|
|
7145
|
+
example: "CONCATENATE(text1, text2, ...textN)",
|
|
7146
|
+
params: [{
|
|
7147
|
+
type: "...string",
|
|
7148
|
+
name: "text",
|
|
7149
|
+
description: "文本集合"
|
|
7150
|
+
}],
|
|
7151
|
+
returns: {
|
|
7152
|
+
type: "string",
|
|
7153
|
+
description: "连接后的文本"
|
|
7154
|
+
},
|
|
7155
|
+
namespace: "文本函数"
|
|
7156
|
+
}, {
|
|
7157
|
+
name: "CHAR",
|
|
7158
|
+
description: "返回计算机字符集的数字代码所对应的字符。\n\n`CHAR(97)` 等价于 \"a\"",
|
|
7159
|
+
example: "CHAR(code)",
|
|
7160
|
+
params: [{
|
|
7161
|
+
type: "number",
|
|
7162
|
+
name: "code",
|
|
7163
|
+
description: "编码值"
|
|
7164
|
+
}],
|
|
7165
|
+
returns: {
|
|
7166
|
+
type: "string",
|
|
7167
|
+
description: "指定位置的字符"
|
|
7168
|
+
},
|
|
7169
|
+
namespace: "文本函数"
|
|
7170
|
+
}, {
|
|
7171
|
+
name: "LOWER",
|
|
7172
|
+
description: "将传入文本转成小写",
|
|
7173
|
+
example: "LOWER(text)",
|
|
7174
|
+
params: [{
|
|
7175
|
+
type: "string",
|
|
7176
|
+
name: "text",
|
|
7177
|
+
description: "文本"
|
|
7178
|
+
}],
|
|
7179
|
+
returns: {
|
|
7180
|
+
type: "string",
|
|
7181
|
+
description: "结果文本"
|
|
7182
|
+
},
|
|
7183
|
+
namespace: "文本函数"
|
|
7184
|
+
}, {
|
|
7185
|
+
name: "UPPER",
|
|
7186
|
+
description: "将传入文本转成大写",
|
|
7187
|
+
example: "UPPER(text)",
|
|
7188
|
+
params: [{
|
|
7189
|
+
type: "string",
|
|
7190
|
+
name: "text",
|
|
7191
|
+
description: "文本"
|
|
7192
|
+
}],
|
|
7193
|
+
returns: {
|
|
7194
|
+
type: "string",
|
|
7195
|
+
description: "结果文本"
|
|
7196
|
+
},
|
|
7197
|
+
namespace: "文本函数"
|
|
7198
|
+
}, {
|
|
7199
|
+
name: "UPPERFIRST",
|
|
7200
|
+
description: "将传入文本首字母转成大写",
|
|
7201
|
+
example: "UPPERFIRST(text)",
|
|
7202
|
+
params: [{
|
|
7203
|
+
type: "string",
|
|
7204
|
+
name: "text",
|
|
7205
|
+
description: "文本"
|
|
7206
|
+
}],
|
|
7207
|
+
returns: {
|
|
7208
|
+
type: "string",
|
|
7209
|
+
description: "结果文本"
|
|
7210
|
+
},
|
|
7211
|
+
namespace: "文本函数"
|
|
7212
|
+
}, {
|
|
7213
|
+
name: "PADSTART",
|
|
7214
|
+
description: "向前补齐文本长度\n\n示例 `PADSTART(\"6\", 2, \"0\")`\n\n返回 `06`",
|
|
7215
|
+
example: "PADSTART(text)",
|
|
7216
|
+
params: [{
|
|
7217
|
+
type: "string",
|
|
7218
|
+
name: "text",
|
|
7219
|
+
description: "文本"
|
|
7220
|
+
}, {
|
|
7221
|
+
type: "number",
|
|
7222
|
+
name: "num",
|
|
7223
|
+
description: "目标长度"
|
|
7224
|
+
}, {
|
|
7225
|
+
type: "string",
|
|
7226
|
+
name: "pad",
|
|
7227
|
+
description: "用于补齐的文本"
|
|
7228
|
+
}],
|
|
7229
|
+
returns: {
|
|
7230
|
+
type: "string",
|
|
7231
|
+
description: "结果文本"
|
|
7232
|
+
},
|
|
7233
|
+
namespace: "文本函数"
|
|
7234
|
+
}, {
|
|
7235
|
+
name: "CAPITALIZE",
|
|
7236
|
+
description: "将文本转成标题\n\n示例 `CAPITALIZE(\"star\")`\n\n返回 `Star`",
|
|
7237
|
+
example: "CAPITALIZE(text)",
|
|
7238
|
+
params: [{
|
|
7239
|
+
type: "string",
|
|
7240
|
+
name: "text",
|
|
7241
|
+
description: "文本"
|
|
7242
|
+
}],
|
|
7243
|
+
returns: {
|
|
7244
|
+
type: "string",
|
|
7245
|
+
description: "结果文本"
|
|
7246
|
+
},
|
|
7247
|
+
namespace: "文本函数"
|
|
7248
|
+
}, {
|
|
7249
|
+
name: "ESCAPE",
|
|
7250
|
+
description: "对文本进行 HTML 转义\n\n示例 `ESCAPE(\"<star>&\")`\n\n返回 `<start>&`",
|
|
7251
|
+
example: "ESCAPE(text)",
|
|
7252
|
+
params: [{
|
|
7253
|
+
type: "string",
|
|
7254
|
+
name: "text",
|
|
7255
|
+
description: "文本"
|
|
7256
|
+
}],
|
|
7257
|
+
returns: {
|
|
7258
|
+
type: "string",
|
|
7259
|
+
description: "结果文本"
|
|
7260
|
+
},
|
|
7261
|
+
namespace: "文本函数"
|
|
7262
|
+
}, {
|
|
7263
|
+
name: "TRUNCATE",
|
|
7264
|
+
description: "对文本长度进行截断\n\n示例 `TRUNCATE(\"amis.baidu.com\", 6)`\n\n返回 `amis...`",
|
|
7265
|
+
example: "TRUNCATE(text, 6)",
|
|
7266
|
+
params: [{
|
|
7267
|
+
type: "string",
|
|
7268
|
+
name: "text",
|
|
7269
|
+
description: "文本"
|
|
7270
|
+
}, {
|
|
7271
|
+
type: "number",
|
|
7272
|
+
name: "text",
|
|
7273
|
+
description: "最长长度"
|
|
7274
|
+
}],
|
|
7275
|
+
returns: {
|
|
7276
|
+
type: "string",
|
|
7277
|
+
description: "结果文本"
|
|
7278
|
+
},
|
|
7279
|
+
namespace: "文本函数"
|
|
7280
|
+
}, {
|
|
7281
|
+
name: "BEFORELAST",
|
|
7282
|
+
description: "取在某个分隔符之前的所有字符串",
|
|
7283
|
+
example: "BEFORELAST(text, '.')",
|
|
7284
|
+
params: [{
|
|
7285
|
+
type: "string",
|
|
7286
|
+
name: "text",
|
|
7287
|
+
description: "文本"
|
|
7288
|
+
}, {
|
|
7289
|
+
type: "string",
|
|
7290
|
+
name: "delimiter",
|
|
7291
|
+
description: "结束文本"
|
|
7292
|
+
}],
|
|
7293
|
+
returns: {
|
|
7294
|
+
type: "string",
|
|
7295
|
+
description: "判断结果"
|
|
7296
|
+
},
|
|
7297
|
+
namespace: "文本函数"
|
|
7298
|
+
}, {
|
|
7299
|
+
name: "SPLIT",
|
|
7300
|
+
description: "将文本根据指定片段分割成数组\n\n示例:`SPLIT(\"a,b,c\", \",\")`\n\n返回 `[\"a\", \"b\", \"c\"]`",
|
|
7301
|
+
example: "SPLIT(text, ',')",
|
|
7302
|
+
params: [{
|
|
7303
|
+
type: "string",
|
|
7304
|
+
name: "text",
|
|
7305
|
+
description: "文本"
|
|
7306
|
+
}, {
|
|
7307
|
+
type: "string",
|
|
7308
|
+
name: "delimiter",
|
|
7309
|
+
description: "文本片段"
|
|
7310
|
+
}],
|
|
7311
|
+
returns: {
|
|
7312
|
+
type: "Array<string>",
|
|
7313
|
+
description: "文本集"
|
|
7314
|
+
},
|
|
7315
|
+
namespace: "文本函数"
|
|
7316
|
+
}, {
|
|
7317
|
+
name: "TRIM",
|
|
7318
|
+
description: "将文本去除前后空格",
|
|
7319
|
+
example: "TRIM(text)",
|
|
7320
|
+
params: [{
|
|
7321
|
+
type: "string",
|
|
7322
|
+
name: "text",
|
|
7323
|
+
description: "文本"
|
|
7324
|
+
}],
|
|
7325
|
+
returns: {
|
|
7326
|
+
type: "string",
|
|
7327
|
+
description: "处理后的文本"
|
|
7328
|
+
},
|
|
7329
|
+
namespace: "文本函数"
|
|
7330
|
+
}, {
|
|
7331
|
+
name: "STRIPTAG",
|
|
7332
|
+
description: "去除文本中的 HTML 标签\n\n示例:`STRIPTAG(\"<b>amis</b>\")`\n\n返回:`amis`",
|
|
7333
|
+
example: "STRIPTAG(text)",
|
|
7334
|
+
params: [{
|
|
7335
|
+
type: "string",
|
|
7336
|
+
name: "text",
|
|
7337
|
+
description: "文本"
|
|
7338
|
+
}],
|
|
7339
|
+
returns: {
|
|
7340
|
+
type: "string",
|
|
7341
|
+
description: "处理后的文本"
|
|
7342
|
+
},
|
|
7343
|
+
namespace: "文本函数"
|
|
7344
|
+
}, {
|
|
7345
|
+
name: "LINEBREAK",
|
|
7346
|
+
description: "将字符串中的换行转成 HTML `<br>`,用于简单换行的场景\n\n示例:`LINEBREAK(\"\\n\")`\n\n返回:`<br/>`",
|
|
7347
|
+
example: "LINEBREAK(text)",
|
|
7348
|
+
params: [{
|
|
7349
|
+
type: "string",
|
|
7350
|
+
name: "text",
|
|
7351
|
+
description: "文本"
|
|
7352
|
+
}],
|
|
7353
|
+
returns: {
|
|
7354
|
+
type: "string",
|
|
7355
|
+
description: "处理后的文本"
|
|
7356
|
+
},
|
|
7357
|
+
namespace: "文本函数"
|
|
7358
|
+
}, {
|
|
7359
|
+
name: "STARTSWITH",
|
|
7360
|
+
description: "判断字符串(text)是否以特定字符串(startString)开始,是则返回 True,否则返回 False",
|
|
7361
|
+
example: "STARTSWITH(text, '片段')",
|
|
7362
|
+
params: [{
|
|
7363
|
+
type: "string",
|
|
7364
|
+
name: "text",
|
|
7365
|
+
description: "文本"
|
|
7366
|
+
}, {
|
|
7367
|
+
type: "string",
|
|
7368
|
+
name: "startString",
|
|
7369
|
+
description: "起始文本"
|
|
7370
|
+
}],
|
|
7371
|
+
returns: {
|
|
7372
|
+
type: "string",
|
|
7373
|
+
description: "判断结果"
|
|
7374
|
+
},
|
|
7375
|
+
namespace: "文本函数"
|
|
7376
|
+
}, {
|
|
7377
|
+
name: "ENDSWITH",
|
|
7378
|
+
description: "判断字符串(text)是否以特定字符串(endString)结束,是则返回 True,否则返回 False",
|
|
7379
|
+
example: "ENDSWITH(text, '片段')",
|
|
7380
|
+
params: [{
|
|
7381
|
+
type: "string",
|
|
7382
|
+
name: "text",
|
|
7383
|
+
description: "文本"
|
|
7384
|
+
}, {
|
|
7385
|
+
type: "string",
|
|
7386
|
+
name: "endString",
|
|
7387
|
+
description: "结束文本"
|
|
7388
|
+
}],
|
|
7389
|
+
returns: {
|
|
7390
|
+
type: "string",
|
|
7391
|
+
description: "判断结果"
|
|
7392
|
+
},
|
|
7393
|
+
namespace: "文本函数"
|
|
7394
|
+
}, {
|
|
7395
|
+
name: "CONTAINS",
|
|
7396
|
+
description: "判断参数 1 中的文本是否包含参数 2 中的文本。",
|
|
7397
|
+
example: "CONTAINS(text, searchText)",
|
|
7398
|
+
params: [{
|
|
7399
|
+
type: "string",
|
|
7400
|
+
name: "text",
|
|
7401
|
+
description: "文本"
|
|
7402
|
+
}, {
|
|
7403
|
+
type: "string",
|
|
7404
|
+
name: "searchText",
|
|
7405
|
+
description: "搜索文本"
|
|
7406
|
+
}],
|
|
7407
|
+
returns: {
|
|
7408
|
+
type: "string",
|
|
7409
|
+
description: "判断结果"
|
|
7410
|
+
},
|
|
7411
|
+
namespace: "文本函数"
|
|
7412
|
+
}, {
|
|
7413
|
+
name: "REPLACE",
|
|
7414
|
+
description: "对文本进行全量替换。",
|
|
7415
|
+
example: "REPLACE(text, search, replace)",
|
|
7416
|
+
params: [{
|
|
7417
|
+
type: "string",
|
|
7418
|
+
name: "text",
|
|
7419
|
+
description: "要处理的文本"
|
|
7420
|
+
}, {
|
|
7421
|
+
type: "string",
|
|
7422
|
+
name: "search",
|
|
7423
|
+
description: "要被替换的文本"
|
|
7424
|
+
}, {
|
|
7425
|
+
type: "string",
|
|
7426
|
+
name: "replace",
|
|
7427
|
+
description: "要替换的文本"
|
|
7428
|
+
}],
|
|
7429
|
+
returns: {
|
|
7430
|
+
type: "string",
|
|
7431
|
+
description: "处理结果"
|
|
7432
|
+
},
|
|
7433
|
+
namespace: "文本函数"
|
|
7434
|
+
}, {
|
|
7435
|
+
name: "SEARCH",
|
|
7436
|
+
description: "对文本进行搜索,返回命中的位置",
|
|
7437
|
+
example: "SEARCH(text, search, 0)",
|
|
7438
|
+
params: [{
|
|
7439
|
+
type: "string",
|
|
7440
|
+
name: "text",
|
|
7441
|
+
description: "要处理的文本"
|
|
7442
|
+
}, {
|
|
7443
|
+
type: "string",
|
|
7444
|
+
name: "search",
|
|
7445
|
+
description: "用来搜索的文本"
|
|
7446
|
+
}, {
|
|
7447
|
+
type: "number",
|
|
7448
|
+
name: "start",
|
|
7449
|
+
description: "起始位置"
|
|
7450
|
+
}],
|
|
7451
|
+
returns: {
|
|
7452
|
+
type: "number",
|
|
7453
|
+
description: "命中的位置"
|
|
7454
|
+
},
|
|
7455
|
+
namespace: "文本函数"
|
|
7456
|
+
}, {
|
|
7457
|
+
name: "MID",
|
|
7458
|
+
description: "返回文本字符串中从指定位置开始的特定数目的字符",
|
|
7459
|
+
example: "MID(text, from, len)",
|
|
7460
|
+
params: [{
|
|
7461
|
+
type: "string",
|
|
7462
|
+
name: "text",
|
|
7463
|
+
description: "要处理的文本"
|
|
7464
|
+
}, {
|
|
7465
|
+
type: "number",
|
|
7466
|
+
name: "from",
|
|
7467
|
+
description: "起始位置"
|
|
7468
|
+
}, {
|
|
7469
|
+
type: "number",
|
|
7470
|
+
name: "len",
|
|
7471
|
+
description: "处理长度"
|
|
7472
|
+
}],
|
|
7473
|
+
returns: {
|
|
7474
|
+
type: "number",
|
|
7475
|
+
description: "命中的位置"
|
|
7476
|
+
},
|
|
7477
|
+
namespace: "文本函数"
|
|
7478
|
+
}, {
|
|
7479
|
+
name: "BASENAME",
|
|
7480
|
+
description: "返回路径中的文件名\n\n示例:`/home/amis/a.json`\n\n返回:a.json`",
|
|
7481
|
+
example: "BASENAME(text)",
|
|
7482
|
+
params: [{
|
|
7483
|
+
type: "string",
|
|
7484
|
+
name: "text",
|
|
7485
|
+
description: "要处理的文本"
|
|
7486
|
+
}],
|
|
7487
|
+
returns: {
|
|
7488
|
+
type: "string",
|
|
7489
|
+
description: "文件名"
|
|
7490
|
+
},
|
|
7491
|
+
namespace: "文本函数"
|
|
7492
|
+
}, {
|
|
7493
|
+
name: "DATE",
|
|
7494
|
+
description: "创建日期对象,可以通过特定格式的字符串,或者数值。\n\n需要注意的是,其中月份的数值是从0开始的,也就是说,\n如果是12月份,你应该传入数值11。",
|
|
7495
|
+
example: "DATE('2021-12-06 08:20:00')",
|
|
7496
|
+
params: [],
|
|
7497
|
+
returns: {
|
|
7498
|
+
type: "Date",
|
|
7499
|
+
description: "日期对象"
|
|
7500
|
+
},
|
|
7501
|
+
namespace: "日期函数"
|
|
7502
|
+
}, {
|
|
7503
|
+
name: "TIMESTAMP",
|
|
7504
|
+
description: "返回时间的时间戳",
|
|
7505
|
+
example: "TIMESTAMP(date, 'x')",
|
|
7506
|
+
params: [{
|
|
7507
|
+
type: "date",
|
|
7508
|
+
name: "date",
|
|
7509
|
+
description: "日期对象"
|
|
7510
|
+
}, {
|
|
7511
|
+
type: "string",
|
|
7512
|
+
name: "format",
|
|
7513
|
+
description: "时间戳格式,带毫秒传入 'x'。默认为 'X' 不带毫秒的。"
|
|
7514
|
+
}],
|
|
7515
|
+
returns: {
|
|
7516
|
+
type: "number",
|
|
7517
|
+
description: "时间戳"
|
|
7518
|
+
},
|
|
7519
|
+
namespace: "日期函数"
|
|
7520
|
+
}, {
|
|
7521
|
+
name: "TODAY",
|
|
7522
|
+
description: "返回今天的日期",
|
|
7523
|
+
example: "TODAY()",
|
|
7524
|
+
params: [],
|
|
7525
|
+
returns: {
|
|
7526
|
+
type: "number",
|
|
7527
|
+
description: "日期"
|
|
7528
|
+
},
|
|
7529
|
+
namespace: "日期函数"
|
|
7530
|
+
}, {
|
|
7531
|
+
name: "NOW",
|
|
7532
|
+
description: "返回现在的日期",
|
|
7533
|
+
example: "NOW()",
|
|
7534
|
+
params: [],
|
|
7535
|
+
returns: {
|
|
7536
|
+
type: "number",
|
|
7537
|
+
description: "日期"
|
|
7538
|
+
},
|
|
7539
|
+
namespace: "日期函数"
|
|
7540
|
+
}, {
|
|
7541
|
+
name: "WEEKDAY",
|
|
7542
|
+
description: "获取日期的星期几,\n\n示例:\n\nWEEKDAY('2023-02-27') 得到 1",
|
|
7543
|
+
example: "WEEKDAY(date)",
|
|
7544
|
+
params: [{
|
|
7545
|
+
type: "any",
|
|
7546
|
+
name: "date",
|
|
7547
|
+
description: "日期"
|
|
7548
|
+
}, {
|
|
7549
|
+
type: "number",
|
|
7550
|
+
name: "type",
|
|
7551
|
+
description: "星期定义类型,默认为1,1表示0至6代表星期一到星期日,2表示1至7代表星期一到星期日"
|
|
7552
|
+
}],
|
|
7553
|
+
returns: {
|
|
7554
|
+
type: "number",
|
|
7555
|
+
description: "星期几的数字标识"
|
|
7556
|
+
},
|
|
7557
|
+
namespace: "日期函数"
|
|
7558
|
+
}, {
|
|
7559
|
+
name: "WEEK",
|
|
7560
|
+
description: "获取年份的星期,即第几周\n\n示例:\n\nWEEK('2023-03-05') 得到 10",
|
|
7561
|
+
example: "WEEK(date)",
|
|
7562
|
+
params: [{
|
|
7563
|
+
type: "any",
|
|
7564
|
+
name: "date",
|
|
7565
|
+
description: "日期"
|
|
7566
|
+
}, {
|
|
7567
|
+
type: "boolean",
|
|
7568
|
+
name: "isISO",
|
|
7569
|
+
description: "是否ISO星期"
|
|
7570
|
+
}],
|
|
7571
|
+
returns: {
|
|
7572
|
+
type: "number",
|
|
7573
|
+
description: "星期几的数字标识"
|
|
7574
|
+
},
|
|
7575
|
+
namespace: "日期函数"
|
|
7576
|
+
}, {
|
|
7577
|
+
name: "DATETOSTR",
|
|
7578
|
+
description: "对日期、日期字符串、时间戳进行格式化\n\n示例:\n\nDATETOSTR('12/25/2022', 'YYYY-MM-DD') 得到 '2022.12.25'\nDATETOSTR(1676563200, 'YYYY.MM.DD') 得到 '2023.02.17'\nDATETOSTR(1676563200000, 'YYYY.MM.DD hh:mm:ss') 得到 '2023.02.17 12:00:00'\nDATETOSTR(DATE('2021-12-21'), 'YYYY.MM.DD hh:mm:ss') 得到 '2021.12.21 08:00:00'",
|
|
7579
|
+
example: "DATETOSTR(date, 'YYYY-MM-DD')",
|
|
7580
|
+
params: [{
|
|
7581
|
+
type: "any",
|
|
7582
|
+
name: "date",
|
|
7583
|
+
description: "日期对象、日期字符串、时间戳"
|
|
7584
|
+
}, {
|
|
7585
|
+
type: "string",
|
|
7586
|
+
name: "format",
|
|
7587
|
+
description: "日期格式,默认为 \"YYYY-MM-DD HH:mm:ss\""
|
|
7588
|
+
}],
|
|
7589
|
+
returns: {
|
|
7590
|
+
type: "string",
|
|
7591
|
+
description: "日期字符串"
|
|
7592
|
+
},
|
|
7593
|
+
namespace: "日期函数"
|
|
7594
|
+
}, {
|
|
7595
|
+
name: "DATERANGESPLIT",
|
|
7596
|
+
description: "获取日期范围字符串中的开始时间、结束时间\n\n示例:\n\nDATERANGESPLIT('1676563200, 1676735999') 得到 [1676563200, 1676735999]\nDATERANGESPLIT('1676563200, 1676735999', undefined , 'YYYY.MM.DD hh:mm:ss') 得到 [2023.02.17 12:00:00, 2023.02.18 11:59:59]\nDATERANGESPLIT('1676563200, 1676735999', 0 , 'YYYY.MM.DD hh:mm:ss') 得到 '2023.02.17 12:00:00'\nDATERANGESPLIT('1676563200, 1676735999', 'start' , 'YYYY.MM.DD hh:mm:ss') 得到 '2023.02.17 12:00:00'\nDATERANGESPLIT('1676563200, 1676735999', 1 , 'YYYY.MM.DD hh:mm:ss') 得到 '2023.02.18 11:59:59'\nDATERANGESPLIT('1676563200, 1676735999', 'end' , 'YYYY.MM.DD hh:mm:ss') 得到 '2023.02.18 11:59:59'",
|
|
7597
|
+
example: "DATERANGESPLIT(date, 'YYYY-MM-DD')",
|
|
7598
|
+
params: [{
|
|
7599
|
+
type: "string",
|
|
7600
|
+
name: "date",
|
|
7601
|
+
description: "日期范围字符串"
|
|
7602
|
+
}, {
|
|
7603
|
+
type: "string",
|
|
7604
|
+
name: "key",
|
|
7605
|
+
description: "取值标识,0或'start'表示获取开始时间,1或'end'表示获取结束时间"
|
|
7606
|
+
}, {
|
|
7607
|
+
type: "string",
|
|
7608
|
+
name: "format",
|
|
7609
|
+
description: "日期格式,可选"
|
|
7610
|
+
}, {
|
|
7611
|
+
type: "string",
|
|
7612
|
+
name: "delimiter",
|
|
7613
|
+
description: "分隔符,可选,默认为','"
|
|
7614
|
+
}],
|
|
7615
|
+
returns: {
|
|
7616
|
+
type: "string",
|
|
7617
|
+
description: "日期字符串"
|
|
7618
|
+
},
|
|
7619
|
+
namespace: "日期函数"
|
|
7620
|
+
}, {
|
|
7621
|
+
name: "STARTOF",
|
|
7622
|
+
description: "返回日期的指定范围的开端",
|
|
7623
|
+
example: "STARTOF(date[unit = \"day\"])",
|
|
7624
|
+
params: [{
|
|
7625
|
+
type: "date",
|
|
7626
|
+
name: "date",
|
|
7627
|
+
description: "日期对象"
|
|
7628
|
+
}, {
|
|
7629
|
+
type: "string",
|
|
7630
|
+
name: "unit",
|
|
7631
|
+
description: "比如可以传入 'day'、'month'、'year' 或者 `week` 等等"
|
|
7632
|
+
}, {
|
|
7633
|
+
type: "string",
|
|
7634
|
+
name: "format",
|
|
7635
|
+
description: "日期格式,可选"
|
|
7636
|
+
}],
|
|
7637
|
+
returns: {
|
|
7638
|
+
type: "date",
|
|
7639
|
+
description: "新的日期对象"
|
|
7640
|
+
},
|
|
7641
|
+
namespace: "日期函数"
|
|
7642
|
+
}, {
|
|
7643
|
+
name: "ENDOF",
|
|
7644
|
+
description: "返回日期的指定范围的末尾",
|
|
7645
|
+
example: "ENDOF(date[unit = \"day\"])",
|
|
7646
|
+
params: [{
|
|
7647
|
+
type: "date",
|
|
7648
|
+
name: "date",
|
|
7649
|
+
description: "日期对象"
|
|
7650
|
+
}, {
|
|
7651
|
+
type: "string",
|
|
7652
|
+
name: "unit",
|
|
7653
|
+
description: "比如可以传入 'day'、'month'、'year' 或者 `week` 等等"
|
|
7654
|
+
}, {
|
|
7655
|
+
type: "string",
|
|
7656
|
+
name: "format",
|
|
7657
|
+
description: "日期格式,可选"
|
|
7658
|
+
}],
|
|
7659
|
+
returns: {
|
|
7660
|
+
type: "date",
|
|
7661
|
+
description: "新的日期对象"
|
|
7662
|
+
},
|
|
7663
|
+
namespace: "日期函数"
|
|
7664
|
+
}, {
|
|
7665
|
+
name: "YEAR",
|
|
7666
|
+
description: "返回日期的年份",
|
|
7667
|
+
example: "YEAR(date)",
|
|
7668
|
+
params: [{
|
|
7669
|
+
type: "date",
|
|
7670
|
+
name: "date",
|
|
7671
|
+
description: "日期对象"
|
|
7672
|
+
}],
|
|
7673
|
+
returns: {
|
|
7674
|
+
type: "number",
|
|
7675
|
+
description: "数值"
|
|
7676
|
+
},
|
|
7677
|
+
namespace: "日期函数"
|
|
7678
|
+
}, {
|
|
7679
|
+
name: "MONTH",
|
|
7680
|
+
description: "返回日期的月份,这里就是自然月份。",
|
|
7681
|
+
example: "MONTH(date)",
|
|
7682
|
+
params: [{
|
|
7683
|
+
type: "date",
|
|
7684
|
+
name: "date",
|
|
7685
|
+
description: "日期对象"
|
|
7686
|
+
}],
|
|
7687
|
+
returns: {
|
|
7688
|
+
type: "number",
|
|
7689
|
+
description: "数值"
|
|
7690
|
+
},
|
|
7691
|
+
namespace: "日期函数"
|
|
7692
|
+
}, {
|
|
7693
|
+
name: "DAY",
|
|
7694
|
+
description: "返回日期的天",
|
|
7695
|
+
example: "DAY(date)",
|
|
7696
|
+
params: [{
|
|
7697
|
+
type: "date",
|
|
7698
|
+
name: "date",
|
|
7699
|
+
description: "日期对象"
|
|
7700
|
+
}],
|
|
7701
|
+
returns: {
|
|
7702
|
+
type: "number",
|
|
7703
|
+
description: "数值"
|
|
7704
|
+
},
|
|
7705
|
+
namespace: "日期函数"
|
|
7706
|
+
}, {
|
|
7707
|
+
name: "HOUR",
|
|
7708
|
+
description: "返回日期的小时",
|
|
7709
|
+
example: "HOUR(date)",
|
|
7710
|
+
params: [{
|
|
7711
|
+
type: "date",
|
|
7712
|
+
name: "date",
|
|
7713
|
+
description: "日期对象"
|
|
7714
|
+
}],
|
|
7715
|
+
returns: {
|
|
7716
|
+
type: "number",
|
|
7717
|
+
description: "数值"
|
|
7718
|
+
},
|
|
7719
|
+
namespace: "日期函数"
|
|
7720
|
+
}, {
|
|
7721
|
+
name: "MINUTE",
|
|
7722
|
+
description: "返回日期的分",
|
|
7723
|
+
example: "MINUTE(date)",
|
|
7724
|
+
params: [{
|
|
7725
|
+
type: "date",
|
|
7726
|
+
name: "date",
|
|
7727
|
+
description: "日期对象"
|
|
7728
|
+
}],
|
|
7729
|
+
returns: {
|
|
7730
|
+
type: "number",
|
|
7731
|
+
description: "数值"
|
|
7732
|
+
},
|
|
7733
|
+
namespace: "日期函数"
|
|
7734
|
+
}, {
|
|
7735
|
+
name: "SECOND",
|
|
7736
|
+
description: "返回日期的秒",
|
|
7737
|
+
example: "SECOND(date)",
|
|
7738
|
+
params: [{
|
|
7739
|
+
type: "date",
|
|
7740
|
+
name: "date",
|
|
7741
|
+
description: "日期对象"
|
|
7742
|
+
}],
|
|
7743
|
+
returns: {
|
|
7744
|
+
type: "number",
|
|
7745
|
+
description: "数值"
|
|
7746
|
+
},
|
|
7747
|
+
namespace: "日期函数"
|
|
7748
|
+
}, {
|
|
7749
|
+
name: "YEARS",
|
|
7750
|
+
description: "返回两个日期相差多少年",
|
|
7751
|
+
example: "YEARS(endDate, startDate)",
|
|
7752
|
+
params: [{
|
|
7753
|
+
type: "date",
|
|
7754
|
+
name: "endDate",
|
|
7755
|
+
description: "日期对象"
|
|
7756
|
+
}, {
|
|
7757
|
+
type: "date",
|
|
7758
|
+
name: "startDate",
|
|
7759
|
+
description: "日期对象"
|
|
7760
|
+
}],
|
|
7761
|
+
returns: {
|
|
7762
|
+
type: "number",
|
|
7763
|
+
description: "数值"
|
|
7764
|
+
},
|
|
7765
|
+
namespace: "日期函数"
|
|
7766
|
+
}, {
|
|
7767
|
+
name: "MINUTES",
|
|
7768
|
+
description: "返回两个日期相差多少分钟",
|
|
7769
|
+
example: "MINUTES(endDate, startDate)",
|
|
7770
|
+
params: [{
|
|
7771
|
+
type: "date",
|
|
7772
|
+
name: "endDate",
|
|
7773
|
+
description: "日期对象"
|
|
7774
|
+
}, {
|
|
7775
|
+
type: "date",
|
|
7776
|
+
name: "startDate",
|
|
7777
|
+
description: "日期对象"
|
|
7778
|
+
}],
|
|
7779
|
+
returns: {
|
|
7780
|
+
type: "number",
|
|
7781
|
+
description: "数值"
|
|
7782
|
+
},
|
|
7783
|
+
namespace: "日期函数"
|
|
7784
|
+
}, {
|
|
7785
|
+
name: "DAYS",
|
|
7786
|
+
description: "返回两个日期相差多少天",
|
|
7787
|
+
example: "DAYS(endDate, startDate)",
|
|
7788
|
+
params: [{
|
|
7789
|
+
type: "date",
|
|
7790
|
+
name: "endDate",
|
|
7791
|
+
description: "日期对象"
|
|
7792
|
+
}, {
|
|
7793
|
+
type: "date",
|
|
7794
|
+
name: "startDate",
|
|
7795
|
+
description: "日期对象"
|
|
7796
|
+
}],
|
|
7797
|
+
returns: {
|
|
7798
|
+
type: "number",
|
|
7799
|
+
description: "数值"
|
|
7800
|
+
},
|
|
7801
|
+
namespace: "日期函数"
|
|
7802
|
+
}, {
|
|
7803
|
+
name: "HOURS",
|
|
7804
|
+
description: "返回两个日期相差多少小时",
|
|
7805
|
+
example: "HOURS(endDate, startDate)",
|
|
7806
|
+
params: [{
|
|
7807
|
+
type: "date",
|
|
7808
|
+
name: "endDate",
|
|
7809
|
+
description: "日期对象"
|
|
7810
|
+
}, {
|
|
7811
|
+
type: "date",
|
|
7812
|
+
name: "startDate",
|
|
7813
|
+
description: "日期对象"
|
|
7814
|
+
}],
|
|
7815
|
+
returns: {
|
|
7816
|
+
type: "number",
|
|
7817
|
+
description: "数值"
|
|
7818
|
+
},
|
|
7819
|
+
namespace: "日期函数"
|
|
7820
|
+
}, {
|
|
7821
|
+
name: "DATEMODIFY",
|
|
7822
|
+
description: "修改日期,对日期进行加减天、月份、年等操作\n\n示例:\n\nDATEMODIFY(A, -2, 'month')\n\n对日期 A 进行往前减2月的操作。",
|
|
7823
|
+
example: "DATEMODIFY(date, 2, 'days')",
|
|
7824
|
+
params: [{
|
|
7825
|
+
type: "date",
|
|
7826
|
+
name: "date",
|
|
7827
|
+
description: "日期对象"
|
|
7828
|
+
}, {
|
|
7829
|
+
type: "number",
|
|
7830
|
+
name: "num",
|
|
7831
|
+
description: "数值"
|
|
7832
|
+
}, {
|
|
7833
|
+
type: "string",
|
|
7834
|
+
name: "unit",
|
|
7835
|
+
description: "单位:支持年、月、天等等"
|
|
7836
|
+
}],
|
|
7837
|
+
returns: {
|
|
7838
|
+
type: "date",
|
|
7839
|
+
description: "日期对象"
|
|
7840
|
+
},
|
|
7841
|
+
namespace: "日期函数"
|
|
7842
|
+
}, {
|
|
7843
|
+
name: "STRTODATE",
|
|
7844
|
+
description: "将字符日期转成日期对象,可以指定日期格式。\n\n示例:STRTODATE('2021/12/6', 'YYYY/MM/DD')",
|
|
7845
|
+
example: "STRTODATE(value[, format=\"\"])",
|
|
7846
|
+
params: [{
|
|
7847
|
+
type: "string",
|
|
7848
|
+
name: "value",
|
|
7849
|
+
description: "日期字符"
|
|
7850
|
+
}, {
|
|
7851
|
+
type: "string",
|
|
7852
|
+
name: "format",
|
|
7853
|
+
description: "日期格式"
|
|
7854
|
+
}],
|
|
7855
|
+
returns: {
|
|
7856
|
+
type: "date",
|
|
7857
|
+
description: "日期对象"
|
|
7858
|
+
},
|
|
7859
|
+
namespace: "日期函数"
|
|
7860
|
+
}, {
|
|
7861
|
+
name: "ISBEFORE",
|
|
7862
|
+
description: "判断两个日期,是否第一个日期在第二个日期的前面",
|
|
7863
|
+
example: "ISBEFORE(a, b)",
|
|
7864
|
+
params: [{
|
|
7865
|
+
type: "date",
|
|
7866
|
+
name: "a",
|
|
7867
|
+
description: "第一个日期"
|
|
7868
|
+
}, {
|
|
7869
|
+
type: "date",
|
|
7870
|
+
name: "b",
|
|
7871
|
+
description: "第二个日期"
|
|
7872
|
+
}, {
|
|
7873
|
+
type: "string",
|
|
7874
|
+
name: "unit",
|
|
7875
|
+
description: "单位,默认是 'day', 即之比较到天"
|
|
7876
|
+
}],
|
|
7877
|
+
returns: {
|
|
7878
|
+
type: "boolean",
|
|
7879
|
+
description: "判断结果"
|
|
7880
|
+
},
|
|
7881
|
+
namespace: "日期函数"
|
|
7882
|
+
}, {
|
|
7883
|
+
name: "ISAFTER",
|
|
7884
|
+
description: "判断两个日期,是否第一个日期在第二个日期的后面",
|
|
7885
|
+
example: "ISAFTER(a, b)",
|
|
7886
|
+
params: [{
|
|
7887
|
+
type: "date",
|
|
7888
|
+
name: "a",
|
|
7889
|
+
description: "第一个日期"
|
|
7890
|
+
}, {
|
|
7891
|
+
type: "date",
|
|
7892
|
+
name: "b",
|
|
7893
|
+
description: "第二个日期"
|
|
7894
|
+
}, {
|
|
7895
|
+
type: "string",
|
|
7896
|
+
name: "unit",
|
|
7897
|
+
description: "单位,默认是 'day', 即之比较到天"
|
|
7898
|
+
}],
|
|
7899
|
+
returns: {
|
|
7900
|
+
type: "boolean",
|
|
7901
|
+
description: "判断结果"
|
|
7902
|
+
},
|
|
7903
|
+
namespace: "日期函数"
|
|
7904
|
+
}, {
|
|
7905
|
+
name: "BETWEENRANGE",
|
|
7906
|
+
description: "判断日期是否在指定范围内\n\n示例:BETWEENRANGE('2021/12/6', ['2021/12/5','2021/12/7'])",
|
|
7907
|
+
example: "BETWEENRANGE(date, [start, end])",
|
|
7908
|
+
params: [{
|
|
7909
|
+
type: "any",
|
|
7910
|
+
name: "date",
|
|
7911
|
+
description: "第一个日期"
|
|
7912
|
+
}, {
|
|
7913
|
+
type: "Array<any>",
|
|
7914
|
+
name: "daterange",
|
|
7915
|
+
description: "日期范围"
|
|
7916
|
+
}, {
|
|
7917
|
+
type: "string",
|
|
7918
|
+
name: "unit",
|
|
7919
|
+
description: "单位,默认是 'day', 即之比较到天"
|
|
7920
|
+
}, {
|
|
7921
|
+
type: "string",
|
|
7922
|
+
name: "inclusivity",
|
|
7923
|
+
description: "包容性规则,默认为'[]'。[ 表示包含、( 表示排除,如果使用包容性参数,则必须传入两个指示符,如'()'表示左右范围都排除"
|
|
7924
|
+
}],
|
|
7925
|
+
returns: {
|
|
7926
|
+
type: "boolean",
|
|
7927
|
+
description: "判断结果"
|
|
7928
|
+
},
|
|
7929
|
+
namespace: "日期函数"
|
|
7930
|
+
}, {
|
|
7931
|
+
name: "ISSAMEORBEFORE",
|
|
7932
|
+
description: "判断两个日期,是否第一个日期在第二个日期的前面或者相等",
|
|
7933
|
+
example: "ISSAMEORBEFORE(a, b)",
|
|
7934
|
+
params: [{
|
|
7935
|
+
type: "date",
|
|
7936
|
+
name: "a",
|
|
7937
|
+
description: "第一个日期"
|
|
7938
|
+
}, {
|
|
7939
|
+
type: "date",
|
|
7940
|
+
name: "b",
|
|
7941
|
+
description: "第二个日期"
|
|
7942
|
+
}, {
|
|
7943
|
+
type: "string",
|
|
7944
|
+
name: "unit",
|
|
7945
|
+
description: "单位,默认是 'day', 即之比较到天"
|
|
7946
|
+
}],
|
|
7947
|
+
returns: {
|
|
7948
|
+
type: "boolean",
|
|
7949
|
+
description: "判断结果"
|
|
7950
|
+
},
|
|
7951
|
+
namespace: "日期函数"
|
|
7952
|
+
}, {
|
|
7953
|
+
name: "ISSAMEORAFTER",
|
|
7954
|
+
description: "判断两个日期,是否第一个日期在第二个日期的后面或者相等",
|
|
7955
|
+
example: "ISSAMEORAFTER(a, b)",
|
|
7956
|
+
params: [{
|
|
7957
|
+
type: "date",
|
|
7958
|
+
name: "a",
|
|
7959
|
+
description: "第一个日期"
|
|
7960
|
+
}, {
|
|
7961
|
+
type: "date",
|
|
7962
|
+
name: "b",
|
|
7963
|
+
description: "第二个日期"
|
|
7964
|
+
}, {
|
|
7965
|
+
type: "string",
|
|
7966
|
+
name: "unit",
|
|
7967
|
+
description: "单位,默认是 'day', 即之比较到天"
|
|
7968
|
+
}],
|
|
7969
|
+
returns: {
|
|
7970
|
+
type: "boolean",
|
|
7971
|
+
description: "判断结果"
|
|
7972
|
+
},
|
|
7973
|
+
namespace: "日期函数"
|
|
7974
|
+
}, {
|
|
7975
|
+
name: "COUNT",
|
|
7976
|
+
description: "返回数组的长度",
|
|
7977
|
+
example: "COUNT(arr)",
|
|
7978
|
+
params: [{
|
|
7979
|
+
type: "Array<any>",
|
|
7980
|
+
name: "arr",
|
|
7981
|
+
description: "数组"
|
|
7982
|
+
}],
|
|
7983
|
+
returns: {
|
|
7984
|
+
type: "boolean",
|
|
7985
|
+
description: "结果"
|
|
7986
|
+
},
|
|
7987
|
+
namespace: "数组"
|
|
7988
|
+
}, {
|
|
7989
|
+
name: "ARRAYMAP",
|
|
7990
|
+
description: "数组做数据转换,需要搭配箭头函数一起使用,注意箭头函数只支持单表达式用法。",
|
|
7991
|
+
example: "ARRAYMAP(arr, item => item)",
|
|
7992
|
+
params: [{
|
|
7993
|
+
type: "Array<any>",
|
|
7994
|
+
name: "arr",
|
|
7995
|
+
description: "数组"
|
|
7996
|
+
}, {
|
|
7997
|
+
type: "Array<any>",
|
|
7998
|
+
name: "iterator",
|
|
7999
|
+
description: "箭头函数"
|
|
8000
|
+
}],
|
|
8001
|
+
returns: {
|
|
8002
|
+
type: "boolean",
|
|
8003
|
+
description: "结果"
|
|
8004
|
+
},
|
|
8005
|
+
namespace: "数组"
|
|
8006
|
+
}, {
|
|
8007
|
+
name: "ARRAYFILTER",
|
|
8008
|
+
description: "数据做数据过滤,需要搭配箭头函数一起使用,注意箭头函数只支持单表达式用法。\n将第二个箭头函数返回为 false 的成员过滤掉。",
|
|
8009
|
+
example: "ARRAYFILTER(arr, item => item)",
|
|
8010
|
+
params: [{
|
|
8011
|
+
type: "Array<any>",
|
|
8012
|
+
name: "arr",
|
|
8013
|
+
description: "数组"
|
|
8014
|
+
}, {
|
|
8015
|
+
type: "Array<any>",
|
|
8016
|
+
name: "iterator",
|
|
8017
|
+
description: "箭头函数"
|
|
8018
|
+
}],
|
|
8019
|
+
returns: {
|
|
8020
|
+
type: "boolean",
|
|
8021
|
+
description: "结果"
|
|
8022
|
+
},
|
|
8023
|
+
namespace: "数组"
|
|
8024
|
+
}, {
|
|
8025
|
+
name: "ARRAYFINDINDEX",
|
|
8026
|
+
description: "数据做数据查找,需要搭配箭头函数一起使用,注意箭头函数只支持单表达式用法。\n找出第二个箭头函数返回为 true 的成员的索引。\n\n示例:\n\nARRAYFINDINDEX([0, 2, false], item => item === 2) 得到 1",
|
|
8027
|
+
example: "ARRAYFINDINDEX(arr, item => item === 2)",
|
|
8028
|
+
params: [{
|
|
8029
|
+
type: "Array<any>",
|
|
8030
|
+
name: "arr",
|
|
8031
|
+
description: "数组"
|
|
8032
|
+
}, {
|
|
8033
|
+
type: "Array<any>",
|
|
8034
|
+
name: "iterator",
|
|
8035
|
+
description: "箭头函数"
|
|
8036
|
+
}],
|
|
8037
|
+
returns: {
|
|
8038
|
+
type: "number",
|
|
8039
|
+
description: "结果"
|
|
8040
|
+
},
|
|
8041
|
+
namespace: "数组"
|
|
8042
|
+
}, {
|
|
8043
|
+
name: "ARRAYFIND",
|
|
8044
|
+
description: "数据做数据查找,需要搭配箭头函数一起使用,注意箭头函数只支持单表达式用法。\n找出第二个箭头函数返回为 true 的成员。\n\n示例:\n\nARRAYFIND([0, 2, false], item => item === 2) 得到 2",
|
|
8045
|
+
example: "ARRAYFIND(arr, item => item === 2)",
|
|
8046
|
+
params: [{
|
|
8047
|
+
type: "Array<any>",
|
|
8048
|
+
name: "arr",
|
|
8049
|
+
description: "数组"
|
|
8050
|
+
}, {
|
|
8051
|
+
type: "Array<any>",
|
|
8052
|
+
name: "iterator",
|
|
8053
|
+
description: "箭头函数"
|
|
8054
|
+
}],
|
|
8055
|
+
returns: {
|
|
8056
|
+
type: "any",
|
|
8057
|
+
description: "结果"
|
|
8058
|
+
},
|
|
8059
|
+
namespace: "数组"
|
|
8060
|
+
}, {
|
|
8061
|
+
name: "ARRAYSOME",
|
|
8062
|
+
description: "数据做数据遍历判断,需要搭配箭头函数一起使用,注意箭头函数只支持单表达式用法。\n判断第二个箭头函数是否存在返回为 true 的成员。\n\n示例:\n\nARRAYSOME([0, 2, false], item => item === 2) 得到 true",
|
|
8063
|
+
example: "ARRAYSOME(arr, item => item === 2)",
|
|
8064
|
+
params: [{
|
|
8065
|
+
type: "Array<any>",
|
|
8066
|
+
name: "arr",
|
|
8067
|
+
description: "数组"
|
|
8068
|
+
}, {
|
|
8069
|
+
type: "Array<any>",
|
|
8070
|
+
name: "iterator",
|
|
8071
|
+
description: "箭头函数"
|
|
8072
|
+
}],
|
|
8073
|
+
returns: {
|
|
8074
|
+
type: "boolean",
|
|
8075
|
+
description: "结果"
|
|
8076
|
+
},
|
|
8077
|
+
namespace: "数组"
|
|
8078
|
+
}, {
|
|
8079
|
+
name: "ARRAYEVERY",
|
|
8080
|
+
description: "数据做数据遍历判断,需要搭配箭头函数一起使用,注意箭头函数只支持单表达式用法。\n判断第二个箭头函数返回是否都为 true。\n\n示例:\n\nARRAYEVERY([0, 2, false], item => item === 2) 得到 false",
|
|
8081
|
+
example: "ARRAYEVERY(arr, item => item === 2)",
|
|
8082
|
+
params: [{
|
|
8083
|
+
type: "Array<any>",
|
|
8084
|
+
name: "arr",
|
|
8085
|
+
description: "数组"
|
|
8086
|
+
}, {
|
|
8087
|
+
type: "Array<any>",
|
|
8088
|
+
name: "iterator",
|
|
8089
|
+
description: "箭头函数"
|
|
8090
|
+
}],
|
|
8091
|
+
returns: {
|
|
8092
|
+
type: "boolean",
|
|
8093
|
+
description: "结果"
|
|
8094
|
+
},
|
|
8095
|
+
namespace: "数组"
|
|
8096
|
+
}, {
|
|
8097
|
+
name: "ARRAYINCLUDES",
|
|
8098
|
+
description: "判断数据中是否存在指定元素\n\n示例:\n\nARRAYINCLUDES([0, 2, false], 2) 得到 true",
|
|
8099
|
+
example: "ARRAYINCLUDES(arr, 2)",
|
|
8100
|
+
params: [{
|
|
8101
|
+
type: "Array<any>",
|
|
8102
|
+
name: "arr",
|
|
8103
|
+
description: "数组"
|
|
8104
|
+
}, {
|
|
8105
|
+
type: "any",
|
|
8106
|
+
name: "item",
|
|
8107
|
+
description: "元素"
|
|
8108
|
+
}],
|
|
8109
|
+
returns: {
|
|
8110
|
+
type: "any",
|
|
8111
|
+
description: "结果"
|
|
8112
|
+
},
|
|
8113
|
+
namespace: "数组"
|
|
8114
|
+
}, {
|
|
8115
|
+
name: "COMPACT",
|
|
8116
|
+
description: "数组过滤掉 false、null、0 和 \"\"\n\n示例:\n\nCOMPACT([0, 1, false, 2, '', 3]) 得到 [1, 2, 3]",
|
|
8117
|
+
example: "COMPACT(arr)",
|
|
8118
|
+
params: [{
|
|
8119
|
+
type: "Array<any>",
|
|
8120
|
+
name: "arr",
|
|
8121
|
+
description: "数组"
|
|
8122
|
+
}],
|
|
8123
|
+
returns: {
|
|
8124
|
+
type: "Array<any>",
|
|
8125
|
+
description: "结果"
|
|
8126
|
+
},
|
|
8127
|
+
namespace: "数组"
|
|
8128
|
+
}, {
|
|
8129
|
+
name: "JOIN",
|
|
8130
|
+
description: "数组转成字符串\n\n示例:\n\nJOIN(['a', 'b', 'c'], '=') 得到 'a=b=c'",
|
|
8131
|
+
example: "JOIN(arr, string)",
|
|
8132
|
+
params: [{
|
|
8133
|
+
type: "Array<any>",
|
|
8134
|
+
name: "arr",
|
|
8135
|
+
description: "数组"
|
|
8136
|
+
}, {
|
|
8137
|
+
type: "String",
|
|
8138
|
+
name: "separator",
|
|
8139
|
+
description: "分隔符"
|
|
8140
|
+
}],
|
|
8141
|
+
returns: {
|
|
8142
|
+
type: "String",
|
|
8143
|
+
description: "结果"
|
|
8144
|
+
},
|
|
8145
|
+
namespace: "数组"
|
|
8146
|
+
}, {
|
|
8147
|
+
name: "CONCAT",
|
|
8148
|
+
description: "数组合并\n\n示例:\n\nCONCAT(['a', 'b', 'c'], ['1'], ['3']) 得到 ['a', 'b', 'c', '1', '3']",
|
|
8149
|
+
example: "CONCAT(['a', 'b', 'c'], ['1'], ['3'])",
|
|
8150
|
+
params: [{
|
|
8151
|
+
type: "Array<any>",
|
|
8152
|
+
name: "arr",
|
|
8153
|
+
description: "数组"
|
|
8154
|
+
}],
|
|
8155
|
+
returns: {
|
|
8156
|
+
type: "Array<any>",
|
|
8157
|
+
description: "结果"
|
|
8158
|
+
},
|
|
8159
|
+
namespace: "数组"
|
|
8160
|
+
}, {
|
|
8161
|
+
name: "UNIQ",
|
|
8162
|
+
description: "数组去重,第二个参数「field」,可指定根据该字段去重\n\n示例:\n\nUNIQ([{a: '1'}, {b: '2'}, {a: '1'}], 'id')",
|
|
8163
|
+
example: "UNIQ([{a: '1'}, {b: '2'}, {a: '1'}], 'x')",
|
|
8164
|
+
params: [{
|
|
8165
|
+
type: "Array<any>",
|
|
8166
|
+
name: "arr",
|
|
8167
|
+
description: "数组"
|
|
8168
|
+
}, {
|
|
8169
|
+
type: "string",
|
|
8170
|
+
name: "field",
|
|
8171
|
+
description: "字段"
|
|
8172
|
+
}],
|
|
8173
|
+
returns: {
|
|
8174
|
+
type: "Array<any>",
|
|
8175
|
+
description: "结果"
|
|
8176
|
+
},
|
|
8177
|
+
namespace: "数组"
|
|
8178
|
+
}, {
|
|
8179
|
+
name: "ENCODEJSON",
|
|
8180
|
+
description: "将JS对象转换成JSON字符串\n\n示例:\n\nENCODEJSON({name: 'amis'}) 得到 '{\"name\":\"amis\"}'",
|
|
8181
|
+
example: "ENCODEJSON({name: 'amis'})",
|
|
8182
|
+
params: [{
|
|
8183
|
+
type: "object",
|
|
8184
|
+
name: "obj",
|
|
8185
|
+
description: "JS对象"
|
|
8186
|
+
}],
|
|
8187
|
+
returns: {
|
|
8188
|
+
type: "string",
|
|
8189
|
+
description: "结果"
|
|
8190
|
+
},
|
|
8191
|
+
namespace: "编码"
|
|
8192
|
+
}, {
|
|
8193
|
+
name: "DECODEJSON",
|
|
8194
|
+
description: "解析JSON编码数据,返回JS对象\n\n示例:\n\nDECODEJSON('{\\\"name\\\": \"amis\"}') 得到 {name: 'amis'}",
|
|
8195
|
+
example: "DECODEJSON('{\\\"name\\\": \"amis\"}')",
|
|
8196
|
+
params: [{
|
|
8197
|
+
type: "string",
|
|
8198
|
+
name: "str",
|
|
8199
|
+
description: "字符串"
|
|
8200
|
+
}],
|
|
8201
|
+
returns: {
|
|
8202
|
+
type: "object",
|
|
8203
|
+
description: "结果"
|
|
8204
|
+
},
|
|
8205
|
+
namespace: "编码"
|
|
8206
|
+
}, {
|
|
8207
|
+
name: "GET",
|
|
8208
|
+
description: "根据对象或者数组的path路径获取值。 如果解析 value 是 undefined 会以 defaultValue 取代\n\n示例:\n\nGET([0, 2, {name: 'amis', age: 18}], 1) 得到 2\nGET([0, 2, {name: 'amis', age: 18}], '2.name') 得到 'amis'\nGET({arr: [{name: 'amis', age: 18}]}, 'arr[0].name') 得到 'amis'\nGET({arr: [{name: 'amis', age: 18}]}, 'arr.0.name') 得到 'amis'\nGET({arr: [{name: 'amis', age: 18}]}, 'arr.1.name', 'not-found') 得到 'not-found'",
|
|
8209
|
+
example: "GET(arr, 2)",
|
|
8210
|
+
params: [{
|
|
8211
|
+
type: "any",
|
|
8212
|
+
name: "obj",
|
|
8213
|
+
description: "对象或数组"
|
|
8214
|
+
}, {
|
|
8215
|
+
type: "string",
|
|
8216
|
+
name: "path",
|
|
8217
|
+
description: "路径"
|
|
8218
|
+
}, {
|
|
8219
|
+
type: "any",
|
|
8220
|
+
name: "defaultValue",
|
|
8221
|
+
description: "如果解析不到则返回该值"
|
|
8222
|
+
}],
|
|
8223
|
+
returns: {
|
|
8224
|
+
type: "any",
|
|
8225
|
+
description: "结果"
|
|
8226
|
+
},
|
|
8227
|
+
namespace: "其他"
|
|
8228
|
+
}, {
|
|
8229
|
+
name: "ISTYPE",
|
|
8230
|
+
description: "判断是否为类型支持:string, number, array, date, plain-object。",
|
|
8231
|
+
example: "ISTYPE([{a: '1'}, {b: '2'}, {a: '1'}], 'array')",
|
|
8232
|
+
params: [{
|
|
8233
|
+
type: "string",
|
|
8234
|
+
name: "判断对象",
|
|
8235
|
+
description: null
|
|
8236
|
+
}],
|
|
8237
|
+
returns: {
|
|
8238
|
+
type: "boolean",
|
|
8239
|
+
description: "结果"
|
|
8240
|
+
},
|
|
8241
|
+
namespace: "其他"
|
|
8242
|
+
}]);
|
|
8243
|
+
// EXTERNAL MODULE: external "element-ui/lib/message"
|
|
8244
|
+
var message_ = __webpack_require__(56);
|
|
8245
|
+
var message_default = /*#__PURE__*/__webpack_require__.n(message_);
|
|
8246
|
+
|
|
8247
|
+
// CONCATENATED MODULE: ./src/components/formula/src/index.js
|
|
8248
|
+
|
|
8249
|
+
|
|
8250
|
+
|
|
8251
|
+
|
|
8252
|
+
|
|
8253
|
+
|
|
8254
|
+
|
|
8255
|
+
|
|
8256
|
+
|
|
8257
|
+
/* harmony default export */ var formula_src = ({
|
|
8258
|
+
name: "Formula",
|
|
8259
|
+
componentName: "Formula",
|
|
8260
|
+
components: {
|
|
8261
|
+
CodeMirrorEditor: codeMirror,
|
|
8262
|
+
FuncList: funcList,
|
|
8263
|
+
VariableList: variableList
|
|
8264
|
+
},
|
|
8265
|
+
props: {
|
|
8266
|
+
value: String,
|
|
8267
|
+
evalMode: {
|
|
8268
|
+
type: Boolean,
|
|
8269
|
+
default: function _default() {
|
|
8270
|
+
return true;
|
|
8271
|
+
}
|
|
8272
|
+
},
|
|
8273
|
+
/**
|
|
8274
|
+
* 变量展现模式,可选值:'tabs' | 'tree'
|
|
8275
|
+
*/
|
|
8276
|
+
variableMode: {
|
|
8277
|
+
type: String,
|
|
8278
|
+
default: "tabs"
|
|
8279
|
+
},
|
|
8280
|
+
functions: Array,
|
|
8281
|
+
variables: Array,
|
|
8282
|
+
functionClassName: String,
|
|
8283
|
+
variableClassName: String,
|
|
8284
|
+
/**
|
|
8285
|
+
* 当前输入项字段 name: 用于避免循环绑定自身导致无限渲染
|
|
8286
|
+
*/
|
|
8287
|
+
selfVariableName: String
|
|
8288
|
+
},
|
|
8289
|
+
data: function data() {
|
|
8290
|
+
return {
|
|
8291
|
+
focused: false,
|
|
8292
|
+
editorPlugin: null
|
|
8293
|
+
};
|
|
8294
|
+
},
|
|
8295
|
+
computed: {
|
|
8296
|
+
functionList: function functionList() {
|
|
8297
|
+
var funcs = [];
|
|
8298
|
+
doc.forEach(function (item) {
|
|
8299
|
+
var namespace = item.namespace || 'Others';
|
|
8300
|
+
var exists = funcs.find(function (item) {
|
|
8301
|
+
return item.groupName === namespace;
|
|
8302
|
+
});
|
|
8303
|
+
if (!exists) {
|
|
8304
|
+
exists = {
|
|
8305
|
+
groupName: namespace,
|
|
8306
|
+
items: []
|
|
8307
|
+
};
|
|
8308
|
+
funcs.push(exists);
|
|
8309
|
+
}
|
|
8310
|
+
exists.items.push(item);
|
|
8311
|
+
});
|
|
8312
|
+
var customFunctions = Array.isArray(this.functions) ? this.functions : [];
|
|
8313
|
+
return [].concat(funcs, customFunctions);
|
|
8314
|
+
}
|
|
8315
|
+
},
|
|
8316
|
+
methods: {
|
|
8317
|
+
editorFactory: function editorFactory(dom, cm) {
|
|
8318
|
+
return plugin_editorFactory(dom, cm, this.$props);
|
|
8319
|
+
},
|
|
8320
|
+
handleEditorMounted: function handleEditorMounted(cm, editor) {
|
|
8321
|
+
var _this = this;
|
|
8322
|
+
this.editorPlugin = new FormulaPlugin(editor, cm, function () {
|
|
8323
|
+
return _this.$props;
|
|
8324
|
+
});
|
|
8325
|
+
},
|
|
8326
|
+
// type:'variable' | 'func'
|
|
8327
|
+
insertValue: function insertValue(value, type) {
|
|
8328
|
+
if (!this.editorPlugin) {
|
|
8329
|
+
return;
|
|
8330
|
+
}
|
|
8331
|
+
this.editorPlugin.insertContent(value, type);
|
|
8332
|
+
},
|
|
8333
|
+
handleFunctionSelect: function handleFunctionSelect(item) {
|
|
8334
|
+
if (!this.editorPlugin) {
|
|
8335
|
+
return;
|
|
8336
|
+
}
|
|
8337
|
+
this.editorPlugin.insertContent("" + item.name, 'func');
|
|
8338
|
+
},
|
|
8339
|
+
handleVariableSelect: function handleVariableSelect(item) {
|
|
8340
|
+
var _this$$props = this.$props,
|
|
8341
|
+
evalMode = _this$$props.evalMode,
|
|
8342
|
+
selfVariableName = _this$$props.selfVariableName;
|
|
8343
|
+
if (!(item.value && this.editorPlugin)) {
|
|
8344
|
+
return;
|
|
8345
|
+
}
|
|
8346
|
+
if (selfVariableName && selfVariableName === item.value) {
|
|
8347
|
+
message_default.a.warning("\u4E0D\u80FD\u4F7F\u7528\u5F53\u524D\u53D8\u91CF[" + selfVariableName + "]\uFF0C\u907F\u514D\u5FAA\u73AF\u5F15\u7528\u3002");
|
|
8348
|
+
return;
|
|
8349
|
+
}
|
|
8350
|
+
this.editorPlugin.insertContent({
|
|
8351
|
+
key: item.value,
|
|
8352
|
+
name: item.label
|
|
8353
|
+
}, 'variable');
|
|
8354
|
+
},
|
|
8355
|
+
handleChange: function handleChange(value) {
|
|
8356
|
+
this.$emit("change", value);
|
|
8357
|
+
},
|
|
8358
|
+
handleFocus: function handleFocus() {
|
|
8359
|
+
this.focused = true;
|
|
8360
|
+
},
|
|
8361
|
+
handleBlur: function handleBlur() {
|
|
8362
|
+
this.focused = false;
|
|
8363
|
+
},
|
|
8364
|
+
handleValClick: function handleValClick() {
|
|
8365
|
+
this.handleVariableSelect({
|
|
8366
|
+
value: "name",
|
|
8367
|
+
label: "名称"
|
|
8368
|
+
});
|
|
8369
|
+
}
|
|
8370
|
+
},
|
|
8371
|
+
beforeDestroy: function beforeDestroy() {
|
|
8372
|
+
this.editorPlugin && this.editorPlugin.dispose();
|
|
8373
|
+
},
|
|
8374
|
+
render: function render(h) {
|
|
8375
|
+
var mirrorParam = {
|
|
8376
|
+
attrs: Object.assign({
|
|
8377
|
+
className: "FormulaEditor-editor",
|
|
8378
|
+
value: this.value,
|
|
8379
|
+
editorFactory: this.editorFactory,
|
|
8380
|
+
editorDidMount: this.handleEditorMounted
|
|
8381
|
+
}, this.$attrs),
|
|
8382
|
+
on: Object.assign({
|
|
8383
|
+
change: this.handleChange,
|
|
8384
|
+
focus: this.handleFocus,
|
|
8385
|
+
blur: this.handleBlur
|
|
8386
|
+
}, this.$listeners),
|
|
8387
|
+
slots: this.$slots,
|
|
8388
|
+
scopedSlots: this.$scopedSlots
|
|
8389
|
+
};
|
|
8390
|
+
return h("div", {
|
|
8391
|
+
"class": ["FormulaEditor", {
|
|
8392
|
+
"is-focused": this.focused
|
|
8393
|
+
}]
|
|
8394
|
+
}, [h("section", {
|
|
8395
|
+
"class": ["FormulaEditor-content"]
|
|
8396
|
+
}, [h("header", {
|
|
8397
|
+
"class": "FormulaEditor-header"
|
|
8398
|
+
}, ["\u8868\u8FBE\u5F0F"]), h(codeMirror, babel_helper_vue_jsx_merge_props_default()([{}, mirrorParam]))]), h("section", {
|
|
8399
|
+
"class": "FormulaEditor-settings"
|
|
8400
|
+
}, [h("div", {
|
|
8401
|
+
"class": "FormulaEditor-panel"
|
|
8402
|
+
}, [this.variableMode !== 'tabs' ? h("div", {
|
|
8403
|
+
"class": "FormulaEditor-panel-header"
|
|
8404
|
+
}, ["\u53D8\u91CF"]) : null, h("div", {
|
|
8405
|
+
"class": ["FormulaEditor-panel-body", this.variableMode && "FormulaEditor-panel-body--" + this.variableMode]
|
|
8406
|
+
}, [h(variableList, babel_helper_vue_jsx_merge_props_default()([{
|
|
8407
|
+
"class": ["FormulaEditor-VariableList", "FormulaEditor-VariableList-root", this.variableClassName],
|
|
8408
|
+
"attrs": {
|
|
8409
|
+
"classPrefix": this.classPrefix,
|
|
8410
|
+
"selectMode": this.variableMode,
|
|
8411
|
+
"selfVariableName": this.selfVariableName,
|
|
8412
|
+
"data": this.variables
|
|
8413
|
+
}
|
|
8414
|
+
}, {
|
|
8415
|
+
"on": {
|
|
8416
|
+
select: this.handleVariableSelect
|
|
8417
|
+
}
|
|
8418
|
+
}]))])]), h(funcList, babel_helper_vue_jsx_merge_props_default()([{
|
|
8419
|
+
"attrs": {
|
|
8420
|
+
"className": this.functionClassName,
|
|
8421
|
+
"data": this.functionList
|
|
8422
|
+
}
|
|
8423
|
+
}, {
|
|
8424
|
+
"on": {
|
|
8425
|
+
select: this.handleFunctionSelect
|
|
8426
|
+
}
|
|
8427
|
+
}]))])]);
|
|
8428
|
+
}
|
|
8429
|
+
});
|
|
8430
|
+
// CONCATENATED MODULE: ./src/components/formula/index.js
|
|
8431
|
+
|
|
8432
|
+
/* istanbul ignore next */
|
|
8433
|
+
formula_src.install = function (Vue) {
|
|
8434
|
+
Vue.component(formula_src.name, formula_src);
|
|
8435
|
+
};
|
|
8436
|
+
/* harmony default export */ var formula = (formula_src);
|
|
8437
|
+
// CONCATENATED MODULE: ./src/index.js
|
|
8438
|
+
|
|
8439
|
+
|
|
5639
8440
|
|
|
5640
8441
|
|
|
5641
8442
|
|
|
@@ -5649,7 +8450,7 @@ crud_src.install = function (Vue) {
|
|
|
5649
8450
|
|
|
5650
8451
|
|
|
5651
8452
|
|
|
5652
|
-
var components = [components_form, components_form_input, components_form_item, form_group, form_dialog, form_view, form_view_group, form_view_dialog, components_table, components_table_column, table_search, table_editable, crud];
|
|
8453
|
+
var components = [components_form, components_form_input, components_form_item, form_group, form_dialog, form_view, form_view_group, form_view_dialog, components_table, components_table_column, table_search, table_editable, crud, formula, dialog];
|
|
5653
8454
|
var install = function install(Vue, opts) {
|
|
5654
8455
|
if (opts === void 0) {
|
|
5655
8456
|
opts = {};
|
|
@@ -5682,7 +8483,9 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
5682
8483
|
TableColumn: components_table_column,
|
|
5683
8484
|
TableSearch: table_search,
|
|
5684
8485
|
TableEditable: table_editable,
|
|
5685
|
-
Crud: crud
|
|
8486
|
+
Crud: crud,
|
|
8487
|
+
Formula: formula,
|
|
8488
|
+
Dialog: dialog
|
|
5686
8489
|
});
|
|
5687
8490
|
|
|
5688
8491
|
/***/ })
|